diff options
author | admin <devnull@localhost> | 2006-09-02 19:34:52 +0200 |
---|---|---|
committer | admin <devnull@localhost> | 2006-09-02 19:34:52 +0200 |
commit | 2ed76d5ac89ec7869dcb64c050360fb2f99e9326 (patch) | |
tree | d9a8a11e7b94bb51088aaa06e128f99a1c5adc60 | |
parent | 51cf423e1e41f573f87176d28affa50efda46c45 (diff) |
-rw-r--r-- | system/application/config/config.php | 2 | ||||
-rw-r--r-- | system/drivers/DB_driver.php | 3 | ||||
-rw-r--r-- | system/drivers/DB_postgre.php | 10 | ||||
-rw-r--r-- | system/helpers/file_helper.php | 4 | ||||
-rw-r--r-- | system/helpers/url_helper.php | 2 | ||||
-rw-r--r-- | system/libraries/Output.php | 2 | ||||
-rw-r--r-- | user_guide/general/changelog.html | 2 | ||||
-rw-r--r-- | user_guide/general/hooks.html | 6 | ||||
-rw-r--r-- | user_guide/installation/upgrade_140.html | 15 |
9 files changed, 35 insertions, 11 deletions
diff --git a/system/application/config/config.php b/system/application/config/config.php index c19fabf44..7b19b83b5 100644 --- a/system/application/config/config.php +++ b/system/application/config/config.php @@ -78,7 +78,7 @@ $config['language'] = "english"; | setting this variable to TRUE (boolean). See the user guide for details. | */ -$config['enable_hooks'] = TRUE; +$config['enable_hooks'] = FALSE; /* diff --git a/system/drivers/DB_driver.php b/system/drivers/DB_driver.php index 3a2a5e9bc..0c2084ad8 100644 --- a/system/drivers/DB_driver.php +++ b/system/drivers/DB_driver.php @@ -36,6 +36,7 @@ class CI_DB_driver { var $database; var $dbdriver = 'mysql'; var $dbprefix = ''; + var $port = ''; var $pconnect = FALSE; var $conn_id = FALSE; var $result_id = FALSE; @@ -75,7 +76,7 @@ class CI_DB_driver { { 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]; } diff --git a/system/drivers/DB_postgre.php b/system/drivers/DB_postgre.php index fd98ec78b..673dea335 100644 --- a/system/drivers/DB_postgre.php +++ b/system/drivers/DB_postgre.php @@ -38,9 +38,11 @@ class CI_DB_postgre extends CI_DB { */ 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); } - + // -------------------------------------------------------------------- /** @@ -51,7 +53,9 @@ class CI_DB_postgre extends CI_DB { */ 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); } // -------------------------------------------------------------------- diff --git a/system/helpers/file_helper.php b/system/helpers/file_helper.php index 93bddb029..32c0b2cdc 100644 --- a/system/helpers/file_helper.php +++ b/system/helpers/file_helper.php @@ -75,9 +75,9 @@ function read_file($file) * @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; } diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php index 03d6c3b2c..09169e32e 100644 --- a/system/helpers/url_helper.php +++ b/system/helpers/url_helper.php @@ -56,7 +56,7 @@ function site_url($uri = '') function base_url() { $obj =& get_instance(); - return $obj->config->item('base_url', 1); + return $obj->config->slash_item('base_url'); } // ------------------------------------------------------------------------ diff --git a/system/libraries/Output.php b/system/libraries/Output.php index f5db3e0d0..73f03863e 100644 --- a/system/libraries/Output.php +++ b/system/libraries/Output.php @@ -147,7 +147,7 @@ class CI_Output { return; } - $uri = $obj->config->item('base_url', 1). + $uri = $obj->config->slash_item('base_url'). $obj->config->item('index_page'). $obj->uri->uri_string(); diff --git a/user_guide/general/changelog.html b/user_guide/general/changelog.html index 188d8566a..e556684e8 100644 --- a/user_guide/general/changelog.html +++ b/user_guide/general/changelog.html @@ -75,7 +75,7 @@ Change Log <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>
diff --git a/user_guide/general/hooks.html b/user_guide/general/hooks.html index 33d343d82..a780a5cdd 100644 --- a/user_guide/general/hooks.html +++ b/user_guide/general/hooks.html @@ -69,6 +69,12 @@ For example, you might want to run a script right before your controllers get lo 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>
diff --git a/user_guide/installation/upgrade_140.html b/user_guide/installation/upgrade_140.html index 810d10786..1c72b5d70 100644 --- a/user_guide/installation/upgrade_140.html +++ b/user_guide/installation/upgrade_140.html @@ -89,9 +89,22 @@ have not upgraded to that version please do so first.</p> <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
|