本文整理汇总了PHP中Front类的典型用法代码示例。如果您正苦于以下问题:PHP Front类的具体用法?PHP Front怎么用?PHP Front使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Front类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: foreach
// 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();
开发者ID:web3d,项目名称:mincart,代码行数:31,代码来源:framework.php
示例15: Security
}
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();
开发者ID:karimo255,项目名称:myblog,代码行数:31,代码来源:index.php
示例16: Request
$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();
开发者ID:Samirdelvadia,项目名称:opencart,代码行数:31,代码来源:index.php
示例17: Front
<?php
require 'class/Front.php';
$front = new Front();
$front->displayContent('vb_cliente');
开发者ID:domazos,项目名称:sstt,代码行数:5,代码来源:detalle_contrato.php
示例18: Weight
// 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();
开发者ID:jeremywong1992,项目名称:opencart,代码行数:31,代码来源:index.php
示例19: Config
$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();
开发者ID:siiwi,项目名称:siiwi.com,代码行数:31,代码来源:index.php
示例20: 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');
}
开发者ID:cdsalmons,项目名称:arastta,代码行数:32,代码来源:admin.php
注:本文中的Front类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论