Beispiel #1
0
 static function activate()
 {
     // Конфиг хранилищ
     self::$config = Config::read('auth');
     self::$input = new Request();
     self::$input->setFilter(Rule::arrays(['COOKIE' => Rule::arrays(['ID' => Rule::string()])]));
 }
Beispiel #2
0
 /**
  * Установка правила на атрибуты
  */
 protected function rule()
 {
     $rule = parent::rule();
     $rule->arrays[0]['value'] = Rule::double();
     return $rule;
 }
Beispiel #3
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required(), 'agree' => Rule::bool()->default(false)->required(), 'path' => Rule::regexp('/^' . preg_quote($this->path->value(), '/') . '($|\\/)/ui')->required()])]);
 }
Beispiel #4
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['confirm' => Rule::string()->default(false)->required(), 'sendAgain' => Rule::email()->default(false)->required(), 'object' => Rule::entity()->default(false)])]);
 }
Beispiel #5
0
 function startRule()
 {
     return Rule::any(Rule::arrays(['REQUEST' => Rule::arrays(['path' => Rule::regexp('/^' . preg_quote($this->path, '/') . '($|\\/)/ui')->required()])]), Rule::arrays(['REQUEST' => Rule::arrays(['method' => Rule::eq('GET')->required(), 'confirm' => Rule::string()->required(), 'path' => Rule::regexp('/^' . preg_quote($this->path, '/') . '($|\\/)/ui')->required()])]));
 }
Beispiel #6
0
 function startRule()
 {
     return parent::startRule()->mix(Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity(['is', '/vendor/boolive/basic/text'])->required()])]));
 }
Beispiel #7
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity()->required(), 'page' => Rule::int()->default(1)->required(), 'page_count' => Rule::int()->more(1)->required()])]);
 }
Beispiel #8
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity(['is', '/vendor/boolive/basic/page'])->required()])]);
 }
Beispiel #9
0
 function startRule()
 {
     return parent::startRule()->mix(Rule::arrays(['REQUEST' => Rule::arrays(['proto' => Rule::entity(), 'attr' => Rule::arrays(Rule::string())])]));
 }
Beispiel #10
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required(), 'email' => Rule::email()->default(false)->required(), 'password' => Rule::string()->default(false)->required(), 'passwordAgain' => Rule::string()->default(false)->required(), 'call' => Rule::string()->default('')->required()]), 'COOKIE' => Rule::arrays(['token' => Rule::string()->max(32)->default(false)->required()])]);
 }
Beispiel #11
0
 /**
  * Правило на атрибуты
  * @return Rule
  */
 protected function rule()
 {
     return Rule::arrays(['name' => Rule::string()->regexp('|^[^/@:#\\\\]*$|')->min(IS_INSTALL ? 1 : 0)->max(100)->required(), 'parent' => Rule::any(Rule::uri(), Rule::null()), 'proto' => Rule::any(Rule::uri(), Rule::null()), 'author' => Rule::any(Rule::uri(), Rule::null()), 'order' => Rule::int()->max(Entity::MAX_ORDER), 'created' => Rule::int(), 'updated' => Rule::int(), 'value' => Rule::string()->max(65535), 'is_draft' => Rule::bool(), 'is_hidden' => Rule::bool(), 'is_mandatory' => Rule::bool(), 'is_property' => Rule::bool(), 'is_relative' => Rule::bool(), 'is_link' => Rule::bool(), 'is_default_value' => Rule::bool(), 'is_default_file' => Rule::bool(), 'is_default_logic' => Rule::bool(), 'file' => Rule::any([Rule::null(), Rule::string()->regexp('/[^\\/\\\\]+/ui'), Rule::arrays(['tmp_name' => Rule::string(), 'name' => Rule::lowercase()->ospatterns('*.*')->ignore('lowercase')->required(), 'size' => Rule::int(), 'error' => Rule::int()->eq(0, true), 'type' => Rule::string()])])]);
 }
Beispiel #12
0
 function startRule()
 {
     return parent::startRule()->mix(Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required()]), 'COOKIE' => Rule::arrays(['token' => Rule::string()->max(32)->default(false)->required()])]));
 }
Beispiel #13
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required(), 'email' => Rule::email()->default(false)->required(), 'password' => Rule::string()->default(false)->required(), 'remember-me' => Rule::bool()->default(false)->required(), 'path' => Rule::regexp('/^' . preg_quote($this->path->value(), '/') . '($|\\/)/ui')->required()]), 'COOKIE' => Rule::arrays(['token' => Rule::string()->max(32)->default(false)->required()])]);
 }
Beispiel #14
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['path' => Rule::regexp('/^' . preg_quote($this->path, '/') . '($|\\/)/ui')->required()])]);
 }
Beispiel #15
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['method' => Rule::string()->eq('CLI')]), 'ARG' => Rule::arrays([1 => Rule::eq('data_tools')->required(), 2 => Rule::string(), 3 => Rule::string(), 4 => Rule::string(), 5 => Rule::string()])]);
 }
Beispiel #16
0
 function __toString()
 {
     return (string) $this->get(Rule::escape());
 }
Beispiel #17
0
 function startRule()
 {
     return parent::startRule()->mix(Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::any([Rule::entity(['is', '/vendor/boolive/basic/user/title']), Rule::entity(['is', '/vendor/boolive/basic/user/email']), Rule::entity(['is', '/vendor/boolive/basic/user/password'])])])]));
 }
Beispiel #18
0
 function startRule()
 {
     return Rule::null()->ignore('null');
 }
Beispiel #19
0
 /**
  * Выбор значения, фильтруя его
  * Правило фильтра создаётся из имени вызванного метода и его аргументов,
  * таким образом, правило может иметь только один фильтр.
  * Используется как альтернатива get() в простых ситуациях
  * @param string $name Имя метода
  * @param array $args Аргументы
  * @return null
  */
 function __call($name, $args)
 {
     $rule = new Rule();
     $rule->__set($name, $args);
     return $this->get($rule);
 }
Beispiel #20
0
 function startRule()
 {
     return Rule::arrays(array('REQUEST' => Rule::arrays(array('object' => Rule::entity()->default(null)->required()))));
 }
Beispiel #21
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity(['is', '/vendor/boolive/basic/image'])->required(), 'test' => Rule::transform('scale', 200, 200)])]);
 }
Beispiel #22
0
 function startRule()
 {
     return Rule::arrays(['PATH' => Rule::arrays([0 => Rule::eq('admin')->required()])]);
 }
Beispiel #23
0
 function rule()
 {
     return parent::rule()->mix(Rule::arrays(['value' => Rule::email()]));
 }
Beispiel #24
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity()->required(), 'value' => Rule::scalar()->default(''), 'base_uri' => Rule::string()->default('')->required(), 'call' => Rule::string()->default('show')->required()]), 'FILES' => Rule::arrays(['value' => Rule::arrays(Rule::string())])]);
 }
Beispiel #25
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['object' => Rule::entity()->required()])]);
 }
Beispiel #26
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['path' => Rule::string()])]);
 }