当前位置: 首页>>代码示例>>PHP>>正文


PHP Phing::getResourcePath方法代码示例

本文整理汇总了PHP中Phing::getResourcePath方法的典型用法代码示例。如果您正苦于以下问题:PHP Phing::getResourcePath方法的具体用法?PHP Phing::getResourcePath怎么用?PHP Phing::getResourcePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Phing的用法示例。


在下文中一共展示了Phing::getResourcePath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setColors

 /**
  * Set the colors to use from a property file specified in the
  * special phing property file "phing/listener/defaults.properties".
  */
 private final function setColors()
 {
     $systemColorFile = new PhingFile(Phing::getResourcePath("phing/listener/defaults.properties"));
     try {
         $prop = new Properties();
         $prop->load($systemColorFile);
         $err = $prop->getProperty("HtmlColorLogger.ERROR_CLASS");
         $warn = $prop->getProperty("HtmlColorLogger.WARNING_CLASS");
         $info = $prop->getProperty("HtmlColorLogger.INFO_CLASS");
         $verbose = $prop->getProperty("HtmlColorLogger.VERBOSE_CLASS");
         $debug = $prop->getProperty("HtmlColorLogger.DEBUG_CLASS");
         if ($err !== null) {
             $this->errColor = self::PREFIX . $err . self::SUFFIX;
         }
         if ($warn !== null) {
             $this->warnColor = self::PREFIX . $warn . self::SUFFIX;
         }
         if ($info !== null) {
             $this->infoColor = self::PREFIX . $info . self::SUFFIX;
         }
         if ($verbose !== null) {
             $this->verboseColor = self::PREFIX . $verbose . self::SUFFIX;
         }
         if ($debug !== null) {
             $this->debugColor = self::PREFIX . $debug . self::SUFFIX;
         }
     } catch (IOException $ioe) {
         //Ignore exception - we will use the defaults.
     }
 }
开发者ID:altesien,项目名称:FinalProject,代码行数:34,代码来源:HtmlColorLogger.php

示例2: getStyleSheet

 /**
  * Returns the path to the XSL stylesheet
  */
 private function getStyleSheet()
 {
     $xslname = "phpunit2-" . $this->format . ".xsl";
     if ($this->styleDir) {
         $file = new PhingFile($this->styleDir, $xslname);
     } else {
         $path = Phing::getResourcePath("phing/etc/{$xslname}");
         if ($path === NULL) {
             $path = Phing::getResourcePath("etc/{$xslname}");
             if ($path === NULL) {
                 throw new BuildException("Could not find {$xslname} in resource path");
             }
         }
         $file = new PhingFile($path);
     }
     if (!$file->exists()) {
         throw new BuildException("Could not find file " . $file->getPath());
     }
     return $file;
 }
开发者ID:taryono,项目名称:school,代码行数:23,代码来源:PHPUnit2ReportTask.php

示例3: _checkResource

 private function _checkResource($resource)
 {
     if (null != ($resourcePath = Phing::getResourcePath($resource))) {
         return $this->_checkFile1(new PhingFile($resourcePath));
     } else {
         return false;
     }
 }
开发者ID:ngroot,项目名称:phing,代码行数:8,代码来源:AvailableTask.php

示例4: init

 /** inits the project, called from main app */
 public function init()
 {
     // set builtin properties
     $this->setSystemProperties();
     // load default tasks
     $taskdefs = Phing::getResourcePath("phing/tasks/defaults.properties");
     try {
         // try to load taskdefs
         $props = new Properties();
         $in = new PhingFile((string) $taskdefs);
         if ($in === null) {
             throw new BuildException("Can't load default task list");
         }
         $props->load($in);
         $enum = $props->propertyNames();
         foreach ($enum as $key) {
             $value = $props->getProperty($key);
             $this->addTaskDefinition($key, $value);
         }
     } catch (IOException $ioe) {
         throw new BuildException("Can't load default task list");
     }
     // load default tasks
     $typedefs = Phing::getResourcePath("phing/types/defaults.properties");
     try {
         // try to load typedefs
         $props = new Properties();
         $in = new PhingFile((string) $typedefs);
         if ($in === null) {
             throw new BuildException("Can't load default datatype list");
         }
         $props->load($in);
         $enum = $props->propertyNames();
         foreach ($enum as $key) {
             $value = $props->getProperty($key);
             $this->addDataTypeDefinition($key, $value);
         }
     } catch (IOException $ioe) {
         throw new BuildException("Can't load default datatype list");
     }
 }
开发者ID:Ingewikkeld,项目名称:phing,代码行数:42,代码来源:Project.php

示例5: _checkResource

 function _checkResource($resource)
 {
     return $this->_checkFile1(new PhingFile(Phing::getResourcePath($resource)));
 }
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:4,代码来源:AvailableTask.php


注:本文中的Phing::getResourcePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。