/**
  * @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
 /**
  * Loads the default configuration for the current application.
  *
  * @uses Config::loadFile()
  * @throws \Exception if any extension is not found
  * @return array loaded configuration
  */
 public static function load()
 {
     $tConfigFiles = array(Framework::$corepath . 'config.json');
     if (Framework::$application !== null) {
         Io::glob(Framework::$application->path . 'config/', '*.json', Io::GLOB_RECURSIVE | Io::GLOB_FILES, "", $tConfigFiles);
     }
     $tLastModified = Io::getLastModified($tConfigFiles);
     $tOutputFile = Io::translatePath('{writable}cache/config');
     if (!Framework::$disableCaches && Io::isReadableAndNewer($tOutputFile, $tLastModified)) {
         self::$loadedFromCache = true;
         return Io::readSerialize($tOutputFile);
     }
     $tConfig = array();
     foreach ($tConfigFiles as $tFile) {
         self::loadFile($tConfig, $tFile, true);
     }
     if (isset($tConfig['extensionList'])) {
         foreach ($tConfig['extensionList'] as $tExtension) {
             $tFile = Framework::$corepath . 'src/Scabbia/Extensions/' . $tExtension . '/config.json';
             if (file_exists($tFile)) {
                 self::loadFile($tConfig, $tFile, false);
                 continue;
             }
             if (Framework::$application !== null) {
                 $tFile = Framework::$application->path . 'Extensions/' . $tExtension . '/config.json';
                 if (file_exists($tFile)) {
                     self::loadFile($tConfig, $tFile, false);
                     continue;
                 }
             }
             throw new \Exception('extension not found - ' . $tExtension);
         }
     }
     self::$loadedFromCache = false;
     if (!Framework::$readonly) {
         Io::writeSerialize($tOutputFile, $tConfig);
     }
     return $tConfig;
 }
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);
 }