Beispiel #1
0
            }
            fclose($fp);
        } else {
            echo "Can't make the destination file :(\n";
            //_log('cannot create the destination file');
            return false;
        }
        // rename the temporary directory (to avoid access from other
        // concurrent chunks uploads) and than delete it
        //chmod($temp_dir, 0757);
        //if (rename($temp_dir, $temp_dir.'_UNUSED')) {
        //    rmdir($temp_dir.'_UNUSED');
        //} else {
        //    rmdir($temp_dir);
        //}
    } else {
        echo "Failed first check :(\n";
        echo "{$total_files} * {$chunkSize} >=  ({$totalSize} - {$chunkSize} + 1)\n";
        echo $total_files * $chunkSize . " >= " . ($totalSize - $chunkSize + 1) . "\n";
    }
}
echo "Running!\n";
$arguments = $argv;
//$arguments[0] is file name, so you would use arguments[1] --> arguments[4]
//
createFileFromChunks($arguments[1], $arguments[2], $arguments[3], 1024 * 1 * 1024, $arguments[4]);
$nowtime = time();
echo "\ntime elapsed: " . time_elapsed_A($nowtime - $oldtime) . "\n";
echo "\ndone yayyyyyyYYYYYYYYY";
//createFileFromChunks('/tmp/resumable.js', 'test1g.tmp', 1024*1*1024, 1000000);
// php ~/resumable_custom/resumable.js/samples/Node.js/combiner.php '/tmp/resumable.js' 'test1g.tmp' resumable-1073741824-test1gtmp
Beispiel #2
0
        }
    } else {
        //        $city_address_attributes->add( $new_rec );
        print "\nEEEE\n";
        $totals['city_address_attributes']['insert']++;
    }
}
print "\nTotals\n--------------------------------------------------------------------------\n";
printf("%-30.30s %10s %10s %10s %10s\n", 'table', 'insert', 'update', 'N/A', 'ERROR');
foreach ($totals as $table => $counts) {
    printf("%-30.30s %10d %10d %10d %10d\n", $table, $counts['insert'], $counts['update'], $counts['N/A'], $counts['error']);
}
print "--------------------------------------------------------------------------\n\n";
print "Number of lines processed {$row}\n\n";
// Calcuate how much time this took
$end_time = time();
$time_diff = $end_time - $start_time;
if ($time_diff > 0) {
    $time_diff = time_elapsed_A($time_diff);
} else {
    $time_diff = ' 0 seconds';
}
$ru = getrusage();
$str = "This process used " . rutime($ru, $rustart, "utime") . " ms for its computations\n";
print "\n";
print $str;
$str = "It spent " . rutime($ru, $rustart, "stime") . " ms in system calls\n";
print $str;
// Print end message with time it took
print "Run time:  {$time_diff}\n";
print "\n\n";