Requires **Grav 1.7.4** (SemVer library moved to Grav)

This commit is contained in:
Matias Griese
2021-01-29 10:11:20 +02:00
parent 5de805e340
commit 3fd1c7ab6a
33 changed files with 1540 additions and 2164 deletions

View File

@@ -1,7 +1,8 @@
# v1.10.3 # v1.10.3
## mm/dd/2021 ## mm/dd/2021
2. [](#bugfix) 1. [](#new)
* Requires **Grav 1.7.4** (SemVer library moved to Grav)
* Added back special fonts (including Gantry) * Added back special fonts (including Gantry)
# v1.10.2 # v1.10.2

View File

@@ -15,7 +15,7 @@ docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md
license: MIT license: MIT
dependencies: dependencies:
- { name: grav, version: '>=1.7.0' } - { name: grav, version: '>=1.7.4' }
- { name: form, version: '>=4.1.0' } - { name: form, version: '>=4.1.0' }
- { name: login, version: '>=3.3.5' } - { name: login, version: '>=3.3.5' }
- { name: email, version: '>=3.0.9' } - { name: email, version: '>=3.0.9' }

View File

@@ -22,7 +22,6 @@
"require": { "require": {
"php": "^7.3.6 || ^8.0", "php": "^7.3.6 || ^8.0",
"ext-json": "*", "ext-json": "*",
"composer/semver": "^1.4",
"p3k/picofeed": "@stable", "p3k/picofeed": "@stable",
"scssphp/scssphp": "^1.4" "scssphp/scssphp": "^1.4"
}, },
@@ -34,6 +33,10 @@
"symfony/finder": "~4.4", "symfony/finder": "~4.4",
"symfony/event-dispatcher": "~4.4" "symfony/event-dispatcher": "~4.4"
}, },
"replace": {
"symfony/polyfill-php72": "*",
"symfony/polyfill-php73": "*"
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Grav\\Plugin\\Admin\\": "classes/plugin" "Grav\\Plugin\\Admin\\": "classes/plugin"

933
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -37,8 +37,8 @@ namespace Composer\Autoload;
* *
* @author Fabien Potencier <fabien@symfony.com> * @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be> * @author Jordi Boggiano <j.boggiano@seld.be>
* @see http://www.php-fig.org/psr/psr-0/ * @see https://www.php-fig.org/psr/psr-0/
* @see http://www.php-fig.org/psr/psr-4/ * @see https://www.php-fig.org/psr/psr-4/
*/ */
class ClassLoader class ClassLoader
{ {
@@ -60,7 +60,7 @@ class ClassLoader
public function getPrefixes() public function getPrefixes()
{ {
if (!empty($this->prefixesPsr0)) { if (!empty($this->prefixesPsr0)) {
return call_user_func_array('array_merge', $this->prefixesPsr0); return call_user_func_array('array_merge', array_values($this->prefixesPsr0));
} }
return array(); return array();
@@ -279,7 +279,7 @@ class ClassLoader
*/ */
public function setApcuPrefix($apcuPrefix) public function setApcuPrefix($apcuPrefix)
{ {
$this->apcuPrefix = function_exists('apcu_fetch') && ini_get('apc.enabled') ? $apcuPrefix : null; $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null;
} }
/** /**
@@ -377,7 +377,7 @@ class ClassLoader
$subPath = $class; $subPath = $class;
while (false !== $lastPos = strrpos($subPath, '\\')) { while (false !== $lastPos = strrpos($subPath, '\\')) {
$subPath = substr($subPath, 0, $lastPos); $subPath = substr($subPath, 0, $lastPos);
$search = $subPath.'\\'; $search = $subPath . '\\';
if (isset($this->prefixDirsPsr4[$search])) { if (isset($this->prefixDirsPsr4[$search])) {
$pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1);
foreach ($this->prefixDirsPsr4[$search] as $dir) { foreach ($this->prefixDirsPsr4[$search] as $dir) {

283
vendor/composer/InstalledVersions.php vendored Normal file
View File

@@ -0,0 +1,283 @@
<?php
namespace Composer;
use Composer\Semver\VersionParser;
class InstalledVersions
{
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => '5de805e3409611ee484267d47022e3ad93a9c2f0',
'name' => 'getgrav/grav-plugin-admin',
),
'versions' =>
array (
'getgrav/grav-plugin-admin' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => '5de805e3409611ee484267d47022e3ad93a9c2f0',
),
'laminas/laminas-xml' =>
array (
'pretty_version' => '1.3.0',
'version' => '1.3.0.0',
'aliases' =>
array (
),
'reference' => '844dc64557b1ad8a2e0eadb741510ba992674f99',
),
'laminas/laminas-zendframework-bridge' =>
array (
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
'aliases' =>
array (
),
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
),
'miniflux/picofeed' =>
array (
'replaced' =>
array (
0 => '0.1.35',
),
),
'p3k/picofeed' =>
array (
'pretty_version' => 'v0.1.40',
'version' => '0.1.40.0',
'aliases' =>
array (
),
'reference' => '356fd66d48779193b10ac28532cb4a4e11bb801c',
),
'scssphp/scssphp' =>
array (
'pretty_version' => 'v1.4.1',
'version' => '1.4.1.0',
'aliases' =>
array (
),
'reference' => 'ba86c963b94ec7ebd6e19d90cdab90d89667dbf7',
),
'symfony/polyfill-php72' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'symfony/polyfill-php73' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'zendframework/zendxml' =>
array (
'replaced' =>
array (
0 => '^1.2.0',
),
),
),
);
public static function getInstalledPackages()
{
return array_keys(self::$installed['versions']);
}
public static function isInstalled($packageName)
{
return isset(self::$installed['versions'][$packageName]);
}
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
public static function getVersionRanges($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
$ranges = array();
if (isset(self::$installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = self::$installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', self::$installed['versions'][$packageName])) {
$ranges = array_merge($ranges, self::$installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
public static function getVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['version'])) {
return null;
}
return self::$installed['versions'][$packageName]['version'];
}
public static function getPrettyVersion($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return self::$installed['versions'][$packageName]['pretty_version'];
}
public static function getReference($packageName)
{
if (!isset(self::$installed['versions'][$packageName])) {
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
if (!isset(self::$installed['versions'][$packageName]['reference'])) {
return null;
}
return self::$installed['versions'][$packageName]['reference'];
}
public static function getRootPackage()
{
return self::$installed['root'];
}
public static function getRawData()
{
return self::$installed;
}
public static function reload($data)
{
self::$installed = $data;
}
}

View File

@@ -6,5 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir); $baseDir = dirname($vendorDir);
return array( return array(
'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php',
'Grav\\Plugin\\AdminPlugin' => $baseDir . '/admin.php', 'Grav\\Plugin\\AdminPlugin' => $baseDir . '/admin.php',
); );

View File

@@ -10,5 +10,4 @@ return array(
'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'), 'Laminas\\ZendFrameworkBridge\\' => array($vendorDir . '/laminas/laminas-zendframework-bridge/src'),
'Laminas\\Xml\\' => array($vendorDir . '/laminas/laminas-xml/src'), 'Laminas\\Xml\\' => array($vendorDir . '/laminas/laminas-xml/src'),
'Grav\\Plugin\\Admin\\' => array($baseDir . '/classes/plugin'), 'Grav\\Plugin\\Admin\\' => array($baseDir . '/classes/plugin'),
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
); );

View File

@@ -13,19 +13,24 @@ class ComposerAutoloaderInit14b786715d80b97050af9c30f5c07b7c
} }
} }
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader() public static function getLoader()
{ {
if (null !== self::$loader) { if (null !== self::$loader) {
return self::$loader; return self::$loader;
} }
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit14b786715d80b97050af9c30f5c07b7c', 'loadClassLoader'), true, true); spl_autoload_register(array('ComposerAutoloaderInit14b786715d80b97050af9c30f5c07b7c', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(); self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit14b786715d80b97050af9c30f5c07b7c', 'loadClassLoader')); spl_autoload_unregister(array('ComposerAutoloaderInit14b786715d80b97050af9c30f5c07b7c', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) { if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php'; require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit14b786715d80b97050af9c30f5c07b7c::getInitializer($loader)); call_user_func(\Composer\Autoload\ComposerStaticInit14b786715d80b97050af9c30f5c07b7c::getInitializer($loader));
} else { } else {

View File

@@ -24,10 +24,6 @@ class ComposerStaticInit14b786715d80b97050af9c30f5c07b7c
array ( array (
'Grav\\Plugin\\Admin\\' => 18, 'Grav\\Plugin\\Admin\\' => 18,
), ),
'C' =>
array (
'Composer\\Semver\\' => 16,
),
); );
public static $prefixDirsPsr4 = array ( public static $prefixDirsPsr4 = array (
@@ -47,10 +43,6 @@ class ComposerStaticInit14b786715d80b97050af9c30f5c07b7c
array ( array (
0 => __DIR__ . '/../..' . '/classes/plugin', 0 => __DIR__ . '/../..' . '/classes/plugin',
), ),
'Composer\\Semver\\' =>
array (
0 => __DIR__ . '/..' . '/composer/semver/src',
),
); );
public static $prefixesPsr0 = array ( public static $prefixesPsr0 = array (
@@ -64,6 +56,7 @@ class ComposerStaticInit14b786715d80b97050af9c30f5c07b7c
); );
public static $classMap = array ( public static $classMap = array (
'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php',
'Grav\\Plugin\\AdminPlugin' => __DIR__ . '/../..' . '/admin.php', 'Grav\\Plugin\\AdminPlugin' => __DIR__ . '/../..' . '/admin.php',
); );

View File

@@ -1,285 +1,263 @@
[ {
{ "packages": [
"name": "composer/semver", {
"version": "1.7.1", "name": "laminas/laminas-xml",
"version_normalized": "1.7.1.0", "version": "1.3.0",
"source": { "version_normalized": "1.3.0.0",
"type": "git", "source": {
"url": "https://github.com/composer/semver.git", "type": "git",
"reference": "38276325bd896f90dfcfe30029aa5db40df387a7" "url": "https://github.com/laminas/laminas-xml.git",
}, "reference": "844dc64557b1ad8a2e0eadb741510ba992674f99"
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/composer/semver/zipball/38276325bd896f90dfcfe30029aa5db40df387a7",
"reference": "38276325bd896f90dfcfe30029aa5db40df387a7",
"shasum": ""
},
"require": {
"php": "^5.3.2 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.0.5"
},
"time": "2020-09-27T13:13:07+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
}, },
{ "dist": {
"name": "Jordi Boggiano", "type": "zip",
"email": "j.boggiano@seld.be", "url": "https://api.github.com/repos/laminas/laminas-xml/zipball/844dc64557b1ad8a2e0eadb741510ba992674f99",
"homepage": "http://seld.be" "reference": "844dc64557b1ad8a2e0eadb741510ba992674f99",
"shasum": ""
}, },
{ "require": {
"name": "Rob Bast", "laminas/laminas-zendframework-bridge": "^1.0",
"email": "rob.bast@gmail.com", "php": "^7.3 || ~8.0.0"
"homepage": "http://robbast.nl" },
} "replace": {
], "zendframework/zendxml": "^1.2.0"
"description": "Semver library that offers utilities, version constraint parsing and validation.", },
"keywords": [ "require-dev": {
"semantic", "ext-iconv": "*",
"semver", "laminas/laminas-coding-standard": "~1.0.0",
"validation", "phpunit/phpunit": "^9.4"
"versioning" },
] "time": "2020-11-18T20:46:37+00:00",
}, "type": "library",
{ "installation-source": "dist",
"name": "laminas/laminas-xml", "autoload": {
"version": "1.3.0", "psr-4": {
"version_normalized": "1.3.0.0", "Laminas\\Xml\\": "src/"
"source": { }
"type": "git", },
"url": "https://github.com/laminas/laminas-xml.git", "notification-url": "https://packagist.org/downloads/",
"reference": "844dc64557b1ad8a2e0eadb741510ba992674f99" "license": [
}, "BSD-3-Clause"
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-xml/zipball/844dc64557b1ad8a2e0eadb741510ba992674f99",
"reference": "844dc64557b1ad8a2e0eadb741510ba992674f99",
"shasum": ""
},
"require": {
"laminas/laminas-zendframework-bridge": "^1.0",
"php": "^7.3 || ~8.0.0"
},
"replace": {
"zendframework/zendxml": "^1.2.0"
},
"require-dev": {
"ext-iconv": "*",
"laminas/laminas-coding-standard": "~1.0.0",
"phpunit/phpunit": "^9.4"
},
"time": "2020-11-18T20:46:37+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"Laminas\\Xml\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Utility library for XML usage, best practices, and security in PHP",
"homepage": "https://laminas.dev",
"keywords": [
"laminas",
"security",
"xml"
]
},
{
"name": "laminas/laminas-zendframework-bridge",
"version": "1.1.1",
"version_normalized": "1.1.1.0",
"source": {
"type": "git",
"url": "https://github.com/laminas/laminas-zendframework-bridge.git",
"reference": "6ede70583e101030bcace4dcddd648f760ddf642"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642",
"reference": "6ede70583e101030bcace4dcddd648f760ddf642",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2020-09-14T14:23:00+00:00",
"type": "library",
"extra": {
"laminas": {
"module": "Laminas\\ZendFrameworkBridge"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"src/autoload.php"
], ],
"psr-4": { "description": "Utility library for XML usage, best practices, and security in PHP",
"Laminas\\ZendFrameworkBridge\\": "src//" "homepage": "https://laminas.dev",
} "keywords": [
}, "laminas",
"notification-url": "https://packagist.org/downloads/", "security",
"license": [ "xml"
"BSD-3-Clause" ],
], "support": {
"description": "Alias legacy ZF class names to Laminas Project equivalents.", "chat": "https://laminas.dev/chat",
"keywords": [ "forum": "https://discourse.laminas.dev",
"ZendFramework", "issues": "https://github.com/laminas/laminas-xml/issues",
"autoloading", "rss": "https://github.com/laminas/laminas-xml/releases.atom",
"laminas", "source": "https://github.com/laminas/laminas-xml"
"zf"
]
},
{
"name": "p3k/picofeed",
"version": "v0.1.40",
"version_normalized": "0.1.40.0",
"source": {
"type": "git",
"url": "https://github.com/aaronpk/picofeed.git",
"reference": "356fd66d48779193b10ac28532cb4a4e11bb801c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aaronpk/picofeed/zipball/356fd66d48779193b10ac28532cb4a4e11bb801c",
"reference": "356fd66d48779193b10ac28532cb4a4e11bb801c",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"laminas/laminas-xml": "^1.2",
"php": ">=5.3.0"
},
"replace": {
"miniflux/picofeed": "0.1.35"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "2.0.4",
"phpunit/phpunit": "4.8.26",
"symfony/yaml": "2.8.7"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2020-04-25T17:48:36+00:00",
"bin": [
"picofeed"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frédéric Guillot"
}
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/aaronpk/picoFeed"
},
{
"name": "scssphp/scssphp",
"version": "v1.4.0",
"version_normalized": "1.4.0.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
"reference": "f7c9088320e218ca42e4ef0074259a1ba24ec93a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/f7c9088320e218ca42e4ef0074259a1ba24ec93a",
"reference": "f7c9088320e218ca42e4ef0074259a1ba24ec93a",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-json": "*",
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4",
"sass/sass-spec": "2020.10.29",
"squizlabs/php_codesniffer": "~3.5",
"symfony/phpunit-bridge": "^5.1",
"twbs/bootstrap": "~4.3",
"zurb/foundation": "~6.5"
},
"time": "2020-11-07T20:53:41+00:00",
"bin": [
"bin/pscss"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"ScssPhp\\ScssPhp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthon Pang",
"email": "apang@softwaredevelopment.ca",
"homepage": "https://github.com/robocoder"
}, },
{ "funding": [
"name": "Cédric Morin", {
"email": "cedric@yterium.com", "url": "https://funding.communitybridge.org/projects/laminas-project",
"homepage": "https://github.com/Cerdic" "type": "community_bridge"
} }
], ],
"description": "scssphp is a compiler for SCSS written in PHP.", "install-path": "../laminas/laminas-xml"
"homepage": "http://scssphp.github.io/scssphp/", },
"keywords": [ {
"css", "name": "laminas/laminas-zendframework-bridge",
"less", "version": "1.1.1",
"sass", "version_normalized": "1.1.1.0",
"scss", "source": {
"stylesheet" "type": "git",
] "url": "https://github.com/laminas/laminas-zendframework-bridge.git",
} "reference": "6ede70583e101030bcace4dcddd648f760ddf642"
] },
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laminas/laminas-zendframework-bridge/zipball/6ede70583e101030bcace4dcddd648f760ddf642",
"reference": "6ede70583e101030bcace4dcddd648f760ddf642",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0 || ^8.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.1 || ^9.3",
"squizlabs/php_codesniffer": "^3.5"
},
"time": "2020-09-14T14:23:00+00:00",
"type": "library",
"extra": {
"laminas": {
"module": "Laminas\\ZendFrameworkBridge"
}
},
"installation-source": "dist",
"autoload": {
"files": [
"src/autoload.php"
],
"psr-4": {
"Laminas\\ZendFrameworkBridge\\": "src//"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"description": "Alias legacy ZF class names to Laminas Project equivalents.",
"keywords": [
"ZendFramework",
"autoloading",
"laminas",
"zf"
],
"support": {
"forum": "https://discourse.laminas.dev/",
"issues": "https://github.com/laminas/laminas-zendframework-bridge/issues",
"rss": "https://github.com/laminas/laminas-zendframework-bridge/releases.atom",
"source": "https://github.com/laminas/laminas-zendframework-bridge"
},
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"install-path": "../laminas/laminas-zendframework-bridge"
},
{
"name": "p3k/picofeed",
"version": "v0.1.40",
"version_normalized": "0.1.40.0",
"source": {
"type": "git",
"url": "https://github.com/aaronpk/picofeed.git",
"reference": "356fd66d48779193b10ac28532cb4a4e11bb801c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/aaronpk/picofeed/zipball/356fd66d48779193b10ac28532cb4a4e11bb801c",
"reference": "356fd66d48779193b10ac28532cb4a4e11bb801c",
"shasum": ""
},
"require": {
"ext-dom": "*",
"ext-iconv": "*",
"ext-libxml": "*",
"ext-simplexml": "*",
"ext-xml": "*",
"laminas/laminas-xml": "^1.2",
"php": ">=5.3.0"
},
"replace": {
"miniflux/picofeed": "0.1.35"
},
"require-dev": {
"phpdocumentor/reflection-docblock": "2.0.4",
"phpunit/phpunit": "4.8.26",
"symfony/yaml": "2.8.7"
},
"suggest": {
"ext-curl": "PicoFeed will use cURL if present"
},
"time": "2020-04-25T17:48:36+00:00",
"bin": [
"picofeed"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"PicoFeed": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frédéric Guillot"
}
],
"description": "Modern library to handle RSS/Atom feeds",
"homepage": "https://github.com/aaronpk/picoFeed",
"support": {
"issues": "https://github.com/aaronpk/picofeed/issues",
"source": "https://github.com/aaronpk/picofeed/tree/v0.1.40"
},
"install-path": "../p3k/picofeed"
},
{
"name": "scssphp/scssphp",
"version": "v1.4.1",
"version_normalized": "1.4.1.0",
"source": {
"type": "git",
"url": "https://github.com/scssphp/scssphp.git",
"reference": "ba86c963b94ec7ebd6e19d90cdab90d89667dbf7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/scssphp/scssphp/zipball/ba86c963b94ec7ebd6e19d90cdab90d89667dbf7",
"reference": "ba86c963b94ec7ebd6e19d90cdab90d89667dbf7",
"shasum": ""
},
"require": {
"ext-ctype": "*",
"ext-json": "*",
"php": ">=5.6.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4",
"sass/sass-spec": "2020.12.29",
"squizlabs/php_codesniffer": "~3.5",
"symfony/phpunit-bridge": "^5.1",
"twbs/bootstrap": "~4.3",
"zurb/foundation": "~6.5"
},
"time": "2021-01-04T13:23:23+00:00",
"bin": [
"bin/pscss"
],
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"ScssPhp\\ScssPhp\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Anthon Pang",
"email": "apang@softwaredevelopment.ca",
"homepage": "https://github.com/robocoder"
},
{
"name": "Cédric Morin",
"email": "cedric@yterium.com",
"homepage": "https://github.com/Cerdic"
}
],
"description": "scssphp is a compiler for SCSS written in PHP.",
"homepage": "http://scssphp.github.io/scssphp/",
"keywords": [
"css",
"less",
"sass",
"scss",
"stylesheet"
],
"support": {
"issues": "https://github.com/scssphp/scssphp/issues",
"source": "https://github.com/scssphp/scssphp/tree/v1.4.1"
},
"install-path": "../scssphp/scssphp"
}
],
"dev": false,
"dev-package-names": []
}

88
vendor/composer/installed.php vendored Normal file
View File

@@ -0,0 +1,88 @@
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => '5de805e3409611ee484267d47022e3ad93a9c2f0',
'name' => 'getgrav/grav-plugin-admin',
),
'versions' =>
array (
'getgrav/grav-plugin-admin' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'aliases' =>
array (
),
'reference' => '5de805e3409611ee484267d47022e3ad93a9c2f0',
),
'laminas/laminas-xml' =>
array (
'pretty_version' => '1.3.0',
'version' => '1.3.0.0',
'aliases' =>
array (
),
'reference' => '844dc64557b1ad8a2e0eadb741510ba992674f99',
),
'laminas/laminas-zendframework-bridge' =>
array (
'pretty_version' => '1.1.1',
'version' => '1.1.1.0',
'aliases' =>
array (
),
'reference' => '6ede70583e101030bcace4dcddd648f760ddf642',
),
'miniflux/picofeed' =>
array (
'replaced' =>
array (
0 => '0.1.35',
),
),
'p3k/picofeed' =>
array (
'pretty_version' => 'v0.1.40',
'version' => '0.1.40.0',
'aliases' =>
array (
),
'reference' => '356fd66d48779193b10ac28532cb4a4e11bb801c',
),
'scssphp/scssphp' =>
array (
'pretty_version' => 'v1.4.1',
'version' => '1.4.1.0',
'aliases' =>
array (
),
'reference' => 'ba86c963b94ec7ebd6e19d90cdab90d89667dbf7',
),
'symfony/polyfill-php72' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'symfony/polyfill-php73' =>
array (
'replaced' =>
array (
0 => '*',
),
),
'zendframework/zendxml' =>
array (
'replaced' =>
array (
0 => '^1.2.0',
),
),
),
);

26
vendor/composer/platform_check.php vendored Normal file
View File

@@ -0,0 +1,26 @@
<?php
// platform_check.php @generated by Composer
$issues = array();
if (!(PHP_VERSION_ID >= 70306)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 7.3.6". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {
header('HTTP/1.1 500 Internal Server Error');
}
if (!ini_get('display_errors')) {
if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') {
fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL);
} elseif (!headers_sent()) {
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
);
}

View File

@@ -1,102 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
### [1.7.1] 2020-09-27
* Fixed: accidental validation of broken constraints combining ^/~ and wildcards, and -dev suffix allowing weird cases
* Fixed: normalization of beta0 and such which was dropping the 0
### [1.7.0] 2020-09-09
* Added: support for `x || @dev`, not very useful but seen in the wild and failed to validate with 1.5.2/1.6.0
* Added: support for `foobar-dev` being equal to `dev-foobar`, dev-foobar is the official way to write it but we need to support the other for BC and convenience
### [1.6.0] 2020-09-08
* Added: support for constraints like `^2.x-dev` and `~2.x-dev`, not very useful but seen in the wild and failed to validate with 1.5.2
* Fixed: invalid aliases will no longer throw, unless explicitly validated by Composer in the root package
### [1.5.2] 2020-09-08
* Fixed: handling of some invalid -dev versions which were seen as valid
* Fixed: some doctypes
### [1.5.1] 2020-01-13
* Fixed: Parsing of aliased version was not validating the alias to be a valid version
### [1.5.0] 2019-03-19
* Added: some support for date versions (e.g. 201903) in `~` operator
* Fixed: support for stabilities in `~` operator was inconsistent
### [1.4.2] 2016-08-30
* Fixed: collapsing of complex constraints lead to buggy constraints
### [1.4.1] 2016-06-02
* Changed: branch-like requirements no longer strip build metadata - [composer/semver#38](https://github.com/composer/semver/pull/38).
### [1.4.0] 2016-03-30
* Added: getters on MultiConstraint - [composer/semver#35](https://github.com/composer/semver/pull/35).
### [1.3.0] 2016-02-25
* Fixed: stability parsing - [composer/composer#1234](https://github.com/composer/composer/issues/4889).
* Changed: collapse contiguous constraints when possible.
### [1.2.0] 2015-11-10
* Changed: allow multiple numerical identifiers in 'pre-release' version part.
* Changed: add more 'v' prefix support.
### [1.1.0] 2015-11-03
* Changed: dropped redundant `test` namespace.
* Changed: minor adjustment in datetime parsing normalization.
* Changed: `ConstraintInterface` relaxed, setPrettyString is not required anymore.
* Changed: `AbstractConstraint` marked deprecated, will be removed in 2.0.
* Changed: `Constraint` is now extensible.
### [1.0.0] 2015-09-21
* Break: `VersionConstraint` renamed to `Constraint`.
* Break: `SpecificConstraint` renamed to `AbstractConstraint`.
* Break: `LinkConstraintInterface` renamed to `ConstraintInterface`.
* Break: `VersionParser::parseNameVersionPairs` was removed.
* Changed: `VersionParser::parseConstraints` allows (but ignores) build metadata now.
* Changed: `VersionParser::parseConstraints` allows (but ignores) prefixing numeric versions with a 'v' now.
* Changed: Fixed namespace(s) of test files.
* Changed: `Comparator::compare` no longer throws `InvalidArgumentException`.
* Changed: `Constraint` now throws `InvalidArgumentException`.
### [0.1.0] 2015-07-23
* Added: `Composer\Semver\Comparator`, various methods to compare versions.
* Added: various documents such as README.md, LICENSE, etc.
* Added: configuration files for Git, Travis, php-cs-fixer, phpunit.
* Break: the following namespaces were renamed:
- Namespace: `Composer\Package\Version` -> `Composer\Semver`
- Namespace: `Composer\Package\LinkConstraint` -> `Composer\Semver\Constraint`
- Namespace: `Composer\Test\Package\Version` -> `Composer\Test\Semver`
- Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint`
* Changed: code style using php-cs-fixer.
[1.7.1]: https://github.com/composer/semver/compare/1.7.0...1.7.1
[1.7.0]: https://github.com/composer/semver/compare/1.6.0...1.7.0
[1.6.0]: https://github.com/composer/semver/compare/1.5.2...1.6.0
[1.5.2]: https://github.com/composer/semver/compare/1.5.1...1.5.2
[1.5.1]: https://github.com/composer/semver/compare/1.5.0...1.5.1
[1.5.0]: https://github.com/composer/semver/compare/1.4.2...1.5.0
[1.4.2]: https://github.com/composer/semver/compare/1.4.1...1.4.2
[1.4.1]: https://github.com/composer/semver/compare/1.4.0...1.4.1
[1.4.0]: https://github.com/composer/semver/compare/1.3.0...1.4.0
[1.3.0]: https://github.com/composer/semver/compare/1.2.0...1.3.0
[1.2.0]: https://github.com/composer/semver/compare/1.1.0...1.2.0
[1.1.0]: https://github.com/composer/semver/compare/1.0.0...1.1.0
[1.0.0]: https://github.com/composer/semver/compare/0.1.0...1.0.0
[0.1.0]: https://github.com/composer/semver/compare/5e0b9a4da...0.1.0

View File

@@ -1,19 +0,0 @@
Copyright (C) 2015 Composer
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,70 +0,0 @@
composer/semver
===============
Semver library that offers utilities, version constraint parsing and validation.
Originally written as part of [composer/composer](https://github.com/composer/composer),
now extracted and made available as a stand-alone library.
[![Build Status](https://travis-ci.org/composer/semver.svg?branch=master)](https://travis-ci.org/composer/semver)
Installation
------------
Install the latest version with:
```bash
$ composer require composer/semver
```
Requirements
------------
* PHP 5.3.2 is required but using the latest version of PHP is highly recommended.
Version Comparison
------------------
For details on how versions are compared, refer to the [Versions](https://getcomposer.org/doc/articles/versions.md)
article in the documentation section of the [getcomposer.org](https://getcomposer.org) website.
Basic usage
-----------
### Comparator
The `Composer\Semver\Comparator` class provides the following methods for comparing versions:
* greaterThan($v1, $v2)
* greaterThanOrEqualTo($v1, $v2)
* lessThan($v1, $v2)
* lessThanOrEqualTo($v1, $v2)
* equalTo($v1, $v2)
* notEqualTo($v1, $v2)
Each function takes two version strings as arguments and returns a boolean. For example:
```php
use Composer\Semver\Comparator;
Comparator::greaterThan('1.25.0', '1.24.0'); // 1.25.0 > 1.24.0
```
### Semver
The `Composer\Semver\Semver` class provides the following methods:
* satisfies($version, $constraints)
* satisfiedBy(array $versions, $constraint)
* sort($versions)
* rsort($versions)
License
-------
composer/semver is licensed under the MIT License, see the LICENSE file for details.

View File

@@ -1,57 +0,0 @@
{
"name": "composer/semver",
"description": "Semver library that offers utilities, version constraint parsing and validation.",
"type": "library",
"license": "MIT",
"keywords": [
"semver",
"semantic",
"versioning",
"validation"
],
"authors": [
{
"name": "Nils Adermann",
"email": "naderman@naderman.de",
"homepage": "http://www.naderman.de"
},
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be"
},
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com",
"homepage": "http://robbast.nl"
}
],
"support": {
"irc": "irc://irc.freenode.org/composer",
"issues": "https://github.com/composer/semver/issues"
},
"require": {
"php": "^5.3.2 || ^7.0"
},
"require-dev": {
"phpunit/phpunit": "^4.5 || ^5.0.5"
},
"autoload": {
"psr-4": {
"Composer\\Semver\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Composer\\Semver\\": "tests"
}
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"scripts": {
"test": "phpunit"
}
}

View File

@@ -1,111 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver;
use Composer\Semver\Constraint\Constraint;
class Comparator
{
/**
* Evaluates the expression: $version1 > $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function greaterThan($version1, $version2)
{
return self::compare($version1, '>', $version2);
}
/**
* Evaluates the expression: $version1 >= $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function greaterThanOrEqualTo($version1, $version2)
{
return self::compare($version1, '>=', $version2);
}
/**
* Evaluates the expression: $version1 < $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function lessThan($version1, $version2)
{
return self::compare($version1, '<', $version2);
}
/**
* Evaluates the expression: $version1 <= $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function lessThanOrEqualTo($version1, $version2)
{
return self::compare($version1, '<=', $version2);
}
/**
* Evaluates the expression: $version1 == $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function equalTo($version1, $version2)
{
return self::compare($version1, '==', $version2);
}
/**
* Evaluates the expression: $version1 != $version2.
*
* @param string $version1
* @param string $version2
*
* @return bool
*/
public static function notEqualTo($version1, $version2)
{
return self::compare($version1, '!=', $version2);
}
/**
* Evaluates the expression: $version1 $operator $version2.
*
* @param string $version1
* @param string $operator
* @param string $version2
*
* @return bool
*/
public static function compare($version1, $operator, $version2)
{
$constraint = new Constraint($operator, $version2);
return $constraint->matches(new Constraint('==', $version1));
}
}

View File

@@ -1,63 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver\Constraint;
trigger_error('The ' . __NAMESPACE__ . '\AbstractConstraint abstract class is deprecated, there is no replacement for it, it will be removed in the next major version.', E_USER_DEPRECATED);
/**
* Base constraint class.
*/
abstract class AbstractConstraint implements ConstraintInterface
{
/** @var string */
protected $prettyString;
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider)
{
if ($provider instanceof $this) {
// see note at bottom of this class declaration
return $this->matchSpecific($provider);
}
// turn matching around to find a match
return $provider->matches($this);
}
/**
* @param string $prettyString
*/
public function setPrettyString($prettyString)
{
$this->prettyString = $prettyString;
}
/**
* @return string
*/
public function getPrettyString()
{
if ($this->prettyString) {
return $this->prettyString;
}
return $this->__toString();
}
// implementations must implement a method of this format:
// not declared abstract here because type hinting violates parameter coherence (TODO right word?)
// public function matchSpecific(<SpecificConstraintType> $provider);
}

View File

@@ -1,215 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver\Constraint;
/**
* Defines a constraint.
*/
class Constraint implements ConstraintInterface
{
/* operator integer values */
const OP_EQ = 0;
const OP_LT = 1;
const OP_LE = 2;
const OP_GT = 3;
const OP_GE = 4;
const OP_NE = 5;
/**
* Operator to integer translation table.
*
* @var array
*/
private static $transOpStr = array(
'=' => self::OP_EQ,
'==' => self::OP_EQ,
'<' => self::OP_LT,
'<=' => self::OP_LE,
'>' => self::OP_GT,
'>=' => self::OP_GE,
'<>' => self::OP_NE,
'!=' => self::OP_NE,
);
/**
* Integer to operator translation table.
*
* @var array
*/
private static $transOpInt = array(
self::OP_EQ => '==',
self::OP_LT => '<',
self::OP_LE => '<=',
self::OP_GT => '>',
self::OP_GE => '>=',
self::OP_NE => '!=',
);
/** @var int */
protected $operator;
/** @var string */
protected $version;
/** @var string */
protected $prettyString;
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider)
{
if ($provider instanceof $this) {
return $this->matchSpecific($provider);
}
// turn matching around to find a match
return $provider->matches($this);
}
/**
* @param string $prettyString
*/
public function setPrettyString($prettyString)
{
$this->prettyString = $prettyString;
}
/**
* @return string
*/
public function getPrettyString()
{
if ($this->prettyString) {
return $this->prettyString;
}
return $this->__toString();
}
/**
* Get all supported comparison operators.
*
* @return array
*/
public static function getSupportedOperators()
{
return array_keys(self::$transOpStr);
}
/**
* Sets operator and version to compare with.
*
* @param string $operator
* @param string $version
*
* @throws \InvalidArgumentException if invalid operator is given.
*/
public function __construct($operator, $version)
{
if (!isset(self::$transOpStr[$operator])) {
throw new \InvalidArgumentException(sprintf(
'Invalid operator "%s" given, expected one of: %s',
$operator,
implode(', ', self::getSupportedOperators())
));
}
$this->operator = self::$transOpStr[$operator];
$this->version = $version;
}
/**
* @param string $a
* @param string $b
* @param string $operator
* @param bool $compareBranches
*
* @throws \InvalidArgumentException if invalid operator is given.
*
* @return bool
*/
public function versionCompare($a, $b, $operator, $compareBranches = false)
{
if (!isset(self::$transOpStr[$operator])) {
throw new \InvalidArgumentException(sprintf(
'Invalid operator "%s" given, expected one of: %s',
$operator,
implode(', ', self::getSupportedOperators())
));
}
$aIsBranch = 'dev-' === substr($a, 0, 4);
$bIsBranch = 'dev-' === substr($b, 0, 4);
if ($aIsBranch && $bIsBranch) {
return $operator === '==' && $a === $b;
}
// when branches are not comparable, we make sure dev branches never match anything
if (!$compareBranches && ($aIsBranch || $bIsBranch)) {
return false;
}
return version_compare($a, $b, $operator);
}
/**
* @param Constraint $provider
* @param bool $compareBranches
*
* @return bool
*/
public function matchSpecific(Constraint $provider, $compareBranches = false)
{
$noEqualOp = str_replace('=', '', self::$transOpInt[$this->operator]);
$providerNoEqualOp = str_replace('=', '', self::$transOpInt[$provider->operator]);
$isEqualOp = self::OP_EQ === $this->operator;
$isNonEqualOp = self::OP_NE === $this->operator;
$isProviderEqualOp = self::OP_EQ === $provider->operator;
$isProviderNonEqualOp = self::OP_NE === $provider->operator;
// '!=' operator is match when other operator is not '==' operator or version is not match
// these kinds of comparisons always have a solution
if ($isNonEqualOp || $isProviderNonEqualOp) {
return (!$isEqualOp && !$isProviderEqualOp)
|| $this->versionCompare($provider->version, $this->version, '!=', $compareBranches);
}
// an example for the condition is <= 2.0 & < 1.0
// these kinds of comparisons always have a solution
if ($this->operator !== self::OP_EQ && $noEqualOp === $providerNoEqualOp) {
return true;
}
if ($this->versionCompare($provider->version, $this->version, self::$transOpInt[$this->operator], $compareBranches)) {
// special case, e.g. require >= 1.0 and provide < 1.0
// 1.0 >= 1.0 but 1.0 is outside of the provided interval
return !($provider->version === $this->version
&& self::$transOpInt[$provider->operator] === $providerNoEqualOp
&& self::$transOpInt[$this->operator] !== $noEqualOp);
}
return false;
}
/**
* @return string
*/
public function __toString()
{
return self::$transOpInt[$this->operator] . ' ' . $this->version;
}
}

View File

@@ -1,32 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver\Constraint;
interface ConstraintInterface
{
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider);
/**
* @return string
*/
public function getPrettyString();
/**
* @return string
*/
public function __toString();
}

View File

@@ -1,59 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver\Constraint;
/**
* Defines the absence of a constraint.
*/
class EmptyConstraint implements ConstraintInterface
{
/** @var string */
protected $prettyString;
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider)
{
return true;
}
/**
* @param string $prettyString
*/
public function setPrettyString($prettyString)
{
$this->prettyString = $prettyString;
}
/**
* @return string
*/
public function getPrettyString()
{
if ($this->prettyString) {
return $this->prettyString;
}
return (string) $this;
}
/**
* @return string
*/
public function __toString()
{
return '[]';
}
}

