PleaseStand has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/89610


Change subject: Installer: Run the LESS compiler for screen.less
......................................................................

Installer: Run the LESS compiler for screen.less

Bug: 55589
Change-Id: Iab78a60209ab46a10d4c492c75527e717f36f803
---
M includes/installer/WebInstallerOutput.php
1 file changed, 21 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/10/89610/1

diff --git a/includes/installer/WebInstallerOutput.php 
b/includes/installer/WebInstallerOutput.php
index 1df8f05..e12115f 100644
--- a/includes/installer/WebInstallerOutput.php
+++ b/includes/installer/WebInstallerOutput.php
@@ -122,7 +122,7 @@
                        'common/commonElements.css',
                        'common/commonContent.css',
                        'common/commonInterface.css',
-                       'vector/screen.css',
+                       'vector/screen.less',
 
                        // mw-config specific
                        'common/config.css',
@@ -133,7 +133,26 @@
                wfSuppressWarnings();
                foreach ( $cssFileNames as $cssFileName ) {
                        $fullCssFileName = "$skinDir/$cssFileName";
-                       $cssFileContents = file_get_contents( $fullCssFileName 
);
+
+                       // Run the LESS compiler for screen.less (bug 55589)
+                       if ( preg_match( '/\.less$/', $cssFileName ) ) {
+                               if ( function_exists( 'ctype_digit' ) ) {
+                                       try {
+                                               $compiler = 
ResourceLoader::getLessCompiler();
+                                               $cssFileContents = 
$compiler->compileFile( $fullCssFileName );
+                                       } catch ( Exception $e ) {
+                                               $cssFileContents = false;
+                                       }
+                               } else {
+                                       // Ctype extension is missing; don't 
try using lessc. It would cause a
+                                       // fatal error that would prevent even 
config.css from loading.
+                                       $cssFileContents = false;
+                               }
+                       } else {
+                               // Not a LESS file, don't compile it
+                               $cssFileContents = file_get_contents( 
$fullCssFileName );
+                       }
+
                        if ( $cssFileContents ) {
                                preg_match( "/^(\w+)\//", $cssFileName, $match 
);
                                $skinName = $match[1];

-- 
To view, visit https://gerrit.wikimedia.org/r/89610
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iab78a60209ab46a10d4c492c75527e717f36f803
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: PleaseStand <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to