2.2.6

Latest release in branch 2
Released 10 years ago (October 31, 2015)

Software CodeIgniter
Branch 2
First official release version 2.0.3
First official release date 14 years ago (August 20, 2011)
Supported
PHP versions
PHP 5.1.6+
Source code https://github.com/bcit-ci/CodeIgniter/tree/2.1.1
Documentation https://codeigniter.com/userguide2/
CodeIgniter 2 Releases View full list

What Is New in CodeIgniter 2

CodeIgniter 2 represents a significant modernization of the framework, focusing on PHP 5+ support and a cleaner codebase. It's a mandatory upgrade for anyone running older versions to maintain compatibility and security.

Category Key Changes
Core Requirements Now requires PHP 5.1.6 or newer. Dropped support for PHP 4.
New Features Added the get_where() method, list_fields(), and application packages.
Improvements Refactored core classes to use CI_ prefix, enhanced security libraries, and better error handling.
Deprecated Items The $autoload['core'] configuration array was deprecated in favor of $autoload['libraries'].
Bug Fixes Numerous fixes across Database, Email, File Uploading, and Form Validation classes.

Why Did CodeIgniter 2 Drop PHP 4 Support?

The single biggest change was ditching PHP 4. This was a strategic move to leverage the object-oriented features and performance improvements in PHP 5. It allowed the core team to refactor the framework's internal code, making it more robust and modern.

In practice, this meant developers could finally write proper classes that extend native CodeIgniter libraries without the old workarounds. The entire ecosystem shifted to embrace more modern PHP development patterns.

What Are the Key New Features in the Database Layer?

The Active Record database class got some seriously useful additions. The new get_where() method combined a where() clause and get() into a single call, simplifying a very common operation.

Another great addition was list_fields(), which fetches the field names for a particular table. This is super handy for dynamic form building or data processing scripts where you need to know the table schema on the fly.

// New in CI 2: get_where()
$query = $this->db->get_where('my_table', array('id' => $id), $limit, $offset);

How Did CodeIgniter 2 Improve Application Structure?

Application Packages were introduced, letting you modularize your code into reusable bundles. A package can have its own models, libraries, views, config files, and more. This was a step towards a more organized application architecture beyond the standard MVC folders.

The autoload mechanism was also cleaned up. The old $autoload['core'] config was deprecated in favor of using $autoload['libraries'] for everything. This reduced confusion and streamlined the boot process.

Were There Any Security Enhancements?

Yes, the Security and Input classes saw important hardening. The XSS filtering was improved, and the core system was made more resilient against various attack vectors.

These weren't always flashy changes, but they mattered. The community had identified potential weak spots, and the 2.x branch addressed them directly, making it a more secure foundation for production applications.

FAQ

Is CodeIgniter 2 a direct upgrade from version 1.7.2?
Mostly, but not entirely. The main breaking change is the requirement for PHP 5.1.6+. If your server and application code are already on PHP 5, the upgrade path is relatively smooth. You'll also need to move any 'core' items in your autoload config to 'libraries'.

What happened to the "core" autoloading configuration?
It was deprecated. You must now load all libraries, including former 'core' classes, using the $autoload['libraries'] array in your config/autoload.php file. This change unified the loading process.

Can I use my existing CodeIgniter 1.7.x modules and extensions?
Many third-party libraries will work, but some might break if they were built for PHP 4 specifically or relied on deprecated internal methods. Always test them thoroughly in a development environment first.

Why is the get_where() method such a big deal?
It encapsulates a very common database pattern into a single, clean method call. It reduces code repetition and potential for error, making everyday database queries quicker to write and easier to read.

Where can I find the full list of changes for each point release?
The official CodeIgniter 2 changelog provides a exhaustive, version-by-version breakdown of every new feature, change, and bug fix. It's the definitive source for all updates. View the changelog.

Releases In Branch 2

Version Release date
2.2.6 10 years ago
(October 31, 2015)
2.2.5 10 years ago
(October 08, 2015)
2.2.4 10 years ago
(August 20, 2015)
2.2.3 10 years ago
(July 13, 2015)
2.2.2 11 years ago
(April 15, 2015)
2.2.1 11 years ago
(January 26, 2015)
2.2.0 11 years ago
(June 06, 2014)
2.1.4 12 years ago
(July 29, 2013)
2.1.3 13 years ago
(October 08, 2012)
2.1.2 13 years ago
(June 29, 2012)
2.1.1 13 years ago
(June 13, 2012)
2.1.0 14 years ago
(November 22, 2011)
2.0.3 14 years ago
(August 20, 2011)