You are here

Codeigniter 3

Error message

Deprecated function: strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in drupal_strip_dangerous_protocols() (line 1458 of /home2/crephoto/public_html/techblog/includes/common.inc).

I started using the Codeigniter framework when it was still in its infancy. I understand that many folks have bailed in favor of more modern, comprehensive frameworks like Laravel, with which I've dabbled a bit myself. However, most of my sites are not mission critical or revenue generating, and web development is not a full-time job for me so maintaining my CodeIgniter sites is a practical option.

CodeIgniter 3 brings with it many enhancements, including the simple, reliable CommunityAuth module. I decided it was time to upgrade all my Codeigniter 2 sites to version 3. Here's a summary of the process:

  1. Replace your system folder with the new Codeigniter 3 system
  2. Replace the index.php at the root of your web project (with any necessary changes)
  3. Rename all your controller, library, and model files to be UCfirst. IE, foobar_m.php becoms Foobar_m.php
  4. Replace config/mimes.php
  5. Default log file directory is the application directory. Be sure you have a writable/executable folder in here called "logs"
  6. edit config/database.php and change $active_record=TRUE to $query_builder=TRUE
  7. modify config/database.php and change the driver from mysql to mysqli
  8. modify config/config.php and add $config['sess_driver'] = 'files' (or 'database')

There are many other changes as well, but these are the ones that I needed to address to get a basic Codeigniter site up and running with version 3. Details of the upgrade process can be found on the Codeigniter site.

73