Merging a CI app with EE2 - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Merging a CI app with EE2 (/showthread.php?tid=41383) |
Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] Hi all, I'm trying to merge a CI app which we have developed with a EE2 install such that the CI app can run off the version of CI which ships with EE2. Thus far I have EE2 installed and running with no problems and I have moved my index.php for my CI app into a sub folder. However when I try to access my CI app it's returning a similar error on all controllers: Code: Fatal error: Class 'Controller' not found in /home/ihasco/subdomains/dev/system/app/controllers/training.php on line 10 I'm guessing there's something I've missed in the CI index.php file perhaps or is it simply not possible to do what I'm trying... I had assumed that EE2 was just using a stable build of CI as it's base so would be able to point at that from my application... Any help greatly appreciated! Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Darren Miller[/eluser] Sounds like you're trying to extend Controller instead of CI_Controller, which is a v2 change Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] ah! You may be my savior! Yes... this app is running on CI 1.7.2! Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] Of course I'm now getting another error: Code: Fatal error: Call to undefined method CI_Controller::Controller() in /home/ihasco/subdomains/dev/system/app/controllers/training.php on line 15 So I'm guessing something here needs changing... Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); :? Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Darren Miller[/eluser] replace <code> parent::Controller(); </code> with <code> parent::__construct(); </code> Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]toopay[/eluser] also... Code: // replace Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] Brilliant, thanks guys. Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] It's so almost there, I'm stuck with a one final challenge though, the .htaccess rewrites... I decided to go the route of switching things round and having the CI app as the default (index.php) and EE2 called via expressionengine.php. So both these files reside in the /public_html folder along with my .htaccess. What I wish to do is route all traffic for a specific set or controller names to the CI app and everything else to EE2, so I was thinking something along the lines of: Code: <IfModule mod_rewrite.c> But I'm not having any luck, this just throws a server error so I must be completely out of whack somewhere... :/ Merging a CI app with EE2 - El Forum - 05-06-2011 [eluser]toopay[/eluser] Its related with environment issues i believe. Working on this htaccess section, with some regex variation. Code: RewriteBase / Merging a CI app with EE2 - El Forum - 05-09-2011 [eluser]Nathan Pitman (Nine Four)[/eluser] Ok, I managed to get it working! Here's what I did: 1) Placed the CI app front end loader (index.php) in a sub folder (/app). 2) reverted back to having the EE front loader as index.php in the site root. 3) Modified my .htaccess file to read as follows: Code: <IfModule mod_rewrite.c> Now I can specify controller names that need to be routed to CI and everything else get's routed to EE2! Hoorah! |