diff --git a/CHANGELOG.md b/CHANGELOG.md index eefddfcca..856e6dc41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# v1.10.41 +## 05/09/2023 + +1. [](#new) + * Updated to use new `BaconQRCode` version `2.0.8` for new SVG features + PHP 8.2+ fixes +1. [](#improved) + * Require Grav `v1.7.41` + * Fixed a deprecated message where `Admin::$routes` was being dynamically defined + * Fixes to use non-deprecated methods in `ScssCompiler` + # v1.10.40 ## 03/22/2023 diff --git a/blueprints.yaml b/blueprints.yaml index 89d050031..c893ad4a4 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,7 +1,7 @@ name: Admin Panel slug: admin type: plugin -version: 1.10.40 +version: 1.10.41 description: Adds an advanced administration panel to manage your site icon: empire author: @@ -15,7 +15,7 @@ docs: https://github.com/getgrav/grav-plugin-admin/blob/develop/README.md license: MIT dependencies: - - { name: grav, version: '>=1.7.32' } + - { name: grav, version: '>=1.7.41' } - { name: form, version: '>=6.0.1' } - { name: login, version: '>=3.7.0' } - { name: email, version: '>=3.1.6' } diff --git a/classes/plugin/Admin.php b/classes/plugin/Admin.php index 1d6dee84b..3d489dde9 100644 --- a/classes/plugin/Admin.php +++ b/classes/plugin/Admin.php @@ -102,6 +102,9 @@ class Admin /** @var array */ public $languages_enabled = []; /** @var Uri $uri */ + + /** @var array */ + public $routes = []; protected $uri; /** @var array */ protected $pages = []; diff --git a/classes/plugin/ScssCompiler.php b/classes/plugin/ScssCompiler.php index 66f01791b..f8aac9733 100644 --- a/classes/plugin/ScssCompiler.php +++ b/classes/plugin/ScssCompiler.php @@ -10,6 +10,7 @@ namespace Grav\Plugin\Admin; use ScssPhp\ScssPhp\Compiler; +use ScssPhp\ScssPhp\ValueConverter; class ScssCompiler { @@ -31,7 +32,13 @@ public function reset() public function setVariables(array $variables) { - $this->compiler()->setVariables($variables); +// $parsed = ValueConverter::fromPhp($variables); + $parsed = []; + foreach ($variables as $key => $value) { + $parsed[$key] = ValueConverter::parseValue($value); + } + + $this->compiler()->addVariables($parsed); return $this; } @@ -55,7 +62,7 @@ public function compileAll(array $input_paths, string $output_file) foreach ($input_paths as $input_file) { $input .= trim(file_get_contents($input_file)) . "\n\n"; } - $output = $this->compiler()->compile($input); + $output = $this->compiler()->compileString($input)->getCss(); file_put_contents($output_file, $output); return $this; } diff --git a/composer.json b/composer.json index 3d532955e..328482a1d 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "require": { "php": "^7.3.6 || ^8.0", "ext-json": "*", - "scssphp/scssphp": "^1.7", + "scssphp/scssphp": "^1.11", "laminas/laminas-zendframework-bridge": "^1.4", "p3k/picofeed": "@stable" }, diff --git a/composer.lock b/composer.lock index 49bfa02bc..633fd393a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "1f6a6bec99c3a85ac753a1548c22f5d7", + "content-hash": "bc8a9ba032ce28a2c93282b6f1a6e7b9", "packages": [ { "name": "laminas/laminas-xml", @@ -900,16 +900,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "1.9.0", + "version": "1.9.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318" + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", - "reference": "e98e3e6d4f86621a9b75f623996e6bbdeb4b9318", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", "shasum": "" }, "require": { @@ -928,11 +928,6 @@ "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, "autoload": { "files": [ "src/functions_include.php" @@ -990,7 +985,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.0" + "source": "https://github.com/guzzle/psr7/tree/1.9.1" }, "funding": [ { @@ -1006,7 +1001,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T21:43:03+00:00" + "time": "2023-04-17T16:00:37+00:00" }, { "name": "myclabs/deep-copy", @@ -1834,25 +1829,25 @@ }, { "name": "psr/http-message", - "version": "1.0.1", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", "shasum": "" }, "require": { - "php": ">=5.3.0" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -1881,9 +1876,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/master" + "source": "https://github.com/php-fig/http-message/tree/1.1" }, - "time": "2016-08-06T14:39:51+00:00" + "time": "2023-04-04T09:50:52+00:00" }, { "name": "ralouphie/getallheaders", @@ -2060,16 +2055,16 @@ }, { "name": "sebastian/diff", - "version": "3.0.3", + "version": "3.0.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" + "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6296a0c086dd0117c1b78b059374d7fcbe7545ae", + "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae", "shasum": "" }, "require": { @@ -2114,7 +2109,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.4" }, "funding": [ { @@ -2122,7 +2117,7 @@ "type": "github" } ], - "time": "2020-11-30T07:59:04+00:00" + "time": "2023-05-07T05:30:20+00:00" }, { "name": "sebastian/environment", diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index c6b54af7b..51e734a77 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -98,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -119,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -328,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -340,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index fa3c0344f..df6216671 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'getgrav/grav-plugin-admin', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '5f1b3e1e4a413bf5e45e99b8d5aa174b6806c12c', + 'reference' => 'be85fb4194474700fbd8fe60b48b27613b47ce59', 'type' => 'grav-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'getgrav/grav-plugin-admin' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '5f1b3e1e4a413bf5e45e99b8d5aa174b6806c12c', + 'reference' => 'be85fb4194474700fbd8fe60b48b27613b47ce59', 'type' => 'grav-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),