Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function LaunchBackgroundProcess($command){ //Запускает команду в фоне
- // Run command Asynchroniously (in a separate thread)
- if(PHP_OS=='WINNT' || PHP_OS=='WIN32' || PHP_OS=='Windows'){
- $command = 'start /MIN "" '. $command;
- } else {
- $command = $command .' /dev/null &';
- }
- $handle = popen($command, 'r');
- if($handle!==false){
- pclose($handle);
- return true;
- } else {
- return false;
- }
- }
- LaunchBackgroundProcess('php "'.__DIR__.DIRECTORY_SEPARATOR.'script1.php'.'"');
- LaunchBackgroundProcess('php "'.__DIR__.DIRECTORY_SEPARATOR.'script2.php'.'"');
- LaunchBackgroundProcess('php "'.__DIR__.DIRECTORY_SEPARATOR.'script3.php'.'"');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement