mardi 20 janvier 2015

CodeIgniter : core/ override, missing load/loader class


Vote count:

0




Okay, i am having this issue and google is not helping and i think it is because my issue is too simple or something.


I'm trying to load whatever or connect with load->database(); but it aint working.


Here is my code with comments, it will explain everything.



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

class CI_Lang {

function __construct() {
# Show all files included
print_r(get_included_files()); // There is nothing like loader or load .php

# Check for loader file
if( ! class_exists('loader') || ! class_exists('load')) {
echo 'no load '; // is being shown,
}

# Check Database connection before
if (isset($this->db->conn_id) && is_resource($this->db->conn_id)) {
echo 'database is loaded and conected ';
} else {
echo 'no connection '; // is being shown,
}

# Get Database connection
$this->load->library('database');
/*
Script dies on line above with error:
Fatal error: Call to a member function library() on a non-object in
application/core/Lang.php on line 38
*/

$this->load->database();

# Check Database connection after
if (isset($this->db->conn_id) && is_resource($this->db->conn_id)) {
echo 'database is loaded and conected ';
} else {
echo 'no connection ';
}



# Register as loaded
log_message('debug', 'JK_Lang Class initialized');
}
}


This script is named Lang.php and it is in application/core folder. It is supposed to override the main Lang class and it is. The problem is, it seems to be all alone. How can i include other methods here?


I already have modified autoload.php and set there:



$autoload['libraries'] = array(
# We need Loader
'loader',
# Connect with DB
'database',

# Session Start
'session'
);


And now i have ran out of ideas, any help please ?



asked 22 secs ago







CodeIgniter : core/ override, missing load/loader class

Aucun commentaire:

Enregistrer un commentaire