/** * Create the new handler object, loading configuration array * * @param array $config */ public function __construct(array $config = array()) { if (!isset($config['match']) || !is_string($config['match'])) { require_once 'Spizer/Handler/Exception.php'; throw new Spizer_Handler_Exception('The string to match was not passed in the configuration array'); } parent::__construct($config); }
public function __construct($config = array()) { if (!isset($config['save_dir'])) { require_once 'Kumo/Handler/Exception.php'; throw new Kumo_Handler_Exception('not setting save_path'); } parent::__construct($config); }
/** * Create the new handler object, loading configuration array * * @param array $config */ public function __construct(array $config = array()) { if (!isset($config['query'])) { require_once 'Spizer/Handler/Exception.php'; throw new Spizer_Handler_Exception('The XPath query was not passed in the configuration array'); } parent::__construct($config); }
public function __construct(array $config = array()) { if (!is_string($config['queueAdapter'])) { require_once 'Kumo/Handler/Exception.php'; throw new Kumo_Handler_Exception('queueAdapter must String'); } if (!is_array($config['queueOptions'])) { require_once 'Kumo/Handler/Exception.php'; throw new Kumo_Handler_Exception('queueOptions must array'); } parent::__construct($config); }
public function __construct(array $config = array()) { parent::__construct($config); $this->_callonce = isset($config['call-once']) ? true : false; $process = new Diggin_Scraper_Process(); $process->setExpression($config['expression']); $process->setName('kumo'); $process->setArrayFlag(isset($config['arrayflag']) ? (bool) $config['arrayflag'] : true); $process->setType(isset($config['type']) ? $config['type'] : 'TEXT'); // use only first filter if (isset($config['filters'])) { if (($match = $config['filters']['matchpattern']) && ($replace = $config['filters']['replacement'])) { require_once 'Zend/Filter/PregReplace.php'; $pregreplace = new Zend_Filter_PregReplace(); $pregreplace->setMatchPattern($match); $pregreplace->setReplacement($replace); $process->setFilters(array($pregreplace)); } } $this->scraper = new Diggin_Scraper(); $this->scraper->process($process); }