summaryrefslogtreecommitdiff
path: root/buildscripts/phing
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/phing')
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php86
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php102
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php250
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php188
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php322
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php106
-rw-r--r--buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php358
-rw-r--r--buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php104
-rw-r--r--buildscripts/phing/tasks/ManualIndexTask.php74
-rw-r--r--buildscripts/phing/tasks/PradoDocTask.php296
-rw-r--r--buildscripts/phing/tasks/PradoPackageTask.php280
-rw-r--r--buildscripts/phing/tasks/PradoQuickStartDocs.php168
-rw-r--r--buildscripts/phing/tasks/PradoSimpleTestTask.php78
-rw-r--r--buildscripts/phing/tasks/PradoTestTask.php34
-rw-r--r--buildscripts/phing/tasks/QuickstartIndexTask.php62
15 files changed, 1254 insertions, 1254 deletions
diff --git a/buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php b/buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php
index 99434aaa..76780fa6 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/ioncube/IoncubeComment.php
@@ -1,44 +1,44 @@
-<?php
-/**
- * $Id: IoncubeComment.php 59 2006-04-28 14:49:47Z mrook $
- *
- * 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 for comments for ionCube tasks
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: IoncubeComment.php 59 2006-04-28 14:49:47Z mrook $
- * @package phing.tasks.ext.ioncube
- * @since 2.2.0
- */
-class IoncubeComment
-{
- private $value = "";
-
- public function getValue()
- {
- return $this->value;
- }
-
- public function addText($txt)
- {
- $this->value = trim($txt);
- }
-}
+<?php
+/**
+ * $Id: IoncubeComment.php 59 2006-04-28 14:49:47Z mrook $
+ *
+ * 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 for comments for ionCube tasks
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: IoncubeComment.php 59 2006-04-28 14:49:47Z mrook $
+ * @package phing.tasks.ext.ioncube
+ * @since 2.2.0
+ */
+class IoncubeComment
+{
+ private $value = "";
+
+ public function getValue()
+ {
+ return $this->value;
+ }
+
+ public function addText($txt)
+ {
+ $this->value = trim($txt);
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php
index 11e360e0..654d65dd 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php
@@ -1,52 +1,52 @@
-<?php
-/**
- * $Id: SimpleTestCountResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
- *
- * 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/ext/simpletest/SimpleTestResultFormatter.php';
-
-/**
- * Dummy result formatter used to count SimpleTest results
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: SimpleTestCountResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
- * @package phing.tasks.ext.simpletest
- * @since 2.2.0
- */
-class SimpleTestCountResultFormatter extends SimpleTestResultFormatter
-{
- const SUCCESS = 0;
- const FAILURES = 1;
- const ERRORS = 2;
-
- function getRetCode()
- {
- if ($this->getExceptionCount() != 0)
- {
- return self::ERRORS;
- }
- else if ($this->getFailCount() != 0)
- {
- return self::FAILURES;
- }
-
- return self::SUCCESS;
- }
-}
+<?php
+/**
+ * $Id: SimpleTestCountResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
+ *
+ * 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/ext/simpletest/SimpleTestResultFormatter.php';
+
+/**
+ * Dummy result formatter used to count SimpleTest results
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: SimpleTestCountResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
+ * @package phing.tasks.ext.simpletest
+ * @since 2.2.0
+ */
+class SimpleTestCountResultFormatter extends SimpleTestResultFormatter
+{
+ const SUCCESS = 0;
+ const FAILURES = 1;
+ const ERRORS = 2;
+
+ function getRetCode()
+ {
+ if ($this->getExceptionCount() != 0)
+ {
+ return self::ERRORS;
+ }
+ else if ($this->getFailCount() != 0)
+ {
+ return self::FAILURES;
+ }
+
+ return self::SUCCESS;
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
index 82bf5776..768a041f 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestFormatterElement.php
@@ -1,126 +1,126 @@
-<?php
-/**
- * $Id: SimpleTestFormatterElement.php 58 2006-04-28 14:41:04Z mrook $
- *
- * 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/ext/simpletest/SimpleTestPlainResultFormatter.php';
-require_once 'phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php';
-require_once 'phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php';
-
-/**
- * Child class of "FormatterElement", overrides setType to provide other
- * formatter classes for SimpleTest
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: SimpleTestFormatterElement.php 58 2006-04-28 14:41:04Z mrook $
- * @package phing.tasks.ext.simpletest
- * @since 2.2.0
- */
-class SimpleTestFormatterElement
-{
- protected $formatter = NULL;
-
- protected $type = "";
-
- protected $useFile = true;
-
- protected $toDir = ".";
-
- protected $outfile = "";
-
- function setType($type)
- {
- $this->type = $type;
-
- if ($this->type == "xml")
- {
- //$destFile = new PhingFile($this->toDir, 'testsuites.xml');
- $this->formatter = new SimpleTestXmlResultFormatter();
- }
- else
- if ($this->type == "plain")
- {
- $this->formatter = new SimpleTestPlainResultFormatter();
- }
- else
- if ($this->type == "summary")
- {
- $this->formatter = new SimpleTestSummaryResultFormatter();
- }
- else
- {
- throw new BuildException("Formatter '" . $this->type . "' not implemented");
- }
- }
-
- function setClassName($className)
- {
- $classNameNoDot = Phing::import($className);
-
- $this->formatter = new $classNameNoDot();
- }
-
- function setUseFile($useFile)
- {
- $this->useFile = $useFile;
- }
-
- function getUseFile()
- {
- return $this->useFile;
- }
-
- function setToDir($toDir)
- {
- $this->toDir = $toDir;
- }
-
- function getToDir()
- {
- return $this->toDir;
- }
-
- function setOutfile($outfile)
- {
- $this->outfile = $outfile;
- }
-
- function getOutfile()
- {
- if ($this->outfile)
- {
- return $this->outfile;
- }
- else
- {
- return $this->formatter->getPreferredOutfile() . $this->getExtension();
- }
- }
-
- function getExtension()
- {
- return $this->formatter->getExtension();
- }
-
- function getFormatter()
- {
- return $this->formatter;
- }
-}
+<?php
+/**
+ * $Id: SimpleTestFormatterElement.php 58 2006-04-28 14:41:04Z mrook $
+ *
+ * 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/ext/simpletest/SimpleTestPlainResultFormatter.php';
+require_once 'phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php';
+require_once 'phing/tasks/ext/simpletest/SimpleTestXmlResultFormatter.php';
+
+/**
+ * Child class of "FormatterElement", overrides setType to provide other
+ * formatter classes for SimpleTest
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: SimpleTestFormatterElement.php 58 2006-04-28 14:41:04Z mrook $
+ * @package phing.tasks.ext.simpletest
+ * @since 2.2.0
+ */
+class SimpleTestFormatterElement
+{
+ protected $formatter = NULL;
+
+ protected $type = "";
+
+ protected $useFile = true;
+
+ protected $toDir = ".";
+
+ protected $outfile = "";
+
+ function setType($type)
+ {
+ $this->type = $type;
+
+ if ($this->type == "xml")
+ {
+ //$destFile = new PhingFile($this->toDir, 'testsuites.xml');
+ $this->formatter = new SimpleTestXmlResultFormatter();
+ }
+ else
+ if ($this->type == "plain")
+ {
+ $this->formatter = new SimpleTestPlainResultFormatter();
+ }
+ else
+ if ($this->type == "summary")
+ {
+ $this->formatter = new SimpleTestSummaryResultFormatter();
+ }
+ else
+ {
+ throw new BuildException("Formatter '" . $this->type . "' not implemented");
+ }
+ }
+
+ function setClassName($className)
+ {
+ $classNameNoDot = Phing::import($className);
+
+ $this->formatter = new $classNameNoDot();
+ }
+
+ function setUseFile($useFile)
+ {
+ $this->useFile = $useFile;
+ }
+
+ function getUseFile()
+ {
+ return $this->useFile;
+ }
+
+ function setToDir($toDir)
+ {
+ $this->toDir = $toDir;
+ }
+
+ function getToDir()
+ {
+ return $this->toDir;
+ }
+
+ function setOutfile($outfile)
+ {
+ $this->outfile = $outfile;
+ }
+
+ function getOutfile()
+ {
+ if ($this->outfile)
+ {
+ return $this->outfile;
+ }
+ else
+ {
+ return $this->formatter->getPreferredOutfile() . $this->getExtension();
+ }
+ }
+
+ function getExtension()
+ {
+ return $this->formatter->getExtension();
+ }
+
+ function getFormatter()
+ {
+ return $this->formatter;
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php
index 688e2fe6..9d570486 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestPlainResultFormatter.php
@@ -1,95 +1,95 @@
-<?php
-/**
- * $Id: SimpleTestPlainResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
- *
- * 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/ext/simpletest/SimpleTestResultFormatter.php';
-
-/**
- * Prints plain text output of the test to a specified Writer.
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: SimpleTestPlainResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
- * @package phing.tasks.ext.simpletest
- * @since 2.2.0
- */
-class SimpleTestPlainResultFormatter extends SimpleTestResultFormatter
-{
- private $inner = "";
-
- function getExtension()
- {
- return ".txt";
- }
-
- function getPreferredOutfile()
- {
- return "testresults";
- }
-
- function paintCaseStart($test_name)
- {
- parent::paintCaseStart($test_name);
-
- $this->inner = "";
- }
-
- function paintCaseEnd($test_name)
- {
- parent::paintCaseEnd($test_name);
-
- /* Only count suites where more than one test was run */
- if ($this->getRunCount())
- {
- $sb = "Testsuite: $test_name\n";
- $sb.= "Tests run: " . $this->getRunCount();
- $sb.= ", Failures: " . $this->getFailureCount();
- $sb.= ", Errors: " . $this->getErrorCount();
- $sb.= ", Time elapsed: " . $this->getElapsedTime();
- $sb.= " sec\n";
-
- if ($this->out != NULL)
- {
- $this->out->write($sb);
- $this->out->write($this->inner);
- }
- }
- }
-
- function paintError($message)
- {
- parent::paintError($message);
-
- $this->formatError("ERROR", $message);
- }
-
- function paintFail($message)
- {
- parent::paintFail($message);
-
- $this->formatError("FAILED", $message);
- }
-
- private function formatError($type, $message)
- {
- $this->inner.= $this->getTestName() . " " . $type . "\n";
- $this->inner.= $message . "\n";
- }
-}
+<?php
+/**
+ * $Id: SimpleTestPlainResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
+ *
+ * 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/ext/simpletest/SimpleTestResultFormatter.php';
+
+/**
+ * Prints plain text output of the test to a specified Writer.
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: SimpleTestPlainResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
+ * @package phing.tasks.ext.simpletest
+ * @since 2.2.0
+ */
+class SimpleTestPlainResultFormatter extends SimpleTestResultFormatter
+{
+ private $inner = "";
+
+ function getExtension()
+ {
+ return ".txt";
+ }
+
+ function getPreferredOutfile()
+ {
+ return "testresults";
+ }
+
+ function paintCaseStart($test_name)
+ {
+ parent::paintCaseStart($test_name);
+
+ $this->inner = "";
+ }
+
+ function paintCaseEnd($test_name)
+ {
+ parent::paintCaseEnd($test_name);
+
+ /* Only count suites where more than one test was run */
+ if ($this->getRunCount())
+ {
+ $sb = "Testsuite: $test_name\n";
+ $sb.= "Tests run: " . $this->getRunCount();
+ $sb.= ", Failures: " . $this->getFailureCount();
+ $sb.= ", Errors: " . $this->getErrorCount();
+ $sb.= ", Time elapsed: " . $this->getElapsedTime();
+ $sb.= " sec\n";
+
+ if ($this->out != NULL)
+ {
+ $this->out->write($sb);
+ $this->out->write($this->inner);
+ }
+ }
+ }
+
+ function paintError($message)
+ {
+ parent::paintError($message);
+
+ $this->formatError("ERROR", $message);
+ }
+
+ function paintFail($message)
+ {
+ parent::paintFail($message);
+
+ $this->formatError("FAILED", $message);
+ }
+
+ private function formatError($type, $message)
+ {
+ $this->inner.= $this->getTestName() . " " . $type . "\n";
+ $this->inner.= $message . "\n";
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php
index 4583cf27..35077210 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestResultFormatter.php
@@ -1,162 +1,162 @@
-<?php
-/**
- * $Id: SimpleTestResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
- *
- * 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 'simpletest/scorer.php';
-
-require_once 'phing/system/io/Writer.php';
-
-/**
- * This abstract class describes classes that format the results of a SimpleTest testrun.
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: SimpleTestResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
- * @package phing.tasks.ext.phpunit2
- * @since 2.2.0
- */
-abstract class SimpleTestResultFormatter extends SimpleReporter
-{
- protected $out = NULL;
-
- protected $project = NULL;
-
- private $timer = NULL;
-
- private $runCount = 0;
-
- private $failureCount = 0;
-
- private $errorCount = 0;
-
- private $currentTest = "";
-
- /**
- * Sets the writer the formatter is supposed to write its results to.
- */
- function setOutput(Writer $out)
- {
- $this->out = $out;
- }
-
- /**
- * Returns the extension used for this formatter
- *
- * @return string the extension
- */
- function getExtension()
- {
- return "";
- }
-
- /**
- * Sets the project
- *
- * @param Project the project
- */
- function setProject(Project $project)
- {
- $this->project = $project;
- }
-
- function getPreferredOutfile()
- {
- return "";
- }
-
- function paintMethodStart($test_name)
- {
- parent::paintMethodStart($test_name);
-
- $this->currentTest = $test_name;
- }
-
- function paintMethodEnd($test_name)
- {
- parent::paintMethodEnd($test_name);
-
- $this->runCount++;
- }
-
- function paintCaseStart($test_name)
- {
- parent::paintCaseStart($test_name);
-
- $this->runCount = 0;
- $this->failureCount = 0;
- $this->errorCount = 0;
-
- $this->timer = new Timer();
- $this->timer->start();
- }
-
- function paintCaseEnd($test_name)
- {
- parent::paintCaseEnd($test_name);
-
- $this->timer->stop();
- }
-
- function paintError($message)
- {
- parent::paintError($message);
-
- $this->errorCount++;
- }
-
- function paintFail($message)
- {
- parent::paintFail($message);
-
- $this->failureCount++;
- }
-
- function getRunCount()
- {
- return $this->runCount;
- }
-
- function getFailureCount()
- {
- return $this->failureCount;
- }
-
- function getErrorCount()
- {
- return $this->errorCount;
- }
-
- function getTestName()
- {
- return $this->currentTest;
- }
-
- function getElapsedTime()
- {
- if ($this->timer)
- {
- return $this->timer->getElapsedTime();
- }
- else
- {
- return 0;
- }
- }
-}
+<?php
+/**
+ * $Id: SimpleTestResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
+ *
+ * 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 'simpletest/scorer.php';
+
+require_once 'phing/system/io/Writer.php';
+
+/**
+ * This abstract class describes classes that format the results of a SimpleTest testrun.
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: SimpleTestResultFormatter.php 58 2006-04-28 14:41:04Z mrook $
+ * @package phing.tasks.ext.phpunit2
+ * @since 2.2.0
+ */
+abstract class SimpleTestResultFormatter extends SimpleReporter
+{
+ protected $out = NULL;
+
+ protected $project = NULL;
+
+ private $timer = NULL;
+
+ private $runCount = 0;
+
+ private $failureCount = 0;
+
+ private $errorCount = 0;
+
+ private $currentTest = "";
+
+ /**
+ * Sets the writer the formatter is supposed to write its results to.
+ */
+ function setOutput(Writer $out)
+ {
+ $this->out = $out;
+ }
+
+ /**
+ * Returns the extension used for this formatter
+ *
+ * @return string the extension
+ */
+ function getExtension()
+ {
+ return "";
+ }
+
+ /**
+ * Sets the project
+ *
+ * @param Project the project
+ */
+ function setProject(Project $project)
+ {
+ $this->project = $project;
+ }
+
+ function getPreferredOutfile()
+ {
+ return "";
+ }
+
+ function paintMethodStart($test_name)
+ {
+ parent::paintMethodStart($test_name);
+
+ $this->currentTest = $test_name;
+ }
+
+ function paintMethodEnd($test_name)
+ {
+ parent::paintMethodEnd($test_name);
+
+ $this->runCount++;
+ }
+
+ function paintCaseStart($test_name)
+ {
+ parent::paintCaseStart($test_name);
+
+ $this->runCount = 0;
+ $this->failureCount = 0;
+ $this->errorCount = 0;
+
+ $this->timer = new Timer();
+ $this->timer->start();
+ }
+
+ function paintCaseEnd($test_name)
+ {
+ parent::paintCaseEnd($test_name);
+
+ $this->timer->stop();
+ }
+
+ function paintError($message)
+ {
+ parent::paintError($message);
+
+ $this->errorCount++;
+ }
+
+ function paintFail($message)
+ {
+ parent::paintFail($message);
+
+ $this->failureCount++;
+ }
+
+ function getRunCount()
+ {
+ return $this->runCount;
+ }
+
+ function getFailureCount()
+ {
+ return $this->failureCount;
+ }
+
+ function getErrorCount()
+ {
+ return $this->errorCount;
+ }
+
+ function getTestName()
+ {
+ return $this->currentTest;
+ }
+
+ function getElapsedTime()
+ {
+ if ($this->timer)
+ {
+ return $this->timer->getElapsedTime();
+ }
+ else
+ {
+ return 0;
+ }
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php
index bd691374..a2fafb0a 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/simpletest/SimpleTestSummaryResultFormatter.php
@@ -1,54 +1,54 @@
-<?php
-/**
- * $Id: SimpleTestSummaryResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
- *
- * 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/ext/simpletest/SimpleTestResultFormatter.php';
-
-/**
- * Prints short summary output of the test to Phing's logging system.
- *
- * @author Michiel Rook <michiel@trendserver.nl>
- * @version $Id: SimpleTestSummaryResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
- * @package phing.tasks.ext.simpletest
- * @since 2.2.0
- */
-class SimpleTestSummaryResultFormatter extends SimpleTestResultFormatter
-{
- function paintCaseEnd($test_name)
- {
- parent::paintCaseEnd($test_name);
-
- /* Only count suites where more than one test was run */
- if ($this->getRunCount())
- {
- $sb= "Tests run: " . $this->getRunCount();
- $sb.= ", Failures: " . $this->getFailureCount();
- $sb.= ", Errors: " . $this->getErrorCount();
- $sb.= ", Time elapsed: " . $this->getElapsedTime();
- $sb.= " sec\n";
-
- if ($this->out != NULL)
- {
- $this->out->write($sb);
- }
- }
- }
-}
+<?php
+/**
+ * $Id: SimpleTestSummaryResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
+ *
+ * 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/ext/simpletest/SimpleTestResultFormatter.php';
+
+/**
+ * Prints short summary output of the test to Phing's logging system.
+ *
+ * @author Michiel Rook <michiel@trendserver.nl>
+ * @version $Id: SimpleTestSummaryResultFormatter.php 59 2006-04-28 14:49:47Z mrook $
+ * @package phing.tasks.ext.simpletest
+ * @since 2.2.0
+ */
+class SimpleTestSummaryResultFormatter extends SimpleTestResultFormatter
+{
+ function paintCaseEnd($test_name)
+ {
+ parent::paintCaseEnd($test_name);
+
+ /* Only count suites where more than one test was run */
+ if ($this->getRunCount())
+ {
+ $sb= "Tests run: " . $this->getRunCount();
+ $sb.= ", Failures: " . $this->getFailureCount();
+ $sb.= ", Errors: " . $this->getErrorCount();
+ $sb.= ", Time elapsed: " . $this->getElapsedTime();
+ $sb.= " sec\n";
+
+ if ($this->out != NULL)
+ {
+ $this->out->write($sb);
+ }
+ }
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php b/buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php
index 71e3ba2e..55c695cf 100644
--- a/buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php
+++ b/buildscripts/phing/classes/phing/tasks/ext/svn/SvnBaseTask.php
@@ -1,180 +1,180 @@
-<?php
-/*
- * $Id: SvnBaseTask.php 38 2006-03-09 14:05:11Z mrook $
- *
- * 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/Task.php';
-
-/**
- * Send a message by mail()
- *
- * <mail to="user@example.org" subject="build complete">The build process is a success...</mail>
- *
- * @author Francois Harvey at SecuriWeb (http://www.securiweb.net)
- * @version $Id: SvnBaseTask.php 38 2006-03-09 14:05:11Z mrook $
- * @package phing.tasks.ext
- */
-abstract class SvnBaseTask extends Task
-{
- private $workingCopy = "";
-
- private $repositoryUrl = "";
-
- private $svnPath = "/usr/bin/svn";
-
- private $svn = NULL;
-
- private $mode = "";
-
- private $svnArgs = array();
-
- /**
- * Initialize Task.
- * This method includes any necessary SVN libraries and triggers
- * appropriate error if they cannot be found. This is not done in header
- * because we may want this class to be loaded w/o triggering an error.
- */
- function init() {
- include_once 'VersionControl/SVN.php';
- if (!class_exists('VersionControl_SVN')) {
- throw new Exception("SvnLastRevisionTask depends on PEAR VersionControl_SVN package being installed.");
- }
- }
-
- /**
- * Sets the path to the workingcopy
- */
- function setWorkingCopy($workingCopy)
- {
- $this->workingCopy = $workingCopy;
- }
-
- /**
- * Returns the path to the workingcopy
- */
- function getWorkingCopy()
- {
- return $this->workingCopy;
- }
-
- /**
- * Sets the path/URI to the repository
- */
- function setRepositoryUrl($repositoryUrl)
- {
- $this->repositoryUrl = $repositoryUrl;
- }
-
- /**
- * Returns the path/URI to the repository
- */
- function getRepositoryUrl()
- {
- return $this->repositoryUrl;
- }
-
- /**
- * Sets the path to the SVN executable
- */
- function setSvnPath($svnPath)
- {
- $this->svnPath = $svnPath;
- }
-
- /**
- * Returns the path to the SVN executable
- */
- function getSvnPath()
- {
- return $this->svnPath;
- }
-
- /**
- * Creates a VersionControl_SVN class based on $mode
- *
- * @param string The SVN mode to use (info, export, checkout, ...)
- * @throws BuildException
- */
- protected function setup($mode)
- {
- $this->mode = $mode;
-
- // Set up runtime options. Will be passed to all
- // subclasses.
- $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_ASSOC, 'svn_path' => $this->getSvnPath());
-
- // Pass array of subcommands we need to factory
- $this->svn = VersionControl_SVN::factory($mode, $options);
-
- if (!empty($this->repositoryUrl))
- {
- $this->svnArgs = array($this->repositoryUrl);
- }
- else
- if (!empty($this->workingCopy))
- {
- if (is_dir($this->workingCopy))
- {
- if (in_array(".svn", scandir($this->workingCopy)))
- {
- $this->svnArgs = array($this->workingCopy);
- }
- else
- {
- throw new BuildException("'".$this->workingCopy."' doesn't seem to be a working copy");
- }
- }
- else
- {
- throw new BuildException("'".$this->workingCopy."' is not a directory");
- }
- }
- }
-
- /**
- * Executes the constructed VersionControl_SVN instance
- *
- * @param array Additional arguments to pass to SVN.
- * @param array Switches to pass to SVN.
- * @return string Output generated by SVN.
- */
- protected function run($args = array(), $switches = array())
- {
- $svnstack = PEAR_ErrorStack::singleton('VersionControl_SVN');
-
- $tempArgs = $this->svnArgs;
-
- $tempArgs = array_merge($tempArgs, $args);
-
- if ($output = $this->svn->run($tempArgs, $switches))
- {
- return $output;
- }
- else
- {
- if (count($errs = $svnstack->getErrors()))
- {
- $err = current($errs);
-
- throw new BuildException("Failed to run the 'svn " . $this->mode . "' command: " . $err['message']);
- }
- }
- }
-}
+<?php
+/*
+ * $Id: SvnBaseTask.php 38 2006-03-09 14:05:11Z mrook $
+ *
+ * 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/Task.php';
+
+/**
+ * Send a message by mail()
+ *
+ * <mail to="user@example.org" subject="build complete">The build process is a success...</mail>
+ *
+ * @author Francois Harvey at SecuriWeb (http://www.securiweb.net)
+ * @version $Id: SvnBaseTask.php 38 2006-03-09 14:05:11Z mrook $
+ * @package phing.tasks.ext
+ */
+abstract class SvnBaseTask extends Task
+{
+ private $workingCopy = "";
+
+ private $repositoryUrl = "";
+
+ private $svnPath = "/usr/bin/svn";
+
+ private $svn = NULL;
+
+ private $mode = "";
+
+ private $svnArgs = array();
+
+ /**
+ * Initialize Task.
+ * This method includes any necessary SVN libraries and triggers
+ * appropriate error if they cannot be found. This is not done in header
+ * because we may want this class to be loaded w/o triggering an error.
+ */
+ function init() {
+ include_once 'VersionControl/SVN.php';
+ if (!class_exists('VersionControl_SVN')) {
+ throw new Exception("SvnLastRevisionTask depends on PEAR VersionControl_SVN package being installed.");
+ }
+ }
+
+ /**
+ * Sets the path to the workingcopy
+ */
+ function setWorkingCopy($workingCopy)
+ {
+ $this->workingCopy = $workingCopy;
+ }
+
+ /**
+ * Returns the path to the workingcopy
+ */
+ function getWorkingCopy()
+ {
+ return $this->workingCopy;
+ }
+
+ /**
+ * Sets the path/URI to the repository
+ */
+ function setRepositoryUrl($repositoryUrl)
+ {
+ $this->repositoryUrl = $repositoryUrl;
+ }
+
+ /**
+ * Returns the path/URI to the repository
+ */
+ function getRepositoryUrl()
+ {
+ return $this->repositoryUrl;
+ }
+
+ /**
+ * Sets the path to the SVN executable
+ */
+ function setSvnPath($svnPath)
+ {
+ $this->svnPath = $svnPath;
+ }
+
+ /**
+ * Returns the path to the SVN executable
+ */
+ function getSvnPath()
+ {
+ return $this->svnPath;
+ }
+
+ /**
+ * Creates a VersionControl_SVN class based on $mode
+ *
+ * @param string The SVN mode to use (info, export, checkout, ...)
+ * @throws BuildException
+ */
+ protected function setup($mode)
+ {
+ $this->mode = $mode;
+
+ // Set up runtime options. Will be passed to all
+ // subclasses.
+ $options = array('fetchmode' => VERSIONCONTROL_SVN_FETCHMODE_ASSOC, 'svn_path' => $this->getSvnPath());
+
+ // Pass array of subcommands we need to factory
+ $this->svn = VersionControl_SVN::factory($mode, $options);
+
+ if (!empty($this->repositoryUrl))
+ {
+ $this->svnArgs = array($this->repositoryUrl);
+ }
+ else
+ if (!empty($this->workingCopy))
+ {
+ if (is_dir($this->workingCopy))
+ {
+ if (in_array(".svn", scandir($this->workingCopy)))
+ {
+ $this->svnArgs = array($this->workingCopy);
+ }
+ else
+ {
+ throw new BuildException("'".$this->workingCopy."' doesn't seem to be a working copy");
+ }
+ }
+ else
+ {
+ throw new BuildException("'".$this->workingCopy."' is not a directory");
+ }
+ }
+ }
+
+ /**
+ * Executes the constructed VersionControl_SVN instance
+ *
+ * @param array Additional arguments to pass to SVN.
+ * @param array Switches to pass to SVN.
+ * @return string Output generated by SVN.
+ */
+ protected function run($args = array(), $switches = array())
+ {
+ $svnstack = PEAR_ErrorStack::singleton('VersionControl_SVN');
+
+ $tempArgs = $this->svnArgs;
+
+ $tempArgs = array_merge($tempArgs, $args);
+
+ if ($output = $this->svn->run($tempArgs, $switches))
+ {
+ return $output;
+ }
+ else
+ {
+ if (count($errs = $svnstack->getErrors()))
+ {
+ $err = current($errs);
+
+ throw new BuildException("Failed to run the 'svn " . $this->mode . "' command: " . $err['message']);
+ }
+ }
+ }
+}
?> \ No newline at end of file
diff --git a/buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php b/buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php
index 04c1cbbd..09324fb8 100644
--- a/buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php
+++ b/buildscripts/phing/classes/phing/tasks/system/condition/ReferenceExistsCondition.php
@@ -1,52 +1,52 @@
-<?php
-/*
- * $Id: ReferenceExistsCondition.php 59 2006-04-28 14:49:47Z mrook $
- *
- * 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'; require_once 'phing/tasks/system/condition/Condition.php';
-
-/**
- * Condition that tests whether a given reference exists.
- *
- * @author Matthias Pigulla <mp@webfactory.de> (Phing)
- * @version $Revision: 1.1 $
- * @package phing.tasks.system.condition */
-class ReferenceExistsCondition extends ProjectComponent implements Condition {
-
- private $refid;
-
- public function setRef($id) {
- $this->refid = (string) $id;
- }
-
- /**
- * Check whether the reference exists.
- * @throws BuildException
- */
- public function evaluate() {
- if ($this->refid === null) {
- throw new BuildException("No ref attribute specified for reference-exists "
- . "condition");
- }
- $refs = $this->project->getReferences();
- return isset($refs[$this->refid]);
- }
-
-}
-
+<?php
+/*
+ * $Id: ReferenceExistsCondition.php 59 2006-04-28 14:49:47Z mrook $
+ *
+ * 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'; require_once 'phing/tasks/system/condition/Condition.php';
+
+/**
+ * Condition that tests whether a given reference exists.
+ *
+ * @author Matthias Pigulla <mp@webfactory.de> (Phing)
+ * @version $Revision: 1.1 $
+ * @package phing.tasks.system.condition */
+class ReferenceExistsCondition extends ProjectComponent implements Condition {
+
+ private $refid;
+
+ public function setRef($id) {
+ $this->refid = (string) $id;
+ }
+
+ /**
+ * Check whether the reference exists.
+ * @throws BuildException
+ */
+ public function evaluate() {
+ if ($this->refid === null) {
+ throw new BuildException("No ref attribute specified for reference-exists "
+ . "condition");
+ }
+ $refs = $this->project->getReferences();
+ return isset($refs[$this->refid]);
+ }
+
+}
+
diff --git a/buildscripts/phing/tasks/ManualIndexTask.php b/buildscripts/phing/tasks/ManualIndexTask.php
index 1725880f..c689d4c5 100644
--- a/buildscripts/phing/tasks/ManualIndexTask.php
+++ b/buildscripts/phing/tasks/ManualIndexTask.php
@@ -1,38 +1,38 @@
-<?php
-
-require_once 'phing/Task.php';
-
-/**
- * Task to index PRADO API docs.
- */
-class ManualIndexTask extends Task
-{
- private $docdir;
- private $todir;
-
- /**
- * @param string the API documentation directory
- */
- public function setDocdir($value)
- {
- $this->docdir=$value;
- }
-
- public function setTodir($value)
- {
- $this->todir=$value;
- }
-
- public function main()
- {
- $srcdir=realpath(dirname(__FILE__).'/../../../');
- $zend_path = $srcdir.'/demos/quickstart/protected/index';
- set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path));
- require_once ('Zend/Search/Lucene.php');
- require_once($srcdir.'/buildscripts/index/api_index.php');
- $api = new api_index($this->todir, realpath($this->docdir));
- $api->create_index();
- }
-}
-
+<?php
+
+require_once 'phing/Task.php';
+
+/**
+ * Task to index PRADO API docs.
+ */
+class ManualIndexTask extends Task
+{
+ private $docdir;
+ private $todir;
+
+ /**
+ * @param string the API documentation directory
+ */
+ public function setDocdir($value)
+ {
+ $this->docdir=$value;
+ }
+
+ public function setTodir($value)
+ {
+ $this->todir=$value;
+ }
+
+ public function main()
+ {
+ $srcdir=realpath(dirname(__FILE__).'/../../../');
+ $zend_path = $srcdir.'/demos/quickstart/protected/index';
+ set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path));
+ require_once ('Zend/Search/Lucene.php');
+ require_once($srcdir.'/buildscripts/index/api_index.php');
+ $api = new api_index($this->todir, realpath($this->docdir));
+ $api->create_index();
+ }
+}
+
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoDocTask.php b/buildscripts/phing/tasks/PradoDocTask.php
index ac64ac5a..944fde82 100644
--- a/buildscripts/phing/tasks/PradoDocTask.php
+++ b/buildscripts/phing/tasks/PradoDocTask.php
@@ -1,149 +1,149 @@
-<?php
-require_once 'phing/Task.php';
-
-/**
- * Task to run phpDocumentor for PRADO API docs.
- */
-class PradoDocTask extends Task
-{
- private $phpdoc = 'phpdoc';
-
- private $title = "Default Title";
-
- private $destdir = ".";
-
- private $sourcepath = NULL;
-
- private $ignorelist = '';
-
- private $output = "";
-
- private $linksource = false;
-
- private $parseprivate = false;
-
- private $quite = false;
-
- function setPhpdoc($phpdoc)
- {
- $this->phpdoc=$phpdoc;
- }
-
- function setQuite($quite)
- {
- $this->quite=$quite;
- }
-
- /**
- * Set the title for the generated documentation
- */
- function setTitle($title)
- {
- $this->title = $title;
- }
-
- /**
- * Set the destination directory for the generated documentation
- */
- function setDestdir($destdir)
- {
- $this->destdir = $destdir;
- }
-
- /**
- * Set the source path
- */
- function setSourcepath(Path $sourcepath)
- {
- if ($this->sourcepath === NULL)
- {
- $this->sourcepath = $sourcepath;
- }
- else
- {
- $this->sourcepath->append($sourcepath);
- }
- }
-
- /**
- * Set the output type
- */
- function setOutput($output)
- {
- $this->output = $output;
- }
-
- /**
- * Should sources be linked in the generated documentation
- */
- function setLinksource($linksource)
- {
- $this->linksource = $linksource;
- }
-
- function setIgnorelist($ignorelist)
- {
- $this->ignorelist=$ignorelist;
- }
-
- /**
- * Main entrypoint of the task
- */
- function main()
- {
- $arguments = $this->constructArguments();
- passthru($this->phpdoc . " " . $arguments, $retval);
- }
-
- /**
- * Constructs an argument string for phpDocumentor
- */
- private function constructArguments()
- {
- $arguments = " ";
-
- if($this->quite)
- {
- $arguments .= '-q "on" ';
- }
-
- if ($this->title)
- {
- $arguments.= "-ti \"" . $this->title . "\" ";
- }
-
- if ($this->destdir)
- {
- $arguments.= "-t \"" . $this->destdir . "\" ";
- }
-
- if ($this->sourcepath !== NULL)
- {
- $arguments.= "-d \"" . $this->sourcepath->__toString() . "\" ";
- }
-
- if ($this->output)
- {
- $arguments.= "-o \"" . $this->output . "\" ";
- }
-
- if ($this->linksource)
- {
- $arguments.= "-s ";
- }
-
- if ($this->parseprivate)
- {
- $arguments.= "-pp ";
- }
-
- if ($this->ignorelist)
- {
- $arguments.='-i "'.$this->ignorelist.'" ';
- }
-
- return $arguments;
- }
-}
-
+<?php
+require_once 'phing/Task.php';
+
+/**
+ * Task to run phpDocumentor for PRADO API docs.
+ */
+class PradoDocTask extends Task
+{
+ private $phpdoc = 'phpdoc';
+
+ private $title = "Default Title";
+
+ private $destdir = ".";
+
+ private $sourcepath = NULL;
+
+ private $ignorelist = '';
+
+ private $output = "";
+
+ private $linksource = false;
+
+ private $parseprivate = false;
+
+ private $quite = false;
+
+ function setPhpdoc($phpdoc)
+ {
+ $this->phpdoc=$phpdoc;
+ }
+
+ function setQuite($quite)
+ {
+ $this->quite=$quite;
+ }
+
+ /**
+ * Set the title for the generated documentation
+ */
+ function setTitle($title)
+ {
+ $this->title = $title;
+ }
+
+ /**
+ * Set the destination directory for the generated documentation
+ */
+ function setDestdir($destdir)
+ {
+ $this->destdir = $destdir;
+ }
+
+ /**
+ * Set the source path
+ */
+ function setSourcepath(Path $sourcepath)
+ {
+ if ($this->sourcepath === NULL)
+ {
+ $this->sourcepath = $sourcepath;
+ }
+ else
+ {
+ $this->sourcepath->append($sourcepath);
+ }
+ }
+
+ /**
+ * Set the output type
+ */
+ function setOutput($output)
+ {
+ $this->output = $output;
+ }
+
+ /**
+ * Should sources be linked in the generated documentation
+ */
+ function setLinksource($linksource)
+ {
+ $this->linksource = $linksource;
+ }
+
+ function setIgnorelist($ignorelist)
+ {
+ $this->ignorelist=$ignorelist;
+ }
+
+ /**
+ * Main entrypoint of the task
+ */
+ function main()
+ {
+ $arguments = $this->constructArguments();
+ passthru($this->phpdoc . " " . $arguments, $retval);
+ }
+
+ /**
+ * Constructs an argument string for phpDocumentor
+ */
+ private function constructArguments()
+ {
+ $arguments = " ";
+
+ if($this->quite)
+ {
+ $arguments .= '-q "on" ';
+ }
+
+ if ($this->title)
+ {
+ $arguments.= "-ti \"" . $this->title . "\" ";
+ }
+
+ if ($this->destdir)
+ {
+ $arguments.= "-t \"" . $this->destdir . "\" ";
+ }
+
+ if ($this->sourcepath !== NULL)
+ {
+ $arguments.= "-d \"" . $this->sourcepath->__toString() . "\" ";
+ }
+
+ if ($this->output)
+ {
+ $arguments.= "-o \"" . $this->output . "\" ";
+ }
+
+ if ($this->linksource)
+ {
+ $arguments.= "-s ";
+ }
+
+ if ($this->parseprivate)
+ {
+ $arguments.= "-pp ";
+ }
+
+ if ($this->ignorelist)
+ {
+ $arguments.='-i "'.$this->ignorelist.'" ';
+ }
+
+ return $arguments;
+ }
+}
+
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoPackageTask.php b/buildscripts/phing/tasks/PradoPackageTask.php
index e54a4093..61031206 100644
--- a/buildscripts/phing/tasks/PradoPackageTask.php
+++ b/buildscripts/phing/tasks/PradoPackageTask.php
@@ -1,142 +1,142 @@
-<?php
-require_once 'phing/Task.php';
-
-/**
- * Task to run phpDocumentor for PRADO API docs.
- */
-class PradoPackageTask extends Task
-{
- protected $filelists = array();
- protected $output;
- protected $strip=false;
-
- function setOutput(PhingFile $file)
- {
- $this->output=$file;
- }
-
- function setStrip($value)
- {
- $this->strip = (boolean)$value;
- }
-
- /**
- * Supports embedded <filelist> element.
- * @return FileList
- */
- function createFileList() {
- $num = array_push($this->filelists, new FileList());
- return $this->filelists[$num-1];
- }
-
- function main()
- {
- $project = $this->getProject();
-
- $content = '';
- $files=array();
- // append the files in the filelists
- foreach($this->filelists as $fl)
- {
- $fromDir = $fl->getDir($project);
- foreach($fl->getFiles($project) as $file)
- {
- $src = new PhingFile($fromDir,$file);
- $files[] = $file;
- $content .= file_get_contents($src->getAbsolutePath());
- }
- }
-
- $content = $this->processPhp($content,$files);
- file_put_contents($this->output->getAbsolutePath(), $content);
- }
-
- function processPhp($content,$files)
- {
- $content = preg_replace('/^\s*Prado::trace.*\s*;\s*$/mu','',$content);
- $content = preg_replace('/(PradoBase::using|Prado::using|require_once|include_once)\s*\([^\$].*?\);/mu','',$content);
- $content = str_replace('Prado::', 'PradoBase::', $content);
- $content = str_replace('PradoBase::getApplication()->getMode()', 'true', $content);
- $content = str_replace('TApplicationMode::Debug', 'true', $content);
- $content = str_replace('/Exceptions/messages', '/messages', $content);
- if($this->strip)
- $content=$this->strip_comments($content);
- $content=$this->strip_empty_lines($content);
- $content="<?php".$this->getFileComment($files).preg_replace('/(\?>\s?|<\?php\s?)/mu','',$content)."\n?>";
- return $content;
- }
-
-function strip_comments($source)
-{
- $tokens = token_get_all($source);
- /* T_ML_COMMENT does not exist in PHP 5.
- * The following three lines define it in order to
- * preserve backwards compatibility.
- *
- * The next two lines define the PHP 5-only T_DOC_COMMENT,
- * which we will mask as T_ML_COMMENT for PHP 4.
- */
- if (!defined('T_ML_COMMENT')) {
- @define('T_ML_COMMENT', T_COMMENT);
- } else {
- @define('T_DOC_COMMENT', T_ML_COMMENT);
- }
- $output = '';
- foreach ($tokens as $token) {
- if (is_string($token)) {
- // simple 1-character token
- $output .= $token;
- } else {
- // token array
- list($id, $text) = $token;
- switch ($id) {
- case T_COMMENT:
- case T_ML_COMMENT: // we've defined this
- case T_DOC_COMMENT: // and this
- // no action on comments
- break;
- default:
- // anything else -> output "as is"
- $output .= $text;
- break;
- }
- }
- }
- return $output;
-}
-
-function strip_empty_lines($string)
-{
- $string = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n", $string);
- $string = preg_replace("/^[\s\t]*[\r\n]+/", "", $string);
- return $string;
-}
-function getFileComment($files)
-{
- $lastupdate=date('Y/m/d H:i:s');
- $year=date('Y');
- $fileList=array();
- foreach($files as $file)
- $fileList[] = " * $file";
- $fileListStr = implode("\n", $fileList);
-$comments="
-/**
- * Last Update: $lastupdate
- *
- * Do not modify this file manually. This file was auto-generated by combining
- * the following classes from the Prado framework.
- *
- * Files:
-{$fileListStr}
- *
- * @author Qiang Xue <qiang.xue@gmail.com>, Wei Zhuo <weizhuo@gmail.com>
- * @link http://www.pradosoft.com/
- * @copyright Copyright &copy; 2005-{$year} PradoSoft
- * @license http://www.pradosoft.com/license/
- */
-
-";
- return $comments;
-}
+<?php
+require_once 'phing/Task.php';
+
+/**
+ * Task to run phpDocumentor for PRADO API docs.
+ */
+class PradoPackageTask extends Task
+{
+ protected $filelists = array();
+ protected $output;
+ protected $strip=false;
+
+ function setOutput(PhingFile $file)
+ {
+ $this->output=$file;
+ }
+
+ function setStrip($value)
+ {
+ $this->strip = (boolean)$value;
+ }
+
+ /**
+ * Supports embedded <filelist> element.
+ * @return FileList
+ */
+ function createFileList() {
+ $num = array_push($this->filelists, new FileList());
+ return $this->filelists[$num-1];
+ }
+
+ function main()
+ {
+ $project = $this->getProject();
+
+ $content = '';
+ $files=array();
+ // append the files in the filelists
+ foreach($this->filelists as $fl)
+ {
+ $fromDir = $fl->getDir($project);
+ foreach($fl->getFiles($project) as $file)
+ {
+ $src = new PhingFile($fromDir,$file);
+ $files[] = $file;
+ $content .= file_get_contents($src->getAbsolutePath());
+ }
+ }
+
+ $content = $this->processPhp($content,$files);
+ file_put_contents($this->output->getAbsolutePath(), $content);
+ }
+
+ function processPhp($content,$files)
+ {
+ $content = preg_replace('/^\s*Prado::trace.*\s*;\s*$/mu','',$content);
+ $content = preg_replace('/(PradoBase::using|Prado::using|require_once|include_once)\s*\([^\$].*?\);/mu','',$content);
+ $content = str_replace('Prado::', 'PradoBase::', $content);
+ $content = str_replace('PradoBase::getApplication()->getMode()', 'true', $content);
+ $content = str_replace('TApplicationMode::Debug', 'true', $content);
+ $content = str_replace('/Exceptions/messages', '/messages', $content);
+ if($this->strip)
+ $content=$this->strip_comments($content);
+ $content=$this->strip_empty_lines($content);
+ $content="<?php".$this->getFileComment($files).preg_replace('/(\?>\s?|<\?php\s?)/mu','',$content)."\n?>";
+ return $content;
+ }
+
+function strip_comments($source)
+{
+ $tokens = token_get_all($source);
+ /* T_ML_COMMENT does not exist in PHP 5.
+ * The following three lines define it in order to
+ * preserve backwards compatibility.
+ *
+ * The next two lines define the PHP 5-only T_DOC_COMMENT,
+ * which we will mask as T_ML_COMMENT for PHP 4.
+ */
+ if (!defined('T_ML_COMMENT')) {
+ @define('T_ML_COMMENT', T_COMMENT);
+ } else {
+ @define('T_DOC_COMMENT', T_ML_COMMENT);
+ }
+ $output = '';
+ foreach ($tokens as $token) {
+ if (is_string($token)) {
+ // simple 1-character token
+ $output .= $token;
+ } else {
+ // token array
+ list($id, $text) = $token;
+ switch ($id) {
+ case T_COMMENT:
+ case T_ML_COMMENT: // we've defined this
+ case T_DOC_COMMENT: // and this
+ // no action on comments
+ break;
+ default:
+ // anything else -> output "as is"
+ $output .= $text;
+ break;
+ }
+ }
+ }
+ return $output;
+}
+
+function strip_empty_lines($string)
+{
+ $string = preg_replace("/[\r\n]+[\s\t]*[\r\n]+/", "\n", $string);
+ $string = preg_replace("/^[\s\t]*[\r\n]+/", "", $string);
+ return $string;
+}
+function getFileComment($files)
+{
+ $lastupdate=date('Y/m/d H:i:s');
+ $year=date('Y');
+ $fileList=array();
+ foreach($files as $file)
+ $fileList[] = " * $file";
+ $fileListStr = implode("\n", $fileList);
+$comments="
+/**
+ * Last Update: $lastupdate
+ *
+ * Do not modify this file manually. This file was auto-generated by combining
+ * the following classes from the Prado framework.
+ *
+ * Files:
+{$fileListStr}
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>, Wei Zhuo <weizhuo@gmail.com>
+ * @link http://www.pradosoft.com/
+ * @copyright Copyright &copy; 2005-{$year} PradoSoft
+ * @license http://www.pradosoft.com/license/
+ */
+
+";
+ return $comments;
+}
}
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoQuickStartDocs.php b/buildscripts/phing/tasks/PradoQuickStartDocs.php
index 06c30a14..1cbc5140 100644
--- a/buildscripts/phing/tasks/PradoQuickStartDocs.php
+++ b/buildscripts/phing/tasks/PradoQuickStartDocs.php
@@ -1,85 +1,85 @@
-<?php
-require_once 'phing/Task.php';
-
-require_once(dirname(__FILE__).'/../../chmbuilder/ChmQuickstartBuilder.php');
-include(dirname(__FILE__).'/../../../framework/PradoBase.php');
-class Prado extends PradoBase
-{
- protected static $app;
-
- public static function setApplication($application)
- {
- self::$app=$application;
- }
-
- public static function getApplication()
- {
- return self::$app;
- }
-
- public static function setPathOfAlias($alias,$path)
- {
- $aliases = self::getPathAliases();
- if(!isset($aliases[$alias]))
- parent::setPathOfAlias($alias,$path);
- }
-}
-
-include(dirname(__FILE__).'/../../../framework/prado.php');
-
-/**
- * Task to run phpDocumentor for PRADO API docs.
- */
-class PradoQuickStartDocs extends Task
-{
- private $base_dir;
-
- private $destdir;
-
- private $page;
-
- /**
- * Set the destination directory for the generated documentation
- */
- function setOutput(PhingFile $destdir)
- {
- $this->destdir = $destdir;
- }
-
- function setPages($page)
- {
- $this->page = $page;
- }
-
- /**
- * Main entrypoint of the task
- */
- function main()
- {
- $output = $this->destdir->getAbsolutePath();
- $base = dirname(__FILE__).'/../../../demos/quickstart/protected/';
- error_reporting(0);
- $quickstart= new ChmQuickstartBuilder($base,$output);
-
- foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page)
- {
- $file = str_replace(array('/','.page'), array('_','.html'),$page);
- $this->log("Parsing $page");
- file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page));
- $this->log("Writing $file");
- }
- }
-
- protected function parsePage($quickstart, $page)
- {
- $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page);
- $_GET['notheme'] = 'true';
- $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent());
- //hide prado specific content
- $content = str_replace('<body>', '<style type="text/css">.prado-specific {display:none;}</style><body>', $content);
- return $content;
- }
-
-}
-
+<?php
+require_once 'phing/Task.php';
+
+require_once(dirname(__FILE__).'/../../chmbuilder/ChmQuickstartBuilder.php');
+include(dirname(__FILE__).'/../../../framework/PradoBase.php');
+class Prado extends PradoBase
+{
+ protected static $app;
+
+ public static function setApplication($application)
+ {
+ self::$app=$application;
+ }
+
+ public static function getApplication()
+ {
+ return self::$app;
+ }
+
+ public static function setPathOfAlias($alias,$path)
+ {
+ $aliases = self::getPathAliases();
+ if(!isset($aliases[$alias]))
+ parent::setPathOfAlias($alias,$path);
+ }
+}
+
+include(dirname(__FILE__).'/../../../framework/prado.php');
+
+/**
+ * Task to run phpDocumentor for PRADO API docs.
+ */
+class PradoQuickStartDocs extends Task
+{
+ private $base_dir;
+
+ private $destdir;
+
+ private $page;
+
+ /**
+ * Set the destination directory for the generated documentation
+ */
+ function setOutput(PhingFile $destdir)
+ {
+ $this->destdir = $destdir;
+ }
+
+ function setPages($page)
+ {
+ $this->page = $page;
+ }
+
+ /**
+ * Main entrypoint of the task
+ */
+ function main()
+ {
+ $output = $this->destdir->getAbsolutePath();
+ $base = dirname(__FILE__).'/../../../demos/quickstart/protected/';
+ error_reporting(0);
+ $quickstart= new ChmQuickstartBuilder($base,$output);
+
+ foreach(preg_split('/\s*[, ]+\s*/', $this->page) as $page)
+ {
+ $file = str_replace(array('/','.page'), array('_','.html'),$page);
+ $this->log("Parsing $page");
+ file_put_contents($output.'/'.$file, $this->parsePage($quickstart,$page));
+ $this->log("Writing $file");
+ }
+ }
+
+ protected function parsePage($quickstart, $page)
+ {
+ $_GET['page'] = str_replace(array('/','.page'),array('.',''),$page);
+ $_GET['notheme'] = 'true';
+ $content = $quickstart->parseHtmlContent($quickstart->getApplicationContent());
+ //hide prado specific content
+ $content = str_replace('<body>', '<style type="text/css">.prado-specific {display:none;}</style><body>', $content);
+ return $content;
+ }
+
+}
+
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoSimpleTestTask.php b/buildscripts/phing/tasks/PradoSimpleTestTask.php
index 4d6317b5..91e6e22f 100644
--- a/buildscripts/phing/tasks/PradoSimpleTestTask.php
+++ b/buildscripts/phing/tasks/PradoSimpleTestTask.php
@@ -1,40 +1,40 @@
-<?php
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/simpletest/SimpleTestTask.php';
-
-/**
- * Task to run PRADO unit tests
- */
-class PradoSimpleTestTask extends SimpleTestTask
-{
- private $_appdir;
-
- public function setAppdir($value)
- {
- $this->_appdir=$value;
- }
-
- function init()
- {
- $tools= realpath(dirname(__FILE__).'/../../../tests/test_tools/');
- include_once "$tools/unit_tests.php";
-
- if (!class_exists('SimpleReporter',false))
- throw new BuildException("SimpleTestTask depends on SimpleTest package being installed.", $this->getLocation());
-
- require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php';
- require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php';
- }
-
- function main()
- {
- if($this->_appdir)
- {
- $app = new TShellApplication($this->_appdir);
- $app->run();
- }
- parent::main();
- }
-}
-
+<?php
+require_once 'phing/Task.php';
+require_once 'phing/tasks/ext/simpletest/SimpleTestTask.php';
+
+/**
+ * Task to run PRADO unit tests
+ */
+class PradoSimpleTestTask extends SimpleTestTask
+{
+ private $_appdir;
+
+ public function setAppdir($value)
+ {
+ $this->_appdir=$value;
+ }
+
+ function init()
+ {
+ $tools= realpath(dirname(__FILE__).'/../../../tests/test_tools/');
+ include_once "$tools/unit_tests.php";
+
+ if (!class_exists('SimpleReporter',false))
+ throw new BuildException("SimpleTestTask depends on SimpleTest package being installed.", $this->getLocation());
+
+ require_once 'phing/tasks/ext/simpletest/SimpleTestCountResultFormatter.php';
+ require_once 'phing/tasks/ext/simpletest/SimpleTestFormatterElement.php';
+ }
+
+ function main()
+ {
+ if($this->_appdir)
+ {
+ $app = new TShellApplication($this->_appdir);
+ $app->run();
+ }
+ parent::main();
+ }
+}
+
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/PradoTestTask.php b/buildscripts/phing/tasks/PradoTestTask.php
index ba1e06be..cd2c87f8 100644
--- a/buildscripts/phing/tasks/PradoTestTask.php
+++ b/buildscripts/phing/tasks/PradoTestTask.php
@@ -1,18 +1,18 @@
-<?php
-require_once 'phing/Task.php';
-require_once 'phing/tasks/ext/phpunit2/PHPUnit2Task.php';
-
-/**
- * Task to run PRADO unit tests
- */
-class PradoTestTask extends PHPUnit2Task
-{
- function init()
- {
- $phpunit2_path = realpath(dirname(__FILE__).'/../..');
- set_include_path(get_include_path().PATH_SEPARATOR.$phpunit2_path);
- parent::init();
- }
-}
-
+<?php
+require_once 'phing/Task.php';
+require_once 'phing/tasks/ext/phpunit2/PHPUnit2Task.php';
+
+/**
+ * Task to run PRADO unit tests
+ */
+class PradoTestTask extends PHPUnit2Task
+{
+ function init()
+ {
+ $phpunit2_path = realpath(dirname(__FILE__).'/../..');
+ set_include_path(get_include_path().PATH_SEPARATOR.$phpunit2_path);
+ parent::init();
+ }
+}
+
?> \ No newline at end of file
diff --git a/buildscripts/phing/tasks/QuickstartIndexTask.php b/buildscripts/phing/tasks/QuickstartIndexTask.php
index 64a48d4a..5179d8ad 100644
--- a/buildscripts/phing/tasks/QuickstartIndexTask.php
+++ b/buildscripts/phing/tasks/QuickstartIndexTask.php
@@ -1,32 +1,32 @@
-<?php
-
-require_once 'phing/Task.php';
-
-/**
- * Task to index quickstart
- */
-class QuickstartIndexTask extends Task
-{
- private $todir;
-
- public function setTodir($value)
- {
- $this->todir=$value;
- }
-
- public function main()
- {
- $srcdir=realpath(dirname(__FILE__).'/../../../');
- $zend_path = $srcdir.'/demos/quickstart/protected/index';
- set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path));
- require_once ('Zend/Search/Lucene.php');
-
- require_once($srcdir.'/buildscripts/index/quickstart_index.php');
- $quickstart_source = $srcdir.'/buildscripts/texbuilder/quickstart/pages.php';
- $quickstart_base = $srcdir.'/demos/quickstart/protected/pages/';
- $quickstart = new quickstart_index($this->todir, realpath($quickstart_base), realpath($quickstart_source));
- $quickstart->create_index();
- }
-}
-
+<?php
+
+require_once 'phing/Task.php';
+
+/**
+ * Task to index quickstart
+ */
+class QuickstartIndexTask extends Task
+{
+ private $todir;
+
+ public function setTodir($value)
+ {
+ $this->todir=$value;
+ }
+
+ public function main()
+ {
+ $srcdir=realpath(dirname(__FILE__).'/../../../');
+ $zend_path = $srcdir.'/demos/quickstart/protected/index';
+ set_include_path(get_include_path().PATH_SEPARATOR.realpath($zend_path));
+ require_once ('Zend/Search/Lucene.php');
+
+ require_once($srcdir.'/buildscripts/index/quickstart_index.php');
+ $quickstart_source = $srcdir.'/buildscripts/texbuilder/quickstart/pages.php';
+ $quickstart_base = $srcdir.'/demos/quickstart/protected/pages/';
+ $quickstart = new quickstart_index($this->todir, realpath($quickstart_base), realpath($quickstart_source));
+ $quickstart->create_index();
+ }
+}
+
?> \ No newline at end of file