[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slightly OT: Programming with Modules



Although I'm not a PHP programmer myself, I might be able to give you an high-level overview of how everything fits together:

First, you will have a main application that provides some functions that do various things.  These functions will somehow be exposed through an API - the API can be thought of as a definition of the rules that other developers will use to create extensions to your program.   A good API will allow a developer to easily "hook" his or her functions into the main application to change how it operates or add a new feature.  The separate chunks of code that will modify the main application can be called modules, plugins, or extensions; it's really up to the particular program or API you're working with.

Are you writing your own application from scratch?  I would include some example code, but I don't trust how reliable my PHP skills are - I'm a C/C++/Python guy myself.  If you know any other languages and are interested in some examples to help you understand how it works, drop me a message off-list and I'll be glad to help out a fellow programmer.

On 2/17/07, Mark Thurman <met1204@charter.net> wrote:
I'm a young programmer (just finishing high school) who has done a fair
amount of programming with PHP, MySQL, and other web technologies.
However, being self trained, I was wondering if the members could help
me with some questions.  I am looking at projects such as PHPNuke,
Wikipedia, phpBB2, etc and they all have modules, extensions etc.

How does one go about designing a program so it can be extended later
with plugins, apis, and modules?

For example, in Wikipedia, to add a "Special" page, you include that
page's source code in the main file, and then voila, it appears in
lists, links, and adds its own functions and links to the code?  How
does one think and design a program so that functionality is possible?

I've tried reading source code from some of these projects and I never
can just follow along myself.  Therefore, if anyone has some simple code
they'd be willing to share, links to only books or howtos, or just
personal experiences, please reply on or off list.  If I haven't made
myself clear, please ask for clarification.

Thanks for your help,
Mark


-
To unsubscribe, send email to majordomo@silug.org with
"unsubscribe silug-discuss" in the body.