Back to index

php5  5.3.10
Classes | Enumerations | Functions | Variables
server-tests.php File Reference

Go to the source code of this file.

Classes

class  HTTPRequest
class  testHarness

Enumerations

enum  PHP_QA_EMAIL
enum  QA_SUBMISSION_PAGE
enum  PCRE_MISSING_ERROR
enum  SAFE_MODE_WARNING
enum  TMP_MISSING
enum  PROC_OPEN_MISSING
enum  REQ_PHP_VERSION
enum  PHP_INFO_SCRIPT
enum  PHP_EXTENSIONS_SCRIPT
enum  PHP_INI_SETTINGS_SCRIPT

Functions

 settings2array ($settings, &$ini_settings)
 settings2params (&$ini_settings)
 generate_diff ($wanted, $output)
 mkpath ($path, $mode=0777)
 copyfiles ($src, $new)
 post_result_data ($query, $data)
 execute ($command, $args=NULL, $input=NULL, $cwd=NULL, $env=NULL)
 executeCode ($php, $ini_overwrites, $code, $remove_headers=true, $cwd=NULL, $env=NULL)

Variables

 $test = new testHarness()

Enumeration Type Documentation

Definition at line 43 of file server-tests.php.

Definition at line 89 of file server-tests.php.

Definition at line 76 of file server-tests.php.

Definition at line 90 of file server-tests.php.

Definition at line 36 of file server-tests.php.

Definition at line 62 of file server-tests.php.

Definition at line 37 of file server-tests.php.

Definition at line 67 of file server-tests.php.

Definition at line 50 of file server-tests.php.

Definition at line 57 of file server-tests.php.


Function Documentation

copyfiles ( src,
new 
)

Definition at line 144 of file server-tests.php.

                              {
       $d = dir($src);
       while (($entry = $d->read())) {
              if (is_file("$src/$entry")) {
execute ( command,
args = NULL,
input = NULL,
cwd = NULL,
env = NULL 
)

Definition at line 163 of file server-tests.php.

{
       $data = "";
       
       if (gettype($args)=='array') {
              $args = join($args,' ');
       }
       $commandline = "$command $args";
       $proc = proc_open($commandline, array(
                            0 => array('pipe', 'r'),
                            1 => array('pipe', 'w')),
                            $pipes, $cwd, $env);

       if (!$proc)
              return false;

       if ($input) {
              $out = fwrite($pipes[0],$input);
              if ($out != strlen($input)) {
                     return NULL;
              }
       }
       
       fclose($pipes[0]);

       while (true) {
              /* hide errors from interrupted syscalls */
              $r = $pipes;
              $w = null;
              $e = null;
              $n = @stream_select($r, $w, $e, 60);

              if ($n === 0) {
                     /* timed out */
                     $data .= "\n ** ERROR: process timed out **\n";
                     proc_terminate($proc);
                     return $data;
              } else if ($n) {
                     $line = fread($pipes[1], 8192);
                     if (strlen($line) == 0) {
                            /* EOF */
                            break;
                     }
                     $data .= $line;

Here is the caller graph for this function:

executeCode ( php,
ini_overwrites,
code,
remove_headers = true,
cwd = NULL,
env = NULL 
)

Definition at line 213 of file server-tests.php.

{
       $params = NULL;
       if ($ini_overwrites) {
              $info_params = array();
              settings2array($ini_overwrites,$info_params);
              $params = settings2params($info_params);
       }
       $out = execute($php, $params, $code, $cwd, $env);
       // kill the headers
generate_diff ( wanted,
output 
)

Definition at line 120 of file server-tests.php.

{
       $w = explode("\n", $wanted);
       $o = explode("\n", $output);
       $w1 = array_diff_assoc($w,$o);
       $o1 = array_diff_assoc($o,$w);
       $w2 = array();
       $o2 = array();
       foreach($w1 as $idx => $val) $w2[sprintf("%03d<",$idx)] = sprintf("%03d- ", $idx+1).$val;
mkpath ( path,
mode = 0777 
)

Definition at line 135 of file server-tests.php.

                                    {
       $dirs = split('[\\/]',$path);
       $path = $dirs[0];
post_result_data ( query,
data 
)

Definition at line 154 of file server-tests.php.

{
settings2array ( settings,
&$  ini_settings 
)

Definition at line 96 of file server-tests.php.

{
       foreach($settings as $setting) {
              if (strpos($setting, '=')!==false) {
                     $setting = explode("=", $setting, 2);
                     $name = trim($setting[0]);
settings2params ( &$  ini_settings)

Definition at line 108 of file server-tests.php.

{
       $settings = '';
       if (count($ini_settings)) {
              foreach($ini_settings as $name => $value) {
                     $value = addslashes($value);

Variable Documentation

$test = new testHarness()

Definition at line 1554 of file server-tests.php.