Recommend this page to a friend! |
Download .zip |
Info | Example | View files (22) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2016-02-23 (8 months ago) | Not yet rated by the users | Total: 384 | All time: 6,338 This week: 1,068 |
Version | License | PHP version | Categories | |||
cron-job-runner 1.0.0 | The PHP License | 5.0 | PHP 5, Language |
Description | Author | ||||||||||||||
This package can start and stop tasks in the background. |
|
___ _ _ ___ ___ _ _ ___ | _ \ || | _ \/ __|_ _ ___ _ _ _ | |___| |__ | _ \_ _ _ _ _ _ ___ _ _ | _/ __ | _/ (__| '_/ _ \ ' \ | || / _ \ '_ \ | / || | ' \| ' \/ -_) '_| |_| |_||_|_| \___|_| \___/_||_| \__/\___/_.__/ |_|_\\_,_|_||_|_||_\___|_| PHPCron Job Runner 1.0.0 ------------------------------------------------------------------------------- Start and stop tasks in the background This package can start and stop tasks in the background. The main class takes an object as parameter that will be used to implement common functionality of the task that is meant to be executed like the code to run when the task is started, stopped, when receiving new commands, etc.. Applications should extend the main class to implement the functionality of the background task that is going to be executed. The class can start the task in the background in either Linux or Windows. It uses the PHP CLI version to execute the background task. It can take a custom php.ini configuration file. The class can be started from the PHP CLI version or as Web server HTTP request. In the later in can preserve the super-global variables $_GET, $_POST, $_COOKIE, $_SESSION, $_FILES. #################################### Features Summary: ********************** @ Support to run through command line @ Support to run through url request via http server (Apache) @ $_GET/$_POST/$_COOKIE/$_SESSION/$_FILES will perserve if you run through URL Request via http server (Apache) @ Custom error log @ External command listner @ Load Average check. @ OnStop/ onStart/ onFail / onValidate / onReceive callback implemnted @ Direct write debuger data to a output file @ Capture last error during end of excecution of the script @ Support currently activity to status file like "10 of 50 Steps are completed" @ support to run another extranal script @ Output response are form of text, json or xml ********************** !!!!! Required!!!!! ******************** 1. php binary executable file version >=5.3 (Obviously) 2. nohup binary executable file (in case of Linux) 3. temp folder must have write permission to all 4. php_com_dotnet.dll php extension should be enabled (in case of Window) [If not, No Problem, already added nohup.exe in bin folder] ********************* Example 1 Root service folder: crontabs [Place all your service inside this folder] Folder: ExampleCronJob1 [** temp folder with write permission should be created here] Filename: ExampleCronJob1.php --------- Simple cronjob that runs only one instance of the script defined in the script file i,e 1001 On Linux: /usr/bin/php crontabs/ExampleCronJob1/ExampleCronJob1.php -INSTID 1001 & On Window: bin\nohup.exe d:/xampp/php/php.exe crontabs/ExampleCronJob1/ExampleCronJob1.php -INSTID 1001 Through Browser: http://localhost/phpclasses/crontabs/ExampleCronJob1/ExampleCronJob1.php?3GCRON[SHELL]=1001&3GCRON[TESTMODE]=0&3GCRON[CONFIRM]=2&3GCRON[OUTPUT]=xml Params: 3GCRON[SHELL]=1001 for instance id of the script 3GCRON[TESTMODE]=1 1 for foreground, 0 for background 3GCRON[CONFIRM]=2 0-60 for wait until the service started 3GCRON[OUTPUT]='xml' or text;| or xml or json Example 2 Folder: ExampleCronJob2 Filename: ExampleCronJob2.php --------- This example of cron job demonstrate about how to start a script IN background when user request via web Also it preserves all data of $_GET/$_POST/$_SESSION/$_COOKIE/$_FILES Through Browser: http://localhost/crontabs/ExampleCronJob2/ExampleCronJob2.php Example 3 Folder: ExampleCronJob3 Filename: ExampleCronJob3.php -------- This example of cron job demonstrate how to validate a service before start On Linux: /usr/bin/php crontabs/ExampleCronJob3/ExampleCronJob3.php -INSTID 1001 & On Window: bin\nohup.exe d:/xampp/php/php.exe crontabs/ExampleCronJob3/ExampleCronJob3.php -INSTID 1001 Through Browser: http://localhost/phpclasses/crontabs/ExampleCronJob1/ExampleCronJob3.php?3GCRON[SHELL]=1001&3GCRON[TESTMODE]=0&3GCRON[CONFIRM]=2&3GCRON[OUTPUT]=json Params: 3GCRON[SHELL]=1001 for instance id of the script 3GCRON[TESTMODE]=1 1 for forground, 0 for background 3GCRON[CONFIRM]=2 0-60 for wait until the service started 3GCRON[OUTPUT]='json' or text;| or xml or json Example 4 folder : ExampleCronJob4 -------- Full example with:- @Read external command, @Default command ping, @Kill added On Linux: /usr/bin/php crontabs/ExampleCronJob3/ExampleCronJob3.php --INSTID 1001 & On Window: bin\nohup.exe d:/xampp/php/php.exe crontabs/ExampleCronJob3/ExampleCronJob3.php --INSTID 1001 Through Browser: http://localhost/phpclasses/crontabs/ExampleCronJob1/ExampleCronJob1.php?3GCRON[SHELL]=1001&3GCRON[TESTMODE]=0&3GCRON[CONFIRM]=2&3GCRON[OUTPUT]=json Params: 3GCRON[SHELL]=1001 for instance id of the script 3GCRON[TESTMODE]=1 1 for foreground, 0 for background 3GCRON[CONFIRM]=2 0-60 for wait until the service started 3GCRON[OUTPUT]='json' or text;| or xml or json |
Files | / | crontabs |
File | Role | Description | ||
---|---|---|---|---|
ExampleCronJob1 (1 file, 3 directories) | ||||
ExampleCronJob2 (1 file, 3 directories) | ||||
ExampleCronJob3 (1 file, 3 directories) | ||||
ExampleCronJob4 (1 file, 3 directories) |
Files | / | crontabs | / | ExampleCronJob1 |
File | Role | Description | ||
---|---|---|---|---|
.classes (1 file) | ||||
.configs (1 file) | ||||
tmp (1 file) | ||||
ExampleCronJob1.php | Example | Example script |
Files | / | crontabs | / | ExampleCronJob1 | / | .classes |
File | Role | Description |
---|---|---|
example-cron-job1.class.php | Class | Example script |
Files | / | crontabs | / | ExampleCronJob2 |
File | Role | Description | ||
---|---|---|---|---|
.classes (1 file) | ||||
.configs (1 file) | ||||
tmp (1 file) | ||||
ExampleCronJob2.php | Example | Example script |
Files | / | crontabs | / | ExampleCronJob2 | / | .classes |
File | Role | Description |
---|---|---|
example-cron-job1.class.php | Example | Example script |
Files | / | crontabs | / | ExampleCronJob3 |
File | Role | Description | ||
---|---|---|---|---|
.classes (1 file) | ||||
.configs (1 file) | ||||
tmp (1 file) | ||||
ExampleCronJob3.php | Example | Example script |
Files | / | crontabs | / | ExampleCronJob3 | / | .classes |
File | Role | Description |
---|---|---|
example-cron-job3.class.php | Class | Class source |
Files | / | crontabs | / | ExampleCronJob4 |
File | Role | Description | ||
---|---|---|---|---|
.classes (1 file) | ||||
.configs (1 file) | ||||
tmp (1 file) | ||||
ExampleCronJob4.php | Example | Example script |
Files | / | crontabs | / | ExampleCronJob4 | / | .classes |
File | Role | Description |
---|---|---|
example-cron-job4.class.php | Class | Class source |
Files | / | systems |
File | Role | Description |
---|---|---|
cron_runner_class.php | Class | Class source |
cron_service_class.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.