3 * PEAR_Command_Auth (build command)
9 * @author Stig Bakken <ssb@php.net>
10 * @author Tomas V.V.Cox <cox@idecnet.com>
11 * @author Greg Beaver <cellog@php.net>
12 * @copyright 1997-2009 The Authors
13 * @license http://opensource.org/licenses/bsd-license.php New BSD License
14 * @version CVS: $Id: Build.php 313023 2011-07-06 19:17:11Z dufuz $
15 * @link http://pear.php.net/package/PEAR
16 * @since File available since Release 0.1
22 require_once 'PEAR/Command/Common.php';
25 * PEAR commands for building extensions.
29 * @author Stig Bakken <ssb@php.net>
30 * @author Tomas V.V.Cox <cox@idecnet.com>
31 * @author Greg Beaver <cellog@php.net>
32 * @copyright 1997-2009 The Authors
33 * @license http://opensource.org/licenses/bsd-license.php New BSD License
34 * @version Release: 1.9.4
35 * @link http://pear.php.net/package/PEAR
36 * @since Class available since Release 0.1
38 class PEAR_Command_Build extends PEAR_Command_Common
40 var $commands = array(
42 'summary' => 'Build an Extension From C Source',
43 'function' => 'doBuild',
46 'doc' => '[package.xml]
47 Builds one or more extensions contained in a package.'
52 * PEAR_Command_Build constructor.
56 function PEAR_Command_Build(&$ui, &$config)
58 parent::PEAR_Command_Common($ui, $config);
61 function doBuild($command, $options, $params)
63 require_once 'PEAR/Builder.php';
64 if (sizeof($params) < 1) {
65 $params[0] = 'package.xml';
68 $builder = &new PEAR_Builder($this->ui);
69 $this->debug = $this->config->get('verbose');
70 $err = $builder->build($params[0], array(&$this, 'buildCallback'));
71 if (PEAR::isError($err)) {
78 function buildCallback($what, $data)
80 if (($what == 'cmdoutput' && $this->debug > 1) ||
81 ($what == 'output' && $this->debug > 0)) {
82 $this->ui->outputData(rtrim($data), 'build');