/** * 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. } }
/** * 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; }
private function _checkResource($resource) { if (null != ($resourcePath = Phing::getResourcePath($resource))) { return $this->_checkFile1(new PhingFile($resourcePath)); } else { return false; } }
/** 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"); } }
function _checkResource($resource) { return $this->_checkFile1(new PhingFile(Phing::getResourcePath($resource))); }