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


PHP Registry::injectDependencies方法代码示例

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


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

示例1: post

 /**
  * Requests contents of given $uri using POST method and returns AsyncHttp
  * object which has additional methods for controlling how the query is done.
  *
  * See get() for code example.
  *
  * @param string $uri the requested URI
  * @return AsyncHttp
  */
 public function post($uri)
 {
     $http = new AsyncHttp('post', $uri);
     Registry::injectDependencies($http);
     $this->timer->callLater(0, array($http, 'execute'));
     return $http;
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:16,代码来源:Http.php

示例2: startRpcServer

 private function startRpcServer()
 {
     $vars = $this->getConfigVars();
     $this->rpcService = new RunnerRpcService();
     Registry::injectDependencies($this->rpcService);
     $this->rpcService->start($vars['testbotrunner_rpc_port']);
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:7,代码来源:TestBotRunner.php

示例3: getInstance

 public static function getInstance($name, $reload = false)
 {
     $name = strtolower($name);
     LegacyLogger::log("DEBUG", "Registry", "Requesting instance for '{$name}'");
     $instance = Registry::$repo[$name];
     if ($instance == null) {
         LegacyLogger::log("WARN", "Registry", "Could not find instance for '{$name}'");
     }
     if ($instance !== null && (USE_RUNKIT_CLASS_LOADING === true || $reload === true)) {
         Registry::importChanges($instance);
         Registry::injectDependencies($instance);
     }
     return $instance;
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:14,代码来源:Registry.class.php

示例4: waitAndReturnResponse

 /**
  * Waits until response is fully received from remote server and returns
  * the response. Note that this blocks execution, but do not freeze the bot
  * as the execution will return to event loop while waiting.
  *
  * @return mixed
  */
 public function waitAndReturnResponse()
 {
     // run in event loop, waiting for loop->quit()
     $this->loop = new EventLoop();
     Registry::injectDependencies($this->loop);
     $this->loop->exec();
     return $this->buildResponse();
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:15,代码来源:AsyncHttp.class.php

示例5: run

 public function run()
 {
     $loop = new EventLoop();
     Registry::injectDependencies($loop);
     $loop->exec();
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:6,代码来源:Budabot.class.php

示例6: getSettingHandler

 public function getSettingHandler($row)
 {
     $handler = null;
     switch ($row->type) {
         case 'color':
             $handler = new ColorSettingHandler($row);
             break;
         case 'text':
             $handler = new TextSettingHandler($row);
             break;
         case 'number':
             $handler = new NumberSettingHandler($row);
             break;
         case 'options':
             $handler = new OptionsSettingHandler($row);
             break;
         case 'time':
             $handler = new TimeSettingHandler($row);
             break;
         default:
             $this->loggger->log('ERROR', "Could not find setting handler for setting type: '{$row->type}'");
     }
     Registry::injectDependencies($handler);
     return $handler;
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:25,代码来源:SettingManager.class.php

示例7: reloadinstanceCommand

 /**
  * @HandlesCommand("reloadinstance")
  * @Matches("/^reloadinstance all$/i")
  */
 public function reloadinstanceCommand($message, $channel, $sender, $sendto, $args)
 {
     $instances = Registry::getAllInstances();
     $count = count($instances);
     $blob = '';
     foreach ($instances as $name => $instance) {
         $blob .= $name . ' (' . get_class($instance) . ")\n";
         Registry::importChanges($instance);
         Registry::injectDependencies($instance);
     }
     $msg = $this->text->make_blob("All instances have been reloaded ({$count})", $blob);
     $sendto->reply($msg);
 }
开发者ID:jibinam,项目名称:budabot2,代码行数:17,代码来源:TestController.class.php


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