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