I'm trying it myself using a little class that reads itself from a specific file at the beginning of the script and then serialises itself to the file on script termination, and was wondering if anyone else had tried anything similar they wanted to share?
For anyone interested, the basic usage is like this (more or less)
Code: Select all
<?php
/* include the application class - not shown here because it is currently somewhere in between concept and code */
include("application.class.php");
$application = new application();
if( !isset($application->counter ) ){
$application->counter = 1;
}else{
$application->counter++;
}
echo "This server has served ".$application->counter." requests for scripts using application object";
?>If anyone has tried something similar, I'd love to hear about it.
cheers, Sam