FeedCache icon indicating copy to clipboard operation
FeedCache copied to clipboard

filemtime problem in populate_data()

Open quechup opened this issue 7 years ago • 0 comments

Fist delete remote files when the files expire, function cache_feed.

private function cache_feed() { if($this->remote_file_exists($this->remote)) {

  //---------------------line-added-begin
  //First delete localfiles
  unlink($this->local);
  //---------------------line-added-end

  //Second get and create the remote files, this refresh the filemtime used in check_expired
  $compressed_content = '';
  $remote_content = file_get_contents($this->remote);
  $compressed_content = preg_replace('/\s*?\n\s*/', "\n", $remote_content);
  $compressed_content = preg_replace('/( |\t)( |\t)*/', " ", $compressed_content);
  file_put_contents($this->local, $compressed_content);
  return true;
} else {
  return false;
}

}

quechup avatar Jul 27 '17 18:07 quechup