当前位置: 首页>>代码示例>>PHP>>正文


PHP Registry::init方法代码示例

本文整理汇总了PHP中Registry::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::init方法的具体用法?PHP Registry::init怎么用?PHP Registry::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Registry的用法示例。


在下文中一共展示了Registry::init方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: init

 private function init()
 {
     Registry::init();
     $this->displayErrors();
     //this method has to be called before instantiating the autoloader because it's not namespaced
     $this->enableLoggers();
     //this method has to be called before instantiating the autoloader because it's not namespaced
     $this->initTwig();
     $this->initAutoloader();
     $this->initErrorHandler();
     $this->initExceptionHandler();
     $this->startController();
 }
开发者ID:Lyonard,项目名称:PHPExperiments,代码行数:13,代码来源:BootStrapper.php

示例2: run

 /**
  * 运行一个请求生命周期
  * @access public
  * @author songdengtao <http://www.songdengtao.cn>
  * @return void
  */
 public static function run()
 {
     // 系统注册表
     Registry::init(static::get('registryPath'));
     // 运行环境检查
     static::checkEnv();
     // 类文件自动加载
     Autoloader::init(static::getInstance());
     Autoloader::autoload();
     // 设置系统时区
     static::shell('Dtime::setDateDefaultTimeZone');
     // 设置错误处理方法
     static::shell('Error::registerShutdownFunction');
     static::shell('Error::setErrorHandler');
     // 设置异常处理方法
     static::shell('Exception::setExceptionHandler');
     if (false === static::get('isCli')) {
         static::shell('Filter::globalFilter');
         static::shell('Session::start');
     }
     // 路由
     static::shell('Router::dispatch');
     $controller = CONTROLLER_NAME . 'Controller';
     $action = ACTION_NAME . 'Action';
     $class = CONTROLLER_NAMESPACE . '\\' . $controller;
     if (!class_exists($class)) {
         $class = CONTROLLER_NAMESPACE . '\\EmptyController';
         if (!class_exists($class)) {
             $module = strstr(CONTROLLER_NAMESPACE, '\\', true);
             if (static::get('debug')) {
                 if (!is_dir(static::get('appPath') . $module)) {
                     static::shell('Error::halt', 'Call to undefined module ' . $module);
                 } else {
                     static::shell('Error::halt', 'Call to undefined controller ' . $class);
                 }
             } else {
                 static::shell('Error::halt', '404 Not found');
             }
         }
     }
     (new $class())->{$action}();
     return;
 }
开发者ID:songdent,项目名称:pandaphp,代码行数:49,代码来源:Pandaphp.php

示例3: __constructLinkedModel

 function __constructLinkedModel($assoc, $className = null)
 {
     if (empty($className)) {
         $className = $assoc;
     }
     if (!isset($this->{$assoc}) || $this->{$assoc}->name !== $className) {
         $model = array('class' => $className, 'alias' => $assoc);
         if (PHP_VERSION >= 5) {
             $this->{$assoc} = Registry::init($model);
         } else {
             $this->{$assoc} =& Registry::init($model);
         }
     }
 }
开发者ID:vcrack,项目名称:ciorta,代码行数:14,代码来源:Orm.php

示例4:

<?php

$CFG->load('database');
$DB = Mysql::init($CFG->get('mysql_host'), $CFG->get('mysql_user'), $CFG->get('mysql_password'), $CFG->get('mysql_database'));
$DB->set_names();
Registry::init()->set('DB', $DB);
$CFG->unload('database');
开发者ID:ionutmilica,项目名称:my-archive,代码行数:7,代码来源:database.php

示例5: dirname

<?php

//Object Factory
require_once dirname(__FILE__) . "/model/core/Factory.php";
require_once dirname(__FILE__) . "/model/core/Autoloader.php";
$autloader = new model\core\Autoloader();
$autloader->register();
Factory::init();
Controller::boot();
Registry::init();
Cache::init();
Registry::loadDBSettings();
FrameEx::init();
Factory::attachAutoloader($autloader);
//boot the app
Factory::boot(APP_DIR);
开发者ID:Acidburn0zzz,项目名称:xframe-legacy,代码行数:16,代码来源:init.php

示例6: assign

function assign($key, $value)
{
    return Registry::init()->smarty->assign($key, $value);
}
开发者ID:ionutmilica,项目名称:my-archive,代码行数:4,代码来源:smarty.php

示例7: define

// setam caile de acces catre system, fisierele de configuratie si module
define('SYSPATH', BASEPATH . 'system' . DS);
define('CFGPATH', APPPATH . 'config' . DS);
define('MODPATH', BASEPATH . 'modules' . DS);
define('PLUGINPATH', BASEPATH . 'plugins' . DS);
require SYSPATH . 'autoload.php';
// setam ca functia implicita sa fie metoda load din clasa Autoload
spl_autoload_register();
spl_autoload_register(array('Autoload', 'load'));
// deschidem sesiunea
Session::start('metin2fw');
// functii globale facute de utilizator (programator)
require SYSPATH . 'functions.php';
require SYSPATH . 'constants.php';
//
$CFG = Config::init();
$REG = Registry::init();
// includem declararea bazei de date
require SYSPATH . 'database.php';
// wrapper pentru metodele claselor
require SYSPATH . 'wrapper.php';
// Functii ce ne ajut sa lucram cu smarty
require SYSPATH . 'smarty.php';
// pre-config
set_sitename($CFG->get('site_name'));
$smarty->assign('keywords', $CFG->get('site_keywords'));
$smarty->assign('site_description', $CFG->get('site_description'));
$smarty->assign('site_lang', $CFG->get('site_lang'));
$smarty->assign('base_href', site_url());
$smarty->assign('banners', $CFG->get('banners'));
date_default_timezone_set($CFG->get('default_timezone'));
开发者ID:ionutmilica,项目名称:my-archive,代码行数:31,代码来源:core.php


注:本文中的Registry::init方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。