<?php if(IN_MANAGER_MODE == ’true’) { header(’Content-type:text/xml’); ?>
<?xml version="1.0"?>
...
<?php } ?>
Using the above would mean that third party apps would:
1) have to include an XML parser to parse the config file or include the MODx API to do such
2) they would have to define IN_MANAGER_MODE before the can include such a file
On the issue of language support... It has been discussed within the forums about setting up something like a dictionary object or similar that you can use to load your language files. This means that the database would store the words and their transulations and the system would create cache files based on the section/category to which they apply.
Users could then do something like this:
$modx->dic->setLanguage(’en’);
$modx->dic->loadLanguage(’home_page’);
or
$modx->dic->setLanguage(’fr’);
$modx->dic->loadLanguage(array(’home_page’,’menu-bar’));
You could then use the language just like you normally would
echo $_lang[’welcom_msg’];
IMO these cache files should not be stored as xml files. XML is good but it takes a longer time to be parsed that would a normal php file. Now I could be wrong but from what I’ve seen by using DOMIT Lite it took something like 0.1 secs to parser a file that had only a few elements. Compared to a simple php file such as:
$_lang[’welcome_msg’]=’Welcome to your content manager’;
XML is good but at times it might not be the most efficient solution.
Why am I against using XML? It due to speed. Currently the Etomite parser due to it’s integrated nature is capable of rendering a page within .1 seconds on the fly while it can render cache pages within the .02 range. The MODx parses lags behind it a little due the overhead created by including the API as a separate file. I’ve since made a few changes in a test version of modx to get speeds of up to .019 seconds for cached files. The goal is to be able to crunch out speeds of something like .005 seconds or less.
With that said I could be very wrong but I’ll just wait and see.