• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to locate the specified class: Session.php

#1
Hi! I've been struggling trying to figure out what's going on to my code.
I updated CI version of a application from 2x to the latest one available. This app uses tank_auth and grocery_crud. I'm aware that tank_auth is not fully compatible with CI 3x (there is no official updates to CI 3). About crud, I updated it to its latest version as well.
Finishing setting up CI and going through the Upgrading Documentation I went to test my application and here we go, it keeps me returning this error message: 

Unable to locate the specified class: Session.php

My session config:

PHP Code:
$config['sess_driver'] = 'database';
$config['sess_cookie_name'] = 'ci_sessions_sas';
$config['sess_expiration'] = 7200;
$config['sess_save_path'] = 'ci_sessions_sas';
$config['sess_match_ip'] = FALSE;
$config['sess_time_to_update'] = 300;
$config['sess_regenerate_destroy'] = FALSE


My autoload:

PHP Code:
$autoload['drivers'] = array('session'); 


My Home class Controller:

PHP Code:
<?php
    if 
(!defined('BASEPATH'))
 
       exit('No direct script access allowed');

 
   class Home extends MY_Controller {
 
       public $data = array();

 
       function __construct() {
 
           parent::__construct();

 
           $this->load->library('menu');
 
           $menu = new menu();
 
           $this->data['menu'] = $menu->getMenu();
 
       }

 
       public function index() {
 
           $this->data['user'] = $this->session->userdata('username');
 
           $this->data['slug'] = 'home';
 
           $this->load->view('layout'$this->data);
 
       }
 
   

Menu library:

PHP Code:
<?php
    if 
(!defined('BASEPATH'))
 
       exit('No direct script access allowed');

 
   class Menu extends MY_Controller{
 
       function __construct() {
 
           parent::__construct();
 
           $this->load->model('menu_model''menu');
 
       }

 
       public function getMenu() {
 
           $menu = array();
 
           $model = new Menu_model();

 
           $perfil $this->getPerfilUser();

 
           $modulos $model->getModulos($perfil);
 
           $funcoes $model->getFuncoes($perfil);

 
           for ($i 0$i sizeof($modulos); $i++) {
 
               $menu[$i]['nome'] = $modulos[$i]['modulo_nome'];
 
               for ($j 0$j sizeof($funcoes); $j++) {
 
                   if ($menu[$i]['nome'] == $funcoes[$j]['modulo_nome']) {
 
                       $menu[$i]['funcoes'][$j] = $funcoes[$j];
 
                   }
 
               }
 
           }
 
           return $menu;
 
       }

 
       function getPerfilUser() {
 
          //return $this->session->userdata['user_id_perfil'];
 
       }

 
       function getIdUser() {
 
           //return $this->session->userdata['user_id'];
 
       }

 
       function exibirMenu() {
 
           echo '<pre>';
 
               print_r($this->getMenu());
 
           echo '</pre>';
 
       }
 
   


I thought the problem could be the tank_auth library, so I removed it completely. The problem persisted.
In my Home Controller when I comment the lines:

PHP Code:
$this->load->library('menu');
$menu = new menu();
$this->data['menu'] = $menu->getMenu(); 

I guess the problem is related with the Home class, but I can't figure it out.  Huh


Attached Files Thumbnail(s)
   
Reply

#2
Use $autoload['libraries'] = array('session'); not $autoload['drivers']
Reply

#3
(11-08-2017, 08:48 PM)dave friend Wrote: Use $autoload['libraries'] = array('session');  not $autoload['drivers']

Hi Dave, at some point I read session library was migrated to drivers. Anyways, I've tried that and the warning persists.
Reply

#4
Some insight: When I move all the session library to the previous folder the warning disappear. Maybe something related to the Session.php path? I forgot to mention, it is a fresh install.
Reply

#5
You should not need to move the files!

Delete the CodeIgniter 3.
Download and re-install CodeIgniter 3

You seem to have a bad copy of it.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#6
(11-08-2017, 05:29 PM)muldock Wrote: I updated CI version of a application from 2x to the latest one available.

(11-09-2017, 03:53 AM)muldock Wrote: Some insight: When I move all the session library to the previous folder the warning disappear. Maybe something related to the Session.php path? I forgot to mention, it is a fresh install.

It can't be both updated from CI2 and a fresh install at the same time.

It's a botched update; you didn't read a warning in the upgrade instructions: https://codeigniter.com/userguide3/insta...e_300.html
Reply

#7
(11-09-2017, 05:05 AM)Narf Wrote:
(11-08-2017, 05:29 PM)muldock Wrote: I updated CI version of a application from 2x to the latest one available.

(11-09-2017, 03:53 AM)muldock Wrote: Some insight: When I move all the session library to the previous folder the warning disappear. Maybe something related to the Session.php path? I forgot to mention, it is a fresh install.

It can't be both updated from CI2 and a fresh install at the same time.

It's a botched update; you didn't read a warning in the upgrade instructions: https://codeigniter.com/userguide3/insta...e_300.html

Hey Narf. I did both procedures, first just tweaking the files and code following the official instructions and then a fresh install for testing purpose.
Reply

#8
(11-09-2017, 06:48 AM)muldock Wrote:
(11-09-2017, 05:05 AM)Narf Wrote:
(11-08-2017, 05:29 PM)muldock Wrote: I updated CI version of a application from 2x to the latest one available.

(11-09-2017, 03:53 AM)muldock Wrote: Some insight: When I move all the session library to the previous folder the warning disappear. Maybe something related to the Session.php path? I forgot to mention, it is a fresh install.

It can't be both updated from CI2 and a fresh install at the same time.

It's a botched update; you didn't read a warning in the upgrade instructions: https://codeigniter.com/userguide3/insta...e_300.html

Hey Narf. I did both procedures, first just tweaking the files and code following the official instructions and then a fresh install for testing purpose.

A fresh install won't have this problem. I don't know what you've done, but it is certainly not "fresh".

Either way, you're replying to my side remark and ignoring the second paragraph where I'm actually pointing you at what went wrong.
Reply

#9
Nerf, I am not ignoring what you've pointed, and thanks for that. I'll try different things when I get home from work tonight. Some thoughts: I'm running Windows 10, could it be some kind of issue with the ucfirst nomenclature? PHP version? Running 7.0
Reply

#10
(11-09-2017, 07:56 AM)muldock Wrote: Nerf, I am not ignoring what you've pointed, and thanks for that. I'll try different things when I get home from work tonight. Some thoughts: I'm running Windows 10, could it be some kind of issue with the ucfirst nomenclature? PHP version? Running 7.0

It's Narf.

No, it's not related to Windows or PHP versions.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2018 MyBB Group.