|
@@ -906,6 +906,7 @@ class Pico
|
|
'site_title' => 'Pico',
|
|
'site_title' => 'Pico',
|
|
'base_url' => '',
|
|
'base_url' => '',
|
|
'rewrite_url' => null,
|
|
'rewrite_url' => null,
|
|
|
|
+ 'debug' => null,
|
|
'timezone' => null,
|
|
'timezone' => null,
|
|
'theme' => 'default',
|
|
'theme' => 'default',
|
|
'theme_url' => null,
|
|
'theme_url' => null,
|
|
@@ -928,6 +929,10 @@ class Pico
|
|
$this->config['rewrite_url'] = $this->isUrlRewritingEnabled();
|
|
$this->config['rewrite_url'] = $this->isUrlRewritingEnabled();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if ($this->config['debug'] === null) {
|
|
|
|
+ $this->config['debug'] = $this->isDebugModeEnabled();
|
|
|
|
+ }
|
|
|
|
+
|
|
if (!$this->config['timezone']) {
|
|
if (!$this->config['timezone']) {
|
|
// explicitly set a default timezone to prevent a E_NOTICE when no timezone is set;
|
|
// explicitly set a default timezone to prevent a E_NOTICE when no timezone is set;
|
|
// the `date_default_timezone_get()` function always returns a timezone, at least UTC
|
|
// the `date_default_timezone_get()` function always returns a timezone, at least UTC
|
|
@@ -959,6 +964,9 @@ class Pico
|
|
if ($this->config['twig_config']['cache']) {
|
|
if ($this->config['twig_config']['cache']) {
|
|
$this->config['twig_config']['cache'] = $this->getAbsolutePath($this->config['twig_config']['cache']);
|
|
$this->config['twig_config']['cache'] = $this->getAbsolutePath($this->config['twig_config']['cache']);
|
|
}
|
|
}
|
|
|
|
+ if ($this->config['twig_config']['debug'] === null) {
|
|
|
|
+ $this->config['twig_config']['debug'] = $this->isDebugModeEnabled();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
if (!$this->config['content_dir']) {
|
|
if (!$this->config['content_dir']) {
|
|
@@ -2120,6 +2128,29 @@ class Pico
|
|
return $this->config['rewrite_url'];
|
|
return $this->config['rewrite_url'];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * Returns TRUE if Pico's debug mode is enabled
|
|
|
|
+ *
|
|
|
|
+ * @return bool TRUE if Pico's debug mode is enabled, FALSE otherwise
|
|
|
|
+ */
|
|
|
|
+ public function isDebugModeEnabled()
|
|
|
|
+ {
|
|
|
|
+ $debugModeEnabled = $this->getConfig('debug');
|
|
|
|
+ if ($debugModeEnabled !== null) {
|
|
|
|
+ return $debugModeEnabled;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (isset($_SERVER['PICO_DEBUG'])) {
|
|
|
|
+ $this->config['debug'] = (bool) $_SERVER['PICO_DEBUG'];
|
|
|
|
+ } elseif (isset($_SERVER['REDIRECT_PICO_DEBUG'])) {
|
|
|
|
+ $this->config['debug'] = (bool) $_SERVER['REDIRECT_PICO_DEBUG'];
|
|
|
|
+ } else {
|
|
|
|
+ $this->config['debug'] = false;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $this->config['debug'];
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Returns the URL to a given page
|
|
* Returns the URL to a given page
|
|
*
|
|
*
|