public function render() { if (!empty($this->sPath)) { $oFilesystem = new Filesystem(); $sFileContents = $oFilesystem->getFileContents($this->sPath); return $this->processMarkdown($sFileContents); } return null; }
public function __construct($sConfigFile = 'config.json') { $oFilesystem = new Filesystem(); $sContents = $oFilesystem->getFileContents($sConfigFile); if (!empty($sContents)) { $this->_aConfig = json_decode($sContents, true); if (empty($this->_aConfig)) { throw new BadConfigException(sprintf($this->sError, $sConfigFile, $this->getJSONError(json_last_error()))); } } else { throw new BadConfigException("Config file is empty: " . $sConfigFile); } }
/** * Get the text content of this file. Empty string if it doesn't exist. * * @return string */ public function getContents() { return $this->filesystem->getFileContents($this->path); }