Welcome Guest, Not a member yet? Register   Sign In
Can not use session out slide application folder in CI 3.0
#5

I know the tricky answer. Maybe there is an easier way, but I don't know it.

For me I integrated long time ago a standalone file manager (KCFinder) in a way that works in any session driver. But there are two things to be done:

1. Some modification of the file manager's code is needed. Calling session_start() there is not good, CodeIgniter is to initialize the session.

2. How? I implemented loading CodeIgniter core in non-MVC way. The function get_instance() works, it returns a dummy controller with the usual properties, get_instance()->session and etc. And the loaded core initializes itself using the CodeIgniter settings, including the session settings. Thus, the external file manager uses the same session, created by CodeIgniter.

See how a demo non-MVC page looks like: https://github.com/ivantcholakov/starter...c/demo.php

This is one of the entry files of the file manager - I create CodeIgniter's core there too: https://github.com/ivantcholakov/starter...browse.php

And then: https://github.com/ivantcholakov/starter...r.php#L123

3. The good side of such an integration is that the file manager's configuration settings also can be tweaked by CodeIgniter (depending on user credentials). For example, the file manager may be enabled for power users only, this is CodeIgniter to determine who is who.
Reply


Messages In This Thread
RE: Can not use session out slide application folder in CI 3.0 - by ivantcholakov - 04-14-2015, 09:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB