Commit graph

324 commits

Author SHA1 Message Date
Bartosz Dziewoński
c161c46d26 Improve code suffering from PHP 5.3's lack of support for foo()[]
I searched for /\$(\S+) = (.+?\(.*?\);)\n.*?\$\1\[/, ignored
everything involving isset(), unset() or array assigments, then
skimmed through the remaining results and changed things where they
made sense. These changes were not automated, so please review them.

Change-Id: Ib37b4c66fc57648470f151ad412210b3629c2538
2016-02-28 22:49:20 +01:00
Timo Tijhof
35b7921030 installer: Remove obsolete config-no-cache message
Follows-up 02c3f68048.

The older message is obsolete now that we require PHP 5.5.9+.

Change-Id: I68199c2ec91c8447fe7e556a6c77f1da39eb5163
2016-02-25 21:31:52 +00:00
Brad Jorsch
f61cb18b71 Enforce MW_NO_SESSION, add MW_NO_SESSION_HANDLER
When an entry point specifies MW_NO_SESSION, actually enforce that by
having both SessionManager and PHP's session handling (session_start()
and friends) throw exceptions.

If an entry point needs the old behavior of using PHP's default session
handling (as defined in php.ini), it should define
MW_NO_SESSION_HANDLER instead of or in addition to MW_NO_SESSION.

This also makes PHPSessionHandler be installed in CLI mode, where it
wasn't installed before.

Bug: T127233
Change-Id: I2a3db06ee8e44a044096c57a819b5fd5e51c5c5c
2016-02-22 12:17:31 -05:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Kevin Israel
94e5b80fee Remove references to safe_mode INI setting
The feature no longer exists starting in PHP 5.4.0, and MediaWiki
now only supports PHP 5.5.9 or newer.

Change-Id: I3f2d1b564c50f0a28ec1ec0abd7d1b242e26953b
2016-02-12 19:18:26 -05:00
jenkins-bot
f38e4d61ec Merge "Remove register_globals and magic_quotes_* checks" 2016-02-11 22:42:55 +00:00
Max Semenik
231d152d63 Remove register_globals and magic_quotes_* checks
Yay, this crap is finally gone as of PHP 5.4!

Change-Id: I2cb01b5bf0fdde4c8cf5286ef6aff93ac45e99fd
2016-02-11 11:11:49 -08:00
Tim Starling
6a269d4d8d Suppress SessionManager sessions in the installer
SessionManager cannot work in the installer since it depends on
ObjectCache which is just an EmptyBagOStuff and so doesn't store
anything. So, introduce a custom SessionProvider which pretends to
persist sessions but actually doesn't.

Bug: T126177
Change-Id: I13d8aa1453c519df7c19ca2f1fb052c99ade043c
2016-02-11 10:48:28 +11:00
jenkins-bot
0a20c6eae1 Merge "In Installer, set the context language early to avoid loading from User" 2016-02-10 15:22:42 +00:00
Tim Starling
1714299f7a In Installer, set the context language early to avoid loading from User
Set the context language early, even before the session is loaded, to
avoid attempting to call User::loadFromSession(). Also update the things
that set $wgLang to also set it in RequestContext.

Passing $wgUser through to the ParserOptions constructor isn't strictly
necessary right now, but it does at least show the intended data flow
and is more robust to future changes in the way the language is passed
through to ParserOptions.

Fixes bug T126177 independently of my other two patches.

Bug: T126177
Change-Id: I15eb9cdce7805382d96b6fc6ffb9b25855876417
2016-02-10 21:44:09 +11:00
Tim Starling
2676e7fc3b In Installer, set the user to an anon in RequestContext, not just wgUser
This hack to prevent $wgUser being loaded was apparently not updated
when RequestContext was introduced.

Fixes T126177 independently of I13d8aa1453c

Bug: T126177
Change-Id: Iedceec3044352e433710d97d5c7c81fff1a6a3e5
2016-02-10 21:19:25 +11:00
Brad Jorsch
854406883e Add release notes and installer support for $wgAuthenticationTokenVersion
Change-Id: I092a0052b2ab50310cd8ca403d6b2f201b482d5b
2016-02-08 18:20:33 -07:00
jenkins-bot
23299ca879 Merge "Fix CLI installer when --dbname is not specified on command line." 2016-01-15 14:02:17 +00:00
Kunal Mehta
02c3f68048 installer: Say "APCu" for PHP >= 5.5
Pre-PHP 5.5 the extension was called "APC", and provided opcode caching
and userland object caching. In 5.5, the opcode caching was built-in to
PHP, and the userland object caching was moved into an extension named
"APCu".

