Current location: Hot Scripts Forums » Programming Languages » PHP » XML Config vs. Dynamic Loading


XML Config vs. Dynamic Loading

Reply
  #1 (permalink)  
Old 09-12-05, 09:45 PM
Trevor's Avatar
Trevor Trevor is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Denver, Colorado
Posts: 120
Thanks: 0
Thanked 0 Times in 0 Posts
XML Config vs. Dynamic Loading

Hola DevHeads!

In my CMS, I currently employ the practice of dynamically loading class files from a "lib" directory when a specific feature is requested. For example, when a user requests the "news engine", the core of my engine runs through the [root]/ext/news/lib folder looking for all user.classname.php files. It then includes all class files prior to execution. While I do try to keep the number of files to a minimum, there are instances when a lib(rary) may contain up to 15 or more class files. The reason I adopted this approach was to be able to "drop-and-load" new features on the fly without changing any core files. It also allows me to add new enhancements pretty easily.

Now that I have made my CMS XML aware, I am starting to wonder if the auto-generation and subsequent parsing of an XML file (with class pointers) is not a better method to employ. For example, when I add a new module I can set-up an install system where I pass the parameter of "install=true" to signal to an extension the need to create a config file for itself. If I update the extension at a later time, I can pass "reload=true". And naturally "unistall=true". All from an admin protected interface of course.

So... what do *you* think would be faster by way of performance, the dynamic loading of a target directory or the parsing of an XML file? In the end, both approaches utilize the time-consuming "include" directive.

Thoughts?

Cheers,
Trevor
__________________
The Universe Our God, Nature Our Temple, Love And Duty Our Religion, Knowledge Our Happiness And Consolation, Death The Dissolution Of The Ego, And The Return To Eternity.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Xml / Dom / Css Mark_SC.SE JavaScript 0 06-29-05 08:05 AM
xml problem plz help me EvilDeveloper PHP 0 05-10-05 11:53 PM
2 flash websites for sale metamorph General Advertisements 5 01-09-05 10:03 PM
importing xml to phpnuke block larryflynt PHP 0 10-22-04 03:59 PM
javascripting and XML Christoff JavaScript 1 06-23-04 05:44 AM


All times are GMT -5. The time now is 06:12 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.