Bacula-users

Re: [Bacula-users] baculum-7.0.2 /wizard not found.

2014-04-13 10:56:52
Subject: Re: [Bacula-users] baculum-7.0.2 /wizard not found.
From: Marcin Haba <ganiuszka AT gmail DOT com>
To: Josh Fisher <jfisher AT pvct DOT com>
Date: Sun, 13 Apr 2014 16:50:45 +0200
2014-04-13 15:10 GMT+02:00 Josh Fisher <jfisher AT pvct DOT com>:
> On 4/13/2014 8:18 AM, Marcin Haba wrote:
>> 2014-04-12 0:16 GMT+02:00 Marcin Haba <ganiuszka AT gmail DOT com>:
>>> 2014-04-10 0:10 GMT+02:00 John Drescher <drescherjm AT gmail DOT com>:
>>>> After installing baculum
>>>>
>>>> I got a php error @ line 75 of
>>>> gui/baculum/framework/I18N/core/MessageSource_gettext.php
>>>>
>>>> TPhpErrorException
>>>>
>>>> Description
>>>>
>>>> [Runtime Notice] Non-static method TGettext::factory() should not be
>>>> called statically, assuming $this from incompatible context (@line 75
>>>> in file 
>>>> /var/www/localhost/htdocs/baculum/framework/I18N/core/MessageSource_gettext.php).
>>>
>>> Hello John,
>>>
>>> Above error is caused by enabled E_STRICT error reporting flag in your
>>> php.ini file.
>>>
>>> For Baculum working, you need to disable this flag. In other words, in
>>> your php.ini file is need to switch option error_reporting:
>>>
>>> from:
>>>
>>> error_reporting = E_ALL | E_STRICT ... and other flags
>>>
>>> to:
>>>
>>> error_reporting = E_ALL
>> Hello,
>>
>> In above replacing there should be:
>>
>> from:
>>
>> error_reporting = E_ALL | E_STRICT ... and other flags
>>
>> to:
>>
>> error_reporting = E_ALL & ~E_STRICT
>>
>> Sorry for the mistake.
>
> Wouldn't it be better to prepend the '@' error control operator to the
> expression and eliminate the need to alter php.ini?
>
> Also, why exactly is a non-static method being called statically? Surely
> that indeed is an error. I would think either the factory() method needs
> to be made static or else it needs to be called as $object->factory() (
> or perhaps as $this->factory() if called from within TGettext methods or
> from within methods of classes derived from whatever base class defines
> factory(). )

Hello Josh,

Thank you for your opinion and advice. I agree with you about calling
staticly method.

Please let me explain two things.

1. The occured issue is a notice that is result of working E_STRICT
level, not notice from E_NOTICE level. Difference between these two is
that notice from E_STRICT level mainly helps to keep good code style
(in coding standard). Notice from E_NOTICE level usually warns about
possible bugs in code.

Summing up, in short we can say that E_STRICT can make suggestions to
code, E_NOTICE warns before bugs (for example: typo) in code.

Because of that in this case setting:

error_reporting = E_ALL & ~E_NOTICE

will not hide this notice. Setting:

error_reporting = E_ALL & ~E_STRICT

will hide this E_STRICT's notice.

In PHP version < 5.4 E_STRICT level was not part of E_ALL level. From
PHP version >= 5.4 it is part of E_ALL level. So, I think that
proposed solution for PHP setting in version 5.3, 5.4 and 5.5 could be
set:

error_reporting = E_ALL & ~E_STRICT

because it will work in all cases (5.3, 5.4 and 5.5)

2. Occured notice is not caused by direct part of Baculum code, but it
is in framework code. I think that good idea will be report this
notice to framework mailing list, or just sending patch :-) I think
that I will do that for a moment.

At the end I would like to say my opinion about @ operator. Personally
I am very careful before using it. From time to time I use @ operator
but only in reasonable cases. I know that it is not the best practise
:-)

Best regards.
Marcin

------------------------------------------------------------------------------
Put Bad Developers to Shame
Dominate Development with Jenkins Continuous Integration
Continuously Automate Build, Test & Deployment 
Start a new project now. Try Jenkins in the cloud.
http://p.sf.net/sfu/13600_Cloudbees
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users