user_guide_src/source/installation/upgrade_200.rst
############################# Upgrading from 1.7.2 to 2.0.0 #############################
Before performing an update you should take your site offline by replacing the index.php file with a static one.
Update Instructions
Replace all files and directories in your "system" folder except your application folder.
.. note:: If you have any custom developed files in these folders please make copies of them first.
Version 2.0.0 brings a non-backwards compatible change to
get_dir_file_info() in the :doc:File Helper <../helpers/file_helper>. Non-backwards compatible changes
are extremely rare in CodeIgniter, but this one we feel was warranted
due to how easy it was to create serious server performance issues. If
you need recursiveness where you are using this helper function,
change such instances, setting the second parameter, $top_level_only
to FALSE::
get_dir_file_info('/path/to/directory', FALSE);
2.0.0 gets rid of the "Plugin" system as their functionality was identical to Helpers, but non-extensible. You will need to rename your plugin files from filename_pi.php to filename_helper.php, move them to your helpers folder, and change all instances of::
$this->load->plugin('foo');
to ::
$this->load->helper('foo');
.. note:: If your application does not use the Encrypt library, does not store Encrypted data permanently, or is on an environment that does not support Mcrypt, you may skip this step.
The Encrypt library has had a number of improvements, some for encryption strength and some for performance, that has an unavoidable consequence of making it no longer possible to decode encrypted data produced by the original version of this library. To help with the transition, a new method has been added, encode_from_legacy() that will decode the data with the original algorithm and return a re-encoded string using the improved methods. This will enable you to easily replace stale encrypted data with fresh in your applications, either on the fly or en masse.
Please read how to use this in the Encrypt library documentation.
The compatibility helper has been removed from the CodeIgniter core. All methods in it should be natively available in supported PHP versions.
All core classes are now prefixed with CI_. Update Models and Controllers to extend CI_Model and CI_Controller, respectively.
All native CodeIgniter classes now use the PHP 5 __construct() convention. Please update extended libraries to call parent::__construct().
Any extensions to core classes (e.g. MY_Controller.php) in your application/libraries folder must be moved to the new application/core folder.
Please replace your local copy of the user guide with the new version, including the image files.
Update Notes
Please refer to the :ref:2.0.0 Change Log <2.0.0-changelog> for full
details, but here are some of the larger changes that are more likely to
impact your code:
helper </helpers/captcha_helper>.Form Validation library </libraries/form_validation>Security Class </libraries/security>.Session Class </libraries/sessions> requires now the use of an
encryption key set in the config file.orwhere, orlike, groupby, orhaving, orderby,
getwhere._drop_database() and _create_database() functions have been removed
from the db utility drivers.dohash() function of the :doc:Security helper </helpers/security_helper>
has been renamed to do_hash() for naming consistency.The following files have been changed:
The following files have been added: