Commits

Anonymous committed e5a0130

Comments (0)

Files changed (9)

system/application/config/config.php

 | setting this variable to TRUE (boolean).  See the user guide for details.
 |
 */
-$config['enable_hooks'] = TRUE;
+$config['enable_hooks'] = FALSE;
 
 
 /*

system/drivers/DB_driver.php

 	var $database;
 	var $dbdriver		= 'mysql';
 	var $dbprefix		= '';
+	var $port			= '';
 	var $pconnect		= FALSE;
 	var $conn_id		= FALSE;
 	var $result_id		= FALSE;
 	{	
 		if (is_array($params))
 		{
-			foreach (array('hostname' => '', 'username' => '', 'password' => '', 'database' => '', 'dbdriver' => 'mysql', 'dbprefix' => '', 'pconnect' => FALSE, 'db_debug' => FALSE) as $key => $val)
+			foreach (array('hostname' => '', 'username' => '', 'password' => '', 'database' => '', 'dbdriver' => 'mysql', 'dbprefix' => '', 'port' => '', 'pconnect' => FALSE, 'db_debug' => FALSE) as $key => $val)
 			{
 				$this->$key = ( ! isset($params[$key])) ? $val : $params[$key];
 			}

system/drivers/DB_postgre.php

 	 */	
 	function db_connect()
 	{
-		return pg_connect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password);
+		$port = ($this->port == '') ? '' : " port=".$this->port;
+		
+		return pg_connect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
 	}
-	
+
 	// --------------------------------------------------------------------
 
 	/**
 	 */	
 	function db_pconnect()
 	{
-		return pg_pconnect("host=".$this->hostname." dbname=".$this->database." user=".$this->username." password=".$this->password);
+		$port = ($this->port == '') ? '' : " port=".$this->port;
+
+		return pg_pconnect("host=".$this->hostname.$port." dbname=".$this->database." user=".$this->username." password=".$this->password);
 	}
 	
 	// --------------------------------------------------------------------

system/helpers/file_helper.php

  * @param	string	file data
  * @return	bool
  */	
-function write_file($path, $data)
+function write_file($path, $data, $mode = 'wb')
 {
-	if ( ! $fp = @fopen($path, 'wb'))
+	if ( ! $fp = @fopen($path, $mode))
 	{
 		return FALSE;
 	}

system/helpers/url_helper.php

 function base_url()
 { 
 	$obj =& get_instance();
-	return $obj->config->item('base_url', 1);
+	return $obj->config->slash_item('base_url');
 }
 	
 // ------------------------------------------------------------------------

system/libraries/Output.php

 			return;
 		}
 		
-		$uri =	$obj->config->item('base_url', 1).
+		$uri =	$obj->config->slash_item('base_url').
 				$obj->config->item('index_page').
 				$obj->uri->uri_string();
 		

user_guide/general/changelog.html

 <li>Added support for % character in URL.</li>
 <li>Added the ability to supply full URLs using the <a href="../helpers/url_helper.html">anchor()</a> helper function.</li>
 <li>Added mode parameter to <a href="../helpers/file_helper.html">file_write()</a> helper.</li>
-<li>Added support for changing the port number in the <a href="../libraries/database/configuration.html">Postgre driver.</li>
+<li>Added support for changing the port number in the <a href="../libraries/database/configuration.html">Postgre driver</a>.</li>
 <li>Moved the list of "allowed URI characters" out of the Router class and into the config file.</li>
 <li>Moved the MIME type array out of the Upload class and into its own file in the applications/config/ folder.</li>
 <li>Updated the <a href="../libraries/config.html">Config Library</a> to be able to load config files silently, and to be able to assign config files to their own index (to avoid collisions if you use multiple config files).</li>

user_guide/general/hooks.html

 your own scripts in some other location.
 </p>
 
+<h2>Enabling Hooks</h2>
+
+<p>The hooks feature can be globally enabled/disabled by setting the following item in the <kbd>application/config/config.php</kbd> file:</p>
+
+<code>$config['enable_hooks'] = TRUE;</code>
+
 
 <h2>Defining a Hook</h2>
 

user_guide/installation/upgrade_140.html

 
 <h2>Step 2: Update your config.php file</h2>
 
-<p>Open your <dfn>application/config/config.php</dfn> file and add this new item:</p>
+<p>Open your <dfn>application/config/config.php</dfn> file and add these new items:</p>
 
 <pre>
+
+/*
+|--------------------------------------------------------------------------
+| Enable/Disable System Hooks
+|--------------------------------------------------------------------------
+|
+| If you would like to use the "hooks" feature you must enable it by
+| setting this variable to TRUE (boolean).  See the user guide for details.
+|
+*/
+$config['enable_hooks'] = FALSE;
+
+
 /*
 |--------------------------------------------------------------------------
 | Allowed URL Characters