Example #1
0
<?php

require_once "classScielo.php";
require_once 'applications/scielo-org/sso/header.php';
// Create new Scielo object
$host = $_SERVER['HTTP_HOST'];
$scielo = new Scielo($host);
// This check the pid is old, then redirect to the script can treat it
$scielo->loadPreviousUrlWhichContainsOldPid();
$CACHE_STATUS = $scielo->_def->getKeyValue("CACHE_STATUS");
$MAX_DAYS = $scielo->_def->getKeyValue("MAX_DAYS");
$MAX_SIZE = $scielo->_def->getKeyValue("MAX_SIZE");
$DIVULGA = $scielo->_def->getKeyValue("ENABLE_DIVULGACAO");
if ($CACHE_STATUS == 'on' && $MAX_DAYS > 0) {
    $filenamePage = $scielo->GetPageFile();
}
$filenamePage = "";
$pageContent = "";
$GRAVA = false;
if ($filenamePage) {
    if (file_exists($filenamePage)) {
        echo "<!-- EXISTE {$filenamePage} -->";
        $lastChange = date("F j Y g:i:s", filemtime($filenamePage));
        $diff = dateDiff($interval = "d", $lastChange, date("F j Y g:i:s"));
        if ($diff <= $MAX_DAYS) {
            echo "<!-- dentro do prazo {$time} -->";
            $fp = fopen($filenamePage, "r");
            if ($fp) {
                $pageContent = fread($fp, filesize($filenamePage));
                $pageContent .= "\n" . '<!-- Cache File name: ' . $filenamePage . '-->';
                fclose($fp);
 function ScieloLog($host)
 {
     Scielo::Scielo($host);
 }
Example #3
0
 function GenerateXmlUrl()
 {
     $table = $this->_CallSqlQueryScript();
     $xml = Scielo::GenerateXmlUrl();
     $xml .= "&table={$table}";
     return $xml;
 }
Example #4
0
<?php

require_once "classScielo.php";
require_once 'applications/scielo-org/sso/header.php';
// Create new Scielo object
$host = $_SERVER['HTTP_HOST'];
$scielo = new Scielo($host);
$CACHE_STATUS = $scielo->_def->getKeyValue("CACHE_STATUS");
$MAX_DAYS = $scielo->_def->getKeyValue("MAX_DAYS");
$MAX_SIZE = $scielo->_def->getKeyValue("MAX_SIZE");
$DIVULGA = $scielo->_def->getKeyValue("ENABLE_DIVULGACAO");
if ($CACHE_STATUS == 'on' && $MAX_DAYS > 0) {
    $filenamePage = $scielo->GetPageFile();
}
$filenamePage = "";
$pageContent = "";
$GRAVA = false;
if ($filenamePage) {
    if (file_exists($filenamePage)) {
        echo "<!-- EXISTE {$filenamePage} -->";
        $lastChange = date("F j Y g:i:s", filemtime($filenamePage));
        $diff = dateDiff($interval = "d", $lastChange, date("F j Y g:i:s"));
        if ($diff <= $MAX_DAYS) {
            echo "<!-- dentro do prazo {$time} -->";
            $fp = fopen($filenamePage, "r");
            if ($fp) {
                $pageContent = fread($fp, filesize($filenamePage));
                $pageContent .= "\n" . '<!-- Cache File name: ' . $filenamePage . '-->';
                fclose($fp);
            }
        } else {