Re: Background Process

From: Date: Tue, 26 May 2009 08:23:02 +0000
Subject: Re: Background Process
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-293155@lists.php.net to get a copy of this message
shahrzad khorrami wrote:
Hi, I have two php scripts, first one must pass arguments to second(the php script that will take more time to process for example inserting 1000000 records to db, data come from first script). I search around web and find below function: function execInBackground($path, $exe, $additional) {
    global $conf;
    if (file_exists($path . $exe)) {
        chdir($path);
        if (substr(php_uname(), 0, 7) == "Windows"){
            echo 'going Windows';
            pclose(popen("start \"bla\" \"" . $exe . "\" "  . $additional,
"r"));           } else {
                exec("./" . $exe . " " .  $additional . " > /dev/null
&");           }
    }
} But I don't know how to pass variables to the second file? and how to use of this function? in *windows* enviroment... and return value of second file to first.. Thanks in advance shahrzad
after following your recent threads, can I ask have you considered using the tools made available by the db? something like LOAD DATA LOCAL INFILE '/importfile.csv' INTO TABLE test_table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n' (field1, filed2, field3); this will be 100x faster than anything you can write with php regards!

« previous php.general (#293155) next »