本文整理汇总了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.
}
}
示例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;
}
示例3: _checkResource
private function _checkResource($resource)
{
if (null != ($resourcePath = Phing::getResourcePath($resource))) {
return $this->_checkFile1(new PhingFile($resourcePath));
} else {
return false;
}
}
示例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");
}
}
示例5: _checkResource
function _checkResource($resource)
{
return $this->_checkFile1(new PhingFile(Phing::getResourcePath($resource)));
}