|
Revision 323, 1.5 kB
(checked in by hans, 1 year ago)
|
Refs #201 - Added improved support for arg parsing in Phing::execute() as well as better error handling between phing.php CLI script and Phing class.
|
- Property svn:keywords set to
author date id revision
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
if (getenv('PHP_CLASSPATH')) { |
|---|
| 15 |
if (!defined('PHP_CLASSPATH')) { define('PHP_CLASSPATH', getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path()); } |
|---|
| 16 |
ini_set('include_path', PHP_CLASSPATH); |
|---|
| 17 |
} else { |
|---|
| 18 |
if (!defined('PHP_CLASSPATH')) { define('PHP_CLASSPATH', get_include_path()); } |
|---|
| 19 |
} |
|---|
| 20 |
|
|---|
| 21 |
require_once 'phing/Phing.php'; |
|---|
| 22 |
|
|---|
| 23 |
try { |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
Phing::startup(); |
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
// (this may be NULL, but that's not a big problem.) |
|---|
| 30 |
Phing::setProperty('phing.home', getenv('PHING_HOME')); |
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
$args = isset($argv) ? $argv : $_SERVER['argv']; |
|---|
| 34 |
array_shift($args); |
|---|
| 35 |
|
|---|
| 36 |
// Invoke the commandline entry point |
|---|
| 37 |
Phing::fire($args); |
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
Phing::shutdown(); |
|---|
| 41 |
|
|---|
| 42 |
} catch (ConfigurationException $x) { |
|---|
| 43 |
|
|---|
| 44 |
Phing::printMessage($x); |
|---|
| 45 |
exit(-1); |
|---|
| 46 |
|
|---|
| 47 |
} catch (Exception $x) { |
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
// exit with non-0 error code. |
|---|
| 51 |
|
|---|
| 52 |
exit(1); |
|---|
| 53 |
|
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
?> |
|---|