예제 #1
0
 /**
  * Manage database schema
  */
 public function schemaManagerAction()
 {
     $request = $this->getRequest();
     // Set up logger. Log level is already validated by route.
     $priority = \Zend\Filter\StaticFilter::execute($request->getParam('loglevel', 'info'), 'Library\\LogLevel');
     $writer = new \Zend\Log\Writer\Stream('php://stderr');
     $writer->addFilter('priority', array('priority' => $priority));
     $writer->setFormatter('simple', array('format' => '%priorityName%: %message%'));
     $this->_logger->addWriter($writer);
     $this->_schemaManager->updateAll($request->getParam('prune'));
 }
예제 #2
0
 public function __construct($url, Stockfighter $stockfighter)
 {
     $this->url = $url;
     $this->stockfighter = $stockfighter;
     // Create the client (and a logger because the library requires it).
     // Well, we might as well embrace the logger since we have to use it...
     $this->logger = new Logger();
     $writer = new Stream('/dev/null');
     $this->logger->addWriter($writer);
     $this->client = new \Devristo\Phpws\Client\WebSocket($this->url, $this->stockfighter->loop, $this->logger);
 }
예제 #3
0
 public function setUp()
 {
     $configFile = __DIR__ . '/../../config.yml';
     $value = Yaml::parse(file_get_contents($configFile));
     $this->ariAddress = $value['tests']['ari_address'];
     $this->amiAddress = $value['tests']['ami_address'];
     $this->dialString = $value['tests']['dial_string'];
     $this->logger = new Log\Logger();
     $logWriter = new Log\Writer\Stream("php://output");
     $this->logger->addWriter($logWriter);
     $filter = new Log\Filter\SuppressFilter(true);
     //$filter = new Log\Filter\Priority(\Zend\Log\Logger::NOTICE);
     $logWriter->addFilter($filter);
     $this->client = new Phparia($this->logger);
     $this->client->connect($this->ariAddress, $this->amiAddress);
 }