Exemplo n.º 1
0
 /**
  * Saves a file into writable folder
  *
  * @param string $uFilename   filename
  * @param mixed  $uContent    file content to be written
  * @param bool   $uSaveAsPHP  saves file contents as php file if it is true
  *
  * @return void
  */
 public function saveFile($uFilename, $uContent, $uSaveAsPHP = false)
 {
     if ($uSaveAsPHP) {
         FileSystem::writePhpFile(Core::$instance->translateVariables($this->applicationWritablePath . "/{$uFilename}"), $uContent);
         return;
     }
     FileSystem::write(Core::$instance->translateVariables($this->applicationWritablePath . "/{$uFilename}"), $uContent);
 }
Exemplo n.º 2
0
 /**
  * Loads saved annotations or start over scanning
  *
  * @return void
  */
 public function load()
 {
     $tAnnotationMapPath = $this->applicationWritablePath . "/annotations.php";
     // TODO and not in development mode
     if (file_exists($tAnnotationMapPath)) {
         $this->annotationMap = (require $tAnnotationMapPath);
     } else {
         $this->scan();
         // TODO if not in readonly mode
         FileSystem::writePhpFile($tAnnotationMapPath, $this->annotationMap);
     }
 }