Commit graph

31 commits

Author SHA1 Message Date
umherirrender
04bef3dd66 phpcs: Use __DIR__ constant instead of calling
Replaced all dirname(__FILE__) by __DIR__ or added
@codingStandardsIgnore

Found by tests:
https://integration.wikimedia.org/ci/job/mediawiki-core-phpcs/2736/consoleFull

Change-Id: I90ff10f183ed60175fe580c43d73c0e57fd04234
2015-11-15 21:14:42 +01: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
Kevin Israel
975b4d0c34 Web installer: Fix collapsing of field help text
Follows-up 1e06a9f02f.

Bug: T112383
Change-Id: I23030f48ce89abc460ac9e7ed3c148893ffb24ef
2015-09-26 19:56:38 -04:00
Bartosz Dziewoński
1095e8d18c Add missing images used in installer's CSS
Copied from resources/src/mediawiki.legacy/images.
Follow-up to 1e06a9f02f.

Bug: T111519
Change-Id: Idb7f02ee62eb535af3c2dbbaed53dabe04ae4e9e
2015-09-12 19:54:00 +02:00
James D. Forrester
42fe11a2e6 build: Enable jscs rule 'requireSpacesInsideParentheses' and make pass
Change-Id: Ie88c89344e54657f007e5101472e667be5408319
2015-09-03 21:35:22 +00:00
Ori Livneh
1e06a9f02f mediawiki.legacy.config: use own help-field styling
Instead of using .mw-help-field-container from mediawiki.legacy to style help
tooltips, use a class that is specific to the WebInstaller and which is styled
in its stylesheet. This allows us to stop embedding it in mediawiki.legacy
(which is loaded on every page).

The CSS is copied directly from the styles for mw-help-field-container et al.
in mediawiki.legacy.

Change-Id: I8e092e9d2c91b5f70499d93c1134f43f2e96348c
2015-08-14 21:28:37 -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
aude
9880d5b60b Check for dependencies in entry point and Maintenance.php
This way, if someone tries to install MediaWiki via
either web installer or install.php maintenance script,
after obtaining from git, they get some useful information
on what to do.

Put the checks alongside the php version check, as
stuff installed via composer (mustache / lightncandy)
is used for NoLocalSettings.php and install.php
attempts to use logging stuff.

Also tried to make PHPVersionError look slightly nicer,
with some <h2> elements and more padding for the <p>
elements.

and centralized this code in one place, as much as possible,
for improved ease of maintenance.

Bug: T90438
Bug: T88951
Change-Id: Iae4eb42c4266dbe9213c5de8a96fccfbeaa9acb0
2015-05-23 15:05:11 +00: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
Kunal Mehta
0e17070d40 Require PHP >= 5.3.3
Bug: T839
Change-Id: Iac827ef8505ff0653a40e45d759b0f79619351ee
2014-10-30 10:10:52 -07:00
jenkins-bot
959aaf4a43 Merge "Use a custom MediaWiki logo during installation" 2014-09-03 22:52:05 +00:00
Timo Tijhof
c718183466 Use String#slice instead of String#substr or String#substring
Quite a few reasons:

* There is a bug in IE 8 and below where the startIndex argument
  does not support negative values, contrary to the ECMAScript
  spec and implementations in other browsers.
  IE8:
    'faux'.substr( -1 ); // "faux"
  Standards:
    'faux'.substr( -1 ); // "x"

  Code written for ES5 (and using the es5-shim) works as expected
  since the shim repairs this method.

* String#substr and String#substring both exist but have
  different signatures which are easily mixed up.

  String.prototype.substr( start [, length] )
  > Supports negative start, but not in IE8 and below.
  > Takes length, *not* second index. E.g. `substr( 2, 3 )`
    returns `slice( 2, 5 )`.

  String.prototype.substring( indexA [, indexB] )
  > Doesn't support negative indices.
  > If indexA is larger than indexB, they are silently swapped!

  String.prototype.slice( start [, end] )
  > Supports negative indices.

    'faux'.substr( 0, 2 );     // "fa"
    'faux'.substring( 0, 2 );  // "fa"
    'faux'.slice( 0, 2 );      // "fa"

    'faux'.substr( -2 );       // "ux"
    'faux'.substring( -2 );    // "faux"
    'faux'.slice( -2 );        // "ux"

    'faux'.substr( 1, 2 );     // "au"
    'faux'.substring( 1, 2 );  // "a"
    'faux'.slice( 1, 2 );      // "a"

    'faux'.substr( 1, -1 );    // ""
    'faux'.substring( 1, -1 ); // "f"
    'faux'.slice( 1, -1 );     // "au"

    'faux'.substr( 2, 1 );     // "u"
    'faux'.substring( 2, 1 );  // "a"
    'faux'.slice( 2, 1 );      // ""

