Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: phpfog
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (29 sloc) 1.177 kB
<?php
/***********************************************
DAVE PHP API
https://github.com/evantahler/PHP-DAVE-API
Evan Tahler | 2011
Set this page to be fired off every minute by your cron process, and then put the logic inside this page.
The output of this page will be added to the CRON_LOG.txt file
***********************************************/
// Cron example: */1 * * * * /usr/bin/php /path/to/CRON.php > /path/to/CRON_LOG.txt
$parts = explode("/",__FILE__);
$ThisFile = $parts[count($parts) - 1];
chdir(substr(__FILE__,0,(strlen(__FILE__) - strlen($ThisFile))));
require_once("LoadEnv.php"); unset($parts); unset($ThisFile);
load_tasks();
$CRON_OUTPUT = "STARTING CRON @ ".date("m-d-Y H:i:s")."\r\n\r\n";
/////////////////////////////////////////////////////////////////////////
// Do Tasks
$CRON_OUTPUT .= run_task("CleanCache");
$CRON_OUTPUT .= run_task("CleanLog");
$CRON_OUTPUT .= run_task("CleanSessions");
$CRON_OUTPUT .= run_task("RemoveLargeLogs");
/////////////////////////////////////////////////////////////////////////
// End the log output
echo $CRON_OUTPUT;
$fh = fopen($CONFIG['CronLogFile'], 'a');
fwrite($fh, $CRON_OUTPUT);
fclose($fh);
exit;
?>
Jump to Line
Something went wrong with that request. Please try again.