/** * Entry point for Finder CLI script * * @return void * * @since 2.5 */ public function execute() { // import library dependencies //jimport('joomla.application.component.helper'); //$installer = JComponentHelper::getComponent('com_installer'); require_once JPATH_ADMINISTRATOR . '/components/com_installer/controller.php'; //jimport('joomla.application.component.installer'); // fool the system into thinking we are running as JSite with Finder as the active component JFactory::getApplication('site'); $_SERVER['HTTP_HOST'] = 'domain.com'; define('JPATH_COMPONENT_ADMINISTRATOR', JPATH_ADMINISTRATOR . '/components/com_installer'); define('JPATH_COMPONENT', JPATH_BASE . '/administrator/components/com_installer'); // Disable caching. $config = JFactory::getConfig(); $config->set('caching', 0); $config->set('cache_handler', 'file'); // Import the installer plugins. JPluginHelper::importPlugin('installer'); $updater = new InstallerController(); // APS. Fix DB echo "\nFixing database...\n"; $model = $updater->getModel('database'); $model->fix(); echo "Done\n"; }