Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

qwerty2k

macrumors regular
Original poster
Dec 27, 2007
157
5
Hi,

Basically i want to create a module system for a php web app i am creating but not entirely sure the best way to do it.

what i *think* i want to do is have a skeletal core 'program' that loads modules and then add the actual programs functionality through modules that can interact with each other.

now has anyone ever done anything similar or can anyone point me in the right direction of any articles etc that discuss this type of thing and offer some solutions/directions as to what may be best to achieve this.

Thanks,

Scott
 
Hi,

Basically i want to create a module system for a php web app i am creating but not entirely sure the best way to do it.

what i *think* i want to do is have a skeletal core 'program' that loads modules and then add the actual programs functionality through modules that can interact with each other.

now has anyone ever done anything similar or can anyone point me in the right direction of any articles etc that discuss this type of thing and offer some solutions/directions as to what may be best to achieve this.

Thanks,

Scott

Sounds like you want to look into creating Pear modules. http://pear.php.net/
 
hi, thank you for your prompt response. i am using this as much as a learning experience as anything else and would very much like to create my own system so if you have any ideas about where i could find articles/help which discuss pro's/con's of certain ways etc i would be very grateful.
 
@OP:

Aside from Pear, which is a framework and distribution system for reusable PHP components (how to install Pear packages), normally PHP modules are called extensions, i.e. they are statically compiled into the PHP core (enabled in the php.ini file), i.e. filename.so (shared object file). These .so files can also be dynamically loaded at runtime using the dl() method so long as the shared object file is in /libexec.

Is that what you meant by extensions ----- shared object files?

OOP programming and classes is a common way to create portable code that can be extended (as child classes), btw.

-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.