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


PHP Zend_Registry::Set方法代码示例

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


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

示例1: Zend_Log

Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Loader::loadClass('Zend_Registry');
Zend_Loader::loadClass('Zend_View');
Zend_Loader::loadClass('Zend_Config_Ini');
Zend_Loader::loadClass('Zend_Db');
Zend_Loader::loadClass('Zend_Db_Table');
Zend_Loader::loadClass('Zend_Debug');
Zend_Loader::loadClass('Zend_Auth');
$logger = new Zend_Log(new Zend_Log_Writer_Null());
$config = new Zend_Config_Ini(PATH_ROOT . '/config/config.ini', 'general');
Zend_Registry::set('config', $config);
$config = Zend_Registry::get('config');
include "library/Gst/Loader.php";
$cache = Zend_Cache::factory('Core', 'File', array('lifetime' => 60 * 60 * 24), array('cache_dir' => 'public/temp'));
$cache->clean(Zend_Cache::CLEANING_MODE_OLD);
Zend_Registry::Set('cache', $cache);
$db = Zend_Db::factory($config->db->adapter, $config->db->config->toArray());
Zend_Db_Table::setDefaultAdapter($db);
Zend_Registry::set('db', $db);
$session = new Zend_Session_Namespace('gauravstomar');
Zend_Registry::set('session', $session);
try {
    $front = Zend_Controller_Front::getInstance();
    $front->throwExceptions(true);
    $front->setControllerDirectory(PATH_ROOT . '/application/controllers');
    $route['do-nothing'] = new Zend_Controller_Router_Route('take-two-minute-challenge', array('controller' => 'index', 'action' => 'donothing'));
    $route['user'] = new Zend_Controller_Router_Route('user/:user/:tweet', array('controller' => 'users', 'action' => 'profile'));
    $route['my'] = new Zend_Controller_Router_Route('my/', array('controller' => 'users', 'action' => 'index'));
    $route['bio'] = new Zend_Controller_Router_Route('bio/:bio', array('controller' => 'users', 'action' => 'profile'));
    $route['ref'] = new Zend_Controller_Router_Route('i/:ref', array('controller' => 'index', 'action' => 'index'));
    $route['user'] = new Zend_Controller_Router_Route('user/:userid', array('controller' => 'index', 'action' => 'index'));
开发者ID:gauravstomar,项目名称:Pepool,代码行数:31,代码来源:index.php


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