Modular PHP Design

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
qgriffith
Forum Newbie
Posts: 1
Joined: Sat Jan 21, 2006 4:30 pm

Modular PHP Design

Post by qgriffith »

Hello everyone. I am working on an idea for a piece of software that will have two versions, a light version and a full version. Both versions will be based off of the same "core" of the code base. The only difference being that the light version does not have as many modules as the full version. I am trying to figure out how to properly write the core of the application with PHP5 (and maybe Smarty or Wasp) that will allow me include modules. I have never writing an application that allows you to have modules. Does anyone have any suggestions on how to do that, or links to how-tos that may help guide me down the right path. One idea that may work would be to have all the modules in a database table with flags set to 0 for active and 1 for non-active. Then have the application do a query on the table and load the include files for the active modules. That to me does not seem like the idea plan though and could cause issues later on down the road with speed. Any help is appreciated. Thanks so much for your timee.
stuffradio
Forum Newbie
Posts: 14
Joined: Tue Jan 03, 2006 2:33 am

Post by stuffradio »

Well... what are you planning to accomplish with the modular script? And what will the modules be doing? You could do that in the database, that's what most people do, or maybe you can write some dynamic modules or using fwrite() you can make modules in a file or multiple files. Whatever suits your fancy.
Post Reply