/******
* Returns the actual server-time
* The format will be passed as string directly at the constructor (Syntax like the php-function date())
*/
class timer_api {
var $dateFormat;
function __construct($dateFormat) {
$this->dateFormat = $dateFormat;
}
function __sleep() {
// will be called if the object will be serialized.
// close open database connections and/or file-pointers here!!
return (array_keys(get_object_vars($this))); // This is mandatory!!
}
function __wakeup() {
// will be called if the object will be unserialized, before the next method call
// re-open closed database connections and/or file pointers
}
function getTime() {
return date($this->dateFormat);
}
}