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

Comments

Projects
None yet
5 participants
@tkaw220
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

This comment has been minimized.

Show comment
Hide comment
@dwightwatson

dwightwatson Jan 25, 2013

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

dwightwatson commented Jan 25, 2013

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

@tkaw220

This comment has been minimized.

Show comment
Hide comment
@tkaw220

tkaw220 Jan 25, 2013

Contributor

Yes. I replaced the whole system folder.

Contributor

tkaw220 commented Jan 25, 2013

Yes. I replaced the whole system folder.

@tkaw220

This comment has been minimized.

Show comment
Hide comment
@tkaw220

tkaw220 Jan 25, 2013

Contributor

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?

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@AkenRoberts

AkenRoberts Jan 25, 2013

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

Contributor

AkenRoberts commented Jan 25, 2013

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

This comment has been minimized.

Show comment
Hide comment
@tkaw220

tkaw220 Jan 25, 2013

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@AkenRoberts

AkenRoberts Jan 25, 2013

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

AkenRoberts commented Jan 25, 2013

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

This comment has been minimized.

Show comment
Hide comment
@tkaw220

tkaw220 Jan 25, 2013

Contributor

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.

Contributor

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 Jan 25, 2013

@AkenRoberts

This comment has been minimized.

Show comment
Hide comment
@AkenRoberts

AkenRoberts Jan 25, 2013

Contributor

Welcome. :)

Contributor

AkenRoberts commented Jan 25, 2013

Welcome. :)

@tkaw220 tkaw220 reopened this Jan 25, 2013

@tkaw220

This comment has been minimized.

Show comment
Hide comment
@tkaw220

tkaw220 Jan 25, 2013

Contributor

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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@AkenRoberts

AkenRoberts Jan 25, 2013

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

Contributor

AkenRoberts commented Jan 25, 2013

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 Jan 25, 2013

nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

Fix issue bcit-ci#2191.
Signed-off-by: Edwin Aw <tkaw220@gmail.com>

nonchip pushed a commit to nonchip/CodeIgniter that referenced this issue Jun 29, 2013

@digembok

This comment has been minimized.

Show comment
Hide comment
@digembok

digembok Jan 10, 2015

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

digembok commented Jan 10, 2015

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