Author: Vasily Zorin (maintainer@daemon.io)
Inheritance: extends PHPDaemon\Network\Client, use trait PHPDaemon\Traits\StaticObjectWatchdog
Example #1
0
 /**
  * Constructor.
  * @return void
  */
 public function init()
 {
     $this->timeStart = microtime(true);
     $this->db = \MongoClient::getInstance();
     $this->mongo = \PHPDaemon\Clients\Mongo\Pool::getInstance(['maxconnperserv' => 100]);
     $this->collection = $this->mongo->{'MongoAsync.MongoAsync'};
 }
Example #2
0
 /**
  * Constructor.
  * @return void
  */
 public function init()
 {
     $this->db = \PHPDaemon\Clients\Mongo\Pool::getInstance($this->config->mongoclientname->value);
     $this->cache = \PHPDaemon\Clients\Memcache\Pool::getInstance($this->config->memcacheclientname->value);
     if (!isset($this->config->limitinstances)) {
         $this->log('missing \'limitInstances\' directive');
     }
 }
Example #3
0
 public function init()
 {
     if ($this->config->enable->value) {
         Daemon::log(__CLASS__ . ' up.');
         $this->db = \PHPDaemon\Clients\Mongo\Pool::getInstance();
         $this->tags = array();
         $this->minMsgInterval = 1;
     }
 }
Example #4
0
 /**
  * Constructor.
  * @return void
  */
 public function init()
 {
     $this->mongo = \PHPDaemon\Clients\Mongo\Pool::getInstance(['maxconnperserv' => 100]);
 }
Example #5
0
 public function init()
 {
     Daemon::log(get_class($this) . ' up.');
     ini_set('display_errors', 'On');
     $this->redis = \PHPDaemon\Clients\Redis\Pool::getInstance($this->config->redisname->value);
     $this->db = \PHPDaemon\Clients\Mongo\Pool::getInstance($this->config->mongoname->value);
     $this->dbname = $this->config->dbname->value;
     $this->ipcId = new MongoId();
     $this->JobManager = new JobManager($this);
     $this->Sendmail = new Sendmail($this);
     if (isset($this->config->BackendServer)) {
         $this->backendServer = BackendServer::getInstance($this->config->BackendServer, true, $this);
     }
     if (isset($this->config->BackendClient)) {
         $this->backendClient = BackendClient::getInstance($this->config->BackendClient, true, $this);
     }
     $this->discoverOrm($this->config->ormdir->value . '*.php');
     /*	$this->LockClient = \PHPDaemon\Clients\Lock\Pool::getInstance();
     		$this->LockClient->job(get_class($this) . '-' . $this->name, true, function ($jobname, $command, $client) {
     			foreach (glob($this->config->themesdir->value . '*'.'/blocks/*') as $file) {
     				Daemon::$process->fileWatcher->addWatch($file, array($this, 'onBlockFileChanged'));
     			}
     		});*/
     $this->locales = array_map('basename', glob($this->config->localedir->value . '*', GLOB_ONLYDIR));
     if (!in_array($this->config->defaultlocale->value, $this->locales, true)) {
         $this->locales[] = $this->config->defaultlocale->value;
     }
     if (!in_array('en', $this->locales, true)) {
         $this->locales[] = 'en';
     }
     $this->components = new Components($this->fakeRequest());
     foreach ($this->config as $k => $c) {
         if (isset($c->run->value) && $c->run->value) {
             if (substr($k, 0, 3) === 'Cmp') {
                 $appInstance->components->{substr($k, 3)};
             }
         }
     }
     $this->serializer = 'igbinary';
     $this->httpclient = \PHPDaemon\Clients\HTTP\Pool::getInstance();
 }