Bug: T61998
Change-Id: Id6f4a87bfdb59b2592a56aea9450611238e313ad
2016-01-07 14:24:20 -08:00
jenkins-bot
abb7c6792f Merge "Installer: Link 4.0 family of CC licenses" 2015-12-16 19:41:49 +00:00
saper
a9de6fc779 Installer: Link 4.0 family of CC licenses
Bug: T96077
Change-Id: I86efa1dae64967d36f3a1afa79bf3637f43297dd
2015-12-16 19:34:34 +00:00
C. Scott Ananian
777c6dad44 Fix CLI installer when --dbname is not specified on command line.
When installing without an explicit `--dbname` argument on the command
line, the database is installed with the default value of $wgDBname
from DefaultSettings.php (which is `my_wiki`), but then the
LocalSettings.php file is written with the line:
    $wgDBname = "";
which overrides the default value and makes the wiki unable to
connect to the database created by the installer.

Adding `wgDBname` to the `$defaultVarNames` list fixes this problem.

Change-Id: I3792be9675aabe00b5497ed4203b12b89da8dc3a
2015-10-27 22:01:54 -04:00
jenkins-bot
f4a5507a96 Merge "Installer: use _MainCacheType form variable" 2015-10-26 17:32:52 +00:00
saper
1730a17929 Installer: use _MainCacheType form variable
Do not use "wgMainCacheType" form variable
name that contains values that cannot be
assigned to $wgMainCacheType

Bug: T116375
Change-Id: I83459c8006cc4c1bcdeaa0d78a1230687c95db46
2015-10-26 17:10:13 +00:00
saper
a93aa28711 Web installer should not pollute global namespace with session variables
There is no need to store session variables
(that also include user-supplied arguments)
as $wgXXX global variables.

Bug: T116375
Change-Id: I880d4299566beaf99ed1fc21c690cdda64149b0e
2015-10-24 02:00:02 +02:00
Florian
caa637dd83 Don't overwrite all available object caches
Just because some defined object caches are problematic in the installer, it
doesn't mean, that all others are problematic, too. Disable only the object
caches, which are known problematic ones by preserving the others.

Follow up: I1c1938b3fac395d

Bug: T113843
Change-Id: I951ef22d97b4c66d3b781a9bc4a30e7e2fca1395
2015-09-28 17:01:42 +00:00
jenkins-bot
19d5f55c01 Merge "Fix issues identified by SpaceBeforeSingleLineComment sniff" 2015-09-26 23:18:06 +00:00
Vivek Ghaisas
c54766586a Fix issues identified by SpaceBeforeSingleLineComment sniff
Change-Id: I048ccb1fa260e4b7152ca5f09b053defdd72d8f9
2015-09-26 23:06:52 +00:00
Florian
ded1a61e20 Add 'hash' object cache for installer
It's used to e.g. cache less files in ResourceLoader, which would throw
an exception if the installer is used (while it requests the installer
styles), if the object cache isn't defined.

Follow up: I1ff61153ddb9

Bug: T113843
Change-Id: I1c1938b3fac395dda5b42dd68b675a67bdd30261
2015-09-27 00:54:39 +02:00
Reedy
ca4c290082 Re-enable MediaWiki.VariableAnalysis.UnusedGlobalVariables
Globals are used in included file, so ignore warning in this case

Change-Id: I50315425827cc49eac3ca943a5a8952d0292ce23
2015-09-26 15:51:52 +01:00
umherirrender
271da88127 Some bugzilla.wikimedia.org -> phabricator.wikimedia.org changes
Changed some old bugzilla links to new phabricator links in comments,
test data and error message. This reduces the need for redirects from
old bugzilla to new phabricator from our source code.

Change-Id: Id98278e26ce31656295a23f3cadb536859c4caa5
2015-09-24 17:17:25 +02:00
umherirrender
65827867de Fix typo: requiered -> required
Thanks to Ricordisamoa

