Bugs since php 5.4

Status
Not open for further replies.

springbox99

Member
Messages
114
Reaction score
3
Points
18
Hello,

Since x10hosting uses php5.4, my coppermine galery had bugs. An upgrade to the last version didn't solve the problem.
I had to make a lot of changes :
For Strict Standards: Non-static method Inspekt::makeSuperCage() should not be called statically in /include/init.inc.php on line 42
PHP:
$superCage = Inspekt::makeSuperCage($strict);
was replaced by
PHP:
$inspekt = new Inspekt();
$superCage = $inspekt->makeSuperCage($strict);

For Strict Standards: Non-static method Inspekt_Supercage::Factory() should not be called statically in /include/inspekt.php on line 282
PHP:
$_scinstance = Inspekt_Supercage::Factory($strict);
was replaced by
PHP:
$inspekt_supercage = new Inspekt_Supercage();
$_scinstance = $inspekt_supercage->Factory($strict);

For "Strict Standards: Non-static method Inspekt::makeGetCage() should not be called statically, assuming $this from incompatible context in /include/inspekt/supercage.php on line 124
Strict Standards: Non-static method Inspekt::makePostCage() should not be called statically, assuming $this from incompatible context in /include/inspekt/supercage.php on line 125
Strict Standards: Non-static method Inspekt::makeCookieCage() should not be called statically, assuming $this from incompatible context in /include/inspekt/supercage.php on line 126
Strict Standards: Non-static method Inspekt::makeEnvCage() should not be called statically, assuming $this from incompatible context in /include/inspekt/supercage.php on line 127
Strict Standards: Non-static method Inspekt::makeFilesCage() should not be called statically, assuming $this from incompatible context in /include/inspekt/supercage.php on line 128
Strict Standards: Non-static method Inspekt::makeServerCage() should not be called statically, assuming $this from incompatible context in include/inspekt/supercage.php on line 134
"
PHP:
 $inspekt = new Inspekt();
      $this->get   = $inspekt->makeGetCage($strict);
      $this->post   = $inspekt->makePostCage($strict);
      $this->cookie   = $inspekt->makeCookieCage($strict);
      $this->env   = $inspekt->makeEnvCage($strict);
      $this->files   = $inspekt->makeFilesCage($strict);
        /**
         * Don't put session in cage as it will nullify $_SESSION and we will loose the session completely.
         * TODO: Find a way to put the session data in cage and still retain the session correctly
         */
      //$this->session=  $inspekt->makeSessionCage($strict);
      $this->server   = $inspekt->makeServerCage($strict);
Etc.

Another way to solve the problem would be to edit php.ini like explained here
http://forum.coppermine-gallery.net/index.php/topic,75836.0.html

I tell you this because i've seen that i have the same issue with Joomla.
 
Last edited:

Anna

I am just me
Staff member
Messages
11,750
Reaction score
581
Points
113
It is not recommended in the long run but it is an option while working on the solution if nothing else.
 

essellar

Community Advocate
Community Support
Messages
3,295
Reaction score
227
Points
63
Fixing code is always better, but it's not always an option (not everyone's a coder, more's the pity). Updating 3rd-party script versions to something that supports PHP 5.4.x natively is a fix, but, again, it's not always an available option. Suppressing errors doesn't fix them any more than a PHP version reversion will, but at least reversion gets the code that raises the errors in the first place out of the way (the static analysis) -- it's like turning off linting for known-ugly code.
 

Skizzerz

Contributors
Staff member
Contributors
Messages
2,928
Reaction score
118
Points
63
another workaround would be to go to your coppermine config file (or whatever config file you use for your application) and insert the following at the top, under the <?php tag:
PHP:
error_reporting(E_ALL ^ E_STRICT);

This will get rid of the "Strict Standards" warnings (although it doesn't actually fix the code itself, it only prevents the error messages from being displayed). For coppermine, try bugging their support/developers to release a version that is fully compatible with PHP 5.4, it's been out long enough that one should've been released by now anyway.
 
Status
Not open for further replies.
Top