Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-27 Thread jidanni
Hey Jidanni, you can just eliminate your whole
>date_default_timezone_set($wgLocaltimezone); 
>putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;
line. It's already taken care of for you in includes/Setup.php !
You don't even need to reinstall Mediawiki just to find out how they do
it in the current generated LocalSettings.php .
Don't worry. The next time your wiki stops working because something
needs to be updated in LocalSettings.php just look at the...

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-23 Thread jidanni
> "C" == Chad   writes:
C> Of course it won't. LocalSettingsGenerator.php only has a class--no
C> executable code. You could write a maintenance script to do that
C> though.

C> You can pass it an array of all the values you want to output in it
C> (it's pretty well documented), and you could read your current
C> LocalSettings to get those values. Not the most straightforward
C> use-case but the installer didn't call for that behavior. YMMV.

Ah, of course! A simple

 public function execute() {
$vars = Installer::getExistingLocalSettings();
$ls = new LocalSettingsGenerator( $this );
$ls->writeFile( "/tmp/LocalSettings.php" );
}

Unfortunately it is 1 0 0 0 times more complicated than that and it
would be 1 0 0 0 times easier to just download another copy of MediaWiki
and stumble forth from there.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-21 Thread Platonides
On 21/03/12 19:38, jida...@jidanni.org wrote:
> Is there any way I can just run
> $ cd includes/installer && php LocalSettingsGenerator.php
> to see what it generates using my current values,
> so I don't have to install all over again just to see what it makes looks 
> like?
> I did the above line and nothing happens.

The latest MW version gives it for you to download, instead of saving it
as LocalSettings.php so it's easier for comparison.


___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-21 Thread Chad
On Wed, Mar 21, 2012 at 2:38 PM,   wrote:
> Is there any way I can just run
> $ cd includes/installer && php LocalSettingsGenerator.php
> to see what it generates using my current values,
> so I don't have to install all over again just to see what it makes looks 
> like?
> I did the above line and nothing happens.
>

Of course it won't. LocalSettingsGenerator.php only has a class--no
executable code. You could write a maintenance script to do that
though.

You can pass it an array of all the values you want to output in it
(it's pretty well documented), and you could read your current
LocalSettings to get those values. Not the most straightforward
use-case but the installer didn't call for that behavior. YMMV.

-Chad

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-21 Thread jidanni
Is there any way I can just run
$ cd includes/installer && php LocalSettingsGenerator.php
to see what it generates using my current values,
so I don't have to install all over again just to see what it makes looks like?
I did the above line and nothing happens.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-20 Thread jidanni
OK I will try my best to keep up with your changes

for i in RELEASE-NOTES-* includes/installer/LocalSettingsGenerator.php
do
echo $i diff:
svn diff -r ${BASE-BASE}:HEAD $i|wdiff -d -3|tee 
/tmp/mediawikiDiff$$
done

And also watchlist http://www.mediawiki.org/wiki/Manual:LocalSettings.php

Alas that is still not enough to reveal to what the current vanilla
LocalSettings.php that gets produced deals with the issue. Perhaps
someone would be kind enough to post one.

>Why don't you just set `date.timezone` in your php config and make all the
>hacks go away?

I want to keep all this stuff in one file, LocalSettings.php, on my many 
systems.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-19 Thread Daniel Friesen

On Mon, 19 Mar 2012 18:13:58 -0700,  wrote:


Nowadays one gets:

PHP Warning: date(): It is not safe to rely on the system's timezone
settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected the timezone 'UTC' for
now, but please set date.timezone to select your timezone. in
LocalSettings.php on line 82
MediaWiki 1.20alpha Updater

Given

3 matches for "timez" in buffer: LocalSettings.php
 28:  case 'ABJ':$wgLocaltimezone='America/Chicago';
 47:  case ...  :$wgLocaltimezone='Asia/Taipei';
 82:putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;

I found making that line 82 now

date_default_timezone_set($wgLocaltimezone);putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;

fixes the problem.


Why don't you just set `date.timezone` in your php config and make all the  
hacks go away?


--
~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-19 Thread Chad
On Mon, Mar 19, 2012 at 9:13 PM,   wrote:
> Nowadays one gets:
>
> PHP Warning: date(): It is not safe to rely on the system's timezone
> settings. You are *required* to use the date.timezone setting or the
> date_default_timezone_set() function. In case you used any of those
> methods and you are still getting this warning, you most likely
> misspelled the timezone identifier. We selected the timezone 'UTC' for
> now, but please set date.timezone to select your timezone. in
> LocalSettings.php on line 82
> MediaWiki 1.20alpha Updater
>
> Given
>
> 3 matches for "timez" in buffer: LocalSettings.php
>     28:  case 'ABJ':$wgLocaltimezone='America/Chicago';
>     47:  case ...  :$wgLocaltimezone='Asia/Taipei';
>     82:putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;
>
> I found making that line 82 now
>
> date_default_timezone_set($wgLocaltimezone);putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;
>
> fixes the problem.
>

Using putenv("TZ=") has been removed as of PHP 5.4. From the
changelog:

"Removed support for putenv("TZ=..") for setting the timezone."

-Chad

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l

Re: [Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-19 Thread jidanni
Gee, I hope none of my users will be affected...
mysql> select distinct up_value from user_properties where up_property = 
"timecorrection";
+--+
| up_value |
+--+
| Offset|0 |
| 08:00|
| System|480   |
| ZoneInfo|480|Asia/Taipei |
+--+

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l


[Wikitech-l] putenv(TZ) hack in LocalSettings.php now gives warnings

2012-03-19 Thread jidanni
Nowadays one gets:

PHP Warning: date(): It is not safe to rely on the system's timezone
settings. You are *required* to use the date.timezone setting or the
date_default_timezone_set() function. In case you used any of those
methods and you are still getting this warning, you most likely
misspelled the timezone identifier. We selected the timezone 'UTC' for
now, but please set date.timezone to select your timezone. in
LocalSettings.php on line 82
MediaWiki 1.20alpha Updater

Given

3 matches for "timez" in buffer: LocalSettings.php
 28:  case 'ABJ':$wgLocaltimezone='America/Chicago';
 47:  case ...  :$wgLocaltimezone='Asia/Taipei';
 82:putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;

I found making that line 82 now

date_default_timezone_set($wgLocaltimezone);putenv("TZ=$wgLocaltimezone");$wgLocalTZoffset=date('Z')/60;

fixes the problem.

___
Wikitech-l mailing list
Wikitech-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikitech-l