Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI_Driver_Library not found when upgrading from 2.1.3 to 3-dev #2191

Closed
tkaw220 opened this issue Jan 25, 2013 · 11 comments
Closed

CI_Driver_Library not found when upgrading from 2.1.3 to 3-dev #2191

tkaw220 opened this issue Jan 25, 2013 · 11 comments

Comments

@tkaw220
Copy link
Contributor

tkaw220 commented Jan 25, 2013

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?

@dwightwatson
Copy link

Have you verified that that particular file is in that location on the system and in in fact intact?

@tkaw220
Copy link
Contributor Author

tkaw220 commented Jan 25, 2013

Yes. I replaced the whole system folder.

@tkaw220
Copy link
Contributor Author

tkaw220 commented Jan 25, 2013

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?

@AkenRoberts
Copy link
Contributor

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').

@tkaw220
Copy link
Contributor Author

tkaw220 commented Jan 25, 2013

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);

@AkenRoberts
Copy link
Contributor

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);

@tkaw220
Copy link
Contributor Author

tkaw220 commented Jan 25, 2013

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.

@tkaw220 tkaw220 closed this as completed Jan 25, 2013
@AkenRoberts
Copy link
Contributor

Welcome. :)

@tkaw220 tkaw220 reopened this Jan 25, 2013
@tkaw220
Copy link
Contributor Author

tkaw220 commented Jan 25, 2013

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.

@AkenRoberts
Copy link
Contributor

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. :)

narfbg added a commit that referenced this issue Jan 25, 2013
@narfbg narfbg closed this as completed Jan 25, 2013
nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013
Signed-off-by: Edwin Aw <tkaw220@gmail.com>
nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013
@romanbonapart
Copy link

Just set session as driver like this $autoload['drivers'] = array('session');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants