Re: suggestion for bulidtest-submit.php
| From: | Melvyn Sopacua | Date: | Tue, 27 Aug 2002 12:22:06 +0000 |
| Subject: | Re: suggestion for bulidtest-submit.php | ||
| References: | 1 2 | Groups: | php.qa |
| Request: | Send a blank email to php-qa+get-5899@lists.php.net to get a copy of this message | ||
At 07:31 8/27/2002 +0200, derick@php.net wrote:
On Tue, 27 Aug 2002, Sebastian Nohn wrote: what about enabling extensions that are enabled per default? Nice idea, can you make a patch?Hmm - I decided to make a script for this, but it seems, that that also deletes some of the extensions - this would make the file become version specific, which by the way also applies to the default on/off setting of an extension... Need to work in the exceptions (--with-apache2 -> sapi/apache2filter), but let me know if you want to incorporate something like this. You'd need to run it on the configure --help output and will create the corresponding html in 2 include files. <?php $file = './configure.options'; $ext_root = './ext'; $sapi_root = './sapi'; $regex = '/^\s+--((with|without)|(en|dis)able)-(\w+).*$/'; $ext_settings = array(); $sapi_settings = array(); error_reporting(E_ALL); clearstatcache(); $fp = fopen($file, 'r'); while( !feof($fp) && $fp) {
$line = fgets($fp, 1024);
if( ! preg_match($regex, $line) )
continue;
$option_pair = trim(preg_replace($regex, "$1:$4", $line));
list($setting, $option) = explode(':', $option_pair);
if( ! is_dir($ext_root . '/' . $option) and ! is_dir($sapi_root . '/' . $option) )
continue;
if( preg_match("/^with/", $setting) )
{
$enabled_by_default = ($setting == 'without') ? TRUE : FALSE;
}
else
{
// enable/disable
$enabled_by_default = ($setting == 'disable') ? TRUE : FALSE;
}
if(is_dir($sapi_root . '/' . $option) )
{
$sapi_settings[$option] = $enabled_by_default;
}
else
{
$ext_settings[$option] = $enabled_by_default;
}
}
fclose($fp);
ksort($ext_settings);
ksort($sapi_settings);
$fw = fopen('checkboxes_ext.inc.php' , 'w');
foreach($ext_settings AS $ext => $on)
{
fwrite($fw, ($on) ? "<input type=\"checkbox\" name=\"$ext\" checked=\"checked\">$ext</input></td>\n" : "<input type=\"checkbox\" name=\"$ext\">$ext</input></td>\n");} fclose($fw); $fw = fopen('checkboxes_sapi.inc.php' , 'w'); foreach($sapi_settings AS $sapi => $on) {
fwrite($fw, ($on) ? "<input type=\"checkbox\" name=\"$sapi\" checked=\"checked\">$sapi</input></td>\n" : "<input type=\"checkbox\" name=\"$sapi\">$sapi</input></td>\n");} fclose($fw); ?> Met vriendelijke groeten / With kind regards, Webmaster IDG.nl Melvyn Sopacua <@Logan> I spent a minute looking at my own code by accident. <@Logan> I was thinking "What the hell is this guy doing?"