Process to background 0.1 PHP script

SPONSORED LINKS

    Specification

  • Version: 0.1
  • File size: 0 KB
  • File name: download.php?type=snippet&id=1827
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: PHP
  • Price:GPL
  • Company: mosey (View more)

Process to background 0.1 script description:




Publisher review:
Process to background is a PHP 5 class that sends a specified php file, dynamically generated php code, or any system call to a background process on linux/unix servers. This is a PHP 5 class that sends a specified php file, dynamically generated php code, or any system call to a background process on linux/unix servers (a little modification to the forkToStream method would make it run on windows) and returns a filename that will contian that processe's output.

In addition, if you use the forkPHPFile or forkPHPCode methods, the forked script will have access to the output file's name in its first $argv.This is helpful for starting scripts or programs that take a long time to execute and that you do not want to have the user wait for. Since all the fork* methods return immediately, php can continue to generate the page while the time-consuming process runs on another thread on the server.

It can also start a bunch of little processes going - for instance I wrote it to simultaneously make a bunch of connections to remote systems instead of waiting for it to retieve the data from each, one at a time.Tips:

-pass false to the constructor to have all the output files deleted at the end of your script's execution.-If you want to start many processes simultaneously but none of them will take long to finish, you can use the php's sleep() function to check their output every second until they're all done.-Since your php scripts know the name of their output file (its the first command-line argument variable), you can re-write their contents (i.e. 27% turns to 28%...) and then just output the % done whenever the user refreshes (you'd have to store the output filename in a session variable).
Process to background 0.1 is a PHP script for Snippets scripts design by mosey. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5