|
@@ -266,7 +266,8 @@ class Pico
|
|
* meta headers, processes Markdown, does Twig processing and returns
|
|
* meta headers, processes Markdown, does Twig processing and returns
|
|
* the rendered contents.
|
|
* the rendered contents.
|
|
*
|
|
*
|
|
- * @return string rendered Pico contents
|
|
|
|
|
|
+ * @return string rendered Pico contents
|
|
|
|
+ * @throws RuntimeException thrown when a not recoverable error occurs
|
|
*/
|
|
*/
|
|
public function run()
|
|
public function run()
|
|
{
|
|
{
|
|
@@ -281,6 +282,11 @@ class Pico
|
|
$this->loadConfig();
|
|
$this->loadConfig();
|
|
$this->triggerEvent('onConfigLoaded', array(&$this->config));
|
|
$this->triggerEvent('onConfigLoaded', array(&$this->config));
|
|
|
|
|
|
|
|
+ // check content dir
|
|
|
|
+ if (!is_dir($this->getConfig('content_dir'))) {
|
|
|
|
+ throw new RuntimeException('Invalid content directory "' . $this->getConfig('content_dir') . '"');
|
|
|
|
+ }
|
|
|
|
+
|
|
// evaluate request url
|
|
// evaluate request url
|
|
$this->evaluateRequestUrl();
|
|
$this->evaluateRequestUrl();
|
|
$this->triggerEvent('onRequestUrl', array(&$this->requestUrl));
|
|
$this->triggerEvent('onRequestUrl', array(&$this->requestUrl));
|