コード例 #1
0
ファイル: RequestFactory.php プロジェクト: snikch/ergo
 private function _getScheme()
 {
     if ($schemeHeader = $this->_getSchemeHeader()) {
         return $schemeHeader;
     } else {
         $requestUrl = new Ergo_Http_Url($_SERVER['REQUEST_URI']);
         return $requestUrl->hasScheme() ? $requestUrl->getScheme() : 'http';
     }
 }
コード例 #2
0
ファイル: UrlTest.php プロジェクト: snikch/ergo
 public function testExceptionsThrown()
 {
     $url = new Ergo_Http_Url('/');
     try {
         $url->getScheme();
         $this->fail('getScheme() should throw exception');
     } catch (Ergo_Http_UrlException $e) {
         $this->pass('getScheme() should throw exception');
     }
     try {
         $url->getHost();
         $this->fail('getHost() should throw exception');
     } catch (Ergo_Http_UrlException $e) {
         $this->pass('getHost() should throw exception');
     }
 }