zikula-modules/Multisites

Fix and improve updating of core and extensions

Opened this issue · 1 comments

This issue is for brainstorming.

  • Function for updating the db schema for a certain module (Doctrine updateSchema)
  • Function for updating the models/templates/sqldumps. Templates must be handled in a better way for this, e.g. by managing them in dedicated databases, too. So templates are just complete installations which are not used yet. Then normal update methods could be applied there easier than having to merge sql dumps.

Variant 1

  • a file called upgrader.php contains the list of modules and additionally required sql commands
  • one creates a text file with a list of all affected sites, whereby each line contains a URL like http://..../site/upgrader.php.
  • one creates a shell script calling the addresses, e.g. every 2 minutes
  • if only a certain module is updated then only this module is refered to in the upgrader.php file.
    foreach ($newmods as $newmod) {
        ZLanguage::bindModuleDomain($newmod['name']);
        ModUtil::apiFunc('Extensions', 'admin', 'upgrade', array('id' => $newmod['id']));
    }

Variant 2

  • List of databases
  • Required sql statements
  • Multiply and execute

Notes

SELECT table_schema FROM information_schema.tables
WHERE table_name = 'some_module_table';

Related code of version 1.0 is stored in Resources/future/ManageUpdates_oldCode.zip for reference.