Upgrade to 3.9.3
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
# Kirby License Agreement
|
# Kirby License Agreement
|
||||||
|
|
||||||
Published: March 15, 2022
|
Published: March 21, 2023
|
||||||
Source: https://getkirby.com/license/2022-03-15
|
Source: https://getkirby.com/license/2023-03-21
|
||||||
|
|
||||||
## About this Agreement
|
## About this Agreement
|
||||||
|
|
||||||
@@ -37,7 +37,7 @@ As Kirby is software and software is intangible, We don't sell it as such. Inste
|
|||||||
|
|
||||||
The license is **non-exclusive** (meaning that You are not the only one who We will issue a license) and **generally non-transferable** (meaning that the one who purchases the license is the licensee).
|
The license is **non-exclusive** (meaning that You are not the only one who We will issue a license) and **generally non-transferable** (meaning that the one who purchases the license is the licensee).
|
||||||
|
|
||||||
On request, We will **transfer** a license to anyone who is also allowed to buy Kirby licenses by law and this Agreement.
|
On request, We will **transfer** a license to anyone who is also allowed to buy Kirby licenses by law and this Agreement. The new licensee will take over all rights and obligations of this Agreement from You at the moment We confirm the license transfer.
|
||||||
|
|
||||||
We will also **reassign** a license to another Website domain and root directory of Your choice, provided that You confirm that the previous Website is no longer in operation and will not be operated with the same license in the future.
|
We will also **reassign** a license to another Website domain and root directory of Your choice, provided that You confirm that the previous Website is no longer in operation and will not be operated with the same license in the future.
|
||||||
|
|
||||||
@@ -98,13 +98,18 @@ You may only use Kirby in a manner that complies with any and all **applicable l
|
|||||||
|
|
||||||
### Making Copies
|
### Making Copies
|
||||||
|
|
||||||
You may make **copies of Kirby** in any machine readable form solely for purposes of **deploying a Website to a server, developing a Website on a personal computer or server or as a backup**, provided that You reproduce Kirby in its original form and with all proprietary notices on the copy.
|
You may make **copies of Kirby** in any machine readable form solely for the **following purposes**, provided that You reproduce Kirby in its original form and with all proprietary notices on the copy:
|
||||||
|
|
||||||
|
- when deploying a Website to a server,
|
||||||
|
- when developing a Website on a personal computer or server,
|
||||||
|
- when working on code contributions to Kirby or
|
||||||
|
- as a backup.
|
||||||
|
|
||||||
You may _not_ reproduce Kirby or its Source Code, in whole or in part, for **any other purpose**.
|
You may _not_ reproduce Kirby or its Source Code, in whole or in part, for **any other purpose**.
|
||||||
|
|
||||||
### Modification of the Source Code
|
### Modification of the Source Code
|
||||||
|
|
||||||
You may **alter, modify or extend the Source Code** for Your own use. You may also **commission a third party** to perform those modifications for You.
|
You may **alter, modify or extend the Source Code** for Your own use or with the intention to contribute Your changes back to Kirby. You may also **commission a third party** to perform those modifications for You.
|
||||||
|
|
||||||
However You may _not_:
|
However You may _not_:
|
||||||
|
|
||||||
@@ -177,7 +182,13 @@ KIRBY IS OFFERED ON AN **"AS-IS" BASIS** AND **NO WARRANTY**, EITHER EXPRESSED O
|
|||||||
|
|
||||||
## Term, Termination and Modification
|
## Term, Termination and Modification
|
||||||
|
|
||||||
You may use Kirby under this Agreement until either party terminates this Agreement as described in this paragraph. Either party may **terminate the Agreement** at any time, upon notice to the other party in textual form (via email or letter). Upon termination, all or the specified **licenses granted to You will terminate**, and You will **immediately uninstall and cease all use** of Kirby. If not all licenses are terminated, You may continue to use Kirby for the Websites with active licenses. The sections entitled "No Warranty", "Indemnification" and "Limitation of Liability" will **survive any termination** of this Agreement.
|
You may **indefinitely use** all Kirby versions that are covered by Your license under this Agreement until either party **terminates this Agreement** as described in this section.
|
||||||
|
|
||||||
|
**You** may terminate the Agreement at any time.
|
||||||
|
|
||||||
|
**We** may only terminate the Agreement if You or any individual or company who works with Kirby or uses it on Your behalf has violated or failed to comply with terms of this Agreement. If Your compliance with the Agreement can be restored by fixing the violation or non-compliance, We will first contact You with information on the specific term that was violated or not complied with and will allow reasonable time of at least 14 days before We will decide on a license termination. Should We be in the position to terminate a license according to this paragraph, other or all licenses granted to You may be terminated for the same reason(s) at the same time or at any later date.
|
||||||
|
|
||||||
|
Termination takes effect upon notice to the other party in textual form (via email or letter). Upon termination, the specified **licenses granted to You will terminate**, and You will **immediately uninstall and cease all use** of Kirby. If not all licenses are terminated, You may continue to use Kirby for the Websites with active licenses. The sections entitled "No Warranty", "Indemnification" and "Limitation of Liability" will **survive any termination** of this Agreement.
|
||||||
|
|
||||||
We may **modify Kirby and this Agreement** with notice to You either via email or by publishing content on the Kirby website at https://getkirby.com, including but not limited to changing the functionality or appearance of Kirby. Any such modification will **become binding on You** unless You terminate this Agreement. Changes to this Agreement that constrain Your rights to a great extent will only become effective with Your approval in textual or electronic form.
|
We may **modify Kirby and this Agreement** with notice to You either via email or by publishing content on the Kirby website at https://getkirby.com, including but not limited to changing the functionality or appearance of Kirby. Any such modification will **become binding on You** unless You terminate this Agreement. Changes to this Agreement that constrain Your rights to a great extent will only become effective with Your approval in textual or electronic form.
|
||||||
|
|
||||||
|
@@ -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.2",
|
"version": "3.9.3",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"kirby",
|
"kirby",
|
||||||
"cms",
|
"cms",
|
||||||
@@ -36,13 +36,13 @@
|
|||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-openssl": "*",
|
"ext-openssl": "*",
|
||||||
"claviska/simpleimage": "3.7.2",
|
"claviska/simpleimage": "4.0.2",
|
||||||
"composer/semver": "3.3.2",
|
"composer/semver": "3.3.2",
|
||||||
"filp/whoops": "2.14.6",
|
"filp/whoops": "2.15.1",
|
||||||
"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.7.1",
|
"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"
|
||||||
},
|
},
|
||||||
|
67
kirby/composer.lock
generated
67
kirby/composer.lock
generated
@@ -4,26 +4,30 @@
|
|||||||
"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": "4da7bfec5d96803f96d1aca050d9b6c3",
|
"content-hash": "b6d2cf1d95980cd8e5109f436f393339",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "claviska/simpleimage",
|
"name": "claviska/simpleimage",
|
||||||
"version": "3.7.2",
|
"version": "4.0.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/claviska/SimpleImage.git",
|
"url": "https://github.com/claviska/SimpleImage.git",
|
||||||
"reference": "82dbef988e356baa5d73993a1351bcb6c0959269"
|
"reference": "226d507cca0c8400d69bee7eb324158e3cbe246e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/82dbef988e356baa5d73993a1351bcb6c0959269",
|
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/226d507cca0c8400d69bee7eb324158e3cbe246e",
|
||||||
"reference": "82dbef988e356baa5d73993a1351bcb6c0959269",
|
"reference": "226d507cca0c8400d69bee7eb324158e3cbe246e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"league/color-extractor": "0.3.*",
|
"league/color-extractor": "0.4.*",
|
||||||
"php": ">=5.6.0"
|
"php": ">=8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"laravel/pint": "^1.5",
|
||||||
|
"phpstan/phpstan": "^1.10"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -45,7 +49,7 @@
|
|||||||
"description": "A PHP class that makes working with images as simple as possible.",
|
"description": "A PHP class that makes working with images as simple as possible.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/claviska/SimpleImage/issues",
|
"issues": "https://github.com/claviska/SimpleImage/issues",
|
||||||
"source": "https://github.com/claviska/SimpleImage/tree/3.7.2"
|
"source": "https://github.com/claviska/SimpleImage/tree/4.0.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -53,7 +57,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-12-12T14:31:53+00:00"
|
"time": "2023-03-20T15:27:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "composer/semver",
|
"name": "composer/semver",
|
||||||
@@ -138,16 +142,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
"version": "2.14.6",
|
"version": "2.15.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/filp/whoops.git",
|
"url": "https://github.com/filp/whoops.git",
|
||||||
"reference": "f7948baaa0330277c729714910336383286305da"
|
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da",
|
"url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b",
|
||||||
"reference": "f7948baaa0330277c729714910336383286305da",
|
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -197,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.14.6"
|
"source": "https://github.com/filp/whoops/tree/2.15.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -205,7 +209,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-11-02T16:23:29+00:00"
|
"time": "2023-03-06T18:09:13+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "getkirby/composer-installer",
|
"name": "getkirby/composer-installer",
|
||||||
@@ -318,33 +322,36 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/color-extractor",
|
"name": "league/color-extractor",
|
||||||
"version": "0.3.2",
|
"version": "0.4.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/color-extractor.git",
|
"url": "https://github.com/thephpleague/color-extractor.git",
|
||||||
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806"
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806",
|
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806",
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"php": ">=5.4.0"
|
"php": "^7.3 || ^8.0"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"matthecat/colorextractor": "*"
|
"matthecat/colorextractor": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "~2",
|
"friendsofphp/php-cs-fixer": "~2",
|
||||||
"phpunit/phpunit": "~5"
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons"
|
||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"": "src"
|
"League\\ColorExtractor\\": "src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -370,9 +377,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/thephpleague/color-extractor/issues",
|
"issues": "https://github.com/thephpleague/color-extractor/issues",
|
||||||
"source": "https://github.com/thephpleague/color-extractor/tree/master"
|
"source": "https://github.com/thephpleague/color-extractor/tree/0.4.0"
|
||||||
},
|
},
|
||||||
"time": "2016-12-15T09:30:02+00:00"
|
"time": "2022-09-24T15:57:16+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "michelf/php-smartypants",
|
"name": "michelf/php-smartypants",
|
||||||
@@ -430,16 +437,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.7.1",
|
"version": "v6.8.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
|
"reference": "df16b615e371d81fb79e506277faea67a1be18f1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
|
||||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
"reference": "df16b615e371d81fb79e506277faea67a1be18f1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -498,7 +505,7 @@
|
|||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
|
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -506,7 +513,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-12-08T13:30:06+00:00"
|
"time": "2023-03-06T14:43:22+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
|
@@ -1,9 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Kirby\Cms\App;
|
use Kirby\Cms\App;
|
||||||
|
use Kirby\Cms\Collection;
|
||||||
|
use Kirby\Cms\File;
|
||||||
use Kirby\Cms\Helpers;
|
use Kirby\Cms\Helpers;
|
||||||
use Kirby\Cms\Html;
|
use Kirby\Cms\Html;
|
||||||
|
use Kirby\Cms\Page;
|
||||||
|
use Kirby\Cms\Pages;
|
||||||
use Kirby\Cms\Response;
|
use Kirby\Cms\Response;
|
||||||
|
use Kirby\Cms\Site;
|
||||||
use Kirby\Cms\Url;
|
use Kirby\Cms\Url;
|
||||||
use Kirby\Filesystem\Asset;
|
use Kirby\Filesystem\Asset;
|
||||||
use Kirby\Filesystem\F;
|
use Kirby\Filesystem\F;
|
||||||
@@ -18,11 +23,8 @@ use Kirby\Toolkit\V;
|
|||||||
if (Helpers::hasOverride('asset') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('asset') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Helper to create an asset object
|
* Helper to create an asset object
|
||||||
*
|
|
||||||
* @param string $path
|
|
||||||
* @return \Kirby\Filesystem\Asset
|
|
||||||
*/
|
*/
|
||||||
function asset(string $path)
|
function asset(string $path): Asset
|
||||||
{
|
{
|
||||||
return new Asset($path);
|
return new Asset($path);
|
||||||
}
|
}
|
||||||
@@ -35,10 +37,12 @@ if (Helpers::hasOverride('attr') === false) { // @codeCoverageIgnore
|
|||||||
* @param array|null $attr A list of attributes as key/value array
|
* @param array|null $attr A list of attributes as key/value array
|
||||||
* @param string|null $before An optional string that will be prepended if the result is not empty
|
* @param string|null $before An optional string that will be prepended if the result is not empty
|
||||||
* @param string|null $after An optional string that will be appended if the result is not empty
|
* @param string|null $after An optional string that will be appended if the result is not empty
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function attr(array|null $attr = null, string|null $before = null, string|null $after = null): string|null
|
function attr(
|
||||||
{
|
array|null $attr = null,
|
||||||
|
string|null $before = null,
|
||||||
|
string|null $after = null
|
||||||
|
): string|null {
|
||||||
return Html::attr($attr, null, $before, $after);
|
return Html::attr($attr, null, $before, $after);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -46,11 +50,8 @@ if (Helpers::hasOverride('attr') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('collection') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('collection') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Returns the result of a collection by name
|
* Returns the result of a collection by name
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @return \Kirby\Cms\Collection|null
|
|
||||||
*/
|
*/
|
||||||
function collection(string $name)
|
function collection(string $name): Collection|null
|
||||||
{
|
{
|
||||||
return App::instance()->collection($name);
|
return App::instance()->collection($name);
|
||||||
}
|
}
|
||||||
@@ -63,7 +64,7 @@ if (Helpers::hasOverride('csrf') === false) { // @codeCoverageIgnore
|
|||||||
* @param string|null $check Pass a token here to compare it to the one in the session
|
* @param string|null $check Pass a token here to compare it to the one in the session
|
||||||
* @return string|bool Either the token or a boolean check result
|
* @return string|bool Either the token or a boolean check result
|
||||||
*/
|
*/
|
||||||
function csrf(string|null $check = null)
|
function csrf(string|null $check = null): string|bool
|
||||||
{
|
{
|
||||||
// check explicitly if there have been no arguments at all;
|
// check explicitly if there have been no arguments at all;
|
||||||
// checking for null introduces a security issue because null could come
|
// checking for null introduces a security issue because null could come
|
||||||
@@ -81,11 +82,12 @@ if (Helpers::hasOverride('css') === false) { // @codeCoverageIgnore
|
|||||||
* Creates one or multiple CSS link tags
|
* Creates one or multiple CSS link tags
|
||||||
*
|
*
|
||||||
* @param string|array $url Relative or absolute URLs, an array of URLs or `@auto` for automatic template css loading
|
* @param string|array $url Relative or absolute URLs, an array of URLs or `@auto` for automatic template css loading
|
||||||
* @param string|array $options Pass an array of attributes for the link tag or a media attribute string
|
* @param string|array|null $options Pass an array of attributes for the link tag or a media attribute string
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function css($url, $options = null): string|null
|
function css(
|
||||||
{
|
string|array $url,
|
||||||
|
string|array|null $options = null
|
||||||
|
): string|null {
|
||||||
return Html::css($url, $options);
|
return Html::css($url, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -95,7 +97,6 @@ if (Helpers::hasOverride('deprecated') === false) { // @codeCoverageIgnore
|
|||||||
* Triggers a deprecation warning if debug mode is active
|
* Triggers a deprecation warning if debug mode is active
|
||||||
* @since 3.3.0
|
* @since 3.3.0
|
||||||
*
|
*
|
||||||
* @param string $message
|
|
||||||
* @return bool Whether the warning was triggered
|
* @return bool Whether the warning was triggered
|
||||||
*/
|
*/
|
||||||
function deprecated(string $message): bool
|
function deprecated(string $message): bool
|
||||||
@@ -108,12 +109,8 @@ if (Helpers::hasOverride('dump') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Simple object and variable dumper
|
* Simple object and variable dumper
|
||||||
* to help with debugging.
|
* to help with debugging.
|
||||||
*
|
|
||||||
* @param mixed $variable
|
|
||||||
* @param bool $echo
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function dump($variable, bool $echo = true): string
|
function dump(mixed $variable, bool $echo = true): string
|
||||||
{
|
{
|
||||||
return Helpers::dump($variable, $echo);
|
return Helpers::dump($variable, $echo);
|
||||||
}
|
}
|
||||||
@@ -123,11 +120,10 @@ if (Helpers::hasOverride('e') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Smart version of echo with an if condition as first argument
|
* Smart version of echo with an if condition as first argument
|
||||||
*
|
*
|
||||||
* @param mixed $condition
|
|
||||||
* @param mixed $value The string to be echoed if the condition is true
|
* @param mixed $value The string to be echoed if the condition is true
|
||||||
* @param mixed $alternative An alternative string which should be echoed when the condition is false
|
* @param mixed $alternative An alternative string which should be echoed when the condition is false
|
||||||
*/
|
*/
|
||||||
function e($condition, $value, $alternative = null)
|
function e(mixed $condition, mixed $value, mixed $alternative = null): void
|
||||||
{
|
{
|
||||||
echo $condition ? $value : $alternative;
|
echo $condition ? $value : $alternative;
|
||||||
}
|
}
|
||||||
@@ -173,9 +169,8 @@ if (Helpers::hasOverride('get') === false) { // @codeCoverageIgnore
|
|||||||
*
|
*
|
||||||
* @param mixed $key The key to look for. Pass false or null to return the entire request array.
|
* @param mixed $key The key to look for. Pass false or null to return the entire request array.
|
||||||
* @param mixed $default Optional default value, which should be returned if no element has been found
|
* @param mixed $default Optional default value, which should be returned if no element has been found
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
function get($key = null, $default = null)
|
function get(mixed $key = null, mixed $default = null): mixed
|
||||||
{
|
{
|
||||||
return App::instance()->request()->get($key, $default);
|
return App::instance()->request()->get($key, $default);
|
||||||
}
|
}
|
||||||
@@ -184,10 +179,6 @@ if (Helpers::hasOverride('get') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('gist') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('gist') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Embeds a Github Gist
|
* Embeds a Github Gist
|
||||||
*
|
|
||||||
* @param string $url
|
|
||||||
* @param string|null $file
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function gist(string $url, string|null $file = null): string
|
function gist(string $url, string|null $file = null): string
|
||||||
{
|
{
|
||||||
@@ -203,11 +194,9 @@ if (Helpers::hasOverride('go') === false) { // @codeCoverageIgnore
|
|||||||
* Redirects to the given Urls
|
* Redirects to the given Urls
|
||||||
* Urls can be relative or absolute.
|
* Urls can be relative or absolute.
|
||||||
*
|
*
|
||||||
* @param string $url
|
* @todo Change return type to `never` once support for PHP 8.0 is dropped
|
||||||
* @param int $code
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
function go(string $url = '/', int $code = 302)
|
function go(string $url = '/', int $code = 302): void
|
||||||
{
|
{
|
||||||
Response::go($url, $code);
|
Response::go($url, $code);
|
||||||
}
|
}
|
||||||
@@ -218,8 +207,6 @@ if (Helpers::hasOverride('h') === false) { // @codeCoverageIgnore
|
|||||||
* Shortcut for html()
|
* Shortcut for html()
|
||||||
*
|
*
|
||||||
* @param string|null $string unencoded text
|
* @param string|null $string unencoded text
|
||||||
* @param bool $keepTags
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function h(string|null $string, bool $keepTags = false): string
|
function h(string|null $string, bool $keepTags = false): string
|
||||||
{
|
{
|
||||||
@@ -232,8 +219,6 @@ if (Helpers::hasOverride('html') === false) { // @codeCoverageIgnore
|
|||||||
* Creates safe html by encoding special characters
|
* Creates safe html by encoding special characters
|
||||||
*
|
*
|
||||||
* @param string|null $string unencoded text
|
* @param string|null $string unencoded text
|
||||||
* @param bool $keepTags
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function html(string|null $string, bool $keepTags = false): string
|
function html(string|null $string, bool $keepTags = false): string
|
||||||
{
|
{
|
||||||
@@ -248,11 +233,8 @@ if (Helpers::hasOverride('image') === false) { // @codeCoverageIgnore
|
|||||||
*
|
*
|
||||||
* Example:
|
* Example:
|
||||||
* <?= image('some/page/myimage.jpg') ?>
|
* <?= image('some/page/myimage.jpg') ?>
|
||||||
*
|
|
||||||
* @param string|null $path
|
|
||||||
* @return \Kirby\Cms\File|null
|
|
||||||
*/
|
*/
|
||||||
function image(string|null $path = null)
|
function image(string|null $path = null): File|null
|
||||||
{
|
{
|
||||||
return App::instance()->image($path);
|
return App::instance()->image($path);
|
||||||
}
|
}
|
||||||
@@ -261,14 +243,12 @@ if (Helpers::hasOverride('image') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Runs a number of validators on a set of data and checks if the data is invalid
|
* Runs a number of validators on a set of data and checks if the data is invalid
|
||||||
*
|
|
||||||
* @param array $data
|
|
||||||
* @param array $rules
|
|
||||||
* @param array $messages
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
function invalid(array $data = [], array $rules = [], array $messages = []): array
|
function invalid(
|
||||||
{
|
array $data = [],
|
||||||
|
array $rules = [],
|
||||||
|
array $messages = []
|
||||||
|
): array {
|
||||||
return V::invalid($data, $rules, $messages);
|
return V::invalid($data, $rules, $messages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -276,13 +256,11 @@ if (Helpers::hasOverride('invalid') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Creates a script tag to load a javascript file
|
* Creates a script tag to load a javascript file
|
||||||
*
|
|
||||||
* @param string|array $url
|
|
||||||
* @param string|array $options
|
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function js($url, $options = null): string|null
|
function js(
|
||||||
{
|
string|array $url,
|
||||||
|
string|array|bool|null $options = null
|
||||||
|
): string|null {
|
||||||
return Html::js($url, $options);
|
return Html::js($url, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -290,10 +268,8 @@ if (Helpers::hasOverride('js') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Returns the Kirby object in any situation
|
* Returns the Kirby object in any situation
|
||||||
*
|
|
||||||
* @return \Kirby\Cms\App
|
|
||||||
*/
|
*/
|
||||||
function kirby()
|
function kirby(): App
|
||||||
{
|
{
|
||||||
return App::instance();
|
return App::instance();
|
||||||
}
|
}
|
||||||
@@ -302,15 +278,13 @@ if (Helpers::hasOverride('kirby') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('kirbytag') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('kirbytag') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Makes it possible to use any defined Kirbytag as standalone function
|
* Makes it possible to use any defined Kirbytag as standalone function
|
||||||
*
|
|
||||||
* @param string|array $type
|
|
||||||
* @param string|null $value
|
|
||||||
* @param array $attr
|
|
||||||
* @param array $data
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kirbytag($type, string|null $value = null, array $attr = [], array $data = []): string
|
function kirbytag(
|
||||||
{
|
string|array $type,
|
||||||
|
string|null $value = null,
|
||||||
|
array $attr = [],
|
||||||
|
array $data = []
|
||||||
|
): string {
|
||||||
return App::instance()->kirbytag($type, $value, $attr, $data);
|
return App::instance()->kirbytag($type, $value, $attr, $data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -319,10 +293,6 @@ if (Helpers::hasOverride('kirbytags') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Parses KirbyTags in the given string. Shortcut
|
* Parses KirbyTags in the given string. Shortcut
|
||||||
* for `$kirby->kirbytags($text, $data)`
|
* for `$kirby->kirbytags($text, $data)`
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $data
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kirbytags(string|null $text = null, array $data = []): string
|
function kirbytags(string|null $text = null, array $data = []): string
|
||||||
{
|
{
|
||||||
@@ -334,10 +304,6 @@ if (Helpers::hasOverride('kirbytext') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Parses KirbyTags and Markdown in the
|
* Parses KirbyTags and Markdown in the
|
||||||
* given string. Shortcut for `$kirby->kirbytext()`
|
* given string. Shortcut for `$kirby->kirbytext()`
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $data
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kirbytext(string|null $text = null, array $data = []): string
|
function kirbytext(string|null $text = null, array $data = []): string
|
||||||
{
|
{
|
||||||
@@ -350,10 +316,6 @@ if (Helpers::hasOverride('kirbytextinline') === false) { // @codeCoverageIgnore
|
|||||||
* Parses KirbyTags and inline Markdown in the
|
* Parses KirbyTags and inline Markdown in the
|
||||||
* given string.
|
* given string.
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kirbytextinline(string|null $text = null, array $options = []): string
|
function kirbytextinline(string|null $text = null, array $options = []): string
|
||||||
{
|
{
|
||||||
@@ -365,10 +327,6 @@ if (Helpers::hasOverride('kirbytextinline') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('kt') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('kt') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Shortcut for `kirbytext()` helper
|
* Shortcut for `kirbytext()` helper
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $data
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kt(string|null $text = null, array $data = []): string
|
function kt(string|null $text = null, array $data = []): string
|
||||||
{
|
{
|
||||||
@@ -380,10 +338,6 @@ if (Helpers::hasOverride('kti') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Shortcut for `kirbytextinline()` helper
|
* Shortcut for `kirbytextinline()` helper
|
||||||
* @since 3.1.0
|
* @since 3.1.0
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function kti(string|null $text = null, array $options = []): string
|
function kti(string|null $text = null, array $options = []): string
|
||||||
{
|
{
|
||||||
@@ -395,10 +349,6 @@ if (Helpers::hasOverride('kti') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('load') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('load') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* A super simple class autoloader
|
* A super simple class autoloader
|
||||||
*
|
|
||||||
* @param array $classmap
|
|
||||||
* @param string|null $base
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
function load(array $classmap, string|null $base = null): void
|
function load(array $classmap, string|null $base = null): void
|
||||||
{
|
{
|
||||||
@@ -410,10 +360,6 @@ if (Helpers::hasOverride('markdown') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Parses markdown in the given string. Shortcut for
|
* Parses markdown in the given string. Shortcut for
|
||||||
* `$kirby->markdown($text)`
|
* `$kirby->markdown($text)`
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @param array $options
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function markdown(string|null $text = null, array $options = []): string
|
function markdown(string|null $text = null, array $options = []): string
|
||||||
{
|
{
|
||||||
@@ -424,12 +370,8 @@ if (Helpers::hasOverride('markdown') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('option') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('option') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Shortcut for `$kirby->option($key, $default)`
|
* Shortcut for `$kirby->option($key, $default)`
|
||||||
*
|
|
||||||
* @param string $key
|
|
||||||
* @param mixed $default
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
function option(string $key, $default = null)
|
function option(string $key, mixed $default = null): mixed
|
||||||
{
|
{
|
||||||
return App::instance()->option($key, $default);
|
return App::instance()->option($key, $default);
|
||||||
}
|
}
|
||||||
@@ -439,11 +381,8 @@ if (Helpers::hasOverride('page') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Fetches a single page by id or
|
* Fetches a single page by id or
|
||||||
* the current page when no id is specified
|
* the current page when no id is specified
|
||||||
*
|
|
||||||
* @param string|null $id
|
|
||||||
* @return \Kirby\Cms\Page|null
|
|
||||||
*/
|
*/
|
||||||
function page(string|null $id = null)
|
function page(string|null $id = null): Page|null
|
||||||
{
|
{
|
||||||
if (empty($id) === true) {
|
if (empty($id) === true) {
|
||||||
return App::instance()->site()->page();
|
return App::instance()->site()->page();
|
||||||
@@ -456,11 +395,8 @@ if (Helpers::hasOverride('page') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('pages') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('pages') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Helper to build pages collection
|
* Helper to build pages collection
|
||||||
*
|
|
||||||
* @param string|array ...$id
|
|
||||||
* @return \Kirby\Cms\Pages|null
|
|
||||||
*/
|
*/
|
||||||
function pages(...$id)
|
function pages(string|array ...$id): Pages|null
|
||||||
{
|
{
|
||||||
// ensure that a list of string arguments and an array
|
// ensure that a list of string arguments and an array
|
||||||
// as the first argument are treated the same
|
// as the first argument are treated the same
|
||||||
@@ -478,9 +414,6 @@ if (Helpers::hasOverride('param') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Returns a single param from the URL
|
* Returns a single param from the URL
|
||||||
*
|
*
|
||||||
* @param string $key
|
|
||||||
* @param string|null $fallback
|
|
||||||
* @return string|null
|
|
||||||
* @psalm-return ($fallback is string ? string : string|null)
|
* @psalm-return ($fallback is string ? string : string|null)
|
||||||
*/
|
*/
|
||||||
function param(string $key, string|null $fallback = null): string|null
|
function param(string $key, string|null $fallback = null): string|null
|
||||||
@@ -492,8 +425,6 @@ if (Helpers::hasOverride('param') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('params') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('params') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Returns all params from the current Url
|
* Returns all params from the current Url
|
||||||
*
|
|
||||||
* @return array
|
|
||||||
*/
|
*/
|
||||||
function params(): array
|
function params(): array
|
||||||
{
|
{
|
||||||
@@ -505,12 +436,10 @@ if (Helpers::hasOverride('r') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Smart version of return with an if condition as first argument
|
* Smart version of return with an if condition as first argument
|
||||||
*
|
*
|
||||||
* @param mixed $condition
|
|
||||||
* @param mixed $value The string to be returned if the condition is true
|
* @param mixed $value The string to be returned if the condition is true
|
||||||
* @param mixed $alternative An alternative string which should be returned when the condition is false
|
* @param mixed $alternative An alternative string which should be returned when the condition is false
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
function r($condition, $value, $alternative = null)
|
function r(mixed $condition, mixed $value, mixed $alternative = null): mixed
|
||||||
{
|
{
|
||||||
return $condition ? $value : $alternative;
|
return $condition ? $value : $alternative;
|
||||||
}
|
}
|
||||||
@@ -521,15 +450,13 @@ if (Helpers::hasOverride('router') === false) { // @codeCoverageIgnore
|
|||||||
* Creates a micro-router and executes
|
* Creates a micro-router and executes
|
||||||
* the routing action immediately
|
* the routing action immediately
|
||||||
* @since 3.6.0
|
* @since 3.6.0
|
||||||
*
|
|
||||||
* @param string|null $path
|
|
||||||
* @param string $method
|
|
||||||
* @param array $routes
|
|
||||||
* @param \Closure|null $callback
|
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
function router(string|null $path = null, string $method = 'GET', array $routes = [], Closure|null $callback = null)
|
function router(
|
||||||
{
|
string|null $path = null,
|
||||||
|
string $method = 'GET',
|
||||||
|
array $routes = [],
|
||||||
|
Closure|null $callback = null
|
||||||
|
): mixed {
|
||||||
return Router::execute($path, $method, $routes, $callback);
|
return Router::execute($path, $method, $routes, $callback);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -537,10 +464,8 @@ if (Helpers::hasOverride('router') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Returns the current site object
|
* Returns the current site object
|
||||||
*
|
|
||||||
* @return \Kirby\Cms\Site
|
|
||||||
*/
|
*/
|
||||||
function site()
|
function site(): Site
|
||||||
{
|
{
|
||||||
return App::instance()->site();
|
return App::instance()->site();
|
||||||
}
|
}
|
||||||
@@ -549,12 +474,8 @@ if (Helpers::hasOverride('site') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('size') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('size') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Determines the size/length of numbers, strings, arrays and countable objects
|
* Determines the size/length of numbers, strings, arrays and countable objects
|
||||||
*
|
|
||||||
* @param mixed $value
|
|
||||||
* @return int
|
|
||||||
* @throws \Kirby\Exception\InvalidArgumentException
|
|
||||||
*/
|
*/
|
||||||
function size($value): int
|
function size(mixed $value): int
|
||||||
{
|
{
|
||||||
return Helpers::size($value);
|
return Helpers::size($value);
|
||||||
}
|
}
|
||||||
@@ -574,9 +495,6 @@ if (Helpers::hasOverride('smartypants') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Enhances the given string with
|
* Enhances the given string with
|
||||||
* smartypants. Shortcut for `$kirby->smartypants($text)`
|
* smartypants. Shortcut for `$kirby->smartypants($text)`
|
||||||
*
|
|
||||||
* @param string|null $text
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function smartypants(string|null $text = null): string
|
function smartypants(string|null $text = null): string
|
||||||
{
|
{
|
||||||
@@ -602,11 +520,8 @@ if (Helpers::hasOverride('svg') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Includes an SVG file by absolute or
|
* Includes an SVG file by absolute or
|
||||||
* relative file path.
|
* relative file path.
|
||||||
*
|
|
||||||
* @param string|\Kirby\Cms\File $file
|
|
||||||
* @return string|false
|
|
||||||
*/
|
*/
|
||||||
function svg($file)
|
function svg(string|File $file): string|false
|
||||||
{
|
{
|
||||||
return Html::svg($file);
|
return Html::svg($file);
|
||||||
}
|
}
|
||||||
@@ -615,14 +530,12 @@ if (Helpers::hasOverride('svg') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('t') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('t') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Returns translate string for key from translation file
|
* Returns translate string for key from translation file
|
||||||
*
|
|
||||||
* @param string|array $key
|
|
||||||
* @param string|null $fallback
|
|
||||||
* @param string|null $locale
|
|
||||||
* @return array|string|null
|
|
||||||
*/
|
*/
|
||||||
function t($key, string $fallback = null, string $locale = null)
|
function t(
|
||||||
{
|
string|array $key,
|
||||||
|
string|null $fallback = null,
|
||||||
|
string|null $locale = null
|
||||||
|
): string|array|Closure|null {
|
||||||
return I18n::translate($key, $fallback, $locale);
|
return I18n::translate($key, $fallback, $locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -631,18 +544,14 @@ if (Helpers::hasOverride('tc') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Translates a count
|
* Translates a count
|
||||||
*
|
*
|
||||||
* @param string $key
|
|
||||||
* @param int $count
|
|
||||||
* @param string|null $locale
|
|
||||||
* @param bool $formatNumber If set to `false`, the count is not formatted
|
* @param bool $formatNumber If set to `false`, the count is not formatted
|
||||||
* @return mixed
|
|
||||||
*/
|
*/
|
||||||
function tc(
|
function tc(
|
||||||
string $key,
|
string $key,
|
||||||
int $count,
|
int $count,
|
||||||
string $locale = null,
|
string|null $locale = null,
|
||||||
bool $formatNumber = true
|
bool $formatNumber = true
|
||||||
) {
|
): mixed {
|
||||||
return I18n::translateCount($key, $count, $locale, $formatNumber);
|
return I18n::translateCount($key, $count, $locale, $formatNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -652,12 +561,12 @@ if (Helpers::hasOverride('timestamp') === false) { // @codeCoverageIgnore
|
|||||||
* Rounds the minutes of the given date
|
* Rounds the minutes of the given date
|
||||||
* by the defined step
|
* by the defined step
|
||||||
*
|
*
|
||||||
* @param string|null $date
|
|
||||||
* @param int|array|null $step array of `unit` and `size` to round to nearest
|
* @param int|array|null $step array of `unit` and `size` to round to nearest
|
||||||
* @return int|null
|
|
||||||
*/
|
*/
|
||||||
function timestamp(string|null $date = null, $step = null): int|null
|
function timestamp(
|
||||||
{
|
string|null $date = null,
|
||||||
|
int|array|null $step = null
|
||||||
|
): int|null {
|
||||||
return Date::roundedTimestamp($date, $step);
|
return Date::roundedTimestamp($date, $step);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -666,15 +575,13 @@ if (Helpers::hasOverride('tt') === false) { // @codeCoverageIgnore
|
|||||||
/**
|
/**
|
||||||
* Translate by key and then replace
|
* Translate by key and then replace
|
||||||
* placeholders in the text
|
* placeholders in the text
|
||||||
*
|
|
||||||
* @param string $key
|
|
||||||
* @param string|array|null $fallback
|
|
||||||
* @param array|null $replace
|
|
||||||
* @param string|null $locale
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function tt(string $key, $fallback = null, array|null $replace = null, string|null $locale = null): string
|
function tt(
|
||||||
{
|
string $key,
|
||||||
|
string|array|null $fallback = null,
|
||||||
|
array|null $replace = null,
|
||||||
|
string|null $locale = null
|
||||||
|
): string {
|
||||||
return I18n::template($key, $fallback, $replace, $locale);
|
return I18n::template($key, $fallback, $replace, $locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -682,15 +589,13 @@ if (Helpers::hasOverride('tt') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Builds a Twitter link
|
* Builds a Twitter link
|
||||||
*
|
|
||||||
* @param string $username
|
|
||||||
* @param string|null $text
|
|
||||||
* @param string|null $title
|
|
||||||
* @param string|null $class
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function twitter(string $username, string|null $text = null, string|null $title = null, string|null $class = null): string
|
function twitter(
|
||||||
{
|
string $username,
|
||||||
|
string|null $text = null,
|
||||||
|
string|null $title = null,
|
||||||
|
string|null $class = null
|
||||||
|
): string {
|
||||||
return App::instance()->kirbytag([
|
return App::instance()->kirbytag([
|
||||||
'twitter' => $username,
|
'twitter' => $username,
|
||||||
'text' => $text,
|
'text' => $text,
|
||||||
@@ -703,13 +608,11 @@ if (Helpers::hasOverride('twitter') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Shortcut for url()
|
* Shortcut for url()
|
||||||
*
|
|
||||||
* @param string|null $path
|
|
||||||
* @param array|string|null $options
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function u(string|null $path = null, $options = null): string
|
function u(
|
||||||
{
|
string|null $path = null,
|
||||||
|
array|string|null $options = null
|
||||||
|
): string {
|
||||||
return Url::to($path, $options);
|
return Url::to($path, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -717,13 +620,11 @@ if (Helpers::hasOverride('u') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Builds an absolute URL for a given path
|
* Builds an absolute URL for a given path
|
||||||
*
|
|
||||||
* @param string|null $path
|
|
||||||
* @param array|string|null $options
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function url(string|null $path = null, $options = null): string
|
function url(
|
||||||
{
|
string|null $path = null,
|
||||||
|
array|string|null $options = null
|
||||||
|
): string {
|
||||||
return Url::to($path, $options);
|
return Url::to($path, $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -731,8 +632,6 @@ if (Helpers::hasOverride('url') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('uuid') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('uuid') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Creates a compliant v4 UUID
|
* Creates a compliant v4 UUID
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function uuid(): string
|
function uuid(): string
|
||||||
{
|
{
|
||||||
@@ -745,11 +644,6 @@ if (Helpers::hasOverride('video') === false) { // @codeCoverageIgnore
|
|||||||
* Creates a video embed via iframe for Youtube or Vimeo
|
* Creates a video embed via iframe for Youtube or Vimeo
|
||||||
* videos. The embed Urls are automatically detected from
|
* videos. The embed Urls are automatically detected from
|
||||||
* the given Url.
|
* the given Url.
|
||||||
*
|
|
||||||
* @param string $url
|
|
||||||
* @param array $options
|
|
||||||
* @param array $attr
|
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function video(string $url, array $options = [], array $attr = []): string|null
|
function video(string $url, array $options = [], array $attr = []): string|null
|
||||||
{
|
{
|
||||||
@@ -760,11 +654,6 @@ if (Helpers::hasOverride('video') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('vimeo') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('vimeo') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Embeds a Vimeo video by URL in an iframe
|
* Embeds a Vimeo video by URL in an iframe
|
||||||
*
|
|
||||||
* @param string $url
|
|
||||||
* @param array $options
|
|
||||||
* @param array $attr
|
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function vimeo(string $url, array $options = [], array $attr = []): string|null
|
function vimeo(string $url, array $options = [], array $attr = []): string|null
|
||||||
{
|
{
|
||||||
@@ -777,11 +666,8 @@ if (Helpers::hasOverride('widont') === false) { // @codeCoverageIgnore
|
|||||||
* The widont function makes sure that there are no
|
* The widont function makes sure that there are no
|
||||||
* typographical widows at the end of a paragraph –
|
* typographical widows at the end of a paragraph –
|
||||||
* that's a single word in the last line
|
* that's a single word in the last line
|
||||||
*
|
|
||||||
* @param string|null $string
|
|
||||||
* @return string
|
|
||||||
*/
|
*/
|
||||||
function widont(string $string = null): string
|
function widont(string|null $string = null): string
|
||||||
{
|
{
|
||||||
return Str::widont($string);
|
return Str::widont($string);
|
||||||
}
|
}
|
||||||
@@ -790,11 +676,6 @@ if (Helpers::hasOverride('widont') === false) { // @codeCoverageIgnore
|
|||||||
if (Helpers::hasOverride('youtube') === false) { // @codeCoverageIgnore
|
if (Helpers::hasOverride('youtube') === false) { // @codeCoverageIgnore
|
||||||
/**
|
/**
|
||||||
* Embeds a Youtube video by URL in an iframe
|
* Embeds a Youtube video by URL in an iframe
|
||||||
*
|
|
||||||
* @param string $url
|
|
||||||
* @param array $options
|
|
||||||
* @param array $attr
|
|
||||||
* @return string|null
|
|
||||||
*/
|
*/
|
||||||
function youtube(string $url, array $options = [], array $attr = []): string|null
|
function youtube(string $url, array $options = [], array $attr = []): string|null
|
||||||
{
|
{
|
||||||
|
@@ -162,10 +162,9 @@ return [
|
|||||||
}
|
}
|
||||||
|
|
||||||
// count all uploaded files
|
// count all uploaded files
|
||||||
$total = count($this->data);
|
$max = $this->max ? $this->max - $this->total : null;
|
||||||
$max = $this->max ? $this->max - $total : null;
|
|
||||||
|
|
||||||
if ($this->max && $total === $this->max - 1) {
|
if ($this->max && $this->total === $this->max - 1) {
|
||||||
$multiple = false;
|
$multiple = false;
|
||||||
} else {
|
} else {
|
||||||
$multiple = true;
|
$multiple = true;
|
||||||
@@ -179,7 +178,10 @@ return [
|
|||||||
'max' => $max,
|
'max' => $max,
|
||||||
'api' => $this->parent->apiUrl(true) . '/files',
|
'api' => $this->parent->apiUrl(true) . '/files',
|
||||||
'attributes' => array_filter([
|
'attributes' => array_filter([
|
||||||
'sort' => $this->sortable === true ? $total + 1 : null,
|
// TODO: an edge issue that needs to be solved:
|
||||||
|
// if multiple users load the same section at the same time
|
||||||
|
// and upload a file, uploaded files have the same sort number
|
||||||
|
'sort' => $this->sortable === true ? $this->total + 1 : null,
|
||||||
'template' => $template
|
'template' => $template
|
||||||
])
|
])
|
||||||
];
|
];
|
||||||
|
@@ -500,7 +500,7 @@
|
|||||||
|
|
||||||
"stats.empty": "관련 기록이 없습니다.",
|
"stats.empty": "관련 기록이 없습니다.",
|
||||||
"system.issues.content": "<code>/content</code> 폴더의 권한을 확인하세요.",
|
"system.issues.content": "<code>/content</code> 폴더의 권한을 확인하세요.",
|
||||||
"system.issues.eol.kirby": "Your installed Kirby version has reached end-of-life and will not receive further security updates",
|
"system.issues.eol.kirby": "설치된 Kirby는 버전이 만료되었습니다. 더 이상 보안 업데이트를 받을 수 없습니다.",
|
||||||
"system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates",
|
"system.issues.eol.plugin": "Your installed version of the { plugin } plugin is has reached end-of-life and will not receive further security updates",
|
||||||
"system.issues.debug": "공개 서버상에서는 디버그 모드를 해제하세요.",
|
"system.issues.debug": "공개 서버상에서는 디버그 모드를 해제하세요.",
|
||||||
"system.issues.git": "<code>/.git</code> 폴더의 권한을 확인하세요.",
|
"system.issues.git": "<code>/.git</code> 폴더의 권한을 확인하세요.",
|
||||||
|
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
@@ -202,6 +202,18 @@ class BlocksField extends FieldClass
|
|||||||
return $this->valueToJson($blocks, $this->pretty());
|
return $this->valueToJson($blocks, $this->pretty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function setDefault($default = null)
|
||||||
|
{
|
||||||
|
// set id for blocks if not exists
|
||||||
|
if (is_array($default) === true) {
|
||||||
|
array_walk($default, function (&$block) {
|
||||||
|
$block['id'] ??= Str::uuid();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::setDefault($default);
|
||||||
|
}
|
||||||
|
|
||||||
protected function setFieldsets($fieldsets, $model)
|
protected function setFieldsets($fieldsets, $model)
|
||||||
{
|
{
|
||||||
if (is_string($fieldsets) === true) {
|
if (is_string($fieldsets) === true) {
|
||||||
|
@@ -115,6 +115,32 @@ class LayoutField extends BlocksField
|
|||||||
return $routes;
|
return $routes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function setDefault($default = null)
|
||||||
|
{
|
||||||
|
// set id for layouts, columns and blocks within layout if not exists
|
||||||
|
if (is_array($default) === true) {
|
||||||
|
array_walk($default, function (&$layout) {
|
||||||
|
$layout['id'] ??= Str::uuid();
|
||||||
|
|
||||||
|
// set columns id within layout
|
||||||
|
if (isset($layout['columns']) === true) {
|
||||||
|
array_walk($layout['columns'], function (&$column) {
|
||||||
|
$column['id'] ??= Str::uuid();
|
||||||
|
|
||||||
|
// set blocks id within column
|
||||||
|
if (isset($column['blocks']) === true) {
|
||||||
|
array_walk($column['blocks'], function (&$block) {
|
||||||
|
$block['id'] ??= Str::uuid();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
parent::setDefault($default);
|
||||||
|
}
|
||||||
|
|
||||||
protected function setLayouts(array $layouts = [])
|
protected function setLayouts(array $layouts = [])
|
||||||
{
|
{
|
||||||
$this->layouts = array_map(
|
$this->layouts = array_map(
|
||||||
|
@@ -838,11 +838,13 @@ abstract class FieldClass
|
|||||||
*/
|
*/
|
||||||
protected function valueToJson(array $value = null, bool $pretty = false): string
|
protected function valueToJson(array $value = null, bool $pretty = false): string
|
||||||
{
|
{
|
||||||
|
$constants = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE;
|
||||||
|
|
||||||
if ($pretty === true) {
|
if ($pretty === true) {
|
||||||
return json_encode($value, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
|
$constants |= JSON_PRETTY_PRINT;
|
||||||
}
|
}
|
||||||
|
|
||||||
return json_encode($value);
|
return json_encode($value, $constants);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -66,7 +66,7 @@ class Params extends Obj
|
|||||||
$paramValue = $paramParts[1] ?? null;
|
$paramValue = $paramParts[1] ?? null;
|
||||||
|
|
||||||
if ($paramKey !== null) {
|
if ($paramKey !== null) {
|
||||||
$params[rawurldecode($paramKey)] = $paramValue ? rawurldecode($paramValue) : null;
|
$params[rawurldecode($paramKey)] = $paramValue !== null ? rawurldecode($paramValue) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($path[$index]);
|
unset($path[$index]);
|
||||||
|
@@ -33,7 +33,7 @@ class GdLib extends Darkroom
|
|||||||
$image = $this->blur($image, $options);
|
$image = $this->blur($image, $options);
|
||||||
$image = $this->grayscale($image, $options);
|
$image = $this->grayscale($image, $options);
|
||||||
|
|
||||||
$image->toFile($file, $mime, $options['quality']);
|
$image->toFile($file, $mime, $options);
|
||||||
|
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
@@ -60,7 +60,11 @@ class GdLib extends Darkroom
|
|||||||
return $image->resize($options['width'], $options['height']);
|
return $image->resize($options['width'], $options['height']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $image->thumbnail($options['width'], $options['height'] ?? $options['width'], $options['crop']);
|
return $image->thumbnail(
|
||||||
|
$options['width'],
|
||||||
|
$options['height'] ?? $options['width'],
|
||||||
|
$options['crop']
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -48,6 +48,17 @@ class A
|
|||||||
return $array;
|
return $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Counts the number of elements in an array
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
public static function count(array $array): int
|
||||||
|
{
|
||||||
|
return count($array);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an element of an array by key
|
* Gets an element of an array by key
|
||||||
*
|
*
|
||||||
@@ -150,6 +161,19 @@ class A
|
|||||||
return $default;
|
return $default;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if array has a value
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @param mixed $value
|
||||||
|
* @param bool $strict
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function has(array $array, $value, bool $strict = false): bool
|
||||||
|
{
|
||||||
|
return in_array($value, $array, $strict);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Joins the elements of an array to a string
|
* Joins the elements of an array to a string
|
||||||
*/
|
*/
|
||||||
@@ -309,6 +333,19 @@ class A
|
|||||||
return $prepend + $array;
|
return $prepend + $array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reduce an array to a single value
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @param callable $callback
|
||||||
|
* @param mixed $initial
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public static function reduce(array $array, callable $callback, $initial = null): mixed
|
||||||
|
{
|
||||||
|
return array_reduce($array, $callback, $initial);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shuffles an array and keeps the keys
|
* Shuffles an array and keeps the keys
|
||||||
*
|
*
|
||||||
@@ -345,6 +382,36 @@ class A
|
|||||||
return $new;
|
return $new;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a slice of an array
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @param int $offset
|
||||||
|
* @param int|null $length
|
||||||
|
* @param bool $preserveKeys
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public static function slice(
|
||||||
|
array $array,
|
||||||
|
int $offset,
|
||||||
|
int $length = null,
|
||||||
|
bool $preserveKeys = false
|
||||||
|
): array {
|
||||||
|
return array_slice($array, $offset, $length, $preserveKeys);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sums an array
|
||||||
|
*
|
||||||
|
* @param array $array
|
||||||
|
* @return int|float
|
||||||
|
*/
|
||||||
|
public static function sum(array $array): int|float
|
||||||
|
{
|
||||||
|
return array_sum($array);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the first element of an array
|
* Returns the first element of an array
|
||||||
*
|
*
|
||||||
|
@@ -522,6 +522,49 @@ class Str
|
|||||||
return preg_replace('!^(' . preg_quote($trim) . ')+!', '', $string);
|
return preg_replace('!^(' . preg_quote($trim) . ')+!', '', $string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Match string against a regular expression and return matches
|
||||||
|
*
|
||||||
|
* @param string $string The string to match
|
||||||
|
* @param string $pattern The regular expression
|
||||||
|
* @param int $flags Optional flags for PHP `preg_match()`
|
||||||
|
* @param int $offset Positional offset in the string to start the search
|
||||||
|
* @return array|null The matches or null if no match was found
|
||||||
|
*/
|
||||||
|
public static function match(string $string, string $pattern, int $flags = 0, int $offset = 0): ?array
|
||||||
|
{
|
||||||
|
$result = preg_match($pattern, $string, $matches, $flags, $offset);
|
||||||
|
return ($result === 1) ? $matches : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check whether a string matches a regular expression
|
||||||
|
*
|
||||||
|
* @param string $string The string to match
|
||||||
|
* @param string $pattern The regular expression
|
||||||
|
* @param int $flags Optional flags for PHP `preg_match()`
|
||||||
|
* @param int $offset Positional offset in the string to start the search
|
||||||
|
* @return bool True if the string matches the pattern
|
||||||
|
*/
|
||||||
|
public static function matches(string $string, string $pattern, int $flags = 0, int $offset = 0): bool
|
||||||
|
{
|
||||||
|
return static::match($string, $pattern, $flags, $offset) !== null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Match string against a regular expression and return all matches
|
||||||
|
*
|
||||||
|
* @param string $string The string to match
|
||||||
|
* @param string $pattern The regular expression
|
||||||
|
* @param int $flags Optional flags for PHP `preg_match_all()`
|
||||||
|
* @param int $offset Positional offset in the string to start the search
|
||||||
|
* @return array|null The matches or null if no match was found
|
||||||
|
*/
|
||||||
|
public static function matchAll(string $string, string $pattern, int $flags = 0, int $offset = 0): ?array
|
||||||
|
{
|
||||||
|
$result = preg_match_all($pattern, $string, $matches, $flags, $offset);
|
||||||
|
return ($result > 0) ? $matches : null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a character pool with various possible combinations
|
* Get a character pool with various possible combinations
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
"description": "A PHP class that makes working with images as simple as possible.",
|
"description": "A PHP class that makes working with images as simple as possible.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6.0",
|
"php": ">=8.0",
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"league/color-extractor": "0.3.*"
|
"league/color-extractor": "0.4.*"
|
||||||
},
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
@@ -18,5 +18,9 @@
|
|||||||
"psr-0": {
|
"psr-0": {
|
||||||
"claviska": "src/"
|
"claviska": "src/"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"laravel/pint": "^1.5",
|
||||||
|
"phpstan/phpstan": "^1.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
209
kirby/vendor/claviska/simpleimage/composer.lock
generated
vendored
Normal file
209
kirby/vendor/claviska/simpleimage/composer.lock
generated
vendored
Normal file
@@ -0,0 +1,209 @@
|
|||||||
|
{
|
||||||
|
"_readme": [
|
||||||
|
"This file locks the dependencies of your project to a known state",
|
||||||
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
|
"This file is @generated automatically"
|
||||||
|
],
|
||||||
|
"content-hash": "eb94dc95686ec297093755af85d5e7dd",
|
||||||
|
"packages": [
|
||||||
|
{
|
||||||
|
"name": "league/color-extractor",
|
||||||
|
"version": "0.4.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/thephpleague/color-extractor.git",
|
||||||
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-gd": "*",
|
||||||
|
"php": "^7.3 || ^8.0"
|
||||||
|
},
|
||||||
|
"replace": {
|
||||||
|
"matthecat/colorextractor": "*"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "~2",
|
||||||
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"League\\ColorExtractor\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Mathieu Lechat",
|
||||||
|
"email": "math.lechat@gmail.com",
|
||||||
|
"homepage": "http://matthecat.com",
|
||||||
|
"role": "Developer"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "Extract colors from an image as a human would do.",
|
||||||
|
"homepage": "https://github.com/thephpleague/color-extractor",
|
||||||
|
"keywords": [
|
||||||
|
"color",
|
||||||
|
"extract",
|
||||||
|
"human",
|
||||||
|
"image",
|
||||||
|
"palette"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/thephpleague/color-extractor/issues",
|
||||||
|
"source": "https://github.com/thephpleague/color-extractor/tree/0.4.0"
|
||||||
|
},
|
||||||
|
"time": "2022-09-24T15:57:16+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"packages-dev": [
|
||||||
|
{
|
||||||
|
"name": "laravel/pint",
|
||||||
|
"version": "v1.5.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/laravel/pint.git",
|
||||||
|
"reference": "e0a8cef58b74662f27355be9cdea0e726bbac362"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/laravel/pint/zipball/e0a8cef58b74662f27355be9cdea0e726bbac362",
|
||||||
|
"reference": "e0a8cef58b74662f27355be9cdea0e726bbac362",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"ext-json": "*",
|
||||||
|
"ext-mbstring": "*",
|
||||||
|
"ext-tokenizer": "*",
|
||||||
|
"ext-xml": "*",
|
||||||
|
"php": "^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"friendsofphp/php-cs-fixer": "^3.14.4",
|
||||||
|
"illuminate/view": "^9.51.0",
|
||||||
|
"laravel-zero/framework": "^9.2.0",
|
||||||
|
"mockery/mockery": "^1.5.1",
|
||||||
|
"nunomaduro/larastan": "^2.4.0",
|
||||||
|
"nunomaduro/termwind": "^1.15.1",
|
||||||
|
"pestphp/pest": "^1.22.4"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"builds/pint"
|
||||||
|
],
|
||||||
|
"type": "project",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"App\\": "app/",
|
||||||
|
"Database\\Seeders\\": "database/seeders/",
|
||||||
|
"Database\\Factories\\": "database/factories/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Nuno Maduro",
|
||||||
|
"email": "enunomaduro@gmail.com"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "An opinionated code formatter for PHP.",
|
||||||
|
"homepage": "https://laravel.com",
|
||||||
|
"keywords": [
|
||||||
|
"format",
|
||||||
|
"formatter",
|
||||||
|
"lint",
|
||||||
|
"linter",
|
||||||
|
"php"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/laravel/pint/issues",
|
||||||
|
"source": "https://github.com/laravel/pint"
|
||||||
|
},
|
||||||
|
"time": "2023-02-14T16:31:02+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "phpstan/phpstan",
|
||||||
|
"version": "1.10.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/phpstan/phpstan.git",
|
||||||
|
"reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/a2ffec7db373d8da4973d1d62add872db5cd22dd",
|
||||||
|
"reference": "a2ffec7db373d8da4973d1d62add872db5cd22dd",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": "^7.2|^8.0"
|
||||||
|
},
|
||||||
|
"conflict": {
|
||||||
|
"phpstan/phpstan-shim": "*"
|
||||||
|
},
|
||||||
|
"bin": [
|
||||||
|
"phpstan",
|
||||||
|
"phpstan.phar"
|
||||||
|
],
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"files": [
|
||||||
|
"bootstrap.php"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"MIT"
|
||||||
|
],
|
||||||
|
"description": "PHPStan - PHP Static Analysis Tool",
|
||||||
|
"keywords": [
|
||||||
|
"dev",
|
||||||
|
"static analysis"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/phpstan/phpstan/issues",
|
||||||
|
"source": "https://github.com/phpstan/phpstan/tree/1.10.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://github.com/ondrejmirtes",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://github.com/phpstan",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"url": "https://tidelift.com/funding/github/packagist/phpstan/phpstan",
|
||||||
|
"type": "tidelift"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2023-02-23T14:36:46+00:00"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"aliases": [],
|
||||||
|
"minimum-stability": "stable",
|
||||||
|
"stability-flags": [],
|
||||||
|
"prefer-stable": false,
|
||||||
|
"prefer-lowest": false,
|
||||||
|
"platform": {
|
||||||
|
"php": ">=8.0",
|
||||||
|
"ext-gd": "*"
|
||||||
|
},
|
||||||
|
"platform-dev": [],
|
||||||
|
"plugin-api-version": "2.3.0"
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
10
kirby/vendor/composer/autoload_classmap.php
vendored
10
kirby/vendor/composer/autoload_classmap.php
vendored
@@ -318,12 +318,13 @@ return array(
|
|||||||
'Laminas\\Escaper\\Exception\\ExceptionInterface' => $vendorDir . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php',
|
'Laminas\\Escaper\\Exception\\ExceptionInterface' => $vendorDir . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php',
|
||||||
'Laminas\\Escaper\\Exception\\InvalidArgumentException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php',
|
'Laminas\\Escaper\\Exception\\InvalidArgumentException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php',
|
||||||
'Laminas\\Escaper\\Exception\\RuntimeException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/RuntimeException.php',
|
'Laminas\\Escaper\\Exception\\RuntimeException' => $vendorDir . '/laminas/laminas-escaper/src/Exception/RuntimeException.php',
|
||||||
'League\\ColorExtractor\\Color' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/Color.php',
|
'League\\ColorExtractor\\Color' => $vendorDir . '/league/color-extractor/src/Color.php',
|
||||||
'League\\ColorExtractor\\ColorExtractor' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php',
|
'League\\ColorExtractor\\ColorExtractor' => $vendorDir . '/league/color-extractor/src/ColorExtractor.php',
|
||||||
'League\\ColorExtractor\\Palette' => $vendorDir . '/league/color-extractor/src/League/ColorExtractor/Palette.php',
|
'League\\ColorExtractor\\Palette' => $vendorDir . '/league/color-extractor/src/Palette.php',
|
||||||
'Michelf\\SmartyPants' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPants.php',
|
'Michelf\\SmartyPants' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPants.php',
|
||||||
'Michelf\\SmartyPantsTypographer' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php',
|
'Michelf\\SmartyPantsTypographer' => $vendorDir . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php',
|
||||||
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||||
|
'PHPMailer\\PHPMailer\\DSNConfigurator' => $vendorDir . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
||||||
'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php',
|
'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php',
|
'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuthTokenProvider' => $vendorDir . '/phpmailer/phpmailer/src/OAuthTokenProvider.php',
|
'PHPMailer\\PHPMailer\\OAuthTokenProvider' => $vendorDir . '/phpmailer/phpmailer/src/OAuthTokenProvider.php',
|
||||||
@@ -359,6 +360,9 @@ return array(
|
|||||||
'Whoops\\Handler\\PlainTextHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php',
|
'Whoops\\Handler\\PlainTextHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php',
|
||||||
'Whoops\\Handler\\PrettyPageHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php',
|
'Whoops\\Handler\\PrettyPageHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php',
|
||||||
'Whoops\\Handler\\XmlResponseHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php',
|
'Whoops\\Handler\\XmlResponseHandler' => $vendorDir . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php',
|
||||||
|
'Whoops\\Inspector\\InspectorFactory' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorFactory.php',
|
||||||
|
'Whoops\\Inspector\\InspectorFactoryInterface' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php',
|
||||||
|
'Whoops\\Inspector\\InspectorInterface' => $vendorDir . '/filp/whoops/src/Whoops/Inspector/InspectorInterface.php',
|
||||||
'Whoops\\Run' => $vendorDir . '/filp/whoops/src/Whoops/Run.php',
|
'Whoops\\Run' => $vendorDir . '/filp/whoops/src/Whoops/Run.php',
|
||||||
'Whoops\\RunInterface' => $vendorDir . '/filp/whoops/src/Whoops/RunInterface.php',
|
'Whoops\\RunInterface' => $vendorDir . '/filp/whoops/src/Whoops/RunInterface.php',
|
||||||
'Whoops\\Util\\HtmlDumperOutput' => $vendorDir . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php',
|
'Whoops\\Util\\HtmlDumperOutput' => $vendorDir . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php',
|
||||||
|
2
kirby/vendor/composer/autoload_psr4.php
vendored
2
kirby/vendor/composer/autoload_psr4.php
vendored
@@ -12,8 +12,8 @@ return array(
|
|||||||
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
'Symfony\\Polyfill\\Intl\\Idn\\' => array($vendorDir . '/symfony/polyfill-intl-idn'),
|
||||||
'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'),
|
||||||
'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'),
|
'Laminas\\Escaper\\' => array($vendorDir . '/laminas/laminas-escaper/src'),
|
||||||
'Kirby\\' => array($baseDir . '/src', $vendorDir . '/getkirby/composer-installer/src'),
|
'Kirby\\' => array($baseDir . '/src', $vendorDir . '/getkirby/composer-installer/src'),
|
||||||
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
|
'Composer\\Semver\\' => array($vendorDir . '/composer/semver/src'),
|
||||||
'' => array($vendorDir . '/league/color-extractor/src'),
|
|
||||||
);
|
);
|
||||||
|
20
kirby/vendor/composer/autoload_static.php
vendored
20
kirby/vendor/composer/autoload_static.php
vendored
@@ -32,6 +32,7 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
),
|
),
|
||||||
'L' =>
|
'L' =>
|
||||||
array (
|
array (
|
||||||
|
'League\\ColorExtractor\\' => 22,
|
||||||
'Laminas\\Escaper\\' => 16,
|
'Laminas\\Escaper\\' => 16,
|
||||||
),
|
),
|
||||||
'K' =>
|
'K' =>
|
||||||
@@ -69,6 +70,10 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
|
0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src',
|
||||||
),
|
),
|
||||||
|
'League\\ColorExtractor\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/league/color-extractor/src',
|
||||||
|
),
|
||||||
'Laminas\\Escaper\\' =>
|
'Laminas\\Escaper\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/laminas/laminas-escaper/src',
|
0 => __DIR__ . '/..' . '/laminas/laminas-escaper/src',
|
||||||
@@ -84,10 +89,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
public static $fallbackDirsPsr4 = array (
|
|
||||||
0 => __DIR__ . '/..' . '/league/color-extractor/src',
|
|
||||||
);
|
|
||||||
|
|
||||||
public static $prefixesPsr0 = array (
|
public static $prefixesPsr0 = array (
|
||||||
'c' =>
|
'c' =>
|
||||||
array (
|
array (
|
||||||
@@ -418,12 +419,13 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Laminas\\Escaper\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php',
|
'Laminas\\Escaper\\Exception\\ExceptionInterface' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/ExceptionInterface.php',
|
||||||
'Laminas\\Escaper\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php',
|
'Laminas\\Escaper\\Exception\\InvalidArgumentException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/InvalidArgumentException.php',
|
||||||
'Laminas\\Escaper\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/RuntimeException.php',
|
'Laminas\\Escaper\\Exception\\RuntimeException' => __DIR__ . '/..' . '/laminas/laminas-escaper/src/Exception/RuntimeException.php',
|
||||||
'League\\ColorExtractor\\Color' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/Color.php',
|
'League\\ColorExtractor\\Color' => __DIR__ . '/..' . '/league/color-extractor/src/Color.php',
|
||||||
'League\\ColorExtractor\\ColorExtractor' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/ColorExtractor.php',
|
'League\\ColorExtractor\\ColorExtractor' => __DIR__ . '/..' . '/league/color-extractor/src/ColorExtractor.php',
|
||||||
'League\\ColorExtractor\\Palette' => __DIR__ . '/..' . '/league/color-extractor/src/League/ColorExtractor/Palette.php',
|
'League\\ColorExtractor\\Palette' => __DIR__ . '/..' . '/league/color-extractor/src/Palette.php',
|
||||||
'Michelf\\SmartyPants' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPants.php',
|
'Michelf\\SmartyPants' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPants.php',
|
||||||
'Michelf\\SmartyPantsTypographer' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php',
|
'Michelf\\SmartyPantsTypographer' => __DIR__ . '/..' . '/michelf/php-smartypants/Michelf/SmartyPantsTypographer.php',
|
||||||
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php',
|
||||||
|
'PHPMailer\\PHPMailer\\DSNConfigurator' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/DSNConfigurator.php',
|
||||||
'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php',
|
'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php',
|
'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php',
|
||||||
'PHPMailer\\PHPMailer\\OAuthTokenProvider' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuthTokenProvider.php',
|
'PHPMailer\\PHPMailer\\OAuthTokenProvider' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuthTokenProvider.php',
|
||||||
@@ -459,6 +461,9 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
'Whoops\\Handler\\PlainTextHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php',
|
'Whoops\\Handler\\PlainTextHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PlainTextHandler.php',
|
||||||
'Whoops\\Handler\\PrettyPageHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php',
|
'Whoops\\Handler\\PrettyPageHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/PrettyPageHandler.php',
|
||||||
'Whoops\\Handler\\XmlResponseHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php',
|
'Whoops\\Handler\\XmlResponseHandler' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Handler/XmlResponseHandler.php',
|
||||||
|
'Whoops\\Inspector\\InspectorFactory' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorFactory.php',
|
||||||
|
'Whoops\\Inspector\\InspectorFactoryInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php',
|
||||||
|
'Whoops\\Inspector\\InspectorInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Inspector/InspectorInterface.php',
|
||||||
'Whoops\\Run' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Run.php',
|
'Whoops\\Run' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Run.php',
|
||||||
'Whoops\\RunInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/RunInterface.php',
|
'Whoops\\RunInterface' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/RunInterface.php',
|
||||||
'Whoops\\Util\\HtmlDumperOutput' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php',
|
'Whoops\\Util\\HtmlDumperOutput' => __DIR__ . '/..' . '/filp/whoops/src/Whoops/Util/HtmlDumperOutput.php',
|
||||||
@@ -473,7 +478,6 @@ class ComposerStaticInita8011b477bb239488e5d139cdeb7b31e
|
|||||||
return \Closure::bind(function () use ($loader) {
|
return \Closure::bind(function () use ($loader) {
|
||||||
$loader->prefixLengthsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixLengthsPsr4;
|
$loader->prefixLengthsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixLengthsPsr4;
|
||||||
$loader->prefixDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixDirsPsr4;
|
$loader->prefixDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixDirsPsr4;
|
||||||
$loader->fallbackDirsPsr4 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$fallbackDirsPsr4;
|
|
||||||
$loader->prefixesPsr0 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixesPsr0;
|
$loader->prefixesPsr0 = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$prefixesPsr0;
|
||||||
$loader->classMap = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$classMap;
|
$loader->classMap = ComposerStaticInita8011b477bb239488e5d139cdeb7b31e::$classMap;
|
||||||
|
|
||||||
|
73
kirby/vendor/composer/installed.json
vendored
73
kirby/vendor/composer/installed.json
vendored
@@ -2,25 +2,29 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "claviska/simpleimage",
|
"name": "claviska/simpleimage",
|
||||||
"version": "3.7.2",
|
"version": "4.0.2",
|
||||||
"version_normalized": "3.7.2.0",
|
"version_normalized": "4.0.2.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/claviska/SimpleImage.git",
|
"url": "https://github.com/claviska/SimpleImage.git",
|
||||||
"reference": "82dbef988e356baa5d73993a1351bcb6c0959269"
|
"reference": "226d507cca0c8400d69bee7eb324158e3cbe246e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/82dbef988e356baa5d73993a1351bcb6c0959269",
|
"url": "https://api.github.com/repos/claviska/SimpleImage/zipball/226d507cca0c8400d69bee7eb324158e3cbe246e",
|
||||||
"reference": "82dbef988e356baa5d73993a1351bcb6c0959269",
|
"reference": "226d507cca0c8400d69bee7eb324158e3cbe246e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"league/color-extractor": "0.3.*",
|
"league/color-extractor": "0.4.*",
|
||||||
"php": ">=5.6.0"
|
"php": ">=8.0"
|
||||||
},
|
},
|
||||||
"time": "2022-12-12T14:31:53+00:00",
|
"require-dev": {
|
||||||
|
"laravel/pint": "^1.5",
|
||||||
|
"phpstan/phpstan": "^1.10"
|
||||||
|
},
|
||||||
|
"time": "2023-03-20T15:27:20+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -42,7 +46,7 @@
|
|||||||
"description": "A PHP class that makes working with images as simple as possible.",
|
"description": "A PHP class that makes working with images as simple as possible.",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/claviska/SimpleImage/issues",
|
"issues": "https://github.com/claviska/SimpleImage/issues",
|
||||||
"source": "https://github.com/claviska/SimpleImage/tree/3.7.2"
|
"source": "https://github.com/claviska/SimpleImage/tree/4.0.2"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -138,17 +142,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "filp/whoops",
|
"name": "filp/whoops",
|
||||||
"version": "2.14.6",
|
"version": "2.15.1",
|
||||||
"version_normalized": "2.14.6.0",
|
"version_normalized": "2.15.1.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/filp/whoops.git",
|
"url": "https://github.com/filp/whoops.git",
|
||||||
"reference": "f7948baaa0330277c729714910336383286305da"
|
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/filp/whoops/zipball/f7948baaa0330277c729714910336383286305da",
|
"url": "https://api.github.com/repos/filp/whoops/zipball/e864ac957acd66e1565f25efda61e37791a5db0b",
|
||||||
"reference": "f7948baaa0330277c729714910336383286305da",
|
"reference": "e864ac957acd66e1565f25efda61e37791a5db0b",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -164,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": "2022-11-02T16:23:29+00:00",
|
"time": "2023-03-06T18:09:13+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
@@ -200,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.14.6"
|
"source": "https://github.com/filp/whoops/tree/2.15.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -327,36 +331,39 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/color-extractor",
|
"name": "league/color-extractor",
|
||||||
"version": "0.3.2",
|
"version": "0.4.0",
|
||||||
"version_normalized": "0.3.2.0",
|
"version_normalized": "0.4.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/color-extractor.git",
|
"url": "https://github.com/thephpleague/color-extractor.git",
|
||||||
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806"
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/837086ec60f50c84c611c613963e4ad2e2aec806",
|
"url": "https://api.github.com/repos/thephpleague/color-extractor/zipball/21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
"reference": "837086ec60f50c84c611c613963e4ad2e2aec806",
|
"reference": "21fcac6249c5ef7d00eb83e128743ee6678fe505",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-gd": "*",
|
"ext-gd": "*",
|
||||||
"php": ">=5.4.0"
|
"php": "^7.3 || ^8.0"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"matthecat/colorextractor": "*"
|
"matthecat/colorextractor": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "~2",
|
"friendsofphp/php-cs-fixer": "~2",
|
||||||
"phpunit/phpunit": "~5"
|
"phpunit/phpunit": "^9.5"
|
||||||
},
|
},
|
||||||
"time": "2016-12-15T09:30:02+00:00",
|
"suggest": {
|
||||||
|
"ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons"
|
||||||
|
},
|
||||||
|
"time": "2022-09-24T15:57:16+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"": "src"
|
"League\\ColorExtractor\\": "src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
@@ -382,7 +389,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/thephpleague/color-extractor/issues",
|
"issues": "https://github.com/thephpleague/color-extractor/issues",
|
||||||
"source": "https://github.com/thephpleague/color-extractor/tree/master"
|
"source": "https://github.com/thephpleague/color-extractor/tree/0.4.0"
|
||||||
},
|
},
|
||||||
"install-path": "../league/color-extractor"
|
"install-path": "../league/color-extractor"
|
||||||
},
|
},
|
||||||
@@ -445,17 +452,17 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpmailer/phpmailer",
|
"name": "phpmailer/phpmailer",
|
||||||
"version": "v6.7.1",
|
"version": "v6.8.0",
|
||||||
"version_normalized": "6.7.1.0",
|
"version_normalized": "6.8.0.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55"
|
"reference": "df16b615e371d81fb79e506277faea67a1be18f1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/df16b615e371d81fb79e506277faea67a1be18f1",
|
||||||
"reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55",
|
"reference": "df16b615e371d81fb79e506277faea67a1be18f1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -484,7 +491,7 @@
|
|||||||
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
"symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)",
|
||||||
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
|
"thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication"
|
||||||
},
|
},
|
||||||
"time": "2022-12-08T13:30:06+00:00",
|
"time": "2023-03-06T14:43:22+00:00",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"installation-source": "dist",
|
"installation-source": "dist",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
@@ -516,7 +523,7 @@
|
|||||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
"issues": "https://github.com/PHPMailer/PHPMailer/issues",
|
||||||
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1"
|
"source": "https://github.com/PHPMailer/PHPMailer/tree/v6.8.0"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
|
32
kirby/vendor/composer/installed.php
vendored
32
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.2',
|
'pretty_version' => '3.9.3',
|
||||||
'version' => '3.9.2.0',
|
'version' => '3.9.3.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -11,9 +11,9 @@
|
|||||||
),
|
),
|
||||||
'versions' => array(
|
'versions' => array(
|
||||||
'claviska/simpleimage' => array(
|
'claviska/simpleimage' => array(
|
||||||
'pretty_version' => '3.7.2',
|
'pretty_version' => '4.0.2',
|
||||||
'version' => '3.7.2.0',
|
'version' => '4.0.2.0',
|
||||||
'reference' => '82dbef988e356baa5d73993a1351bcb6c0959269',
|
'reference' => '226d507cca0c8400d69bee7eb324158e3cbe246e',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../claviska/simpleimage',
|
'install_path' => __DIR__ . '/../claviska/simpleimage',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@@ -29,17 +29,17 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'filp/whoops' => array(
|
'filp/whoops' => array(
|
||||||
'pretty_version' => '2.14.6',
|
'pretty_version' => '2.15.1',
|
||||||
'version' => '2.14.6.0',
|
'version' => '2.15.1.0',
|
||||||
'reference' => 'f7948baaa0330277c729714910336383286305da',
|
'reference' => 'e864ac957acd66e1565f25efda61e37791a5db0b',
|
||||||
'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.2',
|
'pretty_version' => '3.9.3',
|
||||||
'version' => '3.9.2.0',
|
'version' => '3.9.3.0',
|
||||||
'reference' => NULL,
|
'reference' => NULL,
|
||||||
'type' => 'kirby-cms',
|
'type' => 'kirby-cms',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
@@ -65,9 +65,9 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'league/color-extractor' => array(
|
'league/color-extractor' => array(
|
||||||
'pretty_version' => '0.3.2',
|
'pretty_version' => '0.4.0',
|
||||||
'version' => '0.3.2.0',
|
'version' => '0.4.0.0',
|
||||||
'reference' => '837086ec60f50c84c611c613963e4ad2e2aec806',
|
'reference' => '21fcac6249c5ef7d00eb83e128743ee6678fe505',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../league/color-extractor',
|
'install_path' => __DIR__ . '/../league/color-extractor',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
@@ -89,9 +89,9 @@
|
|||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
'phpmailer/phpmailer' => array(
|
'phpmailer/phpmailer' => array(
|
||||||
'pretty_version' => 'v6.7.1',
|
'pretty_version' => 'v6.8.0',
|
||||||
'version' => '6.7.1.0',
|
'version' => '6.8.0.0',
|
||||||
'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55',
|
'reference' => 'df16b615e371d81fb79e506277faea67a1be18f1',
|
||||||
'type' => 'library',
|
'type' => 'library',
|
||||||
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
'install_path' => __DIR__ . '/../phpmailer/phpmailer',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
@@ -6,16 +6,19 @@
|
|||||||
|
|
||||||
namespace Whoops\Exception;
|
namespace Whoops\Exception;
|
||||||
|
|
||||||
|
use Whoops\Inspector\InspectorInterface;
|
||||||
|
|
||||||
class Formatter
|
class Formatter
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns all basic information about the exception in a simple array
|
* Returns all basic information about the exception in a simple array
|
||||||
* for further convertion to other languages
|
* for further convertion to other languages
|
||||||
* @param Inspector $inspector
|
* @param InspectorInterface $inspector
|
||||||
* @param bool $shouldAddTrace
|
* @param bool $shouldAddTrace
|
||||||
|
* @param array<callable> $frameFilters
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function formatExceptionAsDataArray(Inspector $inspector, $shouldAddTrace)
|
public static function formatExceptionAsDataArray(InspectorInterface $inspector, $shouldAddTrace, array $frameFilters = [])
|
||||||
{
|
{
|
||||||
$exception = $inspector->getException();
|
$exception = $inspector->getException();
|
||||||
$response = [
|
$response = [
|
||||||
@@ -27,7 +30,7 @@ class Formatter
|
|||||||
];
|
];
|
||||||
|
|
||||||
if ($shouldAddTrace) {
|
if ($shouldAddTrace) {
|
||||||
$frames = $inspector->getFrames();
|
$frames = $inspector->getFrames($frameFilters);
|
||||||
$frameData = [];
|
$frameData = [];
|
||||||
|
|
||||||
foreach ($frames as $frame) {
|
foreach ($frames as $frame) {
|
||||||
@@ -47,7 +50,7 @@ class Formatter
|
|||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function formatExceptionPlain(Inspector $inspector)
|
public static function formatExceptionPlain(InspectorInterface $inspector)
|
||||||
{
|
{
|
||||||
$message = $inspector->getException()->getMessage();
|
$message = $inspector->getException()->getMessage();
|
||||||
$frames = $inspector->getFrames();
|
$frames = $inspector->getFrames();
|
||||||
|
@@ -31,9 +31,6 @@ class Frame implements Serializable
|
|||||||
*/
|
*/
|
||||||
protected $application;
|
protected $application;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array[]
|
|
||||||
*/
|
|
||||||
public function __construct(array $frame)
|
public function __construct(array $frame)
|
||||||
{
|
{
|
||||||
$this->frame = $frame;
|
$this->frame = $frame;
|
||||||
|
@@ -25,9 +25,6 @@ class FrameCollection implements ArrayAccess, IteratorAggregate, Serializable, C
|
|||||||
*/
|
*/
|
||||||
private $frames;
|
private $frames;
|
||||||
|
|
||||||
/**
|
|
||||||
* @param array $frames
|
|
||||||
*/
|
|
||||||
public function __construct(array $frames)
|
public function __construct(array $frames)
|
||||||
{
|
{
|
||||||
$this->frames = array_map(function ($frame) {
|
$this->frames = array_map(function ($frame) {
|
||||||
|
@@ -6,9 +6,11 @@
|
|||||||
|
|
||||||
namespace Whoops\Exception;
|
namespace Whoops\Exception;
|
||||||
|
|
||||||
|
use Whoops\Inspector\InspectorFactory;
|
||||||
|
use Whoops\Inspector\InspectorInterface;
|
||||||
use Whoops\Util\Misc;
|
use Whoops\Util\Misc;
|
||||||
|
|
||||||
class Inspector
|
class Inspector implements InspectorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @var \Throwable
|
* @var \Throwable
|
||||||
@@ -31,11 +33,18 @@ class Inspector
|
|||||||
private $previousExceptions;
|
private $previousExceptions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \Throwable $exception The exception to inspect
|
* @var \Whoops\Inspector\InspectorFactoryInterface|null
|
||||||
*/
|
*/
|
||||||
public function __construct($exception)
|
protected $inspectorFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \Throwable $exception The exception to inspect
|
||||||
|
* @param \Whoops\Inspector\InspectorFactoryInterface $factory
|
||||||
|
*/
|
||||||
|
public function __construct($exception, $factory = null)
|
||||||
{
|
{
|
||||||
$this->exception = $exception;
|
$this->exception = $exception;
|
||||||
|
$this->inspectorFactory = $factory ?: new InspectorFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -137,7 +146,7 @@ class Inspector
|
|||||||
$previousException = $this->exception->getPrevious();
|
$previousException = $this->exception->getPrevious();
|
||||||
|
|
||||||
if ($previousException) {
|
if ($previousException) {
|
||||||
$this->previousExceptionInspector = new Inspector($previousException);
|
$this->previousExceptionInspector = $this->inspectorFactory->create($previousException);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,9 +176,12 @@ class Inspector
|
|||||||
/**
|
/**
|
||||||
* Returns an iterator for the inspected exception's
|
* Returns an iterator for the inspected exception's
|
||||||
* frames.
|
* frames.
|
||||||
|
*
|
||||||
|
* @param array<callable> $frameFilters
|
||||||
|
*
|
||||||
* @return \Whoops\Exception\FrameCollection
|
* @return \Whoops\Exception\FrameCollection
|
||||||
*/
|
*/
|
||||||
public function getFrames()
|
public function getFrames(array $frameFilters = [])
|
||||||
{
|
{
|
||||||
if ($this->frames === null) {
|
if ($this->frames === null) {
|
||||||
$frames = $this->getTrace($this->exception);
|
$frames = $this->getTrace($this->exception);
|
||||||
@@ -225,6 +237,13 @@ class Inspector
|
|||||||
$newFrames->prependFrames($outerFrames->topDiff($newFrames));
|
$newFrames->prependFrames($outerFrames->topDiff($newFrames));
|
||||||
$this->frames = $newFrames;
|
$this->frames = $newFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Apply frame filters callbacks on the frames stack
|
||||||
|
if (!empty($frameFilters)) {
|
||||||
|
foreach ($frameFilters as $filterCallback) {
|
||||||
|
$this->frames->filter($filterCallback);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->frames;
|
return $this->frames;
|
||||||
@@ -301,7 +320,6 @@ class Inspector
|
|||||||
* Determine if the frame can be used to fill in previous frame's missing info
|
* Determine if the frame can be used to fill in previous frame's missing info
|
||||||
* happens for call_user_func and call_user_func_array usages (PHP Bug #44428)
|
* happens for call_user_func and call_user_func_array usages (PHP Bug #44428)
|
||||||
*
|
*
|
||||||
* @param array $frame
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function isValidNextFrame(array $frame)
|
protected function isValidNextFrame(array $frame)
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace Whoops\Handler;
|
namespace Whoops\Handler;
|
||||||
|
|
||||||
use Whoops\Exception\Inspector;
|
use Whoops\Inspector\InspectorInterface;
|
||||||
use Whoops\RunInterface;
|
use Whoops\RunInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -36,7 +36,7 @@ abstract class Handler implements HandlerInterface
|
|||||||
private $run;
|
private $run;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var Inspector $inspector
|
* @var InspectorInterface $inspector
|
||||||
*/
|
*/
|
||||||
private $inspector;
|
private $inspector;
|
||||||
|
|
||||||
@@ -62,15 +62,15 @@ abstract class Handler implements HandlerInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Inspector $inspector
|
* @param InspectorInterface $inspector
|
||||||
*/
|
*/
|
||||||
public function setInspector(Inspector $inspector)
|
public function setInspector(InspectorInterface $inspector)
|
||||||
{
|
{
|
||||||
$this->inspector = $inspector;
|
$this->inspector = $inspector;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Inspector
|
* @return InspectorInterface
|
||||||
*/
|
*/
|
||||||
protected function getInspector()
|
protected function getInspector()
|
||||||
{
|
{
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
namespace Whoops\Handler;
|
namespace Whoops\Handler;
|
||||||
|
|
||||||
use Whoops\Exception\Inspector;
|
use Whoops\Inspector\InspectorInterface;
|
||||||
use Whoops\RunInterface;
|
use Whoops\RunInterface;
|
||||||
|
|
||||||
interface HandlerInterface
|
interface HandlerInterface
|
||||||
@@ -29,8 +29,8 @@ interface HandlerInterface
|
|||||||
public function setException($exception);
|
public function setException($exception);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Inspector $inspector
|
* @param InspectorInterface $inspector
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setInspector(Inspector $inspector);
|
public function setInspector(InspectorInterface $inspector);
|
||||||
}
|
}
|
||||||
|
@@ -60,7 +60,8 @@ class JsonResponseHandler extends Handler
|
|||||||
'errors' => [
|
'errors' => [
|
||||||
Formatter::formatExceptionAsDataArray(
|
Formatter::formatExceptionAsDataArray(
|
||||||
$this->getInspector(),
|
$this->getInspector(),
|
||||||
$this->addTraceToOutput()
|
$this->addTraceToOutput(),
|
||||||
|
$this->getRun()->getFrameFilters()
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
@@ -68,7 +69,8 @@ class JsonResponseHandler extends Handler
|
|||||||
$response = [
|
$response = [
|
||||||
'error' => Formatter::formatExceptionAsDataArray(
|
'error' => Formatter::formatExceptionAsDataArray(
|
||||||
$this->getInspector(),
|
$this->getInspector(),
|
||||||
$this->addTraceToOutput()
|
$this->addTraceToOutput(),
|
||||||
|
$this->getRun()->getFrameFilters()
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
@@ -282,7 +282,7 @@ class PlainTextHandler extends Handler
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
$inspector = $this->getInspector();
|
$inspector = $this->getInspector();
|
||||||
$frames = $inspector->getFrames();
|
$frames = $inspector->getFrames($this->getRun()->getFrameFilters());
|
||||||
|
|
||||||
$response = "\nStack trace:";
|
$response = "\nStack trace:";
|
||||||
|
|
||||||
|
@@ -287,6 +287,7 @@ class PrettyPageHandler extends Handler
|
|||||||
$vars["tables"] = array_merge($extraTables, $vars["tables"]);
|
$vars["tables"] = array_merge($extraTables, $vars["tables"]);
|
||||||
|
|
||||||
$plainTextHandler = new PlainTextHandler();
|
$plainTextHandler = new PlainTextHandler();
|
||||||
|
$plainTextHandler->setRun($this->getRun());
|
||||||
$plainTextHandler->setException($this->getException());
|
$plainTextHandler->setException($this->getException());
|
||||||
$plainTextHandler->setInspector($this->getInspector());
|
$plainTextHandler->setInspector($this->getInspector());
|
||||||
$vars["preface"] = "<!--\n\n\n" . $this->templateHelper->escape($plainTextHandler->generateResponse()) . "\n\n\n\n\n\n\n\n\n\n\n-->";
|
$vars["preface"] = "<!--\n\n\n" . $this->templateHelper->escape($plainTextHandler->generateResponse()) . "\n\n\n\n\n\n\n\n\n\n\n-->";
|
||||||
@@ -304,7 +305,7 @@ class PrettyPageHandler extends Handler
|
|||||||
*/
|
*/
|
||||||
protected function getExceptionFrames()
|
protected function getExceptionFrames()
|
||||||
{
|
{
|
||||||
$frames = $this->getInspector()->getFrames();
|
$frames = $this->getInspector()->getFrames($this->getRun()->getFrameFilters());
|
||||||
|
|
||||||
if ($this->getApplicationPaths()) {
|
if ($this->getApplicationPaths()) {
|
||||||
foreach ($frames as $frame) {
|
foreach ($frames as $frame) {
|
||||||
@@ -353,7 +354,6 @@ class PrettyPageHandler extends Handler
|
|||||||
* will be flattened with `print_r`.
|
* will be flattened with `print_r`.
|
||||||
*
|
*
|
||||||
* @param string $label
|
* @param string $label
|
||||||
* @param array $data
|
|
||||||
*
|
*
|
||||||
* @return static
|
* @return static
|
||||||
*/
|
*/
|
||||||
@@ -383,7 +383,7 @@ class PrettyPageHandler extends Handler
|
|||||||
throw new InvalidArgumentException('Expecting callback argument to be callable');
|
throw new InvalidArgumentException('Expecting callback argument to be callable');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->extraTables[$label] = function (\Whoops\Exception\Inspector $inspector = null) use ($callback) {
|
$this->extraTables[$label] = function (\Whoops\Inspector\InspectorInterface $inspector = null) use ($callback) {
|
||||||
try {
|
try {
|
||||||
$result = call_user_func($callback, $inspector);
|
$result = call_user_func($callback, $inspector);
|
||||||
|
|
||||||
@@ -755,11 +755,9 @@ class PrettyPageHandler extends Handler
|
|||||||
/**
|
/**
|
||||||
* Set the application paths.
|
* Set the application paths.
|
||||||
*
|
*
|
||||||
* @param array $applicationPaths
|
|
||||||
*
|
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setApplicationPaths($applicationPaths)
|
public function setApplicationPaths(array $applicationPaths)
|
||||||
{
|
{
|
||||||
$this->applicationPaths = $applicationPaths;
|
$this->applicationPaths = $applicationPaths;
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,8 @@ class XmlResponseHandler extends Handler
|
|||||||
$response = [
|
$response = [
|
||||||
'error' => Formatter::formatExceptionAsDataArray(
|
'error' => Formatter::formatExceptionAsDataArray(
|
||||||
$this->getInspector(),
|
$this->getInspector(),
|
||||||
$this->addTraceToOutput()
|
$this->addTraceToOutput(),
|
||||||
|
$this->getRun()->getFrameFilters()
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
21
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php
vendored
Normal file
21
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactory.php
vendored
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Whoops - php errors for cool kids
|
||||||
|
* @author Filipe Dobreira <http://github.com/filp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Whoops\Inspector;
|
||||||
|
|
||||||
|
use Whoops\Exception\Inspector;
|
||||||
|
|
||||||
|
class InspectorFactory implements InspectorFactoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param \Throwable $exception
|
||||||
|
* @return InspectorInterface
|
||||||
|
*/
|
||||||
|
public function create($exception)
|
||||||
|
{
|
||||||
|
return new Inspector($exception, $this);
|
||||||
|
}
|
||||||
|
}
|
16
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php
vendored
Normal file
16
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorFactoryInterface.php
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Whoops - php errors for cool kids
|
||||||
|
* @author Filipe Dobreira <http://github.com/filp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Whoops\Inspector;
|
||||||
|
|
||||||
|
interface InspectorFactoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param \Throwable $exception
|
||||||
|
* @return InspectorInterface
|
||||||
|
*/
|
||||||
|
public function create($exception);
|
||||||
|
}
|
71
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php
vendored
Normal file
71
kirby/vendor/filp/whoops/src/Whoops/Inspector/InspectorInterface.php
vendored
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Whoops - php errors for cool kids
|
||||||
|
* @author Filipe Dobreira <http://github.com/filp>
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Whoops\Inspector;
|
||||||
|
|
||||||
|
interface InspectorInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @return \Throwable
|
||||||
|
*/
|
||||||
|
public function getException();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getExceptionName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function getExceptionMessage();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string[]
|
||||||
|
*/
|
||||||
|
public function getPreviousExceptionMessages();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return int[]
|
||||||
|
*/
|
||||||
|
public function getPreviousExceptionCodes();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a url to the php-manual related to the underlying error - when available.
|
||||||
|
*
|
||||||
|
* @return string|null
|
||||||
|
*/
|
||||||
|
public function getExceptionDocrefUrl();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Does the wrapped Exception has a previous Exception?
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public function hasPreviousException();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an Inspector for a previous Exception, if any.
|
||||||
|
* @todo Clean this up a bit, cache stuff a bit better.
|
||||||
|
* @return InspectorInterface
|
||||||
|
*/
|
||||||
|
public function getPreviousExceptionInspector();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of all previous exceptions for this inspector's exception
|
||||||
|
* @return \Throwable[]
|
||||||
|
*/
|
||||||
|
public function getPreviousExceptions();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an iterator for the inspected exception's
|
||||||
|
* frames.
|
||||||
|
*
|
||||||
|
* @param array<callable> $frameFilters
|
||||||
|
*
|
||||||
|
* @return \Whoops\Exception\FrameCollection
|
||||||
|
*/
|
||||||
|
public function getFrames(array $frameFilters = []);
|
||||||
|
}
|
58
kirby/vendor/filp/whoops/src/Whoops/Run.php
vendored
58
kirby/vendor/filp/whoops/src/Whoops/Run.php
vendored
@@ -9,10 +9,13 @@ namespace Whoops;
|
|||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
use Whoops\Exception\ErrorException;
|
use Whoops\Exception\ErrorException;
|
||||||
use Whoops\Exception\Inspector;
|
|
||||||
use Whoops\Handler\CallbackHandler;
|
use Whoops\Handler\CallbackHandler;
|
||||||
use Whoops\Handler\Handler;
|
use Whoops\Handler\Handler;
|
||||||
use Whoops\Handler\HandlerInterface;
|
use Whoops\Handler\HandlerInterface;
|
||||||
|
use Whoops\Inspector\CallableInspectorFactory;
|
||||||
|
use Whoops\Inspector\InspectorFactory;
|
||||||
|
use Whoops\Inspector\InspectorFactoryInterface;
|
||||||
|
use Whoops\Inspector\InspectorInterface;
|
||||||
use Whoops\Util\Misc;
|
use Whoops\Util\Misc;
|
||||||
use Whoops\Util\SystemFacade;
|
use Whoops\Util\SystemFacade;
|
||||||
|
|
||||||
@@ -66,9 +69,22 @@ final class Run implements RunInterface
|
|||||||
*/
|
*/
|
||||||
private $canThrowExceptions = true;
|
private $canThrowExceptions = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The inspector factory to create inspectors.
|
||||||
|
*
|
||||||
|
* @var InspectorFactoryInterface
|
||||||
|
*/
|
||||||
|
private $inspectorFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var array<callable>
|
||||||
|
*/
|
||||||
|
private $frameFilters = [];
|
||||||
|
|
||||||
public function __construct(SystemFacade $system = null)
|
public function __construct(SystemFacade $system = null)
|
||||||
{
|
{
|
||||||
$this->system = $system ?: new SystemFacade;
|
$this->system = $system ?: new SystemFacade;
|
||||||
|
$this->inspectorFactory = new InspectorFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -165,6 +181,17 @@ final class Run implements RunInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getFrameFilters()
|
||||||
|
{
|
||||||
|
return $this->frameFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function clearFrameFilters()
|
||||||
|
{
|
||||||
|
$this->frameFilters = [];
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers this instance as an error handler.
|
* Registers this instance as an error handler.
|
||||||
*
|
*
|
||||||
@@ -179,6 +206,7 @@ final class Run implements RunInterface
|
|||||||
class_exists("\\Whoops\\Exception\\FrameCollection");
|
class_exists("\\Whoops\\Exception\\FrameCollection");
|
||||||
class_exists("\\Whoops\\Exception\\Frame");
|
class_exists("\\Whoops\\Exception\\Frame");
|
||||||
class_exists("\\Whoops\\Exception\\Inspector");
|
class_exists("\\Whoops\\Exception\\Inspector");
|
||||||
|
class_exists("\\Whoops\\Inspector\\InspectorFactory");
|
||||||
|
|
||||||
$this->system->setErrorHandler([$this, self::ERROR_HANDLER]);
|
$this->system->setErrorHandler([$this, self::ERROR_HANDLER]);
|
||||||
$this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]);
|
$this->system->setExceptionHandler([$this, self::EXCEPTION_HANDLER]);
|
||||||
@@ -488,14 +516,38 @@ final class Run implements RunInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param InspectorFactoryInterface $factory
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function setInspectorFactory(InspectorFactoryInterface $factory)
|
||||||
|
{
|
||||||
|
$this->inspectorFactory = $factory;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function addFrameFilter($filterCallback)
|
||||||
|
{
|
||||||
|
if (!is_callable($filterCallback)) {
|
||||||
|
throw new \InvalidArgumentException(sprintf(
|
||||||
|
"A frame filter must be of type callable, %s type given.",
|
||||||
|
gettype($filterCallback)
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->frameFilters[] = $filterCallback;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Throwable $exception
|
* @param Throwable $exception
|
||||||
*
|
*
|
||||||
* @return Inspector
|
* @return InspectorInterface
|
||||||
*/
|
*/
|
||||||
private function getInspector($exception)
|
private function getInspector($exception)
|
||||||
{
|
{
|
||||||
return new Inspector($exception);
|
return $this->inspectorFactory->create($exception);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -49,6 +49,16 @@ interface RunInterface
|
|||||||
*/
|
*/
|
||||||
public function clearHandlers();
|
public function clearHandlers();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return array<callable>
|
||||||
|
*/
|
||||||
|
public function getFrameFilters();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Run
|
||||||
|
*/
|
||||||
|
public function clearFrameFilters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registers this instance as an error handler.
|
* Registers this instance as an error handler.
|
||||||
*
|
*
|
||||||
@@ -137,4 +147,12 @@ interface RunInterface
|
|||||||
* Special case to deal with Fatal errors and the like.
|
* Special case to deal with Fatal errors and the like.
|
||||||
*/
|
*/
|
||||||
public function handleShutdown();
|
public function handleShutdown();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Registers a filter callback in the frame filters stack.
|
||||||
|
*
|
||||||
|
* @param callable $filterCallback
|
||||||
|
* @return \Whoops\Run
|
||||||
|
*/
|
||||||
|
public function addFrameFilter($filterCallback);
|
||||||
}
|
}
|
||||||
|
@@ -232,7 +232,6 @@ class TemplateHelper
|
|||||||
* passed to the template.
|
* passed to the template.
|
||||||
*
|
*
|
||||||
* @param string $template
|
* @param string $template
|
||||||
* @param array $additionalVariables
|
|
||||||
*/
|
*/
|
||||||
public function render($template, array $additionalVariables = null)
|
public function render($template, array $additionalVariables = null)
|
||||||
{
|
{
|
||||||
@@ -254,8 +253,6 @@ class TemplateHelper
|
|||||||
/**
|
/**
|
||||||
* Sets the variables to be passed to all templates rendered
|
* Sets the variables to be passed to all templates rendered
|
||||||
* by this template helper.
|
* by this template helper.
|
||||||
*
|
|
||||||
* @param array $variables
|
|
||||||
*/
|
*/
|
||||||
public function setVariables(array $variables)
|
public function setVariables(array $variables)
|
||||||
{
|
{
|
||||||
|
@@ -17,16 +17,24 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.4.0",
|
"php": "^7.3 || ^8.0",
|
||||||
"ext-gd": "*"
|
"ext-gd": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "~2",
|
"friendsofphp/php-cs-fixer": "~2",
|
||||||
"phpunit/phpunit": "~5"
|
"phpunit/phpunit": "^9.5"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-curl": "To download images from remote URLs if allow_url_fopen is disabled for security reasons"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"": "src"
|
"League\\ColorExtractor\\": "src"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoload-dev": {
|
||||||
|
"psr-4": {
|
||||||
|
"League\\ColorExtractor\\Tests\\": "tests"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,6 +25,10 @@ class ColorExtractor
|
|||||||
*/
|
*/
|
||||||
public function extract($colorCount = 1)
|
public function extract($colorCount = 1)
|
||||||
{
|
{
|
||||||
|
if ($colorCount === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->isInitialized()) {
|
if (!$this->isInitialized()) {
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
}
|
}
|
||||||
@@ -75,6 +79,9 @@ class ColorExtractor
|
|||||||
protected static function mergeColors(\SplFixedArray $colors, $limit, $maxDelta)
|
protected static function mergeColors(\SplFixedArray $colors, $limit, $maxDelta)
|
||||||
{
|
{
|
||||||
$limit = min(count($colors), $limit);
|
$limit = min(count($colors), $limit);
|
||||||
|
if ($limit === 0) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
if ($limit === 1) {
|
if ($limit === 1) {
|
||||||
return [$colors[0]];
|
return [$colors[0]];
|
||||||
}
|
}
|
@@ -2,34 +2,41 @@
|
|||||||
|
|
||||||
namespace League\ColorExtractor;
|
namespace League\ColorExtractor;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Palette implements \Countable, \IteratorAggregate
|
class Palette implements \Countable, \IteratorAggregate
|
||||||
{
|
{
|
||||||
/** @var array */
|
/**
|
||||||
protected $colors;
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $colors = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function count()
|
#[\ReturnTypeWillChange]
|
||||||
|
public function count(): int
|
||||||
{
|
{
|
||||||
return count($this->colors);
|
return count($this->colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return \ArrayIterator
|
* @return \Traversable
|
||||||
*/
|
*/
|
||||||
public function getIterator()
|
public function getIterator(): \Traversable
|
||||||
{
|
{
|
||||||
return new \ArrayIterator($this->colors);
|
return new \ArrayIterator($this->colors);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $color
|
|
||||||
*
|
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function getColorCount($color)
|
public function getColorCount($color)
|
||||||
{
|
{
|
||||||
|
if (!array_key_exists($color, $this->colors)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return $this->colors[$color];
|
return $this->colors[$color];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,10 +55,57 @@ class Palette implements \Countable, \IteratorAggregate
|
|||||||
* @param int|null $backgroundColor
|
* @param int|null $backgroundColor
|
||||||
*
|
*
|
||||||
* @return Palette
|
* @return Palette
|
||||||
|
*
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public static function fromFilename($filename, $backgroundColor = null)
|
public static function fromFilename($filename, $backgroundColor = null)
|
||||||
{
|
{
|
||||||
$image = imagecreatefromstring(file_get_contents($filename));
|
if (!is_readable($filename)) {
|
||||||
|
throw new \InvalidArgumentException('Filename must be a valid path and should be readable');
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::fromContents(file_get_contents($filename), $backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $url
|
||||||
|
* @param int|null $backgroundColor
|
||||||
|
*
|
||||||
|
* @return Palette
|
||||||
|
*
|
||||||
|
* @throws \RuntimeException
|
||||||
|
*/
|
||||||
|
public static function fromUrl($url, $backgroundColor = null)
|
||||||
|
{
|
||||||
|
if (!function_exists('curl_init')){
|
||||||
|
return self::fromContents(file_get_contents($url));
|
||||||
|
}
|
||||||
|
|
||||||
|
$ch = curl_init();
|
||||||
|
try {
|
||||||
|
curl_setopt($ch, CURLOPT_URL, $url);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
$contents = curl_exec($ch);
|
||||||
|
if ($contents === false) {
|
||||||
|
throw new \RuntimeException('Failed to fetch image from URL');
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
curl_close($ch);
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::fromContents($contents, $backgroundColor);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create instance with file contents
|
||||||
|
*
|
||||||
|
* @param string $contents
|
||||||
|
* @param int|null $backgroundColor
|
||||||
|
*
|
||||||
|
* @return Palette
|
||||||
|
*/
|
||||||
|
public static function fromContents($contents, $backgroundColor = null) {
|
||||||
|
$image = imagecreatefromstring($contents);
|
||||||
$palette = self::fromGD($image, $backgroundColor);
|
$palette = self::fromGD($image, $backgroundColor);
|
||||||
imagedestroy($image);
|
imagedestroy($image);
|
||||||
|
|
||||||
@@ -59,16 +113,16 @@ class Palette implements \Countable, \IteratorAggregate
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param resource $image
|
* @param \GDImage|resource $image
|
||||||
* @param int|null $backgroundColor
|
* @param int|null $backgroundColor
|
||||||
*
|
*
|
||||||
* @return Palette
|
* @return Palette
|
||||||
*
|
*
|
||||||
* @throws \InvalidArgumentException
|
* @throws \InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public static function fromGD($image, $backgroundColor = null)
|
public static function fromGD($image, ?int $backgroundColor = null)
|
||||||
{
|
{
|
||||||
if (!is_resource($image) || get_resource_type($image) != 'gd') {
|
if (!$image instanceof \GDImage && (!is_resource($image) || get_resource_type($image) !== 'gd')) {
|
||||||
throw new \InvalidArgumentException('Image must be a gd resource');
|
throw new \InvalidArgumentException('Image must be a gd resource');
|
||||||
}
|
}
|
||||||
if ($backgroundColor !== null && (!is_numeric($backgroundColor) || $backgroundColor < 0 || $backgroundColor > 16777215)) {
|
if ($backgroundColor !== null && (!is_numeric($backgroundColor) || $backgroundColor < 0 || $backgroundColor > 16777215)) {
|
@@ -4,24 +4,32 @@
|
|||||||
* Hindi PHPMailer language file: refer to English translation for definitive list
|
* Hindi PHPMailer language file: refer to English translation for definitive list
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author Yash Karanke <mr.karanke@gmail.com>
|
* @author Yash Karanke <mr.karanke@gmail.com>
|
||||||
|
* Rewrite and extension of the work by Jayanti Suthar <suthar.jayanti93@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
|
$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। ';
|
||||||
|
$PHPMAILER_LANG['buggy_php'] = 'PHP का आपका संस्करण एक बग से प्रभावित है जिसके परिणामस्वरूप संदेश दूषित हो सकते हैं. इसे ठीक करने हेतु, भेजने के लिए SMTP का उपयोग करे, अपने php.ini में mail.add_x_header विकल्प को अक्षम करें, MacOS या Linux पर जाए, या अपने PHP संस्करण को 7.0.17+ या 7.1.3+ बदले.';
|
||||||
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
|
$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। ';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
|
$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। ';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
|
$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। ';
|
||||||
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
|
$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। ';
|
||||||
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
|
$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। ';
|
||||||
|
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
|
||||||
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
|
$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
|
$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
|
$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
|
$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
|
$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। ';
|
||||||
|
$PHPMAILER_LANG['invalid_header'] = 'अमान्य हेडर नाम या मान';
|
||||||
|
$PHPMAILER_LANG['invalid_hostentry'] = 'अमान्य hostentry: ';
|
||||||
|
$PHPMAILER_LANG['invalid_host'] = 'अमान्य होस्ट: ';
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
|
$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। ';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
|
$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
|
$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। ';
|
||||||
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। ';
|
$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि: ';
|
||||||
|
$PHPMAILER_LANG['smtp_code'] = 'SMTP कोड: ';
|
||||||
|
$PHPMAILER_LANG['smtp_code_ex'] = 'अतिरिक्त SMTP जानकारी: ';
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। ';
|
||||||
|
$PHPMAILER_LANG['smtp_detail'] = 'विवरण: ';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
|
$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
|
$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: ';
|
|
||||||
|
247
kirby/vendor/phpmailer/phpmailer/src/DSNConfigurator.php
vendored
Normal file
247
kirby/vendor/phpmailer/phpmailer/src/DSNConfigurator.php
vendored
Normal file
@@ -0,0 +1,247 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PHPMailer - PHP email creation and transport class.
|
||||||
|
* PHP Version 5.5.
|
||||||
|
*
|
||||||
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
|
*
|
||||||
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
|
* @author Brent R. Matzelle (original founder)
|
||||||
|
* @copyright 2012 - 2023 Marcus Bointon
|
||||||
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
|
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
|
||||||
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure PHPMailer with DSN string.
|
||||||
|
*
|
||||||
|
* @see https://en.wikipedia.org/wiki/Data_source_name
|
||||||
|
*
|
||||||
|
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
|
||||||
|
*/
|
||||||
|
class DSNConfigurator
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Create new PHPMailer instance configured by DSN.
|
||||||
|
*
|
||||||
|
* @param string $dsn DSN
|
||||||
|
* @param bool $exceptions Should we throw external exceptions?
|
||||||
|
*
|
||||||
|
* @return PHPMailer
|
||||||
|
*/
|
||||||
|
public static function mailer($dsn, $exceptions = null)
|
||||||
|
{
|
||||||
|
static $configurator = null;
|
||||||
|
|
||||||
|
if (null === $configurator) {
|
||||||
|
$configurator = new DSNConfigurator();
|
||||||
|
}
|
||||||
|
|
||||||
|
return $configurator->configure(new PHPMailer($exceptions), $dsn);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure PHPMailer instance with DSN string.
|
||||||
|
*
|
||||||
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
|
* @param string $dsn DSN
|
||||||
|
*
|
||||||
|
* @return PHPMailer
|
||||||
|
*/
|
||||||
|
public function configure(PHPMailer $mailer, $dsn)
|
||||||
|
{
|
||||||
|
$config = $this->parseDSN($dsn);
|
||||||
|
|
||||||
|
$this->applyConfig($mailer, $config);
|
||||||
|
|
||||||
|
return $mailer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse DSN string.
|
||||||
|
*
|
||||||
|
* @param string $dsn DSN
|
||||||
|
*
|
||||||
|
* @throws Exception If DSN is malformed
|
||||||
|
*
|
||||||
|
* @return array Configuration
|
||||||
|
*/
|
||||||
|
private function parseDSN($dsn)
|
||||||
|
{
|
||||||
|
$config = $this->parseUrl($dsn);
|
||||||
|
|
||||||
|
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
|
||||||
|
throw new Exception(
|
||||||
|
sprintf('Malformed DSN: "%s".', $dsn)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($config['query'])) {
|
||||||
|
parse_str($config['query'], $config['query']);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $config;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Apply configuration to mailer.
|
||||||
|
*
|
||||||
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
|
* @param array $config Configuration
|
||||||
|
*
|
||||||
|
* @throws Exception If scheme is invalid
|
||||||
|
*/
|
||||||
|
private function applyConfig(PHPMailer $mailer, $config)
|
||||||
|
{
|
||||||
|
switch ($config['scheme']) {
|
||||||
|
case 'mail':
|
||||||
|
$mailer->isMail();
|
||||||
|
break;
|
||||||
|
case 'sendmail':
|
||||||
|
$mailer->isSendmail();
|
||||||
|
break;
|
||||||
|
case 'qmail':
|
||||||
|
$mailer->isQmail();
|
||||||
|
break;
|
||||||
|
case 'smtp':
|
||||||
|
case 'smtps':
|
||||||
|
$mailer->isSMTP();
|
||||||
|
$this->configureSMTP($mailer, $config);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Exception(
|
||||||
|
sprintf(
|
||||||
|
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
|
||||||
|
$config['scheme']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($config['query'])) {
|
||||||
|
$this->configureOptions($mailer, $config['query']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure SMTP.
|
||||||
|
*
|
||||||
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
|
* @param array $config Configuration
|
||||||
|
*/
|
||||||
|
private function configureSMTP($mailer, $config)
|
||||||
|
{
|
||||||
|
$isSMTPS = 'smtps' === $config['scheme'];
|
||||||
|
|
||||||
|
if ($isSMTPS) {
|
||||||
|
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mailer->Host = $config['host'];
|
||||||
|
|
||||||
|
if (isset($config['port'])) {
|
||||||
|
$mailer->Port = $config['port'];
|
||||||
|
} elseif ($isSMTPS) {
|
||||||
|
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
|
||||||
|
}
|
||||||
|
|
||||||
|
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
|
||||||
|
|
||||||
|
if (isset($config['user'])) {
|
||||||
|
$mailer->Username = $config['user'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($config['pass'])) {
|
||||||
|
$mailer->Password = $config['pass'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Configure options.
|
||||||
|
*
|
||||||
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
|
* @param array $options Options
|
||||||
|
*
|
||||||
|
* @throws Exception If option is unknown
|
||||||
|
*/
|
||||||
|
private function configureOptions(PHPMailer $mailer, $options)
|
||||||
|
{
|
||||||
|
$allowedOptions = get_object_vars($mailer);
|
||||||
|
|
||||||
|
unset($allowedOptions['Mailer']);
|
||||||
|
unset($allowedOptions['SMTPAuth']);
|
||||||
|
unset($allowedOptions['Username']);
|
||||||
|
unset($allowedOptions['Password']);
|
||||||
|
unset($allowedOptions['Hostname']);
|
||||||
|
unset($allowedOptions['Port']);
|
||||||
|
unset($allowedOptions['ErrorInfo']);
|
||||||
|
|
||||||
|
$allowedOptions = \array_keys($allowedOptions);
|
||||||
|
|
||||||
|
foreach ($options as $key => $value) {
|
||||||
|
if (!in_array($key, $allowedOptions)) {
|
||||||
|
throw new Exception(
|
||||||
|
sprintf(
|
||||||
|
'Unknown option: "%s". Allowed values: "%s"',
|
||||||
|
$key,
|
||||||
|
implode('", "', $allowedOptions)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ($key) {
|
||||||
|
case 'AllowEmpty':
|
||||||
|
case 'SMTPAutoTLS':
|
||||||
|
case 'SMTPKeepAlive':
|
||||||
|
case 'SingleTo':
|
||||||
|
case 'UseSendmailOptions':
|
||||||
|
case 'do_verp':
|
||||||
|
case 'DKIM_copyHeaderFields':
|
||||||
|
$mailer->$key = (bool) $value;
|
||||||
|
break;
|
||||||
|
case 'Priority':
|
||||||
|
case 'SMTPDebug':
|
||||||
|
case 'WordWrap':
|
||||||
|
$mailer->$key = (int) $value;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$mailer->$key = $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a URL.
|
||||||
|
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
|
||||||
|
*
|
||||||
|
* @param string $url URL
|
||||||
|
*
|
||||||
|
* @return array|false
|
||||||
|
*/
|
||||||
|
protected function parseUrl($url)
|
||||||
|
{
|
||||||
|
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
|
||||||
|
return parse_url($url);
|
||||||
|
}
|
||||||
|
|
||||||
|
$chunks = explode('?', $url);
|
||||||
|
if (is_array($chunks)) {
|
||||||
|
$result = parse_url($chunks[0]);
|
||||||
|
if (is_array($result)) {
|
||||||
|
$result['query'] = $chunks[1];
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
@@ -750,7 +750,7 @@ class PHPMailer
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.7.1';
|
const VERSION = '6.8.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error severity: message only, continue processing.
|
* Error severity: message only, continue processing.
|
||||||
@@ -2423,7 +2423,7 @@ class PHPMailer
|
|||||||
*/
|
*/
|
||||||
public function addrFormat($addr)
|
public function addrFormat($addr)
|
||||||
{
|
{
|
||||||
if (empty($addr[1])) { //No name provided
|
if (!isset($addr[1]) || ($addr[1] === '')) { //No name provided
|
||||||
return $this->secureHeader($addr[0]);
|
return $this->secureHeader($addr[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -46,7 +46,7 @@ class POP3
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.7.1';
|
const VERSION = '6.8.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default POP3 port number.
|
* Default POP3 port number.
|
||||||
|
10
kirby/vendor/phpmailer/phpmailer/src/SMTP.php
vendored
10
kirby/vendor/phpmailer/phpmailer/src/SMTP.php
vendored
@@ -35,7 +35,7 @@ class SMTP
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.7.1';
|
const VERSION = '6.8.0';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SMTP line break constant.
|
* SMTP line break constant.
|
||||||
@@ -51,6 +51,13 @@ class SMTP
|
|||||||
*/
|
*/
|
||||||
const DEFAULT_PORT = 25;
|
const DEFAULT_PORT = 25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The SMTPs port to use if one is not specified.
|
||||||
|
*
|
||||||
|
* @var int
|
||||||
|
*/
|
||||||
|
const DEFAULT_SECURE_PORT = 465;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
|
* The maximum line length allowed by RFC 5321 section 4.5.3.1.6,
|
||||||
* *excluding* a trailing CRLF break.
|
* *excluding* a trailing CRLF break.
|
||||||
@@ -187,6 +194,7 @@ class SMTP
|
|||||||
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
'SendGrid' => '/[\d]{3} Ok: queued as (.*)/',
|
||||||
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/',
|
||||||
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
|
'Haraka' => '/[\d]{3} Message Queued \((.*)\)/',
|
||||||
|
'ZoneMTA' => '/[\d]{3} Message queued as (.*)/',
|
||||||
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
'Mailjet' => '/[\d]{3} OK queued as (.*)/',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user