Commit graph

182 commits

Author SHA1 Message Date
Timo Tijhof
3a2a707546 Clean up remaining get_class() uses
* get_class()        -> __CLASS__ (same as self::class)
* get_called_class() -> static::class
* get_class($this)   -> static::class

Change-Id: I1888a1897ecf4548a2e5a67a942e5c080dd7e3d3
2017-03-07 22:03:47 +00:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
umherirrender
aa518a6d83 Use better styles for fake button in installer
The old style with visibilty:hidden does not let the enter button do the
submit in IE. The new style works in IE. Tested also with FF and Opera.

Change-Id: I7f86217c2905dabc6d222b3d7b896159b204db0a
2016-05-07 19:37:07 +02: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
Tim Hollmann
6d55397e7c Split the classes in WebInstallerPage.php into multiple files
Bug: T122634
Change-Id: If6606a0e1c2a5ec5651cc7f83cf7342ff8c6c765
2016-01-07 19:03:30 +00:00
saper
b3dc2fedc5 installer: Choose CACHE_ACCEL as the default if available
Bug: T49162
Change-Id: I57c8887c00cb3b73367e6733af1bf93dbab0c639
2015-12-28 15:23:00 -08:00
This, that and the other
da9696333a Installer: Validate password against sysop/bureaucrat policies
Previously, user-group-specific policies were not checked, because the
user hadn't been created yet, and so wasn't assigned to any groups. In his
overhaul of password policy, Chris wrote a function that was designed for
exactly this purpose (UserPasswordPolicy::checkUserPasswordForGroups) but
didn't put it into use.

Some changes to the error handling code are needed so the error messages
display correctly.

Bug: T115700
Change-Id: I1391c77c9667b646b29003bb0b2abcdc21d8c4d8
2015-10-29 23:24:40 +11: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
Ori Livneh
7628a11d8e Remove .php5 entrypoints and $wgScriptExtension
* The '.php5' entrypoints were deprecated in I68b1ae842, $wgScriptExtension
  in I3690f78bc.
* Drop the associated ResourceLoader configuration variable, too. `mwgrep`
  shows no usage in the MediaWiki namespace.
* Keep the scriptExtension configuration parameter for FileRepo for people who
  would like to interoperate with older MediaWiki installations that still use
  '.php5'.

Change-Id: I17c8a15484b7e82cd5970d34e688109a2aae3840
2015-10-08 15:45:31 +01:00
Ricordisamoa
7838fe300a Remove unused globals
* $wgLogExceptionBacktrace from MWExceptionHandler
  unused since 77a397125f

* $wgPasswordPolicy from WebInstallerName
  unused since 6a69a4eb73

Change-Id: Ibaac1bad05f4326a2602958a93d4d46135bdca63
2015-08-15 08:36:05 +00:00
Geoffrey Mon
1ba74a6213 Use XmlSelect in WebInstallerPage
Bug: T93234
Change-Id: Iba0067b4fac381e715e92d87c682261eef8d6669
2015-07-30 19:07:48 +00:00
csteipp
6a69a4eb73 Add "purpose" to password validity check
Allow callers to specify why they are checking a passwords validity, so
some checks can be modified. Only check the default policy on creation,
since the account doesn't exist it's not a member of any groups.

Bug: T104615
Change-Id: I56b66002562aaa1493d94a90309bc8e4ae3841c8
2015-07-14 20:04:23 +00:00
csteipp
66147c798a Check install user's password as sysop/bureaucrat
Refactor password checking a little to allow skipping the normal flow
in a special situation like this.

Bug: T104092
Change-Id: Ib4a4e1f34b6963a6414c6f88893884b0ec369ca5
2015-06-29 16:46:55 -07: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
Chad Horohoe
2fe90864c1 Installer: use proto-relative URLs for license picker
While encouraging HTTPS is nice, you pass styling to the CC picker
and when installing on a non-HTTPS host you end up with mixed
content warnings.

Bug: T100146
Change-Id: Iad706072b1b14b0ce2fb1c1597aae46e8ec15136
2015-05-24 11:55:23 +02:00
Steven Roddis
0ccbe8e8a9 installer: Use HTTPS links for licenses
Change-Id: I2c15602e4db2bffea71e46cbd2e48556dc1d829c
2015-02-05 12:55:06 +00: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
Timo Tijhof
27dd806c6c Omit 'window.' when accessing browsing location
The location object is a global, just like document.

Using it via 'window' needlessly adds complexity and, for example,
makes it harder to catch typos in static analysis.

Also standardise on location.href in place of the many different
variants, like:

 location =
 location.href =
 location.assign() =

And each with 'window', 'document' and without host object.

