/**
  * @ignore
  */
 public static function renderview($uObject)
 {
     $tInputFile = $uObject['templatePath'] . $uObject['templateFile'];
     $tOutputFile = Io::translatePath('{writable}cache/md/' . $uObject['compiledFile']);
     if (Framework::$disableCaches || !Io::isReadableAndNewer($tOutputFile, filemtime($tInputFile))) {
         if (self::$engine === null) {
             self::$engine = new MarkdownExtra();
         }
         $tInput = Io::read($tInputFile);
         $tOutput = self::$engine->transform($tInput);
         Io::writeSerialize($tOutputFile, $tOutput);
         echo $tOutput;
     } else {
         echo Io::readSerialize($tOutputFile);
     }
 }
Example #2
0
 /**
  * Outputs all parts in single output.
  *
  * @returns string Output
  */
 public function output()
 {
     $tOutputFile = Io::translatePath('{writable}cache/assets/' . $this->outputName);
     foreach ($this->classes as $tClassName) {
         $tOutputFile .= '_' . $tClassName;
     }
     $tOutputFile .= '.' . $this->outputType;
     if (!Framework::$disableCaches && Io::isReadable($tOutputFile, $this->cacheTtl)) {
         return Io::read($tOutputFile);
     }
     $tContent = "";
     foreach ($this->parts as $tPart) {
         if ($tPart['class'] !== null && !in_array($tPart['class'], $this->classes, true)) {
             continue;
         }
         if ($tPart['bindtype'] === 'function') {
             $tValue = call_user_func($tPart['value'], $tPart);
             $tDescription = 'function ' . $tPart['value'];
         } elseif ($tPart['bindtype'] === 'string') {
             $tValue = $tPart['value'];
             $tDescription = 'string';
         } else {
             $tValue = Io::read(Io::translatePath($tPart['value']));
             $tDescription = 'file ' . $tPart['value'];
         }
         if (array_key_exists($tPart['parttype'], self::$fileProcessors)) {
             $tContent .= call_user_func(self::$fileProcessors[$tPart['parttype']], $tValue, $tDescription);
         } else {
             $tContent .= $tValue;
         }
     }
     if (array_key_exists($this->outputType, self::$packProcessors)) {
         $tContent = call_user_func(self::$packProcessors[$this->outputType], $tContent);
     }
     if (!Framework::$readonly) {
         Io::write($tOutputFile, $tContent);
     }
     return $tContent;
 }
Example #3
0
 /**
  * @ignore
  */
 public function storageGet($uKey, $uDirect = false)
 {
     // path
     $tPath = Io::translatePath($this->path . $uKey, true);
     if (!Io::isReadable($tPath)) {
         return false;
     }
     if ($uDirect) {
         return Io::read($tPath);
     }
     return Io::readSerialize($tPath, $this->keyphase);
 }
Example #4
0
 /**
  * Returns a configuration which is a compilation of a configuration file.
  *
  * @param array  $uConfig    the array which will contain read data
  * @param string $uFile      path of configuration file
  * @param bool   $uOverwrite overwrite existing values
  *
  * @return array the configuration
  */
 public static function loadFile(&$uConfig, $uFile, $uOverwrite = true)
 {
     $tJsonObject = json_decode(Io::read($uFile));
     $tNodeStack = array();
     self::jsonProcessChildrenRecursive($uConfig, $tJsonObject, $uOverwrite, $tNodeStack);
 }
Example #5
0
 /**
  * @ignore
  */
 public function load($uFilename)
 {
     $this->content = Io::read($uFilename);
 }