CI 2.x removed all compatibility with PHP4, and also updated a number of standards that will comply with PHP 5.3 in the future. One of them is the constructor problem you encountered. Starting with PHP 5.3, the ClassName() function is no longer a constructor for a class, it is just another function. You must explicitly declare the __construct function to perform any tasks that you must complete when creating a new instance of the class. Given this, you should see that it no longer makes sense to call parent::ClassName() in your child constructor, since this function will no longer be the parent constructor.
Another error that I recently encountered is how the $_GET array is now processed. In versions 1.x, you can use query strings to convey additional information and still use URI segments to route to controllers and functions. This is especially useful for AJAX calls, where you cannot always find out all the parameters sent to and from the server in a specific request. In versions 2.x, the config.php file contains the new option $config['allow_get_array'] . This value must be set to TRUE if you want to use query strings, otherwise the input class will clear the $_GET array as part of the CI initialization procedure for each request.
Something that is not an error, but may prove useful, is the new parameters in config / autoload.php, which allow you to add new application directories to the project. If you work with several different projects with CI and want to keep any useful libraries that you write in one place, now you can add this location to $autoload['packages'] . CI expects that any path in this array will contain the subdirectories "controllers", "models", "libraries" and "helpers". He will not complain if you do not have these directories, but at least you will need them for everything that you are going to load, that is, libraries will live in / library, as in the main folder of the application.
source share