Пример #1
0
     logMsg(" No uploaded file attached\n");
 }
 // figure out the path to the results
 $testPath = './' . GetTestPath($id);
 // extract the zip file
 if (isset($_FILES['file'])) {
     logMsg(" Extracting uploaded file '{$_FILES['file']['tmp_name']}' to '{$testPath}'\n");
     $archive = new PclZip($_FILES['file']['tmp_name']);
     $list = $archive->extract(PCLZIP_OPT_PATH, "{$testPath}/", PCLZIP_OPT_REMOVE_ALL_PATH);
 }
 // see if the test is complete
 if ($done) {
     // do pre-complete post-processing
     require_once 'video.inc';
     MoveVideoFiles($testPath);
     BuildVideoScripts($testPath);
     $test = file_get_contents("{$testPath}/testinfo.ini");
     $now = date("m/d/y G:i:s");
     // update the completion time if it isn't already set
     if (!strpos($test, 'completeTime')) {
         $complete = "[test]\r\ncompleteTime={$now}";
         $out = str_replace('[test]', $complete, $test);
         file_put_contents("{$testPath}/testinfo.ini", $out);
     }
     // see if it is an industry benchmark test
     $ini = parse_ini_file("{$testPath}/testinfo.ini");
     if (strlen($ini['industry']) && strlen($ini['industry_page'])) {
         // lock the industry list
         // we will just lock it against ourselves to protect against  simultaneous updates
         // we will let the readers get whatever they can
         if (!is_dir('./video/dat')) {
Пример #2
0
     $p = explode(':', $parts[$i]);
     if (count($p) >= 2) {
         if ($p[0] == 'r') {
             $test['run'] = (int) $p[1];
         }
         if ($p[0] == 'l') {
             $test['label'] = urldecode($p[1]);
         }
         if ($p[0] == 'c') {
             $test['cached'] = (int) $p[1];
         }
     }
 }
 $test['path'] = GetTestPath($test['id']);
 $test['pageData'] = loadAllPageData($test['path']);
 BuildVideoScripts("./{$test['path']}");
 if (!$test['run']) {
     $test['run'] = GetMedianRun($test['pageData']);
 }
 $test['videoPath'] = "./{$test['path']}/video_{$test['run']}";
 if ($test['cached']) {
     $test['videoPath'] .= '_cached';
 }
 if (!strlen($test['label'])) {
     $test['label'] = trim(file_get_contents("./{$test['path']}/label.txt"));
 }
 if (!strlen($test['label'])) {
     $test['label'] = trim(file_get_contents("./{$test['path']}/url.txt"));
 }
 $labels[] = $test['label'];
 if (is_dir($test['videoPath'])) {