milesj / decoda

A lightweight lexical string parser for BBCode styled markup.
MIT License
196 stars 52 forks source link

Can not override default configs #80

Closed ErikMinekus closed 10 years ago

ErikMinekus commented 10 years ago

In Decoda::__construct(), the default config path is always added:

        $this->addPath(dirname(__DIR__) . '/config/');

So if I want to override the default emoticons or censored words, I have to call

        $code->reset($text, true);

After instantiating Decoda, and then I can add my own paths. It would have been nicer if $this->addPath(dirname(__DIR__) . '/config/'); was part of Decoda::defaults(), but I guess that's a backwards incompatible change? Maybe we can add a third parameter to the constructor.

milesj commented 10 years ago

Making it a config option should be fine.

milesj commented 10 years ago

Added a configPath that can be customized through constructor.