CI_Driver_Library not found when upgrading from 2.1.3 to 3-dev
When upgrading from CI2.1.3 to CI3.0.0 Dev, I got this error: Fatal error: Class 'CI_Driver_Library' not found in C:\Server\www\pelican\system\libraries\Session\Session.php on line 53.
I has replaced the system folder and tweaked config files as per instructions from the upgrade guide. What could possibly goes wrong here?
Have you verified that that particular file is in that location on the system and in in fact intact?
Yes. I replaced the whole system folder.
I desperately need to upgrade to CI 3 due to a bug in Pagination class, where custom URI not take into account when re-route (see #1909). Is there any simple fix for 2.1.3?
Can you show me an actual use case that explains your issue with a re-routed URL? Because #1909 didn't give an example, either, and we've had a lengthy argument over the use of rsegment() in #2166, where it was decided that it is not an ideal solution. Note that the other issue mentions that the issue is solved by setting the uri_segment config option when loading/init the pagination lib.
The Session library is now a Driver in 3.0. Make sure you are not autoloading Session as a library, or using $this->load->library('session').
I have a Products controller. When requesting for products/barbie, app would re-route it to products/brand/barbie. Pagination work fine in this re-route because it uses the default 3rd URI segment.
Problem arises when requesting for products/age_group/infant, where the URI segment now fall on the 4th. The pagination doesn't take the custom URI segment into account even though I set:
$offset = $this->uri->segment(4);
Okay, yeah you're just experiencing the issue with the current pagination library default. We're gonna take care of that so it works out of the box in way more scenarios than it does right now.
In the mean time, you can set the uri_segment config option when doing your pagination config. Something like this:
$config = array(
'base_url' => site_url('products/age_group/infant'),
'total_rows' => 205,
'per_page' => 10,
'uri_segment' => 4,
);
$this->load->library('pagination', $config);
Wow, you had just solved my problem. Thank you very much.
It's my mistake because I didn't set the URI segment in custom config. Thanks for pointing out in your example.
Thank you.
Welcome. :)
Autoload the Cart library would trigger error Class 'CI_Driver_Library' not found in C:\Server\www\pelican\system\libraries\Session\Session.php on line 53.
Aha! $this->load->library('session') is still used in the Cart library. That does indeed need updating, good catch.
If you're familiar with submitting a pull request, you should take care of it. :)
Just set session as driver like this $autoload['drivers'] = array('session');