/** * Returns only instance of AutoloadHelper * @static * @return object */ public static function getInstance() { if (self::$instance == NULL) { self::$instance = new AutoloadHelper(); } return self::$instance; }
<?php error_reporting(E_ALL); define('SYSTEM_ROOT', realpath(dirname(__FILE__) . '/../')); require_once SYSTEM_ROOT . '/classes/smarty/Smarty.class.php'; require_once SYSTEM_ROOT . '/classes/AutoloadHelper.class.php'; require_once SYSTEM_ROOT . '/install/ConfigurationChecks.class.php'; if (file_exists(SYSTEM_ROOT . '/system/config.php')) { require_once SYSTEM_ROOT . '/system/config.php'; } else { header('Location: install.php'); exit; } $autoload = AutoloadHelper::getInstance(); $autoload->addPattern('Form.%s.class.php'); $autoload->addDirectory(SYSTEM_ROOT . '/classes', SYSTEM_ROOT . '/classes/form'); spl_autoload_register(array($autoload, 'invoke')); final class Upgrade { public static function run($action = '') { $smarty = new Smarty(); $smarty->muteExpectedErrors(); $smarty->setCacheDir(SYSTEM_ROOT . '/classes/smarty/cache/'); $smarty->setCompileDir(SYSTEM_ROOT . '/classes/smarty/templates_c/'); $smarty->setTemplateDir(SYSTEM_ROOT . '/upgrade/view/'); $smarty->caching = Smarty::CACHING_OFF; $smarty->force_compile = true; $smarty->assign('title', 'Upgrade'); switch ($action) { case 'success':