Exemplo n.º 1
0
 /**
  * @return Flickr
  */
 public function init()
 {
     parent::init();
     if ($this->getgeodata) {
         $this->buildPhotoGeoCache(false);
     }
     return $this;
 }
 /**
  * @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));
 }
Exemplo n.º 3
0
 public function init()
 {
     parent::init();
 }
Exemplo n.º 4
0
Arquivo: cron.php Projeto: jankal/mvc
<?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();
Exemplo n.º 5
0
    {
        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();
Exemplo n.º 6
0
 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);
 }
Exemplo n.º 7
0
 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);
 }
Exemplo n.º 8
0
<?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');