예제 #1
0
파일: Feed.php 프로젝트: janmarek/Neuron
 /**
  * Write content to file
  * @param string $path
  * @param string $content
  */
 protected function writeFile($path, $content)
 {
     if (!in_array(SafeStream::PROTOCOL, stream_get_wrappers())) {
         SafeStream::register();
     }
     file_put_contents("safe://" . $path, $content);
 }
예제 #2
0
 /**
  * Load content and save file
  * @param array files
  * @return string filename of generated file
  */
 protected function generate($files)
 {
     $name = $this->getGeneratedFilename($files);
     $path = $this->tempPath . "/" . $name;
     $lastModified = $this->getLastModified($files);
     if (!file_exists($path) || $lastModified > filemtime($path)) {
         if (!in_array(SafeStream::PROTOCOL, stream_get_wrappers())) {
             SafeStream::register();
         }
         file_put_contents("safe://" . $path, $this->getContent($files));
     }
     return $name . "?" . $lastModified;
 }