/** * method to run after an install/update/discover method * * @param string $type - the type * @param object $parent - the parent object * * @return void */ public function postflight($type, $parent) { $path = $parent->getParent()->getPath('source'); $this->status = new stdClass(); $dbInstaller = new CompojoomDatabaseInstaller(array('dbinstaller_directory' => $path . '/administrator/components/com_cmc/sql/xml')); $dbInstaller->updateSchema(); // Let us install the modules $this->status->plugins = $this->installer->installPlugins($this->installationQueue['plugins']); $this->status->modules = $this->installer->installModules($this->installationQueue['modules']); $this->status->libraries = $this->installer->installLibraries($this->installationQueue['libraries']); $this->status->cb = false; if (JFile::exists(JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php')) { global $_CB_framework; require_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php'; require_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.class.php'; require_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/comprofiler.class.php'; require_once JPATH_ADMINISTRATOR . '/components/com_comprofiler/library/cb/cb.installer.php'; foreach ($this->installationQueue['cbplugins'] as $plugin) { $cbInstaller = new cbInstallerPlugin(); if ($cbInstaller->install($path . '/components/com_comprofiler/plugin/user/' . $plugin . '/')) { $langPath = $parent->getParent()->getPath('source') . '/components/com_comprofiler/plugin/user/' . $plugin . '/administrator/language'; $cbNames = explode('_', $plugin); if (JFolder::exists($langPath)) { $languages = JFolder::folders($langPath); foreach ($languages as $language) { if (JFolder::exists(JPATH_ROOT . '/administrator/language/' . $language)) { JFile::copy($langPath . '/' . $language . '/' . $language . '.plg_' . $cbNames[1] . '.ini', JPATH_ROOT . '/administrator/language/' . $language . '/' . $language . '.plg_' . $cbNames[1] . '.ini'); } } } $this->status->cb = true; } } } echo $this->displayInfoInstallation(); }
/** * Checks the database for missing / outdated tables and installs or * updates the database using the SQL xml file if necessary. * * @return void */ public function checkAndFixDatabase() { $dbInstaller = new CompojoomDatabaseInstaller(array('dbinstaller_directory' => JPATH_ADMINISTRATOR . '/components/' . $this->component . '/sql/xml')); $dbInstaller->updateSchema(); }