View File

@@ -1,120 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver\Constraint;
/**
* Defines a conjunctive or disjunctive set of constraints.
*/
class MultiConstraint implements ConstraintInterface
{
/** @var ConstraintInterface[] */
protected $constraints;
/** @var string|null */
protected $prettyString;
/** @var bool */
protected $conjunctive;
/**
* @param ConstraintInterface[] $constraints A set of constraints
* @param bool $conjunctive Whether the constraints should be treated as conjunctive or disjunctive
*/
public function __construct(array $constraints, $conjunctive = true)
{
$this->constraints = $constraints;
$this->conjunctive = $conjunctive;
}
/**
* @return ConstraintInterface[]
*/
public function getConstraints()
{
return $this->constraints;
}
/**
* @return bool
*/
public function isConjunctive()
{
return $this->conjunctive;
}
/**
* @return bool
*/
public function isDisjunctive()
{
return !$this->conjunctive;
}
/**
* @param ConstraintInterface $provider
*
* @return bool
*/
public function matches(ConstraintInterface $provider)
{
if (false === $this->conjunctive) {
foreach ($this->constraints as $constraint) {
if ($constraint->matches($provider)) {
return true;
}
}
return false;
}
foreach ($this->constraints as $constraint) {
if (!$constraint->matches($provider)) {
return false;
}
}
return true;
}
/**
* @param string|null $prettyString
*/
public function setPrettyString($prettyString)
{
$this->prettyString = $prettyString;
}
/**
* @return string
*/
public function getPrettyString()
{
if ($this->prettyString) {
return $this->prettyString;
}
return (string) $this;
}
/**
* @return string
*/
public function __toString()
{
$constraints = array();
foreach ($this->constraints as $constraint) {
$constraints[] = (string) $constraint;
}
return '[' . implode($this->conjunctive ? ' ' : ' || ', $constraints) . ']';
}
}

