Compare commits

..

4 Commits
php82 ... php74

Author SHA1 Message Date
Jephté Clain 1a42d8adec ajout cv::complen 2025-02-05 06:26:41 +04:00
Jephté Clain de3b84441d maj deps 2025-01-30 17:25:02 +04:00
Jephté Clain b50d881e7f maj compat nur/sery 2025-01-30 08:25:31 +04:00
Jephté Clain 756502361f compat avec les nur/sery 2025-01-29 11:27:25 +04:00
5 changed files with 60 additions and 27 deletions

View File

@ -4,5 +4,5 @@
RUNPHP= RUNPHP=
# Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies # Si RUNPHP n'est pas défini, les variables suivantes peuvent être définies
DIST=d12 DIST=d11
#REGISTRY=pubdocker.univ-reunion.fr #REGISTRY=pubdocker.univ-reunion.fr

View File

@ -15,12 +15,12 @@
} }
}, },
"require": { "require": {
"symfony/yaml": "^7.1", "symfony/yaml": "^5.0",
"ext-json": "*", "ext-json": "*",
"php": "^8.2" "php": "^7.4"
}, },
"require-dev": { "require-dev": {
"nulib/tests": "8.2", "nulib/tests": "^7.4",
"ext-posix": "*", "ext-posix": "*",
"ext-pcntl": "*", "ext-pcntl": "*",
"ext-curl": "*" "ext-curl": "*"

44
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "92c82f1783bab891c66fa145a07f88c7", "content-hash": "ab280aa4a5f5c83fa488537530b29759",
"packages": [ "packages": [
{ {
"name": "symfony/deprecation-contracts", "name": "symfony/deprecation-contracts",
@ -25,12 +25,12 @@
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": {
"url": "https://github.com/symfony/contracts",
"name": "symfony/contracts"
},
"branch-alias": { "branch-alias": {
"dev-main": "2.5-dev" "dev-main": "2.5-dev"
},
"thanks": {
"name": "symfony/contracts",
"url": "https://github.com/symfony/contracts"
} }
}, },
"autoload": { "autoload": {
@ -99,8 +99,8 @@
"type": "library", "type": "library",
"extra": { "extra": {
"thanks": { "thanks": {
"name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill",
"url": "https://github.com/symfony/polyfill" "name": "symfony/polyfill"
} }
}, },
"autoload": { "autoload": {
@ -361,16 +361,16 @@
}, },
{ {
"name": "nikic/php-parser", "name": "nikic/php-parser",
"version": "v5.3.1", "version": "v5.4.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/nikic/PHP-Parser.git", "url": "https://github.com/nikic/PHP-Parser.git",
"reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" "reference": "447a020a1f875a434d62f2a401f53b82a396e494"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494",
"reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", "reference": "447a020a1f875a434d62f2a401f53b82a396e494",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -413,9 +413,9 @@
], ],
"support": { "support": {
"issues": "https://github.com/nikic/PHP-Parser/issues", "issues": "https://github.com/nikic/PHP-Parser/issues",
"source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0"
}, },
"time": "2024-10-08T18:51:32+00:00" "time": "2024-12-30T11:07:19+00:00"
}, },
{ {
"name": "nulib/tests", "name": "nulib/tests",
@ -423,7 +423,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git", "url": "https://git.univ-reunion.fr/sda-php/nulib-tests.git",
"reference": "6ce8257560b42e8fb3eea03eba84d3877c9648ca" "reference": "9b5c9c295c3dee6fc02ccddbd8a70bca797c8045"
}, },
"require": { "require": {
"php": ">=7.3", "php": ">=7.3",
@ -447,7 +447,7 @@
} }
], ],
"description": "fonctions et classes pour les tests", "description": "fonctions et classes pour les tests",
"time": "2024-03-26T10:56:17+00:00" "time": "2025-01-30T13:18:31+00:00"
}, },
{ {
"name": "phar-io/manifest", "name": "phar-io/manifest",
@ -888,16 +888,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.6.21", "version": "9.6.22",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c",
"reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -908,7 +908,7 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-xml": "*", "ext-xml": "*",
"ext-xmlwriter": "*", "ext-xmlwriter": "*",
"myclabs/deep-copy": "^1.12.0", "myclabs/deep-copy": "^1.12.1",
"phar-io/manifest": "^2.0.4", "phar-io/manifest": "^2.0.4",
"phar-io/version": "^3.2.1", "phar-io/version": "^3.2.1",
"php": ">=7.3", "php": ">=7.3",
@ -971,7 +971,7 @@
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy", "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22"
}, },
"funding": [ "funding": [
{ {
@ -987,7 +987,7 @@
"type": "tidelift" "type": "tidelift"
} }
], ],
"time": "2024-09-19T10:50:18+00:00" "time": "2024-12-05T13:48:26+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",

View File

@ -222,4 +222,13 @@ class cv {
if ($a > $b) return 1; if ($a > $b) return 1;
return 0; return 0;
} }
/** comparer la longueur de $a et $b */
static final function complen($a, $b): int {
if (is_array($a)) $la = count($a);
else $la = strlen(strval($a));
if (is_array($b)) $lb = count($b);
else $lb = strlen(strval($b));
return self::compare($la, $lb);
}
} }

View File

@ -309,8 +309,32 @@ class Stream extends AbstractIterator implements IReader, IWriter {
} }
} }
/** @var bool faut-il faire un mapping pour la compatibilité avec nur/sery */
const NURSERY_COMPAT_ENABLED = true;
/**
* @var string[] mappings pour la compatibilité avec des fichiers générés par
* nur/sery
*/
const NURSERY_COMPAT_MAPPING = [
'O:22:"nur\sery\php\time\Date":' => 'O:19:"nulib\php\time\Date":',
'O:26:"nur\sery\php\time\DateTime":' => 'O:23:"nulib\php\time\DateTime":',
'O:23:"nur\sery\php\time\Delay":' => 'O:20:"nulib\php\time\Delay":',
];
static function nursery_compat_verifix(string $contents): string {
if (static::NURSERY_COMPAT_ENABLED) {
foreach (self::NURSERY_COMPAT_MAPPING as $from => $to) {
$contents = str_replace($from, $to, $contents);
}
}
return $contents;
}
function unserialize(?array $options=null, bool $close=true, bool $alreadyLocked=false) { function unserialize(?array $options=null, bool $close=true, bool $alreadyLocked=false) {
$args = [$this->getContents($close, $alreadyLocked)]; $contents = $this->getContents($close, $alreadyLocked);
$contents = self::nursery_compat_verifix($contents);
$args = [$contents];
if ($options !== null) $args[] = $options; if ($options !== null) $args[] = $options;
return unserialize(...$args); return unserialize(...$args);
} }