Ubuntu-Basis auf 24.04 pinnen (PHP2Shell-Fix, Kirby 4 braucht PHP <= 8.4)
ubuntu:latest ist inzwischen 26.04 mit PHP 8.5, das Kirby 4.6 nicht unterstuetzt. 24.04 liefert php8.3 8.3.6-0ubuntu0.24.04.13 mit dem Fix fuer CVE-2026-109618/-109619. Image neu bauen mit --pull. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# Use latest official Ubuntu image
|
# Ubuntu 24.04 LTS gepinnt: PHP 8.3 (Kirby 4 unterstuetzt max. PHP 8.4; ubuntu:latest liefert inzwischen 8.5)
|
||||||
FROM ubuntu:latest
|
FROM ubuntu:24.04
|
||||||
|
|
||||||
# Set timezone
|
# Set timezone
|
||||||
ENV TZ=Europe/Berlin
|
ENV TZ=Europe/Berlin
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
|
* Vietnamese (Tiếng Việt) PHPMailer language file: refer to English translation for definitive list.
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author VINADES.,JSC <contact@vinades.vn>
|
* @author VINADES.,JSC <contact@vinades.vn>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.';
|
$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.';
|
||||||
$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
|
$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.';
|
||||||
$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
|
$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.';
|
||||||
$PHPMAILER_LANG['empty_message'] = 'Không có nội dung';
|
$PHPMAILER_LANG['empty_message'] = 'Không có nội dung';
|
||||||
$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: ';
|
$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: ';
|
||||||
$PHPMAILER_LANG['execute'] = 'Không thực hiện được: ';
|
$PHPMAILER_LANG['execute'] = 'Không thực hiện được: ';
|
||||||
$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin ';
|
$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin ';
|
||||||
$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: ';
|
$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: ';
|
||||||
$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: ';
|
$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: ';
|
||||||
$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.';
|
$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.';
|
||||||
$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: ';
|
$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: ';
|
||||||
$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
|
$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.';
|
||||||
$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
|
$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.';
|
||||||
$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
|
$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: ';
|
||||||
$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: ';
|
$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: ';
|
||||||
$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp ';
|
$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp ';
|
||||||
$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: ';
|
$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: ';
|
||||||
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: ';
|
||||||
|
|||||||
+29
-29
@@ -1,29 +1,29 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list
|
* Traditional Chinese PHPMailer language file: refer to English translation for definitive list
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author liqwei <liqwei@liqwei.com>
|
* @author liqwei <liqwei@liqwei.com>
|
||||||
* @author Peter Dave Hello <@PeterDaveHello/>
|
* @author Peter Dave Hello <@PeterDaveHello/>
|
||||||
* @author Jason Chiang <xcojad@gmail.com>
|
* @author Jason Chiang <xcojad@gmail.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。';
|
$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。';
|
||||||
$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['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['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_connect_failed'] = 'SMTP 連線失敗';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: ';
|
$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: ';
|
||||||
$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: ';
|
$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: ';
|
||||||
$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: ';
|
$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: ';
|
||||||
|
|||||||
@@ -1,36 +1,36 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list
|
* Simplified Chinese PHPMailer language file: refer to English translation for definitive list
|
||||||
* @package PHPMailer
|
* @package PHPMailer
|
||||||
* @author liqwei <liqwei@liqwei.com>
|
* @author liqwei <liqwei@liqwei.com>
|
||||||
* @author young <masxy@foxmail.com>
|
* @author young <masxy@foxmail.com>
|
||||||
* @author Teddysun <i@teddysun.com>
|
* @author Teddysun <i@teddysun.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['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['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['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['smtp_connect_failed'] = 'SMTP服务器连接失败。';
|
$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。';
|
||||||
$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:';
|
$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:';
|
||||||
$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
|
$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:';
|
||||||
$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值';
|
$PHPMAILER_LANG['invalid_header'] = '无效的标题名称或值';
|
||||||
$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: ';
|
$PHPMAILER_LANG['invalid_hostentry'] = '无效的hostentry: ';
|
||||||
$PHPMAILER_LANG['invalid_host'] = '无效的主机:';
|
$PHPMAILER_LANG['invalid_host'] = '无效的主机:';
|
||||||
$PHPMAILER_LANG['signing'] = '签名错误:';
|
$PHPMAILER_LANG['signing'] = '签名错误:';
|
||||||
$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: ';
|
$PHPMAILER_LANG['smtp_code'] = 'SMTP代码: ';
|
||||||
$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: ';
|
$PHPMAILER_LANG['smtp_code_ex'] = '附加SMTP信息: ';
|
||||||
$PHPMAILER_LANG['smtp_detail'] = '详情:';
|
$PHPMAILER_LANG['smtp_detail'] = '详情:';
|
||||||
|
|||||||
+245
-245
@@ -1,245 +1,245 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer - PHP email creation and transport class.
|
* PHPMailer - PHP email creation and transport class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
*
|
*
|
||||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2023 Marcus Bointon
|
* @copyright 2012 - 2023 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PHPMailer\PHPMailer;
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure PHPMailer with DSN string.
|
* Configure PHPMailer with DSN string.
|
||||||
*
|
*
|
||||||
* @see https://en.wikipedia.org/wiki/Data_source_name
|
* @see https://en.wikipedia.org/wiki/Data_source_name
|
||||||
*
|
*
|
||||||
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
|
* @author Oleg Voronkovich <oleg-voronkovich@yandex.ru>
|
||||||
*/
|
*/
|
||||||
class DSNConfigurator
|
class DSNConfigurator
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create new PHPMailer instance configured by DSN.
|
* Create new PHPMailer instance configured by DSN.
|
||||||
*
|
*
|
||||||
* @param string $dsn DSN
|
* @param string $dsn DSN
|
||||||
* @param bool $exceptions Should we throw external exceptions?
|
* @param bool $exceptions Should we throw external exceptions?
|
||||||
*
|
*
|
||||||
* @return PHPMailer
|
* @return PHPMailer
|
||||||
*/
|
*/
|
||||||
public static function mailer($dsn, $exceptions = null)
|
public static function mailer($dsn, $exceptions = null)
|
||||||
{
|
{
|
||||||
static $configurator = null;
|
static $configurator = null;
|
||||||
|
|
||||||
if (null === $configurator) {
|
if (null === $configurator) {
|
||||||
$configurator = new DSNConfigurator();
|
$configurator = new DSNConfigurator();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $configurator->configure(new PHPMailer($exceptions), $dsn);
|
return $configurator->configure(new PHPMailer($exceptions), $dsn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure PHPMailer instance with DSN string.
|
* Configure PHPMailer instance with DSN string.
|
||||||
*
|
*
|
||||||
* @param PHPMailer $mailer PHPMailer instance
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
* @param string $dsn DSN
|
* @param string $dsn DSN
|
||||||
*
|
*
|
||||||
* @return PHPMailer
|
* @return PHPMailer
|
||||||
*/
|
*/
|
||||||
public function configure(PHPMailer $mailer, $dsn)
|
public function configure(PHPMailer $mailer, $dsn)
|
||||||
{
|
{
|
||||||
$config = $this->parseDSN($dsn);
|
$config = $this->parseDSN($dsn);
|
||||||
|
|
||||||
$this->applyConfig($mailer, $config);
|
$this->applyConfig($mailer, $config);
|
||||||
|
|
||||||
return $mailer;
|
return $mailer;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse DSN string.
|
* Parse DSN string.
|
||||||
*
|
*
|
||||||
* @param string $dsn DSN
|
* @param string $dsn DSN
|
||||||
*
|
*
|
||||||
* @throws Exception If DSN is malformed
|
* @throws Exception If DSN is malformed
|
||||||
*
|
*
|
||||||
* @return array Configuration
|
* @return array Configuration
|
||||||
*/
|
*/
|
||||||
private function parseDSN($dsn)
|
private function parseDSN($dsn)
|
||||||
{
|
{
|
||||||
$config = $this->parseUrl($dsn);
|
$config = $this->parseUrl($dsn);
|
||||||
|
|
||||||
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
|
if (false === $config || !isset($config['scheme']) || !isset($config['host'])) {
|
||||||
throw new Exception('Malformed DSN');
|
throw new Exception('Malformed DSN');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['query'])) {
|
if (isset($config['query'])) {
|
||||||
parse_str($config['query'], $config['query']);
|
parse_str($config['query'], $config['query']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $config;
|
return $config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply configuration to mailer.
|
* Apply configuration to mailer.
|
||||||
*
|
*
|
||||||
* @param PHPMailer $mailer PHPMailer instance
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
* @param array $config Configuration
|
* @param array $config Configuration
|
||||||
*
|
*
|
||||||
* @throws Exception If scheme is invalid
|
* @throws Exception If scheme is invalid
|
||||||
*/
|
*/
|
||||||
private function applyConfig(PHPMailer $mailer, $config)
|
private function applyConfig(PHPMailer $mailer, $config)
|
||||||
{
|
{
|
||||||
switch ($config['scheme']) {
|
switch ($config['scheme']) {
|
||||||
case 'mail':
|
case 'mail':
|
||||||
$mailer->isMail();
|
$mailer->isMail();
|
||||||
break;
|
break;
|
||||||
case 'sendmail':
|
case 'sendmail':
|
||||||
$mailer->isSendmail();
|
$mailer->isSendmail();
|
||||||
break;
|
break;
|
||||||
case 'qmail':
|
case 'qmail':
|
||||||
$mailer->isQmail();
|
$mailer->isQmail();
|
||||||
break;
|
break;
|
||||||
case 'smtp':
|
case 'smtp':
|
||||||
case 'smtps':
|
case 'smtps':
|
||||||
$mailer->isSMTP();
|
$mailer->isSMTP();
|
||||||
$this->configureSMTP($mailer, $config);
|
$this->configureSMTP($mailer, $config);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
|
'Invalid scheme: "%s". Allowed values: "mail", "sendmail", "qmail", "smtp", "smtps".',
|
||||||
$config['scheme']
|
$config['scheme']
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['query'])) {
|
if (isset($config['query'])) {
|
||||||
$this->configureOptions($mailer, $config['query']);
|
$this->configureOptions($mailer, $config['query']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure SMTP.
|
* Configure SMTP.
|
||||||
*
|
*
|
||||||
* @param PHPMailer $mailer PHPMailer instance
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
* @param array $config Configuration
|
* @param array $config Configuration
|
||||||
*/
|
*/
|
||||||
private function configureSMTP($mailer, $config)
|
private function configureSMTP($mailer, $config)
|
||||||
{
|
{
|
||||||
$isSMTPS = 'smtps' === $config['scheme'];
|
$isSMTPS = 'smtps' === $config['scheme'];
|
||||||
|
|
||||||
if ($isSMTPS) {
|
if ($isSMTPS) {
|
||||||
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
$mailer->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailer->Host = $config['host'];
|
$mailer->Host = $config['host'];
|
||||||
|
|
||||||
if (isset($config['port'])) {
|
if (isset($config['port'])) {
|
||||||
$mailer->Port = $config['port'];
|
$mailer->Port = $config['port'];
|
||||||
} elseif ($isSMTPS) {
|
} elseif ($isSMTPS) {
|
||||||
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
|
$mailer->Port = SMTP::DEFAULT_SECURE_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
|
$mailer->SMTPAuth = isset($config['user']) || isset($config['pass']);
|
||||||
|
|
||||||
if (isset($config['user'])) {
|
if (isset($config['user'])) {
|
||||||
$mailer->Username = $config['user'];
|
$mailer->Username = $config['user'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($config['pass'])) {
|
if (isset($config['pass'])) {
|
||||||
$mailer->Password = $config['pass'];
|
$mailer->Password = $config['pass'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configure options.
|
* Configure options.
|
||||||
*
|
*
|
||||||
* @param PHPMailer $mailer PHPMailer instance
|
* @param PHPMailer $mailer PHPMailer instance
|
||||||
* @param array $options Options
|
* @param array $options Options
|
||||||
*
|
*
|
||||||
* @throws Exception If option is unknown
|
* @throws Exception If option is unknown
|
||||||
*/
|
*/
|
||||||
private function configureOptions(PHPMailer $mailer, $options)
|
private function configureOptions(PHPMailer $mailer, $options)
|
||||||
{
|
{
|
||||||
$allowedOptions = get_object_vars($mailer);
|
$allowedOptions = get_object_vars($mailer);
|
||||||
|
|
||||||
unset($allowedOptions['Mailer']);
|
unset($allowedOptions['Mailer']);
|
||||||
unset($allowedOptions['SMTPAuth']);
|
unset($allowedOptions['SMTPAuth']);
|
||||||
unset($allowedOptions['Username']);
|
unset($allowedOptions['Username']);
|
||||||
unset($allowedOptions['Password']);
|
unset($allowedOptions['Password']);
|
||||||
unset($allowedOptions['Hostname']);
|
unset($allowedOptions['Hostname']);
|
||||||
unset($allowedOptions['Port']);
|
unset($allowedOptions['Port']);
|
||||||
unset($allowedOptions['ErrorInfo']);
|
unset($allowedOptions['ErrorInfo']);
|
||||||
|
|
||||||
$allowedOptions = \array_keys($allowedOptions);
|
$allowedOptions = \array_keys($allowedOptions);
|
||||||
|
|
||||||
foreach ($options as $key => $value) {
|
foreach ($options as $key => $value) {
|
||||||
if (!in_array($key, $allowedOptions)) {
|
if (!in_array($key, $allowedOptions)) {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
sprintf(
|
sprintf(
|
||||||
'Unknown option: "%s". Allowed values: "%s"',
|
'Unknown option: "%s". Allowed values: "%s"',
|
||||||
$key,
|
$key,
|
||||||
implode('", "', $allowedOptions)
|
implode('", "', $allowedOptions)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($key) {
|
switch ($key) {
|
||||||
case 'AllowEmpty':
|
case 'AllowEmpty':
|
||||||
case 'SMTPAutoTLS':
|
case 'SMTPAutoTLS':
|
||||||
case 'SMTPKeepAlive':
|
case 'SMTPKeepAlive':
|
||||||
case 'SingleTo':
|
case 'SingleTo':
|
||||||
case 'UseSendmailOptions':
|
case 'UseSendmailOptions':
|
||||||
case 'do_verp':
|
case 'do_verp':
|
||||||
case 'DKIM_copyHeaderFields':
|
case 'DKIM_copyHeaderFields':
|
||||||
$mailer->$key = (bool) $value;
|
$mailer->$key = (bool) $value;
|
||||||
break;
|
break;
|
||||||
case 'Priority':
|
case 'Priority':
|
||||||
case 'SMTPDebug':
|
case 'SMTPDebug':
|
||||||
case 'WordWrap':
|
case 'WordWrap':
|
||||||
$mailer->$key = (int) $value;
|
$mailer->$key = (int) $value;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$mailer->$key = $value;
|
$mailer->$key = $value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse a URL.
|
* Parse a URL.
|
||||||
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
|
* Wrapper for the built-in parse_url function to work around a bug in PHP 5.5.
|
||||||
*
|
*
|
||||||
* @param string $url URL
|
* @param string $url URL
|
||||||
*
|
*
|
||||||
* @return array|false
|
* @return array|false
|
||||||
*/
|
*/
|
||||||
protected function parseUrl($url)
|
protected function parseUrl($url)
|
||||||
{
|
{
|
||||||
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
|
if (\PHP_VERSION_ID >= 50600 || false === strpos($url, '?')) {
|
||||||
return parse_url($url);
|
return parse_url($url);
|
||||||
}
|
}
|
||||||
|
|
||||||
$chunks = explode('?', $url);
|
$chunks = explode('?', $url);
|
||||||
if (is_array($chunks)) {
|
if (is_array($chunks)) {
|
||||||
$result = parse_url($chunks[0]);
|
$result = parse_url($chunks[0]);
|
||||||
if (is_array($result)) {
|
if (is_array($result)) {
|
||||||
$result['query'] = $chunks[1];
|
$result['query'] = $chunks[1];
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-40
@@ -1,40 +1,40 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer Exception class.
|
* PHPMailer Exception class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
*
|
*
|
||||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PHPMailer\PHPMailer;
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer exception handler.
|
* PHPMailer exception handler.
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
class Exception extends \Exception
|
class Exception extends \Exception
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Prettify error message output.
|
* Prettify error message output.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function errorMessage()
|
public function errorMessage()
|
||||||
{
|
{
|
||||||
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
return '<strong>' . htmlspecialchars($this->getMessage(), ENT_COMPAT | ENT_HTML401) . "</strong><br />\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+139
-139
@@ -1,139 +1,139 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer - PHP email creation and transport class.
|
* PHPMailer - PHP email creation and transport class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
*
|
*
|
||||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PHPMailer\PHPMailer;
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
use League\OAuth2\Client\Grant\RefreshToken;
|
use League\OAuth2\Client\Grant\RefreshToken;
|
||||||
use League\OAuth2\Client\Provider\AbstractProvider;
|
use League\OAuth2\Client\Provider\AbstractProvider;
|
||||||
use League\OAuth2\Client\Token\AccessToken;
|
use League\OAuth2\Client\Token\AccessToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAuth - OAuth2 authentication wrapper class.
|
* OAuth - OAuth2 authentication wrapper class.
|
||||||
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
* Uses the oauth2-client package from the League of Extraordinary Packages.
|
||||||
*
|
*
|
||||||
* @see https://oauth2-client.thephpleague.com
|
* @see https://oauth2-client.thephpleague.com
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
class OAuth implements OAuthTokenProvider
|
class OAuth implements OAuthTokenProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* An instance of the League OAuth Client Provider.
|
* An instance of the League OAuth Client Provider.
|
||||||
*
|
*
|
||||||
* @var AbstractProvider
|
* @var AbstractProvider
|
||||||
*/
|
*/
|
||||||
protected $provider;
|
protected $provider;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current OAuth access token.
|
* The current OAuth access token.
|
||||||
*
|
*
|
||||||
* @var AccessToken
|
* @var AccessToken
|
||||||
*/
|
*/
|
||||||
protected $oauthToken;
|
protected $oauthToken;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The user's email address, usually used as the login ID
|
* The user's email address, usually used as the login ID
|
||||||
* and also the from address when sending email.
|
* and also the from address when sending email.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $oauthUserEmail = '';
|
protected $oauthUserEmail = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client secret, generated in the app definition of the service you're connecting to.
|
* The client secret, generated in the app definition of the service you're connecting to.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $oauthClientSecret = '';
|
protected $oauthClientSecret = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The client ID, generated in the app definition of the service you're connecting to.
|
* The client ID, generated in the app definition of the service you're connecting to.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $oauthClientId = '';
|
protected $oauthClientId = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The refresh token, used to obtain new AccessTokens.
|
* The refresh token, used to obtain new AccessTokens.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $oauthRefreshToken = '';
|
protected $oauthRefreshToken = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAuth constructor.
|
* OAuth constructor.
|
||||||
*
|
*
|
||||||
* @param array $options Associative array containing
|
* @param array $options Associative array containing
|
||||||
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
|
* `provider`, `userName`, `clientSecret`, `clientId` and `refreshToken` elements
|
||||||
*/
|
*/
|
||||||
public function __construct($options)
|
public function __construct($options)
|
||||||
{
|
{
|
||||||
$this->provider = $options['provider'];
|
$this->provider = $options['provider'];
|
||||||
$this->oauthUserEmail = $options['userName'];
|
$this->oauthUserEmail = $options['userName'];
|
||||||
$this->oauthClientSecret = $options['clientSecret'];
|
$this->oauthClientSecret = $options['clientSecret'];
|
||||||
$this->oauthClientId = $options['clientId'];
|
$this->oauthClientId = $options['clientId'];
|
||||||
$this->oauthRefreshToken = $options['refreshToken'];
|
$this->oauthRefreshToken = $options['refreshToken'];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a new RefreshToken.
|
* Get a new RefreshToken.
|
||||||
*
|
*
|
||||||
* @return RefreshToken
|
* @return RefreshToken
|
||||||
*/
|
*/
|
||||||
protected function getGrant()
|
protected function getGrant()
|
||||||
{
|
{
|
||||||
return new RefreshToken();
|
return new RefreshToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a new AccessToken.
|
* Get a new AccessToken.
|
||||||
*
|
*
|
||||||
* @return AccessToken
|
* @return AccessToken
|
||||||
*/
|
*/
|
||||||
protected function getToken()
|
protected function getToken()
|
||||||
{
|
{
|
||||||
return $this->provider->getAccessToken(
|
return $this->provider->getAccessToken(
|
||||||
$this->getGrant(),
|
$this->getGrant(),
|
||||||
['refresh_token' => $this->oauthRefreshToken]
|
['refresh_token' => $this->oauthRefreshToken]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a base64-encoded OAuth token.
|
* Generate a base64-encoded OAuth token.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getOauth64()
|
public function getOauth64()
|
||||||
{
|
{
|
||||||
//Get a new token if it's not available or has expired
|
//Get a new token if it's not available or has expired
|
||||||
if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
|
if (null === $this->oauthToken || $this->oauthToken->hasExpired()) {
|
||||||
$this->oauthToken = $this->getToken();
|
$this->oauthToken = $this->getToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
return base64_encode(
|
return base64_encode(
|
||||||
'user=' .
|
'user=' .
|
||||||
$this->oauthUserEmail .
|
$this->oauthUserEmail .
|
||||||
"\001auth=Bearer " .
|
"\001auth=Bearer " .
|
||||||
$this->oauthToken .
|
$this->oauthToken .
|
||||||
"\001\001"
|
"\001\001"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+44
-44
@@ -1,44 +1,44 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer - PHP email creation and transport class.
|
* PHPMailer - PHP email creation and transport class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
*
|
*
|
||||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PHPMailer\PHPMailer;
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* OAuthTokenProvider - OAuth2 token provider interface.
|
* OAuthTokenProvider - OAuth2 token provider interface.
|
||||||
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
|
* Provides base64 encoded OAuth2 auth strings for SMTP authentication.
|
||||||
*
|
*
|
||||||
* @see OAuth
|
* @see OAuth
|
||||||
* @see SMTP::authenticate()
|
* @see SMTP::authenticate()
|
||||||
*
|
*
|
||||||
* @author Peter Scopes (pdscopes)
|
* @author Peter Scopes (pdscopes)
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
*/
|
*/
|
||||||
interface OAuthTokenProvider
|
interface OAuthTokenProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
|
* Generate a base64-encoded OAuth token ensuring that the access token has not expired.
|
||||||
* The string to be base 64 encoded should be in the form:
|
* The string to be base 64 encoded should be in the form:
|
||||||
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
|
* "user=<user_email_address>\001auth=Bearer <access_token>\001\001"
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getOauth64();
|
public function getOauth64();
|
||||||
}
|
}
|
||||||
|
|||||||
+5248
-5248
File diff suppressed because it is too large
Load Diff
+469
-469
@@ -1,469 +1,469 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer POP-Before-SMTP Authentication Class.
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
* PHP Version 5.5.
|
* PHP Version 5.5.
|
||||||
*
|
*
|
||||||
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
* @see https://github.com/PHPMailer/PHPMailer/ The PHPMailer GitHub project
|
||||||
*
|
*
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
* @author Brent R. Matzelle (original founder)
|
* @author Brent R. Matzelle (original founder)
|
||||||
* @copyright 2012 - 2020 Marcus Bointon
|
* @copyright 2012 - 2020 Marcus Bointon
|
||||||
* @copyright 2010 - 2012 Jim Jagielski
|
* @copyright 2010 - 2012 Jim Jagielski
|
||||||
* @copyright 2004 - 2009 Andy Prevost
|
* @copyright 2004 - 2009 Andy Prevost
|
||||||
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
* @license https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html GNU Lesser General Public License
|
||||||
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
* @note This program is distributed in the hope that it will be useful - WITHOUT
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE.
|
* FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace PHPMailer\PHPMailer;
|
namespace PHPMailer\PHPMailer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PHPMailer POP-Before-SMTP Authentication Class.
|
* PHPMailer POP-Before-SMTP Authentication Class.
|
||||||
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
|
* Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication.
|
||||||
* 1) This class does not support APOP authentication.
|
* 1) This class does not support APOP authentication.
|
||||||
* 2) Opening and closing lots of POP3 connections can be quite slow. If you need
|
* 2) Opening and closing lots of POP3 connections can be quite slow. If you need
|
||||||
* to send a batch of emails then just perform the authentication once at the start,
|
* to send a batch of emails then just perform the authentication once at the start,
|
||||||
* and then loop through your mail sending script. Providing this process doesn't
|
* and then loop through your mail sending script. Providing this process doesn't
|
||||||
* take longer than the verification period lasts on your POP3 server, you should be fine.
|
* take longer than the verification period lasts on your POP3 server, you should be fine.
|
||||||
* 3) This is really ancient technology; you should only need to use it to talk to very old systems.
|
* 3) This is really ancient technology; you should only need to use it to talk to very old systems.
|
||||||
* 4) This POP3 class is deliberately lightweight and incomplete, implementing just
|
* 4) This POP3 class is deliberately lightweight and incomplete, implementing just
|
||||||
* enough to do authentication.
|
* enough to do authentication.
|
||||||
* If you want a more complete class there are other POP3 classes for PHP available.
|
* If you want a more complete class there are other POP3 classes for PHP available.
|
||||||
*
|
*
|
||||||
* @author Richard Davey (original author) <rich@corephp.co.uk>
|
* @author Richard Davey (original author) <rich@corephp.co.uk>
|
||||||
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
* @author Marcus Bointon (Synchro/coolbru) <phpmailer@synchromedia.co.uk>
|
||||||
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
* @author Jim Jagielski (jimjag) <jimjag@gmail.com>
|
||||||
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
* @author Andy Prevost (codeworxtech) <codeworxtech@users.sourceforge.net>
|
||||||
*/
|
*/
|
||||||
class POP3
|
class POP3
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The POP3 PHPMailer Version number.
|
* The POP3 PHPMailer Version number.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
const VERSION = '6.9.3';
|
const VERSION = '6.9.3';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default POP3 port number.
|
* Default POP3 port number.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEFAULT_PORT = 110;
|
const DEFAULT_PORT = 110;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default timeout in seconds.
|
* Default timeout in seconds.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEFAULT_TIMEOUT = 30;
|
const DEFAULT_TIMEOUT = 30;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 class debug output mode.
|
* POP3 class debug output mode.
|
||||||
* Debug output level.
|
* Debug output level.
|
||||||
* Options:
|
* Options:
|
||||||
* @see POP3::DEBUG_OFF: No output
|
* @see POP3::DEBUG_OFF: No output
|
||||||
* @see POP3::DEBUG_SERVER: Server messages, connection/server errors
|
* @see POP3::DEBUG_SERVER: Server messages, connection/server errors
|
||||||
* @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors
|
* @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $do_debug = self::DEBUG_OFF;
|
public $do_debug = self::DEBUG_OFF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 mail server hostname.
|
* POP3 mail server hostname.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $host;
|
public $host;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 port number.
|
* POP3 port number.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $port;
|
public $port;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 Timeout Value in seconds.
|
* POP3 Timeout Value in seconds.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
public $tval;
|
public $tval;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 username.
|
* POP3 username.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $username;
|
public $username;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 password.
|
* POP3 password.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $password;
|
public $password;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource handle for the POP3 connection socket.
|
* Resource handle for the POP3 connection socket.
|
||||||
*
|
*
|
||||||
* @var resource
|
* @var resource
|
||||||
*/
|
*/
|
||||||
protected $pop_conn;
|
protected $pop_conn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Are we connected?
|
* Are we connected?
|
||||||
*
|
*
|
||||||
* @var bool
|
* @var bool
|
||||||
*/
|
*/
|
||||||
protected $connected = false;
|
protected $connected = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Error container.
|
* Error container.
|
||||||
*
|
*
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $errors = [];
|
protected $errors = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Line break constant.
|
* Line break constant.
|
||||||
*/
|
*/
|
||||||
const LE = "\r\n";
|
const LE = "\r\n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level for no output.
|
* Debug level for no output.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEBUG_OFF = 0;
|
const DEBUG_OFF = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show server -> client messages
|
* Debug level to show server -> client messages
|
||||||
* also shows clients connection errors or errors from server
|
* also shows clients connection errors or errors from server
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEBUG_SERVER = 1;
|
const DEBUG_SERVER = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Debug level to show client -> server and server -> client messages.
|
* Debug level to show client -> server and server -> client messages.
|
||||||
*
|
*
|
||||||
* @var int
|
* @var int
|
||||||
*/
|
*/
|
||||||
const DEBUG_CLIENT = 2;
|
const DEBUG_CLIENT = 2;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Simple static wrapper for all-in-one POP before SMTP.
|
* Simple static wrapper for all-in-one POP before SMTP.
|
||||||
*
|
*
|
||||||
* @param string $host The hostname to connect to
|
* @param string $host The hostname to connect to
|
||||||
* @param int|bool $port The port number to connect to
|
* @param int|bool $port The port number to connect to
|
||||||
* @param int|bool $timeout The timeout value
|
* @param int|bool $timeout The timeout value
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @param string $password
|
||||||
* @param int $debug_level
|
* @param int $debug_level
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function popBeforeSmtp(
|
public static function popBeforeSmtp(
|
||||||
$host,
|
$host,
|
||||||
$port = false,
|
$port = false,
|
||||||
$timeout = false,
|
$timeout = false,
|
||||||
$username = '',
|
$username = '',
|
||||||
$password = '',
|
$password = '',
|
||||||
$debug_level = 0
|
$debug_level = 0
|
||||||
) {
|
) {
|
||||||
$pop = new self();
|
$pop = new self();
|
||||||
|
|
||||||
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
|
return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Authenticate with a POP3 server.
|
* Authenticate with a POP3 server.
|
||||||
* A connect, login, disconnect sequence
|
* A connect, login, disconnect sequence
|
||||||
* appropriate for POP-before SMTP authorisation.
|
* appropriate for POP-before SMTP authorisation.
|
||||||
*
|
*
|
||||||
* @param string $host The hostname to connect to
|
* @param string $host The hostname to connect to
|
||||||
* @param int|bool $port The port number to connect to
|
* @param int|bool $port The port number to connect to
|
||||||
* @param int|bool $timeout The timeout value
|
* @param int|bool $timeout The timeout value
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @param string $password
|
||||||
* @param int $debug_level
|
* @param int $debug_level
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0)
|
||||||
{
|
{
|
||||||
$this->host = $host;
|
$this->host = $host;
|
||||||
//If no port value provided, use default
|
//If no port value provided, use default
|
||||||
if (false === $port) {
|
if (false === $port) {
|
||||||
$this->port = static::DEFAULT_PORT;
|
$this->port = static::DEFAULT_PORT;
|
||||||
} else {
|
} else {
|
||||||
$this->port = (int) $port;
|
$this->port = (int) $port;
|
||||||
}
|
}
|
||||||
//If no timeout value provided, use default
|
//If no timeout value provided, use default
|
||||||
if (false === $timeout) {
|
if (false === $timeout) {
|
||||||
$this->tval = static::DEFAULT_TIMEOUT;
|
$this->tval = static::DEFAULT_TIMEOUT;
|
||||||
} else {
|
} else {
|
||||||
$this->tval = (int) $timeout;
|
$this->tval = (int) $timeout;
|
||||||
}
|
}
|
||||||
$this->do_debug = $debug_level;
|
$this->do_debug = $debug_level;
|
||||||
$this->username = $username;
|
$this->username = $username;
|
||||||
$this->password = $password;
|
$this->password = $password;
|
||||||
//Reset the error log
|
//Reset the error log
|
||||||
$this->errors = [];
|
$this->errors = [];
|
||||||
//Connect
|
//Connect
|
||||||
$result = $this->connect($this->host, $this->port, $this->tval);
|
$result = $this->connect($this->host, $this->port, $this->tval);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
$login_result = $this->login($this->username, $this->password);
|
$login_result = $this->login($this->username, $this->password);
|
||||||
if ($login_result) {
|
if ($login_result) {
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//We need to disconnect regardless of whether the login succeeded
|
//We need to disconnect regardless of whether the login succeeded
|
||||||
$this->disconnect();
|
$this->disconnect();
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to a POP3 server.
|
* Connect to a POP3 server.
|
||||||
*
|
*
|
||||||
* @param string $host
|
* @param string $host
|
||||||
* @param int|bool $port
|
* @param int|bool $port
|
||||||
* @param int $tval
|
* @param int $tval
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function connect($host, $port = false, $tval = 30)
|
public function connect($host, $port = false, $tval = 30)
|
||||||
{
|
{
|
||||||
//Are we already connected?
|
//Are we already connected?
|
||||||
if ($this->connected) {
|
if ($this->connected) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
//On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
||||||
//Rather than suppress it with @fsockopen, capture it cleanly instead
|
//Rather than suppress it with @fsockopen, capture it cleanly instead
|
||||||
set_error_handler(function () {
|
set_error_handler(function () {
|
||||||
call_user_func_array([$this, 'catchWarning'], func_get_args());
|
call_user_func_array([$this, 'catchWarning'], func_get_args());
|
||||||
});
|
});
|
||||||
|
|
||||||
if (false === $port) {
|
if (false === $port) {
|
||||||
$port = static::DEFAULT_PORT;
|
$port = static::DEFAULT_PORT;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Connect to the POP3 server
|
//Connect to the POP3 server
|
||||||
$errno = 0;
|
$errno = 0;
|
||||||
$errstr = '';
|
$errstr = '';
|
||||||
$this->pop_conn = fsockopen(
|
$this->pop_conn = fsockopen(
|
||||||
$host, //POP3 Host
|
$host, //POP3 Host
|
||||||
$port, //Port #
|
$port, //Port #
|
||||||
$errno, //Error Number
|
$errno, //Error Number
|
||||||
$errstr, //Error Message
|
$errstr, //Error Message
|
||||||
$tval
|
$tval
|
||||||
); //Timeout (seconds)
|
); //Timeout (seconds)
|
||||||
//Restore the error handler
|
//Restore the error handler
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
|
|
||||||
//Did we connect?
|
//Did we connect?
|
||||||
if (false === $this->pop_conn) {
|
if (false === $this->pop_conn) {
|
||||||
//It would appear not...
|
//It would appear not...
|
||||||
$this->setError(
|
$this->setError(
|
||||||
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
|
"Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr"
|
||||||
);
|
);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Increase the stream time-out
|
//Increase the stream time-out
|
||||||
stream_set_timeout($this->pop_conn, $tval, 0);
|
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||||
|
|
||||||
//Get the POP3 server response
|
//Get the POP3 server response
|
||||||
$pop3_response = $this->getResponse();
|
$pop3_response = $this->getResponse();
|
||||||
//Check for the +OK
|
//Check for the +OK
|
||||||
if ($this->checkResponse($pop3_response)) {
|
if ($this->checkResponse($pop3_response)) {
|
||||||
//The connection is established and the POP3 server is talking
|
//The connection is established and the POP3 server is talking
|
||||||
$this->connected = true;
|
$this->connected = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Log in to the POP3 server.
|
* Log in to the POP3 server.
|
||||||
* Does not support APOP (RFC 2828, 4949).
|
* Does not support APOP (RFC 2828, 4949).
|
||||||
*
|
*
|
||||||
* @param string $username
|
* @param string $username
|
||||||
* @param string $password
|
* @param string $password
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function login($username = '', $password = '')
|
public function login($username = '', $password = '')
|
||||||
{
|
{
|
||||||
if (!$this->connected) {
|
if (!$this->connected) {
|
||||||
$this->setError('Not connected to POP3 server');
|
$this->setError('Not connected to POP3 server');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (empty($username)) {
|
if (empty($username)) {
|
||||||
$username = $this->username;
|
$username = $this->username;
|
||||||
}
|
}
|
||||||
if (empty($password)) {
|
if (empty($password)) {
|
||||||
$password = $this->password;
|
$password = $this->password;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Send the Username
|
//Send the Username
|
||||||
$this->sendString("USER $username" . static::LE);
|
$this->sendString("USER $username" . static::LE);
|
||||||
$pop3_response = $this->getResponse();
|
$pop3_response = $this->getResponse();
|
||||||
if ($this->checkResponse($pop3_response)) {
|
if ($this->checkResponse($pop3_response)) {
|
||||||
//Send the Password
|
//Send the Password
|
||||||
$this->sendString("PASS $password" . static::LE);
|
$this->sendString("PASS $password" . static::LE);
|
||||||
$pop3_response = $this->getResponse();
|
$pop3_response = $this->getResponse();
|
||||||
if ($this->checkResponse($pop3_response)) {
|
if ($this->checkResponse($pop3_response)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disconnect from the POP3 server.
|
* Disconnect from the POP3 server.
|
||||||
*/
|
*/
|
||||||
public function disconnect()
|
public function disconnect()
|
||||||
{
|
{
|
||||||
// If could not connect at all, no need to disconnect
|
// If could not connect at all, no need to disconnect
|
||||||
if ($this->pop_conn === false) {
|
if ($this->pop_conn === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sendString('QUIT' . static::LE);
|
$this->sendString('QUIT' . static::LE);
|
||||||
|
|
||||||
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
|
// RFC 1939 shows POP3 server sending a +OK response to the QUIT command.
|
||||||
// Try to get it. Ignore any failures here.
|
// Try to get it. Ignore any failures here.
|
||||||
try {
|
try {
|
||||||
$this->getResponse();
|
$this->getResponse();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Do nothing
|
//Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
//The QUIT command may cause the daemon to exit, which will kill our connection
|
//The QUIT command may cause the daemon to exit, which will kill our connection
|
||||||
//So ignore errors here
|
//So ignore errors here
|
||||||
try {
|
try {
|
||||||
@fclose($this->pop_conn);
|
@fclose($this->pop_conn);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
//Do nothing
|
//Do nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clean up attributes.
|
// Clean up attributes.
|
||||||
$this->connected = false;
|
$this->connected = false;
|
||||||
$this->pop_conn = false;
|
$this->pop_conn = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a response from the POP3 server.
|
* Get a response from the POP3 server.
|
||||||
*
|
*
|
||||||
* @param int $size The maximum number of bytes to retrieve
|
* @param int $size The maximum number of bytes to retrieve
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getResponse($size = 128)
|
protected function getResponse($size = 128)
|
||||||
{
|
{
|
||||||
$response = fgets($this->pop_conn, $size);
|
$response = fgets($this->pop_conn, $size);
|
||||||
if ($this->do_debug >= self::DEBUG_SERVER) {
|
if ($this->do_debug >= self::DEBUG_SERVER) {
|
||||||
echo 'Server -> Client: ', $response;
|
echo 'Server -> Client: ', $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Send raw data to the POP3 server.
|
* Send raw data to the POP3 server.
|
||||||
*
|
*
|
||||||
* @param string $string
|
* @param string $string
|
||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
protected function sendString($string)
|
protected function sendString($string)
|
||||||
{
|
{
|
||||||
if ($this->pop_conn) {
|
if ($this->pop_conn) {
|
||||||
if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2
|
if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2
|
||||||
echo 'Client -> Server: ', $string;
|
echo 'Client -> Server: ', $string;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fwrite($this->pop_conn, $string, strlen($string));
|
return fwrite($this->pop_conn, $string, strlen($string));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks the POP3 server response.
|
* Checks the POP3 server response.
|
||||||
* Looks for for +OK or -ERR.
|
* Looks for for +OK or -ERR.
|
||||||
*
|
*
|
||||||
* @param string $string
|
* @param string $string
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
protected function checkResponse($string)
|
protected function checkResponse($string)
|
||||||
{
|
{
|
||||||
if (strpos($string, '+OK') !== 0) {
|
if (strpos($string, '+OK') !== 0) {
|
||||||
$this->setError("Server reported an error: $string");
|
$this->setError("Server reported an error: $string");
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an error to the internal error store.
|
* Add an error to the internal error store.
|
||||||
* Also display debug output if it's enabled.
|
* Also display debug output if it's enabled.
|
||||||
*
|
*
|
||||||
* @param string $error
|
* @param string $error
|
||||||
*/
|
*/
|
||||||
protected function setError($error)
|
protected function setError($error)
|
||||||
{
|
{
|
||||||
$this->errors[] = $error;
|
$this->errors[] = $error;
|
||||||
if ($this->do_debug >= self::DEBUG_SERVER) {
|
if ($this->do_debug >= self::DEBUG_SERVER) {
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
foreach ($this->errors as $e) {
|
foreach ($this->errors as $e) {
|
||||||
print_r($e);
|
print_r($e);
|
||||||
}
|
}
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get an array of error messages, if any.
|
* Get an array of error messages, if any.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function getErrors()
|
public function getErrors()
|
||||||
{
|
{
|
||||||
return $this->errors;
|
return $this->errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POP3 connection error handler.
|
* POP3 connection error handler.
|
||||||
*
|
*
|
||||||
* @param int $errno
|
* @param int $errno
|
||||||
* @param string $errstr
|
* @param string $errstr
|
||||||
* @param string $errfile
|
* @param string $errfile
|
||||||
* @param int $errline
|
* @param int $errline
|
||||||
*/
|
*/
|
||||||
protected function catchWarning($errno, $errstr, $errfile, $errline)
|
protected function catchWarning($errno, $errstr, $errfile, $errline)
|
||||||
{
|
{
|
||||||
$this->setError(
|
$this->setError(
|
||||||
'Connecting to the POP3 server raised a PHP warning:' .
|
'Connecting to the POP3 server raised a PHP warning:' .
|
||||||
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
|
"errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1509
-1509
File diff suppressed because it is too large
Load Diff
Vendored
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2012 PHP Framework Interoperability Group
|
Copyright (c) 2012 PHP Framework Interoperability Group
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
furnished to do so, subject to the following conditions:
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
The above copyright notice and this permission notice shall be included in
|
||||||
all copies or substantial portions of the Software.
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
Vendored
+26
-26
@@ -1,26 +1,26 @@
|
|||||||
{
|
{
|
||||||
"name": "psr/log",
|
"name": "psr/log",
|
||||||
"description": "Common interface for logging libraries",
|
"description": "Common interface for logging libraries",
|
||||||
"keywords": ["psr", "psr-3", "log"],
|
"keywords": ["psr", "psr-3", "log"],
|
||||||
"homepage": "https://github.com/php-fig/log",
|
"homepage": "https://github.com/php-fig/log",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "PHP-FIG",
|
"name": "PHP-FIG",
|
||||||
"homepage": "https://www.php-fig.org/"
|
"homepage": "https://www.php-fig.org/"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.0.0"
|
"php": ">=8.0.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
"Psr\\Log\\": "src"
|
"Psr\\Log\\": "src"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "3.x-dev"
|
"dev-master": "3.x-dev"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-15
@@ -1,15 +1,15 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a simple Logger implementation that other Loggers can inherit from.
|
* This is a simple Logger implementation that other Loggers can inherit from.
|
||||||
*
|
*
|
||||||
* It simply delegates all log-level-specific methods to the `log` method to
|
* It simply delegates all log-level-specific methods to the `log` method to
|
||||||
* reduce boilerplate code that a simple Logger that does the same thing with
|
* reduce boilerplate code that a simple Logger that does the same thing with
|
||||||
* messages regardless of the error level has to implement.
|
* messages regardless of the error level has to implement.
|
||||||
*/
|
*/
|
||||||
abstract class AbstractLogger implements LoggerInterface
|
abstract class AbstractLogger implements LoggerInterface
|
||||||
{
|
{
|
||||||
use LoggerTrait;
|
use LoggerTrait;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
class InvalidArgumentException extends \InvalidArgumentException
|
class InvalidArgumentException extends \InvalidArgumentException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-18
@@ -1,18 +1,18 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes log levels.
|
* Describes log levels.
|
||||||
*/
|
*/
|
||||||
class LogLevel
|
class LogLevel
|
||||||
{
|
{
|
||||||
const EMERGENCY = 'emergency';
|
const EMERGENCY = 'emergency';
|
||||||
const ALERT = 'alert';
|
const ALERT = 'alert';
|
||||||
const CRITICAL = 'critical';
|
const CRITICAL = 'critical';
|
||||||
const ERROR = 'error';
|
const ERROR = 'error';
|
||||||
const WARNING = 'warning';
|
const WARNING = 'warning';
|
||||||
const NOTICE = 'notice';
|
const NOTICE = 'notice';
|
||||||
const INFO = 'info';
|
const INFO = 'info';
|
||||||
const DEBUG = 'debug';
|
const DEBUG = 'debug';
|
||||||
}
|
}
|
||||||
|
|||||||
+14
-14
@@ -1,14 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a logger-aware instance.
|
* Describes a logger-aware instance.
|
||||||
*/
|
*/
|
||||||
interface LoggerAwareInterface
|
interface LoggerAwareInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Sets a logger instance on the object.
|
* Sets a logger instance on the object.
|
||||||
*/
|
*/
|
||||||
public function setLogger(LoggerInterface $logger): void;
|
public function setLogger(LoggerInterface $logger): void;
|
||||||
}
|
}
|
||||||
|
|||||||
+22
-22
@@ -1,22 +1,22 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Basic Implementation of LoggerAwareInterface.
|
* Basic Implementation of LoggerAwareInterface.
|
||||||
*/
|
*/
|
||||||
trait LoggerAwareTrait
|
trait LoggerAwareTrait
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The logger instance.
|
* The logger instance.
|
||||||
*/
|
*/
|
||||||
protected ?LoggerInterface $logger = null;
|
protected ?LoggerInterface $logger = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets a logger.
|
* Sets a logger.
|
||||||
*/
|
*/
|
||||||
public function setLogger(LoggerInterface $logger): void
|
public function setLogger(LoggerInterface $logger): void
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+98
-98
@@ -1,98 +1,98 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes a logger instance.
|
* Describes a logger instance.
|
||||||
*
|
*
|
||||||
* The message MUST be a string or object implementing __toString().
|
* The message MUST be a string or object implementing __toString().
|
||||||
*
|
*
|
||||||
* The message MAY contain placeholders in the form: {foo} where foo
|
* The message MAY contain placeholders in the form: {foo} where foo
|
||||||
* will be replaced by the context data in key "foo".
|
* will be replaced by the context data in key "foo".
|
||||||
*
|
*
|
||||||
* The context array can contain arbitrary data. The only assumption that
|
* The context array can contain arbitrary data. The only assumption that
|
||||||
* can be made by implementors is that if an Exception instance is given
|
* can be made by implementors is that if an Exception instance is given
|
||||||
* to produce a stack trace, it MUST be in a key named "exception".
|
* to produce a stack trace, it MUST be in a key named "exception".
|
||||||
*
|
*
|
||||||
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
* See https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-3-logger-interface.md
|
||||||
* for the full interface specification.
|
* for the full interface specification.
|
||||||
*/
|
*/
|
||||||
interface LoggerInterface
|
interface LoggerInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* System is unusable.
|
* System is unusable.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function emergency(string|\Stringable $message, array $context = []): void;
|
public function emergency(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action must be taken immediately.
|
* Action must be taken immediately.
|
||||||
*
|
*
|
||||||
* Example: Entire website down, database unavailable, etc. This should
|
* Example: Entire website down, database unavailable, etc. This should
|
||||||
* trigger the SMS alerts and wake you up.
|
* trigger the SMS alerts and wake you up.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function alert(string|\Stringable $message, array $context = []): void;
|
public function alert(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Critical conditions.
|
* Critical conditions.
|
||||||
*
|
*
|
||||||
* Example: Application component unavailable, unexpected exception.
|
* Example: Application component unavailable, unexpected exception.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function critical(string|\Stringable $message, array $context = []): void;
|
public function critical(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runtime errors that do not require immediate action but should typically
|
* Runtime errors that do not require immediate action but should typically
|
||||||
* be logged and monitored.
|
* be logged and monitored.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function error(string|\Stringable $message, array $context = []): void;
|
public function error(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exceptional occurrences that are not errors.
|
* Exceptional occurrences that are not errors.
|
||||||
*
|
*
|
||||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||||
* that are not necessarily wrong.
|
* that are not necessarily wrong.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function warning(string|\Stringable $message, array $context = []): void;
|
public function warning(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normal but significant events.
|
* Normal but significant events.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function notice(string|\Stringable $message, array $context = []): void;
|
public function notice(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interesting events.
|
* Interesting events.
|
||||||
*
|
*
|
||||||
* Example: User logs in, SQL logs.
|
* Example: User logs in, SQL logs.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function info(string|\Stringable $message, array $context = []): void;
|
public function info(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detailed debug information.
|
* Detailed debug information.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*/
|
*/
|
||||||
public function debug(string|\Stringable $message, array $context = []): void;
|
public function debug(string|\Stringable $message, array $context = []): void;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs with an arbitrary level.
|
* Logs with an arbitrary level.
|
||||||
*
|
*
|
||||||
* @param mixed $level
|
* @param mixed $level
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*
|
*
|
||||||
* @throws \Psr\Log\InvalidArgumentException
|
* @throws \Psr\Log\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function log($level, string|\Stringable $message, array $context = []): void;
|
public function log($level, string|\Stringable $message, array $context = []): void;
|
||||||
}
|
}
|
||||||
|
|||||||
+98
-98
@@ -1,98 +1,98 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a simple Logger trait that classes unable to extend AbstractLogger
|
* This is a simple Logger trait that classes unable to extend AbstractLogger
|
||||||
* (because they extend another class, etc) can include.
|
* (because they extend another class, etc) can include.
|
||||||
*
|
*
|
||||||
* It simply delegates all log-level-specific methods to the `log` method to
|
* It simply delegates all log-level-specific methods to the `log` method to
|
||||||
* reduce boilerplate code that a simple Logger that does the same thing with
|
* reduce boilerplate code that a simple Logger that does the same thing with
|
||||||
* messages regardless of the error level has to implement.
|
* messages regardless of the error level has to implement.
|
||||||
*/
|
*/
|
||||||
trait LoggerTrait
|
trait LoggerTrait
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* System is unusable.
|
* System is unusable.
|
||||||
*/
|
*/
|
||||||
public function emergency(string|\Stringable $message, array $context = []): void
|
public function emergency(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::EMERGENCY, $message, $context);
|
$this->log(LogLevel::EMERGENCY, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Action must be taken immediately.
|
* Action must be taken immediately.
|
||||||
*
|
*
|
||||||
* Example: Entire website down, database unavailable, etc. This should
|
* Example: Entire website down, database unavailable, etc. This should
|
||||||
* trigger the SMS alerts and wake you up.
|
* trigger the SMS alerts and wake you up.
|
||||||
*/
|
*/
|
||||||
public function alert(string|\Stringable $message, array $context = []): void
|
public function alert(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::ALERT, $message, $context);
|
$this->log(LogLevel::ALERT, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Critical conditions.
|
* Critical conditions.
|
||||||
*
|
*
|
||||||
* Example: Application component unavailable, unexpected exception.
|
* Example: Application component unavailable, unexpected exception.
|
||||||
*/
|
*/
|
||||||
public function critical(string|\Stringable $message, array $context = []): void
|
public function critical(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::CRITICAL, $message, $context);
|
$this->log(LogLevel::CRITICAL, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runtime errors that do not require immediate action but should typically
|
* Runtime errors that do not require immediate action but should typically
|
||||||
* be logged and monitored.
|
* be logged and monitored.
|
||||||
*/
|
*/
|
||||||
public function error(string|\Stringable $message, array $context = []): void
|
public function error(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::ERROR, $message, $context);
|
$this->log(LogLevel::ERROR, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exceptional occurrences that are not errors.
|
* Exceptional occurrences that are not errors.
|
||||||
*
|
*
|
||||||
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
* Example: Use of deprecated APIs, poor use of an API, undesirable things
|
||||||
* that are not necessarily wrong.
|
* that are not necessarily wrong.
|
||||||
*/
|
*/
|
||||||
public function warning(string|\Stringable $message, array $context = []): void
|
public function warning(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::WARNING, $message, $context);
|
$this->log(LogLevel::WARNING, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normal but significant events.
|
* Normal but significant events.
|
||||||
*/
|
*/
|
||||||
public function notice(string|\Stringable $message, array $context = []): void
|
public function notice(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::NOTICE, $message, $context);
|
$this->log(LogLevel::NOTICE, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interesting events.
|
* Interesting events.
|
||||||
*
|
*
|
||||||
* Example: User logs in, SQL logs.
|
* Example: User logs in, SQL logs.
|
||||||
*/
|
*/
|
||||||
public function info(string|\Stringable $message, array $context = []): void
|
public function info(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::INFO, $message, $context);
|
$this->log(LogLevel::INFO, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Detailed debug information.
|
* Detailed debug information.
|
||||||
*/
|
*/
|
||||||
public function debug(string|\Stringable $message, array $context = []): void
|
public function debug(string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
$this->log(LogLevel::DEBUG, $message, $context);
|
$this->log(LogLevel::DEBUG, $message, $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs with an arbitrary level.
|
* Logs with an arbitrary level.
|
||||||
*
|
*
|
||||||
* @param mixed $level
|
* @param mixed $level
|
||||||
*
|
*
|
||||||
* @throws \Psr\Log\InvalidArgumentException
|
* @throws \Psr\Log\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
abstract public function log($level, string|\Stringable $message, array $context = []): void;
|
abstract public function log($level, string|\Stringable $message, array $context = []): void;
|
||||||
}
|
}
|
||||||
|
|||||||
+26
-26
@@ -1,26 +1,26 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace Psr\Log;
|
namespace Psr\Log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This Logger can be used to avoid conditional log calls.
|
* This Logger can be used to avoid conditional log calls.
|
||||||
*
|
*
|
||||||
* Logging should always be optional, and if no logger is provided to your
|
* Logging should always be optional, and if no logger is provided to your
|
||||||
* library creating a NullLogger instance to have something to throw logs at
|
* library creating a NullLogger instance to have something to throw logs at
|
||||||
* is a good way to avoid littering your code with `if ($this->logger) { }`
|
* is a good way to avoid littering your code with `if ($this->logger) { }`
|
||||||
* blocks.
|
* blocks.
|
||||||
*/
|
*/
|
||||||
class NullLogger extends AbstractLogger
|
class NullLogger extends AbstractLogger
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Logs with an arbitrary level.
|
* Logs with an arbitrary level.
|
||||||
*
|
*
|
||||||
* @param mixed[] $context
|
* @param mixed[] $context
|
||||||
*
|
*
|
||||||
* @throws \Psr\Log\InvalidArgumentException
|
* @throws \Psr\Log\InvalidArgumentException
|
||||||
*/
|
*/
|
||||||
public function log($level, string|\Stringable $message, array $context = []): void
|
public function log($level, string|\Stringable $message, array $context = []): void
|
||||||
{
|
{
|
||||||
// noop
|
// noop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2020-present Fabien Potencier
|
Copyright (c) 2020-present Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
+35
-35
@@ -1,35 +1,35 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/deprecation-contracts",
|
"name": "symfony/deprecation-contracts",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "A generic function and convention to trigger deprecation notices",
|
"description": "A generic function and convention to trigger deprecation notices",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Nicolas Grekas",
|
"name": "Nicolas Grekas",
|
||||||
"email": "p@tchwork.com"
|
"email": "p@tchwork.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1"
|
"php": ">=8.1"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
"function.php"
|
"function.php"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"extra": {
|
"extra": {
|
||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-main": "3.5-dev"
|
"dev-main": "3.5-dev"
|
||||||
},
|
},
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/contracts",
|
"name": "symfony/contracts",
|
||||||
"url": "https://github.com/symfony/contracts"
|
"url": "https://github.com/symfony/contracts"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+27
-27
@@ -1,27 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!function_exists('trigger_deprecation')) {
|
if (!function_exists('trigger_deprecation')) {
|
||||||
/**
|
/**
|
||||||
* Triggers a silenced deprecation notice.
|
* Triggers a silenced deprecation notice.
|
||||||
*
|
*
|
||||||
* @param string $package The name of the Composer package that is triggering the deprecation
|
* @param string $package The name of the Composer package that is triggering the deprecation
|
||||||
* @param string $version The version of the package that introduced the deprecation
|
* @param string $version The version of the package that introduced the deprecation
|
||||||
* @param string $message The message of the deprecation
|
* @param string $message The message of the deprecation
|
||||||
* @param mixed ...$args Values to insert in the message using printf() formatting
|
* @param mixed ...$args Values to insert in the message using printf() formatting
|
||||||
*
|
*
|
||||||
* @author Nicolas Grekas <p@tchwork.com>
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
*/
|
*/
|
||||||
function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void
|
function trigger_deprecation(string $package, string $version, string $message, mixed ...$args): void
|
||||||
{
|
{
|
||||||
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
|
@trigger_error(($package || $version ? "Since $package $version: " : '').($args ? vsprintf($message, $args) : $message), \E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+232
-232
@@ -1,232 +1,232 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Polyfill\Ctype;
|
namespace Symfony\Polyfill\Ctype;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ctype implementation through regex.
|
* Ctype implementation through regex.
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*
|
*
|
||||||
* @author Gert de Pagter <BackEndTea@gmail.com>
|
* @author Gert de Pagter <BackEndTea@gmail.com>
|
||||||
*/
|
*/
|
||||||
final class Ctype
|
final class Ctype
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise.
|
* Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-alnum
|
* @see https://php.net/ctype-alnum
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_alnum($text)
|
public static function ctype_alnum($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is a letter, FALSE otherwise.
|
* Returns TRUE if every character in text is a letter, FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-alpha
|
* @see https://php.net/ctype-alpha
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_alpha($text)
|
public static function ctype_alpha($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise.
|
* Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-cntrl
|
* @see https://php.net/ctype-cntrl
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_cntrl($text)
|
public static function ctype_cntrl($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.
|
* Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-digit
|
* @see https://php.net/ctype-digit
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_digit($text)
|
public static function ctype_digit($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
|
* Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-graph
|
* @see https://php.net/ctype-graph
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_graph($text)
|
public static function ctype_graph($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is a lowercase letter.
|
* Returns TRUE if every character in text is a lowercase letter.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-lower
|
* @see https://php.net/ctype-lower
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_lower($text)
|
public static function ctype_lower($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all.
|
* Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-print
|
* @see https://php.net/ctype-print
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_print($text)
|
public static function ctype_print($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise.
|
* Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-punct
|
* @see https://php.net/ctype-punct
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_punct($text)
|
public static function ctype_punct($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.
|
* Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-space
|
* @see https://php.net/ctype-space
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_space($text)
|
public static function ctype_space($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is an uppercase letter.
|
* Returns TRUE if every character in text is an uppercase letter.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-upper
|
* @see https://php.net/ctype-upper
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_upper($text)
|
public static function ctype_upper($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
|
* Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise.
|
||||||
*
|
*
|
||||||
* @see https://php.net/ctype-xdigit
|
* @see https://php.net/ctype-xdigit
|
||||||
*
|
*
|
||||||
* @param mixed $text
|
* @param mixed $text
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function ctype_xdigit($text)
|
public static function ctype_xdigit($text)
|
||||||
{
|
{
|
||||||
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
$text = self::convert_int_to_char_for_ctype($text, __FUNCTION__);
|
||||||
|
|
||||||
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
|
return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts integers to their char versions according to normal ctype behaviour, if needed.
|
* Converts integers to their char versions according to normal ctype behaviour, if needed.
|
||||||
*
|
*
|
||||||
* If an integer between -128 and 255 inclusive is provided,
|
* If an integer between -128 and 255 inclusive is provided,
|
||||||
* it is interpreted as the ASCII value of a single character
|
* it is interpreted as the ASCII value of a single character
|
||||||
* (negative values have 256 added in order to allow characters in the Extended ASCII range).
|
* (negative values have 256 added in order to allow characters in the Extended ASCII range).
|
||||||
* Any other integer is interpreted as a string containing the decimal digits of the integer.
|
* Any other integer is interpreted as a string containing the decimal digits of the integer.
|
||||||
*
|
*
|
||||||
* @param mixed $int
|
* @param mixed $int
|
||||||
* @param string $function
|
* @param string $function
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private static function convert_int_to_char_for_ctype($int, $function)
|
private static function convert_int_to_char_for_ctype($int, $function)
|
||||||
{
|
{
|
||||||
if (!\is_int($int)) {
|
if (!\is_int($int)) {
|
||||||
return $int;
|
return $int;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($int < -128 || $int > 255) {
|
if ($int < -128 || $int > 255) {
|
||||||
return (string) $int;
|
return (string) $int;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\PHP_VERSION_ID >= 80100) {
|
if (\PHP_VERSION_ID >= 80100) {
|
||||||
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
|
@trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($int < 0) {
|
if ($int < 0) {
|
||||||
$int += 256;
|
$int += 256;
|
||||||
}
|
}
|
||||||
|
|
||||||
return \chr($int);
|
return \chr($int);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2018-present Fabien Potencier
|
Copyright (c) 2018-present Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
+50
-50
@@ -1,50 +1,50 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Ctype as p;
|
use Symfony\Polyfill\Ctype as p;
|
||||||
|
|
||||||
if (\PHP_VERSION_ID >= 80000) {
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
return require __DIR__.'/bootstrap80.php';
|
return require __DIR__.'/bootstrap80.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('ctype_alnum')) {
|
if (!function_exists('ctype_alnum')) {
|
||||||
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
|
function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_alpha')) {
|
if (!function_exists('ctype_alpha')) {
|
||||||
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
|
function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_cntrl')) {
|
if (!function_exists('ctype_cntrl')) {
|
||||||
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
|
function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_digit')) {
|
if (!function_exists('ctype_digit')) {
|
||||||
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
|
function ctype_digit($text) { return p\Ctype::ctype_digit($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_graph')) {
|
if (!function_exists('ctype_graph')) {
|
||||||
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
|
function ctype_graph($text) { return p\Ctype::ctype_graph($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_lower')) {
|
if (!function_exists('ctype_lower')) {
|
||||||
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
|
function ctype_lower($text) { return p\Ctype::ctype_lower($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_print')) {
|
if (!function_exists('ctype_print')) {
|
||||||
function ctype_print($text) { return p\Ctype::ctype_print($text); }
|
function ctype_print($text) { return p\Ctype::ctype_print($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_punct')) {
|
if (!function_exists('ctype_punct')) {
|
||||||
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
|
function ctype_punct($text) { return p\Ctype::ctype_punct($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_space')) {
|
if (!function_exists('ctype_space')) {
|
||||||
function ctype_space($text) { return p\Ctype::ctype_space($text); }
|
function ctype_space($text) { return p\Ctype::ctype_space($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_upper')) {
|
if (!function_exists('ctype_upper')) {
|
||||||
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
|
function ctype_upper($text) { return p\Ctype::ctype_upper($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_xdigit')) {
|
if (!function_exists('ctype_xdigit')) {
|
||||||
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
|
function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); }
|
||||||
}
|
}
|
||||||
|
|||||||
+46
-46
@@ -1,46 +1,46 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Ctype as p;
|
use Symfony\Polyfill\Ctype as p;
|
||||||
|
|
||||||
if (!function_exists('ctype_alnum')) {
|
if (!function_exists('ctype_alnum')) {
|
||||||
function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); }
|
function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_alpha')) {
|
if (!function_exists('ctype_alpha')) {
|
||||||
function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); }
|
function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_cntrl')) {
|
if (!function_exists('ctype_cntrl')) {
|
||||||
function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); }
|
function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_digit')) {
|
if (!function_exists('ctype_digit')) {
|
||||||
function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); }
|
function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_graph')) {
|
if (!function_exists('ctype_graph')) {
|
||||||
function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); }
|
function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_lower')) {
|
if (!function_exists('ctype_lower')) {
|
||||||
function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); }
|
function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_print')) {
|
if (!function_exists('ctype_print')) {
|
||||||
function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); }
|
function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_punct')) {
|
if (!function_exists('ctype_punct')) {
|
||||||
function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); }
|
function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_space')) {
|
if (!function_exists('ctype_space')) {
|
||||||
function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); }
|
function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_upper')) {
|
if (!function_exists('ctype_upper')) {
|
||||||
function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); }
|
function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); }
|
||||||
}
|
}
|
||||||
if (!function_exists('ctype_xdigit')) {
|
if (!function_exists('ctype_xdigit')) {
|
||||||
function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); }
|
function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); }
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-38
@@ -1,38 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/polyfill-ctype",
|
"name": "symfony/polyfill-ctype",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Symfony polyfill for ctype functions",
|
"description": "Symfony polyfill for ctype functions",
|
||||||
"keywords": ["polyfill", "compatibility", "portable", "ctype"],
|
"keywords": ["polyfill", "compatibility", "portable", "ctype"],
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Gert de Pagter",
|
"name": "Gert de Pagter",
|
||||||
"email": "BackEndTea@gmail.com"
|
"email": "BackEndTea@gmail.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2"
|
"php": ">=7.2"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
"ext-ctype": "*"
|
"ext-ctype": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
|
"psr-4": { "Symfony\\Polyfill\\Ctype\\": "" },
|
||||||
"files": [ "bootstrap.php" ]
|
"files": [ "bootstrap.php" ]
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-ctype": "For best performance"
|
"ext-ctype": "For best performance"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"extra": {
|
"extra": {
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"url": "https://github.com/symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+933
-933
File diff suppressed because it is too large
Load Diff
+23
-23
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com> and Trevor Rowbotham <trevor.rowbotham@pm.me>
|
* (c) Fabien Potencier <fabien@symfony.com> and Trevor Rowbotham <trevor.rowbotham@pm.me>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Polyfill\Intl\Idn;
|
namespace Symfony\Polyfill\Intl\Idn;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
class Info
|
class Info
|
||||||
{
|
{
|
||||||
public $bidiDomain = false;
|
public $bidiDomain = false;
|
||||||
public $errors = 0;
|
public $errors = 0;
|
||||||
public $validBidiDomain = true;
|
public $validBidiDomain = true;
|
||||||
public $transitionalDifferent = false;
|
public $transitionalDifferent = false;
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2018-present Fabien Potencier and Trevor Rowbotham <trevor.rowbotham@pm.me>
|
Copyright (c) 2018-present Fabien Potencier and Trevor Rowbotham <trevor.rowbotham@pm.me>
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
+384
-384
@@ -1,384 +1,384 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Polyfill\Intl\Idn\Resources\unidata;
|
namespace Symfony\Polyfill\Intl\Idn\Resources\unidata;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class DisallowedRanges
|
final class DisallowedRanges
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param int $codePoint
|
* @param int $codePoint
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function inRange($codePoint)
|
public static function inRange($codePoint)
|
||||||
{
|
{
|
||||||
if ($codePoint >= 128 && $codePoint <= 159) {
|
if ($codePoint >= 128 && $codePoint <= 159) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 2155 && $codePoint <= 2207) {
|
if ($codePoint >= 2155 && $codePoint <= 2207) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 3676 && $codePoint <= 3712) {
|
if ($codePoint >= 3676 && $codePoint <= 3712) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 3808 && $codePoint <= 3839) {
|
if ($codePoint >= 3808 && $codePoint <= 3839) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 4059 && $codePoint <= 4095) {
|
if ($codePoint >= 4059 && $codePoint <= 4095) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 4256 && $codePoint <= 4293) {
|
if ($codePoint >= 4256 && $codePoint <= 4293) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 6849 && $codePoint <= 6911) {
|
if ($codePoint >= 6849 && $codePoint <= 6911) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 11859 && $codePoint <= 11903) {
|
if ($codePoint >= 11859 && $codePoint <= 11903) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 42955 && $codePoint <= 42996) {
|
if ($codePoint >= 42955 && $codePoint <= 42996) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 55296 && $codePoint <= 57343) {
|
if ($codePoint >= 55296 && $codePoint <= 57343) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 57344 && $codePoint <= 63743) {
|
if ($codePoint >= 57344 && $codePoint <= 63743) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 64218 && $codePoint <= 64255) {
|
if ($codePoint >= 64218 && $codePoint <= 64255) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 64976 && $codePoint <= 65007) {
|
if ($codePoint >= 64976 && $codePoint <= 65007) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 65630 && $codePoint <= 65663) {
|
if ($codePoint >= 65630 && $codePoint <= 65663) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 65953 && $codePoint <= 65999) {
|
if ($codePoint >= 65953 && $codePoint <= 65999) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 66046 && $codePoint <= 66175) {
|
if ($codePoint >= 66046 && $codePoint <= 66175) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 66518 && $codePoint <= 66559) {
|
if ($codePoint >= 66518 && $codePoint <= 66559) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 66928 && $codePoint <= 67071) {
|
if ($codePoint >= 66928 && $codePoint <= 67071) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 67432 && $codePoint <= 67583) {
|
if ($codePoint >= 67432 && $codePoint <= 67583) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 67760 && $codePoint <= 67807) {
|
if ($codePoint >= 67760 && $codePoint <= 67807) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 67904 && $codePoint <= 67967) {
|
if ($codePoint >= 67904 && $codePoint <= 67967) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 68256 && $codePoint <= 68287) {
|
if ($codePoint >= 68256 && $codePoint <= 68287) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 68528 && $codePoint <= 68607) {
|
if ($codePoint >= 68528 && $codePoint <= 68607) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 68681 && $codePoint <= 68735) {
|
if ($codePoint >= 68681 && $codePoint <= 68735) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 68922 && $codePoint <= 69215) {
|
if ($codePoint >= 68922 && $codePoint <= 69215) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 69298 && $codePoint <= 69375) {
|
if ($codePoint >= 69298 && $codePoint <= 69375) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 69466 && $codePoint <= 69551) {
|
if ($codePoint >= 69466 && $codePoint <= 69551) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 70207 && $codePoint <= 70271) {
|
if ($codePoint >= 70207 && $codePoint <= 70271) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 70517 && $codePoint <= 70655) {
|
if ($codePoint >= 70517 && $codePoint <= 70655) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 70874 && $codePoint <= 71039) {
|
if ($codePoint >= 70874 && $codePoint <= 71039) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 71134 && $codePoint <= 71167) {
|
if ($codePoint >= 71134 && $codePoint <= 71167) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 71370 && $codePoint <= 71423) {
|
if ($codePoint >= 71370 && $codePoint <= 71423) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 71488 && $codePoint <= 71679) {
|
if ($codePoint >= 71488 && $codePoint <= 71679) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 71740 && $codePoint <= 71839) {
|
if ($codePoint >= 71740 && $codePoint <= 71839) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 72026 && $codePoint <= 72095) {
|
if ($codePoint >= 72026 && $codePoint <= 72095) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 72441 && $codePoint <= 72703) {
|
if ($codePoint >= 72441 && $codePoint <= 72703) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 72887 && $codePoint <= 72959) {
|
if ($codePoint >= 72887 && $codePoint <= 72959) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 73130 && $codePoint <= 73439) {
|
if ($codePoint >= 73130 && $codePoint <= 73439) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 73465 && $codePoint <= 73647) {
|
if ($codePoint >= 73465 && $codePoint <= 73647) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 74650 && $codePoint <= 74751) {
|
if ($codePoint >= 74650 && $codePoint <= 74751) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 75076 && $codePoint <= 77823) {
|
if ($codePoint >= 75076 && $codePoint <= 77823) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 78905 && $codePoint <= 82943) {
|
if ($codePoint >= 78905 && $codePoint <= 82943) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 83527 && $codePoint <= 92159) {
|
if ($codePoint >= 83527 && $codePoint <= 92159) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 92784 && $codePoint <= 92879) {
|
if ($codePoint >= 92784 && $codePoint <= 92879) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 93072 && $codePoint <= 93759) {
|
if ($codePoint >= 93072 && $codePoint <= 93759) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 93851 && $codePoint <= 93951) {
|
if ($codePoint >= 93851 && $codePoint <= 93951) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 94112 && $codePoint <= 94175) {
|
if ($codePoint >= 94112 && $codePoint <= 94175) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 101590 && $codePoint <= 101631) {
|
if ($codePoint >= 101590 && $codePoint <= 101631) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 101641 && $codePoint <= 110591) {
|
if ($codePoint >= 101641 && $codePoint <= 110591) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 110879 && $codePoint <= 110927) {
|
if ($codePoint >= 110879 && $codePoint <= 110927) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 111356 && $codePoint <= 113663) {
|
if ($codePoint >= 111356 && $codePoint <= 113663) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 113828 && $codePoint <= 118783) {
|
if ($codePoint >= 113828 && $codePoint <= 118783) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 119366 && $codePoint <= 119519) {
|
if ($codePoint >= 119366 && $codePoint <= 119519) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 119673 && $codePoint <= 119807) {
|
if ($codePoint >= 119673 && $codePoint <= 119807) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 121520 && $codePoint <= 122879) {
|
if ($codePoint >= 121520 && $codePoint <= 122879) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 122923 && $codePoint <= 123135) {
|
if ($codePoint >= 122923 && $codePoint <= 123135) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 123216 && $codePoint <= 123583) {
|
if ($codePoint >= 123216 && $codePoint <= 123583) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 123648 && $codePoint <= 124927) {
|
if ($codePoint >= 123648 && $codePoint <= 124927) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 125143 && $codePoint <= 125183) {
|
if ($codePoint >= 125143 && $codePoint <= 125183) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 125280 && $codePoint <= 126064) {
|
if ($codePoint >= 125280 && $codePoint <= 126064) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 126133 && $codePoint <= 126208) {
|
if ($codePoint >= 126133 && $codePoint <= 126208) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 126270 && $codePoint <= 126463) {
|
if ($codePoint >= 126270 && $codePoint <= 126463) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 126652 && $codePoint <= 126703) {
|
if ($codePoint >= 126652 && $codePoint <= 126703) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 126706 && $codePoint <= 126975) {
|
if ($codePoint >= 126706 && $codePoint <= 126975) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 127406 && $codePoint <= 127461) {
|
if ($codePoint >= 127406 && $codePoint <= 127461) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 127590 && $codePoint <= 127743) {
|
if ($codePoint >= 127590 && $codePoint <= 127743) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 129202 && $codePoint <= 129279) {
|
if ($codePoint >= 129202 && $codePoint <= 129279) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 129751 && $codePoint <= 129791) {
|
if ($codePoint >= 129751 && $codePoint <= 129791) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 129995 && $codePoint <= 130031) {
|
if ($codePoint >= 129995 && $codePoint <= 130031) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 130042 && $codePoint <= 131069) {
|
if ($codePoint >= 130042 && $codePoint <= 131069) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 173790 && $codePoint <= 173823) {
|
if ($codePoint >= 173790 && $codePoint <= 173823) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 191457 && $codePoint <= 194559) {
|
if ($codePoint >= 191457 && $codePoint <= 194559) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 195102 && $codePoint <= 196605) {
|
if ($codePoint >= 195102 && $codePoint <= 196605) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 201547 && $codePoint <= 262141) {
|
if ($codePoint >= 201547 && $codePoint <= 262141) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 262144 && $codePoint <= 327677) {
|
if ($codePoint >= 262144 && $codePoint <= 327677) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 327680 && $codePoint <= 393213) {
|
if ($codePoint >= 327680 && $codePoint <= 393213) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 393216 && $codePoint <= 458749) {
|
if ($codePoint >= 393216 && $codePoint <= 458749) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 458752 && $codePoint <= 524285) {
|
if ($codePoint >= 458752 && $codePoint <= 524285) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 524288 && $codePoint <= 589821) {
|
if ($codePoint >= 524288 && $codePoint <= 589821) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 589824 && $codePoint <= 655357) {
|
if ($codePoint >= 589824 && $codePoint <= 655357) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 655360 && $codePoint <= 720893) {
|
if ($codePoint >= 655360 && $codePoint <= 720893) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 720896 && $codePoint <= 786429) {
|
if ($codePoint >= 720896 && $codePoint <= 786429) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 786432 && $codePoint <= 851965) {
|
if ($codePoint >= 786432 && $codePoint <= 851965) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 851968 && $codePoint <= 917501) {
|
if ($codePoint >= 851968 && $codePoint <= 917501) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 917536 && $codePoint <= 917631) {
|
if ($codePoint >= 917536 && $codePoint <= 917631) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 917632 && $codePoint <= 917759) {
|
if ($codePoint >= 917632 && $codePoint <= 917759) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 918000 && $codePoint <= 983037) {
|
if ($codePoint >= 918000 && $codePoint <= 983037) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 983040 && $codePoint <= 1048573) {
|
if ($codePoint >= 983040 && $codePoint <= 1048573) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($codePoint >= 1048576 && $codePoint <= 1114109) {
|
if ($codePoint >= 1048576 && $codePoint <= 1114109) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
223 => 'ss',
|
223 => 'ss',
|
||||||
962 => 'σ',
|
962 => 'σ',
|
||||||
8204 => '',
|
8204 => '',
|
||||||
8205 => '',
|
8205 => '',
|
||||||
);
|
);
|
||||||
|
|||||||
+2638
-2638
File diff suppressed because it is too large
Load Diff
+308
-308
@@ -1,308 +1,308 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
160 => ' ',
|
160 => ' ',
|
||||||
168 => ' ̈',
|
168 => ' ̈',
|
||||||
175 => ' ̄',
|
175 => ' ̄',
|
||||||
180 => ' ́',
|
180 => ' ́',
|
||||||
184 => ' ̧',
|
184 => ' ̧',
|
||||||
728 => ' ̆',
|
728 => ' ̆',
|
||||||
729 => ' ̇',
|
729 => ' ̇',
|
||||||
730 => ' ̊',
|
730 => ' ̊',
|
||||||
731 => ' ̨',
|
731 => ' ̨',
|
||||||
732 => ' ̃',
|
732 => ' ̃',
|
||||||
733 => ' ̋',
|
733 => ' ̋',
|
||||||
890 => ' ι',
|
890 => ' ι',
|
||||||
894 => ';',
|
894 => ';',
|
||||||
900 => ' ́',
|
900 => ' ́',
|
||||||
901 => ' ̈́',
|
901 => ' ̈́',
|
||||||
8125 => ' ̓',
|
8125 => ' ̓',
|
||||||
8127 => ' ̓',
|
8127 => ' ̓',
|
||||||
8128 => ' ͂',
|
8128 => ' ͂',
|
||||||
8129 => ' ̈͂',
|
8129 => ' ̈͂',
|
||||||
8141 => ' ̓̀',
|
8141 => ' ̓̀',
|
||||||
8142 => ' ̓́',
|
8142 => ' ̓́',
|
||||||
8143 => ' ̓͂',
|
8143 => ' ̓͂',
|
||||||
8157 => ' ̔̀',
|
8157 => ' ̔̀',
|
||||||
8158 => ' ̔́',
|
8158 => ' ̔́',
|
||||||
8159 => ' ̔͂',
|
8159 => ' ̔͂',
|
||||||
8173 => ' ̈̀',
|
8173 => ' ̈̀',
|
||||||
8174 => ' ̈́',
|
8174 => ' ̈́',
|
||||||
8175 => '`',
|
8175 => '`',
|
||||||
8189 => ' ́',
|
8189 => ' ́',
|
||||||
8190 => ' ̔',
|
8190 => ' ̔',
|
||||||
8192 => ' ',
|
8192 => ' ',
|
||||||
8193 => ' ',
|
8193 => ' ',
|
||||||
8194 => ' ',
|
8194 => ' ',
|
||||||
8195 => ' ',
|
8195 => ' ',
|
||||||
8196 => ' ',
|
8196 => ' ',
|
||||||
8197 => ' ',
|
8197 => ' ',
|
||||||
8198 => ' ',
|
8198 => ' ',
|
||||||
8199 => ' ',
|
8199 => ' ',
|
||||||
8200 => ' ',
|
8200 => ' ',
|
||||||
8201 => ' ',
|
8201 => ' ',
|
||||||
8202 => ' ',
|
8202 => ' ',
|
||||||
8215 => ' ̳',
|
8215 => ' ̳',
|
||||||
8239 => ' ',
|
8239 => ' ',
|
||||||
8252 => '!!',
|
8252 => '!!',
|
||||||
8254 => ' ̅',
|
8254 => ' ̅',
|
||||||
8263 => '??',
|
8263 => '??',
|
||||||
8264 => '?!',
|
8264 => '?!',
|
||||||
8265 => '!?',
|
8265 => '!?',
|
||||||
8287 => ' ',
|
8287 => ' ',
|
||||||
8314 => '+',
|
8314 => '+',
|
||||||
8316 => '=',
|
8316 => '=',
|
||||||
8317 => '(',
|
8317 => '(',
|
||||||
8318 => ')',
|
8318 => ')',
|
||||||
8330 => '+',
|
8330 => '+',
|
||||||
8332 => '=',
|
8332 => '=',
|
||||||
8333 => '(',
|
8333 => '(',
|
||||||
8334 => ')',
|
8334 => ')',
|
||||||
8448 => 'a/c',
|
8448 => 'a/c',
|
||||||
8449 => 'a/s',
|
8449 => 'a/s',
|
||||||
8453 => 'c/o',
|
8453 => 'c/o',
|
||||||
8454 => 'c/u',
|
8454 => 'c/u',
|
||||||
9332 => '(1)',
|
9332 => '(1)',
|
||||||
9333 => '(2)',
|
9333 => '(2)',
|
||||||
9334 => '(3)',
|
9334 => '(3)',
|
||||||
9335 => '(4)',
|
9335 => '(4)',
|
||||||
9336 => '(5)',
|
9336 => '(5)',
|
||||||
9337 => '(6)',
|
9337 => '(6)',
|
||||||
9338 => '(7)',
|
9338 => '(7)',
|
||||||
9339 => '(8)',
|
9339 => '(8)',
|
||||||
9340 => '(9)',
|
9340 => '(9)',
|
||||||
9341 => '(10)',
|
9341 => '(10)',
|
||||||
9342 => '(11)',
|
9342 => '(11)',
|
||||||
9343 => '(12)',
|
9343 => '(12)',
|
||||||
9344 => '(13)',
|
9344 => '(13)',
|
||||||
9345 => '(14)',
|
9345 => '(14)',
|
||||||
9346 => '(15)',
|
9346 => '(15)',
|
||||||
9347 => '(16)',
|
9347 => '(16)',
|
||||||
9348 => '(17)',
|
9348 => '(17)',
|
||||||
9349 => '(18)',
|
9349 => '(18)',
|
||||||
9350 => '(19)',
|
9350 => '(19)',
|
||||||
9351 => '(20)',
|
9351 => '(20)',
|
||||||
9372 => '(a)',
|
9372 => '(a)',
|
||||||
9373 => '(b)',
|
9373 => '(b)',
|
||||||
9374 => '(c)',
|
9374 => '(c)',
|
||||||
9375 => '(d)',
|
9375 => '(d)',
|
||||||
9376 => '(e)',
|
9376 => '(e)',
|
||||||
9377 => '(f)',
|
9377 => '(f)',
|
||||||
9378 => '(g)',
|
9378 => '(g)',
|
||||||
9379 => '(h)',
|
9379 => '(h)',
|
||||||
9380 => '(i)',
|
9380 => '(i)',
|
||||||
9381 => '(j)',
|
9381 => '(j)',
|
||||||
9382 => '(k)',
|
9382 => '(k)',
|
||||||
9383 => '(l)',
|
9383 => '(l)',
|
||||||
9384 => '(m)',
|
9384 => '(m)',
|
||||||
9385 => '(n)',
|
9385 => '(n)',
|
||||||
9386 => '(o)',
|
9386 => '(o)',
|
||||||
9387 => '(p)',
|
9387 => '(p)',
|
||||||
9388 => '(q)',
|
9388 => '(q)',
|
||||||
9389 => '(r)',
|
9389 => '(r)',
|
||||||
9390 => '(s)',
|
9390 => '(s)',
|
||||||
9391 => '(t)',
|
9391 => '(t)',
|
||||||
9392 => '(u)',
|
9392 => '(u)',
|
||||||
9393 => '(v)',
|
9393 => '(v)',
|
||||||
9394 => '(w)',
|
9394 => '(w)',
|
||||||
9395 => '(x)',
|
9395 => '(x)',
|
||||||
9396 => '(y)',
|
9396 => '(y)',
|
||||||
9397 => '(z)',
|
9397 => '(z)',
|
||||||
10868 => '::=',
|
10868 => '::=',
|
||||||
10869 => '==',
|
10869 => '==',
|
||||||
10870 => '===',
|
10870 => '===',
|
||||||
12288 => ' ',
|
12288 => ' ',
|
||||||
12443 => ' ゙',
|
12443 => ' ゙',
|
||||||
12444 => ' ゚',
|
12444 => ' ゚',
|
||||||
12800 => '(ᄀ)',
|
12800 => '(ᄀ)',
|
||||||
12801 => '(ᄂ)',
|
12801 => '(ᄂ)',
|
||||||
12802 => '(ᄃ)',
|
12802 => '(ᄃ)',
|
||||||
12803 => '(ᄅ)',
|
12803 => '(ᄅ)',
|
||||||
12804 => '(ᄆ)',
|
12804 => '(ᄆ)',
|
||||||
12805 => '(ᄇ)',
|
12805 => '(ᄇ)',
|
||||||
12806 => '(ᄉ)',
|
12806 => '(ᄉ)',
|
||||||
12807 => '(ᄋ)',
|
12807 => '(ᄋ)',
|
||||||
12808 => '(ᄌ)',
|
12808 => '(ᄌ)',
|
||||||
12809 => '(ᄎ)',
|
12809 => '(ᄎ)',
|
||||||
12810 => '(ᄏ)',
|
12810 => '(ᄏ)',
|
||||||
12811 => '(ᄐ)',
|
12811 => '(ᄐ)',
|
||||||
12812 => '(ᄑ)',
|
12812 => '(ᄑ)',
|
||||||
12813 => '(ᄒ)',
|
12813 => '(ᄒ)',
|
||||||
12814 => '(가)',
|
12814 => '(가)',
|
||||||
12815 => '(나)',
|
12815 => '(나)',
|
||||||
12816 => '(다)',
|
12816 => '(다)',
|
||||||
12817 => '(라)',
|
12817 => '(라)',
|
||||||
12818 => '(마)',
|
12818 => '(마)',
|
||||||
12819 => '(바)',
|
12819 => '(바)',
|
||||||
12820 => '(사)',
|
12820 => '(사)',
|
||||||
12821 => '(아)',
|
12821 => '(아)',
|
||||||
12822 => '(자)',
|
12822 => '(자)',
|
||||||
12823 => '(차)',
|
12823 => '(차)',
|
||||||
12824 => '(카)',
|
12824 => '(카)',
|
||||||
12825 => '(타)',
|
12825 => '(타)',
|
||||||
12826 => '(파)',
|
12826 => '(파)',
|
||||||
12827 => '(하)',
|
12827 => '(하)',
|
||||||
12828 => '(주)',
|
12828 => '(주)',
|
||||||
12829 => '(오전)',
|
12829 => '(오전)',
|
||||||
12830 => '(오후)',
|
12830 => '(오후)',
|
||||||
12832 => '(一)',
|
12832 => '(一)',
|
||||||
12833 => '(二)',
|
12833 => '(二)',
|
||||||
12834 => '(三)',
|
12834 => '(三)',
|
||||||
12835 => '(四)',
|
12835 => '(四)',
|
||||||
12836 => '(五)',
|
12836 => '(五)',
|
||||||
12837 => '(六)',
|
12837 => '(六)',
|
||||||
12838 => '(七)',
|
12838 => '(七)',
|
||||||
12839 => '(八)',
|
12839 => '(八)',
|
||||||
12840 => '(九)',
|
12840 => '(九)',
|
||||||
12841 => '(十)',
|
12841 => '(十)',
|
||||||
12842 => '(月)',
|
12842 => '(月)',
|
||||||
12843 => '(火)',
|
12843 => '(火)',
|
||||||
12844 => '(水)',
|
12844 => '(水)',
|
||||||
12845 => '(木)',
|
12845 => '(木)',
|
||||||
12846 => '(金)',
|
12846 => '(金)',
|
||||||
12847 => '(土)',
|
12847 => '(土)',
|
||||||
12848 => '(日)',
|
12848 => '(日)',
|
||||||
12849 => '(株)',
|
12849 => '(株)',
|
||||||
12850 => '(有)',
|
12850 => '(有)',
|
||||||
12851 => '(社)',
|
12851 => '(社)',
|
||||||
12852 => '(名)',
|
12852 => '(名)',
|
||||||
12853 => '(特)',
|
12853 => '(特)',
|
||||||
12854 => '(財)',
|
12854 => '(財)',
|
||||||
12855 => '(祝)',
|
12855 => '(祝)',
|
||||||
12856 => '(労)',
|
12856 => '(労)',
|
||||||
12857 => '(代)',
|
12857 => '(代)',
|
||||||
12858 => '(呼)',
|
12858 => '(呼)',
|
||||||
12859 => '(学)',
|
12859 => '(学)',
|
||||||
12860 => '(監)',
|
12860 => '(監)',
|
||||||
12861 => '(企)',
|
12861 => '(企)',
|
||||||
12862 => '(資)',
|
12862 => '(資)',
|
||||||
12863 => '(協)',
|
12863 => '(協)',
|
||||||
12864 => '(祭)',
|
12864 => '(祭)',
|
||||||
12865 => '(休)',
|
12865 => '(休)',
|
||||||
12866 => '(自)',
|
12866 => '(自)',
|
||||||
12867 => '(至)',
|
12867 => '(至)',
|
||||||
64297 => '+',
|
64297 => '+',
|
||||||
64606 => ' ٌّ',
|
64606 => ' ٌّ',
|
||||||
64607 => ' ٍّ',
|
64607 => ' ٍّ',
|
||||||
64608 => ' َّ',
|
64608 => ' َّ',
|
||||||
64609 => ' ُّ',
|
64609 => ' ُّ',
|
||||||
64610 => ' ِّ',
|
64610 => ' ِّ',
|
||||||
64611 => ' ّٰ',
|
64611 => ' ّٰ',
|
||||||
65018 => 'صلى الله عليه وسلم',
|
65018 => 'صلى الله عليه وسلم',
|
||||||
65019 => 'جل جلاله',
|
65019 => 'جل جلاله',
|
||||||
65040 => ',',
|
65040 => ',',
|
||||||
65043 => ':',
|
65043 => ':',
|
||||||
65044 => ';',
|
65044 => ';',
|
||||||
65045 => '!',
|
65045 => '!',
|
||||||
65046 => '?',
|
65046 => '?',
|
||||||
65075 => '_',
|
65075 => '_',
|
||||||
65076 => '_',
|
65076 => '_',
|
||||||
65077 => '(',
|
65077 => '(',
|
||||||
65078 => ')',
|
65078 => ')',
|
||||||
65079 => '{',
|
65079 => '{',
|
||||||
65080 => '}',
|
65080 => '}',
|
||||||
65095 => '[',
|
65095 => '[',
|
||||||
65096 => ']',
|
65096 => ']',
|
||||||
65097 => ' ̅',
|
65097 => ' ̅',
|
||||||
65098 => ' ̅',
|
65098 => ' ̅',
|
||||||
65099 => ' ̅',
|
65099 => ' ̅',
|
||||||
65100 => ' ̅',
|
65100 => ' ̅',
|
||||||
65101 => '_',
|
65101 => '_',
|
||||||
65102 => '_',
|
65102 => '_',
|
||||||
65103 => '_',
|
65103 => '_',
|
||||||
65104 => ',',
|
65104 => ',',
|
||||||
65108 => ';',
|
65108 => ';',
|
||||||
65109 => ':',
|
65109 => ':',
|
||||||
65110 => '?',
|
65110 => '?',
|
||||||
65111 => '!',
|
65111 => '!',
|
||||||
65113 => '(',
|
65113 => '(',
|
||||||
65114 => ')',
|
65114 => ')',
|
||||||
65115 => '{',
|
65115 => '{',
|
||||||
65116 => '}',
|
65116 => '}',
|
||||||
65119 => '#',
|
65119 => '#',
|
||||||
65120 => '&',
|
65120 => '&',
|
||||||
65121 => '*',
|
65121 => '*',
|
||||||
65122 => '+',
|
65122 => '+',
|
||||||
65124 => '<',
|
65124 => '<',
|
||||||
65125 => '>',
|
65125 => '>',
|
||||||
65126 => '=',
|
65126 => '=',
|
||||||
65128 => '\\',
|
65128 => '\\',
|
||||||
65129 => '$',
|
65129 => '$',
|
||||||
65130 => '%',
|
65130 => '%',
|
||||||
65131 => '@',
|
65131 => '@',
|
||||||
65136 => ' ً',
|
65136 => ' ً',
|
||||||
65138 => ' ٌ',
|
65138 => ' ٌ',
|
||||||
65140 => ' ٍ',
|
65140 => ' ٍ',
|
||||||
65142 => ' َ',
|
65142 => ' َ',
|
||||||
65144 => ' ُ',
|
65144 => ' ُ',
|
||||||
65146 => ' ِ',
|
65146 => ' ِ',
|
||||||
65148 => ' ّ',
|
65148 => ' ّ',
|
||||||
65150 => ' ْ',
|
65150 => ' ْ',
|
||||||
65281 => '!',
|
65281 => '!',
|
||||||
65282 => '"',
|
65282 => '"',
|
||||||
65283 => '#',
|
65283 => '#',
|
||||||
65284 => '$',
|
65284 => '$',
|
||||||
65285 => '%',
|
65285 => '%',
|
||||||
65286 => '&',
|
65286 => '&',
|
||||||
65287 => '\'',
|
65287 => '\'',
|
||||||
65288 => '(',
|
65288 => '(',
|
||||||
65289 => ')',
|
65289 => ')',
|
||||||
65290 => '*',
|
65290 => '*',
|
||||||
65291 => '+',
|
65291 => '+',
|
||||||
65292 => ',',
|
65292 => ',',
|
||||||
65295 => '/',
|
65295 => '/',
|
||||||
65306 => ':',
|
65306 => ':',
|
||||||
65307 => ';',
|
65307 => ';',
|
||||||
65308 => '<',
|
65308 => '<',
|
||||||
65309 => '=',
|
65309 => '=',
|
||||||
65310 => '>',
|
65310 => '>',
|
||||||
65311 => '?',
|
65311 => '?',
|
||||||
65312 => '@',
|
65312 => '@',
|
||||||
65339 => '[',
|
65339 => '[',
|
||||||
65340 => '\\',
|
65340 => '\\',
|
||||||
65341 => ']',
|
65341 => ']',
|
||||||
65342 => '^',
|
65342 => '^',
|
||||||
65343 => '_',
|
65343 => '_',
|
||||||
65344 => '`',
|
65344 => '`',
|
||||||
65371 => '{',
|
65371 => '{',
|
||||||
65372 => '|',
|
65372 => '|',
|
||||||
65373 => '}',
|
65373 => '}',
|
||||||
65374 => '~',
|
65374 => '~',
|
||||||
65507 => ' ̄',
|
65507 => ' ̄',
|
||||||
127233 => '0,',
|
127233 => '0,',
|
||||||
127234 => '1,',
|
127234 => '1,',
|
||||||
127235 => '2,',
|
127235 => '2,',
|
||||||
127236 => '3,',
|
127236 => '3,',
|
||||||
127237 => '4,',
|
127237 => '4,',
|
||||||
127238 => '5,',
|
127238 => '5,',
|
||||||
127239 => '6,',
|
127239 => '6,',
|
||||||
127240 => '7,',
|
127240 => '7,',
|
||||||
127241 => '8,',
|
127241 => '8,',
|
||||||
127242 => '9,',
|
127242 => '9,',
|
||||||
127248 => '(a)',
|
127248 => '(a)',
|
||||||
127249 => '(b)',
|
127249 => '(b)',
|
||||||
127250 => '(c)',
|
127250 => '(c)',
|
||||||
127251 => '(d)',
|
127251 => '(d)',
|
||||||
127252 => '(e)',
|
127252 => '(e)',
|
||||||
127253 => '(f)',
|
127253 => '(f)',
|
||||||
127254 => '(g)',
|
127254 => '(g)',
|
||||||
127255 => '(h)',
|
127255 => '(h)',
|
||||||
127256 => '(i)',
|
127256 => '(i)',
|
||||||
127257 => '(j)',
|
127257 => '(j)',
|
||||||
127258 => '(k)',
|
127258 => '(k)',
|
||||||
127259 => '(l)',
|
127259 => '(l)',
|
||||||
127260 => '(m)',
|
127260 => '(m)',
|
||||||
127261 => '(n)',
|
127261 => '(n)',
|
||||||
127262 => '(o)',
|
127262 => '(o)',
|
||||||
127263 => '(p)',
|
127263 => '(p)',
|
||||||
127264 => '(q)',
|
127264 => '(q)',
|
||||||
127265 => '(r)',
|
127265 => '(r)',
|
||||||
127266 => '(s)',
|
127266 => '(s)',
|
||||||
127267 => '(t)',
|
127267 => '(t)',
|
||||||
127268 => '(u)',
|
127268 => '(u)',
|
||||||
127269 => '(v)',
|
127269 => '(v)',
|
||||||
127270 => '(w)',
|
127270 => '(w)',
|
||||||
127271 => '(x)',
|
127271 => '(x)',
|
||||||
127272 => '(y)',
|
127272 => '(y)',
|
||||||
127273 => '(z)',
|
127273 => '(z)',
|
||||||
);
|
);
|
||||||
|
|||||||
+71
-71
@@ -1,71 +1,71 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
0 => true,
|
0 => true,
|
||||||
1 => true,
|
1 => true,
|
||||||
2 => true,
|
2 => true,
|
||||||
3 => true,
|
3 => true,
|
||||||
4 => true,
|
4 => true,
|
||||||
5 => true,
|
5 => true,
|
||||||
6 => true,
|
6 => true,
|
||||||
7 => true,
|
7 => true,
|
||||||
8 => true,
|
8 => true,
|
||||||
9 => true,
|
9 => true,
|
||||||
10 => true,
|
10 => true,
|
||||||
11 => true,
|
11 => true,
|
||||||
12 => true,
|
12 => true,
|
||||||
13 => true,
|
13 => true,
|
||||||
14 => true,
|
14 => true,
|
||||||
15 => true,
|
15 => true,
|
||||||
16 => true,
|
16 => true,
|
||||||
17 => true,
|
17 => true,
|
||||||
18 => true,
|
18 => true,
|
||||||
19 => true,
|
19 => true,
|
||||||
20 => true,
|
20 => true,
|
||||||
21 => true,
|
21 => true,
|
||||||
22 => true,
|
22 => true,
|
||||||
23 => true,
|
23 => true,
|
||||||
24 => true,
|
24 => true,
|
||||||
25 => true,
|
25 => true,
|
||||||
26 => true,
|
26 => true,
|
||||||
27 => true,
|
27 => true,
|
||||||
28 => true,
|
28 => true,
|
||||||
29 => true,
|
29 => true,
|
||||||
30 => true,
|
30 => true,
|
||||||
31 => true,
|
31 => true,
|
||||||
32 => true,
|
32 => true,
|
||||||
33 => true,
|
33 => true,
|
||||||
34 => true,
|
34 => true,
|
||||||
35 => true,
|
35 => true,
|
||||||
36 => true,
|
36 => true,
|
||||||
37 => true,
|
37 => true,
|
||||||
38 => true,
|
38 => true,
|
||||||
39 => true,
|
39 => true,
|
||||||
40 => true,
|
40 => true,
|
||||||
41 => true,
|
41 => true,
|
||||||
42 => true,
|
42 => true,
|
||||||
43 => true,
|
43 => true,
|
||||||
44 => true,
|
44 => true,
|
||||||
47 => true,
|
47 => true,
|
||||||
58 => true,
|
58 => true,
|
||||||
59 => true,
|
59 => true,
|
||||||
60 => true,
|
60 => true,
|
||||||
61 => true,
|
61 => true,
|
||||||
62 => true,
|
62 => true,
|
||||||
63 => true,
|
63 => true,
|
||||||
64 => true,
|
64 => true,
|
||||||
91 => true,
|
91 => true,
|
||||||
92 => true,
|
92 => true,
|
||||||
93 => true,
|
93 => true,
|
||||||
94 => true,
|
94 => true,
|
||||||
95 => true,
|
95 => true,
|
||||||
96 => true,
|
96 => true,
|
||||||
123 => true,
|
123 => true,
|
||||||
124 => true,
|
124 => true,
|
||||||
125 => true,
|
125 => true,
|
||||||
126 => true,
|
126 => true,
|
||||||
127 => true,
|
127 => true,
|
||||||
8800 => true,
|
8800 => true,
|
||||||
8814 => true,
|
8814 => true,
|
||||||
8815 => true,
|
8815 => true,
|
||||||
);
|
);
|
||||||
|
|||||||
+273
-273
@@ -1,273 +1,273 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
173 => true,
|
173 => true,
|
||||||
847 => true,
|
847 => true,
|
||||||
6155 => true,
|
6155 => true,
|
||||||
6156 => true,
|
6156 => true,
|
||||||
6157 => true,
|
6157 => true,
|
||||||
8203 => true,
|
8203 => true,
|
||||||
8288 => true,
|
8288 => true,
|
||||||
8292 => true,
|
8292 => true,
|
||||||
65024 => true,
|
65024 => true,
|
||||||
65025 => true,
|
65025 => true,
|
||||||
65026 => true,
|
65026 => true,
|
||||||
65027 => true,
|
65027 => true,
|
||||||
65028 => true,
|
65028 => true,
|
||||||
65029 => true,
|
65029 => true,
|
||||||
65030 => true,
|
65030 => true,
|
||||||
65031 => true,
|
65031 => true,
|
||||||
65032 => true,
|
65032 => true,
|
||||||
65033 => true,
|
65033 => true,
|
||||||
65034 => true,
|
65034 => true,
|
||||||
65035 => true,
|
65035 => true,
|
||||||
65036 => true,
|
65036 => true,
|
||||||
65037 => true,
|
65037 => true,
|
||||||
65038 => true,
|
65038 => true,
|
||||||
65039 => true,
|
65039 => true,
|
||||||
65279 => true,
|
65279 => true,
|
||||||
113824 => true,
|
113824 => true,
|
||||||
113825 => true,
|
113825 => true,
|
||||||
113826 => true,
|
113826 => true,
|
||||||
113827 => true,
|
113827 => true,
|
||||||
917760 => true,
|
917760 => true,
|
||||||
917761 => true,
|
917761 => true,
|
||||||
917762 => true,
|
917762 => true,
|
||||||
917763 => true,
|
917763 => true,
|
||||||
917764 => true,
|
917764 => true,
|
||||||
917765 => true,
|
917765 => true,
|
||||||
917766 => true,
|
917766 => true,
|
||||||
917767 => true,
|
917767 => true,
|
||||||
917768 => true,
|
917768 => true,
|
||||||
917769 => true,
|
917769 => true,
|
||||||
917770 => true,
|
917770 => true,
|
||||||
917771 => true,
|
917771 => true,
|
||||||
917772 => true,
|
917772 => true,
|
||||||
917773 => true,
|
917773 => true,
|
||||||
917774 => true,
|
917774 => true,
|
||||||
917775 => true,
|
917775 => true,
|
||||||
917776 => true,
|
917776 => true,
|
||||||
917777 => true,
|
917777 => true,
|
||||||
917778 => true,
|
917778 => true,
|
||||||
917779 => true,
|
917779 => true,
|
||||||
917780 => true,
|
917780 => true,
|
||||||
917781 => true,
|
917781 => true,
|
||||||
917782 => true,
|
917782 => true,
|
||||||
917783 => true,
|
917783 => true,
|
||||||
917784 => true,
|
917784 => true,
|
||||||
917785 => true,
|
917785 => true,
|
||||||
917786 => true,
|
917786 => true,
|
||||||
917787 => true,
|
917787 => true,
|
||||||
917788 => true,
|
917788 => true,
|
||||||
917789 => true,
|
917789 => true,
|
||||||
917790 => true,
|
917790 => true,
|
||||||
917791 => true,
|
917791 => true,
|
||||||
917792 => true,
|
917792 => true,
|
||||||
917793 => true,
|
917793 => true,
|
||||||
917794 => true,
|
917794 => true,
|
||||||
917795 => true,
|
917795 => true,
|
||||||
917796 => true,
|
917796 => true,
|
||||||
917797 => true,
|
917797 => true,
|
||||||
917798 => true,
|
917798 => true,
|
||||||
917799 => true,
|
917799 => true,
|
||||||
917800 => true,
|
917800 => true,
|
||||||
917801 => true,
|
917801 => true,
|
||||||
917802 => true,
|
917802 => true,
|
||||||
917803 => true,
|
917803 => true,
|
||||||
917804 => true,
|
917804 => true,
|
||||||
917805 => true,
|
917805 => true,
|
||||||
917806 => true,
|
917806 => true,
|
||||||
917807 => true,
|
917807 => true,
|
||||||
917808 => true,
|
917808 => true,
|
||||||
917809 => true,
|
917809 => true,
|
||||||
917810 => true,
|
917810 => true,
|
||||||
917811 => true,
|
917811 => true,
|
||||||
917812 => true,
|
917812 => true,
|
||||||
917813 => true,
|
917813 => true,
|
||||||
917814 => true,
|
917814 => true,
|
||||||
917815 => true,
|
917815 => true,
|
||||||
917816 => true,
|
917816 => true,
|
||||||
917817 => true,
|
917817 => true,
|
||||||
917818 => true,
|
917818 => true,
|
||||||
917819 => true,
|
917819 => true,
|
||||||
917820 => true,
|
917820 => true,
|
||||||
917821 => true,
|
917821 => true,
|
||||||
917822 => true,
|
917822 => true,
|
||||||
917823 => true,
|
917823 => true,
|
||||||
917824 => true,
|
917824 => true,
|
||||||
917825 => true,
|
917825 => true,
|
||||||
917826 => true,
|
917826 => true,
|
||||||
917827 => true,
|
917827 => true,
|
||||||
917828 => true,
|
917828 => true,
|
||||||
917829 => true,
|
917829 => true,
|
||||||
917830 => true,
|
917830 => true,
|
||||||
917831 => true,
|
917831 => true,
|
||||||
917832 => true,
|
917832 => true,
|
||||||
917833 => true,
|
917833 => true,
|
||||||
917834 => true,
|
917834 => true,
|
||||||
917835 => true,
|
917835 => true,
|
||||||
917836 => true,
|
917836 => true,
|
||||||
917837 => true,
|
917837 => true,
|
||||||
917838 => true,
|
917838 => true,
|
||||||
917839 => true,
|
917839 => true,
|
||||||
917840 => true,
|
917840 => true,
|
||||||
917841 => true,
|
917841 => true,
|
||||||
917842 => true,
|
917842 => true,
|
||||||
917843 => true,
|
917843 => true,
|
||||||
917844 => true,
|
917844 => true,
|
||||||
917845 => true,
|
917845 => true,
|
||||||
917846 => true,
|
917846 => true,
|
||||||
917847 => true,
|
917847 => true,
|
||||||
917848 => true,
|
917848 => true,
|
||||||
917849 => true,
|
917849 => true,
|
||||||
917850 => true,
|
917850 => true,
|
||||||
917851 => true,
|
917851 => true,
|
||||||
917852 => true,
|
917852 => true,
|
||||||
917853 => true,
|
917853 => true,
|
||||||
917854 => true,
|
917854 => true,
|
||||||
917855 => true,
|
917855 => true,
|
||||||
917856 => true,
|
917856 => true,
|
||||||
917857 => true,
|
917857 => true,
|
||||||
917858 => true,
|
917858 => true,
|
||||||
917859 => true,
|
917859 => true,
|
||||||
917860 => true,
|
917860 => true,
|
||||||
917861 => true,
|
917861 => true,
|
||||||
917862 => true,
|
917862 => true,
|
||||||
917863 => true,
|
917863 => true,
|
||||||
917864 => true,
|
917864 => true,
|
||||||
917865 => true,
|
917865 => true,
|
||||||
917866 => true,
|
917866 => true,
|
||||||
917867 => true,
|
917867 => true,
|
||||||
917868 => true,
|
917868 => true,
|
||||||
917869 => true,
|
917869 => true,
|
||||||
917870 => true,
|
917870 => true,
|
||||||
917871 => true,
|
917871 => true,
|
||||||
917872 => true,
|
917872 => true,
|
||||||
917873 => true,
|
917873 => true,
|
||||||
917874 => true,
|
917874 => true,
|
||||||
917875 => true,
|
917875 => true,
|
||||||
917876 => true,
|
917876 => true,
|
||||||
917877 => true,
|
917877 => true,
|
||||||
917878 => true,
|
917878 => true,
|
||||||
917879 => true,
|
917879 => true,
|
||||||
917880 => true,
|
917880 => true,
|
||||||
917881 => true,
|
917881 => true,
|
||||||
917882 => true,
|
917882 => true,
|
||||||
917883 => true,
|
917883 => true,
|
||||||
917884 => true,
|
917884 => true,
|
||||||
917885 => true,
|
917885 => true,
|
||||||
917886 => true,
|
917886 => true,
|
||||||
917887 => true,
|
917887 => true,
|
||||||
917888 => true,
|
917888 => true,
|
||||||
917889 => true,
|
917889 => true,
|
||||||
917890 => true,
|
917890 => true,
|
||||||
917891 => true,
|
917891 => true,
|
||||||
917892 => true,
|
917892 => true,
|
||||||
917893 => true,
|
917893 => true,
|
||||||
917894 => true,
|
917894 => true,
|
||||||
917895 => true,
|
917895 => true,
|
||||||
917896 => true,
|
917896 => true,
|
||||||
917897 => true,
|
917897 => true,
|
||||||
917898 => true,
|
917898 => true,
|
||||||
917899 => true,
|
917899 => true,
|
||||||
917900 => true,
|
917900 => true,
|
||||||
917901 => true,
|
917901 => true,
|
||||||
917902 => true,
|
917902 => true,
|
||||||
917903 => true,
|
917903 => true,
|
||||||
917904 => true,
|
917904 => true,
|
||||||
917905 => true,
|
917905 => true,
|
||||||
917906 => true,
|
917906 => true,
|
||||||
917907 => true,
|
917907 => true,
|
||||||
917908 => true,
|
917908 => true,
|
||||||
917909 => true,
|
917909 => true,
|
||||||
917910 => true,
|
917910 => true,
|
||||||
917911 => true,
|
917911 => true,
|
||||||
917912 => true,
|
917912 => true,
|
||||||
917913 => true,
|
917913 => true,
|
||||||
917914 => true,
|
917914 => true,
|
||||||
917915 => true,
|
917915 => true,
|
||||||
917916 => true,
|
917916 => true,
|
||||||
917917 => true,
|
917917 => true,
|
||||||
917918 => true,
|
917918 => true,
|
||||||
917919 => true,
|
917919 => true,
|
||||||
917920 => true,
|
917920 => true,
|
||||||
917921 => true,
|
917921 => true,
|
||||||
917922 => true,
|
917922 => true,
|
||||||
917923 => true,
|
917923 => true,
|
||||||
917924 => true,
|
917924 => true,
|
||||||
917925 => true,
|
917925 => true,
|
||||||
917926 => true,
|
917926 => true,
|
||||||
917927 => true,
|
917927 => true,
|
||||||
917928 => true,
|
917928 => true,
|
||||||
917929 => true,
|
917929 => true,
|
||||||
917930 => true,
|
917930 => true,
|
||||||
917931 => true,
|
917931 => true,
|
||||||
917932 => true,
|
917932 => true,
|
||||||
917933 => true,
|
917933 => true,
|
||||||
917934 => true,
|
917934 => true,
|
||||||
917935 => true,
|
917935 => true,
|
||||||
917936 => true,
|
917936 => true,
|
||||||
917937 => true,
|
917937 => true,
|
||||||
917938 => true,
|
917938 => true,
|
||||||
917939 => true,
|
917939 => true,
|
||||||
917940 => true,
|
917940 => true,
|
||||||
917941 => true,
|
917941 => true,
|
||||||
917942 => true,
|
917942 => true,
|
||||||
917943 => true,
|
917943 => true,
|
||||||
917944 => true,
|
917944 => true,
|
||||||
917945 => true,
|
917945 => true,
|
||||||
917946 => true,
|
917946 => true,
|
||||||
917947 => true,
|
917947 => true,
|
||||||
917948 => true,
|
917948 => true,
|
||||||
917949 => true,
|
917949 => true,
|
||||||
917950 => true,
|
917950 => true,
|
||||||
917951 => true,
|
917951 => true,
|
||||||
917952 => true,
|
917952 => true,
|
||||||
917953 => true,
|
917953 => true,
|
||||||
917954 => true,
|
917954 => true,
|
||||||
917955 => true,
|
917955 => true,
|
||||||
917956 => true,
|
917956 => true,
|
||||||
917957 => true,
|
917957 => true,
|
||||||
917958 => true,
|
917958 => true,
|
||||||
917959 => true,
|
917959 => true,
|
||||||
917960 => true,
|
917960 => true,
|
||||||
917961 => true,
|
917961 => true,
|
||||||
917962 => true,
|
917962 => true,
|
||||||
917963 => true,
|
917963 => true,
|
||||||
917964 => true,
|
917964 => true,
|
||||||
917965 => true,
|
917965 => true,
|
||||||
917966 => true,
|
917966 => true,
|
||||||
917967 => true,
|
917967 => true,
|
||||||
917968 => true,
|
917968 => true,
|
||||||
917969 => true,
|
917969 => true,
|
||||||
917970 => true,
|
917970 => true,
|
||||||
917971 => true,
|
917971 => true,
|
||||||
917972 => true,
|
917972 => true,
|
||||||
917973 => true,
|
917973 => true,
|
||||||
917974 => true,
|
917974 => true,
|
||||||
917975 => true,
|
917975 => true,
|
||||||
917976 => true,
|
917976 => true,
|
||||||
917977 => true,
|
917977 => true,
|
||||||
917978 => true,
|
917978 => true,
|
||||||
917979 => true,
|
917979 => true,
|
||||||
917980 => true,
|
917980 => true,
|
||||||
917981 => true,
|
917981 => true,
|
||||||
917982 => true,
|
917982 => true,
|
||||||
917983 => true,
|
917983 => true,
|
||||||
917984 => true,
|
917984 => true,
|
||||||
917985 => true,
|
917985 => true,
|
||||||
917986 => true,
|
917986 => true,
|
||||||
917987 => true,
|
917987 => true,
|
||||||
917988 => true,
|
917988 => true,
|
||||||
917989 => true,
|
917989 => true,
|
||||||
917990 => true,
|
917990 => true,
|
||||||
917991 => true,
|
917991 => true,
|
||||||
917992 => true,
|
917992 => true,
|
||||||
917993 => true,
|
917993 => true,
|
||||||
917994 => true,
|
917994 => true,
|
||||||
917995 => true,
|
917995 => true,
|
||||||
917996 => true,
|
917996 => true,
|
||||||
917997 => true,
|
917997 => true,
|
||||||
917998 => true,
|
917998 => true,
|
||||||
917999 => true,
|
917999 => true,
|
||||||
);
|
);
|
||||||
|
|||||||
+5778
-5778
File diff suppressed because it is too large
Load Diff
@@ -1,65 +1,65 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return array (
|
return array (
|
||||||
2381 => 9,
|
2381 => 9,
|
||||||
2509 => 9,
|
2509 => 9,
|
||||||
2637 => 9,
|
2637 => 9,
|
||||||
2765 => 9,
|
2765 => 9,
|
||||||
2893 => 9,
|
2893 => 9,
|
||||||
3021 => 9,
|
3021 => 9,
|
||||||
3149 => 9,
|
3149 => 9,
|
||||||
3277 => 9,
|
3277 => 9,
|
||||||
3387 => 9,
|
3387 => 9,
|
||||||
3388 => 9,
|
3388 => 9,
|
||||||
3405 => 9,
|
3405 => 9,
|
||||||
3530 => 9,
|
3530 => 9,
|
||||||
3642 => 9,
|
3642 => 9,
|
||||||
3770 => 9,
|
3770 => 9,
|
||||||
3972 => 9,
|
3972 => 9,
|
||||||
4153 => 9,
|
4153 => 9,
|
||||||
4154 => 9,
|
4154 => 9,
|
||||||
5908 => 9,
|
5908 => 9,
|
||||||
5940 => 9,
|
5940 => 9,
|
||||||
6098 => 9,
|
6098 => 9,
|
||||||
6752 => 9,
|
6752 => 9,
|
||||||
6980 => 9,
|
6980 => 9,
|
||||||
7082 => 9,
|
7082 => 9,
|
||||||
7083 => 9,
|
7083 => 9,
|
||||||
7154 => 9,
|
7154 => 9,
|
||||||
7155 => 9,
|
7155 => 9,
|
||||||
11647 => 9,
|
11647 => 9,
|
||||||
43014 => 9,
|
43014 => 9,
|
||||||
43052 => 9,
|
43052 => 9,
|
||||||
43204 => 9,
|
43204 => 9,
|
||||||
43347 => 9,
|
43347 => 9,
|
||||||
43456 => 9,
|
43456 => 9,
|
||||||
43766 => 9,
|
43766 => 9,
|
||||||
44013 => 9,
|
44013 => 9,
|
||||||
68159 => 9,
|
68159 => 9,
|
||||||
69702 => 9,
|
69702 => 9,
|
||||||
69759 => 9,
|
69759 => 9,
|
||||||
69817 => 9,
|
69817 => 9,
|
||||||
69939 => 9,
|
69939 => 9,
|
||||||
69940 => 9,
|
69940 => 9,
|
||||||
70080 => 9,
|
70080 => 9,
|
||||||
70197 => 9,
|
70197 => 9,
|
||||||
70378 => 9,
|
70378 => 9,
|
||||||
70477 => 9,
|
70477 => 9,
|
||||||
70722 => 9,
|
70722 => 9,
|
||||||
70850 => 9,
|
70850 => 9,
|
||||||
71103 => 9,
|
71103 => 9,
|
||||||
71231 => 9,
|
71231 => 9,
|
||||||
71350 => 9,
|
71350 => 9,
|
||||||
71467 => 9,
|
71467 => 9,
|
||||||
71737 => 9,
|
71737 => 9,
|
||||||
71997 => 9,
|
71997 => 9,
|
||||||
71998 => 9,
|
71998 => 9,
|
||||||
72160 => 9,
|
72160 => 9,
|
||||||
72244 => 9,
|
72244 => 9,
|
||||||
72263 => 9,
|
72263 => 9,
|
||||||
72345 => 9,
|
72345 => 9,
|
||||||
72767 => 9,
|
72767 => 9,
|
||||||
73028 => 9,
|
73028 => 9,
|
||||||
73029 => 9,
|
73029 => 9,
|
||||||
73111 => 9,
|
73111 => 9,
|
||||||
);
|
);
|
||||||
|
|||||||
+145
-145
@@ -1,145 +1,145 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Intl\Idn as p;
|
use Symfony\Polyfill\Intl\Idn as p;
|
||||||
|
|
||||||
if (extension_loaded('intl')) {
|
if (extension_loaded('intl')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\PHP_VERSION_ID >= 80000) {
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
return require __DIR__.'/bootstrap80.php';
|
return require __DIR__.'/bootstrap80.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
||||||
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ERROR_START')) {
|
if (!defined('U_IDNA_ERROR_START')) {
|
||||||
define('U_IDNA_ERROR_START', 66560);
|
define('U_IDNA_ERROR_START', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
|
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
|
||||||
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
|
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
|
||||||
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
|
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
|
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
|
||||||
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
|
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
|
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
|
||||||
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
|
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
|
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
|
||||||
define('U_IDNA_VERIFICATION_ERROR', 66565);
|
define('U_IDNA_VERIFICATION_ERROR', 66565);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
|
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
|
||||||
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
|
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
|
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
|
||||||
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
|
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
|
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
|
||||||
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
|
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ERROR_LIMIT')) {
|
if (!defined('U_IDNA_ERROR_LIMIT')) {
|
||||||
define('U_IDNA_ERROR_LIMIT', 66569);
|
define('U_IDNA_ERROR_LIMIT', 66569);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
|
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
|
||||||
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
|
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
|
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
|
||||||
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
|
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
|
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
|
||||||
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
|
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_DEFAULT')) {
|
if (!defined('IDNA_DEFAULT')) {
|
||||||
define('IDNA_DEFAULT', 0);
|
define('IDNA_DEFAULT', 0);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
|
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
|
||||||
define('IDNA_ALLOW_UNASSIGNED', 1);
|
define('IDNA_ALLOW_UNASSIGNED', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_USE_STD3_RULES')) {
|
if (!defined('IDNA_USE_STD3_RULES')) {
|
||||||
define('IDNA_USE_STD3_RULES', 2);
|
define('IDNA_USE_STD3_RULES', 2);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_CHECK_BIDI')) {
|
if (!defined('IDNA_CHECK_BIDI')) {
|
||||||
define('IDNA_CHECK_BIDI', 4);
|
define('IDNA_CHECK_BIDI', 4);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_CHECK_CONTEXTJ')) {
|
if (!defined('IDNA_CHECK_CONTEXTJ')) {
|
||||||
define('IDNA_CHECK_CONTEXTJ', 8);
|
define('IDNA_CHECK_CONTEXTJ', 8);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
|
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
|
||||||
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
|
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
|
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
|
||||||
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
|
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
|
||||||
}
|
}
|
||||||
if (!defined('INTL_IDNA_VARIANT_2003')) {
|
if (!defined('INTL_IDNA_VARIANT_2003')) {
|
||||||
define('INTL_IDNA_VARIANT_2003', 0);
|
define('INTL_IDNA_VARIANT_2003', 0);
|
||||||
}
|
}
|
||||||
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
|
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||||
define('INTL_IDNA_VARIANT_UTS46', 1);
|
define('INTL_IDNA_VARIANT_UTS46', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
|
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
|
||||||
define('IDNA_ERROR_EMPTY_LABEL', 1);
|
define('IDNA_ERROR_EMPTY_LABEL', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
|
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
|
||||||
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
|
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
|
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
|
||||||
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
|
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
|
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
|
||||||
define('IDNA_ERROR_LEADING_HYPHEN', 8);
|
define('IDNA_ERROR_LEADING_HYPHEN', 8);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
|
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
|
||||||
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
|
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
|
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
|
||||||
define('IDNA_ERROR_HYPHEN_3_4', 32);
|
define('IDNA_ERROR_HYPHEN_3_4', 32);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
|
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
|
||||||
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
|
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_DISALLOWED')) {
|
if (!defined('IDNA_ERROR_DISALLOWED')) {
|
||||||
define('IDNA_ERROR_DISALLOWED', 128);
|
define('IDNA_ERROR_DISALLOWED', 128);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_PUNYCODE')) {
|
if (!defined('IDNA_ERROR_PUNYCODE')) {
|
||||||
define('IDNA_ERROR_PUNYCODE', 256);
|
define('IDNA_ERROR_PUNYCODE', 256);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
|
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
|
||||||
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
|
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
|
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
|
||||||
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_BIDI')) {
|
if (!defined('IDNA_ERROR_BIDI')) {
|
||||||
define('IDNA_ERROR_BIDI', 2048);
|
define('IDNA_ERROR_BIDI', 2048);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
||||||
define('IDNA_ERROR_CONTEXTJ', 4096);
|
define('IDNA_ERROR_CONTEXTJ', 4096);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\PHP_VERSION_ID < 70400) {
|
if (\PHP_VERSION_ID < 70400) {
|
||||||
if (!function_exists('idn_to_ascii')) {
|
if (!function_exists('idn_to_ascii')) {
|
||||||
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
if (!function_exists('idn_to_utf8')) {
|
if (!function_exists('idn_to_utf8')) {
|
||||||
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_2003, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!function_exists('idn_to_ascii')) {
|
if (!function_exists('idn_to_ascii')) {
|
||||||
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
function idn_to_ascii($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_ascii($domain, $flags, $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
if (!function_exists('idn_to_utf8')) {
|
if (!function_exists('idn_to_utf8')) {
|
||||||
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
function idn_to_utf8($domain, $flags = 0, $variant = \INTL_IDNA_VARIANT_UTS46, &$idna_info = null) { return p\Idn::idn_to_utf8($domain, $flags, $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+125
-125
@@ -1,125 +1,125 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Intl\Idn as p;
|
use Symfony\Polyfill\Intl\Idn as p;
|
||||||
|
|
||||||
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
if (!defined('U_IDNA_PROHIBITED_ERROR')) {
|
||||||
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
define('U_IDNA_PROHIBITED_ERROR', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ERROR_START')) {
|
if (!defined('U_IDNA_ERROR_START')) {
|
||||||
define('U_IDNA_ERROR_START', 66560);
|
define('U_IDNA_ERROR_START', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
|
if (!defined('U_IDNA_UNASSIGNED_ERROR')) {
|
||||||
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
define('U_IDNA_UNASSIGNED_ERROR', 66561);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
|
if (!defined('U_IDNA_CHECK_BIDI_ERROR')) {
|
||||||
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
|
define('U_IDNA_CHECK_BIDI_ERROR', 66562);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
|
if (!defined('U_IDNA_STD3_ASCII_RULES_ERROR')) {
|
||||||
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
|
define('U_IDNA_STD3_ASCII_RULES_ERROR', 66563);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
|
if (!defined('U_IDNA_ACE_PREFIX_ERROR')) {
|
||||||
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
|
define('U_IDNA_ACE_PREFIX_ERROR', 66564);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
|
if (!defined('U_IDNA_VERIFICATION_ERROR')) {
|
||||||
define('U_IDNA_VERIFICATION_ERROR', 66565);
|
define('U_IDNA_VERIFICATION_ERROR', 66565);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
|
if (!defined('U_IDNA_LABEL_TOO_LONG_ERROR')) {
|
||||||
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
|
define('U_IDNA_LABEL_TOO_LONG_ERROR', 66566);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
|
if (!defined('U_IDNA_ZERO_LENGTH_LABEL_ERROR')) {
|
||||||
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
|
define('U_IDNA_ZERO_LENGTH_LABEL_ERROR', 66567);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
|
if (!defined('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR')) {
|
||||||
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
|
define('U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR', 66568);
|
||||||
}
|
}
|
||||||
if (!defined('U_IDNA_ERROR_LIMIT')) {
|
if (!defined('U_IDNA_ERROR_LIMIT')) {
|
||||||
define('U_IDNA_ERROR_LIMIT', 66569);
|
define('U_IDNA_ERROR_LIMIT', 66569);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
|
if (!defined('U_STRINGPREP_PROHIBITED_ERROR')) {
|
||||||
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
|
define('U_STRINGPREP_PROHIBITED_ERROR', 66560);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
|
if (!defined('U_STRINGPREP_UNASSIGNED_ERROR')) {
|
||||||
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
|
define('U_STRINGPREP_UNASSIGNED_ERROR', 66561);
|
||||||
}
|
}
|
||||||
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
|
if (!defined('U_STRINGPREP_CHECK_BIDI_ERROR')) {
|
||||||
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
|
define('U_STRINGPREP_CHECK_BIDI_ERROR', 66562);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_DEFAULT')) {
|
if (!defined('IDNA_DEFAULT')) {
|
||||||
define('IDNA_DEFAULT', 0);
|
define('IDNA_DEFAULT', 0);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
|
if (!defined('IDNA_ALLOW_UNASSIGNED')) {
|
||||||
define('IDNA_ALLOW_UNASSIGNED', 1);
|
define('IDNA_ALLOW_UNASSIGNED', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_USE_STD3_RULES')) {
|
if (!defined('IDNA_USE_STD3_RULES')) {
|
||||||
define('IDNA_USE_STD3_RULES', 2);
|
define('IDNA_USE_STD3_RULES', 2);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_CHECK_BIDI')) {
|
if (!defined('IDNA_CHECK_BIDI')) {
|
||||||
define('IDNA_CHECK_BIDI', 4);
|
define('IDNA_CHECK_BIDI', 4);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_CHECK_CONTEXTJ')) {
|
if (!defined('IDNA_CHECK_CONTEXTJ')) {
|
||||||
define('IDNA_CHECK_CONTEXTJ', 8);
|
define('IDNA_CHECK_CONTEXTJ', 8);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
|
if (!defined('IDNA_NONTRANSITIONAL_TO_ASCII')) {
|
||||||
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
|
define('IDNA_NONTRANSITIONAL_TO_ASCII', 16);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
|
if (!defined('IDNA_NONTRANSITIONAL_TO_UNICODE')) {
|
||||||
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
|
define('IDNA_NONTRANSITIONAL_TO_UNICODE', 32);
|
||||||
}
|
}
|
||||||
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
|
if (!defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||||
define('INTL_IDNA_VARIANT_UTS46', 1);
|
define('INTL_IDNA_VARIANT_UTS46', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
|
if (!defined('IDNA_ERROR_EMPTY_LABEL')) {
|
||||||
define('IDNA_ERROR_EMPTY_LABEL', 1);
|
define('IDNA_ERROR_EMPTY_LABEL', 1);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
|
if (!defined('IDNA_ERROR_LABEL_TOO_LONG')) {
|
||||||
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
|
define('IDNA_ERROR_LABEL_TOO_LONG', 2);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
|
if (!defined('IDNA_ERROR_DOMAIN_NAME_TOO_LONG')) {
|
||||||
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
|
define('IDNA_ERROR_DOMAIN_NAME_TOO_LONG', 4);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
|
if (!defined('IDNA_ERROR_LEADING_HYPHEN')) {
|
||||||
define('IDNA_ERROR_LEADING_HYPHEN', 8);
|
define('IDNA_ERROR_LEADING_HYPHEN', 8);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
|
if (!defined('IDNA_ERROR_TRAILING_HYPHEN')) {
|
||||||
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
|
define('IDNA_ERROR_TRAILING_HYPHEN', 16);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
|
if (!defined('IDNA_ERROR_HYPHEN_3_4')) {
|
||||||
define('IDNA_ERROR_HYPHEN_3_4', 32);
|
define('IDNA_ERROR_HYPHEN_3_4', 32);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
|
if (!defined('IDNA_ERROR_LEADING_COMBINING_MARK')) {
|
||||||
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
|
define('IDNA_ERROR_LEADING_COMBINING_MARK', 64);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_DISALLOWED')) {
|
if (!defined('IDNA_ERROR_DISALLOWED')) {
|
||||||
define('IDNA_ERROR_DISALLOWED', 128);
|
define('IDNA_ERROR_DISALLOWED', 128);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_PUNYCODE')) {
|
if (!defined('IDNA_ERROR_PUNYCODE')) {
|
||||||
define('IDNA_ERROR_PUNYCODE', 256);
|
define('IDNA_ERROR_PUNYCODE', 256);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
|
if (!defined('IDNA_ERROR_LABEL_HAS_DOT')) {
|
||||||
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
|
define('IDNA_ERROR_LABEL_HAS_DOT', 512);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
|
if (!defined('IDNA_ERROR_INVALID_ACE_LABEL')) {
|
||||||
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
define('IDNA_ERROR_INVALID_ACE_LABEL', 1024);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_BIDI')) {
|
if (!defined('IDNA_ERROR_BIDI')) {
|
||||||
define('IDNA_ERROR_BIDI', 2048);
|
define('IDNA_ERROR_BIDI', 2048);
|
||||||
}
|
}
|
||||||
if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
if (!defined('IDNA_ERROR_CONTEXTJ')) {
|
||||||
define('IDNA_ERROR_CONTEXTJ', 4096);
|
define('IDNA_ERROR_CONTEXTJ', 4096);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('idn_to_ascii')) {
|
if (!function_exists('idn_to_ascii')) {
|
||||||
function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
function idn_to_ascii(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_ascii((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
if (!function_exists('idn_to_utf8')) {
|
if (!function_exists('idn_to_utf8')) {
|
||||||
function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
function idn_to_utf8(?string $domain, ?int $flags = IDNA_DEFAULT, ?int $variant = INTL_IDNA_VARIANT_UTS46, &$idna_info = null): string|false { return p\Idn::idn_to_utf8((string) $domain, (int) $flags, (int) $variant, $idna_info); }
|
||||||
}
|
}
|
||||||
|
|||||||
+40
-40
@@ -1,40 +1,40 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-idn",
|
"name": "symfony/polyfill-intl-idn",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
|
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
|
||||||
"keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"],
|
"keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "idn"],
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Laurent Bassin",
|
"name": "Laurent Bassin",
|
||||||
"email": "laurent@bassin.info"
|
"email": "laurent@bassin.info"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Trevor Rowbotham",
|
"name": "Trevor Rowbotham",
|
||||||
"email": "trevor.rowbotham@pm.me"
|
"email": "trevor.rowbotham@pm.me"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2",
|
"php": ">=7.2",
|
||||||
"symfony/polyfill-intl-normalizer": "^1.10"
|
"symfony/polyfill-intl-normalizer": "^1.10"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" },
|
"psr-4": { "Symfony\\Polyfill\\Intl\\Idn\\": "" },
|
||||||
"files": [ "bootstrap.php" ]
|
"files": [ "bootstrap.php" ]
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-intl": "For best performance"
|
"ext-intl": "For best performance"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"extra": {
|
"extra": {
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"url": "https://github.com/symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2015-present Fabien Potencier
|
Copyright (c) 2015-present Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
+310
-310
@@ -1,310 +1,310 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Polyfill\Intl\Normalizer;
|
namespace Symfony\Polyfill\Intl\Normalizer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension.
|
* Normalizer is a PHP fallback implementation of the Normalizer class provided by the intl extension.
|
||||||
*
|
*
|
||||||
* It has been validated with Unicode 6.3 Normalization Conformance Test.
|
* It has been validated with Unicode 6.3 Normalization Conformance Test.
|
||||||
* See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations.
|
* See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations.
|
||||||
*
|
*
|
||||||
* @author Nicolas Grekas <p@tchwork.com>
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
class Normalizer
|
class Normalizer
|
||||||
{
|
{
|
||||||
public const FORM_D = \Normalizer::FORM_D;
|
public const FORM_D = \Normalizer::FORM_D;
|
||||||
public const FORM_KD = \Normalizer::FORM_KD;
|
public const FORM_KD = \Normalizer::FORM_KD;
|
||||||
public const FORM_C = \Normalizer::FORM_C;
|
public const FORM_C = \Normalizer::FORM_C;
|
||||||
public const FORM_KC = \Normalizer::FORM_KC;
|
public const FORM_KC = \Normalizer::FORM_KC;
|
||||||
public const NFD = \Normalizer::NFD;
|
public const NFD = \Normalizer::NFD;
|
||||||
public const NFKD = \Normalizer::NFKD;
|
public const NFKD = \Normalizer::NFKD;
|
||||||
public const NFC = \Normalizer::NFC;
|
public const NFC = \Normalizer::NFC;
|
||||||
public const NFKC = \Normalizer::NFKC;
|
public const NFKC = \Normalizer::NFKC;
|
||||||
|
|
||||||
private static $C;
|
private static $C;
|
||||||
private static $D;
|
private static $D;
|
||||||
private static $KD;
|
private static $KD;
|
||||||
private static $cC;
|
private static $cC;
|
||||||
private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
|
private static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4];
|
||||||
private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
|
private static $ASCII = "\x20\x65\x69\x61\x73\x6E\x74\x72\x6F\x6C\x75\x64\x5D\x5B\x63\x6D\x70\x27\x0A\x67\x7C\x68\x76\x2E\x66\x62\x2C\x3A\x3D\x2D\x71\x31\x30\x43\x32\x2A\x79\x78\x29\x28\x4C\x39\x41\x53\x2F\x50\x22\x45\x6A\x4D\x49\x6B\x33\x3E\x35\x54\x3C\x44\x34\x7D\x42\x7B\x38\x46\x77\x52\x36\x37\x55\x47\x4E\x3B\x4A\x7A\x56\x23\x48\x4F\x57\x5F\x26\x21\x4B\x3F\x58\x51\x25\x59\x5C\x09\x5A\x2B\x7E\x5E\x24\x40\x60\x7F\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F";
|
||||||
|
|
||||||
public static function isNormalized(string $s, int $form = self::FORM_C)
|
public static function isNormalized(string $s, int $form = self::FORM_C)
|
||||||
{
|
{
|
||||||
if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) {
|
if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!isset($s[strspn($s, self::$ASCII)])) {
|
if (!isset($s[strspn($s, self::$ASCII)])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) {
|
if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return self::normalize($s, $form) === $s;
|
return self::normalize($s, $form) === $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function normalize(string $s, int $form = self::FORM_C)
|
public static function normalize(string $s, int $form = self::FORM_C)
|
||||||
{
|
{
|
||||||
if (!preg_match('//u', $s)) {
|
if (!preg_match('//u', $s)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($form) {
|
switch ($form) {
|
||||||
case self::NFC: $C = true; $K = false; break;
|
case self::NFC: $C = true; $K = false; break;
|
||||||
case self::NFD: $C = false; $K = false; break;
|
case self::NFD: $C = false; $K = false; break;
|
||||||
case self::NFKC: $C = true; $K = true; break;
|
case self::NFKC: $C = true; $K = true; break;
|
||||||
case self::NFKD: $C = false; $K = true; break;
|
case self::NFKD: $C = false; $K = true; break;
|
||||||
default:
|
default:
|
||||||
if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) {
|
if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) {
|
||||||
return $s;
|
return $s;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (80000 > \PHP_VERSION_ID) {
|
if (80000 > \PHP_VERSION_ID) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form');
|
throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('' === $s) {
|
if ('' === $s) {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($K && null === self::$KD) {
|
if ($K && null === self::$KD) {
|
||||||
self::$KD = self::getData('compatibilityDecomposition');
|
self::$KD = self::getData('compatibilityDecomposition');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === self::$D) {
|
if (null === self::$D) {
|
||||||
self::$D = self::getData('canonicalDecomposition');
|
self::$D = self::getData('canonicalDecomposition');
|
||||||
self::$cC = self::getData('combiningClass');
|
self::$cC = self::getData('combiningClass');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) {
|
if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) {
|
||||||
mb_internal_encoding('8bit');
|
mb_internal_encoding('8bit');
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = self::decompose($s, $K);
|
$r = self::decompose($s, $K);
|
||||||
|
|
||||||
if ($C) {
|
if ($C) {
|
||||||
if (null === self::$C) {
|
if (null === self::$C) {
|
||||||
self::$C = self::getData('canonicalComposition');
|
self::$C = self::getData('canonicalComposition');
|
||||||
}
|
}
|
||||||
|
|
||||||
$r = self::recompose($r);
|
$r = self::recompose($r);
|
||||||
}
|
}
|
||||||
if (null !== $mbEncoding) {
|
if (null !== $mbEncoding) {
|
||||||
mb_internal_encoding($mbEncoding);
|
mb_internal_encoding($mbEncoding);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function recompose($s)
|
private static function recompose($s)
|
||||||
{
|
{
|
||||||
$ASCII = self::$ASCII;
|
$ASCII = self::$ASCII;
|
||||||
$compMap = self::$C;
|
$compMap = self::$C;
|
||||||
$combClass = self::$cC;
|
$combClass = self::$cC;
|
||||||
$ulenMask = self::$ulenMask;
|
$ulenMask = self::$ulenMask;
|
||||||
|
|
||||||
$result = $tail = '';
|
$result = $tail = '';
|
||||||
|
|
||||||
$i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"];
|
$i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"];
|
||||||
$len = \strlen($s);
|
$len = \strlen($s);
|
||||||
|
|
||||||
$lastUchr = substr($s, 0, $i);
|
$lastUchr = substr($s, 0, $i);
|
||||||
$lastUcls = isset($combClass[$lastUchr]) ? 256 : 0;
|
$lastUcls = isset($combClass[$lastUchr]) ? 256 : 0;
|
||||||
|
|
||||||
while ($i < $len) {
|
while ($i < $len) {
|
||||||
if ($s[$i] < "\x80") {
|
if ($s[$i] < "\x80") {
|
||||||
// ASCII chars
|
// ASCII chars
|
||||||
|
|
||||||
if ($tail) {
|
if ($tail) {
|
||||||
$lastUchr .= $tail;
|
$lastUchr .= $tail;
|
||||||
$tail = '';
|
$tail = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($j = strspn($s, $ASCII, $i + 1)) {
|
if ($j = strspn($s, $ASCII, $i + 1)) {
|
||||||
$lastUchr .= substr($s, $i, $j);
|
$lastUchr .= substr($s, $i, $j);
|
||||||
$i += $j;
|
$i += $j;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= $lastUchr;
|
$result .= $lastUchr;
|
||||||
$lastUchr = $s[$i];
|
$lastUchr = $s[$i];
|
||||||
$lastUcls = 0;
|
$lastUcls = 0;
|
||||||
++$i;
|
++$i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ulen = $ulenMask[$s[$i] & "\xF0"];
|
$ulen = $ulenMask[$s[$i] & "\xF0"];
|
||||||
$uchr = substr($s, $i, $ulen);
|
$uchr = substr($s, $i, $ulen);
|
||||||
|
|
||||||
if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr
|
if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr
|
||||||
|| $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr
|
|| $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr
|
||||||
|| $lastUcls) {
|
|| $lastUcls) {
|
||||||
// Table lookup and combining chars composition
|
// Table lookup and combining chars composition
|
||||||
|
|
||||||
$ucls = $combClass[$uchr] ?? 0;
|
$ucls = $combClass[$uchr] ?? 0;
|
||||||
|
|
||||||
if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) {
|
if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) {
|
||||||
$lastUchr = $compMap[$lastUchr.$uchr];
|
$lastUchr = $compMap[$lastUchr.$uchr];
|
||||||
} elseif ($lastUcls = $ucls) {
|
} elseif ($lastUcls = $ucls) {
|
||||||
$tail .= $uchr;
|
$tail .= $uchr;
|
||||||
} else {
|
} else {
|
||||||
if ($tail) {
|
if ($tail) {
|
||||||
$lastUchr .= $tail;
|
$lastUchr .= $tail;
|
||||||
$tail = '';
|
$tail = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= $lastUchr;
|
$result .= $lastUchr;
|
||||||
$lastUchr = $uchr;
|
$lastUchr = $uchr;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Hangul chars
|
// Hangul chars
|
||||||
|
|
||||||
$L = \ord($lastUchr[2]) - 0x80;
|
$L = \ord($lastUchr[2]) - 0x80;
|
||||||
$V = \ord($uchr[2]) - 0xA1;
|
$V = \ord($uchr[2]) - 0xA1;
|
||||||
$T = 0;
|
$T = 0;
|
||||||
|
|
||||||
$uchr = substr($s, $i + $ulen, 3);
|
$uchr = substr($s, $i + $ulen, 3);
|
||||||
|
|
||||||
if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") {
|
if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") {
|
||||||
$T = \ord($uchr[2]) - 0xA7;
|
$T = \ord($uchr[2]) - 0xA7;
|
||||||
0 > $T && $T += 0x40;
|
0 > $T && $T += 0x40;
|
||||||
$ulen += 3;
|
$ulen += 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
$L = 0xAC00 + ($L * 21 + $V) * 28 + $T;
|
$L = 0xAC00 + ($L * 21 + $V) * 28 + $T;
|
||||||
$lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F);
|
$lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
$i += $ulen;
|
$i += $ulen;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result.$lastUchr.$tail;
|
return $result.$lastUchr.$tail;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function decompose($s, $c)
|
private static function decompose($s, $c)
|
||||||
{
|
{
|
||||||
$result = '';
|
$result = '';
|
||||||
|
|
||||||
$ASCII = self::$ASCII;
|
$ASCII = self::$ASCII;
|
||||||
$decompMap = self::$D;
|
$decompMap = self::$D;
|
||||||
$combClass = self::$cC;
|
$combClass = self::$cC;
|
||||||
$ulenMask = self::$ulenMask;
|
$ulenMask = self::$ulenMask;
|
||||||
if ($c) {
|
if ($c) {
|
||||||
$compatMap = self::$KD;
|
$compatMap = self::$KD;
|
||||||
}
|
}
|
||||||
|
|
||||||
$c = [];
|
$c = [];
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$len = \strlen($s);
|
$len = \strlen($s);
|
||||||
|
|
||||||
while ($i < $len) {
|
while ($i < $len) {
|
||||||
if ($s[$i] < "\x80") {
|
if ($s[$i] < "\x80") {
|
||||||
// ASCII chars
|
// ASCII chars
|
||||||
|
|
||||||
if ($c) {
|
if ($c) {
|
||||||
ksort($c);
|
ksort($c);
|
||||||
$result .= implode('', $c);
|
$result .= implode('', $c);
|
||||||
$c = [];
|
$c = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$j = 1 + strspn($s, $ASCII, $i + 1);
|
$j = 1 + strspn($s, $ASCII, $i + 1);
|
||||||
$result .= substr($s, $i, $j);
|
$result .= substr($s, $i, $j);
|
||||||
$i += $j;
|
$i += $j;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ulen = $ulenMask[$s[$i] & "\xF0"];
|
$ulen = $ulenMask[$s[$i] & "\xF0"];
|
||||||
$uchr = substr($s, $i, $ulen);
|
$uchr = substr($s, $i, $ulen);
|
||||||
$i += $ulen;
|
$i += $ulen;
|
||||||
|
|
||||||
if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) {
|
if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) {
|
||||||
// Table lookup
|
// Table lookup
|
||||||
|
|
||||||
if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) {
|
if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) {
|
||||||
$uchr = $j;
|
$uchr = $j;
|
||||||
|
|
||||||
$j = \strlen($uchr);
|
$j = \strlen($uchr);
|
||||||
$ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"];
|
$ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"];
|
||||||
|
|
||||||
if ($ulen != $j) {
|
if ($ulen != $j) {
|
||||||
// Put trailing chars in $s
|
// Put trailing chars in $s
|
||||||
|
|
||||||
$j -= $ulen;
|
$j -= $ulen;
|
||||||
$i -= $j;
|
$i -= $j;
|
||||||
|
|
||||||
if (0 > $i) {
|
if (0 > $i) {
|
||||||
$s = str_repeat(' ', -$i).$s;
|
$s = str_repeat(' ', -$i).$s;
|
||||||
$len -= $i;
|
$len -= $i;
|
||||||
$i = 0;
|
$i = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ($j--) {
|
while ($j--) {
|
||||||
$s[$i + $j] = $uchr[$ulen + $j];
|
$s[$i + $j] = $uchr[$ulen + $j];
|
||||||
}
|
}
|
||||||
|
|
||||||
$uchr = substr($uchr, 0, $ulen);
|
$uchr = substr($uchr, 0, $ulen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (isset($combClass[$uchr])) {
|
if (isset($combClass[$uchr])) {
|
||||||
// Combining chars, for sorting
|
// Combining chars, for sorting
|
||||||
|
|
||||||
if (!isset($c[$combClass[$uchr]])) {
|
if (!isset($c[$combClass[$uchr]])) {
|
||||||
$c[$combClass[$uchr]] = '';
|
$c[$combClass[$uchr]] = '';
|
||||||
}
|
}
|
||||||
$c[$combClass[$uchr]] .= $uchr;
|
$c[$combClass[$uchr]] .= $uchr;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Hangul chars
|
// Hangul chars
|
||||||
|
|
||||||
$uchr = unpack('C*', $uchr);
|
$uchr = unpack('C*', $uchr);
|
||||||
$j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80;
|
$j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80;
|
||||||
|
|
||||||
$uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588))
|
$uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588))
|
||||||
."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28));
|
."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28));
|
||||||
|
|
||||||
if ($j %= 28) {
|
if ($j %= 28) {
|
||||||
$uchr .= $j < 25
|
$uchr .= $j < 25
|
||||||
? ("\xE1\x86".\chr(0xA7 + $j))
|
? ("\xE1\x86".\chr(0xA7 + $j))
|
||||||
: ("\xE1\x87".\chr(0x67 + $j));
|
: ("\xE1\x87".\chr(0x67 + $j));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($c) {
|
if ($c) {
|
||||||
ksort($c);
|
ksort($c);
|
||||||
$result .= implode('', $c);
|
$result .= implode('', $c);
|
||||||
$c = [];
|
$c = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
$result .= $uchr;
|
$result .= $uchr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($c) {
|
if ($c) {
|
||||||
ksort($c);
|
ksort($c);
|
||||||
$result .= implode('', $c);
|
$result .= implode('', $c);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function getData($file)
|
private static function getData($file)
|
||||||
{
|
{
|
||||||
if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) {
|
if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) {
|
||||||
return require $file;
|
return require $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+17
-17
@@ -1,17 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
class Normalizer extends Symfony\Polyfill\Intl\Normalizer\Normalizer
|
class Normalizer extends Symfony\Polyfill\Intl\Normalizer\Normalizer
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @deprecated since ICU 56 and removed in PHP 8
|
* @deprecated since ICU 56 and removed in PHP 8
|
||||||
*/
|
*/
|
||||||
public const NONE = 2;
|
public const NONE = 2;
|
||||||
public const FORM_D = 4;
|
public const FORM_D = 4;
|
||||||
public const FORM_KD = 8;
|
public const FORM_KD = 8;
|
||||||
public const FORM_C = 16;
|
public const FORM_C = 16;
|
||||||
public const FORM_KC = 32;
|
public const FORM_KC = 32;
|
||||||
public const NFD = 4;
|
public const NFD = 4;
|
||||||
public const NFKD = 8;
|
public const NFKD = 8;
|
||||||
public const NFC = 16;
|
public const NFC = 16;
|
||||||
public const NFKC = 32;
|
public const NFKC = 32;
|
||||||
}
|
}
|
||||||
|
|||||||
+945
-945
File diff suppressed because it is too large
Load Diff
+2065
-2065
File diff suppressed because it is too large
Load Diff
+876
-876
File diff suppressed because it is too large
Load Diff
Vendored
+3695
-3695
File diff suppressed because it is too large
Load Diff
+23
-23
@@ -1,23 +1,23 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Intl\Normalizer as p;
|
use Symfony\Polyfill\Intl\Normalizer as p;
|
||||||
|
|
||||||
if (\PHP_VERSION_ID >= 80000) {
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
return require __DIR__.'/bootstrap80.php';
|
return require __DIR__.'/bootstrap80.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('normalizer_is_normalized')) {
|
if (!function_exists('normalizer_is_normalized')) {
|
||||||
function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); }
|
function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); }
|
||||||
}
|
}
|
||||||
if (!function_exists('normalizer_normalize')) {
|
if (!function_exists('normalizer_normalize')) {
|
||||||
function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); }
|
function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); }
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Intl\Normalizer as p;
|
use Symfony\Polyfill\Intl\Normalizer as p;
|
||||||
|
|
||||||
if (!function_exists('normalizer_is_normalized')) {
|
if (!function_exists('normalizer_is_normalized')) {
|
||||||
function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); }
|
function normalizer_is_normalized(?string $string, ?int $form = p\Normalizer::FORM_C): bool { return p\Normalizer::isNormalized((string) $string, (int) $form); }
|
||||||
}
|
}
|
||||||
if (!function_exists('normalizer_normalize')) {
|
if (!function_exists('normalizer_normalize')) {
|
||||||
function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); }
|
function normalizer_normalize(?string $string, ?int $form = p\Normalizer::FORM_C): string|false { return p\Normalizer::normalize((string) $string, (int) $form); }
|
||||||
}
|
}
|
||||||
|
|||||||
+36
-36
@@ -1,36 +1,36 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/polyfill-intl-normalizer",
|
"name": "symfony/polyfill-intl-normalizer",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Symfony polyfill for intl's Normalizer class and related functions",
|
"description": "Symfony polyfill for intl's Normalizer class and related functions",
|
||||||
"keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"],
|
"keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"],
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Nicolas Grekas",
|
"name": "Nicolas Grekas",
|
||||||
"email": "p@tchwork.com"
|
"email": "p@tchwork.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2"
|
"php": ">=7.2"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" },
|
"psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" },
|
||||||
"files": [ "bootstrap.php" ],
|
"files": [ "bootstrap.php" ],
|
||||||
"classmap": [ "Resources/stubs" ]
|
"classmap": [ "Resources/stubs" ]
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-intl": "For best performance"
|
"ext-intl": "For best performance"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"extra": {
|
"extra": {
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"url": "https://github.com/symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2015-present Fabien Potencier
|
Copyright (c) 2015-present Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
+1045
-1045
File diff suppressed because it is too large
Load Diff
+119
-119
@@ -1,119 +1,119 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'İ' => 'i̇',
|
'İ' => 'i̇',
|
||||||
'µ' => 'μ',
|
'µ' => 'μ',
|
||||||
'ſ' => 's',
|
'ſ' => 's',
|
||||||
'ͅ' => 'ι',
|
'ͅ' => 'ι',
|
||||||
'ς' => 'σ',
|
'ς' => 'σ',
|
||||||
'ϐ' => 'β',
|
'ϐ' => 'β',
|
||||||
'ϑ' => 'θ',
|
'ϑ' => 'θ',
|
||||||
'ϕ' => 'φ',
|
'ϕ' => 'φ',
|
||||||
'ϖ' => 'π',
|
'ϖ' => 'π',
|
||||||
'ϰ' => 'κ',
|
'ϰ' => 'κ',
|
||||||
'ϱ' => 'ρ',
|
'ϱ' => 'ρ',
|
||||||
'ϵ' => 'ε',
|
'ϵ' => 'ε',
|
||||||
'ẛ' => 'ṡ',
|
'ẛ' => 'ṡ',
|
||||||
'ι' => 'ι',
|
'ι' => 'ι',
|
||||||
'ß' => 'ss',
|
'ß' => 'ss',
|
||||||
'ʼn' => 'ʼn',
|
'ʼn' => 'ʼn',
|
||||||
'ǰ' => 'ǰ',
|
'ǰ' => 'ǰ',
|
||||||
'ΐ' => 'ΐ',
|
'ΐ' => 'ΐ',
|
||||||
'ΰ' => 'ΰ',
|
'ΰ' => 'ΰ',
|
||||||
'և' => 'եւ',
|
'և' => 'եւ',
|
||||||
'ẖ' => 'ẖ',
|
'ẖ' => 'ẖ',
|
||||||
'ẗ' => 'ẗ',
|
'ẗ' => 'ẗ',
|
||||||
'ẘ' => 'ẘ',
|
'ẘ' => 'ẘ',
|
||||||
'ẙ' => 'ẙ',
|
'ẙ' => 'ẙ',
|
||||||
'ẚ' => 'aʾ',
|
'ẚ' => 'aʾ',
|
||||||
'ẞ' => 'ss',
|
'ẞ' => 'ss',
|
||||||
'ὐ' => 'ὐ',
|
'ὐ' => 'ὐ',
|
||||||
'ὒ' => 'ὒ',
|
'ὒ' => 'ὒ',
|
||||||
'ὔ' => 'ὔ',
|
'ὔ' => 'ὔ',
|
||||||
'ὖ' => 'ὖ',
|
'ὖ' => 'ὖ',
|
||||||
'ᾀ' => 'ἀι',
|
'ᾀ' => 'ἀι',
|
||||||
'ᾁ' => 'ἁι',
|
'ᾁ' => 'ἁι',
|
||||||
'ᾂ' => 'ἂι',
|
'ᾂ' => 'ἂι',
|
||||||
'ᾃ' => 'ἃι',
|
'ᾃ' => 'ἃι',
|
||||||
'ᾄ' => 'ἄι',
|
'ᾄ' => 'ἄι',
|
||||||
'ᾅ' => 'ἅι',
|
'ᾅ' => 'ἅι',
|
||||||
'ᾆ' => 'ἆι',
|
'ᾆ' => 'ἆι',
|
||||||
'ᾇ' => 'ἇι',
|
'ᾇ' => 'ἇι',
|
||||||
'ᾈ' => 'ἀι',
|
'ᾈ' => 'ἀι',
|
||||||
'ᾉ' => 'ἁι',
|
'ᾉ' => 'ἁι',
|
||||||
'ᾊ' => 'ἂι',
|
'ᾊ' => 'ἂι',
|
||||||
'ᾋ' => 'ἃι',
|
'ᾋ' => 'ἃι',
|
||||||
'ᾌ' => 'ἄι',
|
'ᾌ' => 'ἄι',
|
||||||
'ᾍ' => 'ἅι',
|
'ᾍ' => 'ἅι',
|
||||||
'ᾎ' => 'ἆι',
|
'ᾎ' => 'ἆι',
|
||||||
'ᾏ' => 'ἇι',
|
'ᾏ' => 'ἇι',
|
||||||
'ᾐ' => 'ἠι',
|
'ᾐ' => 'ἠι',
|
||||||
'ᾑ' => 'ἡι',
|
'ᾑ' => 'ἡι',
|
||||||
'ᾒ' => 'ἢι',
|
'ᾒ' => 'ἢι',
|
||||||
'ᾓ' => 'ἣι',
|
'ᾓ' => 'ἣι',
|
||||||
'ᾔ' => 'ἤι',
|
'ᾔ' => 'ἤι',
|
||||||
'ᾕ' => 'ἥι',
|
'ᾕ' => 'ἥι',
|
||||||
'ᾖ' => 'ἦι',
|
'ᾖ' => 'ἦι',
|
||||||
'ᾗ' => 'ἧι',
|
'ᾗ' => 'ἧι',
|
||||||
'ᾘ' => 'ἠι',
|
'ᾘ' => 'ἠι',
|
||||||
'ᾙ' => 'ἡι',
|
'ᾙ' => 'ἡι',
|
||||||
'ᾚ' => 'ἢι',
|
'ᾚ' => 'ἢι',
|
||||||
'ᾛ' => 'ἣι',
|
'ᾛ' => 'ἣι',
|
||||||
'ᾜ' => 'ἤι',
|
'ᾜ' => 'ἤι',
|
||||||
'ᾝ' => 'ἥι',
|
'ᾝ' => 'ἥι',
|
||||||
'ᾞ' => 'ἦι',
|
'ᾞ' => 'ἦι',
|
||||||
'ᾟ' => 'ἧι',
|
'ᾟ' => 'ἧι',
|
||||||
'ᾠ' => 'ὠι',
|
'ᾠ' => 'ὠι',
|
||||||
'ᾡ' => 'ὡι',
|
'ᾡ' => 'ὡι',
|
||||||
'ᾢ' => 'ὢι',
|
'ᾢ' => 'ὢι',
|
||||||
'ᾣ' => 'ὣι',
|
'ᾣ' => 'ὣι',
|
||||||
'ᾤ' => 'ὤι',
|
'ᾤ' => 'ὤι',
|
||||||
'ᾥ' => 'ὥι',
|
'ᾥ' => 'ὥι',
|
||||||
'ᾦ' => 'ὦι',
|
'ᾦ' => 'ὦι',
|
||||||
'ᾧ' => 'ὧι',
|
'ᾧ' => 'ὧι',
|
||||||
'ᾨ' => 'ὠι',
|
'ᾨ' => 'ὠι',
|
||||||
'ᾩ' => 'ὡι',
|
'ᾩ' => 'ὡι',
|
||||||
'ᾪ' => 'ὢι',
|
'ᾪ' => 'ὢι',
|
||||||
'ᾫ' => 'ὣι',
|
'ᾫ' => 'ὣι',
|
||||||
'ᾬ' => 'ὤι',
|
'ᾬ' => 'ὤι',
|
||||||
'ᾭ' => 'ὥι',
|
'ᾭ' => 'ὥι',
|
||||||
'ᾮ' => 'ὦι',
|
'ᾮ' => 'ὦι',
|
||||||
'ᾯ' => 'ὧι',
|
'ᾯ' => 'ὧι',
|
||||||
'ᾲ' => 'ὰι',
|
'ᾲ' => 'ὰι',
|
||||||
'ᾳ' => 'αι',
|
'ᾳ' => 'αι',
|
||||||
'ᾴ' => 'άι',
|
'ᾴ' => 'άι',
|
||||||
'ᾶ' => 'ᾶ',
|
'ᾶ' => 'ᾶ',
|
||||||
'ᾷ' => 'ᾶι',
|
'ᾷ' => 'ᾶι',
|
||||||
'ᾼ' => 'αι',
|
'ᾼ' => 'αι',
|
||||||
'ῂ' => 'ὴι',
|
'ῂ' => 'ὴι',
|
||||||
'ῃ' => 'ηι',
|
'ῃ' => 'ηι',
|
||||||
'ῄ' => 'ήι',
|
'ῄ' => 'ήι',
|
||||||
'ῆ' => 'ῆ',
|
'ῆ' => 'ῆ',
|
||||||
'ῇ' => 'ῆι',
|
'ῇ' => 'ῆι',
|
||||||
'ῌ' => 'ηι',
|
'ῌ' => 'ηι',
|
||||||
'ῒ' => 'ῒ',
|
'ῒ' => 'ῒ',
|
||||||
'ῖ' => 'ῖ',
|
'ῖ' => 'ῖ',
|
||||||
'ῗ' => 'ῗ',
|
'ῗ' => 'ῗ',
|
||||||
'ῢ' => 'ῢ',
|
'ῢ' => 'ῢ',
|
||||||
'ῤ' => 'ῤ',
|
'ῤ' => 'ῤ',
|
||||||
'ῦ' => 'ῦ',
|
'ῦ' => 'ῦ',
|
||||||
'ῧ' => 'ῧ',
|
'ῧ' => 'ῧ',
|
||||||
'ῲ' => 'ὼι',
|
'ῲ' => 'ὼι',
|
||||||
'ῳ' => 'ωι',
|
'ῳ' => 'ωι',
|
||||||
'ῴ' => 'ώι',
|
'ῴ' => 'ώι',
|
||||||
'ῶ' => 'ῶ',
|
'ῶ' => 'ῶ',
|
||||||
'ῷ' => 'ῶι',
|
'ῷ' => 'ῶι',
|
||||||
'ῼ' => 'ωι',
|
'ῼ' => 'ωι',
|
||||||
'ff' => 'ff',
|
'ff' => 'ff',
|
||||||
'fi' => 'fi',
|
'fi' => 'fi',
|
||||||
'fl' => 'fl',
|
'fl' => 'fl',
|
||||||
'ffi' => 'ffi',
|
'ffi' => 'ffi',
|
||||||
'ffl' => 'ffl',
|
'ffl' => 'ffl',
|
||||||
'ſt' => 'st',
|
'ſt' => 'st',
|
||||||
'st' => 'st',
|
'st' => 'st',
|
||||||
'ﬓ' => 'մն',
|
'ﬓ' => 'մն',
|
||||||
'ﬔ' => 'մե',
|
'ﬔ' => 'մե',
|
||||||
'ﬕ' => 'մի',
|
'ﬕ' => 'մի',
|
||||||
'ﬖ' => 'վն',
|
'ﬖ' => 'վն',
|
||||||
'ﬗ' => 'մխ',
|
'ﬗ' => 'մխ',
|
||||||
];
|
];
|
||||||
|
|||||||
+1397
-1397
File diff suppressed because it is too large
Load Diff
+5
-5
File diff suppressed because one or more lines are too long
+1489
-1489
File diff suppressed because it is too large
Load Diff
+172
-172
@@ -1,172 +1,172 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Mbstring as p;
|
use Symfony\Polyfill\Mbstring as p;
|
||||||
|
|
||||||
if (\PHP_VERSION_ID >= 80000) {
|
if (\PHP_VERSION_ID >= 80000) {
|
||||||
return require __DIR__.'/bootstrap80.php';
|
return require __DIR__.'/bootstrap80.php';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_convert_encoding')) {
|
if (!function_exists('mb_convert_encoding')) {
|
||||||
function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
function mb_convert_encoding($string, $to_encoding, $from_encoding = null) { return p\Mbstring::mb_convert_encoding($string, $to_encoding, $from_encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_decode_mimeheader')) {
|
if (!function_exists('mb_decode_mimeheader')) {
|
||||||
function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
|
function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encode_mimeheader')) {
|
if (!function_exists('mb_encode_mimeheader')) {
|
||||||
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
function mb_encode_mimeheader($string, $charset = null, $transfer_encoding = null, $newline = "\r\n", $indent = 0) { return p\Mbstring::mb_encode_mimeheader($string, $charset, $transfer_encoding, $newline, $indent); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_decode_numericentity')) {
|
if (!function_exists('mb_decode_numericentity')) {
|
||||||
function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encode_numericentity')) {
|
if (!function_exists('mb_encode_numericentity')) {
|
||||||
function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
|
function mb_encode_numericentity($string, $map, $encoding = null, $hex = false) { return p\Mbstring::mb_encode_numericentity($string, $map, $encoding, $hex); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_convert_case')) {
|
if (!function_exists('mb_convert_case')) {
|
||||||
function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
|
function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_internal_encoding')) {
|
if (!function_exists('mb_internal_encoding')) {
|
||||||
function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
|
function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_language')) {
|
if (!function_exists('mb_language')) {
|
||||||
function mb_language($language = null) { return p\Mbstring::mb_language($language); }
|
function mb_language($language = null) { return p\Mbstring::mb_language($language); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_list_encodings')) {
|
if (!function_exists('mb_list_encodings')) {
|
||||||
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encoding_aliases')) {
|
if (!function_exists('mb_encoding_aliases')) {
|
||||||
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_check_encoding')) {
|
if (!function_exists('mb_check_encoding')) {
|
||||||
function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_detect_encoding')) {
|
if (!function_exists('mb_detect_encoding')) {
|
||||||
function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
|
function mb_detect_encoding($string, $encodings = null, $strict = false) { return p\Mbstring::mb_detect_encoding($string, $encodings, $strict); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_detect_order')) {
|
if (!function_exists('mb_detect_order')) {
|
||||||
function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
|
function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_parse_str')) {
|
if (!function_exists('mb_parse_str')) {
|
||||||
function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
|
function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strlen')) {
|
if (!function_exists('mb_strlen')) {
|
||||||
function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
|
function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strpos')) {
|
if (!function_exists('mb_strpos')) {
|
||||||
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
|
function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strtolower')) {
|
if (!function_exists('mb_strtolower')) {
|
||||||
function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
|
function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strtoupper')) {
|
if (!function_exists('mb_strtoupper')) {
|
||||||
function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
|
function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substitute_character')) {
|
if (!function_exists('mb_substitute_character')) {
|
||||||
function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
|
function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substr')) {
|
if (!function_exists('mb_substr')) {
|
||||||
function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
|
function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_stripos')) {
|
if (!function_exists('mb_stripos')) {
|
||||||
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
|
function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_stristr')) {
|
if (!function_exists('mb_stristr')) {
|
||||||
function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
|
function mb_stristr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_stristr($haystack, $needle, $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrchr')) {
|
if (!function_exists('mb_strrchr')) {
|
||||||
function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
|
function mb_strrchr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrchr($haystack, $needle, $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrichr')) {
|
if (!function_exists('mb_strrichr')) {
|
||||||
function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
|
function mb_strrichr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strrichr($haystack, $needle, $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strripos')) {
|
if (!function_exists('mb_strripos')) {
|
||||||
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
|
function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrpos')) {
|
if (!function_exists('mb_strrpos')) {
|
||||||
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
|
function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strstr')) {
|
if (!function_exists('mb_strstr')) {
|
||||||
function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
|
function mb_strstr($haystack, $needle, $before_needle = false, $encoding = null) { return p\Mbstring::mb_strstr($haystack, $needle, $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_get_info')) {
|
if (!function_exists('mb_get_info')) {
|
||||||
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_http_output')) {
|
if (!function_exists('mb_http_output')) {
|
||||||
function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
|
function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strwidth')) {
|
if (!function_exists('mb_strwidth')) {
|
||||||
function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
|
function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substr_count')) {
|
if (!function_exists('mb_substr_count')) {
|
||||||
function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
|
function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_output_handler')) {
|
if (!function_exists('mb_output_handler')) {
|
||||||
function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
|
function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_http_input')) {
|
if (!function_exists('mb_http_input')) {
|
||||||
function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
|
function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_convert_variables')) {
|
if (!function_exists('mb_convert_variables')) {
|
||||||
function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
|
function mb_convert_variables($to_encoding, $from_encoding, &...$vars) { return p\Mbstring::mb_convert_variables($to_encoding, $from_encoding, ...$vars); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ord')) {
|
if (!function_exists('mb_ord')) {
|
||||||
function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
|
function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_chr')) {
|
if (!function_exists('mb_chr')) {
|
||||||
function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
|
function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_scrub')) {
|
if (!function_exists('mb_scrub')) {
|
||||||
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
|
function mb_scrub($string, $encoding = null) { $encoding = null === $encoding ? mb_internal_encoding() : $encoding; return mb_convert_encoding($string, $encoding, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_str_split')) {
|
if (!function_exists('mb_str_split')) {
|
||||||
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_str_pad')) {
|
if (!function_exists('mb_str_pad')) {
|
||||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ucfirst')) {
|
if (!function_exists('mb_ucfirst')) {
|
||||||
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
function mb_ucfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_lcfirst')) {
|
if (!function_exists('mb_lcfirst')) {
|
||||||
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
function mb_lcfirst(string $string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_trim')) {
|
if (!function_exists('mb_trim')) {
|
||||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ltrim')) {
|
if (!function_exists('mb_ltrim')) {
|
||||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_rtrim')) {
|
if (!function_exists('mb_rtrim')) {
|
||||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (extension_loaded('mbstring')) {
|
if (extension_loaded('mbstring')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('MB_CASE_UPPER')) {
|
if (!defined('MB_CASE_UPPER')) {
|
||||||
define('MB_CASE_UPPER', 0);
|
define('MB_CASE_UPPER', 0);
|
||||||
}
|
}
|
||||||
if (!defined('MB_CASE_LOWER')) {
|
if (!defined('MB_CASE_LOWER')) {
|
||||||
define('MB_CASE_LOWER', 1);
|
define('MB_CASE_LOWER', 1);
|
||||||
}
|
}
|
||||||
if (!defined('MB_CASE_TITLE')) {
|
if (!defined('MB_CASE_TITLE')) {
|
||||||
define('MB_CASE_TITLE', 2);
|
define('MB_CASE_TITLE', 2);
|
||||||
}
|
}
|
||||||
|
|||||||
+167
-167
@@ -1,167 +1,167 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Polyfill\Mbstring as p;
|
use Symfony\Polyfill\Mbstring as p;
|
||||||
|
|
||||||
if (!function_exists('mb_convert_encoding')) {
|
if (!function_exists('mb_convert_encoding')) {
|
||||||
function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
|
function mb_convert_encoding(array|string|null $string, ?string $to_encoding, array|string|null $from_encoding = null): array|string|false { return p\Mbstring::mb_convert_encoding($string ?? '', (string) $to_encoding, $from_encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_decode_mimeheader')) {
|
if (!function_exists('mb_decode_mimeheader')) {
|
||||||
function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
|
function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encode_mimeheader')) {
|
if (!function_exists('mb_encode_mimeheader')) {
|
||||||
function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
|
function mb_encode_mimeheader(?string $string, ?string $charset = null, ?string $transfer_encoding = null, ?string $newline = "\r\n", ?int $indent = 0): string { return p\Mbstring::mb_encode_mimeheader((string) $string, $charset, $transfer_encoding, (string) $newline, (int) $indent); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_decode_numericentity')) {
|
if (!function_exists('mb_decode_numericentity')) {
|
||||||
function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
|
function mb_decode_numericentity(?string $string, array $map, ?string $encoding = null): string { return p\Mbstring::mb_decode_numericentity((string) $string, $map, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encode_numericentity')) {
|
if (!function_exists('mb_encode_numericentity')) {
|
||||||
function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
|
function mb_encode_numericentity(?string $string, array $map, ?string $encoding = null, ?bool $hex = false): string { return p\Mbstring::mb_encode_numericentity((string) $string, $map, $encoding, (bool) $hex); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_convert_case')) {
|
if (!function_exists('mb_convert_case')) {
|
||||||
function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
|
function mb_convert_case(?string $string, ?int $mode, ?string $encoding = null): string { return p\Mbstring::mb_convert_case((string) $string, (int) $mode, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_internal_encoding')) {
|
if (!function_exists('mb_internal_encoding')) {
|
||||||
function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
|
function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_language')) {
|
if (!function_exists('mb_language')) {
|
||||||
function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
|
function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_list_encodings')) {
|
if (!function_exists('mb_list_encodings')) {
|
||||||
function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
|
function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_encoding_aliases')) {
|
if (!function_exists('mb_encoding_aliases')) {
|
||||||
function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
|
function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_check_encoding')) {
|
if (!function_exists('mb_check_encoding')) {
|
||||||
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
function mb_check_encoding(array|string|null $value = null, ?string $encoding = null): bool { return p\Mbstring::mb_check_encoding($value, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_detect_encoding')) {
|
if (!function_exists('mb_detect_encoding')) {
|
||||||
function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
|
function mb_detect_encoding(?string $string, array|string|null $encodings = null, ?bool $strict = false): string|false { return p\Mbstring::mb_detect_encoding((string) $string, $encodings, (bool) $strict); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_detect_order')) {
|
if (!function_exists('mb_detect_order')) {
|
||||||
function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
|
function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_parse_str')) {
|
if (!function_exists('mb_parse_str')) {
|
||||||
function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; }
|
function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strlen')) {
|
if (!function_exists('mb_strlen')) {
|
||||||
function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
|
function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strpos')) {
|
if (!function_exists('mb_strpos')) {
|
||||||
function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
function mb_strpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strtolower')) {
|
if (!function_exists('mb_strtolower')) {
|
||||||
function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
|
function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strtoupper')) {
|
if (!function_exists('mb_strtoupper')) {
|
||||||
function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
|
function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substitute_character')) {
|
if (!function_exists('mb_substitute_character')) {
|
||||||
function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
|
function mb_substitute_character(string|int|null $substitute_character = null): string|int|bool { return p\Mbstring::mb_substitute_character($substitute_character); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substr')) {
|
if (!function_exists('mb_substr')) {
|
||||||
function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
|
function mb_substr(?string $string, ?int $start, ?int $length = null, ?string $encoding = null): string { return p\Mbstring::mb_substr((string) $string, (int) $start, $length, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_stripos')) {
|
if (!function_exists('mb_stripos')) {
|
||||||
function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
function mb_stripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_stripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_stristr')) {
|
if (!function_exists('mb_stristr')) {
|
||||||
function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
function mb_stristr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_stristr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrchr')) {
|
if (!function_exists('mb_strrchr')) {
|
||||||
function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
function mb_strrchr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrchr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrichr')) {
|
if (!function_exists('mb_strrichr')) {
|
||||||
function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
function mb_strrichr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strrichr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strripos')) {
|
if (!function_exists('mb_strripos')) {
|
||||||
function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
function mb_strripos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strripos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strrpos')) {
|
if (!function_exists('mb_strrpos')) {
|
||||||
function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
function mb_strrpos(?string $haystack, ?string $needle, ?int $offset = 0, ?string $encoding = null): int|false { return p\Mbstring::mb_strrpos((string) $haystack, (string) $needle, (int) $offset, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strstr')) {
|
if (!function_exists('mb_strstr')) {
|
||||||
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
function mb_strstr(?string $haystack, ?string $needle, ?bool $before_needle = false, ?string $encoding = null): string|false { return p\Mbstring::mb_strstr((string) $haystack, (string) $needle, (bool) $before_needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_get_info')) {
|
if (!function_exists('mb_get_info')) {
|
||||||
function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); }
|
function mb_get_info(?string $type = 'all'): array|string|int|false|null { return p\Mbstring::mb_get_info((string) $type); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_http_output')) {
|
if (!function_exists('mb_http_output')) {
|
||||||
function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
|
function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_strwidth')) {
|
if (!function_exists('mb_strwidth')) {
|
||||||
function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
|
function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_substr_count')) {
|
if (!function_exists('mb_substr_count')) {
|
||||||
function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
|
function mb_substr_count(?string $haystack, ?string $needle, ?string $encoding = null): int { return p\Mbstring::mb_substr_count((string) $haystack, (string) $needle, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_output_handler')) {
|
if (!function_exists('mb_output_handler')) {
|
||||||
function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
|
function mb_output_handler(?string $string, ?int $status): string { return p\Mbstring::mb_output_handler((string) $string, (int) $status); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_http_input')) {
|
if (!function_exists('mb_http_input')) {
|
||||||
function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
|
function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_convert_variables')) {
|
if (!function_exists('mb_convert_variables')) {
|
||||||
function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
|
function mb_convert_variables(?string $to_encoding, array|string|null $from_encoding, mixed &$var, mixed &...$vars): string|false { return p\Mbstring::mb_convert_variables((string) $to_encoding, $from_encoding ?? '', $var, ...$vars); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ord')) {
|
if (!function_exists('mb_ord')) {
|
||||||
function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
|
function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_chr')) {
|
if (!function_exists('mb_chr')) {
|
||||||
function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
|
function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_scrub')) {
|
if (!function_exists('mb_scrub')) {
|
||||||
function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
|
function mb_scrub(?string $string, ?string $encoding = null): string { $encoding ??= mb_internal_encoding(); return mb_convert_encoding((string) $string, $encoding, $encoding); }
|
||||||
}
|
}
|
||||||
if (!function_exists('mb_str_split')) {
|
if (!function_exists('mb_str_split')) {
|
||||||
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
|
function mb_str_split(?string $string, ?int $length = 1, ?string $encoding = null): array { return p\Mbstring::mb_str_split((string) $string, (int) $length, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_str_pad')) {
|
if (!function_exists('mb_str_pad')) {
|
||||||
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
function mb_str_pad(string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, ?string $encoding = null): string { return p\Mbstring::mb_str_pad($string, $length, $pad_string, $pad_type, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ucfirst')) {
|
if (!function_exists('mb_ucfirst')) {
|
||||||
function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
function mb_ucfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_ucfirst($string, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_lcfirst')) {
|
if (!function_exists('mb_lcfirst')) {
|
||||||
function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
function mb_lcfirst($string, ?string $encoding = null): string { return p\Mbstring::mb_lcfirst($string, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_trim')) {
|
if (!function_exists('mb_trim')) {
|
||||||
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
function mb_trim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_trim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_ltrim')) {
|
if (!function_exists('mb_ltrim')) {
|
||||||
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
function mb_ltrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_ltrim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_rtrim')) {
|
if (!function_exists('mb_rtrim')) {
|
||||||
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
function mb_rtrim(string $string, ?string $characters = null, ?string $encoding = null): string { return p\Mbstring::mb_rtrim($string, $characters, $encoding); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extension_loaded('mbstring')) {
|
if (extension_loaded('mbstring')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined('MB_CASE_UPPER')) {
|
if (!defined('MB_CASE_UPPER')) {
|
||||||
define('MB_CASE_UPPER', 0);
|
define('MB_CASE_UPPER', 0);
|
||||||
}
|
}
|
||||||
if (!defined('MB_CASE_LOWER')) {
|
if (!defined('MB_CASE_LOWER')) {
|
||||||
define('MB_CASE_LOWER', 1);
|
define('MB_CASE_LOWER', 1);
|
||||||
}
|
}
|
||||||
if (!defined('MB_CASE_TITLE')) {
|
if (!defined('MB_CASE_TITLE')) {
|
||||||
define('MB_CASE_TITLE', 2);
|
define('MB_CASE_TITLE', 2);
|
||||||
}
|
}
|
||||||
|
|||||||
+38
-38
@@ -1,38 +1,38 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/polyfill-mbstring",
|
"name": "symfony/polyfill-mbstring",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Symfony polyfill for the Mbstring extension",
|
"description": "Symfony polyfill for the Mbstring extension",
|
||||||
"keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"],
|
"keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"],
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Nicolas Grekas",
|
"name": "Nicolas Grekas",
|
||||||
"email": "p@tchwork.com"
|
"email": "p@tchwork.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.2"
|
"php": ">=7.2"
|
||||||
},
|
},
|
||||||
"provide": {
|
"provide": {
|
||||||
"ext-mbstring": "*"
|
"ext-mbstring": "*"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
|
"psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" },
|
||||||
"files": [ "bootstrap.php" ]
|
"files": [ "bootstrap.php" ]
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"ext-mbstring": "For best performance"
|
"ext-mbstring": "For best performance"
|
||||||
},
|
},
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
"extra": {
|
"extra": {
|
||||||
"thanks": {
|
"thanks": {
|
||||||
"name": "symfony/polyfill",
|
"name": "symfony/polyfill",
|
||||||
"url": "https://github.com/symfony/polyfill"
|
"url": "https://github.com/symfony/polyfill"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+276
-276
@@ -1,276 +1,276 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Command;
|
namespace Symfony\Component\Yaml\Command;
|
||||||
|
|
||||||
use Symfony\Component\Console\Attribute\AsCommand;
|
use Symfony\Component\Console\Attribute\AsCommand;
|
||||||
use Symfony\Component\Console\CI\GithubActionReporter;
|
use Symfony\Component\Console\CI\GithubActionReporter;
|
||||||
use Symfony\Component\Console\Command\Command;
|
use Symfony\Component\Console\Command\Command;
|
||||||
use Symfony\Component\Console\Completion\CompletionInput;
|
use Symfony\Component\Console\Completion\CompletionInput;
|
||||||
use Symfony\Component\Console\Completion\CompletionSuggestions;
|
use Symfony\Component\Console\Completion\CompletionSuggestions;
|
||||||
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
use Symfony\Component\Console\Exception\InvalidArgumentException;
|
||||||
use Symfony\Component\Console\Exception\RuntimeException;
|
use Symfony\Component\Console\Exception\RuntimeException;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||||
use Symfony\Component\Yaml\Exception\ParseException;
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
use Symfony\Component\Yaml\Parser;
|
use Symfony\Component\Yaml\Parser;
|
||||||
use Symfony\Component\Yaml\Yaml;
|
use Symfony\Component\Yaml\Yaml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates YAML files syntax and outputs encountered errors.
|
* Validates YAML files syntax and outputs encountered errors.
|
||||||
*
|
*
|
||||||
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
* @author Grégoire Pineau <lyrixx@lyrixx.info>
|
||||||
* @author Robin Chalas <robin.chalas@gmail.com>
|
* @author Robin Chalas <robin.chalas@gmail.com>
|
||||||
*/
|
*/
|
||||||
#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')]
|
#[AsCommand(name: 'lint:yaml', description: 'Lint a YAML file and outputs encountered errors')]
|
||||||
class LintCommand extends Command
|
class LintCommand extends Command
|
||||||
{
|
{
|
||||||
private Parser $parser;
|
private Parser $parser;
|
||||||
private ?string $format = null;
|
private ?string $format = null;
|
||||||
private bool $displayCorrectFiles;
|
private bool $displayCorrectFiles;
|
||||||
private ?\Closure $directoryIteratorProvider;
|
private ?\Closure $directoryIteratorProvider;
|
||||||
private ?\Closure $isReadableProvider;
|
private ?\Closure $isReadableProvider;
|
||||||
|
|
||||||
public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null)
|
public function __construct(?string $name = null, ?callable $directoryIteratorProvider = null, ?callable $isReadableProvider = null)
|
||||||
{
|
{
|
||||||
parent::__construct($name);
|
parent::__construct($name);
|
||||||
|
|
||||||
$this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...);
|
$this->directoryIteratorProvider = null === $directoryIteratorProvider ? null : $directoryIteratorProvider(...);
|
||||||
$this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
|
$this->isReadableProvider = null === $isReadableProvider ? null : $isReadableProvider(...);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
protected function configure()
|
protected function configure()
|
||||||
{
|
{
|
||||||
$this
|
$this
|
||||||
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
|
->addArgument('filename', InputArgument::IS_ARRAY, 'A file, a directory or "-" for reading from STDIN')
|
||||||
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
|
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format ("%s")', implode('", "', $this->getAvailableFormatOptions())))
|
||||||
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
|
->addOption('exclude', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Path(s) to exclude')
|
||||||
->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
|
->addOption('parse-tags', null, InputOption::VALUE_NEGATABLE, 'Parse custom tags', null)
|
||||||
->setHelp(<<<EOF
|
->setHelp(<<<EOF
|
||||||
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
|
The <info>%command.name%</info> command lints a YAML file and outputs to STDOUT
|
||||||
the first encountered syntax error.
|
the first encountered syntax error.
|
||||||
|
|
||||||
You can validates YAML contents passed from STDIN:
|
You can validates YAML contents passed from STDIN:
|
||||||
|
|
||||||
<info>cat filename | php %command.full_name% -</info>
|
<info>cat filename | php %command.full_name% -</info>
|
||||||
|
|
||||||
You can also validate the syntax of a file:
|
You can also validate the syntax of a file:
|
||||||
|
|
||||||
<info>php %command.full_name% filename</info>
|
<info>php %command.full_name% filename</info>
|
||||||
|
|
||||||
Or of a whole directory:
|
Or of a whole directory:
|
||||||
|
|
||||||
<info>php %command.full_name% dirname</info>
|
<info>php %command.full_name% dirname</info>
|
||||||
<info>php %command.full_name% dirname --format=json</info>
|
<info>php %command.full_name% dirname --format=json</info>
|
||||||
|
|
||||||
You can also exclude one or more specific files:
|
You can also exclude one or more specific files:
|
||||||
|
|
||||||
<info>php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml"</info>
|
<info>php %command.full_name% dirname --exclude="dirname/foo.yaml" --exclude="dirname/bar.yaml"</info>
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||||
{
|
{
|
||||||
$io = new SymfonyStyle($input, $output);
|
$io = new SymfonyStyle($input, $output);
|
||||||
$filenames = (array) $input->getArgument('filename');
|
$filenames = (array) $input->getArgument('filename');
|
||||||
$excludes = $input->getOption('exclude');
|
$excludes = $input->getOption('exclude');
|
||||||
$this->format = $input->getOption('format');
|
$this->format = $input->getOption('format');
|
||||||
$flags = $input->getOption('parse-tags');
|
$flags = $input->getOption('parse-tags');
|
||||||
|
|
||||||
if (null === $this->format) {
|
if (null === $this->format) {
|
||||||
// Autodetect format according to CI environment
|
// Autodetect format according to CI environment
|
||||||
$this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt';
|
$this->format = class_exists(GithubActionReporter::class) && GithubActionReporter::isGithubActionEnvironment() ? 'github' : 'txt';
|
||||||
}
|
}
|
||||||
|
|
||||||
$flags = $flags ? Yaml::PARSE_CUSTOM_TAGS : 0;
|
$flags = $flags ? Yaml::PARSE_CUSTOM_TAGS : 0;
|
||||||
|
|
||||||
$this->displayCorrectFiles = $output->isVerbose();
|
$this->displayCorrectFiles = $output->isVerbose();
|
||||||
|
|
||||||
if (['-'] === $filenames) {
|
if (['-'] === $filenames) {
|
||||||
return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]);
|
return $this->display($io, [$this->validate(file_get_contents('php://stdin'), $flags)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$filenames) {
|
if (!$filenames) {
|
||||||
throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
|
throw new RuntimeException('Please provide a filename or pipe file content to STDIN.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$filesInfo = [];
|
$filesInfo = [];
|
||||||
foreach ($filenames as $filename) {
|
foreach ($filenames as $filename) {
|
||||||
if (!$this->isReadable($filename)) {
|
if (!$this->isReadable($filename)) {
|
||||||
throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
|
throw new RuntimeException(sprintf('File or directory "%s" is not readable.', $filename));
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->getFiles($filename) as $file) {
|
foreach ($this->getFiles($filename) as $file) {
|
||||||
if (!\in_array($file->getPathname(), $excludes, true)) {
|
if (!\in_array($file->getPathname(), $excludes, true)) {
|
||||||
$filesInfo[] = $this->validate(file_get_contents($file), $flags, $file);
|
$filesInfo[] = $this->validate(file_get_contents($file), $flags, $file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->display($io, $filesInfo);
|
return $this->display($io, $filesInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function validate(string $content, int $flags, ?string $file = null): array
|
private function validate(string $content, int $flags, ?string $file = null): array
|
||||||
{
|
{
|
||||||
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
|
$prevErrorHandler = set_error_handler(function ($level, $message, $file, $line) use (&$prevErrorHandler) {
|
||||||
if (\E_USER_DEPRECATED === $level) {
|
if (\E_USER_DEPRECATED === $level) {
|
||||||
throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1);
|
throw new ParseException($message, $this->getParser()->getRealCurrentLineNb() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false;
|
return $prevErrorHandler ? $prevErrorHandler($level, $message, $file, $line) : false;
|
||||||
});
|
});
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags);
|
$this->getParser()->parse($content, Yaml::PARSE_CONSTANT | $flags);
|
||||||
} catch (ParseException $e) {
|
} catch (ParseException $e) {
|
||||||
return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()];
|
return ['file' => $file, 'line' => $e->getParsedLine(), 'valid' => false, 'message' => $e->getMessage()];
|
||||||
} finally {
|
} finally {
|
||||||
restore_error_handler();
|
restore_error_handler();
|
||||||
}
|
}
|
||||||
|
|
||||||
return ['file' => $file, 'valid' => true];
|
return ['file' => $file, 'valid' => true];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function display(SymfonyStyle $io, array $files): int
|
private function display(SymfonyStyle $io, array $files): int
|
||||||
{
|
{
|
||||||
return match ($this->format) {
|
return match ($this->format) {
|
||||||
'txt' => $this->displayTxt($io, $files),
|
'txt' => $this->displayTxt($io, $files),
|
||||||
'json' => $this->displayJson($io, $files),
|
'json' => $this->displayJson($io, $files),
|
||||||
'github' => $this->displayTxt($io, $files, true),
|
'github' => $this->displayTxt($io, $files, true),
|
||||||
default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
|
default => throw new InvalidArgumentException(sprintf('Supported formats are "%s".', implode('", "', $this->getAvailableFormatOptions()))),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int
|
private function displayTxt(SymfonyStyle $io, array $filesInfo, bool $errorAsGithubAnnotations = false): int
|
||||||
{
|
{
|
||||||
$countFiles = \count($filesInfo);
|
$countFiles = \count($filesInfo);
|
||||||
$erroredFiles = 0;
|
$erroredFiles = 0;
|
||||||
$suggestTagOption = false;
|
$suggestTagOption = false;
|
||||||
|
|
||||||
if ($errorAsGithubAnnotations) {
|
if ($errorAsGithubAnnotations) {
|
||||||
$githubReporter = new GithubActionReporter($io);
|
$githubReporter = new GithubActionReporter($io);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($filesInfo as $info) {
|
foreach ($filesInfo as $info) {
|
||||||
if ($info['valid'] && $this->displayCorrectFiles) {
|
if ($info['valid'] && $this->displayCorrectFiles) {
|
||||||
$io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
$io->comment('<info>OK</info>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
||||||
} elseif (!$info['valid']) {
|
} elseif (!$info['valid']) {
|
||||||
++$erroredFiles;
|
++$erroredFiles;
|
||||||
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
$io->text('<error> ERROR </error>'.($info['file'] ? sprintf(' in %s', $info['file']) : ''));
|
||||||
$io->text(sprintf('<error> >> %s</error>', $info['message']));
|
$io->text(sprintf('<error> >> %s</error>', $info['message']));
|
||||||
|
|
||||||
if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) {
|
if (str_contains($info['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||||
$suggestTagOption = true;
|
$suggestTagOption = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($errorAsGithubAnnotations) {
|
if ($errorAsGithubAnnotations) {
|
||||||
$githubReporter->error($info['message'], $info['file'] ?? 'php://stdin', $info['line']);
|
$githubReporter->error($info['message'], $info['file'] ?? 'php://stdin', $info['line']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0 === $erroredFiles) {
|
if (0 === $erroredFiles) {
|
||||||
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
|
$io->success(sprintf('All %d YAML files contain valid syntax.', $countFiles));
|
||||||
} else {
|
} else {
|
||||||
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
|
$io->warning(sprintf('%d YAML files have valid syntax and %d contain errors.%s', $countFiles - $erroredFiles, $erroredFiles, $suggestTagOption ? ' Use the --parse-tags option if you want parse custom tags.' : ''));
|
||||||
}
|
}
|
||||||
|
|
||||||
return min($erroredFiles, 1);
|
return min($erroredFiles, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function displayJson(SymfonyStyle $io, array $filesInfo): int
|
private function displayJson(SymfonyStyle $io, array $filesInfo): int
|
||||||
{
|
{
|
||||||
$errors = 0;
|
$errors = 0;
|
||||||
|
|
||||||
array_walk($filesInfo, function (&$v) use (&$errors) {
|
array_walk($filesInfo, function (&$v) use (&$errors) {
|
||||||
$v['file'] = (string) $v['file'];
|
$v['file'] = (string) $v['file'];
|
||||||
if (!$v['valid']) {
|
if (!$v['valid']) {
|
||||||
++$errors;
|
++$errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($v['message']) && str_contains($v['message'], 'PARSE_CUSTOM_TAGS')) {
|
if (isset($v['message']) && str_contains($v['message'], 'PARSE_CUSTOM_TAGS')) {
|
||||||
$v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
|
$v['message'] .= ' Use the --parse-tags option if you want parse custom tags.';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
|
$io->writeln(json_encode($filesInfo, \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
|
||||||
|
|
||||||
return min($errors, 1);
|
return min($errors, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getFiles(string $fileOrDirectory): iterable
|
private function getFiles(string $fileOrDirectory): iterable
|
||||||
{
|
{
|
||||||
if (is_file($fileOrDirectory)) {
|
if (is_file($fileOrDirectory)) {
|
||||||
yield new \SplFileInfo($fileOrDirectory);
|
yield new \SplFileInfo($fileOrDirectory);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) {
|
foreach ($this->getDirectoryIterator($fileOrDirectory) as $file) {
|
||||||
if (!\in_array($file->getExtension(), ['yml', 'yaml'])) {
|
if (!\in_array($file->getExtension(), ['yml', 'yaml'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
yield $file;
|
yield $file;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getParser(): Parser
|
private function getParser(): Parser
|
||||||
{
|
{
|
||||||
return $this->parser ??= new Parser();
|
return $this->parser ??= new Parser();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getDirectoryIterator(string $directory): iterable
|
private function getDirectoryIterator(string $directory): iterable
|
||||||
{
|
{
|
||||||
$default = fn ($directory) => new \RecursiveIteratorIterator(
|
$default = fn ($directory) => new \RecursiveIteratorIterator(
|
||||||
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
|
new \RecursiveDirectoryIterator($directory, \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS),
|
||||||
\RecursiveIteratorIterator::LEAVES_ONLY
|
\RecursiveIteratorIterator::LEAVES_ONLY
|
||||||
);
|
);
|
||||||
|
|
||||||
if (null !== $this->directoryIteratorProvider) {
|
if (null !== $this->directoryIteratorProvider) {
|
||||||
return ($this->directoryIteratorProvider)($directory, $default);
|
return ($this->directoryIteratorProvider)($directory, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $default($directory);
|
return $default($directory);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function isReadable(string $fileOrDirectory): bool
|
private function isReadable(string $fileOrDirectory): bool
|
||||||
{
|
{
|
||||||
$default = is_readable(...);
|
$default = is_readable(...);
|
||||||
|
|
||||||
if (null !== $this->isReadableProvider) {
|
if (null !== $this->isReadableProvider) {
|
||||||
return ($this->isReadableProvider)($fileOrDirectory, $default);
|
return ($this->isReadableProvider)($fileOrDirectory, $default);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $default($fileOrDirectory);
|
return $default($fileOrDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
|
public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void
|
||||||
{
|
{
|
||||||
if ($input->mustSuggestOptionValuesFor('format')) {
|
if ($input->mustSuggestOptionValuesFor('format')) {
|
||||||
$suggestions->suggestValues($this->getAvailableFormatOptions());
|
$suggestions->suggestValues($this->getAvailableFormatOptions());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getAvailableFormatOptions(): array
|
private function getAvailableFormatOptions(): array
|
||||||
{
|
{
|
||||||
return ['txt', 'json', 'github'];
|
return ['txt', 'json', 'github'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+178
-178
@@ -1,178 +1,178 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml;
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
use Symfony\Component\Yaml\Tag\TaggedValue;
|
use Symfony\Component\Yaml\Tag\TaggedValue;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumper dumps PHP variables to YAML strings.
|
* Dumper dumps PHP variables to YAML strings.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* @final
|
* @final
|
||||||
*/
|
*/
|
||||||
class Dumper
|
class Dumper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* The amount of spaces to use for indentation of nested nodes.
|
* The amount of spaces to use for indentation of nested nodes.
|
||||||
*/
|
*/
|
||||||
private int $indentation;
|
private int $indentation;
|
||||||
|
|
||||||
public function __construct(int $indentation = 4)
|
public function __construct(int $indentation = 4)
|
||||||
{
|
{
|
||||||
if ($indentation < 1) {
|
if ($indentation < 1) {
|
||||||
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
throw new \InvalidArgumentException('The indentation must be greater than zero.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->indentation = $indentation;
|
$this->indentation = $indentation;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumps a PHP value to YAML.
|
* Dumps a PHP value to YAML.
|
||||||
*
|
*
|
||||||
* @param mixed $input The PHP value
|
* @param mixed $input The PHP value
|
||||||
* @param int $inline The level where you switch to inline YAML
|
* @param int $inline The level where you switch to inline YAML
|
||||||
* @param int $indent The level of indentation (used internally)
|
* @param int $indent The level of indentation (used internally)
|
||||||
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
|
* @param int $flags A bit field of Yaml::DUMP_* constants to customize the dumped YAML string
|
||||||
*/
|
*/
|
||||||
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
|
public function dump(mixed $input, int $inline = 0, int $indent = 0, int $flags = 0): string
|
||||||
{
|
{
|
||||||
$output = '';
|
$output = '';
|
||||||
$prefix = $indent ? str_repeat(' ', $indent) : '';
|
$prefix = $indent ? str_repeat(' ', $indent) : '';
|
||||||
$dumpObjectAsInlineMap = true;
|
$dumpObjectAsInlineMap = true;
|
||||||
|
|
||||||
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) {
|
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($input instanceof \ArrayObject || $input instanceof \stdClass)) {
|
||||||
$dumpObjectAsInlineMap = empty((array) $input);
|
$dumpObjectAsInlineMap = empty((array) $input);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) {
|
if ($inline <= 0 || (!\is_array($input) && !$input instanceof TaggedValue && $dumpObjectAsInlineMap) || empty($input)) {
|
||||||
$output .= $prefix.Inline::dump($input, $flags);
|
$output .= $prefix.Inline::dump($input, $flags);
|
||||||
} elseif ($input instanceof TaggedValue) {
|
} elseif ($input instanceof TaggedValue) {
|
||||||
$output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix);
|
$output .= $this->dumpTaggedValue($input, $inline, $indent, $flags, $prefix);
|
||||||
} else {
|
} else {
|
||||||
$dumpAsMap = Inline::isHash($input);
|
$dumpAsMap = Inline::isHash($input);
|
||||||
|
|
||||||
foreach ($input as $key => $value) {
|
foreach ($input as $key => $value) {
|
||||||
if ('' !== $output && "\n" !== $output[-1]) {
|
if ('' !== $output && "\n" !== $output[-1]) {
|
||||||
$output .= "\n";
|
$output .= "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) {
|
if (\is_int($key) && Yaml::DUMP_NUMERIC_KEY_AS_STRING & $flags) {
|
||||||
$key = (string) $key;
|
$key = (string) $key;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && str_contains($value, "\n") && !str_contains($value, "\r")) {
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value) && str_contains($value, "\n") && !str_contains($value, "\r")) {
|
||||||
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value);
|
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value);
|
||||||
|
|
||||||
if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) {
|
if (isset($value[-2]) && "\n" === $value[-2] && "\n" === $value[-1]) {
|
||||||
$blockChompingIndicator = '+';
|
$blockChompingIndicator = '+';
|
||||||
} elseif ("\n" === $value[-1]) {
|
} elseif ("\n" === $value[-1]) {
|
||||||
$blockChompingIndicator = '';
|
$blockChompingIndicator = '';
|
||||||
} else {
|
} else {
|
||||||
$blockChompingIndicator = '-';
|
$blockChompingIndicator = '-';
|
||||||
}
|
}
|
||||||
|
|
||||||
$output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator);
|
$output .= sprintf('%s%s%s |%s%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', '', $blockIndentationIndicator, $blockChompingIndicator);
|
||||||
|
|
||||||
foreach (explode("\n", $value) as $row) {
|
foreach (explode("\n", $value) as $row) {
|
||||||
if ('' === $row) {
|
if ('' === $row) {
|
||||||
$output .= "\n";
|
$output .= "\n";
|
||||||
} else {
|
} else {
|
||||||
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($value instanceof TaggedValue) {
|
if ($value instanceof TaggedValue) {
|
||||||
$output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
|
$output .= sprintf('%s%s !%s', $prefix, $dumpAsMap ? Inline::dump($key, $flags).':' : '-', $value->getTag());
|
||||||
|
|
||||||
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
|
||||||
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
|
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
|
||||||
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
||||||
|
|
||||||
foreach (explode("\n", $value->getValue()) as $row) {
|
foreach (explode("\n", $value->getValue()) as $row) {
|
||||||
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
||||||
$output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
$output .= ' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
||||||
} else {
|
} else {
|
||||||
$output .= "\n";
|
$output .= "\n";
|
||||||
$output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
|
$output .= $this->dump($value->getValue(), $inline - 1, $dumpAsMap ? $indent + $this->indentation : $indent + 2, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$dumpObjectAsInlineMap = true;
|
$dumpObjectAsInlineMap = true;
|
||||||
|
|
||||||
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) {
|
if (Yaml::DUMP_OBJECT_AS_MAP & $flags && ($value instanceof \ArrayObject || $value instanceof \stdClass)) {
|
||||||
$dumpObjectAsInlineMap = empty((array) $value);
|
$dumpObjectAsInlineMap = empty((array) $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
$willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value);
|
$willBeInlined = $inline - 1 <= 0 || !\is_array($value) && $dumpObjectAsInlineMap || empty($value);
|
||||||
|
|
||||||
$output .= sprintf('%s%s%s%s',
|
$output .= sprintf('%s%s%s%s',
|
||||||
$prefix,
|
$prefix,
|
||||||
$dumpAsMap ? Inline::dump($key, $flags).':' : '-',
|
$dumpAsMap ? Inline::dump($key, $flags).':' : '-',
|
||||||
$willBeInlined ? ' ' : "\n",
|
$willBeInlined ? ' ' : "\n",
|
||||||
$this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
|
$this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + $this->indentation, $flags)
|
||||||
).($willBeInlined ? "\n" : '');
|
).($willBeInlined ? "\n" : '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string
|
private function dumpTaggedValue(TaggedValue $value, int $inline, int $indent, int $flags, string $prefix): string
|
||||||
{
|
{
|
||||||
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
|
$output = sprintf('%s!%s', $prefix ? $prefix.' ' : '', $value->getTag());
|
||||||
|
|
||||||
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
|
if (Yaml::DUMP_MULTI_LINE_LITERAL_BLOCK & $flags && \is_string($value->getValue()) && str_contains($value->getValue(), "\n") && !str_contains($value->getValue(), "\r\n")) {
|
||||||
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
|
$blockIndentationIndicator = $this->getBlockIndentationIndicator($value->getValue());
|
||||||
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
$output .= sprintf(' |%s', $blockIndentationIndicator);
|
||||||
|
|
||||||
foreach (explode("\n", $value->getValue()) as $row) {
|
foreach (explode("\n", $value->getValue()) as $row) {
|
||||||
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
$output .= sprintf("\n%s%s%s", $prefix, str_repeat(' ', $this->indentation), $row);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
if ($inline - 1 <= 0 || null === $value->getValue() || \is_scalar($value->getValue())) {
|
||||||
return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
return $output.' '.$this->dump($value->getValue(), $inline - 1, 0, $flags)."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags);
|
return $output."\n".$this->dump($value->getValue(), $inline - 1, $indent, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBlockIndentationIndicator(string $value): string
|
private function getBlockIndentationIndicator(string $value): string
|
||||||
{
|
{
|
||||||
$lines = explode("\n", $value);
|
$lines = explode("\n", $value);
|
||||||
|
|
||||||
// If the first line (that is neither empty nor contains only spaces)
|
// If the first line (that is neither empty nor contains only spaces)
|
||||||
// starts with a space character, the spec requires a block indentation indicator
|
// starts with a space character, the spec requires a block indentation indicator
|
||||||
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
// http://www.yaml.org/spec/1.2/spec.html#id2793979
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
if ('' !== trim($line, ' ')) {
|
if ('' !== trim($line, ' ')) {
|
||||||
return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : '';
|
return (' ' === substr($line, 0, 1)) ? (string) $this->indentation : '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+95
-95
@@ -1,95 +1,95 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml;
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escaper encapsulates escaping rules for single and double-quoted
|
* Escaper encapsulates escaping rules for single and double-quoted
|
||||||
* YAML strings.
|
* YAML strings.
|
||||||
*
|
*
|
||||||
* @author Matthew Lewinski <matthew@lewinski.org>
|
* @author Matthew Lewinski <matthew@lewinski.org>
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
class Escaper
|
class Escaper
|
||||||
{
|
{
|
||||||
// Characters that would cause a dumped string to require double quoting.
|
// Characters that would cause a dumped string to require double quoting.
|
||||||
public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
|
public const REGEX_CHARACTER_TO_ESCAPE = "[\\x00-\\x1f]|\x7f|\xc2\x85|\xc2\xa0|\xe2\x80\xa8|\xe2\x80\xa9";
|
||||||
|
|
||||||
// Mapping arrays for escaping a double quoted string. The backslash is
|
// Mapping arrays for escaping a double quoted string. The backslash is
|
||||||
// first to ensure proper escaping because str_replace operates iteratively
|
// first to ensure proper escaping because str_replace operates iteratively
|
||||||
// on the input arrays. This ordering of the characters avoids the use of strtr,
|
// on the input arrays. This ordering of the characters avoids the use of strtr,
|
||||||
// which performs more slowly.
|
// which performs more slowly.
|
||||||
private const ESCAPEES = ['\\', '\\\\', '\\"', '"',
|
private const ESCAPEES = ['\\', '\\\\', '\\"', '"',
|
||||||
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
|
"\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07",
|
||||||
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
"\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f",
|
||||||
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
"\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17",
|
||||||
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
"\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f",
|
||||||
"\x7f",
|
"\x7f",
|
||||||
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
|
"\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9",
|
||||||
];
|
];
|
||||||
private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"',
|
private const ESCAPED = ['\\\\', '\\"', '\\\\', '\\"',
|
||||||
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
'\\0', '\\x01', '\\x02', '\\x03', '\\x04', '\\x05', '\\x06', '\\a',
|
||||||
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
'\\b', '\\t', '\\n', '\\v', '\\f', '\\r', '\\x0e', '\\x0f',
|
||||||
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
'\\x10', '\\x11', '\\x12', '\\x13', '\\x14', '\\x15', '\\x16', '\\x17',
|
||||||
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
'\\x18', '\\x19', '\\x1a', '\\e', '\\x1c', '\\x1d', '\\x1e', '\\x1f',
|
||||||
'\\x7f',
|
'\\x7f',
|
||||||
'\\N', '\\_', '\\L', '\\P',
|
'\\N', '\\_', '\\L', '\\P',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a PHP value would require double quoting in YAML.
|
* Determines if a PHP value would require double quoting in YAML.
|
||||||
*
|
*
|
||||||
* @param string $value A PHP value
|
* @param string $value A PHP value
|
||||||
*/
|
*/
|
||||||
public static function requiresDoubleQuoting(string $value): bool
|
public static function requiresDoubleQuoting(string $value): bool
|
||||||
{
|
{
|
||||||
return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
|
return 0 < preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes and surrounds a PHP value with double quotes.
|
* Escapes and surrounds a PHP value with double quotes.
|
||||||
*
|
*
|
||||||
* @param string $value A PHP value
|
* @param string $value A PHP value
|
||||||
*/
|
*/
|
||||||
public static function escapeWithDoubleQuotes(string $value): string
|
public static function escapeWithDoubleQuotes(string $value): string
|
||||||
{
|
{
|
||||||
return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
|
return sprintf('"%s"', str_replace(self::ESCAPEES, self::ESCAPED, $value));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines if a PHP value would require single quoting in YAML.
|
* Determines if a PHP value would require single quoting in YAML.
|
||||||
*
|
*
|
||||||
* @param string $value A PHP value
|
* @param string $value A PHP value
|
||||||
*/
|
*/
|
||||||
public static function requiresSingleQuoting(string $value): bool
|
public static function requiresSingleQuoting(string $value): bool
|
||||||
{
|
{
|
||||||
// Determines if a PHP value is entirely composed of a value that would
|
// Determines if a PHP value is entirely composed of a value that would
|
||||||
// require single quoting in YAML.
|
// require single quoting in YAML.
|
||||||
if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) {
|
if (\in_array(strtolower($value), ['null', '~', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', 'off'])) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determines if the PHP value contains any single characters that would
|
// Determines if the PHP value contains any single characters that would
|
||||||
// cause it to require single quoting in YAML.
|
// cause it to require single quoting in YAML.
|
||||||
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
|
return 0 < preg_match('/[ \s \' " \: \{ \} \[ \] , & \* \# \?] | \A[ \- ? | < > = ! % @ ` \p{Zs}]/xu', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Escapes and surrounds a PHP value with single quotes.
|
* Escapes and surrounds a PHP value with single quotes.
|
||||||
*
|
*
|
||||||
* @param string $value A PHP value
|
* @param string $value A PHP value
|
||||||
*/
|
*/
|
||||||
public static function escapeWithSingleQuotes(string $value): string
|
public static function escapeWithSingleQuotes(string $value): string
|
||||||
{
|
{
|
||||||
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
|
return sprintf("'%s'", str_replace('\'', '\'\'', $value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Exception;
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception class thrown when an error occurs during dumping.
|
* Exception class thrown when an error occurs during dumping.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class DumpException extends RuntimeException
|
class DumpException extends RuntimeException
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Exception;
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception interface for all exceptions thrown by the component.
|
* Exception interface for all exceptions thrown by the component.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
interface ExceptionInterface extends \Throwable
|
interface ExceptionInterface extends \Throwable
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
+132
-132
@@ -1,132 +1,132 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Exception;
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception class thrown when an error occurs during parsing.
|
* Exception class thrown when an error occurs during parsing.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*/
|
*/
|
||||||
class ParseException extends RuntimeException
|
class ParseException extends RuntimeException
|
||||||
{
|
{
|
||||||
private ?string $parsedFile;
|
private ?string $parsedFile;
|
||||||
private int $parsedLine;
|
private int $parsedLine;
|
||||||
private ?string $snippet;
|
private ?string $snippet;
|
||||||
private string $rawMessage;
|
private string $rawMessage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $message The error message
|
* @param string $message The error message
|
||||||
* @param int $parsedLine The line where the error occurred
|
* @param int $parsedLine The line where the error occurred
|
||||||
* @param string|null $snippet The snippet of code near the problem
|
* @param string|null $snippet The snippet of code near the problem
|
||||||
* @param string|null $parsedFile The file name where the error occurred
|
* @param string|null $parsedFile The file name where the error occurred
|
||||||
*/
|
*/
|
||||||
public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null)
|
public function __construct(string $message, int $parsedLine = -1, ?string $snippet = null, ?string $parsedFile = null, ?\Throwable $previous = null)
|
||||||
{
|
{
|
||||||
$this->parsedFile = $parsedFile;
|
$this->parsedFile = $parsedFile;
|
||||||
$this->parsedLine = $parsedLine;
|
$this->parsedLine = $parsedLine;
|
||||||
$this->snippet = $snippet;
|
$this->snippet = $snippet;
|
||||||
$this->rawMessage = $message;
|
$this->rawMessage = $message;
|
||||||
|
|
||||||
$this->updateRepr();
|
$this->updateRepr();
|
||||||
|
|
||||||
parent::__construct($this->message, 0, $previous);
|
parent::__construct($this->message, 0, $previous);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the snippet of code near the error.
|
* Gets the snippet of code near the error.
|
||||||
*/
|
*/
|
||||||
public function getSnippet(): string
|
public function getSnippet(): string
|
||||||
{
|
{
|
||||||
return $this->snippet;
|
return $this->snippet;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the snippet of code near the error.
|
* Sets the snippet of code near the error.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSnippet(string $snippet)
|
public function setSnippet(string $snippet)
|
||||||
{
|
{
|
||||||
$this->snippet = $snippet;
|
$this->snippet = $snippet;
|
||||||
|
|
||||||
$this->updateRepr();
|
$this->updateRepr();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the filename where the error occurred.
|
* Gets the filename where the error occurred.
|
||||||
*
|
*
|
||||||
* This method returns null if a string is parsed.
|
* This method returns null if a string is parsed.
|
||||||
*/
|
*/
|
||||||
public function getParsedFile(): string
|
public function getParsedFile(): string
|
||||||
{
|
{
|
||||||
return $this->parsedFile;
|
return $this->parsedFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the filename where the error occurred.
|
* Sets the filename where the error occurred.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setParsedFile(string $parsedFile)
|
public function setParsedFile(string $parsedFile)
|
||||||
{
|
{
|
||||||
$this->parsedFile = $parsedFile;
|
$this->parsedFile = $parsedFile;
|
||||||
|
|
||||||
$this->updateRepr();
|
$this->updateRepr();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the line where the error occurred.
|
* Gets the line where the error occurred.
|
||||||
*/
|
*/
|
||||||
public function getParsedLine(): int
|
public function getParsedLine(): int
|
||||||
{
|
{
|
||||||
return $this->parsedLine;
|
return $this->parsedLine;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the line where the error occurred.
|
* Sets the line where the error occurred.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setParsedLine(int $parsedLine)
|
public function setParsedLine(int $parsedLine)
|
||||||
{
|
{
|
||||||
$this->parsedLine = $parsedLine;
|
$this->parsedLine = $parsedLine;
|
||||||
|
|
||||||
$this->updateRepr();
|
$this->updateRepr();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function updateRepr(): void
|
private function updateRepr(): void
|
||||||
{
|
{
|
||||||
$this->message = $this->rawMessage;
|
$this->message = $this->rawMessage;
|
||||||
|
|
||||||
$dot = false;
|
$dot = false;
|
||||||
if (str_ends_with($this->message, '.')) {
|
if (str_ends_with($this->message, '.')) {
|
||||||
$this->message = substr($this->message, 0, -1);
|
$this->message = substr($this->message, 0, -1);
|
||||||
$dot = true;
|
$dot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null !== $this->parsedFile) {
|
if (null !== $this->parsedFile) {
|
||||||
$this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
|
$this->message .= sprintf(' in %s', json_encode($this->parsedFile, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->parsedLine >= 0) {
|
if ($this->parsedLine >= 0) {
|
||||||
$this->message .= sprintf(' at line %d', $this->parsedLine);
|
$this->message .= sprintf(' at line %d', $this->parsedLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->snippet) {
|
if ($this->snippet) {
|
||||||
$this->message .= sprintf(' (near "%s")', $this->snippet);
|
$this->message .= sprintf(' (near "%s")', $this->snippet);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($dot) {
|
if ($dot) {
|
||||||
$this->message .= '.';
|
$this->message .= '.';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Exception;
|
namespace Symfony\Component\Yaml\Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exception class thrown when an error occurs during parsing.
|
* Exception class thrown when an error occurs during parsing.
|
||||||
*
|
*
|
||||||
* @author Romain Neutron <imprec@gmail.com>
|
* @author Romain Neutron <imprec@gmail.com>
|
||||||
*/
|
*/
|
||||||
class RuntimeException extends \RuntimeException implements ExceptionInterface
|
class RuntimeException extends \RuntimeException implements ExceptionInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+841
-841
File diff suppressed because it is too large
Load Diff
Vendored
+19
-19
@@ -1,19 +1,19 @@
|
|||||||
Copyright (c) 2004-present Fabien Potencier
|
Copyright (c) 2004-present Fabien Potencier
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
in the Software without restriction, including without limitation the rights
|
in the Software without restriction, including without limitation the rights
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
copies of the Software, and to permit persons to whom the Software is furnished
|
copies of the Software, and to permit persons to whom the Software is furnished
|
||||||
to do so, subject to the following conditions:
|
to do so, subject to the following conditions:
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
The above copyright notice and this permission notice shall be included in all
|
||||||
copies or substantial portions of the Software.
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|||||||
Vendored
+1253
-1253
File diff suppressed because it is too large
Load Diff
+49
-49
@@ -1,49 +1,49 @@
|
|||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ('cli' !== \PHP_SAPI) {
|
if ('cli' !== \PHP_SAPI) {
|
||||||
throw new Exception('This script must be run from the command line.');
|
throw new Exception('This script must be run from the command line.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs the Yaml lint command.
|
* Runs the Yaml lint command.
|
||||||
*
|
*
|
||||||
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
* @author Jan Schädlich <jan.schaedlich@sensiolabs.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Symfony\Component\Console\Application;
|
use Symfony\Component\Console\Application;
|
||||||
use Symfony\Component\Yaml\Command\LintCommand;
|
use Symfony\Component\Yaml\Command\LintCommand;
|
||||||
|
|
||||||
function includeIfExists(string $file): bool
|
function includeIfExists(string $file): bool
|
||||||
{
|
{
|
||||||
return file_exists($file) && include $file;
|
return file_exists($file) && include $file;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!includeIfExists(__DIR__ . '/../../../../autoload.php') &&
|
!includeIfExists(__DIR__ . '/../../../../autoload.php') &&
|
||||||
!includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
|
!includeIfExists(__DIR__ . '/../../vendor/autoload.php') &&
|
||||||
!includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
|
!includeIfExists(__DIR__ . '/../../../../../../vendor/autoload.php')
|
||||||
) {
|
) {
|
||||||
fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
|
fwrite(STDERR, 'Install dependencies using Composer.'.PHP_EOL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!class_exists(Application::class)) {
|
if (!class_exists(Application::class)) {
|
||||||
fwrite(STDERR, 'You need the "symfony/console" component in order to run the Yaml linter.'.PHP_EOL);
|
fwrite(STDERR, 'You need the "symfony/console" component in order to run the Yaml linter.'.PHP_EOL);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
(new Application())->add($command = new LintCommand())
|
(new Application())->add($command = new LintCommand())
|
||||||
->getApplication()
|
->getApplication()
|
||||||
->setDefaultCommand($command->getName(), true)
|
->setDefaultCommand($command->getName(), true)
|
||||||
->run()
|
->run()
|
||||||
;
|
;
|
||||||
|
|||||||
+38
-38
@@ -1,38 +1,38 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml\Tag;
|
namespace Symfony\Component\Yaml\Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Nicolas Grekas <p@tchwork.com>
|
* @author Nicolas Grekas <p@tchwork.com>
|
||||||
* @author Guilhem N. <egetick@gmail.com>
|
* @author Guilhem N. <egetick@gmail.com>
|
||||||
*/
|
*/
|
||||||
final class TaggedValue
|
final class TaggedValue
|
||||||
{
|
{
|
||||||
private string $tag;
|
private string $tag;
|
||||||
private mixed $value;
|
private mixed $value;
|
||||||
|
|
||||||
public function __construct(string $tag, mixed $value)
|
public function __construct(string $tag, mixed $value)
|
||||||
{
|
{
|
||||||
$this->tag = $tag;
|
$this->tag = $tag;
|
||||||
$this->value = $value;
|
$this->value = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTag(): string
|
public function getTag(): string
|
||||||
{
|
{
|
||||||
return $this->tag;
|
return $this->tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getValue(): mixed
|
public function getValue(): mixed
|
||||||
{
|
{
|
||||||
return $this->value;
|
return $this->value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+108
-108
@@ -1,108 +1,108 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml;
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
use Symfony\Component\Yaml\Exception\ParseException;
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unescaper encapsulates unescaping rules for single and double-quoted
|
* Unescaper encapsulates unescaping rules for single and double-quoted
|
||||||
* YAML strings.
|
* YAML strings.
|
||||||
*
|
*
|
||||||
* @author Matthew Lewinski <matthew@lewinski.org>
|
* @author Matthew Lewinski <matthew@lewinski.org>
|
||||||
*
|
*
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
class Unescaper
|
class Unescaper
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Regex fragment that matches an escaped character in a double quoted string.
|
* Regex fragment that matches an escaped character in a double quoted string.
|
||||||
*/
|
*/
|
||||||
public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
|
public const REGEX_ESCAPED_CHARACTER = '\\\\(x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8}|.)';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unescapes a single quoted string.
|
* Unescapes a single quoted string.
|
||||||
*
|
*
|
||||||
* @param string $value A single quoted string
|
* @param string $value A single quoted string
|
||||||
*/
|
*/
|
||||||
public function unescapeSingleQuotedString(string $value): string
|
public function unescapeSingleQuotedString(string $value): string
|
||||||
{
|
{
|
||||||
return str_replace('\'\'', '\'', $value);
|
return str_replace('\'\'', '\'', $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unescapes a double quoted string.
|
* Unescapes a double quoted string.
|
||||||
*
|
*
|
||||||
* @param string $value A double quoted string
|
* @param string $value A double quoted string
|
||||||
*/
|
*/
|
||||||
public function unescapeDoubleQuotedString(string $value): string
|
public function unescapeDoubleQuotedString(string $value): string
|
||||||
{
|
{
|
||||||
$callback = fn ($match) => $this->unescapeCharacter($match[0]);
|
$callback = fn ($match) => $this->unescapeCharacter($match[0]);
|
||||||
|
|
||||||
// evaluate the string
|
// evaluate the string
|
||||||
return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value);
|
return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unescapes a character that was found in a double-quoted string.
|
* Unescapes a character that was found in a double-quoted string.
|
||||||
*
|
*
|
||||||
* @param string $value An escaped character
|
* @param string $value An escaped character
|
||||||
*/
|
*/
|
||||||
private function unescapeCharacter(string $value): string
|
private function unescapeCharacter(string $value): string
|
||||||
{
|
{
|
||||||
return match ($value[1]) {
|
return match ($value[1]) {
|
||||||
'0' => "\x0",
|
'0' => "\x0",
|
||||||
'a' => "\x7",
|
'a' => "\x7",
|
||||||
'b' => "\x8",
|
'b' => "\x8",
|
||||||
't' => "\t",
|
't' => "\t",
|
||||||
"\t" => "\t",
|
"\t" => "\t",
|
||||||
'n' => "\n",
|
'n' => "\n",
|
||||||
'v' => "\xB",
|
'v' => "\xB",
|
||||||
'f' => "\xC",
|
'f' => "\xC",
|
||||||
'r' => "\r",
|
'r' => "\r",
|
||||||
'e' => "\x1B",
|
'e' => "\x1B",
|
||||||
' ' => ' ',
|
' ' => ' ',
|
||||||
'"' => '"',
|
'"' => '"',
|
||||||
'/' => '/',
|
'/' => '/',
|
||||||
'\\' => '\\',
|
'\\' => '\\',
|
||||||
// U+0085 NEXT LINE
|
// U+0085 NEXT LINE
|
||||||
'N' => "\xC2\x85",
|
'N' => "\xC2\x85",
|
||||||
// U+00A0 NO-BREAK SPACE
|
// U+00A0 NO-BREAK SPACE
|
||||||
'_' => "\xC2\xA0",
|
'_' => "\xC2\xA0",
|
||||||
// U+2028 LINE SEPARATOR
|
// U+2028 LINE SEPARATOR
|
||||||
'L' => "\xE2\x80\xA8",
|
'L' => "\xE2\x80\xA8",
|
||||||
// U+2029 PARAGRAPH SEPARATOR
|
// U+2029 PARAGRAPH SEPARATOR
|
||||||
'P' => "\xE2\x80\xA9",
|
'P' => "\xE2\x80\xA9",
|
||||||
'x' => self::utf8chr(hexdec(substr($value, 2, 2))),
|
'x' => self::utf8chr(hexdec(substr($value, 2, 2))),
|
||||||
'u' => self::utf8chr(hexdec(substr($value, 2, 4))),
|
'u' => self::utf8chr(hexdec(substr($value, 2, 4))),
|
||||||
'U' => self::utf8chr(hexdec(substr($value, 2, 8))),
|
'U' => self::utf8chr(hexdec(substr($value, 2, 8))),
|
||||||
default => throw new ParseException(sprintf('Found unknown escape character "%s".', $value)),
|
default => throw new ParseException(sprintf('Found unknown escape character "%s".', $value)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the UTF-8 character for the given code point.
|
* Get the UTF-8 character for the given code point.
|
||||||
*/
|
*/
|
||||||
private static function utf8chr(int $c): string
|
private static function utf8chr(int $c): string
|
||||||
{
|
{
|
||||||
if (0x80 > $c %= 0x200000) {
|
if (0x80 > $c %= 0x200000) {
|
||||||
return \chr($c);
|
return \chr($c);
|
||||||
}
|
}
|
||||||
if (0x800 > $c) {
|
if (0x800 > $c) {
|
||||||
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
|
return \chr(0xC0 | $c >> 6).\chr(0x80 | $c & 0x3F);
|
||||||
}
|
}
|
||||||
if (0x10000 > $c) {
|
if (0x10000 > $c) {
|
||||||
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
return \chr(0xE0 | $c >> 12).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
return \chr(0xF0 | $c >> 18).\chr(0x80 | $c >> 12 & 0x3F).\chr(0x80 | $c >> 6 & 0x3F).\chr(0x80 | $c & 0x3F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+97
-97
@@ -1,97 +1,97 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony package.
|
* This file is part of the Symfony package.
|
||||||
*
|
*
|
||||||
* (c) Fabien Potencier <fabien@symfony.com>
|
* (c) Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* For the full copyright and license information, please view the LICENSE
|
* For the full copyright and license information, please view the LICENSE
|
||||||
* file that was distributed with this source code.
|
* file that was distributed with this source code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Symfony\Component\Yaml;
|
namespace Symfony\Component\Yaml;
|
||||||
|
|
||||||
use Symfony\Component\Yaml\Exception\ParseException;
|
use Symfony\Component\Yaml\Exception\ParseException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Yaml offers convenience methods to load and dump YAML.
|
* Yaml offers convenience methods to load and dump YAML.
|
||||||
*
|
*
|
||||||
* @author Fabien Potencier <fabien@symfony.com>
|
* @author Fabien Potencier <fabien@symfony.com>
|
||||||
*
|
*
|
||||||
* @final
|
* @final
|
||||||
*/
|
*/
|
||||||
class Yaml
|
class Yaml
|
||||||
{
|
{
|
||||||
public const DUMP_OBJECT = 1;
|
public const DUMP_OBJECT = 1;
|
||||||
public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2;
|
public const PARSE_EXCEPTION_ON_INVALID_TYPE = 2;
|
||||||
public const PARSE_OBJECT = 4;
|
public const PARSE_OBJECT = 4;
|
||||||
public const PARSE_OBJECT_FOR_MAP = 8;
|
public const PARSE_OBJECT_FOR_MAP = 8;
|
||||||
public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16;
|
public const DUMP_EXCEPTION_ON_INVALID_TYPE = 16;
|
||||||
public const PARSE_DATETIME = 32;
|
public const PARSE_DATETIME = 32;
|
||||||
public const DUMP_OBJECT_AS_MAP = 64;
|
public const DUMP_OBJECT_AS_MAP = 64;
|
||||||
public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128;
|
public const DUMP_MULTI_LINE_LITERAL_BLOCK = 128;
|
||||||
public const PARSE_CONSTANT = 256;
|
public const PARSE_CONSTANT = 256;
|
||||||
public const PARSE_CUSTOM_TAGS = 512;
|
public const PARSE_CUSTOM_TAGS = 512;
|
||||||
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
|
public const DUMP_EMPTY_ARRAY_AS_SEQUENCE = 1024;
|
||||||
public const DUMP_NULL_AS_TILDE = 2048;
|
public const DUMP_NULL_AS_TILDE = 2048;
|
||||||
public const DUMP_NUMERIC_KEY_AS_STRING = 4096;
|
public const DUMP_NUMERIC_KEY_AS_STRING = 4096;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a YAML file into a PHP value.
|
* Parses a YAML file into a PHP value.
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
*
|
*
|
||||||
* $array = Yaml::parseFile('config.yml');
|
* $array = Yaml::parseFile('config.yml');
|
||||||
* print_r($array);
|
* print_r($array);
|
||||||
*
|
*
|
||||||
* @param string $filename The path to the YAML file to be parsed
|
* @param string $filename The path to the YAML file to be parsed
|
||||||
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
||||||
*
|
*
|
||||||
* @throws ParseException If the file could not be read or the YAML is not valid
|
* @throws ParseException If the file could not be read or the YAML is not valid
|
||||||
*/
|
*/
|
||||||
public static function parseFile(string $filename, int $flags = 0): mixed
|
public static function parseFile(string $filename, int $flags = 0): mixed
|
||||||
{
|
{
|
||||||
$yaml = new Parser();
|
$yaml = new Parser();
|
||||||
|
|
||||||
return $yaml->parseFile($filename, $flags);
|
return $yaml->parseFile($filename, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses YAML into a PHP value.
|
* Parses YAML into a PHP value.
|
||||||
*
|
*
|
||||||
* Usage:
|
* Usage:
|
||||||
* <code>
|
* <code>
|
||||||
* $array = Yaml::parse(file_get_contents('config.yml'));
|
* $array = Yaml::parse(file_get_contents('config.yml'));
|
||||||
* print_r($array);
|
* print_r($array);
|
||||||
* </code>
|
* </code>
|
||||||
*
|
*
|
||||||
* @param string $input A string containing YAML
|
* @param string $input A string containing YAML
|
||||||
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
|
||||||
*
|
*
|
||||||
* @throws ParseException If the YAML is not valid
|
* @throws ParseException If the YAML is not valid
|
||||||
*/
|
*/
|
||||||
public static function parse(string $input, int $flags = 0): mixed
|
public static function parse(string $input, int $flags = 0): mixed
|
||||||
{
|
{
|
||||||
$yaml = new Parser();
|
$yaml = new Parser();
|
||||||
|
|
||||||
return $yaml->parse($input, $flags);
|
return $yaml->parse($input, $flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dumps a PHP value to a YAML string.
|
* Dumps a PHP value to a YAML string.
|
||||||
*
|
*
|
||||||
* The dump method, when supplied with an array, will do its best
|
* The dump method, when supplied with an array, will do its best
|
||||||
* to convert the array into friendly YAML.
|
* to convert the array into friendly YAML.
|
||||||
*
|
*
|
||||||
* @param mixed $input The PHP value
|
* @param mixed $input The PHP value
|
||||||
* @param int $inline The level where you switch to inline YAML
|
* @param int $inline The level where you switch to inline YAML
|
||||||
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
* @param int $indent The amount of spaces to use for indentation of nested nodes
|
||||||
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
|
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
|
||||||
*/
|
*/
|
||||||
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
|
public static function dump(mixed $input, int $inline = 2, int $indent = 4, int $flags = 0): string
|
||||||
{
|
{
|
||||||
$yaml = new Dumper($indent);
|
$yaml = new Dumper($indent);
|
||||||
|
|
||||||
return $yaml->dump($input, $inline, 0, $flags);
|
return $yaml->dump($input, $inline, 0, $flags);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+39
-39
@@ -1,39 +1,39 @@
|
|||||||
{
|
{
|
||||||
"name": "symfony/yaml",
|
"name": "symfony/yaml",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"description": "Loads and dumps YAML files",
|
"description": "Loads and dumps YAML files",
|
||||||
"keywords": [],
|
"keywords": [],
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Fabien Potencier",
|
"name": "Fabien Potencier",
|
||||||
"email": "fabien@symfony.com"
|
"email": "fabien@symfony.com"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Symfony Community",
|
"name": "Symfony Community",
|
||||||
"homepage": "https://symfony.com/contributors"
|
"homepage": "https://symfony.com/contributors"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=8.1",
|
"php": ">=8.1",
|
||||||
"symfony/deprecation-contracts": "^2.5|^3",
|
"symfony/deprecation-contracts": "^2.5|^3",
|
||||||
"symfony/polyfill-ctype": "^1.8"
|
"symfony/polyfill-ctype": "^1.8"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"symfony/console": "^5.4|^6.0|^7.0"
|
"symfony/console": "^5.4|^6.0|^7.0"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
"symfony/console": "<5.4"
|
"symfony/console": "<5.4"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": { "Symfony\\Component\\Yaml\\": "" },
|
"psr-4": { "Symfony\\Component\\Yaml\\": "" },
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
"/Tests/"
|
"/Tests/"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"bin": [
|
"bin": [
|
||||||
"Resources/bin/yaml-lint"
|
"Resources/bin/yaml-lint"
|
||||||
],
|
],
|
||||||
"minimum-stability": "dev"
|
"minimum-stability": "dev"
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-21
@@ -1,21 +1,21 @@
|
|||||||
<?php include __DIR__ . '/snippets/header.php' ?>
|
<?php include __DIR__ . '/snippets/header.php' ?>
|
||||||
|
|
||||||
<p class="notice">
|
<p class="notice">
|
||||||
We are really sorry, but your browser does not support
|
We are really sorry, but your browser does not support
|
||||||
all features required for the Kirby Panel.
|
all features required for the Kirby Panel.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="admin-advice">
|
<div class="admin-advice">
|
||||||
<p>
|
<p>
|
||||||
<strong>Fetch</strong><br>
|
<strong>Fetch</strong><br>
|
||||||
We use Javascript's new Fetch API. You can find a list of supported browsers for this feature on
|
We use Javascript's new Fetch API. You can find a list of supported browsers for this feature on
|
||||||
<strong><a href="https://caniuse.com/#feat=fetch">caniuse.com</a></strong>
|
<strong><a href="https://caniuse.com/#feat=fetch">caniuse.com</a></strong>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<strong>CSS Grid</strong><br>
|
<strong>CSS Grid</strong><br>
|
||||||
We use CSS Grids for all our layouts. You can find a list of supported browsers for this feature on
|
We use CSS Grids for all our layouts. You can find a list of supported browsers for this feature on
|
||||||
<strong><a href="https://caniuse.com/#feat=css-grid">caniuse.com</a></strong>
|
<strong><a href="https://caniuse.com/#feat=css-grid">caniuse.com</a></strong>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php include __DIR__ . '/snippets/footer.php' ?>
|
<?php include __DIR__ . '/snippets/footer.php' ?>
|
||||||
|
|||||||
+11
-11
@@ -1,11 +1,11 @@
|
|||||||
<?php include __DIR__ . '/snippets/header.php' ?>
|
<?php include __DIR__ . '/snippets/header.php' ?>
|
||||||
|
|
||||||
<p class="notice">
|
<p class="notice">
|
||||||
This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.
|
This page is currently offline due to an unexpected error. We are very sorry for the inconvenience and will fix it as soon as possible.
|
||||||
</p>
|
</p>
|
||||||
<p class="admin-advice">
|
<p class="admin-advice">
|
||||||
Advice for developers and administrators:<br>
|
Advice for developers and administrators:<br>
|
||||||
Enable <a href="https://getkirby.com/docs/reference/system/options/debug">debug mode</a> to get further information about the error.
|
Enable <a href="https://getkirby.com/docs/reference/system/options/debug">debug mode</a> to get further information about the error.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php include __DIR__ . '/snippets/footer.php' ?>
|
<?php include __DIR__ . '/snippets/footer.php' ?>
|
||||||
|
|||||||
+75
-75
@@ -1,75 +1,75 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Kirby\Toolkit\Html;
|
use Kirby\Toolkit\Html;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \Kirby\Cms\App $kirby
|
* @var \Kirby\Cms\App $kirby
|
||||||
* @var string $icons
|
* @var string $icons
|
||||||
* @var array<string, mixed> $assets
|
* @var array<string, mixed> $assets
|
||||||
* @var array<string, mixed> $fiber
|
* @var array<string, mixed> $fiber
|
||||||
* @var string $panelUrl
|
* @var string $panelUrl
|
||||||
* @var string $nonce
|
* @var string $nonce
|
||||||
*/ ?>
|
*/ ?>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
|
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||||
<meta name="referrer" content="same-origin">
|
<meta name="referrer" content="same-origin">
|
||||||
|
|
||||||
<title>Kirby Panel</title>
|
<title>Kirby Panel</title>
|
||||||
|
|
||||||
<script nonce="<?= $nonce ?>">
|
<script nonce="<?= $nonce ?>">
|
||||||
if (
|
if (
|
||||||
!window.CSS ||
|
!window.CSS ||
|
||||||
window.CSS.supports("display", "grid") === false ||
|
window.CSS.supports("display", "grid") === false ||
|
||||||
!window.fetch
|
!window.fetch
|
||||||
) {
|
) {
|
||||||
window.location.href = "<?= $panelUrl ?>browser";
|
window.location.href = "<?= $panelUrl ?>browser";
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php foreach ($assets['css'] as $css): ?>
|
<?php foreach ($assets['css'] as $css): ?>
|
||||||
<link nonce="<?= $nonce ?>" rel="stylesheet" href="<?= $css ?>">
|
<link nonce="<?= $nonce ?>" rel="stylesheet" href="<?= $css ?>">
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
<?php foreach ($assets['icons'] as $icon): ?>
|
<?php foreach ($assets['icons'] as $icon): ?>
|
||||||
<?= Html::tag('link', null, $icon) ?>
|
<?= Html::tag('link', null, $icon) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
<?php foreach ($assets['js'] as $js): ?>
|
<?php foreach ($assets['js'] as $js): ?>
|
||||||
<?php if (($js['type'] ?? null) === 'module'): ?>
|
<?php if (($js['type'] ?? null) === 'module'): ?>
|
||||||
<link rel="modulepreload" href="<?= $js['src'] ?>">
|
<link rel="modulepreload" href="<?= $js['src'] ?>">
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
<base href="<?= $panelUrl ?>">
|
<base href="<?= $panelUrl ?>">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app"></div>
|
<div id="app"></div>
|
||||||
|
|
||||||
<noscript>
|
<noscript>
|
||||||
Please enable JavaScript in your browser
|
Please enable JavaScript in your browser
|
||||||
</noscript>
|
</noscript>
|
||||||
|
|
||||||
<?= $icons ?>
|
<?= $icons ?>
|
||||||
|
|
||||||
<script nonce="<?= $nonce ?>">
|
<script nonce="<?= $nonce ?>">
|
||||||
// Fiber setup
|
// Fiber setup
|
||||||
window.fiber = <?= json_encode($fiber) ?>;
|
window.fiber = <?= json_encode($fiber) ?>;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<?php foreach ($assets['js'] as $key => $js): ?>
|
<?php foreach ($assets['js'] as $key => $js): ?>
|
||||||
<?php if ($key === 'index'): ?>
|
<?php if ($key === 'index'): ?>
|
||||||
<script type="module" nonce="<?= $nonce ?>">
|
<script type="module" nonce="<?= $nonce ?>">
|
||||||
<?= $assets['plugin-imports'] ?>
|
<?= $assets['plugin-imports'] ?>
|
||||||
import('<?= $js['src'] ?>')
|
import('<?= $js['src'] ?>')
|
||||||
</script>
|
</script>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?= Html::tag('script', '', $js) . PHP_EOL ?>
|
<?= Html::tag('script', '', $js) . PHP_EOL ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+11
-11
@@ -1,11 +1,11 @@
|
|||||||
<?php include __DIR__ . '/snippets/header.php' ?>
|
<?php include __DIR__ . '/snippets/header.php' ?>
|
||||||
|
|
||||||
<p class="notice">
|
<p class="notice">
|
||||||
This page is currently offline. We are very sorry for the inconvenience and will fix it as soon as possible.
|
This page is currently offline. We are very sorry for the inconvenience and will fix it as soon as possible.
|
||||||
</p>
|
</p>
|
||||||
<p class="admin-advice">
|
<p class="admin-advice">
|
||||||
Advice for developers and administrators:<br>
|
Advice for developers and administrators:<br>
|
||||||
Change the PHP version to one supported by your version of Kirby
|
Change the PHP version to one supported by your version of Kirby
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<?php include __DIR__ . '/snippets/footer.php' ?>
|
<?php include __DIR__ . '/snippets/footer.php' ?>
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
|
||||||
<title>Error</title>
|
<title>Error</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
||||||
padding: 10%;
|
padding: 10%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 1.5em;
|
line-height: 1.5em;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
a:hover,
|
a:hover,
|
||||||
a:focus {
|
a:focus {
|
||||||
color: #000;
|
color: #000;
|
||||||
}
|
}
|
||||||
p {
|
p {
|
||||||
max-width: 30em;
|
max-width: 30em;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
.notice {
|
.notice {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.admin-advice {
|
.admin-advice {
|
||||||
font-size: .8em;
|
font-size: .8em;
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
color: #999;
|
color: #999;
|
||||||
padding-top: 3rem;
|
padding-top: 3rem;
|
||||||
}
|
}
|
||||||
.admin-advice p {
|
.admin-advice p {
|
||||||
margin-bottom: 1.5rem;
|
margin-bottom: 1.5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
+62
-62
@@ -1,62 +1,62 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
|
||||||
if PROJECT_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel 2>/dev/null)"; then
|
if PROJECT_ROOT="$(git -C "${SCRIPT_DIR}" rev-parse --show-toplevel 2>/dev/null)"; then
|
||||||
:
|
:
|
||||||
else
|
else
|
||||||
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
PROJECT_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
||||||
fi
|
fi
|
||||||
DOCKER_CONTEXT="${PROJECT_ROOT}"
|
DOCKER_CONTEXT="${PROJECT_ROOT}"
|
||||||
DOCKERFILE_PATH="${PROJECT_ROOT}/Dockerfile"
|
DOCKERFILE_PATH="${PROJECT_ROOT}/Dockerfile"
|
||||||
|
|
||||||
REGISTRY_HOST="gitea.mindboost.team"
|
REGISTRY_HOST="gitea.mindboost.team"
|
||||||
IMAGE_NAME="interkollektives/lichterei-web"
|
IMAGE_NAME="interkollektives/lichterei-web"
|
||||||
DEFAULT_TAG="0.0.2"
|
DEFAULT_TAG="0.0.2"
|
||||||
|
|
||||||
if ! command -v docker >/dev/null 2>&1; then
|
if ! command -v docker >/dev/null 2>&1; then
|
||||||
echo "Docker is required but not found in PATH." >&2
|
echo "Docker is required but not found in PATH." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! docker buildx version >/dev/null 2>&1; then
|
if ! docker buildx version >/dev/null 2>&1; then
|
||||||
echo "Docker Buildx is required but not available. Please install/enable it in Docker Desktop or via the CLI plugin." >&2
|
echo "Docker Buildx is required but not available. Please install/enable it in Docker Desktop or via the CLI plugin." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
read -rp "Image tag [${DEFAULT_TAG}]: " INPUT_TAG
|
read -rp "Image tag [${DEFAULT_TAG}]: " INPUT_TAG
|
||||||
IMAGE_TAG="${INPUT_TAG:-$DEFAULT_TAG}"
|
IMAGE_TAG="${INPUT_TAG:-$DEFAULT_TAG}"
|
||||||
IMAGE_REF="${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}"
|
IMAGE_REF="${REGISTRY_HOST}/${IMAGE_NAME}:${IMAGE_TAG}"
|
||||||
|
|
||||||
DEFAULT_PLATFORMS="linux/amd64"
|
DEFAULT_PLATFORMS="linux/amd64"
|
||||||
read -rp "Target platforms [${DEFAULT_PLATFORMS}]: " INPUT_PLATFORMS
|
read -rp "Target platforms [${DEFAULT_PLATFORMS}]: " INPUT_PLATFORMS
|
||||||
TARGET_PLATFORMS="${INPUT_PLATFORMS:-$DEFAULT_PLATFORMS}"
|
TARGET_PLATFORMS="${INPUT_PLATFORMS:-$DEFAULT_PLATFORMS}"
|
||||||
|
|
||||||
read -rp "Registry username: " REGISTRY_USER
|
read -rp "Registry username: " REGISTRY_USER
|
||||||
read -rsp "Registry password or token: " REGISTRY_PASSWORD
|
read -rsp "Registry password or token: " REGISTRY_PASSWORD
|
||||||
echo
|
echo
|
||||||
|
|
||||||
echo "Logging into ${REGISTRY_HOST} ..."
|
echo "Logging into ${REGISTRY_HOST} ..."
|
||||||
echo "${REGISTRY_PASSWORD}" | docker login "${REGISTRY_HOST}" \
|
echo "${REGISTRY_PASSWORD}" | docker login "${REGISTRY_HOST}" \
|
||||||
--username "${REGISTRY_USER}" \
|
--username "${REGISTRY_USER}" \
|
||||||
--password-stdin
|
--password-stdin
|
||||||
|
|
||||||
cleanup() {
|
cleanup() {
|
||||||
docker logout "${REGISTRY_HOST}" >/dev/null 2>&1 || true
|
docker logout "${REGISTRY_HOST}" >/dev/null 2>&1 || true
|
||||||
}
|
}
|
||||||
trap cleanup EXIT
|
trap cleanup EXIT
|
||||||
|
|
||||||
echo "Bootstrapping buildx builder ..."
|
echo "Bootstrapping buildx builder ..."
|
||||||
docker buildx inspect --bootstrap >/dev/null
|
docker buildx inspect --bootstrap >/dev/null
|
||||||
|
|
||||||
echo "Building and pushing ${IMAGE_REF} for ${TARGET_PLATFORMS} ..."
|
echo "Building and pushing ${IMAGE_REF} for ${TARGET_PLATFORMS} ..."
|
||||||
docker buildx build \
|
docker buildx build \
|
||||||
--platform "${TARGET_PLATFORMS}" \
|
--platform "${TARGET_PLATFORMS}" \
|
||||||
--file "${DOCKERFILE_PATH}" \
|
--file "${DOCKERFILE_PATH}" \
|
||||||
--tag "${IMAGE_REF}" \
|
--tag "${IMAGE_REF}" \
|
||||||
--push \
|
--push \
|
||||||
"${DOCKER_CONTEXT}"
|
"${DOCKER_CONTEXT}"
|
||||||
|
|
||||||
echo "Image pushed successfully."
|
echo "Image pushed successfully."
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Fields can be defined in their own field blueprints
|
# Fields can be defined in their own field blueprints
|
||||||
# and reused across multiple blueprints
|
# and reused across multiple blueprints
|
||||||
# This field is used in the album.yml and note.yml blueprints
|
# This field is used in the album.yml and note.yml blueprints
|
||||||
# See http://getkirby.com/docs/guide/blueprints/extending-blueprints#reusing-and-extending-single-fields
|
# See http://getkirby.com/docs/guide/blueprints/extending-blueprints#reusing-and-extending-single-fields
|
||||||
type: files
|
type: files
|
||||||
multiple: false
|
multiple: false
|
||||||
query: page.images.template('image')
|
query: page.images.template('image')
|
||||||
uploads:
|
uploads:
|
||||||
template: image
|
template: image
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# The blocks/image template is automatically assigned to all uploaded
|
# The blocks/image template is automatically assigned to all uploaded
|
||||||
# images in the blocks field. We don't really need a separate blueprint
|
# images in the blocks field. We don't really need a separate blueprint
|
||||||
# for this and can therefor extend the already existing files/image blueprint
|
# for this and can therefor extend the already existing files/image blueprint
|
||||||
extends: files/image
|
extends: files/image
|
||||||
|
|||||||
@@ -1,47 +1,47 @@
|
|||||||
# Each file blueprint must have a title, the title may be different from the file name
|
# Each file blueprint must have a title, the title may be different from the file name
|
||||||
title: Image
|
title: Image
|
||||||
|
|
||||||
# Like page blueprints, file blueprints can define a layout with tabs, columns, sections and fields
|
# Like page blueprints, file blueprints can define a layout with tabs, columns, sections and fields
|
||||||
# File blueprints define what sort of information should get stored in a file's meta data file
|
# File blueprints define what sort of information should get stored in a file's meta data file
|
||||||
# In addition to the fields defined in this example blueprint, you can also set what type of file is acceptable
|
# In addition to the fields defined in this example blueprint, you can also set what type of file is acceptable
|
||||||
# when this blueprint is used, which allows you to control what users can upload.
|
# when this blueprint is used, which allows you to control what users can upload.
|
||||||
# More about file blueprints: https://getkirby.com/docs/reference/panel/blueprints/file
|
# More about file blueprints: https://getkirby.com/docs/reference/panel/blueprints/file
|
||||||
|
|
||||||
accept:
|
accept:
|
||||||
type: image
|
type: image
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
sections:
|
sections:
|
||||||
content:
|
content:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
caption:
|
caption:
|
||||||
label: Caption
|
label: Caption
|
||||||
type: textarea
|
type: textarea
|
||||||
size: medium
|
size: medium
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
sections:
|
sections:
|
||||||
meta:
|
meta:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
alt:
|
alt:
|
||||||
label: Alternative Text
|
label: Alternative Text
|
||||||
type: text
|
type: text
|
||||||
photographer:
|
photographer:
|
||||||
label: Photographer
|
label: Photographer
|
||||||
type: text
|
type: text
|
||||||
width: 2/3
|
width: 2/3
|
||||||
license:
|
license:
|
||||||
label: License
|
label: License
|
||||||
type: select
|
type: select
|
||||||
width: 1/3
|
width: 1/3
|
||||||
options:
|
options:
|
||||||
- Unsplash
|
- Unsplash
|
||||||
- CC BY 4.0
|
- CC BY 4.0
|
||||||
- CC BY-SA 4.0
|
- CC BY-SA 4.0
|
||||||
- CC BY-NC 4.0
|
- CC BY-NC 4.0
|
||||||
- CC BY-ND 4.0
|
- CC BY-ND 4.0
|
||||||
link:
|
link:
|
||||||
label: Link
|
label: Link
|
||||||
type: url
|
type: url
|
||||||
|
|||||||
@@ -1,79 +1,79 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: About us
|
title: About us
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: ☎️
|
icon: ☎️
|
||||||
|
|
||||||
# Limit the possible page statuses to `draft` and `listed`.
|
# Limit the possible page statuses to `draft` and `listed`.
|
||||||
# More about page statuses: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
# More about page statuses: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
||||||
status:
|
status:
|
||||||
draft: true
|
draft: true
|
||||||
listed: true
|
listed: true
|
||||||
|
|
||||||
# Page options allow you to control how users can interact with the page.
|
# Page options allow you to control how users can interact with the page.
|
||||||
# Here we prevent changing the page slug and page deletion
|
# Here we prevent changing the page slug and page deletion
|
||||||
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
||||||
options:
|
options:
|
||||||
changeSlug: false
|
changeSlug: false
|
||||||
delete: false
|
delete: false
|
||||||
|
|
||||||
# We use tabs here to focus on the layout in one tab
|
# We use tabs here to focus on the layout in one tab
|
||||||
# and have the additional contact fields in a secondary
|
# and have the additional contact fields in a secondary
|
||||||
# tab. Tabs can really help to clean up the interface
|
# tab. Tabs can really help to clean up the interface
|
||||||
# when it otherwise gets too complicated
|
# when it otherwise gets too complicated
|
||||||
tabs:
|
tabs:
|
||||||
content:
|
content:
|
||||||
icon: text
|
icon: text
|
||||||
label: Content
|
label: Content
|
||||||
fields:
|
fields:
|
||||||
layout:
|
layout:
|
||||||
label: Layout
|
label: Layout
|
||||||
type: layout
|
type: layout
|
||||||
layouts:
|
layouts:
|
||||||
- "1/1"
|
- "1/1"
|
||||||
- "1/2, 1/2"
|
- "1/2, 1/2"
|
||||||
- "1/3, 1/3, 1/3"
|
- "1/3, 1/3, 1/3"
|
||||||
# The contact tab pre-defines a set of address
|
# The contact tab pre-defines a set of address
|
||||||
# fields for the contact box at the bottom of the about
|
# fields for the contact box at the bottom of the about
|
||||||
# page. Combining modular content from layouts with
|
# page. Combining modular content from layouts with
|
||||||
# pre-defined content from such fields is a great way to
|
# pre-defined content from such fields is a great way to
|
||||||
# offer flexibility and yet keep certain constraints.
|
# offer flexibility and yet keep certain constraints.
|
||||||
#
|
#
|
||||||
# The form layout is created with two columns,
|
# The form layout is created with two columns,
|
||||||
# each column has a set of fields
|
# each column has a set of fields
|
||||||
# More about columns:
|
# More about columns:
|
||||||
# https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
# https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
||||||
contact:
|
contact:
|
||||||
icon: map
|
icon: map
|
||||||
label: Contact
|
label: Contact
|
||||||
columns:
|
columns:
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
# Kirby has many different field types, from simple text fields to the more complex structure field that contains subfields
|
# Kirby has many different field types, from simple text fields to the more complex structure field that contains subfields
|
||||||
# All available field types: https://getkirby.com/docs/reference/panel/fields
|
# All available field types: https://getkirby.com/docs/reference/panel/fields
|
||||||
fields:
|
fields:
|
||||||
address:
|
address:
|
||||||
label: Address
|
label: Address
|
||||||
type: writer
|
type: writer
|
||||||
inline: true
|
inline: true
|
||||||
email:
|
email:
|
||||||
label: Email
|
label: Email
|
||||||
type: email
|
type: email
|
||||||
phone:
|
phone:
|
||||||
label: Phone
|
label: Phone
|
||||||
type: tel
|
type: tel
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
fields:
|
fields:
|
||||||
social:
|
social:
|
||||||
label: On the web
|
label: On the web
|
||||||
type: structure
|
type: structure
|
||||||
columns:
|
columns:
|
||||||
platform: true
|
platform: true
|
||||||
fields:
|
fields:
|
||||||
platform:
|
platform:
|
||||||
label: Platform
|
label: Platform
|
||||||
type: text
|
type: text
|
||||||
width: 1/2
|
width: 1/2
|
||||||
url:
|
url:
|
||||||
label: URL
|
label: URL
|
||||||
type: url
|
type: url
|
||||||
width: 1/2
|
width: 1/2
|
||||||
|
|||||||
@@ -1,54 +1,54 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Album
|
title: Album
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 🖼
|
icon: 🖼
|
||||||
|
|
||||||
# Page status can be limited, here to `draft` and `listed`.
|
# Page status can be limited, here to `draft` and `listed`.
|
||||||
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
||||||
status:
|
status:
|
||||||
draft: true
|
draft: true
|
||||||
listed: true
|
listed: true
|
||||||
|
|
||||||
# Define the form layout with two columns
|
# Define the form layout with two columns
|
||||||
# Columns are optional but help structure the form layout
|
# Columns are optional but help structure the form layout
|
||||||
# The first column defines an files section, the second a set of fields
|
# The first column defines an files section, the second a set of fields
|
||||||
# More about different types of sections: https://getkirby.com/docs/reference/panel/sections
|
# More about different types of sections: https://getkirby.com/docs/reference/panel/sections
|
||||||
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
- width: 1/3
|
- width: 1/3
|
||||||
# The first column contains a set of fields to store
|
# The first column contains a set of fields to store
|
||||||
# information about the album.
|
# information about the album.
|
||||||
#
|
#
|
||||||
# List of all available field types:
|
# List of all available field types:
|
||||||
# https://getkirby.com/docs/reference/panel/fields
|
# https://getkirby.com/docs/reference/panel/fields
|
||||||
fields:
|
fields:
|
||||||
# If you need the same field in multiple locations, you can define them once and reuse whereever needed.
|
# If you need the same field in multiple locations, you can define them once and reuse whereever needed.
|
||||||
# Here we use a files field defined in `/site/blueprints/field/cover.yml`
|
# Here we use a files field defined in `/site/blueprints/field/cover.yml`
|
||||||
cover: fields/cover
|
cover: fields/cover
|
||||||
headline:
|
headline:
|
||||||
type: text
|
type: text
|
||||||
placeholder: "{{ page.title }}"
|
placeholder: "{{ page.title }}"
|
||||||
help: Leave empty to use the title as headline
|
help: Leave empty to use the title as headline
|
||||||
subheadline:
|
subheadline:
|
||||||
type: text
|
type: text
|
||||||
text:
|
text:
|
||||||
type: writer
|
type: writer
|
||||||
tags: true
|
tags: true
|
||||||
|
|
||||||
- width: 2/3
|
- width: 2/3
|
||||||
sections:
|
sections:
|
||||||
# The `images` files section shows all images of
|
# The `images` files section shows all images of
|
||||||
# the current page that use the `image` template
|
# the current page that use the `image` template
|
||||||
images:
|
images:
|
||||||
type: files
|
type: files
|
||||||
layout: cards
|
layout: cards
|
||||||
template: image
|
template: image
|
||||||
info: "{{ file.dimensions }}"
|
info: "{{ file.dimensions }}"
|
||||||
image:
|
image:
|
||||||
ratio: 5/4
|
ratio: 5/4
|
||||||
cover: true
|
cover: true
|
||||||
min: 1
|
min: 1
|
||||||
size: small
|
size: small
|
||||||
|
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
# This default blueprint is used to display a page in the Panel whenever a custom page blueprint is missing.
|
# This default blueprint is used to display a page in the Panel whenever a custom page blueprint is missing.
|
||||||
title: Simple Page
|
title: Simple Page
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 📝
|
icon: 📝
|
||||||
|
|
||||||
# Custom descriptions of page statuses depending on use case
|
# Custom descriptions of page statuses depending on use case
|
||||||
# More about page statuses: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
# More about page statuses: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
||||||
status:
|
status:
|
||||||
draft: true
|
draft: true
|
||||||
unlisted:
|
unlisted:
|
||||||
label: Hidden Page
|
label: Hidden Page
|
||||||
text: The page is not listed in the main menu
|
text: The page is not listed in the main menu
|
||||||
listed:
|
listed:
|
||||||
label: Menu Page
|
label: Menu Page
|
||||||
text: The page is listed in the main menu
|
text: The page is listed in the main menu
|
||||||
|
|
||||||
# Content area width 2 columns and 3 sections: fields, pages, and files
|
# Content area width 2 columns and 3 sections: fields, pages, and files
|
||||||
# Columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
# Columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
||||||
columns:
|
columns:
|
||||||
main:
|
main:
|
||||||
width: 2/3
|
width: 2/3
|
||||||
sections:
|
sections:
|
||||||
# Fields section: https://getkirby.com/docs/reference/panel/sections/fields
|
# Fields section: https://getkirby.com/docs/reference/panel/sections/fields
|
||||||
fields:
|
fields:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
text:
|
text:
|
||||||
type: textarea
|
type: textarea
|
||||||
size: huge
|
size: huge
|
||||||
sidebar:
|
sidebar:
|
||||||
width: 1/3
|
width: 1/3
|
||||||
sections:
|
sections:
|
||||||
# Pages section: https://getkirby.com/docs/reference/panel/sections/pages
|
# Pages section: https://getkirby.com/docs/reference/panel/sections/pages
|
||||||
pages:
|
pages:
|
||||||
type: pages
|
type: pages
|
||||||
template: default
|
template: default
|
||||||
# Files section: https://getkirby.com/docs/reference/panel/sections/files
|
# Files section: https://getkirby.com/docs/reference/panel/sections/files
|
||||||
files:
|
files:
|
||||||
type: files
|
type: files
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Error
|
title: Error
|
||||||
|
|
||||||
# Page options allow you to control how users can interact with the page.
|
# Page options allow you to control how users can interact with the page.
|
||||||
# Here we prevent reading of the page, so it is not shown to anyone in the Panel.
|
# Here we prevent reading of the page, so it is not shown to anyone in the Panel.
|
||||||
# If you want to allow users to modify the error page content in the Panel, remove this option.
|
# If you want to allow users to modify the error page content in the Panel, remove this option.
|
||||||
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
||||||
options:
|
options:
|
||||||
read: false
|
read: false
|
||||||
|
|||||||
@@ -1,34 +1,34 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Home
|
title: Home
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 🏠
|
icon: 🏠
|
||||||
|
|
||||||
# Page options allow you to control how users can interact with the page.
|
# Page options allow you to control how users can interact with the page.
|
||||||
# Here we prevent changing the page status (the home page cannot be renamed or deleted by default)
|
# Here we prevent changing the page status (the home page cannot be renamed or deleted by default)
|
||||||
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
# More about page options: https://getkirby.com/docs/reference/panel/blueprints/page#options
|
||||||
options:
|
options:
|
||||||
changeStatus: false
|
changeStatus: false
|
||||||
|
|
||||||
# Here we define an info section and a pages section (`photography`)
|
# Here we define an info section and a pages section (`photography`)
|
||||||
sections:
|
sections:
|
||||||
content:
|
content:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
headline:
|
headline:
|
||||||
type: text
|
type: text
|
||||||
width: 1/2
|
width: 1/2
|
||||||
gap:
|
gap:
|
||||||
width: 1/2
|
width: 1/2
|
||||||
subheadline:
|
subheadline:
|
||||||
type: text
|
type: text
|
||||||
width: 1/2
|
width: 1/2
|
||||||
|
|
||||||
# The photography section extends a pages section defined in the `/site/blueprints/section/album.yml` blueprint
|
# The photography section extends a pages section defined in the `/site/blueprints/section/album.yml` blueprint
|
||||||
# More about reusing and extending sections: https://getkirby.com/docs/guide/blueprints/extending-blueprints#reusing-and-extending-sectionss
|
# More about reusing and extending sections: https://getkirby.com/docs/guide/blueprints/extending-blueprints#reusing-and-extending-sectionss
|
||||||
photography:
|
photography:
|
||||||
label: Photography
|
label: Photography
|
||||||
extends: sections/albums
|
extends: sections/albums
|
||||||
status: listed
|
status: listed
|
||||||
size: small
|
size: small
|
||||||
help: All projects for the homepage are being pulled from the photography page.
|
help: All projects for the homepage are being pulled from the photography page.
|
||||||
|
|||||||
@@ -1,55 +1,55 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Note
|
title: Note
|
||||||
|
|
||||||
# Sorting number scheme that is applied when page status is changed to `listed`
|
# Sorting number scheme that is applied when page status is changed to `listed`
|
||||||
# More about page sorting: https://getkirby.com/docs/reference/panel/blueprints/page#sorting
|
# More about page sorting: https://getkirby.com/docs/reference/panel/blueprints/page#sorting
|
||||||
num: date
|
num: date
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 📖
|
icon: 📖
|
||||||
|
|
||||||
# Custom descriptions for each page status depending on use case
|
# Custom descriptions for each page status depending on use case
|
||||||
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
# More about page status: https://getkirby.com/docs/reference/panel/blueprints/page#statuses
|
||||||
status:
|
status:
|
||||||
draft:
|
draft:
|
||||||
label: Draft
|
label: Draft
|
||||||
text: The note is still in draft mode. It can only be seen by editors with panel access.
|
text: The note is still in draft mode. It can only be seen by editors with panel access.
|
||||||
unlisted:
|
unlisted:
|
||||||
label: In Review
|
label: In Review
|
||||||
text: The note is online and can be visited with the direct URL. The team must still give the final go to publish it.
|
text: The note is online and can be visited with the direct URL. The team must still give the final go to publish it.
|
||||||
listed:
|
listed:
|
||||||
label: Published
|
label: Published
|
||||||
text: The note is online and listed in the blog
|
text: The note is online and listed in the blog
|
||||||
|
|
||||||
# Define the form layout with two columns
|
# Define the form layout with two columns
|
||||||
# Columns are optional but help structure the form layout
|
# Columns are optional but help structure the form layout
|
||||||
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
||||||
columns:
|
columns:
|
||||||
- width: 2/3
|
- width: 2/3
|
||||||
# This columns only has a single field
|
# This columns only has a single field
|
||||||
fields:
|
fields:
|
||||||
text:
|
text:
|
||||||
type: blocks
|
type: blocks
|
||||||
|
|
||||||
- width: 1/3
|
- width: 1/3
|
||||||
# This second column holds a fields section with multiple fields
|
# This second column holds a fields section with multiple fields
|
||||||
# More about fields sections: https://getkirby.com/docs/reference/panel/sections/fields
|
# More about fields sections: https://getkirby.com/docs/reference/panel/sections/fields
|
||||||
sections:
|
sections:
|
||||||
meta:
|
meta:
|
||||||
type: fields
|
type: fields
|
||||||
fields:
|
fields:
|
||||||
# If you need the same field in multiple locations, you can define them once and reuse whereever needed.
|
# If you need the same field in multiple locations, you can define them once and reuse whereever needed.
|
||||||
# Here we use a files field defined in `/site/blueprints/field/cover.yml`
|
# Here we use a files field defined in `/site/blueprints/field/cover.yml`
|
||||||
cover: fields/cover
|
cover: fields/cover
|
||||||
date:
|
date:
|
||||||
type: date
|
type: date
|
||||||
time: true
|
time: true
|
||||||
default: now
|
default: now
|
||||||
author:
|
author:
|
||||||
type: users
|
type: users
|
||||||
# Fields types can be added using the shortcut `fieldname: true`
|
# Fields types can be added using the shortcut `fieldname: true`
|
||||||
# (however, you can only use a fieldname once per page and this only makes sense for simple fields without configuration)
|
# (however, you can only use a fieldname once per page and this only makes sense for simple fields without configuration)
|
||||||
tags: true
|
tags: true
|
||||||
files:
|
files:
|
||||||
type: files
|
type: files
|
||||||
template: blocks/image
|
template: blocks/image
|
||||||
|
|||||||
@@ -1,35 +1,35 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Notes
|
title: Notes
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 📖
|
icon: 📖
|
||||||
|
|
||||||
# Define the form layout with two columns
|
# Define the form layout with two columns
|
||||||
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
# More about columns: https://getkirby.com/docs/guide/blueprints/layout#defining-columns
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
- width: 1/3
|
- width: 1/3
|
||||||
# In the first column, we reuse the `notes` section
|
# In the first column, we reuse the `notes` section
|
||||||
# (defined in `/site/blueprints/sections/notes.yml` twice with different page status and headline
|
# (defined in `/site/blueprints/sections/notes.yml` twice with different page status and headline
|
||||||
sections:
|
sections:
|
||||||
drafts:
|
drafts:
|
||||||
extends: sections/notes
|
extends: sections/notes
|
||||||
label: Drafts
|
label: Drafts
|
||||||
status: draft
|
status: draft
|
||||||
|
|
||||||
unlisted:
|
unlisted:
|
||||||
extends: sections/notes
|
extends: sections/notes
|
||||||
label: In Review
|
label: In Review
|
||||||
status: unlisted
|
status: unlisted
|
||||||
|
|
||||||
- width: 2/3
|
- width: 2/3
|
||||||
# In the second column, we reuse the same section, this time for listed pages and with a different headline
|
# In the second column, we reuse the same section, this time for listed pages and with a different headline
|
||||||
sections:
|
sections:
|
||||||
listed:
|
listed:
|
||||||
extends: sections/notes
|
extends: sections/notes
|
||||||
label: Published
|
label: Published
|
||||||
status: listed
|
status: listed
|
||||||
size: small
|
size: small
|
||||||
layout: cards
|
layout: cards
|
||||||
|
|
||||||
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
# Each page blueprint must have a title, the title may be different from the file name
|
# Each page blueprint must have a title, the title may be different from the file name
|
||||||
title: Photos
|
title: Photos
|
||||||
|
|
||||||
# Each page can have an icon that is shown in page listings when no preview image is available.
|
# Each page can have an icon that is shown in page listings when no preview image is available.
|
||||||
icon: 🖼
|
icon: 🖼
|
||||||
|
|
||||||
# Here we extend two sections which are defined in `/site/blueprints/sections/albums.yml`
|
# Here we extend two sections which are defined in `/site/blueprints/sections/albums.yml`
|
||||||
# They differ in their page status and the headline.
|
# They differ in their page status and the headline.
|
||||||
sections:
|
sections:
|
||||||
drafts:
|
drafts:
|
||||||
extends: sections/albums
|
extends: sections/albums
|
||||||
label: Drafts
|
label: Drafts
|
||||||
status: draft
|
status: draft
|
||||||
|
|
||||||
listed:
|
listed:
|
||||||
extends: sections/albums
|
extends: sections/albums
|
||||||
label: Published Albums
|
label: Published Albums
|
||||||
status: listed
|
status: listed
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
# This section blueprint defines a pages section that can be reused across multiple blueprints
|
# This section blueprint defines a pages section that can be reused across multiple blueprints
|
||||||
# or multiple times within the same blueprint, see `/site/blueprints/pages/photography.yml` and `/site/blueprints/site.yml`
|
# or multiple times within the same blueprint, see `/site/blueprints/pages/photography.yml` and `/site/blueprints/site.yml`
|
||||||
# Sections can have different layouts and display additional information or a preview image
|
# Sections can have different layouts and display additional information or a preview image
|
||||||
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
||||||
type: pages
|
type: pages
|
||||||
label: Photography
|
label: Photography
|
||||||
parent: kirby.page("photography")
|
parent: kirby.page("photography")
|
||||||
size: small
|
size: small
|
||||||
info: "{{ page.images.count }} image(s)"
|
info: "{{ page.images.count }} image(s)"
|
||||||
layout: cards
|
layout: cards
|
||||||
template: album
|
template: album
|
||||||
empty: No albums yet
|
empty: No albums yet
|
||||||
image:
|
image:
|
||||||
query: page.cover
|
query: page.cover
|
||||||
cover: true
|
cover: true
|
||||||
ratio: 5/4
|
ratio: 5/4
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
# This section blueprint defines a pages section that can be reused across multiple blueprints
|
# This section blueprint defines a pages section that can be reused across multiple blueprints
|
||||||
# or multiple times within the same blueprint, see `/site/blueprints/pages/notes.yml` and `/site/blueprints/site.yml`
|
# or multiple times within the same blueprint, see `/site/blueprints/pages/notes.yml` and `/site/blueprints/site.yml`
|
||||||
# Sections can have different layouts and display additional information or a preview image
|
# Sections can have different layouts and display additional information or a preview image
|
||||||
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
# More about pages sections: https://getkirby.com/docs/reference/panel/sections/pages
|
||||||
type: pages
|
type: pages
|
||||||
label: Notes
|
label: Notes
|
||||||
parent: kirby.page("notes")
|
parent: kirby.page("notes")
|
||||||
info: "{{ page.published }}"
|
info: "{{ page.published }}"
|
||||||
template: note
|
template: note
|
||||||
empty: No notes yet
|
empty: No notes yet
|
||||||
sortBy: date desc
|
sortBy: date desc
|
||||||
image:
|
image:
|
||||||
query: page.cover
|
query: page.cover
|
||||||
cover: true
|
cover: true
|
||||||
ratio: 3/2
|
ratio: 3/2
|
||||||
|
|||||||
+42
-42
@@ -1,42 +1,42 @@
|
|||||||
# The `site.yml` blueprint defines the look of the start page (Dashboard) of the Panel.
|
# The `site.yml` blueprint defines the look of the start page (Dashboard) of the Panel.
|
||||||
|
|
||||||
# The site blueprint usually provides easy access to all main pages of the site.
|
# The site blueprint usually provides easy access to all main pages of the site.
|
||||||
# In this example blueprint, we also show subpages of the `photography` and `notes` pages.
|
# In this example blueprint, we also show subpages of the `photography` and `notes` pages.
|
||||||
# More about the site blueprint: https://getkirby.com/docs/reference/panel/blueprints/site
|
# More about the site blueprint: https://getkirby.com/docs/reference/panel/blueprints/site
|
||||||
|
|
||||||
# The layout of this form has two columns:
|
# The layout of this form has two columns:
|
||||||
columns:
|
columns:
|
||||||
# The first column has one section for the subpages of the `photography` page in card layout
|
# The first column has one section for the subpages of the `photography` page in card layout
|
||||||
# It reuses the pages section defined in `/site/blueprints/sections/albums.yml`
|
# It reuses the pages section defined in `/site/blueprints/sections/albums.yml`
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
sections:
|
sections:
|
||||||
albums: sections/albums
|
albums: sections/albums
|
||||||
|
|
||||||
# The second column has two sections, `notes` and `pages`
|
# The second column has two sections, `notes` and `pages`
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
sections:
|
sections:
|
||||||
# The `notes` section reuses the pages section defined in `/site/blueprints/sections/notes.yml`
|
# The `notes` section reuses the pages section defined in `/site/blueprints/sections/notes.yml`
|
||||||
notes: sections/notes
|
notes: sections/notes
|
||||||
|
|
||||||
# The `pages` pages section shows other main pages of the site
|
# The `pages` pages section shows other main pages of the site
|
||||||
# Using the `templates` option, we limit which types of pages are shown
|
# Using the `templates` option, we limit which types of pages are shown
|
||||||
# Using the `create` option, we limit the type of page that can be created when a new page is created
|
# Using the `create` option, we limit the type of page that can be created when a new page is created
|
||||||
# Note that the `sandbox` page and the `error` page that also exist in the content folder but use different blueprints thus do not show up in the list
|
# Note that the `sandbox` page and the `error` page that also exist in the content folder but use different blueprints thus do not show up in the list
|
||||||
# Since the error page's blueprint is set to `read: false`, it wouldn't show up here even if you added the error blueprint to the templates list
|
# Since the error page's blueprint is set to `read: false`, it wouldn't show up here even if you added the error blueprint to the templates list
|
||||||
pages:
|
pages:
|
||||||
type: pages
|
type: pages
|
||||||
create: default
|
create: default
|
||||||
templates:
|
templates:
|
||||||
- about
|
- about
|
||||||
- home
|
- home
|
||||||
- default
|
- default
|
||||||
fields:
|
fields:
|
||||||
footerSecretsHeading:
|
footerSecretsHeading:
|
||||||
label: Footer secrets heading
|
label: Footer secrets heading
|
||||||
type: text
|
type: text
|
||||||
footerSecretOne:
|
footerSecretOne:
|
||||||
label: Footer secret one
|
label: Footer secret one
|
||||||
type: text
|
type: text
|
||||||
footerSecretTwo:
|
footerSecretTwo:
|
||||||
label: Footer secret two
|
label: Footer secret two
|
||||||
type: text
|
type: text
|
||||||
|
|||||||
@@ -1,41 +1,41 @@
|
|||||||
# User blueprints are used to create new user roles, define form fields for each user role and set role permissions.
|
# User blueprints are used to create new user roles, define form fields for each user role and set role permissions.
|
||||||
# By default, Kirby only has the `admin` role, a user role that is allowed to do anything.
|
# By default, Kirby only has the `admin` role, a user role that is allowed to do anything.
|
||||||
# The title is required, everything else is optional.
|
# The title is required, everything else is optional.
|
||||||
# The default user blueprint does not define a role, but a standard set of fields
|
# The default user blueprint does not define a role, but a standard set of fields
|
||||||
# available for each defined user role with blueprints that only contain a title.
|
# available for each defined user role with blueprints that only contain a title.
|
||||||
# More about users, roles and permissions: https://getkirby.com/docs/guide/users/managing-users
|
# More about users, roles and permissions: https://getkirby.com/docs/guide/users/managing-users
|
||||||
title: User
|
title: User
|
||||||
|
|
||||||
columns:
|
columns:
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
fields:
|
fields:
|
||||||
street:
|
street:
|
||||||
label: Street
|
label: Street
|
||||||
type: text
|
type: text
|
||||||
zip:
|
zip:
|
||||||
label: ZIP
|
label: ZIP
|
||||||
type: text
|
type: text
|
||||||
width: 1/4
|
width: 1/4
|
||||||
city:
|
city:
|
||||||
label: City
|
label: City
|
||||||
type: text
|
type: text
|
||||||
width: 3/4
|
width: 3/4
|
||||||
country:
|
country:
|
||||||
label: Country
|
label: Country
|
||||||
type: text
|
type: text
|
||||||
|
|
||||||
- width: 1/2
|
- width: 1/2
|
||||||
fields:
|
fields:
|
||||||
website:
|
website:
|
||||||
label: Website
|
label: Website
|
||||||
type: url
|
type: url
|
||||||
fediverse:
|
fediverse:
|
||||||
label: Fediverse URL
|
label: Fediverse URL
|
||||||
type: url
|
type: url
|
||||||
icon: mastodon
|
icon: mastodon
|
||||||
placeholder: https://example.com/@username
|
placeholder: https://example.com/@username
|
||||||
instagram:
|
instagram:
|
||||||
label: Instagram
|
label: Instagram
|
||||||
type: text
|
type: text
|
||||||
icon: instagram
|
icon: instagram
|
||||||
placeholder: username
|
placeholder: username
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user