Login   Register  
PHP Classes
elePHPant
Icontem

File: jobScript.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Manooj Kumar Dhar  >  Multi Threading, Daemon (Windows service)  >  jobScript.php  >  Download  
File: jobScript.php
Role: Example script
Content type: text/plain
Description: this file will receive all the paramets sent by the windows service using the multithreading process and process the further execution
Class: Multi Threading, Daemon (Windows service)
Create Windows service to run daemons
Author: By
Last change:
Date: 4 years ago
Size: 747 bytes
 

Contents

Class file image Download
<?php

/**
* Created on 31/10/2008
* @author Manooj Kumar Dhar

* (...)
* This part of code is simply called by window service 
* Receives the parameters sent by window service and then fires the Database Query to fetch the result 
*/

// I am creating the semaphore file
$filename dirname(__FILE__).'/count/process' trim(rand(10000,9999999999)) . '.proc';
$file fopen($filename'w');
fclose($file);

// There I am putting the arguments array into a string (just to write the content in a file)
ob_start();
print_r($argv);
$ret_str ob_get_contents();
ob_end_clean();

// Arguments passed in the thread are received here as follows:

//$argv(0,1....)

// I am deleting the semaphore file
unlink($filename);
?>