Jelajahi Sumber

Merge pull request #88 from NeoBlack/feature/moveConfigLoading

[BUGFIX] load config and call hook before the other hooks
Gilbert Pellegrom 11 tahun lalu
induk
melakukan
9616d902e0
1 mengubah file dengan 5 tambahan dan 5 penghapusan
  1. 5 5
      lib/pico.php

+ 5 - 5
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));