Follow-Up: I095c545f77aa50d6be4cd48588bd1ae1c82cf343
Change-Id: I3c40b02865170ba0391f3637a5bebb6058c053fd
2015-07-28 19:21:58 +02:00
umherirrender
621521601a Updater: Avoid fatal on wfLoadSkin/wfLoadExtension
When having $wgExtensionDirectory or $wgStyleDirectory set to a
different location in LocalSettings.php, the load of LocalSettings.php
can give fatal, because the called functions wfLoadSkin and
wfLoadExtensions need at least this globals to be set correctly.

This does not bring the vector skin back to the updater, when having the
globals set, but it avoids a fatal about "MonoBook/skin.json does not
exist!" or similar.

Change-Id: I095c545f77aa50d6be4cd48588bd1ae1c82cf343
2015-07-27 21:04:36 +02:00
umherirrender
6b24d10b6d Fix some line indent of string concat
Change-Id: I5883c9cd57d106168648b4502051b4b49046fea2
2015-06-19 20:52:43 +02:00
jenkins-bot
5b74a93eff Merge "Do not support new installations via .php5 entrypoint any longer" 2015-06-12 20:49:56 +00:00
Kunal Mehta
f6e5079a69 Use mediawiki/at-ease library for suppressing warnings
wfSuppressWarnings() and wfRestoreWarnings() were split out into a
separate library. All usages in core were replaced with the new
functions, and the wf* global functions are marked as deprecated.

Additionally, some uses of @ were replaced due to composer's autoloader
being loaded even earlier.

Ie1234f8c12693408de9b94bf6f84480a90bd4f8e adds the library to
mediawiki/vendor.

Bug: T100923
Change-Id: I5c35079a0a656180852be0ae6b1262d40f6534c4
2015-06-11 18:49:29 +00:00
Chad Horohoe
785a8289d3 Do not support new installations via .php5 entrypoint any longer
Continues the path of deprecating $wgScriptExtension and all of
the related baggage.

You'll only end up with sadness when we rip out of the rest of
this later so don't let people shoot themselves in the foot.

Change-Id: I34cd1d2c266405ebc761a271e3740e972fb7cf2f
2015-06-02 08:38:57 -07:00
Timo Tijhof
f325d07b6c installer: Export wgResourceBasePath in LocalSettingsGenerator
wgRightsIcon uses wgResourceBasePath in its value, therefore it
must be exported first. Otherwise $wgResourceBasePath will still
be null (as from DefaultSettings.php) and cause an incorrect
value to be assigned.

Also fix $wgLogo to use wgResourceBasePath instead of wgScriptPath,
to match what Setup.php does already.

Bug: T75031
Change-Id: I6f18895f3caa50871327eec108fc7d70c1077f1e
2015-05-24 11:30:21 +02:00
jenkins-bot
9440d5228f Merge "installer: Read from extension.json if possible" 2015-04-07 16:14:35 +00:00
Kunal Mehta
e33a719823 installer: Read from extension.json if possible
We still have to keep in the hacky include code to support extensions
not using extension registration yet.

Bug: T94668
Change-Id: Ifedbf8026d46e376181e957725cd91d365295fcb
2015-04-01 22:51:38 -07:00
Kunal Mehta
7935bd4c80 installer: Use wfLoadExtension/Skin in LocalSettingsGenerator
Bug: T87791
Change-Id: I37cede7396d9677466ec68289702a3a73f1a1f8a
2015-04-01 00:16:17 -07:00
Kunal Mehta
13975fe76a Use wikimedia/utfnormal library, add backwards-compatability layer
This drops support for the custom utf8 normal PHP extension in favor
of the intl extension.

Bug: T90825
Change-Id: Ifbaeb2ef684217cf6187ccc4fb4d303f89608300
2015-03-24 12:59:26 -07:00
Chad Horohoe
c33f4de066 Profile all external HTTP requests from MW
Change-Id: Ie980b080da2ef21ec7d9fc32f1accc55710de140
2015-03-03 20:54:30 -08:00
Timo Tijhof
466c29847d installer: Remove unused references to wgResourceLoaderMaxQueryLength
* Added in 40e18e4534.
* Removed in 648bed9f83 (r87494).

The latter left the Installer::values array still populating this
variable eventhough it was no longer used in the generators output.

The example in overrides.php is also outdated as modifying this
variable there would have no effect.

