Login   Register  
PHP Classes
elePHPant
Icontem

File: bt-cron.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Michael Dale  >  Bluetrait  >  bt-cron.php  >  Download  
File: bt-cron.php
Role: Auxiliary script
Content type: text/plain
Description: Cron File
Class: Bluetrait
A multi-user blog system
Author: By
Last change:
Date: 2008-10-26 03:23
Size: 701 bytes
 

Contents

Class file image Download
<?php
/*
    Bluetrait 2.0 Cron Support
    Michael Dale Copyright 2007
*/

//stop from running over and over again :)
define('BT_RUNNING_CRON'TRUE);
ignore_user_abort(TRUE);

include(
'bt-common.php');

$cron_intervals bt_get_config('cron_intervals');

if (!
is_array($cron_intervals)) exit;

foreach (
$cron_intervals as &$cron_interval) {
    if (
$cron_interval['next_run'] <= bt_datetime()) {
        
$cron_interval['next_run'] = bt_datetime($cron_interval['frequency']);
        
bt_run_section('cron_' $cron_interval['name']);
        
//too noisy
        //trigger_error('Cron ('.$cron_interval['description'].') Successful', E_USER_NOTICE);
    
}
}

bt_set_config('cron_intervals'$cron_intervals);
?>