* String#slice works the same way as Array#slice and slice
  methods elsewhere (jQuery, PHP, ..).

* Also simplify calls:
  - Omit second argument where it explicitly calculated the length
    and passed it as is (default behaviour)
  - Pass negative values instead of length - x.
  - Use chatAt to extract a single character.

* Change:
  - Replace all uses of substring() with slice().
  - Replace all uses of substr() with slice() where only one
    parameter is passed or where the first parameter is 0.
  - Using substr()'s unique behaviour (length instead of endIndex)
    is fine, though there's only one instances of that, in
    mediawiki.jqueryMsg.js

Change-Id: I9b6dd682a64fa28c7ea0da1846ccd3b42f9430cf
2014-09-03 21:33:06 +00:00
Bartosz Dziewoński
bae9058d8c Use a custom MediaWiki logo during installation
Previously we used the regular logo, which could prove confusing when
one switched back-and-forth between the installed and mediawiki.org
pages.

The new one is "half-drawn", evoking the image that we are in the
process of creating something (a new wiki). I like that.

Source: <https://commons.wikimedia.org/wiki/File:Wikitech-logo.png>,
authored by Brion, GFDL 1.2+. It was previously used as a logo of the
Wikitech wiki, but that has unicorns instead now.

Change-Id: Ic5c83bb85e6b6a11978d452fbe46d2dad9c5a553
2014-09-03 17:34:11 +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
2b021dc48a Fixed spacing
- Added/removed spaces around parenthesis
- Added space after switch/if/foreach
- changed else if to elseif

Change-Id: I99cda543e0e077320091addd75c188cb6e3a42c2
2014-07-19 23:12:10 +02:00
Chad Horohoe
a4334bbef5 Use PHP_VERSION constant instead of phpversion() function call
Change-Id: Ifb3d1bd92d6abaa561e7337b311b4cb10c38a2b6
2014-07-09 16:46:35 -07:00
Sergio Santoro
c2040515ef Web installer: check for low PHP versions before executing
Web installer was not checking for unsupported PHP versions.
In those cases the script should terminate or the
installation will break (e.g. syntax errors for PHP4).

Installer::doEnvironmentChecks() no longer checks for PHP
version since it has already been done by the entry scripts
(both in cli and web modes)

Installer::MINIMUM_PHP_VERSION has been removed since it is
no longer used.

Message config-env-php-toolow is no longer used and it has
been removed

Change-Id: I9227868bd2bd4e13bad6b95ad581be3ada71c94e
2014-07-08 10:19:02 +02:00
Sergio Santoro
debe7cf7e6 installer: Remove unnecessary param to outputCss()
WebInstaller::outputCss no longer requires an argument
as of I717cb299b3639024.

Change-Id: I85c1624eb99affd5df809a041cfc9f22fc46945a
2014-06-28 21:12:49 +00:00
Sergio Santoro
1e9064483d Installer: output css correctly when session errors occur
CSS was not showing correctly when session errors occurred.
This was caused because mw-config/index.php was not taking
into account the "css" parameter passed in the URL.

Change-Id: I500c7340ab6826d428e9e3be28bcfc7ca5ed8466
2014-05-04 12:43:28 +02:00
Siebrand Mazeland
de37be7716 Pass phpcs-strict on mw-config/
Change-Id: I80e5c26f4d11cfb9b702382859587438406e729c
2014-04-23 13:48:06 +02:00
Waldir Pimenta
86a9b8c06c Clean up access points
* Harmonize spacing
* Use // for comments rather than #
* Harmonize call style for 'require', 'include' etc.
* Add missing profileinfo.php5
* Use "./" for path to api.php in api.php5 (to match other php5 files).
* Move documentation related to Setup.php from index.php to WebStart.php
* Remove "Initialise common code." comment in api.php (was already remove
  in most entry points)

