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


PHP ezcBaseFile::isAbsolutePath方法代碼示例

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


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

示例1: process

 /**
  * Processes the template with the variables added by the send() method.
  * The result of this action should be retrievable through the getResult() method.
  *
  * The $last parameter is set if the view handler is the last one in the
  * list of zones for a specific view.
  *
  * @param bool $last
  */
 public function process($last)
 {
     if (!file_exists($this->templateLocation)) {
         $fileName = ezcBaseFile::isAbsolutePath($this->templateLocation) ? $this->templateLocation : getcwd() . DIRECTORY_SEPARATOR . $this->templateLocation;
         throw new ezcBaseFileNotFoundException($fileName, 'php template');
     }
     ob_start();
     include $this->templateLocation;
     $this->result = ob_get_contents();
     ob_end_clean();
 }
開發者ID:bmdevel,項目名稱:ezc,代碼行數:20,代碼來源:php.php

示例2: getFile

 /**
  * Check and return file
  *
  * Check for the files location, and return the absolute path to the file,
  * or thorw an exception, if the file could not be found.
  * 
  * @param string $file 
  * @return string
  */
 protected function getFile($file)
 {
     if (!ezcBaseFile::isAbsolutePath($file)) {
         // If path to file is not an absolute path, use the given relative
         // path relative to the currently processed document location.
         $file = $this->path . $file;
     }
     // @TODO: docutils performs automatic checks, that no system files
     // (like /etc/passwd) are included - do we want to do similar stuff
     // here?
     // Throw an exception, if we cannot find the referenced file
     if (!is_file($file) || !is_readable($file)) {
         throw new ezcBaseFileNotFoundException($file);
     }
     return $file;
 }
開發者ID:jackalope,項目名稱:jr_cr_demo,代碼行數:25,代碼來源:include.php

示例3: testAbsoluteLinux3

 public static function testAbsoluteLinux3()
 {
     if (ezcBaseFeatures::os() === 'Windows') {
         self::markTestSkipped('Test is for unix-like systems only');
     }
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c://winnt//winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c:/winnt/winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c://winnt'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c://winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c:/winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c://winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c:/table.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c:winnt'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('c//winnt.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//winnt.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('/winnt.sys'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('winnt.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//server/share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('////server/share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//tequila/share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('////tequila/share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//tequila/thare/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('////tequila/thare/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//server//share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('////server//share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//tequila//share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('////tequila//share/foo.sys'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('/etc/init.d/apache'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('//etc//init.d//apache'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('etc/init.d/apache'));
     self::assertEquals(false, ezcBaseFile::isAbsolutePath('etc//init.d//apache'));
 }
開發者ID:andikoller,項目名稱:FHC-3.0-FHBGLD,代碼行數:32,代碼來源:file_is_absolute_path.php

示例4: testAbsoluteStreamWrapper

 public static function testAbsoluteStreamWrapper()
 {
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('phar://test.phar/foo'));
     self::assertEquals(true, ezcBaseFile::isAbsolutePath('http://example.com/file'));
 }
開發者ID:broschb,項目名稱:cyclebrain,代碼行數:5,代碼來源:file_is_absolute_path.php

示例5: locateFile

 /**
  * Tries to locate a file
  *
  * Tries to locate a file, referenced in a docbook document. If available
  * the document path is used a base for relative paths.
  *
  * @param string $file
  * @return string
  */
 public function locateFile($file)
 {
     if (!ezcBaseFile::isAbsolutePath($file)) {
         $file = $this->document->getPath() . $file;
     }
     if (!is_file($file)) {
         throw new ezcBaseFileNotFoundException($file);
     }
     return $file;
 }
開發者ID:bmdevel,項目名稱:ezc,代碼行數:19,代碼來源:main.php


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