In LocalSettings.php I put
switch($wgSitename){case 'ABJ': trigger_error("can you believe $wgSitename is $wgSitename and not ABJ?!",E_USER_WARNING);}
For each HTTP GET, I see in /var/log/apache2/error.log:
[Fri Jan 03 15:48:43.103883 2014] [:error] [pid 6608] [client 127.0.0.1:52043] PHP Warning: can you believe $wgSitename is ABJ and not ABJ?! in /home/jidanni/mediawiki/LocalSettings.php on line 28 PHP Warning: can you believe $wgSitename is 0 and not ABJ?! in /home/jidanni/mediawiki/LocalSettings.php on line 28
So there is apparently two runs going on per each one HTTP GET.
But how in the world does it execution happen for the second run inside the case statement's ABJ switch if at the same time it is 0?
Or is this some weird php/apache echoing?
On 2014-01-03 2:37 AM, jidanni@jidanni.org wrote:
Or is this some weird php/apache echoing?
You can test whether it is or isn't by adding an mt_rand() call to your log test.
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://danielfriesen.name/]
DF> You can test whether it is or isn't by adding an mt_rand() call to your log test. You would have to tell me how. But anyway I've isolated the problem: $ cat n.php <?php $wgSitename='ABJ'; $wgSitename=0; switch($wgSitename){case 'ABJ':trigger_error("can you believe $wgSitename is $wgSitename and not ABJ?!",E_USER_WARNING);} $wgSitename=0; $wgSitename='ABJ'; switch($wgSitename){case 0:trigger_error("can you believe $wgSitename is $wgSitename and not 0?!",E_USER_WARNING);} $ php n.php PHP Warning: can you believe $wgSitename is 0 and not ABJ?! in /mnt/usb/cf/n.php on line 4 PHP Warning: can you believe $wgSitename is ABJ and not 0?! in /mnt/usb/cf/n.php on line 7
What in the world is going on? Thank you. PHP 5.5.7-2.
OK I see, http://www.php.net/manual/en/control-structures.switch.php#86911 http://www.php.net/manual/en/control-structures.switch.php#97112 http://www.php.net/manual/en/control-structures.switch.php#84150 How awful. No wonder people write http://me.veekun.com/blog/2012/04/09/php-a-fractal-of-bad-design/
mediawiki-l@lists.wikimedia.org