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


PHP Registry::put方法代码示例

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


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

示例1: setUp

 /** set up */
 public function setUp()
 {
     $this->createDatabase();
     Registry::put($configurator = new MockConfigurator(), '__configurator');
     Registry::put(new Logger($configurator), '__logger');
     ActiveRecord::close_connection();
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:8,代码来源:ValidatorTest.php

示例2: dispatch

 /**
  * Framework entry point
  *
  * @return void.
  */
 public function dispatch()
 {
     include_once 'action/controller/http/HTTPResponse.php';
     include_once 'action/controller/http/HTTPRequest.php';
     $request = new HTTPRequest();
     $response = new HTTPResponse();
     try {
         $configurator = $this->manager->getConfigurator();
         Registry::put($configurator, '__configurator');
         Registry::put($logger = new Logger($configurator), '__logger');
         $ap = $configurator->getApplicationPath();
         // application path
         $an = $configurator->getApplicationName();
         // application name
         $logger->debug('[Medick] >> version: ' . Medick::getVersion() . ' ready for ' . $an);
         $logger->debug('[Medick] >> Application path ' . $ap);
         $routes_path = $ap . DIRECTORY_SEPARATOR . 'conf' . DIRECTORY_SEPARATOR . $an . '.routes.php';
         include_once $routes_path;
         // load routes
         $logger->debug('[Medick] >> Config File: ' . str_replace($ap, '${' . $an . '}', $configurator->getConfigFile()));
         $logger->debug('[Medick] >> Routes loaded from: ' . str_replace($ap, '${' . $an . '}', $routes_path));
         ActionControllerRouting::recognize($request)->process($request, $response)->dump();
     } catch (Exception $ex) {
         ActionController::process_with_exception($request, $response, $ex)->dump();
         $logger->warn($ex->getMessage());
     }
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:32,代码来源:Dispatcher.php

示例3: setUp

 /** set up */
 public function setUp()
 {
     Registry::put($configurator = new MockConfigurator(), '__configurator');
     Registry::put(new Logger($configurator), '__logger');
     ActiveRecord::close_connection();
     $author = new Author();
     $author->name = 'Andrei Cristescu';
     $author->email = 'andrei@foocompany.com';
     $id = $author->save();
     $book = new Book();
     $book->author_id = $id;
     $book->title = 'The End is NEAR!';
     $book->save();
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:15,代码来源:HasOneTest.php

示例4: setUp

 /** set up this test case, we insert 3 fileds in DB table */
 public function setUp()
 {
     Registry::put($configurator = new MockConfigurator(), '__configurator');
     Registry::put(new Logger($configurator), '__logger');
     ActiveRecord::close_connection();
     $author = new Author();
     $author->name = "Andrei Cristescu";
     $author->email = "andrei.cristescu@foo-factory.info";
     $this->authors[] = $author;
     $author->insert();
     $author = new Author();
     $author->name = "Cristescu";
     $this->authors[] = $author;
     $author->insert();
     $author = new Author();
     $author->name = "Andrei";
     $this->authors[] = $author;
     $author->insert();
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:20,代码来源:FindTest.php

示例5: createControllerInstance

 /**
  * Creates a Controller Instance
  * 
  * @throws RoutingException
  * @return ActionControllerBase
  */
 public function createControllerInstance(Request $request)
 {
     if (!$this->isLoaded) {
         $this->load($request);
     }
     try {
         // Registry::get('__logger')->debug('[Medick] >> found ' . $this->toString());
         return Registry::put(new Injector(), '__injector')->inject('controller', $request->getParameter('controller'));
     } catch (FileNotFoundException $fnfEx) {
         throw new RoutingException('Cannot create a controller instance, ' . $fnfEx->getMessage());
     }
 }
开发者ID:BackupTheBerlios,项目名称:medick-svn,代码行数:18,代码来源:Route.php


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