Subversion Repositories Applications.gtt

Rev

Rev 94 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 94 Rev 187
Line 2... Line 2...
2
/**
2
/**
3
 * PEAR_Command_Auth (build command)
3
 * PEAR_Command_Auth (build command)
4
 *
4
 *
5
 * PHP versions 4 and 5
5
 * PHP versions 4 and 5
6
 *
6
 *
7
 * LICENSE: This source file is subject to version 3.0 of the PHP license
-
 
8
 * that is available through the world-wide-web at the following URI:
-
 
9
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
-
 
10
 * the PHP License and are unable to obtain it through the web, please
-
 
11
 * send a note to license@php.net so we can mail you a copy immediately.
-
 
12
 *
-
 
13
 * @category   pear
7
 * @category   pear
14
 * @package    PEAR
8
 * @package    PEAR
15
 * @author     Stig Bakken <ssb@php.net>
9
 * @author     Stig Bakken <ssb@php.net>
16
 * @author     Tomas V.V.Cox <cox@idecnet.com>
10
 * @author     Tomas V.V.Cox <cox@idecnet.com>
17
 * @author     Greg Beaver <cellog@php.net>
11
 * @author     Greg Beaver <cellog@php.net>
18
 * @copyright  1997-2006 The PHP Group
12
 * @copyright  1997-2009 The Authors
19
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
13
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
20
 * @version    CVS: $Id: Build.php,v 1.13 2006/01/06 04:47:36 cellog Exp $
-
 
21
 * @link       http://pear.php.net/package/PEAR
14
 * @link       http://pear.php.net/package/PEAR
22
 * @since      File available since Release 0.1
15
 * @since      File available since Release 0.1
23
 */
16
 */
Line 24... Line 17...
24
 
17
 
Line 33... Line 26...
33
 * @category   pear
26
 * @category   pear
34
 * @package    PEAR
27
 * @package    PEAR
35
 * @author     Stig Bakken <ssb@php.net>
28
 * @author     Stig Bakken <ssb@php.net>
36
 * @author     Tomas V.V.Cox <cox@idecnet.com>
29
 * @author     Tomas V.V.Cox <cox@idecnet.com>
37
 * @author     Greg Beaver <cellog@php.net>
30
 * @author     Greg Beaver <cellog@php.net>
38
 * @copyright  1997-2006 The PHP Group
31
 * @copyright  1997-2009 The Authors
39
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
32
 * @license    http://opensource.org/licenses/bsd-license.php New BSD License
40
 * @version    Release: 1.5.1
33
 * @version    Release: 1.10.1
41
 * @link       http://pear.php.net/package/PEAR
34
 * @link       http://pear.php.net/package/PEAR
42
 * @since      Class available since Release 0.1
35
 * @since      Class available since Release 0.1
43
 */
36
 */
44
class PEAR_Command_Build extends PEAR_Command_Common
37
class PEAR_Command_Build extends PEAR_Command_Common
45
{
38
{
46
    // {{{ properties
-
 
47
 
-
 
48
    var $commands = array(
39
    var $commands = array(
49
        'build' => array(
40
        'build' => array(
50
            'summary' => 'Build an Extension From C Source',
41
            'summary' => 'Build an Extension From C Source',
51
            'function' => 'doBuild',
42
            'function' => 'doBuild',
52
            'shortcut' => 'b',
43
            'shortcut' => 'b',
Line 54... Line 45...
54
            'doc' => '[package.xml]
45
            'doc' => '[package.xml]
55
Builds one or more extensions contained in a package.'
46
Builds one or more extensions contained in a package.'
56
            ),
47
            ),
57
        );
48
        );
Line 58... Line -...
58
 
-
 
59
    // }}}
-
 
60
 
-
 
61
    // {{{ constructor
-
 
62
 
49
 
63
    /**
50
    /**
64
     * PEAR_Command_Build constructor.
51
     * PEAR_Command_Build constructor.
65
     *
52
     *
66
     * @access public
53
     * @access public
67
     */
54
     */
68
    function PEAR_Command_Build(&$ui, &$config)
55
    function __construct(&$ui, &$config)
69
    {
56
    {
70
        parent::PEAR_Command_Common($ui, $config);
57
        parent::__construct($ui, $config);
Line 71... Line -...
71
    }
-
 
72
 
-
 
73
    // }}}
-
 
74
 
-
 
75
    // {{{ doBuild()
58
    }
76
 
59
 
77
    function doBuild($command, $options, $params)
60
    function doBuild($command, $options, $params)
78
    {
61
    {
79
        require_once 'PEAR/Builder.php';
62
        require_once 'PEAR/Builder.php';
80
        if (sizeof($params) < 1) {
63
        if (sizeof($params) < 1) {
-
 
64
            $params[0] = 'package.xml';
81
            $params[0] = 'package.xml';
65
        }
82
        }
66
 
83
        $builder = &new PEAR_Builder($this->ui);
67
        $builder = new PEAR_Builder($this->ui);
84
        $this->debug = $this->config->get('verbose');
68
        $this->debug = $this->config->get('verbose');
85
        $err = $builder->build($params[0], array(&$this, 'buildCallback'));
69
        $err = $builder->build($params[0], array(&$this, 'buildCallback'));
86
        if (PEAR::isError($err)) {
70
        if (PEAR::isError($err)) {
-
 
71
            return $err;
87
            return $err;
72
        }
88
        }
73
 
Line 89... Line -...
89
        return true;
-
 
90
    }
-
 
91
 
-
 
92
    // }}}
74
        return true;
93
    // {{{ buildCallback()
75
    }
94
 
76
 
95
    function buildCallback($what, $data)
77
    function buildCallback($what, $data)
96
    {
78
    {
97
        if (($what == 'cmdoutput' && $this->debug > 1) ||
79
        if (($what == 'cmdoutput' && $this->debug > 1) ||
98
            ($what == 'output' && $this->debug > 0)) {
80
            ($what == 'output' && $this->debug > 0)) {
99
            $this->ui->outputData(rtrim($data), 'build');
-
 
100
        }
-
 
101
    }
81
            $this->ui->outputData(rtrim($data), 'build');