當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Front類代碼示例

本文整理匯總了PHP中Front的典型用法代碼示例。如果您正苦於以下問題:PHP Front類的具體用法?PHP Front怎麽用?PHP Front使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Front類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: execute

 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'));
     }
 }
開發者ID:beyondit,項目名稱:ocok,代碼行數:25,代碼來源:CliTaskCommand.php

示例2: dispatch

 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');
 }
開發者ID:cdsalmons,項目名稱:arastta,代碼行數:14,代碼來源:install.php

示例3: init

 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);
 }
開發者ID:Vladimirtishenko,項目名稱:sn,代碼行數:7,代碼來源:FrontsRegion.php

示例4: init

 public function init()
 {
     $crit = new CDbCriteria();
     $crit->condition = 'on_front = :on_front';
     $crit->params = array(':on_front' => 1);
     $this->model = Front::model()->findAll($crit);
 }
開發者ID:Vladimirtishenko,項目名稱:sn,代碼行數:7,代碼來源:FrontWidgetFull.php

示例5: front

/**
 * 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);
}
開發者ID:jpalala,項目名稱:startupjobs,代碼行數:15,代碼來源:front.php

示例6: Request

$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();
開發者ID:karimo255,項目名稱:blog,代碼行數:31,代碼來源:index.php

示例7: array

    $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 {
開發者ID:rb2,項目名稱:ocstoreru,代碼行數:31,代碼來源:index.php

示例8: Router

    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'));
開發者ID:buxiaoyang,項目名稱:EmailArchive,代碼行數:31,代碼來源:index.php

示例9: Openbay

$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
開發者ID:i92011,項目名稱:opencart,代碼行數:31,代碼來源:index.php

示例10: 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');
     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');
 }
開發者ID:sojimaxi,項目名稱:arastta,代碼行數:30,代碼來源:catalog.php

示例11: setcookie

                        $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();
開發者ID:siiwi,項目名稱:siiwi.com,代碼行數:31,代碼來源:index.php

示例12: dispatch

 /**
  * 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();
 }
開發者ID:ramzzes52,項目名稱:Uni3,代碼行數:32,代碼來源:Dispatcher.php

示例13: init

 public function init()
 {
     $this->model = Front::model()->findAll();
 }
開發者ID:Vladimirtishenko,項目名稱:sn,代碼行數:4,代碼來源:FrontWidget.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     if (config_item('require_login')) {
         \CI::Login()->isLoggedIn('checkout');
     }
     $this->customer = \CI::Login()->customer();
 }
開發者ID:lekhangyahoo,項目名稱:gonline,代碼行數:8,代碼來源:Checkout.php

示例15: __construct

 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;
     //        }
 }
開發者ID:sunkejl,項目名稱:weixinAPI,代碼行數:18,代碼來源:wtest.php


注:本文中的Front類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。