Welcome Guest, Not a member yet? Register   Sign In
Application Package and MY_helperName
#1

[eluser]coldscooter[/eluser]
I'm using a 'package' to hold shared resources between two apps i'm running on the same CI deployment. It's great for sharing libraries, models and helpers.

But it won't recognise when i put extended helpers/models in there (MY_helperName). Which means i'm ending up with lots of duplicates of extended helpers and classes in each app.

Does anyone know how to fix this?
#2

[eluser]tomcode[/eluser]
I choose one of the apps to be my 'main' application. It contains the extension files.

In the other apps I put files which point to the original :

Code:
// pseudo MY_Config.php
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

require_once(dirname(APPPATH) .'/main_application/core/MY_Config.php');
#3

[eluser]coldscooter[/eluser]
So you are still creating the MY_Config.php in every app, but just pointing to the shared version?

It would work but seems a little hacky.

It's a shame that this isn't set up by default.

I also can't put my database settings in the shared app. Anyone else experience this problem?
#4

[eluser]tomcode[/eluser]
Yeah, I have not found another solution. I use the same technique for the database settings. I did not like it in the beginning, but I have now several sites up like that and it works good.




Theme © iAndrew 2016 - Forum software by © MyBB