EllisLab text mark
Advanced Search
     
How to autoload shared package
Posted: 15 November 2012 07:13 AM   [ Ignore ]
Joined: 2010-07-20
74 posts

I’d like to use the Package feature for sharing libraries and helpers between applications.
My CodeIgniter structure looks like :

/back// admin app
    
/config/
    /
controllers/
    /
helpers/
    ...
/
front// main site app
    
/config/
    /
controllers/
    /
helpers/
    ...
/
shared/
    /
helpers/
    /
libraries/
    /
models/
/
system/
    /
core/
    /
database/
    ...
/
www/
    /
back/
        /
css/
        ...
    /
front/
        /
css/
        ... 

But when I move some code from /back/helpers and /back/libraries to /shared/helpers, and /shared/libraries, and load the “shared” package like this in /back/config/autoload.php:

$autoload['packages'= array('/shared'); 

It just doesn’t work.

I also tried others combinations, but nothing works

$autoload['packages'= array('shared');
$autoload['packages'= array('/shared/');
$autoload['packages'= array('shared/');
$autoload['packages'= array('./shared');
$autoload['packages'= array('shared/helpers''shared/libraries'); 

What am I doing wrong or missing ?

 
Posted: 15 November 2012 01:15 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2010-07-20
74 posts

How could I achieve this please ? confused

What did you do to have resources shared between applications ?

 
Posted: 16 November 2012 05:18 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2010-07-20
74 posts

In fact I think that only my extended helpers placed in my shared package folder seemed not to be loaded.
So I found this thread on the EllisLab github, opened 11 months ago, and fixed just few days ago in this commit smile
Hope it will be part of the next CI update !