Bearsampp 2026.9.23
Loading...
Searching...
No Matches
Build.php
Go to the documentation of this file.
1<?php
17
21require_once 'PEAR/Command/Common.php';
22
38{
39 var $commands = array(
40 'build' => array(
41 'summary' => 'Build an Extension From C Source',
42 'function' => 'doBuild',
43 'shortcut' => 'b',
44 'options' => array(
45 'configureoptions' => array(
46 'shortopt' => 'D',
47 'arg' => 'OPTION1=VALUE[ OPTION2=VALUE]',
48 'doc' => 'space-delimited list of configure options',
49 ),
50 ),
51 'doc' => '[package.xml]
52Builds one or more extensions contained in a package.'
53 ),
54 );
55
61 function __construct(&$ui, &$config)
62 {
63 parent::__construct($ui, $config);
64 }
65
66 function doBuild($command, $options, $params)
67 {
68 require_once 'PEAR/Builder.php';
69 if (sizeof($params) < 1) {
70 $params[0] = 'package.xml';
71 }
72
73 $configureoptions = empty($options['configureoptions']) ? '' : $options['configureoptions'];
74 $builder = new PEAR_Builder($configureoptions, $this->ui);
75 $this->debug = $this->config->get('verbose');
76 $err = $builder->build($params[0], array(&$this, 'buildCallback'));
77 if (PEAR::isError($err)) {
78 return $err;
79 }
80
81 return true;
82 }
83
84 function buildCallback($what, $data)
85 {
86 if (($what == 'cmdoutput' && $this->debug > 1) ||
87 ($what == 'output' && $this->debug > 0)) {
88 $this->ui->outputData(rtrim($data), 'build');
89 }
90 }
91}
__construct(&$ui, &$config)
Definition Build.php:61
buildCallback($what, $data)
Definition Build.php:84
doBuild($command, $options, $params)
Definition Build.php:66
static isError($data, $code=null)
Definition PEAR.php:306
$options
Definition pearcmd.php:145
if( $raw) foreach($opts as $opt) if( $store_system_config) if($store_user_config) $command
Definition pearcmd.php:322