示例#1
0
 public function __construct($default = NULL, $validators = [], $filters = [], $context = NULL, Loops $loops = NULL)
 {
     if ($default !== NULL) {
         throw new Exception("File can't have a default value.");
     }
     parent::__construct($default, $validators, $filters, $context, $loops);
     $loops = $this->getLoops();
     $config = $loops->getService('config');
     $application = $loops->GetService('application');
     $this->storage_dir = @$config->upload->storage_dir ?: "{$application->cache_dir}/upload/";
     $this->timeout = @$config->upload->timeout ?: 60 * 60 * 24 * 7;
 }
示例#2
0
 public function __construct($default = NULL, $validators = [], $filters = [], $context = NULL, Loops $loops = NULL)
 {
     parent::__construct($default, $validators, $filters, $context, $loops);
     $this->addInternalFilter(new NumberFilter($loops));
     $this->addValidator(new NumberValidator($loops));
 }