示例#1
0
 public function call(Request $req = null, Error $err = null)
 {
     if (!$this->config['viewPath']) {
         throw new Error('Missing the `viewPath` parameter');
     }
     if (!file_exists($this->config['viewPath'])) {
         throw new Error('The view path does not exist: ' . $this->config['viewPath']);
     }
     return $this->render(parent::call($req, $err));
 }
示例#2
0
 public function call(Request $req = null, Error $err = null)
 {
     if (!$req) {
         $req = $this->getCurrentRequest();
     }
     $this->d('Stack.call(`' . $req->method . ' ' . $req->uri . '`)');
     switch ($this->state) {
         case static::STATE_IDLE:
             if ($app = $this->resolve($req)) {
                 return $app->call($req, $err);
             }
             return parent::call($req, $err);
         case static::STATE_LOOP:
             return $this->next ? $this->next->call($req, $err) : new Response($req);
         default:
             return parent::call($req, $err);
     }
 }
示例#3
0
 public function testFactoryCreate()
 {
     $layer = Layer::create();
     $this->assertInstanceOf('Server\\Layer', $layer);
 }