Welcome Guest, Not a member yet? Register   Sign In
Upgrade to 2.0.2 from 1.7.2
#1

[eluser]mabright[/eluser]
Sorry if I missed a link or post with detailed information for upgrading from 1.7.2 to 2.0.2.

I do not have a system or core folder in my 1.7.2 setup, can't remember if I renamed some folders, it's been awhile since I have done any coding.

How do I properly upgrade from 1.7.2?


I actually just need to know where the files in the core folder should go.
#2

[eluser]wh1tel1te[/eluser]
Any CI library extensions, e.g. MY_Controller.php MY_Loader.php, which were originally in "libraries", you must move to the "core" folder in 2.0.
#3

[eluser]InsiteFX[/eluser]
All Controllers now extend CI_Controller
All Models now extend CI_Model

If the library you are extending is in system/core then your library goes into application/core
If the library you are extending is in system/libraries then your library goes into application/libraries

If you use a MY_Controller it may not work! So you need to add this...
application/config/config.php - to the bottom of the config file.
Code:
/*
| -------------------------------------------------------------------
|  Native Autoload - by Phil Sturgeon.
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
| If using HMVC you do not need this! HMVC will autoload.
|
| Place this code at the bottom of your application/config/config.php file.
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        @include_once(APPPATH . 'core/' . $class . EXT);
    }
}

InsiteFX
#4

[eluser]mabright[/eluser]
I made all the updates (thanks for the replies) but now all my pages which previously worked all error with "Fatal error: Call to undefined method CI_DB_mysql_driver::where() in ....../libraries/Session.php on line 201"


I am also now getting error "Fatal error: Call to undefined method CI_Controller::Controller() in ". I use a MY_Controller but I already moved it to the core folder as suggested.
#5

[eluser]wbremen[/eluser]
Quote:I am also now getting error "Fatal error: Call to undefined method CI_Controller::Controller() in ". I use a MY_Controller but I already moved it to the core folder as suggested.


I am experiencing the same problem which is caused by the following lines:
$CI =& get_instance(); in my extended core class (MY_Lang)
#6

[eluser]mabright[/eluser]
see my post in the main forum.
http://ellislab.com/forums/viewthread/186282/
#7

[eluser]InsiteFX[/eluser]
Make sure you use the above autoload code!

application/core/MY_Controller.php
Code:
class MY_Controller extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
    }
}

InsiteFX
#8

[eluser]wbremen[/eluser]
I tried the autoload and also the things described in the other thread but I still get this error, it is slightly diffrent to the one here. (I tried 2.0.2, 2.0.1 and 2.0.0 and the error applies to all those versions). I am confused.

Now here the thing (completly new/clean Codeigniter 2.0.0)

This works (application/core/MY_Lang.php):
Code:
class MY_Lang extends CI_Lang {

    function __construct()
    {
        parent::__construct();

    }

This does not (application/core/MY_Lang.php):
Code:
class MY_Lang extends CI_Lang {

    function __construct()
    {
        parent::__construct();

        $CI =& get_instance();

    }

I get this error for line 210 in CodeIgniter.php
Quote:Fatal error: Class 'CI_Controller' not found in system\core\CodeIgniter.php on line 210

... which refers to the following lines:
Code:
require BASEPATH.'core/Controller'.EXT;

    function &get;_instance()
    {
        return CI_Controller::get_instance(); // this is line 210
    }

Not my script fails to load the CI_Controller but the CodeIgniter.php Core File...
#9

[eluser]InsiteFX[/eluser]
Did you copy over the new index.php file?

InsiteFX
#10

[eluser]wbremen[/eluser]
sure.




Theme © iAndrew 2016 - Forum software by © MyBB