Upgrade to 3.9.4
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"description": "The Kirby 3 core",
|
"description": "The Kirby 3 core",
|
||||||
"license": "proprietary",
|
"license": "proprietary",
|
||||||
"type": "kirby-cms",
|
"type": "kirby-cms",
|
||||||
"version": "3.9.3",
|
"version": "3.9.4",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"kirby",
|
"kirby",
|
||||||
"cms",
|
"cms",
|
||||||
@@ -38,13 +38,14 @@
|
|||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"claviska/simpleimage": "4.0.2",
|
"claviska/simpleimage": "4.0.2",
|
||||||
"composer/semver": "3.3.2",
|
"composer/semver": "3.3.2",
|
||||||
"filp/whoops": "2.15.1",
|
"filp/whoops": "2.15.2",
|
||||||
"getkirby/composer-installer": "^1.2.1",
|
"getkirby/composer-installer": "^1.2.1",
|
||||||
"laminas/laminas-escaper": "2.12.0",
|
"laminas/laminas-escaper": "2.12.0",
|
||||||
"michelf/php-smartypants": "1.8.1",
|
"michelf/php-smartypants": "1.8.1",
|
||||||
"phpmailer/phpmailer": "6.8.0",
|
"phpmailer/phpmailer": "6.8.0",
|
||||||
"symfony/polyfill-intl-idn": "1.27.0",
|
"symfony/polyfill-intl-idn": "1.27.0",
|
||||||
"symfony/polyfill-mbstring": "1.27.0"
|
"symfony/polyfill-mbstring": "1.27.0",
|
||||||
|
"symfony/yaml": "5.4.21"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"symfony/polyfill-php72": "*"
|
"symfony/polyfill-php72": "*"
|
||||||
@@ -91,11 +92,9 @@
|
|||||||
"analyze": [
|
"analyze": [
|
||||||
"@analyze:composer",
|
"@analyze:composer",
|
||||||
"@analyze:psalm",
|
"@analyze:psalm",
|
||||||
"@analyze:phpcpd",
|
|
||||||
"@analyze:phpmd"
|
"@analyze:phpmd"
|
||||||
],
|
],
|
||||||
"analyze:composer": "composer validate --strict --no-check-version --no-check-all",
|
"analyze:composer": "composer validate --strict --no-check-version --no-check-all",
|
||||||
"analyze:phpcpd": "phpcpd --fuzzy --exclude tests --exclude vendor .",
|
|
||||||
"analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
|
"analyze:phpmd": "phpmd . ansi phpmd.xml.dist --exclude 'dependencies/*,tests/*,vendor/*'",
|
||||||
"analyze:psalm": "psalm",
|
"analyze:psalm": "psalm",
|
||||||
"build": "./scripts/build",
|
"build": "./scripts/build",
|
||||||
|
238
kirby/composer.lock
generated
238
kirby/composer.lock
generated
@@ -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": "b6d2cf1d95980cd8e5109f436f393339",
|
"content-hash": "69b8764b73a3ee160520dca4ac70a53d",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "claviska/simpleimage",
|
"name": "claviska/simpleimage",
|
||||||
@@ -142,16 +142,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
"version": "2.15.1",
|
"version": "2.15.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/filp/whoops.git",
|
"url": "https://github.com/filp/whoops.git",
|
||||||
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b"
|
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b",
|
"url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
||||||
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b",
|
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -201,7 +201,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/filp/whoops/issues",
|
"issues": "https://github.com/filp/whoops/issues",
|
||||||
"source": "https://github.com/filp/whoops/tree/2.15.1"
|
"source": "https://github.com/filp/whoops/tree/2.15.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -209,7 +209,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2023-03-06T18:09:13+00:00"
|
"time": "2023-04-12T12:00:00+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "getkirby/composer-installer",
|
"name": "getkirby/composer-installer",
|
||||||
@@ -565,6 +565,155 @@
|
|||||||
},
|
},
|
||||||
"time": "2021-07-14T16:46:02+00:00"
|
"time": "2021-07-14T16:46:02+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/deprecation-contracts",
|
||||||
|
"version": "v2.5.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
|
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||||
|
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "2.5-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/contracts",
|
||||||
|
"url": "https://github.com/symfony/contracts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"function.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2022-01-02T09:53:40+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-ctype",
|
||||||
|
"version": "v1.27.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"ext-ctype": "*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-ctype": "For best performance"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.27-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/polyfill",
|
||||||
|
"url": "https://github.com/symfony/polyfill"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Ctype\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Gert de Pagter",
|
||||||
|
"email": "BackEndTea@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony polyfill for ctype functions",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compatibility",
|
||||||
|
"ctype",
|
||||||
|
"polyfill",
|
||||||
|
"portable"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-idn",
|
"name": "symfony/polyfill-intl-idn",
|
||||||
"version": "v1.27.0",
|
"version": "v1.27.0",
|
||||||
@@ -818,6 +967,81 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-11-03T14:55:06+00:00"
|
"time": "2022-11-03T14:55:06+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/yaml",
|
||||||
|
"version": "v5.4.21",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/yaml.git",
|
||||||
|
"reference": "3713e20d93e46e681e51605d213027e48dab3469"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/yaml/zipball/3713e20d93e46e681e51605d213027e48dab3469",
|
||||||
|
"reference": "3713e20d93e46e681e51605d213027e48dab3469",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"symfony/deprecation-contracts": "^2.1|^3",
|
||||||
|
"symfony/polyfill-ctype": "^1.8"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/console": "<5.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/console": "^5.3|^6.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/console": "For validating YAML files using the lint command"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"Resources/bin/yaml-lint"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Yaml\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Loads and dumps YAML files",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/yaml/tree/v5.4.21"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-02-21T19:46:44+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [],
|
"packages-dev": [],
|
||||||
|
@@ -11,7 +11,7 @@ $src = null;
|
|||||||
if ($block->location() == 'web') {
|
if ($block->location() == 'web') {
|
||||||
$src = $block->src()->esc();
|
$src = $block->src()->esc();
|
||||||
} elseif ($image = $block->image()->toFile()) {
|
} elseif ($image = $block->image()->toFile()) {
|
||||||
$alt = $alt ?? $image->alt();
|
$alt = $alt->or($image->alt());
|
||||||
$src = $image->url();
|
$src = $image->url();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
kirby/panel/dist/css/style.css
vendored
2
kirby/panel/dist/css/style.css
vendored
File diff suppressed because one or more lines are too long
2
kirby/panel/dist/js/index.js
vendored
2
kirby/panel/dist/js/index.js
vendored
File diff suppressed because one or more lines are too long
12
kirby/panel/dist/js/vendor.js
vendored
12
kirby/panel/dist/js/vendor.js
vendored
File diff suppressed because one or more lines are too long
6
kirby/panel/dist/js/vuedraggable.js
vendored
6
kirby/panel/dist/js/vuedraggable.js
vendored
File diff suppressed because one or more lines are too long
@@ -555,10 +555,8 @@ class App
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the default language object
|
* Returns the default language object
|
||||||
*
|
|
||||||
* @return \Kirby\Cms\Language|null
|
|
||||||
*/
|
*/
|
||||||
public function defaultLanguage()
|
public function defaultLanguage(): Language|null
|
||||||
{
|
{
|
||||||
return $this->defaultLanguage ??= $this->languages()->default();
|
return $this->defaultLanguage ??= $this->languages()->default();
|
||||||
}
|
}
|
||||||
@@ -577,22 +575,21 @@ class App
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Detect the preferred language from the visitor object
|
* Detect the preferred language from the visitor object
|
||||||
*
|
|
||||||
* @return \Kirby\Cms\Language
|
|
||||||
*/
|
*/
|
||||||
public function detectedLanguage()
|
public function detectedLanguage(): Language|null
|
||||||
{
|
{
|
||||||
$languages = $this->languages();
|
$languages = $this->languages();
|
||||||
$visitor = $this->visitor();
|
$visitor = $this->visitor();
|
||||||
|
|
||||||
foreach ($visitor->acceptedLanguages() as $lang) {
|
foreach ($visitor->acceptedLanguages() as $acceptedLang) {
|
||||||
if ($language = $languages->findBy('locale', $lang->locale(LC_ALL))) {
|
$closure = fn ($language) => $language->locale(LC_ALL) === $acceptedLang->locale();
|
||||||
|
if ($language = $languages->filter($closure)?->first()) {
|
||||||
return $language;
|
return $language;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($visitor->acceptedLanguages() as $lang) {
|
foreach ($visitor->acceptedLanguages() as $acceptedLang) {
|
||||||
if ($language = $languages->findBy('code', $lang->code())) {
|
if ($language = $languages->findBy('code', $acceptedLang->code())) {
|
||||||
return $language;
|
return $language;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,13 @@ class Blocks extends Items
|
|||||||
{
|
{
|
||||||
public const ITEM_CLASS = Block::class;
|
public const ITEM_CLASS = Block::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All registered blocks methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return HTML when the collection is
|
* Return HTML when the collection is
|
||||||
* converted to a string
|
* converted to a string
|
||||||
|
@@ -459,10 +459,19 @@ class Blueprint
|
|||||||
|
|
||||||
// groups don't need all the crap
|
// groups don't need all the crap
|
||||||
if ($type === 'group') {
|
if ($type === 'group') {
|
||||||
|
$fields = $props['fields'];
|
||||||
|
|
||||||
|
if (isset($props['when']) === true) {
|
||||||
|
$fields = array_map(
|
||||||
|
fn ($field) => array_replace_recursive(['when' => $props['when']], $field),
|
||||||
|
$fields
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'fields' => $props['fields'],
|
'fields' => $fields,
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'type' => $type,
|
'type' => $type
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,6 +21,13 @@ class Fieldsets extends Items
|
|||||||
{
|
{
|
||||||
public const ITEM_CLASS = Fieldset::class;
|
public const ITEM_CLASS = Fieldset::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All registered fieldsets methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
protected static function createFieldsets($params)
|
protected static function createFieldsets($params)
|
||||||
{
|
{
|
||||||
$fieldsets = [];
|
$fieldsets = [];
|
||||||
|
@@ -172,15 +172,21 @@ class File extends ModelWithContent
|
|||||||
* other content.
|
* other content.
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
* @param array $data
|
|
||||||
* @param string|null $languageCode
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
public function contentFileData(array $data, string $languageCode = null): array
|
public function contentFileData(
|
||||||
{
|
array $data,
|
||||||
return A::append($data, [
|
string $languageCode = null
|
||||||
'template' => $data['template'] ?? $this->template(),
|
): array {
|
||||||
]);
|
// only add the template in, if the $data array
|
||||||
|
// doesn't explicitly unsets it
|
||||||
|
if (
|
||||||
|
array_key_exists('template', $data) === false &&
|
||||||
|
$template = $this->template()
|
||||||
|
) {
|
||||||
|
$data['template'] = $template;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -21,6 +21,13 @@ class Items extends Collection
|
|||||||
|
|
||||||
protected Field|null $field;
|
protected Field|null $field;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All registered items methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
|
@@ -16,6 +16,13 @@ use Kirby\Filesystem\F;
|
|||||||
*/
|
*/
|
||||||
class Languages extends Collection
|
class Languages extends Collection
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* All registered languages methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new collection with the given language objects
|
* Creates a new collection with the given language objects
|
||||||
*
|
*
|
||||||
|
@@ -15,4 +15,11 @@ namespace Kirby\Cms;
|
|||||||
class LayoutColumns extends Items
|
class LayoutColumns extends Items
|
||||||
{
|
{
|
||||||
public const ITEM_CLASS = LayoutColumn::class;
|
public const ITEM_CLASS = LayoutColumn::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All registered layout columns methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
}
|
}
|
||||||
|
@@ -20,6 +20,13 @@ class Layouts extends Items
|
|||||||
{
|
{
|
||||||
public const ITEM_CLASS = Layout::class;
|
public const ITEM_CLASS = Layout::class;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* All registered layouts methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
public static function factory(array $items = null, array $params = [])
|
public static function factory(array $items = null, array $params = [])
|
||||||
{
|
{
|
||||||
$first = $items[0] ?? [];
|
$first = $items[0] ?? [];
|
||||||
|
@@ -536,29 +536,43 @@ trait PageActions
|
|||||||
// create a temporary page object
|
// create a temporary page object
|
||||||
$page = Page::factory($props);
|
$page = Page::factory($props);
|
||||||
|
|
||||||
|
// always create pages in the default language
|
||||||
|
if ($page->kirby()->multilang() === true) {
|
||||||
|
$languageCode = $page->kirby()->defaultLanguage()->code();
|
||||||
|
} else {
|
||||||
|
$languageCode = null;
|
||||||
|
}
|
||||||
|
|
||||||
// create a form for the page
|
// create a form for the page
|
||||||
$form = Form::for($page, ['values' => $props['content']]);
|
// use always default language to fill form with default values
|
||||||
|
$form = Form::for(
|
||||||
|
$page,
|
||||||
|
[
|
||||||
|
'language' => $languageCode,
|
||||||
|
'values' => $props['content']
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
// inject the content
|
// inject the content
|
||||||
$page = $page->clone(['content' => $form->strings(true)]);
|
$page = $page->clone(['content' => $form->strings(true)]);
|
||||||
|
|
||||||
// run the hooks and creation action
|
// run the hooks and creation action
|
||||||
$page = $page->commit('create', ['page' => $page, 'input' => $props], function ($page, $props) {
|
$page = $page->commit(
|
||||||
// always create pages in the default language
|
'create',
|
||||||
if ($page->kirby()->multilang() === true) {
|
[
|
||||||
$languageCode = $page->kirby()->defaultLanguage()->code();
|
'page' => $page,
|
||||||
} else {
|
'input' => $props
|
||||||
$languageCode = null;
|
],
|
||||||
|
function ($page, $props) use ($languageCode) {
|
||||||
|
// write the content file
|
||||||
|
$page = $page->save($page->content()->toArray(), $languageCode);
|
||||||
|
|
||||||
|
// flush the parent cache to get children and drafts right
|
||||||
|
static::updateParentCollections($page, 'append');
|
||||||
|
|
||||||
|
return $page;
|
||||||
}
|
}
|
||||||
|
);
|
||||||
// write the content file
|
|
||||||
$page = $page->save($page->content()->toArray(), $languageCode);
|
|
||||||
|
|
||||||
// flush the parent cache to get children and drafts right
|
|
||||||
static::updateParentCollections($page, 'append');
|
|
||||||
|
|
||||||
return $page;
|
|
||||||
});
|
|
||||||
|
|
||||||
// publish the new page if a number is given
|
// publish the new page if a number is given
|
||||||
if (isset($props['num']) === true) {
|
if (isset($props['num']) === true) {
|
||||||
|
@@ -18,6 +18,13 @@ namespace Kirby\Cms;
|
|||||||
*/
|
*/
|
||||||
class Roles extends Collection
|
class Roles extends Collection
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* All registered roles methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a filtered list of all
|
* Returns a filtered list of all
|
||||||
* roles that can be created by the
|
* roles that can be created by the
|
||||||
|
@@ -20,6 +20,13 @@ use Kirby\Exception\InvalidArgumentException;
|
|||||||
*/
|
*/
|
||||||
class Structure extends Collection
|
class Structure extends Collection
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* All registered structure methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new Collection with the given objects
|
* Creates a new Collection with the given objects
|
||||||
*
|
*
|
||||||
|
@@ -19,6 +19,13 @@ use Kirby\Filesystem\F;
|
|||||||
*/
|
*/
|
||||||
class Translations extends Collection
|
class Translations extends Collection
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* All registered translations methods
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
public static $methods = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $code
|
* @param string $code
|
||||||
* @return void
|
* @return void
|
||||||
|
@@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
namespace Kirby\Data;
|
namespace Kirby\Data;
|
||||||
|
|
||||||
|
use Kirby\Cms\App;
|
||||||
use Kirby\Exception\InvalidArgumentException;
|
use Kirby\Exception\InvalidArgumentException;
|
||||||
use Spyc;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple Wrapper around the Spyc YAML class
|
* Simple Wrapper around the Symfony or Spyc YAML class
|
||||||
*
|
*
|
||||||
* @package Kirby Data
|
* @package Kirby Data
|
||||||
* @author Bastian Allgeier <bastian@getkirby.com>
|
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||||
@@ -21,8 +21,10 @@ class Yaml extends Handler
|
|||||||
*/
|
*/
|
||||||
public static function encode($data): string
|
public static function encode($data): string
|
||||||
{
|
{
|
||||||
// $data, $indent, $wordwrap, $no_opening_dashes
|
return match (static::handler()) {
|
||||||
return Spyc::YAMLDump($data, false, false, true);
|
'symfony' => YamlSymfony::encode($data),
|
||||||
|
default => YamlSpyc::encode($data),
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,16 +44,19 @@ class Yaml extends Handler
|
|||||||
throw new InvalidArgumentException('Invalid YAML data; please pass a string');
|
throw new InvalidArgumentException('Invalid YAML data; please pass a string');
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove BOM
|
return match (static::handler()) {
|
||||||
$string = str_replace("\xEF\xBB\xBF", '', $string);
|
'symfony' => YamlSymfony::decode($string),
|
||||||
$result = Spyc::YAMLLoadString($string);
|
default => YamlSpyc::decode($string)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($result) === true) {
|
/**
|
||||||
return $result;
|
* Returns which YAML parser (`spyc` or `symfony`)
|
||||||
}
|
* is configured to be used
|
||||||
|
* @internal
|
||||||
// apparently Spyc always returns an array, even for invalid YAML syntax
|
*/
|
||||||
// so this Exception should currently never be thrown
|
public static function handler(): string
|
||||||
throw new InvalidArgumentException('The YAML data cannot be parsed'); // @codeCoverageIgnore
|
{
|
||||||
|
return App::instance(null, true)?->option('yaml.handler') ?? 'spyc';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
43
kirby/src/Data/YamlSpyc.php
Normal file
43
kirby/src/Data/YamlSpyc.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kirby\Data;
|
||||||
|
|
||||||
|
use Kirby\Exception\InvalidArgumentException;
|
||||||
|
use Spyc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple Wrapper around the Spyc YAML class
|
||||||
|
*
|
||||||
|
* @package Kirby Data
|
||||||
|
* @author Bastian Allgeier <bastian@getkirby.com>
|
||||||
|
* @link https://getkirby.com
|
||||||
|
* @copyright Bastian Allgeier
|
||||||
|
* @license https://opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
class YamlSpyc
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Converts an array to an encoded YAML string
|
||||||
|
*/
|
||||||
|
public static function encode($data): string
|
||||||
|
{
|
||||||
|
// $data, $indent, $wordwrap, $no_opening_dashes
|
||||||
|
return Spyc::YAMLDump($data, false, false, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses an encoded YAML string and returns a multi-dimensional array
|
||||||
|
*/
|
||||||
|
public static function decode($string): array
|
||||||
|
{
|
||||||
|
$result = Spyc::YAMLLoadString($string);
|
||||||
|
|
||||||
|
if (is_array($result) === true) {
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
// apparently Spyc always returns an array, even for invalid YAML syntax
|
||||||
|
// so this Exception should currently never be thrown
|
||||||
|
throw new InvalidArgumentException('The YAML data cannot be parsed'); // @codeCoverageIgnore
|
||||||
|
}
|
||||||
|
}
|
44
kirby/src/Data/YamlSymfony.php
Normal file
44
kirby/src/Data/YamlSymfony.php
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Kirby\Data;
|
||||||
|
|
||||||
|
use Kirby\Cms\App;
|
||||||
|
use Kirby\Toolkit\A;
|
||||||
|
use Symfony\Component\Yaml\Yaml as Symfony;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Simple Wrapper around the Symfony YAML class
|
||||||
|
*
|
||||||
|
* @package Kirby Data
|
||||||
|
* @author Nico Hoffmann <nico@getkirby.com>
|
||||||
|
* @link https://getkirby.com
|
||||||
|
* @copyright Bastian Allgeier
|
||||||
|
* @license https://opensource.org/licenses/MIT
|
||||||
|
*/
|
||||||
|
class YamlSymfony
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Converts an array to an encoded YAML string
|
||||||
|
*/
|
||||||
|
public static function encode($data): string
|
||||||
|
{
|
||||||
|
$kirby = App::instance(null, true);
|
||||||
|
|
||||||
|
return Symfony::dump(
|
||||||
|
$data,
|
||||||
|
$kirby?->option('yaml.params.inline') ?? 9999,
|
||||||
|
$kirby?->option('yaml.params.indent') ?? 2,
|
||||||
|
Symfony::DUMP_MULTI_LINE_LITERAL_BLOCK | Symfony::DUMP_EMPTY_ARRAY_AS_SEQUENCE
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses an encoded YAML string and returns a multi-dimensional array
|
||||||
|
*/
|
||||||
|
public static function decode($string): array
|
||||||
|
{
|
||||||
|
$result = Symfony::parse($string);
|
||||||
|
$result = A::wrap($result);
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
@@ -521,12 +521,26 @@ class F
|
|||||||
Dir::make($directory, true);
|
Dir::make($directory, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// actually move the file
|
// atomically moving the file will only work if
|
||||||
if (rename($oldRoot, $newRoot) !== true) {
|
// source and target are on the same filesystem
|
||||||
return false;
|
if (stat($oldRoot)['dev'] === stat($directory)['dev']) {
|
||||||
|
// same filesystem, we can move the file
|
||||||
|
return rename($oldRoot, $newRoot) === true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
// @codeCoverageIgnoreStart
|
||||||
|
// not the same filesystem; we need to copy
|
||||||
|
// the file and unlink the source afterwards
|
||||||
|
if (copy($oldRoot, $newRoot) === true) {
|
||||||
|
return unlink($oldRoot) === true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// copying failed, ensure the new root isn't there
|
||||||
|
// (e.g. if the file could be created but there's no
|
||||||
|
// more remaining disk space to write its contents)
|
||||||
|
static::remove($newRoot);
|
||||||
|
return false;
|
||||||
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -224,7 +224,7 @@ class Blocks extends Plain
|
|||||||
'tag' => 'a',
|
'tag' => 'a',
|
||||||
'attrs' => ['href', 'rel', 'target', 'title'],
|
'attrs' => ['href', 'rel', 'target', 'title'],
|
||||||
'defaults' => [
|
'defaults' => [
|
||||||
'rel' => 'noopener noreferrer'
|
'rel' => 'noreferrer'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
@@ -358,7 +358,7 @@ class Html extends Xml
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add noopener & noreferrer to rels when target is `_blank`
|
* Add noreferrer to rels when target is `_blank`
|
||||||
*
|
*
|
||||||
* @param string|null $rel Current `rel` value
|
* @param string|null $rel Current `rel` value
|
||||||
* @param string|null $target Current `target` value
|
* @param string|null $target Current `target` value
|
||||||
@@ -373,7 +373,7 @@ class Html extends Xml
|
|||||||
return $rel;
|
return $rel;
|
||||||
}
|
}
|
||||||
|
|
||||||
return trim($rel . ' noopener noreferrer', ' ');
|
return trim($rel . ' noreferrer', ' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
return $rel ?: null;
|
return $rel ?: null;
|
||||||
|
120
kirby/vendor/bin/yaml-lint
vendored
Executable file
120
kirby/vendor/bin/yaml-lint
vendored
Executable file
@@ -0,0 +1,120 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Proxy PHP file generated by Composer
|
||||||
|
*
|
||||||
|
* This file includes the referenced bin path (../symfony/yaml/Resources/bin/yaml-lint)
|
||||||
|
* using a stream wrapper to prevent the shebang from being output on PHP<8
|
||||||
|
*
|
||||||
|
* @generated
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer;
|
||||||
|
|
||||||
|
$GLOBALS['_composer_bin_dir'] = __DIR__;
|
||||||
|
$GLOBALS['_composer_autoload_path'] = __DIR__ . '/..'.'/autoload.php';
|
||||||
|
|
||||||
|
if (PHP_VERSION_ID < 80000) {
|
||||||
|
if (!class_exists('Composer\BinProxyWrapper')) {
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
final class BinProxyWrapper
|
||||||
|
{
|
||||||
|
private $handle;
|
||||||
|
private $position;
|
||||||
|
private $realpath;
|
||||||
|
|
||||||
|
public function stream_open($path, $mode, $options, &$opened_path)
|
||||||
|
{
|
||||||
|
// get rid of phpvfscomposer:// prefix for __FILE__ & __DIR__ resolution
|
||||||
|
$opened_path = substr($path, 17);
|
||||||
|
$this->realpath = realpath($opened_path) ?: $opened_path;
|
||||||
|
$opened_path = $this->realpath;
|
||||||
|
$this->handle = fopen($this->realpath, $mode);
|
||||||
|
$this->position = 0;
|
||||||
|
|
||||||
|
return (bool) $this->handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_read($count)
|
||||||
|
{
|
||||||
|
$data = fread($this->handle, $count);
|
||||||
|
|
||||||
|
if ($this->position === 0) {
|
||||||
|
$data = preg_replace('{^#!.*\r?\n}', '', $data);
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->position += strlen($data);
|
||||||
|
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_cast($castAs)
|
||||||
|
{
|
||||||
|
return $this->handle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_close()
|
||||||
|
{
|
||||||
|
fclose($this->handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_lock($operation)
|
||||||
|
{
|
||||||
|
return $operation ? flock($this->handle, $operation) : true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_seek($offset, $whence)
|
||||||
|
{
|
||||||
|
if (0 === fseek($this->handle, $offset, $whence)) {
|
||||||
|
$this->position = ftell($this->handle);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_tell()
|
||||||
|
{
|
||||||
|
return $this->position;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_eof()
|
||||||
|
{
|
||||||
|
return feof($this->handle);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_stat()
|
||||||
|
{
|
||||||
|
return array();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function stream_set_option($option, $arg1, $arg2)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function url_stat($path, $flags)
|
||||||
|
{
|
||||||
|
$path = substr($path, 17);
|
||||||
|
if (file_exists($path)) {
|
||||||
|
return stat($path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||||
|
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||||
|
) {
|
||||||
|
include("phpvfscomposer://" . __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint');
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include __DIR__ . '/..'.'/symfony/yaml/Resources/bin/yaml-lint';
|
15
kirby/vendor/composer/autoload_classmap.php
vendored
15
kirby/vendor/composer/autoload_classmap.php
vendored
@@ -154,6 +154,8 @@ return array(
|
|||||||
'Kirby\\Data\\Txt' => $baseDir . '/src/Data/Txt.php',
|
'Kirby\\Data\\Txt' => $baseDir . '/src/Data/Txt.php',
|
||||||
'Kirby\\Data\\Xml' => $baseDir . '/src/Data/Xml.php',
|
'Kirby\\Data\\Xml' => $baseDir . '/src/Data/Xml.php',
|
||||||
'Kirby\\Data\\Yaml' => $baseDir . '/src/Data/Yaml.php',
|
'Kirby\\Data\\Yaml' => $baseDir . '/src/Data/Yaml.php',
|
||||||
|
'Kirby\\Data\\YamlSpyc' => $baseDir . '/src/Data/YamlSpyc.php',
|
||||||
|
'Kirby\\Data\\YamlSymfony' => $baseDir . '/src/Data/YamlSymfony.php',
|
||||||
'Kirby\\Database\\Database' => $baseDir . '/src/Database/Database.php',
|
'Kirby\\Database\\Database' => $baseDir . '/src/Database/Database.php',
|
||||||
'Kirby\\Database\\Db' => $baseDir . '/src/Database/Db.php',
|
'Kirby\\Database\\Db' => $baseDir . '/src/Database/Db.php',
|
||||||
'Kirby\\Database\\Query' => $baseDir . '/src/Database/Query.php',
|
'Kirby\\Database\\Query' => $baseDir . '/src/Database/Query.php',
|
||||||
@@ -342,6 +344,19 @@ return array(
|
|||||||
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php',
|
'Psr\\Log\\LoggerTrait' => $vendorDir . '/psr/log/src/LoggerTrait.php',
|
||||||
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php',
|
'Psr\\Log\\NullLogger' => $vendorDir . '/psr/log/src/NullLogger.php',
|
||||||
'Spyc' => $baseDir . '/dependencies/spyc/Spyc.php',
|
'Spyc' => $baseDir . '/dependencies/spyc/Spyc.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Command\\LintCommand' => $vendorDir . '/symfony/yaml/Command/LintCommand.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Dumper' => $vendorDir . '/symfony/yaml/Dumper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Escaper' => $vendorDir . '/symfony/yaml/Escaper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\DumpException' => $vendorDir . '/symfony/yaml/Exception/DumpException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/yaml/Exception/ExceptionInterface.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\ParseException' => $vendorDir . '/symfony/yaml/Exception/ParseException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\RuntimeException' => $vendorDir . '/symfony/yaml/Exception/RuntimeException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Inline' => $vendorDir . '/symfony/yaml/Inline.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Parser' => $vendorDir . '/symfony/yaml/Parser.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Tag\\TaggedValue' => $vendorDir . '/symfony/yaml/Tag/TaggedValue.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Unescaper' => $vendorDir . '/symfony/yaml/Unescaper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Yaml' => $vendorDir . '/symfony/yaml/Yaml.php',
|
||||||
|
'Symfony\\Polyfill\\Ctype\\Ctype' => $vendorDir . '/symfony/polyfill-ctype/Ctype.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => $vendorDir . '/symfony/polyfill-intl-idn/Idn.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Info' => $vendorDir . '/symfony/polyfill-intl-idn/Info.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Info' => $vendorDir . '/symfony/polyfill-intl-idn/Info.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => $vendorDir . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => $vendorDir . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
|
||||||
|
2
kirby/vendor/composer/autoload_files.php
vendored
2
kirby/vendor/composer/autoload_files.php
vendored
@@ -6,6 +6,8 @@ $vendorDir = dirname(__DIR__);
|
|||||||
$baseDir = dirname($vendorDir);
|
$baseDir = dirname($vendorDir);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||||
|
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||||
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
'f598d06aa772fa33d905e87be6398fb1' => $vendorDir . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||||
|
2
kirby/vendor/composer/autoload_psr4.php
vendored
2
kirby/vendor/composer/autoload_psr4.php
vendored
@@ -10,6 +10,8 @@ return array(
|
|||||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
|
'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'),
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
||||||
|
'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'),
|
||||||
|
'Symfony\\Component\\Yaml\\' => array($vendorDir . '/symfony/yaml'),
|
||||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
||||||
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
|
'PHPMailer\\PHPMailer\\' => array($vendorDir . '/phpmailer/phpmailer/src'),
|
||||||
'League\\ColorExtractor\\' => array($vendorDir . '/league/color-extractor/src'),
|
'League\\ColorExtractor\\' => array($vendorDir . '/league/color-extractor/src'),
|
||||||
|
27
kirby/vendor/composer/autoload_static.php
vendored
27
kirby/vendor/composer/autoload_static.php
vendored
@@ -7,6 +7,8 @@ namespace Composer\Autoload;
|
|||||||
class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
||||||
{
|
{
|
||||||
public static $files = array (
|
public static $files = array (
|
||||||
|
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||||
|
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||||
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
'f598d06aa772fa33d905e87be6398fb1' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/bootstrap.php',
|
||||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||||
@@ -24,6 +26,8 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||||
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
|
'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33,
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
|
'Symfony\\Polyfill\\Intl\\Idn\\' => 26,
|
||||||
|
'Symfony\\Polyfill\\Ctype\\' => 23,
|
||||||
|
'Symfony\\Component\\Yaml\\' => 23,
|
||||||
),
|
),
|
||||||
'P' =>
|
'P' =>
|
||||||
array (
|
array (
|
||||||
@@ -62,6 +66,14 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
0 => __DIR__ . '/..' . '/symfony/polyfill-intl-idn',
|
||||||
),
|
),
|
||||||
|
'Symfony\\Polyfill\\Ctype\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/symfony/polyfill-ctype',
|
||||||
|
),
|
||||||
|
'Symfony\\Component\\Yaml\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/symfony/yaml',
|
||||||
|
),
|
||||||
'Psr\\Log\\' =>
|
'Psr\\Log\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/psr/log/src',
|
0 => __DIR__ . '/..' . '/psr/log/src',
|
||||||
@@ -255,6 +267,8 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Kirby\\Data\\Txt' => __DIR__ . '/../..' . '/src/Data/Txt.php',
|
'Kirby\\Data\\Txt' => __DIR__ . '/../..' . '/src/Data/Txt.php',
|
||||||
'Kirby\\Data\\Xml' => __DIR__ . '/../..' . '/src/Data/Xml.php',
|
'Kirby\\Data\\Xml' => __DIR__ . '/../..' . '/src/Data/Xml.php',
|
||||||
'Kirby\\Data\\Yaml' => __DIR__ . '/../..' . '/src/Data/Yaml.php',
|
'Kirby\\Data\\Yaml' => __DIR__ . '/../..' . '/src/Data/Yaml.php',
|
||||||
|
'Kirby\\Data\\YamlSpyc' => __DIR__ . '/../..' . '/src/Data/YamlSpyc.php',
|
||||||
|
'Kirby\\Data\\YamlSymfony' => __DIR__ . '/../..' . '/src/Data/YamlSymfony.php',
|
||||||
'Kirby\\Database\\Database' => __DIR__ . '/../..' . '/src/Database/Database.php',
|
'Kirby\\Database\\Database' => __DIR__ . '/../..' . '/src/Database/Database.php',
|
||||||
'Kirby\\Database\\Db' => __DIR__ . '/../..' . '/src/Database/Db.php',
|
'Kirby\\Database\\Db' => __DIR__ . '/../..' . '/src/Database/Db.php',
|
||||||
'Kirby\\Database\\Query' => __DIR__ . '/../..' . '/src/Database/Query.php',
|
'Kirby\\Database\\Query' => __DIR__ . '/../..' . '/src/Database/Query.php',
|
||||||
@@ -443,6 +457,19 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php',
|
'Psr\\Log\\LoggerTrait' => __DIR__ . '/..' . '/psr/log/src/LoggerTrait.php',
|
||||||
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php',
|
'Psr\\Log\\NullLogger' => __DIR__ . '/..' . '/psr/log/src/NullLogger.php',
|
||||||
'Spyc' => __DIR__ . '/../..' . '/dependencies/spyc/Spyc.php',
|
'Spyc' => __DIR__ . '/../..' . '/dependencies/spyc/Spyc.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Command\\LintCommand' => __DIR__ . '/..' . '/symfony/yaml/Command/LintCommand.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Dumper' => __DIR__ . '/..' . '/symfony/yaml/Dumper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Escaper' => __DIR__ . '/..' . '/symfony/yaml/Escaper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\DumpException' => __DIR__ . '/..' . '/symfony/yaml/Exception/DumpException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/symfony/yaml/Exception/ExceptionInterface.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\ParseException' => __DIR__ . '/..' . '/symfony/yaml/Exception/ParseException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/yaml/Exception/RuntimeException.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Inline' => __DIR__ . '/..' . '/symfony/yaml/Inline.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Parser' => __DIR__ . '/..' . '/symfony/yaml/Parser.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Tag\\TaggedValue' => __DIR__ . '/..' . '/symfony/yaml/Tag/TaggedValue.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Unescaper' => __DIR__ . '/..' . '/symfony/yaml/Unescaper.php',
|
||||||
|
'Symfony\\Component\\Yaml\\Yaml' => __DIR__ . '/..' . '/symfony/yaml/Yaml.php',
|
||||||
|
'Symfony\\Polyfill\\Ctype\\Ctype' => __DIR__ . '/..' . '/symfony/polyfill-ctype/Ctype.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Idn' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Idn.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Info' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Info.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Info' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Info.php',
|
||||||
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
|
'Symfony\\Polyfill\\Intl\\Idn\\Resources\\unidata\\DisallowedRanges' => __DIR__ . '/..' . '/symfony/polyfill-intl-idn/Resources/unidata/DisallowedRanges.php',
|
||||||
|
247
kirby/vendor/composer/installed.json
vendored
247
kirby/vendor/composer/installed.json
vendored
@@ -142,17 +142,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
"version": "2.15.1",
|
"version": "2.15.2",
|
||||||
"version_normalized": "2.15.1.0",
|
"version_normalized": "2.15.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/filp/whoops.git",
|
"url": "https://github.com/filp/whoops.git",
|
||||||
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b"
|
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b",
|
"url": "https://api.github.com/repos/filp/whoops/zipball/aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
||||||
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b",
|
"reference": "aac9304c5ed61bf7b1b7a6064bf9806ab842ce73",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -168,7 +168,7 @@
|
|||||||
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
|
"symfony/var-dumper": "Pretty print complex values better with var-dumper available",
|
||||||
"whoops/soap": "Formats errors as SOAP responses"
|
"whoops/soap": "Formats errors as SOAP responses"
|
||||||
},
|
},
|
||||||
"time": "2023-03-06T18:09:13+00:00",
|
"time": "2023-04-12T12:00:00+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
@@ -204,7 +204,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/filp/whoops/issues",
|
"issues": "https://github.com/filp/whoops/issues",
|
||||||
"source": "https://github.com/filp/whoops/tree/2.15.1"
|
"source": "https://github.com/filp/whoops/tree/2.15.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -586,6 +586,161 @@
|
|||||||
},
|
},
|
||||||
"install-path": "../psr/log"
|
"install-path": "../psr/log"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/deprecation-contracts",
|
||||||
|
"version": "v2.5.2",
|
||||||
|
"version_normalized": "2.5.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||||
|
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||||
|
"reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"time": "2022-01-02T09:53:40+00:00",
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "2.5-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/contracts",
|
||||||
|
"url": "https://github.com/symfony/contracts"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"function.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"install-path": "../symfony/deprecation-contracts"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/polyfill-ctype",
|
||||||
|
"version": "v1.27.0",
|
||||||
|
"version_normalized": "1.27.0.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/polyfill-ctype.git",
|
||||||
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
|
"reference": "5bbc823adecdae860bb64756d639ecfec17b050a",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"ext-ctype": "*"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-ctype": "For best performance"
|
||||||
|
},
|
||||||
|
"time": "2022-11-03T14:55:06+00:00",
|
||||||
|
"type": "library",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.27-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/polyfill",
|
||||||
|
"url": "https://github.com/symfony/polyfill"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Ctype\\": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Gert de Pagter",
|
||||||
|
"email": "BackEndTea@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Symfony polyfill for ctype functions",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"keywords": [
|
||||||
|
"compatibility",
|
||||||
|
"ctype",
|
||||||
|
"polyfill",
|
||||||
|
"portable"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/polyfill-ctype/tree/v1.27.0"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"install-path": "../symfony/polyfill-ctype"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-idn",
|
"name": "symfony/polyfill-intl-idn",
|
||||||
"version": "v1.27.0",
|
"version": "v1.27.0",
|
||||||
@@ -848,6 +1003,84 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"install-path": "../symfony/polyfill-mbstring"
|
"install-path": "../symfony/polyfill-mbstring"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "symfony/yaml",
|
||||||
|
"version": "v5.4.21",
|
||||||
|
"version_normalized": "5.4.21.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/symfony/yaml.git",
|
||||||
|
"reference": "3713e20d93e46e681e51605d213027e48dab3469"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/symfony/yaml/zipball/3713e20d93e46e681e51605d213027e48dab3469",
|
||||||
|
"reference": "3713e20d93e46e681e51605d213027e48dab3469",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"symfony/deprecation-contracts": "^2.1|^3",
|
||||||
|
"symfony/polyfill-ctype": "^1.8"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/console": "<5.3"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/console": "^5.3|^6.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/console": "For validating YAML files using the lint command"
|
||||||
|
},
|
||||||
|
"time": "2023-02-21T19:46:44+00:00",
|
||||||
|
"bin": [
|
||||||
|
"Resources/bin/yaml-lint"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\Yaml\\": ""
|
||||||
|
},
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Loads and dumps YAML files",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"support": {
|
||||||
|
"source": "https://github.com/symfony/yaml/tree/v5.4.21"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://symfony.com/sponsor",
|
||||||
|
"type": "custom"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/fabpot",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"install-path": "../symfony/yaml"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
41
kirby/vendor/composer/installed.php
vendored
41
kirby/vendor/composer/installed.php
vendored
@@ -1,8 +1,8 @@
|
|||||||
<?php return array(
|
<?php return array(
|
||||||
'root' => array(
|
'root' => array(
|
||||||
'name' => 'getkirby/cms',
|
'name' => 'getkirby/cms',
|
||||||
'pretty_version' => '3.9.3',
|
'pretty_version' => '3.9.4',
|
||||||
'version' => '3.9.3.0',
|
'version' => '3.9.4.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -29,17 +29,17 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'filp/whoops' => array(
|
'filp/whoops' => array(
|
||||||
'pretty_version' => '2.15.1',
|
'pretty_version' => '2.15.2',
|
||||||
'version' => '2.15.1.0',
|
'version' => '2.15.2.0',
|
||||||
'reference' => 'e864ac957acd66e1565f25efda61e37791a5db0b',
|
'reference' => 'aac9304c5ed61bf7b1b7a6064bf9806ab842ce73',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../filp/whoops',
|
'install_path' => __DIR__ . '/../filp/whoops',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'getkirby/cms' => array(
|
'getkirby/cms' => array(
|
||||||
'pretty_version' => '3.9.3',
|
'pretty_version' => '3.9.4',
|
||||||
'version' => '3.9.3.0',
|
'version' => '3.9.4.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -106,6 +106,24 @@
|
|||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
|
'symfony/deprecation-contracts' => array(
|
||||||
|
'pretty_version' => 'v2.5.2',
|
||||||
|
'version' => '2.5.2.0',
|
||||||
|
'reference' => 'e8b495ea28c1d97b5e0c121748d6f9b53d075c66',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
|
'symfony/polyfill-ctype' => array(
|
||||||
|
'pretty_version' => 'v1.27.0',
|
||||||
|
'version' => '1.27.0.0',
|
||||||
|
'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
'symfony/polyfill-intl-idn' => array(
|
'symfony/polyfill-intl-idn' => array(
|
||||||
'pretty_version' => 'v1.27.0',
|
'pretty_version' => 'v1.27.0',
|
||||||
'version' => '1.27.0.0',
|
'version' => '1.27.0.0',
|
||||||
@@ -139,5 +157,14 @@
|
|||||||
0 => '*',
|
0 => '*',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
'symfony/yaml' => array(
|
||||||
|
'pretty_version' => 'v5.4.21',
|
||||||
|
'version' => '5.4.21.0',
|
||||||
|
'reference' => '3713e20d93e46e681e51605d213027e48dab3469',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../symfony/yaml',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
?>
|
?>
|
||||||
<pre class="code-block line-numbers"
|
<pre class="code-block line-numbers"
|
||||||
data-line="<?php echo $line ?>"
|
data-line="<?php echo $line ?>"
|
||||||
|
data-line-offset="<?php echo $start ?>"
|
||||||
data-start="<?php echo $start ?>"
|
data-start="<?php echo $start ?>"
|
||||||
><code class="language-php"><?php echo $tpl->escape($code) ?></code></pre>
|
><code class="language-php"><?php echo $tpl->escape($code) ?></code></pre>
|
||||||
|
|
||||||
|
19
kirby/vendor/symfony/deprecation-contracts/LICENSE
vendored
Normal file
19
kirby/vendor/symfony/deprecation-contracts/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2020-2022 Fabien Potencier
|
||||||
|
|
||||||
|
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.
|
35
kirby/vendor/symfony/deprecation-contracts/composer.json
vendored
Normal file
35
kirby/vendor/symfony/deprecation-contracts/composer.json
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "symfony/deprecation-contracts",
|
||||||
|
"type": "library",
|
||||||
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nicolas Grekas",
|
||||||
|
"email": "p@tchwork.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"function.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "2.5-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/contracts",
|
||||||
|
"url": "https://github.com/symfony/contracts"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
27
kirby/vendor/symfony/deprecation-contracts/function.php
vendored
Normal file
27
kirby/vendor/symfony/deprecation-contracts/function.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if (!function_exists('trigger_deprecation')) {
|
||||||
|
/**
|
||||||
|
* Triggers a silenced deprecation notice.
|
||||||
|
*
|
||||||
|
* @param string $package The name of the Composer package that is triggering the deprecation
|
||||||
|
* @param string $version The version of the package that introduced the deprecation
|
||||||
|
* @param string $message The message of the deprecation
|
||||||
|
* @param mixed ...$args Values to insert in the message using printf() formatting
|
||||||
|
*
|
||||||
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
|
*/
|
||||||
|
function trigger_deprecation(string $package, string $version, string $message, ...$args): void
|
||||||
|
{
|
||||||
|
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
}
|
232
kirby/vendor/symfony/polyfill-ctype/Ctype.php
vendored
Normal file
232
kirby/vendor/symfony/polyfill-ctype/Ctype.php
vendored
Normal file
@@ -0,0 +1,232 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Polyfill\Ctype;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ctype implementation through regex.
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* @author Gert de Pagter <BackEndTea@gmail.com>
|
||||||
|
*/
|
||||||
|
final class Ctype
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-alnum
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_alnum($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is a letter, FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-alpha
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_alpha($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-cntrl
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_cntrl($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-digit
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_digit($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-graph
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_graph($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is a lowercase letter.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-lower
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_lower($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-print
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_print($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-punct
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_punct($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-space
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_space($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is an uppercase letter.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-upper
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_upper($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
|
||||||
|
*
|
||||||
|
* @see https://php.net/ctype-xdigit
|
||||||
|
*
|
||||||
|
* @param mixed $text
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function ctype_xdigit($text)
|
||||||
|
{
|
||||||
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts integers to their char versions according to normal ctype behaviour, if needed.
|
||||||
|
*
|
||||||
|
* If an integer between -128 and 255 inclusive is provided,
|
||||||
|
* it is interpreted as the ASCII value of a single character
|
||||||
|
* (negative values have 256 added in order to allow characters in the Extended ASCII range).
|
||||||
|
* Any other integer is interpreted as a string containing the decimal digits of the integer.
|
||||||
|
*
|
||||||
|
* @param mixed $int
|
||||||
|
* @param string $function
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
private static function convert_int_to_char_for_ctype($int, $function)
|
||||||
|
{
|
||||||
|
if (!\is_int($int)) {
|
||||||
|
return $int;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($int < -128 || $int > 255) {
|
||||||
|
return (string) $int;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (\PHP_VERSION_ID >= 80100) {
|
||||||
|
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($int < 0) {
|
||||||
|
$int += 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
return \chr($int);
|
||||||
|
}
|
||||||
|
}
|
19
kirby/vendor/symfony/polyfill-ctype/LICENSE
vendored
Normal file
19
kirby/vendor/symfony/polyfill-ctype/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2018-2019 Fabien Potencier
|
||||||
|
|
||||||
|
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.
|
50
kirby/vendor/symfony/polyfill-ctype/bootstrap.php
vendored
Normal file
50
kirby/vendor/symfony/polyfill-ctype/bootstrap.php
vendored
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Symfony\Polyfill\Ctype as p;
|
||||||
|
|
||||||
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
|
return require __DIR__.'/bootstrap80.php';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!function_exists('ctype_alnum')) {
|
||||||
|
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_alpha')) {
|
||||||
|
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_cntrl')) {
|
||||||
|
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_digit')) {
|
||||||
|
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_graph')) {
|
||||||
|
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_lower')) {
|
||||||
|
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_print')) {
|
||||||
|
function ctype_print($text) { return p\Ctype::ctype_print($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_punct')) {
|
||||||
|
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_space')) {
|
||||||
|
function ctype_space($text) { return p\Ctype::ctype_space($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_upper')) {
|
||||||
|
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_xdigit')) {
|
||||||
|
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
|
||||||
|
}
|
46
kirby/vendor/symfony/polyfill-ctype/bootstrap80.php
vendored
Normal file
46
kirby/vendor/symfony/polyfill-ctype/bootstrap80.php
vendored
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Symfony\Polyfill\Ctype as p;
|
||||||
|
|
||||||
|
if (!function_exists('ctype_alnum')) {
|
||||||
|
function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_alpha')) {
|
||||||
|
function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_cntrl')) {
|
||||||
|
function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_digit')) {
|
||||||
|
function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_graph')) {
|
||||||
|
function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_lower')) {
|
||||||
|
function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_print')) {
|
||||||
|
function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_punct')) {
|
||||||
|
function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_space')) {
|
||||||
|
function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_upper')) {
|
||||||
|
function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); }
|
||||||
|
}
|
||||||
|
if (!function_exists('ctype_xdigit')) {
|
||||||
|
function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); }
|
||||||
|
}
|
41
kirby/vendor/symfony/polyfill-ctype/composer.json
vendored
Normal file
41
kirby/vendor/symfony/polyfill-ctype/composer.json
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"name": "symfony/polyfill-ctype",
|
||||||
|
"type": "library",
|
||||||
|
"description": "Symfony polyfill for ctype functions",
|
||||||
|
"keywords": ["polyfill", "compatibility", "portable", "ctype"],
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Gert de Pagter",
|
||||||
|
"email": "BackEndTea@gmail.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"provide": {
|
||||||
|
"ext-ctype": "*"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
|
||||||
|
"files": [ "bootstrap.php" ]
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-ctype": "For best performance"
|
||||||
|
},
|
||||||
|
"minimum-stability": "dev",
|
||||||
|
"extra": {
|
||||||
|
"branch-alias": {
|
||||||
|
"dev-main": "1.27-dev"
|
||||||
|
},
|
||||||
|
"thanks": {
|
||||||
|
"name": "symfony/polyfill",
|
||||||
|
"url": "https://github.com/symfony/polyfill"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
289
kirby/vendor/symfony/yaml/Command/LintCommand.php
vendored
Normal file
289
kirby/vendor/symfony/yaml/Command/LintCommand.php
vendored
Normal file
@@ -0,0 +1,289 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Command;
|
||||||
|
|
||||||
|
use Symfony\Component\Console\CI\GithubActionReporter;
|
||||||
|
use Symfony\Component\Console\Command\Command;
|
||||||
|
use Symfony\Component\Console\Completion\CompletionInput;
|
||||||
|
use Symfony\Component\Console\Completion\CompletionSuggestions;
|
||||||
|
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||||
|
use Symfony\Component\Console\Exception\RuntimeException;
|
||||||
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
use Symfony\Component\Yaml\Parser;
|
||||||
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates YAML files syntax and outputs encountered errors.
|
||||||
|
*
|
||||||
|
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||||
|
* @author Robin Chalas <robin.chalas@gmail.com>
|
||||||
|
*/
|
||||||
|
class LintCommand extends Command
|
||||||
|
{
|
||||||
|
protected static $defaultName = 'lint:yaml';
|
||||||
|
protected static $defaultDescription = 'Lint a YAML file and outputs encountered errors';
|
||||||
|
|
||||||
|
private $parser;
|
||||||
|
private $format;
|
||||||
|
private $displayCorrectFiles;
|
||||||
|
private $directoryIteratorProvider;
|
||||||
|
private $isReadableProvider;
|
||||||
|
|
||||||
|
public function __construct(string $name = null, callable $directoryIteratorProvider = null, callable $isReadableProvider = null)
|
||||||
|
{
|
||||||
|
parent::__construct($name);
|
||||||
|
|
||||||
|
$this->directoryIteratorProvider = $directoryIteratorProvider;
|
||||||
|
$this->isReadableProvider = $isReadableProvider;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
protected function configure()
|
||||||
|
{
|
||||||
|
$this
|
||||||
|
->setDescription(self::$defaultDescription)
|
||||||
|
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
|
||||||
|
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The output format')
|
||||||
|
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
|
||||||
|
->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
|
||||||
|
->setHelp(<<<EOF
|
||||||
|
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
|
||||||
|
the first encountered syntax error.
|
||||||
|
|
||||||
|
You can validates YAML contents passed from STDIN:
|
||||||
|
|
||||||
|
<info>cat filename | php %command.full_name% -</info>
|
||||||
|
|
||||||
|
You can also validate the syntax of a file:
|
||||||
|
|
||||||
|
<info>php %command.full_name% filename</info>
|
||||||
|
|
||||||
|
Or of a whole directory:
|
||||||
|
|
||||||
|
<info>php %command.full_name% dirname</info>
|
||||||
|
<info>php %command.full_name% dirname --format=json</info>
|
||||||
|
|
||||||
|
You can also exclude one or more specific files:
|
||||||
|
|
||||||
|
<info>php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml"</info>
|
||||||
|
|
||||||
|
EOF
|
||||||
|
)
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute(InputInterface $input, OutputInterface $output)
|
||||||
|
{
|
||||||
|
$io = new SymfonyStyle($input, $output);
|
||||||
|
$filenames = (array) $input->getArgument('filename');
|
||||||
|
$excludes = $input->getOption('exclude');
|
||||||
|
$this->format = $input->getOption('format');
|
||||||
|
$flags = $input->getOption('parse-tags');
|
||||||
|
|
||||||
|
if ('github' === $this->format && !class_exists(GithubActionReporter::class)) {
|
||||||
|
throw new \InvalidArgumentException('The "github" format is only available since "symfony/console" >= 5.3.');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $this->format) {
|
||||||
|
// Autodetect format according to CI environment
|
||||||
|
$this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt';
|
||||||
|
}
|
||||||
|
|
||||||
|
$flags = $flags ? Yaml::PARSE_CUSTOM_TAGS : 0;
|
||||||
|
|
||||||
|
$this->displayCorrectFiles = $output->isVerbose();
|
||||||
|
|
||||||
|
if (['-'] === $filenames) {
|
||||||
|
return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$filenames) {
|
||||||
|
throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$filesInfo = [];
|
||||||
|
foreach ($filenames as $filename) {
|
||||||
|
if (!$this->isReadable($filename)) {
|
||||||
|
throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($this->getFiles($filename) as $file) {
|
||||||
|
if (!\in_array($file->getPathname(), $excludes, true)) {
|
||||||
|
$filesInfo[] = $this->validate(file_get_contents($file), $flags, $file);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->display($io, $filesInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function validate(string $content, int $flags, string $file = null)
|
||||||
|
{
|
||||||
|
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
|
||||||
|
if (\E_USER_DEPRECATED === $level) {
|
||||||
|
throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false;
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
$this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags);
|
||||||
|
} catch (ParseException $e) {
|
||||||
|
return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()];
|
||||||
|
} finally {
|
||||||
|
restore_error_handler();
|
||||||
|
}
|
||||||
|
|
||||||
|
return ['file' => $file, 'valid' => true];
|
||||||
|
}
|
||||||
|
|
||||||
|
private function display(SymfonyStyle $io, array $files): int
|
||||||
|
{
|
||||||
|
switch ($this->format) {
|
||||||
|
case 'txt':
|
||||||
|
return $this->displayTxt($io, $files);
|
||||||
|
case 'json':
|
||||||
|
return $this->displayJson($io, $files);
|
||||||
|
case 'github':
|
||||||
|
return $this->displayTxt($io, $files, true);
|
||||||
|
default:
|
||||||
|
throw new InvalidArgumentException(sprintf('The format "%s" is not supported.', $this->format));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int
|
||||||
|
{
|
||||||
|
$countFiles = \count($filesInfo);
|
||||||
|
$erroredFiles = 0;
|
||||||
|
$suggestTagOption = false;
|
||||||
|
|
||||||
|
if ($errorAsGithubAnnotations) {
|
||||||
|
$githubReporter = new GithubActionReporter($io);
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($filesInfo as $info) {
|
||||||
|
if ($info['valid'] && $this->displayCorrectFiles) {
|
||||||
|
$io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
||||||
|
} elseif (!$info['valid']) {
|
||||||
|
++$erroredFiles;
|
||||||
|
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
||||||
|
$io->text(sprintf('<error> >> %s</error>', $info['message']));
|
||||||
|
|
||||||
|
if (false !== strpos($info['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||||
|
$suggestTagOption = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($errorAsGithubAnnotations) {
|
||||||
|
$githubReporter->error($info['message'], $info['file'] ?? 'php://stdin', $info['line']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 === $erroredFiles) {
|
||||||
|
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
|
||||||
|
} else {
|
||||||
|
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
|
||||||
|
}
|
||||||
|
|
||||||
|
return min($erroredFiles, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function displayJson(SymfonyStyle $io, array $filesInfo): int
|
||||||
|
{
|
||||||
|
$errors = 0;
|
||||||
|
|
||||||
|
array_walk($filesInfo, function (&$v) use (&$errors) {
|
||||||
|
$v['file'] = (string) $v['file'];
|
||||||
|
if (!$v['valid']) {
|
||||||
|
++$errors;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($v['message']) && false !== strpos($v['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||||
|
$v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
|
||||||
|
|
||||||
|
return min($errors, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getFiles(string $fileOrDirectory): iterable
|
||||||
|
{
|
||||||
|
if (is_file($fileOrDirectory)) {
|
||||||
|
yield new \SplFileInfo($fileOrDirectory);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) {
|
||||||
|
if (!\in_array($file->getExtension(), ['yml', 'yaml'])) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield $file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getParser(): Parser
|
||||||
|
{
|
||||||
|
if (!$this->parser) {
|
||||||
|
$this->parser = new Parser();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->parser;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getDirectoryIterator(string $directory): iterable
|
||||||
|
{
|
||||||
|
$default = function ($directory) {
|
||||||
|
return new \RecursiveIteratorIterator(
|
||||||
|
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
|
||||||
|
\RecursiveIteratorIterator::LEAVES_ONLY
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (null !== $this->directoryIteratorProvider) {
|
||||||
|
return ($this->directoryIteratorProvider)($directory, $default);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $default($directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function isReadable(string $fileOrDirectory): bool
|
||||||
|
{
|
||||||
|
$default = function ($fileOrDirectory) {
|
||||||
|
return is_readable($fileOrDirectory);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (null !== $this->isReadableProvider) {
|
||||||
|
return ($this->isReadableProvider)($fileOrDirectory, $default);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $default($fileOrDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
|
||||||
|
{
|
||||||
|
if ($input->mustSuggestOptionValuesFor('format')) {
|
||||||
|
$suggestions->suggestValues(['txt', 'json', 'github']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
166
kirby/vendor/symfony/yaml/Dumper.php
vendored
Normal file
166
kirby/vendor/symfony/yaml/Dumper.php
vendored
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
|
use Symfony\Component\Yaml\Tag\TaggedValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumper dumps PHP variables to YAML strings.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @final
|
||||||
|
*/
|
||||||
|
class Dumper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The amount of spaces to use for indentation of nested nodes.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
protected $indentation;
|
||||||
|
|
||||||
|
public function __construct(int $indentation = 4)
|
||||||
|
{
|
||||||
|
if ($indentation < 1) {
|
||||||
|
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->indentation = $indentation;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumps a PHP value to YAML.
|
||||||
|
*
|
||||||
|
* @param mixed $input The PHP value
|
||||||
|
* @param int $inline The level where you switch to inline YAML
|
||||||
|
* @param int $indent The level of indentation (used internally)
|
||||||
|
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
|
||||||
|
*/
|
||||||
|
public function dump($input, int $inline = 0, int $indent = 0, int $flags = 0): string
|
||||||
|
{
|
||||||
|
$output = '';
|
||||||
|
$prefix = $indent ? str_repeat(' ', $indent) : '';
|
||||||
|
$dumpObjectAsInlineMap = true;
|
||||||
|
|
||||||
|
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) {
|
||||||
|
$dumpObjectAsInlineMap = empty((array) $input);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) {
|
||||||
|
$output .= $prefix.Inline::dump($input, $flags);
|
||||||
|
} elseif ($input instanceof TaggedValue) {
|
||||||
|
$output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix);
|
||||||
|
} else {
|
||||||
|
$dumpAsMap = Inline::isHash($input);
|
||||||
|
|
||||||
|
foreach ($input as $key => $value) {
|
||||||
|
if ('' !== $output && "\n" !== $output[-1]) {
|
||||||
|
$output .= "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && false !== strpos($value, "\n") && false === strpos($value, "\r")) {
|
||||||
|
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
|
||||||
|
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||||
|
$blockIndentationIndicator = (' ' === substr($value, 0, 1)) ? (string) $this->indentation : '';
|
||||||
|
|
||||||
|
if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) {
|
||||||
|
$blockChompingIndicator = '+';
|
||||||
|
} elseif ("\n" === $value[-1]) {
|
||||||
|
$blockChompingIndicator = '';
|
||||||
|
} else {
|
||||||
|
$blockChompingIndicator = '-';
|
||||||
|
}
|
||||||
|
|
||||||
|
$output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator);
|
||||||
|
|
||||||
|
foreach (explode("\n", $value) as $row) {
|
||||||
|
if ('' === $row) {
|
||||||
|
$output .= "\n";
|
||||||
|
} else {
|
||||||
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($value instanceof TaggedValue) {
|
||||||
|
$output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
|
||||||
|
|
||||||
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
|
||||||
|
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
|
||||||
|
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||||
|
$blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : '';
|
||||||
|
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
||||||
|
|
||||||
|
foreach (explode("\n", $value->getValue()) as $row) {
|
||||||
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
||||||
|
$output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
||||||
|
} else {
|
||||||
|
$output .= "\n";
|
||||||
|
$output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$dumpObjectAsInlineMap = true;
|
||||||
|
|
||||||
|
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) {
|
||||||
|
$dumpObjectAsInlineMap = empty((array) $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value);
|
||||||
|
|
||||||
|
$output .= sprintf('%s%s%s%s',
|
||||||
|
$prefix,
|
||||||
|
$dumpAsMap ? Inline::dump($key, $flags).':' : '-',
|
||||||
|
$willBeInlined ? ' ' : "\n",
|
||||||
|
$this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
|
||||||
|
).($willBeInlined ? "\n" : '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string
|
||||||
|
{
|
||||||
|
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
|
||||||
|
|
||||||
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && false !== strpos($value->getValue(), "\n") && false === strpos($value->getValue(), "\r\n")) {
|
||||||
|
// If the first line starts with a space character, the spec requires a blockIndicationIndicator
|
||||||
|
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||||
|
$blockIndentationIndicator = (' ' === substr($value->getValue(), 0, 1)) ? (string) $this->indentation : '';
|
||||||
|
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
||||||
|
|
||||||
|
foreach (explode("\n", $value->getValue()) as $row) {
|
||||||
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
||||||
|
return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags);
|
||||||
|
}
|
||||||
|
}
|
95
kirby/vendor/symfony/yaml/Escaper.php
vendored
Normal file
95
kirby/vendor/symfony/yaml/Escaper.php
vendored
Normal file
@@ -0,0 +1,95 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escaper encapsulates escaping rules for single and double-quoted
|
||||||
|
* YAML strings.
|
||||||
|
*
|
||||||
|
* @author Matthew Lewinski <matthew@lewinski.org>
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class Escaper
|
||||||
|
{
|
||||||
|
// Characters that would cause a dumped string to require double quoting.
|
||||||
|
public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
|
||||||
|
|
||||||
|
// Mapping arrays for escaping a double quoted string. The backslash is
|
||||||
|
// first to ensure proper escaping because str_replace operates iteratively
|
||||||
|
// on the input arrays. This ordering of the characters avoids the use of strtr,
|
||||||
|
// which performs more slowly.
|
||||||
|
private const ESCAPEES = ['\\', '\\\\', '\\"', '"',
|
||||||
|
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
|
||||||
|
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
||||||
|
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
||||||
|
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
||||||
|
"\x7f",
|
||||||
|
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
|
||||||
|
];
|
||||||
|
private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"',
|
||||||
|
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
||||||
|
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
||||||
|
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
||||||
|
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
||||||
|
'\\x7f',
|
||||||
|
'\\N', '\\_', '\\L', '\\P',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a PHP value would require double quoting in YAML.
|
||||||
|
*
|
||||||
|
* @param string $value A PHP value
|
||||||
|
*/
|
||||||
|
public static function requiresDoubleQuoting(string $value): bool
|
||||||
|
{
|
||||||
|
return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes and surrounds a PHP value with double quotes.
|
||||||
|
*
|
||||||
|
* @param string $value A PHP value
|
||||||
|
*/
|
||||||
|
public static function escapeWithDoubleQuotes(string $value): string
|
||||||
|
{
|
||||||
|
return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a PHP value would require single quoting in YAML.
|
||||||
|
*
|
||||||
|
* @param string $value A PHP value
|
||||||
|
*/
|
||||||
|
public static function requiresSingleQuoting(string $value): bool
|
||||||
|
{
|
||||||
|
// Determines if a PHP value is entirely composed of a value that would
|
||||||
|
// require single quoting in YAML.
|
||||||
|
if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Determines if the PHP value contains any single characters that would
|
||||||
|
// cause it to require single quoting in YAML.
|
||||||
|
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Escapes and surrounds a PHP value with single quotes.
|
||||||
|
*
|
||||||
|
* @param string $value A PHP value
|
||||||
|
*/
|
||||||
|
public static function escapeWithSingleQuotes(string $value): string
|
||||||
|
{
|
||||||
|
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
|
||||||
|
}
|
||||||
|
}
|
21
kirby/vendor/symfony/yaml/Exception/DumpException.php
vendored
Normal file
21
kirby/vendor/symfony/yaml/Exception/DumpException.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception class thrown when an error occurs during dumping.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*/
|
||||||
|
class DumpException extends RuntimeException
|
||||||
|
{
|
||||||
|
}
|
21
kirby/vendor/symfony/yaml/Exception/ExceptionInterface.php
vendored
Normal file
21
kirby/vendor/symfony/yaml/Exception/ExceptionInterface.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception interface for all exceptions thrown by the component.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*/
|
||||||
|
interface ExceptionInterface extends \Throwable
|
||||||
|
{
|
||||||
|
}
|
132
kirby/vendor/symfony/yaml/Exception/ParseException.php
vendored
Normal file
132
kirby/vendor/symfony/yaml/Exception/ParseException.php
vendored
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception class thrown when an error occurs during parsing.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*/
|
||||||
|
class ParseException extends RuntimeException
|
||||||
|
{
|
||||||
|
private $parsedFile;
|
||||||
|
private $parsedLine;
|
||||||
|
private $snippet;
|
||||||
|
private $rawMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $message The error message
|
||||||
|
* @param int $parsedLine The line where the error occurred
|
||||||
|
* @param string|null $snippet The snippet of code near the problem
|
||||||
|
* @param string|null $parsedFile The file name where the error occurred
|
||||||
|
*/
|
||||||
|
public function __construct(string $message, int $parsedLine = -1, string $snippet = null, string $parsedFile = null, \Throwable $previous = null)
|
||||||
|
{
|
||||||
|
$this->parsedFile = $parsedFile;
|
||||||
|
$this->parsedLine = $parsedLine;
|
||||||
|
$this->snippet = $snippet;
|
||||||
|
$this->rawMessage = $message;
|
||||||
|
|
||||||
|
$this->updateRepr();
|
||||||
|
|
||||||
|
parent::__construct($this->message, 0, $previous);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the snippet of code near the error.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getSnippet()
|
||||||
|
{
|
||||||
|
return $this->snippet;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the snippet of code near the error.
|
||||||
|
*/
|
||||||
|
public function setSnippet(string $snippet)
|
||||||
|
{
|
||||||
|
$this->snippet = $snippet;
|
||||||
|
|
||||||
|
$this->updateRepr();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the filename where the error occurred.
|
||||||
|
*
|
||||||
|
* This method returns null if a string is parsed.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getParsedFile()
|
||||||
|
{
|
||||||
|
return $this->parsedFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the filename where the error occurred.
|
||||||
|
*/
|
||||||
|
public function setParsedFile(string $parsedFile)
|
||||||
|
{
|
||||||
|
$this->parsedFile = $parsedFile;
|
||||||
|
|
||||||
|
$this->updateRepr();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the line where the error occurred.
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public function getParsedLine()
|
||||||
|
{
|
||||||
|
return $this->parsedLine;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the line where the error occurred.
|
||||||
|
*/
|
||||||
|
public function setParsedLine(int $parsedLine)
|
||||||
|
{
|
||||||
|
$this->parsedLine = $parsedLine;
|
||||||
|
|
||||||
|
$this->updateRepr();
|
||||||
|
}
|
||||||
|
|
||||||
|
private function updateRepr()
|
||||||
|
{
|
||||||
|
$this->message = $this->rawMessage;
|
||||||
|
|
||||||
|
$dot = false;
|
||||||
|
if ('.' === substr($this->message, -1)) {
|
||||||
|
$this->message = substr($this->message, 0, -1);
|
||||||
|
$dot = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $this->parsedFile) {
|
||||||
|
$this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->parsedLine >= 0) {
|
||||||
|
$this->message .= sprintf(' at line %d', $this->parsedLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->snippet) {
|
||||||
|
$this->message .= sprintf(' (near "%s")', $this->snippet);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($dot) {
|
||||||
|
$this->message .= '.';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
kirby/vendor/symfony/yaml/Exception/RuntimeException.php
vendored
Normal file
21
kirby/vendor/symfony/yaml/Exception/RuntimeException.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Exception class thrown when an error occurs during parsing.
|
||||||
|
*
|
||||||
|
* @author Romain Neutron <imprec@gmail.com>
|
||||||
|
*/
|
||||||
|
class RuntimeException extends \RuntimeException implements ExceptionInterface
|
||||||
|
{
|
||||||
|
}
|
811
kirby/vendor/symfony/yaml/Inline.php
vendored
Normal file
811
kirby/vendor/symfony/yaml/Inline.php
vendored
Normal file
@@ -0,0 +1,811 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
|
use Symfony\Component\Yaml\Exception\DumpException;
|
||||||
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
use Symfony\Component\Yaml\Tag\TaggedValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inline implements a YAML parser/dumper for the YAML inline syntax.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class Inline
|
||||||
|
{
|
||||||
|
public const REGEX_QUOTED_STRING = '(?:"([^"\\\\]*+(?:\\\\.[^"\\\\]*+)*+)"|\'([^\']*+(?:\'\'[^\']*+)*+)\')';
|
||||||
|
|
||||||
|
public static $parsedLineNumber = -1;
|
||||||
|
public static $parsedFilename;
|
||||||
|
|
||||||
|
private static $exceptionOnInvalidType = false;
|
||||||
|
private static $objectSupport = false;
|
||||||
|
private static $objectForMap = false;
|
||||||
|
private static $constantSupport = false;
|
||||||
|
|
||||||
|
public static function initialize(int $flags, int $parsedLineNumber = null, string $parsedFilename = null)
|
||||||
|
{
|
||||||
|
self::$exceptionOnInvalidType = (bool) (Yaml::PARSE_EXCEPTION_ON_INVALID_TYPE & $flags);
|
||||||
|
self::$objectSupport = (bool) (Yaml::PARSE_OBJECT & $flags);
|
||||||
|
self::$objectForMap = (bool) (Yaml::PARSE_OBJECT_FOR_MAP & $flags);
|
||||||
|
self::$constantSupport = (bool) (Yaml::PARSE_CONSTANT & $flags);
|
||||||
|
self::$parsedFilename = $parsedFilename;
|
||||||
|
|
||||||
|
if (null !== $parsedLineNumber) {
|
||||||
|
self::$parsedLineNumber = $parsedLineNumber;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts a YAML string to a PHP value.
|
||||||
|
*
|
||||||
|
* @param string|null $value A YAML string
|
||||||
|
* @param int $flags A bit field of Yaml::PARSE_* constants to customize the YAML parser behavior
|
||||||
|
* @param array $references Mapping of variable names to values
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws ParseException
|
||||||
|
*/
|
||||||
|
public static function parse(string $value = null, int $flags = 0, array &$references = [])
|
||||||
|
{
|
||||||
|
self::initialize($flags);
|
||||||
|
|
||||||
|
$value = trim($value);
|
||||||
|
|
||||||
|
if ('' === $value) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) {
|
||||||
|
$mbEncoding = mb_internal_encoding();
|
||||||
|
mb_internal_encoding('ASCII');
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
$i = 0;
|
||||||
|
$tag = self::parseTag($value, $i, $flags);
|
||||||
|
switch ($value[$i]) {
|
||||||
|
case '[':
|
||||||
|
$result = self::parseSequence($value, $flags, $i, $references);
|
||||||
|
++$i;
|
||||||
|
break;
|
||||||
|
case '{':
|
||||||
|
$result = self::parseMapping($value, $flags, $i, $references);
|
||||||
|
++$i;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$result = self::parseScalar($value, $flags, null, $i, true, $references);
|
||||||
|
}
|
||||||
|
|
||||||
|
// some comments are allowed at the end
|
||||||
|
if (preg_replace('/\s*#.*$/A', '', substr($value, $i))) {
|
||||||
|
throw new ParseException(sprintf('Unexpected characters near "%s".', substr($value, $i)), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $tag && '' !== $tag) {
|
||||||
|
return new TaggedValue($tag, $result);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
} finally {
|
||||||
|
if (isset($mbEncoding)) {
|
||||||
|
mb_internal_encoding($mbEncoding);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumps a given PHP variable to a YAML string.
|
||||||
|
*
|
||||||
|
* @param mixed $value The PHP variable to convert
|
||||||
|
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
|
||||||
|
*
|
||||||
|
* @throws DumpException When trying to dump PHP resource
|
||||||
|
*/
|
||||||
|
public static function dump($value, int $flags = 0): string
|
||||||
|
{
|
||||||
|
switch (true) {
|
||||||
|
case \is_resource($value):
|
||||||
|
if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
|
||||||
|
throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::dumpNull($flags);
|
||||||
|
case $value instanceof \DateTimeInterface:
|
||||||
|
return $value->format('c');
|
||||||
|
case $value instanceof \UnitEnum:
|
||||||
|
return sprintf('!php/const %s::%s', \get_class($value), $value->name);
|
||||||
|
case \is_object($value):
|
||||||
|
if ($value instanceof TaggedValue) {
|
||||||
|
return '!'.$value->getTag().' '.self::dump($value->getValue(), $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Yaml::DUMP_OBJECT & $flags) {
|
||||||
|
return '!php/object '.self::dump(serialize($value));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \stdClass || $value instanceof \ArrayObject)) {
|
||||||
|
$output = [];
|
||||||
|
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
$output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf('{ %s }', implode(', ', $output));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Yaml::DUMP_EXCEPTION_ON_INVALID_TYPE & $flags) {
|
||||||
|
throw new DumpException('Object support when dumping a YAML file has been disabled.');
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::dumpNull($flags);
|
||||||
|
case \is_array($value):
|
||||||
|
return self::dumpArray($value, $flags);
|
||||||
|
case null === $value:
|
||||||
|
return self::dumpNull($flags);
|
||||||
|
case true === $value:
|
||||||
|
return 'true';
|
||||||
|
case false === $value:
|
||||||
|
return 'false';
|
||||||
|
case \is_int($value):
|
||||||
|
return $value;
|
||||||
|
case is_numeric($value) && false === strpbrk($value, "\f\n\r\t\v"):
|
||||||
|
$locale = setlocale(\LC_NUMERIC, 0);
|
||||||
|
if (false !== $locale) {
|
||||||
|
setlocale(\LC_NUMERIC, 'C');
|
||||||
|
}
|
||||||
|
if (\is_float($value)) {
|
||||||
|
$repr = (string) $value;
|
||||||
|
if (is_infinite($value)) {
|
||||||
|
$repr = str_ireplace('INF', '.Inf', $repr);
|
||||||
|
} elseif (floor($value) == $value && $repr == $value) {
|
||||||
|
// Preserve float data type since storing a whole number will result in integer value.
|
||||||
|
if (false === strpos($repr, 'E')) {
|
||||||
|
$repr = $repr.'.0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$repr = \is_string($value) ? "'$value'" : (string) $value;
|
||||||
|
}
|
||||||
|
if (false !== $locale) {
|
||||||
|
setlocale(\LC_NUMERIC, $locale);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $repr;
|
||||||
|
case '' == $value:
|
||||||
|
return "''";
|
||||||
|
case self::isBinaryString($value):
|
||||||
|
return '!!binary '.base64_encode($value);
|
||||||
|
case Escaper::requiresDoubleQuoting($value):
|
||||||
|
return Escaper::escapeWithDoubleQuotes($value);
|
||||||
|
case Escaper::requiresSingleQuoting($value):
|
||||||
|
case Parser::preg_match('{^[0-9]+[_0-9]*$}', $value):
|
||||||
|
case Parser::preg_match(self::getHexRegex(), $value):
|
||||||
|
case Parser::preg_match(self::getTimestampRegex(), $value):
|
||||||
|
return Escaper::escapeWithSingleQuotes($value);
|
||||||
|
default:
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if given array is hash or just normal indexed array.
|
||||||
|
*
|
||||||
|
* @param array|\ArrayObject|\stdClass $value The PHP array or array-like object to check
|
||||||
|
*/
|
||||||
|
public static function isHash($value): bool
|
||||||
|
{
|
||||||
|
if ($value instanceof \stdClass || $value instanceof \ArrayObject) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$expectedKey = 0;
|
||||||
|
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
if ($key !== $expectedKey++) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumps a PHP array to a YAML string.
|
||||||
|
*
|
||||||
|
* @param array $value The PHP array to dump
|
||||||
|
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
|
||||||
|
*/
|
||||||
|
private static function dumpArray(array $value, int $flags): string
|
||||||
|
{
|
||||||
|
// array
|
||||||
|
if (($value || Yaml::DUMP_EMPTY_ARRAY_AS_SEQUENCE & $flags) && !self::isHash($value)) {
|
||||||
|
$output = [];
|
||||||
|
foreach ($value as $val) {
|
||||||
|
$output[] = self::dump($val, $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf('[%s]', implode(', ', $output));
|
||||||
|
}
|
||||||
|
|
||||||
|
// hash
|
||||||
|
$output = [];
|
||||||
|
foreach ($value as $key => $val) {
|
||||||
|
$output[] = sprintf('%s: %s', self::dump($key, $flags), self::dump($val, $flags));
|
||||||
|
}
|
||||||
|
|
||||||
|
return sprintf('{ %s }', implode(', ', $output));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function dumpNull(int $flags): string
|
||||||
|
{
|
||||||
|
if (Yaml::DUMP_NULL_AS_TILDE & $flags) {
|
||||||
|
return '~';
|
||||||
|
}
|
||||||
|
|
||||||
|
return 'null';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a YAML scalar.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws ParseException When malformed inline YAML string is parsed
|
||||||
|
*/
|
||||||
|
public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array &$references = [], bool &$isQuoted = null)
|
||||||
|
{
|
||||||
|
if (\in_array($scalar[$i], ['"', "'"], true)) {
|
||||||
|
// quoted scalar
|
||||||
|
$isQuoted = true;
|
||||||
|
$output = self::parseQuotedScalar($scalar, $i);
|
||||||
|
|
||||||
|
if (null !== $delimiters) {
|
||||||
|
$tmp = ltrim(substr($scalar, $i), " \n");
|
||||||
|
if ('' === $tmp) {
|
||||||
|
throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
if (!\in_array($tmp[0], $delimiters)) {
|
||||||
|
throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// "normal" string
|
||||||
|
$isQuoted = false;
|
||||||
|
|
||||||
|
if (!$delimiters) {
|
||||||
|
$output = substr($scalar, $i);
|
||||||
|
$i += \strlen($output);
|
||||||
|
|
||||||
|
// remove comments
|
||||||
|
if (Parser::preg_match('/[ \t]+#/', $output, $match, \PREG_OFFSET_CAPTURE)) {
|
||||||
|
$output = substr($output, 0, $match[0][1]);
|
||||||
|
}
|
||||||
|
} elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
|
||||||
|
$output = $match[1];
|
||||||
|
$i += \strlen($output);
|
||||||
|
$output = trim($output);
|
||||||
|
} else {
|
||||||
|
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
// a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >)
|
||||||
|
if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) {
|
||||||
|
throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($evaluate) {
|
||||||
|
$output = self::evaluateScalar($output, $flags, $references, $isQuoted);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a YAML quoted scalar.
|
||||||
|
*
|
||||||
|
* @throws ParseException When malformed inline YAML string is parsed
|
||||||
|
*/
|
||||||
|
private static function parseQuotedScalar(string $scalar, int &$i = 0): string
|
||||||
|
{
|
||||||
|
if (!Parser::preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) {
|
||||||
|
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output = substr($match[0], 1, -1);
|
||||||
|
|
||||||
|
$unescaper = new Unescaper();
|
||||||
|
if ('"' == $scalar[$i]) {
|
||||||
|
$output = $unescaper->unescapeDoubleQuotedString($output);
|
||||||
|
} else {
|
||||||
|
$output = $unescaper->unescapeSingleQuotedString($output);
|
||||||
|
}
|
||||||
|
|
||||||
|
$i += \strlen($match[0]);
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a YAML sequence.
|
||||||
|
*
|
||||||
|
* @throws ParseException When malformed inline YAML string is parsed
|
||||||
|
*/
|
||||||
|
private static function parseSequence(string $sequence, int $flags, int &$i = 0, array &$references = []): array
|
||||||
|
{
|
||||||
|
$output = [];
|
||||||
|
$len = \strlen($sequence);
|
||||||
|
++$i;
|
||||||
|
|
||||||
|
// [foo, bar, ...]
|
||||||
|
while ($i < $len) {
|
||||||
|
if (']' === $sequence[$i]) {
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
if (',' === $sequence[$i] || ' ' === $sequence[$i]) {
|
||||||
|
++$i;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tag = self::parseTag($sequence, $i, $flags);
|
||||||
|
switch ($sequence[$i]) {
|
||||||
|
case '[':
|
||||||
|
// nested sequence
|
||||||
|
$value = self::parseSequence($sequence, $flags, $i, $references);
|
||||||
|
break;
|
||||||
|
case '{':
|
||||||
|
// nested mapping
|
||||||
|
$value = self::parseMapping($sequence, $flags, $i, $references);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = self::parseScalar($sequence, $flags, [',', ']'], $i, null === $tag, $references, $isQuoted);
|
||||||
|
|
||||||
|
// the value can be an array if a reference has been resolved to an array var
|
||||||
|
if (\is_string($value) && !$isQuoted && false !== strpos($value, ': ')) {
|
||||||
|
// embedded mapping?
|
||||||
|
try {
|
||||||
|
$pos = 0;
|
||||||
|
$value = self::parseMapping('{'.$value.'}', $flags, $pos, $references);
|
||||||
|
} catch (\InvalidArgumentException $e) {
|
||||||
|
// no, it's not
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$isQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) {
|
||||||
|
$references[$matches['ref']] = $matches['value'];
|
||||||
|
$value = $matches['value'];
|
||||||
|
}
|
||||||
|
|
||||||
|
--$i;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $tag && '' !== $tag) {
|
||||||
|
$value = new TaggedValue($tag, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
$output[] = $value;
|
||||||
|
|
||||||
|
++$i;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $sequence), self::$parsedLineNumber + 1, null, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a YAML mapping.
|
||||||
|
*
|
||||||
|
* @return array|\stdClass
|
||||||
|
*
|
||||||
|
* @throws ParseException When malformed inline YAML string is parsed
|
||||||
|
*/
|
||||||
|
private static function parseMapping(string $mapping, int $flags, int &$i = 0, array &$references = [])
|
||||||
|
{
|
||||||
|
$output = [];
|
||||||
|
$len = \strlen($mapping);
|
||||||
|
++$i;
|
||||||
|
$allowOverwrite = false;
|
||||||
|
|
||||||
|
// {foo: bar, bar:foo, ...}
|
||||||
|
while ($i < $len) {
|
||||||
|
switch ($mapping[$i]) {
|
||||||
|
case ' ':
|
||||||
|
case ',':
|
||||||
|
case "\n":
|
||||||
|
++$i;
|
||||||
|
continue 2;
|
||||||
|
case '}':
|
||||||
|
if (self::$objectForMap) {
|
||||||
|
return (object) $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
|
// key
|
||||||
|
$offsetBeforeKeyParsing = $i;
|
||||||
|
$isKeyQuoted = \in_array($mapping[$i], ['"', "'"], true);
|
||||||
|
$key = self::parseScalar($mapping, $flags, [':', ' '], $i, false);
|
||||||
|
|
||||||
|
if ($offsetBeforeKeyParsing === $i) {
|
||||||
|
throw new ParseException('Missing mapping key.', self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('!php/const' === $key) {
|
||||||
|
$key .= ' '.self::parseScalar($mapping, $flags, [':'], $i, false);
|
||||||
|
$key = self::evaluateScalar($key, $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (false === $i = strpos($mapping, ':', $i)) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$isKeyQuoted) {
|
||||||
|
$evaluatedKey = self::evaluateScalar($key, $flags, $references);
|
||||||
|
|
||||||
|
if ('' !== $key && $evaluatedKey !== $key && !\is_string($evaluatedKey) && !\is_int($evaluatedKey)) {
|
||||||
|
throw new ParseException('Implicit casting of incompatible mapping keys to strings is not supported. Quote your evaluable mapping keys instead.', self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!$isKeyQuoted && (!isset($mapping[$i + 1]) || !\in_array($mapping[$i + 1], [' ', ',', '[', ']', '{', '}', "\n"], true))) {
|
||||||
|
throw new ParseException('Colons must be followed by a space or an indication character (i.e. " ", ",", "[", "]", "{", "}").', self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('<<' === $key) {
|
||||||
|
$allowOverwrite = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
while ($i < $len) {
|
||||||
|
if (':' === $mapping[$i] || ' ' === $mapping[$i] || "\n" === $mapping[$i]) {
|
||||||
|
++$i;
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tag = self::parseTag($mapping, $i, $flags);
|
||||||
|
switch ($mapping[$i]) {
|
||||||
|
case '[':
|
||||||
|
// nested sequence
|
||||||
|
$value = self::parseSequence($mapping, $flags, $i, $references);
|
||||||
|
// Spec: Keys MUST be unique; first one wins.
|
||||||
|
// Parser cannot abort this mapping earlier, since lines
|
||||||
|
// are processed sequentially.
|
||||||
|
// But overwriting is allowed when a merge node is used in current block.
|
||||||
|
if ('<<' === $key) {
|
||||||
|
foreach ($value as $parsedValue) {
|
||||||
|
$output += $parsedValue;
|
||||||
|
}
|
||||||
|
} elseif ($allowOverwrite || !isset($output[$key])) {
|
||||||
|
if (null !== $tag) {
|
||||||
|
$output[$key] = new TaggedValue($tag, $value);
|
||||||
|
} else {
|
||||||
|
$output[$key] = $value;
|
||||||
|
}
|
||||||
|
} elseif (isset($output[$key])) {
|
||||||
|
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case '{':
|
||||||
|
// nested mapping
|
||||||
|
$value = self::parseMapping($mapping, $flags, $i, $references);
|
||||||
|
// Spec: Keys MUST be unique; first one wins.
|
||||||
|
// Parser cannot abort this mapping earlier, since lines
|
||||||
|
// are processed sequentially.
|
||||||
|
// But overwriting is allowed when a merge node is used in current block.
|
||||||
|
if ('<<' === $key) {
|
||||||
|
$output += $value;
|
||||||
|
} elseif ($allowOverwrite || !isset($output[$key])) {
|
||||||
|
if (null !== $tag) {
|
||||||
|
$output[$key] = new TaggedValue($tag, $value);
|
||||||
|
} else {
|
||||||
|
$output[$key] = $value;
|
||||||
|
}
|
||||||
|
} elseif (isset($output[$key])) {
|
||||||
|
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = self::parseScalar($mapping, $flags, [',', '}', "\n"], $i, null === $tag, $references, $isValueQuoted);
|
||||||
|
// Spec: Keys MUST be unique; first one wins.
|
||||||
|
// Parser cannot abort this mapping earlier, since lines
|
||||||
|
// are processed sequentially.
|
||||||
|
// But overwriting is allowed when a merge node is used in current block.
|
||||||
|
if ('<<' === $key) {
|
||||||
|
$output += $value;
|
||||||
|
} elseif ($allowOverwrite || !isset($output[$key])) {
|
||||||
|
if (!$isValueQuoted && \is_string($value) && '' !== $value && '&' === $value[0] && Parser::preg_match(Parser::REFERENCE_PATTERN, $value, $matches)) {
|
||||||
|
$references[$matches['ref']] = $matches['value'];
|
||||||
|
$value = $matches['value'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null !== $tag) {
|
||||||
|
$output[$key] = new TaggedValue($tag, $value);
|
||||||
|
} else {
|
||||||
|
$output[$key] = $value;
|
||||||
|
}
|
||||||
|
} elseif (isset($output[$key])) {
|
||||||
|
throw new ParseException(sprintf('Duplicate key "%s" detected.', $key), self::$parsedLineNumber + 1, $mapping);
|
||||||
|
}
|
||||||
|
--$i;
|
||||||
|
}
|
||||||
|
++$i;
|
||||||
|
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new ParseException(sprintf('Malformed inline YAML string: "%s".', $mapping), self::$parsedLineNumber + 1, null, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Evaluates scalars and replaces magic values.
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws ParseException when object parsing support was disabled and the parser detected a PHP object or when a reference could not be resolved
|
||||||
|
*/
|
||||||
|
private static function evaluateScalar(string $scalar, int $flags, array &$references = [], bool &$isQuotedString = null)
|
||||||
|
{
|
||||||
|
$isQuotedString = false;
|
||||||
|
$scalar = trim($scalar);
|
||||||
|
|
||||||
|
if (0 === strpos($scalar, '*')) {
|
||||||
|
if (false !== $pos = strpos($scalar, '#')) {
|
||||||
|
$value = substr($scalar, 1, $pos - 2);
|
||||||
|
} else {
|
||||||
|
$value = substr($scalar, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// an unquoted *
|
||||||
|
if (false === $value || '' === $value) {
|
||||||
|
throw new ParseException('A reference must contain at least one character.', self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!\array_key_exists($value, $references)) {
|
||||||
|
throw new ParseException(sprintf('Reference "%s" does not exist.', $value), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $references[$value];
|
||||||
|
}
|
||||||
|
|
||||||
|
$scalarLower = strtolower($scalar);
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case 'null' === $scalarLower:
|
||||||
|
case '' === $scalar:
|
||||||
|
case '~' === $scalar:
|
||||||
|
return null;
|
||||||
|
case 'true' === $scalarLower:
|
||||||
|
return true;
|
||||||
|
case 'false' === $scalarLower:
|
||||||
|
return false;
|
||||||
|
case '!' === $scalar[0]:
|
||||||
|
switch (true) {
|
||||||
|
case 0 === strpos($scalar, '!!str '):
|
||||||
|
$s = (string) substr($scalar, 6);
|
||||||
|
|
||||||
|
if (\in_array($s[0] ?? '', ['"', "'"], true)) {
|
||||||
|
$isQuotedString = true;
|
||||||
|
$s = self::parseQuotedScalar($s);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $s;
|
||||||
|
case 0 === strpos($scalar, '! '):
|
||||||
|
return substr($scalar, 2);
|
||||||
|
case 0 === strpos($scalar, '!php/object'):
|
||||||
|
if (self::$objectSupport) {
|
||||||
|
if (!isset($scalar[12])) {
|
||||||
|
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/object tag without a value is deprecated.');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return unserialize(self::parseScalar(substr($scalar, 12)));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (self::$exceptionOnInvalidType) {
|
||||||
|
throw new ParseException('Object support when parsing a YAML file has been disabled.', self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
case 0 === strpos($scalar, '!php/const'):
|
||||||
|
if (self::$constantSupport) {
|
||||||
|
if (!isset($scalar[11])) {
|
||||||
|
trigger_deprecation('symfony/yaml', '5.1', 'Using the !php/const tag without a value is deprecated.');
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = 0;
|
||||||
|
if (\defined($const = self::parseScalar(substr($scalar, 11), 0, null, $i, false))) {
|
||||||
|
return \constant($const);
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new ParseException(sprintf('The constant "%s" is not defined.', $const), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
if (self::$exceptionOnInvalidType) {
|
||||||
|
throw new ParseException(sprintf('The string "%s" could not be parsed as a constant. Did you forget to pass the "Yaml::PARSE_CONSTANT" flag to the parser?', $scalar), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
case 0 === strpos($scalar, '!!float '):
|
||||||
|
return (float) substr($scalar, 8);
|
||||||
|
case 0 === strpos($scalar, '!!binary '):
|
||||||
|
return self::evaluateBinaryScalar(substr($scalar, 9));
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new ParseException(sprintf('The string "%s" could not be parsed as it uses an unsupported built-in tag.', $scalar), self::$parsedLineNumber, $scalar, self::$parsedFilename);
|
||||||
|
case preg_match('/^(?:\+|-)?0o(?P<value>[0-7_]++)$/', $scalar, $matches):
|
||||||
|
$value = str_replace('_', '', $matches['value']);
|
||||||
|
|
||||||
|
if ('-' === $scalar[0]) {
|
||||||
|
return -octdec($value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return octdec($value);
|
||||||
|
case \in_array($scalar[0], ['+', '-', '.'], true) || is_numeric($scalar[0]):
|
||||||
|
if (Parser::preg_match('{^[+-]?[0-9][0-9_]*$}', $scalar)) {
|
||||||
|
$scalar = str_replace('_', '', $scalar);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (true) {
|
||||||
|
case ctype_digit($scalar):
|
||||||
|
if (preg_match('/^0[0-7]+$/', $scalar)) {
|
||||||
|
trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '0o'.substr($scalar, 1));
|
||||||
|
|
||||||
|
return octdec($scalar);
|
||||||
|
}
|
||||||
|
|
||||||
|
$cast = (int) $scalar;
|
||||||
|
|
||||||
|
return ($scalar === (string) $cast) ? $cast : $scalar;
|
||||||
|
case '-' === $scalar[0] && ctype_digit(substr($scalar, 1)):
|
||||||
|
if (preg_match('/^-0[0-7]+$/', $scalar)) {
|
||||||
|
trigger_deprecation('symfony/yaml', '5.1', 'Support for parsing numbers prefixed with 0 as octal numbers. They will be parsed as strings as of 6.0. Use "%s" to represent the octal number.', '-0o'.substr($scalar, 2));
|
||||||
|
|
||||||
|
return -octdec(substr($scalar, 1));
|
||||||
|
}
|
||||||
|
|
||||||
|
$cast = (int) $scalar;
|
||||||
|
|
||||||
|
return ($scalar === (string) $cast) ? $cast : $scalar;
|
||||||
|
case is_numeric($scalar):
|
||||||
|
case Parser::preg_match(self::getHexRegex(), $scalar):
|
||||||
|
$scalar = str_replace('_', '', $scalar);
|
||||||
|
|
||||||
|
return '0x' === $scalar[0].$scalar[1] ? hexdec($scalar) : (float) $scalar;
|
||||||
|
case '.inf' === $scalarLower:
|
||||||
|
case '.nan' === $scalarLower:
|
||||||
|
return -log(0);
|
||||||
|
case '-.inf' === $scalarLower:
|
||||||
|
return log(0);
|
||||||
|
case Parser::preg_match('/^(-|\+)?[0-9][0-9_]*(\.[0-9_]+)?$/', $scalar):
|
||||||
|
return (float) str_replace('_', '', $scalar);
|
||||||
|
case Parser::preg_match(self::getTimestampRegex(), $scalar):
|
||||||
|
// When no timezone is provided in the parsed date, YAML spec says we must assume UTC.
|
||||||
|
$time = new \DateTime($scalar, new \DateTimeZone('UTC'));
|
||||||
|
|
||||||
|
if (Yaml::PARSE_DATETIME & $flags) {
|
||||||
|
return $time;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (false !== $scalar = $time->getTimestamp()) {
|
||||||
|
return $scalar;
|
||||||
|
}
|
||||||
|
} catch (\ValueError $e) {
|
||||||
|
// no-op
|
||||||
|
}
|
||||||
|
|
||||||
|
return $time->format('U');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (string) $scalar;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function parseTag(string $value, int &$i, int $flags): ?string
|
||||||
|
{
|
||||||
|
if ('!' !== $value[$i]) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tagLength = strcspn($value, " \t\n[]{},", $i + 1);
|
||||||
|
$tag = substr($value, $i + 1, $tagLength);
|
||||||
|
|
||||||
|
$nextOffset = $i + $tagLength + 1;
|
||||||
|
$nextOffset += strspn($value, ' ', $nextOffset);
|
||||||
|
|
||||||
|
if ('' === $tag && (!isset($value[$nextOffset]) || \in_array($value[$nextOffset], [']', '}', ','], true))) {
|
||||||
|
throw new ParseException('Using the unquoted scalar value "!" is not supported. You must quote it.', self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Is followed by a scalar and is a built-in tag
|
||||||
|
if ('' !== $tag && (!isset($value[$nextOffset]) || !\in_array($value[$nextOffset], ['[', '{'], true)) && ('!' === $tag[0] || 'str' === $tag || 'php/const' === $tag || 'php/object' === $tag)) {
|
||||||
|
// Manage in {@link self::evaluateScalar()}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$i = $nextOffset;
|
||||||
|
|
||||||
|
// Built-in tags
|
||||||
|
if ('' !== $tag && '!' === $tag[0]) {
|
||||||
|
throw new ParseException(sprintf('The built-in tag "!%s" is not implemented.', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('' !== $tag && !isset($value[$i])) {
|
||||||
|
throw new ParseException(sprintf('Missing value for tag "%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ('' === $tag || Yaml::PARSE_CUSTOM_TAGS & $flags) {
|
||||||
|
return $tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
throw new ParseException(sprintf('Tags support is not enabled. Enable the "Yaml::PARSE_CUSTOM_TAGS" flag to use "!%s".', $tag), self::$parsedLineNumber + 1, $value, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function evaluateBinaryScalar(string $scalar): string
|
||||||
|
{
|
||||||
|
$parsedBinaryData = self::parseScalar(preg_replace('/\s/', '', $scalar));
|
||||||
|
|
||||||
|
if (0 !== (\strlen($parsedBinaryData) % 4)) {
|
||||||
|
throw new ParseException(sprintf('The normalized base64 encoded data (data without whitespace characters) length must be a multiple of four (%d bytes given).', \strlen($parsedBinaryData)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Parser::preg_match('#^[A-Z0-9+/]+={0,2}$#i', $parsedBinaryData)) {
|
||||||
|
throw new ParseException(sprintf('The base64 encoded data (%s) contains invalid characters.', $parsedBinaryData), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
return base64_decode($parsedBinaryData, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function isBinaryString(string $value): bool
|
||||||
|
{
|
||||||
|
return !preg_match('//u', $value) || preg_match('/[^\x00\x07-\x0d\x1B\x20-\xff]/', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a regex that matches a YAML date.
|
||||||
|
*
|
||||||
|
* @see http://www.yaml.org/spec/1.2/spec.html#id2761573
|
||||||
|
*/
|
||||||
|
private static function getTimestampRegex(): string
|
||||||
|
{
|
||||||
|
return <<<EOF
|
||||||
|
~^
|
||||||
|
(?P<year>[0-9][0-9][0-9][0-9])
|
||||||
|
-(?P<month>[0-9][0-9]?)
|
||||||
|
-(?P<day>[0-9][0-9]?)
|
||||||
|
(?:(?:[Tt]|[ \t]+)
|
||||||
|
(?P<hour>[0-9][0-9]?)
|
||||||
|
:(?P<minute>[0-9][0-9])
|
||||||
|
:(?P<second>[0-9][0-9])
|
||||||
|
(?:\.(?P<fraction>[0-9]*))?
|
||||||
|
(?:[ \t]*(?P<tz>Z|(?P<tz_sign>[-+])(?P<tz_hour>[0-9][0-9]?)
|
||||||
|
(?::(?P<tz_minute>[0-9][0-9]))?))?)?
|
||||||
|
$~x
|
||||||
|
EOF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a regex that matches a YAML number in hexadecimal notation.
|
||||||
|
*/
|
||||||
|
private static function getHexRegex(): string
|
||||||
|
{
|
||||||
|
return '~^0x[0-9a-f_]++$~i';
|
||||||
|
}
|
||||||
|
}
|
19
kirby/vendor/symfony/yaml/LICENSE
vendored
Normal file
19
kirby/vendor/symfony/yaml/LICENSE
vendored
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Copyright (c) 2004-present Fabien Potencier
|
||||||
|
|
||||||
|
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.
|
1305
kirby/vendor/symfony/yaml/Parser.php
vendored
Normal file
1305
kirby/vendor/symfony/yaml/Parser.php
vendored
Normal file
File diff suppressed because it is too large
Load Diff
49
kirby/vendor/symfony/yaml/Resources/bin/yaml-lint
vendored
Executable file
49
kirby/vendor/symfony/yaml/Resources/bin/yaml-lint
vendored
Executable file
@@ -0,0 +1,49 @@
|
|||||||
|
#!/usr/bin/env php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
if ('cli' !== \PHP_SAPI) {
|
||||||
|
throw new Exception('This script must be run from the command line.');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Runs the Yaml lint command.
|
||||||
|
*
|
||||||
|
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
||||||
|
*/
|
||||||
|
|
||||||
|
use Symfony\Component\Console\Application;
|
||||||
|
use Symfony\Component\Yaml\Command\LintCommand;
|
||||||
|
|
||||||
|
function includeIfExists(string $file): bool
|
||||||
|
{
|
||||||
|
return file_exists($file) && include $file;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!includeIfExists(__DIR__ . '/../../../../autoload.php') &&
|
||||||
|
!includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
|
||||||
|
!includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
|
||||||
|
) {
|
||||||
|
fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!class_exists(Application::class)) {
|
||||||
|
fwrite(STDERR, 'You need the "symfony/console" component in order to run the Yaml linter.'.PHP_EOL);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
(new Application())->add($command = new LintCommand())
|
||||||
|
->getApplication()
|
||||||
|
->setDefaultCommand($command->getName(), true)
|
||||||
|
->run()
|
||||||
|
;
|
38
kirby/vendor/symfony/yaml/Tag/TaggedValue.php
vendored
Normal file
38
kirby/vendor/symfony/yaml/Tag/TaggedValue.php
vendored
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml\Tag;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
|
* @author Guilhem N. <egetick@gmail.com>
|
||||||
|
*/
|
||||||
|
final class TaggedValue
|
||||||
|
{
|
||||||
|
private $tag;
|
||||||
|
private $value;
|
||||||
|
|
||||||
|
public function __construct(string $tag, $value)
|
||||||
|
{
|
||||||
|
$this->tag = $tag;
|
||||||
|
$this->value = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getTag(): string
|
||||||
|
{
|
||||||
|
return $this->tag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getValue()
|
||||||
|
{
|
||||||
|
return $this->value;
|
||||||
|
}
|
||||||
|
}
|
132
kirby/vendor/symfony/yaml/Unescaper.php
vendored
Normal file
132
kirby/vendor/symfony/yaml/Unescaper.php
vendored
Normal file
@@ -0,0 +1,132 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unescaper encapsulates unescaping rules for single and double-quoted
|
||||||
|
* YAML strings.
|
||||||
|
*
|
||||||
|
* @author Matthew Lewinski <matthew@lewinski.org>
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
class Unescaper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Regex fragment that matches an escaped character in a double quoted string.
|
||||||
|
*/
|
||||||
|
public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unescapes a single quoted string.
|
||||||
|
*
|
||||||
|
* @param string $value A single quoted string
|
||||||
|
*/
|
||||||
|
public function unescapeSingleQuotedString(string $value): string
|
||||||
|
{
|
||||||
|
return str_replace('\'\'', '\'', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unescapes a double quoted string.
|
||||||
|
*
|
||||||
|
* @param string $value A double quoted string
|
||||||
|
*/
|
||||||
|
public function unescapeDoubleQuotedString(string $value): string
|
||||||
|
{
|
||||||
|
$callback = function ($match) {
|
||||||
|
return $this->unescapeCharacter($match[0]);
|
||||||
|
};
|
||||||
|
|
||||||
|
// evaluate the string
|
||||||
|
return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unescapes a character that was found in a double-quoted string.
|
||||||
|
*
|
||||||
|
* @param string $value An escaped character
|
||||||
|
*/
|
||||||
|
private function unescapeCharacter(string $value): string
|
||||||
|
{
|
||||||
|
switch ($value[1]) {
|
||||||
|
case '0':
|
||||||
|
return "\x0";
|
||||||
|
case 'a':
|
||||||
|
return "\x7";
|
||||||
|
case 'b':
|
||||||
|
return "\x8";
|
||||||
|
case 't':
|
||||||
|
return "\t";
|
||||||
|
case "\t":
|
||||||
|
return "\t";
|
||||||
|
case 'n':
|
||||||
|
return "\n";
|
||||||
|
case 'v':
|
||||||
|
return "\xB";
|
||||||
|
case 'f':
|
||||||
|
return "\xC";
|
||||||
|
case 'r':
|
||||||
|
return "\r";
|
||||||
|
case 'e':
|
||||||
|
return "\x1B";
|
||||||
|
case ' ':
|
||||||
|
return ' ';
|
||||||
|
case '"':
|
||||||
|
return '"';
|
||||||
|
case '/':
|
||||||
|
return '/';
|
||||||
|
case '\\':
|
||||||
|
return '\\';
|
||||||
|
case 'N':
|
||||||
|
// U+0085 NEXT LINE
|
||||||
|
return "\xC2\x85";
|
||||||
|
case '_':
|
||||||
|
// U+00A0 NO-BREAK SPACE
|
||||||
|
return "\xC2\xA0";
|
||||||
|
case 'L':
|
||||||
|
// U+2028 LINE SEPARATOR
|
||||||
|
return "\xE2\x80\xA8";
|
||||||
|
case 'P':
|
||||||
|
// U+2029 PARAGRAPH SEPARATOR
|
||||||
|
return "\xE2\x80\xA9";
|
||||||
|
case 'x':
|
||||||
|
return self::utf8chr(hexdec(substr($value, 2, 2)));
|
||||||
|
case 'u':
|
||||||
|
return self::utf8chr(hexdec(substr($value, 2, 4)));
|
||||||
|
case 'U':
|
||||||
|
return self::utf8chr(hexdec(substr($value, 2, 8)));
|
||||||
|
default:
|
||||||
|
throw new ParseException(sprintf('Found unknown escape character "%s".', $value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the UTF-8 character for the given code point.
|
||||||
|
*/
|
||||||
|
private static function utf8chr(int $c): string
|
||||||
|
{
|
||||||
|
if (0x80 > $c %= 0x200000) {
|
||||||
|
return \chr($c);
|
||||||
|
}
|
||||||
|
if (0x800 > $c) {
|
||||||
|
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
|
||||||
|
}
|
||||||
|
if (0x10000 > $c) {
|
||||||
|
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
||||||
|
}
|
||||||
|
|
||||||
|
return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
||||||
|
}
|
||||||
|
}
|
100
kirby/vendor/symfony/yaml/Yaml.php
vendored
Normal file
100
kirby/vendor/symfony/yaml/Yaml.php
vendored
Normal file
@@ -0,0 +1,100 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of the Symfony package.
|
||||||
|
*
|
||||||
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Yaml offers convenience methods to load and dump YAML.
|
||||||
|
*
|
||||||
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
|
*
|
||||||
|
* @final
|
||||||
|
*/
|
||||||
|
class Yaml
|
||||||
|
{
|
||||||
|
public const DUMP_OBJECT = 1;
|
||||||
|
public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2;
|
||||||
|
public const PARSE_OBJECT = 4;
|
||||||
|
public const PARSE_OBJECT_FOR_MAP = 8;
|
||||||
|
public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16;
|
||||||
|
public const PARSE_DATETIME = 32;
|
||||||
|
public const DUMP_OBJECT_AS_MAP = 64;
|
||||||
|
public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128;
|
||||||
|
public const PARSE_CONSTANT = 256;
|
||||||
|
public const PARSE_CUSTOM_TAGS = 512;
|
||||||
|
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
|
||||||
|
public const DUMP_NULL_AS_TILDE = 2048;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses a YAML file into a PHP value.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
*
|
||||||
|
* $array = Yaml::parseFile('config.yml');
|
||||||
|
* print_r($array);
|
||||||
|
*
|
||||||
|
* @param string $filename The path to the YAML file to be parsed
|
||||||
|
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws ParseException If the file could not be read or the YAML is not valid
|
||||||
|
*/
|
||||||
|
public static function parseFile(string $filename, int $flags = 0)
|
||||||
|
{
|
||||||
|
$yaml = new Parser();
|
||||||
|
|
||||||
|
return $yaml->parseFile($filename, $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses YAML into a PHP value.
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* <code>
|
||||||
|
* $array = Yaml::parse(file_get_contents('config.yml'));
|
||||||
|
* print_r($array);
|
||||||
|
* </code>
|
||||||
|
*
|
||||||
|
* @param string $input A string containing YAML
|
||||||
|
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
||||||
|
*
|
||||||
|
* @return mixed
|
||||||
|
*
|
||||||
|
* @throws ParseException If the YAML is not valid
|
||||||
|
*/
|
||||||
|
public static function parse(string $input, int $flags = 0)
|
||||||
|
{
|
||||||
|
$yaml = new Parser();
|
||||||
|
|
||||||
|
return $yaml->parse($input, $flags);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Dumps a PHP value to a YAML string.
|
||||||
|
*
|
||||||
|
* The dump method, when supplied with an array, will do its best
|
||||||
|
* to convert the array into friendly YAML.
|
||||||
|
*
|
||||||
|
* @param mixed $input The PHP value
|
||||||
|
* @param int $inline The level where you switch to inline YAML
|
||||||
|
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
||||||
|
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
|
||||||
|
*/
|
||||||
|
public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string
|
||||||
|
{
|
||||||
|
$yaml = new Dumper($indent);
|
||||||
|
|
||||||
|
return $yaml->dump($input, $inline, 0, $flags);
|
||||||
|
}
|
||||||
|
}
|
42
kirby/vendor/symfony/yaml/composer.json
vendored
Normal file
42
kirby/vendor/symfony/yaml/composer.json
vendored
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
{
|
||||||
|
"name": "symfony/yaml",
|
||||||
|
"type": "library",
|
||||||
|
"description": "Loads and dumps YAML files",
|
||||||
|
"keywords": [],
|
||||||
|
"homepage": "https://symfony.com",
|
||||||
|
"license": "MIT",
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Fabien Potencier",
|
||||||
|
"email": "fabien@symfony.com"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Symfony Community",
|
||||||
|
"homepage": "https://symfony.com/contributors"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.2.5",
|
||||||
|
"symfony/deprecation-contracts": "^2.1|^3",
|
||||||
|
"symfony/polyfill-ctype": "^1.8"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"symfony/console": "^5.3|^6.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/console": "<5.3"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"symfony/console": "For validating YAML files using the lint command"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": { "Symfony\\Component\\Yaml\\": "" },
|
||||||
|
"exclude-from-classmap": [
|
||||||
|
"/Tests/"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"Resources/bin/yaml-lint"
|
||||||
|
],
|
||||||
|
"minimum-stability": "dev"
|
||||||
|
}
|
Reference in New Issue
Block a user