<?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);
 
?>
 
 |