<?php
namespace Moto\Application\Updates\InputFilter; use Moto\InputFilter\AbstractInputFilter; use Moto; class ExecuteAction extends AbstractInputFilter { protected $_name = 'updates:runAction'; public function init() { $this->add(array( 'name' => 'type', 'required' => false, 'validators' => array( array( 'name' => 'InArray', 'options' => array( 'haystack' => array( 'engine', 'theme', 'plugin', ) ) ), ), )); $this->add(array( 'name' => 'action', 'required' => true, 'validators' => array( array( 'name' => 'Regex', 'break_chain_on_failure' => true, 'options' => array( 'pattern' => '/^([@]?[a-z][a-z0-9\_\:]{5,64})$/i', ) ), ), )); $this->add(array( 'name' => 'token', 'required' => false, 'validators' => array( array( 'name' => 'StringLength', 'options' => array( 'encoding' => 'UTF-8', 'min' => 1, ), ), ), )); $this->add(array( 'name' => 'params', 'required' => false, )); $this->add(array( 'name' => 'update', 'required' => true, )); } }