protected function execute(InputInterface $input, OutputInterface $output) { if (parent::execute($input, $output)) { if (!$input->getOption("catalog")) { chdir('admin'); } foreach ($input->getArgument("args") as $arg) { $pair = explode("=", $arg); if (count($pair) === 2) { if ($input->getOption("post")) { $_POST[$pair[0]] = $pair[1]; } else { $_GET[$pair[0]] = $pair[1]; } } } ob_start(); require_once $this->getOCDirectory() . DIRECTORY_SEPARATOR . "index.php"; ob_end_clean(); $registry->set('is_cli', true); $this->registry = $registry; $controller = new \Front($registry); $controller->dispatch(new \Action($input->getArgument("route")), new \Action('error/not_found')); } }
public function dispatch() { // Front Controller $controller = new Front($this->registry); // Router if (isset($this->request->get['route'])) { $action = new Action($this->request->get['route']); } else { $action = new Action($this->_route); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); $this->trigger->fire('post.app.dispatch'); }
// Currency $registry->set('currency', new Currency($registry)); // Tax $registry->set('tax', new Tax($registry)); // Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // Cart $registry->set('cart', new Cart($registry)); // Encryption $registry->set('encryption', new Encryption($config->get('config_encryption'))); // Event $event = new Event($registry); $registry->set('event', $event); $query = $db->query("SELECT * FROM " . DB_PREFIX . "event"); foreach ($query->rows as $result) { $event->register($result['trigger'], $result['action']); } // Front Controller $controller = new Front($registry); // Maintenance Mode $controller->addPreAction(new Action('common/maintenance')); // SEO URL's $controller->addPreAction(new Action('common/seo_url')); // Router $action = new Action('payment/alipay_guarantee/callback'); // Dispatch $controller->dispatch($action, new Action('error/not_found')); // Output $response->output();
$request = new Request(); $registry->set('request', $request); //config $config = new Config(); $registry->set('config', $config); //detect lang $languages = array('en' => 'english', 'de' => 'deutsch', 'fr' => 'france'); $session->data['install_lang'] = 'en'; if (isset($session->data['install_lang']) && array_key_exists($session->data['install_lang'], $languages)) { $code = $session->data['install_lang']; } elseif (isset($request->cookie['install_lang']) && array_key_exists($request->cookie['install_lang'], $languages)) { $code = $request->cookie['install_lang']; } if (!isset($session->data['install_lang']) || $session->data['install_lang'] != $code) { $session->data['install_lang'] = $code; } if (!isset($request->cookie['install_lang']) || $request->cookie['install_lang'] != $code) { setcookie('install_lang', $code, time() + 60 * 60 * 24 * 30, '/', $request->server['HTTP_HOST']); } $config->set('config_lang', $languages[$code]); //lang $registry->set('lang', new Lang($languages[$code])); //front $front = new Front($registry); if (isset($request->get['url'])) { $action = new action($request->get['url']); } else { $action = new action('home/index'); } $front->dispatch($action, new action('error/index')); $response->output();
if (isset($request->get['route'])) { $action = new Router($request->get['route']); } else { $action = new Router('search/search'); } if (ENABLE_SAAS == 1) { $query = $db->query("UPDATE " . TABLE_ONLINE . " SET last_activity=? WHERE username=? AND ipaddr=?", array(NOW, $session->get('email'), $_SERVER['REMOTE_ADDR'])); if ($db->countAffected() == 0) { $query = $db->query("INSERT INTO " . TABLE_ONLINE . " (username, ts, last_activity, ipaddr) VALUES(?,?,?,?)", array($session->get('email'), NOW, NOW, $_SERVER['REMOTE_ADDR'])); } } } else { if (ENABLE_GOOGLE_LOGIN == 1 && isset($request->get['route']) && $request->get['route'] == 'login/google') { $action = new Router('login/google'); } else { if (ENABLE_SSO_LOGIN == 1) { if (isset($request->get['route']) && $request->get['route'] == 'login/login') { $action = new Router('login/login'); } else { header("Location: " . SITE_URL . 'sso.php'); exit; } } else { $action = new Router('login/login'); } } } } $controller = new Front(); $controller->dispatch($action, new Router('common/not_found'));
$registry->set('request', new Request()); // Response $response = new Response(); $response->addHeader('Content-Type: text/html; charset=utf-8'); $registry->set('response', $response); // Session $session = new Session(); $session->start(); $registry->set('session', $session); // Cache $registry->set('cache', new Cache('file')); // Url $registry->set('url', new Url($_SERVER['HTTP_HOST'])); // Event $registry->set('event', new Event($registry)); // Language $registry->set('language', new Language('en-gb')); // Document $registry->set('document', new Document()); // Front Controller $controller = new Front($registry); // Pre Action if ($config->has('config_pre_action')) { foreach ($config->get('config_pre_action') as $action) { $controller->addPreAction(new Action($action)); } } // Dispatch $controller->dispatch(new Action('action/route'), new Action('error/not_found')); // Output $response->output();
// Language Autoload if ($config->has('language_autoload')) { foreach ($config->get('language_autoload') as $value) { $loader->language($value); } } // Library Autoload if ($config->has('library_autoload')) { foreach ($config->get('library_autoload') as $value) { $loader->library($value); } } // Model Autoload if ($config->has('model_autoload')) { foreach ($config->get('model_autoload') as $value) { $loader->model($value); } } // Front Controller $controller = new Front($registry); // Pre Actions if ($config->has('action_pre_action')) { foreach ($config->get('action_pre_action') as $value) { $controller->addPreAction(new Action($value)); } } // Dispatch $controller->dispatch(new Action($config->get('action_router')), new Action($config->get('action_error'))); // Output $response->setCompression($config->get('config_compression')); $response->output();
public function dispatch() { # B/C start global $registry; $registry = $this->registry; global $config; $config = $this->registry->get('config'); global $db; $db = $this->registry->get('db'); global $log; $log = $this->registry->get('log'); global $loader; $loader = $this->registry->get('load'); # B/C end // Front Controller $controller = new Front($this->registry); // Maintenance Mode $controller->addPreAction(new Action('common/maintenance')); // Router if (isset($this->request->get['route'])) { $action = new Action($this->request->get['route']); } else { $action = new Action('common/home'); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); // Set the page cache if enabled $this->pagecache->setPage($this->response); $this->trigger->fire('post.app.dispatch'); }
public function dispatch() { # B/C start global $registry; $registry = $this->registry; global $config; $config = $this->registry->get('config'); global $db; $db = $this->registry->get('db'); global $log; $log = $this->registry->get('log'); # B/C end if (!$this->canAccessAdmin()) { $catalog = Client::isAdmin() ? HTTPS_CATALOG : HTTPS_SERVER; $this->response->redirect($catalog); } // Front Controller $controller = new Front($this->registry); // Login $controller->addPreAction(new Action('common/login/check')); // Permission $controller->addPreAction(new Action('error/permission/check')); // Router if (isset($this->request->get['route'])) { $action = new Action($this->request->get['route']); } else { $action = new Action('common/dashboard'); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); $this->trigger->fire('post.app.dispatch'); }
$registry->set('currency', new Currency($registry)); // Tax $registry->set('tax', new Tax($registry)); // Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // Cart $registry->set('cart', new Cart($registry)); //OpenBay Pro $registry->set('openbay', new Openbay($registry)); // Encryption $registry->set('encryption', new Encryption($config->get('config_encryption'))); // Front Controller $controller = new Front($registry); // Maintenance Mode $controller->addPreAction(new Action('common/maintenance')); // SEO URL's $controller->addPreAction(new Action('common/seo_url')); // Router if (isset($request->get['route'])) { $action = new Action($request->get['route']); } else { //$action = new Action('common/home'); $action = new Action('cosplay/main'); } // Dispatch //$controller->dispatch($action, new Action('error/not_found')); $controller->dispatch($action, new Action('error/404')); // Output $response->output();
$config = new Config(); $config->load('message'); $registry->set('config', $config); foreach ($_config as $key => $value) { $config->set($key, $value); } // Database $db = new \Siiwi\Api\DB(DB_DRIVER, DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_DATABASE); $registry->set('db', $db); // Request $request = new \Siiwi\Api\Request(); $registry->set('request', $request); // Response $response = new \Siiwi\Api\Response(); $response->addHeader('Access-Control-Allow-Origin: *'); $response->addHeader('Content-Type: application/json; charset=utf-8'); $response->setCompression($config->get('config_compression')); $response->setMessage($config->get('api')); $response->setRequest($request->get['route']); $registry->set('response', $response); // Front Controller $controller = new Front($registry); // Signature $controller->addPreAction(new Action('signature/verify')); // Router $route = isset($request->get['route']) ? $request->get['route'] : 'common/error'; $action = new Action($route); // Dispatch $controller->dispatch($action, new Action('common/error')); // Output $response->output();
$detect = $value['code']; break 2; } } } } } $language = $detect ? $detect : $config->get('config_language'); } if (!$request->cookie['language']) { setcookie('language', $language, time() + 60 * 60 * 24 * 30, $config->get('config_app_path'), $request->server['HTTP_HOST']); $request->cookie['language'] = $language; } $config->set('language_list', $language_list); $config->set('language_id', $language_list[$language]['language_id']); // Lang $lang = new Language($language_list[$language]['directory']); $lang->load($language_list[$language]['directory']); $registry->set('language', $lang); // Front Controller $controller = new Front($registry); // Router if (isset($request->get['route'])) { $action = new Action($request->get['route']); } else { $action = new Action('home/home'); } // Dispatch $controller->dispatch($action, new Action('home/home')); // Output $response->output();
public function dispatch() { # B/C start global $registry; $registry = $this->registry; global $config; $config = $this->registry->get('config'); global $db; $db = $this->registry->get('db'); global $log; $log = $this->registry->get('log'); # B/C end // Front Controller $controller = new Front($this->registry); // Login $controller->addPreAction(new Action('common/login/check')); // Permission $controller->addPreAction(new Action('error/permission/check')); // Router if (isset($this->request->get['route'])) { $action = new Action($this->request->get['route']); } else { $action = new Action('common/dashboard'); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); $this->trigger->fire('post.app.dispatch'); }
// Url Registry::set('url', new Url()); // Document Registry::set('document', new Document()); // Language $language = new Language($config->get('config_admin_language')); Registry::set('language', $language); // Currency Registry::set('currency', new Currency()); // Weight Registry::set('weight', new Weight()); // Measurement Registry::set('measurement', new Measurement()); // User Registry::set('user', new User()); // Front Controller $controller = new Front(); // Login $controller->addPreAction(new Router('common/login/check')); // Permission $controller->addPreAction(new Router('common/permission/check')); // Router if (isset($request->get['route'])) { $action = new Router($request->get['route']); } else { $action = new Router('common/home'); } // Dispatch $controller->dispatch($action, new Router('error/not_found')); // Output $response->output();
$config->set('config_language_id', $languages[$config->get('config_admin_language')]['language_id']); $language = new Language($languages[$config->get('config_admin_language')]['directory']); $language->load($languages[$config->get('config_admin_language')]['filename']); $registry->set('language', $language); // Currency $currency = new Currency($registry); // always RU $currency->set('RUB'); //$symbol_right = trim($currency->getSymbolRight('RUB')); //$currency->setSymbolRight('RUB', '<span class="ru"> Б</span>'); $registry->set('currency', $currency); // Tax $registry->set('tax', new Tax($registry)); // Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // Cart $registry->set('cart', new Cart($registry)); // Front Controller $controller = new Front($registry); //require_once(DIR_APPLICATION . 'controller/feed/yandex_yml.php'); //$controller = new ControllerFeedYandexYml($registry); // SEO URL's if (!($seo_type = $config->get('config_seo_url_type'))) { $seo_type = 'seo_url'; } $controller->addPreAction(new Action('common/' . $seo_type)); $action = new Action('feed/yandex_yml3/savetofile', array(dirname(__FILE__) . '/yandex_yml3.xml')); $controller->dispatch($action, ''); //$controller->saveToFile(dirname(__FILE__).'/yandex_yml.xml');
$registry->set('session', $session); // Language if (empty($session->data['language'])) { $session->data['language'] = 'nl'; } if (!empty($request->get['language'])) { $language = preg_replace('~[^a-z]~', '', strtolower($request->get['language'])); if (file_exists(DIR_LANGUAGE . $language . '.php')) { $session->data['language'] = $language; } } include_once DIR_LANGUAGE . $session->data['language'] . '.php'; foreach ($language as $key => $translation) { $config->set('LANG_' . strtoupper($key), $translation); } // Front Controller $controller = new Front($registry); // Router if (isset($request->get['route'])) { $action = new Sumo\Action($request->get['route']); } else { if (isset($request->get['_route_'])) { $action = new Sumo\Action($request->get['_route_']); } else { $action = new Sumo\Action('step_1'); } } // Dispatch $controller->dispatch($action, new Sumo\Action('step_1')); // Output $response->output();