예제 #1
0
 public function __construct(ScrollerInterface $scroller, array $config)
 {
     if (!empty($config['forceStop'])) {
         if (!empty($config['forceStop']['pages'])) {
             $this->pageLimit = $config['forceStop']['pages'];
         }
         if (!empty($config['forceStop']['time'])) {
             $this->timeLimit = is_int($config['forceStop']['time']) ? $config['forceStop']['time'] : strtotime($config['forceStop']['time'], 0);
         }
         if (!empty($config['forceStop']['volume'])) {
             $this->volumeLimit = Utils::return_bytes($config['forceStop']['volume']);
         }
     }
     parent::__construct($scroller, $config);
     $this->reset();
 }
예제 #2
0
 public function __construct(ScrollerInterface $scroller, array $config)
 {
     if (!empty($config['nextPageFlag'])) {
         if (empty($config['nextPageFlag']['field'])) {
             throw new UserException("'field' has to be specified for 'nextPageFlag'");
         }
         if (!isset($config['nextPageFlag']['stopOn'])) {
             throw new UserException("'stopOn' value must be set to a boolean value for 'nextPageFlag'");
         }
         if (!isset($config['nextPageFlag']['ifNotSet'])) {
             $config['nextPageFlag']['ifNotSet'] = $config['nextPageFlag']['stopOn'];
         }
         $this->nextPageFlag = $config['nextPageFlag'];
     }
     parent::__construct($scroller, $config);
 }