CodeIgniter 2.x Support in cms_system

This document is intended to help you configure your cms_system application to use CodeIgniter 2.x (CI2).
Since CI2 is scheduled to reach end of life in October, 2015, this functionality is intended as a vehicle for upgrading an existing application to support CodeIgniter 3.x (CI3).
While there is every reason to believe that CI2 will work fine with cms_system 0.8.x, this is not intended for long-term production use.

Installing CI2

While CI2 is not included within cms_system v0.8+, it can be installed and used in v0.8.x.
If you run into any problems while using CI2 with cms_system, please feel free to open an issue.

To install CI2, you will need to do the following:
- Setup (or update) a cms_system installation with the latest code from GitHub.
- Download the latest CI2 release (CI 2.2.4 is the latest 2.x release at the time of this writing).
- Making sure to not overwrite the existing files in the /cms_system/ci2/ directory of your working test site, copy the files from the CI2 system directory into the /cms_system/ci2/ directory. (If you do happen to overwrite the files, you can pull them down from the cms_system GitHub repository.)

Switching CodeIgniter versions

Additionally, the /public/index.php file must be updated.
In this file, when the $system_path variable is first defined, you can easily switch between CI2 and CI3 by commenting out the current $system_path definition and uncommenting the definition for the version of CI you wish to use.
In other words:
- to use CI2, the $system_path should point to "{$path}/cms_system/ci2"
- to use CI3, the $system_path should point to "{$path}/cms_system/ci3"

Upgrading from CI2 to CI3

Finally, check the CI3 upgrade guide for changes you will need to make to your application's modules.

If you have issues related to the changes in CI3's directory_map() function, cms_system has added a bcDirectoryMap() function to provide the results of directory_map() in the format returned by CI2's version of the function.
The function is in /cms_system/helpers/BF_directory_helper.php, so it should be available whenever directory_map() is available.
This is intended as a temporary compatibility function while transitioning an application from CI2 to CI3.