Login   Register  
PHP Classes
elePHPant
Icontem

File: example.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Paul Scott  >  Backgrounder  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example Script
Class: Backgrounder
Call background processes
Author: By
Last change: Added better comments to the example script
Date: 2006-01-17 23:34
Size: 709 bytes
 

Contents

Class file image Download
<?php
//include the class source
include("background_class_inc.php");

//instantiate a new object
$b = new background;

//check the users connection status, 
//only needs to be done once, then it becomes internal
$status $b->isUserConn();

//keep the user connection alive, even if browser is closed!
$callback $b->keepAlive();

//this is where you would call your code that takes a long time to execute
sleep(60); //fake the long process - a 60 second process

//fork the process, and create the child process
//call the callback function when done!
$call2 $b->setCallback("john.doe@example.com","Your Script","The really long running process that you requested is complete!");

?>