Welcome Guest, Not a member yet? Register   Sign In
Access codeigniter super object from external files
#1

[eluser]helmutbjorg[/eluser]
Hi Guys,

I think I am getting closer to a simple way to access the CI super object from an external script. Sometimes you need the methods inside third party scripts (like forums, wikis, fckeditor filemanager, etc) to authenticate, etc.

My idea is to simply include the main index.php inside phps output buffering somehow... For example we have a script

external.php
Code:
ob_start();
include('index.php');
ob_end_clean();
$CI =& get_instance();
// And now you can use the methods, etc

I have hit a problem which I think there must be a solution to. It works perfectly if I do not echo anything to the screen. The only time it doesn't work is when I have Output Compression set to true in the config.php and I echo something. If I don't output anything it works great with compression on. I would like this to work with this setting true or false. The error I get is the standard browser error 'Content Encoding Error'.

Anyone have any ideas?

I know that other people have had other ideas to fix this general problem (such as Dip Into CI http://codeigniter.com/wiki/dip_into_CI/) etc but I think if this works it is a VERY simple solution.

Cheers Steve


Messages In This Thread
Access codeigniter super object from external files - by El Forum - 01-07-2009, 07:41 PM
Access codeigniter super object from external files - by El Forum - 01-07-2009, 09:27 PM
Access codeigniter super object from external files - by El Forum - 07-29-2009, 02:04 PM
Access codeigniter super object from external files - by El Forum - 02-22-2010, 03:54 PM
Access codeigniter super object from external files - by El Forum - 02-23-2010, 02:49 AM
Access codeigniter super object from external files - by El Forum - 02-23-2010, 03:27 AM
Access codeigniter super object from external files - by El Forum - 02-23-2010, 04:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB