From 3d91c03979ded51338aad9aac3d73c640734f495 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Na=CC=88gler?= Date: Mon, 14 Oct 2013 20:26:02 +0200 Subject: [PATCH] [BUGFIX] load config and call hook before the other hooks this bugfix is very important, because other hooks like "after_load_content" can not use the config. --- lib/pico.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/pico.php b/lib/pico.php index 259c05a..10c9d5e 100644 --- a/lib/pico.php +++ b/lib/pico.php @@ -22,7 +22,11 @@ class Pico { // Load plugins $this->load_plugins(); $this->run_hooks('plugins_loaded'); - + + // Load the settings + $settings = $this->get_config(); + $this->run_hooks('config_loaded', array(&$settings)); + // Get request url and script url $url = ''; $request_url = (isset($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] : ''; @@ -51,10 +55,6 @@ class Pico { $this->run_hooks('after_404_load_content', array(&$file, &$content)); } $this->run_hooks('after_load_content', array(&$file, &$content)); - - // Load the settings - $settings = $this->get_config(); - $this->run_hooks('config_loaded', array(&$settings)); $meta = $this->read_file_meta($content); $this->run_hooks('file_meta', array(&$meta));