Changeset 1084 for trunk/system/core/Kohana.php
- Timestamp:
- 11/11/2007 12:59:10 AM (13 months ago)
- Files:
-
- 1 modified
-
trunk/system/core/Kohana.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Kohana.php
r1047 r1084 118 118 setlocale(LC_ALL, Config::item('locale.language').'.UTF-8'); 119 119 120 // Enable Kohana routing 121 Event::add('system.routing', array('Router', 'find_uri')); 122 Event::add('system.routing', array('Router', 'setup')); 123 124 // Enable Kohana controller initialization 125 Event::add('system.execute', array('Kohana', 'instance')); 126 127 // Enable Kohana output handling 128 Event::add('system.shutdown', array('Kohana', 'display')); 129 120 130 if ($hooks = Config::item('hooks.enable')) 121 131 { 122 // All hooks are enabled, we must build an array of filenames123 132 if ( ! is_array($hooks)) 124 133 { 125 $hooks = array(); 126 foreach(Config::include_paths() as $path) 127 { 128 // Find all the hooks in each path 129 if ($files = glob($path.'hooks/*'.EXT)) 130 { 131 $hooks = array_merge($hooks, $files); 132 } 133 } 134 // All hooks are enabled, find them 135 $hooks = Kohana::list_files('hooks'); 134 136 } 135 137 … … 143 145 } 144 146 } 145 146 // Enable Kohana routing147 Event::add('system.routing', array('Router', 'setup'));148 149 // Enable Kohana controller initialization150 Event::add('system.execute', array('Kohana', 'instance'));151 152 // Enable Kohana output handling153 Event::add('system.shutdown', array('Kohana', 'display'));154 147 155 148 if (Config::item('log.threshold') > 0) … … 491 484 } 492 485 493 require self::find_file($type, $file, TRUE);486 require_once self::find_file($type, $file, TRUE); 494 487 495 488 if ($type == 'libraries') … … 499 492 require $extension; 500 493 } 501 else 494 elseif (substr($class, -5) !== '_Core') 502 495 { 503 496 eval('class '.$class.' extends '.$class.'_Core { }'); … … 686 679 { 687 680 // No array to search 688 if ( empty($keys) OR empty($array))681 if ((empty($keys) AND is_array($keys)) OR (empty($array) AND is_array($array))) 689 682 return; 690 683
