Esempio n. 1
0
 /**
  * @param Config_Abstract $config
  */
 public function __construct(Config_Abstract $config)
 {
     $this->_config = $config;
     $this->_stat = array();
     if ($config->offsetExists('lock')) {
         $lock = $config->get('lock');
         if ($lock instanceof Cron_Lock) {
             $this->_lock = $lock;
         }
     }
     // Setting thread number
     if (!$this->_config->offsetExists('thread')) {
         $this->_config->set('thread', 0);
     }
 }
Esempio n. 2
0
 /**
  * Delete index
  * @param string $name
  */
 public function removeIndex($name)
 {
     $indexes = $this->getIndexesConfig();
     if (!isset($indexes[$name])) {
         return;
     }
     unset($indexes[$name]);
     $this->_config->set('indexes', $indexes);
 }
Esempio n. 3
0
 /**
  * Add a record
  * @param string $key
  * @param string $value
  * @return boolean
  */
 public function addRecord($key, $value)
 {
     return $this->_data->set($key, $value);
 }