當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleUrl::makeAbsolute方法代碼示例

本文整理匯總了PHP中SimpleUrl::makeAbsolute方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleUrl::makeAbsolute方法的具體用法?PHP SimpleUrl::makeAbsolute怎麽用?PHP SimpleUrl::makeAbsolute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleUrl的用法示例。


在下文中一共展示了SimpleUrl::makeAbsolute方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: SimpleUrl

 function _createAction($action, $base)
 {
     if (is_bool($action)) {
         return $base;
     }
     $url = new SimpleUrl($action);
     return $url->makeAbsolute($base);
 }
開發者ID:BackupTheBerlios,項目名稱:phpbase-svn,代碼行數:8,代碼來源:form.php

示例2: SimpleUrl

 /**
  *    Combined action attribute with current location
  *    to get an absolute form target.
  *    @param string $action    Action attribute from form tag.
  *    @param SimpleUrl $base   Page location.
  *    @return SimpleUrl        Absolute form target.
  */
 function _createAction($action, $base)
 {
     if ($action === false) {
         return $base;
     }
     if ($action === true) {
         $url = new SimpleUrl('');
     } else {
         $url = new SimpleUrl($action);
     }
     return $url->makeAbsolute($base);
 }
開發者ID:BGCX067,項目名稱:ezpdo2-svn-to-git,代碼行數:19,代碼來源:form.php

示例3: fetchWhileRedirected

 /**
  *    Fetches the page until no longer redirected or
  *    until the redirect limit runs out.
  *    @param SimpleUrl $url                  Target to fetch.
  *    @param SimpelFormEncoding $encoding    Additional parameters for request.
  *    @return SimpleHttpResponse             Hopefully the target page.
  *    @access private
  */
 protected function fetchWhileRedirected($url, $encoding)
 {
     $redirects = 0;
     do {
         $response = $this->fetch($url, $encoding);
         if ($response->isError()) {
             return $response;
         }
         $headers = $response->getHeaders();
         if ($this->cookies_enabled) {
             $headers->writeCookiesToJar($this->cookie_jar, $url);
         }
         if (!$headers->isRedirect()) {
             break;
         }
         $location = new SimpleUrl($headers->getLocation());
         $url = $location->makeAbsolute($url);
         $encoding = new SimpleGetEncoding();
     } while (!$this->isTooManyRedirects(++$redirects));
     return $response;
 }
開發者ID:Boris-de,項目名稱:videodb,代碼行數:29,代碼來源:user_agent.php

示例4: SimpleUrl

 function testMakingHostOnlyAbsoluteDoesNotCarryAnyOtherInformation()
 {
     $url = new SimpleUrl('http://www.lastcraft.com');
     $absolute = $url->makeAbsolute('https://host.com:81/here/');
     $this->assertEqual($absolute->getScheme(), 'http');
     $this->assertEqual($absolute->getHost(), 'www.lastcraft.com');
     $this->assertIdentical($absolute->getPort(), false);
     $this->assertEqual($absolute->getPath(), '/');
 }
開發者ID:PublicityPort,項目名稱:OpenCATS,代碼行數:9,代碼來源:url_test.php

