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


PHP URL::toString方法代碼示例

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


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

示例1: FileReader

 function FileReader($file = NULL)
 {
     $fileobj = NULL;
     if (!isset($file)) {
         return;
     }
     if (URL::validClass($file)) {
         $fileobj = $file;
         $path = $fileobj->toString();
     } else {
         if (File::validClass($file)) {
             $fileobj = $file;
             $path = $fileobj->getFilePath();
         } else {
             $str = StringBuffer::toStringBuffer($file);
             if ($str->startsWith('http://') || $str->startsWith('ftp://') || $str->startsWith('php://')) {
                 $fileobj = new URL($str);
                 $path = $fileobj->toString();
             } else {
                 $fileobj = new File($file);
                 $path = $fileobj->getFilePath();
             }
         }
     }
     if (isset($fileobj)) {
         $this->handle = @fopen($path, 'r');
         if (isset($this->handle)) {
             $this->file = $fileobj;
         }
     }
 }
開發者ID:alexpagnoni,項目名稱:jphp,代碼行數:31,代碼來源:FileReader.php

示例2: rewrite

 static function rewrite(Location $l) {
   $rv = Location::rewrite($l);
   $u = new URL($rv);
   
   $action = $u->query['action'];
   unSet($u->query['action']);
   $u->resource = $action;
   return str_replace('?', '/', $u->toString());
 }
開發者ID:BackupTheBerlios,項目名稱:freeform-frmwrk,代碼行數:9,代碼來源:FDLocationRewriter2.php5

示例3: rewrite

 static function rewrite(Location $l) {
   $rv = Location::rewrite($l);
   $u = new URL($rv);
   
   list($path, $res) = explode('?', $rv);
   $res = base64_encode($res); 
   $u->query = array();
   $u->resource = '';
   return $u->toString() . $res;
 }
開發者ID:BackupTheBerlios,項目名稱:freeform-frmwrk,代碼行數:10,代碼來源:FDLocationRewriter1.php5

示例4: equals

 /**
  * Tests whether two URLs are equal.
  * Two URLs are equal if they have all fields equal, possibly except for ref
  *
  * @param  mixed $url the url to compare to
  * @return  bool  true if two locations are equal
  */
 function equals($url) {
   if (! ( $url instanceof URL))
   $url = new URL($url);
   return  $url->isWellformed() && $this->isWellformed() && ($this->toString(false) === $url->toString(false));
 }
開發者ID:BackupTheBerlios,項目名稱:freeform-frmwrk,代碼行數:12,代碼來源:URL.php5

示例5: isSealed

 public function isSealed(URL $url)
 {
     if ($this->sealBase->toString() == $url->toString()) {
         return true;
     }
     return false;
 }
開發者ID:rgantt,項目名稱:japha,代碼行數:7,代碼來源:Package.php

示例6: toString

 /** @return string */
 public function toString()
 {
     return $this->url ? $this->url->toString() : $this->path;
 }
開發者ID:rsms,項目名稱:phpab,代碼行數:5,代碼來源:File.php


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