Location: PHPKode > projects > Pindorama > pindorama/active/schedule.php
<?php
/************************************************************
 *                                                          *
 *      Pindorama Core Components v. 0.1                    *
 *      Guilherme Capilé <hide@address.com>           *
 *                                                          *
 ************************************************************/

global $param, $c;
error_reporting (E_ALL ^ E_NOTICE); 
$cwd = dirname(str_replace("\\", "/", getcwd()));
//ob_start();
$c["base"] = $cwd;
require_once("config/core.php");
if (is_file($c["config"]."core.php")){
    require_once($c["config"]."core.php");
}
require_once("config/error.php");
require_once("components/core.php");
require_once("components/login.php");
$checkfile = $c["var"]."check.publish";
tmp_checkin($checkfile);

$param["user"] = "admin";
$param["quiet"] = true;
xml_request();
$param["user"] = "admin";
$param["quiet"] = true;
$param["shell"] = true;
require($c["components"]."components.php");
// do publication 
require($c["components"]."publication.php");
process_todo();

// clean the checkfile
//tmp_checkout($checkfile);

// import posted information
//require($c["components"]."import.php");
//import_upload_info();

//$res = ob_get_contents();
//log_xpml($res);
//ob_end_clean();

function tmp_checkin($checkfile)
{
    $now = time();
    if (is_file($checkfile)) {
        // checkfile exists -- there must be someone publishing some pages
        // see if it's up for more than 20 min 
        $then = trim(file_get_contents($checkfile));
        $then = (!is_numeric($then))?(filemtime($checkfile)):($then);
        if (!is_numeric($then)) {
            exit();
        } else if (($then + 72000) < $now ) {
            // if it is, delete the checkfile
            unlink($checkfile);
        } else {
            // if it's not, come back later...
            sleep(60);
            return tmp_checkin($checkfile);
        }
    }
    // save the new checkfile
    //return save_file($checkfile, $now);
}

function tmp_checkout($checkfile)
{
    return unlink($checkfile);
}
?>
Return current item: Pindorama