source: trunk/bin/phing.php @ 1

Revision 1, 1.3 KB checked in by hans, 5 years ago (diff)

Initial checkin

Line 
1<?php
2
3/**
4 * This is the Phing command line launcher. It starts up the system evironment
5 * tests for all important paths and properties and kicks of the main command-
6 * line entry point of phing located in phing.Phing
7 * @version $Revision: 1.7 $
8 */
9 
10// Set any INI options for PHP
11// ---------------------------
12
13ini_set('track_errors', 1);
14
15/* set classpath */
16if (getenv('PHP_CLASSPATH')) {
17    define('PHP_CLASSPATH',  getenv('PHP_CLASSPATH') . PATH_SEPARATOR . get_include_path());
18    ini_set('include_path', PHP_CLASSPATH);
19} else {
20    define('PHP_CLASSPATH',  get_include_path());
21}
22
23require_once 'phing/Phing.php';
24
25/* Setup Phing environment */
26Phing::startup();
27
28/*
29  find phing home directory
30   -- if Phing is installed from PEAR this will probably be null,
31   which is fine (I think).  Nothing uses phing.home right now.
32*/
33Phing::setProperty('phing.home', getenv('PHING_HOME'));
34
35
36/* polish CLI arguments */
37$args = isset($argv) ? $argv : $_SERVER['argv']; // $_SERVER['argv'] seems not to work when argv is registered (PHP5b4)
38array_shift($args); // 1st arg is script name, so drop it
39
40/* fire main application */
41Phing::fire($args);
42
43/*
44  exit OO system if not already called by Phing
45   -- basically we should not need this due to register_shutdown_function in Phing
46 */
47 Phing::halt(0);
48
49?>
Note: See TracBrowser for help on using the repository browser.