On 2012-02-22 7:52 PM, Christian Boltz <pos...@cb...> wrote:
> Am Donnerstag, 16. Februar 2012 schrieb Tanstaafl:
>> I opened this Feature Request a while back:
>>
>> https://sourceforge.net/tracker/?func=detail&aid=3150300&group_id=1915
>> 83&atid=937967
>>
>> I'm fairly certain it is a trivial change -
> "trivial" is relative when it comes to PHP - does open_basedir ring a
> bell? ;-)
Heh... no, actually - remember, ianap... ;)
But it doesn't surprise me to learn that what I thought would be a
trivial change may not be so trivial...
> dirname(__FILE__) . '/etc/postfixadmin/config.local.php' will result in
> something like
> /var/www/pfa.example.com/htdocs/db_version/etc/postfixadmin/config.local.php
>
> You most probably want to use
>
> if (file_exists('/etc/postfixadmin/config.local.php')) {
> include('/etc/postfixadmin/config.local.php');
> }
>
> To avoid flooding the error log with open_basedir warnings, using
> @file_exists() (to supress the error message) _might_ be needed
> (untested, as usual in past-midnight mails ;-)
Ok, but ... are you saying to simply add the '@' character, like:
if (@file_exists('/etc/postfixadmin/config.local.php')) {
include('/etc/postfixadmin/config.local.php');
}
?
Also, I'm guessing that there may only be an error *if* the file
actually doesn't exist (which, in my case, it always should)?
> That said: if we find a solution that does not cause problems with
> open_basedir restrictions, I'll happily include it.
Sounds good... and it isn't a huge deal for me to maintain this change
manually myself per your and Davids instructions, but the less things I
have to manually maintain the better.
>> Hmmm... just had a thought... why not also add optional support for
>> putting the custom vacation.conf settings into config.local.php too?
> I understand your usecase/problem, but it's very hard to implement.
> The problem is that we use different programming languages -
> config.*.php is PHP code, but vacation.pl is written in perl. It would
> be quite difficult to parse config.*.php from perl (because it may
> contain _anything_ that is valid PHP, not only variables)
Ok, understood... like I said it was just a thought, but I readily admit
sometimes my casual thoughts (like this one) reflect my ignorance to a
much greater degree than I would like... ;)
|