Change-Id: I77510294d8b5bd4b8a1b08e06817762a7839d43d
2014-11-19 00:13:51 +00:00
Bartosz Dziewoński
3e85dfb8ad Standardize indentation of multiline 'if'/'elseif' conditions
Always indent the continuation one level deeper, and always place the
closing parenthesis on the next line, per coding conventions.
https://www.mediawiki.org/wiki/Manual:Coding_conventions#Indenting_and_alignment
https://www.mediawiki.org/wiki/Manual:Coding_conventions#Line_continuation

Regexp used: (\t+)(if|while|\} elseif|foreach).+(?<![;}])\n\1\S

Also:
* Change to just one line if line length stays under 100 characters.
* Add "// Do nothing" comment in empty 'if' bodies.
* Change '#' comments to '//' comments near affected code.

Change-Id: I4f62658fddb5a0ed18bbf9b2231cd794683d6402
2014-11-17 15:33:34 +00:00
Amir E. Aharoni
5950ac2cef Set AdminEmail field in the installer to explicit ltr
Email addresses are usually left-to-right.

Change-Id: Iaf2320a17d62ad6c950cf83cc74b2cc020cbb9cb
2014-10-18 18:54:01 +00: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
Bartosz Dziewoński
a8e474c1f2 Move installer files from skins/common/ to mw-config/
The CSS and JS files are definitely used only by the installer.

As for the images:
* mediawiki.png is still used directly by some error pages
  (includes/PHPVersionError.php, includes/templates/NoLocalSettings.php)
* ajax-loader.gif is still used by shared.css
* bullet.gif is mysteriously used by *something*, according to the
  logs at bug 69277 comment 11; I currently have no idea what, so
  let's keep it here for a while
* All other ones don't grep (outside of the installer itself) and
  don't appear in the logs on bug 69277.

Bug: 69277
Change-Id: I9146d9211a807911a5e0cfaa1dd3ab8170f333ca
2014-08-17 22:32:25 +00:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +02:00
umherirrender
4ee680a8b3 Fixed spacing
- Removed spaces after not operator (!)
- Removed spaces inside array index
- use tab as indent instead of spaces
- Add newline at end of file
- Removed spaces after casts

Change-Id: I9ba17c4385fcb43d38998d45f89cf42952bc791b
2014-07-24 11:53:04 +02:00
Bartosz Dziewoński
a957836f4a Support for enabling skins in the installer
Let the user choose the skins to install (like extensions)
and decide which one will be the default for the new wiki.

Right now core skins are always enabled regardless of user
choices there, but I'm working on that.

Bug: 66440
Change-Id: I2e10720a6ac327e66c415bb91dc897885f952738
2014-07-20 19:54:39 +02:00
Bartosz Dziewoński
1e01fa96bb WebInstallerOptions: Don't ignore following options if an error is detected
Change-Id: I025db4624f653c4e52f84364b881c0eff485e069
2014-07-02 21:41:25 +02:00
Bartosz Dziewoński
d37b1770ab WebInstallerOptions: Preserve state of extension checkboxes on error
Change-Id: I7713f04653a96641896e997981656cfd582479cc
2014-07-02 21:39:42 +02:00
jenkins-bot
894b5da4df Merge "Remove underscore from classes WebInstaller_*" 2014-05-15 15:07:47 +00:00
jenkins-bot
0ff2c62197 Merge "Installer: properly override default $wgLogo value" 2014-05-15 13:21:21 +00:00
Siebrand Mazeland
5bc1cf4093 Remove underscore from classes WebInstaller_*
Part of program to remove underscores from class names. Checked core and
675 extensions for occurrences. All uses are in core in core are updated
in this patch. There are no uses in Gerrit extensions.

Change-Id: I6150c2d3f5a18496da5bcdcadc5d8982b70bec7a
2014-05-12 18:36:55 +02:00
Waldir Pimenta
7b176bef9d Rename variable _AdminPassword2 to _AdminPasswordConfirm for clarity
Change-Id: Ica04efb07014d0e7c91ae69c1a7ba5e00c0b16c2
2014-05-10 16:56:14 +02:00
Thiemo Mättig
6419dc7e26 WebInstaller inline documentation cleanup
This is a follow-up to Ide17d5af13c416c62a40029848ac17ba24eb5563.
However, I could not fix the "minor style" issue mentioned there
because this would make the line to long.

I fixed lots and lots of other issues instead, e.g.:

* "void" isn't a thing. Added "return null" instead.
* Removed documentation that said "a constructor is a constructor".
* Use "string[]" and such instead of "array" if possible.

Change-Id: I9658c2af58862f1d634cf1b2ba4c9d0f27ee7608
2014-04-08 12:22:43 +02:00
Thiemo Mättig
d0dbbc376c Replace in_array( array_keys( ... ) ) with array_key_exists( ... )
It's the same, right? in_array() must search for a value and therefor
is expensive. array_key_exists() searches for a key and should be
much cheaper. Also easier to read.

Change-Id: Ide17d5af13c416c62a40029848ac17ba24eb5563
2014-04-01 23:44:03 +02:00
Kevin Israel
b14a2dcfaa Installer: properly override default $wgLogo value
Setup.php uses the value of $wgScriptPath in $wgLogo before the
installer determines the former, so it is necessary to override
the latter even before the WebInstaller_Options page is shown
(because it might never be shown).

Bug: 48084
Change-Id: Icc577c1bb1f78adc7a7cfb0581ae8ea2facba4cf
2014-03-18 08:34:06 +09:00
shirayuki
964548c14e i18n: use "int:" for consistency
- {{int:config-mssql-windowsauth}}
- update comment for grep

Change-Id: Id4749ab3e0c9e6cc9f1af5877cffe614adce2b8d
2014-02-24 18:28:47 +09:00
jenkins-bot
c63e33d5cf Merge "Changed the password $valid check condition" 2014-02-07 16:44:55 +00:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
tonythomas01
f805ef74d0 Changed the password $valid check condition
$user will always be an object and User::getPasswordValidity will
always return either true, a string or a (non-empty) array
combined with AND (&&), this will always be true"
Removed message 'config-admin-password-same' as it was used nowhere.

Bug: 41392
Change-Id: Idc2cb80ca4541d1120e18aad3261aece7bd72122
2014-02-04 19:12:53 +05:30
Chad Horohoe
4d6dad7100 Remove vestiges of AdminSettings.php
This has been deprecated and mostly unused for quite some time.
Remove the few remaining uses that exist.

Change-Id: I522ef138d291cf7567250fef1de34bb41673bc6c
2014-01-29 15:09:33 -08:00
MaxSem
0998c41943 Revert "Include short descriptions for extensions bundled in the release"
Contains var_dump(), self-merged non-trivial code.

This reverts commit 96b2c66e24.

Change-Id: Ie630466ef50e6bcdabf01daff28c283c764aae35
2014-01-12 23:59:44 +00:00
Mark A. Hershberger
96b2c66e24 Include short descriptions for extensions bundled in the release
Also fix styling for the list of extensions.

Bug: 43817
Change-Id: I5335225683ec8f1c163bb67f478787ebc52ee3a9
2014-01-12 18:21:55 -05:00
umherirrender
28144261f0 Call Installer::getDBTypes() static
Change-Id: Ie819c7c6be39c4beab0fca30216632b3e87178a8
2014-01-11 23:57:47 +01:00
Kevin Israel
0eab1ace67 WebInstaller: Don't call getSoftwareLink()
This gets the web installer working without the mysql or mysqli
PHP extension, which is not needed for other database systems.

* Avoid "lego" construction: put link text directly in the messages,
  which because the messages are parsed as wikitext, is easy to do.
* Put URLs in separate, ignored messages to avoid duplication in
  Database*::getSoftwareLink().
* Because I had to touch a MySQL-related i18n message, I figured
  this would be a good time to address bug 28281 (regarding MySQL
  forks and Special:Version).
* Other miscellaneous message changes, such as recommending the
  mysqli PHP extension over the old, deprecated mysql extension.

Bug: 28281
Bug: 58167
Change-Id: I6dbc9d32c8c2d8f233a67d574229b80444885aea
2014-01-10 03:38:44 -05:00
Siebrand Mazeland
38c728b896 Update documentation for WebInstaller_DBConnect::execute()
Change-Id: I7f700daf8c1dbf0903159a1b750612b09f0e8e25
2013-12-27 17:05:36 +00:00
Siebrand Mazeland
00ba1c542e Add close elements through code
Change-Id: I517221ebcc062477f315c6716e74056c754988a0
2013-11-07 17:30:36 +00:00
Siebrand Mazeland
bb0044f638 Address PHP CodeSniffer errors and warnings
One class of errors left unaddressed: Class name "WebInstaller_Language"
is not in camel caps format. I think this can be changed, too, but I
wasn't able to quickly find out where class names are being created.

Change-Id: I920b0231db1b70b68c6c8907257c288a0e112668
2013-10-23 12:42:07 +00:00
Siebrand Mazeland
626addab9e Update formatting
With some manual corrections.

Change-Id: Icd947288c32fdb90a0f35388963ef5a17ffa58e7
2013-10-09 09:35:18 +00:00
Timo Tijhof
90749a261c doc: Remove repetitive "Give grep a chance" phrase from comments
* Follows-up b2e2b2e016.
* Minor clean up of surrounding documentation comments.
* Fixed missing keys for messages in WebInstallerPage

Change-Id: Iaa692064262f3c0e10cfa5e4b1ec8c86e5d02362
2013-08-29 10:46:46 -07:00
shirayuki
b2e2b2e016 Give grep a chance to find the usages
Change-Id: I18846326539b814fa7fa93ca54117dac3572e4b0
2013-08-16 22:07:38 +09:00
MarkAHershberger
ebabe9fa35 Merge "Installer: page refresh should refresh list of supported DBs" 2013-07-29 22:30:37 +00:00