View File

@@ -1,127 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver;
use Composer\Semver\Constraint\Constraint;
class Semver
{
const SORT_ASC = 1;
const SORT_DESC = -1;
/** @var VersionParser */
private static $versionParser;
/**
* Determine if given version satisfies given constraints.
*
* @param string $version
* @param string $constraints
*
* @return bool
*/
public static function satisfies($version, $constraints)
{
if (null === self::$versionParser) {
self::$versionParser = new VersionParser();
}
$versionParser = self::$versionParser;
$provider = new Constraint('==', $versionParser->normalize($version));
$parsedConstraints = $versionParser->parseConstraints($constraints);
return $parsedConstraints->matches($provider);
}
/**
* Return all versions that satisfy given constraints.
*
* @param array $versions
* @param string $constraints
*
* @return array
*/
public static function satisfiedBy(array $versions, $constraints)
{
$versions = array_filter($versions, function ($version) use ($constraints) {
return Semver::satisfies($version, $constraints);
});
return array_values($versions);
}
/**
* Sort given array of versions.
*
* @param array $versions
*
* @return array
*/
public static function sort(array $versions)
{
return self::usort($versions, self::SORT_ASC);
}
/**
* Sort given array of versions in reverse.
*
* @param array $versions
*
* @return array
*/
public static function rsort(array $versions)
{
return self::usort($versions, self::SORT_DESC);
}
/**
* @param array $versions
* @param int $direction
*
* @return array
*/
private static function usort(array $versions, $direction)
{
if (null === self::$versionParser) {
self::$versionParser = new VersionParser();
}
$versionParser = self::$versionParser;
$normalized = array();
// Normalize outside of usort() scope for minor performance increase.
// Creates an array of arrays: [[normalized, key], ...]
foreach ($versions as $key => $version) {
$normalized[] = array($versionParser->normalize($version), $key);
}
usort($normalized, function (array $left, array $right) use ($direction) {
if ($left[0] === $right[0]) {
return 0;
}
if (Comparator::lessThan($left[0], $right[0])) {
return -$direction;
}
return $direction;
});
// Recreate input array, using the original indexes which are now in sorted order.
$sorted = array();
foreach ($normalized as $item) {
$sorted[] = $versions[$item[1]];
}
return $sorted;
}
}

