IMO it's time to actually begin with the development of CMSimple_XH 1.6. In the last few weeks I've refactored and restructured the code in an own branch on SourceForge. I've added no new features and tried to stay fully compatible with CMSimple_XH 1.5.5. Now I want to present a snapshot of the current state, so interested developers and users can have a look at it, and test, if it works with existing plugins. If so, and if you agree with the changes, we can use this as base for CMSimple_XH 1.6.
The most important changes:
- I merged the pluginloader (including page_data, the stylesheets and the help icons) to the core. IMO it doesn't make sense to keep it separated, as it isn't meant to be exchangable with alternative pluginloaders. The benefits: 2 CSS files less, and the possibility to restructure the code (e.g. saving of the content now happens together, after the plugins were loaded; formerly pagedata.php was saved, then the plugins were loaded, and only then content.htm was saved); the few pluginloader language strings are now editable under Settings->Language.
- I restructured the PHP code files, so that the only file that contains global code is cms.php (+ search.php and mailform.php). All functions were moved to functions.php, tplfuncs.php and adminfuncs.php (the latter file is only included in admin mode). All classes are now in cmsimple/classes/.
- I refactored the handling of config and text forms for the core and the plugins. The display and saving is now handled by a class hierarchy in cmsimple/classes/FileEdit.php. This greatly reduced the required code, which basically was duplicated in adm.php and pluginloader/index.php; in addition this file is only included, if it is actually required. Additional benefits: both the core and the plugin config etc. now have identical look and feel; it should be easy to introduce any "typed" config (some basics are already in place); it's easy to extend the class hierarchy for special needs of plugins.
- I refactored the link check to the class LinkCheck. This way the code has to be loaded only, when actually necessary, and can be improved and maintained more easily.
- I refactored out several parts of the code to new functions, most notably XH_plugins(), which scans the plugins/ folder and caches the results (formerly the plugins/ folder was scanned up to 6 times for a single request!). XH_writeFile() might be interesting for plugin developers, as it's basically a file_put_contents(), which is not available in PHP 4.
- I started to document the code in cms.php according to the PEAR coding standards. You can use PHPDocumentor to produce the documentation (there's still much work required, though, to have a complete documentation).
- I added a folder javascript in the root folder, which for now only contains a single file with a single function, but of course this might change.
- I removed $cf[folder][plugins] and $cf[file][functions]
- I removed quite some global variables, which are most likely not needed by any plugin, and did only clutter the global namespace.
Build of r376.
I'm looking forward to any kind of feedback.
Christoph