/** * @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); } }
/** * 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; }
/** * @ignore */ public function storageReplace($uKey, $uObject, $uDirect = false) { // path $tPath = Io::translatePath($this->path . $uKey, true); if ($uDirect) { Io::write($tPath, $uObject); return; } Io::writeSerialize($tPath, $uObject, $this->keyphase); }