예제 #1
0
파일: Writer.php 프로젝트: tyurderi/csv
 protected static function applyOptions(Options $options = null)
 {
     if ($options !== null) {
         self::$options = $options;
     } else {
         self::$options = Options::getInstance();
     }
 }
예제 #2
0
 protected function mongoInit($require = true)
 {
     $this->mongo = Options::getInstance()->get('mongo');
     if ($require && (empty($this->mongo) || !$this->mongo instanceof \MongoDB)) {
         throw new Exception('Bad database options');
     }
     $this->collection = Options::getInstance()->get('mongo_collection', $this->collection);
 }
예제 #3
0
 public function __construct()
 {
     $this->mongoInit();
     $this->cmd = Options::getInstance()->get('worker_cmd');
     if (empty($this->cmd)) {
         throw new Exception('Bad worker command options');
     }
     $this->workerMax = Options::getInstance()->get('worker_max_count', self::WORKERS_MAX);
     $this->log = Options::getInstance()->get('log', function () {
         /*do nothing*/
     });
     $this->timeout = intval(Options::getInstance()->get('hovering_timeout', self::HOVERING_TIMEOUT));
 }
예제 #4
0
 private function __construct()
 {
     $this->mongoInit();
     $this->types = Options::getInstance()->get('job_types', []);
 }