On 21/04/2008, Brion Vibber <brion(a)wikimedia.org> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andreas Rindler wrote:
we are trying to change the default skin for all
users using the
userOptions script and we get an error. Any idea how to resolve the
error or change the skin user option for users with another method?
MW version: 1.11
Php: 5.1.6
Here is the command and the error:
[openm@machine maintenance]$ php userOptions.php -cli skin --old
monobook --new mike2
PHP Warning: array_shift() [<a
href='function.array-shift'>function.array-shift</a>]: The argument
should be an array in
/chroot/home/openmeth/openmethodology.org/html/mike2/w/maintenance/commandLine.inc
on line 39
PHP Warning: reset() [<a href='function.reset'>function.reset</a>]:
Passed variable is not an array or object in
/chroot/home/openmeth/openmethodology.org/html/mike2/w/maintenance/commandLine.inc
on line 49
X-Powered-By: PHP/5.1.6
Content-type: text/html
It looks like you're running a CGI (web interface) version of PHP. This
can behave a bit differently from the CLI (command-line interface)
version; in this case it fails to register the command-line arguments as
a global variable.
If you can't find a CLI version of PHP on your system (it might be
called php-cli in some cases) you might or might not have luck by
adding this line to maintenance/commandLine.inc, right before line 39:
$argv =& $_SERVER['argv'];
Also use the -q option on PHP to suppress the HTTP headers.
We ended up using
phpMyAdmin.
- export user table
- replace all skin options with new skin name
- import user table and overwrite
The import worked fine. But mediawiki ignored the new user option
(skin=skinname) and defaulted all existing users to the classic skin.
That seems to be a bug? Or maybe the export/import failed, although
the table look fine.
We then removed all skins other than the new one and it now works
fine. It was our ultimate goal anyway to remove all other skins, but
we would have liked to this a bit more graceful...
Any ideas why the options are ignored?
We also found that only a third of the users had a value in the skin
option. The rest was blank?! My understanding of the options blob was
that (if specified in Localsettings.php) it gets filled with the
default skin. Any thoughts?
Thanks,
Andi