Change-Id: I8dc4a79fd13cee49e34f250a4039b3666bd42aca
2014-03-28 01:05:30 +00:00
Timo Tijhof
beb1c4a0ec phpcs: More require/include is not a function
Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81.

Also updated usage in text in documentation and the
installer LocalSettingsGenerator.

Most of them were handled by this regex:
- find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$
- replace: $1 $2;

Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
2013-05-21 23:26:28 +02:00
Tim Starling
1fe9340bb3 Remove hphpc support and deprecate related functions
hphpc has been superseded by hhvm, so support for hphpc is no longer
needed.

* Continue to use Preprocessor_Hash under HipHop since it is still
  faster under hhvm
* Keep $wgCompiledFiles for now, so that wikihiero doesn't give an error
  before Ic9d1e795 is merged
* Migrate the run-server script and associated configuration file to
  hhvm. Enable EnableStaticContentFromDisk since it doesn't seem
  ridiculously inefficient at first glance. Run from $IP rather than
  $IP/.. since hhvm is apparently not picky about sourcing files from
  outside of the current directory.

Change-Id: Ic3e769f1fbad4f7ad26dd819406796fee48c6b45
2013-05-09 08:28:05 +10:00
Yuri Astrakhan
27d83878c0 Lots of spelling mistakes and phpdoc attributes
@throw->@throws
@returns->@return
@seealso->@see
@cover->@covers
etc

Change-Id: I9ae6bc3034e9790e2d66cd96473b923fe9ee7953
2013-03-10 23:16:28 -04:00
Alexandre Emsenhuber
01f11f8e98 Improve documentation of maintenance scripts and test suite.
Change-Id: If5d695dc3665635fbed73a713583c0b03c14ebb1
2012-10-02 22:24:33 +02:00
jeroendedauw
38c7f444e1 Use __DIR__ instead of dirname( __FILE__ )
We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :)

Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
2012-08-27 21:45:00 +02:00
Max Semenik
63fb18bd4e Add a way for packagers to override some installation details
...after a discussion with Debian packagers. They can now override installer
classes and change LocalSettings.php the installer generates. The file
intended for such overrides, mw-config/overrides.php, has intentionally been
placed outside of includes to underline the "don't change includes" paradigm.

Change-Id: Id82b90f6740307609bc6c6f4fb8765bc3484dbe7
2012-06-12 20:18:44 +04:00
Platonides
9951f9f9ae trunk/phase3 is now mediawiki/core
Change-Id: Ief2721ee6573a5e54a276c91de636d9e1a678b8b
2012-03-23 17:19:22 +01:00
John Du Hart
2ee37f2267 Bug 28296 - Installer should honor &uselang= parameter 2011-11-21 15:30:20 +00:00
Tim Starling
ff1dc8a175 HipHop improvements:
* Added the ability to compile extensions. The build process is bootstrapped by running MediaWiki in interpreted mode. Extension setup file inclusions are slightly modified in a way that makes them register themselves for compilation. Then the same LocalSettings.php uses the compiled extension setup file when the compiled binary runs.
* Tested with Cite and ParserFunctions. The code which lets you have an extensions directory in a place other than $IP/../extensions is untested.
* Simplified WebStart.php slightly by using a custom $_SERVER variable to mark compiled mode. It will break if you don't use the supplied server.conf, but that will break a lot of things so don't do that.
* Fixed the core web entry points to include WebStart.php in compiled mode instead of interpreted.
* Made the build directory configurable. This is mostly so that I can grep the source tree without seeing loads of generated C++.
* In server.conf, added a rewrite rule allowing a /wiki/$1 article path.
* Removed server.conf log file location "/dev/stdout", breaks when you switch user
* Disable static content cache, breaks horribly when you set SourceRoot to a directory containing 7GB of files.
* Rewrote the run-server script in PHP, mostly to support the configurable build directory feature.
* Added an option to the run-server script to allow running in interpreted (hphpi) mode.
2011-05-30 13:49:09 +00:00
Max Semenik
1fdaf8db17 (bug 1379) Installer directory conflicts with some hosts' configuration panel.
Renamed config/ to mw-config/, however left aliases for b/c.
2011-02-26 12:35:23 +00:00