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 * @link http://pear.php.net/package/PEAR
15 * @since File available since Release 0.1
21 require_once 'PEAR/Command/Common.php';
24 * PEAR commands for building extensions.
28 * @author Stig Bakken <ssb@php.net>
29 * @author Tomas V.V.Cox <cox@idecnet.com>
30 * @author Greg Beaver <cellog@php.net>
31 * @copyright 1997-2009 The Authors
32 * @license http://opensource.org/licenses/bsd-license.php New BSD License
33 * @version Release: 1.10.3
34 * @link http://pear.php.net/package/PEAR
35 * @since Class available since Release 0.1
37 class PEAR_Command_Build extends PEAR_Command_Common
39 var $commands = array(
41 'summary' => 'Build an Extension From C Source',
42 'function' => 'doBuild',
45 'doc' => '[package.xml]
46 Builds one or more extensions contained in a package.'
51 * PEAR_Command_Build constructor.
55 function __construct(&$ui, &$config)
57 parent::__construct($ui, $config);
60 function doBuild($command, $options, $params)
62 require_once 'PEAR/Builder.php';
63 if (sizeof($params) < 1) {
64 $params[0] = 'package.xml';
67 $builder = new PEAR_Builder($this->ui);
68 $this->debug = $this->config->get('verbose');
69 $err = $builder->build($params[0], array(&$this, 'buildCallback'));
70 if (PEAR::isError($err)) {
77 function buildCallback($what, $data)
79 if (($what == 'cmdoutput' && $this->debug > 1) ||
80 ($what == 'output' && $this->debug > 0)) {
81 $this->ui->outputData(rtrim($data), 'build');