Updated composer dependencies
This commit is contained in:
parent
085622b5ac
commit
2cadabe7de
|
@ -206,16 +206,16 @@
|
|||
},
|
||||
{
|
||||
"name": "openpsa/universalfeedcreator",
|
||||
"version": "v1.8.5",
|
||||
"version": "v1.8.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/flack/UniversalFeedCreator.git",
|
||||
"reference": "d07a9f54e4fe522d8fefaf99564efd675932a635"
|
||||
"reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/d07a9f54e4fe522d8fefaf99564efd675932a635",
|
||||
"reference": "d07a9f54e4fe522d8fefaf99564efd675932a635",
|
||||
"url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/3abf36ef9d3a3b31a3c330caea7d5176f0396301",
|
||||
"reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -255,9 +255,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/flack/UniversalFeedCreator/issues",
|
||||
"source": "https://github.com/flack/UniversalFeedCreator/tree/v1.8.5"
|
||||
"source": "https://github.com/flack/UniversalFeedCreator/tree/v1.8.6"
|
||||
},
|
||||
"time": "2023-04-17T12:24:35+00:00"
|
||||
"time": "2024-01-23T15:59:31+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/constant_time_encoding",
|
||||
|
@ -378,16 +378,16 @@
|
|||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "3.0.34",
|
||||
"version": "3.0.35",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a"
|
||||
"reference": "4b1827beabce71953ca479485c0ae9c51287f2fe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56c79f16a6ae17e42089c06a2144467acc35348a",
|
||||
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe",
|
||||
"reference": "4b1827beabce71953ca479485c0ae9c51287f2fe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -468,7 +468,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.34"
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.35"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -484,7 +484,7 @@
|
|||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2023-11-27T11:13:31+00:00"
|
||||
"time": "2023-12-29T01:59:53+00:00"
|
||||
},
|
||||
{
|
||||
"name": "simplepie/simplepie",
|
||||
|
@ -624,16 +624,16 @@
|
|||
},
|
||||
{
|
||||
"name": "splitbrain/php-cli",
|
||||
"version": "1.2.1",
|
||||
"version": "1.3.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/splitbrain/php-cli.git",
|
||||
"reference": "47cd2b2c1d976d22afb01e121985d59c4f98c031"
|
||||
"reference": "844609ef16b8486691b7fd892d54478918f27fe8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/splitbrain/php-cli/zipball/47cd2b2c1d976d22afb01e121985d59c4f98c031",
|
||||
"reference": "47cd2b2c1d976d22afb01e121985d59c4f98c031",
|
||||
"url": "https://api.github.com/repos/splitbrain/php-cli/zipball/844609ef16b8486691b7fd892d54478918f27fe8",
|
||||
"reference": "844609ef16b8486691b7fd892d54478918f27fe8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -673,9 +673,9 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/splitbrain/php-cli/issues",
|
||||
"source": "https://github.com/splitbrain/php-cli/tree/1.2.1"
|
||||
"source": "https://github.com/splitbrain/php-cli/tree/1.3.1"
|
||||
},
|
||||
"time": "2022-11-04T11:59:39+00:00"
|
||||
"time": "2024-01-17T12:03:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "splitbrain/php-jsstrip",
|
||||
|
@ -729,18 +729,21 @@
|
|||
},
|
||||
{
|
||||
"name": "splitbrain/slika",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/splitbrain/slika.git",
|
||||
"reference": "be0785cb6b7def847df5d92e0e5fde57def7220f"
|
||||
"reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/splitbrain/slika/zipball/be0785cb6b7def847df5d92e0e5fde57def7220f",
|
||||
"reference": "be0785cb6b7def847df5d92e0e5fde57def7220f",
|
||||
"url": "https://api.github.com/repos/splitbrain/slika/zipball/274511fc654fa29cb7cfc039bed97a5ea786f1a0",
|
||||
"reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.0"
|
||||
},
|
||||
|
@ -767,9 +770,9 @@
|
|||
"description": "Simple image resizing",
|
||||
"support": {
|
||||
"issues": "https://github.com/splitbrain/slika/issues",
|
||||
"source": "https://github.com/splitbrain/slika/tree/1.0.5"
|
||||
"source": "https://github.com/splitbrain/slika/tree/1.0.6"
|
||||
},
|
||||
"time": "2022-02-04T22:41:26+00:00"
|
||||
"time": "2023-10-26T10:06:48+00:00"
|
||||
}
|
||||
],
|
||||
"packages-dev": [],
|
||||
|
@ -795,5 +798,5 @@
|
|||
"platform-overrides": {
|
||||
"php": "7.4"
|
||||
},
|
||||
"plugin-api-version": "2.3.0"
|
||||
"plugin-api-version": "2.6.0"
|
||||
}
|
||||
|
|
|
@ -45,35 +45,34 @@ class ClassLoader
|
|||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var ?string */
|
||||
/** @var string|null */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
* @var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
* @var array<string, list<string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var list<string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
|
@ -81,8 +80,7 @@ class ClassLoader
|
|||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
* @var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
|
@ -90,21 +88,20 @@ class ClassLoader
|
|||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
* @var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var ?string */
|
||||
/** @var string|null */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var self[]
|
||||
* @var array<string, self>
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param ?string $vendorDir
|
||||
* @param string|null $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
|
@ -113,7 +110,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
|
@ -125,8 +122,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
* @return array<string, list<string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
|
@ -134,8 +130,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
|
@ -143,8 +138,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
|
@ -152,8 +146,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
* @return array<string, string> Array of classname => path
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
|
@ -161,8 +154,7 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -179,24 +171,25 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -205,19 +198,19 @@ class ClassLoader
|
|||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -226,9 +219,9 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
|
@ -236,17 +229,18 @@ class ClassLoader
|
|||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
|
@ -256,18 +250,18 @@ class ClassLoader
|
|||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
(array) $paths,
|
||||
$paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
(array) $paths
|
||||
$paths
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -276,8 +270,8 @@ class ClassLoader
|
|||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
@ -294,8 +288,8 @@ class ClassLoader
|
|||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
|
@ -481,9 +475,9 @@ class ClassLoader
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
*
|
||||
* @return self[]
|
||||
* @return array<string, self>
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
|
|
|
@ -98,7 +98,7 @@ class InstalledVersions
|
|||
{
|
||||
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 @@ class InstalledVersions
|
|||
*/
|
||||
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 @@ class InstalledVersions
|
|||
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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $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 @@ class InstalledVersions
|
|||
// 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<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $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;
|
||||
}
|
||||
|
|
|
@ -208,17 +208,17 @@
|
|||
},
|
||||
{
|
||||
"name": "openpsa/universalfeedcreator",
|
||||
"version": "v1.8.5",
|
||||
"version_normalized": "1.8.5.0",
|
||||
"version": "v1.8.6",
|
||||
"version_normalized": "1.8.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/flack/UniversalFeedCreator.git",
|
||||
"reference": "d07a9f54e4fe522d8fefaf99564efd675932a635"
|
||||
"reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/d07a9f54e4fe522d8fefaf99564efd675932a635",
|
||||
"reference": "d07a9f54e4fe522d8fefaf99564efd675932a635",
|
||||
"url": "https://api.github.com/repos/flack/UniversalFeedCreator/zipball/3abf36ef9d3a3b31a3c330caea7d5176f0396301",
|
||||
"reference": "3abf36ef9d3a3b31a3c330caea7d5176f0396301",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -227,7 +227,7 @@
|
|||
"require-dev": {
|
||||
"phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.32 || ^9.5.10"
|
||||
},
|
||||
"time": "2023-04-17T12:24:35+00:00",
|
||||
"time": "2024-01-23T15:59:31+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -260,7 +260,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/flack/UniversalFeedCreator/issues",
|
||||
"source": "https://github.com/flack/UniversalFeedCreator/tree/v1.8.5"
|
||||
"source": "https://github.com/flack/UniversalFeedCreator/tree/v1.8.6"
|
||||
},
|
||||
"install-path": "../openpsa/universalfeedcreator"
|
||||
},
|
||||
|
@ -389,17 +389,17 @@
|
|||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "3.0.34",
|
||||
"version_normalized": "3.0.34.0",
|
||||
"version": "3.0.35",
|
||||
"version_normalized": "3.0.35.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a"
|
||||
"reference": "4b1827beabce71953ca479485c0ae9c51287f2fe"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/56c79f16a6ae17e42089c06a2144467acc35348a",
|
||||
"reference": "56c79f16a6ae17e42089c06a2144467acc35348a",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/4b1827beabce71953ca479485c0ae9c51287f2fe",
|
||||
"reference": "4b1827beabce71953ca479485c0ae9c51287f2fe",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -417,7 +417,7 @@
|
|||
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
|
||||
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
|
||||
},
|
||||
"time": "2023-11-27T11:13:31+00:00",
|
||||
"time": "2023-12-29T01:59:53+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -482,7 +482,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.34"
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.35"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
|
@ -644,17 +644,17 @@
|
|||
},
|
||||
{
|
||||
"name": "splitbrain/php-cli",
|
||||
"version": "1.2.1",
|
||||
"version_normalized": "1.2.1.0",
|
||||
"version": "1.3.1",
|
||||
"version_normalized": "1.3.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/splitbrain/php-cli.git",
|
||||
"reference": "47cd2b2c1d976d22afb01e121985d59c4f98c031"
|
||||
"reference": "844609ef16b8486691b7fd892d54478918f27fe8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/splitbrain/php-cli/zipball/47cd2b2c1d976d22afb01e121985d59c4f98c031",
|
||||
"reference": "47cd2b2c1d976d22afb01e121985d59c4f98c031",
|
||||
"url": "https://api.github.com/repos/splitbrain/php-cli/zipball/844609ef16b8486691b7fd892d54478918f27fe8",
|
||||
"reference": "844609ef16b8486691b7fd892d54478918f27fe8",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
|
@ -666,7 +666,7 @@
|
|||
"suggest": {
|
||||
"psr/log": "Allows you to make the CLI available as PSR-3 logger"
|
||||
},
|
||||
"time": "2022-11-04T11:59:39+00:00",
|
||||
"time": "2024-01-17T12:03:34+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -696,7 +696,7 @@
|
|||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/splitbrain/php-cli/issues",
|
||||
"source": "https://github.com/splitbrain/php-cli/tree/1.2.1"
|
||||
"source": "https://github.com/splitbrain/php-cli/tree/1.3.1"
|
||||
},
|
||||
"install-path": "../splitbrain/php-cli"
|
||||
},
|
||||
|
@ -755,26 +755,29 @@
|
|||
},
|
||||
{
|
||||
"name": "splitbrain/slika",
|
||||
"version": "1.0.5",
|
||||
"version_normalized": "1.0.5.0",
|
||||
"version": "1.0.6",
|
||||
"version_normalized": "1.0.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/splitbrain/slika.git",
|
||||
"reference": "be0785cb6b7def847df5d92e0e5fde57def7220f"
|
||||
"reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/splitbrain/slika/zipball/be0785cb6b7def847df5d92e0e5fde57def7220f",
|
||||
"reference": "be0785cb6b7def847df5d92e0e5fde57def7220f",
|
||||
"url": "https://api.github.com/repos/splitbrain/slika/zipball/274511fc654fa29cb7cfc039bed97a5ea786f1a0",
|
||||
"reference": "274511fc654fa29cb7cfc039bed97a5ea786f1a0",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gd": "PHP's builtin image manipulation library. Alternatively use an installation of ImageMagick"
|
||||
},
|
||||
"time": "2022-02-04T22:41:26+00:00",
|
||||
"time": "2023-10-26T10:06:48+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
|
@ -796,7 +799,7 @@
|
|||
"description": "Simple image resizing",
|
||||
"support": {
|
||||
"issues": "https://github.com/splitbrain/slika/issues",
|
||||
"source": "https://github.com/splitbrain/slika/tree/1.0.5"
|
||||
"source": "https://github.com/splitbrain/slika/tree/1.0.6"
|
||||
},
|
||||
"install-path": "../splitbrain/slika"
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
'name' => 'dokuwiki/dokuwiki',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '64782ba777686674a0d1a8d5816c05549654fe7a',
|
||||
'reference' => 'e860a4fbf1abc8ba96c4cd6c00e8f6efd6510d50',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
@ -22,7 +22,7 @@
|
|||
'dokuwiki/dokuwiki' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '64782ba777686674a0d1a8d5816c05549654fe7a',
|
||||
'reference' => 'e860a4fbf1abc8ba96c4cd6c00e8f6efd6510d50',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
|
@ -59,9 +59,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'openpsa/universalfeedcreator' => array(
|
||||
'pretty_version' => 'v1.8.5',
|
||||
'version' => '1.8.5.0',
|
||||
'reference' => 'd07a9f54e4fe522d8fefaf99564efd675932a635',
|
||||
'pretty_version' => 'v1.8.6',
|
||||
'version' => '1.8.6.0',
|
||||
'reference' => '3abf36ef9d3a3b31a3c330caea7d5176f0396301',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../openpsa/universalfeedcreator',
|
||||
'aliases' => array(),
|
||||
|
@ -86,9 +86,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'phpseclib/phpseclib' => array(
|
||||
'pretty_version' => '3.0.34',
|
||||
'version' => '3.0.34.0',
|
||||
'reference' => '56c79f16a6ae17e42089c06a2144467acc35348a',
|
||||
'pretty_version' => '3.0.35',
|
||||
'version' => '3.0.35.0',
|
||||
'reference' => '4b1827beabce71953ca479485c0ae9c51287f2fe',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpseclib/phpseclib',
|
||||
'aliases' => array(),
|
||||
|
@ -113,9 +113,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'splitbrain/php-cli' => array(
|
||||
'pretty_version' => '1.2.1',
|
||||
'version' => '1.2.1.0',
|
||||
'reference' => '47cd2b2c1d976d22afb01e121985d59c4f98c031',
|
||||
'pretty_version' => '1.3.1',
|
||||
'version' => '1.3.1.0',
|
||||
'reference' => '844609ef16b8486691b7fd892d54478918f27fe8',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../splitbrain/php-cli',
|
||||
'aliases' => array(),
|
||||
|
@ -131,9 +131,9 @@
|
|||
'dev_requirement' => false,
|
||||
),
|
||||
'splitbrain/slika' => array(
|
||||
'pretty_version' => '1.0.5',
|
||||
'version' => '1.0.5.0',
|
||||
'reference' => 'be0785cb6b7def847df5d92e0e5fde57def7220f',
|
||||
'pretty_version' => '1.0.6',
|
||||
'version' => '1.0.6.0',
|
||||
'reference' => '274511fc654fa29cb7cfc039bed97a5ea786f1a0',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../splitbrain/slika',
|
||||
'aliases' => array(),
|
||||
|
|
|
@ -52,6 +52,8 @@ abstract class FeedCreator extends HtmlDescribable
|
|||
*/
|
||||
protected $encoding = "UTF-8"; //"ISO-8859-1";
|
||||
|
||||
protected $_timeout; # lib/Creator/FeedCreator.php line 238
|
||||
|
||||
/**
|
||||
* Any additional elements to include as an associated array. All $key => $value pairs
|
||||
* will be included unencoded in the feed in the form
|
||||
|
|
|
@ -59,7 +59,6 @@ class KMLCreator extends FeedCreator
|
|||
$feed .= " <name>".FeedCreator::iTrunc(htmlspecialchars($this->title), 100)."</name>
|
||||
<description>".$this->getDescription()."</description>
|
||||
<visibility>1</visibility>\n";
|
||||
$this->truncSize = 500;
|
||||
|
||||
for ($i = 0; $i < count($this->items); $i++) {
|
||||
//added here beucase description gets auto surrounded by cdata
|
||||
|
|
|
@ -24,7 +24,6 @@ class PHPCreator extends FeedCreator
|
|||
$feed = "<?php\n";
|
||||
$feed .= "class FeedItem {}\n";
|
||||
$feed .= " \$feedTitle='".addslashes(FeedCreator::iTrunc(htmlspecialchars($this->title), 100))."';\n";
|
||||
$this->truncSize = 500;
|
||||
$feed .= " \$feedDescription='".addslashes($this->getDescription())."';\n";
|
||||
$feed .= " \$feedLink='".$this->link."';\n";
|
||||
$feed .= " \$feedItem = array();\n";
|
||||
|
|
|
@ -26,7 +26,6 @@ class PIECreator01 extends FeedCreator
|
|||
$feed .= $this->_createStylesheetReferences();
|
||||
$feed .= "<feed version=\"0.1\" xmlns=\"http://example.com/newformat#\">\n";
|
||||
$feed .= " <title>".FeedCreator::iTrunc(htmlspecialchars($this->title), 100)."</title>\n";
|
||||
$this->truncSize = 500;
|
||||
$feed .= " <subtitle>".$this->getDescription()."</subtitle>\n";
|
||||
$feed .= " <link>".$this->link."</link>\n";
|
||||
for ($i = 0; $i < count($this->items); $i++) {
|
||||
|
|
|
@ -51,7 +51,7 @@ SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 /
|
|||
* PHP4 compatible
|
||||
* Composer compatible (PSR-0 autoloading)
|
||||
* Install using Composer: `composer require phpseclib/phpseclib:~1.0`
|
||||
* [Download 1.0.21 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.21.zip/download)
|
||||
* [Download 1.0.22 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.22.zip/download)
|
||||
|
||||
## Security contact information
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ abstract class AsymmetricKey
|
|||
|
||||
/**
|
||||
* @param string $type
|
||||
* @return string
|
||||
* @return array|string
|
||||
*/
|
||||
abstract public function toString($type, array $options = []);
|
||||
|
||||
|
@ -382,7 +382,7 @@ abstract class AsymmetricKey
|
|||
$shortname = $meta->getShortName();
|
||||
self::$plugins[static::ALGORITHM]['Keys'][strtolower($shortname)] = $fullname;
|
||||
if ($meta->hasConstant('IS_INVISIBLE')) {
|
||||
self::$invisiblePlugins[static::ALGORITHM] = strtolower($name);
|
||||
self::$invisiblePlugins[static::ALGORITHM][] = strtolower($shortname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -668,11 +668,13 @@ abstract class SymmetricKey
|
|||
switch (true) {
|
||||
// PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster
|
||||
case (PHP_OS & "\xDF\xDF\xDF") === 'WIN':
|
||||
case !(is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM'):
|
||||
case !function_exists('php_uname'):
|
||||
case !is_string(php_uname('m')):
|
||||
case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM':
|
||||
case defined('PHP_INT_SIZE') && PHP_INT_SIZE == 8:
|
||||
self::$use_reg_intval = true;
|
||||
break;
|
||||
case is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
|
||||
case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM':
|
||||
switch (true) {
|
||||
/* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors:
|
||||
|
||||
|
|
|
@ -332,6 +332,7 @@ abstract class RSA extends AsymmetricKey
|
|||
openssl_pkey_export($rsa, $privatekeystr, null, $config);
|
||||
|
||||
// clear the buffer of error strings stemming from a minimalistic openssl.cnf
|
||||
// https://github.com/php/php-src/issues/11054 talks about other errors this'll pick up
|
||||
while (openssl_error_string() !== false) {
|
||||
}
|
||||
|
||||
|
|
|
@ -3295,6 +3295,7 @@ class SFTP extends SSH2
|
|||
$this->use_request_id = false;
|
||||
$this->pwd = false;
|
||||
$this->requestBuffer = [];
|
||||
$this->partial_init = false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1102,6 +1102,16 @@ class SSH2
|
|||
*/
|
||||
private $errorOnMultipleChannels;
|
||||
|
||||
/**
|
||||
* Terrapin Countermeasure
|
||||
*
|
||||
* "During initial KEX, terminate the connection if any unexpected or out-of-sequence packet is received"
|
||||
* -- https://github.com/openssh/openssh-portable/commit/1edb00c58f8a6875fad6a497aa2bacf37f9e6cd5
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
private $extra_packets;
|
||||
|
||||
/**
|
||||
* Default Constructor.
|
||||
*
|
||||
|
@ -1536,7 +1546,7 @@ class SSH2
|
|||
$preferred['client_to_server']['comp'] :
|
||||
SSH2::getSupportedCompressionAlgorithms();
|
||||
|
||||
$kex_algorithms = array_merge($kex_algorithms, array('ext-info-c'));
|
||||
$kex_algorithms = array_merge($kex_algorithms, ['ext-info-c', 'kex-strict-c-v00@openssh.com']);
|
||||
|
||||
// some SSH servers have buggy implementations of some of the above algorithms
|
||||
switch (true) {
|
||||
|
@ -1592,6 +1602,7 @@ class SSH2
|
|||
if ($kexinit_payload_server === false) {
|
||||
$this->send_binary_packet($kexinit_payload_client);
|
||||
|
||||
$this->extra_packets = 0;
|
||||
$kexinit_payload_server = $this->get_binary_packet();
|
||||
|
||||
if (
|
||||
|
@ -1623,6 +1634,11 @@ class SSH2
|
|||
$this->languages_server_to_client,
|
||||
$first_kex_packet_follows
|
||||
) = Strings::unpackSSH2('L10C', $response);
|
||||
if (in_array('kex-strict-s-v00@openssh.com', $this->kex_algorithms)) {
|
||||
if ($this->session_id === false && $this->extra_packets) {
|
||||
throw new \UnexpectedValueException('Possible Terrapin Attack detected');
|
||||
}
|
||||
}
|
||||
|
||||
$this->supported_private_key_algorithms = $this->server_host_key_algorithms;
|
||||
|
||||
|
@ -1881,6 +1897,10 @@ class SSH2
|
|||
throw new \UnexpectedValueException('Expected SSH_MSG_NEWKEYS');
|
||||
}
|
||||
|
||||
if (in_array('kex-strict-s-v00@openssh.com', $this->kex_algorithms)) {
|
||||
$this->get_seq_no = $this->send_seq_no = 0;
|
||||
}
|
||||
|
||||
$keyBytes = pack('Na*', strlen($keyBytes), $keyBytes);
|
||||
|
||||
$this->encrypt = self::encryption_algorithm_to_crypt_instance($encrypt);
|
||||
|
@ -2193,7 +2213,9 @@ class SSH2
|
|||
*/
|
||||
public function login($username, ...$args)
|
||||
{
|
||||
$this->auth[] = func_get_args();
|
||||
if (!$this->retry_connect) {
|
||||
$this->auth[] = func_get_args();
|
||||
}
|
||||
|
||||
// try logging with 'none' as an authentication method first since that's what
|
||||
// PuTTY does
|
||||
|
@ -3767,9 +3789,11 @@ class SSH2
|
|||
$this->bitmap = 0;
|
||||
return false;
|
||||
case NET_SSH2_MSG_IGNORE:
|
||||
$this->extra_packets++;
|
||||
$payload = $this->get_binary_packet($skip_channel_filter);
|
||||
break;
|
||||
case NET_SSH2_MSG_DEBUG:
|
||||
$this->extra_packets++;
|
||||
Strings::shift($payload, 2); // second byte is "always_display"
|
||||
list($message) = Strings::unpackSSH2('s', $payload);
|
||||
$this->errors[] = "SSH_MSG_DEBUG: $message";
|
||||
|
@ -3778,6 +3802,7 @@ class SSH2
|
|||
case NET_SSH2_MSG_UNIMPLEMENTED:
|
||||
return false;
|
||||
case NET_SSH2_MSG_KEXINIT:
|
||||
// this is here for key re-exchanges after the initial key exchange
|
||||
if ($this->session_id !== false) {
|
||||
if (!$this->key_exchange($payload)) {
|
||||
$this->bitmap = 0;
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace splitbrain\phpcli;
|
|||
* Class CLIBase
|
||||
*
|
||||
* All base functionality is implemented here.
|
||||
*
|
||||
*
|
||||
* Your commandline should not inherit from this class, but from one of the *CLI* classes
|
||||
*
|
||||
* @author Andreas Gohr <andi@splitbrain.org>
|
||||
|
@ -21,19 +21,65 @@ abstract class Base
|
|||
/** @var Colors */
|
||||
public $colors;
|
||||
|
||||
/** @var array PSR-3 compatible loglevels and their prefix, color, output channel */
|
||||
/** @var array PSR-3 compatible loglevels and their prefix, color, output channel, enabled status */
|
||||
protected $loglevel = array(
|
||||
'debug' => array('', Colors::C_RESET, STDOUT),
|
||||
'info' => array('ℹ ', Colors::C_CYAN, STDOUT),
|
||||
'notice' => array('☛ ', Colors::C_CYAN, STDOUT),
|
||||
'success' => array('✓ ', Colors::C_GREEN, STDOUT),
|
||||
'warning' => array('⚠ ', Colors::C_BROWN, STDERR),
|
||||
'error' => array('✗ ', Colors::C_RED, STDERR),
|
||||
'critical' => array('☠ ', Colors::C_LIGHTRED, STDERR),
|
||||
'alert' => array('✖ ', Colors::C_LIGHTRED, STDERR),
|
||||
'emergency' => array('✘ ', Colors::C_LIGHTRED, STDERR),
|
||||
'debug' => array(
|
||||
'icon' => '',
|
||||
'color' => Colors::C_RESET,
|
||||
'channel' => STDOUT,
|
||||
'enabled' => true
|
||||
),
|
||||
'info' => array(
|
||||
'icon' => 'ℹ ',
|
||||
'color' => Colors::C_CYAN,
|
||||
'channel' => STDOUT,
|
||||
'enabled' => true
|
||||
),
|
||||
'notice' => array(
|
||||
'icon' => '☛ ',
|
||||
'color' => Colors::C_CYAN,
|
||||
'channel' => STDOUT,
|
||||
'enabled' => true
|
||||
),
|
||||
'success' => array(
|
||||
'icon' => '✓ ',
|
||||
'color' => Colors::C_GREEN,
|
||||
'channel' => STDOUT,
|
||||
'enabled' => true
|
||||
),
|
||||
'warning' => array(
|
||||
'icon' => '⚠ ',
|
||||
'color' => Colors::C_BROWN,
|
||||
'channel' => STDERR,
|
||||
'enabled' => true
|
||||
),
|
||||
'error' => array(
|
||||
'icon' => '✗ ',
|
||||
'color' => Colors::C_RED,
|
||||
'channel' => STDERR,
|
||||
'enabled' => true
|
||||
),
|
||||
'critical' => array(
|
||||
'icon' => '☠ ',
|
||||
'color' => Colors::C_LIGHTRED,
|
||||
'channel' => STDERR,
|
||||
'enabled' => true
|
||||
),
|
||||
'alert' => array(
|
||||
'icon' => '✖ ',
|
||||
'color' => Colors::C_LIGHTRED,
|
||||
'channel' => STDERR,
|
||||
'enabled' => true
|
||||
),
|
||||
'emergency' => array(
|
||||
'icon' => '✘ ',
|
||||
'color' => Colors::C_LIGHTRED,
|
||||
'channel' => STDERR,
|
||||
'enabled' => true
|
||||
),
|
||||
);
|
||||
|
||||
/** @var string default log level */
|
||||
protected $logdefault = 'info';
|
||||
|
||||
/**
|
||||
|
@ -144,11 +190,7 @@ abstract class Base
|
|||
protected function setupLogging()
|
||||
{
|
||||
$level = $this->options->getOpt('loglevel', $this->logdefault);
|
||||
if (!isset($this->loglevel[$level])) $this->fatal('Unknown log level');
|
||||
foreach (array_keys($this->loglevel) as $l) {
|
||||
if ($l == $level) break;
|
||||
unset($this->loglevel[$l]);
|
||||
}
|
||||
$this->setLogLevel($level);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,6 +221,33 @@ abstract class Base
|
|||
|
||||
// region logging
|
||||
|
||||
/**
|
||||
* Set the current log level
|
||||
*
|
||||
* @param string $level
|
||||
*/
|
||||
public function setLogLevel($level)
|
||||
{
|
||||
if (!isset($this->loglevel[$level])) $this->fatal('Unknown log level');
|
||||
$enable = false;
|
||||
foreach (array_keys($this->loglevel) as $l) {
|
||||
if ($l == $level) $enable = true;
|
||||
$this->loglevel[$l]['enabled'] = $enable;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a message with the given level should be logged
|
||||
*
|
||||
* @param string $level
|
||||
* @return bool
|
||||
*/
|
||||
public function isLogLevelEnabled($level)
|
||||
{
|
||||
if (!isset($this->loglevel[$level])) $this->fatal('Unknown log level');
|
||||
return $this->loglevel[$level]['enabled'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Exits the program on a fatal error
|
||||
*
|
||||
|
@ -222,17 +291,20 @@ abstract class Base
|
|||
*/
|
||||
protected function logMessage($level, $message, array $context = array())
|
||||
{
|
||||
// is this log level wanted?
|
||||
if (!isset($this->loglevel[$level])) return;
|
||||
// unknown level is always an error
|
||||
if (!isset($this->loglevel[$level])) $level = 'error';
|
||||
|
||||
/** @var string $prefix */
|
||||
/** @var string $color */
|
||||
/** @var resource $channel */
|
||||
list($prefix, $color, $channel) = $this->loglevel[$level];
|
||||
if (!$this->colors->isEnabled()) $prefix = '';
|
||||
$info = $this->loglevel[$level];
|
||||
if (!$this->isLogLevelEnabled($level)) return; // no logging for this level
|
||||
|
||||
$message = $this->interpolate($message, $context);
|
||||
$this->colors->ptln($prefix . $message, $color, $channel);
|
||||
|
||||
// when colors are wanted, we also add the icon
|
||||
if ($this->colors->isEnabled()) {
|
||||
$message = $info['icon'] . $message;
|
||||
}
|
||||
|
||||
$this->colors->ptln($message, $info['color'], $info['channel']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +0,0 @@
|
|||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.xcf filter=lfs diff=lfs merge=lfs -text
|
||||
*.bmp filter=lfs diff=lfs merge=lfs -text
|
|
@ -1,3 +0,0 @@
|
|||
vendor/
|
||||
artefacts/
|
||||
.phpunit.result.cache
|
|
@ -18,6 +18,9 @@
|
|||
"splitbrain\\slika\\": "src"
|
||||
}
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^8.0"
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ namespace splitbrain\slika;
|
|||
*/
|
||||
abstract class Adapter
|
||||
{
|
||||
/** @var string path tot he image */
|
||||
/** @var string path to the image */
|
||||
protected $imagepath;
|
||||
|
||||
/** @var array Adapter Options */
|
||||
|
|
|
@ -231,32 +231,56 @@ class GdAdapter extends Adapter
|
|||
}
|
||||
|
||||
//keep gif transparent color if possible
|
||||
if ($this->extension == 'gif' && function_exists('imagefill') && function_exists('imagecolorallocate')) {
|
||||
if (function_exists('imagecolorsforindex') && function_exists('imagecolortransparent')) {
|
||||
$transcolorindex = @imagecolortransparent($this->image);
|
||||
if ($transcolorindex >= 0) { //transparent color exists
|
||||
$transcolor = @imagecolorsforindex($this->image, $transcolorindex);
|
||||
$transcolorindex = @imagecolorallocate(
|
||||
$canvas,
|
||||
$transcolor['red'],
|
||||
$transcolor['green'],
|
||||
$transcolor['blue']
|
||||
);
|
||||
@imagefill($canvas, 0, 0, $transcolorindex);
|
||||
@imagecolortransparent($canvas, $transcolorindex);
|
||||
} else { //filling with white
|
||||
$whitecolorindex = @imagecolorallocate($canvas, 255, 255, 255);
|
||||
@imagefill($canvas, 0, 0, $whitecolorindex);
|
||||
}
|
||||
} else { //filling with white
|
||||
$whitecolorindex = @imagecolorallocate($canvas, 255, 255, 255);
|
||||
@imagefill($canvas, 0, 0, $whitecolorindex);
|
||||
}
|
||||
if ($this->extension == 'gif') {
|
||||
$this->keepGifTransparency($this->image, $canvas);
|
||||
}
|
||||
|
||||
return $canvas;
|
||||
}
|
||||
|
||||
/**
|
||||
* Copy transparency from gif to gif
|
||||
*
|
||||
* If no transparency is found or the PHP does not support it, the canvas is filled with white
|
||||
*
|
||||
* @param resource $image Original image
|
||||
* @param resource $canvas New, empty image
|
||||
* @return void
|
||||
*/
|
||||
protected function keepGifTransparency($image, $canvas)
|
||||
{
|
||||
if (!function_exists('imagefill') || !function_exists('imagecolorallocate')) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!function_exists('imagecolorsforindex') || !function_exists('imagecolortransparent')) {
|
||||
throw new \Exception('missing alpha methods');
|
||||
}
|
||||
|
||||
$transcolorindex = @imagecolortransparent($image);
|
||||
$transcolor = @imagecolorsforindex($image, $transcolorindex);
|
||||
if (!$transcolor) {
|
||||
// pre-PHP8 false is returned, in PHP8 an exception is thrown
|
||||
throw new \ValueError('no valid alpha color');
|
||||
}
|
||||
|
||||
$transcolorindex = @imagecolorallocate(
|
||||
$canvas,
|
||||
$transcolor['red'],
|
||||
$transcolor['green'],
|
||||
$transcolor['blue']
|
||||
);
|
||||
@imagefill($canvas, 0, 0, $transcolorindex);
|
||||
@imagecolortransparent($canvas, $transcolorindex);
|
||||
|
||||
} catch (\Throwable $ignored) {
|
||||
//filling with white
|
||||
$whitecolorindex = @imagecolorallocate($canvas, 255, 255, 255);
|
||||
@imagefill($canvas, 0, 0, $whitecolorindex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate new size
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue