当前位置: 首页>>代码示例>>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;未经允许,请勿转载。