2

I am trying to write a joomla type system in PHP to improve my coding/programming skills

i need guidelines/rules of thumb to do that.

what i basically want to do is create a index.php file which will act as a front controller and will redirect to the request transparently to "extensions/plugins" (no need for them to follow MVC and hence it will be more flexible)

what are your recommendations on that?

EDIT i meant i am trying to create it using CORE PHP (no frameworks), but existing libraries are acceptable

5
  • Look at the Zend Framework
    – KM.
    Commented Jun 10, 2011 at 15:45
  • thanks for the answer KM01 but i need to make a system similar to Joomla using core PHP (not an existing code)
    – Shaheer
    Commented Jun 10, 2011 at 15:49
  • 1
    +1 Good learning exercise. Start at the hardest (scariest?) first, then watch the rest fall into place...
    – tylermac
    Commented Jun 10, 2011 at 19:20
  • thanks! this is my proffered way of learning. Do it once do the solid! :p
    – Shaheer
    Commented Jun 10, 2011 at 19:52
  • i meant preferred, i cant edit the comment now
    – Shaheer
    Commented Jun 10, 2011 at 20:00

2 Answers 2

2

I would have given the same answer as KM01, if it wasn't for your update. However, seeing you want to create this from scratch, I would recommend the following (and I won't give any code examples, since you really need to figure the details out on your own):

a) Create rewrite rules that direct all page requests to the index page and provide the rest of the URL as parameters.
b) Use the magic functions in PHP to write autoloaders for modules and extensions, either as directly referenced in the URL (in that case each element of the URL would correspond to a module or extension) or as resolved by an overarching parameter/URL parser.

I would still recommend that you actually have a look at the code structure of the Zend Framework, but if you are not an experienced PHP coder, you will probably struggle to grasp the concepts, as the framework is quite large and in parts very abstract.

8
  • exactly! i believe it will be hard for me to understand the code structure of the zend framework as per your recommendation about the autoloaders, how about having a config.php file which will contain the supported extensions or extensions in use of the system, this way it will be reusable...?
    – Shaheer
    Commented Jun 10, 2011 at 16:16
  • 1
    Don't put this in a config.php. You want the library of modules and extensions to be configurable on the fly, i.e. no code changes. That's why you need to go right now and read up about magic PHP functions, especially the _autoload() function.
    – wolfgangsz
    Commented Jun 10, 2011 at 16:29
  • i didn't think about that (on the fly thing) but will it affect the performance ? and i do know about magic function (a little)
    – Shaheer
    Commented Jun 10, 2011 at 16:33
  • @wolfgangsz This strikes me as being better to have a look at Codeigniter rather than Zend, what do you think?
    – yannisl
    Commented Jun 10, 2011 at 18:51
  • I am not familiar with Codeigniter, so I can't really comment on that.
    – wolfgangsz
    Commented Jun 10, 2011 at 19:38
2

If you're looking for scalability as in the ability to process many requests, you'll actually need to go beyond the scope of PHP and learn about caching, multiple webservers / clustering, load balancing, clustered database systems, load testing and that kinda stuff.

1
  • great suggestion !!!!
    – Shaheer
    Commented Jun 13, 2011 at 13:43

Not the answer you're looking for? Browse other questions tagged or ask your own question.