示例#1
0
 /**
  * Constructor.
  *
  * @param string $action Action command.
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $action = (new \ReflectionClass(get_class($this)))->getShortName();
     if (preg_match('/([\\S]+)Action$/', $action, $matches)) {
         $this->setAction($matches[1]);
     } else {
         throw new \RuntimeException(sprintf('AMI Action invalid class: "%s"', get_class($this)));
     }
     $this->setActionID(microtime(true));
 }
示例#2
0
 /**
  * Constructor.
  *
  * @param string $what
  *        	Action command.
  *        	
  * @return void
  */
 public function __construct($what)
 {
     parent::__construct();
     $this->setKey('Action', $what);
     $this->setKey('ActionID', microtime(true));
 }