Welcome Guest, Not a member yet? Register   Sign In
Issue with Session.php on CLI
#1

(This post was last modified: 11-20-2023, 02:55 PM by byrallier.)

Hello everyone,I got stuck on a issue with CI 3 version.
I have external PHP file which help me utilize CI Controller externally. 
I have a loader :
My_loader a simple custom loader to load controller. I got it from here: https://forum.codeigniter.com/showthread...#pid366518

On my ExternalPHP file:
PHP Code:
require("index.php")
$CI =& get_instance();
$CI->load->library('session/session');//unintended-added while trying to fix issue
$CI->load->model('Mymodel');
$CI->load->controller('Myparser'); 
session is loaded by autoloader:
$autoload['libraries'] = array(
'database',
'session',
...

But the issue is when I called controller, it simply try to load "session.php" which is not allowed to be added over CLI as its nothing for it. then my controller is not loaded properly by saying:

unable to locate the specified class: Session.php

session is normally loaded by autoload in config.php and works perfectly on web server. But when it comes to loading a controller in an external php file. Its a huge pain. I wanted to patch framework itself to avoid trying to load session over CLI but you know, at some ponit I will have to migrate CI4 and other versions and i dont want to mass the code

also the other weird part is, when I remove loading controller part, it doesnt throw the error.
any advice?
Reply


Messages In This Thread
Issue with Session.php on CLI - by byrallier - 11-20-2023, 02:38 PM
RE: Issue with Session.php on CLI - by e-ujian - 11-21-2023, 02:59 AM
RE: Issue with Session.php on CLI - by byrallier - 11-21-2023, 06:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB