On 4/13/2014 10:50 AM, Marcin Haba wrote: > 2014-04-13 15:10 GMT+02:00 Josh Fisher <jfis...@pvct.com>: >> On 4/13/2014 8:18 AM, Marcin Haba wrote: >>> 2014-04-12 0:16 GMT+02:00 Marcin Haba <ganius...@gmail.com>: >>>> 2014-04-10 0:10 GMT+02:00 John Drescher <dresche...@gmail.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.
Yes, it definitely should be fixed in the framework. If the framework didn't throw notices in E_STRICT, then perhaps there would be no need to turn it off in php.ini at all. > 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 > :-) I agree. It should only be used in cases where it is known that an expression will throw a notice even when the code is doing exactly what is expected. > > Best regards. > Marcin ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/NeoTech _______________________________________________ Bacula-users mailing list Bacula-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users