示例#1
0
文件: Block.php 项目: rbnvrw/crispus
 public function render()
 {
     if (!empty($this->sPath)) {
         $oFilesystem = new Filesystem();
         $sFileContents = $oFilesystem->getFileContents($this->sPath);
         return $this->processMarkdown($sFileContents);
     }
     return null;
 }
示例#2
0
文件: Config.php 项目: rbnvrw/crispus
 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);
     }
 }
示例#3
0
文件: File.php 项目: sephiroth88/Elgg
 /**
  * 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);
 }