Beispiel #1
0
                         }
                         $testCount++;
                     }
                 }
                 // write out the list of urls and the test ID for each
                 if ($testCount) {
                     $path = GetTestPath($test['id']);
                     gz_file_put_contents("./{$path}/bulk.json", json_encode($bulk));
                 } else {
                     $error = 'Urls could not be submitted for testing';
                 }
             } else {
                 $error = "No valid urls submitted for bulk testing";
             }
         } else {
             $test['id'] = CreateTest($test, $test['url']);
             if (!$test['id'] && !strlen($error)) {
                 $error = 'Error submitting url for testing';
             }
         }
     }
 }
 // redirect the browser to the test results page
 if (!strlen($error)) {
     if (array_key_exists('submit_callback', $test)) {
         $test['submit_callback']($test);
     }
     $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' || isset($_SERVER['HTTP_SSL']) && $_SERVER['HTTP_SSL'] == 'On' ? 'https' : 'http';
     $host = $_SERVER['HTTP_HOST'];
     $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
     if ($xml) {
Beispiel #2
0
                        $bfunc = "{$f2}(x)";
                        if ($be == -1) {
                        } else {
                            $bfunc = "pow({$bfunc}," . -$be . ".0)";
                        }
                        $func .= $bfunc;
                    } else {
                        if ($be != 0) {
                            $func .= $operator == 0 ? " * " : " + ";
                            $bfunc = "{$f2}(x)";
                            if ($be == 1) {
                            } else {
                                $bfunc = "pow({$bfunc},{$be}.0)";
                            }
                            $func .= $bfunc;
                        }
                    }
                    static $counter = 0;
                    ++$counter;
                    $name = $counter;
                    #$op = $operator?'add':'mul';
                    #$name = sprintf('%s_%sp%d_%sp%d', $op,$f1,$ae,$f2,$be);
                    CreateTest($func, $name);
                    if (preg_match('/h\\(/', $func)) {
                        CreateTest(str_replace('(x)', '(x*x)', $func), ++$counter);
                    }
                }
            }
        }
    }
}