models/Pages.php
protected static function _parse($file) {
		$header = '';
		$content = '';

		if (!$stream = fopen($file, 'r')) {
			throw new Exception('Failed to open file.');
		}

		$isHeader = false;

		while (!feof($stream)) {
			$line = rtrim(fgets($stream));

			if ($line === '---') {
				$isHeader = !$isHeader;
				continue;
			}
			if ($isHeader) {
				$header .= $line . "\n";
			} else {
				$content .= $line . "\n";
			}
		}
		if ($header) {
			$info = Yaml::parse($header);
		} else {
			$info = [];
		}

		fclose($stream);
		return [$info, $content];
	}
protected static function _parse($file) {
		$header = '';
		$content = '';

		if (!$stream = fopen($file, 'r')) {
			throw new Exception('Failed to open file.');
		}

		$isHeader = false;

		while (!feof($stream)) {
			$line = rtrim(fgets($stream));

			if ($line === '---') {
				$isHeader = !$isHeader;
				continue;
			}
			if ($isHeader) {
				$header .= $line . "\n";
			} else {
				$content .= $line . "\n";
			}
		}
		if ($header) {
			$info = Yaml::parse($header);
		} else {
			$info = [];
		}

		fclose($stream);
		return [$info, $content];
	}
protected static function _parse ( $ file ) { $ header = '' ; $ content = '' ; if ( ! $ stream = fopen ( $ file , 'r' ) ) { throw new Exception ( 'Failed to open file.' ) ; } $ isHeader = false ; while ( ! feof ( $ stream ) ) { $ line = rtrim ( fgets ( $ stream ) ) ; if ( $ line === '---' ) { $ isHeader = ! $ isHeader ; continue ; } if ( $ isHeader ) { $ header .= $ line . "\n" ; } else { $ content .= $ line . "\n" ; } } if ( $ header ) { $ info = Yaml :: parse ( $ header ) ; } else { $ info = [ ] ; } fclose ( $ stream ) ; return [ $ info , $ content ] ; }
Does not parse file body.
Does not parse file body .