Change-Id: I0c86e94a004c034702c5fcd83257c0f4c3d15a57
2015-02-28 17:31:19 +00:00
Steven Roddis
0ccbe8e8a9 installer: Use HTTPS links for licenses
Change-Id: I2c15602e4db2bffea71e46cbd2e48556dc1d829c
2015-02-05 12:55:06 +00:00
umherirrender
aa9e6597ca Add plural support for message config-no-db in the installer
The message config-no-db contains a comma separated list of items.
Adding the count of this list allows use of plural for better i18n.

Change-Id: I07ccbd3f664709d1a6234cb1e268ff8d7ddfabd9
2015-01-14 17:29:59 +01:00
Bartosz Dziewoński
8d2b933b01 installer: Don't generate $wgDefaultSkin='' when no skins are present during installation
The bug only affects people installing from Git, not tarball releases.

* Make sure getDefaultSkin() never returns null and just uses 'vector'
  when no skins are available (so the user just has to install it).
* Produce a hidden input field to pass the generated value to the next
  installer page.

Change-Id: I025f1aeb182a818de59a42df01591e01fc9e6236
2015-01-13 22:47:24 +00:00
Aaron Schulz
6921770414 Updated some try-catch statements: MWException -> Exception
Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
2015-01-09 17:20:22 -08:00
Chad Horohoe
5f8edb2c0a Drop ss_total_views and page_counter fields from MediaWiki
Follows up removal of code using hitcounters in 90d90dad6

RFC: https://www.mediawiki.org/wiki/Requests_for_comment/Removing_hit_counters_from_MediaWiki_core
Change-Id: Ieeb558f9523c11965cbc1941cad4f316c00c85c5
2015-01-09 19:01:01 +00:00
jenkins-bot
1d19ba04c3 Merge "Improve mod_security warning" 2014-09-22 17:38:55 +00:00
jenkins-bot
fea10ac2b4 Merge "Move default logo to resources/assets/ directory" 2014-09-21 05:23:53 +00:00
Bartosz Dziewoński
96b3dd0ae3 Move default logo to resources/assets/ directory
The problem here is that the path to 'wiki.png' is saved in users'
LocalSettings.

We likely should not remap the path, like we did for footer license
icons in Ic7c32e56:

* It's likely that users changed their logo image by overwriting the
  file in skins/common/.
* If the normal upgrade process is followed (overwrite-uploading new
  files), the old file will still be there with the skins/common/
  directory.
* If it does cause problems, they'll be rather easy to notice and fix.

On the other hand, maybe we should?

* This is going to be annoying for git users.
* It will bite anyone who deletes all MediaWiki files when upgrading
  via tarball, which is more likely with the recent skin system
  changes encouraging users to remove old cruft from skins/ directory.

Bug: 69277
Change-Id: I175fe57048ebf9d348fb2fe67bf62cf5df389003
2014-09-20 20:45:50 +00:00
Bartosz Dziewoński
bf1168b8cd Fix CSSJanus flipping in LESS mixins and remove broken custom LESS functions
Custom LESS functions are problematic for us for a number of reasons,
as outlined by Timo on bug 67368. We should get rid of them.

The only use case was implementing CSSMin data: URI embedding in LESS,
which used to be impossible due to lessc not preserving comments (bug
54673). However, thanks to new syntax added in f3779e06 we can insert
the annotations in such a way that the compiler won't mess with them.
The same technique is used in OOjs UI since 584ed144.

The LESS-function-based embedding implementation also meant that we
were unable to flip images for RTL (bug 66091 and friends: bug 66773,
bug 68326). The annotation one doesn't have this limitation.

Bug: 67368
Bug: 66091
Bug: 66773
Bug: 68326
Change-Id: I3062346ed63272a1c22b5df27b4cc1de2a699d9a
2014-09-20 20:28:22 +00:00
Jackmcbarn
e4dbcc3580 Improve mod_security warning
Make it detect mod_security2 as well, and make the warning message
scarier.

Bug: 39463
Change-Id: Ic8dbd8425299f60e9fc0b54ff1b9a9a991d24190
2014-09-20 11:29:05 -04:00
Bartosz Dziewoński
358a2347b2 Support for enabling skins in the command-line installer
Whoops, I kind of forgot that this exists. Follow-up to a957836f.

Bug: 70815
Change-Id: I6944fe1b1f7a8b77d32fafbca2349645320571f5
2014-09-18 17:33:23 +00:00