The basic usage of this compatibility layer appears to work well:
A CSS file can be compiled from the default style, without needing any
additional adjustments.
What this compatibility layer cannot do is rewrite the Exceptions that
are thrown by scssphp/scssphp. A strict catch block catching a specific
Exception, such as `\Leafo\ScssPhp\Exception\ParserException` will not
match the aliased `ScssPhp\ScssPhp\Exception\ParserException`.
Resolves #3398
// set autoload function
spl_autoload_register([WCF::class, 'autoload']);
+ spl_autoload_register(function ($className) {
+ /**
+ * @deprecated 5.3 This file is a compatibility layer mapping from Leafo\\ to ScssPhp\\
+ */
+ $leafo = 'Leafo\\';
+ if (substr($className, 0, strlen($leafo)) === $leafo) {
+ class_alias('ScssPhp\\'.substr($className, strlen($leafo)), $className, true);
+ }
+ });
+
/**
* Escapes a string for use in sql query.
*
<?php
-require(WCF_DIR.'lib/system/api/leafo/scssphp/scss.inc.php');
+/**
+ * @deprecated 5.3 The SCSS compiler is a composer package as of 5.2.
+ */
+require(WCF_DIR.'lib/system/api/scssphp/scssphp/scss.inc.php');