Exemplo n.º 1
0
 public static function initialize()
 {
     OSCOM::loadConfig();
     if (strlen(DB_SERVER) < 1) {
         osc_redirect(OSCOM::getLink('Setup'));
     }
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('Database', Database::initialize());
     $Qcfg = Registry::get('Database')->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
     $Qcfg->setCache('configuration');
     $Qcfg->execute();
     while ($Qcfg->next()) {
         define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
     }
     $Qcfg->freeResult();
     Registry::set('Session', Session::load('adminSid'));
     Registry::get('Session')->start();
     Registry::get('MessageStack')->loadFromSession();
     Registry::set('Language', new Language());
     if (!self::hasAccess(OSCOM::getSiteApplication())) {
         Registry::get('MessageStack')->add('header', 'No access.', 'error');
         osc_redirect_admin(OSCOM::getLink(null, 'Index'));
     }
     $application = 'osCommerce\\OM\\Core\\Site\\Admin\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::set('Template', new Template());
     Registry::get('Template')->setApplication(Registry::get('Application'));
     // HPDL move following checks elsewhere
     // check if a default currency is set
     if (!defined('DEFAULT_CURRENCY')) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_error_no_default_currency'), 'error');
     }
     // check if a default language is set
     if (!defined('DEFAULT_LANGUAGE')) {
         Registry::get('MessageStack')->add('header', ERROR_NO_DEFAULT_LANGUAGE_DEFINED, 'error');
     }
     if (function_exists('ini_get') && (bool) ini_get('file_uploads') == false) {
         Registry::get('MessageStack')->add('header', OSCOM::getDef('ms_warning_uploads_disabled'), 'warning');
     }
 }
Exemplo n.º 2
0
 public static function initialize()
 {
     OSCOM::loadConfig();
     if (strlen(DB_SERVER) < 1) {
         osc_redirect(OSCOM::getLink('Setup'));
     }
     Registry::set('MessageStack', new MessageStack());
     Registry::set('Cache', new Cache());
     Registry::set('Database', Database::initialize());
     $Qcfg = Registry::get('Database')->query('select configuration_key as cfgKey, configuration_value as cfgValue from :table_configuration');
     $Qcfg->setCache('configuration');
     $Qcfg->execute();
     while ($Qcfg->next()) {
         define($Qcfg->value('cfgKey'), $Qcfg->value('cfgValue'));
     }
     $Qcfg->freeResult();
     Registry::set('Service', new Service());
     Registry::get('Service')->start();
     Registry::set('Template', new Template());
     $application = 'osCommerce\\OM\\Core\\Site\\Shop\\Application\\' . OSCOM::getSiteApplication() . '\\Controller';
     Registry::set('Application', new $application());
     Registry::get('Template')->setApplication(Registry::get('Application'));
 }