Changeset 144
- Timestamp:
- 02/05/07 15:19:00 (2 years ago)
- Files:
-
- trunk/classes/phing/BuildEvent.php (modified) (1 diff)
- trunk/classes/phing/IntrospectionHelper.php (modified) (5 diffs)
- trunk/classes/phing/Phing.php (modified) (9 diffs)
- trunk/classes/phing/Project.php (modified) (18 diffs)
- trunk/classes/phing/ProjectComponent.php (modified) (1 diff)
- trunk/classes/phing/Target.php (modified) (1 diff)
- trunk/classes/phing/Task.php (modified) (1 diff)
- trunk/classes/phing/TaskAdapter.php (modified) (2 diffs)
- trunk/classes/phing/filters/BaseFilterReader.php (modified) (1 diff)
- trunk/classes/phing/filters/ReplaceRegexp.php (modified) (1 diff)
- trunk/classes/phing/filters/TranslateGettext.php (modified) (4 diffs)
- trunk/classes/phing/filters/XincludeFilter.php (modified) (1 diff)
- trunk/classes/phing/filters/XsltFilter.php (modified) (3 diffs)
- trunk/classes/phing/listener/AnsiColorLogger.php (modified) (1 diff)
- trunk/classes/phing/listener/DefaultLogger.php (modified) (5 diffs)
- trunk/classes/phing/listener/PearLogger.php (modified) (3 diffs)
- trunk/classes/phing/listener/XmlLogger.php (modified) (2 diffs)
- trunk/classes/phing/parser/ProjectConfigurator.php (modified) (2 diffs)
- trunk/classes/phing/parser/TaskHandler.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/CapsuleTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/CreoleSQLExecTask.php (modified) (8 diffs)
- trunk/classes/phing/tasks/ext/CreoleTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/ExtractBaseTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/JslLintTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/PDOSQLExecTask.php (modified) (8 diffs)
- trunk/classes/phing/tasks/ext/PDOTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/PearPackageTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/PhpLintTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/SmartyTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/TarTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/UntarTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/UnzipTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/XmlLintTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/ZendCodeAnalyzerTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/ext/ZipTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/ext/phpdoc/PHPDocumentorTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/AdhocTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/AdhocTaskdefTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/AdhocTypedefTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/AppendTask.php (modified) (6 diffs)
- trunk/classes/phing/tasks/system/AvailableTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/ChmodTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/CopyTask.php (modified) (4 diffs)
- trunk/classes/phing/tasks/system/CvsPassTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/CvsTask.php (modified) (5 diffs)
- trunk/classes/phing/tasks/system/DeleteTask.php (modified) (10 diffs)
- trunk/classes/phing/tasks/system/EchoTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/ExecTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/ForeachTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/IncludePathTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/MoveTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/PhingCallTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/PhingTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/PhpEvalTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/PropertyPromptTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/PropertyTask.php (modified) (6 diffs)
- trunk/classes/phing/tasks/system/ReflexiveTask.php (modified) (3 diffs)
- trunk/classes/phing/tasks/system/ResolvePathTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/TaskdefTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/TouchTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/UpToDateTask.php (modified) (1 diff)
- trunk/classes/phing/tasks/system/WarnTask.php (modified) (2 diffs)
- trunk/classes/phing/tasks/system/XsltTask.php (modified) (1 diff)
- trunk/classes/phing/types/AbstractFileSet.php (modified) (1 diff)
- trunk/classes/phing/types/Path.php (modified) (2 diffs)
- trunk/classes/phing/types/TokenSource.php (modified) (1 diff)
- trunk/classes/phing/util/LogWriter.php (modified) (1 diff)
- trunk/classes/phing/util/SourceFileScanner.php (modified) (4 diffs)
- trunk/pear/BuildPhingPEARPackageTask.php (modified) (1 diff)
- trunk/test/classes/example/tasks/TaskdefTestSimpleTask.php (modified) (1 diff)
- trunk/test/classes/phing/BuildFileTest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/phing/BuildEvent.php
r123 r144 76 76 * @access private 77 77 */ 78 protected $priority = P ROJECT_MSG_VERBOSE;78 protected $priority = Project::MSG_VERBOSE; 79 79 80 80 /** trunk/classes/phing/IntrospectionHelper.php
r123 r144 353 353 354 354 try { 355 $project->log(" -calling setter ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", P ROJECT_MSG_DEBUG);355 $project->log(" -calling setter ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 356 356 $method->invoke($element, $value); 357 357 } catch(Exception $exc) { … … 392 392 $method = $this->nestedCreators[$createMethod]; 393 393 try { // try to invoke the creator method on object 394 $project->log(" -calling creator ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", P ROJECT_MSG_DEBUG);394 $project->log(" -calling creator ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 395 395 $nestedElement = $method->invoke($element); 396 396 } catch (Exception $exc) { … … 406 406 try { // try to invoke the adder method on object 407 407 408 $project->log(" -calling adder ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", P ROJECT_MSG_DEBUG);408 $project->log(" -calling adder ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 409 409 // we've already assured that correct num of params 410 410 // exist and that method is using class hints … … 455 455 456 456 try { 457 $project->log(" -calling storer ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", P ROJECT_MSG_DEBUG);457 $project->log(" -calling storer ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG); 458 458 $method->invoke($element, $child); 459 459 } catch (Exception $exc) { … … 535 535 */ 536 536 function warn($msg) { 537 if (Phing::getMsgOutputLevel() === P ROJECT_MSG_DEBUG) {537 if (Phing::getMsgOutputLevel() === Project::MSG_DEBUG) { 538 538 print("[IntrospectionHelper] " . $msg . "\n"); 539 539 } trunk/classes/phing/Phing.php
r143 r144 64 64 const DEFAULT_BUILD_FILENAME = "build.xml"; 65 65 66 /** Our current message output status. Follows P ROJECT_MSG_XXX */67 private static $msgOutputLevel = P ROJECT_MSG_INFO;66 /** Our current message output status. Follows Project::MSG_XXX */ 67 private static $msgOutputLevel = Project::MSG_INFO; 68 68 69 69 /** PhingFile that we are using for configuration */ … … 116 116 function printMessage(Exception $t) { 117 117 print($t->getMessage() . "\n"); 118 if (self::getMsgOutputLevel() === P ROJECT_MSG_DEBUG) {118 if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 119 119 print($t->getTraceAsString()."\n"); 120 120 if ($t instanceof Exception) { … … 214 214 return; 215 215 } elseif ($arg == "-quiet" || $arg == "-q") { 216 self::$msgOutputLevel = P ROJECT_MSG_WARN;216 self::$msgOutputLevel = Project::MSG_WARN; 217 217 } elseif ($arg == "-verbose") { 218 218 $this->printVersion(); 219 self::$msgOutputLevel = P ROJECT_MSG_VERBOSE;219 self::$msgOutputLevel = Project::MSG_VERBOSE; 220 220 } elseif ($arg == "-debug") { 221 221 $this->printVersion(); 222 self::$msgOutputLevel = P ROJECT_MSG_DEBUG;222 self::$msgOutputLevel = Project::MSG_DEBUG; 223 223 } elseif ($arg == "-logfile") { 224 224 try { // try to set logfile … … 332 332 $filename = $file->getParent(); 333 333 334 if ($filename !== null && self::$msgOutputLevel >= P ROJECT_MSG_VERBOSE) {334 if ($filename !== null && self::$msgOutputLevel >= Project::MSG_VERBOSE) { 335 335 print("Searching in $filename\n"); 336 336 } … … 354 354 */ 355 355 function _findBuildFile($start, $suffix) { 356 if (self::$msgOutputLevel >= P ROJECT_MSG_INFO) {356 if (self::$msgOutputLevel >= Project::MSG_INFO) { 357 357 print("Searching for $suffix ...\n"); 358 358 } … … 571 571 * If there is no currently-configured Project, then this will do nothing. 572 572 * @param string $message 573 * @param int $priority P ROJECT_MSG_INFO, etc.573 * @param int $priority Project::MSG_INFO, etc. 574 574 */ 575 public static function log($message, $priority = P ROJECT_MSG_INFO) {575 public static function log($message, $priority = Project::MSG_INFO) { 576 576 $p = self::getCurrentProject(); 577 577 if ($p) { … … 603 603 case E_NOTICE: 604 604 case E_USER_NOTICE: 605 self::log($message, P ROJECT_MSG_VERBOSE);605 self::log($message, Project::MSG_VERBOSE); 606 606 break; 607 607 case E_WARNING: 608 608 case E_USER_WARNING: 609 self::log($message, P ROJECT_MSG_WARN);609 self::log($message, Project::MSG_WARN); 610 610 break; 611 611 case E_ERROR: 612 612 case E_USER_ERROR: 613 613 default: 614 self::log($message, P ROJECT_MSG_ERR);614 self::log($message, Project::MSG_ERR); 615 615 616 616 } // switch … … 870 870 $new_parts = array_diff($add_parts, $curr_parts); 871 871 if ($new_parts) { 872 if (self::getMsgOutputLevel() === P ROJECT_MSG_DEBUG) {872 if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 873 873 print("Phing::import() prepending new include_path components: " . implode(PATH_SEPARATOR, $new_parts) . "\n"); 874 874 } … … 881 881 if ($ret === false) { 882 882 $e = new BuildException("Error importing $path"); 883 if (self::getMsgOutputLevel() === P ROJECT_MSG_DEBUG) {883 if (self::getMsgOutputLevel() === Project::MSG_DEBUG) { 884 884 // We can't log this because listeners belong 885 885 // to projects. We'll just print it -- of course trunk/classes/phing/Project.php
r130 r144 20 20 */ 21 21 22 define('PROJECT_MSG_DEBUG', 4); 23 define('PROJECT_MSG_VERBOSE', 3); 24 define('PROJECT_MSG_INFO', 2); 25 define('PROJECT_MSG_WARN', 1); 26 define('PROJECT_MSG_ERR', 0); 22 // DEPRECATED logging constants 23 define('PROJECT_MSG_DEBUG', Project::MSG_DEBUG); 24 define('PROJECT_MSG_VERBOSE', Project::MSG_VERBOSE); 25 define('PROJECT_MSG_INFO', Project::MSG_INFO); 26 define('PROJECT_MSG_WARN', Project::MSG_WARN); 27 define('PROJECT_MSG_ERR', Project::MSG_ERR); 27 28 28 29 include_once 'phing/system/io/PhingFile.php'; … … 46 47 class Project { 47 48 49 // Logging level constants. 50 const MSG_DEBUG = 4; 51 const MSG_VERBOSE = 3; 52 const MSG_INFO = 2; 53 const MSG_WARN = 1; 54 const MSG_ERR = 0; 55 48 56 /** contains the targets */ 49 57 private $targets = array(); … … 195 203 // command line properties take precedence 196 204 if (isset($this->userProperties[$name])) { 197 $this->log("Override ignored for user property " . $name, P ROJECT_MSG_VERBOSE);205 $this->log("Override ignored for user property " . $name, Project::MSG_VERBOSE); 198 206 return; 199 207 } 200 208 201 209 if (isset($this->properties[$name])) { 202 $this->log("Overriding previous definition of property " . $name, P ROJECT_MSG_VERBOSE);203 } 204 205 $this->log("Setting project property: " . $name . " -> " . $value, P ROJECT_MSG_DEBUG);210 $this->log("Overriding previous definition of property " . $name, Project::MSG_VERBOSE); 211 } 212 213 $this->log("Setting project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 206 214 $this->properties[$name] = $value; 207 215 } … … 220 228 public function setNewProperty($name, $value) { 221 229 if (isset($this->properties[$name])) { 222 $this->log("Override ignored for property " . $name, P ROJECT_MSG_DEBUG);230 $this->log("Override ignored for property " . $name, Project::MSG_DEBUG); 223 231 return; 224 232 } 225 $this->log("Setting project property: " . $name . " -> " . $value, P ROJECT_MSG_DEBUG);233 $this->log("Setting project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 226 234 $this->properties[$name] = $value; 227 235 } … … 237 245 */ 238 246 public function setUserProperty($name, $value) { 239 $this->log("Setting ro project property: " . $name . " -> " . $value, P ROJECT_MSG_DEBUG);247 $this->log("Setting ro project property: " . $name . " -> " . $value, Project::MSG_DEBUG); 240 248 $this->userProperties[$name] = $value; 241 249 $this->properties[$name] = $value; … … 269 277 private function setPropertyInternal($name, $value) { 270 278 if (isset($this->userProperties[$name])) { 271 $this->log("Override ignored for user property " . $name, P ROJECT_MSG_VERBOSE);279 $this->log("Override ignored for user property " . $name, Project::MSG_VERBOSE); 272 280 return; 273 281 } … … 449 457 $this->basedir = $dir; 450 458 $this->setPropertyInternal("project.basedir", $this->basedir->getAbsolutePath()); 451 $this->log("Project base dir set to: " . $this->basedir->getPath(), P ROJECT_MSG_VERBOSE);459 $this->log("Project base dir set to: " . $this->basedir->getPath(), Project::MSG_VERBOSE); 452 460 453 461 // [HL] added this so that ./ files resolve correctly. This may be a mistake ... or may be in wrong place. … … 509 517 $class = $class; 510 518 if ($class === "") { 511 $this->log("Task $name has no class defined.", P ROJECT_MSG_ERR);519 $this->log("Task $name has no class defined.", Project::MSG_ERR); 512 520 } elseif (!isset($this->taskdefs[$name])) { 513 521 Phing::import($class, $classpath); 514 522 $this->taskdefs[$name] = $class; 515 $this->log(" +Task definiton: $name ($class)", P ROJECT_MSG_DEBUG);523 $this->log(" +Task definiton: $name ($class)", Project::MSG_DEBUG); 516 524 } else { 517 $this->log("Task $name ($class) already registerd, skipping", P ROJECT_MSG_VERBOSE);525 $this->log("Task $name ($class) already registerd, skipping", Project::MSG_VERBOSE); 518 526 } 519 527 } … … 533 541 Phing::import($typeClass, $classpath); 534 542 $this->typedefs[$typeName] = $typeClass; 535 $this->log(" +User datatype: $typeName ($typeClass)", P ROJECT_MSG_DEBUG);543 $this->log(" +User datatype: $typeName ($typeClass)", Project::MSG_DEBUG); 536 544 } else { 537 $this->log("Type $name ($class) already registerd, skipping", P ROJECT_MSG_VERBOSE);545 $this->log("Type $name ($class) already registerd, skipping", Project::MSG_VERBOSE); 538 546 } 539 547 } … … 552 560 553 561 function addOrReplaceTarget($targetName, &$target) { 554 $this->log(" +Target: $targetName", P ROJECT_MSG_DEBUG);562 $this->log(" +Target: $targetName", Project::MSG_DEBUG); 555 563 $target->setProject($this); 556 564 $this->targets[$targetName] = $target; … … 602 610 $task = $o; 603 611 } else { 604 $this->log (" (Using TaskAdapter for: $taskType)", P ROJECT_MSG_DEBUG);612 $this->log (" (Using TaskAdapter for: $taskType)", Project::MSG_DEBUG); 605 613 // not a real task, try adapter 606 614 $taskA = new TaskAdapter(); … … 612 620 // set default value, can be changed by the user 613 621 $task->setTaskName($taskType); 614 $this->log (" +Task: " . $taskType, P ROJECT_MSG_DEBUG);622 $this->log (" +Task: " . $taskType, Project::MSG_DEBUG); 615 623 } catch (Exception $t) { 616 624 throw new BuildException("Could not create task of type: " . $taskType, $t); … … 649 657 650 658 $type = new $cls(); 651 $this->log(" +Type: $typeName", P ROJECT_MSG_DEBUG);659 $this->log(" +Type: $typeName", Project::MSG_DEBUG); 652 660 if (!($type instanceof DataType)) { 653 661 throw new Exception("$class is not an instance of phing.types.DataType"); … … 701 709 $curTarget->performTasks(); 702 710 } catch (BuildException $exc) { 703 $this->log("Execution of target \"".$curTarget->getName()."\" failed for the following reason: ".$exc->getMessage(), P ROJECT_MSG_ERR);711 $this->log("Execution of target \"".$curTarget->getName()."\" failed for the following reason: ".$exc->getMessage(), Project::MSG_ERR); 704 712 throw $exc; 705 713 } … … 746 754 $retHuman .= $ret[$i]->toString()." "; 747 755 } 748 $this->log("Build sequence for target '$root' is: $retHuman", P ROJECT_MSG_VERBOSE);756 $this->log("Build sequence for target '$root' is: $retHuman", Project::MSG_VERBOSE); 749 757 750 758 $keys = array_keys($targets); … … 768 776 $retHuman .= $ret[$i]->toString()." "; 769 777 } 770 $this->log("Complete build sequence is: $retHuman", P ROJECT_MSG_VERBOSE);778 $this->log("Complete build sequence is: $retHuman", Project::MSG_VERBOSE); 771 779 772 780 return $ret; … … 854 862 function addReference($name, $object) { 855 863 if (isset($this->references[$name])) { 856 $this->log("Overriding previous definition of reference to $name", P ROJECT_MSG_WARN);857 } 858 $this->log("Adding reference: $name -> ".get_class($object), P ROJECT_MSG_DEBUG);864 $this->log("Overriding previous definition of reference to $name", Project::MSG_WARN); 865 } 866 $this->log("Adding reference: $name -> ".get_class($object), Project::MSG_DEBUG); 859 867 $this->references[$name] = $object; 860 868 } … … 884 892 * Abstracting and simplifyling Logger calls for project messages 885 893 */ 886 function log($msg, $level = P ROJECT_MSG_INFO) {894 function log($msg, $level = Project::MSG_INFO) { 887 895 $this->logObject($this, $msg, $level); 888 896 } trunk/classes/phing/ProjectComponent.php
r123 r144 65 65 * @param integer The message's priority at this message should have 66 66 */ 67 public function log($msg, $level = P ROJECT_MSG_INFO) {67 public function log($msg, $level = Project::MSG_INFO) { 68 68 if ($this->project !== null) { 69 69 $this->project->log($msg, $level); trunk/classes/phing/Target.php
r123 r144 245 245 } 246 246 } elseif (!$this->testIfCondition()) { 247 $this->project->log("Skipped target '".$this->name."' because property '".$this->ifCondition."' not set.", P ROJECT_MSG_VERBOSE);247 $this->project->log("Skipped target '".$this->name."' because property '".$this->ifCondition."' not set.", Project::MSG_VERBOSE); 248 248 } else { 249 $this->project->log("Skipped target '".$this->name."' because property '".$this->unlessCondition."' set.", P ROJECT_MSG_VERBOSE);249 $this->project->log("Skipped target '".$this->name."' because property '".$this->unlessCondition."' set.", Project::MSG_VERBOSE); 250 250 } 251 251 } trunk/classes/phing/Task.php
r123 r144 137 137 * @see BuildListener 138 138 */ 139 function log($msg, $level = P ROJECT_MSG_INFO) {139 function log($msg, $level = Project::MSG_INFO) { 140 140 $this->project->logObject($this, $msg, $level); 141 141 } trunk/classes/phing/TaskAdapter.php
r123 r144 46 46 $this->proxy->setProject($this->project); 47 47 } catch (Exception $ex) { 48 $this->log("Error setting project in " . get_class($this->proxy) . P ROJECT_MSG_ERR);48 $this->log("Error setting project in " . get_class($this->proxy) . Project::MSG_ERR); 49 49 throw new BuildException($ex); 50 50 } … … 57 57 $this->proxy->main($this->project); 58 58 } catch (Exception $ex) { 59 $this->log("Error in " . get_class($this->proxy), P ROJECT_MSG_ERR);59 $this->log("Error in " . get_class($this->proxy), Project::MSG_ERR); 60 60 throw new BuildException($ex->getMessage()); 61 61 } trunk/classes/phing/filters/BaseFilterReader.php
r123 r144 148 148 * @param int $level Priority level. 149 149 */ 150 function log($msg, $level = P ROJECT_MSG_INFO) {150 function log($msg, $level = Project::MSG_INFO) { 151 151 if ($this->project !== null) { 152 152 $this->project->log("[filter:".get_class($this)."] ".$msg, $level); trunk/classes/phing/filters/ReplaceRegexp.php
r123 r144 98 98 try { 99 99 $buffer = $regexp->replace($buffer); 100 $this->log("Performing regexp replace: /".$regexp->getPattern()."/".$regexp->getReplace()."/g".($regexp->getIgnoreCase() ? 'i' : ''), P ROJECT_MSG_VERBOSE);100 $this->log("Performing regexp replace: /".$regexp->getPattern()."/".$regexp->getReplace()."/g".($regexp->getIgnoreCase() ? 'i' : ''), Project::MSG_VERBOSE); 101 101 } catch (Exception $e) { 102 102 // perhaps mismatch in params (e.g. no replace or pattern specified) 103 $this->log("Error performing regexp replace: " . $e->getMessage(), P ROJECT_MSG_WARN);103 $this->log("Error performing regexp replace: " . $e->getMessage(), Project::MSG_WARN); 104 104 } 105 105 } trunk/classes/phing/filters/TranslateGettext.php
r123 r144 141 141 $this->storedLocale = getenv("LANG"); 142 142 143 $this->log("Setting locale to " . $this->locale, P ROJECT_MSG_DEBUG);143 $this->log("Setting locale to " . $this->locale, Project::MSG_DEBUG); 144 144 putenv("LANG=".$this->locale); 145 145 $ret = setlocale(LC_ALL, $this->locale); … … 151 151 } 152 152 153 $this->log("Binding domain '".$this->domain."' to " . $this->dir, P ROJECT_MSG_DEBUG);153 $this->log("Binding domain '".$this->domain."' to " . $this->dir, Project::MSG_DEBUG); 154 154 bindtextdomain($this->domain, $this->dir->getAbsolutePath()); 155 155 textdomain($this->domain); … … 182 182 $msgid = $matches[2]; 183 183 $translated = gettext($msgid); 184 $this->log("Translating \"$msgid\" => \"$translated\"", P ROJECT_MSG_DEBUG);184 $this->log("Translating \"$msgid\" => \"$translated\"", Project::MSG_DEBUG); 185 185 return $charbefore . '"' . $translated . '"'; 186 186 } … … 232 232 $matches = array(); 233 233 if (preg_match('/([^\w]|^)(gettext\([^\)]+\))/', $buffer, $matches)) { 234 $this->log("Unable to perform translation on: " . $matches[2], P ROJECT_MSG_WARN);234 $this->log("Unable to perform translation on: " . $matches[2], Project::MSG_WARN); 235 235 } 236 236 trunk/classes/phing/filters/XincludeFilter.php
r139 r144 73 73 74 74 if (empty($_xml)) { 75 $this->log("XML file is empty!", P ROJECT_MSG_WARN);75 $this->log("XML file is empty!", Project::MSG_WARN); 76 76 return ''; 77 77 } 78 78 79 $this->log("Transforming XML " . $this->in->getResource() . " using Xinclude ", P ROJECT_MSG_VERBOSE);79 $this->log("Transforming XML " . $this->in->getResource() . " using Xinclude ", Project::MSG_VERBOSE); 80 80 81 81 $out = ''; trunk/classes/phing/filters/XsltFilter.php
r123 r144 151 151 152 152 if(empty($_xml)) { 153 $this->log("XML file is empty!", P ROJECT_MSG_WARN);153 $this->log("XML file is empty!", Project::MSG_WARN); 154 154 return ''; // return empty string, don't attempt to apply XSLT 155 155 } … … 160 160 $xslFr->readInto($_xsl); 161 161 162 $this->log("Tranforming XML " . $this->in->getResource() . " using style " . $this->xslFile->getPath(), P ROJECT_MSG_VERBOSE);162 $this->log("Tranforming XML " . $this->in->getResource() . " using style " . $this->xslFile->getPath(), Project::MSG_VERBOSE); 163 163 164 164 $out = ''; … … 202 202 // we're only supporting direct XSL params right now 203 203 foreach($this->xsltParams as $param) { 204 $this->log("Setting XSLT param: " . $param->getName() . "=>" . $param->getExpression(), P ROJECT_MSG_DEBUG);204 $this->log("Setting XSLT param: " . $param->getName() . "=>" . $param->getExpression(), Project::MSG_DEBUG); 205 205 $processor->setParameter(null, $param->getName(), $param->getExpression()); 206 206 } trunk/classes/phing/listener/AnsiColorLogger.php
r123 r144 210 210 211 211 switch ($priority) { 212 case P ROJECT_MSG_ERR:212 case Project::MSG_ERR: 213 213 $message = $this->errColor . $message . self::END_COLOR; 214 214 break; 215 case P ROJECT_MSG_WARN:215 case Project::MSG_WARN: 216 216 $message = $this->warnColor . $message . self::END_COLOR; 217 217 break; 218 case P ROJECT_MSG_INFO:218 case Project::MSG_INFO: 219 219 $message = $this->infoColor . $message . self::END_COLOR; 220 220 break; 221 case P ROJECT_MSG_VERBOSE:221 case Project::MSG_VERBOSE: 222 222 $message = $this->verboseColor . $message . self::END_COLOR; 223 223 break; 224 case P ROJECT_MSG_DEBUG:224 case Project::MSG_DEBUG: 225 225 $message = $this->debugColor . $message . self::END_COLOR; 226 226 break; trunk/classes/phing/listener/DefaultLogger.php
r143 r144 45 45 /** 46 46 * The message output level that should be used. The default is 47 * <code>P ROJECT_MSG_VERBOSE</code>.47 * <code>Project::MSG_VERBOSE</code>. 48 48 * @var int 49 49 */ 50 protected $msgOutputLevel = P ROJECT_MSG_ERR;50 protected $msgOutputLevel = Project::MSG_ERR; 51 51 52 52 /** … … 80 80 * 81 81 * <ul> 82 * <li>P ROJECT_MSG_ERR</li>83 * <li>P ROJECT_MSG_WARN</li>84 * <li>P ROJECT_MSG_INFO</li>85 * <li>P ROJECT_MSG_VERBOSE</li>86 * <li>P ROJECT_MSG_DEBUG</li>82 * <li>Project::MSG_ERR</li> 83 * <li>Project::MSG_WARN</li> 84 * <li>Project::MSG_INFO</li> 85 * <li>Project::MSG_VERBOSE</li> 86 * <li>Project::MSG_DEBUG</li> 87 87 * </ul> 88 88 * 89 * The default message level for DefaultLogger is P ROJECT_MSG_ERR.89 * The default message level for DefaultLogger is Project::MSG_ERR. 90 90 * 91 91 * @param integer the logging level for the logger. … … 106 106 function buildStarted(BuildEvent $event) { 107 107 $this->startTime = Phing::currentTimeMillis(); 108 if ($this->msgOutputLevel >= P ROJECT_MSG_INFO) {109 $this->printMessage("Buildfile: ".$event->getProject()->getProperty("phing.file"), P ROJECT_MSG_INFO);108 if ($this->msgOutputLevel >= Project::MSG_INFO) { 109 $this->printMessage("Buildfile: ".$event->getProject()->getProperty("phing.file"), Project::MSG_INFO); 110 110 } 111 111 } … … 125 125 } else { 126 126 print($this->lSep . "BUILD FAILED" . $this->lSep); 127 if (P ROJECT_MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) {127 if (Project::MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) { 128 128 print($error->__toString().$this->lSep); 129 129 } else { … … 142 142 */ 143 143 function targetStarted(BuildEvent $event) { 144 if (P ROJECT_MSG_INFO <= $this->msgOutputLevel) {144 if (Project::MSG_INFO <= $this->msgOutputLevel) { 145 145 print($this->lSep . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ':' . $this->lSep); 146 146 } trunk/classes/phing/listener/PearLogger.php
r143 r144 53 53 /** 54 54 * The message output level that should be used. The default is 55 * <code>P ROJECT_MSG_VERBOSE</code>.55 * <code>Project::MSG_VERBOSE</code>. 56 56 * @var int 57 57 */ 58 protected $msgOutputLevel = P ROJECT_MSG_DEBUG;58 protected $msgOutputLevel = Project::MSG_DEBUG; 59 59 60 60 /** … … 65 65 66 66 /** 67 * Maps Phing P ROJECT_MSG_* constants to PEAR_LOG_* constants.67 * Maps Phing Project::MSG_* constants to PEAR_LOG_* constants. 68 68 * @var array 69 69 */ 70 protected static $levelMap = array( P ROJECT_MSG_DEBUG => PEAR_LOG_DEBUG,71 P ROJECT_MSG_INFO => PEAR_LOG_INFO,72 P ROJECT_MSG_VERBOSE => PEAR_LOG_NOTICE,73 P ROJECT_MSG_WARN => PEAR_LOG_WARNING,74 P ROJECT_MSG_ERR => PEAR_LOG_ERR70 protected static $levelMap = array( Project::MSG_DEBUG => PEAR_LOG_DEBUG, 71 Project::MSG_INFO => PEAR_LOG_INFO, 72 Project::MSG_VERBOSE => PEAR_LOG_NOTICE, 73 Project::MSG_WARN => PEAR_LOG_WARNING, 74 Project::MSG_ERR => PEAR_LOG_ERR 75 75 ); 76 76 /** … … 129 129 * 130 130 * <ul> 131 * <li>P ROJECT_MSG_ERR</li>132 * <li>P ROJECT_MSG_WARN</li>133 * <li>P ROJECT_MSG_INFO</li>134 * <li>P ROJECT_MSG_VERBOSE</li>135 * <li>P ROJECT_MSG_DEBUG</li>131 * <li>Project::MSG_ERR</li> 132 * <li>Project::MSG_WARN</li> 133 * <li>Project::MSG_INFO</li> 134 * <li>Project::MSG_VERBOSE</li> 135 * <li>Project::MSG_DEBUG</li> 136 136 * </ul> 137 137 * 138 * The default message level for DefaultLogger is P ROJECT_MSG_ERR.138 * The default message level for DefaultLogger is Project::MSG_ERR. 139 139 * 140 140 * @param integer the logging level for the logger. trunk/classes/phing/listener/XmlLogger.php
r143 r144 64 64 private $buildElement = NULL; 65 65 66 private $msgOutputLevel = P ROJECT_MSG_DEBUG;66 private $msgOutputLevel = Project::MSG_DEBUG; 67 67 68 68 /** … … 229 229 switch ($priority) 230 230 { 231 case P ROJECT_MSG_ERR:231 case Project::MSG_ERR: 232 232 $name = "error"; 233 233 break; 234 234 235 case P ROJECT_MSG_WARN:235 case Project::MSG_WARN: 236 236 $name = "warn"; 237 237 break; 238 238 239 case P ROJECT_MSG_INFO:239 case Project::MSG_INFO: 240 240 $name = "info"; 241 241 break; trunk/classes/phing/parser/ProjectConfigurator.php
r143 r144 89 89 $parser->parserSetOption(XML_OPTION_CASE_FOLDING,0); 90 90 $parser->setHandler(new RootHandler($parser, $this));
