summaryrefslogtreecommitdiff
path: root/buildscripts/phing/bin
diff options
context:
space:
mode:
Diffstat (limited to 'buildscripts/phing/bin')
-rw-r--r--buildscripts/phing/bin/pear-phing22
-rw-r--r--buildscripts/phing/bin/pear-phing.bat44
-rwxr-xr-x[-rw-r--r--]buildscripts/phing/bin/phing16
-rw-r--r--buildscripts/phing/bin/phing.bat6
-rwxr-xr-x[-rw-r--r--]buildscripts/phing/bin/phing.php72
5 files changed, 54 insertions, 106 deletions
diff --git a/buildscripts/phing/bin/pear-phing b/buildscripts/phing/bin/pear-phing
deleted file mode 100644
index bf568c17..00000000
--- a/buildscripts/phing/bin/pear-phing
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# ------------------------------------------------------------------------
-# The phing build script for Unix based systems
-# $Id: pear-phing,v 1.3 2003/12/23 19:45:14 hlellelid Exp $
-# ------------------------------------------------------------------------
-
-# Change this to reflect your environment if the default value doesn't work
-PHP_COMMAND="@PHP-BIN@"
-export PHP_COMMAND
-
-# -------------------------------------------------------------------------
-# 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
- export PHP_COMMAND
-fi
-
-$PHP_COMMAND -d html_errors=off -qC @PEAR-DIR@/phing.php -logger phing.listener.AnsiColorLogger $*
diff --git a/buildscripts/phing/bin/pear-phing.bat b/buildscripts/phing/bin/pear-phing.bat
deleted file mode 100644
index fba90772..00000000
--- a/buildscripts/phing/bin/pear-phing.bat
+++ /dev/null
@@ -1,44 +0,0 @@
-@ECHO OFF
-
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-:: The phing build script for Windows based systems
-:: $Id: pear-phing.bat,v 1.4 2005/12/22 13:12:33 hlellelid Exp $
-:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
-
-::----------------------------------------------------------------------------------
-:: 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 to point to your php.exe (CLI version!)
-ECHO * [Currently set to %phpCli%]
-ECHO **************************************************************************
-
-GOTO :PAUSE_END
-
-:PAUSE_END
-PAUSE \ No newline at end of file
diff --git a/buildscripts/phing/bin/phing b/buildscripts/phing/bin/phing
index e24c6cfb..bbc6eefe 100644..100755
--- a/buildscripts/phing/bin/phing
+++ b/buildscripts/phing/bin/phing
@@ -1,6 +1,6 @@
#!/bin/sh
# Shell wrapper for Phing
-# $Id: phing,v 1.2 2006/01/23 21:51:16 mrook Exp $
+# $Id$
#
# This script will do the following:
# - check for PHP_COMMAND env, if found, use it.
@@ -10,6 +10,14 @@
# - check for PHP_CLASSPATH, if found use it
# - if not found set it using PHING_HOME/classes
+
+# Put all args in quotes
+phing_exec_debug=false
+phing_exec_args=
+for arg in "$@" ; do
+ phing_exec_args="$phing_exec_args \"$arg\""
+done
+
if [ -z "$PHING_HOME" ] ; then
# echo "WARNING: PHING_HOME environment not set. Attempting to guess."
@@ -72,4 +80,8 @@ if (test -z "$PHP_CLASSPATH") ; then
export PHP_CLASSPATH
fi
-$PHP_COMMAND -d html_errors=off -qC $PHING_HOME/bin/phing.php -logger phing.listener.AnsiColorLogger $@
+phing_exec_cmd="exec $PHP_COMMAND -d html_errors=off -qC \"$PHING_HOME/bin/phing.php\" -logger phing.listener.AnsiColorLogger $phing_exec_args"
+if $phing_exec_debug ; then
+ echo $phing_exec_cmd
+fi
+eval $phing_exec_cmd \ No newline at end of file
diff --git a/buildscripts/phing/bin/phing.bat b/buildscripts/phing/bin/phing.bat
index c57c30dd..ea310470 100644
--- a/buildscripts/phing/bin/phing.bat
+++ b/buildscripts/phing/bin/phing.bat
@@ -2,7 +2,7 @@
rem *********************************************************************
rem ** the phing build script for Windows based systems
-rem ** $Id: phing.bat,v 1.5 2003/11/06 14:56:13 hlellelid Exp $
+rem ** $Id$
rem *********************************************************************
rem This script will do the following:
@@ -33,7 +33,7 @@ goto run
goto cleanup
:run
-%PHP_COMMAND% -d html_errors=off -qC %PHING_HOME%\bin\phing.php %1 %2 %3 %4 %5 %6 %7 %8 %9
+"%PHP_COMMAND%" -d html_errors=off -qC "%PHING_HOME%\bin\phing.php" %*
goto cleanup
:no_phpcommand
@@ -50,7 +50,7 @@ echo variable to your local phing installation!
goto cleanup
:set_classpath
-set PHP_CLASSPATH="%PHING_HOME%\classes"
+set PHP_CLASSPATH=%PHING_HOME%\classes
goto init
:cleanup
diff --git a/buildscripts/phing/bin/phing.php b/buildscripts/phing/bin/phing.php
index 7d0a774a..3b70887a 100644..100755
--- a/buildscripts/phing/bin/phing.php
+++ b/buildscripts/phing/bin/phing.php
@@ -4,51 +4,53 @@
* 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 $Revision: 1.7 $
+ * @version $Id$
*/
-
+
// Set any INI options for PHP
// ---------------------------
-ini_set('track_errors', 1);
-
/* set classpath */
-/*
if (getenv('PHP_CLASSPATH')) {
-// define('PHP_CLASSPATH', getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path());
- define('PHP_CLASSPATH', realpath(dirname(__FILE__).'/../classes') . PATH_SEPARATOR . get_include_path());
+ if (!defined('PHP_CLASSPATH')) { define('PHP_CLASSPATH', getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path()); }
ini_set('include_path', PHP_CLASSPATH);
} else {
- define('PHP_CLASSPATH', get_include_path());
+ if (!defined('PHP_CLASSPATH')) { define('PHP_CLASSPATH', get_include_path()); }
}
-*/
-define('PHP_CLASSPATH', realpath(dirname(__FILE__).'/../classes') . PATH_SEPARATOR . get_include_path());
-ini_set('include_path', PHP_CLASSPATH);
require_once 'phing/Phing.php';
-/* Setup Phing environment */
-Phing::startup();
-
-/*
- find phing home directory
- -- if Phing is installed from PEAR this will probably be null,
- which is fine (I think). Nothing uses phing.home right now.
-*/
-Phing::setProperty('phing.home', getenv('PHING_HOME'));
-
-
-/* polish CLI arguments */
-$args = isset($argv) ? $argv : $_SERVER['argv']; // $_SERVER['argv'] seems not to work when argv is registered (PHP5b4)
-array_shift($args); // 1st arg is script name, so drop it
-
-/* fire main application */
-Phing::fire($args);
-
-/*
- exit OO system if not already called by Phing
- -- basically we should not need this due to register_shutdown_function in Phing
- */
- Phing::halt(0);
+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);
+
+}
-?> \ No newline at end of file
+?>