summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Aker <greg.aker@ellislab.com>2010-11-09 20:46:13 +0100
committerGreg Aker <greg.aker@ellislab.com>2010-11-09 20:46:13 +0100
commit63277b81edde11b77ff94cbf1c3e5db16c97c4bf (patch)
treee03d08dcba5de6a97576bbdd6565891dc1d98256
parent6b6c274e00fe2357004c0a4e38e6bdb0b2e0ddb4 (diff)
Fix #62 Adding CI_ prefix to Controller.
-rw-r--r--application/controllers/welcome.php4
-rw-r--r--system/core/CodeIgniter.php2
-rw-r--r--system/core/Controller.php6
-rw-r--r--user_guide/changelog.html1
-rw-r--r--user_guide/general/controllers.html20
5 files changed, 17 insertions, 16 deletions
diff --git a/application/controllers/welcome.php b/application/controllers/welcome.php
index 2e4cff8ed..3c2f7e1cf 100644
--- a/application/controllers/welcome.php
+++ b/application/controllers/welcome.php
@@ -1,10 +1,10 @@
<?php
-class Welcome extends Controller {
+class Welcome extends CI_Controller {
function Welcome()
{
- parent::Controller();
+ parent::CI_Controller();
}
function index()
diff --git a/system/core/CodeIgniter.php b/system/core/CodeIgniter.php
index e701cc323..3dfefc2ef 100644
--- a/system/core/CodeIgniter.php
+++ b/system/core/CodeIgniter.php
@@ -261,7 +261,7 @@
if ( ! class_exists($class)
OR $method == 'controller'
OR strncmp($method, '_', 1) == 0
- OR in_array(strtolower($method), array_map('strtolower', get_class_methods('Controller')))
+ OR in_array(strtolower($method), array_map('strtolower', get_class_methods('CI_Controller')))
)
{
show_404("{$class}/{$method}");
diff --git a/system/core/Controller.php b/system/core/Controller.php
index 9bd9912dc..e250caf4b 100644
--- a/system/core/Controller.php
+++ b/system/core/Controller.php
@@ -27,17 +27,17 @@
* @author ExpressionEngine Dev Team
* @link http://codeigniter.com/user_guide/general/controllers.html
*/
-class Controller extends CI_Base {
+class CI_Controller extends CI_Base {
/**
* Constructor
*
* Calls the initialize() function
*/
- function Controller()
+ function CI_Controller()
{
parent::CI_Base();
-
+
// Assign all the class objects that were instantiated by the
// bootstrap file (CodeIgniter.php) to local class variables
// so that CI can run as one big super object.
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index 5bfbee702..67fcb7e25 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -75,6 +75,7 @@ Hg Tag: </p>
<li>Added ability to set "Package" paths - specific paths where the Loader and Config classes should try to look first for a requested file. This allows distribution of sub-applications with their own libraries, models, config files, etc. in a single "package" directory. See the <a href="libraries/loader.html">Loader class</a> documentation for more details.</li>
<li>In-development code is now hosted at <a href="http://bitbucket.org/ellislab/codeigniter/">BitBucket</a>.</li>
<li>Removed the deprecated Validation Class.</li>
+ <li>Added CI_ Prefix to all core classes.</li>
</ul>
<li>Libraries
<ul>
diff --git a/user_guide/general/controllers.html b/user_guide/general/controllers.html
index 782fbfa7e..9da1da248 100644
--- a/user_guide/general/controllers.html
+++ b/user_guide/general/controllers.html
@@ -96,7 +96,7 @@ Controllers
<textarea class="textarea" style="width:100%" cols="50" rows="10">
&lt;?php
-class Blog extends Controller {
+class Blog extends CI_Controller {
function index()
{
@@ -119,7 +119,7 @@ class Blog extends Controller {
<p>Note: Class names must start with an uppercase letter. In other words, this is valid:</p>
<code>&lt;?php<br />
-class <var>Blog</var> extends Controller {<br />
+class <var>Blog</var> extends CI_Controller {<br />
<br />
}<br />
?&gt;</code>
@@ -127,7 +127,7 @@ class <var>Blog</var> extends Controller {<br />
<p>This is <strong>not</strong> valid:</p>
<code>&lt;?php<br />
-class <var>blog</var> extends Controller {<br />
+class <var>blog</var> extends CI_Controller {<br />
<br />
}<br />
?&gt;</code>
@@ -151,7 +151,7 @@ class <var>blog</var> extends Controller {<br />
<textarea class="textarea" style="width:100%" cols="50" rows="15">
&lt;?php
-class Blog extends Controller {
+class Blog extends CI_Controller {
function index()
{
@@ -185,7 +185,7 @@ class Blog extends Controller {
<code>
&lt;?php<br />
-class Products extends Controller {<br />
+class Products extends CI_Controller {<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;function shoes($sandals, $id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;{<br />
@@ -329,7 +329,7 @@ called if the URL contains only the sub-folder. Simply name your default contro
<p>If you intend to use a constructor in any of your Controllers, you <strong>MUST</strong> place the following line of code in it:</p>
-<code>parent::Controller();</code>
+<code>parent::CI_Controller();</code>
<p>The reason this line is necessary is because your local constructor will be overriding the one in the parent controller class so we need to manually call it.</p>
@@ -338,11 +338,11 @@ called if the URL contains only the sub-folder. Simply name your default contro
<code>
&lt;?php<br />
-class <kbd>Blog</kbd> extends Controller {<br />
+class <kbd>Blog</kbd> extends CI_Controller {<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>Blog()</kbd><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::Controller();</var><br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::CI_Controller();</var><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
?&gt;</code>
@@ -351,11 +351,11 @@ class <kbd>Blog</kbd> extends Controller {<br />
<code>
&lt;?php<br />
-class <kbd>Blog</kbd> extends Controller {<br />
+class <kbd>Blog</kbd> extends CI_Controller {<br />
<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;function <kbd>__construct()</kbd><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::Controller();</var><br />
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<var>parent::CI_Controller();</var><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
?&gt;</code>