View File

@@ -1,578 +0,0 @@
<?php
/*
* This file is part of composer/semver.
*
* (c) Composer <https://github.com/composer>
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
namespace Composer\Semver;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Semver\Constraint\EmptyConstraint;
use Composer\Semver\Constraint\MultiConstraint;
use Composer\Semver\Constraint\Constraint;
/**
* Version parser.
*
* @author Jordi Boggiano <j.boggiano@seld.be>
*/
class VersionParser
{
/**
* Regex to match pre-release data (sort of).
*
* Due to backwards compatibility:
* - Instead of enforcing hyphen, an underscore, dot or nothing at all are also accepted.
* - Only stabilities as recognized by Composer are allowed to precede a numerical identifier.
* - Numerical-only pre-release identifiers are not supported, see tests.
*
* |--------------|
* [major].[minor].[patch] -[pre-release] +[build-metadata]
*
* @var string
*/
private static $modifierRegex = '[._-]?(?:(stable|beta|b|RC|alpha|a|patch|pl|p)((?:[.-]?\d+)*+)?)?([.-]?dev)?';
/** @var string */
private static $stabilitiesRegex = 'stable|RC|beta|alpha|dev';
/**
* Returns the stability of a version.
*
* @param string $version
*
* @return string
*/
public static function parseStability($version)
{
$version = preg_replace('{#.+$}i', '', $version);
if (strpos($version, 'dev-') === 0 || '-dev' === substr($version, -4)) {
return 'dev';
}
preg_match('{' . self::$modifierRegex . '(?:\+.*)?$}i', strtolower($version), $match);
if (!empty($match[3])) {
return 'dev';
}
if (!empty($match[1])) {
if ('beta' === $match[1] || 'b' === $match[1]) {
return 'beta';
}
if ('alpha' === $match[1] || 'a' === $match[1]) {
return 'alpha';
}
if ('rc' === $match[1]) {
return 'RC';
}
}
return 'stable';
}
/**
* @param string $stability
*
* @return string
*/
public static function normalizeStability($stability)
{
$stability = strtolower($stability);
return $stability === 'rc' ? 'RC' : $stability;
}
/**
* Normalizes a version string to be able to perform comparisons on it.
*
* @param string $version
* @param string $fullVersion optional complete version string to give more context
*
* @throws \UnexpectedValueException
*
* @return string
*/
public function normalize($version, $fullVersion = null)
{
$version = trim($version);
$origVersion = $version;
if (null === $fullVersion) {
$fullVersion = $version;
}
// strip off aliasing
if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $version, $match)) {
$version = $match[1];
}
// strip off stability flag
if (preg_match('{@(?:' . self::$stabilitiesRegex . ')$}i', $version, $match)) {
$version = substr($version, 0, strlen($version) - strlen($match[0]));
}
// match master-like branches
if (preg_match('{^(?:dev-)?(?:master|trunk|default)$}i', $version)) {
return '9999999-dev';
}
// if requirement is branch-like, use full name
if (stripos($version, 'dev-') === 0) {
return 'dev-' . substr($version, 4);
}
// strip off build metadata
if (preg_match('{^([^,\s+]++)\+[^\s]++$}', $version, $match)) {
$version = $match[1];
}
// match classical versioning
if (preg_match('{^v?(\d{1,5})(\.\d++)?(\.\d++)?(\.\d++)?' . self::$modifierRegex . '$}i', $version, $matches)) {
$version = $matches[1]
. (!empty($matches[2]) ? $matches[2] : '.0')
. (!empty($matches[3]) ? $matches[3] : '.0')
. (!empty($matches[4]) ? $matches[4] : '.0');
$index = 5;
// match date(time) based versioning
} elseif (preg_match('{^v?(\d{4}(?:[.:-]?\d{2}){1,6}(?:[.:-]?\d{1,3})?)' . self::$modifierRegex . '$}i', $version, $matches)) {
$version = preg_replace('{\D}', '.', $matches[1]);
$index = 2;
}
// add version modifiers if a version was matched
if (isset($index)) {
if (!empty($matches[$index])) {
if ('stable' === $matches[$index]) {
return $version;
}
$version .= '-' . $this->expandStability($matches[$index]) . (isset($matches[$index + 1]) && '' !== $matches[$index + 1] ? ltrim($matches[$index + 1], '.-') : '');
}
if (!empty($matches[$index + 2])) {
$version .= '-dev';
}
return $version;
}
// match dev branches
if (preg_match('{(.*?)[.-]?dev$}i', $version, $match)) {
try {
$normalized = $this->normalizeBranch($match[1]);
// a branch ending with -dev is only valid if it is numeric
// if it gets prefixed with dev- it means the branch name should
// have had a dev- prefix already when passed to normalize
if (strpos($normalized, 'dev-') === false) {
return $normalized;
}
} catch (\Exception $e) {
}
}
$extraMessage = '';
if (preg_match('{ +as +' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))?$}', $fullVersion)) {
$extraMessage = ' in "' . $fullVersion . '", the alias must be an exact version';
} elseif (preg_match('{^' . preg_quote($version) . '(?:@(?:'.self::$stabilitiesRegex.'))? +as +}', $fullVersion)) {
$extraMessage = ' in "' . $fullVersion . '", the alias source must be an exact version, if it is a branch name you should prefix it with dev-';
}
throw new \UnexpectedValueException('Invalid version string "' . $origVersion . '"' . $extraMessage);
}
/**
* Extract numeric prefix from alias, if it is in numeric format, suitable for version comparison.
*
* @param string $branch Branch name (e.g. 2.1.x-dev)
*
* @return string|false Numeric prefix if present (e.g. 2.1.) or false
*/
public function parseNumericAliasPrefix($branch)
{
if (preg_match('{^(?P<version>(\d++\\.)*\d++)(?:\.x)?-dev$}i', $branch, $matches)) {
return $matches['version'] . '.';
}
return false;
}
/**
* Normalizes a branch name to be able to perform comparisons on it.
*
* @param string $name
*
* @return string
*/
public function normalizeBranch($name)
{
$name = trim($name);
if (in_array($name, array('master', 'trunk', 'default'))) {
return $this->normalize($name);
}
if (preg_match('{^v?(\d++)(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?(\.(?:\d++|[xX*]))?$}i', $name, $matches)) {
$version = '';
for ($i = 1; $i < 5; ++$i) {
$version .= isset($matches[$i]) ? str_replace(array('*', 'X'), 'x', $matches[$i]) : '.x';
}
return str_replace('x', '9999999', $version) . '-dev';
}
return 'dev-' . $name;
}
/**
* Parses a constraint string into MultiConstraint and/or Constraint objects.
*
* @param string $constraints
*
* @return ConstraintInterface
*/
public function parseConstraints($constraints)
{
$prettyConstraint = $constraints;
$orConstraints = preg_split('{\s*\|\|?\s*}', trim($constraints));
$orGroups = array();
foreach ($orConstraints as $constraints) {
$andConstraints = preg_split('{(?<!^|as|[=>< ,]) *(?<!-)[, ](?!-) *(?!,|as|$)}', $constraints);
if (count($andConstraints) > 1) {
$constraintObjects = array();
foreach ($andConstraints as $constraint) {
foreach ($this->parseConstraint($constraint) as $parsedConstraint) {
$constraintObjects[] = $parsedConstraint;
}
}
} else {
$constraintObjects = $this->parseConstraint($andConstraints[0]);
}
if (1 === count($constraintObjects)) {
$constraint = $constraintObjects[0];
} else {
$constraint = new MultiConstraint($constraintObjects);
}
$orGroups[] = $constraint;
}
if (1 === count($orGroups)) {
$constraint = $orGroups[0];
} elseif (2 === count($orGroups)
// parse the two OR groups and if they are contiguous we collapse
// them into one constraint
&& $orGroups[0] instanceof MultiConstraint
&& $orGroups[1] instanceof MultiConstraint
&& 2 === count($orGroups[0]->getConstraints())
&& 2 === count($orGroups[1]->getConstraints())
&& ($a = (string) $orGroups[0])
&& strpos($a, '[>=') === 0 && (false !== ($posA = strpos($a, '<', 4)))
&& ($b = (string) $orGroups[1])
&& strpos($b, '[>=') === 0 && (false !== ($posB = strpos($b, '<', 4)))
&& substr($a, $posA + 2, -1) === substr($b, 4, $posB - 5)
) {
$constraint = new MultiConstraint(array(
new Constraint('>=', substr($a, 4, $posA - 5)),
new Constraint('<', substr($b, $posB + 2, -1)),
));
} else {
$constraint = new MultiConstraint($orGroups, false);
}
$constraint->setPrettyString($prettyConstraint);
return $constraint;
}
/**
* @param string $constraint
*
* @throws \UnexpectedValueException
*
* @return array
*/
private function parseConstraint($constraint)
{
// strip off aliasing
if (preg_match('{^([^,\s]++) ++as ++([^,\s]++)$}', $constraint, $match)) {
$constraint = $match[1];
}
// strip @stability flags, and keep it for later use
if (preg_match('{^([^,\s]*?)@(' . self::$stabilitiesRegex . ')$}i', $constraint, $match)) {
$constraint = '' !== $match[1] ? $match[1] : '*';
if ($match[2] !== 'stable') {
$stabilityModifier = $match[2];
}
}
// get rid of #refs as those are used by composer only
if (preg_match('{^(dev-[^,\s@]+?|[^,\s@]+?\.x-dev)#.+$}i', $constraint, $match)) {
$constraint = $match[1];
}
if (preg_match('{^v?[xX*](\.[xX*])*$}i', $constraint)) {
return array(new EmptyConstraint());
}
$versionRegex = 'v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.(\d++))?(?:' . self::$modifierRegex . '|\.([xX*][.-]?dev))(?:\+[^\s]+)?';
// Tilde Range
//
// Like wildcard constraints, unsuffixed tilde constraints say that they must be greater than the previous
// version, to ensure that unstable instances of the current version are allowed. However, if a stability
// suffix is added to the constraint, then a >= match on the current version is used instead.
if (preg_match('{^~>?' . $versionRegex . '$}i', $constraint, $matches)) {
if (strpos($constraint, '~>') === 0) {
throw new \UnexpectedValueException(
'Could not parse version constraint ' . $constraint . ': ' .
'Invalid operator "~>", you probably meant to use the "~" operator'
);
}
// Work out which position in the version we are operating at
if (isset($matches[4]) && '' !== $matches[4] && null !== $matches[4]) {
$position = 4;
} elseif (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) {
$position = 3;
} elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) {
$position = 2;
} else {
$position = 1;
}
// when matching 2.x-dev or 3.0.x-dev we have to shift the second or third number, despite no second/third number matching above
if (!empty($matches[8])) {
$position++;
}
// Calculate the stability suffix
$stabilitySuffix = '';
if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
$stabilitySuffix .= '-dev';
}
$lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1));
$lowerBound = new Constraint('>=', $lowVersion);
// For upper bound, we increment the position of one more significance,
// but highPosition = 0 would be illegal
$highPosition = max(1, $position - 1);
$highVersion = $this->manipulateVersionString($matches, $highPosition, 1) . '-dev';
$upperBound = new Constraint('<', $highVersion);
return array(
$lowerBound,
$upperBound,
);
}
// Caret Range
//
// Allows changes that do not modify the left-most non-zero digit in the [major, minor, patch] tuple.
// In other words, this allows patch and minor updates for versions 1.0.0 and above, patch updates for
// versions 0.X >=0.1.0, and no updates for versions 0.0.X
if (preg_match('{^\^' . $versionRegex . '($)}i', $constraint, $matches)) {
// Work out which position in the version we are operating at
if ('0' !== $matches[1] || '' === $matches[2] || null === $matches[2]) {
$position = 1;
} elseif ('0' !== $matches[2] || '' === $matches[3] || null === $matches[3]) {
$position = 2;
} else {
$position = 3;
}
// Calculate the stability suffix
$stabilitySuffix = '';
if (empty($matches[5]) && empty($matches[7]) && empty($matches[8])) {
$stabilitySuffix .= '-dev';
}
$lowVersion = $this->normalize(substr($constraint . $stabilitySuffix, 1));
$lowerBound = new Constraint('>=', $lowVersion);
// For upper bound, we increment the position of one more significance,
// but highPosition = 0 would be illegal
$highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
$upperBound = new Constraint('<', $highVersion);
return array(
$lowerBound,
$upperBound,
);
}
// X Range
//
// Any of X, x, or * may be used to "stand in" for one of the numeric values in the [major, minor, patch] tuple.
// A partial version range is treated as an X-Range, so the special character is in fact optional.
if (preg_match('{^v?(\d++)(?:\.(\d++))?(?:\.(\d++))?(?:\.[xX*])++$}', $constraint, $matches)) {
if (isset($matches[3]) && '' !== $matches[3] && null !== $matches[3]) {
$position = 3;
} elseif (isset($matches[2]) && '' !== $matches[2] && null !== $matches[2]) {
$position = 2;
} else {
$position = 1;
}
$lowVersion = $this->manipulateVersionString($matches, $position) . '-dev';
$highVersion = $this->manipulateVersionString($matches, $position, 1) . '-dev';
if ($lowVersion === '0.0.0.0-dev') {
return array(new Constraint('<', $highVersion));
}
return array(
new Constraint('>=', $lowVersion),
new Constraint('<', $highVersion),
);
}
// Hyphen Range
//
// Specifies an inclusive set. If a partial version is provided as the first version in the inclusive range,
// then the missing pieces are replaced with zeroes. If a partial version is provided as the second version in
// the inclusive range, then all versions that start with the supplied parts of the tuple are accepted, but
// nothing that would be greater than the provided tuple parts.
if (preg_match('{^(?P<from>' . $versionRegex . ') +- +(?P<to>' . $versionRegex . ')($)}i', $constraint, $matches)) {
// Calculate the stability suffix
$lowStabilitySuffix = '';
if (empty($matches[6]) && empty($matches[8]) && empty($matches[9])) {
$lowStabilitySuffix = '-dev';
}
$lowVersion = $this->normalize($matches['from']);
$lowerBound = new Constraint('>=', $lowVersion . $lowStabilitySuffix);
$empty = function ($x) {
return ($x === 0 || $x === '0') ? false : empty($x);
};
if ((!$empty($matches[12]) && !$empty($matches[13])) || !empty($matches[15]) || !empty($matches[17]) || !empty($matches[18])) {
$highVersion = $this->normalize($matches['to']);
$upperBound = new Constraint('<=', $highVersion);
} else {
$highMatch = array('', $matches[11], $matches[12], $matches[13], $matches[14]);
// validate to version
$this->normalize($matches['to']);
$highVersion = $this->manipulateVersionString($highMatch, $empty($matches[12]) ? 1 : 2, 1) . '-dev';
$upperBound = new Constraint('<', $highVersion);
}
return array(
$lowerBound,
$upperBound,
);
}
// Basic Comparators
if (preg_match('{^(<>|!=|>=?|<=?|==?)?\s*(.*)}', $constraint, $matches)) {
try {
try {
$version = $this->normalize($matches[2]);
} catch (\UnexpectedValueException $e) {
// recover from an invalid constraint like foobar-dev which should be dev-foobar
// except if the constraint uses a known operator, in which case it must be a parse error
if (substr($matches[2], -4) === '-dev' && preg_match('{^[0-9a-zA-Z-./]+$}', $matches[2])) {
$version = $this->normalize('dev-'.substr($matches[2], 0, -4));
} else {
throw $e;
}
}
$op = $matches[1] ?: '=';
if ($op !== '==' && $op !== '=' && !empty($stabilityModifier) && self::parseStability($version) === 'stable') {
$version .= '-' . $stabilityModifier;
} elseif ('<' === $op || '>=' === $op) {
if (!preg_match('/-' . self::$modifierRegex . '$/', strtolower($matches[2]))) {
if (strpos($matches[2], 'dev-') !== 0) {
$version .= '-dev';
}
}
}
return array(new Constraint($matches[1] ?: '=', $version));
} catch (\Exception $e) {
}
}
$message = 'Could not parse version constraint ' . $constraint;
if (isset($e)) {
$message .= ': ' . $e->getMessage();
}
throw new \UnexpectedValueException($message);
}
/**
* Increment, decrement, or simply pad a version number.
*
* Support function for {@link parseConstraint()}
*
* @param array $matches Array with version parts in array indexes 1,2,3,4
* @param int $position 1,2,3,4 - which segment of the version to increment/decrement
* @param int $increment
* @param string $pad The string to pad version parts after $position
*
* @return string|null The new version
*/
private function manipulateVersionString($matches, $position, $increment = 0, $pad = '0')
{
for ($i = 4; $i > 0; --$i) {
if ($i > $position) {
$matches[$i] = $pad;
} elseif ($i === $position && $increment) {
$matches[$i] += $increment;
// If $matches[$i] was 0, carry the decrement
if ($matches[$i] < 0) {
$matches[$i] = $pad;
--$position;
// Return null on a carry overflow
if ($i === 1) {
return null;
}
}
}
}
return $matches[1] . '.' . $matches[2] . '.' . $matches[3] . '.' . $matches[4];
}
/**
* Expand shorthand stability string to long version.
*
* @param string $stability
*
* @return string
*/
private function expandStability($stability)
{
$stability = strtolower($stability);
switch ($stability) {
case 'a':
return 'alpha';
case 'b':
return 'beta';
case 'p':
case 'pl':
return 'patch';
case 'rc':
return 'RC';
default:
return $stability;
}
}
}

