コード例 #1
0
ファイル: class.robotstxt.php プロジェクト: hungnv0789/vhtm
	/**
	 * Load the file content, or default content if file is not found.
	 *
	 * @return string The file content.
	*/
	public function getContent()
	{
		include_once(ISC_BASE_PATH.'/lib/class.file.php');
		$fc = new FileClass();
		$filePath = $this->filePath;
		$content = $fc->readFromFile($filePath);
		if ($content === false) {
			// Init new file with default content.
			$content = $this->defaultContent;
			$res = $fc->writeToFile($content, $filePath);
		}

		return $content;
	}