Beispiel #1
0
 /**
  *
  * @todo Consider using request and response as controller constructor
  *       params?
  */
 function __construct()
 {
     $this->_server = Oops_Server::getInstance();
     $this->_request = Oops_Server::getRequest();
     $this->_response = Oops_Server::getResponse();
     $this->_config = Oops_Server::getConfig();
 }
Beispiel #2
0
 function Run()
 {
     $this->Data['request'] = array();
     $keys = $this->getRequestKeys();
     foreach ($keys as $k) {
         $this->Data['request'][$k] = $this->Request($k);
     }
     $server =& Oops_Server::getInstance();
     $this->Data['server'] = array('controller_params' => $server->get('controller_params'), 'controller_ident' => $server->get('controller_ident'));
     return $this->Data;
 }
Beispiel #3
0
 function test_ServerGetInstance()
 {
     $server = Oops_Server::newInstance();
     $server2 = Oops_Server::getInstance();
     $this->assertEquals($server, $server2);
     //Try to configure server
     $server->configure(new Oops_Config(array('testKey' => 'testValue')));
     $this->assertEquals($server->config->testKey, $server2->config->testKey);
     //destroy servers
     $server = null;
     $server2 = null;
     Oops_Server_Stack::pop();
     $this->assertEquals(0, Oops_Server_Stack::size());
 }
Beispiel #4
0
 /**
  *
  * @return Oops_Server_Router
  */
 public static function getRouter()
 {
     $server = Oops_Server::getInstance();
     if (!isset($server->_router)) {
         $server->_initRouter();
     }
     return $server->_router;
 }