From e6f9026c18806be21f197b8c9b37d553cdfe2b22 Mon Sep 17 00:00:00 2001 From: Francis Whittle Date: Wed, 10 Apr 2024 15:11:27 +1000 Subject: [PATCH] WPCIVIUX-144 Refactor strftime use to prevent incorrect autoloader use in pear/log package --- civicrm-ux.php | 2 +- composer.json | 3 +- composer.lock | 48 +--- includes/class-civicrm-ux.php | 15 +- shortcodes/civicrm/api4-get.php | 4 +- vendor/autoload.php | 18 ++ vendor/composer/ClassLoader.php | 137 +++++------ vendor/composer/InstalledVersions.php | 33 ++- vendor/composer/LICENSE | 2 + vendor/composer/autoload_classmap.php | 2 +- vendor/composer/autoload_files.php | 3 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 54 +---- vendor/composer/autoload_static.php | 1 - vendor/composer/installed.json | 47 ---- vendor/composer/installed.php | 21 +- vendor/composer/platform_check.php | 4 +- vendor/php81_bc/strftime/.editorconfig | 24 -- vendor/php81_bc/strftime/.gitattributes | 51 ---- .../strftime/.github/workflows/php.yml | 53 ----- vendor/php81_bc/strftime/.gitignore | 45 ---- vendor/php81_bc/strftime/LICENSE | 21 -- vendor/php81_bc/strftime/README.md | 168 -------------- vendor/php81_bc/strftime/autoload.php | 2 - vendor/php81_bc/strftime/composer.json | 38 --- vendor/php81_bc/strftime/example.php | 9 - vendor/php81_bc/strftime/phpunit.xml | 6 - .../strftime/src/php-8.1-strftime.php | 217 ------------------ .../tests/LocaleFormatterTestTrait.php | 18 -- .../LocaleTests/Locale_en_EN_TestTrait.php | 58 ----- .../LocaleTests/Locale_es_ES_TestTrait.php | 61 ----- .../tests/LocaleTests/Locale_eu_TestTrait.php | 59 ----- .../LocaleTests/Locale_it_CH_TestTrait.php | 55 ----- .../LocaleTests/Locale_it_IT_TestTrait.php | 55 ----- .../php81_bc/strftime/tests/strftimeTest.php | 212 ----------------- vendor/sabre/vobject/bin/generate_vcards | 0 vendor/sabre/vobject/bin/vobject | 0 38 files changed, 154 insertions(+), 1396 deletions(-) delete mode 100644 vendor/php81_bc/strftime/.editorconfig delete mode 100644 vendor/php81_bc/strftime/.gitattributes delete mode 100644 vendor/php81_bc/strftime/.github/workflows/php.yml delete mode 100644 vendor/php81_bc/strftime/.gitignore delete mode 100644 vendor/php81_bc/strftime/LICENSE delete mode 100644 vendor/php81_bc/strftime/README.md delete mode 100644 vendor/php81_bc/strftime/autoload.php delete mode 100644 vendor/php81_bc/strftime/composer.json delete mode 100644 vendor/php81_bc/strftime/example.php delete mode 100644 vendor/php81_bc/strftime/phpunit.xml delete mode 100644 vendor/php81_bc/strftime/src/php-8.1-strftime.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleFormatterTestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleTests/Locale_en_EN_TestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleTests/Locale_es_ES_TestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleTests/Locale_eu_TestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_CH_TestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_IT_TestTrait.php delete mode 100644 vendor/php81_bc/strftime/tests/strftimeTest.php mode change 100644 => 100755 vendor/sabre/vobject/bin/generate_vcards mode change 100644 => 100755 vendor/sabre/vobject/bin/vobject diff --git a/civicrm-ux.php b/civicrm-ux.php index 1df9885..6cb4756 100644 --- a/civicrm-ux.php +++ b/civicrm-ux.php @@ -9,7 +9,7 @@ * Plugin Name: WP CiviCRM UX * Plugin URI: https://github.com/agileware/wp-civicrm-ux * Description: A better user experience for integrating WordPress and CiviCRM - * Version: 1.13.1 + * Version: 1.13.2 * Requires at least: 5.8 * Requires PHP: 7.4 * Author: Agileware diff --git a/composer.json b/composer.json index 2792e65..183d632 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,5 @@ { "require": { - "sabre/vobject": "^4.2", - "php81_bc/strftime": "^0.7.4" + "sabre/vobject": "^4.2" } } diff --git a/composer.lock b/composer.lock index f63ad09..67e5800 100644 --- a/composer.lock +++ b/composer.lock @@ -4,52 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "97fe30aa315c8813ccfac86fc4d649db", + "content-hash": "7930f71dc4213a7eeefe3b65d96d488a", "packages": [ - { - "name": "php81_bc/strftime", - "version": "0.7.4", - "source": { - "type": "git", - "url": "https://github.com/alphp/strftime.git", - "reference": "10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alphp/strftime/zipball/10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc", - "reference": "10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc", - "shasum": "" - }, - "require": { - "ext-intl": "*", - "php": ">=7.1.0" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "type": "library", - "autoload": { - "files": [ - "src/php-8.1-strftime.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fernando Herrero", - "homepage": "https://github.com/alphp/strftime/graphs/contributors" - } - ], - "description": "Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible)", - "support": { - "issues": "https://github.com/alphp/strftime/issues", - "source": "https://github.com/alphp/strftime" - }, - "time": "2024-03-12T11:46:29+00:00" - }, { "name": "sabre/uri", "version": "2.1.1", @@ -268,5 +224,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.2.0" + "plugin-api-version": "2.6.0" } diff --git a/includes/class-civicrm-ux.php b/includes/class-civicrm-ux.php index 1d768a1..6814b9b 100755 --- a/includes/class-civicrm-ux.php +++ b/includes/class-civicrm-ux.php @@ -102,7 +102,7 @@ static public function getInstance( $plugin_file = '../civicrm-ux.php' ) { private function __construct( $plugin_file ) { $this->version = \get_file_data( realpath( $plugin_file ), [ 'Version' => 'Version' ], 'plugin' )['Version']; $this->civicrm_ux = 'civicrm-ux'; - self::$directory = plugin_dir_path( $plugin_file ); + self::$directory = trailingslashit( plugin_dir_path( $plugin_file ) ); $this->load_dependencies(); $this->set_locale(); @@ -113,8 +113,10 @@ private function __construct( $plugin_file ) { $this->define_rest(); $this->define_magic_tag(); - if( !function_exists( 'urlparam' ) && !empty( self::$directory ) ) { - include_once( self::$directory . '/packaged/url-params/urlparams.php'); + if( !empty( self::$directory ) ) { + if ( !function_exists( 'urlparam' ) ){ + include_once( self::$directory . 'packaged/url-params/urlparams.php'); + } } $this->loader->add_action( 'init', $this, 'civicrm_init' ); @@ -418,4 +420,11 @@ public function get_version() { return $this->version; } + public function strftime ( string $format, $timestamp = null, ?string $locale = null ) : string { + if ( !function_exists( 'PHP81_BC\\strftime' ) ){ + include_once( self::$directory . 'packaged/PHP81_BC/strftime.php'); + } + + return PHP81_BC\strftime( $format, $timestamp, $locale ); + } } diff --git a/shortcodes/civicrm/api4-get.php b/shortcodes/civicrm/api4-get.php index 3094a04..dff5a3e 100644 --- a/shortcodes/civicrm/api4-get.php +++ b/shortcodes/civicrm/api4-get.php @@ -1,6 +1,4 @@ strftime( $match['format'], strtotime( $output ) ) : CRM_Utils_Date::customFormat( $output ); } elseif ( ( $field['fk_entity'] ?? NULL ) == 'File' ) { $output = Civicrm_Ux::in_basepage( function () use ( $output ) { return htmlentities( civicrm_api3( 'Attachment', 'getvalue', [ diff --git a/vendor/autoload.php b/vendor/autoload.php index efec30e..79088e8 100644 --- a/vendor/autoload.php +++ b/vendor/autoload.php @@ -2,6 +2,24 @@ // autoload.php @generated by Composer +if (PHP_VERSION_ID < 50600) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + $err = 'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '.PHP_VERSION.', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'.PHP_EOL; + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, $err); + } elseif (!headers_sent()) { + echo $err; + } + } + trigger_error( + $err, + E_USER_ERROR + ); +} + require_once __DIR__ . '/composer/autoload_real.php'; return ComposerAutoloaderInitfa85ac06b7f15758458f94c1334ceeb2::getLoader(); diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index afef3fa..7824d8f 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -42,35 +42,37 @@ */ class ClassLoader { - /** @var ?string */ + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ private $vendorDir; // PSR-4 /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixLengthsPsr4 = array(); /** - * @var array[] - * @psalm-var array> + * @var array> */ private $prefixDirsPsr4 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr4 = array(); // PSR-0 /** - * @var array[] - * @psalm-var array> + * List of PSR-0 prefixes + * + * Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2'))) + * + * @var array>> */ private $prefixesPsr0 = array(); /** - * @var array[] - * @psalm-var array + * @var list */ private $fallbackDirsPsr0 = array(); @@ -78,8 +80,7 @@ class ClassLoader private $useIncludePath = false; /** - * @var string[] - * @psalm-var array + * @var array */ private $classMap = array(); @@ -87,29 +88,29 @@ class ClassLoader private $classMapAuthoritative = false; /** - * @var bool[] - * @psalm-var array + * @var array */ private $missingClasses = array(); - /** @var ?string */ + /** @var string|null */ private $apcuPrefix; /** - * @var self[] + * @var array */ private static $registeredLoaders = array(); /** - * @param ?string $vendorDir + * @param string|null $vendorDir */ public function __construct($vendorDir = null) { $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); } /** - * @return string[] + * @return array> */ public function getPrefixes() { @@ -121,8 +122,7 @@ public function getPrefixes() } /** - * @return array[] - * @psalm-return array> + * @return array> */ public function getPrefixesPsr4() { @@ -130,8 +130,7 @@ public function getPrefixesPsr4() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirs() { @@ -139,8 +138,7 @@ public function getFallbackDirs() } /** - * @return array[] - * @psalm-return array + * @return list */ public function getFallbackDirsPsr4() { @@ -148,8 +146,7 @@ public function getFallbackDirsPsr4() } /** - * @return string[] Array of classname => path - * @psalm-return array + * @return array Array of classname => path */ public function getClassMap() { @@ -157,8 +154,7 @@ public function getClassMap() } /** - * @param string[] $classMap Class to filename map - * @psalm-param array $classMap + * @param array $classMap Class to filename map * * @return void */ @@ -175,24 +171,25 @@ public function addClassMap(array $classMap) * Registers a set of PSR-0 directories for a given prefix, either * appending or prepending to the ones previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 root directories + * @param bool $prepend Whether to prepend the directories * * @return void */ public function add($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { if ($prepend) { $this->fallbackDirsPsr0 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr0 ); } else { $this->fallbackDirsPsr0 = array_merge( $this->fallbackDirsPsr0, - (array) $paths + $paths ); } @@ -201,19 +198,19 @@ public function add($prefix, $paths, $prepend = false) $first = $prefix[0]; if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; + $this->prefixesPsr0[$first][$prefix] = $paths; return; } if ($prepend) { $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixesPsr0[$first][$prefix] ); } else { $this->prefixesPsr0[$first][$prefix] = array_merge( $this->prefixesPsr0[$first][$prefix], - (array) $paths + $paths ); } } @@ -222,9 +219,9 @@ public function add($prefix, $paths, $prepend = false) * Registers a set of PSR-4 directories for a given namespace, either * appending or prepending to the ones previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories + * @param bool $prepend Whether to prepend the directories * * @throws \InvalidArgumentException * @@ -232,17 +229,18 @@ public function add($prefix, $paths, $prepend = false) */ public function addPsr4($prefix, $paths, $prepend = false) { + $paths = (array) $paths; if (!$prefix) { // Register directories for the root namespace. if ($prepend) { $this->fallbackDirsPsr4 = array_merge( - (array) $paths, + $paths, $this->fallbackDirsPsr4 ); } else { $this->fallbackDirsPsr4 = array_merge( $this->fallbackDirsPsr4, - (array) $paths + $paths ); } } elseif (!isset($this->prefixDirsPsr4[$prefix])) { @@ -252,18 +250,18 @@ public function addPsr4($prefix, $paths, $prepend = false) throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); } $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; + $this->prefixDirsPsr4[$prefix] = $paths; } elseif ($prepend) { // Prepend directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, + $paths, $this->prefixDirsPsr4[$prefix] ); } else { // Append directories for an already registered namespace. $this->prefixDirsPsr4[$prefix] = array_merge( $this->prefixDirsPsr4[$prefix], - (array) $paths + $paths ); } } @@ -272,8 +270,8 @@ public function addPsr4($prefix, $paths, $prepend = false) * Registers a set of PSR-0 directories for a given prefix, * replacing any others previously set for this prefix. * - * @param string $prefix The prefix - * @param string[]|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories * * @return void */ @@ -290,8 +288,8 @@ public function set($prefix, $paths) * Registers a set of PSR-4 directories for a given namespace, * replacing any others previously set for this namespace. * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param string[]|string $paths The PSR-4 base directories + * @param string $prefix The prefix/namespace, with trailing '\\' + * @param list|string $paths The PSR-4 base directories * * @throws \InvalidArgumentException * @@ -425,7 +423,8 @@ public function unregister() public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } @@ -476,9 +475,9 @@ public function findFile($class) } /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. + * Returns the currently registered loaders keyed by their corresponding vendor directories. * - * @return self[] + * @return array */ public static function getRegisteredLoaders() { @@ -555,18 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - * - * @param string $file - * @return void - * @private - */ -function includeFile($file) -{ - include $file; + /** + * @return void + */ + private static function initializeIncludeClosure() + { + if (self::$includeFile !== null) { + return; + } + + /** + * Scope isolated include. + * + * Prevents access to $this/self from included files. + * + * @param string $file + * @return void + */ + self::$includeFile = \Closure::bind(static function($file) { + include $file; + }, null, null); + } } diff --git a/vendor/composer/InstalledVersions.php b/vendor/composer/InstalledVersions.php index d50e0c9..51e734a 100644 --- a/vendor/composer/InstalledVersions.php +++ b/vendor/composer/InstalledVersions.php @@ -21,12 +21,14 @@ * See also https://getcomposer.org/doc/07-runtime.md#installed-versions * * To require its presence, you can require `composer-runtime-api ^2.0` + * + * @final */ class InstalledVersions { /** * @var mixed[]|null - * @psalm-var array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array}|array{}|null + * @psalm-var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null */ private static $installed; @@ -37,7 +39,7 @@ class InstalledVersions /** * @var array[] - * @psalm-var array}> + * @psalm-var array}> */ private static $installedByVendor = array(); @@ -96,7 +98,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) { foreach (self::getInstalled() as $installed) { if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; } } @@ -117,7 +119,7 @@ public static function isInstalled($packageName, $includeDevRequirements = true) */ public static function satisfies(VersionParser $parser, $packageName, $constraint) { - $constraint = $parser->parseConstraints($constraint); + $constraint = $parser->parseConstraints((string) $constraint); $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); return $provided->matches($constraint); @@ -241,7 +243,7 @@ public static function getInstallPath($packageName) /** * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string} + * @psalm-return array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool} */ public static function getRootPackage() { @@ -255,7 +257,7 @@ public static function getRootPackage() * * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect. * @return array[] - * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} + * @psalm-return array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} */ public static function getRawData() { @@ -278,7 +280,7 @@ public static function getRawData() * Returns the raw data of all installed.php which are currently loaded for custom implementations * * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ public static function getAllRawData() { @@ -301,7 +303,7 @@ public static function getAllRawData() * @param array[] $data A vendor/composer/installed.php data set * @return void * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string, type: string}, versions: array} $data + * @psalm-param array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $data */ public static function reload($data) { @@ -311,7 +313,7 @@ public static function reload($data) /** * @return array[] - * @psalm-return list}> + * @psalm-return list}> */ private static function getInstalled() { @@ -326,7 +328,9 @@ private static function getInstalled() if (isset(self::$installedByVendor[$vendorDir])) { $installed[] = self::$installedByVendor[$vendorDir]; } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require $vendorDir.'/composer/installed.php'; + $installed[] = self::$installedByVendor[$vendorDir] = $required; if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { self::$installed = $installed[count($installed) - 1]; } @@ -338,12 +342,17 @@ private static function getInstalled() // only require the installed.php file if this file is loaded from its dumped location, // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; + /** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} $required */ + $required = require __DIR__ . '/installed.php'; + self::$installed = $required; } else { self::$installed = array(); } } - $installed[] = self::$installed; + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } return $installed; } diff --git a/vendor/composer/LICENSE b/vendor/composer/LICENSE index 62ecfd8..f27399a 100644 --- a/vendor/composer/LICENSE +++ b/vendor/composer/LICENSE @@ -1,3 +1,4 @@ + Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -17,3 +18,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b26f1b1..0fb0a2c 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,7 +2,7 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 7205daa..3490fbb 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,12 +2,11 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( '383eaff206634a77a1be54e64e6459c7' => $vendorDir . '/sabre/uri/lib/functions.php', '3569eecfeed3bcf0bad3c998a494ecb8' => $vendorDir . '/sabre/xml/lib/Deserializer/functions.php', '93aa591bc4ca510c520999e34229ee79' => $vendorDir . '/sabre/xml/lib/Serializer/functions.php', - '9e71c1459ef1226520e4b26dac3a180d' => $vendorDir . '/php81_bc/strftime/src/php-8.1-strftime.php', ); diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index b7fc012..15a2ff3 100644 --- a/vendor/composer/autoload_namespaces.php +++ b/vendor/composer/autoload_namespaces.php @@ -2,7 +2,7 @@ // autoload_namespaces.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index bacd3b6..4cc8bc4 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -2,7 +2,7 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 19ed684..6a9bd59 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -25,56 +25,26 @@ public static function getLoader() require __DIR__ . '/platform_check.php'; spl_autoload_register(array('ComposerAutoloaderInitfa85ac06b7f15758458f94c1334ceeb2', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__))); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitfa85ac06b7f15758458f94c1334ceeb2', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInitfa85ac06b7f15758458f94c1334ceeb2::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInitfa85ac06b7f15758458f94c1334ceeb2::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } + $loader->register(true); - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } + $filesToLoad = \Composer\Autoload\ComposerStaticInitfa85ac06b7f15758458f94c1334ceeb2::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); + require $file; } - } - - $loader->register(true); - - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInitfa85ac06b7f15758458f94c1334ceeb2::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirefa85ac06b7f15758458f94c1334ceeb2($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -/** - * @param string $fileIdentifier - * @param string $file - * @return void - */ -function composerRequirefa85ac06b7f15758458f94c1334ceeb2($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index a934f76..f4bb387 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -10,7 +10,6 @@ class ComposerStaticInitfa85ac06b7f15758458f94c1334ceeb2 '383eaff206634a77a1be54e64e6459c7' => __DIR__ . '/..' . '/sabre/uri/lib/functions.php', '3569eecfeed3bcf0bad3c998a494ecb8' => __DIR__ . '/..' . '/sabre/xml/lib/Deserializer/functions.php', '93aa591bc4ca510c520999e34229ee79' => __DIR__ . '/..' . '/sabre/xml/lib/Serializer/functions.php', - '9e71c1459ef1226520e4b26dac3a180d' => __DIR__ . '/..' . '/php81_bc/strftime/src/php-8.1-strftime.php', ); public static $prefixLengthsPsr4 = array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6915d5b..c712368 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,52 +1,5 @@ { "packages": [ - { - "name": "php81_bc/strftime", - "version": "0.7.4", - "version_normalized": "0.7.4.0", - "source": { - "type": "git", - "url": "https://github.com/alphp/strftime.git", - "reference": "10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/alphp/strftime/zipball/10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc", - "reference": "10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc", - "shasum": "" - }, - "require": { - "ext-intl": "*", - "php": ">=7.1.0" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "time": "2024-03-12T11:46:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/php-8.1-strftime.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fernando Herrero", - "homepage": "https://github.com/alphp/strftime/graphs/contributors" - } - ], - "description": "Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible)", - "support": { - "issues": "https://github.com/alphp/strftime/issues", - "source": "https://github.com/alphp/strftime" - }, - "install-path": "../php81_bc/strftime" - }, { "name": "sabre/uri", "version": "2.1.1", diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 93102b1..cdfc5d2 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,58 +1,49 @@ array( + 'name' => '__root__', 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', + 'reference' => NULL, 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => NULL, - 'name' => '__root__', 'dev' => true, ), 'versions' => array( '__root__' => array( 'pretty_version' => '1.0.0+no-version-set', 'version' => '1.0.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../../', - 'aliases' => array(), 'reference' => NULL, - 'dev_requirement' => false, - ), - 'php81_bc/strftime' => array( - 'pretty_version' => '0.7.4', - 'version' => '0.7.4.0', 'type' => 'library', - 'install_path' => __DIR__ . '/../php81_bc/strftime', + 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'reference' => '10c13faf2f65bfaec17dfa769918e0c7a4c9b3cc', 'dev_requirement' => false, ), 'sabre/uri' => array( 'pretty_version' => '2.1.1', 'version' => '2.1.1.0', + 'reference' => 'a42126042c7dcb53e2978dadb6d22574d1359b4c', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/uri', 'aliases' => array(), - 'reference' => 'a42126042c7dcb53e2978dadb6d22574d1359b4c', 'dev_requirement' => false, ), 'sabre/vobject' => array( 'pretty_version' => '4.2.0', 'version' => '4.2.0.0', + 'reference' => 'bd500019764e434ff65872d426f523e7882a0739', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/vobject', 'aliases' => array(), - 'reference' => 'bd500019764e434ff65872d426f523e7882a0739', 'dev_requirement' => false, ), 'sabre/xml' => array( 'pretty_version' => '2.1.2', 'version' => '2.1.2.0', + 'reference' => 'e15454e68805e3713271ea58c0b2d6a82dac56b7', 'type' => 'library', 'install_path' => __DIR__ . '/../sabre/xml', 'aliases' => array(), - 'reference' => 'e15454e68805e3713271ea58c0b2d6a82dac56b7', 'dev_requirement' => false, ), ), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php index 6d3407d..f79e574 100644 --- a/vendor/composer/platform_check.php +++ b/vendor/composer/platform_check.php @@ -4,8 +4,8 @@ $issues = array(); -if (!(PHP_VERSION_ID >= 70100)) { - $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +if (!(PHP_VERSION_ID >= 70000)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.0.0". You are running ' . PHP_VERSION . '.'; } if ($issues) { diff --git a/vendor/php81_bc/strftime/.editorconfig b/vendor/php81_bc/strftime/.editorconfig deleted file mode 100644 index f9d7962..0000000 --- a/vendor/php81_bc/strftime/.editorconfig +++ /dev/null @@ -1,24 +0,0 @@ -; This file is for unifying the coding style for different editors and IDEs. -; More information at http://editorconfig.org - -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.bat] -end_of_line = crlf - -[*.yml] -indent_style = space -indent_size = 2 - -[*.twig] -insert_final_newline = false - -[Makefile] -indent_style = tab diff --git a/vendor/php81_bc/strftime/.gitattributes b/vendor/php81_bc/strftime/.gitattributes deleted file mode 100644 index cc578ba..0000000 --- a/vendor/php81_bc/strftime/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -# Define the line ending behavior of the different file extensions -# Set default behavior, in case users don't have core.autocrlf set. -* text=auto -* text eol=lf - -# Explicitly declare text files we want to always be normalized and converted -# to native line endings on checkout. -*.php text -*.default text -*.ctp text -*.sql text -*.md text -*.po text -*.js text -*.css text -*.ini text -*.properties text -*.txt text -*.xml text -*.svg text -*.yml text -.htaccess text - -# Declare files that will always have CRLF line endings on checkout. -*.bat eol=crlf - -# Declare files that will always have LF line endings on checkout. -*.pem eol=lf - -# Denote all files that are truly binary and should not be modified. -*.dbf binary -*.prj binary -*.shp binary -*.shx binary -*.sld binary -*.png binary -*.jpg binary -*.gif binary -*.ico binary -*.mo binary -*.pdf binary -*.phar binary -*.woff binary -*.woff2 binary -*.ttf binary -*.otf binary -*.eot binary -*.gz binary -*.bz2 binary -*.7z binary -*.zip binary diff --git a/vendor/php81_bc/strftime/.github/workflows/php.yml b/vendor/php81_bc/strftime/.github/workflows/php.yml deleted file mode 100644 index 56eda52..0000000 --- a/vendor/php81_bc/strftime/.github/workflows/php.yml +++ /dev/null @@ -1,53 +0,0 @@ -name: PHP Composer - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -permissions: - contents: read - -jobs: - build: - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - operating-system: [ubuntu-latest, windows-latest, macOS-latest] - php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3'] - - name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }} - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Install PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-versions }} - extensions: intl - - - name: Validate composer.json and composer.lock - run: composer validate --strict - - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v4 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-php- - - - name: Install dependencies - run: composer install --prefer-dist --no-progress - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: composer run-script test diff --git a/vendor/php81_bc/strftime/.gitignore b/vendor/php81_bc/strftime/.gitignore deleted file mode 100644 index a5b8120..0000000 --- a/vendor/php81_bc/strftime/.gitignore +++ /dev/null @@ -1,45 +0,0 @@ -# CakePHP specific files # -########################## -/config/app.php -/config/.env -/logs/* -/tmp/* -/vendor/* -/webroot/files/* - -# OS generated files # -###################### -.DS_Store -.DS_Store? -._* -.Spotlight-V100 -.Trashes -Icon? -ehthumbs.db -Thumbs.db -*.zip - -# Tool specific files # -####################### -/.vscode -/composer.lock -# vim -*~ -*.swp -*.swo -# sublime text & textmate -*.sublime-* -*.stTheme.cache -*.tmlanguage.cache -*.tmPreferences.cache -# Eclipse -.settings/* -# JetBrains, aka PHPStorm, IntelliJ IDEA -.idea/* -# NetBeans -nbproject/* -# Visual Studio Code -.vscode -# Sass preprocessor -.sass-cache/ -data diff --git a/vendor/php81_bc/strftime/LICENSE b/vendor/php81_bc/strftime/LICENSE deleted file mode 100644 index 030d10b..0000000 --- a/vendor/php81_bc/strftime/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -MIT License - -Copyright (c) 2022 Fernando Herrero - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/vendor/php81_bc/strftime/README.md b/vendor/php81_bc/strftime/README.md deleted file mode 100644 index 926eec7..0000000 --- a/vendor/php81_bc/strftime/README.md +++ /dev/null @@ -1,168 +0,0 @@ -[![GitHub Workflow](https://github.com/alphp/strftime/actions/workflows/php.yml/badge.svg)](https://github.com/alphp/strftime/actions/workflows/php.yml) -[![GitHub license](https://img.shields.io/github/license/alphp/strftime)](https://github.com/alphp/strftime/blob/master/LICENSE) -[![GitHub release](https://img.shields.io/github/release/alphp/strftime)](https://github.com/alphp/strftime/releases) -[![Packagist](https://img.shields.io/packagist/v/php81_bc/strftime)](https://packagist.org/packages/php81_bc/strftime) -[![Packagist Downloads](https://img.shields.io/packagist/dt/php81_bc/strftime)](https://packagist.org/packages/php81_bc/strftime/stats) -[![GitHub issues](https://img.shields.io/github/issues/alphp/strftime)](https://github.com/alphp/strftime/issues) -[![GitHub forks](https://img.shields.io/github/forks/alphp/strftime)](https://github.com/alphp/strftime/network) -[![GitHub stars](https://img.shields.io/github/stars/alphp/strftime)](https://github.com/alphp/strftime/stargazers) - -# strftime -Locale-formatted strftime using IntlDateFormatter (PHP 8.1 compatible) - -This provides a cross-platform alternative to strftime() for when it will be removed from PHP. - -Note that output can be slightly different between libc sprintf and this function as it is using ICU. - -Original code: https://gist.github.com/bohwaz/42fc223031e2b2dd2585aab159a20f30 - -Original autor: [BohwaZ](https://bohwaz.net/) - -# Table of contents -- [Requirements](#requirements) -- [Installation](#installation) - - [Composer install](#composer-install) - - [Manual install](#manual-install) -- [Usage](#usage) - - [Original use](#original-use) -- [Formats](#formats) - - [Day](#day) - - [Week](#week) - - [Month](#month) - - [Year](#year) - - [Time](#time) - - [Time and Date Stamps](#time-and-date-stamps) - - [Miscellaneous](#miscellaneous) - -## Requirements -- PHP >= 7.1.0 -- ext-intl ([Internationalization extension ICU](https://www.php.net/manual/en/book.intl.php)) - -[TOC](#table-of-contents) - -## Installation - -### Composer install -You can install this plugin into your application using [composer](https://getcomposer.org): - -- Add php81_bc/strftime package to your project: - ```bash - composer require php81_bc/strftime - ``` - -- Load the function PHP81_BC\strftime in your project - ```php - =7.1.0", - "ext-intl" : "*" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "scripts": { - "test": "vendor/bin/phpunit" - }, - "scripts-descriptions": { - "test": "Run PHPUnit tests" - }, - "autoload": { - "files": [ - "src/php-8.1-strftime.php" - ] - }, - "autoload-dev": { - "psr-4": { - "PHP81_BC\\Tests\\": "tests/" - } - } -} diff --git a/vendor/php81_bc/strftime/example.php b/vendor/php81_bc/strftime/example.php deleted file mode 100644 index c778238..0000000 --- a/vendor/php81_bc/strftime/example.php +++ /dev/null @@ -1,9 +0,0 @@ - - - - tests - - diff --git a/vendor/php81_bc/strftime/src/php-8.1-strftime.php b/vendor/php81_bc/strftime/src/php-8.1-strftime.php deleted file mode 100644 index 40eef9d..0000000 --- a/vendor/php81_bc/strftime/src/php-8.1-strftime.php +++ /dev/null @@ -1,217 +0,0 @@ - - */ - function strftime (string $format, $timestamp = null, ?string $locale = null) : string { - if (!($timestamp instanceof DateTimeInterface)) { - $timestamp = is_int($timestamp) ? '@' . $timestamp : (string) $timestamp; - - try { - $timestamp = new DateTime($timestamp); - } catch (Exception $e) { - throw new InvalidArgumentException('$timestamp argument is neither a valid UNIX timestamp, a valid date-time string or a DateTime object.', 0, $e); - } - } - - $timestamp->setTimezone(new DateTimeZone(date_default_timezone_get())); - - $locale = Locale::canonicalize($locale ?? (Locale::getDefault() ?? setlocale(LC_TIME, '0'))); - - $intl_formats = [ - '%a' => 'ccc', // An abbreviated textual representation of the day Sun through Sat - '%A' => 'EEEE', // A full textual representation of the day Sunday through Saturday - '%b' => 'LLL', // Abbreviated month name, based on the locale Jan through Dec - '%B' => 'MMMM', // Full month name, based on the locale January through December - '%h' => 'MMM', // Abbreviated month name, based on the locale (an alias of %b) Jan through Dec - ]; - - $intl_formatter = function (DateTimeInterface $timestamp, string $format) use ($intl_formats, $locale) { - $tz = $timestamp->getTimezone(); - $date_type = IntlDateFormatter::FULL; - $time_type = IntlDateFormatter::FULL; - $pattern = ''; - - switch ($format) { - // %c = Preferred date and time stamp based on locale - // Example: Tue Feb 5 00:45:10 2009 for February 5, 2009 at 12:45:10 AM - case '%c': - $date_type = IntlDateFormatter::LONG; - $time_type = IntlDateFormatter::SHORT; - break; - - // %x = Preferred date representation based on locale, without the time - // Example: 02/05/09 for February 5, 2009 - case '%x': - $date_type = IntlDateFormatter::SHORT; - $time_type = IntlDateFormatter::NONE; - break; - - // Localized time format - case '%X': - $date_type = IntlDateFormatter::NONE; - $time_type = IntlDateFormatter::MEDIUM; - break; - - default: - $pattern = $intl_formats[$format]; - } - - // In October 1582, the Gregorian calendar replaced the Julian in much of Europe, and - // the 4th October was followed by the 15th October. - // ICU (including IntlDateFormattter) interprets and formats dates based on this cutover. - // Posix (including strftime) and timelib (including DateTimeImmutable) instead use - // a "proleptic Gregorian calendar" - they pretend the Gregorian calendar has existed forever. - // This leads to the same instants in time, as expressed in Unix time, having different representations - // in formatted strings. - // To adjust for this, a custom calendar can be supplied with a cutover date arbitrarily far in the past. - $calendar = IntlGregorianCalendar::createInstance(); - // NOTE: IntlGregorianCalendar::createInstance DOES NOT return an IntlGregorianCalendar instance when - // using a non-Gregorian locale (e.g. fa_IR)! In that case, setGregorianChange will not exist. - if ($calendar instanceof IntlGregorianCalendar) { - $calendar->setGregorianChange(PHP_INT_MIN); - } - - return (new IntlDateFormatter($locale, $date_type, $time_type, $tz, $calendar, $pattern))->format($timestamp); - }; - - // Same order as https://www.php.net/manual/en/function.strftime.php - $translation_table = [ - // Day - '%a' => $intl_formatter, - '%A' => $intl_formatter, - '%d' => 'd', - '%e' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('j')); - }, - '%j' => function ($timestamp) { - // Day number in year, 001 to 366 - return sprintf('%03d', $timestamp->format('z')+1); - }, - '%u' => 'N', - '%w' => 'w', - - // Week - '%U' => function ($timestamp) { - // Number of weeks between date and first Sunday of year - $day = new DateTime(sprintf('%d-01 Sunday', $timestamp->format('Y'))); - return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7); - }, - '%V' => 'W', - '%W' => function ($timestamp) { - // Number of weeks between date and first Monday of year - $day = new DateTime(sprintf('%d-01 Monday', $timestamp->format('Y'))); - return sprintf('%02u', 1 + ($timestamp->format('z') - $day->format('z')) / 7); - }, - - // Month - '%b' => $intl_formatter, - '%B' => $intl_formatter, - '%h' => $intl_formatter, - '%m' => 'm', - - // Year - '%C' => function ($timestamp) { - // Century (-1): 19 for 20th century - return floor($timestamp->format('Y') / 100); - }, - '%g' => function ($timestamp) { - return substr($timestamp->format('o'), -2); - }, - '%G' => 'o', - '%y' => 'y', - '%Y' => 'Y', - - // Time - '%H' => 'H', - '%k' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('G')); - }, - '%I' => 'h', - '%l' => function ($timestamp) { - return sprintf('% 2u', $timestamp->format('g')); - }, - '%M' => 'i', - '%p' => 'A', // AM PM (this is reversed on purpose!) - '%P' => 'a', // am pm - '%r' => 'h:i:s A', // %I:%M:%S %p - '%R' => 'H:i', // %H:%M - '%S' => 's', - '%T' => 'H:i:s', // %H:%M:%S - '%X' => $intl_formatter, // Preferred time representation based on locale, without the date - - // Timezone - '%z' => 'O', - '%Z' => 'T', - - // Time and Date Stamps - '%c' => $intl_formatter, - '%D' => 'm/d/Y', - '%F' => 'Y-m-d', - '%s' => 'U', - '%x' => $intl_formatter, - ]; - - $out = preg_replace_callback('/(?format($replace); - } else { - $result = $replace($timestamp, $pattern); - } - - switch ($prefix) { - case '_': - // replace leading zeros with spaces but keep last char if also zero - return preg_replace('/\G0(?=.)/', ' ', $result); - case '#': - case '-': - // remove leading zeros but keep last char if also zero - return preg_replace('/^[0\s]+(?=.)/', '', $result); - } - - return $result; - }, $format); - - $out = str_replace('%%', '%', $out); - return $out; - } diff --git a/vendor/php81_bc/strftime/tests/LocaleFormatterTestTrait.php b/vendor/php81_bc/strftime/tests/LocaleFormatterTestTrait.php deleted file mode 100644 index 4870a42..0000000 --- a/vendor/php81_bc/strftime/tests/LocaleFormatterTestTrait.php +++ /dev/null @@ -1,18 +0,0 @@ -assertEquals('Sun', $result, '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', $locale); - $this->assertEquals('Sunday', $result, '%A: A full textual representation of the day'); - - $result = strftime('%b', '20220306 13:02:03', $locale); - $this->assertEquals('Mar', $result, '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', $locale); - $this->assertEquals('March', $result, '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', $locale); - $this->assertEquals('Mar', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%X', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('1:02:03 PM'), // PHP-7 - $this->equalTo('13:02:03') // PHP-8 - ), '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%c', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('March 6, 2022 at 1:02 PM'), // PHP-7 - $this->equalTo('March 6, 2022 at 13:02') // PHP-8 - ), '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%x', '20220306 13:02:03', $locale); - $this->assertEquals('3/6/22', $result, '%x: Preferred date representation based on locale, without the time'); - - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-01: 10/1/82', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-10: 10/10/82', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-15: 10/15/82', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_es_ES_TestTrait.php b/vendor/php81_bc/strftime/tests/LocaleTests/Locale_es_ES_TestTrait.php deleted file mode 100644 index a009735..0000000 --- a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_es_ES_TestTrait.php +++ /dev/null @@ -1,61 +0,0 @@ -assertThat($result, $this->logicalOr( - $this->equalTo('dom.'), // PHP-7 - $this->equalTo('dom') // PHP-8 - ), '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', $locale); - $this->assertEquals('domingo', $result, '%A: A full textual representation of the day'); - - $result = strftime('%b', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('mar.'), // PHP-7 - $this->equalTo('mar') // PHP-8 - ), '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', $locale); - $this->assertEquals('marzo', $result, '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('mar.'), // PHP-7 - $this->equalTo('mar') // PHP-8 - ), '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%X', '20220306 13:02:03', $locale); - $this->assertEquals('13:02:03', $result, '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%c', '20220306 13:02:03', $locale); - $this->assertEquals('6 de marzo de 2022, 13:02', $result, '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%x', '20220306 13:02:03', $locale); - $this->assertEquals('6/3/22', $result, '%x: Preferred date representation based on locale, without the time'); - - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-01: 1/10/82', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-10: 10/10/82', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-15: 15/10/82', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_eu_TestTrait.php b/vendor/php81_bc/strftime/tests/LocaleTests/Locale_eu_TestTrait.php deleted file mode 100644 index 2d30502..0000000 --- a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_eu_TestTrait.php +++ /dev/null @@ -1,59 +0,0 @@ -assertEquals('ig.', $result, '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', $locale); - $this->assertEquals('igandea', $result, '%A: A full textual representation of the day'); - - $result = strftime('%b', '20220306 13:02:03', $locale); - $this->assertEquals('mar.', $result, '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('martxoak'), - $this->equalTo('martxoa') // PHP-7.4, PHP-8.3 - ), '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', $locale); - $this->assertEquals('mar.', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%X', '20220306 13:02:03', $locale); - $this->assertEquals('13:02:03', $result, '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%c', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('2022(e)ko martxoaren 6(a) 13:02'), // PHP-7.4 - $this->equalTo('2022(e)ko martxoakren 6(a) 13:02'), - $this->equalTo('2022(e)ko martxoaren 6(a) (13:02)') // PHP-8.3 - ), '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%x', '20220306 13:02:03', $locale); - $this->assertEquals('22/3/6', $result, '%x: Preferred date representation based on locale, without the time'); - - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-01: 82/10/1', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-10: 82/10/10', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-15: 82/10/15', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_CH_TestTrait.php b/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_CH_TestTrait.php deleted file mode 100644 index 335b3be..0000000 --- a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_CH_TestTrait.php +++ /dev/null @@ -1,55 +0,0 @@ -assertEquals('dom', $result, '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', $locale); - $this->assertEquals('domenica', $result, '%A: A full textual representation of the day'); - - $result = strftime('%b', '20220306 13:02:03', $locale); - $this->assertEquals('mar', $result, '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', $locale); - $this->assertEquals('marzo', $result, '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', $locale); - $this->assertEquals('mar', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%X', '20220306 13:02:03', $locale); - $this->assertEquals('13:02:03', $result, '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%c', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('6 marzo 2022 13:02'), - $this->equalTo('6 marzo 2022 alle ore 13:02') // PHP-8.3 - ), '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%x', '20220306 13:02:03', $locale); - $this->assertEquals('06.03.22', $result, '%x: Preferred date representation based on locale, without the time'); - - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-01: 01.10.82', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-10: 10.10.82', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-15: 15.10.82', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_IT_TestTrait.php b/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_IT_TestTrait.php deleted file mode 100644 index ab6737e..0000000 --- a/vendor/php81_bc/strftime/tests/LocaleTests/Locale_it_IT_TestTrait.php +++ /dev/null @@ -1,55 +0,0 @@ -assertEquals('dom', $result, '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', $locale); - $this->assertEquals('domenica', $result, '%A: A full textual representation of the day'); - - $result = strftime('%b', '20220306 13:02:03', $locale); - $this->assertEquals('mar', $result, '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', $locale); - $this->assertEquals('marzo', $result, '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', $locale); - $this->assertEquals('mar', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%X', '20220306 13:02:03', $locale); - $this->assertEquals('13:02:03', $result, '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%c', '20220306 13:02:03', $locale); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('6 marzo 2022 13:02'), - $this->equalTo('6 marzo 2022 alle ore 13:02') // PHP-8.3 - ), '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%x', '20220306 13:02:03', $locale); - $this->assertEquals('06/03/22', $result, '%x: Preferred date representation based on locale, without the time'); - - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-01: 01/10/82', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-10: 10/10/82', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, $locale); - $this->assertEquals('1582-10-15: 15/10/82', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/php81_bc/strftime/tests/strftimeTest.php b/vendor/php81_bc/strftime/tests/strftimeTest.php deleted file mode 100644 index 2540afc..0000000 --- a/vendor/php81_bc/strftime/tests/strftimeTest.php +++ /dev/null @@ -1,212 +0,0 @@ -assertEquals('2022-03-06 01:02:03', $result, 'int $timestamp test fail'); - - $result = strftime('%Y-%m-%d %H:%M:%S', '20220306 01:02:03'); - $this->assertEquals('2022-03-06 01:02:03', $result, 'string $timestamp test fail'); - - $result = strftime('%Y-%m-%d %H:%M:%S', new DateTime('20220306 01:02:03')); - $this->assertEquals('2022-03-06 01:02:03', $result, 'DateTime $timestamp test fail'); - } - - public function testException () { - $this->expectException(InvalidArgumentException::class); - $result = strftime('%Y-%m-%d %H:%M:%S', 'InvalidArgumentException'); - - $this->expectException(InvalidArgumentException::class); - $result = strftime('%ñ', '20220306 13:02:03'); - } - - public function testDayFormats () { - $result = strftime('%a', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('Sun', $result, '%a: An abbreviated textual representation of the day'); - - $result = strftime('%A', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('Sunday', $result, '%A: A full textual representation of the day'); - - $result = strftime('%d', '20220306 13:02:03'); - $this->assertEquals('06', $result, '%d: Two-digit day of the month (with leading zeros)'); - - $result = strftime('%e', '20220306 13:02:03'); - $this->assertEquals(' 6', $result, '%e: Day of the month, with a space preceding single digits'); - - $result = strftime('%#e', '20220306 13:02:03'); - $this->assertEquals('6', $result, '%#e: Day of the month, without leading space'); - - $result = strftime('%-e', '20220306 13:02:03'); - $this->assertEquals('6', $result, '%-e: Day of the month, without leading space'); - - $result = strftime('%j', '20220306 13:02:03'); - $this->assertEquals('065', $result, '%j: Day of the year, 3 digits with leading zeros'); - - $result = strftime('%u', '20220306 13:02:03'); - $this->assertEquals('7', $result, '%u: ISO-8601 numeric representation of the day of the week'); - - $result = strftime('%w', '20220306 13:02:03'); - $this->assertEquals('0', $result, '%w: Numeric representation of the day of the week'); - } - - public function testWeekFormats () { - $result = strftime('%U', '20220306 13:02:03'); - $this->assertEquals('10', $result, '%U: Week number of the given year, starting with the first Sunday as the first week'); - - $result = strftime('%V', '20220306 13:02:03'); - $this->assertEquals('09', $result, '%V: ISO-8601:1988 week number of the given year, starting withthe first week of the year with at least 4 weekdays, with Monday being the start of the week'); - - $result = strftime('%W', '20220306 13:02:03'); - $this->assertEquals('09', $result, '%W: A numeric representation of the week of the year, starting with the first Monday as the first week'); - } - - public function testMonthFormats () { - $result = strftime('%b', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('Mar', $result, '%b: Abbreviated month name, based on the locale'); - - $result = strftime('%B', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('March', $result, '%B: Full month name, based on the locale'); - - $result = strftime('%h', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('Mar', $result, '%h: Abbreviated month name, based on the locale (an alias of %b)'); - - $result = strftime('%m', '20220306 13:02:03'); - $this->assertEquals('03', $result, '%m: Two digit representation of the month'); - } - - public function testYearFormats () { - $result = strftime('%C', '20220306 13:02:03'); - $this->assertEquals('20', $result, '%C: Two digit representation of the century (year divided by 100, truncated to an integer)'); - - $result = strftime('%g', '20220306 13:02:03'); - $this->assertEquals('22', $result, '%g: Two digit representation of the year going by ISO-8601:1988 standards (see %V)'); - - $result = strftime('%G', '20220306 13:02:03'); - $this->assertEquals('2022', $result, '%G: The full four-digit version of %g'); - - $result = strftime('%y', '20220306 13:02:03'); - $this->assertEquals('22', $result, '%y: Two digit representation of the year'); - - $result = strftime('%Y', '20220306 13:02:03'); - $this->assertEquals('2022', $result, '%Y: Four digit representation for the year'); - } - - public function testTimeFormats () { - $result = strftime('%H', '20220306 13:02:03'); - $this->assertEquals('13', $result, '%H: Two digit representation of the hour in 24-hour format'); - - $result = strftime('%k', '20220306 01:02:03'); - $this->assertEquals(' 1', $result, '%k: Hour in 24-hour format, with a space preceding single digits'); - - $result = strftime('%I', '20220306 13:02:03'); - $this->assertEquals('01', $result, '%I: Two digit representation of the hour in 12-hour format'); - - $result = strftime('%l', '20220306 13:02:03'); - $this->assertEquals(' 1', $result, '%l: (lower-case "L") Hour in 12-hour format, with a space preceding single digits'); - - $result = strftime('%M', '20220306 13:02:03'); - $this->assertEquals('02', $result, '%M: Two digit representation of the minute'); - - $result = strftime('%p', '20220306 13:02:03'); - $this->assertEquals('PM', $result, '%p: UPPER-CASE "AM" or "PM" based on the given time'); - - $result = strftime('%P', '20220306 13:02:03'); - $this->assertEquals('pm', $result, '%P: lower-case "am" or "pm" based on the given time'); - - $result = strftime('%r', '20220306 13:02:03'); - $this->assertEquals('01:02:03 PM', $result, '%r: Same as "%I:%M:%S %p"'); - - $result = strftime('%R', '20220306 13:02:03'); - $this->assertEquals('13:02', $result, '%R: Same as "%H:%M"'); - - $result = strftime('%S', '20220306 13:02:03'); - $this->assertEquals('03', $result, '%S: Two digit representation of the second'); - - $result = strftime('%T', '20220306 13:02:03'); - $this->assertEquals('13:02:03', $result, '%T: Same as "%H:%M:%S"'); - - $result = strftime('%X', '20220306 13:02:03', 'en-EN'); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('1:02:03 PM'), - $this->equalTo('13:02:03') // PHP-8 - ), '%X: Preferred time representation based on locale, without the date'); - - $result = strftime('%z', '20220306 13:02:03'); - $this->assertEquals('+0100', $result, '%z: The time zone offset'); - - $result = strftime('%Z', '20220306 13:02:03'); - $this->assertEquals('CET', $result, '%Z: The time zone abbreviation'); - } - - public function testStampsFormats () { - $result = strftime('%c', '20220306 13:02:03', 'en-EN'); - $this->assertThat($result, $this->logicalOr( - $this->equalTo('March 6, 2022 at 1:02 PM'), - $this->equalTo('March 6, 2022 at 13:02') // PHP-8 - ), '%c: Preferred date and time stamp based on locale'); - - $result = strftime('%D', '20220306 13:02:03'); - $this->assertEquals('03/06/2022', $result, '%D: Same as "%m/%d/%y"'); - - $result = strftime('%F', '20220306 13:02:03'); - $this->assertEquals('2022-03-06', $result, '%F: Same as "%Y-%m-%d" (commonly used in database datestamps)'); - - $result = strftime('%s', '20220306 13:02:03'); - $this->assertEquals('1646568123', $result, '%s: Unix Epoch Time timestamp (same as the time() function)'); - - $result = strftime('%x', '20220306 13:02:03', 'en-EN'); - $this->assertEquals('3/6/22', $result, '%x: Preferred date representation based on locale, without the time'); - } - - public function testMiscellaneousFormats () { - $result = strftime('%n', '20220306 13:02:03'); - $this->assertEquals("\n", $result, '%n: A newline character ("\n")'); - - $result = strftime('%t', '20220306 13:02:03'); - $this->assertEquals("\t", $result, '%t: A Tab character ("\t")'); - - $result = strftime('%%', '20220306 13:02:03'); - $this->assertEquals('%', $result, '%%: A literal percentage character ("%")'); - } - - /** - * In October 1582, the Gregorian calendar replaced the Julian in much of Europe, and - * the 4th October was followed by the 15th October. - * ICU (including IntlDateFormattter) interprets and formats dates based on this cutover. - * Posix (including strftime) and timelib (including DateTimeImmutable) instead use - * a "proleptic Gregorian calendar" - they pretend the Gregorian calendar has existed forever. - * This leads to the same instants in time, as expressed in Unix time, having different representations - * in formatted strings. - */ - public function testJulianCutover () { - // 1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-01')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, 'en-EN'); - $this->assertEquals('1582-10-01: 10/1/82', $result, '1st October 1582 in proleptic Gregorian is the same date as 21st September 1582 Julian'); - - // In much of Europe, the 10th October 1582 never existed - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-10')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, 'en-EN'); - $this->assertEquals('1582-10-10: 10/10/82', $result, 'In much of Europe, the 10th October 1582 never existed'); - - // The 15th October was the first day after the cutover, after which both systems agree - $prolepticTimestamp = DateTimeImmutable::createFromFormat('Y-m-d|', '1582-10-15')->getTimestamp(); - $result = strftime('%F: %x', $prolepticTimestamp, 'en-EN'); - $this->assertEquals('1582-10-15: 10/15/82', $result, 'The 15th October was the first day after the cutover, after which both systems agree'); - } - } diff --git a/vendor/sabre/vobject/bin/generate_vcards b/vendor/sabre/vobject/bin/generate_vcards old mode 100644 new mode 100755 diff --git a/vendor/sabre/vobject/bin/vobject b/vendor/sabre/vobject/bin/vobject old mode 100644 new mode 100755