/** * Sets validator options * * Min limits the used diskspace for all files, when used with max=null it is the maximum filesize * It also accepts an array with the keys 'min' and 'max' * * @param integer|array|\Zend\Config\Config $options Options for this validator * @return void */ public function __construct($options) { $this->_files = array(); $this->_setSize(0); if ($options instanceof \Zend\Config\Config) { $options = $options->toArray(); } elseif (is_scalar($options)) { $options = array('max' => $options); } elseif (!is_array($options)) { throw new \Zend\Validator\Exception('Invalid options to validator provided'); } if (1 < func_num_args()) { $argv = func_get_args(); array_shift($argv); $options['max'] = array_shift($argv); if (!empty($argv)) { $options['bytestring'] = array_shift($argv); } } parent::__construct($options); }