cvs: qaweb /build_tracker extension_list.txt filter.php functions.php harvest.php php_source_list.txt server_list.txt
| From: | Zak Greant | Date: | Thu, 05 Oct 2000 02:34:00 +0000 |
| Subject: | cvs: qaweb /build_tracker extension_list.txt filter.php functions.php harvest.php php_source_list.txt server_list.txt | ||
| Groups: | php.qa | ||
| Request: | Send a blank email to php-qa+get-1432@lists.php.net to get a copy of this message | ||
zak Wed Oct 4 19:34:00 2000 EDT
Added files:
/qaweb/build_tracker harvest.php extension_list.txt
Modified files:
/qaweb/build_tracker filter.php functions.php php_source_list.txt
server_list.txt
Log:
Hacked together a phenomenally ugly page (harvest.php)
that gathers additional data based on the how the filter.php
form is filled out.
Amazing bad code :)
Index: qaweb/build_tracker/filter.php
diff -u qaweb/build_tracker/filter.php:1.5 qaweb/build_tracker/filter.php:1.6
--- qaweb/build_tracker/filter.php:1.5 Wed Oct 4 15:51:02 2000
+++ qaweb/build_tracker/filter.php Wed Oct 4 19:34:00 2000
@@ -1,126 +1,4 @@
-<?php
-
-# file2select
-# Author: j.a.greant 2000/08/23 zak@php.net
-
-# A simple function for generating select boxes from formatted text files
-# format for text files is: option value::option display name
-# each entry should be separated by a newline
-# blank lines and lines that start with a single # are ignored
-
-function file2select ($field_name)
-{
- $field[$field_name] = $GLOBALS[field][$field_name];
- $selected[$field[$field_name]] = ' selected';
-
- foreach (file ($field_name.'_list.txt') as $temp)
- {
- $temp = trim ($temp);
- if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
-
- list ($value, $option) = explode ('::', $temp);
- $option
- or $option = $value;
- $output .= sprintf ('<option
value="%s"%s>%s</option>'."\n", $value, $selected[$value],
$option);
- }
-
- return '<select name="field[' . $field_name . ']">' .
"\n$output" . '</select>';
-}
-
-# file2checkbox
-# Author: j.a.greant 2000/10/03 zak@php.net
-
-# A simple function for generating one or more checkboxes from formatted text files
-# format for text files is: option value::option display name
-# each entry should be separated by a newline
-# blank lines and lines that start with a single # are ignored
-
-function file2checkbox ($field_name)
-{
- $field[$field_name] = $GLOBALS[field][$field_name];
- if(is_array ($field[$field_name]))
- foreach ($field[$field_name] as $item)
- $checked[$item] = ' checked';
-
- foreach (file ($field_name.'_list.txt') as $temp)
- {
- $temp = trim ($temp);
- if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
-
- list ($value, $option) = explode ('::', $temp);
- $option
- or $option = $value;
- $output .= sprintf ('<input type="checkbox" name="field[%s]"
value="%s"%s /> %s<br />'."\n", $field_name, $value,
$selected[$value], $option);
- }
-
- return "\n$output";
-}
-
-function file2cb_column ($field_name)
-{
- $field[$field_name] = $GLOBALS[field][$field_name];
-
- if(is_array ($field[$field_name]))
- foreach ($field[$field_name] as $item)
- $checked[$item] = ' checked';
-
- $modules = file ($field_name.'_list.txt');
- $no_of_cells = count ($modules);
- $row_length = ceil ($no_of_cells/3);
-
-
-
- for ($n=0, $col = 0, $row = 0; $n < $no_of_cells; ++$n)
- {
- $temp = trim ($modules[$n])
- or $temp = ' ';
-
- if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
-
- list ($value, $option) = explode ('::', $temp);
-
- $option
- or $option = $value;
-
- $line = '<td><font face="Tahoma, Arial, Helvetica, sans-serif"
SIZE="2">';
- $line .= sprintf ('<input type="checkbox" name="field[%s][]"
value="%s" %s /> %s ', $field_name, $value, $checked[$value], $option);
- $line .= '</font></td>';
-
- $cell[$col][$row] = $line;
-
- ++$row;
- if ($row == $row_length)
- {
- $row = 0;
- ++$col;
- }
- }
-
- for ($row = 0; $cell[0][$row]; ++$row)
- $out .= '<tr
bgcolor="#F0F0F0">'.$cell[0][$row].$cell[1][$row].$cell[2][$row].'</tr>';
-
- return '<table border="1"
width="100%">'.$out.'</table>';
-}
-
-# generate_row
-# Author: j.a.greant 2000/08/23 zak@php.net
-
-# A simple function for generating formatted rows with a varying # of columns
-
-function generate_row ($column_data, $no_of_columns = 2)
-{
- $row = '<tr bgcolor="#F0F0F0">';
-
- for ($index=0; $index < $no_of_columns; ++$index)
- {
- $row .= '<td><font face="Tahoma, Arial, Helvetica, sans-serif">';
- $row .= $column_data[$index];
- $row .= '</font></td>';
- }
-
- return $row . '</tr>';
-}
-?>
+<?php include 'functions.php'; ?>
<html>
<head>
<title>
@@ -129,7 +7,7 @@
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#990000"
vlink="#999900">
<font face="Tahoma, Arial, Helvetica, Sans Serif">
-<form action="<?= $PHP_SELF ?>" method="POST">
+<form action="harvest.php" method="POST">
<center>
<h3>PHP Build and Install Tracker</h3>
@@ -174,8 +52,7 @@
<?= generate_row (array (' <b>3.2 (b)</b> What version of the above
operating system are you using?', '<input type="text"
name="field[os_version]" value="'.htmlentities (stripslashes
($field[os_version])).'" size="32" maxlength="56" />')) ?>
<tr bgcolor="#F0F0F0"><td colspan="2"><font
face="Tahoma, Arial, Helvetica, sans-serif"> <b>3.3</b> What web
server(s) do you use with this build of PHP?</font></td></tr>
<tr bgcolor="#F0F0F0"><td colspan="2"><?= file2cb_column
('server') ?></td></tr>
- <?= generate_row (array (' <b>3.4 (a)</b> If you compiled PHP,
please enter the configure line here:', '<textarea name="field[configure]"
rows="2" cols="30">'.$field[configure].'</textarea>'))
?>
- <?= generate_row (array (' <b>3.4 (b)</b> If you installed a
binary, please enter the output of phpinfo() here:', '<textarea
name="field[configure]" rows="2"
cols="30">'.$field[phpinfo].'</textarea>')) ?>
+ <?= generate_row (array (' <b>3.4</b> If you compiled PHP, please
enter the configure line here:', '<textarea name="field[configure]"
rows="2" cols="30"
wrap="virtual">'.$field[configure].'</textarea>')) ?>
</table>
</td>
Index: qaweb/build_tracker/functions.php
diff -u qaweb/build_tracker/functions.php:1.1 qaweb/build_tracker/functions.php:1.2
--- qaweb/build_tracker/functions.php:1.1 Fri Aug 25 18:16:16 2000
+++ qaweb/build_tracker/functions.php Wed Oct 4 19:34:00 2000
@@ -1,5 +1,18 @@
<?php
+function widget ($group_name, $field_name, $note_desc = ' ', $long_note = 0)
+{
+ $field[$group_name][$field_name] = $GLOBALS[field][$group_name][$field_name];
+ $var_name = "field[$field_name][$name]";
+ $out[] = '<input type="text" name="'.$var_name[version].'"
value="'.htmlentities (${$var_name.'[version]'}).'" />';
+ $out[] = ' '.$note_desc;
+ if ($long_note)
+ $out[] = '<textarea name="'.$var_name[notes].'" rows="2"
cols="30" wrap="virtual">'.htmlentities
(${$var_name.'[notes]'}).'</textarea>';
+ else
+ $out[] = '<input type="text" name="'.$var_name[notes].'"
value="'.htmlentities (${$var_name.'[notes]'}).'" />';
+ return $out;
+}
+
# file2select
# Author: j.a.greant 2000/08/23 zak@php.net
@@ -18,14 +31,90 @@
$temp = trim ($temp);
if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
-
list ($value, $option) = explode ('::', $temp);
+ $option
+ or $option = $value;
$output .= sprintf ('<option
value="%s"%s>%s</option>'."\n", $value, $selected[$value],
$option);
}
return '<select name="field[' . $field_name . ']">' .
"\n$output" . '</select>';
}
+# file2checkbox
+# Author: j.a.greant 2000/10/03 zak@php.net
+
+# A simple function for generating one or more checkboxes from formatted text files
+# format for text files is: option value::option display name
+# each entry should be separated by a newline
+# blank lines and lines that start with a single # are ignored
+
+function file2checkbox ($field_name)
+{
+ $field[$field_name] = $GLOBALS[field][$field_name];
+ if(is_array ($field[$field_name]))
+ foreach ($field[$field_name] as $item)
+ $checked[$item] = ' checked';
+
+ foreach (file ($field_name.'_list.txt') as $temp)
+ {
+ $temp = trim ($temp);
+ if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
+
+ list ($value, $option) = explode ('::', $temp);
+ $option
+ or $option = $value;
+ $output .= sprintf ('<input type="checkbox" name="field[%s]"
value="%s"%s /> %s<br />'."\n", $field_name, $value,
$selected[$value], $option);
+ }
+
+ return "\n$output";
+}
+
+function file2cb_column ($field_name)
+{
+ $field[$field_name] = $GLOBALS[field][$field_name];
+
+ if(is_array ($field[$field_name]))
+ foreach ($field[$field_name] as $item)
+ $checked[$item] = ' checked';
+
+ $modules = file ($field_name.'_list.txt');
+ $no_of_cells = count ($modules);
+ $row_length = ceil ($no_of_cells/3);
+
+
+
+ for ($n=0, $col = 0, $row = 0; $n < $no_of_cells; ++$n)
+ {
+ $temp = trim ($modules[$n])
+ or $temp = ' ';
+
+ if (! $temp || $temp[0] == '#') continue; # ignore blanks and comments
+
+ list ($value, $option) = explode ('::', $temp);
+
+ $option
+ or $option = $value;
+
+ $line = '<td><font face="Tahoma, Arial, Helvetica, sans-serif"
SIZE="2">';
+ $line .= sprintf ('<input type="checkbox" name="field[%s][]"
value="%s" %s /> %s ', $field_name, $value, $checked[$value], $option);
+ $line .= '</font></td>';
+
+ $cell[$col][$row] = $line;
+
+ ++$row;
+ if ($row == $row_length)
+ {
+ $row = 0;
+ ++$col;
+ }
+ }
+
+ for ($row = 0; $cell[0][$row]; ++$row)
+ $out .= '<tr
bgcolor="#F0F0F0">'.$cell[0][$row].$cell[1][$row].$cell[2][$row].'</tr>';
+
+ return '<table border="1"
width="100%">'.$out.'</table>';
+}
+
# generate_row
# Author: j.a.greant 2000/08/23 zak@php.net
@@ -42,11 +131,13 @@
$row .= '</font></td>';
}
- $row .= '</tr>';
-
- return $row;
+ return $row . '</tr>';
}
-
-
+function I_am_so_embarrassed ($group_name, $name, $note_desc = 'Notes', $long_note=0)
+{
+ list ($version_field, $note_desc, $note_field) = widget ($group_name, $name, $note_desc,
$long_note);
+ print generate_row (array ($name, $version_field));
+ print generate_row (array ($note_desc, $note_field));
+}
?>
Index: qaweb/build_tracker/php_source_list.txt
diff -u qaweb/build_tracker/php_source_list.txt:1.1 qaweb/build_tracker/php_source_list.txt:1.2
--- qaweb/build_tracker/php_source_list.txt:1.1 Fri Aug 25 18:16:16 2000
+++ qaweb/build_tracker/php_source_list.txt Wed Oct 4 19:34:00 2000
@@ -1,4 +1,4 @@
-# Comments start with a #
+# Comments lines must start with a #
release::I downloaded a source release from PHP.net
CVS::I grabbed a copy of the source code from CVS
snapshot::I downloaded a snapshot from snaps.php.net
Index: qaweb/build_tracker/server_list.txt
diff -u qaweb/build_tracker/server_list.txt:1.2 qaweb/build_tracker/server_list.txt:1.3
--- qaweb/build_tracker/server_list.txt:1.2 Wed Oct 4 15:14:11 2000
+++ qaweb/build_tracker/server_list.txt Wed Oct 4 19:34:00 2000
@@ -1,6 +1,7 @@
AOL Server
Apache
fhttpd
+Java Servlet
Netscape
OmniHTTPD
phttpd
Index: qaweb/build_tracker/harvest.php
+++ qaweb/build_tracker/harvest.php
<?php include 'functions.php'; ?>
<html>
<head>
<title>
PHP|QAT: PHP Build and Install Tracker
</title>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#990000"
vlink="#999900">
<font face="Tahoma, Arial, Helvetica, Sans Serif">
<form action="<?= $PHP_SELF ?>" method="POST">
<center>
<h3>PHP Build and Install Tracker</h3>
<table cellpadding="3" cellspacing="3" border="0"
width="620">
<tr bgcolor="#E0E0E0">
<td><font face="Tahoma, Arial, Helvetica, sans-serif"><b>
SERVER INFORMATION
</b></font>
<table width="100%">
<?
# Add handling for 'other' server
# discard check once error handling in place
if ($field[server])
foreach ($field[server] as $server)
{
list ($version_field, $note_desc, $note_field) = widget ('server', $server,
'Server Conf File', 1);
print generate_row (array ($server, $version_field));
print generate_row (array ($note_desc, $note_field));
}
?>
</table>
</td>
</tr>
<?php if ($field[php_source] != binary) { ?>
<tr bgcolor="#E0E0E0">
<td><font face="Tahoma, Arial, Helvetica, sans-serif"><b>
BUILD INFORMATION
</b></font>
<table width="100%">
<?
if ($field[php_source] != 'release')
{
I_am_so_embarrassed ('build_info', 'autobuild');
I_am_so_embarrassed ('build_info', 'autoconf');
}
I_am_so_embarrassed ('build_info', 'compiler');
I_am_so_embarrassed ('build_info', 'bison');
I_am_so_embarrassed ('build_info', 'flex');
I_am_so_embarrassed ('build_info', 'm4');
I_am_so_embarrassed ('build_info', 'make');
?>
</table>
</td>
</tr>
<tr bgcolor="#E0E0E0">
<td><font face="Tahoma, Arial, Helvetica, sans-serif"><b>
CONFIGURE INFORMATION
</b></font>
<table width="100%">
<?
I_am_so_embarrassed ('build_info', 'configure.log', 'Paste Configure Log
Here',1);
# parse config file into chunks and match to extensions
$field[configure] = ereg_replace ('[[:space:]]+', ' ', stripslashes
($field[configure]));
foreach (explode ('--', $field[configure]) as $line)
{
foreach (file ('extension_list.txt') as $ext)
{
list ($ext, $name) = explode ('::', $ext);
if (stristr ('--'.$line, trim ($ext)))
{
I_am_so_embarrassed ('extensions', $name);
break;
}
}
}
?>
</table>
</td>
</tr>
<?php } else { ?>
<tr bgcolor="#E0E0E0">
<td><font face="Tahoma, Arial, Helvetica, sans-serif"><b>
BINARY INFORMATION
</b></font>
<table width="100%">
<?
I_am_so_embarrassed ('binary_info', 'where you got the binary');
I_am_so_embarrassed ('build_info', 'phpinfo() output', 'Paste Output of
phpinfo() here', 1);
stristr ($field[os], 'window')
and I_am_so_embarrassed ('where did you get your dlls', 'dll source');
?>
</table>
</td>
</tr>
<?php } ?>
<tr bgcolor="#E0E0E0">
<td><font face="Tahoma, Arial, Helvetica, sans-serif"><b>
ADDITIONAL NOTES
</b></font>
<table width="100%">
<?
I_am_so_embarrassed ('notes', 'notes', 'place any extra notes
here', 1);
?>
</table>
</td>
</tr>
</table>
</center>
</form>
<br />
<PRE>
<? print_r ($HTTP_POST_VARS) ?>
</form>
</font>
</body>
</html>
Index: qaweb/build_tracker/extension_list.txt
+++ qaweb/build_tracker/extension_list.txt
--enable-bcmath::BC Math
--enable-dba::DBA
--enable-dbase::dBase
--enable-exif::exif
--enable-filepro::filePro
--enable-freetype-4bit-antialias-hack::FreeType 2
--enable-roxen-zts::Roxen
--enable-sysvsem::System V Semaphores
--enable-sysvshm::System V Shared Memory
--enable-wddx::WDDX
--enable-yp::YP
--with-adabas::Adabase
--with-aolserver::AOLserver
--with-apache::Apache
--with-aspell::Aspell
--with-ccvs::CCVS
--with-cdb::CDB
--with-cpdflib::ClibPDF
--with-curl::cURL
--with-custom-odbc::ODBC
--with-cybercash::CyberCash
--with-db2::DB2
--with-db3::DB3
--with-dbm::DBM
--with-dbmaker::dbMaker
--with-dom::DOM XML
--with-empress::Empress
--with-esoob::Easysoft OOB
--with-fdftk::Forms Data Format
--with-fhttpd::fhttpd
--with-gd::gd
--with-gdbm::gdbm
--with-gettext::GNU gettext
--with-hyperwave::Hyperwave
--with-ibm-db2::IBM DB2
--with-icap::ICAP
--with-imap::IMAP
--with-informix::Informix
--with-ingres::Ingress
--with-interbase::Interbase
--with-iodbc::iodbc
--with-java::Java
--with-jpeg-dir::jpeg dir for gd-1.8+ and/or pdflib 3.x
--with-kerberos::Kerberos
--with-ldap::LDAP
--with-mcal::MCAP
--with-mcrypt::Mcrypt
--with-mhash::Mhash
--with-mod-dav::DAV
--with-msql::mSQL
--with-mysql::MySQL
--with-ndbm::ndbm
--with-nsapi::Netscape Server
--with-oci8::Oracle8 Call-Interface
--with-openlink::OpenLink ODBC
--with-openssl::OpenSSL
--with-oracle::Oracle
--with-pcre-regex::Perl Compatible Regular Expressions
--with-pdflib::PDFlib
--with-pfpro::Verisign Payflow Pro
--with-pgsql::PostgreSQL
--with-phttpd::Phttpd
--with-pi3web::Pi3Web
--with-png-dir::png dir for pdflib 3.x
--with-pspell::Pspell
--with-readline::GNU Readline
--with-recode::GNU Recode
--with-roxen::Roxen
--with-servlet::Java Servlet
--with-snmp::SNMP
--with-solid::Solid
--with-swf::libswf
--with-sybase::Sybase
--with-t1lib::T1lib
--with-thttpd::thttpd
--with-tiff-dir::tiff dir for pdflib 3.x
--with-ttf::Freetype
--with-unixODBC::unixODBC
--with-velocis.::Velocis
--with-xpm-dir::xpm dir for gd-1.8+
--with-yaz::YAZ
--with-zeus::Zeus
--with-zlib-dir::zlib dir for pdflib 3.x (or include zlib support)
--with-zlib::zlib