當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。