47 if (file_exists($filename)) {
48 $date_time = new \DateTime();
49 $file_tmstamp = filemtime($filename);
51 $delta = $date_time->getTimestamp() - $file_tmstamp;
54 if (
$delta > $time_cache_second) {
56 $f_file = fopen($filename,
"w+");
57 if ( $f_file ==
false ) {
63 $content = file_get_contents($filename);
67 $f_file = fopen($filename,
"w+");
68 if ( $f_file ==
false ) {
static get_content($url, $filename, $time_cache_second)
Check if the file exists, if yes then read otherwise take it from the url,.