difference between Loader.php and MY_Loader.php - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: difference between Loader.php and MY_Loader.php (/showthread.php?tid=70599) Pages:
1
2
|
difference between Loader.php and MY_Loader.php - richb201 - 05-01-2018 I am getting an error when I load my working code unto a shared host. see below that I have MY_Loader.php in my core directory but line 344 is trying to use Loader.php. Is there some kind of prefix configuration that I need to setup? An uncaught Exception was encountered Type: RuntimeException Message: Unable to locate the model you have specified: User Filename: /home/substant/public_html/rndcontroller/sub_crud/system/core/Loader.php Line Number: 344 Backtrace: File: /home/substant/public_html/rndcontroller/sub_crud/application/controllers/Users.php Line: 18 Function: model File: /home/substant/public_html/rndcontroller/sub_crud/index.php Line: 316 Function: require_once RE: difference between Loader.php and MY_Loader.php - richb201 - 05-01-2018 Well, I tried just renaming MY_Loader.php to Loader.php. Now I get this error: A PHP Error was encountered Severity: Error Message: Class 'CI_Loader' not found Filename: core/Loader.php Line Number: 20 Backtrace: Now to install this application on my server I just copied the sub_crud directory from my local machine to the server. I did NOT do a CI installation on the server. Should I have? RE: difference between Loader.php and MY_Loader.php - ciadmin - 05-01-2018 Check the original error message ... Message: Unable to locate the model you have specified: User You might have named your class user.php, when the CI loader is looking for User.php. Won't matter on Windows, but it does on Linux. RE: difference between Loader.php and MY_Loader.php - richb201 - 05-02-2018 I do have a model called user.php. I have attached a directory listing showing a file called sub_crud/application/models/user.php. So how do I fix this? If I rename sub_crud/application/models/user.php to sub_crud/application/models/User.php, might that work? Is it worth a try? RE: difference between Loader.php and MY_Loader.php - ciadmin - 05-02-2018 That is correct. Case sensitivity is a common problem when deploying a site developed on Windows to a server on Linux. See https://www.codeigniter.com/user_guide/general/styleguide.html?highlight=ucfirst#file-naming RE: difference between Loader.php and MY_Loader.php - richb201 - 05-02-2018 thx. I changed the user.php to User.php in the /model. This seemed to work and i am down to the next problem. I am getting an error: An Error Was Encountered Unable to load the requested file: Users/login.php I never actually use Users/login.php in my code. I have places where I have: $this->load->view('Users/login'); and <li class="active"><li><a href='<?php echo site_url('Users/login')?>'>Login</a></li> and redirect('/Users/login/'); But Users/login.php? No. Any reason this would happen? RE: difference between Loader.php and MY_Loader.php - ciadmin - 05-02-2018 Your first reference, "$this->load->view('Users/login');", is asking CI to load the view file found in "application/views/Users/login.php" RE: difference between Loader.php and MY_Loader.php - ciadmin - 05-02-2018 Your second & third references are linking to - the *Users* controller (login method) inside "application/controllers", or to - the *Login* controller (index method) inside "application/controllers/Users" RE: difference between Loader.php and MY_Loader.php - richb201 - 05-02-2018 Thanks. I changed the first one to upper case "Users/login.php". That seems to take care of it. One more quick question? I have a whole bunch of warnings coming up on my browser screen. How do I turn off this level of warnings? Here is one example: A PHP Error was encountered Severity: Warning Message: session_set_cookie_params(): Cannot change session cookie parameters when headers already sent Filename: Session/Session.php Line Number: 296 Backtrace: File: /home/substant/public_html/rndcontroller/sub_crud/application/core/MY_Loader.php Line: 284 Function: library File: /home/substant/public_html/rndcontroller/sub_crud/application/controllers/Users.php Line: 15 Function: __construct File: /home/substant/public_html/rndcontroller/sub_crud/index.php Line: 316 Function: require_once Do I need to be concerned with going through and fixing every warning, or should I just turn off warnings? RE: difference between Loader.php and MY_Loader.php - dave friend - 05-02-2018 Fix'm |