本文整理汇总了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;
}
示例2: startRpcServer
private function startRpcServer()
{
$vars = $this->getConfigVars();
$this->rpcService = new RunnerRpcService();
Registry::injectDependencies($this->rpcService);
$this->rpcService->start($vars['testbotrunner_rpc_port']);
}
示例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;
}
示例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();
}
示例5: run
public function run()
{
$loop = new EventLoop();
Registry::injectDependencies($loop);
$loop->exec();
}
示例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;
}
示例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);
}