示例5: SimpleUrl

 /**
  *    Expands expandomatic URLs into fully qualified
  *    URLs.
  *    @param SimpleUrl $url        Relative URL.
  *    @return SimpleUrl            Absolute URL.
  *    @access protected
  */
 function _makeAbsolute($url)
 {
     if (!is_object($url)) {
         $url = new SimpleUrl($url);
     }
     return $url->makeAbsolute($this->getUrl());
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:14,代碼來源:page.php

示例6: createAbsoluteUrl

 /**
  *    Turns an incoming URL string into a
  *    URL object, filling the relative URL if
  *    a base URL is present.
  *    @param string $base_url       Browser current URL.
  *    @param string $raw_url        Incoming URL.
  *    @param hash $parameters       Additional request, parameters.
  *    @return SimpleUrl             Absolute URL.
  *    @access public
  *    @static
  */
 function createAbsoluteUrl($base_url, $raw_url, $parameters = false)
 {
     $url = new SimpleUrl($raw_url);
     if ($parameters) {
         $url->addRequestParameters($parameters);
     }
     $url->makeAbsolute($base_url);
     return $url;
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:20,代碼來源:user_agent.php

示例7: expandUrl

 /**
  *    Expands expandomatic URLs into fully qualified
  *    URLs.
  *    @param SimpleUrl $url        Relative URL.
  *    @return SimpleUrl            Absolute URL.
  *    @access public
  */
 function expandUrl($url)
 {
     if (!is_object($url)) {
         $url = new SimpleUrl($url);
     }
     $location = $this->getBaseUrl() ? $this->getBaseUrl() : new SimpleUrl();
     return $url->makeAbsolute($location->makeAbsolute($this->getUrl()));
 }
開發者ID:r-kitaev,項目名稱:limb,代碼行數:15,代碼來源:page.php

示例8: testMakingAbsoluteAppendedPath

 function testMakingAbsoluteAppendedPath()
 {
     $url = new SimpleUrl("./there/somewhere.php");
     $url->makeAbsolute("http://host.com/here/");
     $this->assertEqual($url->getPath(), "/here/there/somewhere.php");
     $base = new SimpleUrl("http://host.com/here/");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:7,代碼來源:http_test.php

示例9: SimpleUrl

 /**
  *    Combined action attribute with current location
  *    to get an absolute form target.
  *    @param string $action    Action attribute from form tag.
  *    @param SimpleUrl $base   Page location.
  *    @return SimpleUrl        Absolute form target.
  */
 function _createAction($action, $base)
 {
     if ($action === '' || $action === false) {
         return $base;
     }
     $url = new SimpleUrl($action);
     return $url->makeAbsolute($base);
 }
開發者ID:Spark-Eleven,項目名稱:revive-adserver,代碼行數:15,代碼來源:form.php

示例10: SimpleUrl

 /**
  *    Fetches the page until no longer redirected or
  *    until the redirect limit runs out.
  *    @param string $method                  GET, POST, etc.
  *    @param SimpleUrl $url                  Target to fetch.
  *    @param SimpelFormEncoding $parameters  Additional parameters for request.
  *    @return SimpleHttpResponse             Hopefully the target page.
  *    @access private
  */
 function &_fetchWhileRedirected($method, $url, $parameters)
 {
     $redirects = 0;
     do {
         $response =& $this->_fetch($method, $url, $parameters);
         if ($response->isError()) {
             return $response;
         }
         $headers = $response->getHeaders();
         $location = new SimpleUrl($headers->getLocation());
         $url = $location->makeAbsolute($url);
         $this->_addCookiesToJar($url, $headers->getNewCookies());
         if (!$headers->isRedirect()) {
             break;
         }
         $method = 'GET';
         $parameters = false;
     } while (!$this->_isTooManyRedirects(++$redirects));
     return $response;
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:29,代碼來源:user_agent.php

示例11: createAbsoluteUrl

 /**
  *    Turns an incoming URL string or object into a
  *    URL object, filling the relative URL if
  *    a base URL is present.
  *    @param string/SimpleUrl $base Browser current URL.
  *    @param string/SimpleUrl $url  Incoming URL.
  *    @return SimpleUrl             Absolute URL.
  *    @access public
  *    @static
  */
 function createAbsoluteUrl($base, $url)
 {
     if (!is_object($url)) {
         $url = new SimpleUrl($url);
     }
     $url->makeAbsolute($base);
     return $url;
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:18,代碼來源:user_agent.php

示例12: SimpleUrl

 function testMakingAbsolutehasNoEffectWhenAlreadyAbsolute()
 {
     $url = new SimpleUrl('https://test:secret@www.lastcraft.com/stuff/');
     $url->makeAbsolute('http://host.com/here/');
     $this->assertEqual($url->getScheme(), 'https');
     $this->assertEqual($url->getUsername(), 'test');
     $this->assertEqual($url->getPassword(), 'secret');
     $this->assertEqual($url->getHost(), 'www.lastcraft.com');
     $this->assertEqual($url->getPath(), '/stuff/');
 }
開發者ID:sebs,項目名稱:simpletest,代碼行數:10,代碼來源:http_test.php

示例13: SimpleUrl

 /**
  *    Fetches the page until no longer redirected or
  *    until the redirect limit runs out.
  *    @param SimpleUrl $url                  Target to fetch.
  *    @param SimpelFormEncoding $encoding    Additional parameters for request.
  *    @return SimpleHttpResponse             Hopefully the target page.
  *    @access private
  */
 function &_fetchWhileRedirected($url, $encoding)
 {
     $redirects = 0;
     do {
         $response =& $this->_fetch($url, $encoding);
         if ($response->isError()) {
             return $response;
         }
         $headers = $response->getHeaders();
         $location = new SimpleUrl($headers->getLocation());
         $url = $location->makeAbsolute($url);
         $this->_addCookiesToJar($url, $headers->getNewCookies());
         if (!$headers->isRedirect()) {
             break;
         }
         $encoding = new SimpleGetEncoding();
     } while (!$this->_isTooManyRedirects(++$redirects));
     return $response;
 }
開發者ID:emma5021,項目名稱:toba,代碼行數:27,代碼來源:user_agent.php


注:本文中的SimpleUrl::makeAbsolute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。