View File

@@ -32,7 +32,7 @@
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4", "phpunit/phpunit": "^5.7 || ^6.5 || ^7.5 || ^8.3 || ^9.4",
"sass/sass-spec": "2020.10.29", "sass/sass-spec": "2020.12.29",
"squizlabs/php_codesniffer": "~3.5", "squizlabs/php_codesniffer": "~3.5",
"symfony/phpunit-bridge": "^5.1", "symfony/phpunit-bridge": "^5.1",
"twbs/bootstrap": "~4.3", "twbs/bootstrap": "~4.3",
@@ -43,16 +43,16 @@
"type": "package", "type": "package",
"package": { "package": {
"name": "sass/sass-spec", "name": "sass/sass-spec",
"version": "2020.10.29", "version": "2020.12.29",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sass/sass-spec.git", "url": "https://github.com/sass/sass-spec.git",
"reference": "07094dab93a598795e8b04caec6ceae67a43f504" "reference": "d975d33146fb679a6b359ceca329012f02e4a794"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sass/sass-spec/zipball/07094dab93a598795e8b04caec6ceae67a43f504", "url": "https://api.github.com/repos/sass/sass-spec/zipball/d975d33146fb679a6b359ceca329012f02e4a794",
"reference": "07094dab93a598795e8b04caec6ceae67a43f504", "reference": "d975d33146fb679a6b359ceca329012f02e4a794",
"shasum": "" "shasum": ""
} }
} }

