本文整理汇总了PHP中Service::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Service::init方法的具体用法?PHP Service::init怎么用?PHP Service::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Service
的用法示例。
在下文中一共展示了Service::init方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
/**
* @return Flickr
*/
public function init()
{
parent::init();
if ($this->getgeodata) {
$this->buildPhotoGeoCache(false);
}
return $this;
}
示例2: testRunPluginActionNotFound
/**
* @covers \Plugin\Service::run
* @uses \Plugin\Request
* @expectedException BadMethodCallException
* @depends testInitPlugin
*/
public function testRunPluginActionNotFound()
{
$config = array('routes' => array('/test' => array('controller' => 'Plugin\\Controller', 'action' => 'fooAction')));
$application = Service::init($config);
$request = new \Request\Service();
$request->setPath('/test');
$result = $application->run($request);
$this->assertTrue(is_string($result) && strlen($result));
}
示例3: init
public function init()
{
parent::init();
}
示例4:
<?php
require_once 'autoload.php';
$logger = new \Logger\MainLogger();
$logger->addLoggers(new \Logger\EmailLogger());
\App::mode('raw');
DI::addInstance($logger);
\Service::init();
\Service::add("Cron\\Crontab");
\Service::add('GlobalEvents');
\Raw::go();
示例5: setState
{
return new ConcreteMemento($this->url, $this->currentLine);
}
public function setState(ConcreteMemento $state)
{
if (!$state instanceof Memento) {
throw new Exception('Memento object was not recognize');
}
$this->url = $state->getUrl();
$this->currentLine = $state->getCurrentLine();
$this->init();
}
public static function getLine()
{
$line = Service::$content++;
return $line . PHP_EOL;
}
}
$service = new Service('http://rambler.ru');
$service->init();
echo $service->getLine();
echo $service->getLine();
echo $service->getLine();
$memento = $service->getState();
//storing Memento in session, or smth else
$mementoString = serialize($memento);
$newService = new Service();
$newService->setState(unserialize($mementoString));
echo $newService->getLine();
echo $newService->getLine();
echo $newService->getLine();
示例6: __construct
public function __construct($version = Service::VERSION_3)
{
$companyId = 0;
parent::init($version);
$this->url = sprintf("%s/%s/company/%d/invoice", self::BASE_URL, $version, $companyId);
}
示例7: createTestQueue
private function createTestQueue()
{
$config = array('queue' => array('host' => '192.169.255.126', 'port' => 5672, 'user' => 'testTask', 'password' => 'fbrtgBne78G'));
$plugin = Service::init($config);
return new Queue($plugin);
}
示例8:
<?php
/**
* bootstrap the framework
*/
Session::start();
$logger = new \Logger\MainLogger();
$logger->addLoggers(new \Logger\EmailLogger());
DI::addInstance($logger);
Service::init('stack');
Service::add(App::get('startupClass'));
Service::add('\\Cron\\HTTP');
Service::add('GlobalEvents');
Service::go();
App::mode('server');