composer updated

propel installed but not integrated yet
new autoload process including classMap
This commit is contained in:
Manuel Raynaud
2012-12-11 11:00:04 +01:00
parent 43ec85bb1e
commit e0e5c58c1b
1821 changed files with 267545 additions and 34496 deletions

View File

@@ -21,4 +21,11 @@ foreach ($namespaces as $namespace => $directory) {
$loader->registerNamespace('Thelia', __DIR__ . '/lib/');
if(file_exists(__DIR__ . '/vendor/composer/autoload_classmap.php'))
{
$classMap = require __DIR__ . '/vendor/composer/autoload_classmap.php';
$loader->addClassMap($classMap);
}
$loader->register();

View File

@@ -7,7 +7,8 @@
"symfony/yaml" : "2.1.*",
"symfony/dependency-injection" : "2.1.*",
"symfony/console" : "2.1.*",
"symfony/event-dispatcher" : "2.1.*"
"symfony/event-dispatcher" : "2.1.*",
"propel/propel1" : "1.6.*"
},
"minimum-stability": "stable"
}

357
core/composer.lock generated
View File

@@ -1,19 +1,131 @@
{
"hash": "49f3143b77fd4fbd695a56746b52042a",
"hash": "1d8c7207462e0d701000ae6e732d0301",
"packages": [
{
"name": "phing/phing",
"version": "2.4.14",
"source": {
"type": "git",
"url": "https://github.com/phingofficial/phing",
"reference": "2.4.14"
},
"dist": {
"type": "zip",
"url": "https://github.com/phingofficial/phing/archive/2.4.14.zip",
"reference": "2.4.14",
"shasum": ""
},
"require": {
"php": ">=5.2.0"
},
"time": "2012-11-29 21:23:47",
"bin": [
"bin/phing"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"classmap": [
"classes/phing/"
]
},
"include-path": [
"classes"
],
"license": [
"LGPL3"
],
"authors": [
{
"name": "Michiel Rook",
"email": "mrook@php.net"
},
{
"name": "Phing Community",
"homepage": "http://www.phing.info/trac/wiki/Development/Contributors"
}
],
"description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.",
"homepage": "http://www.phing.info/",
"keywords": [
"build",
"task",
"tool"
]
},
{
"name": "propel/propel1",
"version": "1.6.7",
"source": {
"type": "git",
"url": "https://github.com/propelorm/Propel",
"reference": "1.6.7"
},
"dist": {
"type": "zip",
"url": "https://github.com/propelorm/Propel/zipball/1.6.7",
"reference": "1.6.7",
"shasum": ""
},
"require": {
"php": ">=5.2.4",
"phing/phing": ">=2.4.12,2.4.*"
},
"time": "2012-07-30 00:58:15",
"bin": [
"generator/bin/propel-gen",
"generator/bin/propel-gen.bat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.6-dev"
}
},
"installation-source": "dist",
"autoload": {
"classmap": [
"runtime/lib",
"generator/lib"
]
},
"include-path": [
"runtime/lib",
"generator/lib"
],
"license": [
"MIT"
],
"authors": [
{
"name": "William Durand",
"email": "william.durand1@gmail.com",
"homepage": "http://www.willdurand.fr"
}
],
"description": "Propel is an open-source Object-Relational Mapping (ORM) for PHP5.",
"homepage": "http://www.propelorm.org/",
"keywords": [
"database",
"orm",
"persistence",
"Active Record",
"mapping"
]
},
{
"name": "symfony/class-loader",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/ClassLoader/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -22,7 +134,7 @@
"require-dev": {
"symfony/finder": "2.1.*"
},
"time": "2012-09-01 07:02:36",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -34,27 +146,42 @@
"psr-0": {
"Symfony\\Component\\ClassLoader": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/config",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Config/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Config/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -66,27 +193,42 @@
"psr-0": {
"Symfony\\Component\\Config": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/console",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Console/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Console/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-09 08:52:51",
"type": "library",
"extra": {
"branch-alias": {
@@ -98,21 +240,36 @@
"psr-0": {
"Symfony\\Component\\Console": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/DependencyInjection/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -126,7 +283,7 @@
"symfony/yaml": "2.1.*",
"symfony/config": "2.1.*"
},
"time": "2012-09-17 18:41:57",
"time": "2012-11-11 11:59:36",
"type": "library",
"extra": {
"branch-alias": {
@@ -138,21 +295,36 @@
"psr-0": {
"Symfony\\Component\\DependencyInjection": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/EventDispatcher/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -165,7 +337,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/http-kernel": "2.1.*"
},
"time": "2012-09-10 08:53:42",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -177,27 +349,42 @@
"psr-0": {
"Symfony\\Component\\EventDispatcher": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/http-foundation",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/HttpFoundation/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-09-18 14:09:52",
"time": "2012-11-30 12:53:14",
"type": "library",
"extra": {
"branch-alias": {
@@ -210,21 +397,36 @@
"Symfony\\Component\\HttpFoundation": "",
"SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/http-kernel",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/HttpKernel/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -250,7 +452,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.1.*"
},
"time": "2012-09-20 05:13:00",
"time": "2012-11-29 11:56:19",
"type": "library",
"extra": {
"branch-alias": {
@@ -262,21 +464,36 @@
"psr-0": {
"Symfony\\Component\\HttpKernel": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/routing",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/Routing/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -293,7 +510,7 @@
"symfony/yaml": "2.1.*",
"doctrine/common": ">=2.2,<2.4-dev"
},
"time": "2012-09-10 08:53:42",
"time": "2012-11-19 10:35:29",
"type": "library",
"extra": {
"branch-alias": {
@@ -305,27 +522,42 @@
"psr-0": {
"Symfony\\Component\\Routing": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/yaml",
"version": "v2.1.2",
"version": "v2.1.4",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -337,7 +569,22 @@
"psr-0": {
"Symfony\\Component\\Yaml": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com"
}
],
"packages-dev": null,

View File

@@ -9,7 +9,9 @@ use Symfony\Component\ClassLoader\UniversalClassLoader;
*
* extends Symfony\Component\ClassLoader\UniversalClassLoader
*
* This class respect PSR-0 autoloading standard and allow to load traditionnal Thelia classes
* This class respect PSR-0 autoloading standard and allow to load traditionnal Thelia classes.
*
* classMap can be used to.
*
* @author Manuel Raynaud <mraynaud@openstudio.fr>
*
@@ -18,6 +20,7 @@ use Symfony\Component\ClassLoader\UniversalClassLoader;
class TheliaUniversalClassLoader extends UniversalClassLoader
{
private $directories = array();
private $classMap = array();
/**
*
@@ -53,6 +56,18 @@ class TheliaUniversalClassLoader extends UniversalClassLoader
{
return $this->directories;
}
/**
* @param array $classMap Class to filename map
*/
public function addClassMap(array $classMap)
{
if ($this->classMap) {
$this->classMap = array_merge($this->classMap, $classMap);
} else {
$this->classMap = $classMap;
}
}
/**
*
@@ -63,6 +78,10 @@ class TheliaUniversalClassLoader extends UniversalClassLoader
*/
public function findFile($class)
{
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
foreach ($this->directories as $directory) {
if (is_file($directory.DIRECTORY_SEPARATOR.$class.".class.php")) {

View File

@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer' . '/autoload_real.php';
return ComposerAutoloaderInit::getLoader();
return ComposerAutoloaderInit905b30423346316c3c4a4d3d5d31b16c::getLoader();

1
core/vendor/bin/phing vendored Symbolic link
View File

@@ -0,0 +1 @@
../phing/phing/bin/phing

1
core/vendor/bin/propel-gen vendored Symbolic link
View File

@@ -0,0 +1 @@
../propel/propel1/generator/bin/propel-gen

1
core/vendor/bin/propel-gen.bat vendored Symbolic link
View File

@@ -0,0 +1 @@
../propel/propel1/generator/bin/propel-gen.bat

View File

@@ -162,14 +162,14 @@ class ClassLoader
*/
public function findFile($class)
{
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if ('\\' == $class[0]) {
$class = substr($class, 1);
}
if (isset($this->classMap[$class])) {
return $this->classMap[$class];
}
if (false !== $pos = strrpos($class, '\\')) {
// namespaced class name
$classPath = str_replace('\\', DIRECTORY_SEPARATOR, substr($class, 0, $pos)) . DIRECTORY_SEPARATOR;
@@ -202,6 +202,6 @@ class ClassLoader
return $file;
}
$this->classMap[$class] = false;
return $this->classMap[$class] = false;
}
}

View File

@@ -6,4 +6,622 @@ $vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
'*/' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/templates/queryJoinWithI18n.php',
'AbstractFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/AbstractFileSet.php',
'AbstractHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/AbstractHandler.php',
'AbstractLiquibaseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/AbstractLiquibaseTask.php',
'AbstractPropelDataModelTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/AbstractPropelDataModelTask.php',
'AbstractSAXParser' => $baseDir . '/vendor/phing/phing/classes/phing/parser/AbstractSAXParser.php',
'AdhocTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/AdhocTask.php',
'AdhocTaskdefTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/AdhocTaskdefTask.php',
'AdhocTypedefTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/AdhocTypedefTask.php',
'AggregateColumnBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/aggregate_column/AggregateColumnBehavior.php',
'AggregateColumnRelationBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/aggregate_column/AggregateColumnRelationBehavior.php',
'AlternativeCodingStandardsBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/AlternativeCodingStandardsBehavior.php',
'AndCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/AndCondition.php',
'AndSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/AndSelector.php',
'AnsiColorLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/AnsiColorLogger.php',
'ApiGenTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/apigen/ApiGenTask.php',
'AppData' => $baseDir . '/vendor/propel/propel1/generator/lib/model/AppData.php',
'AppendTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/AppendTask.php',
'ArchivableBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/archivable/ArchivableBehavior.php',
'ArchivableBehaviorObjectBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/archivable/ArchivableBehaviorObjectBuilderModifier.php',
'ArchivableBehaviorQueryBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/archivable/ArchivableBehaviorQueryBuilderModifier.php',
'Arg' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/SymfonyConsole/Arg.php',
'AssignedVar' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/CapsuleTask.php',
'AutoAddPkBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/AutoAddPkBehavior.php',
'AvailableTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/AvailableTask.php',
'BaseExtendSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/BaseExtendSelector.php',
'BaseFilterReader' => $baseDir . '/vendor/phing/phing/classes/phing/filters/BaseFilterReader.php',
'BaseObject' => $baseDir . '/vendor/propel/propel1/runtime/lib/om/BaseObject.php',
'BaseParamFilterReader' => $baseDir . '/vendor/phing/phing/classes/phing/filters/BaseParamFilterReader.php',
'BasePeer' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/BasePeer.php',
'BasePropelMigrationTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/BasePropelMigrationTask.php',
'BaseSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/BaseSchemaParser.php',
'BaseSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/BaseSelector.php',
'BaseSelectorContainer' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/BaseSelectorContainer.php',
'BasicLogger' => $baseDir . '/vendor/propel/propel1/runtime/lib/logger/BasicLogger.php',
'BasicValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/BasicValidator.php',
'BatchTest' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/BatchTest.php',
'Behavior' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Behavior.php',
'BufferedReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/BufferedReader.php',
'BufferedWriter' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/BufferedWriter.php',
'BuildEvent' => $baseDir . '/vendor/phing/phing/classes/phing/BuildEvent.php',
'BuildException' => $baseDir . '/vendor/phing/phing/classes/phing/BuildException.php',
'BuildListener' => $baseDir . '/vendor/phing/phing/classes/phing/BuildListener.php',
'BuildLogger' => $baseDir . '/vendor/phing/phing/classes/phing/BuildLogger.php',
'CVSPassTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/CvsPassTask.php',
'Capsule' => $baseDir . '/vendor/phing/phing/classes/phing/lib/Capsule.php',
'CapsuleTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/CapsuleTask.php',
'ChainReaderHelper' => $baseDir . '/vendor/phing/phing/classes/phing/filters/util/ChainReaderHelper.php',
'ChainableReader' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ChainableReader.php',
'Character' => $baseDir . '/vendor/phing/phing/classes/phing/system/lang/Character.php',
'ChmodTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ChmodTask.php',
'ChownTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ChownTask.php',
'ClassTools' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/ClassTools.php',
'CloverPHPUnitResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/formatter/CloverPHPUnitResultFormatter.php',
'Column' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Column.php',
'ColumnDefaultValue' => $baseDir . '/vendor/propel/propel1/generator/lib/model/ColumnDefaultValue.php',
'ColumnMap' => $baseDir . '/vendor/propel/propel1/runtime/lib/map/ColumnMap.php',
'ColumnValue' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/XmlToDataSQL.php',
'Commandline' => $baseDir . '/vendor/phing/phing/classes/phing/types/Commandline.php',
'CommandlineArgument' => $baseDir . '/vendor/phing/phing/classes/phing/types/Commandline.php',
'CommandlineMarker' => $baseDir . '/vendor/phing/phing/classes/phing/types/Commandline.php',
'Comment' => $baseDir . '/vendor/phing/phing/classes/phing/filters/StripLineComments.php',
'ComposerTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ComposerTask.php',
'ConcreteInheritanceBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceBehavior.php',
'ConcreteInheritanceParentBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/concrete_inheritance/ConcreteInheritanceParentBehavior.php',
'Condition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/Condition.php',
'ConditionBase' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/ConditionBase.php',
'ConditionEnumeration' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/ConditionBase.php',
'ConditionTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ConditionTask.php',
'ConfigurationException' => $baseDir . '/vendor/phing/phing/classes/phing/ConfigurationException.php',
'ConsoleReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/ConsoleReader.php',
'ConstraintNameGenerator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/ConstraintNameGenerator.php',
'Contains' => $baseDir . '/vendor/phing/phing/classes/phing/filters/LineContains.php',
'ContainsCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/ContainsCondition.php',
'ContainsRegexpSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/ContainsRegexpSelector.php',
'ContainsSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/ContainsSelector.php',
'CopyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/CopyTask.php',
'CoverageMerger' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageMerger.php',
'CoverageMergerTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageMergerTask.php',
'CoverageReportTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageReportTask.php',
'CoverageReportTransformer' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageReportTransformer.php',
'CoverageSetupTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageSetupTask.php',
'CoverageThresholdTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/coverage/CoverageThresholdTask.php',
'CreoleSQLExecTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/creole/CreoleSQLExecTask.php',
'CreoleTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/creole/CreoleTask.php',
'Criteria' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/Criteria.php',
'Criterion' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/Criterion.php',
'CriterionIterator' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/CriterionIterator.php',
'CustomChildCreator' => $baseDir . '/vendor/phing/phing/classes/phing/parser/CustomChildCreator.php',
'CvsTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/CvsTask.php',
'DBAdapter' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBAdapter.php',
'DBMSSQL' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBMSSQL.php',
'DBMySQL' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBMySQL.php',
'DBNone' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBNone.php',
'DBOracle' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBOracle.php',
'DBPostgres' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBPostgres.php',
'DBSQLSRV' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBSQLSRV.php',
'DBSQLite' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/DBSQLite.php',
'DataModelBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/DataModelBuilder.php',
'DataRow' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/XmlToDataSQL.php',
'DataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/DataSQLBuilder.php',
'DataStore' => $baseDir . '/vendor/phing/phing/classes/phing/util/DataStore.php',
'DataType' => $baseDir . '/vendor/phing/phing/classes/phing/types/DataType.php',
'DataTypeHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/DataTypeHandler.php',
'Database' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Database.php',
'DatabaseMap' => $baseDir . '/vendor/propel/propel1/runtime/lib/map/DatabaseMap.php',
'DateSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/DateSelector.php',
'DbDeployTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbDeployTask.php',
'DbmsSyntax' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntax.php',
'DbmsSyntaxFactory' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxFactory.php',
'DbmsSyntaxMsSql' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxMsSql.php',
'DbmsSyntaxMysql' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxMysql.php',
'DbmsSyntaxOracle' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxOracle.php',
'DbmsSyntaxPgSQL' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxPgSQL.php',
'DbmsSyntaxSQLite' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/dbdeploy/DbmsSyntaxSQLite.php',
'DebugPDO' => $baseDir . '/vendor/propel/propel1/runtime/lib/connection/DebugPDO.php',
'DebugPDOStatement' => $baseDir . '/vendor/propel/propel1/runtime/lib/connection/DebugPDOStatement.php',
'DefaultEnglishPluralizer' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/DefaultEnglishPluralizer.php',
'DefaultInputHandler' => $baseDir . '/vendor/phing/phing/classes/phing/input/DefaultInputHandler.php',
'DefaultLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/DefaultLogger.php',
'DefaultPDOQuerySplitter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/DefaultPDOQuerySplitter.php',
'DefaultPHPCPDResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcpd/formatter/DefaultPHPCPDResultFormatter.php',
'DefaultPlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/DefaultPlatform.php',
'DelegateBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/DelegateBehavior.php',
'DeleteTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/DeleteTask.php',
'DependSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/DependSelector.php',
'DepthSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/DepthSelector.php',
'Description' => $baseDir . '/vendor/phing/phing/classes/phing/types/Description.php',
'DirSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/DirSet.php',
'DirectoryScanner' => $baseDir . '/vendor/phing/phing/classes/phing/util/DirectoryScanner.php',
'DocBloxTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/docblox/DocBloxTask.php',
'DocBlox_Parallel_Manager' => $baseDir . '/vendor/phing/phing/classes/phing/contrib/DocBlox/Parallel/Manager.php',
'DocBlox_Parallel_Worker' => $baseDir . '/vendor/phing/phing/classes/phing/contrib/DocBlox/Parallel/Worker.php',
'DocBlox_Parallel_WorkerPipe' => $baseDir . '/vendor/phing/phing/classes/phing/contrib/DocBlox/Parallel/WorkerPipe.php',
'Domain' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Domain.php',
'EchoTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/EchoTask.php',
'ElseIfTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/IfTask.php',
'EngineException' => $baseDir . '/vendor/propel/propel1/generator/lib/exception/EngineException.php',
'EqualsCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/EqualsCondition.php',
'EventObject' => $baseDir . '/vendor/phing/phing/classes/phing/system/lang/EventObject.php',
'Excludes' => $baseDir . '/vendor/phing/phing/classes/phing/types/Excludes.php',
'ExcludesNameEntry' => $baseDir . '/vendor/phing/phing/classes/phing/types/ExcludesNameEntry.php',
'ExecTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ExecTask.php',
'ExpandProperties' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ExpandProperties.php',
'ExpatParseException' => $baseDir . '/vendor/phing/phing/classes/phing/parser/ExpatParseException.php',
'ExpatParser' => $baseDir . '/vendor/phing/phing/classes/phing/parser/ExpatParser.php',
'ExportPropertiesTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ExportPropertiesTask.php',
'ExtendFileSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/ExtendFileSelector.php',
'ExtendSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/ExtendSelector.php',
'ExtendedFileStream' => $baseDir . '/vendor/phing/phing/classes/phing/util/ExtendedFileStream.php',
'ExtensionQueryBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/ExtensionQueryBuilder.php',
'ExtensionQueryInheritanceBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/ExtensionQueryInheritanceBuilder.php',
'ExtractBaseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ExtractBaseTask.php',
'FailTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/FailTask.php',
'FileHashTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/FileHashTask.php',
'FileInputStream' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FileInputStream.php',
'FileList' => $baseDir . '/vendor/phing/phing/classes/phing/types/FileList.php',
'FileNameMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/FileNameMapper.php',
'FileNotFoundException' => $baseDir . '/vendor/phing/phing/classes/phing/system/lang/FileNotFoundException.php',
'FileOutputStream' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FileOutputStream.php',
'FileReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FileReader.php',
'FileSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/FileSelector.php',
'FileSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/FileSet.php',
'FileSizeTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/FileSizeTask.php',
'FileSyncTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/FileSyncTask.php',
'FileSystem' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FileSystem.php',
'FileUtils' => $baseDir . '/vendor/phing/phing/classes/phing/util/FileUtils.php',
'FileWriter' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FileWriter.php',
'FilenameSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/FilenameSelector.php',
'FilterChain' => $baseDir . '/vendor/phing/phing/classes/phing/types/FilterChain.php',
'FilterReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/FilterReader.php',
'FlattenMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/FlattenMapper.php',
'ForeachTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ForeachTask.php',
'ForeignKey' => $baseDir . '/vendor/propel/propel1/generator/lib/model/ForeignKey.php',
'FormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/FormatterElement.php',
'FtpDeployTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/FtpDeployTask.php',
'FunctionParam' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PhpEvalTask.php',
'GeneratorConfig' => $baseDir . '/vendor/propel/propel1/generator/lib/config/GeneratorConfig.php',
'GeneratorConfigInterface' => $baseDir . '/vendor/propel/propel1/generator/lib/config/GeneratorConfigInterface.php',
'GitBaseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitBaseTask.php',
'GitBranchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitBranchTask.php',
'GitCheckoutTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitCheckoutTask.php',
'GitCloneTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitCloneTask.php',
'GitCommitTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitCommitTask.php',
'GitFetchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitFetchTask.php',
'GitGcTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitGcTask.php',
'GitInitTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitInitTask.php',
'GitLogTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitLogTask.php',
'GitMergeTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitMergeTask.php',
'GitPullTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitPullTask.php',
'GitPushTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitPushTask.php',
'GitTagTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/git/GitTagTask.php',
'GlobMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/GlobMapper.php',
'GrowlNotifyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/GrowlNotifyTask.php',
'HeadFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/HeadFilter.php',
'HtmlColorLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/HtmlColorLogger.php',
'HttpGetTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/HttpGetTask.php',
'HttpRequestTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/HttpRequestTask.php',
'I18nBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/I18nBehavior.php',
'I18nBehaviorObjectBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/I18nBehaviorObjectBuilderModifier.php',
'I18nBehaviorPeerBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/I18nBehaviorPeerBuilderModifier.php',
'I18nBehaviorQueryBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/I18nBehaviorQueryBuilderModifier.php',
'IDMethod' => $baseDir . '/vendor/propel/propel1/generator/lib/model/IDMethod.php',
'IOException' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/IOException.php',
'IconvFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/IconvFilter.php',
'IdMethodParameter' => $baseDir . '/vendor/propel/propel1/generator/lib/model/IdMethodParameter.php',
'IdentityMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/IdentityMapper.php',
'IfTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/IfTask.php',
'ImportTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ImportTask.php',
'IncludePathTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/IncludePathTask.php',
'Index' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Index.php',
'Inheritance' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Inheritance.php',
'IniFileTokenReader' => $baseDir . '/vendor/phing/phing/classes/phing/filters/util/IniFileTokenReader.php',
'InputHandler' => $baseDir . '/vendor/phing/phing/classes/phing/input/InputHandler.php',
'InputRequest' => $baseDir . '/vendor/phing/phing/classes/phing/input/InputRequest.php',
'InputStream' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/InputStream.php',
'InputStreamReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/InputStreamReader.php',
'InputTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/InputTask.php',
'IntrospectionHelper' => $baseDir . '/vendor/phing/phing/classes/phing/IntrospectionHelper.php',
'IoncubeComment' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php',
'IoncubeEncoderTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ioncube/IoncubeEncoderTask.php',
'IoncubeLicenseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ioncube/IoncubeLicenseTask.php',
'IsFalseCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/IsFalseCondition.php',
'IsSetCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/IsSetCondition.php',
'IsTrueCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/IsTrueCondition.php',
'IterableFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/IterableFileSet.php',
'JSMin' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/jsmin/JsMin.php',
'JSMinException' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/jsmin/JsMin.php',
'Join' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/Join.php',
'JsMinTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/jsmin/JsMinTask.php',
'JslLintTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/JslLintTask.php',
'LineContains' => $baseDir . '/vendor/phing/phing/classes/phing/filters/LineContains.php',
'LineContainsRegexp' => $baseDir . '/vendor/phing/phing/classes/phing/filters/LineContainsRegexp.php',
'LiquibaseChangeLogTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseChangeLogTask.php',
'LiquibaseDbDocTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseDbDocTask.php',
'LiquibaseDiffTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseDiffTask.php',
'LiquibaseRollbackTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseRollbackTask.php',
'LiquibaseTagTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseTagTask.php',
'LiquibaseUpdateTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/liquibase/LiquibaseUpdateTask.php',
'LoadFileTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/LoadFileTask.php',
'Location' => $baseDir . '/vendor/phing/phing/classes/phing/parser/Location.php',
'LogWriter' => $baseDir . '/vendor/phing/phing/classes/phing/util/LogWriter.php',
'MailLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/MailLogger.php',
'MailTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/MailTask.php',
'MajoritySelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/MajoritySelector.php',
'ManifestTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ManifestTask.php',
'Mapper' => $baseDir . '/vendor/phing/phing/classes/phing/types/Mapper.php',
'MatchValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/MatchValidator.php',
'MatchingTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/MatchingTask.php',
'MaxLengthValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/MaxLengthValidator.php',
'MaxValueValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/MaxValueValidator.php',
'MergeMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/MergeMapper.php',
'MinLengthValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/MinLengthValidator.php',
'MinValueValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/MinValueValidator.php',
'MkdirTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/MkdirTask.php',
'ModelCriteria' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/ModelCriteria.php',
'ModelCriterion' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/ModelCriterion.php',
'ModelJoin' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/ModelJoin.php',
'ModelWith' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/ModelWith.php',
'MojaviLogAdapter' => $baseDir . '/vendor/propel/propel1/runtime/lib/logger/MojaviLogAdapter.php',
'MoveTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/MoveTask.php',
'MssqlDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/mssql/MssqlDataSQLBuilder.php',
'MssqlDebugPDO' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/MSSQL/MssqlDebugPDO.php',
'MssqlPlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/MssqlPlatform.php',
'MssqlPropelPDO' => $baseDir . '/vendor/propel/propel1/runtime/lib/adapter/MSSQL/MssqlPropelPDO.php',
'MssqlSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/mssql/MssqlSchemaParser.php',
'MultipleChoiceInputRequest' => $baseDir . '/vendor/phing/phing/classes/phing/input/MultipleChoiceInputRequest.php',
'MysqlDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/mysql/MysqlDataSQLBuilder.php',
'MysqlPlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/MysqlPlatform.php',
'MysqlSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/mysql/MysqlSchemaParser.php',
'NameFactory' => $baseDir . '/vendor/propel/propel1/generator/lib/model/NameFactory.php',
'NameGenerator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/NameGenerator.php',
'NestedElementHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/NestedElementHandler.php',
'NestedSetBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/nestedset/NestedSetBehavior.php',
'NestedSetBehaviorObjectBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/nestedset/NestedSetBehaviorObjectBuilderModifier.php',
'NestedSetBehaviorPeerBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/nestedset/NestedSetBehaviorPeerBuilderModifier.php',
'NestedSetBehaviorQueryBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/nestedset/NestedSetBehaviorQueryBuilderModifier.php',
'NestedSetRecursiveIterator' => $baseDir . '/vendor/propel/propel1/runtime/lib/om/NestedSetRecursiveIterator.php',
'NoBannerLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/NoBannerLogger.php',
'NodeObject' => $baseDir . '/vendor/propel/propel1/runtime/lib/om/NodeObject.php',
'NodePeer' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/NodePeer.php',
'NoneSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/NoneSelector.php',
'NotCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/NotCondition.php',
'NotMatchValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/NotMatchValidator.php',
'NotSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/NotSelector.php',
'NullPointerException' => $baseDir . '/vendor/phing/phing/classes/phing/system/lang/NullPointerException.php',
'OMBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/OMBuilder.php',
'ObjectBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/ObjectBuilder.php',
'OrCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/OrCondition.php',
'OrSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/OrSelector.php',
'OracleDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/oracle/OracleDataSQLBuilder.php',
'OraclePlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/OraclePlatform.php',
'OracleSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/oracle/OracleSchemaParser.php',
'OsCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/OsCondition.php',
'OutputStream' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/OutputStream.php',
'OutputStreamWriter' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/OutputStreamWriter.php',
'PDOQuerySplitter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOQuerySplitter.php',
'PDOResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOResultFormatter.php',
'PDOSQLExecFormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOSQLExecFormatterElement.php',
'PDOSQLExecTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOSQLExecTask.php',
'PDOSQLExecTransaction' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOSQLExecTask.php',
'PDOTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PDOTask.php',
'PEAR_PackageFileManager_Fileset' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pearpackage/Fileset.php',
'PHP5ExtensionNodeBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ExtensionNodeBuilder.php',
'PHP5ExtensionNodePeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ExtensionNodePeerBuilder.php',
'PHP5ExtensionObjectBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ExtensionObjectBuilder.php',
'PHP5ExtensionPeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ExtensionPeerBuilder.php',
'PHP5InterfaceBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5InterfaceBuilder.php',
'PHP5MultiExtendObjectBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5MultiExtendObjectBuilder.php',
'PHP5NestedSetBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5NestedSetBuilder.php',
'PHP5NestedSetPeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5NestedSetPeerBuilder.php',
'PHP5NodeBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5NodeBuilder.php',
'PHP5NodePeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5NodePeerBuilder.php',
'PHP5ObjectBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ObjectBuilder.php',
'PHP5ObjectNoCollectionBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5ObjectNoCollectionBuilder.php',
'PHP5PeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5PeerBuilder.php',
'PHP5TableMapBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PHP5TableMapBuilder.php',
'PHPCPDFormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcpd/PHPCPDFormatterElement.php',
'PHPCPDResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcpd/formatter/PHPCPDResultFormatter.php',
'PHPCPDTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcpd/PHPCPDTask.php',
'PHPLocTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phploc/PHPLocTask.php',
'PHPMDFormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpmd/PHPMDFormatterElement.php',
'PHPMDTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpmd/PHPMDTask.php',
'PHPUnitReportTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/PHPUnitReportTask.php',
'PHPUnitResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/formatter/PHPUnitResultFormatter.php',
'PHPUnitTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/PHPUnitTask.php',
'PHPUnitTestRunner' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/PHPUnitTestRunner.php',
'PHPUnitUtil' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/PHPUnitUtil.php',
'PMDPHPCPDResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcpd/formatter/PMDPHPCPDResultFormatter.php',
'PackageAsPathTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PackageAsPathTask.php',
'ParallelTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ParallelTask.php',
'Parameter' => $baseDir . '/vendor/phing/phing/classes/phing/types/Parameter.php',
'Parameterizable' => $baseDir . '/vendor/phing/phing/classes/phing/types/Parameterizable.php',
'PatchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PatchTask.php',
'Path' => $baseDir . '/vendor/phing/phing/classes/phing/types/Path.php',
'PathElement' => $baseDir . '/vendor/phing/phing/classes/phing/types/Path.php',
'PathTokenizer' => $baseDir . '/vendor/phing/phing/classes/phing/util/PathTokenizer.php',
'PatternSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/PatternSet.php',
'PatternSetNameEntry' => $baseDir . '/vendor/phing/phing/classes/phing/types/PatternSet.php',
'PearLogListener' => $baseDir . '/vendor/phing/phing/classes/phing/listener/PearLogListener.php',
'PearPackage2Task' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackage2Task.php',
'PearPackageFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/types/PearPackageFileSet.php',
'PearPackageScanner' => $baseDir . '/vendor/phing/phing/classes/phing/util/PearPackageScanner.php',
'PearPackageTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackageTask.php',
'PearPkgMapping' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackageTask.php',
'PearPkgMappingElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackageTask.php',
'PearPkgOption' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackageTask.php',
'PearPkgRole' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PearPackageTask.php',
'PeerBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/PeerBuilder.php',
'Persistent' => $baseDir . '/vendor/propel/propel1/runtime/lib/om/Persistent.php',
'PgsqlDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/pgsql/PgsqlDataSQLBuilder.php',
'PgsqlPDOQuerySplitter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PgsqlPDOQuerySplitter.php',
'PgsqlPlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/PgsqlPlatform.php',
'PgsqlSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/pgsql/PgsqlSchemaParser.php',
'PharMetadata' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phar/PharMetadata.php',
'PharMetadataElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phar/PharMetadataElement.php',
'PharPackageTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phar/PharPackageTask.php',
'Phing' => $baseDir . '/vendor/phing/phing/classes/phing/Phing.php',
'PhingCallTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PhingCallTask.php',
'PhingFile' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/PhingFile.php',
'PhingFilterReader' => $baseDir . '/vendor/phing/phing/classes/phing/types/PhingFilterReader.php',
'PhingPhpDocumentorErrorTracker' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhingPhpDocumentorErrorTracker.php',
'PhingPhpDocumentorSetup' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhingPhpDocumentorSetup.php',
'PhingReference' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PhingTask.php',
'PhingTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PhingTask.php',
'PhingXMLContext' => $baseDir . '/vendor/phing/phing/classes/phing/parser/PhingXMLContext.php',
'PhkPackageTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phk/PhkPackageTask.php',
'PhkPackageWebAccess' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phk/PhkPackageWebAccess.php',
'PhkPackageWebAccessPath' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phk/PhkPackageWebAccessPath.php',
'PhpCodeSnifferTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PhpCodeSnifferTask.php',
'PhpCodeSnifferTask_FormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PhpCodeSnifferTask.php',
'PhpCodeSnifferTask_Wrapper' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpcs/PhpCodeSnifferTask_Wrapper.php',
'PhpDependAnalyzerElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdepend/PhpDependAnalyzerElement.php',
'PhpDependLoggerElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdepend/PhpDependLoggerElement.php',
'PhpDependTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdepend/PhpDependTask.php',
'PhpDocumentor2Task' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhpDocumentor2Task.php',
'PhpDocumentor2Wrapper' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhpDocumentor2Wrapper.php',
'PhpDocumentorExternalTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhpDocumentorExternalTask.php',
'PhpDocumentorTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpdoc/PhpDocumentorTask.php',
'PhpEvalTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PhpEvalTask.php',
'PhpLintTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/PhpLintTask.php',
'PhpNameGenerator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/PhpNameGenerator.php',
'PlainPDOResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/PlainPDOResultFormatter.php',
'PlainPHPUnitResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/formatter/PlainPHPUnitResultFormatter.php',
'Pluralizer' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/Pluralizer.php',
'PreOrderNodeIterator' => $baseDir . '/vendor/propel/propel1/runtime/lib/om/PreOrderNodeIterator.php',
'PrefixLines' => $baseDir . '/vendor/phing/phing/classes/phing/filters/PrefixLines.php',
'PregEngine' => $baseDir . '/vendor/phing/phing/classes/phing/util/regexp/PregEngine.php',
'PresentSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/PresentSelector.php',
'Project' => $baseDir . '/vendor/phing/phing/classes/phing/Project.php',
'ProjectComponent' => $baseDir . '/vendor/phing/phing/classes/phing/ProjectComponent.php',
'ProjectConfigurator' => $baseDir . '/vendor/phing/phing/classes/phing/parser/ProjectConfigurator.php',
'ProjectHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/ProjectHandler.php',
'Propel' => $baseDir . '/vendor/propel/propel1/runtime/lib/Propel.php',
'PropelArrayCollection' => $baseDir . '/vendor/propel/propel1/runtime/lib/collection/PropelArrayCollection.php',
'PropelArrayFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelArrayFormatter.php',
'PropelAutoloader' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelAutoloader.php',
'PropelCSVParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/PropelCSVParser.php',
'PropelCollection' => $baseDir . '/vendor/propel/propel1/runtime/lib/collection/PropelCollection.php',
'PropelColumnComparator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelColumnComparator.php',
'PropelColumnDiff' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelColumnDiff.php',
'PropelColumnTypes' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelColumnTypes.php',
'PropelConditionalProxy' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelConditionalProxy.php',
'PropelConfiguration' => $baseDir . '/vendor/propel/propel1/runtime/lib/config/PropelConfiguration.php',
'PropelConfigurationIterator' => $baseDir . '/vendor/propel/propel1/runtime/lib/config/PropelConfigurationIterator.php',
'PropelConvertConfTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelConvertConfTask.php',
'PropelDataDumpTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelDataDumpTask.php',
'PropelDataSQLTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelDataSQLTask.php',
'PropelDatabaseComparator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelDatabaseComparator.php',
'PropelDatabaseDiff' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelDatabaseDiff.php',
'PropelDateTime' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelDateTime.php',
'PropelDotGenerator' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelDotGenerator.php',
'PropelException' => $baseDir . '/vendor/propel/propel1/runtime/lib/exception/PropelException.php',
'PropelForeignKeyComparator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelForeignKeyComparator.php',
'PropelFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelFormatter.php',
'PropelGraphvizTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelGraphvizTask.php',
'PropelIndexComparator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelIndexComparator.php',
'PropelJSONParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/PropelJSONParser.php',
'PropelMigrationDownTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelMigrationDownTask.php',
'PropelMigrationManager' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelMigrationManager.php',
'PropelMigrationStatusTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelMigrationStatusTask.php',
'PropelMigrationTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelMigrationTask.php',
'PropelMigrationUpTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelMigrationUpTask.php',
'PropelModelPager' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelModelPager.php',
'PropelOMTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelOMTask.php',
'PropelObjectCollection' => $baseDir . '/vendor/propel/propel1/runtime/lib/collection/PropelObjectCollection.php',
'PropelObjectFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelObjectFormatter.php',
'PropelOnDemandCollection' => $baseDir . '/vendor/propel/propel1/runtime/lib/collection/PropelOnDemandCollection.php',
'PropelOnDemandFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelOnDemandFormatter.php',
'PropelOnDemandIterator' => $baseDir . '/vendor/propel/propel1/runtime/lib/collection/PropelOnDemandIterator.php',
'PropelPDO' => $baseDir . '/vendor/propel/propel1/runtime/lib/connection/PropelPDO.php',
'PropelPHPParser' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelPHPParser.php',
'PropelPager' => $baseDir . '/vendor/propel/propel1/runtime/lib/util/PropelPager.php',
'PropelParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/PropelParser.php',
'PropelPlatformInterface' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/PropelPlatformInterface.php',
'PropelQuery' => $baseDir . '/vendor/propel/propel1/runtime/lib/query/PropelQuery.php',
'PropelQuickBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelQuickBuilder.php',
'PropelSQLDiffTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSQLDiffTask.php',
'PropelSQLExec' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSQLExec.php',
'PropelSQLParser' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelSQLParser.php',
'PropelSQLTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSQLTask.php',
'PropelSchemaReverseTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSchemaReverseTask.php',
'PropelSchemaReverse_ValidatorSet' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSchemaReverseTask.php',
'PropelSchemaValidator' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelSchemaValidator.php',
'PropelSimpleArrayFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelSimpleArrayFormatter.php',
'PropelSqlBuildTask' => $baseDir . '/vendor/propel/propel1/generator/lib/task/PropelSqlBuildTask.php',
'PropelSqlManager' => $baseDir . '/vendor/propel/propel1/generator/lib/util/PropelSqlManager.php',
'PropelStatementFormatter' => $baseDir . '/vendor/propel/propel1/runtime/lib/formatter/PropelStatementFormatter.php',
'PropelStringReader' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/PropelStringReader.php',
'PropelTableComparator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelTableComparator.php',
'PropelTableDiff' => $baseDir . '/vendor/propel/propel1/generator/lib/model/diff/PropelTableDiff.php',
'PropelTemplate' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/PropelTemplate.php',
'PropelTypes' => $baseDir . '/vendor/propel/propel1/generator/lib/model/PropelTypes.php',
'PropelXMLParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/PropelXMLParser.php',
'PropelYAMLParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/PropelYAMLParser.php',
'Properties' => $baseDir . '/vendor/phing/phing/classes/phing/system/util/Properties.php',
'PropertyPromptTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PropertyPromptTask.php',
'PropertyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/PropertyTask.php',
'QueryBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/QueryBuilder.php',
'QueryCacheBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/query_cache/QueryCacheBehavior.php',
'QueryInheritanceBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/om/QueryInheritanceBuilder.php',
'QuickGeneratorConfig' => $baseDir . '/vendor/propel/propel1/generator/lib/config/QuickGeneratorConfig.php',
'Reader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/Reader.php',
'Reference' => $baseDir . '/vendor/phing/phing/classes/phing/types/Reference.php',
'ReferenceExistsCondition' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php',
'ReflexiveTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ReflexiveTask.php',
'Regexp' => $baseDir . '/vendor/phing/phing/classes/phing/util/regexp/Regexp.php',
'RegexpEngine' => $baseDir . '/vendor/phing/phing/classes/phing/util/regexp/RegexpEngine.php',
'RegexpMapper' => $baseDir . '/vendor/phing/phing/classes/phing/mappers/RegexpMapper.php',
'Register' => $baseDir . '/vendor/phing/phing/classes/phing/system/util/Register.php',
'RegisterSlot' => $baseDir . '/vendor/phing/phing/classes/phing/system/util/Register.php',
'RegularExpression' => $baseDir . '/vendor/phing/phing/classes/phing/types/RegularExpression.php',
'RelationMap' => $baseDir . '/vendor/propel/propel1/runtime/lib/map/RelationMap.php',
'ReplaceRegexp' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ReplaceRegexp.php',
'ReplaceRegexpTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ReplaceRegexpTask.php',
'ReplaceTokens' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ReplaceTokens.php',
'ReplaceTokensWithFile' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ReplaceTokensWithFile.php',
'RequiredValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/RequiredValidator.php',
'ResolvePathTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/ResolvePathTask.php',
'RootHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/RootHandler.php',
'Rule' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Rule.php',
'RuntimeConfigurable' => $baseDir . '/vendor/phing/phing/classes/phing/RuntimeConfigurable.php',
'S3GetTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/Service/Amazon/S3/S3GetTask.php',
'S3PutTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/Service/Amazon/S3/S3PutTask.php',
'SQLExecTransaction' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/creole/CreoleSQLExecTask.php',
'SchemaException' => $baseDir . '/vendor/propel/propel1/generator/lib/exception/SchemaException.php',
'SchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/SchemaParser.php',
'ScopedElement' => $baseDir . '/vendor/propel/propel1/generator/lib/model/ScopedElement.php',
'ScpTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ScpTask.php',
'SecurityException' => $baseDir . '/vendor/phing/phing/classes/phing/system/lang/SecurityException.php',
'SelectSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/SelectSelector.php',
'SelectorContainer' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/SelectorContainer.php',
'SelectorScanner' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/SelectorScanner.php',
'SelectorUtils' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/SelectorUtils.php',
'SequentialTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/SequentialTask.php',
'Service_Amazon' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/Service/Amazon.php',
'Service_Amazon_S3' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/Service/Amazon/S3.php',
'SimpleTestCountResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php',
'SimpleTestDebugResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestDebugResultFormatter.php',
'SimpleTestFormatterElement' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php',
'SimpleTestPlainResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php',
'SimpleTestResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php',
'SimpleTestSummaryResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php',
'SimpleTestTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestTask.php',
'SimpleTestXmlResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php',
'SizeSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/SizeSelector.php',
'SluggableBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/sluggable/SluggableBehavior.php',
'SmartyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/SmartyTask.php',
'SoftDeleteBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/SoftDeleteBehavior.php',
'SortableBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/sortable/SortableBehavior.php',
'SortableBehaviorObjectBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/sortable/SortableBehaviorObjectBuilderModifier.php',
'SortableBehaviorPeerBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/sortable/SortableBehaviorPeerBuilderModifier.php',
'SortableBehaviorQueryBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/sortable/SortableBehaviorQueryBuilderModifier.php',
'SourceFileScanner' => $baseDir . '/vendor/phing/phing/classes/phing/util/SourceFileScanner.php',
'SqliteDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/sqlite/SqliteDataSQLBuilder.php',
'SqlitePlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/SqlitePlatform.php',
'SqliteSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/sqlite/SqliteSchemaParser.php',
'SqlsrvDataSQLBuilder' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/sql/sqlsrv/SqlsrvDataSQLBuilder.php',
'SqlsrvPlatform' => $baseDir . '/vendor/propel/propel1/generator/lib/platform/SqlsrvPlatform.php',
'SqlsrvSchemaParser' => $baseDir . '/vendor/propel/propel1/generator/lib/reverse/sqlsrv/SqlsrvSchemaParser.php',
'SshTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/SshTask.php',
'StandardEnglishPluralizer' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/StandardEnglishPluralizer.php',
'StreamRequiredBuildLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/StreamRequiredBuildLogger.php',
'StringHelper' => $baseDir . '/vendor/phing/phing/classes/phing/util/StringHelper.php',
'StringReader' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/StringReader.php',
'StripLineBreaks' => $baseDir . '/vendor/phing/phing/classes/phing/filters/StripLineBreaks.php',
'StripLineComments' => $baseDir . '/vendor/phing/phing/classes/phing/filters/StripLineComments.php',
'StripPhpComments' => $baseDir . '/vendor/phing/phing/classes/phing/filters/StripPhpComments.php',
'StripWhitespace' => $baseDir . '/vendor/phing/phing/classes/phing/filters/StripWhitespace.php',
'SummaryPHPUnitResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/formatter/SummaryPHPUnitResultFormatter.php',
'SvnBaseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php',
'SvnCheckoutTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnCheckoutTask.php',
'SvnCommitTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnCommitTask.php',
'SvnCopyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnCopyTask.php',
'SvnExportTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnExportTask.php',
'SvnInfoTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnInfoTask.php',
'SvnLastRevisionTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnLastRevisionTask.php',
'SvnListTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnListTask.php',
'SvnLogTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnLogTask.php',
'SvnSwitchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnSwitchTask.php',
'SvnUpdateTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/svn/SvnUpdateTask.php',
'SymfonyConsoleTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/SymfonyConsole/SymfonyConsoleTask.php',
'SymlinkTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/SymlinkTask.php',
'TabToSpaces' => $baseDir . '/vendor/phing/phing/classes/phing/filters/TabToSpaces.php',
'Table' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Table.php',
'TableMap' => $baseDir . '/vendor/propel/propel1/runtime/lib/map/TableMap.php',
'TailFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/TailFilter.php',
'TarFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/TarTask.php',
'TarTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/TarTask.php',
'Target' => $baseDir . '/vendor/phing/phing/classes/phing/Target.php',
'TargetHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/TargetHandler.php',
'Task' => $baseDir . '/vendor/phing/phing/classes/phing/Task.php',
'TaskAdapter' => $baseDir . '/vendor/phing/phing/classes/phing/TaskAdapter.php',
'TaskContainer' => $baseDir . '/vendor/phing/phing/classes/phing/TaskContainer.php',
'TaskHandler' => $baseDir . '/vendor/phing/phing/classes/phing/parser/TaskHandler.php',
'TaskdefTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TaskdefTask.php',
'TidyFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/TidyFilter.php',
'Timer' => $baseDir . '/vendor/phing/phing/classes/phing/system/util/Timer.php',
'TimestampableBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/TimestampableBehavior.php',
'Token' => $baseDir . '/vendor/phing/phing/classes/phing/filters/ReplaceTokens.php',
'TokenReader' => $baseDir . '/vendor/phing/phing/classes/phing/types/TokenReader.php',
'TokenSource' => $baseDir . '/vendor/phing/phing/classes/phing/types/TokenSource.php',
'TouchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TouchTask.php',
'TranslateGettext' => $baseDir . '/vendor/phing/phing/classes/phing/filters/TranslateGettext.php',
'TryCatchTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TryCatchTask.php',
'TstampCustomFormat' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TstampTask.php',
'TstampTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TstampTask.php',
'TypeSelector' => $baseDir . '/vendor/phing/phing/classes/phing/types/selectors/TypeSelector.php',
'TypeValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/TypeValidator.php',
'TypedefTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/TypedefTask.php',
'Unique' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Unique.php',
'UniqueValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/UniqueValidator.php',
'UnixFileSystem' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/UnixFileSystem.php',
'UnknownElement' => $baseDir . '/vendor/phing/phing/classes/phing/UnknownElement.php',
'UntarTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/UntarTask.php',
'UnzipTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/UnzipTask.php',
'UpToDateTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/UpToDateTask.php',
'ValidValuesValidator' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/ValidValuesValidator.php',
'ValidationFailed' => $baseDir . '/vendor/propel/propel1/runtime/lib/validator/ValidationFailed.php',
'Validator' => $baseDir . '/vendor/propel/propel1/generator/lib/model/Validator.php',
'ValidatorMap' => $baseDir . '/vendor/propel/propel1/runtime/lib/map/ValidatorMap.php',
'VendorInfo' => $baseDir . '/vendor/propel/propel1/generator/lib/model/VendorInfo.php',
'VersionTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/VersionTask.php',
'VersionableBehavior' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/versionable/VersionableBehavior.php',
'VersionableBehaviorObjectBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/versionable/VersionableBehaviorObjectBuilderModifier.php',
'VersionableBehaviorPeerBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/versionable/VersionableBehaviorPeerBuilderModifier.php',
'VersionableBehaviorQueryBuilderModifier' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/versionable/VersionableBehaviorQueryBuilderModifier.php',
'WaitForTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/WaitForTask.php',
'WarnTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/WarnTask.php',
'Win32FileSystem' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/Win32FileSystem.php',
'WinNTFileSystem' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/WinNTFileSystem.php',
'Writer' => $baseDir . '/vendor/phing/phing/classes/phing/system/io/Writer.php',
'XMLElement' => $baseDir . '/vendor/propel/propel1/generator/lib/model/XMLElement.php',
'XMLPDOResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/pdo/XMLPDOResultFormatter.php',
'XMLPHPUnitResultFormatter' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/phpunit/formatter/XMLPHPUnitResultFormatter.php',
'XSLTParam' => $baseDir . '/vendor/phing/phing/classes/phing/filters/XsltFilter.php',
'XincludeFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/XincludeFilter.php',
'XmlLintTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/XmlLintTask.php',
'XmlLogger' => $baseDir . '/vendor/phing/phing/classes/phing/listener/XmlLogger.php',
'XmlPropertyTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/XmlPropertyTask.php',
'XmlToAppData' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/XmlToAppData.php',
'XmlToDataSQL' => $baseDir . '/vendor/propel/propel1/generator/lib/builder/util/XmlToDataSQL.php',
'XsltFilter' => $baseDir . '/vendor/phing/phing/classes/phing/filters/XsltFilter.php',
'XsltTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/system/XsltTask.php',
'YesNoInputRequest' => $baseDir . '/vendor/phing/phing/classes/phing/input/YesNoInputRequest.php',
'ZendCodeAnalyzerTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ZendCodeAnalyzerTask.php',
'ZendGuardEncodeTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/zendguard/ZendGuardEncodeTask.php',
'ZendGuardFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/zendguard/ZendGuardEncodeTask.php',
'ZendGuardLicenseTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/zendguard/ZendGuardLicenseTask.php',
'ZipFileSet' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ZipTask.php',
'ZipTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/ZipTask.php',
'as' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php',
'rSTTask' => $baseDir . '/vendor/phing/phing/classes/phing/tasks/ext/rSTTask.php',
'sfYaml' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/yaml/sfYaml.php',
'sfYamlDumper' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/yaml/sfYamlDumper.php',
'sfYamlInline' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/yaml/sfYamlInline.php',
'sfYamlParser' => $baseDir . '/vendor/propel/propel1/runtime/lib/parser/yaml/sfYamlParser.php',
'using' => $baseDir . '/vendor/propel/propel1/generator/lib/behavior/i18n/templates/queryUseI18nQuery.php',
);

View File

@@ -2,22 +2,34 @@
// autoload_real.php generated by Composer
require __DIR__ . '/ClassLoader.php';
class ComposerAutoloaderInit
class ComposerAutoloaderInit905b30423346316c3c4a4d3d5d31b16c
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== static::$loader) {
return static::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit905b30423346316c3c4a4d3d5d31b16c', 'loadClassLoader'));
static::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit905b30423346316c3c4a4d3d5d31b16c', 'loadClassLoader'));
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
$includePaths = require __DIR__ . '/include_paths.php';
array_push($includePaths, get_include_path());
set_include_path(join(PATH_SEPARATOR, $includePaths));
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->add($namespace, $path);

12
core/vendor/composer/include_paths.php vendored Normal file
View File

@@ -0,0 +1,12 @@
<?php
// include_paths.php generated by Composer
$vendorDir = dirname(__DIR__);
$baseDir = dirname($vendorDir);
return array(
$vendorDir . '/phing/phing/classes',
$vendorDir . '/propel/propel1/runtime/lib',
$vendorDir . '/propel/propel1/generator/lib',
);

View File

@@ -1,24 +1,75 @@
[
{
"name": "symfony/http-foundation",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"target-dir": "Symfony/Component/HttpFoundation",
"name": "symfony/class-loader",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/ClassLoader",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.2"
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/ClassLoader/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-09-18 14:09:52",
"require-dev": {
"symfony/finder": "2.1.*"
},
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Symfony\\Component\\ClassLoader": ""
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony ClassLoader Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/http-foundation",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/HttpFoundation",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpFoundation",
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpFoundation/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-11-30 12:53:14",
"type": "library",
"extra": {
"branch-alias": {
@@ -31,22 +82,37 @@
"Symfony\\Component\\HttpFoundation": "",
"SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony HttpFoundation Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/event-dispatcher",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/EventDispatcher",
"source": {
"type": "git",
"url": "https://github.com/symfony/EventDispatcher",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/EventDispatcher/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/EventDispatcher/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -59,7 +125,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/http-kernel": "2.1.*"
},
"time": "2012-09-10 08:53:42",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -71,22 +137,37 @@
"psr-0": {
"Symfony\\Component\\EventDispatcher": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony EventDispatcher Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/http-kernel",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/HttpKernel",
"source": {
"type": "git",
"url": "https://github.com/symfony/HttpKernel",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/HttpKernel/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/HttpKernel/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -112,7 +193,7 @@
"symfony/dependency-injection": "2.1.*",
"symfony/finder": "2.1.*"
},
"time": "2012-09-20 05:13:00",
"time": "2012-11-29 11:56:19",
"type": "library",
"extra": {
"branch-alias": {
@@ -124,22 +205,37 @@
"psr-0": {
"Symfony\\Component\\HttpKernel": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony HttpKernel Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/routing",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/Routing",
"source": {
"type": "git",
"url": "https://github.com/symfony/Routing",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Routing/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/Routing/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -156,7 +252,7 @@
"symfony/yaml": "2.1.*",
"doctrine/common": ">=2.2,<2.4-dev"
},
"time": "2012-09-10 08:53:42",
"time": "2012-11-19 10:35:29",
"type": "library",
"extra": {
"branch-alias": {
@@ -168,28 +264,43 @@
"psr-0": {
"Symfony\\Component\\Routing": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Routing Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/config",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/Config",
"source": {
"type": "git",
"url": "https://github.com/symfony/Config",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Config/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Config/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -201,28 +312,43 @@
"psr-0": {
"Symfony\\Component\\Config": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Config Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/yaml",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/Yaml",
"source": {
"type": "git",
"url": "https://github.com/symfony/Yaml",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Yaml/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Yaml/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-08 09:51:48",
"type": "library",
"extra": {
"branch-alias": {
@@ -234,22 +360,37 @@
"psr-0": {
"Symfony\\Component\\Yaml": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Yaml Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/dependency-injection",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/DependencyInjection",
"source": {
"type": "git",
"url": "https://github.com/symfony/DependencyInjection",
"reference": "v2.1.2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/DependencyInjection/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/symfony/DependencyInjection/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
@@ -263,7 +404,7 @@
"symfony/yaml": "2.1.*",
"symfony/config": "2.1.*"
},
"time": "2012-09-17 18:41:57",
"time": "2012-11-11 11:59:36",
"type": "library",
"extra": {
"branch-alias": {
@@ -275,28 +416,43 @@
"psr-0": {
"Symfony\\Component\\DependencyInjection": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony DependencyInjection Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/console",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"version": "v2.1.4",
"version_normalized": "2.1.4.0",
"target-dir": "Symfony/Component/Console",
"source": {
"type": "git",
"url": "https://github.com/symfony/Console",
"reference": "v2.1.0-RC2"
"reference": "v2.1.4"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/Console/zipball/v2.1.0-RC2",
"reference": "v2.1.0-RC2",
"url": "https://github.com/symfony/Console/archive/v2.1.4.zip",
"reference": "v2.1.4",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"time": "2012-08-22 11:48:41",
"time": "2012-11-09 08:52:51",
"type": "library",
"extra": {
"branch-alias": {
@@ -308,42 +464,135 @@
"psr-0": {
"Symfony\\Component\\Console": ""
}
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
},
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
}
],
"description": "Symfony Console Component",
"homepage": "http://symfony.com"
},
{
"name": "symfony/class-loader",
"version": "v2.1.2",
"version_normalized": "2.1.2.0",
"target-dir": "Symfony/Component/ClassLoader",
"name": "phing/phing",
"version": "2.4.14",
"version_normalized": "2.4.14.0",
"source": {
"type": "git",
"url": "https://github.com/symfony/ClassLoader",
"reference": "v2.1.2"
"url": "https://github.com/phingofficial/phing",
"reference": "2.4.14"
},
"dist": {
"type": "zip",
"url": "https://github.com/symfony/ClassLoader/zipball/v2.1.2",
"reference": "v2.1.2",
"url": "https://github.com/phingofficial/phing/archive/2.4.14.zip",
"reference": "2.4.14",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
"php": ">=5.2.0"
},
"require-dev": {
"symfony/finder": "2.1.*"
"time": "2012-11-29 21:23:47",
"bin": [
"bin/phing"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"classmap": [
"classes/phing/"
]
},
"time": "2012-09-01 07:02:36",
"include-path": [
"classes"
],
"license": [
"LGPL3"
],
"authors": [
{
"name": "Michiel Rook",
"email": "mrook@php.net"
},
{
"name": "Phing Community",
"homepage": "http://www.phing.info/trac/wiki/Development/Contributors"
}
],
"description": "PHing Is Not GNU make; it's a PHP project build system or build tool based on Apache Ant.",
"homepage": "http://www.phing.info/",
"keywords": [
"build",
"task",
"tool"
]
},
{
"name": "propel/propel1",
"version": "1.6.7",
"version_normalized": "1.6.7.0",
"source": {
"type": "git",
"url": "https://github.com/propelorm/Propel",
"reference": "1.6.7"
},
"dist": {
"type": "zip",
"url": "https://github.com/propelorm/Propel/zipball/1.6.7",
"reference": "1.6.7",
"shasum": ""
},
"require": {
"php": ">=5.2.4",
"phing/phing": ">=2.4.12,2.4.*"
},
"time": "2012-07-30 00:58:15",
"bin": [
"generator/bin/propel-gen",
"generator/bin/propel-gen.bat"
],
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.1-dev"
"dev-master": "1.6-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Symfony\\Component\\ClassLoader": ""
"classmap": [
"runtime/lib",
"generator/lib"
]
},
"include-path": [
"runtime/lib",
"generator/lib"
],
"license": [
"MIT"
],
"authors": [
{
"name": "William Durand",
"email": "william.durand1@gmail.com",
"homepage": "http://www.willdurand.fr"
}
}
],
"description": "Propel is an open-source Object-Relational Mapping (ORM) for PHP5.",
"homepage": "http://www.propelorm.org/",
"keywords": [
"database",
"orm",
"persistence",
"Active Record",
"mapping"
]
}
]

View File

@@ -0,0 +1,6 @@
*.php ident
*.html ident
bin/* ident
*.css ident
*.xsl ident
*.rng ident

8
core/vendor/phing/phing/.gitignore vendored Normal file
View File

@@ -0,0 +1,8 @@
.buildpath
.project
.settings
build/full
build/pear
test/reports
docs/api/docs
vendor

87
core/vendor/phing/phing/.travis.sh vendored Normal file
View File

@@ -0,0 +1,87 @@
#!/bin/bash
#-----------------------------------------------------------
#
# Purpose: Run phing in a travis environment
#
# Target system: travis-ci
#-----------------------------------------------------------
installPearTask ()
{
echo -e "\nAuto-discover pear channels and upgrade ..."
pear config-set auto_discover 1
pear -qq channel-update pear.php.net
pear -qq upgrade
echo "... OK"
echo -e "\nInstalling / upgrading phing ... "
which phing >/dev/null &&
pear upgrade pear.phing.info/phing ||
pear install --alldeps pear.phing.info/phing
# update paths
phpenv rehash
# re-test for phing:
phing -v 2>&1 >/dev/null &&
echo "... OK" ||
return 1
echo -e "\nInstalling / upgrading phpcpd ... "
which phpcpd >/dev/null &&
sudo pear upgrade pear.phpunit.de/phpcpd ||
sudo pear install pear.phpunit.de/phpcpd
phpenv rehash
echo -e "\nInstalling / upgrading phploc ... "
which phploc >/dev/null &&
sudo pear upgrade pear.phpunit.de/phploc ||
sudo pear install pear.phpunit.de/phploc
phpenv rehash
echo -e "\nInstalling / upgrading phpcs ... "
which phpcs >/dev/null &&
sudo pear upgrade pear.php.net/PHP_CodeSniffer ||
sudo pear install pear.php.net/PHP_CodeSniffer
phpenv rehash
# re-test for phpcs:
phpcs --version 2>&1 >/dev/null &&
echo "... OK" ||
return 1
sudo apt-get install python-docutils
pear install VersionControl_Git-alpha
pear install VersionControl_SVN-alpha
pear install pear/XML_Serializer-beta
pear install --alldeps PEAR_PackageFileManager
pear install --alldeps PEAR_PackageFileManager2
pear install Net_Growl
# update paths
phpenv rehash
}
#-----------------------------------------------------------
installPearTask &&
echo -e "\nSUCCESS - PHP ENVIRONMENT READY." ||
( echo "=== FAILED."; exit 1 )
if [[ $TRAVIS_PHP_VERSION < 5.3 ]]; then
pear install -f phpunit/File_Iterator-1.3.2
pear install -f phpunit/PHP_TokenStream-1.1.4
pear install -f phpunit/PHP_Timer-1.0.3
pear install -f phpunit/Text_Template-1.1.1
else
composer install
fi
# echo "=== BUILDING PHING ==="
# cd build
# phing -Dversion=2.0.0b1
echo "=== TESTING PHING ==="
cd test
../bin/phing
#------------------------------------------------------- eof

7
core/vendor/phing/phing/.travis.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
language: php
php:
- 5.2
- 5.3
- 5.4
script: ./.travis.sh

847
core/vendor/phing/phing/CHANGELOG.md vendored Normal file
View File

@@ -0,0 +1,847 @@
P H I N G
=========================
Nov. 29, 2012 - Phing 2.4.14
----------------------------
This release addresses the following issues:
* [944] phing/phingdocs bad md5sum
* [943] If task with "equals" directly in "project" tag does not work
* [942] Typo in tasks/ext/dbdeploy/DbmsSyntaxOracle.php
* [939] Add username/password to svn info/lastrevision/list/log task docs
* [938] XSLT filter fails when libxslt security present in php
Starting from this version, Phing releases and release numbers will follow
the Semantic Versioning (www.semver.org) principle.
Nov. 20, 2012 - Phing 2.4.13
----------------------------
This release updates the composer package, adds a phploc task and improved
support for phpDocumentor 2 and IonCube 7, improves the unit tests,
clarifies the documentation in a number of places, and addresses
the following issues:
* [933] PHPLoc 1.7 broken
* [931] PHP_CodeSniffer throws errors with CodeSniffer 1.4.0
* [929] Can not pass empty string (enclosed in double quotes) as exec task argument
* [928] Fatal error with ZipTask when zip extension is not loaded
* [927] PHPCPD upgrade breaks PHPCPD task
* [926] FtpDeployTask: Missing features and patch for them (chmod and only change if different)
* [925] Problem with spaces in error redirection path.
* [924] Update to PEAR::VersionControl_SVN 0.5.0
* [922] Introduce build file property that contains the build file's directory
* [915] path with special characters does not delete
* [909] Replace __DIR__
* [905] Add filterchain support to the property task
* [904] TarTask should raise error if zlib extension not installed
* [903] Cannot redeclare class phpDocumentor\Bootstrap
* [902] SvnBaseTask and subversion 1.7
* [901] phpunitreport create html's classes files in wrong folder
* [900] phpdoc2 example has error
* [895] error in includepath when calling more than once
* [893] Phing will run bootstrap before first task but clean up autoloader before second task
* [892] Concatenate property lines ending with backslash
* [891] Symfony console task: space within the arguments, not working on windows
* [890] Allow custom child elements
* [888] Documentation error for CvsTask setfailonerror
* [886] Error throwing in PDOSQLExecTask breaking trycatch
* [884] svnlist fails on empty directories
* [882] Dbdeploy does not retrieve changelog number with oracle
* [881] Silent fail on delete tasks
* [880] Add phploc task
* [867] phpcpd task should check external dep in main()
* [866] Code coverage not showing "not executed" lines
* [863] MoveTask ignores fileset
* [845] GrowlNotifyTask to be notified on long-task when they are finished
* [813] Allow custom conditions
* [751] Allow loading of phpunit.xml in phpunit task
* [208] ReplaceRegexp problem with newline as replace string
Apr. 6, 2012 - Phing 2.4.12
---------------------------
* [877] Add 'level' attribute to resolvepath task
* [876] JslLint Task is_executable() broken
* [874] ParallelTask.php is not PHP 5.2 compatible
* [860] SvnBaseTask: getRecursive
* [539] Custom build log mailer
* [406] an ability to turn phpLint verbose ON and OFF
Apr. 4, 2012 - Phing 2.4.11
---------------------------
* [870] Can't find ParallelTask.php
Apr. 3, 2012 - Phing 2.4.10
---------------------------
* [872] ReplaceTokens can't work with '/' char
* [870] Can't find ParallelTask.php
* [868] Git Clone clones into wrong directory
* [865] static call to a non-static function PhingFile.php::getTempdir()
* [854] PropertyTask with file. Can't use a comment delimiter in the value.
* [853] PHP Error with HttpGetTask
* [852] Several minor errors in documentation of core tasks
* [851] RNG grammar hasn't been updated to current version
* [850] Typo in documentation - required attributes for project
* [849] Symfony 2 Console Task
* [847] Add support for RNG grammar in task XmlLint
* [846] RNG grammar is wrong for task 'foreach'
* [844] symlink task - overwrite not working
* [843] "verbose" option should print fileset/filelist filenames before execution, not afterwards
* [840] Prevent weird bugs: raise warning when a target tag contains no ending tag
* [835] JSL-Check faulty
* [834] ExecTask documentation has incorrect escape attribute default value
* [833] Exec task args with special characters cannot be escaped
* [828] SelectorUtils::matchPath matches **/._* matches dir/file._name
* [820] Type selector should treat symlinks to directories as such
* [790] Make it easy to add new inherited types to phing: Use addFileset instead of createFileset
* [772] Support for filelist in UpToDateTask
* [671] fix CvsTask documentation
* [587] More detailed backtrace in debug mode (patch)
* [519] Extend mail task to include attachments
* [419] schema file for editors and validation
* [334] Run a task on BuildException
Dec. 29, 2011 - Phing 2.4.9
---------------------------
* [837] PHPMDTask should check external dep in main()
* [836] DocBlox task breaks with version 0.17.0: function getThemesPath not found
* [831] dbdeploy undo script SQL is not formatted correctly
* [822] rSTTask: add debug statement when creating target directory
* [821] phingcall using a lot of memory
* [819] Documentation for SvnUpdateTask is outdated
* [818] [patch] Add overwrite option to Symlink task
* [817] Adding the "trust-server-cert" option to SVN tasks
* [816] Fix notice in SimpleTestXmlResultFormatter
* [811] phpunitreport path fails on linux
* [810] AvailableTask resolving symbolic links
* [807] SVN tasks do not always show error message
* [795] Untar : allow overwriting of newer files when extracting
* [782] PharTask is very slow for big project
* [776] Add waitFor task
* [736] Incompatibility when copying from Windows to Linux on ScpTask
* [709] talk about invalid property values
* [697] More descriptive error messages in PharPackageTask
* [674] Properties: global or local in tasks?
* [653] Allow ChownTask to change only group
* [619] verbose level in ExpandPropertiesFilter
Nov. 2, 2011 - Phing 2.4.8
--------------------------
* [814] Class 'PHPCPD_Log_XML' not found in /home/m/www/elvis/vendor/phpcpd/PHPCPD/Log/XML/PMD.php on line 55
* [812] Fix PHPUnit 3.6 / PHP_CodeCoverage 1.1.0 compatibility
* [808] Bad example for the <or> selector
* [805] phing executable has bug in ENV/PHP_COMMAND
* [804] PhpUnitTask overwrites autoload stack
* [801] PhpCodeSnifferTask doesn't pass files encoding to PHP_CodeSniffer
* [800] CoverageReportTask fails with "runtime error" on PHP 5.4.0beta1
* [799] DbDeploy does not support pdo-dblib
* [798] ReplaceTokensWithFile - postfix attribute ignored
* [797] PhpLintTask performance improvement
* [794] Fix rSTTask to avoid the need of PEAR everytime
* [793] Corrected spelling of name
* [792] EchoTask: Fileset support
* [789] rSTTask unittests fix
* [788] rSTTask documentation: fix examples
* [787] Add pearPackageFileSet type
* [785] method execute doesn't exists in CvsTask.php
* [784] Refactor DocBlox task to work with DocBlox 0.14+
* [783] SvnExportTask impossible to export current version from working copy
* [779] phplint task error summary doesn't display the errors
* [775] ScpTask: mis-leading error message if 'host' attribute is not set
* [772] Support for filelist in UpToDateTask
* [770] Keep the RelaxNG grammar in sync with the code/doc
* [707] Writing Tasks/class properties: taskname not correctly used
* [655] PlainPHPUnitResultFormatter does not display errors if @dataProvider was used
* [578] [PATCH] Add mapper support to ForeachTask
* [552] 2 validargs to input task does not display defaults correctly
Aug. 19, 2011 - Phing 2.4.7.1
-----------------------------
This is a hotfix release.
* [774] Fix PHP 5.3 dependency in CoverageReportTask
* [773] Fix for Ticket #744 breaks PHPCodeSnifferTask's nested formatters
Aug. 18, 2011 - Phing 2.4.7
---------------------------
This release fixes and improves several tasks (particularly the DocBlox
task), adds OCI/ODBC support to the dbdeploy task and introduces
a task to render reStructuredText.
* [771] Undefined offset: 1 [line 204 of /usr/share/php/phing/tasks/ext/JslLintTask.php]
* [767] PharPackageTask: metadata should not be required
* [766] The DocBlox task does not load the markdown library.
* [765] CoverageReportTask incorrectly considers dead code to be unexecuted
* [762] Gratuitous unit test failures on Windows
* [760] SelectorUtils::matchPath() directory matching broken
* [759] DocBloxTask throws an error when using DocBlox 0.12.2
* [757] Grammar error in ChmodTask documentation
* [755] PharPackageTask Web/Cli stub path is incorrect
* [754] ExecTask: <arg> support
* [753] ExecTask: Unit tests and refactoring
* [752] Declaration of Win32FileSystem::compare()
* [750] Enable process isolation support in the PHPUnit task
* [747] Improve "can't load default task list" message
* [745] MkdirTask mode param mistake
* [744] PHP_CodeSniffer formatter doesn't work with summary
* [742] ExecTask docs: link os.name in os attribute
* [741] ExecTask: missing docs for "output", "error" and "level"
* [740] PHPMDTask: "InvalidArgumentException" with no globbed files.
* [739] Making the jsMin suffix optional
* [737] PHPCPDTask: omitting 'outfile' attribute with 'useFIle="false"'
* [735] CopyTask can't copy broken symlinks when included in fileset
* [733] DeleteTask cannot delete dangling symlinks
* [731] Implement filepath support in Available Task
* [720] rSTTask to render reStructuredText
* [658] Add support to Oracle (OCI) in DbDeployTask
* [580] ODBC in DbDeployTask
* [553] copy task bails on symbolic links (filemtime)
* [499] PDO cannot handle PL/Perl function creation statements in PostgreSQL
Jul. 12, 2011 - Phing 2.4.6
---------------------------
This release fixes a large number of issues, improves a number of tasks
and adds several new tasks (SVN log/list, DocBlox and LoadFile).
* [732] execTask fails to chdir if the chdir parameter is a symlink to a dir
* [730] phpunitreport: styledir not required
* [729] CopyTask fails when todir="" does not exist
* [725] Clarify documentation for using AvailableTask as a condition
* [723] setIni() fails with memory_limit not set in Megabytes
* [719] TouchTask: file not required?
* [718] mkdir: are parent directories created?
* [715] Fix for mail task documentation
* [712] expectSpecificBuildException fails to detect wrong exception message
* [708] typo in docs: "No you can set"
* [706] Advanced task example missing
* [705] Missing links in Writing Tasks: Summary
* [704] Case problem in "Writing Tasks" with setMessage
* [703] missing links in "Package Imports"
* [701] Setting more then two properties in command line not possible on windows
* [699] Add loadfile task
* [698] Add documentation for patternset element to user guide
* [696] CoverageReportTask doesn't recognize UTF-8 source code
* [695] phpunit Task doesn't support @codeCoverageIgnore[...] comments
* [692] Class 'GroupTest' not found in /usr/share/php/phing/tasks/ext/simpletest/SimpleTestTask.php on line 158
* [691] foreach doesn't work with filelists
* [690] Support DocBlox
* [689] Improve documentation about selectors
* [688] SshTask Adding (+propertysetter, +displaysetter)
* [685] SvnLogTask and SvnListTask
* [682] Loading custom tasks should use the autoloading mechanism
* [681] phpunit report does not work with a single testcase
* [680] phpunitreport: make tables sortable
* [679] IoncubeEncoderTask improved
* [673] new listener HtmlColorLogger
* [672] DbDeployTask::getDeltasFilesArray has undefined variable
* [671] fix CvsTask documentation
* [670] DirectoryScanner: add darcs to default excludes
* [668] Empty Default Value Behaves Like the Value is not set
* [667] Document how symbolic links and hidden files are treated in copy task
* [663] __toString for register slots
* [662] Hiding the command that is excecuted with "ExecTask"
* [659] optionally skip version check in codesniffer task
* [654] fileset not selecting folders
* [652] PDOSQLExec task doesn't close the DB connection before throw an exception or at the end of the task.
* [642] ERROR: option "-o" not known with phpcs version 1.3.0RC2 and phing/phpcodesniffer 2.4.4
* [639] Add verbose mode for SCPTask
* [635] ignored autocommit="false" in PDOTask?
* [632] CoverageThresholdTask needs exclusion option/attribute
* [626] Coverage threshold message is too detailed...
* [616] PhpDocumentor prematurely checks for executable
* [613] Would be nice to have -properties=<file> CLI option
* [611] Attribute "title" is wanted in CoverageReportTask
* [608] Tweak test failure message from PHPUnitTask
* [591] PhpLintTask don't log all errors for each file
* [563] Make PatchTask silent on FreeBSD
* [546] Support of filelist in CodeCoverageTask
* [527] pearpkg2: unable to specify different file roles
* [521] jslint warning logger
Mar. 3, 2011 - Phing 2.4.5
--------------------------
This release fixes several issues, and reverts the changes
that introduced the ComponentHelper class.
* [657] Wrong example of creating task in stable documentation.
* [656] Many erratas on the "Getting Started"-page.
* [651] Messages of ReplaceTokens should be verbose
* [641] 2.4.4 packages contains .rej and .orig files in release tarball
* [640] "phing -q" does not work: "Unknown argument: -q"
* [634] php print() statement outputting to stdout
* [624] PDOSQLExec fails with Fatal error: Class 'LogWriter' not found in [...]/PDOSQLExecFormatterElement
* [623] 2.4.5RC1 requires PHPUnit erroneously
* [621] PhpLintTask outputs all messages (info and errors) to same loglevel
* [614] phpcodesniffer task changes Phing build working directory
* [610] BUG: AdhocTaskdefTask fails when creating a task that extends from an existing task
* [607] v 2.4.4 broke taskdef for tasks following PEAR naming standard
* [603] Add support to PostgreSQL in DbDeployTask
* [601] Add HTTP_Request2 to optional dependencies
* [600] typo in ReplaceRegexpTask
* [598] Wrong version for optional Services_Amazon_S3 dependency
* [596] PhpDependTask no more compatible with PDepend since 0.10RC1
* [593] Ssh/scp task: Move ssh2_connect checking from init to main
* [564] command line "-D" switch not handled correctly under windows
* [544] Wrong file set when exclude test/**/** is used
Dec. 2, 2010 - Phing 2.4.4
--------------------------
This release fixes several issues.
* [595] FilterChain without ReplaceTokensWithFile creator
* [594] Taskdef in phing 2.4.3 was broken!
* [590] PhpLintTask don't flag files that can't be parsed as bad files
* [589] Mail Task don't show recipients list on log
* [588] Add (optional) dependency to VersionControl_Git and Services_Amazon_S3 packages
* [585] Same line comments in property files are included in the property value
* [570] XmlLintTask - check well-formedness only
* [568] Boolean properties get incorrectly expanded
* [544] Wrong file set when exclude test/**/** is used
* [536] DbDeployTask: Undo script wrongly generated
Nov. 12, 2010 - Phing 2.4.3
---------------------------
This release adds tasks to interface with Git and Amazon S3, adds support for PHPUnit 3.5,
and fixes numerous issues.
* [583] UnixFileSystem::compare() is broken
* [582] Add haltonerror attribute to copy/move tasks
* [581] XmlProperty creating wrong properties
* [577] SVN commands fail on Windows XP
* [575] xmlproperty - misplaced xml attributes
* [574] Task "phpcodesniffer" broken, no output
* [572] ImportTask don't skipp file if optional is set to true
* [560] [PATCH] Compatibility with PHPUnit 3.5.
* [559] UpToDate not override value of property when target is called by phingcall
* [555] STRICT Declaration of UnixFileSystem::getBooleanAttributes() should be compatible with that of FileSystem::getBooleanAttributes()
* [554] Patch to force PhpDocumentor to log using phing
* [551] SVN Switch Task
* [550] Ability to convert encoding of files
* [549] ScpTask doesn't finish the transfer properly
* [547] The new attribute version does not work
* [543] d51PearPkg2Task: Docs link wrong
* [542] JslLintTask: wrap conf parameter with escapeshellarg
* [537] Install documentation incorrect/incomplete
* [536] DbDeployTask: Undo script wrongly generated
* [534] Task for downloading a file through HTTP
* [531] cachefile parameter of PhpLintTask also caches erroneous files
* [530] XmlLintTask does not stop buid process when schema validation fails
* [529] d51pearpkg2: setOptions() call does not check return value
* [526] pearpkg2: extdeps and replacements mappings not documented
* [525] pearpkg2: minimal version on dependency automatically set max and recommended
* [524] pearpkg2: maintainers mapping does not support "active" tag
* [520] Need SvnLastChangedRevisionTask to grab the last changed revision for the current working directory
* [518] [PHP Error] file_put_contents(): Filename cannot be empty in phpcpdesniffer task
* [513] Version tag doesn't increment bugfix portion of the version
* [511] Properties not being set on subsequent sets.
* [510] to show test name when testing fails
* [501] formatter type "clover" of task "phpunit" doesn't generate coverage according to task "coverage-setup"
* [488] FtpDeployTask is very silent, error messages are not clear
* [455] Should be able to ignore a task when listing them from CLI
* [369] Add Git Support
Jul. 28, 2010 - Phing 2.4.2
---------------------------
* [509] Phing.php setIni() does not honor -1 as unlimited
* [506] Patch to allow -D<option> with no "=<value>"
* [503] PHP Documentor Task not correctly documented
* [502] Add repository url support to SvnLastRevisionTask
* [500] static function call in PHPCPDTask
* [498] References to Core types page are broken
* [496] __autoload not being called
* [492] Add executable attribute in JslLint task
* [489] PearPackage Task fatal error trying to process Fileset options
* [487] Allow files in subdirectories in ReplaceTokensWithFile filter
* [486] PHP Errors in PDOSQLExecTask
* [485] ReplaceTokensWithFile filter does not allow HTML translation to be
switched off
* [484] Make handling of incomplete tests when logging XML configurable
* [483] Bug in FileUtils::copyFile() on Linux - when using FilterChains,
doesn't preserve attributes
* [482] Bug in ChownTask with verbose set to false
* [480] ExportPropertiesTask does not export all the initialized properties
* [477] HttpRequestTask should NOT validate output if regex is not provided
* [474] Bad Comparisons in FilenameSelector (possibly others)
* [473] CPanel can't read Phing's Zip Files
* [472] Add a multiline option to regex replace filter
* [471] ChownTask throws exception if group is given
* [468] CopyTask does not accept a FileList as only source of files
* [467] coverage of abstract class/method is always ZERO
* [466] incomplete logging in coverage-threshold
* [465] PatchTask should support more options
* [463] Broken Links in coverage report
* [461] version tag in project node
Mar. 10, 2010 - Phing 2.4.1
---------------------------
* [460] FtpDeployTask error
* [458] PHPCodeSniffer Task throws Exceptions
* [456] Fileset's dir should honor expandsymboliclinks
* [449] ZipTask creates ZIP file but doesn't set file/dir attributes
* [448] PatchTask
* [447] SVNCopy task is not documented
* [446] Add documentation describing phpdocext
* [444] PhpCodeSnifferTask fails to generate a checkstyle-like output
* [443] HttpRequestTask is very desirable
* [442] public key support for scp and ssh tasks
* [436] Windows phing.bat can't handle PHP paths with spaces
* [435] Phing download link broken in bibliography
* [433] Error in Documentation in Book under Writing a simple Buildfile
* [432] would be nice to create CoverateThresholdTask
* [431] integrate Phing with PHP Mess Detector and PHP_Depend
* [430] FtpDeployTask is extremely un-verbose...
* [428] Ability to specify the default build listener in build file
* [426] SvnExport task documentation does not mention "revision" property
* [421] ExportProperties class incorrectly named
* [420] Typo in setExcludeGroups function of PHPUnitTask
* [418] Minor improvement for PhpLintTask
Jan. 17, 2010 - Phing 2.4.0
---------------------------
* [414] PhpLintTask: retrieving bad files
* [413] PDOSQLExecTask does not recognize "delimiter" command
* [411] PhpEvalTask calculation should not always returns anything
* [410] Allow setting alias for Phar files as well as a custom stub
* [384] Delete directories fails on '[0]' name
Dec. 17, 2009 - Phing 2.4.0 RC3
-------------------------------
* [407] some error with svn info
* [406] an ability to turn phpLint verbose ON and OFF
* [405] I can't get a new version of Phing through PEAR
* [402] Add fileset/filelist support to scp tasks
* [401] PHPUnitTask 'summary' formatter produces a long list of results
* [400] Support for Clover coverage XML
* [399] PhpDocumentorExternal stops in method constructArguments
* [398] Error using ResolvePath on Windows
* [397] DbDeployTask only looks for -- //@UNDO (requires space)
* [396] PDOSQLExecTask requires both fileset and filelist, rather than either or
* [395] PharPackageTask fails to compress files
* [394] Fix differences in zip and tar tasks
* [393] prefix parameter for tar task
* [391] Docs: PharPackageTask 'compress' attribute wrong
* [389] Code coverage shows incorrect results Part2
* [388] Beautify directory names in zip archives
* [387] IoncubeEncoderTask noshortopentags
* [386] PhpCpd output to screen
* [385] Directory ignored in PhpCpdTask.php
* [382] Add prefix parameter to ZipTask
* [381] FtpDeployTask: invalid default transfer mode
* [380] How to use PhpDocumentorExternalTask
* [379] PHPUnit error handler issue
* [378] PHPUnit task bootstrap file included too late
* [377] Code coverage shows incorrect results
* [376] ReplaceToken boolean problems
* [375] error in docs for echo task
* [373] grammar errors
* [372] Use E_DEPRECATED
* [367] Can't build simple build.xml file
* [361] Bug in PHPCodeSnifferTask
* [360] &amp;&amp; transfers into & in new created task
* [309] startdir and 'current directory' not the same when build.xml not in current directory
* [268] Patch - xmlproperties Task
* [204] Resolve task class names with PEAR/ZEND/etc. naming convention
* [137] Excluded files may be included in Zip/Tar tasks
Oct. 20, 2009 - Phing 2.4.0 RC2
-------------------------------
* [370] Fatal error: Cannot redeclare class PHPUnit_Framework_TestSuite
* [366] Broken link in "Getting Started/More Complex Buildfile"
* [365] Phing 2.4rc1 via pear is not usable
* [364] 2.4.0-rc1 download links broken
* [363] PHPUnit task fails with formatter type 'xml'
* [359] 403 for Documentation (User Guide) Phing HEAD
* [355] PDOSQLExecTask should accept filelist subelement
* [352] Add API documentation
Sep. 14, 2009 - Phing 2.4.0 RC1
-------------------------------
* [362] Can't get phpunit code coverage to export as XML
* [361] Bug in PHPCodeSnifferTask
* [357] SvnLastRevisionTask fails when locale != EN
* [356] Documentation for tasks Chmod and Chown
* [349] JslLint task fails to escape shell argument
* [347] PHPUnit / Coverage tasks do not deal with bootstrap code
* [344] Phing ignores public static array named $browsers in Selenium tests
* [342] custom-made re-engine in SelectorUtils is awful slow
* [339] PHAR signature setting
* [336] Use intval to loop through files
* [333] XmlLogger doesn't ensure proper ut8 encoding of log messages
* [332] Conditions: uptodate does not work
* [331] UpToDateTask documentation says that nested FileSet tags are allowed
* [330] "DirectoryScanner cannot find a folder/file named ""0"" (zero)"
* [326] Add revision to svncheckout and svnupdate
* [325] "<filterchain id=""xxx""> and <filterchain refid=""xxx""> don't work"
* [322] phpdoc task not parsing and including RIC files in documentation output
* [319] Simpletest sometimes reports an undefined variable
* [317] PhpCodeSnifferTask lacks of haltonerror and haltonwarning attributes
* [316] Make haltonfailure attribute for ZendCodeAnalyzerTask
* [312] SimpleTestXMLResultFormatter
* [311] Fileset support for the TouchTask?
* [307] Replaceregexp filter works in Copy task but not Move task
* [306] Command-line option to output the <target> description attribute text
* [303] Documentation of Task Tag SimpleTest
* [300] ExecTask should return command output as a property (different from passthru)
* [299] PhingCall crashes if an AdhocTask is defined
* [292] Svn copy task
* [290] Add facility for setting resolveExternals property of DomDocument object in XML related tasks
* [289] Undefined property in XincludeFilter class
* [282] Import Task fix/improvement
* [280] Add Phar support (task) to Phing
* [279] Add documentation to PHK package task
* [278] Add PHK package task
* [277] PhpCodeSnifferTask has mis-named class, patch included
* [273] PHPUnit 3.3RC1 error in phpunit task adding files to filter
* [270] [patch] ReplaceRegExp
* [269] Allow properties to be recursively named.
* [263] phpunit code coverage file format change
* [262] Archive_Zip fails to extract on Windows
* [261] UnZip task reports success on failure on Windows
* [259] Unneeded warning in Untar task
* [256] Ignore dead code in code coverage
* [254] Add extra debug resultformatter to the simpletest task
* [252] foreach on a fileset
* [248] Extend taskdef task to allow property file style imports
* [247] New task: Import
* [246] Phing test brocken but no failure entry if test case class has no test method
* [245] TAR task
* [243] Delete task won't delete all files
* [240] phing test succesful while phpunit test is broken
* [233] Separate docs from phing package
* [231] File::exists() returns false on *existing* but broken symlinks
* [229] CopyTask shoul accept filelist subelement
* [226] <move> task doesn't support filters
* [222] Terminal output dissapears and/or changes color
* [221] Support for copying symlinks as is
* [212] Make file perms configurable in copy task
* [209] Cache the results of PHPLintTask so as to not check unmodified files
* [187] "ExecTask attribute ""passthru"" to make use of the PHP function ""passthru"""
* [21] svn tasks doesn't work
Dec. 8, 2008 - Phing 2.3.3
--------------------------
* [314] <phpunit> task does not work
* [313] Incorrect PhpDoc package of SimpleTestResultFormatter
* [302] Incorrect error detecting in XSLT filter
* [293] Contains condition fails on case-insensitive checks
* [291] The release package is not the one as the version(2.3.2) suppose to be
Oct. 16, 2008 - Phing 2.3.2
---------------------------
* [296] Problem with the Phing plugin with Hudson CI Tool
* [288] Comment syntax for dbdeploy violates standard
Oct. 16, 2008 - Phing 2.3.1
---------------------------
* [287] DateSelector.php bug
* [286] dbdeploy failes with MySQL strict mode
* [285] Syntax error in dbdeploy task
* [284] XSL Errors in coverage-report task
* [275] AnsiColorLogger should not be final
* [274] PHPUnit 3.3RC1 incompatibility with code coverage
* [272] Using CDATA with ReplaceTokens values
* [271] Warning on iterating over empty keys
* [264] Illeal use of max() with empty array
* [260] Error processing reults: SQLSTATE [HY000]: General error: 2053 when executing inserts or create statements.
* [258] getPhingVersion + printVersion should be public static
* [255] Timestamp in Phing Properties for Echo etc
* [253] CCS nav bug on PHING.info site
* [251] debug statement in Path datatype for DirSet
* [249] See failed tests in console
* [244] Phing pear install nor working
* [242] Log incomplete and skipped tests for phpunit3
* [241] FtpDeployTask reports FTP port as FTP server on error
* [239] ExecTask shows no output from running command
* [238] Bug in SummaryPHPUnit3ResultFormatter
* [237] Several PHP errors in XSLTProcessor
* [236] Do not show passwords for svn in log
* [234] typo in foreach task documentation
* [230] Fatal error: Call to undefined method PHPUnit2_Framework_TestResult::skippedCount() in /usr/local/lib/php/phing/tasks/ext/phpunit/PHPUnitTestRunner.php on line 120
* [227] simpletestformaterelement bad require
* [225] Missing Software Dependence in documentation
* [224] Path class duplicates absolute path on subsequent path includes
* [220] AnsiColorLogger colors cannot be changed by build.properties
* [219] Add new chown task
* [218] Clear support of PHPUnit versions
* [217] Memory limit in phpdoc
* [216] output messages about errors and warnings in JslLint task
* [215] boolean attributes of task PhpCodeSniffer are wrong
* [214] PhpCodeSnifferTask should be able to output file
* [213] Error in documentation task related to copy task
* [211] XSLT does not handle multiple testcase nodes for the same test method
* [210] Reworked PhpDocumentorExternalTask
* [208] ReplaceRegexp problem with newline as replace string
* [207] PhpLintTask: optional use a different PHP interpreter
* [206] Installation guide out of date (phing fails to run)
* [205] AvailableTask::_checkResource ends up with an exception if resource isn't found.
* [203] ExecTask returnProperty
* [202] Add PHP_CodeSniffer task
* [201] "Improve Phing's ability to work as an ""embedded"" process"
* [200] Additional attribute for SvnUpdateTask
* [199] Invalid error message in delete task when deleting directory fails.
* [198] PDO SQL exec task unable to handle multi-line statements
* [197] phing delete task sometimes fails to delete file that could be deleted
* [195] SvnLastRevisionTask fails if Subversion is localized (Spanish)
* [194] haltonincomplete attribute for phpunit task
* [193] Manifest Task
* [192] Error when skip test
* [191] Akismet says content is spam
* [190] Add test name in printsummary in PHPUnit task
* [185] PHPUnit_MAIN_METHOD defined more than once
* [184] PlainPHPUnit3ResultFormatter filteres test in stack trace
* [183] Undefined variable in PhingTask.php
* [182] Undefined variable in SummaryPHPUnit3ResultFormatter
* [181] PhingCallTask should call setHaltOnFailure
* [179] Add documentation for TidyFilter
* [178] printsummary doens work in PHP Unit task
* [177] Only write ConfigurationExceptions to stdout
* [176] Cleanup installation documentation.
* [175] passing aarguments to phing
* [169] Spurious PHP Error from XSLT Filter
* [150] unable to include phpdocumentor.ini in PHPDoc-Task
* [15] FTP upload task
Nov. 3, 2007 - Phing 2.3.0
--------------------------
* [174] Add differentiation for build loggers that require explicit streams to be set
* [173] Add 'value' alias to XSLTParam type.
* [172] broken phpunit2-frames.xsl
* [171] Allow results from selector to be loosely type matched to true/false
* [170] SvnLastRevisionTask cannot get SVN revision number on single file
* [168] XincludeFilter PHP Error
* [167] Add new formatter support for PDOSQLExecTask
* [166] Change CreoleTask to use <creole> tagname instead of <sql>
* [165] Add support for PHPUnit_Framework_TestSuite subclasses in fileset of test classes
* [164] Failed build results in empty log.xml
* [163] Add stripwhitespace filter
* [162] Add @pattern alias for @name in <fileset>
* [161] phing/etc directory missing (breaking PHPUnit)
* [157] Fatal error in PDOSQLExecTask when using filesets
* [155] <delete> fails when it encounters symlink pointing to non-writable file
* [154] Suggestion to add attribute to PDOSQLExecTask for fetch_style
* [153] sqlite select failure
* [152] result of PHP-Unit seems to be incorrect
* [151] add group-option to PHPUnit-Task
* [149] using TestSuites in fileset of PHPUnit-Task
* [148] remove dependency to PEAR in PHPUnit-Task
* [146] Illegal offset type PHP notice in CopyTask
* [143] Example for PhpDocumentor task has typographical errors and a wrong attribute.
* [142] SvnCheckout task only makes non-recursive checkouts.
* [141] Add 'recursive' attribute to svncheckout task.
* [136] Attribute os of ExecTask is not working
* [135] add source file attribute for code coverage xml report
* [133] Error in documenation: AppendTask
* [129] Typo in documentation
* [128] <pearpkg2> is missing in the doc completely
* [127] Error in documentation
* [126] Typo in documentation
* [122] PearPackage2Task Replacements don't seem to work
* [121] BUILD FAILED use JsLintTask
* [119] PhpDocumentorTask fails when trying to use parsePrivate attribute.
* [118] custom tasks have this->project == null
* [117] CoverageSetupTask and autoloaders
* [116] Test unit don't report notice or strict warnings
* [110] "Add ""errorproperty"" attribute to PhpLintTask"
* [107] SvnLastRevisionTask doesn't work with repositoryUrl
* [106] "document ""haltonfailure"" attribute for phplint task"
* [105] FileSystemUnix::normalize method: Improve handling
* [97] delete dir and mkdir are incompatible
* [92] Inconsistent newlines in PHP files
* [91] Improve detection for PHPUnit3
* [83] "XmlLogger improperly handling ""non-traditional"" buildfile execution paths"
* [82] Error when use markTestIncomplete in test
* [79] Allow escaped dots in classpaths
* [78] (SVN doc) ${phing.version} and ${php.version} are different!
* [77] taskdef doesn't support fileset
* [76] Overhaul PhpDocumentor task
* [75] files excluded by fileset end up in .tgz but not .zip
* [74] Phing commandline args don't support quoting / spaces
* [73] Semantical error in PhingFile::getParent()
* [72] "Remove use of getProperty(""line.separator"") in favor of PHP_EOL"
* [71] "Add ""-p"" alias for project help"
* [70] Create Project class constants for log levels (replacing PROJECT_MSG_*)
* [69] mkdir and delete tasks don't work properly together
* [68] Xinclude filter
* [67] Add PDO SQL execution task
* [66] Incorrectly set PHP_CLASSPATH in phing.bat
* [65] Convert all loggers/listeners to use streams
* [64] Build listeners currently not working
* [63] Configured -logger can get overridden
* [62] phing.buildfile.dirname built-in property
* [58] Path::listPaths() broken for DirSet objects.
* [57] FileList.getListFile method references undefined variable
* [56] TaskHandler passing incorrect param to ProjectConfigurator->configureId()
* [53] _makeCircularException seems to have an infinite loop
* [52] \<match>-syntax does not work correctly with preg_*()
* [51] Cannot get phing to work with PHPUnit 3
* [48] Supported PHPUnit2_Framework_TestSuite and PHPUnit2_Extensions_TestSetup sub-classes for the PHPUnit2Task and CoverageReportTask tasks
* [33] Implement changes to use PHPUnit2 3.0 code coverage information
* [22] Description about integrating into CruiseControl
Aug. 21, 2006 - Phing 2.2.0
---------------------------
* Refactored parser to support many tags as children of base <project> tag (HL)
* Added new IfTask (HL)
* Added "spawn" attribute to ExecTask (only applies to *nix)
* Several bugfixes & behavior imporvements to ExecTask (HL, MR, Ben Gollmer)
* Bugfixes & refactoring for SVNLastRevisionTask (MR, Knut Urdalen)
* Fixed reference copy bug (HL, Matthias Pigulla)
* Added SvnExportTask (MR)
* Added support for FileList in DeleteTask. (HL)
* Added support for using setting Properties using CDATA value of <property> tag. (HL)
* Added ReferenceExistsCondition (Matthias Pigulla)
* Added Phing::log() static method & integrated PHP error handling with Phing logging (HL)
* Added new task to run the ionCube Encoder (MR)
* Added new HTML Tidy filter (HL)
* Added PhpLintTask (Knut Urdalen)
* Added XmlLintTask (Knut Urdalen)
* Added ZendCodeAnalyzerTask (Knut Urdalen)
* Removed CoverageFormatter class (MR)
NOTE: This changes the usage of the collection of PHPUnit2 code coverage reports, see the
updated documentation for the CoverageSetupTask
* Added Unzip and Untar tasks contributed by Joakim Bodin
* [8], [49] Fixed bugs in TarTask related to including empty directories (HL)
* [44] Fixed bug related to copying empty dirs. (HL)
* [32] Fixed PHPUnit2 tasks to work with PHPUnit2-3.0.0 (MR)
* [31] Fixed bug with using PHPDocumentor 1.3.0RC6 (MR)
* [43] Fixed top-level (no target) IfTask behavior (Matthias Pigulla)
* [41] Removed some lingering E_STRICT errors, bugs with 5.1.x and PHP >= 5.0.5 (HL)
* [25] Fixed 'phing' script to also run on non-bash unix /bin/sh
* Numerous documentation improvements by many members of the community (Thanks!)
Sept. 18, 2005 - Phing 2.1.1
----------------------------
* Added support for specifying 4-char mask (e.g. 1777) to ChmodTask. (Hans Lellelid)
* Added .svn files to default excludes in DirectoryScanner.
* Updated PHPUnit2 BatchTest to use class detection and non-dot-path loader. (Michiel Rook)
* Added support for importing non dot-path files (Michiel Rook)
* Add better error message when build fails with exception (Hans Lellelid)
* Fixed runtime error when errors were encountered in AppendTask (Hans Lellelid)
June 17, 2005 - Phing 2.1.0
---------------------------
* Renamed File -> PhingFile to avoid namespace collisions (Michiel Rook)
* Add ZipTask to create .zip files (Michiel Rook)
* Removed redudant logging of build errors in Phing::start() (Michiel Rook)
* Added tasks to execute PHPUnit2 testsuites and generate coverage and
test reports. (Michiel Rook, Sebastian Bergmann)
* Added SvnLastRevisionTask that stores the number of the last revision
of a workingcopy in a property. (Michiel Rook)
* Added MailTask that sends a message by mail() (Michiel Rook, contributed by Francois Harvey)
* New IncludePathTask (<includepath/>) for adding values to PHP's include_path. (Hans Lellelid)
* Fix to Phing::import() to *not* attempt to invoke __autoload() in class_exists() check. (Hans Lellelid)
* Fixed AppendTask to allow use of only <fileset> as source. (Hans Lellelid)
* Removed dependency on posix, by changing posix_uname to php_uname if needed. (Christian Stocker)
* Fixed issues: (Michiel Rook)
11 ExtendedFileStream does not work on Windows
12 CoverageFormatter problem on Windows
13 DOMElement warnings in PHPUnit2 tasks
14 RuntimeException conflicts with SPL class
15 It is not possible to execute it with PHP5.1
16 Add Passthru option to ExecTask
17 Blank list on foreach task will loop once
19 Problem with <formatter outfile="...">
20 Phpunit2report missing XSL stylesheets
21 Warnings when output dir does not exist in PHPUnit2Report
Oct 16, 2004 - Phing 2.0.0
--------------------------
* Minor fixes to make Phing run under E_STRICT/PHP5.
* Fix to global/system properties not being set in project. (Matt Zandstra)
* Fixes to deprecated return by reference issues w/ PHP5.0.0
June 8, 2004 - Phing 2.0.0b3
----------------------------
* Brought up-to-date w/ PHP5.0.0RC3
* Fixed several bugs in ForeachTask
* Fixed runtime errors and incomplete inheriting of properties in PhingTask
* Added <fileset> support to AppendTask
March 19, 2004 - Phing 2.0.0b2
------------------------------
* Brought up-to-date w/ PHP5.0.0RC1 (Hans)
* Fixed bug in seting XSLT params using XSLTask (Hans, Jeff Moss)
* Fixed PHPUnit test framework for PHPUnit-2.0.0alpha3
* Added "Adhoc" tasks, which allow for defining PHP task or type classes within the
buildfile. (Hans)
* Added PhpEvalTask which allows property values to be set to simple PHP evaluations or
the results of function/method calls. (Hans)
* Added new phing.listener.PearLogger listener (logger). Also, the -logfile arg is now
supported. (Hans)
* Fixed broken ForeachTask task. (Manuel)
Dec 24, 2003 - Phing 2.0.0b1
----------------------------
* Added PEAR installation framework & ability to build Phing into PEAR package.
* Added TarTask using PEAR Archive_Tar
* Added PearPackageTask which creates a PEAR package.xml (using PEAR_PackageFileManager).
* Added ResolvePathTask which converts relative paths into absolute paths.
* Removed System class, due to namespace collision w/ PEAR.
* Basic "working?" tests performed with all selectors.
* Added selectors: TypeSelector, ContainsRegexpSelector
* CreoleSQLExec task is now operational.
* Corrected non-fatal bugs in: DeleteTask, ReflexiveTask
* All core Phing classes now in PHP5 syntax (no "var" used, etc.)
* CopyTask will not stop build execution if a file cannot be copied (will log and
continue to next file).
* New abstract MatchingTask task makes it easier to create your own tasks that use
selectors.
* Removed redundant calls in DirectoryScanner (<fileset> scanning now much faster).
* Fixed fatal errors in File::equals()
Nov 24, 2003 - Phing 2.0.0a2
----------------------------
* Fixed ReplaceTokens filter to correctly replace matched tokens
* Changed "project.basedir" property to be absolute path of basedir
* Made IntrospectionHelper more tollerant of add*() and addConfigured*() signatures
* New CvsTask and CvsPassTask for working with CVS repositories
* New TranslateGettext filter substitutes _("hello!") with "hola!" / "bonjour!" / etc.
* More consistent use of classhints to enable auto-casting by IntrospectionHelper
* Fixed infinite loop bug in FileUtils::normalize() for paths containing "/./"
* Fixed bug in CopyFile/fileset that caused termination of copy operation on encounter
of unreadable file
Nov 6, 20003 - Phing 2.0.0a1
----------------------------
* First release of Phing 2, an extensive rewrite and upgrade.
* Refactored much of codebase, using new PHP5 features (e.g. Interfaces, Exceptions!)
* Many, many, many bugfixes to existing functionality
* Restructuring for more intuitive directory layout, change the parser class names.
* Introduction of new tasks: AppendTask, ReflexiveTask, ExitTask, Input, PropertyPrompt
* Introduction of new types: Path, FileList, DirSet, selectors, conditions
* Introduction of new filters: ReplaceRegexp
* Introduction of new logger: AnsiColorLogger
* Many features from ANT 1.5 added to existing Tasks/Types
* New "Register Slot" functionality allows for tracking "inner" dynamic variables.

51
core/vendor/phing/phing/CREDITS.md vendored Normal file
View File

@@ -0,0 +1,51 @@
P H I N G
=========================
Phing 2.x Development
---------------------
- Michiel Rook <mrook@php.net>
- Hans Lellelid <hans@xmpl.org>
- Sebastian Bergmann <sb@sebastian-bergmann.de>
- Joakim Bodin <joakim.bodin+phing@gmail.com>
- Johan Van den Brande <johan@vandenbrande.com>
- Bryan Davis <bender@casadebender.com>
- Andrew Eddie <andrew.eddie@jamboworks.com>
- Markus Fischer <markus@fischer.name>
- David Giffin <david@giffin.org>
- Ryan Grove <ryan@wonko.com>
- Frank Kleine <mikey@stubbles.net>
- George Miroshnikov <laggy.luke@gmail.com>
- David Persson <davidpersson at qeweurope dot org>
- Stefan Priebsch <stefan.priebsch@e-novative.de>
- Jorrit Schippers <jorrit at ncode dot nl>
- Alexey Shockov <alexey@shockov.com>
- Dirk Thomas <dirk.thomas@4wdmedia.de>
- Knut Urdalen <knut.urdalen@gmail.com>
- Mike Wittje <mw@mike.wittje.de>
- Benjamin Schultz <bschultz@proqrent.de>
- Andrei Serdeliuc <andrei@serdeliuc.ro>
- Victor Farazdagi
- Christian Weiske
- Matthias Pigulla
- Lineke Kerckhoffs-Willems <lineke@phpassionate.com>
If you've done work on Phing and you are not listed here, please feel free
to add yourself.
Original Phing 1.x Development
------------------------------
- Andreas Aderhold <andi@binarycloud.com>
- Alex Black <enigma@turingstudio.com>
- Albert Lash <alash@plateauinnovation.com>
- Charlie Killian <charlie@tizac.com>
- Manuel Holtgrewe <grin@gmx.net>
- Andrzej Nowodworski <a.nowodworski@learn.pl>
- Jason Hines <jason@greenhell.com>
- Jesse Estevez <jesseestevez@earthlink.net>
- Andris Spruds <Andris.Spruds@stud.lba.lv>
- Ronald TAO <ronaldtao@hotmail.com>
- Yannick Lecaillez <yl@seasonfive.com>
- Hans Lellelid <hans@xmpl.org>

165
core/vendor/phing/phing/LICENSE vendored Normal file
View File

@@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

65
core/vendor/phing/phing/README.md vendored Normal file
View File

@@ -0,0 +1,65 @@
P H I N G
=========================
[![Build Status](https://secure.travis-ci.org/phingofficial/phing.png)](http://travis-ci.org/phingofficial/phing)
(PH)ing (I)s (N)ot (G)NU make; it's a PHP project build system or build
tool based on Apache Ant. You can do anything with it that you could do
with a traditional build system like GNU make, and its use of simple XML
build files and extensible PHP "task" classes make it an easy-to-use and
highly flexible build framework.
Features include running PHPUnit and SimpleTest unit tests (including test
result and coverage reports), file transformations (e.g. token replacement,
XSLT transformation, Smarty template transformations),
file system operations, interactive build support, SQL execution,
CVS/SVN/GIT operations, tools for creating PEAR packages, documentation
generation (DocBlox, PhpDocumentor) and much, much more.
If you find yourself writing custom scripts to handle the packaging,
deploying, or testing of your applications, then we suggest looking at Phing.
Phing comes packaged with numerous out-of-the-box operation modules (tasks),
and an easy-to-use OO model to extend or add your own custom tasks.
Phing provides the following features:
* Simple XML buildfiles
* Rich set of provided tasks
* Easily extendable via PHP classes
* Platform-independent: works on UNIX, Windows, Mac OSX
* No required external dependencies
* Built for PHP5
The Latest Version
------------------
Details of the latest version can be found on the Phing homepage
<http://www.phing.info/>.
Installation
------------
The preferred method to install Phing is through PEAR and the Phing PEAR
channel. You can install Phing by adding the pear.phing.info channel
to your PEAR environment and then installing Phing using the *phing*
channel alias and *phing* package name:
$> pear channel-discover pear.phing.info
$> pear install [--alldeps] phing/phing
Documentation
-------------
Documentation is available in HTML format in the *docs* directory. In particular,
open the *docs/phing_guide/book/index.html* in a browser to see the
Phing User Guide.
For online documentation, you can also visit the Phing website: http://www.phing.info/
Licensing
---------
This software is licensed under the terms you may find in the file
named "LICENSE" in this directory.
Thank you for using PHING!

18
core/vendor/phing/phing/bin/pear-phing vendored Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# ------------------------------------------------------------------------
# The phing build script for Unix based systems
# $Id$
# ------------------------------------------------------------------------
# -------------------------------------------------------------------------
# Do not change anything below this line unless you know what you're doing.
# -------------------------------------------------------------------------
if (test -z "$PHP_COMMAND") ; then
#echo "WARNING: PHP_COMMAND environment not set. (Assuming php on PATH)"
PHP_COMMAND="@PHP-BIN@"
export PHP_COMMAND
fi
$PHP_COMMAND -d html_errors=off -qC @PEAR-DIR@/phing.php -logger phing.listener.AnsiColorLogger "$@"

View File

@@ -0,0 +1,44 @@
@ECHO OFF
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: The phing build script for Windows based systems
:: $Id$
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::----------------------------------------------------------------------------------
:: Please set following to PHP's CLI
:: NOTE: In PHP 4.2.x the PHP-CLI used to be named php-cli.exe.
:: PHP 4.3.x names it php.exe but stores it in a subdir called /cli/php.exe
:: E.g. for PHP 4.2 C:\phpdev\php-4.2-Win32\php-cli.exe
:: for PHP 4.3 C:\phpdev\php-4.3-Win32\cli\php.exe
SET phpCli=@PHP-BIN@
::---------------------------------------------------------------------------------
::---------------------------------------------------------------------------------
:: Do not modify below this line!! (Unless you know what your doing :)
::---------------------------------------------------------------------------------
::---------------------------------------------------------------------------------
:: Check existence of php.exe
IF EXIST "%phpCli%" (
SET doNothing=
) ELSE GOTO :NoPhpCli
"%phpCli%" -d html_errors=off -qC "@PEAR-DIR@\phing.php" %*
GOTO :EOF
::
:: php.exe not found error
GOTO :PAUSE_END
:NoPhpCli
ECHO ** ERROR *****************************************************************
ECHO * Sorry, can't find the php.exe file.
ECHO * You must edit this file (%~s0) to point to your php.exe (CLI)
ECHO * [Currently set to %phpCli%]
ECHO **************************************************************************
GOTO :PAUSE_END
:PAUSE_END
PAUSE

18
core/vendor/phing/phing/bin/phing vendored Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env php
<?php
/**
* Shell wrapper for Phing
* $Id$
*/
// turn off html errors
ini_set('html_errors', 'off');
// default logger
if (!in_array('-logger', $argv)) {
$argv[] = '-logger';
$argv[] = 'phing.listener.AnsiColorLogger';
}
require_once dirname(__FILE__) . '/phing.php';

58
core/vendor/phing/phing/bin/phing.bat vendored Normal file
View File

@@ -0,0 +1,58 @@
@echo off
rem *********************************************************************
rem ** the phing build script for Windows based systems
rem ** $Id$
rem *********************************************************************
rem This script will do the following:
rem - check for PHP_COMMAND env, if found, use it.
rem - if not found detect php, if found use it, otherwise err and terminate
rem - check for PHING_HOME evn, if found use it
rem - if not found error and leave
rem - check for PHP_CLASSPATH, if found use it
rem - if not found set it using PHING_HOME/classes
if "%OS%"=="Windows_NT" @setlocal
rem %~dp0 is expanded pathname of the current script under NT
set DEFAULT_PHING_HOME=%~dp0..
goto init
goto cleanup
:init
if "%PHING_HOME%" == "" set PHING_HOME=%DEFAULT_PHING_HOME%
set DEFAULT_PHING_HOME=
if "%PHP_COMMAND%" == "" goto no_phpcommand
if "%PHP_CLASSPATH%" == "" goto set_classpath
goto run
goto cleanup
:run
"%PHP_COMMAND%" -d html_errors=off -qC "%PHING_HOME%\bin\phing.php" %*
goto cleanup
:no_phpcommand
REM echo ------------------------------------------------------------------------
REM echo WARNING: Set environment var PHP_COMMAND to the location of your php.exe
REM echo executable (e.g. C:\PHP\php.exe). (Assuming php.exe on Path)
REM echo ------------------------------------------------------------------------
set PHP_COMMAND=php.exe
goto init
:err_home
echo ERROR: Environment var PHING_HOME not set. Please point this
echo variable to your local phing installation!
goto cleanup
:set_classpath
set PHP_CLASSPATH=%PHING_HOME%\classes
goto init
:cleanup
if "%OS%"=="Windows_NT" @endlocal
REM pause

62
core/vendor/phing/phing/bin/phing.php vendored Normal file
View File

@@ -0,0 +1,62 @@
<?php
/**
* This is the Phing command line launcher. It starts up the system evironment
* tests for all important paths and properties and kicks of the main command-
* line entry point of phing located in phing.Phing
* @version $Id$
*/
// Use composers autoload.php if available
if (file_exists(dirname(__FILE__) . '/../vendor/autoload.php')) {
require_once dirname(__FILE__) . '/../vendor/autoload.php';
} else if (file_exists(dirname(__FILE__) . '/../../../autoload.php')) {
require_once dirname(__FILE__) . '/../../../autoload.php';
}
// Set any INI options for PHP
// ---------------------------
/* set include paths */
set_include_path(
dirname(__FILE__) . '/../classes' .
PATH_SEPARATOR .
get_include_path()
);
require_once 'phing/Phing.php';
try {
/* Setup Phing environment */
Phing::startup();
// Set phing.home property to the value from environment
// (this may be NULL, but that's not a big problem.)
Phing::setProperty('phing.home', getenv('PHING_HOME'));
// Grab and clean up the CLI arguments
$args = isset($argv) ? $argv : $_SERVER['argv']; // $_SERVER['argv'] seems to not work (sometimes?) when argv is registered
array_shift($args); // 1st arg is script name, so drop it
// Invoke the commandline entry point
Phing::fire($args);
// Invoke any shutdown routines.
Phing::shutdown();
} catch (ConfigurationException $x) {
Phing::printMessage($x);
exit(-1); // This was convention previously for configuration errors.
} catch (Exception $x) {
// Assume the message was already printed as part of the build and
// exit with non-0 error code.
exit(1);
}
?>

View File

@@ -0,0 +1,314 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/tasks/system/MatchingTask.php';
include_once 'phing/types/FileSet.php';
include_once 'phing/tasks/ext/pearpackage/Fileset.php';
/**
*
* @author Hans Lellelid <hans@xmpl.org>
* @package phing.tasks.ext
* @version $Revision$
*/
class BuildPhingPEARPackageTask extends MatchingTask {
/** Base directory for reading files. */
private $dir;
private $version;
private $state = 'stable';
private $notes;
private $mode = 'source';
private $filesets = array();
/** Package file */
private $packageFile;
public function init() {
include_once 'PEAR/PackageFileManager2.php';
if (!class_exists('PEAR_PackageFileManager2')) {
throw new BuildException("You must have installed PEAR_PackageFileManager2 (PEAR_PackageFileManager >= 1.6.0) in order to create a PEAR package.xml file.");
}
}
private function setOptions($pkg){
$options['baseinstalldir'] = 'phing';
$options['packagedirectory'] = $this->dir->getAbsolutePath();
if (empty($this->filesets)) {
throw new BuildException("You must use a <fileset> tag to specify the files to include in the package.xml");
}
$options['filelistgenerator'] = 'Fileset';
// Some PHING-specific options needed by our Fileset reader
$options['phing_project'] = $this->getProject();
$options['phing_filesets'] = $this->filesets;
if ($this->packageFile !== null) {
// create one w/ full path
$f = new PhingFile($this->packageFile->getAbsolutePath());
$options['packagefile'] = $f->getName();
// must end in trailing slash
$options['outputdirectory'] = $f->getParent() . DIRECTORY_SEPARATOR;
$this->log("Creating package file: " . $f->getPath(), Project::MSG_INFO);
} else {
$this->log("Creating [default] package.xml file in base directory.", Project::MSG_INFO);
}
if ($this->mode == "docs")
{
$options['dir_roles'] = array( 'phing_guide' => 'doc',
'api' => 'doc',
'example' => 'doc');
}
else
{
// add install exceptions
$options['installexceptions'] = array( 'bin/phing.php' => '/',
'bin/pear-phing' => '/',
'bin/pear-phing.bat' => '/',
);
$options['dir_roles'] = array( 'etc' => 'data');
$options['exceptions'] = array( 'bin/pear-phing.bat' => 'script',
'bin/pear-phing' => 'script',
'CREDITS.md' => 'doc',
'CHANGELOG.md' => 'doc',
'LICENSE' => 'doc',
'README.md' => 'doc');
}
$pkg->setOptions($options);
}
/**
* Main entry point.
* @return void
*/
public function main() {
if ($this->dir === null) {
throw new BuildException("You must specify the \"dir\" attribute for PEAR package task.");
}
if ($this->version === null) {
throw new BuildException("You must specify the \"version\" attribute for PEAR package task.");
}
$package = new PEAR_PackageFileManager2();
$this->setOptions($package);
// the hard-coded stuff
if ($this->mode == "docs")
{
$package->setPackage('phingdocs');
$package->setSummary('PHP5 project build system based on Apache Ant (documentation)');
}
else
{
$package->setPackage('phing');
$package->setSummary('PHP5 project build system based on Apache Ant');
}
$package->setDescription('PHing Is Not GNU make; it\'s a project build system based on Apache Ant.
You can do anything with it that you could do with a traditional build system like GNU make, and its use of
simple XML build files and extensible PHP "task" classes make it an easy-to-use and highly flexible build framework.
Features include file transformations (e.g. token replacement, XSLT transformation, Smarty template transformations,
etc.), file system operations, interactive build support, SQL execution, and much more.');
$package->setChannel('pear.phing.info');
$package->setPackageType('php');
$package->setReleaseVersion($this->version);
$package->setAPIVersion($this->version);
$package->setReleaseStability($this->state);
$package->setAPIStability($this->state);
$package->setNotes($this->notes);
$package->setLicense('LGPL', 'http://www.gnu.org/licenses/lgpl.html');
// Add package maintainers
$package->addMaintainer('lead', 'mrook', 'Michiel Rook', 'mrook@php.net');
// (wow ... this is a poor design ...)
//
// note that the order of the method calls below is creating
// sub-"release" sections which have specific rules. This replaces
// the platformexceptions system in the older version of PEAR's package.xml
//
// Programmatically, I feel the need to re-iterate that this API for PEAR_PackageFileManager
// seems really wrong. Sub-sections should be encapsulated in objects instead of having
// a "flat" API that does not represent the structure being created....
if ($this->mode != "docs")
{
// creating a sub-section for 'windows'
$package->addRelease();
$package->setOSInstallCondition('windows');
$package->addInstallAs('bin/phing.php', 'phing.php');
$package->addInstallAs('bin/pear-phing.bat', 'phing.bat');
$package->addIgnoreToRelease('bin/pear-phing');
// creating a sub-section for non-windows
$package->addRelease();
$package->addInstallAs('bin/phing.php', 'phing.php');
$package->addInstallAs('bin/pear-phing', 'phing');
$package->addIgnoreToRelease('bin/pear-phing.bat');
}
// "core" dependencies
$package->setPhpDep('5.2.0');
$package->setPearinstallerDep('1.8.0');
// "package" dependencies
if ($this->mode != "docs")
{
$package->addPackageDepWithChannel( 'optional', 'phingdocs', 'pear.phing.info', $this->version);
$package->addPackageDepWithChannel( 'optional', 'VersionControl_SVN', 'pear.php.net', '0.4.0');
$package->addPackageDepWithChannel( 'optional', 'VersionControl_Git', 'pear.php.net', '0.4.3');
$package->addPackageDepWithChannel( 'optional', 'PHPUnit', 'pear.phpunit.de', '3.6.0');
$package->addPackageDepWithChannel( 'optional', 'PHP_CodeCoverage', 'pear.phpunit.de', '1.1.0');
$package->addPackageDepWithChannel( 'optional', 'Xdebug', 'pecl.php.net', '2.0.5');
$package->addPackageDepWithChannel( 'optional', 'Archive_Tar', 'pear.php.net', '1.3.0');
$package->addPackageDepWithChannel( 'optional', 'PEAR_PackageFileManager', 'pear.php.net', '1.5.2');
$package->addPackageDepWithChannel( 'optional', 'Services_Amazon_S3', 'pear.php.net', '0.3.1');
$package->addPackageDepWithChannel( 'optional', 'HTTP_Request2', 'pear.php.net', '0.5.2');
$package->addPackageDepWithChannel( 'optional', 'PHP_Depend', 'pear.pdepend.org', '0.10.0');
$package->addPackageDepWithChannel( 'optional', 'PHP_PMD', 'pear.phpmd.org', '1.1.0');
$package->addPackageDepWithChannel( 'optional', 'phpcpd', 'pear.phpunit.de', '1.3.3');
$package->addPackageDepWithChannel( 'optional', 'phploc', 'pear.phpunit.de', '1.6.4');
$package->addPackageDepWithChannel( 'optional', 'phpDocumentor', 'pear.phpdoc.org', '2.0.0a10');
$package->addPackageDepWithChannel( 'optional', 'PHP_CodeSniffer', 'pear.php.net', '1.3.0');
$package->addPackageDepWithChannel( 'optional', 'Net_Growl', 'pear.php.net', '2.6.0');
// now add the replacements, chdir() to source directory
// to allow addReplacement() to find the specified files
$cwd = getcwd();
chdir($this->dir->getAbsolutePath());
$package->addReplacement('Phing.php', 'pear-config', '@DATA-DIR@', 'data_dir');
$package->addReplacement('bin/pear-phing.bat', 'pear-config', '@PHP-BIN@', 'php_bin');
$package->addReplacement('bin/pear-phing.bat', 'pear-config', '@BIN-DIR@', 'bin_dir');
$package->addReplacement('bin/pear-phing.bat', 'pear-config', '@PEAR-DIR@', 'php_dir');
$package->addReplacement('bin/pear-phing', 'pear-config', '@PHP-BIN@', 'php_bin');
$package->addReplacement('bin/pear-phing', 'pear-config', '@BIN-DIR@', 'bin_dir');
$package->addReplacement('bin/pear-phing', 'pear-config', '@PEAR-DIR@', 'php_dir');
chdir($cwd);
}
$package->generateContents();
$e = $package->writePackageFile();
if (PEAR::isError($e)) {
throw new BuildException("Unable to write package file.", new Exception($e->getMessage()));
}
}
/**
* Used by the PEAR_PackageFileManager_PhingFileSet lister.
* @return array FileSet[]
*/
public function getFileSets() {
return $this->filesets;
}
// -------------------------------
// Set properties from XML
// -------------------------------
/**
* Nested creator, creates a FileSet for this task
*
* @return FileSet The created fileset object
*/
function createFileSet() {
$num = array_push($this->filesets, new FileSet());
return $this->filesets[$num-1];
}
/**
* Set the version we are building.
* @param string $v
* @return void
*/
public function setVersion($v){
$this->version = $v;
}
/**
* Set the state we are building.
* @param string $v
* @return void
*/
public function setState($v) {
$this->state = $v;
}
/**
* Sets release notes field.
* @param string $v
* @return void
*/
public function setNotes($v) {
$this->notes = $v;
}
/**
* Sets "dir" property from XML.
* @param PhingFile $f
* @return void
*/
public function setDir(PhingFile $f) {
$this->dir = $f;
}
/**
* Sets the file to use for generated package.xml
*/
public function setDestFile(PhingFile $f) {
$this->packageFile = $f;
}
/**
* Sets mode property
* @param string $v
* @return void
*/
public function setMode($v) {
$this->mode = $v;
}
}

307
core/vendor/phing/phing/build/build.xml vendored Normal file
View File

@@ -0,0 +1,307 @@
<?xml version="1.0"?>
<!--
This build file packages the phing files, builds a package.xml (version 2) for installation
using PEAR and creates the TAR and TGZ files.
-->
<project name="phing" basedir="." default="main">
<property name="phingpkg.home" value=".."/>
<property name="build.pear.dir" value="pear"/>
<taskdef
name="pear-package"
classname="BuildPhingPEARPackageTask" classpath="."/>
<fileset dir="${phingpkg.home}" id="all">
<include name="**/**"/>
<exclude name="bin/pear-phing"/>
<exclude name="bin/pear-phing.bat"/>
<exclude name="build/**"/>
<exclude name=".settings/**"/>
<exclude name=".buildpath"/>
<exclude name=".project"/>
<exclude name="test/performance/**"/>
<exclude name="test/reports/**"/>
<exclude name="docs/docbook5/**"/>
<exclude name="docs/docsystem/**"/>
</fileset>
<fileset dir="${phingpkg.home}/classes/phing" id="classes">
<include name="**"/>
</fileset>
<fileset dir="${phingpkg.home}/docs" id="docs">
<include name="api/docs/**"/>
<include name="example/**"/>
<include name="phing_guide/book/**"/>
</fileset>
<fileset dir="${phingpkg.home}" id="etc">
<include name="etc/**"/>
</fileset>
<fileset dir="${phingpkg.home}" id="etc-no-version">
<include name="etc/**"/>
<exclude name="etc/VERSION.TXT"/>
</fileset>
<fileset dir="${phingpkg.home}" id="scripts">
<include name="bin/pear-*"/>
<include name="bin/phing.php"/>
</fileset>
<fileset dir="${phingpkg.home}" id="misc">
<include name="CHANGELOG.md"/>
<include name="CREDITS.md"/>
<include name="LICENSE"/>
<include name="README.md"/>
<exclude name="INSTALL*"/>
</fileset>
<!--
==============================================
Main entry point
==============================================
-->
<target name="main" if="version"
depends="versioncheck,setproperties,clean,clean-external,copy-files,create-package-xml,tar,phar"/>
<!--
===================================================================
Retrieve version number from commandline if not set
===================================================================
-->
<target name="versioncheck" unless="version">
<echo message="====================================================="/>
<echo message="Version not specified. You must enter a version. In"/>
<echo message="the future you can add this to build.properties or"/>
<echo message="enter it on the command line: "/>
<echo message=" "/>
<echo message="-Dversion=2.0.0b1"/>
<echo message="====================================================="/>
<input propertyname="version" promptChar=":">Phing version for package</input>
</target>
<!--
==============================================
Sets some default properties
==============================================
-->
<target name="setproperties">
<property name="pkgname" value="phing-${version}"/>
<property name="pkgname-docs" value="phingdocs-${version}" override="true"/>
<property name="build.src.dir" value="${build.pear.dir}/phing/${pkgname}"/>
<property name="build.docs.dir" value="${build.pear.dir}/phingdocs/${pkgname-docs}" override="true"/>
<property name="build.full.dir" value="full/${pkgname}"/>
<if>
<isset property="version"/>
<then>
<if>
<contains string="${version}" substring="RC"/>
<then>
<property name="notes">This is the latest beta release of Phing.</property>
<property name="state" value="beta"/>
</then>
<elseif>
<contains string="${version}" substring="snapshot"/>
<then>
<property name="notes">This is a snapshot release that might not be functional.</property>
<property name="state" value="alpha"/>
</then>
</elseif>
<else>
<property name="notes">This is the latest stable release of Phing.</property>
<property name="state" value="stable"/>
</else>
</if>
</then>
</if>
<echo>Building Phing PEAR/full version ${version}</echo>
<echo>Build notes: ${notes} (${state})</echo>
</target>
<!--
==============================================
Copy the desired files into the build/ dir
making sure to put them in the directory
structure that will be needed for PEAR install
==============================================
-->
<target name="copy-files">
<echo>-----------------------------</echo>
<echo>| Creating directory layout |</echo>
<echo>-----------------------------</echo>
<copy todir="${build.full.dir}">
<fileset refid="all"/>
</copy>
<copy todir="${build.src.dir}">
<fileset refid="classes"/>
<fileset refid="etc-no-version"/>
<fileset refid="scripts"/>
<fileset refid="misc"/>
</copy>
<copy todir="${build.docs.dir}">
<fileset refid="docs"/>
</copy>
<echo append="false" file="${build.src.dir}/etc/VERSION.TXT">Phing ${version}</echo>
<echo append="false" file="${build.full.dir}/etc/VERSION.TXT">Phing ${version}</echo>
<chmod file="${build.src.dir}/bin/pear-phing" mode="755"/>
<chmod file="${build.full.dir}/bin/phing" mode="755"/>
</target>
<!--
==============================================
Create a PEAR package.xml which will guide the
installation.
==============================================
-->
<target name="create-package-xml" depends="versioncheck" if="version">
<echo>-----------------------------</echo>
<echo>| Creating PEAR package.xml |</echo>
<echo>-----------------------------</echo>
<echo></echo>
<echo>... (This step may take some time) ...</echo>
<delete file="${build.pear.dir}/phing/package.xml"
failonerror="false"/>
<pear-package mode="source" dir="${build.src.dir}"
destFile="${build.pear.dir}/phing/package.xml" version="${version}" state="${state}" notes="${notes}">
<fileset refid="classes"/>
<fileset refid="etc"/>
<fileset refid="misc"/>
<fileset refid="scripts"/>
</pear-package>
<pear-package mode="docs" dir="${build.docs.dir}"
destFile="${build.pear.dir}/phingdocs/package.xml" version="${version}" state="${state}" notes="${notes}">
<fileset refid="docs"/>
</pear-package>
</target>
<!--
==============================================
Create a tar.gz of the files, which will be
installed by pear package manager.
==============================================
-->
<target name="tar">
<echo>-----------------------------</echo>
<echo>| Creating PEAR packages |</echo>
<echo>-----------------------------</echo>
<property name="tgzfile" value="${build.pear.dir}/${pkgname}.tgz"/>
<delete file="${tgzfile}" failonerror="false"/>
<tar compression="gzip" destFile="${tgzfile}"
basedir="${build.pear.dir}/phing" />
<property name="tarfile" value="${build.pear.dir}/${pkgname}.tar"/>
<delete file="${tarfile}" failonerror="false"/>
<tar compression="none" destFile="${tarfile}"
basedir="${build.pear.dir}/phing" />
<property name="tgzfile-docs" value="${build.pear.dir}/${pkgname-docs}.tgz"/>
<delete file="${tgzfile-docs}" failonerror="false"/>
<tar compression="gzip" destFile="${tgzfile-docs}"
basedir="${build.pear.dir}/phingdocs" />
<property name="tarfile-docs" value="${build.pear.dir}/${pkgname-docs}.tar"/>
<delete file="${tarfile-docs}" failonerror="false"/>
<tar compression="none" destFile="${tarfile-docs}"
basedir="${build.pear.dir}/phingdocs" />
<property name="tgzfile-full" value="full/${pkgname}.tgz"/>
<delete file="${tgzfile-full}" failonerror="false"/>
<tar compression="gzip" destFile="${tgzfile-full}"
basedir="full/${pkgname}" />
<property name="zipfile-full" value="full/${pkgname}.zip"/>
<delete file="${zipfile-full}" failonerror="false"/>
<zip destFile="${zipfile-full}" basedir="full/${pkgname}" />
</target>
<!--
==============================================
Create a phar package of the files.
==============================================
-->
<target name="phar">
<php expression="date('Ymd')" returnProperty="builddate" />
<pharpackage
compression="gzip"
destfile="full/phing-${version}.phar"
stub="phing-stub.php"
alias="phing.phar"
basedir="full/${pkgname}">
<fileset dir="full/${pkgname}">
<include name="bin/**" />
<include name="classes/**" />
<include name="etc/**" />
</fileset>
<metadata>
<element name="version" value="${version}" />
<element name="state" value="${state}" />
<element name="builddate" value="${builddate}" />
<element name="authors">
<element name="Michiel Rook">
<element name="e-mail"
value="mrook@php.net" />
</element>
</element>
</metadata>
</pharpackage>
</target>
<!--
==============================================
Clean up build files.
==============================================
-->
<target name="clean-external">
<phing phingfile="../docs/example/build.xml"
target="clean"/>
<phing phingfile="build.xml" dir="../docs/api"
target="clean"/>
<phing phingfile="build.xml" dir="../docs/api"
target="build"/>
</target>
<!--
==============================================
Clean up build files.
==============================================
-->
<target name="clean">
<echo>-----------------------------</echo>
<echo>| Deleting build directory |</echo>
<echo>-----------------------------</echo>
<delete dir="${build.pear.dir}" failonerror="false"/>
<delete dir="full" failonerror="false"/>
</target>
</project>

View File

@@ -0,0 +1,10 @@
<?php
array_push($argv, '-logger');
array_push($argv, 'phing.listener.AnsiColorLogger');
$argc+=2;
$argc++;
include 'phar://phing.phar/bin/phing.php';
__HALT_COMPILER();

View File

@@ -0,0 +1,198 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/system/lang/EventObject.php';
/**
* Encapsulates a build specific event.
*
* <p>We have three sources of events all handled by this class:
*
* <ul>
* <li>Project level events</li>
* <li>Target level events</li>
* <li>Task level events</li>
* </ul>
*
* <p> Events are all fired from the project class by creating an event object
* using this class and passing it to the listeners.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing
*/
class BuildEvent extends EventObject {
/**
* A reference to the project
* @var Project
*/
protected $project;
/**
* A reference to the target
* @var Target
*/
protected $target;
/**
* A reference to the task
*
* @var Task
*/
protected $task;
/**
* The message of this event, if the event is a message
* @var string
*/
protected $message = null;
/**
* The priority of the message
*
* @var string
* @see $message
*/
protected $priority = Project::MSG_VERBOSE;
/**
* The execption that caused the event, if any
*
* @var object
*/
protected $exception = null;
/**
* Construct a BuildEvent for a project, task or target source event
*
* @param object project the project that emitted the event.
*/
public function __construct($source) {
parent::__construct($source);
if ($source instanceof Project) {
$this->project = $source;
$this->target = null;
$this->task = null;
} elseif ($source instanceof Target) {
$this->project = $source->getProject();
$this->target = $source;
$this->task = null;
} elseif ($source instanceof Task) {
$this->project = $source->getProject();
$this->target = $source->getOwningTarget();
$this->task = $source;
} else {
throw new Exception("Can not construct BuildEvent, unknown source given.");
}
}
/**
* Sets the message with details and the message priority for this event.
*
* @param string The string message of the event
* @param integer The priority this message should have
*/
public function setMessage($message, $priority) {
$this->message = (string) $message;
$this->priority = (int) $priority;
}
/**
* Set the exception that was the cause of this event.
*
* @param Exception The exception that caused the event
*/
public function setException($exception) {
$this->exception = $exception;
}
/**
* Returns the project instance that fired this event.
*
* The reference to the project instance is set by the constructor if this
* event was fired from the project class.
*
* @return Project The project instance that fired this event
*/
public function getProject() {
return $this->project;
}
/**
* Returns the target instance that fired this event.
*
* The reference to the target instance is set by the constructor if this
* event was fired from the target class.
*
* @return Target The target that fired this event
*/
public function getTarget() {
return $this->target;
}
/**
* Returns the target instance that fired this event.
*
* The reference to the task instance is set by the constructor if this
* event was fired within a task.
*
* @return Task The task that fired this event
*/
public function getTask() {
return $this->task;
}
/**
* Returns the logging message. This field will only be set for
* "messageLogged" events.
*
* @return string The log message
*/
function getMessage() {
return $this->message;
}
/**
* Returns the priority of the logging message. This field will only
* be set for "messageLogged" events.
*
* @return integer The message priority
*/
function getPriority() {
return $this->priority;
}
/**
* Returns the exception that was thrown, if any.
* This field will only be set for "taskFinished", "targetFinished", and
* "buildFinished" events.
*
* @see BuildListener::taskFinished()
* @see BuildListener::targetFinished()
* @see BuildListener::buildFinished()
* @return Exception
*/
public function getException() {
return $this->exception;
}
}

View File

@@ -0,0 +1,124 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* BuildException is for when things go wrong in a build execution.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @version $Id$
* @package phing
*/
class BuildException extends Exception {
/**
* Location in the xml file.
* @var Location
*/
protected $location;
/**
* The nested "cause" exception.
* @var Exception
*/
protected $cause;
/**
* Construct a BuildException.
* Supported signatures:
* throw new BuildException($causeExc);
* throw new BuildException($msg);
* throw new Buildexception($causeExc, $loc);
* throw new BuildException($msg, $causeExc);
* throw new BuildException($msg, $loc);
* throw new BuildException($msg, $causeExc, $loc);
* @param Exception|string $p1
* @param Location|Exception|null $p2
* @param Location|null $p3
*/
public function __construct($p1, $p2 = null, $p3 = null) {
$cause = null;
$loc = null;
$msg = "";
if ($p3 !== null) {
$cause = $p2;
$loc = $p3;
$msg = $p1;
} elseif ($p2 !== null) {
if ($p2 instanceof Exception) {
$cause = $p2;
$msg = $p1;
} elseif ($p2 instanceof Location) {
$loc = $p2;
if ($p1 instanceof Exception) {
$cause = $p1;
} else {
$msg = $p1;
}
}
} elseif ($p1 instanceof Exception) {
$cause = $p1;
} else {
$msg = $p1;
}
parent::__construct($msg);
if ($cause !== null) {
$this->cause = $cause;
$this->message .= " [wrapped: " . $cause->getMessage() ."]";
}
if ($loc !== null) {
$this->setLocation($loc);
}
}
/**
* Gets the cause exception.
*
* @return Exception
*/
public function getCause() {
return $this->cause;
}
/**
* Gets the location of error in XML file.
*
* @return Location
*/
public function getLocation() {
return $this->location;
}
/**
* Sets the location of error in XML file.
*
* @param Location $loc
*/
public function setLocation(Location $loc) {
$this->location = $loc;
$this->message = $loc->toString() . ': ' . $this->message;
}
}

View File

@@ -0,0 +1,91 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Interface for build listeners.
*
* Classes that implement a listener must extend this class and (faux)implement
* all methods that are decleard as dummies below.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BuildEvent
* @see Project::addBuildListener()
* @package phing
*/
interface BuildListener {
/**
* Fired before any targets are started.
*
* @param BuildEvent $event The BuildEvent
*/
public function buildStarted(BuildEvent $event);
/**
* Fired after the last target has finished.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent::getException()
*/
public function buildFinished(BuildEvent $event);
/**
* Fired when a target is started.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent::getTarget()
*/
public function targetStarted(BuildEvent $event);
/**
* Fired when a target has finished.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent#getException()
*/
public function targetFinished(BuildEvent $event);
/**
* Fired when a task is started.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent::getTask()
*/
public function taskStarted(BuildEvent $event);
/**
* Fired when a task has finished.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent::getException()
*/
public function taskFinished(BuildEvent $event);
/**
* Fired whenever a message is logged.
*
* @param BuildEvent $event The BuildEvent
* @see BuildEvent::getMessage()
*/
public function messageLogged(BuildEvent $event);
}

View File

@@ -0,0 +1,70 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/BuildListener.php';
/**
* Interface for build loggers.
*
* Build loggers are build listeners but with some additional functionality:
* - They can be configured with a log level (below which they will ignore messages)
* - They have error and output streams
*
* Classes that implement a listener must implement this interface.
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BuildEvent
* @see Project::addBuildListener()
* @package phing
*/
interface BuildLogger extends BuildListener {
/**
* Sets the min log level that this logger should respect.
*
* Messages below this level are ignored.
*
* Constants for the message levels are in Project.php. The order of
* the levels, from least to most verbose, is:
* - Project::MSG_ERR
* - Project::MSG_WARN
* - Project::MSG_INFO
* - Project::MSG_VERBOSE
* - Project::MSG_DEBUG
*
* @param int $level The log level integer (e.g. Project::MSG_VERBOSE, etc.).
*/
public function setMessageOutputLevel($level);
/**
* Sets the standard output stream to use.
* @param OutputStream $output Configured output stream (e.g. STDOUT) for standard output.
*/
public function setOutputStream(OutputStream $output);
/**
* Sets the output stream to use for errors.
* @param OutputStream $err Configured output stream (e.g. STDERR) for errors.
*/
public function setErrorStream(OutputStream $err);
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* ConfigurationException is thrown by Phing during the configuration and setup phase of the project.
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing
*/
class ConfigurationException extends Exception {
/**
* Location in the xml file.
* @var Location
*/
protected $location;
/**
* The nested "cause" exception.
* @var Exception
*/
protected $cause;
/**
* Construct a ConfigurationException.
* Supported signatures:
* throw new BuildException($causeExc);
* throw new BuildException($msg);
* throw new BuildException($msg, $causeExc);
* @param Exception|string $p1
* @param Exception|null $p2
*/
public function __construct($p1, $p2 = null) {
$cause = null;
$msg = "";
if ($p2 !== null) {
if ($p2 instanceof Exception) {
$cause = $p2;
$msg = $p1;
}
} elseif ($p1 instanceof Exception) {
$cause = $p1;
} else {
$msg = $p1;
}
parent::__construct($msg);
if ($cause !== null) {
$this->cause = $cause;
$this->message .= " [wrapped: " . $cause->getMessage() ."]";
}
}
/**
* Gets the cause exception.
*
* @return Exception
*/
public function getCause() {
return $this->cause;
}
}

View File

@@ -0,0 +1,584 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/types/Reference.php';
include_once 'phing/types/Path.php';
include_once 'phing/util/StringHelper.php';
include_once 'phing/parser/CustomChildCreator.php';
/**
* Helper class that collects the methods that a task or nested element
* holds to set attributes, create nested elements or hold PCDATA
* elements.
*
*<ul>
* <li><strong>SMART-UP INLINE DOCS</strong></li>
* <li><strong>POLISH-UP THIS CLASS</strong></li>
*</ul>
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @package phing
*/
class IntrospectionHelper {
/**
* Holds the attribute setter methods.
*
* @var array string[]
*/
private $attributeSetters = array();
/**
* Holds methods to create nested elements.
*
* @var array string[]
*/
private $nestedCreators = array();
/**
* Holds methods to store configured nested elements.
*
* @var array string[]
*/
private $nestedStorers = array();
/**
* Map from attribute names to nested types.
*/
private $nestedTypes = array();
/**
* New idea in phing: any class can register certain
* keys -- e.g. "task.current_file" -- which can be used in
* task attributes, if supported. In the build XML these
* are referred to like this:
* <regexp pattern="\n" replace="%{task.current_file}"/>
* In the type/task a listener method must be defined:
* function setListeningReplace($slot) {}
* @var array string[]
*/
private $slotListeners = array();
/**
* The method to add PCDATA stuff.
*
* @var string Method name of the addText (redundant?) method, if class supports it :)
*/
private $methodAddText = null;
/**
* The Class that's been introspected.
*
* @var object
* @access private
*/
private $bean;
/**
* The cache of IntrospectionHelper classes instantiated by getHelper().
* @var array IntrospectionHelpers[]
*/
private static $helpers = array();
/**
* Factory method for helper objects.
*
* @param string $class The class to create a Helper for
*/
public static function getHelper($class) {
if (!isset(self::$helpers[$class])) {
self::$helpers[$class] = new IntrospectionHelper($class);
}
return self::$helpers[$class];
}
/**
* This function constructs a new introspection helper for a specific class.
*
* This method loads all methods for the specified class and categorizes them
* as setters, creators, slot listeners, etc. This way, the setAttribue() doesn't
* need to perform any introspection -- either the requested attribute setter/creator
* exists or it does not & a BuildException is thrown.
*
* @param string $class The classname for this IH.
*/
public function __construct($class) {
$this->bean = new ReflectionClass($class);
//$methods = get_class_methods($bean);
foreach($this->bean->getMethods() as $method) {
if ($method->isPublic()) {
// We're going to keep case-insensitive method names
// for as long as we're allowed :) It makes it much
// easier to map XML attributes to PHP class method names.
$name = strtolower($method->getName());
// There are a few "reserved" names that might look like attribute setters
// but should actually just be skipped. (Note: this means you can't ever
// have an attribute named "location" or "tasktype" or a nested element named "task".)
if ($name === "setlocation" || $name === "settasktype" || $name === "addtask") {
continue;
}
if ($name === "addtext") {
$this->methodAddText = $method;
} elseif (strpos($name, "setlistening") === 0) {
// Phing supports something unique called "RegisterSlots"
// These are dynamic values that use a basic slot system so that
// classes can register to listen to specific slots, and the value
// will always be grabbed from the slot (and never set in the project
// component). This is useful for things like tracking the current
// file being processed by a filter (e.g. AppendTask sets an append.current_file
// slot, which can be ready by the XSLTParam type.)
if (count($method->getParameters()) !== 1) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() must take exactly one parameter.");
}
$this->slotListeners[$name] = $method;
} elseif (strpos($name, "set") === 0) {
// A standard attribute setter.
if (count($method->getParameters()) !== 1) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() must take exactly one parameter.");
}
$this->attributeSetters[$name] = $method;
} elseif (strpos($name, "create") === 0) {
if ($method->getNumberOfRequiredParameters() > 0) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() may not take any parameters.");
}
// Because PHP doesn't support return types, we are going to do
// two things here to guess return type:
// 1) parse comments for an explicit value
// 2) if that fails, assume that the part of the method after "create"
// is the name of the return type (in many cases it is not)
// This isn't super important -- i.e. we're not instantaiting classes
// based on this information. It's more just so that IntrospectionHelper
// can keep track of all the nested types -- and provide more helpful
// exception messages, etc.
preg_match('/@return[\s]+([\w]+)/', $method->getDocComment(), $matches);
if (!empty($matches[1]) && class_exists($matches[1], false)) {
$this->nestedTypes[$name] = $matches[1];
} else {
// assume that method createEquals() creates object of type "Equals"
// (that example would be false, of course)
$this->nestedTypes[$name] = $this->getPropertyName($name, "create");
}
$this->nestedCreators[$name] = $method;
} elseif (strpos($name, "addconfigured") === 0) {
// *must* use class hints if using addConfigured ...
// 1 param only
$params = $method->getParameters();
if (count($params) < 1) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() must take at least one parameter.");
}
if (count($params) > 1) {
$this->warn($method->getDeclaringClass()->getName()."::".$method->getName()."() takes more than one parameter. (IH only uses the first)");
}
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
$classname = $hint->getName();
}
if ($classname === null) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() method MUST use a class hint to indicate the class type of parameter.");
}
$this->nestedTypes[$name] = $classname;
$this->nestedStorers[$name] = $method;
} elseif (strpos($name, "add") === 0) {
// *must* use class hints if using add ...
// 1 param only
$params = $method->getParameters();
if (count($params) < 1) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() must take at least one parameter.");
}
if (count($params) > 1) {
$this->warn($method->getDeclaringClass()->getName()."::".$method->getName()."() takes more than one parameter. (IH only uses the first)");
}
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
$classname = $hint->getName();
}
// we don't use the classname here, but we need to make sure it exists before
// we later try to instantiate a non-existant class
if ($classname === null) {
throw new BuildException($method->getDeclaringClass()->getName()."::".$method->getName()."() method MUST use a class hint to indicate the class type of parameter.");
}
$this->nestedCreators[$name] = $method;
}
} // if $method->isPublic()
} // foreach
}
/**
* Sets the named attribute.
* @param Project $project
* @param string $element
* @param string $attributeName
* @param mixed $value
*/
public function setAttribute(Project $project, $element, $attributeName, &$value) {
// we want to check whether the value we are setting looks like
// a slot-listener variable: %{task.current_file}
//
// slot-listener variables are not like properties, in that they cannot be mixed with
// other text values. The reason for this disparity is that properties are only
// set when first constructing objects from XML, whereas slot-listeners are always dynamic.
//
// This is made possible by PHP5 (objects automatically passed by reference) and PHP's loose
// typing.
if (StringHelper::isSlotVar($value)) {
$as = "setlistening" . strtolower($attributeName);
if (!isset($this->slotListeners[$as])) {
$msg = $this->getElementName($project, $element) . " doesn't support a slot-listening '$attributeName' attribute.";
throw new BuildException($msg);
}
$method = $this->slotListeners[$as];
$key = StringHelper::slotVar($value);
$value = Register::getSlot($key); // returns a RegisterSlot object which will hold current value of that register (accessible using getValue())
} else {
// Traditional value options
$as = "set".strtolower($attributeName);
if (!isset($this->attributeSetters[$as])) {
$msg = $this->getElementName($project, $element) . " doesn't support the '$attributeName' attribute.";
throw new BuildException($msg);
}
$method = $this->attributeSetters[$as];
if ($as == "setrefid") {
$value = new Reference($value);
} else {
// value is a string representation of a boolean type,
// convert it to primitive
if (StringHelper::isBoolean($value)) {
$value = StringHelper::booleanValue($value);
}
// does method expect a PhingFile object? if so, then
// pass a project-relative file.
$params = $method->getParameters();
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
$classname = $hint->getName();
}
// there should only be one param; we'll just assume ....
if ($classname !== null) {
switch(strtolower($classname)) {
case "phingfile":
$value = $project->resolveFile($value);
break;
case "path":
$value = new Path($project, $value);
break;
case "reference":
$value = new Reference($value);
break;
// any other object params we want to support should go here ...
}
} // if hint !== null
} // if not setrefid
} // if is slot-listener
try {
$project->log(" -calling setter ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG);
$method->invoke($element, $value);
} catch(Exception $exc) {
throw new BuildException($exc);
}
}
/**
* Adds PCDATA areas.
*
* @param Project $project
* @param string $element
* @param string $text
*/
public function addText(Project $project, $element, $text) {
if ($this->methodAddText === null) {
$msg = $this->getElementName($project, $element)." doesn't support nested text data.";
throw new BuildException($msg);
}
try {
$method = $this->methodAddText;
$method->invoke($element, $text);
} catch (Exception $exc) {
throw new BuildException($exc);
}
}
/**
* Creates a named nested element.
*
* Valid creators can be in the form createFoo() or addFoo(Bar).
*
* @param Project $project
* @param string $element
* @param string $elementName
* @return object Returns the nested element.
* @throws BuildException
*/
public function createElement(Project $project, $element, $elementName) {
$addMethod = "add".strtolower($elementName);
$createMethod = "create".strtolower($elementName);
$nestedElement = null;
if (isset($this->nestedCreators[$createMethod])) {
$method = $this->nestedCreators[$createMethod];
try { // try to invoke the creator method on object
$project->log(" -calling creator ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG);
$nestedElement = $method->invoke($element);
} catch (Exception $exc) {
throw new BuildException($exc);
}
} elseif (isset($this->nestedCreators[$addMethod])) {
$method = $this->nestedCreators[$addMethod];
// project components must use class hints to support the add methods
try { // try to invoke the adder method on object
$project->log(" -calling adder ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG);
// we've already assured that correct num of params
// exist and that method is using class hints
$params = $method->getParameters();
$classname = null;
if (($hint = $params[0]->getClass()) !== null) {
$classname = $hint->getName();
}
// create a new instance of the object and add it via $addMethod
$nestedElement = new $classname();
$method->invoke($element, $nestedElement);
} catch (Exception $exc) {
throw new BuildException($exc);
}
} elseif ($this->bean->implementsInterface("CustomChildCreator")) {
$method = $this->bean->getMethod('customChildCreator');
try {
$nestedElement = $method->invoke($element, strtolower($elementName), $project);
} catch (Exception $exc) {
throw new BuildException($exc);
}
} else {
$msg = $this->getElementName($project, $element) . " doesn't support the '$elementName' creator/adder.";
throw new BuildException($msg);
}
if ($nestedElement instanceof ProjectComponent) {
$nestedElement->setProject($project);
}
return $nestedElement;
}
/**
* Creates a named nested element.
*
* @param Project $project
* @param string $element
* @param string $child
* @param string|null $elementName
* @return void
* @throws BuildException
*/
public function storeElement($project, $element, $child, $elementName = null) {
if ($elementName === null) {
return;
}
$storer = "addconfigured".strtolower($elementName);
if (isset($this->nestedStorers[$storer])) {
$method = $this->nestedStorers[$storer];
try {
$project->log(" -calling storer ".$method->getDeclaringClass()->getName()."::".$method->getName()."()", Project::MSG_DEBUG);
$method->invoke($element, $child);
} catch (Exception $exc) {
throw new BuildException($exc);
}
}
}
/**
* Does the introspected class support PCDATA?
* @return boolean
*/
public function supportsCharacters() {
return ($this->methodAddText !== null);
}
/**
* Return all attribues supported by the introspected class.
* @return string[]
*/
public function getAttributes() {
$attribs = array();
foreach (array_keys($this->attributeSetters) as $setter) {
$attribs[] =$this->getPropertyName($setter, "set");
}
return $attribs;
}
/**
* Return all nested elements supported by the introspected class.
* @return string[]
*/
public function getNestedElements() {
return $this->nestedTypes;
}
/**
* Get the the name for an element.
* When possible the full classnam (phing.tasks.system.PropertyTask) will
* be returned. If not available (loaded in taskdefs or typedefs) then the
* XML element name will be returned.
*
* @param Project $project
* @param object $element The Task or type element.
* @return string Fully qualified class name of element when possible.
*/
public function getElementName(Project $project, $element) {
$taskdefs = $project->getTaskDefinitions();
$typedefs = $project->getDataTypeDefinitions();
// check if class of element is registered with project (tasks & types)
// most element types don't have a getTag() method
$elClass = get_class($element);
if (!in_array('getTag', get_class_methods($elClass))) {
// loop through taskdefs and typesdefs and see if the class name
// matches (case-insensitive) any of the classes in there
foreach(array_merge($taskdefs, $typedefs) as $elName => $class) {
if (0 === strcasecmp($elClass, StringHelper::unqualify($class))) {
return $class;
}
}
return "$elClass (unknown)";
} else {
// ->getTag() method does exist, so use it
$elName = $element->getTag();
if (isset($taskdefs[$elName])) {
return $taskdefs[$elName];
} elseif (isset($typedefs[$elName])) {
return $typedefs[$elName];
} else {
return "$elName (unknown)";
}
}
}
/**
* Extract the name of a property from a method name - subtracting a given prefix.
*
* @param string $methodName
* @param string $prefix
* @return string
*/
public function getPropertyName($methodName, $prefix) {
$start = strlen($prefix);
return strtolower(substr($methodName, $start));
}
/**
* Prints warning message to screen if -debug was used.
* @param string $msg
*/
public function warn($msg) {
if (Phing::getMsgOutputLevel() === Project::MSG_DEBUG) {
print("[IntrospectionHelper] " . $msg . "\n");
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Abstract class providing properties and methods common to all
* the project components
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing
*/
abstract class ProjectComponent {
/**
* Holds a reference to the project that a project component
* (a task, a target, etc.) belongs to
*
* @var Project A reference to the current project instance
*/
protected $project = null;
/**
* References the project to the current component.
*
* @param Project $project The reference to the current project
*/
public function setProject($project) {
$this->project = $project;
}
/**
* Returns a reference to current project
*
* @return Project Reference to current porject object
*/
public function getProject() {
return $this->project;
}
/**
* Logs a message with the given priority.
*
* @param string $msg The message to be logged.
* @param integer $level The message's priority at this message should have
*/
public function log($msg, $level = Project::MSG_INFO) {
if ($this->project !== null) {
$this->project->log($msg, $level);
}
}
}

View File

@@ -0,0 +1,116 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Wrapper class that holds the attributes of a Task (or elements
* nested below that level) and takes care of configuring that element
* at runtime.
*
* <strong>SMART-UP INLINE DOCS</strong>
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing
*/
class RuntimeConfigurable {
private $elementTag = null;
private $children = array();
private $wrappedObject = null;
private $attributes = array();
private $characters = "";
/** @param proxy The element to wrap. */
function __construct($proxy, $elementTag) {
$this->wrappedObject = $proxy;
$this->elementTag = $elementTag;
}
function setProxy($proxy) {
$this->wrappedObject = $proxy;
}
/** Set's the attributes for the wrapped element. */
function setAttributes($attributes) {
$this->attributes = $attributes;
}
/** Returns the AttributeList of the wrapped element. */
function getAttributes() {
return $this->attributes;
}
/** Adds child elements to the wrapped element. */
function addChild(RuntimeConfigurable $child) {
$this->children[] = $child;
}
/** Returns the child with index */
function getChild($index) {
return $this->children[(int)$index];
}
/** Add characters from #PCDATA areas to the wrapped element. */
function addText($data) {
$this->characters .= (string) $data;
}
function getElementTag() {
return $this->elementTag;
}
/** Configure the wrapped element and all children. */
function maybeConfigure(Project $project) {
$id = null;
// DataType configured in ProjectConfigurator
// if ( is_a($this->wrappedObject, "DataType") )
// return;
if ($this->attributes || $this->characters) {
ProjectConfigurator::configure($this->wrappedObject, $this->attributes, $project);
if (isset($this->attributes["id"])) {
$id = $this->attributes["id"];
}
if ($this->characters) {
ProjectConfigurator::addText($project, $this->wrappedObject, (string) $this->characters);
$this->characters="";
}
if ($id !== null) {
$project->addReference($id, $this->wrappedObject);
}
}
if ( is_array($this->children) && !empty($this->children) ) {
// Configure all child of this object ...
foreach($this->children as $child) {
$child->maybeConfigure($project);
ProjectConfigurator::storeChild($project, $this->wrappedObject, $child->wrappedObject, strtolower($child->getElementTag()));
}
}
}
}

View File

@@ -0,0 +1,375 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/TaskContainer.php';
/**
* The Target component. Carries all required target data. Implements the
* abstract class {@link TaskContainer}
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @access public
* @see TaskContainer
* @package phing
*/
class Target implements TaskContainer {
/**
* Name of target
* @var string
*/
private $name;
/**
* Dependencies
* @var array
*/
private $dependencies = array();
/**
* Holds objects of children of this target
* @var array
*/
private $children = array();
/**
* The if condition from xml
* @var string
*/
private $ifCondition = "";
/**
* The unless condition from xml
* @var string
*/
private $unlessCondition = "";
/**
* Description of this target
* @var string
*/
private $description;
/**
* Whether to hide target in targets list (-list -p switches)
* @var boolean
*/
private $hidden = false;
/**
* Rreference to project
* @var Project
*/
private $project;
/**
* References the project to the current component.
*
* @param Project $project The reference to the current project
*/
public function setProject(Project $project) {
$this->project = $project;
}
/**
* Returns reference to current project
*
* @return Project Reference to current porject object
*/
public function getProject() {
return $this->project;
}
/**
* Sets the target dependencies from xml
*
* @param string $depends Comma separated list of targetnames that depend on
* this target
* @throws BuildException
*/
public function setDepends($depends) {
// explode should be faster than strtok
$deps = explode(',', $depends);
for ($i=0, $size=count($deps); $i < $size; $i++) {
$trimmed = trim($deps[$i]);
if ($trimmed === "") {
throw new BuildException("Syntax Error: Depend attribute for target ".$this->getName()." is malformed.");
}
$this->addDependency($trimmed);
}
}
/**
* Adds a singular dependent target name to the list
*
* @param string $dependency The dependency target to add
* @access public
*/
public function addDependency($dependency) {
$this->dependencies[] = (string) $dependency;
}
/**
* Returns reference to indexed array of the dependencies this target has.
*
* @return array Referece to target dependencoes
*/
public function getDependencies() {
return $this->dependencies;
}
/**
* Sets the name of the target
*
* @param string $name Name of this target
*/
public function setName($name) {
$this->name = (string) $name;
}
/**
* Returns name of this target.
*
* @return string The name of the target
* @access public
*/
public function getName() {
return (string) $this->name;
}
/**
* Set target status. If true, target does not come in phing -list
*
* @param boolean $flag
* @return Target
*/
public function setHidden($flag)
{
$this->hidden = (boolean) $flag;
return $this;
}
/**
* Get target status. If true, target does not come in phing -list
*
* @return boolean
*/
public function getHidden()
{
return $this->hidden;
}
/**
* Alias for getHidden()
*
* @return boolean
*/
public function isHidden()
{
return $this->getHidden();
}
/**
* Adds a task element to the list of this targets child elements
*
* @param Task $task The task object to add
* @access public
*/
public function addTask(Task $task) {
$this->children[] = $task;
}
/**
* Adds a runtime configurable element to the list of this targets child
* elements.
*
* @param RuntimeConfigurable $rtc The RuntimeConfigurable object
* @access public
*/
public function addDataType($rtc) {
$this->children[] = $rtc;
}
/**
* Returns an array of all tasks this target has as childrens.
*
* The task objects are copied here. Don't use this method to modify
* task objects.
*
* @return array Task[]
*/
public function getTasks() {
$tasks = array();
for ($i=0,$size=count($this->children); $i < $size; $i++) {
$tsk = $this->children[$i];
if ($tsk instanceof Task) {
// note: we're copying objects here!
$tasks[] = clone $tsk;
}
}
return $tasks;
}
/**
* Set the if-condition from the XML tag, if any. The property name given
* as parameter must be present so the if condition evaluates to true
*
* @param string $property The property name that has to be present
* @access public
*/
public function setIf($property) {
$this->ifCondition = ($property === null) ? "" : $property;
}
/**
* Set the unless-condition from the XML tag, if any. The property name
* given as parameter must be present so the unless condition evaluates
* to true
*
* @param string $property The property name that has to be present
* @access public
*/
public function setUnless($property) {
$this->unlessCondition = ($property === null) ? "" : $property;
}
/**
* Sets a textual description of this target.
*
* @param string $description The description text
*/
public function setDescription($description) {
if ($description !== null && strcmp($description, "") !== 0) {
$this->description = (string) $description;
} else {
$this->description = null;
}
}
/**
* Returns the description of this target.
*
* @return string The description text of this target
*/
public function getDescription() {
return $this->description;
}
/**
* Returns a string representation of this target. In our case it
* simply returns the target name field
*
* @return string The string representation of this target
*/
public function toString() {
return (string) $this->name;
}
/**
* The entry point for this class. Does some checking, then processes and
* performs the tasks for this target.
*/
public function main() {
if ($this->testIfCondition() && $this->testUnlessCondition()) {
foreach($this->children as $o) {
if ($o instanceof Task) {
// child is a task
$o->perform();
} else {
// child is a RuntimeConfigurable
$o->maybeConfigure($this->project);
}
}
} elseif (!$this->testIfCondition()) {
$this->project->log("Skipped target '".$this->name."' because property '".$this->ifCondition."' not set.", Project::MSG_VERBOSE);
} else {
$this->project->log("Skipped target '".$this->name."' because property '".$this->unlessCondition."' set.", Project::MSG_VERBOSE);
}
}
/**
* Performs the tasks by calling the main method of this target that
* actually executes the tasks.
*
* This method is for ZE2 and used for proper exception handling of
* task exceptions.
*/
public function performTasks() {
try {// try to execute this target
$this->project->fireTargetStarted($this);
$this->main();
$this->project->fireTargetFinished($this, $null=null);
} catch (BuildException $exc) {
// log here and rethrow
$this->project->fireTargetFinished($this, $exc);
throw $exc;
}
}
/**
* Tests if the property set in ifConfiditon exists.
*
* @return boolean <code>true</code> if the property specified
* in <code>$this->ifCondition</code> exists;
* <code>false</code> otherwise
*/
private function testIfCondition() {
if ($this->ifCondition === "") {
return true;
}
$properties = explode(",", $this->ifCondition);
$result = true;
foreach ($properties as $property) {
$test = ProjectConfigurator::replaceProperties($this->getProject(), $property, $this->project->getProperties());
$result = $result && ($this->project->getProperty($test) !== null);
}
return $result;
}
/**
* Tests if the property set in unlessCondition exists.
*
* @return boolean <code>true</code> if the property specified
* in <code>$this->unlessCondition</code> exists;
* <code>false</code> otherwise
*/
private function testUnlessCondition() {
if ($this->unlessCondition === "") {
return true;
}
$properties = explode(",", $this->unlessCondition);
$result = true;
foreach ($properties as $property) {
$test = ProjectConfigurator::replaceProperties($this->getProject(), $property, $this->project->getProperties());
$result = $result && ($this->project->getProperty($test) === null);
}
return $result;
}
}

View File

@@ -0,0 +1,272 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/ProjectComponent.php';
include_once 'phing/RuntimeConfigurable.php';
/**
* The base class for all Tasks.
*
* Use {@link Project#createTask} to register a new Task.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @see Project#createTask()
* @package phing
*/
abstract class Task extends ProjectComponent {
/**
* Owning Target object
* @var Target
*/
protected $target;
/**
* Description of the task
* @var string
*/
protected $description;
/**
* Internal taskname (req)
* @var string
*/
protected $taskType;
/**
* Taskname for logger
* @var string
*/
protected $taskName;
/**
* Stored buildfile location
* @var Location
*/
protected $location;
/**
* Wrapper of the task
* @var RuntimeConfigurable
*/
protected $wrapper;
/**
* Sets the owning target this task belongs to.
*
* @param Target Reference to owning target
*/
public function setOwningTarget(Target $target) {
$this->target = $target;
}
/**
* Returns the owning target of this task.
*
* @return Target The target object that owns this task
*/
public function getOwningTarget() {
return $this->target;
}
/**
* Returns the name of task, used only for log messages
*
* @return string Name of this task
*/
public function getTaskName() {
if ($this->taskName === null) {
// if no task name is set, then it's possible
// this task was created from within another task. We don't
// therefore know the XML tag name for this task, so we'll just
// use the class name stripped of "task" suffix. This is only
// for log messages, so we don't have to worry much about accuracy.
return preg_replace('/task$/i', '', get_class($this));
}
return $this->taskName;
}
/**
* Sets the name of this task for log messages
*
* @param string $name
* @return string A string representing the name of this task for log
*/
public function setTaskName($name) {
$this->taskName = (string) $name;
}
/**
* Returns the name of the task under which it was invoked,
* usually the XML tagname
*
* @return string The type of this task (XML Tag)
*/
public function getTaskType() {
return $this->taskType;
}
/**
* Sets the type of the task. Usually this is the name of the XML tag
*
* @param string The type of this task (XML Tag)
*/
public function setTaskType($name) {
$this->taskType = (string) $name;
}
/**
* Returns a name
* @param string $slotName
*/
protected function getRegisterSlot($slotName) {
return Register::getSlot('task.' . $this->getTaskName() . '.' . $slotName);
}
/**
* Provides a project level log event to the task.
*
* @param string The message to log
* @param integer The priority of the message
* @see BuildEvent
* @see BuildListener
*/
function log($msg, $level = Project::MSG_INFO) {
$this->project->logObject($this, $msg, $level);
}
/**
* Sets a textual description of the task
*
* @param string $desc The text describing the task
*/
public function setDescription($desc) {
$this->description = $desc;
}
/**
* Returns the textual description of the task
*
* @return string The text description of the task
*/
public function getDescription() {
return $this->description;
}
/**
* Called by the parser to let the task initialize properly.
* Should throw a BuildException if something goes wrong with the build
*
* This is abstract here, but may not be overloaded by subclasses.
*
* @throws BuildException
*/
public function init() {
}
/**
* Called by the project to let the task do it's work. This method may be
* called more than once, if the task is invoked more than once. For
* example, if target1 and target2 both depend on target3, then running
* <em>phing target1 target2</em> will run all tasks in target3 twice.
*
* Should throw a BuildException if someting goes wrong with the build
*
* This is abstract here. Must be overloaded by real tasks.
*/
abstract public function main();
/**
* Returns the location within the buildfile this task occurs. Used
* by {@link BuildException} to give detailed error messages.
*
* @return Location The location object describing the position of this
* task within the buildfile.
*/
function getLocation() {
return $this->location;
}
/**
* Sets the location within the buildfile this task occurs. Called by
* the parser to set location information.
*
* @param Location $location The location object describing the position of this
* task within the buildfile.
*/
function setLocation(Location $location) {
$this->location = $location;
}
/**
* Returns the wrapper object for runtime configuration
*
* @return RuntimeConfigurable The wrapper object used by this task
*/
function getRuntimeConfigurableWrapper() {
if ($this->wrapper === null) {
$this->wrapper = new RuntimeConfigurable($this, $this->getTaskName());
}
return $this->wrapper;
}
/**
* Sets the wrapper object this task should use for runtime
* configurable elements.
*
* @param RuntimeConfigurable $wrapper The wrapper object this task should use
*/
function setRuntimeConfigurableWrapper(RuntimeConfigurable $wrapper) {
$this->wrapper = $wrapper;
}
/**
* Configure this task if it hasn't been done already.
*/
public function maybeConfigure() {
if ($this->wrapper !== null) {
$this->wrapper->maybeConfigure($this->project);
}
}
/**
* Perfrom this task
*/
public function perform() {
try { // try executing task
$this->project->fireTaskStarted($this);
$this->maybeConfigure();
$this->main();
$this->project->fireTaskFinished($this, $null=null);
} catch (Exception $exc) {
if ($exc instanceof BuildException) {
if ($exc->getLocation() === null) {
$exc->setLocation($this->getLocation());
}
}
$this->project->fireTaskFinished($this, $exc);
throw $exc;
}
}
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/Task.php';
/**
* Use introspection to "adapt" an arbitrary ( not extending Task, but with
* similar patterns).
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @package phing
*/
class TaskAdapter extends Task {
/** target object */
private $proxy;
/**
* Main entry point.
* @return void
*/
function main() {
if (method_exists($this->proxy, "setProject")) {
try { // try to set project
$this->proxy->setProject($this->project);
} catch (Exception $ex) {
$this->log("Error setting project in " . get_class($this->proxy) . Project::MSG_ERR);
throw new BuildException($ex);
}
} else {
throw new Exception("Error setting project in class " . get_class($this->proxy));
}
if (method_exists($this->proxy, "main")) {
try { //try to call main
$this->proxy->main($this->project);
} catch (Exception $ex) {
$this->log("Error in " . get_class($this->proxy), Project::MSG_ERR);
$this->log($ex->getTraceAsString(), Project::MSG_DEBUG);
throw new BuildException($ex->getMessage());
}
} else {
throw new BuildException("Your task-like class '" . get_class($this->proxy) ."' does not have a main() method");
}
}
/**
* Set the target object.
* @param object $o
* @return void
*/
function setProxy($o) {
$this->proxy = $o;
}
/**
* Gets the target object.
* @return object
*/
function getProxy() {
return $this->proxy;
}
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*
* @package phing
*/
/**
* Abstract interface for objects which can contain tasks (targets)
* Used to check if a class can contain tasks (via instanceof)
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @access public
* @package phing
*/
interface TaskContainer {
/**
* Adds a task to this task container. Must be implemented
* by derived class
*
* @param object The task to be added to the container
* @access public
*/
function addTask(Task $task);
}

View File

@@ -0,0 +1,214 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/Task.php';
/**
* Wrapper class that holds all information necessary to create a task
* that did not exist when Phing started.
*
* <em> This has something to do with phing encountering an task XML element
* it is not aware of at start time. This is a situation where special steps
* need to be taken so that the element is then known.</em>
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing
*/
class UnknownElement extends Task {
private $elementName;
private $realThing;
private $children = array();
/**
* Constructs a UnknownElement object
*
* @param string The XML element name that is unknown
* @access public
*/
function __construct($elementName) {
$this->elementName = (string) $elementName;
}
/**
* Return the XML element name that this <code>UnnownElement</code>
* handles.
*
* @return string The XML element name that is unknown
*/
public function getTag() {
return (string) $this->elementName;
}
/**
* Tries to configure the unknown element
*
* @throws BuildException if the element can not be configured
*/
public function maybeConfigure() {
$this->realThing = $this->makeObject($this, $this->wrapper);
$this->wrapper->setProxy($this->realThing);
if ($this->realThing instanceof Task) {
$this->realThing->setRuntimeConfigurableWrapper($this->wrapper);
}
$this->handleChildren($this->realThing, $this->wrapper);
$this->wrapper->maybeConfigure($this->getProject());
}
/**
* Called when the real task has been configured for the first time.
*
* @throws BuildException if the task can not be created
*/
public function main() {
if ($this->realThing === null) {
// plain impossible to get here, maybeConfigure should
// have thrown an exception.
throw new BuildException("Should not be executing UnknownElement::main() -- task/type: {$this->elementName}");
}
if ($this->realThing instanceof Task) {
$this->realThing->main();
}
}
/**
* Add a child element to the unknown element
*
* @param object The object representing the child element
*/
public function addChild(UnknownElement $child) {
$this->children[] = $child;
}
/**
* Handle child elemets of the unknown element, if any.
*
* @param object $parent The parent object the unkown element belongs to
* @param object $parentWrapper The parent wrapper object
*/
function handleChildren($parent, $parentWrapper) {
if ($parent instanceof TaskAdapter) {
$parent = $parent->getProxy();
}
$parentClass = get_class($parent);
$ih = IntrospectionHelper::getHelper($parentClass);
for ($i=0, $childrenCount=count($this->children); $i < $childrenCount; $i++) {
$childWrapper = $parentWrapper->getChild($i);
$child = $this->children[$i];
$realChild = null;
if ($parent instanceof TaskContainer) {
$realChild = $this->makeTask($child, $childWrapper, false);
$parent->addTask($realChild);
} else {
$project = $this->project === null ? $parent->project : $this->project;
$realChild = $ih->createElement($project, $parent, $child->getTag());
}
$childWrapper->setProxy($realChild);
if ($realChild instanceof Task) {
$realChild->setRuntimeConfigurableWrapper($childWrapper);
}
$child->handleChildren($realChild, $childWrapper);
if ($realChild instanceof Task) {
$realChild->maybeConfigure();
}
}
}
/**
* Creates a named task or data type. If the real object is a task,
* it is configured up to the init() stage.
*
* @param UnknownElement $ue The unknown element to create the real object for.
* Must not be <code>null</code>.
* @param RuntimeConfigurable $w Ignored in this implementation.
* @return object The Task or DataType represented by the given unknown element.
*/
protected function makeObject(UnknownElement $ue, RuntimeConfigurable $w) {
$o = $this->makeTask($ue, $w, true);
if ($o === null) {
$o = $this->project->createDataType($ue->getTag());
}
if ($o === null) {
throw new BuildException("Could not create task/type: '".$ue->getTag()."'. Make sure that this class has been declared using taskdef / typedef.");
}
return $o;
}
/**
* Create a named task and configure it up to the init() stage.
*
* @param UnknownElement $ue The unknwon element to create a task from
* @param RuntimeConfigurable $w The wrapper object
* @param boolean $onTopLevel Whether to treat this task as if it is top-level.
* @return Task The freshly created task
*/
protected function makeTask(UnknownElement $ue, RuntimeConfigurable $w, $onTopLevel = false) {
$task = $this->project->createTask($ue->getTag());
if ($task === null) {
if (!$onTopLevel) {
throw new BuildException("Could not create task of type: '".$this->elementName."'. Make sure that this class has been declared using taskdef.");
}
return null;
}
// used to set the location within the xmlfile so that exceptions can
// give detailed messages
$task->setLocation($this->getLocation());
$attrs = $w->getAttributes();
if (isset($attrs['id'])) {
$this->project->addReference($attrs['id'], $task);
}
if ($this->target !== null) {
$task->setOwningTarget($this->target);
}
$task->init();
return $task;
}
/**
* Get the name of the task to use in logging messages.
*
* @return string The task's name
*/
function getTaskName() {
return $this->realThing === null ? parent::getTaskName() : $this->realThing->getTaskName();
}
}

View File

@@ -0,0 +1,304 @@
<?php
/**
* DocBlox
*
* PHP Version 5
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
/**
* Manager class for Parallel processes.
*
* This class will manage the workers and make sure all processes are executed
* in parallel and not too many at the same time.
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
class DocBlox_Parallel_Manager extends ArrayObject
{
/** @var int The maximum number of processes to run simultaneously */
protected $process_limit = 2;
/** @var boolean Tracks whether this manager is currently executing */
protected $is_running = false;
/**
* Tries to autodetect the optimal number of process by counting the number
* of processors.
*
* @param array $input Input for the array object.
* @param int $flags flags for the array object.
* @param string $iterator_class Iterator class for this array object.
*/
public function __construct(
$input = array(), $flags = 0, $iterator_class = "ArrayIterator"
) {
parent::__construct($input, $flags, $iterator_class);
if (is_readable('/proc/cpuinfo')) {
$processors = 0;
exec("cat /proc/cpuinfo | grep processor | wc -l", $processors);
$this->setProcessLimit(reset($processors));
}
}
/**
* Adds a worker to to the queue.
*
* This method will prepare a worker to be executed in parallel once the
* execute method is invoked.
* A fluent interface is provided so that you can chain multiple workers
* in one call.
*
* Example:
*
* $cb1 = function() { var_dump('a'); sleep(1); };
* $cb2 = function() { var_dump('b'); sleep(1); };
*
* $mgr = new DocBlox_Parallel_Manager();
* $mgr->setProcessLimit(2)
* ->addWorker(new DocBlox_Parallel_Worker($cb1))
* ->addWorker(new DocBlox_Parallel_Worker($cb2))
* ->execute();
*
* @param int $index The key for this worker.
* @param DocBlox_Parallel_Worker $newval The worker to add onto the queue.
*
* @see DocBlox_Parallel_Manager::execute()
*
* @throws RuntimeException if this method is invoked while the
* manager is busy executing tasks.
* @throws InvalidArgumentException if the provided element is not of type
* DocBlox_Parallel_Worker.
*
* @return void
*/
public function offsetSet($index, $newval)
{
if (!$newval instanceof DocBlox_Parallel_Worker) {
throw new InvalidArgumentException(
'Provided element must be of type DocBlox_Parallel_Worker'
);
}
if ($this->isRunning()) {
throw new RuntimeException(
'Workers may not be added during execution of the manager'
);
}
parent::offsetSet($index, $newval);
}
/**
* Convenience method to make the addition of workers explicit and allow a
* fluent interface.
*
* @param DocBlox_Parallel_Worker $worker The worker to add onto the queue.
*
* @return self
*/
public function addWorker(DocBlox_Parallel_Worker $worker)
{
$this[] = $worker;
return $this;
}
/**
* Sets how many processes at most to execute at the same time.
*
* A fluent interface is provided so that you can chain multiple workers
* in one call.
*
* @param int $process_limit The limit, minimum of 1
*
* @see DocBlox_Parallel_Manager::addWorker() for an example
*
* @return self
*/
public function setProcessLimit($process_limit)
{
if ($process_limit < 1) {
throw new InvalidArgumentException(
'Number of simultaneous processes may not be less than 1'
);
}
$this->process_limit = $process_limit;
return $this;
}
/**
* Returns the current limit on the amount of processes that can be
* executed at the same time.
*
* @return int
*/
public function getProcessLimit()
{
return $this->process_limit;
}
/**
* Returns whether the manager is executing the workers.
*
* @return boolean
*/
public function isRunning()
{
return $this->is_running;
}
/**
* Executes each worker.
*
* This method loops through the list of workers and tries to fork as
* many times as the ProcessLimit dictates at the same time.
*
* @return void
*/
public function execute()
{
/** @var int[] $processes */
$processes = $this->startExecution();
/** @var DocBlox_Parallel_Worker $worker */
foreach ($this as $worker) {
// if requirements are not met, execute workers in series.
if (!$this->checkRequirements()) {
$worker->execute();
continue;
}
$this->forkAndRun($worker, $processes);
}
$this->stopExecution($processes);
}
/**
* Notifies manager that execution has started, checks requirements and
* returns array for child processes.
*
* If forking is not available because library requirements are not met
* than the list of workers is processed in series and a E_USER_NOTICE is
* triggered.
*
* @return int[]
*/
protected function startExecution()
{
$this->is_running = true;
// throw a E_USER_NOTICE if the requirements are not met.
if (!$this->checkRequirements()) {
trigger_error(
'The PCNTL extension is not available, running workers in series '
. 'instead of parallel',
E_USER_NOTICE
);
}
return array();
}
/**
* Waits for all processes to have finished and notifies the manager that
* execution has stopped.
*
* @param int[] &$processes List of running processes.
*
* @return void
*/
protected function stopExecution(array &$processes)
{
// starting of processes has ended but some processes might still be
// running wait for them to finish
while (!empty($processes)) {
pcntl_waitpid(array_shift($processes), $status);
}
/** @var DocBlox_Parallel_Worker $worker */
foreach ($this as $worker) {
$worker->pipe->push();
}
$this->is_running = false;
}
/**
* Forks the current process and calls the Worker's execute method OR
* handles the parent process' execution.
*
* This is the really tricky part of the forking mechanism. Here we invoke
* {@link http://www.php.net/manual/en/function.pcntl-fork.php pcntl_fork}
* and either execute the forked process or deal with the parent's process
* based on in which process we are.
*
* To fully understand what is going on here it is recommended to read the
* PHP manual page on
* {@link http://www.php.net/manual/en/function.pcntl-fork.php pcntl_fork}
* and associated articles.
*
* If there are more workers than may be ran simultaneously then this method
* will wait until a slot becomes available and then starts the next worker.
*
* @param DocBlox_Parallel_Worker $worker The worker to process.
* @param int[] &$processes The list of running processes.
*
* @throws RuntimeException if we are unable to fork.
*
* @return void
*/
protected function forkAndRun(
DocBlox_Parallel_Worker $worker, array &$processes
) {
$worker->pipe = new DocBlox_Parallel_WorkerPipe($worker);
// fork the process and register the PID
$pid = pcntl_fork();
switch ($pid) {
case -1:
throw new RuntimeException('Unable to establish a fork');
case 0: // Child process
$worker->execute();
$worker->pipe->pull();
// Kill -9 this process to prevent closing of shared file handlers.
// Not doing this causes, for example, MySQL connections to be cleaned.
posix_kill(getmypid(), SIGKILL);
default: // Parent process
// Keep track if the worker children
$processes[] = $pid;
if (count($processes) >= $this->getProcessLimit()) {
pcntl_waitpid(array_shift($processes), $status);
}
break;
}
}
/**
* Returns true when all requirements are met.
*
* @return bool
*/
protected function checkRequirements()
{
return (bool)(extension_loaded('pcntl'));
}
}

View File

@@ -0,0 +1,203 @@
<?php
/**
* DocBlox
*
* PHP Version 5
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
/**
* Class that represents the execution of a single task within a parallelized
* frame.
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
class DocBlox_Parallel_Worker
{
/** @var callback the task to execute for this worker */
protected $task = null;
/** @var mixed[] A list of argument to pass to the task */
protected $arguments = array();
/** @var int The return code to tell the parent process how it went */
protected $return_code = -1;
/** @var mixed The result of the given task */
protected $result = '';
/** @var string The error message, if an error occurred */
protected $error = '';
/**
* Creates the worker and sets the task to execute optionally including
* the arguments that need to be passed to the task.
*
* @param callback $task The task to invoke upon execution.
* @param mixed[] $arguments The arguments to provide to the task.
*/
function __construct($task, array $arguments = array())
{
$this->setTask($task);
$this->arguments = $arguments;
}
/**
* Returns the list of arguments as provided int he constructor.
*
* @see DocBlox_Parallel_Worker::__construct()
*
* @return mixed[]
*/
public function getArguments()
{
return $this->arguments;
}
/**
* Returns the task as provided in the constructor.
*
* @see DocBlox_Parallel_Worker::__construct()
*
* @return callback
*/
public function getTask()
{
return $this->task;
}
/**
* Returns the available return code.
*
* This method may return -1 if no return code is available yet.
*
* @return int
*/
public function getReturnCode()
{
return $this->return_code;
}
/**
* Sets the return code for this worker.
*
* Recommended is to use the same codes as are used with
* {@link http://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
* exit codes}.
*
* In short: 0 means that the task succeeded and a any other positive value
* indicates an error condition.
*
* @param int $return_code Recommended to be a positive number
*
* @throw InvalidArgumentException if the code is not a number or negative
*
* @return void
*/
public function setReturnCode($return_code)
{
if (!is_numeric($return_code) || ($return_code < 0)) {
throw new InvalidArgumentException(
'Expected the return code to be a positive number'
);
}
$this->return_code = $return_code;
}
/**
* Returns the error message associated with the return code.
*
* @return string
*/
public function getError()
{
return $this->error;
}
/**
* Sets the error message.
*
* @param string $error The error message.
*
* @return void
*/
public function setError($error)
{
$this->error = $error;
}
/**
* Returns the result for this task run.
*
* @return null|mixed
*/
public function getResult()
{
return $this->result;
}
/**
* Sets the result for this task run.
*
* @param mixed $result The value that is returned by the task; can be anything.
*
* @return void
*/
public function setResult($result)
{
$this->result = $result;
}
/**
* Invokes the task with the given arguments and processes the output.
*
* @return void.
*/
public function execute()
{
$this->setReturnCode(0);
try {
$this->setResult(
call_user_func_array($this->getTask(), $this->getArguments())
);
} catch (Exception $e) {
$this->setError($e->getMessage());
$this->setReturnCode($e->getCode());
}
}
/**
* Sets the task for this worker and validates whether it is callable.
*
* @param callback $task The task to execute when the execute method
* is invoked.
*
* @throws InvalidArgumentException if the given argument is not a callback.
*
* @see DocBlox_Parallel_Worker::__construct()
* @see DocBlox_Parallel_Worker::execute()
*
* @return void
*/
protected function setTask($task)
{
if (!is_callable($task)) {
throw new InvalidArgumentException(
'Worker task is not a callable object'
);
}
$this->task = $task;
}
}

View File

@@ -0,0 +1,127 @@
<?php
/**
* DocBlox
*
* PHP Version 5
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @copyright 2010-2011 Mike van Riel / Naenius (http://www.naenius.com)
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
/**
* Class that represents a named pipe for a Worker.
*
* This class manages the named pipe for a worker and is able to push and pull
* specific data to facilitate IPC (interprocess communication).
*
* @category DocBlox
* @package Parallel
* @author Mike van Riel <mike.vanriel@naenius.com>
* @license http://www.opensource.org/licenses/mit-license.php MIT
* @link http://docblox-project.org
*/
class DocBlox_Parallel_WorkerPipe
{
/** @var DocBlox_Parallel_Worker worker class that is associated */
protected $worker;
/** @var string Path to the pipe */
protected $path;
/**
* Initializes the named pipe.
*
* @param DocBlox_Parallel_Worker $worker Associated worker.
*/
public function __construct(DocBlox_Parallel_Worker $worker)
{
$this->worker = $worker;
$this->path = tempnam(sys_get_temp_dir(), 'dpm_');
posix_mkfifo($this->path, 0750);
}
/**
* If the named pipe was not cleaned up, do so now.
*/
public function __destruct()
{
if (file_exists($this->path)) {
$this->release();
}
}
/**
* Pull the worker data into the named pipe.
*
* @return void
*/
public function pull()
{
$this->writePipeContents();
}
/**
* Push the worker data back onto the worker and release the pipe.
*
* @return void
*/
public function push()
{
list($result, $error, $return_code) = $this->readPipeContents();
$this->release();
$this->worker->setResult($result);
$this->worker->setError($error);
$this->worker->setReturnCode($return_code);
}
/**
* Convenience method to show relation to readPipeContents.
*
* @return void
*/
protected function writePipeContents()
{
// push the gathered data onto a name pipe
$pipe = fopen($this->path, 'w');
fwrite(
$pipe, serialize(
array(
$this->worker->getResult(),
$this->worker->getError(),
$this->worker->getReturnCode()
)
)
);
fclose($pipe);
}
/**
* Returns the unserialized contents of the pipe.
*
* @return array
*/
protected function readPipeContents()
{
$pipe = fopen($this->path, 'r+');
$result = unserialize(fread($pipe, filesize($this->path)));
fclose($pipe);
return $result;
}
/**
* Releases the pipe.
*
* @return void
*/
protected function release()
{
unlink($this->path);
}
}

View File

@@ -0,0 +1,157 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/system/io/FilterReader.php';
include_once 'phing/system/io/StringReader.php';
/**
* Base class for core filter readers.
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @version $Id$
* @access public
* @see FilterReader
* @package phing.filters
*/
class BaseFilterReader extends FilterReader {
/** Have the parameters passed been interpreted? */
protected $initialized = false;
/** The Phing project this filter is part of. */
protected $project = null;
/**
* Constructor used by Phing's introspection mechanism.
* The original filter reader is only used for chaining
* purposes, never for filtering purposes (and indeed
* it would be useless for filtering purposes, as it has
* no real data to filter). ChainedReaderHelper uses
* this placeholder instance to create a chain of real filters.
*
* @param Reader $in
*/
function __construct($in = null) {
if ($in === null) {
$dummy = "";
$in = new StringReader($dummy);
}
parent::__construct($in);
}
/**
* Returns the initialized status.
*
* @return boolean whether or not the filter is initialized
*/
function getInitialized() {
return $this->initialized;
}
/**
* Sets the initialized status.
*
* @param boolean $initialized Whether or not the filter is initialized.
*/
function setInitialized($initialized) {
$this->initialized = (boolean) $initialized;
}
/**
* Sets the project to work with.
*
* @param object $project The project this filter is part of.
* Should not be <code>null</code>.
*/
function setProject(Project $project) {
// type check, error must never occur, bad code of it does
$this->project = $project;
}
/**
* Returns the project this filter is part of.
*
* @return object The project this filter is part of
*/
function getProject() {
return $this->project;
}
/**
* Reads characters.
*
* @param off Offset at which to start storing characters.
* @param len Maximum number of characters to read.
*
* @return Characters read, or -1 if the end of the stream
* has been reached
*
* @throws IOException If an I/O error occurs
*/
function read($len = null) {
return $this->in->read($len);
}
/**
* Reads a line of text ending with '\n' (or until the end of the stream).
* The returned String retains the '\n'.
*
* @return the line read, or <code>null</code> if the end of the
stream has already been reached
*
* @throws IOException if the underlying reader throws one during
* reading
*/
function readLine() {
$line = null;
while ( ($ch = $this->in->read(1)) !== -1 ) {
$line .= $ch;
if ( $ch === "\n" )
break;
}
return $line;
}
/**
* Returns whether the end of file has been reached with input stream.
* @return boolean
*/
function eof() {
return $this->in->eof();
}
/**
* Convenience method to support logging in filters.
* @param string $msg Message to log.
* @param int $level Priority level.
*/
function log($msg, $level = Project::MSG_INFO) {
if ($this->project !== null) {
$this->project->log("[filter:".get_class($this)."] ".$msg, $level);
}
}
}

View File

@@ -0,0 +1,69 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/types/Parameterizable.php';
include_once 'phing/types/Parameter.php';
/**
* Base class for core filter readers.
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @copyright 2003 seasonfive. All rights reserved
* @version $Id$
* @access public
* @see FilterReader
* @package phing.filters
*/
class BaseParamFilterReader extends BaseFilterReader implements Parameterizable {
/** The passed in parameter array. */
protected $_parameters = array();
/*
* Sets the parameters used by this filter, and sets
* the filter to an uninitialized status.
*
* @param array Array of parameters to be used by this filter.
* Should not be <code>null</code>.
*/
function setParameters($parameters) {
// type check, error must never occur, bad code of it does
if ( !is_array($parameters) ) {
throw new Exception("Expected parameters array got something else");
}
$this->_parameters = $parameters;
$this->setInitialized(false);
}
/*
* Returns the parameters to be used by this filter.
*
* @return the parameters to be used by this filter
*/
function &getParameters() {
return $this->_parameters;
}
}

View File

@@ -0,0 +1,43 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Interface indicating that a reader may be chained to another one.
*
* @author Magesh Umasankar
* @package phing.filters
*/
interface ChainableReader {
/**
* Returns a reader with the same configuration as this one,
* but filtering input from the specified reader.
*
* @param Reader $rdr the reader which the returned reader should be filtering
*
* @return Reader A reader with the same configuration as this one, but
* filtering input from the specified reader
*/
public function chain(Reader $rdr);
}

View File

@@ -0,0 +1,99 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Expands Phing Properties, if any, in the data.
* <p>
* Example:<br>
* <pre><expandproperties/></pre>
* Or:
* <pre><filterreader classname="phing.filters.ExpandProperties'/></pre>
*
* @author Yannick Lecaillez <yl@seasonfive.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BaseFilterReader
* @package phing.filters
*/
class ExpandProperties extends BaseFilterReader implements ChainableReader {
protected $logLevel = Project::MSG_VERBOSE;
/**
* Set level of log messages generated (default = info)
* @param string $level
*/
public function setLevel($level)
{
switch ($level)
{
case "error": $this->logLevel = Project::MSG_ERR; break;
case "warning": $this->logLevel = Project::MSG_WARN; break;
case "info": $this->logLevel = Project::MSG_INFO; break;
case "verbose": $this->logLevel = Project::MSG_VERBOSE; break;
case "debug": $this->logLevel = Project::MSG_DEBUG; break;
}
}
/**
* Returns the filtered stream.
* The original stream is first read in fully, and the Phing properties are expanded.
*
* @return mixed the filtered stream, or -1 if the end of the resulting stream has been reached.
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
$project = $this->getProject();
$buffer = ProjectConfigurator::replaceProperties($project, $buffer, $project->getProperties(), $this->logLevel);
return $buffer;
}
/**
* Creates a new ExpandProperties filter using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new ExpandProperties($reader);
$newFilter->setProject($this->getProject());
return $newFilter;
}
}

View File

@@ -0,0 +1,161 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Reads the first <code>n</code> lines of a stream.
* (Default is first 10 lines.)
* <p>
* Example:
* <pre><headfilter lines="3"/></pre>
* Or:
* <pre><filterreader classname="phing.filters.HeadFilter">
* <param name="lines" value="3"/>
* </filterreader></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see FilterReader
* @package phing.filters
*/
class HeadFilter extends BaseParamFilterReader implements ChainableReader {
/**
* Parameter name for the number of lines to be returned.
*/
const LINES_KEY = "lines";
/**
* Number of lines currently read in.
* @var integer
*/
private $_linesRead = 0;
/**
* Number of lines to be returned in the filtered stream.
* @var integer
*/
private $_lines = 10;
/**
* Returns first n lines of stream.
* @return the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
// note, if buffer contains fewer lines than
// $this->_lines this code will not work.
if($this->_linesRead < $this->_lines) {
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// now grab first X lines from buffer
$lines = explode("\n", $buffer);
$linesCount = count($lines);
// must account for possibility that the num lines requested could
// involve more than one buffer read.
$len = ($linesCount > $this->_lines ? $this->_lines - $this->_linesRead : $linesCount);
$filtered_buffer = implode("\n", array_slice($lines, 0, $len) );
$this->_linesRead += $len;
return $filtered_buffer;
}
return -1; // EOF, since the file is "finished" as far as subsequent filters are concerned.
}
/**
* Sets the number of lines to be returned in the filtered stream.
*
* @param integer $lines the number of lines to be returned in the filtered stream.
*/
function setLines($lines) {
$this->_lines = (int) $lines;
}
/**
* Returns the number of lines to be returned in the filtered stream.
*
* @return integer The number of lines to be returned in the filtered stream.
*/
function getLines() {
return $this->_lines;
}
/**
* Creates a new HeadFilter using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader.
*/
function chain(Reader $reader) {
$newFilter = new HeadFilter($reader);
$newFilter->setLines($this->getLines());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Scans the parameters list for the "lines" parameter and uses
* it to set the number of lines to be returned in the filtered stream.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0, $_i=count($params) ; $i < $_i; $i++) {
if ( self::LINES_KEY == $params[$i]->getName() ) {
$this->_lines = (int) $params[$i]->getValue();
break;
}
}
}
}
}

View File

@@ -0,0 +1,155 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Encode data from <code>in</code> encoding to <code>out</code> encoding.
*
* Example:
* <pre>
* <iconvfilter inputencoding="UTF-8" outputencoding="CP1251" />
* </pre>
* Or:
* <pre>
* <filterreader classname="phing.filters.IconvFilter">
* <param name="inputencoding" value="UTF-8" />
* <param name="outputencoding" value="CP1251" />
* </filterreader>
* </pre>
*
* @author Alexey Shockov, <alexey@shockov.com>
* @version $Id$
* @package phing.filters
*/
class IconvFilter
extends BaseParamFilterReader
implements ChainableReader {
private $_inputEncoding;
private $_outputEncoding;
/**
* Returns first n lines of stream.
* @return the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
$this->_initialize();
// Process whole text at once.
$text = null;
while (($data = $this->in->read($len)) !== -1) {
$text .= $data;
}
// At the end.
if (null === $text) {
return -1;
}
$this->log(
"Encoding " . $this->in->getResource() . " from " . $this->getInputEncoding() . " to " . $this->getOutputEncoding(),
Project::MSG_VERBOSE
);
return iconv($this->_inputEncoding, $this->_outputEncoding, $text);
}
/**
*
* @param string $encoding Input encoding.
*/
public function setInputEncoding($encoding) {
$this->_inputEncoding = $encoding;
}
/**
*
* @return string
*/
public function getInputEncoding() {
return $this->_inputEncoding;
}
/**
*
* @param string $encoding Output encoding.
*/
public function setOutputEncoding($encoding) {
$this->_outputEncoding = $encoding;
}
/**
*
* @return string
*/
public function getOutputEncoding() {
return $this->_outputEncoding;
}
/**
* Creates a new IconvFilter using the passed in Reader for instantiation.
*
* @param object A Reader object providing the underlying stream. Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering the specified reader.
*/
function chain(Reader $reader) {
$filter = new self($reader);
$filter->setInputEncoding($this->getInputEncoding());
$filter->setOutputEncoding($this->getOutputEncoding());
$filter->setInitialized(true);
$filter->setProject($this->getProject());
return $filter;
}
/**
* Configuring object from the parameters list.
*/
private function _initialize() {
if ($this->getInitialized()) {
return;
}
$params = $this->getParameters();
if ($params !== null) {
foreach ($params as $param) {
if ('in' == $param->getName()) {
$this->setInputEncoding($param->getValue());
} else if ('out' == $param->getName()) {
$this->setOutputEncoding($param->getValue());
}
}
}
$this->setInitialized(true);
}
}

View File

@@ -0,0 +1,260 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Filter which includes only those lines that contain all the user-specified
* strings.
*
* Example:
*
* <pre><linecontains>
* <contains value="foo">
* <contains value="bar">
* </linecontains></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.LineContains">
* <param type="contains" value="foo"/>
* <param type="contains" value="bar"/>
* </filterreader></pre>
*
* This will include only those lines that contain <code>foo</code> and
* <code>bar</code>.
*
* @author Yannick Lecaillez <yl@seasonfive.com>
* @author Hans Lellelid <hans@velum.net>
* @version $Id$
* @see PhingFilterReader
* @package phing.filters
*/
class LineContains extends BaseParamFilterReader implements ChainableReader {
/**
* The parameter name for the string to match on.
* @var string
*/
const CONTAINS_KEY = "contains";
/**
* Array of Contains objects.
* @var array
*/
private $_contains = array();
/**
* [Deprecated]
* @var string
*/
private $_line = null;
/**
* Returns all lines in a buffer that contain specified strings.
* @return mixed buffer, -1 on EOF
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if ($buffer === -1) {
return -1;
}
$lines = explode("\n", $buffer);
$matched = array();
$containsSize = count($this->_contains);
foreach($lines as $line) {
for($i = 0 ; $i < $containsSize ; $i++) {
$containsStr = $this->_contains[$i]->getValue();
if ( strstr($line, $containsStr) === false ) {
$line = null;
break;
}
}
if($line !== null) {
$matched[] = $line;
}
}
$filtered_buffer = implode("\n", $matched);
return $filtered_buffer;
}
/**
* [Deprecated. For reference only, used to be read() method.]
* Returns the next character in the filtered stream, only including
* lines from the original stream which contain all of the specified words.
*
* @return the next character in the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function readChar() {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$ch = -1;
if ( $this->_line !== null ) {
$ch = substr($this->_line, 0, 1);
if ( strlen($this->_line) === 1 )
$this->_line = null;
else
$this->_line = substr($this->_line, 1);
} else {
$this->_line = $this->readLine();
if ( $this->_line === null ) {
$ch = -1;
} else {
$containsSize = count($this->_contains);
for($i = 0 ; $i < $containsSize ; $i++) {
$containsStr = $this->_contains[$i]->getValue();
if ( strstr($this->_line, $containsStr) === false ) {
$this->_line = null;
break;
}
}
return $this->readChar();
}
}
return $ch;
}
/**
* Adds a <code>contains</code> nested element.
*
* @return Contains The <code>contains</code> element added.
* Must not be <code>null</code>.
*/
function createContains() {
$num = array_push($this->_contains, new Contains());
return $this->_contains[$num-1];
}
/**
* Sets the array of words which must be contained within a line read
* from the original stream in order for it to match this filter.
*
* @param array $contains An array of words which must be contained
* within a line in order for it to match in this filter.
* Must not be <code>null</code>.
*/
function setContains($contains) {
// type check, error must never occur, bad code of it does
if ( !is_array($contains) ) {
throw new Exception("Excpected array got something else");
}
$this->_contains = $contains;
}
/**
* Returns the vector of words which must be contained within a line read
* from the original stream in order for it to match this filter.
*
* @return array The array of words which must be contained within a line read
* from the original stream in order for it to match this filter. The
* returned object is "live" - in other words, changes made to the
* returned object are mirrored in the filter.
*/
function getContains() {
return $this->_contains;
}
/**
* Creates a new LineContains using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new LineContains($reader);
$newFilter->setContains($this->getContains());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Parses the parameters to add user-defined contains strings.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
foreach($params as $param) {
if ( self::CONTAINS_KEY == $param->getType() ) {
$cont = new Contains();
$cont->setValue($param->getValue());
array_push($this->_contains, $cont);
break; // because we only support a single contains
}
}
}
}
}
/**
* Holds a contains element.
*
* @package phing.filters
*/
class Contains {
/**
* @var string
*/
private $_value;
/**
* Set 'contains' value.
* @param string $contains
*/
function setValue($contains) {
$this->_value = (string) $contains;
}
/**
* Returns 'contains' value.
* @return string
*/
function getValue() {
return $this->_value;
}
}

View File

@@ -0,0 +1,179 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/types/RegularExpression.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Filter which includes only those lines that contain the user-specified
* regular expression matching strings.
*
* Example:
* <pre><linecontainsregexp>
* <regexp pattern="foo*">
* </linecontainsregexp></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.LineContainsRegExp">
* <param type="regexp" value="foo*"/>
* </filterreader></pre>
*
* This will fetch all those lines that contain the pattern <code>foo</code>
*
* @author Yannick Lecaillez <yl@seasonfive.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see FilterReader
* @package phing.filters
*/
class LineContainsRegexp extends BaseParamFilterReader implements ChainableReader {
/**
* Parameter name for regular expression.
* @var string
*/
const REGEXP_KEY = "regexp";
/**
* Regular expressions that are applied against lines.
* @var array
*/
private $_regexps = array();
/**
* Returns all lines in a buffer that contain specified strings.
* @return mixed buffer, -1 on EOF
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if ($buffer === -1) {
return -1;
}
$lines = explode("\n", $buffer);
$matched = array();
$regexpsSize = count($this->_regexps);
foreach($lines as $line) {
for($i = 0 ; $i<$regexpsSize ; $i++) {
$regexp = $this->_regexps[$i];
$re = $regexp->getRegexp($this->getProject());
$matches = $re->matches($line);
if ( !$matches ) {
$line = null;
break;
}
}
if($line !== null) {
$matched[] = $line;
}
}
$filtered_buffer = implode("\n", $matched);
return $filtered_buffer;
}
/**
* Adds a <code>regexp</code> element.
*
* @return object regExp The <code>regexp</code> element added.
*/
function createRegexp() {
$num = array_push($this->_regexps, new RegularExpression());
return $this->_regexps[$num-1];
}
/**
* Sets the vector of regular expressions which must be contained within
* a line read from the original stream in order for it to match this
* filter.
*
* @param regexps An array of regular expressions which must be contained
* within a line in order for it to match in this filter. Must not be
* <code>null</code>.
*/
function setRegexps($regexps) {
// type check, error must never occur, bad code of it does
if ( !is_array($regexps) ) {
throw new Exception("Excpected an 'array', got something else");
}
$this->_regexps = $regexps;
}
/**
* Returns the array of regular expressions which must be contained within
* a line read from the original stream in order for it to match this
* filter.
*
* @return array The array of regular expressions which must be contained within
* a line read from the original stream in order for it to match this
* filter. The returned object is "live" - in other words, changes made to
* the returned object are mirrored in the filter.
*/
function getRegexps() {
return $this->_regexps;
}
/**
* Creates a new LineContainsRegExp using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new LineContainsRegExp($reader);
$newFilter->setRegexps($this->getRegexps());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Parses parameters to add user defined regular expressions.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0 ; $i<count($params) ; $i++) {
if ( self::REGEXP_KEY === $params[$i]->getType() ) {
$pattern = $params[$i]->getValue();
$regexp = new RegularExpression();
$regexp->setPattern($pattern);
array_push($this->_regexps, $regexp);
}
}
}
}
}

View File

@@ -0,0 +1,142 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Attaches a prefix to every line.
*
* Example:
* <pre><prefixlines prefix="Foo"/></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.PrefixLines">
* <param name="prefix" value="Foo"/>
* </filterreader></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see FilterReader
* @package phing.filters
*/
class PrefixLines extends BaseParamFilterReader implements ChainableReader {
/**
* Parameter name for the prefix.
* @var string
*/
const PREFIX_KEY = "lines";
/**
* The prefix to be used.
* @var string
*/
private $_prefix = null;
/**
* Adds a prefix to each line of input stream and returns resulting stream.
*
* @return mixed buffer, -1 on EOF
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if ($buffer === -1) {
return -1;
}
$lines = explode("\n", $buffer);
$filtered = array();
foreach($lines as $line) {
$line = $this->_prefix . $line;
$filtered[] = $line;
}
$filtered_buffer = implode("\n", $filtered);
return $filtered_buffer;
}
/**
* Sets the prefix to add at the start of each input line.
*
* @param string $prefix The prefix to add at the start of each input line.
* May be <code>null</code>, in which case no prefix
* is added.
*/
function setPrefix($prefix) {
$this->_prefix = (string) $prefix;
}
/**
* Returns the prefix which will be added at the start of each input line.
*
* @return string The prefix which will be added at the start of each input line
*/
function getPrefix() {
return $this->_prefix;
}
/**
* Creates a new PrefixLines filter using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new PrefixLines($reader);
$newFilter->setPrefix($this->getPrefix());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Initializes the prefix if it is available from the parameters.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0, $_i=count($params) ; $i < $_i ; $i++) {
if ( self::PREFIX_KEY == $params[$i]->getName() ) {
$this->_prefix = (string) $params[$i]->getValue();
break;
}
}
}
}
}

View File

@@ -0,0 +1,129 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
include_once 'phing/types/RegularExpression.php';
/**
* Performs a regexp find/replace on stream.
* <p>
* Example:<br>
* <pre>
* <replaceregexp>
* <regexp pattern="\r\n" replace="\n"/>
* <regexp pattern="(\w+)\.xml" replace="\1.php" ignoreCase="true"/>
* </replaceregexp>
* </pre>
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.filters
*/
class ReplaceRegexp extends BaseFilterReader implements ChainableReader {
/**
* @var array RegularExpression[]
*/
private $regexps = array();
/**
* Creator method handles nested <regexp> tags.
* @return RegularExpression
*/
function createRegexp() {
$num = array_push($this->regexps, new RegularExpression());
return $this->regexps[$num-1];
}
/**
* Sets the current regexps.
* (Used when, e.g., cloning/chaining the method.)
* @param array RegularExpression[]
*/
function setRegexps($regexps) {
$this->regexps = $regexps;
}
/**
* Gets the current regexps.
* (Used when, e.g., cloning/chaining the method.)
* @return array RegularExpression[]
*/
function getRegexps() {
return $this->regexps;
}
/**
* Returns the filtered stream.
* The original stream is first read in fully, and the regex replace is performed.
*
* @param int $len Required $len for Reader compliance.
*
* @return mixed The filtered stream, or -1 if the end of the resulting stream has been reached.
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// perform regex replace here ...
foreach($this->regexps as $exptype) {
$regexp = $exptype->getRegexp($this->project);
try {
$buffer = $regexp->replace($buffer);
$this->log("Performing regexp replace: /".$regexp->getPattern()."/".$regexp->getReplace()."/g".$regexp->getModifiers(), Project::MSG_VERBOSE);
} catch (Exception $e) {
// perhaps mismatch in params (e.g. no replace or pattern specified)
$this->log("Error performing regexp replace: " . $e->getMessage(), Project::MSG_WARN);
}
}
return $buffer;
}
/**
* Creates a new ReplaceRegExp filter using the passed in
* Reader for instantiation.
*
* @param Reader $reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return ReplaceRegExp A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new ReplaceRegExp($reader);
$newFilter->setProject($this->getProject());
$newFilter->setRegexps($this->getRegexps());
return $newFilter;
}
}

View File

@@ -0,0 +1,435 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/types/TokenSource.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Replaces tokens in the original input with user-supplied values.
*
* Example:
*
* <pre><replacetokens begintoken="#" endtoken="#">;
* <token key="DATE" value="${TODAY}"/>
* </replacetokens></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.ReplaceTokens">
* <param type="tokenchar" name="begintoken" value="#"/>
* <param type="tokenchar" name="endtoken" value="#"/>
* <param type="token" name="DATE" value="${TODAY}"/>
* </filterreader></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see BaseParamFilterReader
* @package phing.filters
*/
class ReplaceTokens extends BaseParamFilterReader implements ChainableReader {
/**
* Default "begin token" character.
* @var string
*/
const DEFAULT_BEGIN_TOKEN = "@";
/**
* Default "end token" character.
* @var string
*/
const DEFAULT_END_TOKEN = "@";
/**
* [Deprecated] Data that must be read from, if not null.
* @var string
*/
private $_queuedData = null;
/**
* Array to hold the replacee-replacer pairs (String to String).
* @var array
*/
private $_tokens = array();
/**
* Array to hold the token sources that make tokens from
* different sources available
* @var array
*/
private $_tokensources = array();
/**
* Array holding all tokens given directly to the Filter and
* those passed via a TokenSource.
* @var array
*/
private $_alltokens = null;
/**
* Character marking the beginning of a token.
* @var string
*/
private $_beginToken = "@"; // self::DEFAULT_BEGIN_TOKEN;
/**
* Character marking the end of a token.
* @var string
*/
private $_endToken = "@"; //self::DEFAULT_END_TOKEN;
/**
* Performs lookup on key and returns appropriate replacement string.
* @param array $matches Array of 1 el containing key to search for.
* @return string Text with which to replace key or value of key if none is found.
* @access private
*/
private function replaceTokenCallback($matches) {
$key = $matches[1];
/* Get tokens from tokensource and merge them with the
* tokens given directly via build file. This should be
* done a bit more elegantly
*/
if ($this->_alltokens === null) {
$this->_alltokens = array();
$count = count($this->_tokensources);
for ($i = 0; $i < $count; $i++) {
$source = $this->_tokensources[$i];
$this->_alltokens = array_merge($this->_alltokens, $source->getTokens());
}
$this->_alltokens = array_merge($this->_tokens, $this->_alltokens);
}
$tokens = $this->_alltokens;
$replaceWith = null;
$count = count($tokens);
for ($i = 0; $i < $count; $i++) {
if ($tokens[$i]->getKey() === $key) {
$replaceWith = $tokens[$i]->getValue();
}
}
if ($replaceWith === null) {
$replaceWith = $this->_beginToken . $key . $this->_endToken;
$this->log("No token defined for key \"".$this->_beginToken . $key . $this->_endToken."\"");
} else {
$this->log("Replaced \"".$this->_beginToken . $key . $this->_endToken ."\" with \"".$replaceWith."\"", Project::MSG_VERBOSE);
}
return $replaceWith;
}
/**
* Returns stream with tokens having been replaced with appropriate values.
* If a replacement value is not found for a token, the token is left in the stream.
*
* @return mixed filtered stream, -1 on EOF.
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
// read from next filter up the chain
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// filter buffer
$buffer = preg_replace_callback(
"/".preg_quote($this->_beginToken, '/')."([\w\.\-:]+?)".preg_quote($this->_endToken, '/')."/",
array($this, 'replaceTokenCallback'), $buffer);
return $buffer;
}
/**
* Sets the "begin token" character.
*
* @param string $beginToken the character used to denote the beginning of a token.
*/
function setBeginToken($beginToken) {
$this->_beginToken = (string) $beginToken;
}
/**
* Returns the "begin token" character.
*
* @return string The character used to denote the beginning of a token.
*/
function getBeginToken() {
return $this->_beginToken;
}
/**
* Sets the "end token" character.
*
* @param string $endToken the character used to denote the end of a token
*/
function setEndToken($endToken) {
$this->_endToken = (string) $endToken;
}
/**
* Returns the "end token" character.
*
* @return the character used to denote the beginning of a token
*/
function getEndToken() {
return $this->_endToken;
}
/**
* Adds a token element to the map of tokens to replace.
*
* @return object The token added to the map of replacements.
* Must not be <code>null</code>.
*/
function createToken() {
$num = array_push($this->_tokens, new Token());
return $this->_tokens[$num-1];
}
/**
* Adds a token source to the sources of this filter.
*
* @return object A Reference to the source just added.
*/
function createTokensource() {
$num = array_push($this->_tokensources, new TokenSource());
return $this->_tokensources[$num-1];
}
/**
* Sets the map of tokens to replace.
* ; used by ReplaceTokens::chain()
*
* @param array A map (String->String) of token keys to replacement
* values. Must not be <code>null</code>.
*/
function setTokens($tokens) {
// type check, error must never occur, bad code of it does
if ( !is_array($tokens) ) {
throw new Exception("Excpected 'array', got something else");
}
$this->_tokens = $tokens;
}
/**
* Returns the map of tokens which will be replaced.
* ; used by ReplaceTokens::chain()
*
* @return array A map (String->String) of token keys to replacement values.
*/
function getTokens() {
return $this->_tokens;
}
/**
* Sets the tokensources to use; used by ReplaceTokens::chain()
*
* @param array An array of token sources.
*/
function setTokensources($sources) {
// type check
if ( !is_array($sources)) {
throw new Exception("Exspected 'array', got something else");
}
$this->_tokensources = $sources;
}
/**
* Returns the token sources used by this filter; used by ReplaceTokens::chain()
*
* @return array
*/
function getTokensources() {
return $this->_tokensources;
}
/**
* Creates a new ReplaceTokens using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new ReplaceTokens($reader);
$newFilter->setProject($this->getProject());
$newFilter->setBeginToken($this->getBeginToken());
$newFilter->setEndToken($this->getEndToken());
$newFilter->setTokens($this->getTokens());
$newFilter->setTokensources($this->getTokensources());
$newFilter->setInitialized(true);
return $newFilter;
}
/**
* Initializes tokens and loads the replacee-replacer hashtable.
* This method is only called when this filter is used through
* a <filterreader> tag in build file.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0 ; $i<count($params) ; $i++) {
if ( $params[$i] !== null ) {
$type = $params[$i]->getType();
if ( $type === "tokenchar" ) {
$name = $params[$i]->getName();
if ( $name === "begintoken" ) {
$this->_beginToken = substr($params[$i]->getValue(), 0, 1);
} else if ( $name === "endtoken" ) {
$this->_endToken = substr($params[$i]->getValue(), 0, 1);
}
} else if ( $type === "token" ) {
$name = $params[$i]->getName();
$value = $params[$i]->getValue();
$tok = new Token();
$tok->setKey($name);
$tok->setValue($value);
array_push($this->_tokens, $tok);
} else if ( $type === "tokensource" ) {
// Store data from nested tags in local array
$arr = array(); $subparams = $params[$i]->getParams();
$count = count($subparams);
for ($i = 0; $i < $count; $i++) {
$arr[$subparams[$i]->getName()] = $subparams[$i]->getValue();
}
// Create TokenSource
$tokensource = new TokenSource();
if (isset($arr["classname"]))
$tokensource->setClassname($arr["classname"]);
// Copy other parameters 1:1 to freshly created TokenSource
foreach ($arr as $key => $value) {
if (strtolower($key) === "classname")
continue;
$param = $tokensource->createParam();
$param->setName($key);
$param->setValue($value);
}
$this->_tokensources[] = $tokensource;
}
}
}
}
}
}
/**
* Holds a token.
*
* @package phing.filters
*/
class Token {
/**
* Token key.
* @var string
*/
private $_key;
/**
* Token value.
* @var string
*/
private $_value;
/**
* Sets the token key.
*
* @param string $key The key for this token. Must not be <code>null</code>.
*/
function setKey($key) {
$this->_key = (string) $key;
}
/**
* Sets the token value.
*
* @param string $value The value for this token. Must not be <code>null</code>.
*/
function setValue($value) {
// special case for boolean values
if (is_bool($value)) {
if ($value) {
$this->_value = "true";
} else {
$this->_value = "false";
}
} else {
$this->_value = (string) $value;
}
}
/**
* Returns the key for this token.
*
* @return string The key for this token.
*/
function getKey() {
return $this->_key;
}
/**
* Returns the value for this token.
*
* @return string The value for this token.
*/
function getValue() {
return $this->_value;
}
/**
* Sets the token value from text.
*
* @param string $value The value for this token. Must not be <code>null</code>.
*/
function addText($value) {
$this->setValue($value);
}
}

View File

@@ -0,0 +1,361 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Replaces tokens in the original input with the contents of a file.
* The file to be used is controlled by the name of the token which
* corresponds to the basename of the file to be used together with
* the optional pre and postfix strings that is possible to set.
*
* By default all HTML entities in the file is replaced by the
* corresponding HTML entities. This behaviour can be controlled by
* the "translatehtml" parameter.
*
* Supported parameters are:
* <pre>
* prefix string Text to be prefixed to token before using as filename
* postfix string Text to be prefixed to token before using as filename
* dir string The directory where the files should be read from
* translatehtml bool If we should translate all HTML entities in the file.
* </pre>
* Example:
*
* <pre><filterreader classname="phing.filters.ReplaceTokensWithFile">
* <param name="dir" value="examples/" />
* <param name="postfix" value=".php" />
* </filterreader></pre>
*
* @author johan persson, johanp@aditus.nu
* @version $Id$
* @access public
* @see ReplaceTokensWithFile
* @package phing.filters
*/
class ReplaceTokensWithFile extends BaseParamFilterReader implements ChainableReader {
/**
* Default "begin token" character.
* @var string
*/
const DEFAULT_BEGIN_TOKEN = "#@#";
/**
* Default "end token" character.
* @var string
*/
const DEFAULT_END_TOKEN = "#@#";
/**
* Array to hold the token sources that make tokens from
* different sources available
* @var array
*/
private $_tokensources = array();
/**
* Character marking the beginning of a token.
* @var string
*/
private $_beginToken = ReplaceTokensWithFile::DEFAULT_BEGIN_TOKEN;
/**
* Character marking the end of a token.
* @var string
*/
private $_endToken = ReplaceTokensWithFile::DEFAULT_END_TOKEN;
/**
* File prefix to be inserted in front of the token to create the
* file name to be used.
* @var string
*/
private $_prefix = '';
/**
* File postfix to be inserted in front of the token to create the
* file name to be used.
* @var string
*/
private $_postfix = '';
/**
* Directory where to look for the files. The default is to look in the
* current file.
*
* @var string
*/
private $_dir = './';
/**
* Translate all HTML entities in the file to the corresponding HTML
* entities before it is used as replacements. For example all '<'
* will be translated to &lt; before the content is inserted.
*
* @var boolean
*/
private $_translatehtml = true;
/**
* Sets the drectory where to look for the files to use for token replacement
*
* @param string $dir
*/
function setTranslateHTML($translate) {
$this->_translatehtml = (bool) $translate;
}
/**
* Returns the drectory where to look for the files to use for token replacement
*/
function getTranslateHTML() {
return $this->_translatehtml;
}
/**
* Sets the drectory where to look for the files to use for token replacement
*
* @param string $dir
*/
function setDir($dir) {
$this->_dir = (string) $dir;
}
/**
* Returns the drectory where to look for the files to use for token replacement
*/
function getDir() {
return $this->_dir;
}
/**
* Sets the prefix that is prepended to the token in order to create the file
* name. For example if the token is 01 and the prefix is "example" then
* the filename to look for will be "example01"
*
* @param string $prefix
*/
function setPrefix($prefix) {
$this->_prefix = (string) $prefix;
}
/*
* Returns the prefix that is prepended to the token in order to create the file
* name. For example if the token is 01 and the prefix is "example" then
* the filename to look for will be "example01"
*/
function getPrefix() {
return $this->_prefix;
}
/**
* Sets the postfix that is added to the token in order to create the file
* name. For example if the token is 01 and the postfix is ".php" then
* the filename to look for will be "01.php"
*
* @param string $postfix
*/
function setPostfix($postfix) {
$this->_postfix = (string) $postfix;
}
/**
* Returns the postfix that is added to the token in order to create the file
* name. For example if the token is 01 and the postfix is ".php" then
* the filename to look for will be "01.php"
*/
function getPostfix() {
return $this->_postfix;
}
/**
* Sets the "begin token" character.
*
* @param string $beginToken the character used to denote the beginning of a token.
*/
function setBeginToken($beginToken) {
$this->_beginToken = (string) $beginToken;
}
/**
* Returns the "begin token" character.
*
* @return string The character used to denote the beginning of a token.
*/
function getBeginToken() {
return $this->_beginToken;
}
/**
* Sets the "end token" character.
*
* @param string $endToken the character used to denote the end of a token
*/
function setEndToken($endToken) {
$this->_endToken = (string) $endToken;
}
/**
* Returns the "end token" character.
*
* @return the character used to denote the beginning of a token
*/
function getEndToken() {
return $this->_endToken;
}
/**
* Replace the token found with the appropriate file contents
* @param array $matches Array of 1 el containing key to search for.
* @return string Text with which to replace key or value of key if none is found.
* @access private
*/
private function replaceTokenCallback($matches) {
$filetoken = $matches[1];
// We look in all specified directories for the named file and use
// the first directory which has the file.
$dirs = explode(';',$this->_dir);
$ndirs = count($dirs);
$n = 0;
$file = $dirs[$n] . $this->_prefix . $filetoken . $this->_postfix;
while ( $n < $ndirs && ! is_readable($file) ) {
++$n;
}
if( ! is_readable($file) || $n >= $ndirs ) {
$this->log("Can not read or find file \"$file\". Searched in directories: {$this->_dir}", Project::MSG_WARN);
//return $this->_beginToken . $filetoken . $this->_endToken;
return "[Phing::Filters::ReplaceTokensWithFile: Can not find file " . '"' . $filetoken . $this->_postfix . '"' . "]";
}
$buffer = file_get_contents($file);
if( $this->_translatehtml ) {
$buffer = htmlentities($buffer);
}
if ($buffer === null) {
$buffer = $this->_beginToken . $filetoken . $this->_endToken;
$this->log("No corresponding file found for key \"$buffer\"", Project::MSG_WARN);
} else {
$this->log("Replaced \"".$this->_beginToken . $filetoken . $this->_endToken."\" with content from file \"$file\"");
}
return $buffer;
}
/**
* Returns stream with tokens having been replaced with appropriate values.
* If a replacement value is not found for a token, the token is left in the stream.
*
* @return mixed filtered stream, -1 on EOF.
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
// read from next filter up the chain
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// filter buffer
$buffer = preg_replace_callback(
"/".preg_quote($this->_beginToken)."([\w\.\-:\/]+?)".preg_quote($this->_endToken)."/",
array($this, 'replaceTokenCallback'), $buffer);
return $buffer;
}
/**
* Creates a new ReplaceTokensWithFile using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new ReplaceTokensWithFile($reader);
$newFilter->setProject($this->getProject());
$newFilter->setTranslateHTML($this->getTranslateHTML());
$newFilter->setDir($this->getDir());
$newFilter->setPrefix($this->getPrefix());
$newFilter->setPostfix($this->getPostfix());
$newFilter->setBeginToken($this->getBeginToken());
$newFilter->setEndToken($this->getEndToken());
$newFilter->setInitialized(true);
return $newFilter;
}
/**
* Initializes parameters
* This method is only called when this filter is used through
* a <filterreader> tag in build file.
*/
private function _initialize() {
$params = $this->getParameters();
$n = count($params);
if ( $params !== null ) {
for($i = 0 ; $i < $n ; $i++) {
if ( $params[$i] !== null ) {
$name = $params[$i]->getName();
switch( $name ) {
case 'begintoken' :
$this->_beginToken = $params[$i]->getValue();
break;
case 'endtoken' :
$this->_endToken = $params[$i]->getValue();
break;
case 'dir':
$this->_dir = $params[$i]->getValue();
break;
case 'prefix':
$this->_prefix = $params[$i]->getValue();
break;
case 'postfix':
$this->_postfix = $params[$i]->getValue();
break;
case 'translatehtml':
$this->_translatehtml = $params[$i]->getValue();
break;
}
}
}
}
}
}

View File

@@ -0,0 +1,148 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Filter to flatten the stream to a single line.
*
* Example:
*
* <pre><striplinebreaks/></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.StripLineBreaks"/></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see BaseParamFilterReader
* @package phing.filters
*/
class StripLineBreaks extends BaseParamFilterReader implements ChainableReader {
/**
* Default line-breaking characters.
* @var string
*/
const DEFAULT_LINE_BREAKS = "\r\n";
/**
* Parameter name for the line-breaking characters parameter.
* @var string
*/
const LINES_BREAKS_KEY = "linebreaks";
/**
* The characters that are recognized as line breaks.
* @var string
*/
private $_lineBreaks = "\r\n"; // self::DEFAULT_LINE_BREAKS;
/**
* Returns the filtered stream, only including
* characters not in the set of line-breaking characters.
*
* @return mixed the resulting stream, or -1
* if the end of the resulting stream has been reached.
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
$buffer = preg_replace("/[".$this->_lineBreaks."]/", '', $buffer);
return $buffer;
}
/**
* Sets the line-breaking characters.
*
* @param string $lineBreaks A String containing all the characters to be
* considered as line-breaking.
*/
function setLineBreaks($lineBreaks) {
$this->_lineBreaks = (string) $lineBreaks;
}
/**
* Gets the line-breaking characters.
*
* @return string A String containing all the characters that are considered as line-breaking.
*/
function getLineBreaks() {
return $this->_lineBreaks;
}
/**
* Creates a new StripLineBreaks using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new StripLineBreaks($reader);
$newFilter->setLineBreaks($this->getLineBreaks());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Parses the parameters to set the line-breaking characters.
*/
private function _initialize() {
$userDefinedLineBreaks = null;
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0 ; $i<count($params) ; $i++) {
if ( self::LINE_BREAKS_KEY === $params[$i]->getName() ) {
$userDefinedLineBreaks = $params[$i]->getValue();
break;
}
}
}
if ( $userDefinedLineBreaks !== null ) {
$this->_lineBreaks = $userDefinedLineBreaks;
}
}
}

View File

@@ -0,0 +1,207 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* This filter strips line comments.
*
* Example:
*
* <pre><striplinecomments>
* <comment value="#"/>
* <comment value="--"/>
* <comment value="REM "/>
* <comment value="rem "/>
* <comment value="//"/>
* </striplinecomments></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.StripLineComments">
* <param type="comment" value="#"/>
* <param type="comment" value="--"/>
* <param type="comment" value="REM "/>
* <param type="comment" value="rem "/>
* <param type="comment" value="//"/>
* </filterreader></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see BaseParamFilterReader
* @package phing.filters
*/
class StripLineComments extends BaseParamFilterReader implements ChainableReader {
/** Parameter name for the comment prefix. */
const COMMENTS_KEY = "comment";
/** Array that holds the comment prefixes. */
private $_comments = array();
/**
* Returns stream only including
* lines from the original stream which don't start with any of the
* specified comment prefixes.
*
* @return mixed the resulting stream, or -1
* if the end of the resulting stream has been reached.
*
* @throws IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if ($buffer === -1) {
return -1;
}
$lines = explode("\n", $buffer);
$filtered = array();
$commentsSize = count($this->_comments);
foreach($lines as $line) {
for($i = 0; $i < $commentsSize; $i++) {
$comment = $this->_comments[$i]->getValue();
if ( StringHelper::startsWith($comment, ltrim($line)) ) {
$line = null;
break;
}
}
if ($line !== null) {
$filtered[] = $line;
}
}
$filtered_buffer = implode("\n", $filtered);
return $filtered_buffer;
}
/*
* Adds a <code>comment</code> element to the list of prefixes.
*
* @return comment The <code>comment</code> element added to the
* list of comment prefixes to strip.
*/
function createComment() {
$num = array_push($this->_comments, new Comment());
return $this->_comments[$num-1];
}
/*
* Sets the list of comment prefixes to strip.
*
* @param comments A list of strings, each of which is a prefix
* for a comment line. Must not be <code>null</code>.
*/
function setComments($lineBreaks) {
if (!is_array($lineBreaks)) {
throw new Exception("Excpected 'array', got something else");
}
$this->_comments = $lineBreaks;
}
/*
* Returns the list of comment prefixes to strip.
*
* @return array The list of comment prefixes to strip.
*/
function getComments() {
return $this->_comments;
}
/*
* Creates a new StripLineComments using the passed in
* Reader for instantiation.
*
* @param reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new StripLineComments($reader);
$newFilter->setComments($this->getComments());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/*
* Parses the parameters to set the comment prefixes.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0 ; $i<count($params) ; $i++) {
if ( self::COMMENTS_KEY === $params[$i]->getType() ) {
$comment = new Comment();
$comment->setValue($params[$i]->getValue());
array_push($this->_comments, $comment);
}
}
}
}
}
/**
* The class that holds a comment representation.
*
* @package phing.filters
*/
class Comment {
/** The prefix for a line comment. */
private $_value;
/*
* Sets the prefix for this type of line comment.
*
* @param string $value The prefix for a line comment of this type.
* Must not be <code>null</code>.
*/
function setValue($value) {
$this->_value = (string) $value;
}
/*
* Returns the prefix for this type of line comment.
*
* @return string The prefix for this type of line comment.
*/
function getValue() {
return $this->_value;
}
}

View File

@@ -0,0 +1,188 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* This is a Php comment and string stripper reader that filters
* those lexical tokens out for purposes of simple Php parsing.
* (if you have more complex Php parsing needs, use a real lexer).
* Since this class heavily relies on the single char read function,
* you are reccomended to make it work on top of a buffered reader.
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @version $Id$
* @access public
* @see FilterReader
* @package phing.filters
*/
class StripPhpComments extends BaseFilterReader implements ChainableReader {
/**
* The read-ahead character, used for effectively pushing a single
* character back. -1 indicates that no character is in the buffer.
*/
private $_readAheadCh = -1;
/**
* Whether or not the parser is currently in the middle of a string
* literal.
* @var boolean
*/
private $_inString = false;
/**
* Returns the stream without Php comments.
*
* @return the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @throws IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// This regex replace /* */ and // style comments
$buffer = preg_replace('/\/\*[^*]*\*+([^\/*][^*]*\*+)*\/|\/\/[^\n]*|("(\\\\.|[^"\\\\])*"|\'(\\\\.|[^\'\\\\])*\'|.[^\/"\'\\\\]*)/s', "$2", $buffer);
// The regex above is not identical to, but is based on the expression below:
//
// created by Jeffrey Friedl
// and later modified by Fred Curtis.
// s{
// /\* ## Start of /* ... */ comment
// [^*]*\*+ ## Non-* followed by 1-or-more *'s
// (
// [^/*][^*]*\*+
// )* ## 0-or-more things which don't start with /
// ## but do end with '*'
// / ## End of /* ... */ comment
//
// | ## OR various things which aren't comments:
//
// (
// " ## Start of " ... " string
// (
// \\. ## Escaped char
// | ## OR
// [^"\\] ## Non "\
// )*
// " ## End of " ... " string
//
// | ## OR
//
// ' ## Start of ' ... ' string
// (
// \\. ## Escaped char
// | ## OR
// [^'\\] ## Non '\
// )*
// ' ## End of ' ... ' string
//
// | ## OR
//
// . ## Anything other char
// [^/"'\\]* ## Chars which doesn't start a comment, string or escape
// )
// }{$2}gxs;
return $buffer;
}
/*
* Returns the next character in the filtered stream, not including
* Php comments.
*
* @return the next character in the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @throws IOException if the underlying stream throws an IOException
* during reading
* @deprecated
*/
function readChar() {
$ch = -1;
if ( $this->_readAheadCh !== -1 ) {
$ch = $this->_readAheadCh;
$this->_readAheadCh = -1;
} else {
$ch = $this->in->readChar();
if ( $ch === "\"" ) {
$this->_inString = !$this->_inString;
} else {
if ( !$this->_inString ) {
if ( $ch === "/" ) {
$ch = $this->in->readChar();
if ( $ch === "/" ) {
while ( $ch !== "\n" && $ch !== -1 ) {
$ch = $this->in->readChar();
}
} else if ( $ch === "*" ) {
while ( $ch !== -1 ) {
$ch = $this->in->readChar();
while ( $ch === "*" && $ch !== -1 ) {
$ch = $this->in->readChar();
}
if ( $ch === "/" ) {
$ch = $this->readChar();
echo "$ch\n";
break;
}
}
} else {
$this->_readAheadCh = $ch;
$ch = "/";
}
}
}
}
}
return $ch;
}
/**
* Creates a new StripPhpComments using the passed in
* Reader for instantiation.
*
* @param reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new StripPhpComments($reader);
$newFilter->setProject($this->getProject());
return $newFilter;
}
}

View File

@@ -0,0 +1,95 @@
<?php
/*
* $Id $
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Strips whitespace from [php] files using PHP stripwhitespace() method.
*
* @author Hans Lellelid, hans@velum.net
* @version $Id$
* @see FilterReader
* @package phing.filters
* @todo -c use new PHP functions to perform this instead of regex.
*/
class StripWhitespace extends BaseFilterReader implements ChainableReader {
private $processed = false;
/**
* Returns the stream without Php comments and whitespace.
*
* @return the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @throws IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if ($this->processed === true) {
return -1; // EOF
}
// Read XML
$php = null;
while ( ($buffer = $this->in->read($len)) !== -1 ) {
$php .= $buffer;
}
if ($php === null ) { // EOF?
return -1;
}
if(empty($php)) {
$this->log("PHP file is empty!", Project::MSG_WARN);
return ''; // return empty string, don't attempt to strip whitespace
}
// write buffer to a temporary file, since php_strip_whitespace() needs a filename
$file = new PhingFile(tempnam(PhingFile::getTempDir(), 'stripwhitespace'));
file_put_contents($file->getAbsolutePath(), $php);
$output = php_strip_whitespace($file->getAbsolutePath());
unlink($file->getAbsolutePath());
$this->processed = true;
return $output;
}
/**
* Creates a new StripWhitespace using the passed in
* Reader for instantiation.
*
* @param reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
public function chain(Reader $reader) {
$newFilter = new StripWhitespace($reader);
$newFilter->setProject($this->getProject());
return $newFilter;
}
}

View File

@@ -0,0 +1,144 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/filters/BaseParamFilterReader.php';
require_once 'phing/filters/ChainableReader.php';
/**
* Converts tabs to spaces.
*
* Example:
*
* <pre><tabtospaces tablength="8"></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.TabsToSpaces">
* <param name="tablength" value="8">
* </filterreader></pre>
*
* @author Yannick Lecaillez <yl@seasonfive.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BaseParamFilterReader
* @package phing.filters
*/
class TabToSpaces extends BaseParamFilterReader implements ChainableReader {
/**
* The default tab length.
* @var int
*/
const DEFAULT_TAB_LENGTH = 8;
/**
* Parameter name for the length of a tab.
* @var string
*/
const TAB_LENGTH_KEY = "tablength";
/**
* Tab length in this filter.
* @var int
*/
private $tabLength = 8; //self::DEFAULT_TAB_LENGTH;
/**
* Returns stream after converting tabs to the specified number of spaces.
*
* @return the resulting stream, or -1
* if the end of the resulting stream has been reached
*
* @exception IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
$buffer = str_replace("\t", str_repeat(' ', $this->tabLength), $buffer);
return $buffer;
}
/**
* Sets the tab length.
*
* @param int $tabLength The number of spaces to be used when converting a tab.
*/
function setTablength($tabLength) {
$this->tabLength = (int) $tabLength;
}
/**
* Returns the tab length.
*
* @return int The number of spaces used when converting a tab
*/
function getTablength() {
return $this->tabLength;
}
/**
* Creates a new TabsToSpaces using the passed in
* Reader for instantiation.
*
* @param Reader $reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return Reader A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new TabToSpaces($reader);
$newFilter->setTablength($this->getTablength());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Parses the parameters to set the tab length.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0 ; $i<count($params) ; $i++) {
if (self::TAB_LENGTH_KEY === $params[$i]->getName()) {
$this->tabLength = $params[$i]->getValue();
break;
}
}
}
}
}

View File

@@ -0,0 +1,157 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/filters/BaseParamFilterReader.php';
/**
* Reads the last <code>n</code> lines of a stream. (Default is last10 lines.)
*
* Example:
*
* <pre><tailfilter lines="3" /></pre>
*
* Or:
*
* <pre><filterreader classname="phing.filters.TailFilter">
* <param name="lines" value="3">
* </filterreader></pre>
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @author hans lellelid, hans@velum.net
* @copyright 2003 seasonfive. All rights reserved
* @version $Id$
* @see BaseParamFilterReader
* @package phing.filters
*/
class TailFilter extends BaseParamFilterReader implements ChainableReader {
/**
* Parameter name for the number of lines to be returned.
* @var string
*/
const LINES_KEY = "lines";
/**
* Number of lines to be returned in the filtered stream.
* @var integer
*/
private $_lines = 10;
/**
* Array to hold lines.
* @var array
*/
private $_lineBuffer = array();
/**
* Returns the last n lines of a file.
* @param int $len Num chars to read.
* @return mixed The filtered buffer or -1 if EOF.
*/
function read($len = null) {
while ( ($buffer = $this->in->read($len)) !== -1 ) {
// Remove the last "\n" from buffer for
// prevent explode to add an empty cell at
// the end of array
$buffer= trim($buffer, "\n");
$lines = explode("\n", $buffer);
if ( count($lines) >= $this->_lines ) {
// Buffer have more (or same) number of lines than needed.
// Fill lineBuffer with the last "$this->_lines" lasts ones.
$off = count($lines)-$this->_lines;
$this->_lineBuffer = array_slice($lines, $off);
} else {
// Some new lines ...
// Prepare space for insert these new ones
$this->_lineBuffer = array_slice($this->_lineBuffer, count($lines)-1);
$this->_lineBuffer = array_merge($this->_lineBuffer, $lines);
}
}
if ( empty($this->_lineBuffer) )
$ret = -1;
else {
$ret = implode("\n", $this->_lineBuffer);
$this->_lineBuffer = array();
}
return $ret;
}
/**
* Sets the number of lines to be returned in the filtered stream.
*
* @param integer $lines the number of lines to be returned in the filtered stream.
*/
function setLines($lines) {
$this->_lines = (int) $lines;
}
/**
* Returns the number of lines to be returned in the filtered stream.
*
* @return integer The number of lines to be returned in the filtered stream.
*/
function getLines() {
return $this->_lines;
}
/**
* Creates a new TailFilter using the passed in
* Reader for instantiation.
*
* @param object A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return object A new filter based on this configuration, but filtering
* the specified reader.
*/
function chain(Reader $reader) {
$newFilter = new TailFilter($reader);
$newFilter->setLines($this->getLines());
$newFilter->setInitialized(true);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Scans the parameters list for the "lines" parameter and uses
* it to set the number of lines to be returned in the filtered stream.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i=0, $_i=count($params); $i < $_i; $i++) {
if ( self::LINES_KEY == $params[$i]->getName() ) {
$this->_lines = (int) $params[$i]->getValue();
break;
}
}
}
}
}

View File

@@ -0,0 +1,162 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* This filter uses the bundled-with-PHP Tidy extension to filter input.
*
* <p>
* Example:<br/>
* <pre>
* <tidyfilter encoding="utf8">
* <config name="indent" value="true"/>
* <config name="output-xhtml" value="true"/>
* </tidyfilter>
* </pre>
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.filters
*/
class TidyFilter extends BaseParamFilterReader implements ChainableReader {
/** @var string Encoding of resulting document. */
private $encoding = 'utf8';
/** @var array Parameter[] */
private $configParameters = array();
/**
* Set the encoding for resulting (X)HTML document.
* @param string $v
*/
public function setEncoding($v) {
$this->encoding = $v;
}
/**
* Sets the config params.
* @param array Parameter[]
* @see chain()
*/
public function setConfigParameters($params)
{
$this->configParameters = $params;
}
/**
* Adds a <config> element (which is a Parameter).
* @return Parameter
*/
public function createConfig() {
$num = array_push($this->configParameters, new Parameter());
return $this->configParameters[$num-1];
}
/**
* Converts the Parameter objects being used to store configuration into a simle assoc array.
* @return array
*/
private function getDistilledConfig() {
$config = array();
foreach($this->configParameters as $p) {
$config[$p->getName()] = $p->getValue();
}
return $config;
}
/**
* Reads input and returns Tidy-filtered output.
*
* @return the resulting stream, or -1 if the end of the resulting stream has been reached
*
* @throws IOException if the underlying stream throws an IOException
* during reading
*/
function read($len = null) {
if (!class_exists('Tidy')) {
throw new BuildException("You must enable the 'tidy' extension in your PHP configuration in order to use the Tidy filter.");
}
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
$config = $this->getDistilledConfig();
$tidy = new Tidy();
$tidy->parseString($buffer, $config, $this->encoding);
$tidy->cleanRepair();
return tidy_get_output($tidy);
}
/**
* Creates a new TidyFilter using the passed in Reader for instantiation.
*
* @param reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return a new filter based on this configuration, but filtering
* the specified reader
*/
public function chain(Reader $reader) {
$newFilter = new TidyFilter($reader);
$newFilter->setConfigParameters($this->configParameters);
$newFilter->setEncoding($this->encoding);
$newFilter->setProject($this->getProject());
return $newFilter;
}
/**
* Initializes any parameters (e.g. config options).
* This method is only called when this filter is used through a <filterreader> tag in build file.
*/
private function _initialize() {
$params = $this->getParameters();
if ($params) {
foreach($params as $param) {
if ($param->getType() == "config") {
$this->configParameters[] = $param;
} else {
if ($param->getName() == "encoding") {
$this->setEncoding($param->getValue());
}
}
}
}
}
}

View File

@@ -0,0 +1,285 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Replaces gettext("message id") and _("message id") with the translated string.
*
* Gettext is great for creating multi-lingual sites, but in some cases (e.g. for
* performance reasons) you may wish to replace the gettext calls with the translations
* of the strings; that's what this task is for. Note that this is similar to
* ReplaceTokens, but both the find and the replace aspect is more complicated -- hence
* this is a separate, stand-alone filter.
*
* <p>
* Example:<br>
* <pre>
* <translategettext locale="en_US" domain="messages" dir="${webroot}/local"/>
* </pre>
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @access public
* @see BaseFilterReader
* @package phing.filters
*/
class TranslateGettext extends BaseParamFilterReader implements ChainableReader {
// constants for specifying keys to expect
// when this is called using <filterreader ... />
const DOMAIN_KEY = "domain";
const DIR_KEY = "dir";
const LOCALE_KEY = "locale";
/** The domain to use */
private $domain = 'messages';
/** The dir containing LC_MESSAGES */
private $dir;
/** The locale to use */
private $locale;
/** The system locale before it was changed for this filter. */
private $storedLocale;
/**
* Set the text domain to use.
* The text domain must correspond to the name of the compiled .mo files.
* E.g. "messages" ==> $dir/LC_MESSAGES/messages.mo
* "mydomain" ==> $dir/LC_MESSAGES/mydomain.mo
* @param string $domain
*/
function setDomain($domain) {
$this->domain = $domain;
}
/**
* Get the current domain.
* @return string
*/
function getDomain() {
return $this->domain;
}
/**
* Sets the root locale directory.
* @param PhingFile $dir
*/
function setDir(PhingFile $dir) {
$this->dir = $dir;
}
/**
* Gets the root locale directory.
* @return PhingFile
*/
function getDir() {
return $this->dir;
}
/**
* Sets the locale to use for translation.
* Note that for gettext() to work, you have to make sure this locale
* is specific enough for your system (e.g. some systems may allow an 'en' locale,
* but others will require 'en_US', etc.).
* @param string $locale
*/
function setLocale($locale) {
$this->locale = $locale;
}
/**
* Gets the locale to use for translation.
* @return string
*/
function getLocale() {
return $this->locale;
}
/**
* Make sure that required attributes are set.
* @throws BuldException - if any required attribs aren't set.
*/
protected function checkAttributes() {
if (!$this->domain || !$this->locale || !$this->dir) {
throw new BuildException("You must specify values for domain, locale, and dir attributes.");
}
}
/**
* Initialize the gettext/locale environment.
* This method will change some env vars and locale settings; the
* restoreEnvironment should put them all back :)
*
* @return void
* @throws BuildException - if locale cannot be set.
* @see restoreEnvironment()
*/
protected function initEnvironment() {
$this->storedLocale = getenv("LANG");
$this->log("Setting locale to " . $this->locale, Project::MSG_DEBUG);
putenv("LANG=".$this->locale);
$ret = setlocale(LC_ALL, $this->locale);
if ($ret === false) {
$msg = "Could not set locale to " . $this->locale
. ". You may need to use fully qualified name"
. " (e.g. en_US instead of en).";
throw new BuildException($msg);
}
$this->log("Binding domain '".$this->domain."' to " . $this->dir, Project::MSG_DEBUG);
bindtextdomain($this->domain, $this->dir->getAbsolutePath());
textdomain($this->domain);
}
/**
* Restores environment settings and locale.
* This does _not_ restore any gettext-specific settings
* (e.g. textdomain()).
*
* @return void
*/
protected function restoreEnvironment() {
putenv("LANG=".$this->storedLocale);
setlocale(LC_ALL, $this->storedLocale);
}
/**
* Performs gettext translation of msgid and returns translated text.
*
* This function simply wraps gettext() call, but provides ability to log
* string replacements. (alternative would be using preg_replace with /e which
* would probably be faster, but no ability to debug/log.)
*
* @param array $matches Array of matches; we're interested in $matches[2].
* @return string Translated text
*/
private function xlateStringCallback($matches) {
$charbefore = $matches[1];
$msgid = $matches[2];
$translated = gettext($msgid);
$this->log("Translating \"$msgid\" => \"$translated\"", Project::MSG_DEBUG);
return $charbefore . '"' . $translated . '"';
}
/**
* Returns the filtered stream.
* The original stream is first read in fully, and then translation is performed.
*
* @return mixed the filtered stream, or -1 if the end of the resulting stream has been reached.
*
* @throws IOException - if the underlying stream throws an IOException during reading
* @throws BuildException - if the correct params are not supplied
*/
function read($len = null) {
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
// Make sure correct params/attribs have been set
$this->checkAttributes();
$buffer = $this->in->read($len);
if($buffer === -1) {
return -1;
}
// Setup the locale/gettext environment
$this->initEnvironment();
// replace any occurrences of _("") or gettext("") with
// the translated value.
//
// ([^\w]|^)_\("((\\"|[^"])*)"\)
// --$1--- -----$2----
// ---$3-- [match escaped quotes or any char that's not a quote]
//
// also match gettext() -- same as above
$buffer = preg_replace_callback('/([^\w]|^)_\("((\\\"|[^"])*)"\)/', array($this, 'xlateStringCallback'), $buffer);
$buffer = preg_replace_callback('/([^\w]|^)gettext\("((\\\"|[^"])*)"\)/', array($this, 'xlateStringCallback'), $buffer);
// Check to see if there are any _('') calls and flag an error
// Check to see if there are any unmatched gettext() calls -- and flag an error
$matches = array();
if (preg_match('/([^\w]|^)(gettext\([^\)]+\))/', $buffer, $matches)) {
$this->log("Unable to perform translation on: " . $matches[2], Project::MSG_WARN);
}
$this->restoreEnvironment();
return $buffer;
}
/**
* Creates a new TranslateGettext filter using the passed in
* Reader for instantiation.
*
* @param Reader $reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return TranslateGettext A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new TranslateGettext($reader);
$newFilter->setProject($this->getProject());
$newFilter->setDomain($this->getDomain());
$newFilter->setLocale($this->getLocale());
$newFilter->setDir($this->getDir());
return $newFilter;
}
/**
* Parses the parameters if this filter is being used in "generic" mode.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
foreach($params as $param) {
switch($param->getType()) {
case self::DOMAIN_KEY:
$this->setDomain($param->getValue());
break;
case self::DIR_KEY:
$this->setDir($this->project->resolveFile($param->getValue()));
break;
case self::LOCALE_KEY:
$this->setLocale($param->getValue());
break;
} // switch
}
} // if params !== null
}
}

View File

@@ -0,0 +1,176 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Applies Xinclude parsing to incoming text.
*
* Uses PHP DOM XML support
*
* @author Bill Karwin <bill@karwin.com>
* @version $Id$
* @see FilterReader
* @package phing.filters
*/
class XincludeFilter extends BaseParamFilterReader implements ChainableReader {
private $basedir = null;
/**
* @var bool
*/
private $processed = false;
/**
* Whether to resolve entities.
*
* @var bool
*
* @since 2.4
*/
private $resolveExternals = false;
/**
* Whether to resolve entities.
*
* @param $resolveExternals
*
* @since 2.4
*/
public function setResolveExternals($resolveExternals)
{
$this->resolveExternals = (bool)$resolveExternals;
}
/**
* @return bool
*
* @since 2.4
*/
public function getResolveExternals()
{
return $this->resolveExternals;
}
public function setBasedir(PhingFile $dir)
{
$this->basedir = $dir;
}
public function getBasedir()
{
return $this->basedir;
}
/**
* Reads stream, applies XSLT and returns resulting stream.
* @return string transformed buffer.
* @throws BuildException - if XSLT support missing, if error in xslt processing
*/
function read($len = null) {
if (!class_exists('DomDocument')) {
throw new BuildException("Could not find the DomDocument class. Make sure PHP has been compiled/configured to support DOM XML.");
}
if ($this->processed === true) {
return -1; // EOF
}
// Read XML
$_xml = null;
while ( ($data = $this->in->read($len)) !== -1 )
$_xml .= $data;
if ($_xml === null ) { // EOF?
return -1;
}
if (empty($_xml)) {
$this->log("XML file is empty!", Project::MSG_WARN);
return '';
}
$this->log("Transforming XML " . $this->in->getResource() . " using Xinclude ", Project::MSG_VERBOSE);
$out = '';
try {
$out = $this->process($_xml);
$this->processed = true;
} catch (IOException $e) {
throw new BuildException($e);
}
return $out;
}
/**
* Try to process the Xinclude transformation
*
* @param string XML to process.
*
* @throws BuildException On errors
*/
protected function process($xml) {
if ($this->basedir) {
$cwd = getcwd();
chdir($this->basedir);
}
// Create and setup document.
$xmlDom = new DomDocument();
$xmlDom->resolveExternals = $this->resolveExternals;
$xmlDom->loadXML($xml);
$xmlDom->xinclude();
if ($this->basedir) {
chdir($cwd);
}
return $xmlDom->saveXML();
}
/**
* Creates a new XincludeFilter using the passed in
* Reader for instantiation.
*
* @param Reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return Reader A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new XincludeFilter($reader);
$newFilter->setProject($this->getProject());
$newFilter->setBasedir($this->getBasedir());
return $newFilter;
}
}

View File

@@ -0,0 +1,415 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/filters/BaseParamFilterReader.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Applies XSL stylesheet to incoming text.
*
* Uses PHP XSLT support (libxslt).
*
* @author Hans Lellelid <hans@velum.net>
* @author Yannick Lecaillez <yl@seasonfive.com>
* @author Andreas Aderhold <andi@binarycloud.com>
* @version $Id$
* @see FilterReader
* @package phing.filters
*/
class XsltFilter extends BaseParamFilterReader implements ChainableReader {
/**
* Path to XSL stylesheet.
* @var string
*/
private $xslFile = null;
/**
* Whether XML file has been transformed.
* @var boolean
*/
private $processed = false;
/**
* XSLT Params.
* @var array
*/
private $xsltParams = array();
/**
* Whether to use loadHTML() to parse the input XML file.
*/
private $html = false;
/**
* Whether to resolve entities in the XML document (see
* {@link http://www.php.net/manual/en/class.domdocument.php#domdocument.props.resolveexternals}
* for more details).
*
* @var bool
*
* @since 2.4
*/
private $resolveDocumentExternals = false;
/**
* Whether to resolve entities in the stylesheet.
*
* @var bool
*
* @since 2.4
*/
private $resolveStylesheetExternals = false;
/**
* Create new XSLT Param object, to handle the <param/> nested element.
* @return XSLTParam
*/
function createParam() {
$num = array_push($this->xsltParams, new XSLTParam());
return $this->xsltParams[$num-1];
}
/**
* Sets the XSLT params for this class.
* This is used to "clone" this class, in the chain() method.
* @param array $params
*/
function setParams($params) {
$this->xsltParams = $params;
}
/**
* Returns the XSLT params set for this class.
* This is used to "clone" this class, in the chain() method.
* @return array
*/
function getParams() {
return $this->xsltParams;
}
/**
* Set the XSLT stylesheet.
* @param mixed $file PhingFile object or path.
*/
function setStyle(PhingFile $file) {
$this->xslFile = $file;
}
/**
* Whether to use HTML parser for the XML.
* This is supported in libxml2 -- Yay!
* @return boolean
*/
function getHtml() {
return $this->html;
}
/**
* Whether to use HTML parser for XML.
* @param boolean $b
*/
function setHtml($b) {
$this->html = (boolean) $b;
}
/**
* Get the path to XSLT stylesheet.
* @return mixed XSLT stylesheet path.
*/
function getStyle() {
return $this->xslFile;
}
/**
* Whether to resolve entities in document.
*
* @param bool $resolveExternals
*
* @since 2.4
*/
function setResolveDocumentExternals($resolveExternals) {
$this->resolveDocumentExternals = (bool)$resolveExternals;
}
/**
* @return bool
*
* @since 2.4
*/
function getResolveDocumentExternals() {
return $this->resolveDocumentExternals;
}
/**
* Whether to resolve entities in stylesheet.
*
* @param bool $resolveExternals
*
* @since 2.4
*/
function setResolveStylesheetExternals($resolveExternals) {
$this->resolveStylesheetExternals = (bool)$resolveExternals;
}
/**
* @return bool
*
* @since 2.4
*/
function getResolveStylesheetExternals() {
return $this->resolveStylesheetExternals;
}
/**
* Reads stream, applies XSLT and returns resulting stream.
* @return string transformed buffer.
* @throws BuildException - if XSLT support missing, if error in xslt processing
*/
function read($len = null) {
if (!class_exists('XSLTProcessor')) {
throw new BuildException("Could not find the XSLTProcessor class. Make sure PHP has been compiled/configured to support XSLT.");
}
if ($this->processed === true) {
return -1; // EOF
}
if ( !$this->getInitialized() ) {
$this->_initialize();
$this->setInitialized(true);
}
// Read XML
$_xml = null;
while ( ($data = $this->in->read($len)) !== -1 )
$_xml .= $data;
if ($_xml === null ) { // EOF?
return -1;
}
if(empty($_xml)) {
$this->log("XML file is empty!", Project::MSG_WARN);
return ''; // return empty string, don't attempt to apply XSLT
}
// Read XSLT
$_xsl = null;
$xslFr = new FileReader($this->xslFile);
$xslFr->readInto($_xsl);
$this->log("Tranforming XML " . $this->in->getResource() . " using style " . $this->xslFile->getPath(), Project::MSG_VERBOSE);
$out = '';
try {
$out = $this->process($_xml, $_xsl);
$this->processed = true;
} catch (IOException $e) {
throw new BuildException($e);
}
return $out;
}
// {{{ method _ProcessXsltTransformation($xml, $xslt) throws BuildException
/**
* Try to process the XSLT transformation
*
* @param string XML to process.
* @param string XSLT sheet to use for the processing.
*
* @throws BuildException On XSLT errors
*/
protected function process($xml, $xsl) {
$processor = new XSLTProcessor();
// Create and setup document.
$xmlDom = new DOMDocument();
$xmlDom->resolveExternals = $this->resolveDocumentExternals;
// Create and setup stylesheet.
$xslDom = new DOMDocument();
$xslDom->resolveExternals = $this->resolveStylesheetExternals;
if ($this->html) {
$xmlDom->loadHTML($xml);
} else {
$xmlDom->loadXML($xml);
}
$xslDom->loadxml($xsl);
if (defined('XSL_SECPREF_WRITE_FILE')) {
if (version_compare(PHP_VERSION,'5.4',"<")) {
ini_set("xsl.security_prefs", XSL_SECPREF_WRITE_FILE | XSL_SECPREF_CREATE_DIRECTORY);
} else {
$proc->setSecurityPrefs(XSL_SECPREF_WRITE_FILE | XSL_SECPREF_CREATE_DIRECTORY);
}
}
$processor->importStylesheet($xslDom);
// ignoring param "type" attrib, because
// we're only supporting direct XSL params right now
foreach($this->xsltParams as $param) {
$this->log("Setting XSLT param: " . $param->getName() . "=>" . $param->getExpression(), Project::MSG_DEBUG);
$processor->setParameter(null, $param->getName(), $param->getExpression());
}
$errorlevel = error_reporting();
error_reporting($errorlevel & ~E_WARNING);
@$result = $processor->transformToXML($xmlDom);
error_reporting($errorlevel);
if (false === $result) {
//$errno = xslt_errno($processor);
//$err = xslt_error($processor);
throw new BuildException("XSLT Error");
} else {
return $result;
}
}
/**
* Creates a new XsltFilter using the passed in
* Reader for instantiation.
*
* @param Reader A Reader object providing the underlying stream.
* Must not be <code>null</code>.
*
* @return Reader A new filter based on this configuration, but filtering
* the specified reader
*/
function chain(Reader $reader) {
$newFilter = new XsltFilter($reader);
$newFilter->setProject($this->getProject());
$newFilter->setStyle($this->getStyle());
$newFilter->setInitialized(true);
$newFilter->setParams($this->getParams());
$newFilter->setHtml($this->getHtml());
return $newFilter;
}
/**
* Parses the parameters to get stylesheet path.
*/
private function _initialize() {
$params = $this->getParameters();
if ( $params !== null ) {
for($i = 0, $_i=count($params) ; $i < $_i; $i++) {
if ( $params[$i]->getType() === null ) {
if ($params[$i]->getName() === "style") {
$this->setStyle($params[$i]->getValue());
}
} elseif ($params[$i]->getType() == "param") {
$xp = new XSLTParam();
$xp->setName($params[$i]->getName());
$xp->setExpression($params[$i]->getValue());
$this->xsltParams[] = $xp;
}
}
}
}
}
/**
* Class that holds an XSLT parameter.
*
* @package phing.filters
*/
class XSLTParam {
private $name;
private $expr;
/**
* Sets param name.
* @param string $name
*/
public function setName($name) {
$this->name = $name;
}
/**
* Get param name.
* @return string
*/
public function getName() {
return $this->name;
}
/**
* Sets expression value (alias to the setExpression()) method.
*
* @param string $v
* @see setExpression()
*/
public function setValue($v)
{
$this->setExpression($v);
}
/**
* Gets expression value (alias to the getExpression()) method.
*
* @param string $v
* @see getExpression()
*/
public function getValue()
{
return $this->getExpression();
}
/**
* Sets expression value.
* @param string $expr
*/
public function setExpression($expr) {
$this->expr = $expr;
}
/**
* Sets expression to dynamic register slot.
* @param RegisterSlot $expr
*/
public function setListeningExpression(RegisterSlot $expr) {
$this->expr = $expr;
}
/**
* Returns expression value -- performs lookup if expr is registerslot.
* @return string
*/
public function getExpression() {
if ($this->expr instanceof RegisterSlot) {
return $this->expr->getValue();
} else {
return $this->expr;
}
}
}

View File

@@ -0,0 +1,183 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/Project.php';
include_once 'phing/filters/BaseFilterReader.php';
include_once 'phing/types/PhingFilterReader.php';
include_once 'phing/types/FilterChain.php';
include_once 'phing/types/Parameter.php';
include_once 'phing/util/FileUtils.php';
include_once 'phing/util/StringHelper.php';
include_once 'phing/filters/ChainableReader.php';
/**
* Process a FilterReader chain.
*
* Here, the interesting method is 'getAssembledReader'.
* The purpose of this one is to create a simple Reader object which
* apply all filters on another primary Reader object.
*
* For example : In copyFile (phing.util.FileUtils) the primary Reader
* is a FileReader object (more accuratly, a BufferedReader) previously
* setted for the source file to copy. So, consider this filterchain :
*
* <filterchain>
* <stripphpcomments />
* <linecontains>
* <contains value="foo">
* </linecontains>
* <tabtospaces tablength="8" />
* </filterchain>
*
* getAssembledReader will return a Reader object wich read on each
* of these filters. Something like this : ('->' = 'which read data from') :
*
* [TABTOSPACES] -> [LINECONTAINS] -> [STRIPPHPCOMMENTS] -> [FILEREADER]
* (primary reader)
*
* So, getAssembledReader will return the TABTOSPACES Reader object. Then
* each read done with this Reader object will follow this path.
*
* Hope this explanation is clear :)
*
* TODO: Implement the classPath feature.
*
* @author <a href="mailto:yl@seasonfive.com">Yannick Lecaillez</a>
* @version $Id$
* @access public
* @package phing.filters.util
*/
class ChainReaderHelper {
/** Primary reader to wich the reader chain is to be attached */
private $primaryReader = null;
/** The site of the buffer to be used. */
private $bufferSize = 8192;
/** Chain of filters */
private $filterChains = array();
/** The Phing project */
private $project;
/*
* Sets the primary reader
*/
function setPrimaryReader(Reader $reader) {
$this->primaryReader = $reader;
}
/*
* Set the project to work with
*/
function setProject(Project $project) {
$this->project = $project;
}
/*
* Get the project
*/
function getProject() {
return $this->project;
}
/*
* Sets the buffer size to be used. Defaults to 8192,
* if this method is not invoked.
*/
function setBufferSize($size) {
$this->bufferSize = $size;
}
/*
* Sets the collection of filter reader sets
*/
function setFilterChains(&$fchain) {
$this->filterChains = &$fchain;
}
/*
* Assemble the reader
*/
function getAssembledReader() {
$instream = $this->primaryReader;
$filterReadersCount = count($this->filterChains);
$finalFilters = array();
// Collect all filter readers of all filter chains used ...
for($i = 0 ; $i<$filterReadersCount ; $i++) {
$filterchain = &$this->filterChains[$i];
$filterReaders = $filterchain->getFilterReaders();
$readerCount = count($filterReaders);
for($j = 0 ; $j<$readerCount ; $j++) {
$finalFilters[] = $filterReaders[$j];
}
}
// ... then chain the filter readers.
$filtersCount = count($finalFilters);
if ( $filtersCount > 0 ) {
for($i = 0 ; $i<$filtersCount ; $i++) {
$filter = $finalFilters[$i];
if ( $filter instanceof PhingFilterReader ) {
// This filter reader is an external class.
$className = $filter->getClassName();
$classpath = $filter->getClasspath();
$project = $filter->getProject();
if ( $className !== null ) {
$cls = Phing::import($className, $classpath);
$impl = new $cls();
}
if ( !($impl instanceof FilterReader) ) {
throw new Exception($className." does not extend phing.system.io.FilterReader");
}
$impl->setReader($instream); // chain
$impl->setProject($this->getProject()); // what about $project above ?
if ( $impl instanceof Parameterizable ) {
$impl->setParameters($filter->getParams());
}
$instream = $impl; // now that it's been chained
} elseif (($filter instanceof ChainableReader) && ($filter instanceof Reader)) {
if ( $this->getProject() !== null && ($filter instanceof BaseFilterReader) ) {
$filter->setProject($this->getProject());
}
$instream = $filter->chain($instream);
} else {
throw new Exception("Cannot chain invalid filter: " . get_class($filter));
}
}
}
return $instream;
}
}

View File

@@ -0,0 +1,97 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/types/TokenReader.php';
include_once 'phing/system/io/IOException.php';
include_once 'phing/filters/ReplaceTokens.php'; // For class Token
/**
* Class that allows reading tokens from INI files.
*
* @author Manuel Holtgewe
* @version $Id$
* @package phing.filters.util
*/
class IniFileTokenReader extends TokenReader {
/**
* Holds the path to the INI file that is to be read.
* @var object Reference to a PhingFile Object representing
* the path to the INI file.
*/
private $file = null;
/**
* @var string Sets the section to load from the INI file.
* if omitted, all sections are loaded.
*/
private $section = null;
/**
* Reads the next token from the INI file
*
* @throws IOException On error
* @return Token
*/
function readToken() {
if ($this->file === null) {
throw new BuildException("No File set for IniFileTokenReader");
}
static $tokens = null;
if ($tokens === null) {
$tokens = array();
$arr = parse_ini_file($this->file->getAbsolutePath(), true);
if ($this->section === null) {
foreach ($arr as $sec_name => $values) {
foreach($arr[$sec_name] as $key => $value) {
$tok = new Token;
$tok->setKey($key);
$tok->setValue($value);
$tokens[] = $tok;
}
}
} else if (isset($arr[$this->section])) {
foreach ($arr[$this->section] as $key => $value) {
$tok = new Token;
$tok->setKey($key);
$tok->setValue($value);
$tokens[] = $tok;
}
}
}
if (count($tokens) > 0) {
return array_pop($tokens);
} else
return null;
}
function setFile(PhingFile $file) {
$this->file = $file;
}
function setSection($str) {
$this->section = (string) $str;
}
}

View File

@@ -0,0 +1,85 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/input/InputHandler.php';
include_once 'phing/system/io/ConsoleReader.php';
/**
* Prompts using print(); reads input from Console.
*
* @author Hans Lellelid <hans@xmpl.org> (Phing)
* @author Stefan Bodewig <stefan.bodewig@epost.de> (Ant)
* @version $Id$
* @package phing.input
*/
class DefaultInputHandler implements InputHandler {
/**
* Prompts and requests input. May loop until a valid input has
* been entered.
* @throws BuildException
*/
public function handleInput(InputRequest $request) {
$prompt = $this->getPrompt($request);
$in = new ConsoleReader();
do {
print $prompt;
try {
$input = $in->readLine();
if ($input === "" && ($request->getDefaultValue() !== null) ) {
$input = $request->getDefaultValue();
}
$request->setInput($input);
} catch (Exception $e) {
throw new BuildException("Failed to read input from Console.", $e);
}
} while (!$request->isInputValid());
}
/**
* Constructs user prompt from a request.
*
* <p>This implementation adds (choice1,choice2,choice3,...) to the
* prompt for <code>MultipleChoiceInputRequest</code>s.</p>
*
* @param $request the request to construct the prompt for.
* Must not be <code>null</code>.
*/
protected function getPrompt(InputRequest $request) {
$prompt = $request->getPrompt();
$defaultValue = $request->getDefaultValue();
if ($request instanceof YesNoInputRequest) {
$choices = $request->getChoices();
$defaultValue = $choices[(int) !$request->getDefaultValue()];
$prompt .= '(' . implode('/', $request->getChoices()) .')';
} elseif ($request instanceof MultipleChoiceInputRequest) { // (a,b,c,d)
$prompt .= '(' . implode(',', $request->getChoices()) . ')';
}
if ($request->getDefaultValue() !== null) {
$prompt .= ' ['.$defaultValue.']';
}
$pchar = $request->getPromptChar();
return $prompt . ($pchar ? $pchar . ' ' : ' ');
}
}

View File

@@ -0,0 +1,45 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Plugin to Phing to handle requests for user input.
*
* @author Stefan Bodewig <stefan.bodewig@epost.de>
* @version $Id$
* @package phing.input
*/
interface InputHandler {
/**
* Handle the request encapsulated in the argument.
*
* <p>Precondition: the request.getPrompt will return a non-null
* value.</p>
*
* <p>Postcondition: request.getInput will return a non-null
* value, request.isInputValid will return true.</p>
* @return void
* @throws BuildException
*/
public function handleInput(InputRequest $request);
}

View File

@@ -0,0 +1,107 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Encapsulates an input request.
*
* @author Hans Lellelid <hans@xmpl.org> (Phing)
* @author Stefan Bodewig <stefan.bodewig@epost.de> (Ant)
* @version $Id$
* @package phing.input
*/
class InputRequest {
protected $prompt;
protected $input;
protected $defaultValue;
protected $promptChar;
/**
* @param string $prompt The prompt to show to the user. Must not be null.
*/
public function __construct($prompt) {
if ($prompt === null) {
throw new BuildException("prompt must not be null");
}
$this->prompt = $prompt;
}
/**
* Retrieves the prompt text.
*/
public function getPrompt() {
return $this->prompt;
}
/**
* Sets the user provided input.
*/
public function setInput($input) {
$this->input = $input;
}
/**
* Is the user input valid?
*/
public function isInputValid() {
return true;
}
/**
* Retrieves the user input.
*/
public function getInput() {
return $this->input;
}
/**
* Set the default value to use.
* @param mixed $v
*/
public function setDefaultValue($v) {
$this->defaultValue = $v;
}
/**
* Return the default value to use.
* @return mixed
*/
public function getDefaultValue() {
return $this->defaultValue;
}
/**
* Set the default value to use.
* @param string $c
*/
public function setPromptChar($c) {
$this->promptChar = $c;
}
/**
* Return the default value to use.
* @return string
*/
public function getPromptChar() {
return $this->promptChar;
}
}

View File

@@ -0,0 +1,58 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/input/InputRequest.php';
/**
* Encapsulates an input request.
*
* @author Stefan Bodewig <stefan.bodewig@epost.de>
* @version $Id$
* @package phing.input
*/
class MultipleChoiceInputRequest extends InputRequest {
protected $choices = array();
/**
* @param string $prompt The prompt to show to the user. Must not be null.
* @param array $choices holds all input values that are allowed.
* Must not be null.
*/
public function __construct($prompt, $choices) {
parent::__construct($prompt);
$this->choices = $choices;
}
/**
* @return The possible values.
*/
public function getChoices() {
return $this->choices;
}
/**
* @return true if the input is one of the allowed values.
*/
public function isInputValid() {
return in_array($this->getInput(), $this->choices); // not strict (?)
}
}

View File

@@ -0,0 +1,47 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/input/MultipleChoiceInputRequest.php';
/**
* Encapsulates an input request that returns a boolean (yes/no).
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.input
*/
class YesNoInputRequest extends MultipleChoiceInputRequest {
/**
* @return true if the input is one of the allowed values.
*/
public function isInputValid() {
return StringHelper::isBoolean($this->input);
}
/**
* Converts input to boolean.
* @return boolean
*/
public function getInput() {
return StringHelper::booleanValue($this->input);
}
}

View File

@@ -0,0 +1,267 @@
<?php
/**
* Capsule is a simple "template" engine that essentially provides an isolated context
* for PHP scripts.
*
* There is no special templating language, and therefore no limitations to what
* can be accomplished within templates. The main purpose of Capsule is to separate
* the business logic from display / output logic.
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.lib
*/
class Capsule {
/**
* Look for templates here (if relative path provided).
* @var string
*/
protected $templatePath;
/**
* Where should output files be written?
* (This is named inconsistently to be compatible w/ Texen.)
* @var string
*/
protected $outputDirectory;
/**
* The variables that can be used by the templates.
* @var array Hash of variables.
*/
public $vars = array();
/**
* Has template been initialized.
*/
protected $initialized = false;
/**
* Stores the pre-parse() include_path.
* @var string
*/
private $old_include_path;
function __construct() {
}
/**
* Clears one or several or all variables.
* @param mixed $which String name of var, or array of names.
* @return void
*/
function clear($which = null) {
if ($which === null) {
$this->vars = array();
} elseif (is_array($which)) {
foreach($which as $var) {
unset($this->vars[$var]);
}
} else {
unset($this->vars[$which]);
}
}
/**
* Set the basepath to use for template lookups.
* @param string $v
*/
function setTemplatePath($v) {
$this->templatePath = rtrim($v, DIRECTORY_SEPARATOR.'/');
}
/**
* Get the basepath to use for template lookups.
* @return string
*/
function getTemplatePath() {
return $this->templatePath;
}
/**
* Set a basepath to use for output file creation.
* @param string $v
*/
function setOutputDirectory($v) {
$this->outputDirectory = rtrim($v, DIRECTORY_SEPARATOR.'/');
}
/**
* Get basepath to use for output file creation.
* @return string
*/
function getOutputDirectory() {
return $this->outputDirectory;
}
/**
* Low overhead (no output buffering) method to simply dump template
* to buffer.
*
* @param string $__template
* @return void
* @throws Exception - if template cannot be found
*/
function display($__template) {
// Prepend "private" variable names with $__ in this function
// to keep namespace conflict potential to a minimum.
// Alias this class to $generator.
$generator = $this;
if (isset($this->vars['this'])) {
throw new Exception("Assigning a variable named \$this to a context conflicts with class namespace.");
}
// extract variables into local namespace
extract($this->vars);
// prepend template path to include path,
// so that include "path/relative/to/templates"; can be used within templates
$__old_inc_path = ini_get('include_path');
ini_set('include_path', $this->templatePath . PATH_SEPARATOR . $__old_inc_path);
@ini_set('track_errors', true);
include $__template;
@ini_restore('track_errors');
// restore the include path
ini_set('include_path', $__old_inc_path);
if (!empty($php_errormsg)) {
throw new Exception("Unable to parse template " . $__template . ": " . $php_errormsg);
}
}
/**
* Fetches the results of a tempalte parse and either returns
* the string or writes results to a specified output file.
*
* @param string $template The template filename (relative to templatePath or absolute).
* @param string $outputFile If specified, contents of template will also be written to this file.
* @param boolean $append Should output be appended to source file?
* @return string The "parsed" template output.
* @throws Exception - if template not found.
*/
function parse($template, $outputFile = null, $append = false) {
// main work done right here:
// hopefully this works recursively ... fingers crossed.
ob_start();
try {
$this->display($template);
} catch (Exception $e) {
ob_end_flush(); // flush the output on error (so we can see up to what point it parsed everything)
throw $e;
}
$output = ob_get_contents();
ob_end_clean();
if ($outputFile !== null) {
$outputFile = $this->resolvePath($outputFile, $this->outputDirectory);
$flags = null;
if ($append) $flags = FILE_APPEND;
if (!file_put_contents($outputFile, $output, $flags) && $output != "") {
throw new Exception("Unable to write output to " . $outputFile);
}
}
return $output;
}
/**
* This returns a "best guess" path for the given file.
*
* @param string $file File name or possibly absolute path.
* @param string $basepath The basepath that should be prepended if $file is not absolute.
* @return string "Best guess" path for this file.
*/
protected function resolvePath($file, $basepath) {
if ( !($file{0} == DIRECTORY_SEPARATOR || $file{0} == '/')
// also account for C:\ style path
&& !($file{1} == ':' && ($file{2} == DIRECTORY_SEPARATOR || $file{2} == '/'))) {
if ($basepath != null) {
$file = $basepath . DIRECTORY_SEPARATOR . $file;
}
}
return $file;
}
/**
* Gets value of specified var or NULL if var has not been put().
* @param string $name Variable name to retrieve.
* @return mixed
*/
function get($name) {
if (!isset($this->vars[$name])) return null;
return $this->vars[$name];
}
/**
* Merges in passed hash to vars array.
*
* Given an array like:
*
* array( 'myvar' => 'Hello',
* 'myvar2' => 'Hello')
*
* Resulting template will have access to $myvar and $myvar2.
*
* @param array $vars
* @param boolean $recursiveMerge Should matching keys be recursively merged?
* @return void
*/
function putAll($vars, $recursiveMerge = false) {
if ($recursiveMerge) {
$this->vars = array_merge_recursive($this->vars, $vars);
} else {
$this->vars = array_merge($this->vars, $vars);
}
}
/**
* Adds a variable to the context.
*
* Resulting template will have access to ${$name$} variable.
*
* @param string $name
* @param mixed $value
*/
function put($name, $value) {
$this->vars[$name] = $value;
}
/**
* Put a variable into the context, assigning it by reference.
* This means that if the template modifies the variable, then it
* will also be modified in the context.
*
* @param $name
* @param &$value
*/
function putRef($name, &$value) {
$this->vars[$name] = &$value;
}
/**
* Makes a copy of the value and puts it into the context.
* This is primarily to force copying (cloning) of objects, rather
* than the default behavior which is to assign them by reference.
* @param string $name
* @param mixed $value
*/
function putCopy($name, $value) {
if (is_object($value)) {
$value = clone $value;
}
$this->vars[$name] = $value;
}
}

View File

@@ -0,0 +1,234 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/listener/DefaultLogger.php';
include_once 'phing/system/util/Properties.php';
/**
* Uses ANSI Color Code Sequences to colorize messages
* sent to the console.
*
* If used with the -logfile option, the output file
* will contain all the necessary escape codes to
* display the text in colorized mode when displayed
* in the console using applications like cat, more,
* etc.
*
* This is designed to work on terminals that support ANSI
* color codes. It works on XTerm, ETerm, Mindterm, etc.
* It also works on Win9x (with ANSI.SYS loaded.)
*
* NOTE:
* It doesn't work on WinNT's COMMAND.COM even with
* ANSI.SYS loaded.
*
* The default colors used for differentiating
* the message levels can be changed by editing the
* phing/listener/defaults.properties file.
*
* This file contains 5 key/value pairs:
* AnsiColorLogger.ERROR_COLOR=2;31
* AnsiColorLogger.WARNING_COLOR=2;35
* AnsiColorLogger.INFO_COLOR=2;36
* AnsiColorLogger.VERBOSE_COLOR=2;32
* AnsiColorLogger.DEBUG_COLOR=2;34
*
* Another option is to pass a system variable named
* ant.logger.defaults, with value set to the path of
* the file that contains user defined Ansi Color
* Codes, to the <B>java</B> command using -D option.
*
* To change these colors use the following chart:
*
* <B>ANSI COLOR LOGGER CONFIGURATION</B>
*
* Format for AnsiColorLogger.*=
* Attribute;Foreground;Background
*
* Attribute is one of the following:
* 0 -> Reset All Attributes (return to normal mode)
* 1 -> Bright (Usually turns on BOLD)
* 2 -> Dim
* 3 -> Underline
* 5 -> link
* 7 -> Reverse
* 8 -> Hidden
*
* Foreground is one of the following:
* 30 -> Black
* 31 -> Red
* 32 -> Green
* 33 -> Yellow
* 34 -> Blue
* 35 -> Magenta
* 36 -> Cyan
* 37 -> White
*
* Background is one of the following:
* 40 -> Black
* 41 -> Red
* 42 -> Green
* 43 -> Yellow
* 44 -> Blue
* 45 -> Magenta
* 46 -> Cyan
* 47 -> White
*
* @author Hans Lellelid <hans@xmpl.org> (Phing)
* @author Magesh Umasankar (Ant)
* @package phing.listener
* @version $Id$
*/
class AnsiColorLogger extends DefaultLogger {
const ATTR_NORMAL = 0;
const ATTR_BRIGHT = 1;
const ATTR_DIM = 2;
const ATTR_UNDERLINE = 3;
const ATTR_BLINK = 5;
const ATTR_REVERSE = 7;
const ATTR_HIDDEN = 8;
const FG_BLACK = 30;
const FG_RED = 31;
const FG_GREEN = 32;
const FG_YELLOW = 33;
const FG_BLUE = 34;
const FG_MAGENTA = 35;
const FG_CYAN = 36;
const FG_WHITE = 37;
const BG_BLACK = 40;
const BG_RED = 41;
const BG_GREEN = 42;
const BG_YELLOW = 44;
const BG_BLUE = 44;
const BG_MAGENTA = 45;
const BG_CYAN = 46;
const BG_WHITE = 47;
const PREFIX = "\x1b[";
const SUFFIX = "m";
const SEPARATOR = ';';
const END_COLOR = "\x1b[m"; // self::PREFIX . self::SUFFIX;
private $errColor;
private $warnColor;
private $infoColor;
private $verboseColor;
private $debugColor;
private $colorsSet = false;
/**
* Construct new AnsiColorLogger
* Perform initializations that cannot be done in var declarations.
*/
public function __construct() {
parent::__construct();
$this->errColor = self::PREFIX . self::ATTR_NORMAL . self::SEPARATOR . self::FG_RED . self::SUFFIX;
$this->warnColor = self::PREFIX . self::ATTR_NORMAL . self::SEPARATOR . self::FG_MAGENTA . self::SUFFIX;
$this->infoColor = self::PREFIX . self::ATTR_NORMAL . self::SEPARATOR . self::FG_CYAN . self::SUFFIX;
$this->verboseColor = self::PREFIX . self::ATTR_NORMAL . self::SEPARATOR . self::FG_GREEN . self::SUFFIX;
$this->debugColor = self::PREFIX . self::ATTR_NORMAL . self::SEPARATOR . self::FG_BLUE . self::SUFFIX;
}
/**
* Set the colors to use from a property file specified by the
* special ant property ant.logger.defaults
*/
private final function setColors() {
$userColorFile = Phing::getProperty("phing.logger.defaults");
$systemColorFile = new PhingFile(Phing::getResourcePath("phing/listener/defaults.properties"));
$in = null;
try {
$prop = new Properties();
if ($userColorFile !== null) {
$prop->load($userColorFile);
} else {
$prop->load($systemColorFile);
}
$err = $prop->getProperty("AnsiColorLogger.ERROR_COLOR");
$warn = $prop->getProperty("AnsiColorLogger.WARNING_COLOR");
$info = $prop->getProperty("AnsiColorLogger.INFO_COLOR");
$verbose = $prop->getProperty("AnsiColorLogger.VERBOSE_COLOR");
$debug = $prop->getProperty("AnsiColorLogger.DEBUG_COLOR");
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.
}
}
/**
* @see DefaultLogger#printMessage
* @param string $message
* @param OutputStream $stream
* @param int $priority
*/
protected final function printMessage($message, OutputStream $stream, $priority) {
if ($message !== null) {
if (!$this->colorsSet) {
$this->setColors();
$this->colorsSet = true;
}
switch ($priority) {
case Project::MSG_ERR:
$message = $this->errColor . $message . self::END_COLOR;
break;
case Project::MSG_WARN:
$message = $this->warnColor . $message . self::END_COLOR;
break;
case Project::MSG_INFO:
$message = $this->infoColor . $message . self::END_COLOR;
break;
case Project::MSG_VERBOSE:
$message = $this->verboseColor . $message . self::END_COLOR;
break;
case Project::MSG_DEBUG:
$message = $this->debugColor . $message . self::END_COLOR;
break;
}
$stream->write($message . PHP_EOL);
}
}
}

View File

@@ -0,0 +1,279 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/listener/StreamRequiredBuildLogger.php';
include_once 'phing/BuildEvent.php';
/**
* Writes a build event to the console.
*
* Currently, it only writes which targets are being executed, and
* any messages that get logged.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @see BuildEvent
* @package phing.listener
*/
class DefaultLogger implements StreamRequiredBuildLogger {
/**
* Size of the left column in output. The default char width is 12.
* @var int
*/
const LEFT_COLUMN_SIZE = 12;
/**
* The message output level that should be used. The default is
* <code>Project::MSG_VERBOSE</code>.
* @var int
*/
protected $msgOutputLevel = Project::MSG_ERR;
/**
* Time that the build started
* @var int
*/
protected $startTime;
/**
* @var OutputStream Stream to use for standard output.
*/
protected $out;
/**
* @var OutputStream Stream to use for error output.
*/
protected $err;
/**
* Construct a new default logger.
*/
public function __construct() {
}
/**
* Set the msgOutputLevel this logger is to respond to.
*
* Only messages with a message level lower than or equal to the given
* level are output to the log.
*
* <p> Constants for the message levels are in Project.php. The order of
* the levels, from least to most verbose, is:
*
* <ul>
* <li>Project::MSG_ERR</li>
* <li>Project::MSG_WARN</li>
* <li>Project::MSG_INFO</li>
* <li>Project::MSG_VERBOSE</li>
* <li>Project::MSG_DEBUG</li>
* </ul>
*
* The default message level for DefaultLogger is Project::MSG_ERR.
*
* @param int $level The logging level for the logger.
* @see BuildLogger#setMessageOutputLevel()
*/
public function setMessageOutputLevel($level) {
$this->msgOutputLevel = (int) $level;
}
/**
* Sets the output stream.
* @param OutputStream $output
* @see BuildLogger#setOutputStream()
*/
public function setOutputStream(OutputStream $output) {
$this->out = $output;
}
/**
* Sets the error stream.
* @param OutputStream $err
* @see BuildLogger#setErrorStream()
*/
public function setErrorStream(OutputStream $err) {
$this->err = $err;
}
/**
* Sets the start-time when the build started. Used for calculating
* the build-time.
*
* @param object The BuildEvent
* @access public
*/
public function buildStarted(BuildEvent $event) {
$this->startTime = Phing::currentTimeMillis();
if ($this->msgOutputLevel >= Project::MSG_INFO) {
$this->printMessage("Buildfile: ".$event->getProject()->getProperty("phing.file"), $this->out, Project::MSG_INFO);
}
}
/**
* Prints whether the build succeeded or failed, and any errors that
* occured during the build. Also outputs the total build-time.
*
* @param object The BuildEvent
* @see BuildEvent::getException()
*/
public function buildFinished(BuildEvent $event) {
$error = $event->getException();
if ($error === null) {
$msg = PHP_EOL . $this->getBuildSuccessfulMessage() . PHP_EOL;
} else {
$msg = PHP_EOL . $this->getBuildFailedMessage() . PHP_EOL;
if (Project::MSG_VERBOSE <= $this->msgOutputLevel || !($error instanceof BuildException)) {
$msg .= $error->__toString().PHP_EOL;
} else {
$msg .= $error->getMessage();
}
}
$msg .= PHP_EOL . "Total time: " .self::formatTime(Phing::currentTimeMillis() - $this->startTime) . PHP_EOL;
if ($error === null) {
$this->printMessage($msg, $this->out, Project::MSG_VERBOSE);
} else {
$this->printMessage($msg, $this->err, Project::MSG_ERR);
}
}
/**
* Get the message to return when a build failed.
* @return string The classic "BUILD FAILED"
*/
protected function getBuildFailedMessage() {
return "BUILD FAILED";
}
/**
* Get the message to return when a build succeeded.
* @return string The classic "BUILD FINISHED"
*/
protected function getBuildSuccessfulMessage() {
return "BUILD FINISHED";
}
/**
* Prints the current target name
*
* @param object The BuildEvent
* @access public
* @see BuildEvent::getTarget()
*/
public function targetStarted(BuildEvent $event) {
if (Project::MSG_INFO <= $this->msgOutputLevel) {
$showLongTargets = $event->getProject()->getProperty("phing.showlongtargets");
$msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $event->getTarget()->getName() . ($showLongTargets ? ' [' . $event->getTarget()->getDescription() . ']' : '') . ':' . PHP_EOL;
$this->printMessage($msg, $this->out, $event->getPriority());
}
}
/**
* Fired when a target has finished. We don't need specific action on this
* event. So the methods are empty.
*
* @param object The BuildEvent
* @see BuildEvent::getException()
*/
public function targetFinished(BuildEvent $event) {}
/**
* Fired when a task is started. We don't need specific action on this
* event. So the methods are empty.
*
* @param object The BuildEvent
* @access public
* @see BuildEvent::getTask()
*/
public function taskStarted(BuildEvent $event) {}
/**
* Fired when a task has finished. We don't need specific action on this
* event. So the methods are empty.
*
* @param object The BuildEvent
* @access public
* @see BuildEvent::getException()
*/
public function taskFinished(BuildEvent $event) {}
/**
* Print a message to the stdout.
*
* @param object The BuildEvent
* @access public
* @see BuildEvent::getMessage()
*/
public function messageLogged(BuildEvent $event) {
$priority = $event->getPriority();
if ($priority <= $this->msgOutputLevel) {
$msg = "";
if ($event->getTask() !== null) {
$name = $event->getTask();
$name = $name->getTaskName();
$msg = str_pad("[$name] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
}
$msg .= $event->getMessage();
if ($priority != Project::MSG_ERR) {
$this->printMessage($msg, $this->out, $priority);
} else {
$this->printMessage($msg, $this->err, $priority);
}
}
}
/**
* Formats a time micro integer to human readable format.
*
* @param integer The time stamp
* @access private
*/
public static function formatTime($micros) {
$seconds = $micros;
$minutes = $seconds / 60;
if ($minutes > 1) {
return sprintf("%1.0f minute%s %0.2f second%s",
$minutes, ($minutes === 1 ? " " : "s "),
$seconds - floor($seconds/60) * 60, ($seconds%60 === 1 ? "" : "s"));
} else {
return sprintf("%0.4f second%s", $seconds, ($seconds%60 === 1 ? "" : "s"));
}
}
/**
* Prints a message to console.
*
* @param string $message The message to print.
* Should not be <code>null</code>.
* @param resource $stream The stream to use for message printing.
* @param int $priority The priority of the message.
* (Ignored in this implementation.)
* @return void
*/
protected function printMessage($message, OutputStream $stream, $priority) {
$stream->write($message . PHP_EOL);
}
}

View File

@@ -0,0 +1,175 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/listener/DefaultLogger.php';
include_once 'phing/system/util/Properties.php';
/**
* Uses CSS class that must be defined in the HTML page
* where the Phing output is displayed.
*
* If used with the -logfile option, the output
* will contain the text wrapped in html <span> elements
* with those css classes.
*
* The default classes used for differentiating
* the message levels can be changed by editing the
* phing/listener/defaults.properties file.
*
* This file can contain 5 key/value pairs:
* HtmlColorLogger.ERROR_CLASS=_your_css_class_name_
* HtmlColorLogger.WARNING_CLASS=_your_css_class_name_
* HtmlColorLogger.INFO_CLASS=_your_css_class_name_
* HtmlColorLogger.VERBOSE_CLASS=_your_css_class_name_
* HtmlColorLogger.DEBUG_CLASS=_your_css_class_name_
*
* This stems from the Ansi Color Logger done by Hans Lellelid:
*
* @author Anton Stöckl <anton@stoeckl.de> (Phing HTML Color Logger)
* @author Hans Lellelid <hans@xmpl.org> (Phing Ansi Color Logger)
* @author Magesh Umasankar (Ant)
* @package phing.listener
* @version $Id$
*/
class HtmlColorLogger extends DefaultLogger {
const CLASS_ERR = 'phing_err';
const CLASS_VERBOSE = 'phing_verbose';
const CLASS_DEBUG = 'phing_debug';
const CLASS_WARN = 'phing_warn';
const CLASS_INFO = 'phing_info';
const PREFIX = '<span class="';
const SUFFIX = '">';
const END_COLOR = '</span>';
private $errColor;
private $warnColor;
private $infoColor;
private $verboseColor;
private $debugColor;
private $colorsSet = false;
/**
* Construct new HtmlColorLogger
* Perform initializations that cannot be done in var declarations.
*/
public function __construct() {
parent::__construct();
$this->errColor = self::PREFIX . self::CLASS_ERR . self::SUFFIX;
$this->warnColor = self::PREFIX . self::CLASS_WARN . self::SUFFIX;
$this->infoColor = self::PREFIX . self::CLASS_INFO . self::SUFFIX;
$this->verboseColor = self::PREFIX . self::CLASS_VERBOSE . self::SUFFIX;
$this->debugColor = self::PREFIX . self::CLASS_DEBUG . self::SUFFIX;
}
/**
* 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.
}
}
/**
* @see DefaultLogger#printMessage
* @param string $message
* @param OutputStream $stream
* @param int $priority
*/
protected final function printMessage($message, OutputStream $stream, $priority) {
if ($message !== null) {
if (!$this->colorsSet) {
$this->setColors();
$this->colorsSet = true;
}
$search = array('<', '>');
$replace = array('&lt;', '&gt;');
$message = str_replace($search, $replace, $message);
$search = array("\t", "\n", "\r");
$replace = array('&nbsp;&nbsp;&nbsp;', '<br>', '');
$message = str_replace($search, $replace, $message);
if (preg_match('@^( +)([^ ].+)@', $message, $matches)) {
$len = strlen($matches[1]);
$space = '&nbsp;';
for ($i = 1; $i < $len; $i++) {
$space .= '&nbsp;';
}
$message = $space . $matches[2];
}
switch ($priority) {
case Project::MSG_ERR:
$message = $this->errColor . $message . self::END_COLOR;
break;
case Project::MSG_WARN:
$message = $this->warnColor . $message . self::END_COLOR;
break;
case Project::MSG_INFO:
$message = $this->infoColor . $message . self::END_COLOR;
break;
case Project::MSG_VERBOSE:
$message = $this->verboseColor . $message . self::END_COLOR;
break;
case Project::MSG_DEBUG:
$message = $this->debugColor . $message . self::END_COLOR;
break;
}
$stream->write($message . '<br/>');
}
}
}

View File

@@ -0,0 +1,105 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/listener/DefaultLogger.php';
include_once 'phing/system/util/Properties.php';
/**
* Uses PEAR Mail package to send the build log to one or
* more recipients.
*
* @author Michiel Rook <mrook@php.net>
* @package phing.listener
* @version $Id$
*/
class MailLogger extends DefaultLogger
{
private $_mailMessage = "";
private $_from = "phing@phing.info";
private $_subject = "Phing build result";
private $_tolist = null;
/**
* Construct new MailLogger
*/
public function __construct() {
parent::__construct();
@require_once 'Mail.php';
if (!class_exists('Mail')) {
throw new BuildException('Need the PEAR Mail package to send logs');
}
$from = Phing::getDefinedProperty('phing.log.mail.from');
$subject = Phing::getDefinedProperty('phing.log.mail.subject');
$tolist = Phing::getDefinedProperty('phing.log.mail.recipients');
if (!empty($from)) {
$this->_from = $from;
}
if (!empty($subject)) {
$this->_subject = $subject;
}
if (!empty($tolist)) {
$this->_tolist = $tolist;
}
}
/**
* @see DefaultLogger#printMessage
* @param string $message
* @param OutputStream $stream
* @param int $priority
*/
protected final function printMessage($message, OutputStream $stream, $priority)
{
if ($message !== null) {
$this->_mailMessage .= $message . "\n";
}
}
/**
* Sends the mail
*
* @see DefaultLogger#buildFinished
* @param BuildEvent $event
*/
public function buildFinished(BuildEvent $event)
{
parent::buildFinished($event);
if (empty($this->_tolist)) {
return;
}
$hdrs = array(
'From' => $this->_from,
'Subject' => $this->_subject . (empty($event) ? " (build succesful)" : " (build failed)")
);
$mail = Mail::factory('mail');
$mail->send($this->_tolist, $hdrs, $this->_mailMessage);
}
}

View File

@@ -0,0 +1,59 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/listener/DefaultLogger.php';
/**
* Extends DefaultLogger to strip out empty targets.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @package phing.listener
*/
class NoBannerLogger extends DefaultLogger {
private $targetName = null;
function targetStarted(BuildEvent $event) {
$target = $event->getTarget();
$this->targetName = $target->getName();
}
function targetFinished(BuildEvent $event) {
$this->targetName = null;
}
function messageLogged(BuildEvent $event) {
if ($event->getPriority() > $this->msgOutputLevel || null === $event->getMessage() || trim($event->getMessage() === "")) {
return;
}
if ($this->targetName !== null) {
$msg = PHP_EOL . $event->getProject()->getName() . ' > ' . $this->targetName . ':' . PHP_EOL;
$this->printMessage($msg, $this->out, $event->getPriority());
$this->targetName = null;
}
parent::messageLogged($event);
}
}

View File

@@ -0,0 +1,197 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/BuildListener.php';
/**
* Writes build messages to PEAR Log.
*
* By default it will log to file in current directory w/ name 'phing.log'. You can customize
* this behavior by setting properties:
* - pear.log.type
* - pear.log.name
* - pear.log.ident (note that this class changes ident to project name)
* - pear.log.conf (note that array values are currently unsupported in Phing property files)
*
* <code>
* phing -f build.xml -logger phing.listener.PearLogger -Dpear.log.type=file -Dpear.log.name=/path/to/log.log
* </code>
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BuildEvent
* @package phing.listener
*/
class PearLogListener implements BuildListener {
/**
* Size of the left column in output. The default char width is 12.
* @var int
*/
const LEFT_COLUMN_SIZE = 12;
/**
* Time that the build started
* @var int
*/
protected $startTime;
/**
* Maps Phing Project::MSG_* constants to PEAR_LOG_* constants.
* @var array
*/
protected static $levelMap = array( Project::MSG_DEBUG => PEAR_LOG_DEBUG,
Project::MSG_INFO => PEAR_LOG_INFO,
Project::MSG_VERBOSE => PEAR_LOG_NOTICE,
Project::MSG_WARN => PEAR_LOG_WARNING,
Project::MSG_ERR => PEAR_LOG_ERR
);
/**
* Whether logging has been configured.
* @var boolean
*/
protected $logConfigured = false;
/**
* @var Log PEAR Log object.
*/
protected $logger;
/**
* Configure the logger.
*/
protected function configureLogging() {
$type = Phing::getDefinedProperty('pear.log.type');
$name = Phing::getDefinedProperty('pear.log.name');
$ident = Phing::getDefinedProperty('pear.log.ident');
$conf = Phing::getDefinedProperty('pear.log.conf');
if ($type === null) $type = 'file';
if ($name === null) $name = 'phing.log';
if ($ident === null) $ident = 'phing';
if ($conf === null) $conf = array();
include_once 'Log.php';
if (!class_exists('Log')) {
throw new BuildException("Cannot find PEAR Log class for use by PearLogger.");
}
$this->logger = Log::singleton($type, $name, $ident, $conf, self::$levelMap[$this->msgOutputLevel]);
}
/**
* Get the configured PEAR logger to use.
* This method just ensures that logging has been configured and returns the configured logger.
* @return Log
*/
protected function logger() {
if (!$this->logConfigured) {
$this->configureLogging();
}
return $this->logger;
}
/**
* Sets the start-time when the build started. Used for calculating
* the build-time.
*
* @param BuildEvent The BuildEvent
*/
public function buildStarted(BuildEvent $event) {
$this->startTime = Phing::currentTimeMillis();
$this->logger()->setIdent($event->getProject()->getName());
$this->logger()->info("Starting build with buildfile: ". $event->getProject()->getProperty("phing.file"));
}
/**
* Logs whether the build succeeded or failed, and any errors that
* occured during the build. Also outputs the total build-time.
*
* @param BuildEvent The BuildEvent
* @see BuildEvent::getException()
*/
public function buildFinished(BuildEvent $event) {
$error = $event->getException();
if ($error === null) {
$msg = "Finished successful build.";
} else {
$msg = "Build failed. [reason: " . $error->getMessage() ."]";
}
$this->logger()->log($msg . " Total time: " . DefaultLogger::formatTime(Phing::currentTimeMillis() - $this->startTime));
}
/**
* Logs the current target name
*
* @param BuildEvent The BuildEvent
* @see BuildEvent::getTarget()
*/
public function targetStarted(BuildEvent $event) {}
/**
* Fired when a target has finished. We don't need specific action on this
* event. So the methods are empty.
*
* @param BuildEvent The BuildEvent
* @access public
* @see BuildEvent::getException()
*/
public function targetFinished(BuildEvent $event) {}
/**
* Fired when a task is started. We don't need specific action on this
* event. So the methods are empty.
*
* @param BuildEvent The BuildEvent
* @access public
* @see BuildEvent::getTask()
*/
public function taskStarted(BuildEvent $event) {}
/**
* Fired when a task has finished. We don't need specific action on this
* event. So the methods are empty.
*
* @param BuildEvent The BuildEvent
* @see BuildEvent::getException()
*/
public function taskFinished(BuildEvent $event) {}
/**
* Logs a message to the configured PEAR logger.
*
* @param BuildEvent The BuildEvent
* @see BuildEvent::getMessage()
*/
public function messageLogged(BuildEvent $event) {
if ($event->getPriority() <= $this->msgOutputLevel) {
$msg = "";
if ($event->getTask() !== null) {
$name = $event->getTask();
$name = $name->getTaskName();
$msg = str_pad("[$name] ", self::LEFT_COLUMN_SIZE, " ", STR_PAD_LEFT);
}
$msg .= $event->getMessage();
$this->logger()->log($msg, self::$levelMap[$event->getPriority()]);
}
}
}

View File

@@ -0,0 +1,39 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/BuildLogger.php';
/**
* Interface for build loggers that require that out/err streams be set in order to function.
*
* This is just an empty sub-interface to BuildLogger, but is used by Phing to throw
* graceful errors when classes like phing.listener.DefaultLogger are being used as
* -listener.
*
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @see BuildEvent
* @see Project::addBuildListener()
* @package phing
*/
interface StreamRequiredBuildLogger extends BuildLogger {
}

View File

@@ -0,0 +1,354 @@
<?php
/**
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/BuildLogger.php';
require_once 'phing/listener/DefaultLogger.php';
require_once 'phing/system/util/Timer.php';
/**
* Generates a file in the current directory with
* an XML description of what happened during a build.
* The default filename is "log.xml", but this can be overridden
* with the property <code>XmlLogger.file</code>.
*
* @author Michiel Rook <mrook@php.net>
* @version $Id$
* @package phing.listener
*/
class XmlLogger implements BuildLogger {
/** XML element name for a build. */
const BUILD_TAG = "build";
/** XML element name for a target. */
const TARGET_TAG = "target";
/** XML element name for a task. */
const TASK_TAG = "task";
/** XML element name for a message. */
const MESSAGE_TAG = "message";
/** XML attribute name for a name. */
const NAME_ATTR = "name";
/** XML attribute name for a time. */
const TIME_ATTR = "time";
/** XML attribute name for a message priority. */
const PRIORITY_ATTR = "priority";
/** XML attribute name for a file location. */
const LOCATION_ATTR = "location";
/** XML attribute name for an error description. */
const ERROR_ATTR = "error";
/** XML element name for a stack trace. */
const STACKTRACE_TAG = "stacktrace";
/**
* @var DOMDocument The XML document created by this logger.
*/
private $doc;
/**
* @var int Start time for entire build.
*/
private $buildTimerStart = 0;
/**
* @var DOMElement Top-level (root) build element
*/
private $buildElement;
/**
* @var array DOMElement[] The parent of the element being processed.
*/
private $elementStack = array();
/**
* @var array int[] Array of millisecond times for the various elements being processed.
*/
private $timesStack = array();
/**
* @var int
*/
private $msgOutputLevel = Project::MSG_DEBUG;
/**
* @var OutputStream Stream to use for standard output.
*/
private $out;
/**
* @var OutputStream Stream to use for error output.
*/
private $err;
/**
* @var string Name of filename to create.
*/
private $outFilename;
/**
* Constructs a new BuildListener that logs build events to an XML file.
*/
public function __construct() {
$this->doc = new DOMDocument("1.0", "UTF-8");
$this->doc->formatOutput = true;
}
/**
* Fired when the build starts, this builds the top-level element for the
* document and remembers the time of the start of the build.
*
* @param BuildEvent Ignored.
*/
function buildStarted(BuildEvent $event) {
$this->buildTimerStart = Phing::currentTimeMillis();
$this->buildElement = $this->doc->createElement(XmlLogger::BUILD_TAG);
array_push($this->elementStack, $this->buildElement);
array_push($this->timesStack, $this->buildTimerStart);
}
/**
* Fired when the build finishes, this adds the time taken and any
* error stacktrace to the build element and writes the document to disk.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function buildFinished(BuildEvent $event) {
$elapsedTime = Phing::currentTimeMillis() - $this->buildTimerStart;
$this->buildElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime));
if ($event->getException() != null) {
$this->buildElement->setAttribute(XmlLogger::ERROR_ATTR, $event->getException()->getMessage());
$errText = $this->doc->createCDATASection($event->getException()->getTraceAsString());
$stacktrace = $this->doc->createElement(XmlLogger::STACKTRACE_TAG);
$stacktrace->appendChild($errText);
$this->buildElement->appendChild($stacktrace);
}
$this->doc->appendChild($this->buildElement);
$outFilename = $event->getProject()->getProperty("XmlLogger.file");
if ($outFilename == null) {
$outFilename = "log.xml";
}
try {
$stream = $this->out;
if ($stream === null) {
$stream = new FileOutputStream($outFilename);
}
// Yes, we could just stream->write() but this will eventually be the better
// way to do this (when we need to worry about charset conversions.
$writer = new OutputStreamWriter($stream);
$writer->write($this->doc->saveXML());
$writer->close();
} catch (IOException $exc) {
try {
$stream->close(); // in case there is a stream open still ...
} catch (Exception $x) {}
throw new BuildException("Unable to write log file.", $exc);
}
// cleanup:remove the buildElement
$this->buildElement = null;
array_pop($this->elementStack);
array_pop($this->timesStack);
}
/**
* Fired when a target starts building, remembers the current time and the name of the target.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function targetStarted(BuildEvent $event) {
$target = $event->getTarget();
$targetElement = $this->doc->createElement(XmlLogger::TARGET_TAG);
$targetElement->setAttribute(XmlLogger::NAME_ATTR, $target->getName());
array_push($this->timesStack, Phing::currentTimeMillis());
array_push($this->elementStack, $targetElement);
}
/**
* Fired when a target finishes building, this adds the time taken
* to the appropriate target element in the log.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function targetFinished(BuildEvent $event) {
$targetTimerStart = array_pop($this->timesStack);
$targetElement = array_pop($this->elementStack);
$elapsedTime = Phing::currentTimeMillis() - $targetTimerStart;
$targetElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime));
$parentElement = $this->elementStack[ count($this->elementStack) - 1 ];
$parentElement->appendChild($targetElement);
}
/**
* Fired when a task starts building, remembers the current time and the name of the task.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function taskStarted(BuildEvent $event) {
$task = $event->getTask();
$taskElement = $this->doc->createElement(XmlLogger::TASK_TAG);
$taskElement->setAttribute(XmlLogger::NAME_ATTR, $task->getTaskName());
$taskElement->setAttribute(XmlLogger::LOCATION_ATTR, $task->getLocation()->toString());
array_push($this->timesStack, Phing::currentTimeMillis());
array_push($this->elementStack, $taskElement);
}
/**
* Fired when a task finishes building, this adds the time taken
* to the appropriate task element in the log.
*
* @param BuildEvent $event An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function taskFinished(BuildEvent $event) {
$taskTimerStart = array_pop($this->timesStack);
$taskElement = array_pop($this->elementStack);
$elapsedTime = Phing::currentTimeMillis() - $taskTimerStart;
$taskElement->setAttribute(XmlLogger::TIME_ATTR, DefaultLogger::formatTime($elapsedTime));
$parentElement = $this->elementStack[ count($this->elementStack) - 1 ];
$parentElement->appendChild($taskElement);
}
/**
* Fired when a message is logged, this adds a message element to the
* most appropriate parent element (task, target or build) and records
* the priority and text of the message.
*
* @param BuildEvent An event with any relevant extra information.
* Will not be <code>null</code>.
*/
public function messageLogged(BuildEvent $event)
{
$priority = $event->getPriority();
if ($priority > $this->msgOutputLevel) {
return;
}
$messageElement = $this->doc->createElement(XmlLogger::MESSAGE_TAG);
switch ($priority) {
case Project::MSG_ERR:
$name = "error";
break;
case Project::MSG_WARN:
$name = "warn";
break;
case Project::MSG_INFO:
$name = "info";
break;
default:
$name = "debug";
break;
}
$messageElement->setAttribute(XmlLogger::PRIORITY_ATTR, $name);
if (function_exists('mb_convert_encoding'))
{
$messageConverted = mb_convert_encoding($event->getMessage(), 'UTF-8');
}
else
{
$messageConverted = utf8_encode($event->getMessage());
}
$messageText = $this->doc->createCDATASection($messageConverted);
$messageElement->appendChild($messageText);
if (!empty($this->elementStack)) {
$this->elementStack[count($this->elementStack)-1]->appendChild($messageElement);
}
}
/**
* Set the msgOutputLevel this logger is to respond to.
*
* Only messages with a message level lower than or equal to the given
* level are output to the log.
*
* <p> Constants for the message levels are in Project.php. The order of
* the levels, from least to most verbose, is:
*
* <ul>
* <li>Project::MSG_ERR</li>
* <li>Project::MSG_WARN</li>
* <li>Project::MSG_INFO</li>
* <li>Project::MSG_VERBOSE</li>
* <li>Project::MSG_DEBUG</li>
* </ul>
*
* The default message level for DefaultLogger is Project::MSG_ERR.
*
* @param int $level The logging level for the logger.
* @see BuildLogger#setMessageOutputLevel()
*/
public function setMessageOutputLevel($level) {
$this->msgOutputLevel = (int) $level;
}
/**
* Sets the output stream.
* @param OutputStream $output
* @see BuildLogger#setOutputStream()
*/
public function setOutputStream(OutputStream $output) {
$this->out = $output;
}
/**
* Sets the error stream.
* @param OutputStream $err
* @see BuildLogger#setErrorStream()
*/
public function setErrorStream(OutputStream $err) {
$this->err = $err;
}
}

View File

@@ -0,0 +1,43 @@
####################################################
#
# ANSI COLOR LOGGER CONFIGURATION
#
# Format for AnsiColorLogger.*=
# Attribute;Foreground;Background
#
# Attribute is one of the following:
# 0 -> Reset All Attributes (return to normal mode)
# 1 -> Bright (Usually turns on BOLD)
# 2 -> Dim
# 3 -> Underline
# 5 -> link
# 7 -> Reverse
# 8 -> Hidden
#
# Foreground is one of the following:
# 30 -> Black
# 31 -> Red
# 32 -> Green
# 33 -> Yellow
# 34 -> Blue
# 35 -> Magenta
# 36 -> Cyan
# 37 -> White
#
# Background is one of the following:
# 40 -> Black
# 41 -> Red
# 42 -> Green
# 43 -> Yellow
# 44 -> Blue
# 45 -> Magenta
# 46 -> Cyan
# 47 -> White
#
####################################################
AnsiColorLogger.ERROR_COLOR=01;31
AnsiColorLogger.WARNING_COLOR=01;35
AnsiColorLogger.INFO_COLOR=00;36
AnsiColorLogger.VERBOSE_COLOR=00;32
AnsiColorLogger.DEBUG_COLOR=01;34

View File

@@ -0,0 +1,59 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Interface for filename mapper classes.
*
* @author Andreas Aderhold, andi@binarycloud.com
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.mappers
*/
interface FileNameMapper {
/**
* The mapper implementation.
*
* @param mixed $sourceFileName The data the mapper works on.
* @return array The data after the mapper has been applied; must be in array format (for some reason).
*/
public function main($sourceFileName);
/**
* Accessor. Sets the to property. The actual implementation
* depends on the child class.
*
* @param string $to To what this mapper should convert the from string
* @return void
*/
public function setTo($to);
/**
* Accessor. Sets the from property. What this mapper should
* recognize. The actual implementation is dependent upon the
* child class
*
* @param string $from On what this mapper should work
* @return void
*/
public function setFrom($from);
}

View File

@@ -0,0 +1,55 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/mappers/FileNameMapper.php';
/**
* Removes any directory information from the passed path.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @version $Id$
* @package phing.mappers
*/
class FlattenMapper implements FileNameMapper {
/**
* The mapper implementation. Returns string with source filename
* but without leading directory information
*
* @param string $sourceFileName The data the mapper works on
* @return array The data after the mapper has been applied
*/
function main($sourceFileName) {
$f = new PhingFile($sourceFileName);
return array($f->getName());
}
/**
* Ignored here.
*/
function setTo($to) {}
/**
* Ignored here.
*/
function setFrom($from) {}
}

View File

@@ -0,0 +1,113 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/mappers/FileNameMapper.php';
/**
* description here
*
* @author Andreas Aderhold, andi@binarycloud.com
* @version $Id$
* @package phing.mappers
*/
class GlobMapper implements FileNameMapper {
/**
* Part of &quot;from&quot; pattern before the *.
*/
private $fromPrefix = null;
/**
* Part of &quot;from&quot; pattern after the *.
*/
private $fromPostfix = null;
/**
* Length of the prefix (&quot;from&quot; pattern).
*/
private $prefixLength;
/**
* Length of the postfix (&quot;from&quot; pattern).
*/
private $postfixLength;
/**
* Part of &quot;to&quot; pattern before the *.
*/
private $toPrefix = null;
/**
* Part of &quot;to&quot; pattern after the *.
*/
private $toPostfix = null;
function main($_sourceFileName) {
if (($this->fromPrefix === null)
|| !StringHelper::startsWith($this->fromPrefix, $_sourceFileName)
|| !StringHelper::endsWith($this->fromPostfix, $_sourceFileName)) {
return null;
}
$varpart = $this->_extractVariablePart($_sourceFileName);
$substitution = $this->toPrefix.$varpart.$this->toPostfix;
return array($substitution);
}
function setFrom($from) {
$index = strrpos($from, '*');
if ($index === false) {
$this->fromPrefix = $from;
$this->fromPostfix = "";
} else {
$this->fromPrefix = substr($from, 0, $index);
$this->fromPostfix = substr($from, $index+1);
}
$this->prefixLength = strlen($this->fromPrefix);
$this->postfixLength = strlen($this->fromPostfix);
}
/**
* Sets the &quot;to&quot; pattern. Required.
*/
function setTo($to) {
$index = strrpos($to, '*');
if ($index === false) {
$this->toPrefix = $to;
$this->toPostfix = "";
} else {
$this->toPrefix = substr($to, 0, $index);
$this->toPostfix = substr($to, $index+1);
}
}
private function _extractVariablePart($_name) {
// ergh, i really hate php's string functions .... all but natural
$start = ($this->prefixLength === 0) ? 0 : $this->prefixLength;
$end = ($this->postfixLength === 0) ? strlen($_name) : strlen($_name) - $this->postfixLength;
$len = $end-$start;
return substr($_name, $start, $len);
}
}

View File

@@ -0,0 +1,54 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/mappers/FileNameMapper.php';
/**
* This mapper does nothing ;)
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @version $Id$
* @package phing.mappers
*/
class IdentityMapper implements FileNameMapper {
/**
* The mapper implementation. Basically does nothing in this case.
*
* @param string $sourceFileName The data the mapper works on.
* @return array The data after the mapper has been applied
*/
function main($sourceFileName) {
return array($sourceFileName);
}
/**
* Ignored here.
*/
function setTo($to) {}
/**
* Ignored here.
*/
function setFrom($from) {}
}

View File

@@ -0,0 +1,69 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/mappers/FileNameMapper.php';
/**
* For merging files into a single file. In practice just returns whatever value
* was set for "to".
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @version $Id$
* @package phing.mappers
*/
class MergeMapper implements FileNameMapper {
/** the merge */
private $mergedFile;
/**
* The mapper implementation. Basically does nothing in this case.
*
* @param mixed The data the mapper works on
* @return mixed The data after the mapper has been applied
* @access public
* @author Andreas Aderhold, andi@binarycloud.com
*/
function main($sourceFileName) {
if ($this->mergedFile === null) {
throw new BuildException("MergeMapper error, to attribute not set");
}
return array($this->mergedFile);
}
/**
* Accessor. Sets the to property
*
* @param string To what this mapper should convert the from string
* @return boolean True
* @access public
* @author Andreas Aderhold, andi@binarycloud.com
*/
function setTo($to) {
$this->mergedFile = $to;
}
/**
* Ignored.
*/
function setFrom($from) {}
}

View File

@@ -0,0 +1,97 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/mappers/FileNameMapper.php';
include_once 'phing/util/StringHelper.php';
include_once 'phing/util/regexp/Regexp.php';
/**
* Uses regular expressions to perform filename transformations.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@velum.net>
* @version $Id$
* @package phing.mappers
*/
class RegexpMapper implements FileNameMapper {
/**
* @var string
*/
private $to;
/**
* The Regexp engine.
* @var Regexp
*/
private $reg;
function __construct() {
// instantiage regexp matcher here
$this->reg = new Regexp();
}
/**
* Sets the &quot;from&quot; pattern. Required.
*/
function setFrom($from) {
$this->reg->SetPattern($from);
}
/**
* Sets the &quot;to&quot; pattern. Required.
*/
function setTo($to) {
// [HL] I'm changing the way this works for now to just use string
//$this->to = StringHelper::toCharArray($to);
$this->to = $to;
}
function main($sourceFileName) {
if ($this->reg === null || $this->to === null || !$this->reg->matches((string) $sourceFileName)) {
return null;
}
return array($this->replaceReferences($sourceFileName));
}
/**
* Replace all backreferences in the to pattern with the matched groups.
* groups of the source.
* @param string $source The source filename.
*/
private function replaceReferences($source) {
// FIXME
// Can't we just use engine->replace() to handle this? the Preg engine
// will automatically convert \1 references to $1
// the expression has already been processed (when ->matches() was run in Main())
// so no need to pass $source again to the engine.
$groups = (array) $this->reg->getGroups();
// replace \1 with value of $groups[1] and return the modified "to" string
return preg_replace('/\\\([\d]+)/e', "\$groups[$1]", $this->to);
}
}

View File

@@ -0,0 +1,98 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/parser/ExpatParseException.php';
/**
* This is an abstract class all SAX handler classes must extend
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @package phing.parser
*/
abstract class AbstractHandler {
public $parentHandler = null;
public $parser = null;
/**
* Constructs a SAX handler parser.
*
* The constructor must be called by all derived classes.
*
* @param object the parser object
* @param object the parent handler of this handler
*/
protected function __construct($parser, $parentHandler) {
$this->parentHandler = $parentHandler;
$this->parser = $parser;
$this->parser->setHandler($this);
}
/**
* Gets invoked when a XML open tag occurs
*
* Must be overloaded by the child class. Throws an ExpatParseException
* if there is no handler registered for an element.
*
* @param string the name of the XML element
* @param array the attributes of the XML element
*/
public function startElement($name, $attribs) {
throw new ExpatParseException("Unexpected element $name");
}
/**
* Gets invoked when element closes method.
*
*/
protected function finished() {}
/**
* Gets invoked when a XML element ends.
*
* Can be overloaded by the child class. But should not. It hands
* over control to the parentHandler of this.
*
* @param string the name of the XML element
*/
public function endElement($name) {
$this->finished();
$this->parser->setHandler($this->parentHandler);
}
/**
* Invoked by occurance of #PCDATA.
*
* @param string the name of the XML element
* @exception ExpatParserException if there is no CDATA but method
* was called
* @access public
*/
public function characters($data) {
$s = trim($data);
if (strlen($s) > 0) {
throw new ExpatParseException("Unexpected text '$s'", $this->parser->getLocation());
}
}
}

View File

@@ -0,0 +1,116 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* The abstract SAX parser class.
*
* This class represents a SAX parser. It is a abstract calss that must be
* implemented by the real parser that must extend this class
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @author Hans Lellelid <hans@xmpl.org>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @package phing.parser
*/
abstract class AbstractSAXParser {
/** The AbstractHandler object. */
protected $handler;
/**
* Constructs a SAX parser
*/
function __construct() {}
/**
* Sets options for PHP interal parser. Must be implemented by the parser
* class if it should be used.
*/
abstract function parserSetOption($opt, $val);
/**
* Sets the current element handler object for this parser. Usually this
* is an object using extending "AbstractHandler".
*
* @param AbstractHandler $obj The handler object.
*/
function setHandler( $obj) {
$this->handler = $obj;
}
/**
* Method that gets invoked when the parser runs over a XML start element.
*
* This method is called by PHP's internal parser functions and registered
* in the actual parser implementation.
* It gives control to the current active handler object by calling the
* <code>startElement()</code> method.
*
* @param object the php's internal parser handle
* @param string the open tag name
* @param array the tag's attributes if any
* @throws Exception - Exceptions may be thrown by the Handler
*/
function startElement($parser, $name, $attribs) {
$this->handler->startElement($name, $attribs);
}
/**
* Method that gets invoked when the parser runs over a XML close element.
*
* This method is called by PHP's internal parser funcitons and registered
* in the actual parser implementation.
*
* It gives control to the current active handler object by calling the
* <code>endElement()</code> method.
*
* @param object the php's internal parser handle
* @param string the closing tag name
* @throws Exception - Exceptions may be thrown by the Handler
*/
function endElement($parser, $name) {
$this->handler->endElement($name);
}
/**
* Method that gets invoked when the parser runs over CDATA.
*
* This method is called by PHP's internal parser functions and registered
* in the actual parser implementation.
*
* It gives control to the current active handler object by calling the
* <code>characters()</code> method. That processes the given CDATA.
*
* @param resource $parser php's internal parser handle.
* @param string $data the CDATA
* @throws Exception - Exceptions may be thrown by the Handler
*/
function characters($parser, $data) {
$this->handler->characters($data);
}
/**
* Entrypoint for parser. This method needs to be implemented by the
* child classt that utilizes the concrete parser
*/
abstract function parse();
}

View File

@@ -0,0 +1,40 @@
<?php
/**
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Interface for elements that want to be able to create custom child elements
* at runtime.
*
* @author keith.rogers@unit4.com
* @package phing.parser
*/
interface CustomChildCreator
{
/**
* Creates the object for the child element
*
* @param string $elementName the name of the element that has been requested
* @param Project $project The project the element is in
* @return object Returns the nested element
*/
public function customChildCreator($elementName, Project $project);
}

View File

@@ -0,0 +1,144 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
include_once 'phing/RuntimeConfigurable.php';
/**
* Configures a Project (complete with Targets and Tasks) based on
* a XML build file.
* <p>
* Design/ZE2 migration note:
* If PHP would support nested classes. All the phing/parser/*Filter
* classes would be nested within this class
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @access public
* @package phing.parser
*/
class DataTypeHandler extends AbstractHandler {
private $target;
private $element;
private $wrapper;
/**
* Constructs a new DataTypeHandler and sets up everything.
*
* @param AbstractSAXParser $parser The XML parser (default: ExpatParser)
* @param AbstractHandler $parentHandler The parent handler that invoked this handler.
* @param ProjectConfigurator $configurator The ProjectConfigurator object
* @param Target $target The target object this datatype is contained in (null for top-level datatypes).
*/
function __construct(AbstractSAXParser $parser, AbstractHandler $parentHandler, ProjectConfigurator $configurator, $target = null) { // FIXME b2 typehinting
parent::__construct($parser, $parentHandler);
$this->target = $target;
$this->configurator = $configurator;
}
/**
* Executes initialization actions required to setup the data structures
* related to the tag.
* <p>
* This includes:
* <ul>
* <li>creation of the datatype object</li>
* <li>calling the setters for attributes</li>
* <li>adding the type to the target object if any</li>
* <li>adding a reference to the task (if id attribute is given)</li>
* </ul>
*
* @param string the tag that comes in
* @param array attributes the tag carries
* @throws ExpatParseException if attributes are incomplete or invalid
* @access public
*/
function init($propType, $attrs) {
// shorthands
$project = $this->configurator->project;
$configurator = $this->configurator;
try {//try
$this->element = $project->createDataType($propType);
if ($this->element === null) {
throw new BuildException("Unknown data type $propType");
}
if ($this->target !== null) {
$this->wrapper = new RuntimeConfigurable($this->element, $propType);
$this->wrapper->setAttributes($attrs);
$this->target->addDataType($this->wrapper);
} else {
$configurator->configure($this->element, $attrs, $project);
$configurator->configureId($this->element, $attrs);
}
} catch (BuildException $exc) {
throw new ExpatParseException($exc, $this->parser->getLocation());
}
}
/**
* Handles character data.
*
* @param string the CDATA that comes in
* @access public
*/
function characters($data) {
$project = $this->configurator->project;
try {//try
$this->configurator->addText($project, $this->element, $data);
} catch (BuildException $exc) {
throw new ExpatParseException($exc->getMessage(), $this->parser->getLocation());
}
}
/**
* Checks for nested tags within the current one. Creates and calls
* handlers respectively.
*
* @param string the tag that comes in
* @param array attributes the tag carries
* @access public
*/
function startElement($name, $attrs) {
$nef = new NestedElementHandler($this->parser, $this, $this->configurator, $this->element, $this->wrapper, $this->target);
$nef->init($name, $attrs);
}
/**
* Overrides endElement for data types. Tells the type
* handler that processing the element had been finished so
* handlers know they can perform actions that need to be
* based on the data contained within the element.
*
* @param string the name of the XML element
* @return void
*/
function endElement($name) {
$this->element->parsingComplete();
parent::endElement($name);
}
}

View File

@@ -0,0 +1,31 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/BuildException.php';
/**
* This class throws errors for Expat, the XML processor.
*
* @author Andreas Aderhold, andi@binarycloud.com
* @version $Id$
* @package phing.parser
*/
class ExpatParseException extends BuildException {}

View File

@@ -0,0 +1,140 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
require_once 'phing/parser/AbstractSAXParser.php';
include_once 'phing/parser/ExpatParseException.php';
include_once 'phing/system/io/IOException.php';
include_once 'phing/system/io/FileReader.php';
/**
* This class is a wrapper for the PHP's internal expat parser.
*
* It takes an XML file represented by a abstract path name, and starts
* parsing the file and calling the different "trap" methods inherited from
* the AbstractParser class.
*
* Those methods then invoke the represenatative methods in the registered
* handler classes.
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @access public
* @package phing.parser
*/
class ExpatParser extends AbstractSAXParser {
/** @var resource */
private $parser;
/** @var Reader */
private $reader;
private $file;
private $buffer = 4096;
private $error_string = "";
private $line = 0;
/** @var Location Current cursor pos in XML file. */
private $location;
/**
* Constructs a new ExpatParser object.
*
* The constructor accepts a PhingFile object that represents the filename
* for the file to be parsed. It sets up php's internal expat parser
* and options.
*
* @param Reader $reader The Reader Object that is to be read from.
* @param string $filename Filename to read.
* @throws Exception if the given argument is not a PhingFile object
*/
function __construct(Reader $reader, $filename=null) {
$this->reader = $reader;
if ($filename !== null) {
$this->file = new PhingFile($filename);
}
$this->parser = xml_parser_create();
$this->buffer = 4096;
$this->location = new Location();
xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, array($this,"startElement"),array($this,"endElement"));
xml_set_character_data_handler($this->parser, array($this, "characters"));
}
/**
* Override PHP's parser default settings, created in the constructor.
*
* @param string the option to set
* @throws mixed the value to set
* @return boolean true if the option could be set, otherwise false
* @access public
*/
function parserSetOption($opt, $val) {
return xml_parser_set_option($this->parser, $opt, $val);
}
/**
* Returns the location object of the current parsed element. It describes
* the location of the element within the XML file (line, char)
*
* @return object the location of the current parser
* @access public
*/
function getLocation() {
if ($this->file !== null) {
$path = $this->file->getAbsolutePath();
} else {
$path = $this->reader->getResource();
}
$this->location = new Location($path, xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));
return $this->location;
}
/**
* Starts the parsing process.
*
* @param string the option to set
* @return int 1 if the parsing succeeded
* @throws ExpatParseException if something gone wrong during parsing
* @throws IOException if XML file can not be accessed
* @access public
*/
function parse() {
while ( ($data = $this->reader->read()) !== -1 ) {
if (!xml_parse($this->parser, $data, $this->reader->eof())) {
$error = xml_error_string(xml_get_error_code($this->parser));
$e = new ExpatParseException($error, $this->getLocation());
xml_parser_free($this->parser);
throw $e;
}
}
xml_parser_free($this->parser);
return 1;
}
}

View File

@@ -0,0 +1,76 @@
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information please see
* <http://phing.info>.
*/
/**
* Stores the file name and line number of a XML file
*
* @author Andreas Aderhold <andi@binarycloud.com>
* @copyright 2001,2002 THYRELL. All rights reserved
* @version $Id$
* @access public
* @package phing.parser
*/
class Location {
private $fileName;
private $lineNumber;
private $columnNumber;
/**
* Constructs the location consisting of a file name and line number
*
* @param string the filename
* @param integer the line number
* @param integer the column number
* @access public
*/
function Location($fileName = null, $lineNumber = null, $columnNumber = null) {
$this->fileName = $fileName;
$this->lineNumber = $lineNumber;
$this->columnNumber = $columnNumber;
}
/**
* Returns the file name, line number and a trailing space.
*
* An error message can be appended easily. For unknown locations,
* returns empty string.
*
* @return string the string representation of this Location object
* @access public
*/
function toString() {
$buf = "";
if ($this->fileName !== null) {
$buf.=$this->fileName;
if ($this->lineNumber !== null) {
$buf.= ":".$this->lineNumber;
}
$buf.=":".$this->columnNumber;
}
return (string) $buf;
}
function __toString () {
return $this->toString();
}
}

Some files were not shown because too many files have changed in this diff Show More