本文整理汇总了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'));
}
}
示例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');
}
示例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);
}
示例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);
}
示例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);
}
示例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();
示例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 {
示例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'));
示例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
示例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');
}
示例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();
示例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();
}
示例13: init
public function init()
{
$this->model = Front::model()->findAll();
}
示例14: __construct
public function __construct()
{
parent::__construct();
if (config_item('require_login')) {
\CI::Login()->isLoggedIn('checkout');
}
$this->customer = \CI::Login()->customer();
}
示例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;
// }
}