View File

@@ -33,6 +33,7 @@ if (! class_exists('ScssPhp\ScssPhp\Version', false)) {
include_once __DIR__ . '/src/SourceMap/Base64VLQ.php'; include_once __DIR__ . '/src/SourceMap/Base64VLQ.php';
include_once __DIR__ . '/src/SourceMap/SourceMapGenerator.php'; include_once __DIR__ . '/src/SourceMap/SourceMapGenerator.php';
include_once __DIR__ . '/src/Type.php'; include_once __DIR__ . '/src/Type.php';
include_once __DIR__ . '/src/Util/Path.php';
include_once __DIR__ . '/src/Util.php'; include_once __DIR__ . '/src/Util.php';
include_once __DIR__ . '/src/Version.php'; include_once __DIR__ . '/src/Version.php';
} }

View File

@@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp; namespace ScssPhp\ScssPhp;
use Exception; use Exception;
use ScssPhp\ScssPhp\Version;
/** /**
* The scss cache manager. * The scss cache manager.
@@ -156,6 +157,7 @@ class Cache
{ {
$t = [ $t = [
'version' => self::CACHE_VERSION, 'version' => self::CACHE_VERSION,
'scssphpVersion' => Version::VERSION,
'operation' => $operation, 'operation' => $operation,
'what' => $what, 'what' => $what,
'options' => $options 'options' => $options

View File

@@ -15,12 +15,14 @@ namespace ScssPhp\ScssPhp;
use ScssPhp\ScssPhp\Base\Range; use ScssPhp\ScssPhp\Base\Range;
use ScssPhp\ScssPhp\Compiler\Environment; use ScssPhp\ScssPhp\Compiler\Environment;
use ScssPhp\ScssPhp\Exception\CompilerException; use ScssPhp\ScssPhp\Exception\CompilerException;
use ScssPhp\ScssPhp\Exception\ParserException;
use ScssPhp\ScssPhp\Exception\SassScriptException; use ScssPhp\ScssPhp\Exception\SassScriptException;
use ScssPhp\ScssPhp\Formatter\Compressed; use ScssPhp\ScssPhp\Formatter\Compressed;
use ScssPhp\ScssPhp\Formatter\Expanded; use ScssPhp\ScssPhp\Formatter\Expanded;
use ScssPhp\ScssPhp\Formatter\OutputBlock; use ScssPhp\ScssPhp\Formatter\OutputBlock;
use ScssPhp\ScssPhp\Node\Number; use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\SourceMap\SourceMapGenerator; use ScssPhp\ScssPhp\SourceMap\SourceMapGenerator;
use ScssPhp\ScssPhp\Util\Path;
/** /**
* The scss compiler and parser. * The scss compiler and parser.
@@ -268,7 +270,7 @@ class Compiler
/** /**
* The directory of the currently processed file * The directory of the currently processed file
* *
* @var string * @var string|null
*/ */
private $currentDirectory; private $currentDirectory;
@@ -279,6 +281,8 @@ class Compiler
*/ */
private $rootDirectory; private $rootDirectory;
private $legacyCwdImportPath = true;
/** /**
* Constructor * Constructor
* *
@@ -311,6 +315,7 @@ class Compiler
'sourceMap' => serialize($this->sourceMap), 'sourceMap' => serialize($this->sourceMap),
'sourceMapOptions' => $this->sourceMapOptions, 'sourceMapOptions' => $this->sourceMapOptions,
'formatter' => $this->formatter, 'formatter' => $this->formatter,
'legacyImportPath' => $this->legacyCwdImportPath,
]; ];
return $options; return $options;
@@ -375,11 +380,13 @@ class Compiler
$this->ignoreCallStackMessage = false; $this->ignoreCallStackMessage = false;
if (!\is_null($path) && is_file($path)) { if (!\is_null($path) && is_file($path)) {
$this->currentDirectory = dirname(realpath($path) ?: $path); $path = realpath($path) ?: $path;
$this->currentDirectory = dirname($path);
$this->rootDirectory = $this->currentDirectory;
} else { } else {
$this->currentDirectory = getcwd(); $this->currentDirectory = null;
$this->rootDirectory = getcwd();
} }
$this->rootDirectory = $this->currentDirectory;
try { try {
$this->parser = $this->parserFactory($path); $this->parser = $this->parserFactory($path);
@@ -1806,7 +1813,13 @@ class Compiler
$buffer = $this->collapseSelectors($selectors); $buffer = $this->collapseSelectors($selectors);
$parser = $this->parserFactory(__METHOD__); $parser = $this->parserFactory(__METHOD__);
if ($parser->parseSelector($buffer, $newSelectors, true)) { try {
$isValid = $parser->parseSelector($buffer, $newSelectors, true);
} catch (ParserException $e) {
throw $this->error($e->getMessage());
}
if ($isValid) {
$selectors = array_map([$this, 'evalSelector'], $newSelectors); $selectors = array_map([$this, 'evalSelector'], $newSelectors);
} }
} }
@@ -5087,7 +5100,18 @@ class Compiler
*/ */
public function setImportPaths($path) public function setImportPaths($path)
{ {
$this->importPaths = (array) $path; $paths = (array) $path;
$actualImportPaths = array_filter($paths, function ($path) {
return $path !== '';
});
$this->legacyCwdImportPath = \count($actualImportPaths) !== \count($paths);
if ($this->legacyCwdImportPath) {
@trigger_error('Passing an empty string in the import paths to refer to the current working directory is deprecated. If that\'s the intended behavior, the value of "getcwd()" should be used directly instead. If this was used for resolving relative imports of the input alongside "chdir" with the source directory, the path of the input file should be passed to "compile()" instead.', E_USER_DEPRECATED);
}
$this->importPaths = $actualImportPaths;
} }
/** /**
@@ -5114,6 +5138,8 @@ class Compiler
* *
* @param string $style One of the OutputStyle constants * @param string $style One of the OutputStyle constants
* *
* @return void
*
* @phpstan-param OutputStyle::* $style * @phpstan-param OutputStyle::* $style
*/ */
public function setOutputStyle($style) public function setOutputStyle($style)
@@ -5313,10 +5339,12 @@ class Compiler
return null; return null;
} }
$relativePath = $this->resolveImportPath($url, $this->currentDirectory); if (!\is_null($this->currentDirectory)) {
$relativePath = $this->resolveImportPath($url, $this->currentDirectory);
if (!\is_null($relativePath)) { if (!\is_null($relativePath)) {
return $relativePath; return $relativePath;
}
} }
foreach ($this->importPaths as $dir) { foreach ($this->importPaths as $dir) {
@@ -5336,12 +5364,28 @@ class Compiler
} }
} }
if ($this->legacyCwdImportPath) {
$path = $this->resolveImportPath($url, getcwd());
if (!\is_null($path)) {
@trigger_error('Resolving imports relatively to the current working directory is deprecated. If that\'s the intended behavior, the value of "getcwd()" should be added as an import path explicitly instead. If this was used for resolving relative imports of the input alongside "chdir" with the source directory, the path of the input file should be passed to "compile()" instead.', E_USER_DEPRECATED);
return $path;
}
}
throw $this->error("`$url` file not found for @import"); throw $this->error("`$url` file not found for @import");
} }
/**
* @param string $url
* @param string $baseDir
*
* @return string|null
*/
private function resolveImportPath($url, $baseDir) private function resolveImportPath($url, $baseDir)
{ {
$path = rtrim($baseDir, '/').'/'.ltrim($url, '/'); $path = Path::join($baseDir, $url);
$hasExtension = preg_match('/.scss$/', $url); $hasExtension = preg_match('/.scss$/', $url);
@@ -8023,7 +8067,7 @@ class Compiler
* let extended chars untouched * let extended chars untouched
* *
* @param string $stringContent * @param string $stringContent
* @param string $filter * @param callable $filter
* @return string * @return string
*/ */
protected function stringTransformAsciiOnly($stringContent, $filter) protected function stringTransformAsciiOnly($stringContent, $filter)

View File

@@ -342,7 +342,7 @@ abstract class Formatter
); );
} }
$this->currentColumn = \strlen($lastLine); $this->currentColumn += \strlen($lastLine);
} }
echo $str; echo $str;

