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'); }
public function init() { $crit = new CDbCriteria(); $crit->condition = $this->post . ' = :post AND region_id = :region_id'; $crit->params = array(':post' => 1, ':region_id' => $this->region_id); $this->model = Front::model()->findAll($crit); }
public function init() { $crit = new CDbCriteria(); $crit->condition = 'on_front = :on_front'; $crit->params = array(':on_front' => 1); $this->model = Front::model()->findAll($crit); }
public function __construct() { parent::__construct(); if (config_item('require_login')) { \CI::Login()->isLoggedIn('checkout'); } $this->customer = \CI::Login()->customer(); }
/** * The starting point of every application call. If you are only * using the framework you can rename this function to whatever you * like. * */ function front() { $class = Front::i(); if (func_num_args() == 0) { return $class; } $args = func_get_args(); return $class->__invoke($args); }
public function __construct() { // ob_start();//解决setcookie Cannot modify header information - headers already sent by header("Content-type:text/html;charset=utf-8"); header("Cache-Control: no-cache, must-revalidate"); //HTTP 1.1 header("Pragma: no-cache"); //HTTP 1.0 // header("Cache-Control: max-age=3600"); parent::__construct(); // header(("Last-Modified:" . gmdate("D,d M Y H:i:s") . "GMT")); // if (!isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']) + 32400 < time()) { // header(("Last-Modified:" . gmdate("D,d M Y H:i:s") . "GMT")); // } else { // header("HTTP/1.1 304"); // exit; // } }
public function __construct($registry) { $this->registry = $registry; /* Journal2 Theme modification */ if (defined('HTTP_OPENCART')) { self::$IS_INSTALLER = true; } else { if (defined('VERSION')) { global $config; self::$IS_JOURNAL = $config->get('config_template') === 'journal2'; self::$IS_OC2 = version_compare(VERSION, '2', '>='); if (defined('HTTP_CATALOG') || defined('HTTPS_CATALOG')) { $url1 = new Url(HTTP_SERVER, HTTPS_SERVER); $url2 = new Url(defined('HTTP_CATALOG') ? HTTP_CATALOG : HTTPS_CATALOG, defined('HTTPS_CATALOG') ? HTTPS_CATALOG : HTTP_CATALOG); $url1 = parse_url($url1->link('')); $url2 = parse_url($url2->link('')); self::$IS_ADMIN = $url1['host'] . $url1['path'] !== $url2['host'] . $url2['path']; } } } /* End of Journal2 Theme modification */ }
$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();
$languages[$result['code']] = array('language_id' => $result['language_id'], 'name' => $result['name'], 'code' => $result['code'], 'locale' => $result['locale'], 'directory' => $result['directory'], 'filename' => $result['filename']); } $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 $registry->set('currency', new Currency($registry)); // Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // User $registry->set('user', new User($registry)); // Front Controller $controller = new Front($registry); // Router if (isset($request->get['mode'])) { if ($request->get['mode'] == 'checkauth') { $action = new Action('dataexchange/exchange1c/modeCheckauth'); } elseif ($request->get['mode'] == 'init') { $action = new Action('dataexchange/exchange1c/modeInit'); } elseif ($request->get['mode'] == 'file') { $action = new Action('dataexchange/exchange1c/modeFile'); } elseif ($request->get['mode'] == 'import') { $action = new Action('dataexchange/exchange1c/modeImport'); } else { echo "success\n"; exit; } } else {
if (Registry::get('username')) { 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'));
function __construct() { parent::__construct(); $this->loadModel('Contacts'); }
public function __construct() { parent::__construct(); \CI::lang()->load('cod'); }
$registry->set('weight', new Cart\Weight($registry)); // Length $registry->set('length', new Cart\Length($registry)); // User $registry->set('user', new Cart\User($registry)); // OpenBay Pro $registry->set('openbay', new Openbay($registry)); // Event $event = new Event($registry); $registry->set('event', $event); $query = $db->query("SELECT * FROM `" . DB_PREFIX . "event` WHERE `trigger` LIKE 'admin/%'"); foreach ($query->rows as $result) { $event->register(substr($result['trigger'], strrpos($result['trigger'], '/') + 1), new Action($result['action'])); } // Front Controller $controller = new Front($registry); // Compile Sass $controller->addPreAction(new Action('override/sass')); // Login $controller->addPreAction(new Action('override/login')); // Permission $controller->addPreAction(new Action('override/permission')); // Router if (isset($request->get['route'])) { $action = new Action($request->get['route']); } else { $action = new Action('common/dashboard'); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); // Output
public function __construct() { parent::__construct(); $this->customer = \CI::Login()->customer(); }
public function __construct() { parent::__construct(); \CI::load()->model(array('Locations')); $this->customer = \CI::Login()->customer(); }
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'); }
$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();
/** * Find the controller and instantiate it */ public function dispatch() { //session_start(); //$_GET['id_drawing'] = '19'; // $_GET['rev_system_name'] = '8'; // $_GET['id_drawing_rev'] = '11'; // // $_GET['id_part'] = '7'; //$_GET['controller'] = 'un_drawings'; //$_GET['operation'] = 'delete'; // $_GET['parent_class'] = '15'; // Get current controller //PRINT_R($_GET); global $front; require _UN_CONTROLLERS_URI_ . 'un_auths.php'; $front = new Front(); //require(_UN_CONTROLLERS_URI_.'auth.php'); if (isset($_GET['controller'])) { $front->runController($_GET['controller']); } else { //require(_UN_CONTROLLERS_URI_.'index.php'); $front->runController('un_main'); //$front->runController('un_constructgroups'); //$front->runController('un_drawings'); //$front->runController('un_drawingrevs'); //$front->runController('UN_Izdelies'); } $front->show(); }
public function init() { $this->model = Front::model()->findAll(); }
// 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();
} if ($config->get('config_error_display')) { echo '<b>' . $error . '</b>: ' . $errstr . ' in <b>' . $errfile . '</b> on line <b>' . $errline . '</b>'; } if (true) { $loger->write('PHP ' . $error . ': ' . $errstr . ' in ' . $errfile . ' on line ' . $errline); } return true; } // Error Handler //set_error_handler('error_handler'); //security $registry->set('security', new Security()); //url $url = new Url(HTTP_SERVER); $registry->set('url', $url); //token $registry->set('token', new Token()); //statistik $statistik = new statistik($registry); $registry->set('statistik', $statistik); $statistik->update('pageRequests'); $front = new Front($registry); $front->addPreAction(new action('maintenance/check')); 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();
$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();
<?php require 'class/Front.php'; $front = new Front(); $front->displayContent('vb_cliente');
// Weight $registry->set('weight', new Weight($registry)); // Length $registry->set('length', new Length($registry)); // User $registry->set('user', new User($registry)); // OpenBay Pro $registry->set('openbay', new Openbay($registry)); // 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); // Login $controller->addPreAction(new Action('common/login/check')); // Permission $controller->addPreAction(new Action('error/permission/check')); // Router if (isset($request->get['route'])) { $action = new Action($request->get['route']); } else { $action = new Action('common/dashboard'); } // Dispatch $controller->dispatch($action, new Action('error/not_found')); // 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();
function __construct() { parent::__construct(); $this->loadModel('Pictures'); $this->loadModel('Users'); }
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'); }
// 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();
$registry->set('document', new Document($config)); Sumo\Logger::info('Document created'); // Currency $registry->set('currency', new Sumo\Currency($registry)); Sumo\Logger::info('Currency created'); // Weight $registry->set('weight', new Sumo\Weight($registry)); Sumo\Logger::info('Weight created'); // Length $registry->set('length', new Sumo\Length($registry)); Sumo\Logger::info('Lenght created'); // User $registry->set('user', new User($registry)); Sumo\Logger::info('User created'); // Front Controller $controller = new Front($registry); Sumo\Logger::info('Front created'); // Login $controller->addPreAction(new Sumo\Action('common/home/login')); Sumo\Logger::info('Front pre-action common/home/login added'); // Permission $controller->addPreAction(new Sumo\Action('common/home/permission')); Sumo\Logger::info('Front pre-action common/home/permission added'); // Router if (isset($request->get['route'])) { $route = strtolower($request->get['route']); $action = new Sumo\Action($route); Sumo\Logger::info('Action created with route ' . htmlentities($route)); } else { $action = new Sumo\Action('common/home'); Sumo\Logger::info('Action created with route common/home');