Exemplo n.º 1
0
 /**
  * returns an instance of the front controller class
  *
  * @access public
  * @static
  * @return object, instance of this class
  */
 public static function getInstance()
 {
     if (!self::$_instance) {
         self::$_instance = new self();
     }
     return self::$_instance;
 }
Exemplo n.º 2
0
 /**
  * call a command directly ignoring the set rules for the route associated with it
  *
  * @param array $rules -- the rules that will define the command to be called
  * @param array $data -- the data to be passed to the command
  * @access public
  * @static
  * @throws System_Request_Exception - if the command is left blank
  * @return System_Request_Controller
  */
 public static function command(array $rules = array(), array $data = array())
 {
     if (!isset($rules['command']) || trim($rules['command']) == '') {
         throw new System_Request_Exception('You must provide a command');
     }
     $rules = array_merge(System_Request_Router::getInternalSetup(), $rules);
     $request = new System_Request_Controller($rules);
     $request->setCommandData($data);
     return $request->setUp()->process();
 }