View File

@@ -1366,6 +1366,7 @@ class Parser
] ]
]; ];
case Type::T_CUSTOM_PROPERTY:
case Type::T_UNARY: case Type::T_UNARY:
$parsed[2] = $this->isPlainCssValidElement($parsed[2]); $parsed[2] = $this->isPlainCssValidElement($parsed[2]);
if (! $parsed[2]) { if (! $parsed[2]) {
@@ -3030,6 +3031,11 @@ class Parser
return false; return false;
} }
/**
* @param string $out
* @param bool $inKeywords
* @return bool
*/
protected function matchEscapeCharacter(&$out, $inKeywords = false) protected function matchEscapeCharacter(&$out, $inKeywords = false)
{ {
$s = $this->count; $s = $this->count;
@@ -3456,6 +3462,55 @@ class Parser
return true; return true;
} }
/**
* parsing escaped chars in selectors:
* - escaped single chars are kept escaped in the selector but in a normalized form
* (if not in 0-9a-f range as this would be ambigous)
* - other escaped sequences (multibyte chars or 0-9a-f) are kept in their initial escaped form,
* normalized to lowercase
*
* TODO: this is a fallback solution. Ideally escaped chars in selectors should be encoded as the genuine chars,
* and escaping added when printing in the Compiler, where/if it's mandatory
* - but this require a better formal selector representation instead of the array we have now
*
* @param string $out
* @param bool $keepEscapedNumber
* @return bool
*/
protected function matchEscapeCharacterInSelector(&$out, $keepEscapedNumber = false)
{
$s_escape = $this->count;
if ($this->match('\\\\', $m)) {
$out = '\\' . $m[0];
return true;
}
if ($this->matchEscapeCharacter($escapedout, true)) {
if (strlen($escapedout) === 1) {
if (!preg_match(",\w,", $escapedout)) {
$out = '\\' . $escapedout;
return true;
} elseif (! $keepEscapedNumber || ! \is_numeric($escapedout)) {
$out = $escapedout;
return true;
}
}
$escape_sequence = rtrim(substr($this->buffer, $s_escape, $this->count - $s_escape));
if (strlen($escape_sequence) < 6) {
$escape_sequence .= ' ';
}
$out = '\\' . strtolower($escape_sequence);
return true;
}
if ($this->match('\\S', $m)) {
$out = '\\' . $m[0];
return true;
}
return false;
}
/** /**
* Parse the parts that make up a selector * Parse the parts that make up a selector
* *
@@ -3516,9 +3571,14 @@ class Parser
continue 2; continue 2;
} }
if ($char === '\\' && $this->match('\\\\\S', $m)) { // handling of escaping in selectors : get the escaped char
$parts[] = $m[0]; if ($char === '\\') {
continue; $this->count++;
if ($this->matchEscapeCharacterInSelector($escaped, true)) {
$parts[] = $escaped;
continue;
}
$this->count--;
} }
if ($char === '%') { if ($char === '%') {
@@ -3661,7 +3721,7 @@ class Parser
continue; continue;
} }
if ($this->restrictedKeyword($name)) { if ($this->restrictedKeyword($name, false, true)) {
$parts[] = $name; $parts[] = $name;
continue; continue;
} }
@@ -3714,10 +3774,11 @@ class Parser
* *
* @param string $word * @param string $word
* @param boolean $eatWhitespace * @param boolean $eatWhitespace
* @param boolean $inSelector
* *
* @return boolean * @return boolean
*/ */
protected function keyword(&$word, $eatWhitespace = null) protected function keyword(&$word, $eatWhitespace = null, $inSelector = false)
{ {
$s = $this->count; $s = $this->count;
$match = $this->match( $match = $this->match(
@@ -3744,7 +3805,12 @@ class Parser
$this->count < $send $this->count < $send
&& $char === '\\' && $char === '\\'
&& !$previousEscape && !$previousEscape
&& $this->matchEscapeCharacter($out, true) && (
$inSelector ?
$this->matchEscapeCharacterInSelector($out)
:
$this->matchEscapeCharacter($out, true)
)
) { ) {
$escapedWord[] = $out; $escapedWord[] = $out;
} else { } else {
@@ -3775,14 +3841,15 @@ class Parser
* *
* @param string $word * @param string $word
* @param boolean $eatWhitespace * @param boolean $eatWhitespace
* @param boolean $inSelector
* *
* @return boolean * @return boolean
*/ */
protected function restrictedKeyword(&$word, $eatWhitespace = null) protected function restrictedKeyword(&$word, $eatWhitespace = null, $inSelector = false)
{ {
$s = $this->count; $s = $this->count;
if ($this->keyword($word, $eatWhitespace) && (\ord($word[0]) > 57 || \ord($word[0]) < 48)) { if ($this->keyword($word, $eatWhitespace, $inSelector) && (\ord($word[0]) > 57 || \ord($word[0]) < 48)) {
return true; return true;
} }

View File

@@ -0,0 +1,77 @@
<?php
namespace ScssPhp\ScssPhp\Util;
/**
* @internal
*/
class Path
{
/**
* @param string $path
*
* @return bool
*/
public static function isAbsolute($path)
{
if ($path === '') {
return false;
}
if ($path[0] === '/') {
return true;
}
if (\DIRECTORY_SEPARATOR !== '\\') {
return false;
}
if ($path[0] === '\\') {
return true;
}
if (\strlen($path) < 3) {
return false;
}
if ($path[1] !== ':') {
return false;
}
if ($path[2] !== '/' && $path[2] !== '\\') {
return false;
}
if (!preg_match('/^[A-Za-z]$/', $path[0])) {
return false;
}
return true;
}
/**
* @param string $part1
* @param string $part2
*
* @return string
*/
public static function join($part1, $part2)
{
if ($part1 === '' || self::isAbsolute($part2)) {
return $part2;
}
if ($part2 === '') {
return $part1;
}
$last = $part1[\strlen($part1) - 1];
$separator = \DIRECTORY_SEPARATOR;
if ($last === '/' || $last === \DIRECTORY_SEPARATOR) {
$separator = '';
}
return $part1 . $separator . $part2;
}
}

View File

@@ -19,5 +19,5 @@ namespace ScssPhp\ScssPhp;
*/ */
class Version class Version
{ {
const VERSION = '1.3'; const VERSION = '1.4.1';
} }