jrmadsen67 / Mahana-Messaging-library-for-CodeIgniter

A small library to help jump start your internal messaging system, for the CodeIgniter framework
59 stars 30 forks source link

Error when using HMVC because of hard coded file path #2

Open tonydew opened 11 years ago

tonydew commented 11 years ago

I'm using Modular Extension - HMVC (https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc) and Mahana_messaging.php errors out because it can't find the config file.

On line 24 of Mahana_messaging.php is the following:

require_once(APPPATH.'config/mahana.php');

With HMVC, where I have installed Mahana as a module, the actual path for me is:

require_once(APPPATH.'modules/mahana/config/mahana.php');

It might be better to require the file with something like:

require_once dirname(__FILE__).'/../config/mahana.php';

Although that is a little bit hack-ish and maybe just as error prone.

jrmadsen67 commented 11 years ago

I'm thinking about making a subfolder in libraries for it, so it will always be libraries/mahana/mahana.php. What do you think?

tonydew commented 11 years ago

I'm not sure what the convention would be in a case like this, but it does feel weird that there is a decidedly non CI type config file in the config folder.

Also, for people following along, there is a temporary work around in the merged Pull Request https://github.com/jrmadsen67/Mahana-Messaging-library-for-CodeIgniter/pull/4