Merge pull request #890 from narfbg/develop-core-hl

Improve core Hooks & Lang libraries
diff --git a/system/core/Hooks.php b/system/core/Hooks.php
index 174adcb..e1ac58e 100755
--- a/system/core/Hooks.php
+++ b/system/core/Hooks.php
@@ -1,13 +1,13 @@
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *
  * An open source application development framework for PHP 5.1.6 or newer
  *
  * NOTICE OF LICENSE
- * 
+ *
  * Licensed under the Open Software License version 3.0
- * 
+ *
  * This source file is subject to the Open Software License (OSL 3.0) that is
  * bundled with this package in the files license.txt / license.rst.  It is
  * also available through the world wide web at this URL:
@@ -45,28 +45,24 @@
 	 *
 	 * @var bool
 	 */
-	var $enabled		= FALSE;
+	public $enabled		= FALSE;
 	/**
 	 * List of all hooks set in config/hooks.php
 	 *
 	 * @var array
 	 */
-	var $hooks			= array();
+	public $hooks			= array();
 	/**
 	 * Determines wether hook is in progress, used to prevent infinte loops
 	 *
 	 * @var bool
 	 */
-	var $in_progress	= FALSE;
+	public $in_progress	= FALSE;
 
-	/**
-	 * Constructor
-	 *
-	 */
-	function __construct()
+	public function __construct()
 	{
 		$this->_initialize();
-		log_message('debug', "Hooks Class Initialized");
+		log_message('debug', 'Hooks Class Initialized');
 	}
 
 	// --------------------------------------------------------------------
@@ -74,24 +70,20 @@
 	/**
 	 * Initialize the Hooks Preferences
 	 *
-	 * @access	private
 	 * @return	void
 	 */
-	function _initialize()
+	private function _initialize()
 	{
 		$CFG =& load_class('Config', 'core');
 
 		// If hooks are not enabled in the config file
 		// there is nothing else to do
-
 		if ($CFG->item('enable_hooks') == FALSE)
 		{
 			return;
 		}
 
 		// Grab the "hooks" definition file.
-		// If there are no hooks, we're done.
-
 		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'))
 		{
 			include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php');
@@ -101,7 +93,7 @@
 			include(APPPATH.'config/hooks.php');
 		}
 
-
+		// If there are no hooks, we're done.
 		if ( ! isset($hook) OR ! is_array($hook))
 		{
 			return;
@@ -116,13 +108,12 @@
 	/**
 	 * Call Hook
 	 *
-	 * Calls a particular hook
+	 * Calls a particular hook. Called by CodeIgniter.php.
 	 *
-	 * @access	private
 	 * @param	string	the hook name
 	 * @return	mixed
 	 */
-	function _call_hook($which = '')
+	public function _call_hook($which = '')
 	{
 		if ( ! $this->enabled OR ! isset($this->hooks[$which]))
 		{
@@ -151,11 +142,10 @@
 	 *
 	 * Runs a particular hook
 	 *
-	 * @access	private
 	 * @param	array	the hook details
 	 * @return	bool
 	 */
-	function _run_hook($data)
+	protected function _run_hook($data)
 	{
 		if ( ! is_array($data))
 		{
@@ -168,7 +158,6 @@
 
 		// If the script being called happens to have the same
 		// hook call within it a loop can happen
-
 		if ($this->in_progress == TRUE)
 		{
 			return;
@@ -254,7 +243,5 @@
 
 }
 
-// END CI_Hooks class
-
 /* End of file Hooks.php */
-/* Location: ./system/core/Hooks.php */
\ No newline at end of file
+/* Location: ./system/core/Hooks.php */
diff --git a/system/core/Lang.php b/system/core/Lang.php
index 5eb2801..088cb6c 100755
--- a/system/core/Lang.php
+++ b/system/core/Lang.php
@@ -1,13 +1,13 @@
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 /**
  * CodeIgniter
  *
  * An open source application development framework for PHP 5.1.6 or newer
  *
  * NOTICE OF LICENSE
- * 
+ *
  * Licensed under the Open Software License version 3.0
- * 
+ *
  * This source file is subject to the Open Software License (OSL 3.0) that is
  * bundled with this package in the files license.txt / license.rst.  It is
  * also available through the world wide web at this URL:
@@ -43,22 +43,17 @@
 	 *
 	 * @var array
 	 */
-	var $language	= array();
+	public $language	= array();
 	/**
 	 * List of loaded language files
 	 *
 	 * @var array
 	 */
-	var $is_loaded	= array();
+	public $is_loaded	= array();
 
-	/**
-	 * Constructor
-	 *
-	 * @access	public
-	 */
-	function __construct()
+	public function __construct()
 	{
-		log_message('debug', "Language Class Initialized");
+		log_message('debug', 'Language Class Initialized');
 	}
 
 	// --------------------------------------------------------------------
@@ -66,7 +61,6 @@
 	/**
 	 * Load a language file
 	 *
-	 * @access	public
 	 * @param	mixed	the name of the language file to be loaded. Can be an array
 	 * @param	string	the language (english, etc.)
 	 * @param	bool	return loaded array of translations
@@ -74,7 +68,7 @@
 	 * @param 	string	alternative path to look for language file
 	 * @return	mixed
 	 */
-	function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
+	public function load($langfile = '', $idiom = '', $return = FALSE, $add_suffix = TRUE, $alt_path = '')
 	{
 		$langfile = str_replace('.php', '', $langfile);
 
@@ -148,11 +142,10 @@
 	/**
 	 * Fetch a single line of text from the language array
 	 *
-	 * @access	public
 	 * @param	string	$line	the language line
 	 * @return	string
 	 */
-	function line($line = '')
+	public function line($line = '')
 	{
 		$value = ($line == '' OR ! isset($this->language[$line])) ? FALSE : $this->language[$line];
 
@@ -166,7 +159,6 @@
 	}
 
 }
-// END Language Class
 
 /* End of file Lang.php */
 /* Location: ./system/core/Lang.php */