From e250b94bb16b40d6333182bd18f2e52c4058d34d Mon Sep 17 00:00:00 2001 From: balexey88 Date: Tue, 24 Oct 2023 17:18:53 +0300 Subject: [PATCH 01/53] Merge latest changes from 3.2.5 to v4.0. Update changelog --- changelog.txt | 16 + changes.md | 17 + lib/classes/class-compatibility.php | 421 ++++++++++-------- lib/classes/class-module.php | 138 ++++++ lib/classes/compatibility/ICompatibility.php | 269 ----------- lib/classes/compatibility/acf-image-crop.php | 107 ----- lib/classes/compatibility/buddyboss.php | 48 -- lib/classes/compatibility/buddypress.php | 185 -------- lib/classes/compatibility/divi.php | 65 --- .../compatibility/dynamic-image-support.php | 34 +- .../compatibility/easy-digital-downloads.php | 144 ------ lib/classes/compatibility/elementor.php | 158 ------- lib/classes/compatibility/ewww.php | 68 --- .../compatibility/google-app-engine.php | 14 +- .../compatibility/gravity-forms-signature.php | 109 ----- lib/classes/compatibility/gravity-forms.php | 276 ------------ lib/classes/compatibility/imagify.php | 184 ++++---- lib/classes/compatibility/learn-dash.php | 69 --- .../compatibility/lite-speed-cache.php | 380 ---------------- lib/classes/compatibility/polylang-pro.php | 57 --- lib/classes/compatibility/shortpixel.php | 351 +++++++-------- .../compatibility/simple-local-avatars.php | 78 ---- lib/classes/compatibility/siteorigin-css.php | 36 +- .../siteorigin-widget-bundle.php | 47 +- .../compatibility/the-events-calendar.php | 48 -- lib/classes/compatibility/vidorev.php | 20 +- .../woo-extra-product-options.php | 31 +- lib/classes/compatibility/wp-retina-2x.php | 88 ++-- lib/classes/compatibility/wp-smush.php | 137 +++--- .../compatibility/wpbakery-page-builder.php | 44 +- lib/classes/compatibility/wpforms.php | 17 +- readme.txt | 2 +- wp-stateless-media.php | 4 +- 33 files changed, 894 insertions(+), 2768 deletions(-) create mode 100644 lib/classes/class-module.php delete mode 100644 lib/classes/compatibility/ICompatibility.php delete mode 100644 lib/classes/compatibility/acf-image-crop.php delete mode 100644 lib/classes/compatibility/buddyboss.php delete mode 100644 lib/classes/compatibility/buddypress.php delete mode 100644 lib/classes/compatibility/divi.php delete mode 100644 lib/classes/compatibility/easy-digital-downloads.php delete mode 100644 lib/classes/compatibility/elementor.php delete mode 100644 lib/classes/compatibility/ewww.php delete mode 100644 lib/classes/compatibility/gravity-forms-signature.php delete mode 100644 lib/classes/compatibility/gravity-forms.php delete mode 100644 lib/classes/compatibility/learn-dash.php delete mode 100644 lib/classes/compatibility/lite-speed-cache.php delete mode 100644 lib/classes/compatibility/polylang-pro.php delete mode 100644 lib/classes/compatibility/simple-local-avatars.php delete mode 100644 lib/classes/compatibility/the-events-calendar.php diff --git a/changelog.txt b/changelog.txt index b27651c59..143612745 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,4 +1,20 @@ == Changelog == += 4.0.0 = +* COMPATIBILITY - Removed compatibility with "Advanced Custom Fields: Image Crop Add-on", because plugin is deprecated. +* COMPATIBILITY - BuddyBoss Platform compatibility moved to a separate plugin [WP-Stateless - BuddyBoss Platform Addon](https://github.com/udx/wp-stateless-buddyboss-addon). +* COMPATIBILITY - BuddyPress compatibility moved to a separate plugin [WP-Stateless - BuddyPress Addon](https://github.com/udx/wp-stateless-buddypress-addon). +* COMPATIBILITY - Easy Digital Downloads compatibility moved to a separate plugin [WP-Stateless - Easy Digital Downloads Addon](https://github.com/udx/wp-stateless-easy-digital-downloads-addon). +* COMPATIBILITY - Divi theme compatibility moved to a separate plugin [WP-Stateless - Divi theme Addon](https://github.com/udx/wp-stateless-divi-addon). +* COMPATIBILITY - Elementor Website Builder compatibility moved to a separate plugin [WP-Stateless - Elementor Website Builder Addon](https://github.com/udx/wp-stateless-elementor-addon). +* COMPATIBILITY - Gravity Forms compatibility moved to a separate plugin [WP-Stateless - Gravity Forms Addon](https://github.com/udx/wp-stateless-gravity-forms-addon). +* COMPATIBILITY - Gravity Forms Signature compatibility moved to a separate plugin [WP-Stateless - Gravity Forms Signature Addon](https://github.com/udx/wp-stateless-gravity-forms-signature-addon). +* COMPATIBILITY - LearnDash® LMS compatibility moved to a separate plugin [WP-Stateless - LearnDash LMS Plugin Addon](https://github.com/udx/wp-stateless-learndash-addon). +* COMPATIBILITY - LiteSpeed Cache compatibility moved to a separate plugin [WP-Stateless - LiteSpeed Cache Addon](https://github.com/udx/wp-stateless-litespeed-cache-addon). +* COMPATIBILITY - Polylang Pro compatibility moved to a separate plugin [WP-Stateless - Polylang Pro Addon](https://github.com/udx/wp-stateless-polylang-pro-addon). +* COMPATIBILITY - Simple Local Avatar compatibility moved to a separate plugin [WP-Stateless - Simple Local Avatars Addon](https://github.com/udx/wp-stateless-simple-local-avatars-addon). +* COMPATIBILITY - SiteOrigin CSS compatibility moved to a separate plugin [WP-Stateless - SiteOrigin CSS Addon](https://github.com/udx/wp-stateless-siteorigin-css-addon). +* COMPATIBILITY - SiteOrigin Widgets Bundle compatibility moved to a separate plugin [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://github.com/udx/wp-stateless-siteorigin-widgets-bundle-addon). + = 3.2.5 = * FIX - Folder setting does not allow custom structure [#608](https://github.com/udx/wp-stateless/issues/608). * FIX - Stateless mode Incompatible with Inline Uploader [#675](https://github.com/udx/wp-stateless/issues/675). diff --git a/changes.md b/changes.md index 8f1163fd6..24ea68dd9 100644 --- a/changes.md +++ b/changes.md @@ -1,3 +1,20 @@ +#### 4.0.0 + +* COMPATIBILITY - Removed compatibility with "Advanced Custom Fields: Image Crop Add-on", because plugin is deprecated. +* COMPATIBILITY - BuddyBoss Platform compatibility moved to a separate plugin [WP-Stateless - BuddyBoss Platform Addon](https://github.com/udx/wp-stateless-buddyboss-addon). +* COMPATIBILITY - BuddyPress compatibility moved to a separate plugin [WP-Stateless - BuddyPress Addon](https://github.com/udx/wp-stateless-buddypress-addon). +* COMPATIBILITY - Easy Digital Downloads compatibility moved to a separate plugin [WP-Stateless - Easy Digital Downloads Addon](https://github.com/udx/wp-stateless-easy-digital-downloads-addon). +* COMPATIBILITY - Divi theme compatibility moved to a separate plugin [WP-Stateless - Divi theme Addon](https://github.com/udx/wp-stateless-divi-addon). +* COMPATIBILITY - Elementor Website Builder compatibility moved to a separate plugin [WP-Stateless - Elementor Website Builder Addon](https://github.com/udx/wp-stateless-elementor-addon). +* COMPATIBILITY - Gravity Forms compatibility moved to a separate plugin [WP-Stateless - Gravity Forms Addon](https://github.com/udx/wp-stateless-gravity-forms-addon). +* COMPATIBILITY - Gravity Forms Signature compatibility moved to a separate plugin [WP-Stateless - Gravity Forms Signature Addon](https://github.com/udx/wp-stateless-gravity-forms-signature-addon). +* COMPATIBILITY - LearnDash® LMS compatibility moved to a separate plugin [WP-Stateless - LearnDash LMS Plugin Addon](https://github.com/udx/wp-stateless-learndash-addon). +* COMPATIBILITY - LiteSpeed Cache compatibility moved to a separate plugin [WP-Stateless - LiteSpeed Cache Addon](https://github.com/udx/wp-stateless-litespeed-cache-addon). +* COMPATIBILITY - Polylang Pro compatibility moved to a separate plugin [WP-Stateless - Polylang Pro Addon](https://github.com/udx/wp-stateless-polylang-pro-addon). +* COMPATIBILITY - Simple Local Avatar compatibility moved to a separate plugin [WP-Stateless - Simple Local Avatars Addon](https://github.com/udx/wp-stateless-simple-local-avatars-addon). +* COMPATIBILITY - SiteOrigin CSS compatibility moved to a separate plugin [WP-Stateless - SiteOrigin CSS Addon](https://github.com/udx/wp-stateless-siteorigin-css-addon). +* COMPATIBILITY - SiteOrigin Widgets Bundle compatibility moved to a separate plugin [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://github.com/udx/wp-stateless-siteorigin-widgets-bundle-addon). + #### 3.2.5 * FIX - Folder setting does not allow custom structure [#608](https://github.com/udx/wp-stateless/issues/608). * FIX - Stateless mode Incompatible with Inline Uploader [#675](https://github.com/udx/wp-stateless/issues/675). diff --git a/lib/classes/class-compatibility.php b/lib/classes/class-compatibility.php index d54d977ca..3880795d5 100644 --- a/lib/classes/class-compatibility.php +++ b/lib/classes/class-compatibility.php @@ -1,215 +1,264 @@ New Constant, ...] + * ['WP_STATELESS_MEDIA_ON_FLY' => 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT'] + */ + protected $constant = ''; + protected $enabled = false; + protected $description = ''; + protected $plugin_file = null; + protected $theme_name = null; + protected $first_party = false; + protected $non_library_sync = false; + protected $server_constant = false; + protected $sm_mode_required = ''; + protected $sm_mode_not_supported = []; + + public function __construct() { + $this->init(); + } -namespace wpCloud\StatelessMedia { + /** + * Checking whether the plugin is active or not. + * If the plugin_file is specified then check whether plugin is active or not. + * We can't use is_plugin_active function because it's defined later in init. + * By default return true. + * + * @todo caching. + */ + public function is_plugin_active() { + if (!empty($this->theme_name)) { + $theme = wp_get_theme(); + if ($theme->Name == $this->theme_name) { + return true; + } - class Module { + $parent_theme = $theme->parent(); + if (is_a($parent_theme, 'WP_Theme') && $parent_theme->Name == $this->theme_name) { + return true; + } - private static $modules = array(); + return false; + } - /** - * Object initiated on Bootstrap::__construct - * Save module data on admin_init hook. - * Initiate all the compatibility modules. - */ - public function __construct() { - add_action( 'admin_init', array( $this, 'save_modules' ), 1 ); - - /** - * ACF image crop addons compatibility. - */ - new CompatibilityAcfImageCrop(); - - /** - * Support for BuddyBoss - */ - new BuddyBoss(); - - /** - * Support for The Events Calendar - */ - new TheEventsCalendar(); - - /** - * Support for BuddyPress - */ - new BuddyPress(); - - /** - * Support for Divi - */ - new Divi(); - - /** - * Dynamic Image Support - */ - new DynamicImageSupport(); - - /** - * Support for Easy Digital Downloads download method - */ - new EDDDownloadMethod(); - - /** - * Support for Elementor - */ - new Elementor(); - - /** - * EWWW Image Optimizer - */ - new EWWW(); - - /** - * Google App Engine - */ - new GoogleAppEngine(); - - /** - * Support for Gravity Form file upload field - */ - new GravityForm(); - - /** - * Support for Gravity Forms Signature Add-On - */ - new GravityFormSignature(); - - /** - * Support for Imagify - */ - new Imagify(); - - /** - * Support for LearnDash - */ - new LearnDash(); - - /** - * LiteSpeed Cache - */ - new LSCacheWP(); - - /** - * Polylang Pro - */ - new Polylang(); - - /** - * Support for ShortPixel Image Optimizer - */ - new ShortPixel(); - - /** - * Simple Local Avatars - */ - new SimpleLocalAvatars(); - - /** - * Support for SiteOrigin CSS files - */ - new SOCSS(); - - /** - * Support for SiteOrigin widget CSS files - */ - new SOWidgetCSS(); - - /** - * VidoRev - */ - new VidoRev(); - - /** - * WP Retina 2x - */ - new WPRetina2x(); - - /** - * Support for WPForms - */ - new WPSmush(); - - /** - * Support for WPForms - */ - new CompatibilityWooExtraProductOptions(); - - /** - * Support for WPBakery Page Builder - */ - new WPBakeryPageBuilder(); - - /** - * Support for WPForms - */ - new WPForms(); - - /** - * Support for WooCommerce - */ - new WooCommerce(); + if (!empty($this->plugin_file)) { + // Converting string to array for foreach + if (is_string($this->plugin_file)) { + $this->plugin_file = array($this->plugin_file); + } + + // If multisite then check if plugin is network active + if (is_multisite()) { + $active_plugins = (array)get_site_option('active_sitewide_plugins'); + foreach ($this->plugin_file as $plugin_file) { + if (isset($active_plugins[$plugin_file])) { + return true; + } + } + + // If we are in network admin then return, unless it will get data from main site. + if (is_network_admin()) { + return false; + } + } + $active_plugins = (array)get_option('active_plugins', array()); + foreach ($this->plugin_file as $plugin_file) { + if (in_array($plugin_file, $active_plugins)) { + return true; + } + } + + return false; } /** - * Register compatibility modules so that we can ues them in settings page. - * Called from ICompatibility::init() method. + * If server constant is set - check if exist it on global $_SERVER */ - public static function register_module( $args ) { - if( empty( $args[ 'id' ] ) ) { - return; + if (!empty($this->server_constant)) { + if (isset($_SERVER[$this->server_constant])) { + return true; + } + return false; + } + + return true; + } + + /** + * Checking whether current mode is supported. + * By default return true. + * + * @todo caching. + */ + public function is_mode_supported() { + $sm_mode = isset($_POST['sm']['mode']) ? $_POST['sm']['mode'] : ud_get_stateless_media()->get('sm.mode'); + if (in_array($sm_mode, $this->sm_mode_not_supported)) { + return false; + } + return true; + } + + /** + * Initialize the module + * Check whether plugin is active or not. + * Register module. + * + * Add action for sm::module::init hook for module_init, which is fired(do_action) on Bootstrap::init() + */ + public function init() { + $is_constant = false; + $is_network_override = false; + $sm_mode = isset($_POST['sm']['mode']) ? $_POST['sm']['mode'] : ud_get_stateless_media()->get('sm.mode'); + if (is_network_admin()) { + $this->enabled = null; + } + + if (is_array($this->constant)) { + foreach ($this->constant as $old_const => $new_const) { + if (defined($new_const)) { + $is_constant = true; + $this->enabled = constant($new_const); + break; + } + if (is_string($old_const) && defined($old_const)) { + $is_constant = true; + $this->enabled = constant($old_const); + ud_get_stateless_media()->errors->add(array( + 'key' => $this->id, + 'title' => sprintf(__("%s: Deprecated Notice (%s)", ud_get_stateless_media()->domain), ud_get_stateless_media()->name, $this->title), + 'message' => sprintf(__("%s constant is deprecated, please use %s instead.", ud_get_stateless_media()->domain), $old_const, $new_const), + ), 'notice'); + break; + } } - if( is_bool( $args[ 'enabled' ] ) ) { - $args[ 'enabled' ] = $args[ 'enabled' ] ? 'true' : 'false'; + } elseif (defined($this->constant)) { + $this->enabled = constant($this->constant); + $is_constant = true; + } + + if (!$is_constant) { + $modules = get_option('stateless-modules', array()); + if (empty($this->enabled)) { + $this->enabled = !empty($modules[$this->id]) && $modules[$this->id] == 'true' ? true : false; + } + if (is_multisite()) { + $modules = get_site_option('stateless-modules', array()); + if (is_network_admin()) { + $this->enabled = !empty($modules[$this->id]) ? ($modules[$this->id] == 'true' ? true : false) : ''; + } elseif (!empty($modules[$this->id])) { + $this->enabled = !empty($modules[$this->id]) ? ($modules[$this->id] == 'true' ? true : false) : ''; + $is_network_override = true; + } } - self::$modules[ $args[ 'id' ] ] = wp_parse_args( $args, array( 'id' => '', 'self' => '', 'title' => '', 'enabled' => false, 'description' => '', 'is_constant' => false, 'is_network' => false, 'is_plugin_active' => false, ) ); + } + + if (!is_network_admin() && (!$this->is_plugin_active() || !$this->is_mode_supported())) { + $this->enabled = 'inactive'; } /** - * Return all the registered modules. - * Used in admin_init in bootstrap class as localize_script. + * Checking whether to show manual sync option. */ - public static function get_modules() { - return self::$modules; + if ($this->is_plugin_active() && $this->non_library_sync == true) { + global $show_non_library_sync; + $show_non_library_sync = true; + } + + Module::register_module(array( + 'id' => $this->id, + 'self' => $this, + 'title' => $this->title, + 'enabled' => $this->enabled, + 'description' => $this->description, + 'is_constant' => $is_constant, + 'is_network_override' => $is_network_override, + 'is_plugin_active' => $this->is_plugin_active(), + 'is_network_admin' => is_network_admin(), + 'is_plugin' => !empty($this->plugin_file), + 'is_theme' => !empty($this->theme_name), + 'is_mode_supported' => $this->is_mode_supported(), + 'mode' => ucfirst($sm_mode) + )); + + if ($this->enabled && $this->is_plugin_active() && $this->is_mode_supported()) { + add_action('sm::module::init', array($this, 'module_init')); + } + + if (!$this->enabled && !$this->first_party && $this->is_plugin_active()) { + ud_get_stateless_media()->errors->add(array( + 'key' => $this->id, + 'title' => sprintf(__("%s: Compatibility for %s isn't enabled.", ud_get_stateless_media()->domain), ud_get_stateless_media()->name, $this->title), + 'button' => __("Enable Compatibility", ud_get_stateless_media()->domain), + 'message' => __("Please enable the compatibility to ensure the functionality will work properly between {$this->title} and WP-Stateless.", ud_get_stateless_media()->domain), + ), 'notice'); } /** - * Return all the registered modules. - * Used in admin_init in bootstrap class as localize_script. + * Check requires WP-Stateless mode */ - public static function get_module( $id ) { - if( !empty( self::$modules[ $id ] ) ) { - return self::$modules[ $id ]; + if (!empty($this->sm_mode_required) && $this->enabled !== 'inactive') { + if ($sm_mode !== $this->sm_mode_required) { + ud_get_stateless_media()->errors->add(array( + 'key' => $this->id, + 'title' => sprintf(__("%s: Current Mode is not compatible with %s.", ud_get_stateless_media()->domain), ud_get_stateless_media()->name, $this->title), + 'message' => sprintf(__("%s compatibility requires %s in %s mode.", ud_get_stateless_media()->domain), $this->title, ud_get_stateless_media()->name, ucfirst($this->sm_mode_required)), + ), 'notice'); } - return false; } + } - /** - * Handles saving module data. - * Enable or disable modules from Compatibility tab. - */ - public function save_modules() { - if( isset( $_POST[ 'action' ] ) && $_POST[ 'action' ] == 'stateless_modules' && wp_verify_nonce( $_POST[ '_smnonce' ], 'wp-stateless-modules' ) ) { - $modules = !empty( $_POST[ 'stateless-modules' ] ) ? $_POST[ 'stateless-modules' ] : array(); - $modules = array_map( 'sanitize_text_field', $modules); - $modules = apply_filters( 'stateless::modules::save', $modules ); - - if( is_network_admin() ) { - update_site_option( 'stateless-modules', $modules ); - } else { - update_option( 'stateless-modules', $modules, true ); - } - wp_redirect( $_POST[ '_wp_http_referer' ] ); + /** + * @return bool + */ + public function enable_compatibility() { + + if (is_network_admin()) { + $modules = get_site_option('stateless-modules', array()); + if (empty($modules[$this->id]) || $modules[$this->id] != 'true') { + $modules[$this->id] = 'true'; + update_site_option('stateless-modules', $modules, true); + } + } else { + $modules = get_option('stateless-modules', array()); + if (empty($modules[$this->id]) || $modules[$this->id] != 'true') { + $modules[$this->id] = 'true'; + update_option('stateless-modules', $modules, true); } } + + return true; } -} \ No newline at end of file + /** + * add_webp_mime + * @param $t + * @param $user + * @return mixed + */ + public function add_webp_mime($t, $user) { + $t['webp'] = 'image/webp'; + return $t; + } +} diff --git a/lib/classes/class-module.php b/lib/classes/class-module.php new file mode 100644 index 000000000..1fe19699f --- /dev/null +++ b/lib/classes/class-module.php @@ -0,0 +1,138 @@ + '', 'self' => '', 'title' => '', 'enabled' => false, 'description' => '', 'is_constant' => false, 'is_network' => false, 'is_plugin_active' => false,)); + } + + /** + * Return all the registered modules. + * Used in admin_init in bootstrap class as localize_script. + */ + public static function get_modules() { + return self::$modules; + } + + /** + * Return all the registered modules. + * Used in admin_init in bootstrap class as localize_script. + */ + public static function get_module($id) { + if (!empty(self::$modules[$id])) { + return self::$modules[$id]; + } + return false; + } + + /** + * Handles saving module data. + * Enable or disable modules from Compatibility tab. + */ + public function save_modules() { + if (isset($_POST['action']) && $_POST['action'] == 'stateless_modules' && wp_verify_nonce($_POST['_smnonce'], 'wp-stateless-modules')) { + $modules = !empty($_POST['stateless-modules']) ? $_POST['stateless-modules'] : array(); + $modules = apply_filters('stateless::modules::save', $modules); + + if (is_network_admin()) { + update_site_option('stateless-modules', $modules); + } else { + update_option('stateless-modules', $modules, true); + } + wp_redirect($_POST['_wp_http_referer']); + } + } + } +} \ No newline at end of file diff --git a/lib/classes/compatibility/ICompatibility.php b/lib/classes/compatibility/ICompatibility.php deleted file mode 100644 index 3d0998b4c..000000000 --- a/lib/classes/compatibility/ICompatibility.php +++ /dev/null @@ -1,269 +0,0 @@ - New Constant, ...] - * ['WP_STATELESS_MEDIA_ON_FLY' => 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT'] - */ - protected $constant = ''; - protected $enabled = false; - protected $description = ''; - protected $plugin_file = null; - protected $theme_name = null; - protected $first_party = false; - protected $non_library_sync = false; - protected $server_constant = false; - protected $sm_mode_required = ''; - protected $sm_mode_not_supported = []; - - public function __construct() { - $this->init(); - } - - /** - * Checking whether the plugin is active or not. - * If the plugin_file is specified then check whether plugin is active or not. - * We can't use is_plugin_active function because it's defined later in init. - * By default return true. - * - * @todo caching. - */ - public function is_plugin_active() { - if (!empty($this->theme_name)) { - $theme = wp_get_theme(); - if ($theme->Name == $this->theme_name) { - return true; - } - - $parent_theme = $theme->parent(); - if (is_a($parent_theme, 'WP_Theme') && $parent_theme->Name == $this->theme_name) { - return true; - } - - return false; - } - - if (!empty($this->plugin_file)) { - // Converting string to array for foreach - if (is_string($this->plugin_file)) { - $this->plugin_file = array($this->plugin_file); - } - - // If multisite then check if plugin is network active - if (is_multisite()) { - $active_plugins = (array)get_site_option('active_sitewide_plugins'); - foreach ($this->plugin_file as $plugin_file) { - if (isset($active_plugins[$plugin_file])) { - return true; - } - } - - // If we are in network admin then return, unless it will get data from main site. - if (is_network_admin()) { - return false; - } - } - - $active_plugins = (array)get_option('active_plugins', array()); - foreach ($this->plugin_file as $plugin_file) { - if (in_array($plugin_file, $active_plugins)) { - return true; - } - } - - return false; - } - - /** - * If server constant is set - check if exist it on global $_SERVER - */ - if (!empty( $this->server_constant )) { - if ( isset($_SERVER[ $this->server_constant ]) ) { - return true; - } - return false; - } - - return true; - } - - /** - * Checking whether current mode is supported. - * By default return true. - * - * @todo caching. - */ - public function is_mode_supported () { - $sm_mode = isset($_POST['sm']['mode']) ? sanitize_text_field($_POST['sm']['mode']) : ud_get_stateless_media()->get( 'sm.mode' ); - if ( in_array( $sm_mode, $this->sm_mode_not_supported ) ) { - return false; - } - return true; - } - - /** - * Initialize the module - * Check whether plugin is active or not. - * Register module. - * - * Add action for sm::module::init hook for module_init, which is fired(do_action) on Bootstrap::init() - */ - public function init() { - $is_constant = false; - $is_network_override = false; - $sm_mode = isset($_POST['sm']['mode']) ? $_POST['sm']['mode'] : ud_get_stateless_media()->get( 'sm.mode' ); - if (is_network_admin()) { - $this->enabled = null; - } - - if (is_array($this->constant)) { - foreach ($this->constant as $old_const => $new_const) { - if (defined($new_const)) { - $is_constant = true; - $this->enabled = constant($new_const); - break; - } - if (is_string($old_const) && defined($old_const)) { - $is_constant = true; - $this->enabled = constant($old_const); - ud_get_stateless_media()->errors->add(array( - 'key' => $this->id, - 'title' => sprintf(__("%s: Deprecated Notice (%s)", ud_get_stateless_media()->domain), ud_get_stateless_media()->name, $this->title), - 'message' => sprintf(__("%s constant is deprecated, please use %s instead.", ud_get_stateless_media()->domain), $old_const, $new_const), - ), 'notice'); - break; - } - } - } elseif (defined($this->constant)) { - $this->enabled = constant($this->constant); - $is_constant = true; - } - - if (!$is_constant) { - $modules = get_option('stateless-modules', array()); - if (empty($this->enabled)) { - $this->enabled = !empty($modules[$this->id]) && $modules[$this->id] == 'true' ? true : false; - } - if (is_multisite()) { - $modules = get_site_option('stateless-modules', array()); - if (is_network_admin()) { - $this->enabled = !empty($modules[$this->id]) ? ($modules[$this->id] == 'true' ? true : false) : ''; - } elseif (!empty($modules[$this->id])) { - $this->enabled = !empty($modules[$this->id]) ? ($modules[$this->id] == 'true' ? true : false) : ''; - $is_network_override = true; - } - } - } - - if (!is_network_admin() && ( !$this->is_plugin_active() || !$this->is_mode_supported() )) { - $this->enabled = 'inactive'; - } - - /** - * Checking whether to show manual sync option. - */ - if ($this->is_plugin_active() && $this->non_library_sync == true) { - global $show_non_library_sync; - $show_non_library_sync = true; - } - - Module::register_module(array( - 'id' => $this->id, - 'self' => $this, - 'title' => $this->title, - 'enabled' => $this->enabled, - 'description' => $this->description, - 'is_constant' => $is_constant, - 'is_network_override' => $is_network_override, - 'is_plugin_active' => $this->is_plugin_active(), - 'is_network_admin' => is_network_admin(), - 'is_plugin' => !empty($this->plugin_file), - 'is_theme' => !empty($this->theme_name), - 'is_mode_supported' => $this->is_mode_supported(), - 'mode' => ucfirst( $sm_mode ) - )); - - if ($this->enabled && $this->is_plugin_active() && $this->is_mode_supported()) { - add_action('sm::module::init', array($this, 'module_init')); - } - - if (!$this->enabled && !$this->first_party && $this->is_plugin_active()) { - ud_get_stateless_media()->errors->add(array( - 'key' => $this->id, - 'title' => sprintf(__("%s: Compatibility for %s isn't enabled.", ud_get_stateless_media()->domain), ud_get_stateless_media()->name, $this->title), - 'button' => __("Enable Compatibility", ud_get_stateless_media()->domain), - 'message' => __("Please enable the compatibility to ensure the functionality will work properly between {$this->title} and WP-Stateless.", ud_get_stateless_media()->domain), - ), 'notice'); - } - - /** - * Check requires WP-Stateless mode - */ - if ( !empty( $this->sm_mode_required ) && $this->enabled !== 'inactive' ) { - if ( $sm_mode !== $this->sm_mode_required ) { - ud_get_stateless_media()->errors->add( array( - 'key' => $this->id, - 'title' => sprintf( __( "%s: Current Mode is not compatible with %s.", ud_get_stateless_media()->domain ), ud_get_stateless_media()->name, $this->title ), - 'message' => sprintf( __( "%s compatibility requires %s in %s mode.", ud_get_stateless_media()->domain ), $this->title, ud_get_stateless_media()->name, ucfirst( $this->sm_mode_required ) ), - ), 'notice' ); - } - } - } - - /** - * @return bool - */ - public function enable_compatibility() { - - if (is_network_admin()) { - $modules = get_site_option('stateless-modules', array()); - if (empty($modules[$this->id]) || $modules[$this->id] != 'true') { - $modules[$this->id] = 'true'; - update_site_option('stateless-modules', $modules, true); - } - } else { - $modules = get_option('stateless-modules', array()); - if (empty($modules[$this->id]) || $modules[$this->id] != 'true') { - $modules[$this->id] = 'true'; - update_option('stateless-modules', $modules, true); - } - } - - return true; - } - - /** - * add_webp_mime - * @param $t - * @param $user - * @return mixed - */ - public function add_webp_mime($t, $user) { - $t['webp'] = 'image/webp'; - return $t; - } - } - -} \ No newline at end of file diff --git a/lib/classes/compatibility/acf-image-crop.php b/lib/classes/compatibility/acf-image-crop.php deleted file mode 100644 index 535f64080..000000000 --- a/lib/classes/compatibility/acf-image-crop.php +++ /dev/null @@ -1,107 +0,0 @@ -get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $root_dir = trim( $root_dir, '/ ' ); // Remove any forward slash and empty space. - $data[ 'basedir' ] = ud_get_stateless_media()->get_gs_host() . '/' . $root_dir; - $data[ 'baseurl' ] = ud_get_stateless_media()->get_gs_host() . '/' . $root_dir; - $data[ 'url' ] = $data[ 'baseurl' ] . $data[ 'subdir' ]; - return $data; - } - } - - } - -} diff --git a/lib/classes/compatibility/buddyboss.php b/lib/classes/compatibility/buddyboss.php deleted file mode 100644 index d880ee1f2..000000000 --- a/lib/classes/compatibility/buddyboss.php +++ /dev/null @@ -1,48 +0,0 @@ - $r['object'], - 'item_id' => $r['item_id'], - 'html' => false, - 'type' => 'full', - ) ); - $thumb_avatar = bp_core_fetch_avatar( array( - 'object' => $r['object'], - 'item_id' => $r['item_id'], - 'html' => false, - 'type' => 'thumb', - ) ); - - $wp_uploads_dir = wp_get_upload_dir(); - - $full_avatar_path = $wp_uploads_dir[ 'basedir' ] . '/' . apply_filters( 'wp_stateless_file_name', $full_avatar, false ); - $full_avatar = apply_filters( 'wp_stateless_file_name', $full_avatar, 0 ); - - $thumb_avatar_path = $wp_uploads_dir[ 'basedir' ] . '/' . apply_filters( 'wp_stateless_file_name', $thumb_avatar, false ); - $thumb_avatar = apply_filters( 'wp_stateless_file_name', $thumb_avatar, 0 ); - - do_action( 'sm:sync::syncFile', $full_avatar, $full_avatar_path, true, array( 'ephemeral' => false ) ); - do_action( 'sm:sync::syncFile', $thumb_avatar, $thumb_avatar_path, true, array( 'ephemeral' => false ) ); - } - - /** - * Convert image url in image html to GCS URL. - * - * @param [type] $image_html html code for image. - * @return void - */ - public function bp_core_fetch_avatar( $image_html ) { - try { - preg_match( "/src=(?:'|\")(http.*?)(?:'|\")/", $image_html, $image_url ); - if( !empty( $image_url[ 1 ] ) ) { - $gs_image_url = $this->bp_core_fetch_avatar_url( $image_url[ 1 ] ); - $image_html = str_replace( $image_url[ 1 ], $gs_image_url, $image_html ); - } - } catch( \Throwable $th ) { - //throw $th; - } - return $image_html; - } - - /** - * Sync then return GCS url. - * - * @param [type] $url image url. - * @return void - */ - public function bp_core_fetch_avatar_url( $url ) { - $wp_uploads_dir = wp_get_upload_dir(); - $name = apply_filters( 'wp_stateless_file_name', $url, 0 ); - $full_avatar_path = $wp_uploads_dir[ 'basedir' ] . '/' . $name; - - - $root_dir = ud_get_stateless_media()->get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $root_dir = trim( $root_dir, '/ ' ); // Remove any forward slash and empty space. - // Making sure that we only modify url for uploads dir. - // @todo support photo in plugins directory. - - if( strpos( $name, plugins_url() ) === 0 ) { - $name = str_replace( plugins_url() . '/', '', $name ); - $name = apply_filters( 'wp_stateless_file_name', $name, 0 ); - $full_avatar_path = WP_PLUGIN_DIR . '/' . $name; - } - - if( strpos( $name, "$root_dir/http" ) !== 0 && strpos( $name, "http" ) !== 0 && $root_dir !== $name ) { - do_action( 'sm:sync::syncFile', $name, $full_avatar_path, false, array( 'ephemeral' => false ) ); - $url = ud_get_stateless_media()->get_gs_host() . '/' . $name; - } - return $url; - } - - /** - * Deleting avatar from GCS. - * @param $return - * @param $args - * @return bool - */ - public function delete_existing_avatar( $return, $args ) { - if( empty( $args[ 'object' ] ) && empty( $args[ 'item_id' ] ) ) { - return $return; - } - - $full_avatar = bp_core_fetch_avatar( array( 'object' => $args[ 'object' ], 'item_id' => $args[ 'item_id' ], 'html' => false, 'type' => 'full', ) ); - $thumb_avatar = bp_core_fetch_avatar( array( 'object' => $args[ 'object' ], 'item_id' => $args[ 'item_id' ], 'html' => false, 'type' => 'thumb', ) ); - - do_action( 'sm:sync::deleteFile', apply_filters( 'wp_stateless_file_name', $full_avatar, 0 ) ); - do_action( 'sm:sync::deleteFile', apply_filters( 'wp_stateless_file_name', $thumb_avatar, 0 ) ); - - if( ud_get_stateless_media()->get( 'sm.mode' ) === 'ephemeral' ) { - $return = false; - } - - return $return; - } - - /** - * Sync and return GCS url for group images. - * - * Used as CSS background-image. - * - * @param [type] $return - * @param [type] $r - * @return void - */ - public function bp_attachments_pre_get_attachment( $return, $r ) { - // Return if this is a recursive call. - if( !empty( $r[ 'recursive' ] ) ) { - return $return; - } - - try { - $debug_backtrace = \debug_backtrace( false ); - - // Making sure we only return GCS link if the type is url. - if( !empty( $debug_backtrace[ 3 ][ 'args' ][ 0 ] ) && $debug_backtrace[ 3 ][ 'args' ][ 0 ] == 'url' ) { - $r[ 'recursive' ] = true; - - $url = bp_attachments_get_attachment( 'url', $r ); - $name = apply_filters( 'wp_stateless_file_name', $url, 0 ); - - $root_dir = ud_get_stateless_media()->get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $root_dir = trim( $root_dir, '/ ' ); // Remove any forward slash and empty space. - - if( !empty( $name ) && $root_dir . "/" != $name ) { - $full_path = bp_attachments_get_attachment( false, $r ); - do_action( 'sm:sync::syncFile', $name, $full_path, false, array( 'ephemeral' => false ) ); - $return = ud_get_stateless_media()->get_gs_host() . '/' . $name; - } - - } - } catch( \Throwable $th ) { - //throw $th; - } - return $return; - } - - } - - } - -} diff --git a/lib/classes/compatibility/divi.php b/lib/classes/compatibility/divi.php deleted file mode 100644 index 66a56d907..000000000 --- a/lib/classes/compatibility/divi.php +++ /dev/null @@ -1,65 +0,0 @@ - 7, 'function' => '__construct', 'class' => 'ET_Core_PageResource' ), - array( 'stack_level' => 7, 'function' => 'get_cache_filename', 'class' => 'ET_Builder_Element' ) - ); - - /** - * Initialize compatibility module - * @param $sm - */ - public function module_init( $sm ) { - // exclude randomize_filename from export - if( !empty( $_GET[ 'et_core_portability' ] ) || wp_doing_ajax() && ( !empty( $_POST[ 'action' ] ) - && $_POST[ 'action' ] == 'et_core_portability_export' ) || ( !empty( $_POST[ 'et_core_portability_export' ] ) - && $_POST[ 'et_core_portability_export' ] == 'et_core_portability_export' ) ) { - remove_filter( 'sanitize_file_name', array( "wpCloud\StatelessMedia\Utility", 'randomize_filename' ), 10 ); - } - - // maybe skip cache busting - add_filter( 'stateless_skip_cache_busting', array( $this, 'maybe_skip_cache_busting' ), 10, 2 ); - } - - /** - * Maybe skip cache busting - * @param $null - * @param $filename - * @return bool | string - */ - public function maybe_skip_cache_busting( $null, $filename ) { - $callstack = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS, 8 ); - if( Utility::isCallStackMatches( $callstack, $this->cache_busting_disable_conditions ) ) return $filename; - return $null; - } - - } - - } - -} diff --git a/lib/classes/compatibility/dynamic-image-support.php b/lib/classes/compatibility/dynamic-image-support.php index c674d10df..ffe2b3ad2 100644 --- a/lib/classes/compatibility/dynamic-image-support.php +++ b/lib/classes/compatibility/dynamic-image-support.php @@ -1,4 +1,5 @@ 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT' ]; + protected $constant = ['WP_STATELESS_MEDIA_ON_FLY' => 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT']; protected $description = 'Upload image thumbnails generated by your theme and plugins that do not register media objects with the media library. This could be significantly impact performance negatively.'; protected $first_party = true; public function __construct() { - $modules = get_option( 'stateless-modules', array() ); + $modules = get_option('stateless-modules', array()); - if( empty( $modules[ $this->id ] ) ) { + if (empty($modules[$this->id])) { // Legacy settings - $this->enabled = get_option( 'sm_on_fly', false ); + $this->enabled = get_option('sm_on_fly', false); } $this->init(); @@ -33,16 +34,16 @@ public function __construct() { /** * @param $sm */ - public function module_init( $sm ) { + public function module_init($sm) { /** * On Google App Engine not working */ - if ( isset($_SERVER["GAE_VERSION"]) ) return; + if (isset($_SERVER["GAE_VERSION"])) return; /** * Handle any other on fly generated media * 7d23984e Anton Korotkov, 2 years ago (February 19th, 2016 9:02am) new options added */ - add_filter( 'image_make_intermediate_size', array( $this, 'handle_on_fly' ) ); + add_filter('image_make_intermediate_size', array($this, 'handle_on_fly')); } /** @@ -51,21 +52,21 @@ public function module_init( $sm ) { * @param $file * @return mixed */ - public function handle_on_fly( $file ) { + public function handle_on_fly($file) { $client = ud_get_stateless_media()->get_client(); $upload_dir = wp_upload_dir(); - $file_path = str_replace( trailingslashit( $upload_dir[ 'path' ] ), '', $file ); - $file_info = @getimagesize( $file ); - $mimeType = wp_check_filetype( $file ); + $file_path = str_replace(trailingslashit($upload_dir['path']), '', $file); + $file_info = @getimagesize($file); + $mimeType = wp_check_filetype($file); if ($file_info) { $_metadata = array( 'width' => $file_info[0], 'height' => $file_info[1], 'object-id' => 'unknown', // we really don't know it - 'source-id' => md5( $file . ud_get_stateless_media()->get( 'sm.bucket' ) ), - 'file-hash' => md5( $file ) + 'source-id' => md5($file . ud_get_stateless_media()->get('sm.bucket')), + 'file-hash' => md5($file) ); } @@ -80,9 +81,6 @@ public function handle_on_fly( $file ) { return $file; } - } - } - } diff --git a/lib/classes/compatibility/easy-digital-downloads.php b/lib/classes/compatibility/easy-digital-downloads.php deleted file mode 100644 index 7c13699fb..000000000 --- a/lib/classes/compatibility/easy-digital-downloads.php +++ /dev/null @@ -1,144 +0,0 @@ -get_gs_host() ) ) { - try { - $file_extension = edd_get_file_extension( $requested_file ); - $ctype = edd_get_file_ctype( $file_extension ); - - header( "Content-Type: $ctype" ); - header( "Content-Transfer-Encoding: Binary" ); - header( "Content-Description: File Transfer" ); - header( "Content-disposition: attachment; filename=\"" . apply_filters( 'edd_requested_file_name', basename( $requested_file ) ) . "\"" ); - readfile( $requested_file ); - exit; - } catch( Exception $e ) { - if( wp_redirect( $requested_file ) ) { - exit; - } - } - } - } - - /** - * EDD Front-end Submission Author Avatar - * - * @param $url - * @param $ID - * @return string - */ - public function wp_get_attachment_url( $url, $ID ) { - global $wp_current_filter; - - // Verifying that the wp_get_attachment_url is called from EDD Front-end Submission. - // The flow of function call - // save_form_frontend() > save_field_values() > save_field() > - // save_field_frontend() > fes_update_avatar() > wp_get_image_editor() - if( in_array( 'wp_ajax_fes_submit_profile_form', $wp_current_filter ) ) { - $uploads = wp_get_upload_dir(); - $meta_data = wp_get_attachment_metadata( $ID ); - - if( !empty( $meta_data[ 'file' ] ) && false === $uploads[ 'error' ] ) { - $absolutePath = $uploads[ 'basedir' ] . "/" . $meta_data[ 'file' ]; - - if( !file_exists( $absolutePath ) ) { - $this->client = ud_get_stateless_media()->get_client(); - if( $this->client && !is_wp_error( $this->client ) ) { - $this->client->get_media( $meta_data[ 'file' ], true, $absolutePath ); - } - } - - if( file_exists( $absolutePath ) ) { - $url = $uploads[ 'baseurl' ] . "/" . $meta_data[ 'file' ]; - } - } - } - return $url; - } - - /** - * Change Upload BaseURL when called from fes_get_attachment_id_from_url function. - * Unless fes_get_attachment_id_from_url function won't be able to return attachment id. - * @param $data - * @return mixed - */ - public function upload_dir( $data ) { - if( $this->hook_from_fes() ) { - $root_dir = ud_get_stateless_media()->get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $data[ 'baseurl' ] = ud_get_stateless_media()->get_gs_host() . '/' . $root_dir; - } - return $data; - } - - /** - * Determine where we hook from - * We need to do this only for fes_get_attachment_id_from_url() function - * - * @return bool - */ - private function hook_from_fes() { - $call_stack = debug_backtrace(); - if( !empty( $call_stack[ 5 ][ 'function' ] ) && $call_stack[ 5 ][ 'function' ] == 'fes_get_attachment_id_from_url' ) { - return true; - } - - // Extra layer of condition to be sure - if( !empty( $call_stack ) && is_array( $call_stack ) ) { - foreach( $call_stack as $step ) { - if( $step[ 'function' ] == 'getURLsAndPATHs' && strpos( $step[ 'file' ], 'wp-short-pixel' ) ) { - return true; - } - } - } - - return false; - } - } - - } - -} diff --git a/lib/classes/compatibility/elementor.php b/lib/classes/compatibility/elementor.php deleted file mode 100644 index 7d3a32488..000000000 --- a/lib/classes/compatibility/elementor.php +++ /dev/null @@ -1,158 +0,0 @@ -get('sm.mode'), ['disabled', 'backup'])) { - $url = ud_get_stateless_media()->get_gs_host() . '/' . $name; - } - } - } - } catch (\Exception $e) { - // @todo maybe log the exception. - } - // We are in filter so need to return the passed value. - return $url; - } - - /** - * To regenerate/delete files click Regenerate Files in - * Elementor >> Tools >> General >> Regenerate CSS - * All files will be deleted from GCS. - * And will be copied to GCS again on next page view. - */ - public function delete_elementor_files() { - do_action('sm:sync::deleteFiles', 'elementor/'); - } - - /** - * Delete GCS file on update/delete post. - * @param $post_ID - * @param null $post - * @param null $update - */ - public function delete_css_files($post_ID, $post = null, $update = null) { - if ($update || current_action() === 'deleted_post') { - $post_css = new \Elementor\Core\Files\CSS\Post($post_ID); - - // elementor/ css/ 'post-' . $post_id . '.css' - $name = $post_css::UPLOADS_DIR . $post_css::DEFAULT_FILES_DIR . $post_css->get_file_name(); - $name = apply_filters('wp_stateless_file_name', $name, 0); - do_action('sm:sync::deleteFile', $name); - } - } - - /** - * Delete elementor global css file when global style is updated on Elementor Editor. - * @param $success_response_data - * @param $id - * @param $data - * @return mixed - */ - public function delete_global_css($success_response_data, $id, $data) { - try { - $post_css = new \Elementor\Core\Files\CSS\Global_CSS('global.css'); - // elementor/ css/ 'global.css' - $name = $post_css::UPLOADS_DIR . $post_css::DEFAULT_FILES_DIR . $post_css->get_file_name(); - $name = apply_filters('wp_stateless_file_name', $name, 0); - do_action('sm:sync::deleteFile', $name); - } catch (\Exception $e) { - // @todo maybe log the exception. - } - // We are in filter so need to return the passed value. - return $success_response_data; - } - - /** - * @param $name - * @param $absolutePath - */ - public function filter_css_file($name, $absolutePath) { - if ($upload_data = wp_upload_dir() && file_exists($absolutePath)) { - try { - $content = file_get_contents($absolutePath); - - if (!empty($upload_data['baseurl']) && !empty($content)) { - $baseurl = preg_replace('/https?:\/\//', '', $upload_data['baseurl']); - $root_dir = trim(ud_get_stateless_media()->get('sm.root_dir'), '/ '); // Remove any forward slash and empty space. - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $root_dir = !empty($root_dir) ? $root_dir . '/' : ''; - $image_host = ud_get_stateless_media()->get_gs_host() . $root_dir; - $file_ext = ud_get_stateless_media()->replaceable_file_types(); - - preg_match_all('/(https?:\/\/' . str_replace('/', '\/', $baseurl) . ')\/(.+?)(' . $file_ext . ')/i', $content, $matches); - if (!empty($matches)) { - foreach ($matches[0] as $key => $match) { - $id = attachment_url_to_postid($match); - if (!empty($id)) { - Utility::add_media(null, $id, true); - } - } - } - - $content = preg_replace('/(https?:\/\/' . str_replace('/', '\/', $baseurl) . ')\/(.+?)(' . $file_ext . ')/i', $image_host . '/$2$3', $content); - file_put_contents($absolutePath, $content); - preg_match('/post-(\d+).css/', $name, $match); - - if (!empty($match[1])) { - $_elementor_css = get_post_meta($match[1], '_elementor_css', true); - if (!empty($_elementor_css)) { - $_elementor_css['time'] = time(); - } - } - } - } catch (\Exception $e) { - } - } - } - } - } -} diff --git a/lib/classes/compatibility/ewww.php b/lib/classes/compatibility/ewww.php deleted file mode 100644 index adcf3cf18..000000000 --- a/lib/classes/compatibility/ewww.php +++ /dev/null @@ -1,68 +0,0 @@ - false, 'download' => true, 'use_root' => true ) ); - } - - /** - * If image size not exist then upload it to GS. - * - * @param $file - * @param $type - * @param $fullsize - */ - public function post_optimization( $file, $type, $fullsize ) { - // wp_stateless_file_name filter will remove the basedir from the path and prepend with root dir. - $name = apply_filters( 'wp_stateless_file_name', $file ); - do_action( 'sm:sync::syncFile', $name, $file, true, array( 'use_root' => true ) ); - - - // if($fullsize && file_exists($file . '.bak')) - // do_action( 'sm:sync::syncFile', $name . '.bak', $file . '.bak', true); - - if( file_exists( $file . '.webp' ) ) { - add_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10, 2 ); - do_action( 'sm:sync::syncFile', $name . '.webp', $file . '.webp', true, array( 'use_root' => true ) ); - remove_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10 ); - } - } - - } - - } - -} diff --git a/lib/classes/compatibility/google-app-engine.php b/lib/classes/compatibility/google-app-engine.php index 05398efc6..7fefae956 100644 --- a/lib/classes/compatibility/google-app-engine.php +++ b/lib/classes/compatibility/google-app-engine.php @@ -1,4 +1,5 @@ 'WP_STATELESS_COMPATIBILITY_GAE']; @@ -19,7 +20,7 @@ class GoogleAppEngine extends ICompatibility { protected $server_constant = 'GAE_VERSION'; protected $sm_mode_required = 'stateless'; - public function __construct(){ + public function __construct() { $modules = get_option('stateless-modules', array()); if (empty($modules[$this->id])) { @@ -30,13 +31,8 @@ public function __construct(){ $this->init(); } - public function module_init($sm){ - + public function module_init($sm) { } - - } - } - } diff --git a/lib/classes/compatibility/gravity-forms-signature.php b/lib/classes/compatibility/gravity-forms-signature.php deleted file mode 100644 index 81234cf75..000000000 --- a/lib/classes/compatibility/gravity-forms-signature.php +++ /dev/null @@ -1,109 +0,0 @@ - $value) { - if($value['function'] == 'get_signature_url' && rgar($value, 'class') == 'GFSignature'){ - $folder = \GFSignature::get_signatures_folder(); - $name = $value['args'][0]; - $file_path = $folder . $name . '.png'; - $name = apply_filters( 'wp_stateless_file_name', $file_path); - do_action( 'sm:sync::syncFile', $name, $file_path); - $url = ud_get_stateless_media()->get_gs_host() . '/' . $name; - break; - } - } - } catch (\Throwable $th) { - //throw $th; - } - return $url; - } - - /** - * Deleting signature file from GCS. - */ - public function delete_signature($return, $form, $lead_id, $field_id){ - try { - $lead = \RGFormsModel::get_lead( $lead_id ); - $folder = \GFSignature::get_signatures_folder(); - - $name = rgar( $lead, $field_id ); - $file_path = $folder . $name; - - $name = apply_filters( 'wp_stateless_file_name', $file_path); - do_action( 'sm:sync::deleteFile', $name); - } catch (\Throwable $th) { - //throw $th; - } - return $return; - } - } - - } - -} \ No newline at end of file diff --git a/lib/classes/compatibility/gravity-forms.php b/lib/classes/compatibility/gravity-forms.php deleted file mode 100644 index 3ffde21b6..000000000 --- a/lib/classes/compatibility/gravity-forms.php +++ /dev/null @@ -1,276 +0,0 @@ -plugin_version = \GFForms::$version; - } - add_filter( 'gform_save_field_value', array($this, 'gform_save_field_value'), 10, 5 ); - add_filter( 'stateless_skip_cache_busting', array($this, 'skip_cache_busting'), 10, 2 ); - - do_action('sm:sync::register_dir', '/gravity_forms/'); - add_action( 'sm::synced::nonMediaFiles', array($this, 'modify_db'), 10, 3); - add_action( 'gform_file_path_pre_delete_file', array($this, 'gform_file_path_pre_delete_file'), 10, 2); - } - - /** - * On gform save field value sync file to GCS and alter the file url to GCS link. - * @param $value - * @param $lead - * @param $field - * @param $form - * @param $input_id - * @return array|false|mixed|string - */ - public function gform_save_field_value( $value, $lead, $field, $form, $input_id ) { - if(empty($value)) return $value; - - if ( empty($this->plugin_version) && class_exists('GFForms') ) { - $this->plugin_version = \GFForms::$version; - } - - $type = \GFFormsModel::get_input_type($field); - if($type == 'fileupload'){ - $dir = wp_upload_dir(); - - if ( $field->multipleFiles ) { - $value = json_decode( $value ); - } - else{ - $value = array($value); - } - - foreach($value as $k => $v){ - if(empty($v)) continue; - $position = strpos($v, 'gravity_forms/'); - - if( $position !== false ){ - $name = substr($v, $position); - $absolutePath = $dir['basedir'] . '/' . $name; - $name = apply_filters( 'wp_stateless_file_name', $name, 0); - // doing sync - do_action( 'sm:sync::syncFile', $name, $absolutePath); - $value[$k] = ud_get_stateless_media()->get_gs_host() . '/' . $name; - // Todo add filter. - } - } - - if ( $field->multipleFiles ) { - $value = json_encode( $value ); - } - else{ - $value = array_pop($value); - } - } - else if($type == 'post_image'){ - add_action( 'gform_after_create_post', function($post_id, $lead, $form) use ($value, $field){ - global $wpdb; - $dir = wp_upload_dir(); - $lead_detail_id = $lead['id']; - $gf_upload_root = \GFFormsModel::get_upload_root(); - $gf_upload_url_root = \GFFormsModel::get_upload_url_root(); - $lead_detail_table = \GFFormsModel::get_lead_details_table_name(); - - $position = strpos($value, 'gravity_forms/'); - $_name = substr($value, $position); // gravity_forms/ - $arr_name = explode('|:|', $_name); - $name = rgar( $arr_name, 0 ); // Removed |:| from end of the url. - - // doing sync - $absolutePath = $dir['basedir'] . '/' . $name; - $name = apply_filters( 'wp_stateless_file_name', $name, 0); - do_action( 'sm:sync::syncFile', $name, $absolutePath); - - $value = ud_get_stateless_media()->get_gs_host() . '/' . $name; - // Todo add filter. - if(version_compare($this->plugin_version, '2.3', '<')){ // older version - $result = $wpdb->update( $lead_detail_table, array( 'value' => $value ), array( 'lead_id' => $lead_detail_id, 'form_id' => $form['id'], 'field_number' => $field['id'], ), array( '%s' ), array( '%d' ) ); - } - else{ // New version - $result = $wpdb->update( \GFFormsModel::get_entry_meta_table_name(), array( 'meta_value' => $value ), array( 'entry_id' => $lead_detail_id, 'form_id' => $form['id'], 'meta_key' => $field['id'], ), array( '%s' ), array( '%d' ) ); - } - }, 10, 3); - } - return $value; - } - - /** - * Modify value in database after sync from Sync tab. - * @param $file_path - * @param $fullsizepath - * @param $media - * @throws \Exception - */ - public function modify_db( $file_path, $fullsizepath, $media ){ - global $wpdb; - $wpdb->hide_errors(); - $position = strpos($file_path, 'gravity_forms/'); - $is_index = strpos($file_path, 'index.html'); - $is_htaccess = strpos($file_path, '.htaccess'); - $root_dir = ud_get_stateless_media()->get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - - if ( empty($this->plugin_version) && class_exists('GFForms') ) { - $this->plugin_version = \GFForms::$version; - } - - $gf_val_column = 'meta_value'; - $gf_table = \GFFormsModel::get_entry_meta_table_name(); - if(version_compare($this->plugin_version, '2.3', '<')){ - $gf_val_column = 'value'; - } - - if( $position !== false && !$is_index ){ - $dir = wp_upload_dir(); - $file_path = trim($file_path, '/'); - //EDIT: Use base file name since the URL in the DB could be encoded with in an array - $file_single = basename($file_path); - - // Todo add filter. - - // We need to get results from db because of post image field have extra data at the end of url. - // Also url could be array and json encoded. - // Unless we would loss those data. - // xyz.jpg|:|tile|:|description|:| - $query = sprintf( - " - SELECT id, {$gf_val_column} AS value FROM {$gf_table} - WHERE {$gf_val_column} like '%s'; - " - , '%' . $file_single . '%' - ); - $results = $wpdb->get_results( $query ); - $this->throw_db_error(); - - foreach ($results as $result) { - $position = false; - //EDIT: Check if value is json encoded, if so, cycle through array and replace URLs. - $value = json_decode($result->value); - - if (json_last_error() === 0) { - foreach( $value as $k => $v ){ - $position = strpos($v, $dir['baseurl']); - if($position !== false){ - $value[$k] = str_replace($dir['baseurl'], ud_get_stateless_media()->get_gs_host() . '/' . $root_dir, $v ); - } - } - - $result->value = json_encode($value); - } - else{ - $position = strpos($result->value, $dir['baseurl']); - $result->value = str_replace($dir['baseurl'], ud_get_stateless_media()->get_gs_host() . '/' . $root_dir, $result->value); - } - - if($position !== false){ - $query = sprintf( - " - UPDATE {$gf_table} - SET {$gf_val_column} = '%s' - WHERE id = %d - " - , $result->value, $result->id - ); - $entries = $wpdb->get_results( $query ); - $this->throw_db_error(); - } - - } - } - } - - /** - * Throw db error from last db query. - * We need to throw db error instead of just printing, - * so that we can catch them in ajax request. - */ - function throw_db_error(){ - - global $wpdb; - $wpdb->show_errors(); - - if($wpdb->last_error !== '' && wp_doing_ajax()) : - ob_start(); - $wpdb->print_error(); - $error = ob_get_clean(); - if($error){ - throw new \Exception( $error ); - } - endif; - - } - - /** - * Delete file from GCS - * @param $file_path - * @param $url - * @return string - */ - public function gform_file_path_pre_delete_file( $file_path, $url ){ - $file_path = wp_normalize_path($file_path); - $gs_host = wp_normalize_path( ud_get_stateless_media()->get_gs_host() ); - $dir = wp_upload_dir(); - $is_stateless = strpos($file_path, $gs_host); - - // If the url is a GCS link then remove it from GCS. - if($is_stateless !== false){ - $gs_name = substr($file_path, strpos($file_path, '/gravity_forms/')); - $file_path = $dir['basedir'] . $gs_name; - $gs_name = apply_filters( 'wp_stateless_file_name', $gs_name, 0); - - $client = ud_get_stateless_media()->get_client(); - if( !is_wp_error( $client ) ) { - $client->remove_media( trim($gs_name, '/') ); - } - } - - return $file_path; - } - - /** - * @param $return - * @param $filename - * @return mixed - */ - public function skip_cache_busting($return, $filename){ - $backtrace = debug_backtrace(false, 8); - if( - !empty($backtrace[7]['class']) && - $backtrace[7]['class'] == 'GFExport' && - ( - $backtrace[7]['function'] == 'write_file' || - $backtrace[7]['function'] == 'ajax_download_export' - ) - ){ - return $filename; - } - return $return; - } - } - - } - -} diff --git a/lib/classes/compatibility/imagify.php b/lib/classes/compatibility/imagify.php index a21b48cac..f3eb56f26 100644 --- a/lib/classes/compatibility/imagify.php +++ b/lib/classes/compatibility/imagify.php @@ -1,4 +1,5 @@ is_extension_supported() ) { + $imagify = new \Imagify_Attachment($attachment_id); + if (is_callable(array($imagify, 'is_extension_supported'))) { + if (!$imagify->is_extension_supported()) { return false; } - } elseif( function_exists( 'imagify_is_attachment_mime_type_supported' ) ) { + } elseif (function_exists('imagify_is_attachment_mime_type_supported')) { // Use `imagify_is_attachment_mime_type_supported( $attachment_id )`. - if( !imagify_is_attachment_mime_type_supported( $attachment_id ) ) { + if (!imagify_is_attachment_mime_type_supported($attachment_id)) { return false; } - } elseif( !wp_attachment_is_image( $attachment_id ) ) { + } elseif (!wp_attachment_is_image($attachment_id)) { return false; } @@ -91,23 +92,23 @@ public function skip_add_media( $return, $metadata, $attachment_id, $force = fal * @return bool * @author palant@ud */ - public function skip_remove_media( $return, $metadata, $attachment_id, $force = false, $args = array() ) { + public function skip_remove_media($return, $metadata, $attachment_id, $force = false, $args = array()) { global $doing_manual_sync; - if( $force || $doing_manual_sync || !get_imagify_option( 'auto_optimize' ) ) return false; + if ($force || $doing_manual_sync || !get_imagify_option('auto_optimize')) return false; - $imagify = new \Imagify\Optimization\File( get_attached_file( $attachment_id ) ); + $imagify = new \Imagify\Optimization\File(get_attached_file($attachment_id)); - if( is_callable( array( $imagify, 'is_supported' ) ) ) { - if( !$imagify->is_supported( imagify_get_mime_types() ) ) { + if (is_callable(array($imagify, 'is_supported'))) { + if (!$imagify->is_supported(imagify_get_mime_types())) { return false; } - } elseif( function_exists( 'imagify_is_attachment_mime_type_supported' ) ) { + } elseif (function_exists('imagify_is_attachment_mime_type_supported')) { // Use `imagify_is_attachment_mime_type_supported( $attachment_id )`. - if( !imagify_is_attachment_mime_type_supported( $attachment_id ) ) { + if (!imagify_is_attachment_mime_type_supported($attachment_id)) { return false; } - } elseif( !wp_attachment_is_image( $attachment_id ) ) { + } elseif (!wp_attachment_is_image($attachment_id)) { return false; } @@ -120,38 +121,37 @@ public function skip_remove_media( $return, $metadata, $attachment_id, $force = * @param $attachment_id * @return mixed */ - public function fix_missing_file( $attachment_id ) { + public function fix_missing_file($attachment_id) { /** * If mode is ephemeral then we change it to cdn in order images not being deleted before optimization * Remember that we changed mode via global var */ - if( ud_get_stateless_media()->get( 'sm.mode' ) == 'ephemeral' ) { - ud_get_stateless_media()->set( 'sm.mode', 'cdn' ); + if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { + ud_get_stateless_media()->set('sm.mode', 'cdn'); global $wp_stateless_imagify_mode; $wp_stateless_imagify_mode = 'ephemeral'; } $upload_basedir = wp_upload_dir(); - $upload_basedir = trailingslashit( $upload_basedir[ 'basedir' ] ); - $meta_data = wp_get_attachment_metadata( $attachment_id ); - $file = $upload_basedir . $meta_data[ 'file' ]; + $upload_basedir = trailingslashit($upload_basedir['basedir']); + $meta_data = wp_get_attachment_metadata($attachment_id); + $file = $upload_basedir . $meta_data['file']; /** * Try to get all missing files from GCS */ - if( !file_exists( $file ) ) { - ud_get_stateless_media()->get_client()->get_media( apply_filters( 'wp_stateless_file_name', $meta_data[ 'file' ] ), true, $file ); + if (!file_exists($file)) { + ud_get_stateless_media()->get_client()->get_media(apply_filters('wp_stateless_file_name', $meta_data['file']), true, $file); } - if( !empty( $meta_data[ 'sizes' ] ) && is_array( $meta_data[ 'sizes' ] ) ) { - $upload_basedir = trailingslashit( dirname( $file ) ); - foreach( $meta_data[ 'sizes' ] as $image ) { - if( !empty( $image[ 'gs_name' ] ) && !file_exists( $file = $upload_basedir . $image[ 'file' ] ) ) { - ud_get_stateless_media()->get_client()->get_media( apply_filters( 'wp_stateless_file_name', $image[ 'gs_name' ] ), true, $file ); + if (!empty($meta_data['sizes']) && is_array($meta_data['sizes'])) { + $upload_basedir = trailingslashit(dirname($file)); + foreach ($meta_data['sizes'] as $image) { + if (!empty($image['gs_name']) && !file_exists($file = $upload_basedir . $image['file'])) { + ud_get_stateless_media()->get_client()->get_media(apply_filters('wp_stateless_file_name', $image['gs_name']), true, $file); } } } - } /** @@ -163,38 +163,38 @@ public function fix_missing_file( $attachment_id ) { * ) * @param $id */ - public function after_imagify_optimize_attachment( $id ) { + public function after_imagify_optimize_attachment($id) { /** * Restore ephemeral mode if needed */ global $wp_stateless_imagify_mode; - if( $wp_stateless_imagify_mode == 'ephemeral' ) { - ud_get_stateless_media()->set( 'sm.mode', 'ephemeral' ); + if ($wp_stateless_imagify_mode == 'ephemeral') { + ud_get_stateless_media()->set('sm.mode', 'ephemeral'); } - $metadata = wp_get_attachment_metadata( $id ); - ud_get_stateless_media()->add_media( $metadata, $id, true ); + $metadata = wp_get_attachment_metadata($id); + ud_get_stateless_media()->add_media($metadata, $id, true); // Sync backup file with GCS - if( current_filter() == 'after_imagify_optimize_attachment' ) { + if (current_filter() == 'after_imagify_optimize_attachment') { /** * If mode is ephemeral then we change it to cdn in order images not being deleted before optimization * Remember that we changed mode via global var * @todo remove if Imagify implement "imagify_has_backup" filter. */ - if( ud_get_stateless_media()->get( 'sm.mode' ) == 'ephemeral' ) { - ud_get_stateless_media()->set( 'sm.mode', 'cdn' ); + if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { + ud_get_stateless_media()->set('sm.mode', 'cdn'); global $wp_stateless_imagify_mode; $wp_stateless_imagify_mode = 'ephemeral'; } - $file_path = get_attached_file( $id ); - $backup_path = get_imagify_attachment_backup_path( $file_path ); - if( file_exists( $backup_path ) ) { - $overwrite = apply_filters( 'imagify_backup_overwrite_backup', false, $file_path, $backup_path ); + $file_path = get_attached_file($id); + $backup_path = get_imagify_attachment_backup_path($file_path); + if (file_exists($backup_path)) { + $overwrite = apply_filters('imagify_backup_overwrite_backup', false, $file_path, $backup_path); // wp_stateless_file_name filter will remove the basedir from the path and prepend with root dir. - $name = apply_filters( 'wp_stateless_file_name', $backup_path ); - do_action( 'sm:sync::syncFile', $name, $backup_path, $overwrite ); + $name = apply_filters('wp_stateless_file_name', $backup_path); + do_action('sm:sync::syncFile', $name, $backup_path, $overwrite); } } } @@ -203,14 +203,14 @@ public function after_imagify_optimize_attachment( $id ) { * Restore backup file from GCS if not exist. * @param $id */ - public function get_image_from_gcs( $id ) { - $file_path = get_attached_file( $id ); - $backup_path = get_imagify_attachment_backup_path( $file_path ); - if( !file_exists( $backup_path ) ) { + public function get_image_from_gcs($id) { + $file_path = get_attached_file($id); + $backup_path = get_imagify_attachment_backup_path($file_path); + if (!file_exists($backup_path)) { $upload_dir = wp_upload_dir(); - $name = str_replace( trailingslashit( $upload_dir[ 'basedir' ] ), '', $backup_path ); - $name = apply_filters( 'wp_stateless_file_name', $name ); - do_action( 'sm:sync::syncFile', $name, $backup_path, true ); + $name = str_replace(trailingslashit($upload_dir['basedir']), '', $backup_path); + $name = apply_filters('wp_stateless_file_name', $name); + do_action('sm:sync::syncFile', $name, $backup_path, true); } } @@ -220,10 +220,10 @@ public function get_image_from_gcs( $id ) { * @param $has_backup * @return bool */ - public function imagify_has_backup( $return, $has_backup ) { - if( !$return && $has_backup ) { - $name = apply_filters( 'wp_stateless_file_name', $has_backup ); - $return = (bool) apply_filters( 'sm:sync::queue_is_exists', $name ); + public function imagify_has_backup($return, $has_backup) { + if (!$return && $has_backup) { + $name = apply_filters('wp_stateless_file_name', $has_backup); + $return = (bool) apply_filters('sm:sync::queue_is_exists', $name); } return $return; } @@ -233,22 +233,22 @@ public function imagify_has_backup( $return, $has_backup ) { * @param $file * @param array $args */ - public function imagify_after_optimize_file( $file, $args = array() ) { + public function imagify_after_optimize_file($file, $args = array()) { global $wp_stateless_imagify_mode; - if( $wp_stateless_imagify_mode == 'ephemeral' ) { - ud_get_stateless_media()->set( 'sm.mode', 'ephemeral' ); + if ($wp_stateless_imagify_mode == 'ephemeral') { + ud_get_stateless_media()->set('sm.mode', 'ephemeral'); } - $name = apply_filters( 'wp_stateless_file_name', basename( $file ) ); + $name = apply_filters('wp_stateless_file_name', basename($file)); - if( file_exists( $file ) ) { - add_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10, 2 ); + if (file_exists($file)) { + add_filter('upload_mimes', array($this, 'add_webp_mime'), 10, 2); /** * Media already on GCS, so only replacing data on it. For webp format adding path and status to wp_sm_sync table */ - do_action( 'sm:sync::syncFile', $name, $file, true, array( 'use_root' => true, 'skip_db' => ( substr( $name, -4 ) == "webp" ? false : true ) ) ); - remove_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10 ); + do_action('sm:sync::syncFile', $name, $file, true, array('use_root' => true, 'skip_db' => (substr($name, -4) == "webp" ? false : true))); + remove_filter('upload_mimes', array($this, 'add_webp_mime'), 10); } } @@ -262,16 +262,16 @@ public function imagify_after_optimize_file( $file, $args = array() ) { * @param $is_disabled * @return mixed */ - public function imagify_before_optimize_size( $return, $process, $file, $thumb_size, $optimization_level, $webp, $is_disabled ) { + public function imagify_before_optimize_size($return, $process, $file, $thumb_size, $optimization_level, $webp, $is_disabled) { try { - $attachment_id = $this->getProperties( $this->getProperties( $this->getProperties( $process )[ 'data' ] )[ 'media' ] )[ 'id' ]; + $attachment_id = $this->getProperties($this->getProperties($this->getProperties($process)['data'])['media'])['id']; $full_size_path = $file->get_path(); - $name = apply_filters( 'wp_stateless_file_name', basename( $full_size_path ), true, $attachment_id ); - do_action( 'sm:sync::syncFile', $name, $full_size_path, true, [ 'download' => true ] ); + $name = apply_filters('wp_stateless_file_name', basename($full_size_path), true, $attachment_id); + do_action('sm:sync::syncFile', $name, $full_size_path, true, ['download' => true]); // error_log("\n\ndo_action( 'sm:sync::syncFile', $name, $full_size_path, true, ['download' => true] );"); - } catch( \Throwable $th ) { + } catch (\Throwable $th) { //throw $th; } return $return; @@ -282,27 +282,23 @@ public function imagify_before_optimize_size( $return, $process, $file, $thumb_s * @param $process * @return array */ - public function getProperties( $process ) { + public function getProperties($process) { $properties = array(); try { - $rc = new \ReflectionClass( $process ); + $rc = new \ReflectionClass($process); do { $rp = array(); /* @var $p \ReflectionProperty */ - foreach( $rc->getProperties() as $p ) { - $p->setAccessible( true ); - $rp[ $p->getName() ] = $p->getValue( $process ); + foreach ($rc->getProperties() as $p) { + $p->setAccessible(true); + $rp[$p->getName()] = $p->getValue($process); } - $properties = array_merge( $rp, $properties ); - } while( $rc = $rc->getParentClass() ); - } catch( \ReflectionException $e ) { - + $properties = array_merge($rp, $properties); + } while ($rc = $rc->getParentClass()); + } catch (\ReflectionException $e) { } return $properties; } - } - } - } diff --git a/lib/classes/compatibility/learn-dash.php b/lib/classes/compatibility/learn-dash.php deleted file mode 100644 index c7c1713b9..000000000 --- a/lib/classes/compatibility/learn-dash.php +++ /dev/null @@ -1,69 +0,0 @@ -hook_from_learndash() ) { - return $filename; - } - return $return; - } - - /** - * Determine where we hook from - * We need to do this only for something specific in LearnDash plugin - * - * @return bool - */ - private function hook_from_learndash() { - $call_stack = debug_backtrace(); - if( - !empty($call_stack[6]['function']) && - $call_stack[6]['function'] == 'sanitize_file_name' && - ( - strpos( $call_stack[6]['file'], 'class-ld-semper-fi-module.php' ) || - strpos( $call_stack[6]['file'], 'class-ld-cpt-instance.php' ) - ) - ) { - return true; - } - - return false; - } - - } - - } - -} diff --git a/lib/classes/compatibility/lite-speed-cache.php b/lib/classes/compatibility/lite-speed-cache.php deleted file mode 100644 index 96d21536b..000000000 --- a/lib/classes/compatibility/lite-speed-cache.php +++ /dev/null @@ -1,380 +0,0 @@ - 28 - * [post_id] => 494 - * [optm_status] => notified - * [src] => 2019/10/22645b39-asdf.jpg - * [srcpath_md5] => ad206986974729e1c8edc9321ed9ba9b - * [src_md5] => 9d396b4f7a261a5fac1234b292a7d585 - * [root_id] => 0 - * [src_filesize] => 1 - * [target_filesize] => 0 - * [target_saved] => 827956 - * [webp_filesize] => 0 - * [webp_saved] => 830743 - * [server_info] => { - * "server":"https:\/\/us1.wp.api.litespeedtech.com", - * "id":"SEU98", - * "ori_md5":"3a7bb6b684d34552d75291ed4c32d399", - * "ori":"https:\/\/us1.wp.api.litespeedtech.com\/dl\/20191011\/c91821\/47721644.jpg", - * "webp_md5":"61d80e1d2799af383c820492a1208846", - * "webp":"https:\/\/us1.wp.api.litespeedtech.com\/dl\/20191011\/c91821\/47721644.jpg.webp" - * } - * ) - * - * @param String $local_file - * /var/www/wp-content/uploads/2019/10/22645b39-asdf.jpg - * - */ - public function sync_image( $row_img, $local_file ) { - $rm_ori_bkup = apply_filters('litespeed_conf', 'img_optm-rm_bkup' ); - $gs_name = apply_filters( 'wp_stateless_file_name', $row_img->src ); - $cloud_meta = get_post_meta( $row_img->post_id, 'sm_cloud', true ); - - if(empty($cloud_meta)) $cloud_meta = array(); - - if( !$rm_ori_bkup ) { - $extension = pathinfo( $gs_name, PATHINFO_EXTENSION ); - $bk_file = substr( $gs_name, 0, -strlen( $extension ) ) . 'bk.' . $extension; - $cloud_meta[ 'fileMd5' ][ $bk_file ] = $cloud_meta[ 'fileMd5' ][ $gs_name ]; - do_action( 'sm:sync::copyFile', $gs_name, $bk_file ); - } - - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $local_file ); - update_post_meta( $row_img->post_id, 'sm_cloud', $cloud_meta ); - do_action( 'sm:sync::syncFile', $gs_name, $local_file, 2 ); - } - - /** - * Upload webp image after LS pulled the images. - * @todo put md5_file hash creating here. $row_img might have attachment_id - * @param $row_img - * @param $local_file - */ - public function sync_webp( $row_img, $local_file ) { - $optm_webp = apply_filters('litespeed_conf', 'img_optm-webp' ); - if( $optm_webp ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $row_img->src . '.webp' ); - - $cloud_meta = get_post_meta( $row_img->post_id, 'sm_cloud', true ); - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $local_file ); - update_post_meta( $row_img->post_id, 'sm_cloud', $cloud_meta ); - - add_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10, 2 ); - do_action( 'sm:sync::syncFile', $gs_name, $local_file, 2, array( 'use_root' => true ) ); - } - } - - /** - * Bypassing the is_internal_file check on LiteSpeed Cache. - * That check fails because we are replacing URL with GCS URL. - * So we need to override it with filter. - * - * @todo maybe we can add some validation. - * - * @param $return - * @param $url - * @return bool - */ - public function litespeed_media_check_img( $return, $url ) { - $image_host = ud_get_stateless_media()->get_gs_host(); - if( strpos( $url, $image_host ) === 0 ) { - return true; - } - return $return; - } - - /** - * Return information about a file from relative path. - * - * @param $info - * @param $short_file_path - * @param $post_id - * @return array( 'url', 'md5', 'size' ) - */ - public function litespeed_media_info( $info, $short_file_path, $post_id ) { - if( !$post_id ) return $info; - - try { - $metadata = wp_get_attachment_metadata( $post_id ); - $cloud_meta = get_post_meta( $post_id, 'sm_cloud', true ); - - if( !empty( $metadata[ 'gs_link' ] ) ) { - $short_file_path = apply_filters( 'wp_stateless_file_name', $short_file_path ); - $url = ud_get_stateless_media()->get_gs_host() . '/' . $short_file_path; - $md5 = !empty( $cloud_meta[ 'fileMd5' ][ $short_file_path ] ) ? $cloud_meta[ 'fileMd5' ][ $short_file_path ] : null; - - if( $metadata[ 'file' ] == $short_file_path ) { - $url = $metadata[ 'gs_link' ]; - } else { - foreach( $metadata[ 'sizes' ] as $size => $meta ) { - if( $meta[ 'file' ] == basename( $short_file_path ) ) { - $url = $meta[ 'gs_link' ]; - break; - } - } - } - - if( $md5 ) { - $info = array( 'url' => $url, 'md5' => $md5, 'size' => 1, ); - } - } - } catch( \Throwable $th ) { - error_log( print_r( $th, true ) ); - } - - return $info; - } - - - /** - * Deletes a file in GCS and remove the hash from cloud meta. - - * @param $short_file_path - * @param $post_id - */ - public function litespeed_media_del( $short_file_path, $post_id ) { - $short_file_path = apply_filters( 'wp_stateless_file_name', $short_file_path ); - do_action( 'sm:sync::deleteFile', $short_file_path ); - } - - /** - * Hooks into the rename function of the LS cache. - * And move the file in GCS. - * Also update the md5_file hash on cloud meta. - * - * @param $short_file_path - * @param $short_file_path_new - * @param $post_id - */ - public function litespeed_media_rename( $short_file_path, $short_file_path_new, $post_id ) { - $short_file_path = apply_filters( 'wp_stateless_file_name', $short_file_path ); - $short_file_path_new = apply_filters( 'wp_stateless_file_name', $short_file_path_new ); - - // copy file to the new location and delete the old one. - do_action( 'sm:sync::moveFile', $short_file_path, $short_file_path_new ); - - $this->update_hash( $post_id, $short_file_path_new, $short_file_path ); - } - - /** - * add_webp_mime - * @param $t - * @param $user - * @return mixed - */ - public function add_webp_mime( $t, $user ) { - $t[ 'webp' ] = 'image/webp'; - return $t; - } - - /** - * Move file hash from one key to another. - * - * @param $attachment_id - * @param $gs_name_new key to store md5_file. - * @param $gs_name_old whether to get md5 from another entry. - * @param bool $delete whether only remove the key. - * @return bool - */ - public function update_hash( $attachment_id, $gs_name_new, $gs_name_old, $delete = false ) { - try { - $cloud_meta = get_post_meta( $attachment_id, 'sm_cloud', true ); - - if( !$delete ) { - if( $gs_name_old && !empty( $cloud_meta[ 'fileMd5' ][ $gs_name_old ] ) ) { - $cloud_meta[ 'fileMd5' ][ $gs_name_new ] = $cloud_meta[ 'fileMd5' ][ $gs_name_old ]; - } else { - $url = ud_get_stateless_media()->get_gs_host() . '/' . $gs_name_new; - $cloud_meta[ 'fileMd5' ][ $gs_name_new ] = md5_file( $url ); - } - } - - if( isset( $cloud_meta[ 'fileMd5' ][ $gs_name_old ] ) ) unset( $cloud_meta[ 'fileMd5' ][ $gs_name_old ] ); - update_post_meta( $attachment_id, 'sm_cloud', $cloud_meta ); - return true; - } catch( \Throwable $th ) { - error_log( print_r( $th, true ) ); - return false; - } - return false; - } - - /** - * Adds file hash to cloud meta, so that we can use it later. - * - * @param $cloud_meta - * @param $media - * @param $image_size - * @param $img - * @param $bucketLink - * @return array $cloud_meta with fileMd5 - */ - public function cloud_meta_add_file_md5( $cloud_meta, $media, $image_size, $img, $bucketLink ) { - if( $file_hash = md5_file( $img[ 'path' ] ) ) { - $gs_name = !empty( $media[ 'name' ] ) ? $media[ 'name' ] : $img[ 'gs_name' ]; - $extension = pathinfo( $gs_name, PATHINFO_EXTENSION ); - $bk_file = substr( $gs_name, 0, -strlen( $extension ) ) . 'bk.' . $extension; - - // Storing file hash - $cloud_meta[ 'fileMd5' ][ $gs_name ] = $file_hash; - } - - return $cloud_meta; - } - - /** - * On manual sync/regenerate we need to sync backup/webp files. - * - * @param $attachment_id - * @param $metadata - */ - public function manual_sync_backup_file( $attachment_id, $metadata ) { - $cloud_meta = get_post_meta( $attachment_id, 'sm_cloud', true ); - - if( !empty( $cloud_meta[ 'fileMd5' ] ) ) { - $upload_dir = wp_upload_dir(); - $fileMd5 = $cloud_meta[ 'fileMd5' ]; - $root_dir = ud_get_stateless_media()->get( 'sm.root_dir' ); - $root_dir = apply_filters("wp_stateless_handle_root_dir", $root_dir); - $root_dir = trim( $root_dir, '/ ' ); // Remove any forward slash and empty space. - - foreach( $fileMd5 as $gs_name => $value ) { - $_gs_name = str_replace( $root_dir, '', $gs_name ); - $local_file = $upload_dir[ 'basedir' ] . '/' . trim( $_gs_name, '/' ); - - do_action( 'sm:sync::syncFile', $gs_name, $local_file, true ); - } - } - } - - /** - * On manual sync/regenerate wp regenerate all image sizes. - * So to keep the file md5 accurate we need to update it after image is regenerated. - * - * Manual sync if it's the first time syncing and image optimized before enabling Stateless - * - * @param $attachment_id - */ - public function update_md5_and_manual_sync( $attachment_id ) { - $cloud_meta = get_post_meta( $attachment_id, 'sm_cloud', true ); - $metadata = wp_get_attachment_metadata( $attachment_id ); - $image_sizes = Utility::get_path_and_url( $metadata, $attachment_id ); - - if( !empty( $cloud_meta[ 'fileMd5' ] ) ) { - foreach( $image_sizes as $img ) { - $cloud_meta[ 'fileMd5' ][ $img[ 'gs_name' ] ] = md5_file( $img[ 'path' ] ); - } - } - - if( empty( $cloud_meta[ 'fileMd5' ] ) || count( $cloud_meta[ 'fileMd5' ] ) <= 1 ) { - if( empty( $cloud_meta ) ) { - $cloud_meta = array(); - } - - // In case image optimized before enabling Stateless. - // We only need to copy from local to GCS, otherwise file_md5 meta should be available. - foreach( $image_sizes as $img ) { - $file_path = $img[ 'path' ]; - $rm_ori_bkup = apply_filters('litespeed_conf', 'img_optm-rm_bkup' ); - $optm_webp = apply_filters('litespeed_conf', 'img_optm-webp' ); - - if( !$rm_ori_bkup ) { - $extension = pathinfo( $file_path, PATHINFO_EXTENSION ); - $bk_file = substr( $file_path, 0, -strlen( $extension ) ) . 'bk.' . $extension; - $bk_file_optm = substr( $file_path, 0, -strlen( $extension ) ) . 'bk.optm.' . $extension; - if( file_exists( $bk_file ) ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $bk_file ); - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $bk_file ); - do_action( 'sm:sync::syncFile', $gs_name, $bk_file ); - } elseif( file_exists( $bk_file_optm ) ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $bk_file_optm ); - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $bk_file_optm ); - do_action( 'sm:sync::syncFile', $gs_name, $bk_file_optm ); - } - } - - if( $optm_webp ) { - $gs_name_webp = $file_path . '.webp'; - $gs_name_webp_optm = $file_path . '.optm.webp'; - if( file_exists( $gs_name_webp ) ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $gs_name_webp ); - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $gs_name_webp ); - do_action( 'sm:sync::syncFile', $gs_name, $gs_name_webp ); - } elseif( file_exists( $gs_name_webp_optm ) ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $gs_name_webp_optm ); - $cloud_meta[ 'fileMd5' ][ $gs_name ] = md5_file( $gs_name_webp_optm ); - do_action( 'sm:sync::syncFile', $gs_name, $gs_name_webp_optm ); - } - } - - } - - } - - update_post_meta( $attachment_id, 'sm_cloud', $cloud_meta ); - } - - } - - } - -} diff --git a/lib/classes/compatibility/polylang-pro.php b/lib/classes/compatibility/polylang-pro.php deleted file mode 100644 index f8415c908..000000000 --- a/lib/classes/compatibility/polylang-pro.php +++ /dev/null @@ -1,57 +0,0 @@ -path( 'lib/classes/compatibility/js/shortpixel.js', 'url' ), array( 'shortpixel' ), '', true ); + wp_enqueue_script('stateless-short-pixel', ud_get_stateless_media()->path('lib/classes/compatibility/js/shortpixel.js', 'url'), array('shortpixel'), '', true); $image_host = ud_get_stateless_media()->get_gs_host(); - $bucketLink = apply_filters( 'wp_stateless_bucket_link', $image_host ); - - wp_localize_script( 'stateless-short-pixel', '_stateless_short_pixel', array( 'baseurl' => $upload_dir[ 'baseurl' ], 'bucketLink' => $bucketLink, ) ); + $bucketLink = apply_filters('wp_stateless_bucket_link', $image_host); + wp_localize_script('stateless-short-pixel', '_stateless_short_pixel', array('baseurl' => $upload_dir['baseurl'], 'bucketLink' => $bucketLink,)); } /** @@ -78,11 +78,10 @@ public function shortPixelJS() { * @param $thumbs * @return string */ - public function getBackupFolderAny( $ret, $file, $thumbs ) { - if( $ret == false ) { - $fullSubDir = $this->returnSubDir( $file ); + public function getBackupFolderAny($ret, $file, $thumbs) { + if ($ret == false) { + $fullSubDir = $this->returnSubDir($file); $ret = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - } return $ret; } @@ -96,45 +95,45 @@ public function getBackupFolderAny( $ret, $file, $thumbs ) { * @param null $id * @return bool */ - public function shortpixel_image_exists( $return, $path, $id = null ) { - if( $return ) return $return; + public function shortpixel_image_exists($return, $path, $id = null) { + if ($return) return $return; - $key = "stateless_url_to_postid_" . md5( $path ); - $return = get_transient( $key ); + $key = "stateless_url_to_postid_" . md5($path); + $return = get_transient($key); // echo "\npath: $path \nKey: $key\nReturn: $return\nID: $id\n "; - if( !$return ) { + if (!$return) { // Checking by matching file name in gs_name and $path. - if( !empty( $id ) ) { - $metadata = wp_get_attachment_metadata( $id ); - $basename = basename( $path ); - if( !empty( $metadata[ 'gs_name' ] ) ) { - $gs_basename = basename( $metadata[ 'gs_name' ] ); - if( $gs_basename == $basename ) { + if (!empty($id)) { + $metadata = wp_get_attachment_metadata($id); + $basename = basename($path); + if (!empty($metadata['gs_name'])) { + $gs_basename = basename($metadata['gs_name']); + if ($gs_basename == $basename) { $return = true; } - if( is_array( $metadata[ 'sizes' ] ) ) { - foreach( $metadata[ 'sizes' ] as $key => &$data ) { - if( empty( $data[ 'gs_name' ] ) ) continue; - $gs_basename = basename( $data[ 'gs_name' ] ); - if( $gs_basename == $basename ) { + if (is_array($metadata['sizes'])) { + foreach ($metadata['sizes'] as $key => &$data) { + if (empty($data['gs_name'])) continue; + $gs_basename = basename($data['gs_name']); + if ($gs_basename == $basename) { $return = true; } } } } } // Directly check on GCS if image exist. - else if( empty( $id ) ) { + else if (empty($id)) { $wp_uploads_dir = wp_get_upload_dir(); - $gs_name = str_replace( trailingslashit( $wp_uploads_dir[ 'basedir' ] ), '', $path ); - $gs_name = str_replace( trailingslashit( $wp_uploads_dir[ 'baseurl' ] ), '', $gs_name ); - $gs_name = str_replace( trailingslashit( ud_get_stateless_media()->get_gs_host() ), '', $gs_name ); - $gs_name = apply_filters( 'wp_stateless_file_name', $gs_name ); - if( $media = ud_get_stateless_media()->get_client()->media_exists( $gs_name ) ) { + $gs_name = str_replace(trailingslashit($wp_uploads_dir['basedir']), '', $path); + $gs_name = str_replace(trailingslashit($wp_uploads_dir['baseurl']), '', $gs_name); + $gs_name = str_replace(trailingslashit(ud_get_stateless_media()->get_gs_host()), '', $gs_name); + $gs_name = apply_filters('wp_stateless_file_name', $gs_name); + if ($media = ud_get_stateless_media()->get_client()->media_exists($gs_name)) { $return = true; } } - set_transient( $key, $return, 10 * MINUTE_IN_SECONDS ); + set_transient($key, $return, 10 * MINUTE_IN_SECONDS); } return $return; } @@ -148,28 +147,28 @@ public function shortpixel_image_exists( $return, $path, $id = null ) { * @param $paths * @return bool */ - public function shortpixel_skip_delete_backups_and_webps( $return, $paths ) { - if( empty( $paths ) || !is_array( $paths ) ) return $return; + public function shortpixel_skip_delete_backups_and_webps($return, $paths) { + if (empty($paths) || !is_array($paths)) return $return; $sp__uploads = wp_upload_dir(); - $fullSubDir = $this->returnSubDir( $paths[ 0 ] ); + $fullSubDir = $this->returnSubDir($paths[0]); $backup_path = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - foreach( $paths as $key => $path ) { + foreach ($paths as $key => $path) { // Removing backup - $name = apply_filters( 'wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename( $path ) ); - do_action( 'sm:sync::deleteFile', $name ); + $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename($path)); + do_action('sm:sync::deleteFile', $name); // Removing WebP - $backup_images = \WPShortPixelSettings::getOpt( 'wp-short-create-webp' ); - if( $backup_images ) { - $name = str_replace( $sp__uploads[ 'basedir' ], '', $path ); - $name = apply_filters( 'wp_stateless_file_name', $name . '.webp' ); - do_action( 'sm:sync::deleteFile', $name ); + $backup_images = \WPShortPixelSettings::getOpt('wp-short-create-webp'); + if ($backup_images) { + $name = str_replace($sp__uploads['basedir'], '', $path); + $name = apply_filters('wp_stateless_file_name', $name . '.webp'); + do_action('sm:sync::deleteFile', $name); } } - if( ud_get_stateless_media()->get( 'sm.mode' ) == 'ephemeral' ) { + if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { return true; } // When ephemeral mode isn't set backup files will be available in server. So no short-circuit. @@ -184,8 +183,8 @@ public function shortpixel_skip_delete_backups_and_webps( $return, $paths ) { * @param $PATHs * @return bool */ - public function shortpixel_skip_backup( $return, $mainPath, $PATHs ) { - if( ud_get_stateless_media()->get( 'sm.mode' ) == 'ephemeral' ) { + public function shortpixel_skip_backup($return, $mainPath, $PATHs) { + if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { return true; } return $return; @@ -199,11 +198,11 @@ public function shortpixel_skip_backup( $return, $mainPath, $PATHs ) { * @param $attachment_id * @return mixed */ - public function wp_update_attachment_metadata( $metadata, $attachment_id ) { - if( ud_get_stateless_media()->get( 'sm.mode' ) == 'ephemeral' ) { - $backup_images = \WPShortPixelSettings::getOpt( 'wp-short-backup_images' ); - if( $backup_images ) { - $this->sync_backup_file( $attachment_id, $metadata, false, array( 'before_optimization' => true ) ); + public function wp_update_attachment_metadata($metadata, $attachment_id) { + if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { + $backup_images = \WPShortPixelSettings::getOpt('wp-short-backup_images'); + if ($backup_images) { + $this->sync_backup_file($attachment_id, $metadata, false, array('before_optimization' => true)); } } return $metadata; @@ -214,17 +213,17 @@ public function wp_update_attachment_metadata( $metadata, $attachment_id ) { * * @param $id */ - public function shortpixel_image_optimised( $id ) { - $metadata = wp_get_attachment_metadata( $id ); - ud_get_stateless_media()->add_media( $metadata, $id, true ); + public function shortpixel_image_optimised($id) { + $metadata = wp_get_attachment_metadata($id); + ud_get_stateless_media()->add_media($metadata, $id, true); // Sync the webp to GCS - $create_webp = \WPShortPixelSettings::getOpt( 'wp-short-create-webp' ); - if( $create_webp ) { + $create_webp = \WPShortPixelSettings::getOpt('wp-short-create-webp'); + if ($create_webp) { $this->sync_webp_file($id, $metadata); } // Don't needed in ephemeral mode. In ephemeral mode the back will be sync once on wp_update_attachment_metadata filter. - if( ud_get_stateless_media()->get( 'sm.mode' ) !== 'ephemeral' ) { - $this->sync_backup_file( $id, $metadata, true ); + if (ud_get_stateless_media()->get('sm.mode') !== 'ephemeral') { + $this->sync_backup_file($id, $metadata, true); } } @@ -234,8 +233,8 @@ public function shortpixel_image_optimised( $id ) { * @param $id * @param null $metadata */ - public function shortpixel_before_restore_image( $id, $metadata = null ) { - $this->sync_backup_file( $id, $metadata, true, array( 'download' => true ) ); + public function shortpixel_before_restore_image($id, $metadata = null) { + $this->sync_backup_file($id, $metadata, true, array('download' => true)); } /** @@ -245,10 +244,10 @@ public function shortpixel_before_restore_image( $id, $metadata = null ) { * @param null $id * @return bool */ - public function shortpixel_skip_restore_image( $return, $id = null ) { - if( ud_get_stateless_media()->get( 'sm.mode' ) === 'ephemeral' ) { + public function shortpixel_skip_restore_image($return, $id = null) { + if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { $this->client = ud_get_stateless_media()->get_client(); - $this->client->copy_media( 'localhost/ShortpixelBackups/wp-content/uploads/2019/04/htpps.png', 'localhost/2019/04/htpps.png' ); + $this->client->copy_media('localhost/ShortpixelBackups/wp-content/uploads/2019/04/htpps.png', 'localhost/2019/04/htpps.png'); return true; } return $return; @@ -263,39 +262,39 @@ public function shortpixel_skip_restore_image( $return, $id = null ) { * @param array $args * before_optimization : pass true if you want to sync directly from original path instead of backup path. */ - public function sync_backup_file( $id, $metadata = null, $force = false, $args = array() ) { - $args = wp_parse_args( $args, array( 'download' => false, // whether to only download. + public function sync_backup_file($id, $metadata = null, $force = false, $args = array()) { + $args = wp_parse_args($args, array( + 'download' => false, // whether to only download. 'before_optimization' => false, // whether to delete local file in ephemeral mode. - ) ); + )); /* Get metadata in case if method is called directly. */ - if( empty( $metadata ) ) { - $metadata = wp_get_attachment_metadata( $id ); + if (empty($metadata)) { + $metadata = wp_get_attachment_metadata($id); } /* Now we go through all available image sizes and upload them to Google Storage */ - if( !empty( $metadata[ 'sizes' ] ) && is_array( $metadata[ 'sizes' ] ) ) { + if (!empty($metadata['sizes']) && is_array($metadata['sizes'])) { // Sync backup file with GCS - $file_path = get_attached_file( $id ); - $fullSubDir = $this->returnSubDir( $file_path ); + $file_path = get_attached_file($id); + $fullSubDir = $this->returnSubDir($file_path); $backup_path = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - if( $args[ 'before_optimization' ] ) { + if ($args['before_optimization']) { $upload_dir = wp_upload_dir(); - $backup_path = $upload_dir[ 'basedir' ] . '/' . dirname( $metadata[ 'file' ] ); - $args = array( 'ephemeral' => false ); + $backup_path = $upload_dir['basedir'] . '/' . dirname($metadata['file']); + $args = array('ephemeral' => false); } - $absolutePath = trailingslashit( $backup_path ) . basename( $metadata[ 'file' ] ); - $name = apply_filters( 'wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename( $metadata[ 'file' ] ) ); - do_action( 'sm:sync::syncFile', $name, $absolutePath, $force, $args ); + $absolutePath = trailingslashit($backup_path) . basename($metadata['file']); + $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename($metadata['file'])); + do_action('sm:sync::syncFile', $name, $absolutePath, $force, $args); - foreach( (array) $metadata[ 'sizes' ] as $image_size => $data ) { - $absolutePath = trailingslashit( $backup_path ) . $data[ 'file' ]; - $name = apply_filters( 'wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . $data[ 'file' ] ); + foreach ((array) $metadata['sizes'] as $image_size => $data) { + $absolutePath = trailingslashit($backup_path) . $data['file']; + $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . $data['file']); - do_action( 'sm:sync::syncFile', $name, $absolutePath, $force, $args ); + do_action('sm:sync::syncFile', $name, $absolutePath, $force, $args); } - } } @@ -305,15 +304,15 @@ public function sync_backup_file( $id, $metadata = null, $force = false, $args = * @param $id * @param null $metadata */ - public function sync_webp_file( $id, $metadata = null ) { + public function sync_webp_file($id, $metadata = null) { /* Get metadata in case if method is called directly. */ - if( empty( $metadata ) ) { - $metadata = wp_get_attachment_metadata( $id ); + if (empty($metadata)) { + $metadata = wp_get_attachment_metadata($id); } - add_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10, 2 ); + add_filter('upload_mimes', array($this, 'add_webp_mime'), 10, 2); // Sync the webp to GCS - ud_get_stateless_media()->add_media( $metadata, $id, true, array( 'is_webp' => '.webp' ) ); - remove_filter( 'upload_mimes', array( $this, 'add_webp_mime' ), 10 ); + ud_get_stateless_media()->add_media($metadata, $id, true, array('is_webp' => '.webp')); + remove_filter('upload_mimes', array($this, 'add_webp_mime'), 10); } /** @@ -324,24 +323,24 @@ public function sync_webp_file( $id, $metadata = null ) { * @param type $file * @return string */ - public function returnSubDir( $file ) { - $hp = wp_normalize_path( get_home_path() ); - $file = wp_normalize_path( $file ); + public function returnSubDir($file) { + $hp = wp_normalize_path(get_home_path()); + $file = wp_normalize_path($file); $sp__uploads = wp_upload_dir(); - if( strstr( $file, $hp ) ) { - $path = str_replace( $hp, "", $file ); - } elseif( strstr( $file, dirname( WP_CONTENT_DIR ) ) ) { //in some situations the content dir is not inside the root, check this also (ex. single.shortpixel.com) - $path = str_replace( trailingslashit( dirname( WP_CONTENT_DIR ) ), "", $file ); - } elseif( ( strstr( realpath( $file ), realpath( $hp ) ) ) ) { - $path = str_replace( realpath( $hp ), "", realpath( $file ) ); - } elseif( strstr( $file, trailingslashit( dirname( dirname( $sp__uploads[ 'basedir' ] ) ) ) ) ) { - $path = str_replace( trailingslashit( dirname( dirname( $sp__uploads[ 'basedir' ] ) ) ), "", $file ); + if (strstr($file, $hp)) { + $path = str_replace($hp, "", $file); + } elseif (strstr($file, dirname(WP_CONTENT_DIR))) { //in some situations the content dir is not inside the root, check this also (ex. single.shortpixel.com) + $path = str_replace(trailingslashit(dirname(WP_CONTENT_DIR)), "", $file); + } elseif ((strstr(realpath($file), realpath($hp)))) { + $path = str_replace(realpath($hp), "", realpath($file)); + } elseif (strstr($file, trailingslashit(dirname(dirname($sp__uploads['basedir']))))) { + $path = str_replace(trailingslashit(dirname(dirname($sp__uploads['basedir']))), "", $file); } else { - $path = ( substr( $file, 1 ) ); + $path = (substr($file, 1)); } - $pathArr = explode( '/', $path ); - unset( $pathArr[ count( $pathArr ) - 1 ] ); - return implode( '/', $pathArr ) . '/'; + $pathArr = explode('/', $path); + unset($pathArr[count($pathArr) - 1]); + return implode('/', $pathArr) . '/'; } /** @@ -349,9 +348,9 @@ public function returnSubDir( $file ) { * * @param $attachmentID */ - public function handleRestoreBackup( $attachmentID ) { - $metadata = wp_get_attachment_metadata( $attachmentID ); - $this->add_media( $metadata, $attachmentID ); + public function handleRestoreBackup($attachmentID) { + $metadata = wp_get_attachment_metadata($attachmentID); + $this->add_media($metadata, $attachmentID); } /** @@ -362,67 +361,64 @@ public function handleRestoreBackup( $attachmentID ) { * @param $metadata * @param $attachment_id */ - public static function add_media( $metadata, $attachment_id ) { + public static function add_media($metadata, $attachment_id) { $upload_dir = wp_upload_dir(); $client = ud_get_stateless_media()->get_client(); - if( !is_wp_error( $client ) ) { + if (!is_wp_error($client)) { - $fullsizepath = wp_normalize_path( get_attached_file( $attachment_id ) ); + $fullsizepath = wp_normalize_path(get_attached_file($attachment_id)); // Make non-images uploadable. - if( empty( $metadata[ 'file' ] ) && $attachment_id ) { - $metadata = array( "file" => str_replace( trailingslashit( $upload_dir[ 'basedir' ] ), '', get_attached_file( $attachment_id ) ) ); + if (empty($metadata['file']) && $attachment_id) { + $metadata = array("file" => str_replace(trailingslashit($upload_dir['basedir']), '', get_attached_file($attachment_id))); } - $file = wp_normalize_path( $metadata[ 'file' ] ); + $file = wp_normalize_path($metadata['file']); $image_host = ud_get_stateless_media()->get_gs_host(); - $bucketLink = apply_filters( 'wp_stateless_bucket_link', $image_host ); - $_cacheControl = \wpCloud\StatelessMedia\Utility::getCacheControl( $attachment_id, $metadata, null ); - $_contentDisposition = \wpCloud\StatelessMedia\Utility::getContentDisposition( $attachment_id, $metadata, null ); - $_metadata = array( "width" => isset( $metadata[ 'width' ] ) ? $metadata[ 'width' ] : null, "height" => isset( $metadata[ 'height' ] ) ? $metadata[ 'height' ] : null, 'object-id' => $attachment_id, 'source-id' => md5( $attachment_id . ud_get_stateless_media()->get( 'sm.bucket' ) ), 'file-hash' => md5( $metadata[ 'file' ] ) ); + $bucketLink = apply_filters('wp_stateless_bucket_link', $image_host); + $_cacheControl = \wpCloud\StatelessMedia\Utility::getCacheControl($attachment_id, $metadata, null); + $_contentDisposition = \wpCloud\StatelessMedia\Utility::getContentDisposition($attachment_id, $metadata, null); + $_metadata = array("width" => isset($metadata['width']) ? $metadata['width'] : null, "height" => isset($metadata['height']) ? $metadata['height'] : null, 'object-id' => $attachment_id, 'source-id' => md5($attachment_id . ud_get_stateless_media()->get('sm.bucket')), 'file-hash' => md5($metadata['file'])); - if( file_exists( $fullsizepath ) ) { - $file = apply_filters( 'wp_stateless_file_name', $file ); + if (file_exists($fullsizepath)) { + $file = apply_filters('wp_stateless_file_name', $file); /* Add default image */ - $media = $client->add_media( $_mediaOptions = array_filter( array( 'force' => true, 'name' => $file, 'absolutePath' => wp_normalize_path( get_attached_file( $attachment_id ) ), 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => get_post_mime_type( $attachment_id ), 'metadata' => $_metadata ) ) ); + $media = $client->add_media($_mediaOptions = array_filter(array('force' => true, 'name' => $file, 'absolutePath' => wp_normalize_path(get_attached_file($attachment_id)), 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => get_post_mime_type($attachment_id), 'metadata' => $_metadata))); // ephemeral mode: we don't need the local version. - if( ud_get_stateless_media()->get( 'sm.mode' ) === 'ephemeral' ) { - unlink( $fullsizepath ); + if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { + unlink($fullsizepath); } } /* Now we go through all available image sizes and upload them to Google Storage */ - if( !empty( $metadata[ 'sizes' ] ) && is_array( $metadata[ 'sizes' ] ) ) { + if (!empty($metadata['sizes']) && is_array($metadata['sizes'])) { - $path = wp_normalize_path( dirname( get_attached_file( $attachment_id ) ) ); - $mediaPath = apply_filters( 'wp_stateless_file_name', trim( dirname( $metadata[ 'file' ] ), '\/\\' ) ); + $path = wp_normalize_path(dirname(get_attached_file($attachment_id))); + $mediaPath = apply_filters('wp_stateless_file_name', trim(dirname($metadata['file']), '\/\\')); - foreach( (array) $metadata[ 'sizes' ] as $image_size => $data ) { + foreach ((array) $metadata['sizes'] as $image_size => $data) { - $absolutePath = wp_normalize_path( $path . '/' . $data[ 'file' ] ); + $absolutePath = wp_normalize_path($path . '/' . $data['file']); - if( !file_exists( $absolutePath ) ) { + if (!file_exists($absolutePath)) { continue; } /* Add 'image size' image */ - $media = $client->add_media( array( 'force' => true, 'name' => $file_path = trim( $mediaPath . '/' . $data[ 'file' ], '/' ), 'absolutePath' => $absolutePath, 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => $data[ 'mime-type' ], 'metadata' => array_merge( $_metadata, array( 'width' => $data[ 'width' ], 'height' => $data[ 'height' ], 'child-of' => $attachment_id, 'file-hash' => md5( $data[ 'file' ] ) ) ) ) ); + $media = $client->add_media(array('force' => true, 'name' => $file_path = trim($mediaPath . '/' . $data['file'], '/'), 'absolutePath' => $absolutePath, 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => $data['mime-type'], 'metadata' => array_merge($_metadata, array('width' => $data['width'], 'height' => $data['height'], 'child-of' => $attachment_id, 'file-hash' => md5($data['file']))))); /* Break if we have errors. */ - if( !is_wp_error( $media ) ) { + if (!is_wp_error($media)) { // ephemeral mode: we don't need the local version. - if( ud_get_stateless_media()->get( 'sm.mode' ) === 'ephemeral' ) { - unlink( $absolutePath ); + if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { + unlink($absolutePath); } } - } - } - } } // End add_media @@ -433,20 +429,20 @@ public static function add_media( $metadata, $attachment_id ) { * @param $args * @return mixed */ - public function wp_stateless_add_media_args( $args ) { - if( !empty( $args[ 'is_webp' ] ) && $args[ 'is_webp' ] ) { - if( \file_exists( $args[ 'absolutePath' ] . '.webp' ) ) { - $args[ 'name' ] = $args[ 'name' ] . '.webp'; - $args[ 'absolutePath' ] = $args[ 'absolutePath' ] . '.webp'; + public function wp_stateless_add_media_args($args) { + if (!empty($args['is_webp']) && $args['is_webp']) { + if (\file_exists($args['absolutePath'] . '.webp')) { + $args['name'] = $args['name'] . '.webp'; + $args['absolutePath'] = $args['absolutePath'] . '.webp'; } else { - $pathinfo = pathinfo( $args[ 'absolutePath' ] ); - $absolutePath = trailingslashit( $pathinfo[ 'dirname' ] ) . $pathinfo[ 'filename' ] . '.webp'; - if( file_exists( $absolutePath ) ) { - $args[ 'name' ] = $args[ 'name' ] . '.webp'; - $args[ 'absolutePath' ] = $absolutePath; + $pathinfo = pathinfo($args['absolutePath']); + $absolutePath = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '.webp'; + if (file_exists($absolutePath)) { + $args['name'] = $args['name'] . '.webp'; + $args['absolutePath'] = $absolutePath; } } - $args[ 'mimeType' ] = 'image/webp'; + $args['mimeType'] = 'image/webp'; } return $args; } @@ -458,10 +454,10 @@ public function wp_stateless_add_media_args( $args ) { * @param $src * @return mixed */ - public function shortpixel_webp_image_base( $imageBase, $src ) { - $gs_link = \ud_get_stateless_media()->convert_to_gs_link( $src, true ); - if( $gs_link ) { - $imageBase = trailingslashit( dirname( $gs_link ) ); + public function shortpixel_webp_image_base($imageBase, $src) { + $gs_link = \ud_get_stateless_media()->convert_to_gs_link($src, true); + if ($gs_link) { + $imageBase = trailingslashit(dirname($gs_link)); } return $imageBase; } @@ -471,23 +467,20 @@ public function shortpixel_webp_image_base( $imageBase, $src ) { * @param $id * @return mixed */ - public function shortpixel_image_urls( $URLs, $id ) { - foreach( $URLs as $key => $url ) { - $url_parts = wp_parse_url( $url ); - if( $url_parts[ 'host' ] == 'storage.googleapis.com' ) { - if( preg_match( "@(^/?.*?/)(.*)@", $url_parts[ 'path' ], $matches ) ) { - $bucket = trim( $matches[ 1 ], '/' ); - $url_parts[ 'path' ] = $matches[ 2 ]; - $url_parts[ 'host' ] = $bucket . '.' . $url_parts[ 'host' ]; - $URLs[ $key ] = Utility::join_url( $url_parts ); + public function shortpixel_image_urls($URLs, $id) { + foreach ($URLs as $key => $url) { + $url_parts = wp_parse_url($url); + if ($url_parts['host'] == 'storage.googleapis.com') { + if (preg_match("@(^/?.*?/)(.*)@", $url_parts['path'], $matches)) { + $bucket = trim($matches[1], '/'); + $url_parts['path'] = $matches[2]; + $url_parts['host'] = $bucket . '.' . $url_parts['host']; + $URLs[$key] = Utility::join_url($url_parts); } } } return $URLs; } - } - } - } diff --git a/lib/classes/compatibility/simple-local-avatars.php b/lib/classes/compatibility/simple-local-avatars.php deleted file mode 100644 index baea642b7..000000000 --- a/lib/classes/compatibility/simple-local-avatars.php +++ /dev/null @@ -1,78 +0,0 @@ -get_gs_host(); - $bucketLink = apply_filters('wp_stateless_bucket_link', $image_host); - $upload = wp_get_upload_dir(); - - // Replace local urls with corresponding GCS urls - if ( !empty( $user_meta[0] ) && is_array( $user_meta[0] ) ) { - foreach ( $user_meta[0] as $key => &$value ) { - if ( is_numeric( $key ) ) { - $value = trailingslashit( $bucketLink ) . apply_filters( 'wp_stateless_file_name', str_replace( $upload['baseurl'], '', $value ), true ); - } - } - } - - // Return filtered data back - return $user_meta; - } - } - } -} \ No newline at end of file diff --git a/lib/classes/compatibility/siteorigin-css.php b/lib/classes/compatibility/siteorigin-css.php index 6e3896431..325a268d1 100644 --- a/lib/classes/compatibility/siteorigin-css.php +++ b/lib/classes/compatibility/siteorigin-css.php @@ -1,4 +1,5 @@ get_client()->list_objects("prefix=$prefix"); // $files_array = $object_list->getItems(); // foreach ($files_array as $file) { // do_action( 'sm:sync::deleteFile', $file->name ); // } - } catch( Exception $e ) { + } catch (Exception $e) { } } } @@ -53,23 +54,20 @@ public function action_admin_menu() { * @param $orig_scheme * @return string */ - public function set_url_scheme( $url, $scheme, $orig_scheme ) { - $position = strpos( $url, 'so-css/' ); - if( $position !== false ) { + public function set_url_scheme($url, $scheme, $orig_scheme) { + $position = strpos($url, 'so-css/'); + if ($position !== false) { $upload_data = wp_upload_dir(); - $name = substr( $url, $position ); + $name = substr($url, $position); // We need to get the absolute path before adding the bucket dir to name. - $absolutePath = $upload_data[ 'basedir' ] . '/' . $name; - $name = apply_filters( 'wp_stateless_file_name', $name, 0); - do_action( 'sm:sync::syncFile', $name, $absolutePath ); + $absolutePath = $upload_data['basedir'] . '/' . $name; + $name = apply_filters('wp_stateless_file_name', $name, 0); + do_action('sm:sync::syncFile', $name, $absolutePath); // echo "do_action( 'sm:sync::syncFile', $name, $absolutePath);\n"; $url = ud_get_stateless_media()->get_gs_host() . '/' . $name; } return $url; } - } - } - } diff --git a/lib/classes/compatibility/siteorigin-widget-bundle.php b/lib/classes/compatibility/siteorigin-widget-bundle.php index 6035cb403..412a3e936 100644 --- a/lib/classes/compatibility/siteorigin-widget-bundle.php +++ b/lib/classes/compatibility/siteorigin-widget-bundle.php @@ -1,4 +1,5 @@ get_gs_host() . '/' . $name; } return $url; @@ -57,8 +58,8 @@ public function set_url_scheme( $url, $scheme, $orig_scheme ) { * @param $transient * @return mixed */ - public function clear_file_cache( $value, $expiration, $transient ) { - do_action( 'sm:sync::deleteFiles', 'siteorigin-widgets/' ); + public function clear_file_cache($value, $expiration, $transient) { + do_action('sm:sync::deleteFiles', 'siteorigin-widgets/'); return $value; } @@ -69,20 +70,16 @@ public function clear_file_cache( $value, $expiration, $transient ) { * @param $so_widget * @return mixed */ - public function delete_file( $new_instance, $form_options, $so_widget ) { - $new_instance = $so_widget->modify_instance( $new_instance ); - $style = $so_widget->get_style_name( $new_instance ); - $hash = $so_widget->get_style_hash( $new_instance ); + public function delete_file($new_instance, $form_options, $so_widget) { + $new_instance = $so_widget->modify_instance($new_instance); + $style = $so_widget->get_style_name($new_instance); + $hash = $so_widget->get_style_hash($new_instance); $name = $so_widget->id_base . '-' . $style . '-' . $hash; $file = 'siteorigin-widgets/' . $name . '.css'; - do_action( 'sm:sync::deleteFile', $file ); + do_action('sm:sync::deleteFile', $file); return $new_instance; } - - } - } - } diff --git a/lib/classes/compatibility/the-events-calendar.php b/lib/classes/compatibility/the-events-calendar.php deleted file mode 100644 index 6b7b3beec..000000000 --- a/lib/classes/compatibility/the-events-calendar.php +++ /dev/null @@ -1,48 +0,0 @@ -get_client(); - $file_path = apply_filters( 'wp_stateless_file_name', $file, 0 ); - $file_info = @getimagesize( $file ); + $file_path = apply_filters('wp_stateless_file_name', $file, 0); + $file_info = @getimagesize($file); if ($file_info) { $_metadata = array( 'width' => $file_info[0], 'height' => $file_info[1], 'object-id' => 'unknown', // we really don't know it - 'source-id' => md5( $file . ud_get_stateless_media()->get( 'sm.bucket' ) ), - 'file-hash' => md5( $file ) + 'source-id' => md5($file . ud_get_stateless_media()->get('sm.bucket')), + 'file-hash' => md5($file) ); } @@ -75,7 +76,5 @@ public function wp_handle_upload( $upload ) { return $upload; } } - } - } diff --git a/lib/classes/compatibility/wp-retina-2x.php b/lib/classes/compatibility/wp-retina-2x.php index bd2166f90..557de22ac 100644 --- a/lib/classes/compatibility/wp-retina-2x.php +++ b/lib/classes/compatibility/wp-retina-2x.php @@ -1,4 +1,5 @@ "Over HTTP Check" setting is enabled.'; protected $plugin_file = 'wp-retina-2x-pro/wp-retina-2x-pro.php'; - protected $sm_mode_not_supported = [ 'stateless' ]; + protected $sm_mode_not_supported = ['stateless']; /** * @param $sm */ - public function module_init( $sm ) { + public function module_init($sm) { // Sync image. // wr2x_before_generate_retina is always called // where wr2x_before_regenerate called from ajax requests. - add_action( 'wr2x_before_generate_retina', array( $this, 'before_generate_retina' ) ); - add_action( 'wr2x_retina_file_added', array( $this, 'retina_file_added' ), 10, 3 ); + add_action('wr2x_before_generate_retina', array($this, 'before_generate_retina')); + add_action('wr2x_retina_file_added', array($this, 'retina_file_added'), 10, 3); // Delete retina image from GCS. - add_action( 'delete_attachment', array( $this, 'delete_retina' ) ); + add_action('delete_attachment', array($this, 'delete_retina')); // Manual Sync retina images. - add_action( 'sm:synced::image', array( $this, 'manual_sync_retina' ), 10, 2 ); + add_action('sm:synced::image', array($this, 'manual_sync_retina'), 10, 2); - $over_http = get_option( 'wr2x_over_http_check', false ); - if( !$over_http ) { - $url = admin_url( 'admin.php?page=wr2x_settings-menu' ); - ud_get_stateless_media()->errors->add( array( 'key' => "wp-retina-2x-pro-over-http-check", 'title' => sprintf( __( "WP Stateless Compatibility: WP Retina 2x Pro", ud_get_stateless_media()->domain ) ), 'message' => sprintf( __( 'Please enable the "Over HTTP Check" settings in Meow Apps > Retina.', ud_get_stateless_media()->domain ), $url ), ), 'notice' ); + $over_http = get_option('wr2x_over_http_check', false); + if (!$over_http) { + $url = admin_url('admin.php?page=wr2x_settings-menu'); + ud_get_stateless_media()->errors->add(array('key' => "wp-retina-2x-pro-over-http-check", 'title' => sprintf(__("WP Stateless Compatibility: WP Retina 2x Pro", ud_get_stateless_media()->domain)), 'message' => sprintf(__('Please enable the "Over HTTP Check" settings in Meow Apps > Retina.', ud_get_stateless_media()->domain), $url),), 'notice'); } } @@ -49,15 +50,15 @@ public function module_init( $sm ) { * @param int $attachment_id * @return void */ - public function before_generate_retina( $attachment_id ) { + public function before_generate_retina($attachment_id) { $upload_basedir = wp_upload_dir(); - $upload_basedir = trailingslashit( $upload_basedir[ 'basedir' ] ); - $metadata = wp_get_attachment_metadata( $attachment_id ); - $image_sizes = Utility::get_path_and_url( $metadata, $attachment_id ); + $upload_basedir = trailingslashit($upload_basedir['basedir']); + $metadata = wp_get_attachment_metadata($attachment_id); + $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - foreach( $image_sizes as $image ) { - if( !empty( $image[ 'gs_name' ] ) && !file_exists( $image[ 'path' ] ) ) { - ud_get_stateless_media()->get_client()->get_media( $image[ 'gs_name' ], true, $image[ 'path' ] ); + foreach ($image_sizes as $image) { + if (!empty($image['gs_name']) && !file_exists($image['path'])) { + ud_get_stateless_media()->get_client()->get_media($image['gs_name'], true, $image['path']); } } } @@ -70,9 +71,9 @@ public function before_generate_retina( $attachment_id ) { * @param String $name image size * @return void */ - public function retina_file_added( $attachment_id, $retina_file, $name ) { - $gs_name = apply_filters( 'wp_stateless_file_name', $retina_file, 0 ); - do_action( 'sm:sync::syncFile', $gs_name, $retina_file, true, array( 'use_root' => true ) ); + public function retina_file_added($attachment_id, $retina_file, $name) { + $gs_name = apply_filters('wp_stateless_file_name', $retina_file, 0); + do_action('sm:sync::syncFile', $gs_name, $retina_file, true, array('use_root' => true)); } /** @@ -81,20 +82,20 @@ public function retina_file_added( $attachment_id, $retina_file, $name ) { * @param int $attachment_id * @return void */ - public function delete_retina( $attachment_id ) { - $metadata = wp_get_attachment_metadata( $attachment_id ); - $image_sizes = Utility::get_path_and_url( $metadata, $attachment_id ); - $ignore = get_option( "wr2x_ignore_sizes" ); - if( empty( $ignore ) ) $ignore = array(); - - foreach( $image_sizes as $size => $img ) { - if( in_array( $size, $ignore ) ) { + public function delete_retina($attachment_id) { + $metadata = wp_get_attachment_metadata($attachment_id); + $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); + $ignore = get_option("wr2x_ignore_sizes"); + if (empty($ignore)) $ignore = array(); + + foreach ($image_sizes as $size => $img) { + if (in_array($size, $ignore)) { continue; } - $pathinfo = pathinfo( $img[ 'gs_name' ] ); - $gs_name_retina = trailingslashit( $pathinfo[ 'dirname' ] ) . $pathinfo[ 'filename' ] . '@2x.' . $pathinfo[ 'extension' ]; + $pathinfo = pathinfo($img['gs_name']); + $gs_name_retina = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '@2x.' . $pathinfo['extension']; // @todo Sometime relevant file don't exist on GCS. Try to skip those when retina don't exist. - do_action( 'sm:sync::deleteFile', $gs_name_retina ); + do_action('sm:sync::deleteFile', $gs_name_retina); } } @@ -105,26 +106,25 @@ public function delete_retina( $attachment_id ) { * @param array $metadata * @return void */ - public function manual_sync_retina( $attachment_id, $metadata ) { - $image_sizes = Utility::get_path_and_url( $metadata, $attachment_id ); + public function manual_sync_retina($attachment_id, $metadata) { + $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - $ignore = get_option( "wr2x_ignore_sizes" ); - if( empty( $ignore ) ) $ignore = array(); + $ignore = get_option("wr2x_ignore_sizes"); + if (empty($ignore)) $ignore = array(); - foreach( $image_sizes as $size => $img ) { - if( in_array( $size, $ignore ) ) { + foreach ($image_sizes as $size => $img) { + if (in_array($size, $ignore)) { continue; } - $pathinfo = pathinfo( $img['path'] ) ; - $retina_file = trailingslashit( $pathinfo['dirname'] ) . $pathinfo['filename'] . '@2x.' . $pathinfo['extension']; - $gs_name = apply_filters( 'wp_stateless_file_name', $retina_file, 0); + $pathinfo = pathinfo($img['path']); + $retina_file = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '@2x.' . $pathinfo['extension']; + $gs_name = apply_filters('wp_stateless_file_name', $retina_file, 0); // @todo Sometime relevant file don't exist on GCS. Try to skip those when retina don't exist. - do_action( 'sm:sync::syncFile', $gs_name, $retina_file, false, array( 'use_root' => true ) ); + do_action('sm:sync::syncFile', $gs_name, $retina_file, false, array('use_root' => true)); } } } } - } diff --git a/lib/classes/compatibility/wp-smush.php b/lib/classes/compatibility/wp-smush.php index 01511d393..948e1c4da 100644 --- a/lib/classes/compatibility/wp-smush.php +++ b/lib/classes/compatibility/wp-smush.php @@ -1,4 +1,5 @@ core()->mod->settings->get( 'auto' ); + if (class_exists('WP_Smush_Modules')) { + $auto_smush = \WP_Smush::get_instance()->core()->mod->settings->get('auto'); } else { global $wpsmush_settings; - $auto_smush = $wpsmush_settings->settings[ 'auto' ]; + $auto_smush = $wpsmush_settings->settings['auto']; } - if (!$auto_smush || !wp_attachment_is_image($attachment_id) || + if ( + !$auto_smush || !wp_attachment_is_image($attachment_id) || !apply_filters('wp_smush_image', true, $attachment_id) || !( ((!empty($_POST['action']) && 'upload-attachment' == $_POST['action']) || isset($_POST['post_id'])) && // And, check if Async is enabled. - defined('WP_SMUSH_ASYNC') && WP_SMUSH_ASYNC - ) + defined('WP_SMUSH_ASYNC') && WP_SMUSH_ASYNC) ) { return false; } @@ -85,12 +86,12 @@ public function skip_add_media( $return, $metadata, $attachment_id, $force = fal * * @return null */ - public function image_optimized( $attachment_id, $stats ) { + public function image_optimized($attachment_id, $stats) { // Sync the attachment to GCS - ud_get_stateless_media()->add_media( array(), $attachment_id, true ); + ud_get_stateless_media()->add_media(array(), $attachment_id, true); // also sync the backup images - $this->sync_backup( $attachment_id ); + $this->sync_backup($attachment_id); } /** @@ -102,26 +103,26 @@ public function image_optimized( $attachment_id, $stats ) { * * @return null */ - function maybe_download_file( $file_path = '', $attachment_id = '', $size_details = array() ) { - if( empty( $file_path ) || empty( $attachment_id ) ) { + function maybe_download_file($file_path = '', $attachment_id = '', $size_details = array()) { + if (empty($file_path) || empty($attachment_id)) { return; } //Download if file not exists - if( !file_exists( $file_path ) ) { + if (!file_exists($file_path)) { $client = ud_get_stateless_media()->get_client(); - $metadata = wp_get_attachment_metadata( $attachment_id ); - if( !empty( $metadata[ 'gs_name' ] ) ) { - $image_sizes = Utility::get_path_and_url( $metadata, $attachment_id ); - foreach( $image_sizes as $size => $img ) { - $client->get_media( apply_filters( 'wp_stateless_file_name', $img[ 'gs_name' ] ), true, $img[ 'path' ] ); + $metadata = wp_get_attachment_metadata($attachment_id); + if (!empty($metadata['gs_name'])) { + $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); + foreach ($image_sizes as $size => $img) { + $client->get_media(apply_filters('wp_stateless_file_name', $img['gs_name']), true, $img['path']); } - $gs_name = dirname( $metadata[ 'gs_name' ] ) . '/' . basename( $file_path ); + $gs_name = dirname($metadata['gs_name']) . '/' . basename($file_path); // We need to remove backup from GCS if it's a restore action // @todo revise this code - if( $this->hook_from_restore_image() ) { - $client->remove_media( apply_filters( 'wp_stateless_file_name', $gs_name ) ); + if ($this->hook_from_restore_image()) { + $client->remove_media(apply_filters('wp_stateless_file_name', $gs_name)); } } } @@ -132,25 +133,24 @@ function maybe_download_file( $file_path = '', $attachment_id = '', $size_detail * * @param $attachment_id */ - function remove_backup( $attachment_id ) { + function remove_backup($attachment_id) { $upload_dir = wp_get_upload_dir(); - $metadata = wp_get_attachment_metadata( $attachment_id ); - $backup_paths = get_post_meta( $attachment_id, '_wp_attachment_backup_sizes', true ); + $metadata = wp_get_attachment_metadata($attachment_id); + $backup_paths = get_post_meta($attachment_id, '_wp_attachment_backup_sizes', true); - if( !empty( $metadata[ 'gs_name' ] ) && !empty( $backup_paths ) && is_array( $backup_paths ) ) { + if (!empty($metadata['gs_name']) && !empty($backup_paths) && is_array($backup_paths)) { // Getting local dir path for backup image - $base_dir = $upload_dir[ 'basedir' ] . '/' . dirname( $metadata[ 'file' ] ); + $base_dir = $upload_dir['basedir'] . '/' . dirname($metadata['file']); // Getting GCS dir name from meta data. In case Bucket Folder used. - $gs_dir = dirname( $metadata[ 'gs_name' ] ); - foreach( $backup_paths as $key => $data ) { - $gs_name = $gs_dir . '/' . basename( $data[ 'file' ] ); + $gs_dir = dirname($metadata['gs_name']); + foreach ($backup_paths as $key => $data) { + $gs_name = $gs_dir . '/' . basename($data['file']); // Path of backup image - $backup_path = $base_dir . '/' . basename( $data[ 'file' ] ); - do_action( 'sm:sync::deleteFile', apply_filters( 'wp_stateless_file_name', $gs_name ), $backup_path ); - delete_transient( 'sm-wp-smush-backup-exists-' . $attachment_id ); + $backup_path = $base_dir . '/' . basename($data['file']); + do_action('sm:sync::deleteFile', apply_filters('wp_stateless_file_name', $gs_name), $backup_path); + delete_transient('sm-wp-smush-backup-exists-' . $attachment_id); } } - } /** @@ -161,17 +161,17 @@ function remove_backup( $attachment_id ) { * * @return bool */ - function backup_exists_on_gcs( $exists, $attachment_id = '', $backup_path = '' ) { - if( !$exists && $attachment_id ) { - if( get_transient( 'sm-wp-smush-backup-exists-' . $attachment_id ) ) { + function backup_exists_on_gcs($exists, $attachment_id = '', $backup_path = '') { + if (!$exists && $attachment_id) { + if (get_transient('sm-wp-smush-backup-exists-' . $attachment_id)) { return true; } - $metadata = wp_get_attachment_metadata( $attachment_id ); - if( !empty( $metadata[ 'gs_name' ] ) ) { - $gs_name = dirname( $metadata[ 'gs_name' ] ) . '/' . basename( $backup_path ); - if( ud_get_stateless_media()->get_client()->media_exists( apply_filters( 'wp_stateless_file_name', $gs_name ) ) ) { - set_transient( 'sm-wp-smush-backup-exists-' . $attachment_id, true, HOUR_IN_SECONDS ); + $metadata = wp_get_attachment_metadata($attachment_id); + if (!empty($metadata['gs_name'])) { + $gs_name = dirname($metadata['gs_name']) . '/' . basename($backup_path); + if (ud_get_stateless_media()->get_client()->media_exists(apply_filters('wp_stateless_file_name', $gs_name))) { + set_transient('sm-wp-smush-backup-exists-' . $attachment_id, true, HOUR_IN_SECONDS); return true; } } @@ -186,28 +186,28 @@ function backup_exists_on_gcs( $exists, $attachment_id = '', $backup_path = '' ) * @param $attachment_id * @param array $metadata */ - public function sync_backup( $attachment_id, $metadata = array() ) { + public function sync_backup($attachment_id, $metadata = array()) { $upload_dir = wp_get_upload_dir(); - if( empty( $metadata ) || empty( $metadata[ 'gs_name' ] ) ) { - $metadata = wp_get_attachment_metadata( $attachment_id ); + if (empty($metadata) || empty($metadata['gs_name'])) { + $metadata = wp_get_attachment_metadata($attachment_id); } // Getting backup path from smush settings in db - $backup_paths = get_post_meta( $attachment_id, '_wp_attachment_backup_sizes', true ); + $backup_paths = get_post_meta($attachment_id, '_wp_attachment_backup_sizes', true); - if( !empty( $metadata[ 'gs_name' ] ) && !empty( $backup_paths ) && is_array( $backup_paths ) ) { + if (!empty($metadata['gs_name']) && !empty($backup_paths) && is_array($backup_paths)) { // Getting local dir for backup image - $base_dir = $upload_dir[ 'basedir' ] . '/' . dirname( $metadata[ 'file' ] ); + $base_dir = $upload_dir['basedir'] . '/' . dirname($metadata['file']); // Getting GCS dir name from meta data. In case Bucket Folder used. - $gs_dir = dirname( $metadata[ 'gs_name' ] ); + $gs_dir = dirname($metadata['gs_name']); - foreach( $backup_paths as $key => $data ) { - $gs_name = $gs_dir . '/' . basename( $data[ 'file' ] ); + foreach ($backup_paths as $key => $data) { + $gs_name = $gs_dir . '/' . basename($data['file']); // Path of backup image - $backup_path = $base_dir . '/' . basename( $data[ 'file' ] ); + $backup_path = $base_dir . '/' . basename($data['file']); // Sync backup image with GCS - do_action( 'sm:sync::syncFile', apply_filters( 'wp_stateless_file_name', $gs_name ), $backup_path ); - delete_transient( 'sm-wp-smush-backup-exists-' . $attachment_id ); + do_action('sm:sync::syncFile', apply_filters('wp_stateless_file_name', $gs_name), $backup_path); + delete_transient('sm-wp-smush-backup-exists-' . $attachment_id); } } } @@ -220,12 +220,12 @@ public function sync_backup( $attachment_id, $metadata = array() ) { */ private function hook_from_restore_image() { $call_stack = debug_backtrace(); - $class_name = class_exists( 'WpSmushBackup' ) ? 'WpSmushBackup' : 'WP_Smush_Backup'; + $class_name = class_exists('WpSmushBackup') ? 'WpSmushBackup' : 'WP_Smush_Backup'; - if( !empty( $call_stack ) && is_array( $call_stack ) ) { - foreach( $call_stack as $step ) { + if (!empty($call_stack) && is_array($call_stack)) { + foreach ($call_stack as $step) { - if( $step[ 'function' ] == 'restore_image' && $step[ 'class' ] == $class_name ) { + if ($step['function'] == 'restore_image' && $step['class'] == $class_name) { return true; } } @@ -233,9 +233,6 @@ private function hook_from_restore_image() { return false; } - } - } - } diff --git a/lib/classes/compatibility/wpbakery-page-builder.php b/lib/classes/compatibility/wpbakery-page-builder.php index 0bc3ecf40..99defa802 100644 --- a/lib/classes/compatibility/wpbakery-page-builder.php +++ b/lib/classes/compatibility/wpbakery-page-builder.php @@ -1,4 +1,5 @@ enabled ) { + if ($this->enabled) { // We need to add the filter on construct. Init is too late. - add_filter( 'vc_wpb_getimagesize', array( $this, 'vc_wpb_getimagesize' ), 10, 3 ); + add_filter('vc_wpb_getimagesize', array($this, 'vc_wpb_getimagesize'), 10, 3); } } /** * @param $sm */ - public function module_init( $sm ) { + public function module_init($sm) { // } @@ -48,36 +49,33 @@ public function module_init( $sm ) { * @param $params * @return mixed */ - public function vc_wpb_getimagesize( $args, $attach_id, $params ) { - if( !$this->enabled ) return $args; + public function vc_wpb_getimagesize($args, $attach_id, $params) { + if (!$this->enabled) return $args; $gs_host = ud_get_stateless_media()->get_gs_host(); - $meta_data = wp_get_attachment_metadata( $attach_id ); - preg_match( "/src=[\"|'](.*?)[\"|']/", $args[ 'thumbnail' ], $match ); + $meta_data = wp_get_attachment_metadata($attach_id); + preg_match("/src=[\"|'](.*?)[\"|']/", $args['thumbnail'], $match); - if( !empty( $match[ 1 ] ) && empty( $meta_data[ 'sizes' ][ $params[ 'thumb_size' ] ] ) ) { + if (!empty($match[1]) && empty($meta_data['sizes'][$params['thumb_size']])) { $dir = wp_upload_dir(); - $url = $match[ 1 ]; - $path = str_replace( $gs_host, '', $url ); - $path = trim( $path, '/' ); - $absolute_path = $dir[ 'basedir' ] . '/' . $path; + $url = $match[1]; + $path = str_replace($gs_host, '', $url); + $path = trim($path, '/'); + $absolute_path = $dir['basedir'] . '/' . $path; - $size = getimagesize( $absolute_path ); - $filetype = wp_check_filetype( $absolute_path ); + $size = getimagesize($absolute_path); + $filetype = wp_check_filetype($absolute_path); $size_info = array( - 'file' => wp_basename( $absolute_path ), + 'file' => wp_basename($absolute_path), 'mime-type' => $filetype['type'], 'width' => $size[0], 'height' => $size[1], ); - $meta_data[ 'sizes' ][ $params[ 'thumb_size' ] ] = $size_info; - wp_update_attachment_metadata( $attach_id, $meta_data ); + $meta_data['sizes'][$params['thumb_size']] = $size_info; + wp_update_attachment_metadata($attach_id, $meta_data); } return $args; } - } - } - } diff --git a/lib/classes/compatibility/wpforms.php b/lib/classes/compatibility/wpforms.php index ecd25bef1..575b048bb 100644 --- a/lib/classes/compatibility/wpforms.php +++ b/lib/classes/compatibility/wpforms.php @@ -1,4 +1,5 @@ Date: Tue, 24 Oct 2023 18:34:47 +0300 Subject: [PATCH 02/53] Composer install --- composer.json | 5 + vendor/autoload.php | 18 + vendor/bin/mozart | 120 +- vendor/composer/ClassLoader.php | 202 +- vendor/composer/InstalledVersions.php | 359 +++ vendor/composer/autoload_classmap.php | 21 +- vendor/composer/autoload_files.php | 2 +- vendor/composer/autoload_namespaces.php | 2 +- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_real.php | 51 +- vendor/composer/autoload_static.php | 20 +- vendor/composer/installed.json | 3405 ++++++++++++----------- vendor/composer/installed.php | 257 ++ vendor/composer/platform_check.php | 26 + 14 files changed, 2701 insertions(+), 1789 deletions(-) mode change 120000 => 100755 vendor/bin/mozart create mode 100644 vendor/composer/InstalledVersions.php create mode 100644 vendor/composer/installed.php create mode 100644 vendor/composer/platform_check.php diff --git a/composer.json b/composer.json index ce342fe63..97c1543ea 100644 --- a/composer.json +++ b/composer.json @@ -92,5 +92,10 @@ "require-dev": { "coenjacobs/mozart": "0.7.1", "deliciousbrains/wp-background-processing": "^1.0" + }, + "config": { + "allow-plugins": { + "composer/installers": true + } } } diff --git a/vendor/autoload.php b/vendor/autoload.php index 78a66e62d..9ceacb360 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 ComposerAutoloaderInitc59d002476a452800baaf79c430753cb::getLoader(); diff --git a/vendor/bin/mozart b/vendor/bin/mozart deleted file mode 120000 index fcec443a6..000000000 --- a/vendor/bin/mozart +++ /dev/null @@ -1 +0,0 @@ -../coenjacobs/mozart/bin/mozart \ No newline at end of file diff --git a/vendor/bin/mozart b/vendor/bin/mozart new file mode 100755 index 000000000..50ad97f47 --- /dev/null +++ b/vendor/bin/mozart @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'); + } +} + +return include __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'; diff --git a/vendor/composer/ClassLoader.php b/vendor/composer/ClassLoader.php index 03b9bb9c4..7824d8f7e 100644 --- a/vendor/composer/ClassLoader.php +++ b/vendor/composer/ClassLoader.php @@ -37,26 +37,81 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * 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 list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -66,28 +121,42 @@ public function getPrefixes() return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,22 +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 array|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 ); } @@ -126,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 ); } } @@ -147,25 +219,28 @@ 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 array|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 + * + * @return void */ 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])) { @@ -175,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 ); } } @@ -195,8 +270,10 @@ 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +288,12 @@ 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 array|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 + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +313,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +337,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +359,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,33 +381,55 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -367,6 +474,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -432,14 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -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 new file mode 100644 index 000000000..51e734a77 --- /dev/null +++ b/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * 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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @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() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // 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 = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @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) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($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]; + } + } + } + } + + if (null === self::$installed) { + // 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') { + /** @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(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index b05a66c47..63f1eeb5f 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -2,11 +2,12 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', @@ -41,33 +42,20 @@ 'wpCloud\\StatelessMedia\\API' => $baseDir . '/lib/classes/class-api.php', 'wpCloud\\StatelessMedia\\Ajax' => $baseDir . '/lib/classes/class-ajax.php', 'wpCloud\\StatelessMedia\\Bootstrap' => $baseDir . '/lib/classes/class-bootstrap.php', - 'wpCloud\\StatelessMedia\\BuddyBoss' => $baseDir . '/lib/classes/compatibility/buddyboss.php', - 'wpCloud\\StatelessMedia\\BuddyPress' => $baseDir . '/lib/classes/compatibility/buddypress.php', - 'wpCloud\\StatelessMedia\\CompatibilityAcfImageCrop' => $baseDir . '/lib/classes/compatibility/acf-image-crop.php', + 'wpCloud\\StatelessMedia\\Compatibility' => $baseDir . '/lib/classes/class-compatibility.php', 'wpCloud\\StatelessMedia\\CompatibilityWooExtraProductOptions' => $baseDir . '/lib/classes/compatibility/woo-extra-product-options.php', - 'wpCloud\\StatelessMedia\\Divi' => $baseDir . '/lib/classes/compatibility/divi.php', 'wpCloud\\StatelessMedia\\DynamicImageSupport' => $baseDir . '/lib/classes/compatibility/dynamic-image-support.php', - 'wpCloud\\StatelessMedia\\EDDDownloadMethod' => $baseDir . '/lib/classes/compatibility/easy-digital-downloads.php', - 'wpCloud\\StatelessMedia\\EWWW' => $baseDir . '/lib/classes/compatibility/ewww.php', - 'wpCloud\\StatelessMedia\\Elementor' => $baseDir . '/lib/classes/compatibility/elementor.php', 'wpCloud\\StatelessMedia\\Errors' => $baseDir . '/lib/classes/class-errors.php', 'wpCloud\\StatelessMedia\\FatalException' => $baseDir . '/lib/classes/exception-fatal.php', 'wpCloud\\StatelessMedia\\GS_Client' => $baseDir . '/lib/classes/class-gs-client.php', 'wpCloud\\StatelessMedia\\GoogleAppEngine' => $baseDir . '/lib/classes/compatibility/google-app-engine.php', - 'wpCloud\\StatelessMedia\\GravityForm' => $baseDir . '/lib/classes/compatibility/gravity-forms.php', - 'wpCloud\\StatelessMedia\\GravityFormSignature' => $baseDir . '/lib/classes/compatibility/gravity-forms-signature.php', - 'wpCloud\\StatelessMedia\\ICompatibility' => $baseDir . '/lib/classes/compatibility/ICompatibility.php', 'wpCloud\\StatelessMedia\\Imagify' => $baseDir . '/lib/classes/compatibility/imagify.php', - 'wpCloud\\StatelessMedia\\LSCacheWP' => $baseDir . '/lib/classes/compatibility/lite-speed-cache.php', - 'wpCloud\\StatelessMedia\\LearnDash' => $baseDir . '/lib/classes/compatibility/learn-dash.php', 'wpCloud\\StatelessMedia\\Logger' => $baseDir . '/lib/classes/class-logger.php', - 'wpCloud\\StatelessMedia\\Module' => $baseDir . '/lib/classes/class-compatibility.php', - 'wpCloud\\StatelessMedia\\Polylang' => $baseDir . '/lib/classes/compatibility/polylang-pro.php', + 'wpCloud\\StatelessMedia\\Module' => $baseDir . '/lib/classes/class-module.php', 'wpCloud\\StatelessMedia\\SOCSS' => $baseDir . '/lib/classes/compatibility/siteorigin-css.php', 'wpCloud\\StatelessMedia\\SOWidgetCSS' => $baseDir . '/lib/classes/compatibility/siteorigin-widget-bundle.php', 'wpCloud\\StatelessMedia\\Settings' => $baseDir . '/lib/classes/class-settings.php', 'wpCloud\\StatelessMedia\\ShortPixel' => $baseDir . '/lib/classes/compatibility/shortpixel.php', - 'wpCloud\\StatelessMedia\\SimpleLocalAvatars' => $baseDir . '/lib/classes/compatibility/simple-local-avatars.php', 'wpCloud\\StatelessMedia\\Singleton' => $baseDir . '/lib/classes/trait-singleton.php', 'wpCloud\\StatelessMedia\\StreamWrapper' => $baseDir . '/lib/classes/class-gs-stream-wrapper.php', 'wpCloud\\StatelessMedia\\SyncNonMedia' => $baseDir . '/lib/classes/class-sync-non-media.php', @@ -78,7 +66,6 @@ 'wpCloud\\StatelessMedia\\Sync\\ImageSync' => $baseDir . '/lib/classes/sync/class-image-sync.php', 'wpCloud\\StatelessMedia\\Sync\\LibrarySync' => $baseDir . '/lib/classes/sync/class-library-sync.php', 'wpCloud\\StatelessMedia\\Sync\\NonLibrarySync' => $baseDir . '/lib/classes/sync/class-non-library-sync.php', - 'wpCloud\\StatelessMedia\\TheEventsCalendar' => $baseDir . '/lib/classes/compatibility/the-events-calendar.php', 'wpCloud\\StatelessMedia\\UnprocessableException' => $baseDir . '/lib/classes/exception-unprocessable.php', 'wpCloud\\StatelessMedia\\Upgrader' => $baseDir . '/lib/classes/class-upgrader.php', 'wpCloud\\StatelessMedia\\Utility' => $baseDir . '/lib/classes/class-utility.php', diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php index 7fe9b6d43..e70959884 100644 --- a/vendor/composer/autoload_files.php +++ b/vendor/composer/autoload_files.php @@ -2,7 +2,7 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( diff --git a/vendor/composer/autoload_namespaces.php b/vendor/composer/autoload_namespaces.php index d983a0a8a..703394b01 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 7a5da030f..f69715179 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 8fbed1399..ea6820089 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -22,52 +22,29 @@ public static function getLoader() return self::$loader; } + require __DIR__ . '/platform_check.php'; + spl_autoload_register(array('ComposerAutoloaderInitc59d002476a452800baaf79c430753cb', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitc59d002476a452800baaf79c430753cb', 'loadClassLoader')); - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInitc59d002476a452800baaf79c430753cb::getInitializer($loader)); - call_user_func(\Composer\Autoload\ComposerStaticInitc59d002476a452800baaf79c430753cb::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\ComposerStaticInitc59d002476a452800baaf79c430753cb::$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\ComposerStaticInitc59d002476a452800baaf79c430753cb::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequirec59d002476a452800baaf79c430753cb($fileIdentifier, $file); + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -function composerRequirec59d002476a452800baaf79c430753cb($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 033759d40..5f60a88b8 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -15,7 +15,6 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - '8ca8a91f0a826d6c6c8f274c90ca7d88' => __DIR__ . '/..' . '/wpmetabox/meta-box/meta-box.php', ); public static $prefixLengthsPsr4 = array ( @@ -131,6 +130,7 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb public static $classMap = array ( 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', @@ -165,33 +165,20 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'wpCloud\\StatelessMedia\\API' => __DIR__ . '/../..' . '/lib/classes/class-api.php', 'wpCloud\\StatelessMedia\\Ajax' => __DIR__ . '/../..' . '/lib/classes/class-ajax.php', 'wpCloud\\StatelessMedia\\Bootstrap' => __DIR__ . '/../..' . '/lib/classes/class-bootstrap.php', - 'wpCloud\\StatelessMedia\\BuddyBoss' => __DIR__ . '/../..' . '/lib/classes/compatibility/buddyboss.php', - 'wpCloud\\StatelessMedia\\BuddyPress' => __DIR__ . '/../..' . '/lib/classes/compatibility/buddypress.php', - 'wpCloud\\StatelessMedia\\CompatibilityAcfImageCrop' => __DIR__ . '/../..' . '/lib/classes/compatibility/acf-image-crop.php', + 'wpCloud\\StatelessMedia\\Compatibility' => __DIR__ . '/../..' . '/lib/classes/class-compatibility.php', 'wpCloud\\StatelessMedia\\CompatibilityWooExtraProductOptions' => __DIR__ . '/../..' . '/lib/classes/compatibility/woo-extra-product-options.php', - 'wpCloud\\StatelessMedia\\Divi' => __DIR__ . '/../..' . '/lib/classes/compatibility/divi.php', 'wpCloud\\StatelessMedia\\DynamicImageSupport' => __DIR__ . '/../..' . '/lib/classes/compatibility/dynamic-image-support.php', - 'wpCloud\\StatelessMedia\\EDDDownloadMethod' => __DIR__ . '/../..' . '/lib/classes/compatibility/easy-digital-downloads.php', - 'wpCloud\\StatelessMedia\\EWWW' => __DIR__ . '/../..' . '/lib/classes/compatibility/ewww.php', - 'wpCloud\\StatelessMedia\\Elementor' => __DIR__ . '/../..' . '/lib/classes/compatibility/elementor.php', 'wpCloud\\StatelessMedia\\Errors' => __DIR__ . '/../..' . '/lib/classes/class-errors.php', 'wpCloud\\StatelessMedia\\FatalException' => __DIR__ . '/../..' . '/lib/classes/exception-fatal.php', 'wpCloud\\StatelessMedia\\GS_Client' => __DIR__ . '/../..' . '/lib/classes/class-gs-client.php', 'wpCloud\\StatelessMedia\\GoogleAppEngine' => __DIR__ . '/../..' . '/lib/classes/compatibility/google-app-engine.php', - 'wpCloud\\StatelessMedia\\GravityForm' => __DIR__ . '/../..' . '/lib/classes/compatibility/gravity-forms.php', - 'wpCloud\\StatelessMedia\\GravityFormSignature' => __DIR__ . '/../..' . '/lib/classes/compatibility/gravity-forms-signature.php', - 'wpCloud\\StatelessMedia\\ICompatibility' => __DIR__ . '/../..' . '/lib/classes/compatibility/ICompatibility.php', 'wpCloud\\StatelessMedia\\Imagify' => __DIR__ . '/../..' . '/lib/classes/compatibility/imagify.php', - 'wpCloud\\StatelessMedia\\LSCacheWP' => __DIR__ . '/../..' . '/lib/classes/compatibility/lite-speed-cache.php', - 'wpCloud\\StatelessMedia\\LearnDash' => __DIR__ . '/../..' . '/lib/classes/compatibility/learn-dash.php', 'wpCloud\\StatelessMedia\\Logger' => __DIR__ . '/../..' . '/lib/classes/class-logger.php', - 'wpCloud\\StatelessMedia\\Module' => __DIR__ . '/../..' . '/lib/classes/class-compatibility.php', - 'wpCloud\\StatelessMedia\\Polylang' => __DIR__ . '/../..' . '/lib/classes/compatibility/polylang-pro.php', + 'wpCloud\\StatelessMedia\\Module' => __DIR__ . '/../..' . '/lib/classes/class-module.php', 'wpCloud\\StatelessMedia\\SOCSS' => __DIR__ . '/../..' . '/lib/classes/compatibility/siteorigin-css.php', 'wpCloud\\StatelessMedia\\SOWidgetCSS' => __DIR__ . '/../..' . '/lib/classes/compatibility/siteorigin-widget-bundle.php', 'wpCloud\\StatelessMedia\\Settings' => __DIR__ . '/../..' . '/lib/classes/class-settings.php', 'wpCloud\\StatelessMedia\\ShortPixel' => __DIR__ . '/../..' . '/lib/classes/compatibility/shortpixel.php', - 'wpCloud\\StatelessMedia\\SimpleLocalAvatars' => __DIR__ . '/../..' . '/lib/classes/compatibility/simple-local-avatars.php', 'wpCloud\\StatelessMedia\\Singleton' => __DIR__ . '/../..' . '/lib/classes/trait-singleton.php', 'wpCloud\\StatelessMedia\\StreamWrapper' => __DIR__ . '/../..' . '/lib/classes/class-gs-stream-wrapper.php', 'wpCloud\\StatelessMedia\\SyncNonMedia' => __DIR__ . '/../..' . '/lib/classes/class-sync-non-media.php', @@ -202,7 +189,6 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'wpCloud\\StatelessMedia\\Sync\\ImageSync' => __DIR__ . '/../..' . '/lib/classes/sync/class-image-sync.php', 'wpCloud\\StatelessMedia\\Sync\\LibrarySync' => __DIR__ . '/../..' . '/lib/classes/sync/class-library-sync.php', 'wpCloud\\StatelessMedia\\Sync\\NonLibrarySync' => __DIR__ . '/../..' . '/lib/classes/sync/class-non-library-sync.php', - 'wpCloud\\StatelessMedia\\TheEventsCalendar' => __DIR__ . '/../..' . '/lib/classes/compatibility/the-events-calendar.php', 'wpCloud\\StatelessMedia\\UnprocessableException' => __DIR__ . '/../..' . '/lib/classes/exception-unprocessable.php', 'wpCloud\\StatelessMedia\\Upgrader' => __DIR__ . '/../..' . '/lib/classes/class-upgrader.php', 'wpCloud\\StatelessMedia\\Utility' => __DIR__ . '/../..' . '/lib/classes/class-utility.php', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 2a09072c9..1a3b3d642 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1,1692 +1,1737 @@ -[ - { - "name": "ccampbell/chromephp", - "version": "4.1.0", - "version_normalized": "4.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/ccampbell/chromephp.git", - "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef", - "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef", - "shasum": "" - }, - "require": { - "php": ">=5.0.0" - }, - "time": "2013-06-26T03:44:33+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-0": { - "ChromePhp": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Craig Campbell", - "email": "iamcraigcampbell@gmail.com", - "homepage": "http://craig.is", - "role": "Developer" - } - ], - "description": "Log variables to the Chrome console (via Chrome Logger Google Chrome extension).", - "homepage": "http://github.com/ccampbell/chromephp", - "keywords": [ - "log", - "logging" - ] - }, - { - "name": "coenjacobs/mozart", - "version": "0.7.1", - "version_normalized": "0.7.1.0", - "source": { - "type": "git", - "url": "https://github.com/coenjacobs/mozart.git", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "shasum": "" - }, - "require": { - "league/flysystem": "^1.0", - "php": "^7.3|^8.0", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "mheap/phpunit-github-actions-printer": "^1.4", - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "time": "2021-02-02T21:37:03+00:00", - "bin": [ - "bin/mozart" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "description": "Composes all dependencies as a package inside a WordPress plugin", - "funding": [ - { - "url": "https://github.com/coenjacobs", - "type": "github" - } - ] - }, - { - "name": "composer/installers", - "version": "v1.12.0", - "version_normalized": "1.12.0.0", - "source": { - "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", - "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.6.* || ^2.0", - "composer/semver": "^1 || ^3", - "phpstan/phpstan": "^0.12.55", - "phpstan/phpstan-phpunit": "^0.12.16", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.3" - }, - "time": "2021-09-13T08:19:44+00:00", - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Installers\\": "src/Composer/Installers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "https://composer.github.io/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Eliasis", - "Hurad", - "ImageCMS", - "Kanboard", - "Lan Management System", - "MODX Evo", - "MantisBT", - "Mautic", - "Maya", - "OXID", - "Plentymarkets", - "Porto", - "RadPHP", - "SMF", - "Starbug", - "Thelia", - "Whmcs", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "attogram", - "bitrix", - "cakephp", - "chef", - "cockpit", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "eZ Platform", - "elgg", - "expressionengine", - "fuelphp", - "grav", - "installer", - "itop", - "joomla", - "known", - "kohana", - "laravel", - "lavalite", - "lithium", - "magento", - "majima", - "mako", - "mediawiki", - "miaoxing", - "modulework", - "modx", - "moodle", - "osclass", - "pantheon", - "phpbb", - "piwik", - "ppi", - "processwire", - "puppet", - "pxcms", - "reindex", - "roundcube", - "shopware", - "silverstripe", - "sydes", - "sylius", - "symfony", - "tastyigniter", - "typo3", - "wordpress", - "yawik", - "zend", - "zikula" - ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ] - }, - { - "name": "deliciousbrains/wp-background-processing", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/deliciousbrains/wp-background-processing.git", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpcompatibility/phpcompatibility-wp": "*", - "phpunit/phpunit": "^8.0", - "spryker/code-sniffer": "^0.17.18", - "wp-coding-standards/wpcs": "^2.3", - "yoast/phpunit-polyfills": "^1.0" - }, - "suggest": { - "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library" - }, - "time": "2023-04-18T12:32:25+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "classes/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Delicious Brains", - "email": "nom@deliciousbrains.com" - } - ], - "description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks." - }, - { - "name": "firebase/php-jwt", - "version": "v6.6.0", - "version_normalized": "6.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5a9cf79b4a2eb347230384648cc7b0d68cd97faa", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa", - "shasum": "" - }, - "require": { - "php": "^7.4||^8.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", - "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" - }, - "time": "2023-06-13T17:11:06+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ] - }, - { - "name": "league/flysystem", - "version": "1.1.10", - "version_normalized": "1.1.10.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "time": "2022-10-04T09:16:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ] - }, - { - "name": "league/mime-type-detection", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" - }, - "time": "2022-04-17T13:12:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ] - }, - { - "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "time": "2021-11-05T16:47:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ] - }, - { - "name": "symfony/console", - "version": "v5.4.24", - "version_normalized": "5.4.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2023-05-26T05:13:16+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.3.0", - "version_normalized": "3.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2023-05-23T14:45:45+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/finder", - "version": "v5.4.21", - "version_normalized": "5.4.21.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2023-02-16T09:33:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" +{ + "packages": [ + { + "name": "ccampbell/chromephp", + "version": "4.1.0", + "version_normalized": "4.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/ccampbell/chromephp.git", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ccampbell/chromephp/zipball/c3c297615d48ae5b2a86a82311152d1ed095fcef", + "reference": "c3c297615d48ae5b2a86a82311152d1ed095fcef", + "shasum": "" + }, + "require": { + "php": ">=5.0.0" + }, + "time": "2013-06-26T03:44:33+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-0": { + "ChromePhp": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Craig Campbell", + "email": "iamcraigcampbell@gmail.com", + "homepage": "http://craig.is", + "role": "Developer" + } + ], + "description": "Log variables to the Chrome console (via Chrome Logger Google Chrome extension).", + "homepage": "http://github.com/ccampbell/chromephp", + "keywords": [ + "log", + "logging" ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + "install-path": "../ccampbell/chromephp" + }, + { + "name": "coenjacobs/mozart", + "version": "0.7.1", + "version_normalized": "0.7.1.0", + "source": { + "type": "git", + "url": "https://github.com/coenjacobs/mozart.git", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", + "shasum": "" + }, + "require": { + "league/flysystem": "^1.0", + "php": "^7.3|^8.0", + "symfony/console": "^4|^5", + "symfony/finder": "^4|^5" + }, + "require-dev": { + "mheap/phpunit-github-actions-printer": "^1.4", + "phpunit/phpunit": "^8.5", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.4" + }, + "time": "2021-02-02T21:37:03+00:00", + "bin": [ + "bin/mozart" ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "CoenJacobs\\Mozart\\": "src/" + } }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" ], - "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" + "authors": [ + { + "name": "Coen Jacobs", + "email": "coenjacobs@gmail.com" + } + ], + "description": "Composes all dependencies as a package inside a WordPress plugin", + "funding": [ + { + "url": "https://github.com/coenjacobs", + "type": "github" + } + ], + "install-path": "../coenjacobs/mozart" + }, + { + "name": "composer/installers", + "version": "v1.12.0", + "version_normalized": "1.12.0.0", + "source": { + "type": "git", + "url": "https://github.com/composer/installers.git", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/service-contracts", - "version": "v3.3.0", - "version_normalized": "3.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "time": "2023-05-23T14:45:45+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "symfony/string", - "version": "v6.3.0", - "version_normalized": "6.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "time": "2023-03-21T21:06:29+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", - "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - }, - { - "name": "udx/lib-settings", - "version": "0.3.0", - "version_normalized": "0.3.0.0", - "source": { - "type": "git", - "url": "git@github.com:udx/lib-settings", - "reference": "0.3.0" - }, - "dist": { - "type": "zip", - "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip", - "reference": "0.3.0" - }, - "require": { - "udx/lib-utility": "~0.3" - }, - "require-dev": { - "justinrainbow/json-schema": "1.1.*" - }, - "type": "library", - "extra": { - "component": { - "scripts": [ - "static/scripts/settings.js" + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0" + }, + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" + }, + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" + }, + "time": "2021-09-13T08:19:44+00:00", + "type": "composer-plugin", + "extra": { + "class": "Composer\\Installers\\Plugin", + "branch-alias": { + "dev-main": "1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Composer\\Installers\\": "src/Composer/Installers" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" + } + ], + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", + "keywords": [ + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "tastyigniter", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" + ], + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "install-path": "./installers" + }, + { + "name": "deliciousbrains/wp-background-processing", + "version": "1.1.0", + "version_normalized": "1.1.0.0", + "source": { + "type": "git", + "url": "https://github.com/deliciousbrains/wp-background-processing.git", + "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", + "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpcompatibility/phpcompatibility-wp": "*", + "phpunit/phpunit": "^8.0", + "spryker/code-sniffer": "^0.17.18", + "wp-coding-standards/wpcs": "^2.3", + "yoast/phpunit-polyfills": "^1.0" + }, + "suggest": { + "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library" + }, + "time": "2023-04-18T12:32:25+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "classmap": [ + "classes/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "Delicious Brains", + "email": "nom@deliciousbrains.com" + } + ], + "description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.", + "install-path": "../deliciousbrains/wp-background-processing" + }, + { + "name": "firebase/php-jwt", + "version": "v6.6.0", + "version_normalized": "6.6.0.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5a9cf79b4a2eb347230384648cc7b0d68cd97faa", + "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "time": "2023-06-13T17:11:06+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "install-path": "../firebase/php-jwt" + }, + { + "name": "league/flysystem", + "version": "1.1.10", + "version_normalized": "1.1.10.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/flysystem.git", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "league/mime-type-detection": "^1.3", + "php": "^7.2.5 || ^8.0" + }, + "conflict": { + "league/flysystem-sftp": "<1.0.6" + }, + "require-dev": { + "phpspec/prophecy": "^1.11.1", + "phpunit/phpunit": "^8.5.8" + }, + "suggest": { + "ext-ftp": "Allows you to use FTP server storage", + "ext-openssl": "Allows you to use FTPS server storage", + "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", + "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", + "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", + "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", + "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", + "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", + "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", + "league/flysystem-webdav": "Allows you to use WebDAV storage", + "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", + "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", + "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" + }, + "time": "2022-10-04T09:16:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\Flysystem\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Filesystem abstraction: Many filesystems, one API.", + "keywords": [ + "Cloud Files", + "WebDAV", + "abstraction", + "aws", + "cloud", + "copy.com", + "dropbox", + "file systems", + "files", + "filesystem", + "filesystems", + "ftp", + "rackspace", + "remote", + "s3", + "sftp", + "storage" + ], + "funding": [ + { + "url": "https://offset.earth/frankdejonge", + "type": "other" + } + ], + "install-path": "../league/flysystem" + }, + { + "name": "league/mime-type-detection", + "version": "1.11.0", + "version_normalized": "1.11.0.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/mime-type-detection.git", + "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "shasum": "" + }, + "require": { + "ext-fileinfo": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "phpstan/phpstan": "^0.12.68", + "phpunit/phpunit": "^8.5.8 || ^9.3" + }, + "time": "2022-04-17T13:12:02+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "League\\MimeTypeDetection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frankdejonge.nl" + } + ], + "description": "Mime-type detection for Flysystem", + "funding": [ + { + "url": "https://github.com/frankdejonge", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/league/flysystem", + "type": "tidelift" + } + ], + "install-path": "../league/mime-type-detection" + }, + { + "name": "psr/container", + "version": "2.0.2", + "version_normalized": "2.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "time": "2021-11-05T16:47:00+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "install-path": "../psr/container" + }, + { + "name": "symfony/console", + "version": "v5.4.24", + "version_normalized": "5.4.24.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/polyfill-php73": "^1.9", + "symfony/polyfill-php80": "^1.16", + "symfony/service-contracts": "^1.1|^2|^3", + "symfony/string": "^5.1|^6.0" + }, + "conflict": { + "psr/log": ">=3", + "symfony/dependency-injection": "<4.4", + "symfony/dotenv": "<5.1", + "symfony/event-dispatcher": "<4.4", + "symfony/lock": "<4.4", + "symfony/process": "<4.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0" + }, + "require-dev": { + "psr/log": "^1|^2", + "symfony/config": "^4.4|^5.0|^6.0", + "symfony/dependency-injection": "^4.4|^5.0|^6.0", + "symfony/event-dispatcher": "^4.4|^5.0|^6.0", + "symfony/lock": "^4.4|^5.0|^6.0", + "symfony/process": "^4.4|^5.0|^6.0", + "symfony/var-dumper": "^4.4|^5.0|^6.0" + }, + "suggest": { + "psr/log": "For using the console logger", + "symfony/event-dispatcher": "", + "symfony/lock": "", + "symfony/process": "" + }, + "time": "2023-05-26T05:13:16+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/console" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", + "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "time": "2023-05-23T14:45:45+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/finder", + "version": "v5.4.21", + "version_normalized": "5.4.21.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", + "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "shasum": "" + }, + "require": { + "php": ">=7.2.5", + "symfony/deprecation-contracts": "^2.1|^3", + "symfony/polyfill-php80": "^1.16" + }, + "time": "2023-02-16T09:33:00+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/finder" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", + "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" ], - "templates": [ - "static/views/new-installation.xhtml" + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-ctype" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", + "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-grapheme" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { "files": [ - "static/schemas/settings.json" + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" ] }, - "installer-name": "lib-settings" - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "lib" - ] - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Andy Potanin", - "email": "andy.potanin@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - }, - { - "name": "Maxim Peshkov", - "email": "maxim.peshkov@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - }, - { - "name": "Anton Korotkov", - "email": "anton.korotkov@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - } - ], - "homepage": "https://github.com/udx/lib-settings", - "keywords": [ - "settings" - ] - }, - { - "name": "udx/lib-ud-api-client", - "version": "1.2.1", - "version_normalized": "1.2.1.0", - "source": { - "type": "git", - "url": "git@github.com:udx/lib-ud-api-client", - "reference": "1.2.1" - }, - "dist": { - "type": "zip", - "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip", - "reference": "1.2.1" - }, - "require": { - "php": ">=5.3" - }, - "type": "library", - "extra": { - "installer-name": "lib-ud-api-client" - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "lib/classes" - ] - }, - "license": [ - "GPLv2" - ], - "authors": [ - { - "name": "UsabilityDynamics, Inc.", - "homepage": "https://www.usabilitydynamics.com" - } - ], - "description": "UD API Client for WooCommerce API Manager", - "homepage": "https://github.com/udx/lib-ud-api-client", - "keywords": [ - "api", - "client", - "licenses", - "plugins", - "wordpress" - ] - }, - { - "name": "udx/lib-utility", - "version": "0.4.0", - "version_normalized": "0.4.0.0", - "source": { - "type": "git", - "url": "git@github.com:udx/lib-utility", - "reference": "0.4.0" - }, - "dist": { - "type": "zip", - "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip", - "reference": "0.4.0" - }, - "require-dev": { - "phpunit/phpunit": "4.1.*" - }, - "type": "library", - "extra": { - "installer-name": "lib-utility", - "component": { - "name": "utility", - "scripts": [ - "scripts/*.js" + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-intl-normalizer" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-mbstring" + }, + { + "name": "symfony/polyfill-php73", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php73.git", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php73\\": "" + }, + "classmap": [ + "Resources/stubs" ] - } - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "lib" - ] - }, - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Andy Potanin", - "email": "andy.potanin@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - }, - { - "name": "Maxim Peshkov", - "email": "maxim.peshkov@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - }, - { - "name": "Anton Korotkov", - "email": "anton.korotkov@usabilitydynamics.com", - "homepage": "https://www.usabilitydynamics.com", - "role": "Developer" - } - ], - "keywords": [ - "job", - "process", - "utility" - ] - }, - { - "name": "udx/lib-wp-bootstrap", - "version": "1.3.0", - "version_normalized": "1.3.0.0", - "source": { - "type": "git", - "url": "git@github.com:udx/lib-wp-bootstrap", - "reference": "1.3.0" - }, - "dist": { - "type": "zip", - "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip", - "reference": "1.3.0" - }, - "require": { - "php": ">=5.3", - "udx/lib-utility": "~0.3" - }, - "type": "library", - "extra": { - "installer-name": "lib-wp-bootstrap" - }, - "installation-source": "dist", - "autoload": { - "classmap": [ - "lib/classes" - ] - }, - "license": [ - "MIT" - ], - "description": "Wordpress bootstrap library created by UsabilityDynamics", - "homepage": "https://github.com/udx/lib-wp-bootstrap", - "keywords": [ - "wordpress" - ] - }, - { - "name": "wpmetabox/meta-box", - "version": "5.6.3", - "version_normalized": "5.6.3.0", - "source": { - "type": "git", - "url": "https://github.com/wpmetabox/meta-box.git", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c2c4a30ed70163dfdfe93f2865e88a7a45c46856", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856", - "shasum": "" - }, - "time": "2022-04-18T03:20:58+00:00", - "type": "wordpress-plugin", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0" - ], - "authors": [ - { - "name": "Tran Ngoc Tuan Anh", - "email": "anhtnt@elightup.com", - "homepage": "https://metabox.io", - "role": "Developer" - } - ], - "description": "A powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress websites.", - "homepage": "https://metabox.io", - "keywords": [ - "custom-field", - "meta-box", - "select2", - "ui", - "wordpress", - "wordpress-plugin", - "wp-admin" - ] - } -] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php73" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.27.0", + "version_normalized": "1.27.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2022-11-03T14:55:06+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.27-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php80" + }, + { + "name": "symfony/service-contracts", + "version": "v3.3.0", + "version_normalized": "3.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^2.0" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "time": "2023-05-23T14:45:45+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.4-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/service-contracts" + }, + { + "name": "symfony/string", + "version": "v6.3.0", + "version_normalized": "6.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.0", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/error-handler": "^5.4|^6.0", + "symfony/http-client": "^5.4|^6.0", + "symfony/intl": "^6.2", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^5.4|^6.0" + }, + "time": "2023-03-21T21:06:29+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/string" + }, + { + "name": "udx/lib-settings", + "version": "0.3.0", + "version_normalized": "0.3.0.0", + "source": { + "type": "git", + "url": "git@github.com:udx/lib-settings", + "reference": "0.3.0" + }, + "dist": { + "type": "zip", + "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip", + "reference": "0.3.0" + }, + "require": { + "udx/lib-utility": "~0.3" + }, + "require-dev": { + "justinrainbow/json-schema": "1.1.*" + }, + "type": "library", + "extra": { + "component": { + "scripts": [ + "static/scripts/settings.js" + ], + "templates": [ + "static/views/new-installation.xhtml" + ], + "files": [ + "static/schemas/settings.json" + ] + }, + "installer-name": "lib-settings" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andy Potanin", + "email": "andy.potanin@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + }, + { + "name": "Maxim Peshkov", + "email": "maxim.peshkov@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + }, + { + "name": "Anton Korotkov", + "email": "anton.korotkov@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + } + ], + "homepage": "https://github.com/udx/lib-settings", + "keywords": [ + "settings" + ], + "install-path": "../udx/lib-settings" + }, + { + "name": "udx/lib-ud-api-client", + "version": "1.2.1", + "version_normalized": "1.2.1.0", + "source": { + "type": "git", + "url": "git@github.com:udx/lib-ud-api-client", + "reference": "1.2.1" + }, + "dist": { + "type": "zip", + "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip", + "reference": "1.2.1" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "extra": { + "installer-name": "lib-ud-api-client" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib/classes" + ] + }, + "license": [ + "GPLv2" + ], + "authors": [ + { + "name": "UsabilityDynamics, Inc.", + "homepage": "https://www.usabilitydynamics.com" + } + ], + "description": "UD API Client for WooCommerce API Manager", + "homepage": "https://github.com/udx/lib-ud-api-client", + "keywords": [ + "api", + "client", + "licenses", + "plugins", + "wordpress" + ], + "install-path": "../udx/lib-ud-api-client" + }, + { + "name": "udx/lib-utility", + "version": "0.4.0", + "version_normalized": "0.4.0.0", + "source": { + "type": "git", + "url": "git@github.com:udx/lib-utility", + "reference": "0.4.0" + }, + "dist": { + "type": "zip", + "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip", + "reference": "0.4.0" + }, + "require-dev": { + "phpunit/phpunit": "4.1.*" + }, + "type": "library", + "extra": { + "installer-name": "lib-utility", + "component": { + "name": "utility", + "scripts": [ + "scripts/*.js" + ] + } + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib" + ] + }, + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andy Potanin", + "email": "andy.potanin@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + }, + { + "name": "Maxim Peshkov", + "email": "maxim.peshkov@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + }, + { + "name": "Anton Korotkov", + "email": "anton.korotkov@usabilitydynamics.com", + "homepage": "https://www.usabilitydynamics.com", + "role": "Developer" + } + ], + "keywords": [ + "job", + "process", + "utility" + ], + "install-path": "../udx/lib-utility" + }, + { + "name": "udx/lib-wp-bootstrap", + "version": "1.3.0", + "version_normalized": "1.3.0.0", + "source": { + "type": "git", + "url": "git@github.com:udx/lib-wp-bootstrap", + "reference": "1.3.0" + }, + "dist": { + "type": "zip", + "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip", + "reference": "1.3.0" + }, + "require": { + "php": ">=5.3", + "udx/lib-utility": "~0.3" + }, + "type": "library", + "extra": { + "installer-name": "lib-wp-bootstrap" + }, + "installation-source": "dist", + "autoload": { + "classmap": [ + "lib/classes" + ] + }, + "license": [ + "MIT" + ], + "description": "Wordpress bootstrap library created by UsabilityDynamics", + "homepage": "https://github.com/udx/lib-wp-bootstrap", + "keywords": [ + "wordpress" + ], + "install-path": "../udx/lib-wp-bootstrap" + }, + { + "name": "wpmetabox/meta-box", + "version": "5.6.3", + "version_normalized": "5.6.3.0", + "source": { + "type": "git", + "url": "https://github.com/wpmetabox/meta-box.git", + "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c2c4a30ed70163dfdfe93f2865e88a7a45c46856", + "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856", + "shasum": "" + }, + "time": "2022-04-18T03:20:58+00:00", + "type": "wordpress-plugin", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "GPL-2.0" + ], + "authors": [ + { + "name": "Tran Ngoc Tuan Anh", + "email": "anhtnt@elightup.com", + "homepage": "https://metabox.io", + "role": "Developer" + } + ], + "description": "A powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress websites.", + "homepage": "https://metabox.io", + "keywords": [ + "custom-field", + "meta-box", + "select2", + "ui", + "wordpress", + "wordpress-plugin", + "wp-admin" + ], + "install-path": "../../wp-content/plugins/meta-box" + } + ], + "dev": true, + "dev-package-names": [ + "coenjacobs/mozart", + "deliciousbrains/wp-background-processing", + "league/flysystem", + "league/mime-type-detection", + "psr/container", + "symfony/console", + "symfony/deprecation-contracts", + "symfony/finder", + "symfony/polyfill-ctype", + "symfony/polyfill-intl-grapheme", + "symfony/polyfill-intl-normalizer", + "symfony/polyfill-mbstring", + "symfony/polyfill-php73", + "symfony/polyfill-php80", + "symfony/service-contracts", + "symfony/string" + ] +} diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php new file mode 100644 index 000000000..956594363 --- /dev/null +++ b/vendor/composer/installed.php @@ -0,0 +1,257 @@ + array( + 'name' => 'wpcloud/wp-stateless', + 'pretty_version' => 'dev-latest', + 'version' => 'dev-latest', + 'reference' => 'e250b94bb16b40d6333182bd18f2e52c4058d34d', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => true, + ), + 'versions' => array( + 'ccampbell/chromephp' => array( + 'pretty_version' => '4.1.0', + 'version' => '4.1.0.0', + 'reference' => 'c3c297615d48ae5b2a86a82311152d1ed095fcef', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ccampbell/chromephp', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'coenjacobs/mozart' => array( + 'pretty_version' => '0.7.1', + 'version' => '0.7.1.0', + 'reference' => 'dbcdeb992d20d9c8914eef090f9a0d684bb1102c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../coenjacobs/mozart', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'composer/installers' => array( + 'pretty_version' => 'v1.12.0', + 'version' => '1.12.0.0', + 'reference' => 'd20a64ed3c94748397ff5973488761b22f6d3f19', + 'type' => 'composer-plugin', + 'install_path' => __DIR__ . '/./installers', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'deliciousbrains/wp-background-processing' => array( + 'pretty_version' => '1.1.0', + 'version' => '1.1.0.0', + 'reference' => 'd5ef95cecba7f792ddca3e3bd70ebfb90dc4996d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../deliciousbrains/wp-background-processing', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'firebase/php-jwt' => array( + 'pretty_version' => 'v6.6.0', + 'version' => '6.6.0.0', + 'reference' => '5a9cf79b4a2eb347230384648cc7b0d68cd97faa', + 'type' => 'library', + 'install_path' => __DIR__ . '/../firebase/php-jwt', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'league/flysystem' => array( + 'pretty_version' => '1.1.10', + 'version' => '1.1.10.0', + 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../league/flysystem', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'league/mime-type-detection' => array( + 'pretty_version' => '1.11.0', + 'version' => '1.11.0.0', + 'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd', + 'type' => 'library', + 'install_path' => __DIR__ . '/../league/mime-type-detection', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'psr/container' => array( + 'pretty_version' => '2.0.2', + 'version' => '2.0.2.0', + 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/container', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'psr/log-implementation' => array( + 'dev_requirement' => true, + 'provided' => array( + 0 => '1.0|2.0', + ), + ), + 'roundcube/plugin-installer' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '*', + ), + ), + 'shama/baton' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '*', + ), + ), + 'symfony/console' => array( + 'pretty_version' => 'v5.4.24', + 'version' => '5.4.24.0', + 'reference' => '560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/console', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', + 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/finder' => array( + 'pretty_version' => 'v5.4.21', + 'version' => '5.4.21.0', + 'reference' => '078e9a5e1871fcfe6a5ce421b539344c21afef19', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/finder', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-ctype' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-intl-grapheme' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-intl-normalizer' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-mbstring' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-php73' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php73', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/polyfill-php80' => array( + 'pretty_version' => 'v1.27.0', + 'version' => '1.27.0.0', + 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php80', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/service-contracts' => array( + 'pretty_version' => 'v3.3.0', + 'version' => '3.3.0.0', + 'reference' => '40da9cc13ec349d9e4966ce18b5fbcd724ab10a4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/service-contracts', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'symfony/string' => array( + 'pretty_version' => 'v6.3.0', + 'version' => '6.3.0.0', + 'reference' => 'f2e190ee75ff0f5eced645ec0be5c66fac81f51f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/string', + 'aliases' => array(), + 'dev_requirement' => true, + ), + 'udx/lib-settings' => array( + 'pretty_version' => '0.3.0', + 'version' => '0.3.0.0', + 'reference' => '0.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../udx/lib-settings', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'udx/lib-ud-api-client' => array( + 'pretty_version' => '1.2.1', + 'version' => '1.2.1.0', + 'reference' => '1.2.1', + 'type' => 'library', + 'install_path' => __DIR__ . '/../udx/lib-ud-api-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'udx/lib-utility' => array( + 'pretty_version' => '0.4.0', + 'version' => '0.4.0.0', + 'reference' => '0.4.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../udx/lib-utility', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'udx/lib-wp-bootstrap' => array( + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'reference' => '1.3.0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../udx/lib-wp-bootstrap', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wpcloud/wp-stateless' => array( + 'pretty_version' => 'dev-latest', + 'version' => 'dev-latest', + 'reference' => 'e250b94bb16b40d6333182bd18f2e52c4058d34d', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'wpmetabox/meta-box' => array( + 'pretty_version' => '5.6.3', + 'version' => '5.6.3.0', + 'reference' => 'c2c4a30ed70163dfdfe93f2865e88a7a45c46856', + 'type' => 'wordpress-plugin', + 'install_path' => __DIR__ . '/../../wp-content/plugins/meta-box', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 000000000..580fa9609 --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70400)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.4.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} From c50d3c2204db76a5a20022b55fab0a30fa33bca6 Mon Sep 17 00:00:00 2001 From: balexey88 Date: Tue, 24 Oct 2023 20:44:59 +0300 Subject: [PATCH 03/53] #2 fix install path for metabox --- composer.json | 3 +++ vendor/composer/installed.json | 2 +- vendor/composer/installed.php | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index 97c1543ea..345c7ab8a 100644 --- a/composer.json +++ b/composer.json @@ -87,6 +87,9 @@ }, "product": false } + }, + "installer-paths": { + "vendor/wpmetabox/meta-box": ["wpmetabox/meta-box"] } }, "require-dev": { diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 1a3b3d642..d1abce28a 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1712,7 +1712,7 @@ "wordpress-plugin", "wp-admin" ], - "install-path": "../../wp-content/plugins/meta-box" + "install-path": "../wpmetabox/meta-box" } ], "dev": true, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 956594363..301196736 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'wpcloud/wp-stateless', 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => 'e250b94bb16b40d6333182bd18f2e52c4058d34d', + 'reference' => '642420f5fd4f9c33c4e07bc1de46107e7d2108ad', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -238,7 +238,7 @@ 'wpcloud/wp-stateless' => array( 'pretty_version' => 'dev-latest', 'version' => 'dev-latest', - 'reference' => 'e250b94bb16b40d6333182bd18f2e52c4058d34d', + 'reference' => '642420f5fd4f9c33c4e07bc1de46107e7d2108ad', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -249,7 +249,7 @@ 'version' => '5.6.3.0', 'reference' => 'c2c4a30ed70163dfdfe93f2865e88a7a45c46856', 'type' => 'wordpress-plugin', - 'install_path' => __DIR__ . '/../../wp-content/plugins/meta-box', + 'install_path' => __DIR__ . '/../wpmetabox/meta-box', 'aliases' => array(), 'dev_requirement' => false, ), From c7cda276a472b6e6b16d7cb287bfb39c21e7d56d Mon Sep 17 00:00:00 2001 From: nitin-pandita Date: Fri, 27 Oct 2023 14:55:41 +0530 Subject: [PATCH 04/53] Fixed the typo in the readme --- readme.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/readme.md b/readme.md index 8d79a50d5..dbb1f74b1 100644 --- a/readme.md +++ b/readme.md @@ -2,19 +2,19 @@ ## Description -Upload and serve your WordPress media from Google Cloud Storage (GCS) with the WP-Stateless plugin. In as little as two minutes, you will be benefitting from serving your media from Google Cloud's distributed servers. +Upload and serve your WordPress media from Google Cloud Storage (GCS) with the WP-Stateless plugin. In as little as two minutes, you will be benefiting from serving your media from Google Cloud's distributed servers. New to Google Cloud? Google is offering you a [$300 credit](https://console.cloud.google.com/freetrial?referralId=e1c28cf728ff49b38d4eb5add3f5bfc8) to get you started. ### Benefits * Store and deliver media files on Google Cloud Storage instead of your server. * Google Cloud Storage is geo-redundant, meaning your media is delivered by the closest server - reducing latency and improving page speed. -* Scale your WordPress website across multiple servers without the need of synchronizing media files. +* Scale your WordPress website across multiple servers without the need for synchronizing media files. * Native integration between Google Cloud Storage and WordPress. * $300 free trial from Google Cloud. Nice! ### Modes -* Backup - Upload media files to Google Storage and serve local file urls. +* Backup - Upload media files to Google Storage and serve local file URLs. * CDN - Copy media files to Google Storage and serve them directly from there. * Ephemeral - Store and serve media files with Google Cloud Storage only. Media files are not stored locally, but local storage is used temporarily for processing and is required for certain compatibilities. * Stateless - Store and serve media files with Google Cloud Storage only. Media files are not stored locally. @@ -22,7 +22,7 @@ New to Google Cloud? Google is offering you a [$300 credit](https://console.clou ### Features * Setup assistant makes getting started fast and easy. * No need to manually create service accounts or buckets - handled automatically. -* Settings panel provides you with further GCS configuration and file url customization. +* Settings panel provides you with further GCS configuration and file URL customization. * Mask the default GCS URL with your own custom domain. * Automatically replace hardcoded media URLs with GCS equivalents in post editor and meta. * Batch image thumbnail regeneration. @@ -43,9 +43,9 @@ Looking for a unique feature for your next project? [Hire us!](https://udx.io/) 1. Search, install, and activate the *WP-Stateless* plugin via your WordPress dashboard. 2. Begin WP-Stateless setup assistant at *Media > Stateless Setup* and click "Get Started Now." -3. Click "Google Login" and sign-in with your Google account. +3. Click "Google Login" and sign in with your Google account. 4. Set a Google Cloud Project, Google Cloud Storage Bucket, and Google Cloud Billing Account and click "Continue." -5. Installation and setup is now complete. Visit *Media > Stateless Settings* for more options. +5. Installation and setup are now complete. Visit *Media > Stateless Settings* for more options. For a more detailed installation and setup walkthrough, please see the [manual setup instructions on Github](https://wp-stateless.github.io/docs/manual-setup/). @@ -79,4 +79,4 @@ To ensure new releases cause as little disruption as possible, we rely on a numb ### Who maintains this plugin? -[UDX](https://udx.io/) maintains this plugin by continuing development through it's own staff, reviewing pull requests, testing, and steering the overall release schedule. UDX is located in Durham, North Carolina and provides WordPress engineering and hosting services to clients throughout the United States. +[UDX](https://udx.io/) maintains this plugin by continuing development through its own staff, reviewing pull requests, testing, and steering the overall release schedule. UDX is located in Durham, North Carolina, and provides WordPress engineering and hosting services to clients throughout the United States. From a65b00d5816f9ff7834e1bdecce520e30c49f67b Mon Sep 17 00:00:00 2001 From: balexey88 Date: Tue, 14 Nov 2023 17:02:30 +0200 Subject: [PATCH 05/53] Update libraries. Remove Compatibilities (moved to external addons). Addon compatibilities are enabled by default. Update changlogs and readmes. Dynamic image support is part of the core. Google App Engine compatibility is part of the core. Fix issue with Image upload in Statless mode on Google App Engine. Fix - prevent dulicating messages in Admin Panel. Fix - 'View stateless meta' link remove when not in Media Library. --- changelog.txt | 20 + changes.md | 22 +- composer.json | 2 +- composer.lock | 279 +- lib/Google/CHANGELOG.md | 7 + lib/Google/CODE_OF_CONDUCT.md | 43 + lib/Google/README.md | 9 +- lib/Google/UPGRADING.md | 377 + lib/Google/composer.json | 19 +- lib/Google/composer.lock | 977 +- lib/Google/phpstan.neon.dist | 5 + lib/Google/vendor/autoload.php | 20 +- lib/Google/vendor/bin/google-cloud-batch | 120 +- lib/Google/vendor/composer/ClassLoader.php | 202 +- .../vendor/composer/InstalledVersions.php | 359 + .../vendor/composer/autoload_classmap.php | 5 +- lib/Google/vendor/composer/autoload_files.php | 7 +- .../vendor/composer/autoload_namespaces.php | 2 +- lib/Google/vendor/composer/autoload_psr4.php | 5 +- lib/Google/vendor/composer/autoload_real.php | 57 +- .../vendor/composer/autoload_static.php | 34 +- lib/Google/vendor/composer/installed.json | 3333 ++++--- lib/Google/vendor/composer/installed.php | 269 + lib/Google/vendor/composer/platform_check.php | 26 + .../vendor/firebase/php-jwt/CHANGELOG.md | 46 + lib/Google/vendor/firebase/php-jwt/README.md | 11 +- .../php-jwt/src/BeforeValidException.php | 13 +- .../firebase/php-jwt/src/CachedKeySet.php | 10 + .../firebase/php-jwt/src/ExpiredException.php | 13 +- .../vendor/firebase/php-jwt/src/JWK.php | 32 +- .../vendor/firebase/php-jwt/src/JWT.php | 48 +- .../src/JWTExceptionWithPayloadInterface.php | 20 + .../vendor/google/apiclient-services/LICENSE | 203 + .../google/apiclient-services/README.md | 17 + .../google/apiclient-services/SECURITY.md | 7 + .../google/apiclient-services/autoload.php | 36 + .../google/apiclient-services/composer.json | 27 + .../apiclient-services/src}/Storage.php | 417 +- .../src/Storage/AnywhereCache.php | 224 + .../src/Storage/AnywhereCaches.php | 79 + .../src}/Storage/Bucket.php | 32 + .../src}/Storage/BucketAccessControl.php | 0 .../BucketAccessControlProjectTeam.php | 0 .../src}/Storage/BucketAccessControls.php | 0 .../src}/Storage/BucketAutoclass.php | 36 + .../src}/Storage/BucketBilling.php | 0 .../src}/Storage/BucketCors.php | 0 .../Storage/BucketCustomPlacementConfig.php | 0 .../src}/Storage/BucketEncryption.php | 0 .../src}/Storage/BucketIamConfiguration.php | 0 ...BucketIamConfigurationBucketPolicyOnly.php | 0 ...mConfigurationUniformBucketLevelAccess.php | 0 .../src}/Storage/BucketLifecycle.php | 0 .../src}/Storage/BucketLifecycleRule.php | 0 .../Storage/BucketLifecycleRuleAction.php | 0 .../Storage/BucketLifecycleRuleCondition.php | 0 .../src}/Storage/BucketLogging.php | 0 .../src/Storage/BucketObjectRetention.php | 44 + .../src}/Storage/BucketOwner.php | 0 .../src}/Storage/BucketRetentionPolicy.php | 0 .../src/Storage/BucketSoftDeletePolicy.php | 62 + .../src}/Storage/BucketVersioning.php | 0 .../src}/Storage/BucketWebsite.php | 0 .../src}/Storage/Buckets.php | 0 .../src/Storage/BulkRestoreObjectsRequest.php | 117 + .../src}/Storage/Channel.php | 0 .../src}/Storage/ComposeRequest.php | 0 .../Storage/ComposeRequestSourceObjects.php | 0 ...equestSourceObjectsObjectPreconditions.php | 0 .../apiclient-services/src}/Storage/Expr.php | 0 ...oogleLongrunningListOperationsResponse.php | 61 + .../Storage/GoogleLongrunningOperation.php | 114 + .../src/Storage/GoogleRpcStatus.php | 81 + .../src}/Storage/HmacKey.php | 0 .../src}/Storage/HmacKeyMetadata.php | 0 .../src}/Storage/HmacKeysMetadata.php | 0 .../src/Storage/ManagedFolder.php | 170 + .../src/Storage/ManagedFolders.php | 79 + .../src}/Storage/Notification.php | 0 .../src}/Storage/Notifications.php | 0 .../src}/Storage/ObjectAccessControl.php | 0 .../ObjectAccessControlProjectTeam.php | 0 .../src}/Storage/ObjectAccessControls.php | 0 .../src}/Storage/Objects.php | 0 .../src}/Storage/Policy.php | 0 .../src}/Storage/PolicyBindings.php | 0 .../src/Storage/Resource/AnywhereCache.php | 142 + .../Storage/Resource/BucketAccessControls.php | 0 .../src}/Storage/Resource/Buckets.php | 2 + .../src}/Storage/Resource/Channels.php | 0 .../Resource/DefaultObjectAccessControls.php | 2 +- .../src/Storage/Resource/ManagedFolders.php | 171 + .../src}/Storage/Resource/Notifications.php | 0 .../Storage/Resource/ObjectAccessControls.php | 18 +- .../src}/Storage/Resource/Objects.php | 117 +- .../src/Storage/Resource/Operations.php | 88 + .../src}/Storage/Resource/Projects.php | 0 .../Storage/Resource/ProjectsHmacKeys.php | 0 .../Resource/ProjectsServiceAccount.php | 0 .../src}/Storage/RewriteResponse.php | 0 .../src}/Storage/ServiceAccount.php | 0 .../src}/Storage/StorageObject.php | 52 + .../StorageObjectCustomerEncryption.php | 0 .../src}/Storage/StorageObjectOwner.php | 0 .../src/Storage/StorageObjectRetention.php | 62 + .../Storage/TestIamPermissionsResponse.php | 0 lib/Google/vendor/google/auth/composer.json | 4 +- .../vendor/google/auth/src/AccessToken.php | 34 +- .../src/CredentialSource/AwsNativeSource.php | 360 + .../auth/src/CredentialSource/FileSource.php | 75 + .../auth/src/CredentialSource/UrlSource.php | 97 + .../ExternalAccountCredentials.php | 241 + .../auth/src/Credentials/GCECredentials.php | 21 + .../ImpersonatedServiceAccountCredentials.php | 34 +- .../google/auth/src/CredentialsLoader.php | 48 +- ...ternalAccountCredentialSourceInterface.php | 23 + lib/Google/vendor/google/auth/src/OAuth2.php | 118 +- .../google/auth/src/UpdateMetadataTrait.php | 66 + .../google/cloud-core/.repo-metadata.json | 1 + lib/Google/vendor/google/cloud-core/VERSION | 2 +- .../vendor/google/cloud-core/composer.json | 8 +- .../cloud-core/src/Batch/BatchTrait.php | 2 +- .../src/Batch/HandleFailureTrait.php | 2 +- .../src/Batch/InMemoryConfigStorage.php | 5 +- .../cloud-core/src/Batch/InterruptTrait.php | 3 +- .../src/Batch/QueueOverflowException.php | 2 +- .../google/cloud-core/src/Batch/Retry.php | 5 + .../src/Batch/SerializableClientTrait.php | 2 +- .../cloud-core/src/Batch/SimpleJobTrait.php | 2 +- .../cloud-core/src/ExponentialBackoff.php | 2 +- .../cloud-core/src/GrpcRequestWrapper.php | 2 +- .../vendor/google/cloud-core/src/Iam/Iam.php | 6 +- .../cloud-core/src/LongRunning/LROTrait.php | 3 + .../LongRunningConnectionInterface.php | 1 + .../src/LongRunning/LongRunningOperation.php | 3 + .../src/Report/EmptyMetadataProvider.php | 3 +- .../src/Report/GAEMetadataProvider.php | 3 +- .../src/Report/MetadataProviderInterface.php | 3 +- .../src/Report/SimpleMetadataProvider.php | 3 +- .../google/cloud-core/src/RequestWrapper.php | 3 +- .../vendor/google/cloud-core/src/Retry.php | 2 +- .../google/cloud-core/src/ServiceBuilder.php | 30 +- .../cloud-core/src/Testing/TestHelpers.php | 4 +- .../src/Upload/ResumableUploader.php | 6 +- .../google/cloud-storage/.repo-metadata.json | 1 + .../vendor/google/cloud-storage/VERSION | 2 +- .../vendor/google/cloud-storage/composer.json | 3 +- .../vendor/google/cloud-storage/src/Acl.php | 27 +- .../google/cloud-storage/src/Bucket.php | 47 +- .../src/Connection/ConnectionInterface.php | 2 + .../src/Connection/IamBucket.php | 2 + .../cloud-storage/src/Connection/Rest.php | 25 +- .../ServiceDefinition/storage-v1.json | 8749 +++++++++-------- .../google/cloud-storage/src/HmacKey.php | 5 +- .../google/cloud-storage/src/Lifecycle.php | 4 +- .../google/cloud-storage/src/Notification.php | 6 +- .../cloud-storage/src/ObjectIterator.php | 4 +- .../cloud-storage/src/ObjectPageIterator.php | 4 +- .../google/cloud-storage/src/ReadStream.php | 6 +- .../cloud-storage/src/SigningHelper.php | 21 +- .../cloud-storage/src/StorageClient.php | 16 +- .../cloud-storage/src/StorageObject.php | 28 +- .../google/cloud-storage/src/WriteStream.php | 8 +- .../google/crc32/.github/workflows/test.yml | 45 - lib/Google/vendor/google/crc32/.gitignore | 6 - .../vendor/google/crc32/CONTRIBUTING.md | 28 - lib/Google/vendor/google/crc32/LICENSE | 201 - lib/Google/vendor/google/crc32/Makefile | 71 - lib/Google/vendor/google/crc32/README.md | 138 - lib/Google/vendor/google/crc32/composer.json | 25 - .../vendor/google/crc32/crc32_benchmark.php | 112 - lib/Google/vendor/google/crc32/ext/.gitignore | 35 - lib/Google/vendor/google/crc32/ext/config.m4 | 63 - .../vendor/google/crc32/ext/hash_crc32c.c | 75 - .../vendor/google/crc32/ext/install_crc32c.sh | 34 - .../vendor/google/crc32/ext/php_crc32c.c | 174 - .../vendor/google/crc32/ext/php_crc32c.h | 53 - .../google/crc32/ext/tests/001_loaded.phpt | 14 - .../google/crc32/ext/tests/002_basic.phpt | 93 - .../google/crc32/ext/tests/003_extend.phpt | 47 - .../google/crc32/ext/tests/004_error.phpt | 36 - .../google/crc32/ext/tests/005_hash.phpt | 22 - .../google/crc32/ext/tests/006_serialize.phpt | 26 - .../vendor/google/crc32/src/Builtin.php | 88 - lib/Google/vendor/google/crc32/src/CRC32.php | 112 - .../vendor/google/crc32/src/CRCInterface.php | 59 - .../vendor/google/crc32/src/CRCTrait.php | 54 - lib/Google/vendor/google/crc32/src/Google.php | 69 - lib/Google/vendor/google/crc32/src/PHP.php | 80 - .../vendor/google/crc32/src/PHPSlicedBy4.php | 108 - lib/Google/vendor/google/crc32/src/Table.php | 113 - .../vendor/google/crc32/tests/BuiltinTest.php | 50 - .../vendor/google/crc32/tests/CRC32Test.php | 158 - .../google/crc32/tests/DataIterator.php | 204 - .../vendor/google/crc32/tests/GoogleTest.php | 56 - .../vendor/guzzlehttp/guzzle/CHANGELOG.md | 15 + .../vendor/guzzlehttp/guzzle/UPGRADING.md | 2 +- .../vendor/guzzlehttp/guzzle/composer.json | 4 +- .../vendor/guzzlehttp/guzzle/src/Client.php | 2 +- .../guzzlehttp/guzzle/src/ClientInterface.php | 2 +- .../guzzle/src/Cookie/CookieJar.php | 38 +- .../guzzle/src/Cookie/CookieJarInterface.php | 3 +- .../guzzle/src/Handler/CurlFactory.php | 18 +- .../guzzle/src/Handler/CurlMultiHandler.php | 10 +- .../guzzlehttp/guzzle/src/HandlerStack.php | 4 +- .../guzzle/src/MessageFormatter.php | 2 +- .../guzzle/src/MessageFormatterInterface.php | 2 +- .../guzzle/src/RedirectMiddleware.php | 4 +- .../guzzlehttp/guzzle/src/TransferStats.php | 4 +- .../vendor/guzzlehttp/promises/.editorconfig | 9 - .../vendor/guzzlehttp/promises/.gitattributes | 12 - .../guzzlehttp/promises/.github/.editorconfig | 2 - .../guzzlehttp/promises/.github/FUNDING.yml | 2 - .../guzzlehttp/promises/.github/stale.yml | 14 - .../promises/.github/workflows/checks.yml | 21 - .../promises/.github/workflows/ci.yml | 65 - .../promises/.github/workflows/static.yml | 62 - .../vendor/guzzlehttp/promises/.gitignore | 7 - .../promises/.php-cs-fixer.dist.php | 87 - .../vendor/guzzlehttp/promises/.travis.yml | 19 - .../vendor/guzzlehttp/promises/CHANGELOG.md | 29 + .../vendor/guzzlehttp/promises/Makefile | 13 - .../vendor/guzzlehttp/promises/README.md | 21 +- .../vendor/guzzlehttp/promises/composer.json | 19 +- .../guzzlehttp/promises/phpstan-baseline.neon | 37 - .../guzzlehttp/promises/phpstan.neon.dist | 7 - .../guzzlehttp/promises/phpunit.xml.dist | 21 - .../vendor/guzzlehttp/promises/psalm.xml | 15 - .../promises/src/AggregateException.php | 4 +- .../promises/src/CancellationException.php | 2 + .../guzzlehttp/promises/src/Coroutine.php | 39 +- .../vendor/guzzlehttp/promises/src/Create.php | 21 +- .../vendor/guzzlehttp/promises/src/Each.php | 24 +- .../guzzlehttp/promises/src/EachPromise.php | 43 +- .../promises/src/FulfilledPromise.php | 29 +- .../vendor/guzzlehttp/promises/src/Is.php | 18 +- .../guzzlehttp/promises/src/Promise.php | 51 +- .../promises/src/PromiseInterface.php | 34 +- .../promises/src/PromisorInterface.php | 6 +- .../promises/src/RejectedPromise.php | 30 +- .../promises/src/RejectionException.php | 15 +- .../guzzlehttp/promises/src/TaskQueue.php | 16 +- .../promises/src/TaskQueueInterface.php | 10 +- .../vendor/guzzlehttp/promises/src/Utils.php | 67 +- .../guzzlehttp/promises/src/functions.php | 363 - .../promises/src/functions_include.php | 6 - .../promises/tests/AggregateExceptionTest.php | 16 - .../promises/tests/CoroutineTest.php | 113 - .../guzzlehttp/promises/tests/CreateTest.php | 56 - .../promises/tests/EachPromiseTest.php | 430 - .../guzzlehttp/promises/tests/EachTest.php | 34 - .../promises/tests/FulfilledPromiseTest.php | 113 - .../guzzlehttp/promises/tests/IsTest.php | 40 - .../promises/tests/NotPromiseInstance.php | 49 - .../guzzlehttp/promises/tests/PromiseTest.php | 761 -- .../promises/tests/PropertyHelper.php | 27 - .../promises/tests/RejectedPromiseTest.php | 149 - .../promises/tests/RejectionExceptionTest.php | 28 - .../promises/tests/TaskQueueTest.php | 33 - .../guzzlehttp/promises/tests/Thennable.php | 25 - .../guzzlehttp/promises/tests/Thing1.php | 18 - .../guzzlehttp/promises/tests/Thing2.php | 12 - .../guzzlehttp/promises/tests/UtilsTest.php | 731 -- .../vendor/guzzlehttp/psr7/CHANGELOG.md | 23 +- lib/Google/vendor/guzzlehttp/psr7/README.md | 24 +- .../guzzlehttp/psr7/src/AppendStream.php | 14 +- .../guzzlehttp/psr7/src/BufferStream.php | 2 - .../vendor/guzzlehttp/psr7/src/FnStream.php | 9 +- .../vendor/guzzlehttp/psr7/src/Header.php | 2 +- .../guzzlehttp/psr7/src/HttpFactory.php | 8 +- .../guzzlehttp/psr7/src/InflateStream.php | 6 +- .../vendor/guzzlehttp/psr7/src/Message.php | 26 +- .../guzzlehttp/psr7/src/MessageTrait.php | 12 +- .../vendor/guzzlehttp/psr7/src/MimeType.php | 34 +- .../guzzlehttp/psr7/src/MultipartStream.php | 8 +- .../vendor/guzzlehttp/psr7/src/PumpStream.php | 6 +- .../vendor/guzzlehttp/psr7/src/Query.php | 4 +- .../vendor/guzzlehttp/psr7/src/Request.php | 6 +- .../vendor/guzzlehttp/psr7/src/Response.php | 1 + .../vendor/guzzlehttp/psr7/src/Rfc7230.php | 2 +- .../guzzlehttp/psr7/src/ServerRequest.php | 14 +- .../vendor/guzzlehttp/psr7/src/Stream.php | 11 +- .../psr7/src/StreamDecoratorTrait.php | 5 +- .../guzzlehttp/psr7/src/StreamWrapper.php | 60 +- lib/Google/vendor/guzzlehttp/psr7/src/Uri.php | 51 +- .../guzzlehttp/psr7/src/UriNormalizer.php | 10 +- .../guzzlehttp/psr7/src/UriResolver.php | 18 +- .../vendor/guzzlehttp/psr7/src/Utils.php | 10 +- .../vendor/monolog/monolog/CHANGELOG.md | 6 + .../monolog/src/Monolog/ErrorHandler.php | 2 +- .../src/Monolog/Formatter/LineFormatter.php | 2 +- .../Monolog/Formatter/NormalizerFormatter.php | 3 + ...chHandler.php => ElasticsearchHandler.php} | 0 .../src/Monolog/Handler/StreamHandler.php | 11 +- .../vendor/phpseclib/phpseclib/BACKERS.md | 3 +- .../vendor/phpseclib/phpseclib/README.md | 3 +- .../phpseclib/Crypt/Common/AsymmetricKey.php | 2 +- .../phpseclib/Crypt/Common/SymmetricKey.php | 6 +- .../phpseclib/phpseclib/Crypt/RSA.php | 20 +- .../phpseclib/phpseclib/Crypt/Rijndael.php | 4 +- .../phpseclib/phpseclib/File/ASN1.php | 5 +- .../phpseclib/phpseclib/File/X509.php | 26 +- .../phpseclib/phpseclib/Math/BigInteger.php | 18 +- .../Math/BigInteger/Engines/Engine.php | 5 + .../phpseclib/Math/BigInteger/Engines/PHP.php | 14 + .../Math/BigInteger/Engines/PHP32.php | 6 +- .../Math/BigInteger/Engines/PHP64.php | 2 +- .../phpseclib/Math/PrimeField/Integer.php | 7 +- .../phpseclib/phpseclib/Net/SFTP.php | 380 +- .../phpseclib/phpseclib/Net/SSH2.php | 605 +- .../psr/cache/src/CacheItemInterface.php | 4 +- .../vendor/psr/http-client/CHANGELOG.md | 8 + .../vendor/psr/http-client/composer.json | 3 + .../vendor/psr/http-message/composer.json | 4 +- .../psr/http-message/src/MessageInterface.php | 24 +- .../psr/http-message/src/RequestInterface.php | 15 +- .../http-message/src/ResponseInterface.php | 8 +- .../src/ServerRequestInterface.php | 24 +- .../psr/http-message/src/StreamInterface.php | 28 +- .../src/UploadedFileInterface.php | 14 +- .../psr/http-message/src/UriInterface.php | 34 +- .../vendor/ramsey/collection/composer.json | 3 +- .../ramsey/collection/src/AbstractArray.php | 55 +- .../collection/src/AbstractCollection.php | 206 +- .../ramsey/collection/src/AbstractSet.php | 10 +- .../ramsey/collection/src/ArrayInterface.php | 4 +- .../ramsey/collection/src/Collection.php | 13 +- .../collection/src/CollectionInterface.php | 113 +- .../collection/src/DoubleEndedQueue.php | 127 +- .../src/DoubleEndedQueueInterface.php | 36 +- .../Exception/CollectionMismatchException.php | 2 +- .../Exception/InvalidArgumentException.php | 4 +- ...tion.php => InvalidSortOrderException.php} | 7 +- .../src/Exception/NoSuchElementException.php | 2 +- .../src/Exception/OutOfBoundsException.php | 4 +- .../UnsupportedOperationException.php | 2 +- ...ethod.php => ValueExtractionException.php} | 6 +- .../ramsey/collection/src/Map/AbstractMap.php | 106 +- .../collection/src/Map/AbstractTypedMap.php | 18 +- .../src/Map/AssociativeArrayMap.php | 3 +- .../collection/src/Map/MapInterface.php | 57 +- .../collection/src/Map/NamedParameterMap.php | 21 +- .../ramsey/collection/src/Map/TypedMap.php | 30 +- .../collection/src/Map/TypedMapInterface.php | 3 +- .../vendor/ramsey/collection/src/Queue.php | 97 +- .../ramsey/collection/src/QueueInterface.php | 18 +- .../vendor/ramsey/collection/src/Set.php | 14 +- .../vendor/ramsey/collection/src/Sort.php | 31 - .../ramsey/collection/src/Tool/TypeTrait.php | 49 +- .../src/Tool/ValueExtractorTrait.php | 58 +- .../src/Tool/ValueToStringTrait.php | 15 +- lib/Google/vendor/ramsey/uuid/src/Uuid.php | 2 +- .../symfony/deprecation-contracts/.gitignore | 3 + .../symfony/deprecation-contracts/LICENSE | 2 +- .../symfony/deprecation-contracts/README.md | 2 +- .../deprecation-contracts/composer.json | 4 +- .../vendor/symfony/polyfill-php81}/LICENSE | 2 +- .../vendor/symfony/polyfill-php81/Php81.php | 37 + .../vendor/symfony/polyfill-php81/README.md | 18 + .../Resources/stubs/CURLStringFile.php | 51 + .../Resources/stubs/ReturnTypeWillChange.php | 8 +- .../symfony/polyfill-php81/bootstrap.php | 28 + .../symfony/polyfill-php81}/composer.json | 8 +- lib/classes/class-api.php | 2 +- lib/classes/class-bootstrap.php | 31 +- lib/classes/class-compatibility.php | 2 +- ...rt.php => class-dynamic-image-support.php} | 52 +- lib/classes/class-errors.php | 22 +- lib/classes/class-google-app-engine.php | 93 + lib/classes/class-module.php | 60 - lib/classes/class-settings.php | 5 +- lib/classes/class-upgrader.php | 28 + lib/classes/class-utility.php | 3 +- .../compatibility/google-app-engine.php | 38 - lib/classes/compatibility/imagify.php | 304 - lib/classes/compatibility/js/shortpixel.js | 18 - lib/classes/compatibility/shortpixel.php | 486 - lib/classes/compatibility/siteorigin-css.php | 73 - .../siteorigin-widget-bundle.php | 85 - lib/classes/compatibility/vidorev.php | 40 - .../woo-extra-product-options.php | 80 - lib/classes/compatibility/woocommerce.php | 47 - lib/classes/compatibility/wp-retina-2x.php | 130 - lib/classes/compatibility/wp-smush.php | 238 - .../compatibility/wpbakery-page-builder.php | 81 - lib/classes/compatibility/wpforms.php | 30 - lib/meta-box-tabs/meta-box-tabs.php | 63 +- lib/meta-box-tabs/tabs.css | 243 +- lib/meta-box-tabs/tabs.js | 18 +- readme.txt | 4 +- static/scripts/wp-stateless.js | 9 + static/views/settings_interface.php | 35 +- vendor/bin/mozart | 119 - vendor/coenjacobs/mozart/.github/FUNDING.yml | 3 - .../mozart/.github/workflows/analysis.yml | 20 - .../.github/workflows/docker-latest.yml | 52 - .../mozart/.github/workflows/main.yml | 50 - .../mozart/.github/workflows/release.yml | 92 - vendor/coenjacobs/mozart/.gitignore | 6 - vendor/coenjacobs/mozart/Dockerfile | 17 - vendor/coenjacobs/mozart/LICENSE | 21 - vendor/coenjacobs/mozart/README.md | 146 - vendor/coenjacobs/mozart/bin/mozart | 29 - vendor/coenjacobs/mozart/composer.json | 40 - vendor/coenjacobs/mozart/phpcs.xml | 7 - vendor/coenjacobs/mozart/phpunit.xml | 16 - vendor/coenjacobs/mozart/psalm.xml | 15 - .../src/Composer/Autoload/Autoloader.php | 9 - .../mozart/src/Composer/Autoload/Classmap.php | 36 - .../Composer/Autoload/NamespaceAutoloader.php | 49 - .../mozart/src/Composer/Autoload/Psr0.php | 7 - .../mozart/src/Composer/Autoload/Psr4.php | 22 - .../mozart/src/Composer/Package.php | 69 - .../mozart/src/Console/Application.php | 20 - .../mozart/src/Console/Commands/Compose.php | 243 - vendor/coenjacobs/mozart/src/Mover.php | 243 - .../mozart/src/Replace/BaseReplacer.php | 20 - .../mozart/src/Replace/ClassmapReplacer.php | 64 - .../mozart/src/Replace/NamespaceReplacer.php | 43 - .../mozart/src/Replace/Replacer.php | 11 - vendor/coenjacobs/mozart/src/Replacer.php | 223 - .../tests/Console/Commands/ComposeTest.php | 225 - vendor/coenjacobs/mozart/tests/MoverTest.php | 230 - .../mozart/tests/issue89-composer.json | 18 - .../tests/replacers/ClassMapReplacerTest.php | 155 - .../ClassmapReplacerIntegrationTest.php | 137 - .../NamespaceReplacerIntegrationTest.php | 131 - .../tests/replacers/NamespaceReplacerTest.php | 126 - vendor/composer/autoload_classmap.php | 30 +- vendor/composer/autoload_files.php | 17 - vendor/composer/autoload_psr4.php | 15 +- vendor/composer/autoload_real.php | 12 - vendor/composer/autoload_static.php | 120 +- vendor/composer/installed.json | 1527 +-- vendor/composer/installed.php | 176 +- .../.circleci/config.yml | 93 - .../wp-background-processing/.gitignore | 3 - .../wp-background-processing/.phpcs.xml | 65 - .../wp-background-processing/Makefile | 18 - .../wp-background-processing/README.md | 376 - .../bin/install-wp-tests.sh | 181 - .../classes/wp-async-request.php | 202 - .../classes/wp-background-process.php | 733 -- .../wp-background-processing/composer.json | 35 - .../wp-background-processing/composer.lock | 2022 ---- .../wp-background-processing/license.txt | 280 - .../wp-background-processing/phpunit.xml | 15 - .../tests/Test_Setup.php | 19 - .../tests/Test_WP_Background_Process.php | 589 -- .../tests/bootstrap.php | 38 - .../wp-background-processing.php | 24 - vendor/firebase/php-jwt/CHANGELOG.md | 34 + .../php-jwt/src/BeforeValidException.php | 13 +- vendor/firebase/php-jwt/src/CachedKeySet.php | 10 + .../firebase/php-jwt/src/ExpiredException.php | 13 +- vendor/firebase/php-jwt/src/JWK.php | 32 +- vendor/firebase/php-jwt/src/JWT.php | 41 +- .../src/JWTExceptionWithPayloadInterface.php | 20 + vendor/league/flysystem/CODE_OF_CONDUCT.md | 76 - vendor/league/flysystem/LICENSE | 19 - vendor/league/flysystem/SECURITY.md | 16 - vendor/league/flysystem/composer.json | 68 - vendor/league/flysystem/deprecations.md | 19 - .../flysystem/src/Adapter/AbstractAdapter.php | 72 - .../src/Adapter/AbstractFtpAdapter.php | 705 -- .../src/Adapter/CanOverwriteFiles.php | 12 - vendor/league/flysystem/src/Adapter/Ftp.php | 584 -- vendor/league/flysystem/src/Adapter/Ftpd.php | 48 - vendor/league/flysystem/src/Adapter/Local.php | 533 - .../flysystem/src/Adapter/NullAdapter.php | 144 - .../Polyfill/NotSupportingVisibilityTrait.php | 33 - .../Adapter/Polyfill/StreamedCopyTrait.php | 51 - .../Adapter/Polyfill/StreamedReadingTrait.php | 44 - .../src/Adapter/Polyfill/StreamedTrait.php | 9 - .../Adapter/Polyfill/StreamedWritingTrait.php | 60 - .../flysystem/src/Adapter/SynologyFtp.php | 8 - .../league/flysystem/src/AdapterInterface.php | 118 - vendor/league/flysystem/src/Config.php | 107 - .../league/flysystem/src/ConfigAwareTrait.php | 49 - .../src/ConnectionErrorException.php | 9 - .../src/ConnectionRuntimeException.php | 9 - .../flysystem/src/CorruptedPathDetected.php | 17 - vendor/league/flysystem/src/Directory.php | 31 - vendor/league/flysystem/src/Exception.php | 8 - vendor/league/flysystem/src/File.php | 205 - .../flysystem/src/FileExistsException.php | 37 - .../flysystem/src/FileNotFoundException.php | 37 - vendor/league/flysystem/src/Filesystem.php | 409 - .../flysystem/src/FilesystemException.php | 7 - .../flysystem/src/FilesystemInterface.php | 284 - .../src/FilesystemNotFoundException.php | 12 - vendor/league/flysystem/src/Handler.php | 137 - .../flysystem/src/InvalidRootException.php | 9 - vendor/league/flysystem/src/MountManager.php | 648 -- .../flysystem/src/NotSupportedException.php | 37 - .../flysystem/src/Plugin/AbstractPlugin.php | 24 - .../league/flysystem/src/Plugin/EmptyDir.php | 34 - .../flysystem/src/Plugin/ForcedCopy.php | 44 - .../flysystem/src/Plugin/ForcedRename.php | 44 - .../flysystem/src/Plugin/GetWithMetadata.php | 51 - .../league/flysystem/src/Plugin/ListFiles.php | 35 - .../league/flysystem/src/Plugin/ListPaths.php | 36 - .../league/flysystem/src/Plugin/ListWith.php | 60 - .../flysystem/src/Plugin/PluggableTrait.php | 97 - .../src/Plugin/PluginNotFoundException.php | 10 - .../league/flysystem/src/PluginInterface.php | 20 - vendor/league/flysystem/src/ReadInterface.php | 88 - .../flysystem/src/RootViolationException.php | 10 - vendor/league/flysystem/src/SafeStorage.php | 39 - .../flysystem/src/UnreadableFileException.php | 18 - vendor/league/flysystem/src/Util.php | 354 - .../src/Util/ContentListingFormatter.php | 122 - vendor/league/flysystem/src/Util/MimeType.php | 80 - .../flysystem/src/Util/StreamHasher.php | 36 - .../league/mime-type-detection/CHANGELOG.md | 31 - vendor/league/mime-type-detection/LICENSE | 19 - .../league/mime-type-detection/composer.json | 34 - .../src/EmptyExtensionToMimeTypeMap.php | 13 - .../src/ExtensionMimeTypeDetector.php | 42 - .../src/ExtensionToMimeTypeMap.php | 10 - .../src/FinfoMimeTypeDetector.php | 92 - .../src/GeneratedExtensionToMimeTypeMap.php | 1227 --- .../src/MimeTypeDetector.php | 19 - .../src/OverridingExtensionToMimeTypeMap.php | 30 - vendor/psr/container/.gitignore | 3 - vendor/psr/container/LICENSE | 21 - vendor/psr/container/README.md | 13 - vendor/psr/container/composer.json | 27 - .../src/ContainerExceptionInterface.php | 12 - .../psr/container/src/ContainerInterface.php | 36 - .../src/NotFoundExceptionInterface.php | 10 - vendor/symfony/console/Application.php | 1301 --- .../symfony/console/Attribute/AsCommand.php | 39 - vendor/symfony/console/CHANGELOG.md | 217 - .../console/CI/GithubActionReporter.php | 99 - vendor/symfony/console/Color.php | 180 - vendor/symfony/console/Command/Command.php | 710 -- .../console/Command/CompleteCommand.php | 205 - .../console/Command/DumpCompletionCommand.php | 145 - .../symfony/console/Command/HelpCommand.php | 101 - .../symfony/console/Command/LazyCommand.php | 218 - .../symfony/console/Command/ListCommand.php | 95 - .../symfony/console/Command/LockableTrait.php | 69 - .../Command/SignalableCommandInterface.php | 30 - .../CommandLoader/CommandLoaderInterface.php | 42 - .../CommandLoader/ContainerCommandLoader.php | 63 - .../CommandLoader/FactoryCommandLoader.php | 62 - .../console/Completion/CompletionInput.php | 249 - .../Completion/CompletionSuggestions.php | 99 - .../Output/BashCompletionOutput.php | 33 - .../Output/CompletionOutputInterface.php | 25 - .../symfony/console/Completion/Suggestion.php | 37 - vendor/symfony/console/ConsoleEvents.php | 72 - vendor/symfony/console/Cursor.php | 207 - .../AddConsoleCommandPass.php | 148 - .../Descriptor/ApplicationDescription.php | 143 - .../symfony/console/Descriptor/Descriptor.php | 94 - .../Descriptor/DescriptorInterface.php | 24 - .../console/Descriptor/JsonDescriptor.php | 181 - .../console/Descriptor/MarkdownDescriptor.php | 206 - .../console/Descriptor/TextDescriptor.php | 341 - .../console/Descriptor/XmlDescriptor.php | 247 - .../console/Event/ConsoleCommandEvent.php | 51 - .../console/Event/ConsoleErrorEvent.php | 58 - vendor/symfony/console/Event/ConsoleEvent.php | 67 - .../console/Event/ConsoleSignalEvent.php | 35 - .../console/Event/ConsoleTerminateEvent.php | 43 - .../console/EventListener/ErrorListener.php | 95 - .../Exception/CommandNotFoundException.php | 43 - .../console/Exception/ExceptionInterface.php | 21 - .../Exception/InvalidArgumentException.php | 19 - .../Exception/InvalidOptionException.php | 21 - .../console/Exception/LogicException.php | 19 - .../Exception/MissingInputException.php | 21 - .../Exception/NamespaceNotFoundException.php | 21 - .../console/Exception/RuntimeException.php | 19 - .../console/Formatter/NullOutputFormatter.php | 69 - .../Formatter/NullOutputFormatterStyle.php | 66 - .../console/Formatter/OutputFormatter.php | 285 - .../Formatter/OutputFormatterInterface.php | 60 - .../Formatter/OutputFormatterStyle.php | 109 - .../OutputFormatterStyleInterface.php | 52 - .../Formatter/OutputFormatterStyleStack.php | 110 - .../WrappableOutputFormatterInterface.php | 25 - .../console/Helper/DebugFormatterHelper.php | 107 - .../console/Helper/DescriptorHelper.php | 92 - vendor/symfony/console/Helper/Dumper.php | 64 - .../console/Helper/FormatterHelper.php | 92 - vendor/symfony/console/Helper/Helper.php | 180 - .../console/Helper/HelperInterface.php | 39 - vendor/symfony/console/Helper/HelperSet.php | 108 - .../console/Helper/InputAwareHelper.php | 33 - .../symfony/console/Helper/ProcessHelper.php | 144 - vendor/symfony/console/Helper/ProgressBar.php | 609 -- .../console/Helper/ProgressIndicator.php | 249 - .../symfony/console/Helper/QuestionHelper.php | 625 -- .../console/Helper/SymfonyQuestionHelper.php | 109 - vendor/symfony/console/Helper/Table.php | 915 -- vendor/symfony/console/Helper/TableCell.php | 78 - .../symfony/console/Helper/TableCellStyle.php | 89 - vendor/symfony/console/Helper/TableRows.php | 30 - .../symfony/console/Helper/TableSeparator.php | 25 - vendor/symfony/console/Helper/TableStyle.php | 376 - vendor/symfony/console/Input/ArgvInput.php | 378 - vendor/symfony/console/Input/ArrayInput.php | 210 - vendor/symfony/console/Input/Input.php | 213 - .../symfony/console/Input/InputArgument.php | 129 - .../console/Input/InputAwareInterface.php | 26 - .../symfony/console/Input/InputDefinition.php | 424 - .../symfony/console/Input/InputInterface.php | 151 - vendor/symfony/console/Input/InputOption.php | 231 - .../Input/StreamableInputInterface.php | 37 - vendor/symfony/console/Input/StringInput.php | 84 - vendor/symfony/console/LICENSE | 19 - .../symfony/console/Logger/ConsoleLogger.php | 126 - .../symfony/console/Output/BufferedOutput.php | 45 - .../symfony/console/Output/ConsoleOutput.php | 172 - .../console/Output/ConsoleOutputInterface.php | 32 - .../console/Output/ConsoleSectionOutput.php | 143 - vendor/symfony/console/Output/NullOutput.php | 128 - vendor/symfony/console/Output/Output.php | 174 - .../console/Output/OutputInterface.php | 110 - .../symfony/console/Output/StreamOutput.php | 115 - .../console/Output/TrimmedBufferOutput.php | 63 - .../console/Question/ChoiceQuestion.php | 183 - .../console/Question/ConfirmationQuestion.php | 57 - vendor/symfony/console/Question/Question.php | 299 - vendor/symfony/console/README.md | 36 - .../console/Resources/bin/hiddeninput.exe | Bin 9216 -> 0 bytes .../symfony/console/Resources/completion.bash | 84 - .../console/SignalRegistry/SignalRegistry.php | 65 - .../console/SingleCommandApplication.php | 72 - vendor/symfony/console/Style/OutputStyle.php | 153 - .../symfony/console/Style/StyleInterface.php | 132 - vendor/symfony/console/Style/SymfonyStyle.php | 518 - vendor/symfony/console/Terminal.php | 177 - .../console/Tester/ApplicationTester.php | 85 - .../Tester/CommandCompletionTester.php | 56 - .../symfony/console/Tester/CommandTester.php | 76 - .../Tester/Constraint/CommandIsSuccessful.php | 55 - vendor/symfony/console/Tester/TesterTrait.php | 197 - vendor/symfony/console/composer.json | 60 - .../deprecation-contracts/CHANGELOG.md | 5 - .../symfony/deprecation-contracts/README.md | 26 - .../deprecation-contracts/composer.json | 35 - .../deprecation-contracts/function.php | 27 - vendor/symfony/finder/CHANGELOG.md | 87 - .../symfony/finder/Comparator/Comparator.php | 117 - .../finder/Comparator/DateComparator.php | 50 - .../finder/Comparator/NumberComparator.php | 78 - .../Exception/AccessDeniedException.php | 19 - .../Exception/DirectoryNotFoundException.php | 19 - vendor/symfony/finder/Finder.php | 806 -- vendor/symfony/finder/Gitignore.php | 93 - vendor/symfony/finder/Glob.php | 111 - .../finder/Iterator/CustomFilterIterator.php | 64 - .../Iterator/DateRangeFilterIterator.php | 61 - .../Iterator/DepthRangeFilterIterator.php | 51 - .../ExcludeDirectoryFilterIterator.php | 97 - .../Iterator/FileTypeFilterIterator.php | 56 - .../Iterator/FilecontentFilterIterator.php | 61 - .../Iterator/FilenameFilterIterator.php | 50 - .../symfony/finder/Iterator/LazyIterator.php | 32 - .../Iterator/MultiplePcreFilterIterator.php | 117 - .../finder/Iterator/PathFilterIterator.php | 59 - .../Iterator/RecursiveDirectoryIterator.php | 168 - .../Iterator/SizeRangeFilterIterator.php | 60 - .../finder/Iterator/SortableIterator.php | 104 - .../Iterator/VcsIgnoredFilterIterator.php | 151 - vendor/symfony/finder/LICENSE | 19 - vendor/symfony/finder/README.md | 14 - vendor/symfony/finder/SplFileInfo.php | 88 - vendor/symfony/finder/composer.json | 30 - vendor/symfony/polyfill-ctype/Ctype.php | 232 - vendor/symfony/polyfill-ctype/LICENSE | 19 - vendor/symfony/polyfill-ctype/README.md | 12 - vendor/symfony/polyfill-ctype/bootstrap.php | 50 - vendor/symfony/polyfill-ctype/bootstrap80.php | 46 - vendor/symfony/polyfill-ctype/composer.json | 41 - .../polyfill-intl-grapheme/Grapheme.php | 247 - vendor/symfony/polyfill-intl-grapheme/LICENSE | 19 - .../symfony/polyfill-intl-grapheme/README.md | 31 - .../polyfill-intl-grapheme/bootstrap.php | 58 - .../polyfill-intl-grapheme/bootstrap80.php | 50 - .../polyfill-intl-grapheme/composer.json | 38 - .../symfony/polyfill-intl-normalizer/LICENSE | 19 - .../polyfill-intl-normalizer/Normalizer.php | 310 - .../polyfill-intl-normalizer/README.md | 14 - .../Resources/stubs/Normalizer.php | 17 - .../unidata/canonicalComposition.php | 945 -- .../unidata/canonicalDecomposition.php | 2065 ---- .../Resources/unidata/combiningClass.php | 876 -- .../unidata/compatibilityDecomposition.php | 3695 ------- .../polyfill-intl-normalizer/bootstrap.php | 23 - .../polyfill-intl-normalizer/bootstrap80.php | 19 - .../polyfill-intl-normalizer/composer.json | 39 - vendor/symfony/polyfill-mbstring/LICENSE | 19 - vendor/symfony/polyfill-mbstring/Mbstring.php | 874 -- vendor/symfony/polyfill-mbstring/README.md | 13 - .../Resources/unidata/lowerCase.php | 1397 --- .../Resources/unidata/titleCaseRegexp.php | 5 - .../Resources/unidata/upperCase.php | 1489 --- .../symfony/polyfill-mbstring/bootstrap.php | 147 - .../symfony/polyfill-mbstring/bootstrap80.php | 143 - .../symfony/polyfill-mbstring/composer.json | 41 - vendor/symfony/polyfill-php73/LICENSE | 19 - vendor/symfony/polyfill-php73/Php73.php | 43 - vendor/symfony/polyfill-php73/README.md | 18 - .../Resources/stubs/JsonException.php | 16 - vendor/symfony/polyfill-php73/bootstrap.php | 31 - vendor/symfony/polyfill-php80/LICENSE | 19 - vendor/symfony/polyfill-php80/Php80.php | 115 - vendor/symfony/polyfill-php80/PhpToken.php | 103 - vendor/symfony/polyfill-php80/README.md | 25 - .../Resources/stubs/Attribute.php | 31 - .../Resources/stubs/Stringable.php | 20 - .../Resources/stubs/UnhandledMatchError.php | 16 - .../Resources/stubs/ValueError.php | 16 - vendor/symfony/polyfill-php80/bootstrap.php | 42 - vendor/symfony/polyfill-php80/composer.json | 40 - .../service-contracts/Attribute/Required.php | 25 - .../Attribute/SubscribedService.php | 47 - vendor/symfony/service-contracts/CHANGELOG.md | 5 - vendor/symfony/service-contracts/LICENSE | 19 - vendor/symfony/service-contracts/README.md | 9 - .../service-contracts/ResetInterface.php | 33 - .../service-contracts/ServiceLocatorTrait.php | 115 - .../ServiceProviderInterface.php | 45 - .../ServiceSubscriberInterface.php | 62 - .../ServiceSubscriberTrait.php | 78 - .../Test/ServiceLocatorTest.php | 23 - .../Test/ServiceLocatorTestCase.php | 92 - .../symfony/service-contracts/composer.json | 41 - vendor/symfony/string/AbstractString.php | 708 -- .../symfony/string/AbstractUnicodeString.php | 590 -- vendor/symfony/string/ByteString.php | 485 - vendor/symfony/string/CHANGELOG.md | 40 - vendor/symfony/string/CodePointString.php | 260 - .../string/Exception/ExceptionInterface.php | 16 - .../Exception/InvalidArgumentException.php | 16 - .../string/Exception/RuntimeException.php | 16 - .../string/Inflector/EnglishInflector.php | 511 - .../string/Inflector/FrenchInflector.php | 151 - .../string/Inflector/InflectorInterface.php | 33 - vendor/symfony/string/LICENSE | 19 - vendor/symfony/string/LazyString.php | 145 - vendor/symfony/string/README.md | 14 - .../Resources/data/wcswidth_table_wide.php | 1143 --- .../Resources/data/wcswidth_table_zero.php | 1415 --- vendor/symfony/string/Resources/functions.php | 38 - .../symfony/string/Slugger/AsciiSlugger.php | 210 - .../string/Slugger/SluggerInterface.php | 27 - vendor/symfony/string/UnicodeString.php | 358 - vendor/symfony/string/composer.json | 43 - .../lib/classes/class-admin.php | 2 +- ...e-checker.php => class-update-checker.php} | 58 +- vendor/udx/lib-ud-api-client/readme.md | 18 +- .../lib/classes/class-bootstrap-plugin.php | 2 + .../lib/classes/class-bootstrap-theme.php | 2 + .../lib/classes/class-bootstrap.php | 40 + .../lib/classes/class-errors.php | 4 + .../lib/classes/class-tgm-bulk-installer.php | 554 ++ .../lib/classes/class-tgm-list-table.php | 681 ++ .../classes/class-tgm-plugin-activation.php | 1033 ++ vendor/wpmetabox/meta-box/.distignore | 24 + vendor/wpmetabox/meta-box/README.md | 167 - vendor/wpmetabox/meta-box/composer.json | 25 - .../wpmetabox/meta-box/css/button-group.css | 88 +- vendor/wpmetabox/meta-box/css/date.css | 211 +- vendor/wpmetabox/meta-box/css/file.css | 1 - vendor/wpmetabox/meta-box/css/input-list.css | 19 +- .../wpmetabox/meta-box/css/jqueryui/core.css | 6 +- .../meta-box/css/jqueryui/datepicker.css | 4 +- .../meta-box/css/jqueryui/slider.css | 6 +- .../wpmetabox/meta-box/css/jqueryui/theme.css | 45 +- vendor/wpmetabox/meta-box/css/media-modal.css | 18 - vendor/wpmetabox/meta-box/css/media.css | 1 + vendor/wpmetabox/meta-box/css/modal.css | 70 + .../wpmetabox/meta-box/css/osm-frontend.css | 4 + vendor/wpmetabox/meta-box/css/select-tree.css | 4 +- vendor/wpmetabox/meta-box/css/style.css | 4 +- vendor/wpmetabox/meta-box/css/switch.css | 59 +- vendor/wpmetabox/meta-box/css/taxonomy.css | 18 - vendor/wpmetabox/meta-box/gulpfile.js | 27 - vendor/wpmetabox/meta-box/inc/about/about.php | 98 +- .../meta-box/inc/about/css/about.css | 40 +- .../meta-box/inc/about/dashboard.php | 40 +- .../inc/about/sections/extensions.php | 8 +- .../about/sections/getting-started-pro.php | 12 + .../inc/about/sections/getting-started.php | 8 +- .../meta-box/inc/about/sections/products.php | 20 +- .../meta-box/inc/about/sections/review.php | 11 + .../meta-box/inc/about/sections/support.php | 18 +- .../meta-box/inc/about/sections/tabs.php | 8 +- .../meta-box/inc/about/sections/upgrade.php | 8 +- .../meta-box/inc/about/sections/welcome.php | 10 +- vendor/wpmetabox/meta-box/inc/autoloader.php | 48 +- vendor/wpmetabox/meta-box/inc/clone.php | 47 +- vendor/wpmetabox/meta-box/inc/core.php | 76 +- .../wpmetabox/meta-box/inc/field-registry.php | 26 +- vendor/wpmetabox/meta-box/inc/field.php | 260 +- .../meta-box/inc/fields/autocomplete.php | 33 +- .../meta-box/inc/fields/background.php | 186 +- .../meta-box/inc/fields/button-group.php | 31 +- .../wpmetabox/meta-box/inc/fields/button.php | 26 +- .../meta-box/inc/fields/checkbox-list.php | 8 +- .../meta-box/inc/fields/checkbox.php | 16 +- .../wpmetabox/meta-box/inc/fields/choice.php | 34 +- .../wpmetabox/meta-box/inc/fields/color.php | 52 +- .../meta-box/inc/fields/custom-html.php | 10 +- vendor/wpmetabox/meta-box/inc/fields/date.php | 17 +- .../meta-box/inc/fields/datetime.php | 185 +- .../wpmetabox/meta-box/inc/fields/divider.php | 33 +- .../meta-box/inc/fields/fieldset-text.php | 33 +- .../meta-box/inc/fields/file-input.php | 24 +- .../meta-box/inc/fields/file-upload.php | 35 +- vendor/wpmetabox/meta-box/inc/fields/file.php | 120 +- .../wpmetabox/meta-box/inc/fields/heading.php | 33 +- .../meta-box/inc/fields/image-advanced.php | 41 +- .../meta-box/inc/fields/image-select.php | 25 +- .../meta-box/inc/fields/image-upload.php | 13 +- .../wpmetabox/meta-box/inc/fields/image.php | 53 +- .../meta-box/inc/fields/input-list.php | 32 +- .../wpmetabox/meta-box/inc/fields/input.php | 84 +- .../meta-box/inc/fields/key-value.php | 40 +- vendor/wpmetabox/meta-box/inc/fields/map.php | 159 +- .../wpmetabox/meta-box/inc/fields/media.php | 148 +- .../meta-box/inc/fields/multiple-values.php | 8 +- .../wpmetabox/meta-box/inc/fields/number.php | 35 +- .../meta-box/inc/fields/object-choice.php | 95 +- .../wpmetabox/meta-box/inc/fields/oembed.php | 50 +- vendor/wpmetabox/meta-box/inc/fields/osm.php | 108 +- .../meta-box/inc/fields/password.php | 8 +- vendor/wpmetabox/meta-box/inc/fields/post.php | 129 +- .../wpmetabox/meta-box/inc/fields/radio.php | 14 +- .../wpmetabox/meta-box/inc/fields/range.php | 24 +- .../meta-box/inc/fields/select-advanced.php | 59 +- .../meta-box/inc/fields/select-tree.php | 15 +- .../wpmetabox/meta-box/inc/fields/select.php | 33 +- .../wpmetabox/meta-box/inc/fields/sidebar.php | 38 +- .../meta-box/inc/fields/single-image.php | 23 +- .../wpmetabox/meta-box/inc/fields/slider.php | 47 +- .../wpmetabox/meta-box/inc/fields/switch.php | 26 +- .../meta-box/inc/fields/taxonomy-advanced.php | 44 +- .../meta-box/inc/fields/taxonomy.php | 208 +- .../meta-box/inc/fields/text-list.php | 21 +- .../meta-box/inc/fields/textarea.php | 54 +- vendor/wpmetabox/meta-box/inc/fields/time.php | 11 +- vendor/wpmetabox/meta-box/inc/fields/user.php | 109 +- .../wpmetabox/meta-box/inc/fields/video.php | 66 +- .../wpmetabox/meta-box/inc/fields/wysiwyg.php | 39 +- vendor/wpmetabox/meta-box/inc/functions.php | 64 +- .../wpmetabox/meta-box/inc/helpers/array.php | 91 +- .../wpmetabox/meta-box/inc/helpers/field.php | 44 +- .../wpmetabox/meta-box/inc/helpers/string.php | 18 +- .../wpmetabox/meta-box/inc/helpers/value.php | 2 +- .../meta-box/inc/interfaces/storage.php | 11 +- vendor/wpmetabox/meta-box/inc/loader.php | 51 +- vendor/wpmetabox/meta-box/inc/media-modal.php | 83 +- .../meta-box/inc/meta-box-registry.php | 39 +- vendor/wpmetabox/meta-box/inc/meta-box.php | 192 +- vendor/wpmetabox/meta-box/inc/request.php | 70 +- vendor/wpmetabox/meta-box/inc/sanitizer.php | 175 +- vendor/wpmetabox/meta-box/inc/shortcode.php | 8 +- .../meta-box/inc/storage-registry.php | 14 +- .../wpmetabox/meta-box/inc/storages/base.php | 9 +- .../wpmetabox/meta-box/inc/storages/post.php | 2 + .../meta-box/inc/templates/audio.php | 2 + .../meta-box/inc/templates/image-advanced.php | 2 + .../meta-box/inc/templates/media.php | 4 +- .../meta-box/inc/templates/upload.php | 2 + .../meta-box/inc/templates/video.php | 2 + .../wpmetabox/meta-box/inc/update/checker.php | 220 - vendor/wpmetabox/meta-box/inc/validation.php | 76 +- .../wpmetabox/meta-box/inc/walkers/base.php | 12 +- .../meta-box/inc/walkers/input-list.php | 32 +- .../meta-box/inc/walkers/select-tree.php | 14 +- .../wpmetabox/meta-box/inc/walkers/select.php | 10 +- vendor/wpmetabox/meta-box/inc/wpml.php | 24 +- vendor/wpmetabox/meta-box/js/button-group.js | 6 +- vendor/wpmetabox/meta-box/js/clone.js | 13 +- vendor/wpmetabox/meta-box/js/color.js | 22 +- vendor/wpmetabox/meta-box/js/date.js | 9 +- vendor/wpmetabox/meta-box/js/datetime.js | 9 +- vendor/wpmetabox/meta-box/js/file.js | 20 +- vendor/wpmetabox/meta-box/js/input-list.js | 2 +- vendor/wpmetabox/meta-box/js/map.js | 110 +- vendor/wpmetabox/meta-box/js/media.js | 2 +- vendor/wpmetabox/meta-box/js/modal.js | 132 + vendor/wpmetabox/meta-box/js/oembed.js | 1 + vendor/wpmetabox/meta-box/js/osm.js | 104 +- vendor/wpmetabox/meta-box/js/post.js | 48 + vendor/wpmetabox/meta-box/js/script.js | 5 +- .../wpmetabox/meta-box/js/select-advanced.js | 46 +- vendor/wpmetabox/meta-box/js/select.js | 3 +- vendor/wpmetabox/meta-box/js/taxonomy.js | 40 +- vendor/wpmetabox/meta-box/js/user.js | 35 + .../wpmetabox/meta-box/js/validation.min.js | 18 - .../js/validation/additional-methods.js | 1512 --- .../meta-box/js/validation/jquery.validate.js | 1650 ---- .../meta-box/js/validation/validation.js | 131 - vendor/wpmetabox/meta-box/js/wysiwyg.js | 6 +- vendor/wpmetabox/meta-box/meta-box.php | 4 +- vendor/wpmetabox/meta-box/package.json | 11 - vendor/wpmetabox/meta-box/readme.txt | 241 +- .../wpmetabox/meta-box/src/Block/Register.php | 17 + .../meta-box/src/Bricks/Register.php | 13 + .../meta-box/src/Elementor/Register.php | 18 + .../meta-box/src/Oxygen/Register.php | 16 + vendor/wpmetabox/meta-box/src/Support/Arr.php | 147 + .../wpmetabox/meta-box/src/Support/Data.php | 366 + .../meta-box/src/Updater/Checker.php | 182 + .../Updater/Notification.php} | 95 +- .../option.php => src/Updater/Option.php} | 41 +- .../settings.php => src/Updater/Settings.php} | 93 +- .../wpmetabox/meta-box/tests/001-helper.php | 191 - .../meta-box/tests/002-wysiwyg-clone.php | 103 - vendor/wpmetabox/meta-box/tests/003-wpml.php | 44 - .../wpmetabox/meta-box/tests/004-same-ids.php | 49 - .../meta-box/tests/005-rwmb-the-value.php | 271 - .../tests/006-oembed-clone-remove-preview.php | 36 - .../meta-box/tests/007-large-embed.php | 35 - .../meta-box/tests/008-input-types.php | 123 - .../wpmetabox/meta-box/tests/009-datetime.php | 53 - .../meta-box/tests/010-clone-style.php | 239 - .../wpmetabox/meta-box/tests/011-choices.php | 96 - .../tests/012-multiple-localize-scripts.php | 32 - .../meta-box/tests/013-clone-default.php | 112 - .../tests/014-clone-taxonomy-advanced.php | 86 - .../meta-box/tests/015-save-field-value.php | 100 - .../tests/016-file-upload-custom-folder.php | 60 - .../meta-box/tests/017-shortcode.php | 84 - .../tests/018-label-description-required.php | 26 - wp-stateless-media.php | 3 + 934 files changed, 21193 insertions(+), 80778 deletions(-) create mode 100644 lib/Google/CODE_OF_CONDUCT.md create mode 100644 lib/Google/UPGRADING.md create mode 100644 lib/Google/phpstan.neon.dist mode change 120000 => 100755 lib/Google/vendor/bin/google-cloud-batch create mode 100644 lib/Google/vendor/composer/InstalledVersions.php create mode 100644 lib/Google/vendor/composer/installed.php create mode 100644 lib/Google/vendor/composer/platform_check.php create mode 100644 lib/Google/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php create mode 100644 lib/Google/vendor/google/apiclient-services/LICENSE create mode 100644 lib/Google/vendor/google/apiclient-services/README.md create mode 100644 lib/Google/vendor/google/apiclient-services/SECURITY.md create mode 100644 lib/Google/vendor/google/apiclient-services/autoload.php create mode 100644 lib/Google/vendor/google/apiclient-services/composer.json rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage.php (79%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCache.php create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCaches.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Bucket.php (92%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketAccessControl.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketAccessControlProjectTeam.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketAccessControls.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketAutoclass.php (64%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketBilling.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketCors.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketCustomPlacementConfig.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketEncryption.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketIamConfiguration.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketIamConfigurationBucketPolicyOnly.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketIamConfigurationUniformBucketLevelAccess.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketLifecycle.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketLifecycleRule.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketLifecycleRuleAction.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketLifecycleRuleCondition.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketLogging.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/BucketObjectRetention.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketOwner.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketRetentionPolicy.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/BucketSoftDeletePolicy.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketVersioning.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/BucketWebsite.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Buckets.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/BulkRestoreObjectsRequest.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Channel.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ComposeRequest.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ComposeRequestSourceObjects.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ComposeRequestSourceObjectsObjectPreconditions.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Expr.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningListOperationsResponse.php create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningOperation.php create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/GoogleRpcStatus.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/HmacKey.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/HmacKeyMetadata.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/HmacKeysMetadata.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolder.php create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolders.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Notification.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Notifications.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ObjectAccessControl.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ObjectAccessControlProjectTeam.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ObjectAccessControls.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Objects.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Policy.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/PolicyBindings.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/Resource/AnywhereCache.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/BucketAccessControls.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/Buckets.php (98%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/Channels.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/DefaultObjectAccessControls.php (99%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ManagedFolders.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/Notifications.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/ObjectAccessControls.php (89%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/Objects.php (83%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/Projects.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/ProjectsHmacKeys.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/Resource/ProjectsServiceAccount.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/RewriteResponse.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/ServiceAccount.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/StorageObject.php (91%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/StorageObjectCustomerEncryption.php (100%) rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/StorageObjectOwner.php (100%) create mode 100644 lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectRetention.php rename lib/Google/{src/Service => vendor/google/apiclient-services/src}/Storage/TestIamPermissionsResponse.php (100%) create mode 100644 lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php create mode 100644 lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php create mode 100644 lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php create mode 100644 lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php create mode 100644 lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php create mode 100644 lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php delete mode 100644 lib/Google/vendor/google/crc32/.github/workflows/test.yml delete mode 100644 lib/Google/vendor/google/crc32/.gitignore delete mode 100644 lib/Google/vendor/google/crc32/CONTRIBUTING.md delete mode 100644 lib/Google/vendor/google/crc32/LICENSE delete mode 100644 lib/Google/vendor/google/crc32/Makefile delete mode 100644 lib/Google/vendor/google/crc32/README.md delete mode 100644 lib/Google/vendor/google/crc32/composer.json delete mode 100644 lib/Google/vendor/google/crc32/crc32_benchmark.php delete mode 100644 lib/Google/vendor/google/crc32/ext/.gitignore delete mode 100644 lib/Google/vendor/google/crc32/ext/config.m4 delete mode 100644 lib/Google/vendor/google/crc32/ext/hash_crc32c.c delete mode 100755 lib/Google/vendor/google/crc32/ext/install_crc32c.sh delete mode 100644 lib/Google/vendor/google/crc32/ext/php_crc32c.c delete mode 100644 lib/Google/vendor/google/crc32/ext/php_crc32c.h delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/001_loaded.phpt delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/002_basic.phpt delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/003_extend.phpt delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/004_error.phpt delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/005_hash.phpt delete mode 100644 lib/Google/vendor/google/crc32/ext/tests/006_serialize.phpt delete mode 100644 lib/Google/vendor/google/crc32/src/Builtin.php delete mode 100644 lib/Google/vendor/google/crc32/src/CRC32.php delete mode 100644 lib/Google/vendor/google/crc32/src/CRCInterface.php delete mode 100644 lib/Google/vendor/google/crc32/src/CRCTrait.php delete mode 100644 lib/Google/vendor/google/crc32/src/Google.php delete mode 100644 lib/Google/vendor/google/crc32/src/PHP.php delete mode 100644 lib/Google/vendor/google/crc32/src/PHPSlicedBy4.php delete mode 100644 lib/Google/vendor/google/crc32/src/Table.php delete mode 100644 lib/Google/vendor/google/crc32/tests/BuiltinTest.php delete mode 100644 lib/Google/vendor/google/crc32/tests/CRC32Test.php delete mode 100644 lib/Google/vendor/google/crc32/tests/DataIterator.php delete mode 100644 lib/Google/vendor/google/crc32/tests/GoogleTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.editorconfig delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.gitattributes delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/.editorconfig delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/FUNDING.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/stale.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/workflows/checks.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/workflows/ci.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.github/workflows/static.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.gitignore delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.php-cs-fixer.dist.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/.travis.yml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/Makefile delete mode 100644 lib/Google/vendor/guzzlehttp/promises/phpstan-baseline.neon delete mode 100644 lib/Google/vendor/guzzlehttp/promises/phpstan.neon.dist delete mode 100644 lib/Google/vendor/guzzlehttp/promises/phpunit.xml.dist delete mode 100644 lib/Google/vendor/guzzlehttp/promises/psalm.xml delete mode 100644 lib/Google/vendor/guzzlehttp/promises/src/functions.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/src/functions_include.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/AggregateExceptionTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/CoroutineTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/CreateTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/EachPromiseTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/EachTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/IsTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/PromiseTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/PropertyHelper.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/TaskQueueTest.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/Thennable.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/Thing1.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/Thing2.php delete mode 100644 lib/Google/vendor/guzzlehttp/promises/tests/UtilsTest.php rename lib/Google/vendor/monolog/monolog/src/Monolog/Handler/{ElasticSearchHandler.php => ElasticsearchHandler.php} (100%) rename lib/Google/vendor/ramsey/collection/src/Exception/{CollectionException.php => InvalidSortOrderException.php} (70%) rename lib/Google/vendor/ramsey/collection/src/Exception/{InvalidPropertyOrMethod.php => ValueExtractionException.php} (62%) delete mode 100644 lib/Google/vendor/ramsey/collection/src/Sort.php create mode 100644 lib/Google/vendor/symfony/deprecation-contracts/.gitignore rename {vendor/symfony/deprecation-contracts => lib/Google/vendor/symfony/polyfill-php81}/LICENSE (95%) create mode 100644 lib/Google/vendor/symfony/polyfill-php81/Php81.php create mode 100644 lib/Google/vendor/symfony/polyfill-php81/README.md create mode 100644 lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php rename vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php => lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php (59%) create mode 100644 lib/Google/vendor/symfony/polyfill-php81/bootstrap.php rename {vendor/symfony/polyfill-php73 => lib/Google/vendor/symfony/polyfill-php81}/composer.json (80%) rename lib/classes/{compatibility/dynamic-image-support.php => class-dynamic-image-support.php} (57%) create mode 100644 lib/classes/class-google-app-engine.php delete mode 100644 lib/classes/compatibility/google-app-engine.php delete mode 100644 lib/classes/compatibility/imagify.php delete mode 100644 lib/classes/compatibility/js/shortpixel.js delete mode 100644 lib/classes/compatibility/shortpixel.php delete mode 100644 lib/classes/compatibility/siteorigin-css.php delete mode 100644 lib/classes/compatibility/siteorigin-widget-bundle.php delete mode 100644 lib/classes/compatibility/vidorev.php delete mode 100644 lib/classes/compatibility/woo-extra-product-options.php delete mode 100644 lib/classes/compatibility/woocommerce.php delete mode 100644 lib/classes/compatibility/wp-retina-2x.php delete mode 100644 lib/classes/compatibility/wp-smush.php delete mode 100644 lib/classes/compatibility/wpbakery-page-builder.php delete mode 100644 lib/classes/compatibility/wpforms.php delete mode 100755 vendor/bin/mozart delete mode 100644 vendor/coenjacobs/mozart/.github/FUNDING.yml delete mode 100644 vendor/coenjacobs/mozart/.github/workflows/analysis.yml delete mode 100644 vendor/coenjacobs/mozart/.github/workflows/docker-latest.yml delete mode 100644 vendor/coenjacobs/mozart/.github/workflows/main.yml delete mode 100644 vendor/coenjacobs/mozart/.github/workflows/release.yml delete mode 100644 vendor/coenjacobs/mozart/.gitignore delete mode 100644 vendor/coenjacobs/mozart/Dockerfile delete mode 100644 vendor/coenjacobs/mozart/LICENSE delete mode 100644 vendor/coenjacobs/mozart/README.md delete mode 100755 vendor/coenjacobs/mozart/bin/mozart delete mode 100644 vendor/coenjacobs/mozart/composer.json delete mode 100644 vendor/coenjacobs/mozart/phpcs.xml delete mode 100644 vendor/coenjacobs/mozart/phpunit.xml delete mode 100644 vendor/coenjacobs/mozart/psalm.xml delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Autoload/Classmap.php delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Autoload/Psr4.php delete mode 100644 vendor/coenjacobs/mozart/src/Composer/Package.php delete mode 100644 vendor/coenjacobs/mozart/src/Console/Application.php delete mode 100644 vendor/coenjacobs/mozart/src/Console/Commands/Compose.php delete mode 100644 vendor/coenjacobs/mozart/src/Mover.php delete mode 100644 vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php delete mode 100644 vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php delete mode 100644 vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php delete mode 100644 vendor/coenjacobs/mozart/src/Replace/Replacer.php delete mode 100644 vendor/coenjacobs/mozart/src/Replacer.php delete mode 100644 vendor/coenjacobs/mozart/tests/Console/Commands/ComposeTest.php delete mode 100644 vendor/coenjacobs/mozart/tests/MoverTest.php delete mode 100644 vendor/coenjacobs/mozart/tests/issue89-composer.json delete mode 100644 vendor/coenjacobs/mozart/tests/replacers/ClassMapReplacerTest.php delete mode 100644 vendor/coenjacobs/mozart/tests/replacers/ClassmapReplacerIntegrationTest.php delete mode 100644 vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerIntegrationTest.php delete mode 100644 vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerTest.php delete mode 100644 vendor/composer/autoload_files.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/.circleci/config.yml delete mode 100644 vendor/deliciousbrains/wp-background-processing/.gitignore delete mode 100644 vendor/deliciousbrains/wp-background-processing/.phpcs.xml delete mode 100644 vendor/deliciousbrains/wp-background-processing/Makefile delete mode 100644 vendor/deliciousbrains/wp-background-processing/README.md delete mode 100755 vendor/deliciousbrains/wp-background-processing/bin/install-wp-tests.sh delete mode 100644 vendor/deliciousbrains/wp-background-processing/classes/wp-async-request.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/classes/wp-background-process.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/composer.json delete mode 100644 vendor/deliciousbrains/wp-background-processing/composer.lock delete mode 100644 vendor/deliciousbrains/wp-background-processing/license.txt delete mode 100644 vendor/deliciousbrains/wp-background-processing/phpunit.xml delete mode 100644 vendor/deliciousbrains/wp-background-processing/tests/Test_Setup.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/tests/Test_WP_Background_Process.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/tests/bootstrap.php delete mode 100644 vendor/deliciousbrains/wp-background-processing/wp-background-processing.php create mode 100644 vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php delete mode 100644 vendor/league/flysystem/CODE_OF_CONDUCT.md delete mode 100644 vendor/league/flysystem/LICENSE delete mode 100644 vendor/league/flysystem/SECURITY.md delete mode 100644 vendor/league/flysystem/composer.json delete mode 100644 vendor/league/flysystem/deprecations.md delete mode 100644 vendor/league/flysystem/src/Adapter/AbstractAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php delete mode 100644 vendor/league/flysystem/src/Adapter/Ftp.php delete mode 100644 vendor/league/flysystem/src/Adapter/Ftpd.php delete mode 100644 vendor/league/flysystem/src/Adapter/Local.php delete mode 100644 vendor/league/flysystem/src/Adapter/NullAdapter.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedCopyTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/Polyfill/StreamedWritingTrait.php delete mode 100644 vendor/league/flysystem/src/Adapter/SynologyFtp.php delete mode 100644 vendor/league/flysystem/src/AdapterInterface.php delete mode 100644 vendor/league/flysystem/src/Config.php delete mode 100644 vendor/league/flysystem/src/ConfigAwareTrait.php delete mode 100644 vendor/league/flysystem/src/ConnectionErrorException.php delete mode 100644 vendor/league/flysystem/src/ConnectionRuntimeException.php delete mode 100644 vendor/league/flysystem/src/CorruptedPathDetected.php delete mode 100644 vendor/league/flysystem/src/Directory.php delete mode 100644 vendor/league/flysystem/src/Exception.php delete mode 100644 vendor/league/flysystem/src/File.php delete mode 100644 vendor/league/flysystem/src/FileExistsException.php delete mode 100644 vendor/league/flysystem/src/FileNotFoundException.php delete mode 100644 vendor/league/flysystem/src/Filesystem.php delete mode 100644 vendor/league/flysystem/src/FilesystemException.php delete mode 100644 vendor/league/flysystem/src/FilesystemInterface.php delete mode 100644 vendor/league/flysystem/src/FilesystemNotFoundException.php delete mode 100644 vendor/league/flysystem/src/Handler.php delete mode 100644 vendor/league/flysystem/src/InvalidRootException.php delete mode 100644 vendor/league/flysystem/src/MountManager.php delete mode 100644 vendor/league/flysystem/src/NotSupportedException.php delete mode 100644 vendor/league/flysystem/src/Plugin/AbstractPlugin.php delete mode 100644 vendor/league/flysystem/src/Plugin/EmptyDir.php delete mode 100644 vendor/league/flysystem/src/Plugin/ForcedCopy.php delete mode 100644 vendor/league/flysystem/src/Plugin/ForcedRename.php delete mode 100644 vendor/league/flysystem/src/Plugin/GetWithMetadata.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListFiles.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListPaths.php delete mode 100644 vendor/league/flysystem/src/Plugin/ListWith.php delete mode 100644 vendor/league/flysystem/src/Plugin/PluggableTrait.php delete mode 100644 vendor/league/flysystem/src/Plugin/PluginNotFoundException.php delete mode 100644 vendor/league/flysystem/src/PluginInterface.php delete mode 100644 vendor/league/flysystem/src/ReadInterface.php delete mode 100644 vendor/league/flysystem/src/RootViolationException.php delete mode 100644 vendor/league/flysystem/src/SafeStorage.php delete mode 100644 vendor/league/flysystem/src/UnreadableFileException.php delete mode 100644 vendor/league/flysystem/src/Util.php delete mode 100644 vendor/league/flysystem/src/Util/ContentListingFormatter.php delete mode 100644 vendor/league/flysystem/src/Util/MimeType.php delete mode 100644 vendor/league/flysystem/src/Util/StreamHasher.php delete mode 100644 vendor/league/mime-type-detection/CHANGELOG.md delete mode 100644 vendor/league/mime-type-detection/LICENSE delete mode 100644 vendor/league/mime-type-detection/composer.json delete mode 100644 vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/ExtensionMimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/FinfoMimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php delete mode 100644 vendor/league/mime-type-detection/src/MimeTypeDetector.php delete mode 100644 vendor/league/mime-type-detection/src/OverridingExtensionToMimeTypeMap.php delete mode 100644 vendor/psr/container/.gitignore delete mode 100644 vendor/psr/container/LICENSE delete mode 100644 vendor/psr/container/README.md delete mode 100644 vendor/psr/container/composer.json delete mode 100644 vendor/psr/container/src/ContainerExceptionInterface.php delete mode 100644 vendor/psr/container/src/ContainerInterface.php delete mode 100644 vendor/psr/container/src/NotFoundExceptionInterface.php delete mode 100644 vendor/symfony/console/Application.php delete mode 100644 vendor/symfony/console/Attribute/AsCommand.php delete mode 100644 vendor/symfony/console/CHANGELOG.md delete mode 100644 vendor/symfony/console/CI/GithubActionReporter.php delete mode 100644 vendor/symfony/console/Color.php delete mode 100644 vendor/symfony/console/Command/Command.php delete mode 100644 vendor/symfony/console/Command/CompleteCommand.php delete mode 100644 vendor/symfony/console/Command/DumpCompletionCommand.php delete mode 100644 vendor/symfony/console/Command/HelpCommand.php delete mode 100644 vendor/symfony/console/Command/LazyCommand.php delete mode 100644 vendor/symfony/console/Command/ListCommand.php delete mode 100644 vendor/symfony/console/Command/LockableTrait.php delete mode 100644 vendor/symfony/console/Command/SignalableCommandInterface.php delete mode 100644 vendor/symfony/console/CommandLoader/CommandLoaderInterface.php delete mode 100644 vendor/symfony/console/CommandLoader/ContainerCommandLoader.php delete mode 100644 vendor/symfony/console/CommandLoader/FactoryCommandLoader.php delete mode 100644 vendor/symfony/console/Completion/CompletionInput.php delete mode 100644 vendor/symfony/console/Completion/CompletionSuggestions.php delete mode 100644 vendor/symfony/console/Completion/Output/BashCompletionOutput.php delete mode 100644 vendor/symfony/console/Completion/Output/CompletionOutputInterface.php delete mode 100644 vendor/symfony/console/Completion/Suggestion.php delete mode 100644 vendor/symfony/console/ConsoleEvents.php delete mode 100644 vendor/symfony/console/Cursor.php delete mode 100644 vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php delete mode 100644 vendor/symfony/console/Descriptor/ApplicationDescription.php delete mode 100644 vendor/symfony/console/Descriptor/Descriptor.php delete mode 100644 vendor/symfony/console/Descriptor/DescriptorInterface.php delete mode 100644 vendor/symfony/console/Descriptor/JsonDescriptor.php delete mode 100644 vendor/symfony/console/Descriptor/MarkdownDescriptor.php delete mode 100644 vendor/symfony/console/Descriptor/TextDescriptor.php delete mode 100644 vendor/symfony/console/Descriptor/XmlDescriptor.php delete mode 100644 vendor/symfony/console/Event/ConsoleCommandEvent.php delete mode 100644 vendor/symfony/console/Event/ConsoleErrorEvent.php delete mode 100644 vendor/symfony/console/Event/ConsoleEvent.php delete mode 100644 vendor/symfony/console/Event/ConsoleSignalEvent.php delete mode 100644 vendor/symfony/console/Event/ConsoleTerminateEvent.php delete mode 100644 vendor/symfony/console/EventListener/ErrorListener.php delete mode 100644 vendor/symfony/console/Exception/CommandNotFoundException.php delete mode 100644 vendor/symfony/console/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/console/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/console/Exception/InvalidOptionException.php delete mode 100644 vendor/symfony/console/Exception/LogicException.php delete mode 100644 vendor/symfony/console/Exception/MissingInputException.php delete mode 100644 vendor/symfony/console/Exception/NamespaceNotFoundException.php delete mode 100644 vendor/symfony/console/Exception/RuntimeException.php delete mode 100644 vendor/symfony/console/Formatter/NullOutputFormatter.php delete mode 100644 vendor/symfony/console/Formatter/NullOutputFormatterStyle.php delete mode 100644 vendor/symfony/console/Formatter/OutputFormatter.php delete mode 100644 vendor/symfony/console/Formatter/OutputFormatterInterface.php delete mode 100644 vendor/symfony/console/Formatter/OutputFormatterStyle.php delete mode 100644 vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php delete mode 100644 vendor/symfony/console/Formatter/OutputFormatterStyleStack.php delete mode 100644 vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php delete mode 100644 vendor/symfony/console/Helper/DebugFormatterHelper.php delete mode 100644 vendor/symfony/console/Helper/DescriptorHelper.php delete mode 100644 vendor/symfony/console/Helper/Dumper.php delete mode 100644 vendor/symfony/console/Helper/FormatterHelper.php delete mode 100644 vendor/symfony/console/Helper/Helper.php delete mode 100644 vendor/symfony/console/Helper/HelperInterface.php delete mode 100644 vendor/symfony/console/Helper/HelperSet.php delete mode 100644 vendor/symfony/console/Helper/InputAwareHelper.php delete mode 100644 vendor/symfony/console/Helper/ProcessHelper.php delete mode 100644 vendor/symfony/console/Helper/ProgressBar.php delete mode 100644 vendor/symfony/console/Helper/ProgressIndicator.php delete mode 100644 vendor/symfony/console/Helper/QuestionHelper.php delete mode 100644 vendor/symfony/console/Helper/SymfonyQuestionHelper.php delete mode 100644 vendor/symfony/console/Helper/Table.php delete mode 100644 vendor/symfony/console/Helper/TableCell.php delete mode 100644 vendor/symfony/console/Helper/TableCellStyle.php delete mode 100644 vendor/symfony/console/Helper/TableRows.php delete mode 100644 vendor/symfony/console/Helper/TableSeparator.php delete mode 100644 vendor/symfony/console/Helper/TableStyle.php delete mode 100644 vendor/symfony/console/Input/ArgvInput.php delete mode 100644 vendor/symfony/console/Input/ArrayInput.php delete mode 100644 vendor/symfony/console/Input/Input.php delete mode 100644 vendor/symfony/console/Input/InputArgument.php delete mode 100644 vendor/symfony/console/Input/InputAwareInterface.php delete mode 100644 vendor/symfony/console/Input/InputDefinition.php delete mode 100644 vendor/symfony/console/Input/InputInterface.php delete mode 100644 vendor/symfony/console/Input/InputOption.php delete mode 100644 vendor/symfony/console/Input/StreamableInputInterface.php delete mode 100644 vendor/symfony/console/Input/StringInput.php delete mode 100644 vendor/symfony/console/LICENSE delete mode 100644 vendor/symfony/console/Logger/ConsoleLogger.php delete mode 100644 vendor/symfony/console/Output/BufferedOutput.php delete mode 100644 vendor/symfony/console/Output/ConsoleOutput.php delete mode 100644 vendor/symfony/console/Output/ConsoleOutputInterface.php delete mode 100644 vendor/symfony/console/Output/ConsoleSectionOutput.php delete mode 100644 vendor/symfony/console/Output/NullOutput.php delete mode 100644 vendor/symfony/console/Output/Output.php delete mode 100644 vendor/symfony/console/Output/OutputInterface.php delete mode 100644 vendor/symfony/console/Output/StreamOutput.php delete mode 100644 vendor/symfony/console/Output/TrimmedBufferOutput.php delete mode 100644 vendor/symfony/console/Question/ChoiceQuestion.php delete mode 100644 vendor/symfony/console/Question/ConfirmationQuestion.php delete mode 100644 vendor/symfony/console/Question/Question.php delete mode 100644 vendor/symfony/console/README.md delete mode 100644 vendor/symfony/console/Resources/bin/hiddeninput.exe delete mode 100644 vendor/symfony/console/Resources/completion.bash delete mode 100644 vendor/symfony/console/SignalRegistry/SignalRegistry.php delete mode 100644 vendor/symfony/console/SingleCommandApplication.php delete mode 100644 vendor/symfony/console/Style/OutputStyle.php delete mode 100644 vendor/symfony/console/Style/StyleInterface.php delete mode 100644 vendor/symfony/console/Style/SymfonyStyle.php delete mode 100644 vendor/symfony/console/Terminal.php delete mode 100644 vendor/symfony/console/Tester/ApplicationTester.php delete mode 100644 vendor/symfony/console/Tester/CommandCompletionTester.php delete mode 100644 vendor/symfony/console/Tester/CommandTester.php delete mode 100644 vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php delete mode 100644 vendor/symfony/console/Tester/TesterTrait.php delete mode 100644 vendor/symfony/console/composer.json delete mode 100644 vendor/symfony/deprecation-contracts/CHANGELOG.md delete mode 100644 vendor/symfony/deprecation-contracts/README.md delete mode 100644 vendor/symfony/deprecation-contracts/composer.json delete mode 100644 vendor/symfony/deprecation-contracts/function.php delete mode 100644 vendor/symfony/finder/CHANGELOG.md delete mode 100644 vendor/symfony/finder/Comparator/Comparator.php delete mode 100644 vendor/symfony/finder/Comparator/DateComparator.php delete mode 100644 vendor/symfony/finder/Comparator/NumberComparator.php delete mode 100644 vendor/symfony/finder/Exception/AccessDeniedException.php delete mode 100644 vendor/symfony/finder/Exception/DirectoryNotFoundException.php delete mode 100644 vendor/symfony/finder/Finder.php delete mode 100644 vendor/symfony/finder/Gitignore.php delete mode 100644 vendor/symfony/finder/Glob.php delete mode 100644 vendor/symfony/finder/Iterator/CustomFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/DateRangeFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/FileTypeFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/FilecontentFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/FilenameFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/LazyIterator.php delete mode 100644 vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/PathFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php delete mode 100644 vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php delete mode 100644 vendor/symfony/finder/Iterator/SortableIterator.php delete mode 100644 vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php delete mode 100644 vendor/symfony/finder/LICENSE delete mode 100644 vendor/symfony/finder/README.md delete mode 100644 vendor/symfony/finder/SplFileInfo.php delete mode 100644 vendor/symfony/finder/composer.json delete mode 100644 vendor/symfony/polyfill-ctype/Ctype.php delete mode 100644 vendor/symfony/polyfill-ctype/LICENSE delete mode 100644 vendor/symfony/polyfill-ctype/README.md delete mode 100644 vendor/symfony/polyfill-ctype/bootstrap.php delete mode 100644 vendor/symfony/polyfill-ctype/bootstrap80.php delete mode 100644 vendor/symfony/polyfill-ctype/composer.json delete mode 100644 vendor/symfony/polyfill-intl-grapheme/Grapheme.php delete mode 100644 vendor/symfony/polyfill-intl-grapheme/LICENSE delete mode 100644 vendor/symfony/polyfill-intl-grapheme/README.md delete mode 100644 vendor/symfony/polyfill-intl-grapheme/bootstrap.php delete mode 100644 vendor/symfony/polyfill-intl-grapheme/bootstrap80.php delete mode 100644 vendor/symfony/polyfill-intl-grapheme/composer.json delete mode 100644 vendor/symfony/polyfill-intl-normalizer/LICENSE delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Normalizer.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/README.md delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalComposition.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/bootstrap80.php delete mode 100644 vendor/symfony/polyfill-intl-normalizer/composer.json delete mode 100644 vendor/symfony/polyfill-mbstring/LICENSE delete mode 100644 vendor/symfony/polyfill-mbstring/Mbstring.php delete mode 100644 vendor/symfony/polyfill-mbstring/README.md delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php delete mode 100644 vendor/symfony/polyfill-mbstring/Resources/unidata/upperCase.php delete mode 100644 vendor/symfony/polyfill-mbstring/bootstrap.php delete mode 100644 vendor/symfony/polyfill-mbstring/bootstrap80.php delete mode 100644 vendor/symfony/polyfill-mbstring/composer.json delete mode 100644 vendor/symfony/polyfill-php73/LICENSE delete mode 100644 vendor/symfony/polyfill-php73/Php73.php delete mode 100644 vendor/symfony/polyfill-php73/README.md delete mode 100644 vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php delete mode 100644 vendor/symfony/polyfill-php73/bootstrap.php delete mode 100644 vendor/symfony/polyfill-php80/LICENSE delete mode 100644 vendor/symfony/polyfill-php80/Php80.php delete mode 100644 vendor/symfony/polyfill-php80/PhpToken.php delete mode 100644 vendor/symfony/polyfill-php80/README.md delete mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php delete mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php delete mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php delete mode 100644 vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php delete mode 100644 vendor/symfony/polyfill-php80/bootstrap.php delete mode 100644 vendor/symfony/polyfill-php80/composer.json delete mode 100644 vendor/symfony/service-contracts/Attribute/Required.php delete mode 100644 vendor/symfony/service-contracts/Attribute/SubscribedService.php delete mode 100644 vendor/symfony/service-contracts/CHANGELOG.md delete mode 100644 vendor/symfony/service-contracts/LICENSE delete mode 100644 vendor/symfony/service-contracts/README.md delete mode 100644 vendor/symfony/service-contracts/ResetInterface.php delete mode 100644 vendor/symfony/service-contracts/ServiceLocatorTrait.php delete mode 100644 vendor/symfony/service-contracts/ServiceProviderInterface.php delete mode 100644 vendor/symfony/service-contracts/ServiceSubscriberInterface.php delete mode 100644 vendor/symfony/service-contracts/ServiceSubscriberTrait.php delete mode 100644 vendor/symfony/service-contracts/Test/ServiceLocatorTest.php delete mode 100644 vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php delete mode 100644 vendor/symfony/service-contracts/composer.json delete mode 100644 vendor/symfony/string/AbstractString.php delete mode 100644 vendor/symfony/string/AbstractUnicodeString.php delete mode 100644 vendor/symfony/string/ByteString.php delete mode 100644 vendor/symfony/string/CHANGELOG.md delete mode 100644 vendor/symfony/string/CodePointString.php delete mode 100644 vendor/symfony/string/Exception/ExceptionInterface.php delete mode 100644 vendor/symfony/string/Exception/InvalidArgumentException.php delete mode 100644 vendor/symfony/string/Exception/RuntimeException.php delete mode 100644 vendor/symfony/string/Inflector/EnglishInflector.php delete mode 100644 vendor/symfony/string/Inflector/FrenchInflector.php delete mode 100644 vendor/symfony/string/Inflector/InflectorInterface.php delete mode 100644 vendor/symfony/string/LICENSE delete mode 100644 vendor/symfony/string/LazyString.php delete mode 100644 vendor/symfony/string/README.md delete mode 100644 vendor/symfony/string/Resources/data/wcswidth_table_wide.php delete mode 100644 vendor/symfony/string/Resources/data/wcswidth_table_zero.php delete mode 100644 vendor/symfony/string/Resources/functions.php delete mode 100644 vendor/symfony/string/Slugger/AsciiSlugger.php delete mode 100644 vendor/symfony/string/Slugger/SluggerInterface.php delete mode 100644 vendor/symfony/string/UnicodeString.php delete mode 100644 vendor/symfony/string/composer.json rename vendor/udx/lib-ud-api-client/lib/classes/{class-license-checker.php => class-update-checker.php} (92%) create mode 100644 vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php create mode 100644 vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php create mode 100644 vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php create mode 100644 vendor/wpmetabox/meta-box/.distignore delete mode 100644 vendor/wpmetabox/meta-box/README.md delete mode 100644 vendor/wpmetabox/meta-box/composer.json delete mode 100644 vendor/wpmetabox/meta-box/css/media-modal.css create mode 100644 vendor/wpmetabox/meta-box/css/modal.css create mode 100644 vendor/wpmetabox/meta-box/css/osm-frontend.css delete mode 100644 vendor/wpmetabox/meta-box/css/taxonomy.css delete mode 100644 vendor/wpmetabox/meta-box/gulpfile.js create mode 100644 vendor/wpmetabox/meta-box/inc/about/sections/review.php delete mode 100644 vendor/wpmetabox/meta-box/inc/update/checker.php create mode 100644 vendor/wpmetabox/meta-box/js/modal.js create mode 100644 vendor/wpmetabox/meta-box/js/post.js create mode 100644 vendor/wpmetabox/meta-box/js/user.js delete mode 100644 vendor/wpmetabox/meta-box/js/validation.min.js delete mode 100644 vendor/wpmetabox/meta-box/js/validation/additional-methods.js delete mode 100644 vendor/wpmetabox/meta-box/js/validation/jquery.validate.js delete mode 100644 vendor/wpmetabox/meta-box/js/validation/validation.js delete mode 100644 vendor/wpmetabox/meta-box/package.json create mode 100644 vendor/wpmetabox/meta-box/src/Block/Register.php create mode 100644 vendor/wpmetabox/meta-box/src/Bricks/Register.php create mode 100644 vendor/wpmetabox/meta-box/src/Elementor/Register.php create mode 100644 vendor/wpmetabox/meta-box/src/Oxygen/Register.php create mode 100644 vendor/wpmetabox/meta-box/src/Support/Arr.php create mode 100644 vendor/wpmetabox/meta-box/src/Support/Data.php create mode 100644 vendor/wpmetabox/meta-box/src/Updater/Checker.php rename vendor/wpmetabox/meta-box/{inc/update/notification.php => src/Updater/Notification.php} (74%) rename vendor/wpmetabox/meta-box/{inc/update/option.php => src/Updater/Option.php} (60%) rename vendor/wpmetabox/meta-box/{inc/update/settings.php => src/Updater/Settings.php} (74%) delete mode 100644 vendor/wpmetabox/meta-box/tests/001-helper.php delete mode 100644 vendor/wpmetabox/meta-box/tests/002-wysiwyg-clone.php delete mode 100644 vendor/wpmetabox/meta-box/tests/003-wpml.php delete mode 100644 vendor/wpmetabox/meta-box/tests/004-same-ids.php delete mode 100644 vendor/wpmetabox/meta-box/tests/005-rwmb-the-value.php delete mode 100644 vendor/wpmetabox/meta-box/tests/006-oembed-clone-remove-preview.php delete mode 100644 vendor/wpmetabox/meta-box/tests/007-large-embed.php delete mode 100644 vendor/wpmetabox/meta-box/tests/008-input-types.php delete mode 100644 vendor/wpmetabox/meta-box/tests/009-datetime.php delete mode 100644 vendor/wpmetabox/meta-box/tests/010-clone-style.php delete mode 100644 vendor/wpmetabox/meta-box/tests/011-choices.php delete mode 100644 vendor/wpmetabox/meta-box/tests/012-multiple-localize-scripts.php delete mode 100644 vendor/wpmetabox/meta-box/tests/013-clone-default.php delete mode 100644 vendor/wpmetabox/meta-box/tests/014-clone-taxonomy-advanced.php delete mode 100644 vendor/wpmetabox/meta-box/tests/015-save-field-value.php delete mode 100644 vendor/wpmetabox/meta-box/tests/016-file-upload-custom-folder.php delete mode 100644 vendor/wpmetabox/meta-box/tests/017-shortcode.php delete mode 100644 vendor/wpmetabox/meta-box/tests/018-label-description-required.php diff --git a/changelog.txt b/changelog.txt index 143612745..cdb03fc0d 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,12 @@ == Changelog == = 4.0.0 = +* FIX - Stateless mode Incompatible with Media Uploader in Media Library Grid mode [#675](https://github.com/udx/wp-stateless/issues/675). +* FIX - Prevent duplicating messages in Admin Panel. +* COMPATIBILITY - Dynamic Image Support is now part of the core. +* COMPATIBILITY - Google App Engine is now part of the core. Automatically enables **Stateless** mode when Google App Engine detected. Can be disabled using `WP_STATELESS_COMPATIBILITY_GAE` constant. * COMPATIBILITY - Removed compatibility with "Advanced Custom Fields: Image Crop Add-on", because plugin is deprecated. +* COMPATIBILITY - Removed compatibility with "VidoRev" plugin. +* COMPATIBILITY - Removed compatibility with "WP Retina 2x" plugin. * COMPATIBILITY - BuddyBoss Platform compatibility moved to a separate plugin [WP-Stateless - BuddyBoss Platform Addon](https://github.com/udx/wp-stateless-buddyboss-addon). * COMPATIBILITY - BuddyPress compatibility moved to a separate plugin [WP-Stateless - BuddyPress Addon](https://github.com/udx/wp-stateless-buddypress-addon). * COMPATIBILITY - Easy Digital Downloads compatibility moved to a separate plugin [WP-Stateless - Easy Digital Downloads Addon](https://github.com/udx/wp-stateless-easy-digital-downloads-addon). @@ -14,6 +20,20 @@ * COMPATIBILITY - Simple Local Avatar compatibility moved to a separate plugin [WP-Stateless - Simple Local Avatars Addon](https://github.com/udx/wp-stateless-simple-local-avatars-addon). * COMPATIBILITY - SiteOrigin CSS compatibility moved to a separate plugin [WP-Stateless - SiteOrigin CSS Addon](https://github.com/udx/wp-stateless-siteorigin-css-addon). * COMPATIBILITY - SiteOrigin Widgets Bundle compatibility moved to a separate plugin [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://github.com/udx/wp-stateless-siteorigin-widgets-bundle-addon). +* COMPATIBILITY - WPBakery Page Builder compatibility moved to a separate plugin [WP-Stateless - WPBakery Page Builder Addon](https://github.com/udx/wp-stateless-wpbakery-page-builder-addon). +* COMPATIBILITY - WooCommerce compatibility moved to a separate plugin [WP-Stateless - WooCommerce Addon](https://github.com/udx/wp-stateless-woocommerce-addon). +* COMPATIBILITY - WooCommerce Extra Product Options compatibility moved to a separate plugin [WP-Stateless - WooCommerce Extra Product Options Addon](https://github.com/udx/wp-stateless-woo-extra-product-options-addon). +* COMPATIBILITY - Contact Form by WPForms compatibility moved to a separate plugin [WP-Stateless - Contact Form by WPForms Addon](https://github.com/udx/wp-stateless-wp-forms-lite-addon). +* COMPATIBILITY - Smush compatibility moved to a separate plugin [WP-Stateless - Smush Addon](https://github.com/udx/wp-stateless-wp-smushit-addon). +* COMPATIBILITY - ShortPixel Image Optimizer compatibility moved to a separate plugin [WP-Stateless - ShortPixel Image Optimizer Addon](https://github.com/udx/wp-stateless-shortpixel-addon). +* COMPATIBILITY - EWWW Image Optimizer compatibility moved to a separate plugin [WP-Stateless - EWWW Image Optimizer Addon](https://github.com/udx/wp-stateless-ewww-addon). +* COMPATIBILITY - Imagify compatibility moved to a separate plugin [WP-Stateless - Imagify Addon](https://github.com/udx/wp-stateless-imagify-addon). +* COMPATIBILITY - The Events Calendar compatibility moved to a separate plugin [WP-Stateless - The Events Calendar Addon](https://github.com/udx/wp-stateless-the-events-calendar-addon). +* COMPATIBILITY - any compatibility is enabled by default after installing the addon. +* ENHANCEMENT - Updated Client library for Google APIs to version 2.15.1. +* ENHANCEMENT - Updated Meta Box library to version 5.8.2. +* ENHANCEMENT - Updated Meta Box Tabs to version 1.1.17. +* ENHANCEMENT - Updated JWT library. = 3.2.5 = * FIX - Folder setting does not allow custom structure [#608](https://github.com/udx/wp-stateless/issues/608). diff --git a/changes.md b/changes.md index 24ea68dd9..767973ad3 100644 --- a/changes.md +++ b/changes.md @@ -1,6 +1,11 @@ #### 4.0.0 - +* FIX - Stateless mode Incompatible with Media Uploader in Media Library Grid mode [#675](https://github.com/udx/wp-stateless/issues/675). +* FIX - Prevent duplicating messages in Admin Panel. +* COMPATIBILITY - Dynamic Image Support is now part of the core. +* COMPATIBILITY - Google App Engine is now part of the core. Automatically enables **Stateless** mode when Google App Engine detected. Can be disabled using `WP_STATELESS_COMPATIBILITY_GAE` constant. * COMPATIBILITY - Removed compatibility with "Advanced Custom Fields: Image Crop Add-on", because plugin is deprecated. +* COMPATIBILITY - Removed compatibility with "VidoRev" plugin. +* COMPATIBILITY - Removed compatibility with "WP Retina 2x" plugin. * COMPATIBILITY - BuddyBoss Platform compatibility moved to a separate plugin [WP-Stateless - BuddyBoss Platform Addon](https://github.com/udx/wp-stateless-buddyboss-addon). * COMPATIBILITY - BuddyPress compatibility moved to a separate plugin [WP-Stateless - BuddyPress Addon](https://github.com/udx/wp-stateless-buddypress-addon). * COMPATIBILITY - Easy Digital Downloads compatibility moved to a separate plugin [WP-Stateless - Easy Digital Downloads Addon](https://github.com/udx/wp-stateless-easy-digital-downloads-addon). @@ -14,6 +19,21 @@ * COMPATIBILITY - Simple Local Avatar compatibility moved to a separate plugin [WP-Stateless - Simple Local Avatars Addon](https://github.com/udx/wp-stateless-simple-local-avatars-addon). * COMPATIBILITY - SiteOrigin CSS compatibility moved to a separate plugin [WP-Stateless - SiteOrigin CSS Addon](https://github.com/udx/wp-stateless-siteorigin-css-addon). * COMPATIBILITY - SiteOrigin Widgets Bundle compatibility moved to a separate plugin [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://github.com/udx/wp-stateless-siteorigin-widgets-bundle-addon). +* COMPATIBILITY - SiteOrigin Widgets Bundle compatibility moved to a separate plugin [WP-Stateless - SiteOrigin Widgets Bundle Addon](https://github.com/udx/wp-stateless-siteorigin-widgets-bundle-addon). +* COMPATIBILITY - WPBakery Page Builder compatibility moved to a separate plugin [WP-Stateless - WPBakery Page Builder Addon](https://github.com/udx/wp-stateless-wpbakery-page-builder-addon). +* COMPATIBILITY - WooCommerce compatibility moved to a separate plugin [WP-Stateless - WooCommerce Addon](https://github.com/udx/wp-stateless-woocommerce-addon). +* COMPATIBILITY - WooCommerce Extra Product Options compatibility moved to a separate plugin [WP-Stateless - WooCommerce Extra Product Options Addon](https://github.com/udx/wp-stateless-woo-extra-product-options-addon). +* COMPATIBILITY - Contact Form by WPForms compatibility moved to a separate plugin [WP-Stateless - Contact Form by WPForms Addon](https://github.com/udx/wp-stateless-wp-forms-lite-addon). +* COMPATIBILITY - Smush compatibility moved to a separate plugin [WP-Stateless - Smush Addon](https://github.com/udx/wp-stateless-wp-smushit-addon). +* COMPATIBILITY - ShortPixel Image Optimizer compatibility moved to a separate plugin [WP-Stateless - ShortPixel Image Optimizer Addon](https://github.com/udx/wp-stateless-shortpixel-addon). +* COMPATIBILITY - EWWW Image Optimizer compatibility moved to a separate plugin [WP-Stateless - EWWW Image Optimizer Addon](https://github.com/udx/wp-stateless-ewww-addon). +* COMPATIBILITY - Imagify compatibility moved to a separate plugin [WP-Stateless - Imagify Addon](https://github.com/udx/wp-stateless-imagify-addon). +* COMPATIBILITY - The Events Calendar compatibility moved to a separate plugin [WP-Stateless - The Events Calendar Addon](https://github.com/udx/wp-stateless-the-events-calendar-addon). +* COMPATIBILITY - any compatibility is enabled by default after installing the addon. +* ENHANCEMENT - Updated Client library for Google APIs to version 2.15.1. +* ENHANCEMENT - Updated Meta Box library to version 5.8.2. +* ENHANCEMENT - Updated Meta Box Tabs to version 1.1.17. +* ENHANCEMENT - Updated JWT library. #### 3.2.5 * FIX - Folder setting does not allow custom structure [#608](https://github.com/udx/wp-stateless/issues/608). diff --git a/composer.json b/composer.json index 345c7ab8a..e805684c9 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "udx/lib-ud-api-client": "~1.2", "ccampbell/chromephp": "^4.1", "firebase/php-jwt": "^6.1.2", - "wpmetabox/meta-box": "5.6.3" + "wpmetabox/meta-box": "^5.6.3" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock index c94e9e3a9..267945b37 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e12415dd225dd16878a4f85007e8db5e", + "content-hash": "1763bfd3d53f8f11612d0a9cb9b037da", "packages": [ { "name": "ccampbell/chromephp", @@ -47,6 +47,10 @@ "log", "logging" ], + "support": { + "issues": "https://github.com/ccampbell/chromephp/issues", + "source": "https://github.com/ccampbell/chromephp/tree/4.1.0" + }, "time": "2013-06-26T03:44:33+00:00" }, { @@ -180,6 +184,10 @@ "zend", "zikula" ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.12.0" + }, "funding": [ { "url": "https://packagist.com", @@ -198,16 +206,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.6.0", + "version": "v6.9.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa" + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5a9cf79b4a2eb347230384648cc7b0d68cd97faa", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", "shasum": "" }, "require": { @@ -253,7 +261,11 @@ "jwt", "php" ], - "time": "2023-06-13T17:11:06+00:00" + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" + }, + "time": "2023-10-05T00:24:42+00:00" }, { "name": "udx/lib-settings", @@ -265,8 +277,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip", - "reference": "0.3.0" + "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip" }, "require": { "udx/lib-utility": "~0.3" @@ -332,8 +343,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip", - "reference": "1.2.1" + "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip" }, "require": { "php": ">=5.3" @@ -376,8 +386,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip", - "reference": "0.4.0" + "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip" }, "require-dev": { "phpunit/phpunit": "4.1.*" @@ -436,8 +445,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip", - "reference": "1.3.0" + "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip" }, "require": { "php": ">=5.3", @@ -463,19 +471,24 @@ }, { "name": "wpmetabox/meta-box", - "version": "5.6.3", + "version": "5.8.2", "source": { "type": "git", "url": "https://github.com/wpmetabox/meta-box.git", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856" + "reference": "de583a74171bdee1b5213232a5bf50f82c6fee14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c2c4a30ed70163dfdfe93f2865e88a7a45c46856", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856", + "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/de583a74171bdee1b5213232a5bf50f82c6fee14", + "reference": "de583a74171bdee1b5213232a5bf50f82c6fee14", "shasum": "" }, "type": "wordpress-plugin", + "autoload": { + "psr-4": { + "MetaBox\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0" @@ -499,7 +512,11 @@ "wordpress-plugin", "wp-admin" ], - "time": "2022-04-18T03:20:58+00:00" + "support": { + "issues": "https://github.com/wpmetabox/meta-box/issues", + "source": "https://github.com/wpmetabox/meta-box/tree/5.8.2" + }, + "time": "2023-10-13T13:53:33+00:00" } ], "packages-dev": [ @@ -549,6 +566,10 @@ } ], "description": "Composes all dependencies as a package inside a WordPress plugin", + "support": { + "issues": "https://github.com/coenjacobs/mozart/issues", + "source": "https://github.com/coenjacobs/mozart/tree/0.7.1" + }, "funding": [ { "url": "https://github.com/coenjacobs", @@ -559,16 +580,16 @@ }, { "name": "deliciousbrains/wp-background-processing", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/deliciousbrains/wp-background-processing.git", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d" + "reference": "ebbed762c42e70e76573ffbd36e591378ba5f2ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", + "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/ebbed762c42e70e76573ffbd36e591378ba5f2ee", + "reference": "ebbed762c42e70e76573ffbd36e591378ba5f2ee", "shasum": "" }, "require": { @@ -601,7 +622,11 @@ } ], "description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.", - "time": "2023-04-18T12:32:25+00:00" + "support": { + "issues": "https://github.com/deliciousbrains/wp-background-processing/issues", + "source": "https://github.com/deliciousbrains/wp-background-processing/tree/1.1.1" + }, + "time": "2023-07-18T10:22:06+00:00" }, { "name": "league/flysystem", @@ -685,6 +710,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -695,26 +724,26 @@ }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -733,6 +762,10 @@ } ], "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" + }, "funding": [ { "url": "https://github.com/frankdejonge", @@ -743,7 +776,7 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2023-10-17T14:13:20+00:00" }, { "name": "psr/container", @@ -792,20 +825,24 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, "time": "2021-11-05T16:47:00+00:00" }, { "name": "symfony/console", - "version": "v5.4.24", + "version": "v5.4.31", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" + "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", + "url": "https://api.github.com/repos/symfony/console/zipball/11ac5f154e0e5c4c77af83ad11ead9165280b92a", + "reference": "11ac5f154e0e5c4c77af83ad11ead9165280b92a", "shasum": "" }, "require": { @@ -874,6 +911,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.31" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -888,29 +928,29 @@ "type": "tidelift" } ], - "time": "2023-05-26T05:13:16+00:00" + "time": "2023-10-31T07:58:33+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.3.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -938,6 +978,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -952,20 +995,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2022-01-02T09:55:41+00:00" }, { "name": "symfony/finder", - "version": "v5.4.21", + "version": "v5.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", "shasum": "" }, "require": { @@ -998,6 +1041,9 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.27" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1012,20 +1058,20 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:33:00+00:00" + "time": "2023-07-31T08:02:31+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -1040,7 +1086,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1077,6 +1123,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1091,20 +1140,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -1116,7 +1165,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1155,6 +1204,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1169,20 +1221,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -1194,7 +1246,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1236,6 +1288,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1250,20 +1305,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -1278,7 +1333,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1316,6 +1371,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1330,20 +1388,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -1352,7 +1410,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1392,6 +1450,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1406,20 +1467,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -1428,7 +1489,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -1472,6 +1533,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1486,33 +1550,36 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.3.0", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "psr/container": "^2.0" }, "conflict": { "ext-psr": "<1.1|>=2" }, + "suggest": { + "symfony/service-implementation": "" + }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.4-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1522,10 +1589,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -1551,6 +1615,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1565,37 +1632,36 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2022-05-30T19:17:58+00:00" }, { "name": "symfony/string", - "version": "v6.3.0", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.5" + "symfony/translation-contracts": "<2.0" }, "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.5|^3.0", + "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, "type": "library", @@ -1634,6 +1700,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.19" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1648,7 +1717,7 @@ "type": "tidelift" } ], - "time": "2023-03-21T21:06:29+00:00" + "time": "2023-01-01T08:36:10+00:00" } ], "aliases": [], @@ -1660,5 +1729,5 @@ "php": ">=5.6.20" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.3.0" } diff --git a/lib/Google/CHANGELOG.md b/lib/Google/CHANGELOG.md index 79305bb5a..b6d29393c 100644 --- a/lib/Google/CHANGELOG.md +++ b/lib/Google/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [2.15.1](https://github.com/googleapis/google-api-php-client/compare/v2.15.0...v2.15.1) (2023-09-12) + + +### Bug Fixes + +* Upgrade min phpseclib version ([#2499](https://github.com/googleapis/google-api-php-client/issues/2499)) ([8e7fae2](https://github.com/googleapis/google-api-php-client/commit/8e7fae2b79cfc1b72026347abf6314d91442a018)) + ## [2.15.0](https://github.com/googleapis/google-api-php-client/compare/v2.14.0...v2.15.0) (2023-05-18) diff --git a/lib/Google/CODE_OF_CONDUCT.md b/lib/Google/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..46b2a08ea --- /dev/null +++ b/lib/Google/CODE_OF_CONDUCT.md @@ -0,0 +1,43 @@ +# Contributor Code of Conduct + +As contributors and maintainers of this project, +and in the interest of fostering an open and welcoming community, +we pledge to respect all people who contribute through reporting issues, +posting feature requests, updating documentation, +submitting pull requests or patches, and other activities. + +We are committed to making participation in this project +a harassment-free experience for everyone, +regardless of level of experience, gender, gender identity and expression, +sexual orientation, disability, personal appearance, +body size, race, ethnicity, age, religion, or nationality. + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery +* Personal attacks +* Trolling or insulting/derogatory comments +* Public or private harassment +* Publishing other's private information, +such as physical or electronic +addresses, without explicit permission +* Other unethical or unprofessional conduct. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct. +By adopting this Code of Conduct, +project maintainers commit themselves to fairly and consistently +applying these principles to every aspect of managing this project. +Project maintainers who do not follow or enforce the Code of Conduct +may be permanently removed from the project team. + +This code of conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. + +Instances of abusive, harassing, or otherwise unacceptable behavior +may be reported by opening an issue +or contacting one or more of the project maintainers. + +This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, +available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) diff --git a/lib/Google/README.md b/lib/Google/README.md index 1beb6c88d..b82f44f14 100644 --- a/lib/Google/README.md +++ b/lib/Google/README.md @@ -44,7 +44,7 @@ composer installed. Once composer is installed, execute the following command in your project root to install this library: ```sh -composer require google/apiclient:^2.12.1 +composer require google/apiclient:^2.15.0 ``` Finally, be sure to include the autoloader: @@ -65,7 +65,7 @@ you want to keep in `composer.json`: ```json { "require": { - "google/apiclient": "^2.12.1" + "google/apiclient": "^2.15.0" }, "scripts": { "pre-autoload-dump": "Google\\Task\\Composer::cleanup" @@ -245,9 +245,10 @@ The classes used to call the API in [google-api-php-client-services](https://git A JSON request to the [Datastore API](https://developers.google.com/apis-explorer/#p/datastore/v1beta3/datastore.projects.runQuery) would look like this: -```json +``` POST https://datastore.googleapis.com/v1beta3/projects/YOUR_PROJECT_ID:runQuery?key=YOUR_API_KEY - +``` +```json { "query": { "kind": [{ diff --git a/lib/Google/UPGRADING.md b/lib/Google/UPGRADING.md new file mode 100644 index 000000000..ef939e943 --- /dev/null +++ b/lib/Google/UPGRADING.md @@ -0,0 +1,377 @@ +Google API Client Upgrade Guide +=============================== + +2.x to 2.10.0 +------------- + +### Namespaces + +The Google API Client for PHP now uses namespaces for all classes. Code using +the legacy classnames will continue to work, but it is advised to upgrade to the +underspaced names, as the legacy classnames will be deprecated some time in the +future. + +**Before** + +```php +$client = new Google_Client(); +$service = new Google_Service_Books($client); +``` + +**After** +```php +$client = new Google\Client(); +$service = new Google\Service\Books($client); +``` + +### Service class constructors + +Service class constructors now accept an optional `Google\Client|array` parameter +as their first argument, rather than requiring an instance of `Google\Client`. + +**Before** + +```php +$client = new Google_Client(); +$client->setApplicationName("Client_Library_Examples"); +$client->setDeveloperKey("YOUR_APP_KEY"); + +$service = new Google_Service_Books($client); +``` + +**After** + +```php +$service = new Google\Service\Books([ + 'application_name' => "Client_Library_Examples", + 'developer_key' => "YOUR_APP_KEY", +]); +``` + +1.0 to 2.0 +---------- + +The Google API Client for PHP has undergone major internal changes in `2.0`. Please read through +the list below in order to upgrade to the latest version: + +## Installation now uses `Composer` + +**Before** + +The project was cloned in your project and you would run the autoloader from wherever: + +```php +// the autoload file was included +require_once 'google-api-php-client/src/Google/autoload.php'; // or wherever autoload.php is located +// OR classes were added one-by-one +require_once 'Google/Client.php'; +require_once 'Google/Service/YouTube.php'; +``` + +**After** + +This library now uses [composer](https://getcomposer.org) (We suggest installing +composer [globally](http://symfony.com/doc/current/cookbook/composer.html)). Add this library by +running the following in the root of your project: + +``` +$ composer require google/apiclient:~2.0 +``` + +This will install this library and generate an autoload file in `vendor/autoload.php` in the root +of your project. You can now include this library with the following code: + +```php +require_once 'vendor/autoload.php'; +``` + +## Access Tokens are passed around as arrays instead of JSON strings + +**Before** + +```php +$accessToken = $client->getAccessToken(); +print_r($accessToken); +// would output: +// string(153) "{"access_token":"ya29.FAKsaByOPoddfzvKRo_LBpWWCpVTiAm4BjsvBwxtN7IgSNoUfcErBk_VPl4iAiE1ntb_","token_type":"Bearer","expires_in":3593,"created":1445548590}" +file_put_contents($credentialsPath, $accessToken); +``` + +**After** + +```php +$accessToken = $client->getAccessToken(); +print_r($accessToken); +// will output: +// array(4) { +// ["access_token"]=> +// string(73) "ya29.FAKsaByOPoddfzvKRo_LBpWWCpVTiAm4BjsvBwxtN7IgSNoUfcErBk_VPl4iAiE1ntb_" +// ["token_type"]=> +// string(6) "Bearer" +// ["expires_in"]=> +// int(3593) +// ["created"]=> +// int(1445548590) +// } +file_put_contents($credentialsPath, json_encode($accessToken)); +``` + +## ID Token data is returned as an array + +**Before** + +```php +$ticket = $client->verifyIdToken($idToken); +$data = $ticket->getAttributes(); +$userId = $data['payload']['sub']; +``` + +**After** + +```php +$userData = $client->verifyIdToken($idToken); +$userId = $userData['sub']; +``` + +## `Google_Auth_AssertionCredentials` has been removed + +For service accounts, we now use `setAuthConfig` or `useApplicationDefaultCredentials` + +**Before** + +```php +$client_email = '1234567890-a1b2c3d4e5f6g7h8i@developer.gserviceaccount.com'; +$private_key = file_get_contents('MyProject.p12'); +$scopes = array('https://www.googleapis.com/auth/sqlservice.admin'); +$credentials = new Google_Auth_AssertionCredentials( + $client_email, + $scopes, + $private_key +); +``` + +**After** + +```php +$client->setAuthConfig('/path/to/service-account.json'); + +// OR use environment variables (recommended) + +putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json'); +$client->useApplicationDefaultCredentials(); +``` + +> Note: P12s are deprecated in favor of service account JSON, which can be generated in the +> Credentials section of Google Developer Console. + +In order to impersonate a user, call `setSubject` when your service account +credentials are being used. + +**Before** + +```php +$user_to_impersonate = 'user@example.org'; +$credentials = new Google_Auth_AssertionCredentials( + $client_email, + $scopes, + $private_key, + 'notasecret', // Default P12 password + 'http://oauth.net/grant_type/jwt/1.0/bearer', // Default grant type + $user_to_impersonate, +); +``` + +**After** + +```php +$user_to_impersonate = 'user@example.org'; +$client->setSubject($user_to_impersonate); +``` + +Additionally, `Google_Client::loadServiceAccountJson` has been removed in favor +of `Google_Client::setAuthConfig`: + +**Before** + +```php +$scopes = [ Google_Service_Books::BOOKS ]; +$client->loadServiceAccountJson('/path/to/service-account.json', $scopes); +``` + +**After** + +```php +$scopes = [ Google_Service_Books::BOOKS ]; +$client->setAuthConfig('/path/to/service-account.json'); +$client->setScopes($scopes); +``` + +## `Google_Auth_AppIdentity` has been removed + +For App Engine authentication, we now use the underlying [`google/auth`][Google Auth] and +call `useApplicationDefaultCredentials`: + +**Before** + +```php +$client->setAuth(new Google_Auth_AppIdentity($client)); +$client->getAuth() + ->authenticateForScope('https://www.googleapis.com/auth/sqlservice.admin') +``` + +**After** + +```php +$client->useApplicationDefaultCredentials(); +$client->addScope('https://www.googleapis.com/auth/sqlservice.admin'); +``` + +This will detect when the App Engine environment is present, and use the appropriate credentials. + +## `Google_Auth_Abstract` classes have been removed + +[`google/auth`][Google Auth] is now used for authentication. As a result, all +`Google_Auth`-related functionality has been removed. The methods that were a part of +`Google_Auth_Abstract` have been moved into the `Google_Client` object. + +**Before** + +```php +$request = new Google_Http_Request(); +$client->getAuth()->sign($request); +``` + +**After** + +```php +// create an authorized HTTP client +$httpClient = $client->authorize(); + +// OR add authorization to an existing client +$httpClient = new GuzzleHttp\Client(); +$httpClient = $client->authorize($httpClient); +``` + +**Before** + +```php +$request = new Google_Http_Request(); +$response = $client->getAuth()->authenticatedRequest($request); +``` + +**After** + +```php +$httpClient = $client->authorize(); +$request = new GuzzleHttp\Psr7\Request('POST', $url); +$response = $httpClient->send($request); +``` + +> NOTE: `$request` can be any class implementing +> `Psr\Http\Message\RequestInterface` + +In addition, other methods that were callable on `Google_Auth_OAuth2` are now called +on the `Google_Client` object: + +**Before** + +```php +$client->getAuth()->refreshToken($token); +$client->getAuth()->refreshTokenWithAssertion(); +$client->getAuth()->revokeToken($token); +$client->getAuth()->isAccessTokenExpired(); +``` + +**After** + +```php +$client->refreshToken($token); +$client->refreshTokenWithAssertion(); +$client->revokeToken($token); +$client->isAccessTokenExpired(); +``` + +## PHP 5.6 is now the minimum supported PHP version + +This was previously `PHP 5.2`. If you still need to use PHP 5.2, please continue to use +the [v1-master](https://github.com/google/google-api-php-client/tree/v1-master) branch. + +## Guzzle and PSR-7 are used for HTTP Requests + +The HTTP library Guzzle is used for all HTTP Requests. By default, [`Guzzle 6`][Guzzle 6] +is used, but this library is also compatible with [`Guzzle 5`][Guzzle 5]. As a result, +all `Google_IO`-related functionality and `Google_Http`-related functionality has been +changed or removed. + +1. Removed `Google_Http_Request` +1. Removed `Google_IO_Abstract`, `Google_IO_Exception`, `Google_IO_Curl`, and `Google_IO_Stream` +1. Removed methods `Google_Client::getIo` and `Google_Client::setIo` +1. Refactored `Google_Http_Batch` and `Google_Http_MediaFileUpload` for Guzzle +1. Added `Google_Client::getHttpClient` and `Google_Client::setHttpClient` for getting and +setting the Guzzle `GuzzleHttp\ClientInterface` object. + +> NOTE: `PSR-7`-compatible libraries can now be used with this library. + +## Other Changes + + - [`PSR 3`][PSR 3] `LoggerInterface` is now supported, and [Monolog][Monolog] is used for all + logging. As a result, all `Google_Logger`-related functionality has been removed: + 1. Removed `Google_Logger_Abstract`, `Google_Logger_Exception`, `Google_Logger_File`, + `Google_Logger_Null`, and `Google_Logger_Psr` + 1. `Google_Client::setLogger` now requires `Psr\Log\LoggerInterface` + - [`firebase/jwt`][Firebase JWT] is now used for all JWT signing and verifying. As a result, the + following classes have been changed or removed: + 1. Removed `Google_Signer_P12` + 1. Removed `Google_Verifier_Pem` + 1. Removed `Google_Auth_LoginTicket` (see below) + - The following classes and methods have been removed in favor of [`google/auth`][Google Auth]: + 1. Removed methods `Google_Client::getAuth` and `Google_Client::setAuth` + 1. Removed `Google_Auth_Abstract` + - `Google_Auth_Abstract::sign` and `Google_Auth_Abstract::authenticatedRequest` have been + replaced by `Google_Client::authorize`. See the above examples for more details. + 1. Removed `Google_Auth_AppIdentity`. This is now supported in [`google/auth`][Google Auth AppIdentity] + and is used automatically when `Google_Client::useApplicationDefaultCredentials` is called. + 1. Removed `Google_Auth_AssertionCredentials`. Use `Google_Client::setAuthConfig` instead. + 1. Removed `Google_Auth_ComputeEngine`. This is now supported in + [`google/auth`][Google Auth GCE], and is used automatically when + `Google_Client::useApplicationDefaultCredentials` is called. + 1. Removed `Google_Auth_Exception` + 1. Removed `Google_Auth_LoginTicket`. Calls to `Google_Client::verifyIdToken` now returns + the payload of the ID Token as an array if the verification is successful. + 1. Removed `Google_Auth_OAuth2`. This functionality is now supported in [`google/auth`][Google Auth OAuth2] and wrapped in `Google_Client`. These changes will only affect applications calling `Google_Client::getAuth`, + as the methods on `Google_Client` have not changed. + 1. Removed `Google_Auth_Simple`. This is now supported in [`google/auth`][Google Auth Simple] + and is used automatically when `Google_Client::setDeveloperKey` is called. + - `Google_Client::sign` has been replaced by `Google_Client::authorize`. This function + now takes a `GuzzleHttp\ClientInterface` object and uses the following decision tree for + authentication: + 1. Uses Application Default Credentials when + `Google_Client::useApplicationDefaultCredentials` is called + - Looks for `GOOGLE_APPLICATION_CREDENTIALS` environment variable if set + - Looks in `~/.config/gcloud/application_default_credentials.json` + - Otherwise, uses `GCECredentials` + 1. Uses API Key if set (see `Client::setDeveloperKey`) + 1. Uses Access Token if set (call `Client::setAccessToken`) + 1. Automatically refreshes access tokens if one is set and the access token is expired + - Removed `Google_Config` + - Removed `Google_Utils` + - [`PSR-6`][PSR 6] cache is used for all caching. As a result: + 1. Removed `Google_Cache_Abstract` + 1. Classes `Google_Cache_Apc`, `Google_Cache_File`, `Google_Cache_Memcache`, and + `Google_Cache_Null` now implement `Google\Auth\CacheInterface`. + 1. Google Auth provides simple [caching utilities][Google Auth Cache] which + are used by default unless you provide alternatives. + - Removed `$boundary` constructor argument for `Google_Http_MediaFileUpload` + +[PSR 3]: https://www.php-fig.org/psr/psr-3/ +[PSR 6]: https://www.php-fig.org/psr/psr-6/ +[Guzzle 5]: https://github.com/guzzle/guzzle +[Guzzle 6]: http://docs.guzzlephp.org/en/latest/psr7.html +[Monolog]: https://github.com/Seldaek/monolog +[Google Auth]: https://github.com/google/google-auth-library-php +[Google Auth Cache]: https://github.com/googleapis/google-auth-library-php/tree/master/src/Cache +[Google Auth GCE]: https://github.com/google/google-auth-library-php/blob/master/src/GCECredentials.php +[Google Auth OAuth2]: https://github.com/google/google-auth-library-php/blob/master/src/OAuth2.php +[Google Auth Simple]: https://github.com/google/google-auth-library-php/blob/master/src/Simple.php +[Google Auth AppIdentity]: https://github.com/google/google-auth-library-php/blob/master/src/AppIdentityCredentials.php +[Firebase JWT]: https://github.com/firebase/php-jwt diff --git a/lib/Google/composer.json b/lib/Google/composer.json index 461fdaae7..c646bcd68 100644 --- a/lib/Google/composer.json +++ b/lib/Google/composer.json @@ -8,23 +8,24 @@ "require": { "php": "^7.4|^8.0", "google/auth": "^1.28", - "google/cloud-core": "^1.51.2", - "google/cloud-storage": "^1.31.2", "firebase/php-jwt": "~6.0", "monolog/monolog": "^2.9||^3.0", - "phpseclib/phpseclib": "^3.0.2", + "phpseclib/phpseclib": "^3.0.19", "guzzlehttp/guzzle": "~6.5||~7.0", - "guzzlehttp/psr7": "^1.8.4||^2.2.1" + "guzzlehttp/psr7": "^1.8.4||^2.2.1", + "google/cloud-storage": "^1.34", + "google/cloud-core": "^1.52", + "google/apiclient-services": "^0.323.0" }, "require-dev": { "squizlabs/php_codesniffer": "^3.0", "symfony/dom-crawler": "~2.1", "symfony/css-selector": "~2.1", - "cache/filesystem-adapter": "^1.1", "phpcompatibility/php-compatibility": "^9.2", "composer/composer": "^1.10.22", "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.5", + "cache/filesystem-adapter": "^1.2" }, "suggest": { "cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)" @@ -40,7 +41,13 @@ "src/aliases.php" ] }, + "scripts": { + "pre-autoload-dump": "Google\\Task\\Composer::cleanup" + }, "extra": { + "google/apiclient-services": [ + "Storage" + ], "branch-alias": { "dev-main": "2.x-dev" } diff --git a/lib/Google/composer.lock b/lib/Google/composer.lock index c80636154..cb62414bb 100644 --- a/lib/Google/composer.lock +++ b/lib/Google/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "d23c27e8eca497813f44feccf80aae06", + "content-hash": "a24978434a3e0a329346faa11f43a9d9", "packages": [ { "name": "brick/math", @@ -49,6 +49,10 @@ "brick", "math" ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.11.0" + }, "funding": [ { "url": "https://github.com/BenMorel", @@ -59,16 +63,16 @@ }, { "name": "firebase/php-jwt", - "version": "v6.5.0", + "version": "v6.9.0", "source": { "type": "git", "url": "https://github.com/firebase/php-jwt.git", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2" + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", "shasum": "" }, "require": { @@ -114,20 +118,68 @@ "jwt", "php" ], - "time": "2023-05-12T15:47:07+00:00" + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" + }, + "time": "2023-10-05T00:24:42+00:00" + }, + { + "name": "google/apiclient-services", + "version": "v0.323.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client-services.git", + "reference": "d5497d30ddfafe7592102ca48bedaf222a4ca7a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/d5497d30ddfafe7592102ca48bedaf222a4ca7a6", + "reference": "d5497d30ddfafe7592102ca48bedaf222a4ca7a6", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7||^8.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "autoload.php" + ], + "psr-4": { + "Google\\Service\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client-services/issues", + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.323.0" + }, + "time": "2023-11-06T01:08:38+00:00" }, { "name": "google/auth", - "version": "v1.28.0", + "version": "v1.32.1", "source": { "type": "git", "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "07f7f6305f1b7df32b2acf6e101c1225c839c7ac" + "reference": "999e9ce8b9d17914f04e1718271a0a46da4de2f3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/07f7f6305f1b7df32b2acf6e101c1225c839c7ac", - "reference": "07f7f6305f1b7df32b2acf6e101c1225c839c7ac", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/999e9ce8b9d17914f04e1718271a0a46da4de2f3", + "reference": "999e9ce8b9d17914f04e1718271a0a46da4de2f3", "shasum": "" }, "require": { @@ -139,8 +191,8 @@ "psr/http-message": "^1.1||^2.0" }, "require-dev": { - "guzzlehttp/promises": "^1.3", - "kelvinmo/simplejwt": "0.7.0", + "guzzlehttp/promises": "^2.0", + "kelvinmo/simplejwt": "0.7.1", "phpseclib/phpseclib": "^3.0", "phpspec/prophecy-phpunit": "^2.0", "phpunit/phpunit": "^9.0.0", @@ -167,36 +219,41 @@ "google", "oauth2" ], - "time": "2023-05-11T21:58:18+00:00" + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.32.1" + }, + "time": "2023-10-17T21:13:22+00:00" }, { "name": "google/cloud-core", - "version": "v1.51.2", + "version": "v1.52.8", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "85dc48d62143f4bbfaa34c24da95003371de7b79" + "reference": "2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/85dc48d62143f4bbfaa34c24da95003371de7b79", - "reference": "85dc48d62143f4bbfaa34c24da95003371de7b79", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c", + "reference": "2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c", "shasum": "" }, "require": { "google/auth": "^1.18", - "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", - "guzzlehttp/promises": "^1.3", + "guzzlehttp/guzzle": "^6.5.8|^7.4.4", + "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^1.7|^2.0", "monolog/monolog": "^1.1|^2.0|^3.0", "php": ">=7.4", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0|^2.0", "rize/uri-template": "~0.3" }, "require-dev": { "erusev/parsedown": "^1.6", "google/cloud-common-protos": "^0.4", - "google/gax": "^1.9", + "google/gax": "^1.24.0", "opis/closure": "^3", "phpdocumentor/reflection": "^5.0", "phpspec/prophecy-phpunit": "^2.0", @@ -229,25 +286,27 @@ "Apache-2.0" ], "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", - "time": "2023-05-05T23:01:42+00:00" + "support": { + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.8" + }, + "time": "2023-11-02T19:15:44+00:00" }, { "name": "google/cloud-storage", - "version": "v1.31.2", + "version": "v1.34.0", "source": { "type": "git", "url": "https://github.com/googleapis/google-cloud-php-storage.git", - "reference": "7fe96d56856cda550b21779bb95a066b264852da" + "reference": "4589dd3c8f4171db4ce3eb335fc7d894661ca0e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/7fe96d56856cda550b21779bb95a066b264852da", - "reference": "7fe96d56856cda550b21779bb95a066b264852da", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/4589dd3c8f4171db4ce3eb335fc7d894661ca0e9", + "reference": "4589dd3c8f4171db4ce3eb335fc7d894661ca0e9", "shasum": "" }, "require": { - "google/cloud-core": "^1.51.1", - "google/crc32": "^0.2.0", + "google/cloud-core": "^1.52.7", "php": ">=7.4", "ramsey/uuid": "^4.2.3" }, @@ -283,67 +342,29 @@ "Apache-2.0" ], "description": "Cloud Storage Client for PHP", - "time": "2023-05-05T23:01:42+00:00" - }, - { - "name": "google/crc32", - "version": "v0.2.0", - "source": { - "type": "git", - "url": "https://github.com/google/php-crc32.git", - "reference": "948f7945d803dcc1a375152c72f63144c2dadf23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/google/php-crc32/zipball/948f7945d803dcc1a375152c72f63144c2dadf23", - "reference": "948f7945d803dcc1a375152c72f63144c2dadf23", - "shasum": "" - }, - "require": { - "php": ">=7.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "v3.15", - "phpunit/phpunit": "^9" + "support": { + "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.34.0" }, - "type": "library", - "autoload": { - "psr-4": { - "Google\\CRC32\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Andrew Brampton", - "email": "bramp@google.com" - } - ], - "description": "Various CRC32 implementations", - "homepage": "https://github.com/google/php-crc32", - "time": "2023-04-16T22:44:57+00:00" + "time": "2023-11-02T19:15:44+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.7.0", + "version": "7.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -432,6 +453,10 @@ "rest", "web service" ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -446,33 +471,37 @@ "type": "tidelift" } ], - "time": "2023-05-21T14:04:53+00:00" + "time": "2023-08-27T10:20:53+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.3", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -507,6 +536,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -521,20 +554,20 @@ "type": "tidelift" } ], - "time": "2023-05-21T12:31:43+00:00" + "time": "2023-08-03T15:11:55+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.5.0", + "version": "2.6.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", "shasum": "" }, "require": { @@ -619,6 +652,10 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -633,20 +670,20 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:11:26+00:00" + "time": "2023-08-27T10:13:57+00:00" }, { "name": "monolog/monolog", - "version": "2.9.1", + "version": "2.9.2", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1" + "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", + "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", "shasum": "" }, "require": { @@ -721,6 +758,10 @@ "logging", "psr-3" ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.9.2" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -731,7 +772,7 @@ "type": "tidelift" } ], - "time": "2023-02-06T13:44:46+00:00" + "time": "2023-10-27T15:25:26+00:00" }, { "name": "paragonie/constant_time_encoding", @@ -793,6 +834,11 @@ "hex2bin", "rfc4648" ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, "time": "2022-06-14T06:56:20+00:00" }, { @@ -838,20 +884,25 @@ "pseudorandom", "random" ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, "time": "2020-10-15T08:29:30+00:00" }, { "name": "phpseclib/phpseclib", - "version": "3.0.19", + "version": "3.0.33", "source": { "type": "git", "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95" + "reference": "33fa69b2514a61138dd48e7a49f99445711e0ad0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/33fa69b2514a61138dd48e7a49f99445711e0ad0", + "reference": "33fa69b2514a61138dd48e7a49f99445711e0ad0", "shasum": "" }, "require": { @@ -930,6 +981,10 @@ "x.509", "x509" ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.33" + }, "funding": [ { "url": "https://github.com/terrafrost", @@ -944,7 +999,7 @@ "type": "tidelift" } ], - "time": "2023-03-05T17:13:09+00:00" + "time": "2023-10-21T14:00:39+00:00" }, { "name": "psr/cache", @@ -990,20 +1045,23 @@ "psr", "psr-6" ], + "support": { + "source": "https://github.com/php-fig/cache/tree/2.0.0" + }, "time": "2021-02-03T23:23:37+00:00" }, { "name": "psr/http-client", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", "shasum": "" }, "require": { @@ -1039,7 +1097,10 @@ "psr", "psr-18" ], - "time": "2023-04-10T20:12:12+00:00" + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" }, { "name": "psr/http-factory", @@ -1091,20 +1152,23 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, "time": "2023-04-10T20:10:41+00:00" }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -1113,7 +1177,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -1128,7 +1192,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -1141,7 +1205,10 @@ "request", "response" ], - "time": "2023-04-04T09:50:52+00:00" + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", @@ -1188,6 +1255,9 @@ "psr", "psr-3" ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, "time": "2021-05-03T11:20:27+00:00" }, { @@ -1228,24 +1298,29 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { "name": "ramsey/collection", - "version": "2.0.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/ramsey/collection.git", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", + "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.4 || ^8.0", + "symfony/polyfill-php81": "^1.23" }, "require-dev": { "captainhook/plugin-composer": "^5.3", @@ -1303,6 +1378,10 @@ "queue", "set" ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.3.0" + }, "funding": [ { "url": "https://github.com/ramsey", @@ -1313,7 +1392,7 @@ "type": "tidelift" } ], - "time": "2022-12-31T21:50:55+00:00" + "time": "2022-12-27T19:12:24+00:00" }, { "name": "ramsey/uuid", @@ -1391,6 +1470,10 @@ "identifier", "uuid" ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.4" + }, "funding": [ { "url": "https://github.com/ramsey", @@ -1445,6 +1528,10 @@ "template", "uri" ], + "support": { + "issues": "https://github.com/rize/UriTemplate/issues", + "source": "https://github.com/rize/UriTemplate/tree/0.3.5" + }, "funding": [ { "url": "https://www.paypal.me/rezigned", @@ -1463,25 +1550,25 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.2.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -1509,6 +1596,9 @@ ], "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -1523,7 +1613,86 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:25:55+00:00" + "time": "2022-01-02T09:55:41+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2023-01-26T09:26:14+00:00" } ], "packages-dev": [ @@ -1586,6 +1755,9 @@ "psr-6", "tag" ], + "support": { + "source": "https://github.com/php-cache/adapter-common/tree/1.3.0" + }, "time": "2022-01-15T15:47:19+00:00" }, { @@ -1655,6 +1827,9 @@ "psr-6", "tag" ], + "support": { + "source": "https://github.com/php-cache/filesystem-adapter/tree/1.2.0" + }, "time": "2022-01-15T15:47:19+00:00" }, { @@ -1710,20 +1885,24 @@ "psr6", "tag" ], + "support": { + "issues": "https://github.com/php-cache/tag-interop/issues", + "source": "https://github.com/php-cache/tag-interop/tree/1.1.0" + }, "time": "2021-12-31T10:03:23+00:00" }, { "name": "composer/ca-bundle", - "version": "1.3.5", + "version": "1.3.7", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd" + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/74780ccf8c19d6acb8d65c5f39cd72110e132bbd", - "reference": "74780ccf8c19d6acb8d65c5f39cd72110e132bbd", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/76e46335014860eec1aa5a724799a00a2e47cc85", + "reference": "76e46335014860eec1aa5a724799a00a2e47cc85", "shasum": "" }, "require": { @@ -1767,6 +1946,11 @@ "ssl", "tls" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/ca-bundle/issues", + "source": "https://github.com/composer/ca-bundle/tree/1.3.7" + }, "funding": [ { "url": "https://packagist.com", @@ -1781,20 +1965,20 @@ "type": "tidelift" } ], - "time": "2023-01-11T08:27:00+00:00" + "time": "2023-08-30T09:31:38+00:00" }, { "name": "composer/composer", - "version": "1.10.26", + "version": "1.10.27", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "3e196135eacf9e519a6b00986bc6fe6aff977997" + "reference": "f8f49191eec76f039b466aa1f161406fe43aff50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/3e196135eacf9e519a6b00986bc6fe6aff977997", - "reference": "3e196135eacf9e519a6b00986bc6fe6aff977997", + "url": "https://api.github.com/repos/composer/composer/zipball/f8f49191eec76f039b466aa1f161406fe43aff50", + "reference": "f8f49191eec76f039b466aa1f161406fe43aff50", "shasum": "" }, "require": { @@ -1861,6 +2045,11 @@ "dependency", "package" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/composer/issues", + "source": "https://github.com/composer/composer/tree/1.10.27" + }, "funding": [ { "url": "https://packagist.com", @@ -1875,7 +2064,7 @@ "type": "tidelift" } ], - "time": "2022-04-13T14:39:56+00:00" + "time": "2023-09-29T08:50:23+00:00" }, { "name": "composer/semver", @@ -1936,6 +2125,11 @@ "validation", "versioning" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/1.7.2" + }, "funding": [ { "url": "https://packagist.com", @@ -2011,6 +2205,11 @@ "spdx", "validator" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/spdx-licenses/issues", + "source": "https://github.com/composer/spdx-licenses/tree/1.5.7" + }, "funding": [ { "url": "https://packagist.com", @@ -2070,6 +2269,11 @@ "Xdebug", "performance" ], + "support": { + "irc": "irc://irc.freenode.org/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/1.4.6" + }, "funding": [ { "url": "https://packagist.com", @@ -2088,25 +2292,29 @@ }, { "name": "doctrine/deprecations", - "version": "v1.0.0", + "version": "1.1.2", "source": { "type": "git", "url": "https://github.com/doctrine/deprecations.git", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de" + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/deprecations/zipball/0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", - "reference": "0e2a4f1f8cdfc7a92ec3b01c9334898c806b30de", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/4f2d4f2836e7ec4e7a8625e75c6aa916004db931", + "reference": "4f2d4f2836e7ec4e7a8625e75c6aa916004db931", "shasum": "" }, "require": { - "php": "^7.1|^8.0" + "php": "^7.1 || ^8.0" }, "require-dev": { "doctrine/coding-standard": "^9", - "phpunit/phpunit": "^7.5|^8.5|^9.5", - "psr/log": "^1|^2|^3" + "phpstan/phpstan": "1.4.10 || 1.10.15", + "phpstan/phpstan-phpunit": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "psalm/plugin-phpunit": "0.18.4", + "psr/log": "^1 || ^2 || ^3", + "vimeo/psalm": "4.30.0 || 5.12.0" }, "suggest": { "psr/log": "Allows logging deprecations via PSR-3 logger implementation" @@ -2123,34 +2331,38 @@ ], "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", "homepage": "https://www.doctrine-project.org/", - "time": "2022-05-02T15:47:09+00:00" + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.2" + }, + "time": "2023-09-27T20:04:15+00:00" }, { "name": "doctrine/instantiator", - "version": "2.0.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/doctrine/instantiator.git", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", - "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", "shasum": "" }, "require": { - "php": "^8.1" + "php": "^7.1 || ^8.0" }, "require-dev": { - "doctrine/coding-standard": "^11", + "doctrine/coding-standard": "^9 || ^11", "ext-pdo": "*", "ext-phar": "*", - "phpbench/phpbench": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5.27", - "vimeo/psalm": "^5.4" + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" }, "type": "library", "autoload": { @@ -2175,6 +2387,10 @@ "constructor", "instantiate" ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, "funding": [ { "url": "https://www.doctrine-project.org/sponsorship.html", @@ -2189,20 +2405,20 @@ "type": "tidelift" } ], - "time": "2022-12-30T00:23:10+00:00" + "time": "2022-12-30T00:15:36+00:00" }, { "name": "justinrainbow/json-schema", - "version": "5.2.12", + "version": "v5.2.13", "source": { "type": "git", "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60" + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", - "reference": "ad87d5a5ca981228e0e205c2bc7dfb8e24559b60", + "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", + "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", "shasum": "" }, "require": { @@ -2255,7 +2471,11 @@ "json", "schema" ], - "time": "2022-04-13T08:02:27+00:00" + "support": { + "issues": "https://github.com/justinrainbow/json-schema/issues", + "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + }, + "time": "2023-09-26T02:20:38+00:00" }, { "name": "league/flysystem", @@ -2339,6 +2559,10 @@ "sftp", "storage" ], + "support": { + "issues": "https://github.com/thephpleague/flysystem/issues", + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" + }, "funding": [ { "url": "https://offset.earth/frankdejonge", @@ -2349,26 +2573,26 @@ }, { "name": "league/mime-type-detection", - "version": "1.11.0", + "version": "1.14.0", "source": { "type": "git", "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", + "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/b6a5854368533df0295c5761a0253656a2e52d9e", + "reference": "b6a5854368533df0295c5761a0253656a2e52d9e", "shasum": "" }, "require": { "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.2", "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" + "phpunit/phpunit": "^8.5.8 || ^9.3 || ^10.0" }, "type": "library", "autoload": { @@ -2387,6 +2611,10 @@ } ], "description": "Mime-type detection for Flysystem", + "support": { + "issues": "https://github.com/thephpleague/mime-type-detection/issues", + "source": "https://github.com/thephpleague/mime-type-detection/tree/1.14.0" + }, "funding": [ { "url": "https://github.com/frankdejonge", @@ -2397,7 +2625,7 @@ "type": "tidelift" } ], - "time": "2022-04-17T13:12:02+00:00" + "time": "2023-10-17T14:13:20+00:00" }, { "name": "myclabs/deep-copy", @@ -2446,6 +2674,10 @@ "object", "object graph" ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + }, "funding": [ { "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", @@ -2456,16 +2688,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.15.5", + "version": "v4.17.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e" + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/11e2663a5bc9db5d714eedb4277ee300403b4a9e", - "reference": "11e2663a5bc9db5d714eedb4277ee300403b4a9e", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", "shasum": "" }, "require": { @@ -2504,7 +2736,11 @@ "parser", "php" ], - "time": "2023-05-19T20:20:00+00:00" + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + }, + "time": "2023-08-13T19:53:39+00:00" }, { "name": "phar-io/manifest", @@ -2560,6 +2796,10 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.3" + }, "time": "2021-07-20T11:28:43+00:00" }, { @@ -2607,6 +2847,10 @@ } ], "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, "time": "2022-02-21T01:04:05+00:00" }, { @@ -2665,6 +2909,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -2714,6 +2962,10 @@ "reflection", "static analysis" ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, "time": "2020-06-27T09:03:43+00:00" }, { @@ -2767,20 +3019,24 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.3.0" + }, "time": "2021-10-19T17:43:47+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.7.1", + "version": "1.7.3", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714" + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/dfc078e8af9c99210337325ff5aa152872c98714", - "reference": "dfc078e8af9c99210337325ff5aa152872c98714", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", + "reference": "3219c6ee25c9ea71e3d9bbaf39c67c9ebd499419", "shasum": "" }, "require": { @@ -2821,7 +3077,11 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2023-03-27T19:02:04+00:00" + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.7.3" + }, + "time": "2023-08-12T11:01:26+00:00" }, { "name": "phpspec/prophecy", @@ -2885,6 +3145,10 @@ "spy", "stub" ], + "support": { + "issues": "https://github.com/phpspec/prophecy/issues", + "source": "https://github.com/phpspec/prophecy/tree/v1.17.0" + }, "time": "2023-02-02T15:41:36+00:00" }, { @@ -2933,26 +3197,31 @@ "phpunit", "prophecy" ], + "support": { + "issues": "https://github.com/phpspec/prophecy-phpunit/issues", + "source": "https://github.com/phpspec/prophecy-phpunit/tree/v2.0.2" + }, "time": "2023-04-18T11:58:05+00:00" }, { "name": "phpstan/phpdoc-parser", - "version": "1.21.0", + "version": "1.24.2", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6df62b08faef4f899772bc7c3bbabb93d2b7a21c" + "reference": "bcad8d995980440892759db0c32acae7c8e79442" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6df62b08faef4f899772bc7c3bbabb93d2b7a21c", - "reference": "6df62b08faef4f899772bc7c3bbabb93d2b7a21c", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/bcad8d995980440892759db0c32acae7c8e79442", + "reference": "bcad8d995980440892759db0c32acae7c8e79442", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, "require-dev": { + "doctrine/annotations": "^2.0", "nikic/php-parser": "^4.15", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", @@ -2975,20 +3244,24 @@ "MIT" ], "description": "PHPDoc parser with support for nullable, intersection and generic types", - "time": "2023-05-17T13:13:44+00:00" + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.24.2" + }, + "time": "2023-09-26T12:28:12+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "9.2.26", + "version": "9.2.29", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1" + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", - "reference": "443bc6912c9bd5b409254a40f4b0f4ced7c80ea1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6a3a87ac2bbe33b25042753df8195ba4aa534c76", + "reference": "6a3a87ac2bbe33b25042753df8195ba4aa534c76", "shasum": "" }, "require": { @@ -3042,13 +3315,18 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.29" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2023-03-06T12:58:08+00:00" + "time": "2023-09-19T04:57:46+00:00" }, { "name": "phpunit/php-file-iterator", @@ -3098,6 +3376,10 @@ "filesystem", "iterator" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3157,6 +3439,10 @@ "keywords": [ "process" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3212,6 +3498,10 @@ "keywords": [ "template" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3267,6 +3557,10 @@ "keywords": [ "timer" ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3277,16 +3571,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.8", + "version": "9.6.13", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e" + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e", - "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f3d767f7f9e191eab4189abe41ab37797e30b1be", + "reference": "f3d767f7f9e191eab4189abe41ab37797e30b1be", "shasum": "" }, "require": { @@ -3301,7 +3595,7 @@ "phar-io/manifest": "^2.0.3", "phar-io/version": "^3.0.2", "php": ">=7.3", - "phpunit/php-code-coverage": "^9.2.13", + "phpunit/php-code-coverage": "^9.2.28", "phpunit/php-file-iterator": "^3.0.5", "phpunit/php-invoker": "^3.1.1", "phpunit/php-text-template": "^2.0.3", @@ -3357,6 +3651,11 @@ "testing", "xunit" ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.13" + }, "funding": [ { "url": "https://phpunit.de/sponsors.html", @@ -3371,7 +3670,7 @@ "type": "tidelift" } ], - "time": "2023-05-11T05:14:45+00:00" + "time": "2023-09-19T05:39:22+00:00" }, { "name": "psr/container", @@ -3420,6 +3719,10 @@ "container-interop", "psr" ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, "time": "2021-11-05T16:47:00+00:00" }, { @@ -3468,6 +3771,9 @@ "psr-16", "simple-cache" ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/master" + }, "time": "2017-10-23T01:57:42+00:00" }, { @@ -3514,6 +3820,10 @@ ], "description": "Library for parsing CLI options", "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3566,6 +3876,10 @@ ], "description": "Collection of value objects that represent the PHP code units", "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3617,6 +3931,10 @@ ], "description": "Looks up which function or method a line of code belongs to", "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3687,6 +4005,10 @@ "compare", "equality" ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3740,6 +4062,10 @@ ], "description": "Library for calculating the complexity of PHP code units", "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3802,6 +4128,10 @@ "unidiff", "unified diff" ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3861,6 +4191,10 @@ "environment", "hhvm" ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3934,6 +4268,10 @@ "export", "exporter" ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -3944,16 +4282,16 @@ }, { "name": "sebastian/global-state", - "version": "5.0.5", + "version": "5.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2" + "reference": "bde739e7565280bda77be70044ac1047bc007e34" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/0ca8db5a5fc9c8646244e629625ac486fa286bf2", - "reference": "0ca8db5a5fc9c8646244e629625ac486fa286bf2", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bde739e7565280bda77be70044ac1047bc007e34", + "reference": "bde739e7565280bda77be70044ac1047bc007e34", "shasum": "" }, "require": { @@ -3994,13 +4332,17 @@ "keywords": [ "global state" ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.6" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" } ], - "time": "2022-02-14T08:28:10+00:00" + "time": "2023-08-02T09:26:13+00:00" }, { "name": "sebastian/lines-of-code", @@ -4047,6 +4389,10 @@ ], "description": "Library for counting the lines of code in PHP source code", "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4100,6 +4446,10 @@ ], "description": "Traverses array structures and object graphs to enumerate all referenced objects", "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4151,6 +4501,10 @@ ], "description": "Allows reflection of object attributes, including inherited and non-public ones", "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4210,6 +4564,10 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4261,6 +4619,10 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "issues": "https://github.com/sebastianbergmann/resource-operations/issues", + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.3" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4313,6 +4675,10 @@ ], "description": "Collection of value objects that represent the types of the PHP type system", "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4362,6 +4728,10 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, "funding": [ { "url": "https://github.com/sebastianbergmann", @@ -4418,6 +4788,10 @@ "parser", "validator" ], + "support": { + "issues": "https://github.com/Seldaek/jsonlint/issues", + "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0" + }, "funding": [ { "url": "https://github.com/Seldaek", @@ -4472,6 +4846,10 @@ "keywords": [ "phar" ], + "support": { + "issues": "https://github.com/Seldaek/phar-utils/issues", + "source": "https://github.com/Seldaek/phar-utils/tree/1.2.1" + }, "time": "2022-08-31T10:31:18+00:00" }, { @@ -4524,20 +4902,25 @@ "standards", "static analysis" ], + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, "time": "2023-02-22T23:07:41+00:00" }, { "name": "symfony/console", - "version": "v5.4.23", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c" + "reference": "f4f71842f24c2023b91237c72a365306f3c58827" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c", - "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c", + "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", + "reference": "f4f71842f24c2023b91237c72a365306f3c58827", "shasum": "" }, "require": { @@ -4606,6 +4989,9 @@ "console", "terminal" ], + "support": { + "source": "https://github.com/symfony/console/tree/v5.4.28" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4620,7 +5006,7 @@ "type": "tidelift" } ], - "time": "2023-04-24T18:47:29+00:00" + "time": "2023-08-07T06:12:30+00:00" }, { "name": "symfony/css-selector", @@ -4673,6 +5059,9 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/css-selector/tree/v2.8.52" + }, "time": "2018-11-11T11:18:13+00:00" }, { @@ -4730,20 +5119,23 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/dom-crawler/tree/v2.8.50" + }, "time": "2018-11-24T22:30:19+00:00" }, { "name": "symfony/filesystem", - "version": "v5.4.23", + "version": "v5.4.25", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5" + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", - "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", + "reference": "0ce3a62c9579a53358d3a7eb6b3dfb79789a6364", "shasum": "" }, "require": { @@ -4777,6 +5169,9 @@ ], "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v5.4.25" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4791,20 +5186,20 @@ "type": "tidelift" } ], - "time": "2023-03-02T11:38:35+00:00" + "time": "2023-05-31T13:04:02+00:00" }, { "name": "symfony/finder", - "version": "v5.4.21", + "version": "v5.4.27", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", + "url": "https://api.github.com/repos/symfony/finder/zipball/ff4bce3c33451e7ec778070e45bd23f74214cd5d", + "reference": "ff4bce3c33451e7ec778070e45bd23f74214cd5d", "shasum": "" }, "require": { @@ -4837,6 +5232,9 @@ ], "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v5.4.27" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4851,20 +5249,20 @@ "type": "tidelift" } ], - "time": "2023-02-16T09:33:00+00:00" + "time": "2023-07-31T08:02:31+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", "shasum": "" }, "require": { @@ -4879,7 +5277,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4916,6 +5314,9 @@ "polyfill", "portable" ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -4930,20 +5331,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" + "reference": "875e90aeea2777b6f135677f618529449334a612" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", + "reference": "875e90aeea2777b6f135677f618529449334a612", "shasum": "" }, "require": { @@ -4955,7 +5356,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -4994,6 +5395,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5008,20 +5412,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", "shasum": "" }, "require": { @@ -5033,7 +5437,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5075,6 +5479,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5089,20 +5496,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" + "reference": "42292d99c55abe617799667f454222c54c60e229" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", + "reference": "42292d99c55abe617799667f454222c54c60e229", "shasum": "" }, "require": { @@ -5117,7 +5524,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5155,6 +5562,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5169,20 +5579,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-07-28T09:04:16+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", "shasum": "" }, "require": { @@ -5191,7 +5601,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5231,6 +5641,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5245,20 +5658,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.27.0", + "version": "v1.28.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", "shasum": "" }, "require": { @@ -5267,7 +5680,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", @@ -5311,6 +5724,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5325,20 +5741,20 @@ "type": "tidelift" } ], - "time": "2022-11-03T14:55:06+00:00" + "time": "2023-01-26T09:26:14+00:00" }, { "name": "symfony/process", - "version": "v5.4.23", + "version": "v5.4.28", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287" + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287", - "reference": "4b842fc4b61609e0a155a114082bd94e31e98287", + "url": "https://api.github.com/repos/symfony/process/zipball/45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", + "reference": "45261e1fccad1b5447a8d7a8e67aa7b4a9798b7b", "shasum": "" }, "require": { @@ -5370,6 +5786,9 @@ ], "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v5.4.28" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5384,24 +5803,24 @@ "type": "tidelift" } ], - "time": "2023-04-18T13:50:24+00:00" + "time": "2023-08-07T10:36:04+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.2.1", + "version": "v3.0.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a" + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/a8c9cedf55f314f3a186041d19537303766df09a", - "reference": "a8c9cedf55f314f3a186041d19537303766df09a", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d78d39c1599bd1188b8e26bb341da52c3c6d8a66", + "reference": "d78d39c1599bd1188b8e26bb341da52c3c6d8a66", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "psr/container": "^2.0" }, "conflict": { @@ -5413,7 +5832,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", @@ -5423,10 +5842,7 @@ "autoload": { "psr-4": { "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] + } }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -5452,6 +5868,9 @@ "interoperability", "standards" ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.0.2" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5466,24 +5885,24 @@ "type": "tidelift" } ], - "time": "2023-03-01T10:32:47+00:00" + "time": "2022-05-30T19:17:58+00:00" }, { "name": "symfony/string", - "version": "v6.2.8", + "version": "v6.0.19", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef" + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/193e83bbd6617d6b2151c37fff10fa7168ebddef", - "reference": "193e83bbd6617d6b2151c37fff10fa7168ebddef", + "url": "https://api.github.com/repos/symfony/string/zipball/d9e72497367c23e08bf94176d2be45b00a9d232a", + "reference": "d9e72497367c23e08bf94176d2be45b00a9d232a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.0.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -5495,7 +5914,6 @@ "require-dev": { "symfony/error-handler": "^5.4|^6.0", "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", "symfony/translation-contracts": "^2.0|^3.0", "symfony/var-exporter": "^5.4|^6.0" }, @@ -5535,6 +5953,9 @@ "utf-8", "utf8" ], + "support": { + "source": "https://github.com/symfony/string/tree/v6.0.19" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -5549,7 +5970,7 @@ "type": "tidelift" } ], - "time": "2023-03-20T16:06:02+00:00" + "time": "2023-01-01T08:36:10+00:00" }, { "name": "theseer/tokenizer", @@ -5589,6 +6010,10 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + }, "funding": [ { "url": "https://github.com/theseer", @@ -5649,6 +6074,10 @@ "check", "validate" ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/1.11.0" + }, "time": "2022-06-03T18:03:27+00:00" } ], @@ -5661,5 +6090,5 @@ "php": "^7.4|^8.0" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.3.0" } diff --git a/lib/Google/phpstan.neon.dist b/lib/Google/phpstan.neon.dist new file mode 100644 index 000000000..dcef11342 --- /dev/null +++ b/lib/Google/phpstan.neon.dist @@ -0,0 +1,5 @@ +parameters: + treatPhpDocTypesAsCertain: false + level: 5 + paths: + - src diff --git a/lib/Google/vendor/autoload.php b/lib/Google/vendor/autoload.php index b499e6fe8..67e940915 100644 --- a/lib/Google/vendor/autoload.php +++ b/lib/Google/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 ComposerAutoloaderInit8a18562d3013519ef85187fe20fc0499::getLoader(); +return ComposerAutoloaderInit2cd6126242849aa869f10969652c4467::getLoader(); diff --git a/lib/Google/vendor/bin/google-cloud-batch b/lib/Google/vendor/bin/google-cloud-batch deleted file mode 120000 index e4c01822d..000000000 --- a/lib/Google/vendor/bin/google-cloud-batch +++ /dev/null @@ -1 +0,0 @@ -../google/cloud-core/bin/google-cloud-batch \ No newline at end of file diff --git a/lib/Google/vendor/bin/google-cloud-batch b/lib/Google/vendor/bin/google-cloud-batch new file mode 100755 index 000000000..04b357fa1 --- /dev/null +++ b/lib/Google/vendor/bin/google-cloud-batch @@ -0,0 +1,119 @@ +#!/usr/bin/env php +realpath = realpath($opened_path) ?: $opened_path; + $opened_path = $this->realpath; + $this->handle = fopen($this->realpath, $mode); + $this->position = 0; + + return (bool) $this->handle; + } + + public function stream_read($count) + { + $data = fread($this->handle, $count); + + if ($this->position === 0) { + $data = preg_replace('{^#!.*\r?\n}', '', $data); + } + + $this->position += strlen($data); + + return $data; + } + + public function stream_cast($castAs) + { + return $this->handle; + } + + public function stream_close() + { + fclose($this->handle); + } + + public function stream_lock($operation) + { + return $operation ? flock($this->handle, $operation) : true; + } + + public function stream_seek($offset, $whence) + { + if (0 === fseek($this->handle, $offset, $whence)) { + $this->position = ftell($this->handle); + return true; + } + + return false; + } + + public function stream_tell() + { + return $this->position; + } + + public function stream_eof() + { + return feof($this->handle); + } + + public function stream_stat() + { + return array(); + } + + public function stream_set_option($option, $arg1, $arg2) + { + return true; + } + + public function url_stat($path, $flags) + { + $path = substr($path, 17); + if (file_exists($path)) { + return stat($path); + } + + return false; + } + } + } + + if ( + (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) + || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) + ) { + return include("phpvfscomposer://" . __DIR__ . '/..'.'/google/cloud-core/bin/google-cloud-batch'); + } +} + +return include __DIR__ . '/..'.'/google/cloud-core/bin/google-cloud-batch'; diff --git a/lib/Google/vendor/composer/ClassLoader.php b/lib/Google/vendor/composer/ClassLoader.php index 03b9bb9c4..7824d8f7e 100644 --- a/lib/Google/vendor/composer/ClassLoader.php +++ b/lib/Google/vendor/composer/ClassLoader.php @@ -37,26 +37,81 @@ * * @author Fabien Potencier * @author Jordi Boggiano - * @see http://www.php-fig.org/psr/psr-0/ - * @see http://www.php-fig.org/psr/psr-4/ + * @see https://www.php-fig.org/psr/psr-0/ + * @see https://www.php-fig.org/psr/psr-4/ */ class ClassLoader { + /** @var \Closure(string):void */ + private static $includeFile; + + /** @var string|null */ + private $vendorDir; + // PSR-4 + /** + * @var array> + */ private $prefixLengthsPsr4 = array(); + /** + * @var array> + */ private $prefixDirsPsr4 = array(); + /** + * @var list + */ private $fallbackDirsPsr4 = array(); // PSR-0 + /** + * 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 list + */ private $fallbackDirsPsr0 = array(); + /** @var bool */ private $useIncludePath = false; + + /** + * @var array + */ private $classMap = array(); + + /** @var bool */ private $classMapAuthoritative = false; + + /** + * @var array + */ private $missingClasses = array(); + + /** @var string|null */ private $apcuPrefix; + /** + * @var array + */ + private static $registeredLoaders = array(); + + /** + * @param string|null $vendorDir + */ + public function __construct($vendorDir = null) + { + $this->vendorDir = $vendorDir; + self::initializeIncludeClosure(); + } + + /** + * @return array> + */ public function getPrefixes() { if (!empty($this->prefixesPsr0)) { @@ -66,28 +121,42 @@ public function getPrefixes() return array(); } + /** + * @return array> + */ public function getPrefixesPsr4() { return $this->prefixDirsPsr4; } + /** + * @return list + */ public function getFallbackDirs() { return $this->fallbackDirsPsr0; } + /** + * @return list + */ public function getFallbackDirsPsr4() { return $this->fallbackDirsPsr4; } + /** + * @return array Array of classname => path + */ public function getClassMap() { return $this->classMap; } /** - * @param array $classMap Class to filename map + * @param array $classMap Class to filename map + * + * @return void */ public function addClassMap(array $classMap) { @@ -102,22 +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 array|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 ); } @@ -126,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 ); } } @@ -147,25 +219,28 @@ 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 array|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 + * + * @return void */ 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])) { @@ -175,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 ); } } @@ -195,8 +270,10 @@ 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 array|string $paths The PSR-0 base directories + * @param string $prefix The prefix + * @param list|string $paths The PSR-0 base directories + * + * @return void */ public function set($prefix, $paths) { @@ -211,10 +288,12 @@ 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 array|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 + * + * @return void */ public function setPsr4($prefix, $paths) { @@ -234,6 +313,8 @@ public function setPsr4($prefix, $paths) * Turns on searching the include path for class files. * * @param bool $useIncludePath + * + * @return void */ public function setUseIncludePath($useIncludePath) { @@ -256,6 +337,8 @@ public function getUseIncludePath() * that have not been registered with the class map. * * @param bool $classMapAuthoritative + * + * @return void */ public function setClassMapAuthoritative($classMapAuthoritative) { @@ -276,6 +359,8 @@ public function isClassMapAuthoritative() * APCu prefix to use to cache found/not-found classes, if the extension is enabled. * * @param string|null $apcuPrefix + * + * @return void */ public function setApcuPrefix($apcuPrefix) { @@ -296,33 +381,55 @@ public function getApcuPrefix() * Registers this instance as an autoloader. * * @param bool $prepend Whether to prepend the autoloader or not + * + * @return void */ public function register($prepend = false) { spl_autoload_register(array($this, 'loadClass'), true, $prepend); + + if (null === $this->vendorDir) { + return; + } + + if ($prepend) { + self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; + } else { + unset(self::$registeredLoaders[$this->vendorDir]); + self::$registeredLoaders[$this->vendorDir] = $this; + } } /** * Unregisters this instance as an autoloader. + * + * @return void */ public function unregister() { spl_autoload_unregister(array($this, 'loadClass')); + + if (null !== $this->vendorDir) { + unset(self::$registeredLoaders[$this->vendorDir]); + } } /** * Loads the given class or interface. * * @param string $class The name of the class - * @return bool|null True if loaded, null otherwise + * @return true|null True if loaded, null otherwise */ public function loadClass($class) { if ($file = $this->findFile($class)) { - includeFile($file); + $includeFile = self::$includeFile; + $includeFile($file); return true; } + + return null; } /** @@ -367,6 +474,21 @@ public function findFile($class) return $file; } + /** + * Returns the currently registered loaders keyed by their corresponding vendor directories. + * + * @return array + */ + public static function getRegisteredLoaders() + { + return self::$registeredLoaders; + } + + /** + * @param string $class + * @param string $ext + * @return string|false + */ private function findFileWithExtension($class, $ext) { // PSR-4 lookup @@ -432,14 +554,26 @@ private function findFileWithExtension($class, $ext) return false; } -} -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -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/lib/Google/vendor/composer/InstalledVersions.php b/lib/Google/vendor/composer/InstalledVersions.php new file mode 100644 index 000000000..51e734a77 --- /dev/null +++ b/lib/Google/vendor/composer/InstalledVersions.php @@ -0,0 +1,359 @@ + + * Jordi Boggiano + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Composer; + +use Composer\Autoload\ClassLoader; +use Composer\Semver\VersionParser; + +/** + * This class is copied in every Composer installed project and available to all + * + * 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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array}|array{}|null + */ + private static $installed; + + /** + * @var bool|null + */ + private static $canGetVendors; + + /** + * @var array[] + * @psalm-var array}> + */ + private static $installedByVendor = array(); + + /** + * Returns a list of all package names which are present, either by being installed, replaced or provided + * + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackages() + { + $packages = array(); + foreach (self::getInstalled() as $installed) { + $packages[] = array_keys($installed['versions']); + } + + if (1 === \count($packages)) { + return $packages[0]; + } + + return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); + } + + /** + * Returns a list of all package names with a specific type e.g. 'library' + * + * @param string $type + * @return string[] + * @psalm-return list + */ + public static function getInstalledPackagesByType($type) + { + $packagesByType = array(); + + foreach (self::getInstalled() as $installed) { + foreach ($installed['versions'] as $name => $package) { + if (isset($package['type']) && $package['type'] === $type) { + $packagesByType[] = $name; + } + } + } + + return $packagesByType; + } + + /** + * Checks whether the given package is installed + * + * This also returns true if the package name is provided or replaced by another package + * + * @param string $packageName + * @param bool $includeDevRequirements + * @return bool + */ + public static function isInstalled($packageName, $includeDevRequirements = true) + { + foreach (self::getInstalled() as $installed) { + if (isset($installed['versions'][$packageName])) { + return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false; + } + } + + return false; + } + + /** + * Checks whether the given package satisfies a version constraint + * + * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: + * + * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') + * + * @param VersionParser $parser Install composer/semver to have access to this class and functionality + * @param string $packageName + * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package + * @return bool + */ + public static function satisfies(VersionParser $parser, $packageName, $constraint) + { + $constraint = $parser->parseConstraints((string) $constraint); + $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); + + return $provided->matches($constraint); + } + + /** + * Returns a version constraint representing all the range(s) which are installed for a given package + * + * It is easier to use this via isInstalled() with the $constraint argument if you need to check + * whether a given version of a package is installed, and not just whether it exists + * + * @param string $packageName + * @return string Version constraint usable with composer/semver + */ + public static function getVersionRanges($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + $ranges = array(); + if (isset($installed['versions'][$packageName]['pretty_version'])) { + $ranges[] = $installed['versions'][$packageName]['pretty_version']; + } + if (array_key_exists('aliases', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); + } + if (array_key_exists('replaced', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); + } + if (array_key_exists('provided', $installed['versions'][$packageName])) { + $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); + } + + return implode(' || ', $ranges); + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['version'])) { + return null; + } + + return $installed['versions'][$packageName]['version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present + */ + public static function getPrettyVersion($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['pretty_version'])) { + return null; + } + + return $installed['versions'][$packageName]['pretty_version']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference + */ + public static function getReference($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + if (!isset($installed['versions'][$packageName]['reference'])) { + return null; + } + + return $installed['versions'][$packageName]['reference']; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @param string $packageName + * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. + */ + public static function getInstallPath($packageName) + { + foreach (self::getInstalled() as $installed) { + if (!isset($installed['versions'][$packageName])) { + continue; + } + + return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; + } + + throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); + } + + /** + * @return array + * @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() + { + $installed = self::getInstalled(); + + return $installed[0]['root']; + } + + /** + * Returns the raw installed.php data for custom implementations + * + * @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, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array} + */ + public static function getRawData() + { + @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); + + if (null === self::$installed) { + // 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 = include __DIR__ . '/installed.php'; + } else { + self::$installed = array(); + } + } + + return self::$installed; + } + + /** + * Returns the raw data of all installed.php which are currently loaded for custom implementations + * + * @return array[] + * @psalm-return list}> + */ + public static function getAllRawData() + { + return self::getInstalled(); + } + + /** + * Lets you reload the static array from another file + * + * This is only useful for complex integrations in which a project needs to use + * this class but then also needs to execute another project's autoloader in process, + * and wants to ensure both projects have access to their version of installed.php. + * + * A typical case would be PHPUnit, where it would need to make sure it reads all + * the data it needs from this class, then call reload() with + * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure + * the project in which it runs can then also use this class safely, without + * interference between PHPUnit's dependencies and the project's dependencies. + * + * @param array[] $data A vendor/composer/installed.php data set + * @return void + * + * @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) + { + self::$installed = $data; + self::$installedByVendor = array(); + } + + /** + * @return array[] + * @psalm-return list}> + */ + private static function getInstalled() + { + if (null === self::$canGetVendors) { + self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); + } + + $installed = array(); + + if (self::$canGetVendors) { + foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { + if (isset(self::$installedByVendor[$vendorDir])) { + $installed[] = self::$installedByVendor[$vendorDir]; + } elseif (is_file($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]; + } + } + } + } + + if (null === self::$installed) { + // 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') { + /** @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(); + } + } + + if (self::$installed !== array()) { + $installed[] = self::$installed; + } + + return $installed; + } +} diff --git a/lib/Google/vendor/composer/autoload_classmap.php b/lib/Google/vendor/composer/autoload_classmap.php index 8441ab833..2bda8e960 100644 --- a/lib/Google/vendor/composer/autoload_classmap.php +++ b/lib/Google/vendor/composer/autoload_classmap.php @@ -2,10 +2,12 @@ // autoload_classmap.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( + 'CURLStringFile' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', + 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'Google_AccessToken_Revoke' => $baseDir . '/src/aliases.php', 'Google_AccessToken_Verify' => $baseDir . '/src/aliases.php', 'Google_AuthHandler_AuthHandlerFactory' => $baseDir . '/src/aliases.php', @@ -26,4 +28,5 @@ 'Google_Task_Retryable' => $baseDir . '/src/aliases.php', 'Google_Task_Runner' => $baseDir . '/src/aliases.php', 'Google_Utils_UriTemplate' => $baseDir . '/src/aliases.php', + 'ReturnTypeWillChange' => $vendorDir . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', ); diff --git a/lib/Google/vendor/composer/autoload_files.php b/lib/Google/vendor/composer/autoload_files.php index 2f65642f5..1b96f7179 100644 --- a/lib/Google/vendor/composer/autoload_files.php +++ b/lib/Google/vendor/composer/autoload_files.php @@ -2,15 +2,16 @@ // autoload_files.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( '7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', - 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => $vendorDir . '/symfony/polyfill-php81/bootstrap.php', 'e39a8b23c42d4e1452234d762b03835a' => $vendorDir . '/ramsey/uuid/src/functions.php', + '1f87db08236948d07391152dccb70f04' => $vendorDir . '/google/apiclient-services/autoload.php', + 'decc78cc4436b1292c6c0d151b19445c' => $vendorDir . '/phpseclib/phpseclib/phpseclib/bootstrap.php', 'a8d3953fd9959404dd22d3dfcd0a79f0' => $baseDir . '/src/aliases.php', ); diff --git a/lib/Google/vendor/composer/autoload_namespaces.php b/lib/Google/vendor/composer/autoload_namespaces.php index b7fc0125d..15a2ff3ad 100644 --- a/lib/Google/vendor/composer/autoload_namespaces.php +++ b/lib/Google/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/lib/Google/vendor/composer/autoload_psr4.php b/lib/Google/vendor/composer/autoload_psr4.php index de2fe3828..8f8c57ddb 100644 --- a/lib/Google/vendor/composer/autoload_psr4.php +++ b/lib/Google/vendor/composer/autoload_psr4.php @@ -2,11 +2,12 @@ // autoload_psr4.php @generated by Composer -$vendorDir = dirname(dirname(__FILE__)); +$vendorDir = dirname(__DIR__); $baseDir = dirname($vendorDir); return array( 'phpseclib3\\' => array($vendorDir . '/phpseclib/phpseclib/phpseclib'), + 'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'), 'Rize\\' => array($vendorDir . '/rize/uri-template/src/Rize'), 'Ramsey\\Uuid\\' => array($vendorDir . '/ramsey/uuid/src'), 'Ramsey\\Collection\\' => array($vendorDir . '/ramsey/collection/src'), @@ -19,9 +20,9 @@ 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), + 'Google\\Service\\' => array($vendorDir . '/google/apiclient-services/src'), 'Google\\Cloud\\Storage\\' => array($vendorDir . '/google/cloud-storage/src'), 'Google\\Cloud\\Core\\' => array($vendorDir . '/google/cloud-core/src'), - 'Google\\CRC32\\' => array($vendorDir . '/google/crc32/src'), 'Google\\Auth\\' => array($vendorDir . '/google/auth/src'), 'Google\\' => array($baseDir . '/src'), 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), diff --git a/lib/Google/vendor/composer/autoload_real.php b/lib/Google/vendor/composer/autoload_real.php index b4f8cfd17..a9a344d5e 100644 --- a/lib/Google/vendor/composer/autoload_real.php +++ b/lib/Google/vendor/composer/autoload_real.php @@ -2,7 +2,7 @@ // autoload_real.php @generated by Composer -class ComposerAutoloaderInit8a18562d3013519ef85187fe20fc0499 +class ComposerAutoloaderInit2cd6126242849aa869f10969652c4467 { private static $loader; @@ -22,52 +22,29 @@ public static function getLoader() return self::$loader; } - spl_autoload_register(array('ComposerAutoloaderInit8a18562d3013519ef85187fe20fc0499', 'loadClassLoader'), true, true); - self::$loader = $loader = new \Composer\Autoload\ClassLoader(); - spl_autoload_unregister(array('ComposerAutoloaderInit8a18562d3013519ef85187fe20fc0499', 'loadClassLoader')); + require __DIR__ . '/platform_check.php'; - $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); - if ($useStaticLoader) { - require_once __DIR__ . '/autoload_static.php'; + spl_autoload_register(array('ComposerAutoloaderInit2cd6126242849aa869f10969652c4467', 'loadClassLoader'), true, true); + self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); + spl_autoload_unregister(array('ComposerAutoloaderInit2cd6126242849aa869f10969652c4467', 'loadClassLoader')); - call_user_func(\Composer\Autoload\ComposerStaticInit8a18562d3013519ef85187fe20fc0499::getInitializer($loader)); - } else { - $map = require __DIR__ . '/autoload_namespaces.php'; - foreach ($map as $namespace => $path) { - $loader->set($namespace, $path); - } - - $map = require __DIR__ . '/autoload_psr4.php'; - foreach ($map as $namespace => $path) { - $loader->setPsr4($namespace, $path); - } - - $classMap = require __DIR__ . '/autoload_classmap.php'; - if ($classMap) { - $loader->addClassMap($classMap); - } - } + require __DIR__ . '/autoload_static.php'; + call_user_func(\Composer\Autoload\ComposerStaticInit2cd6126242849aa869f10969652c4467::getInitializer($loader)); $loader->register(true); - if ($useStaticLoader) { - $includeFiles = Composer\Autoload\ComposerStaticInit8a18562d3013519ef85187fe20fc0499::$files; - } else { - $includeFiles = require __DIR__ . '/autoload_files.php'; - } - foreach ($includeFiles as $fileIdentifier => $file) { - composerRequire8a18562d3013519ef85187fe20fc0499($fileIdentifier, $file); + $filesToLoad = \Composer\Autoload\ComposerStaticInit2cd6126242849aa869f10969652c4467::$files; + $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { + if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { + $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; + + require $file; + } + }, null, null); + foreach ($filesToLoad as $fileIdentifier => $file) { + $requireFile($fileIdentifier, $file); } return $loader; } } - -function composerRequire8a18562d3013519ef85187fe20fc0499($fileIdentifier, $file) -{ - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - require $file; - - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - } -} diff --git a/lib/Google/vendor/composer/autoload_static.php b/lib/Google/vendor/composer/autoload_static.php index 5f30bbe99..05dbabeaa 100644 --- a/lib/Google/vendor/composer/autoload_static.php +++ b/lib/Google/vendor/composer/autoload_static.php @@ -4,15 +4,16 @@ namespace Composer\Autoload; -class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 +class ComposerStaticInit2cd6126242849aa869f10969652c4467 { public static $files = array ( '7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', - 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', - 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', + '23c18046f52bef3eea034657bafda50f' => __DIR__ . '/..' . '/symfony/polyfill-php81/bootstrap.php', 'e39a8b23c42d4e1452234d762b03835a' => __DIR__ . '/..' . '/ramsey/uuid/src/functions.php', + '1f87db08236948d07391152dccb70f04' => __DIR__ . '/..' . '/google/apiclient-services/autoload.php', + 'decc78cc4436b1292c6c0d151b19445c' => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib/bootstrap.php', 'a8d3953fd9959404dd22d3dfcd0a79f0' => __DIR__ . '/../..' . '/src/aliases.php', ); @@ -21,6 +22,10 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 array ( 'phpseclib3\\' => 11, ), + 'S' => + array ( + 'Symfony\\Polyfill\\Php81\\' => 23, + ), 'R' => array ( 'Rize\\' => 5, @@ -44,9 +49,9 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 'GuzzleHttp\\Psr7\\' => 16, 'GuzzleHttp\\Promise\\' => 19, 'GuzzleHttp\\' => 11, + 'Google\\Service\\' => 15, 'Google\\Cloud\\Storage\\' => 21, 'Google\\Cloud\\Core\\' => 18, - 'Google\\CRC32\\' => 13, 'Google\\Auth\\' => 12, 'Google\\' => 7, ), @@ -65,6 +70,10 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 array ( 0 => __DIR__ . '/..' . '/phpseclib/phpseclib/phpseclib', ), + 'Symfony\\Polyfill\\Php81\\' => + array ( + 0 => __DIR__ . '/..' . '/symfony/polyfill-php81', + ), 'Rize\\' => array ( 0 => __DIR__ . '/..' . '/rize/uri-template/src/Rize', @@ -114,6 +123,10 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 array ( 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', ), + 'Google\\Service\\' => + array ( + 0 => __DIR__ . '/..' . '/google/apiclient-services/src', + ), 'Google\\Cloud\\Storage\\' => array ( 0 => __DIR__ . '/..' . '/google/cloud-storage/src', @@ -122,10 +135,6 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 array ( 0 => __DIR__ . '/..' . '/google/cloud-core/src', ), - 'Google\\CRC32\\' => - array ( - 0 => __DIR__ . '/..' . '/google/crc32/src', - ), 'Google\\Auth\\' => array ( 0 => __DIR__ . '/..' . '/google/auth/src', @@ -145,6 +154,8 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 ); public static $classMap = array ( + 'CURLStringFile' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php', + 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'Google_AccessToken_Revoke' => __DIR__ . '/../..' . '/src/aliases.php', 'Google_AccessToken_Verify' => __DIR__ . '/../..' . '/src/aliases.php', 'Google_AuthHandler_AuthHandlerFactory' => __DIR__ . '/../..' . '/src/aliases.php', @@ -165,14 +176,15 @@ class ComposerStaticInit8a18562d3013519ef85187fe20fc0499 'Google_Task_Retryable' => __DIR__ . '/../..' . '/src/aliases.php', 'Google_Task_Runner' => __DIR__ . '/../..' . '/src/aliases.php', 'Google_Utils_UriTemplate' => __DIR__ . '/../..' . '/src/aliases.php', + 'ReturnTypeWillChange' => __DIR__ . '/..' . '/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php', ); public static function getInitializer(ClassLoader $loader) { return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit8a18562d3013519ef85187fe20fc0499::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit8a18562d3013519ef85187fe20fc0499::$prefixDirsPsr4; - $loader->classMap = ComposerStaticInit8a18562d3013519ef85187fe20fc0499::$classMap; + $loader->prefixLengthsPsr4 = ComposerStaticInit2cd6126242849aa869f10969652c4467::$prefixLengthsPsr4; + $loader->prefixDirsPsr4 = ComposerStaticInit2cd6126242849aa869f10969652c4467::$prefixDirsPsr4; + $loader->classMap = ComposerStaticInit2cd6126242849aa869f10969652c4467::$classMap; }, null, ClassLoader::class); } diff --git a/lib/Google/vendor/composer/installed.json b/lib/Google/vendor/composer/installed.json index 11af9a3cc..acfd6408e 100644 --- a/lib/Google/vendor/composer/installed.json +++ b/lib/Google/vendor/composer/installed.json @@ -1,1567 +1,1766 @@ -[ - { - "name": "brick/math", - "version": "0.11.0", - "version_normalized": "0.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/brick/math.git", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", - "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", - "shasum": "" - }, - "require": { - "php": "^8.0" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.0", - "vimeo/psalm": "5.0.0" - }, - "time": "2023-01-15T23:15:59+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Brick\\Math\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Arbitrary-precision arithmetic library", - "keywords": [ - "Arbitrary-precision", - "BigInteger", - "BigRational", - "arithmetic", - "bigdecimal", - "bignum", - "brick", - "math" - ], - "funding": [ - { - "url": "https://github.com/BenMorel", - "type": "github" - } - ] - }, - { - "name": "firebase/php-jwt", - "version": "v6.5.0", - "version_normalized": "6.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "reference": "e94e7353302b0c11ec3cfff7180cd0b1743975d2", - "shasum": "" - }, - "require": { - "php": "^7.4||^8.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", - "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" - }, - "time": "2023-05-12T15:47:07+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ] - }, - { - "name": "google/auth", - "version": "v1.28.0", - "version_normalized": "1.28.0.0", - "source": { - "type": "git", - "url": "https://github.com/googleapis/google-auth-library-php.git", - "reference": "07f7f6305f1b7df32b2acf6e101c1225c839c7ac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/07f7f6305f1b7df32b2acf6e101c1225c839c7ac", - "reference": "07f7f6305f1b7df32b2acf6e101c1225c839c7ac", - "shasum": "" - }, - "require": { - "firebase/php-jwt": "^6.0", - "guzzlehttp/guzzle": "^6.2.1|^7.0", - "guzzlehttp/psr7": "^2.4.5", - "php": "^7.4||^8.0", - "psr/cache": "^1.0||^2.0||^3.0", - "psr/http-message": "^1.1||^2.0" - }, - "require-dev": { - "guzzlehttp/promises": "^1.3", - "kelvinmo/simplejwt": "0.7.0", - "phpseclib/phpseclib": "^3.0", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.0.0", - "sebastian/comparator": ">=1.2.3", - "squizlabs/php_codesniffer": "^3.5" - }, - "suggest": { - "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." - }, - "time": "2023-05-11T21:58:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Google\\Auth\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "Google Auth Library for PHP", - "homepage": "http://github.com/google/google-auth-library-php", - "keywords": [ - "Authentication", - "google", - "oauth2" - ] - }, - { - "name": "google/cloud-core", - "version": "v1.51.2", - "version_normalized": "1.51.2.0", - "source": { - "type": "git", - "url": "https://github.com/googleapis/google-cloud-php-core.git", - "reference": "85dc48d62143f4bbfaa34c24da95003371de7b79" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/85dc48d62143f4bbfaa34c24da95003371de7b79", - "reference": "85dc48d62143f4bbfaa34c24da95003371de7b79", - "shasum": "" - }, - "require": { - "google/auth": "^1.18", - "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", - "guzzlehttp/promises": "^1.3", - "guzzlehttp/psr7": "^1.7|^2.0", - "monolog/monolog": "^1.1|^2.0|^3.0", - "php": ">=7.4", - "psr/http-message": "^1.0", - "rize/uri-template": "~0.3" - }, - "require-dev": { - "erusev/parsedown": "^1.6", - "google/cloud-common-protos": "^0.4", - "google/gax": "^1.9", - "opis/closure": "^3", - "phpdocumentor/reflection": "^5.0", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "2.*" - }, - "suggest": { - "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", - "symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9" - }, - "time": "2023-05-05T23:01:42+00:00", - "bin": [ - "bin/google-cloud-batch" - ], - "type": "library", - "extra": { - "component": { - "id": "cloud-core", - "target": "googleapis/google-cloud-php-core.git", - "path": "Core", - "entry": "src/ServiceBuilder.php" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Google\\Cloud\\Core\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "Google Cloud PHP shared dependency, providing functionality useful to all components." - }, - { - "name": "google/cloud-storage", - "version": "v1.31.2", - "version_normalized": "1.31.2.0", - "source": { - "type": "git", - "url": "https://github.com/googleapis/google-cloud-php-storage.git", - "reference": "7fe96d56856cda550b21779bb95a066b264852da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/7fe96d56856cda550b21779bb95a066b264852da", - "reference": "7fe96d56856cda550b21779bb95a066b264852da", - "shasum": "" - }, - "require": { - "google/cloud-core": "^1.51.1", - "google/crc32": "^0.2.0", - "php": ">=7.4", - "ramsey/uuid": "^4.2.3" - }, - "require-dev": { - "erusev/parsedown": "^1.6", - "google/cloud-pubsub": "^1.0", - "phpdocumentor/reflection": "^5.0", - "phpseclib/phpseclib": "^2.0||^3.0", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.0", - "squizlabs/php_codesniffer": "2.*" - }, - "suggest": { - "google/cloud-pubsub": "May be used to register a topic to receive bucket notifications.", - "phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2." - }, - "time": "2023-05-05T23:01:42+00:00", - "type": "library", - "extra": { - "component": { - "id": "cloud-storage", - "target": "googleapis/google-cloud-php-storage.git", - "path": "Storage", - "entry": "src/StorageClient.php" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Google\\Cloud\\Storage\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "description": "Cloud Storage Client for PHP" - }, - { - "name": "google/crc32", - "version": "v0.2.0", - "version_normalized": "0.2.0.0", - "source": { - "type": "git", - "url": "https://github.com/google/php-crc32.git", - "reference": "948f7945d803dcc1a375152c72f63144c2dadf23" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/google/php-crc32/zipball/948f7945d803dcc1a375152c72f63144c2dadf23", - "reference": "948f7945d803dcc1a375152c72f63144c2dadf23", - "shasum": "" - }, - "require": { - "php": ">=7.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "v3.15", - "phpunit/phpunit": "^9" - }, - "time": "2023-04-16T22:44:57+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Google\\CRC32\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "Apache-2.0" - ], - "authors": [ - { - "name": "Andrew Brampton", - "email": "bramp@google.com" - } - ], - "description": "Various CRC32 implementations", - "homepage": "https://github.com/google/php-crc32" - }, - { - "name": "guzzlehttp/guzzle", - "version": "7.7.0", - "version_normalized": "7.7.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/fb7566caccf22d74d1ab270de3551f72a58399f5", - "reference": "fb7566caccf22d74d1ab270de3551f72a58399f5", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", - "php": "^7.2.5 || ^8.0", - "psr/http-client": "^1.0", - "symfony/deprecation-contracts": "^2.2 || ^3.0" - }, - "provide": { - "psr/http-client-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", - "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.29 || ^9.5.23", - "psr/log": "^1.1 || ^2.0 || ^3.0" - }, - "suggest": { - "ext-curl": "Required for CURL handler support", - "ext-intl": "Required for Internationalized Domain Name (IDN) support", - "psr/log": "Required for using the Log middleware" - }, - "time": "2023-05-21T14:04:53+00:00", - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "psr-18", - "psr-7", - "rest", - "web service" - ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ] - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.3", - "version_normalized": "1.5.3.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "time": "2023-05-21T12:31:43+00:00", - "type": "library", - "installation-source": "source", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ] - }, - { - "name": "guzzlehttp/psr7", - "version": "2.5.0", - "version_normalized": "2.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/b635f279edd83fc275f822a1188157ffea568ff6", - "reference": "b635f279edd83fc275f822a1188157ffea568ff6", - "shasum": "" - }, - "require": { - "php": "^7.2.5 || ^8.0", - "psr/http-factory": "^1.0", - "psr/http-message": "^1.1 || ^2.0", - "ralouphie/getallheaders": "^3.0" - }, - "provide": { - "psr/http-factory-implementation": "1.0", - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "bamarni/composer-bin-plugin": "^1.8.1", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.29 || ^9.5.23" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "time": "2023-04-17T16:11:26+00:00", - "type": "library", - "extra": { - "bamarni-bin": { - "bin-links": true, - "forward-command": false - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://sagikazarmark.hu" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ] - }, - { - "name": "monolog/monolog", - "version": "2.9.1", - "version_normalized": "2.9.1.0", - "source": { - "type": "git", - "url": "https://github.com/Seldaek/monolog.git", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "reference": "f259e2b15fb95494c83f52d3caad003bbf5ffaa1", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "psr/log": "^1.0.1 || ^2.0 || ^3.0" - }, - "provide": { - "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" - }, - "require-dev": { - "aws/aws-sdk-php": "^2.4.9 || ^3.0", - "doctrine/couchdb": "~1.0@dev", - "elasticsearch/elasticsearch": "^7 || ^8", - "ext-json": "*", - "graylog2/gelf-php": "^1.4.2 || ^2@dev", - "guzzlehttp/guzzle": "^7.4", - "guzzlehttp/psr7": "^2.2", - "mongodb/mongodb": "^1.8", - "php-amqplib/php-amqplib": "~2.4 || ^3", - "phpspec/prophecy": "^1.15", - "phpstan/phpstan": "^0.12.91", - "phpunit/phpunit": "^8.5.14", - "predis/predis": "^1.1 || ^2.0", - "rollbar/rollbar": "^1.3 || ^2 || ^3", - "ruflin/elastica": "^7", - "swiftmailer/swiftmailer": "^5.3|^6.0", - "symfony/mailer": "^5.4 || ^6", - "symfony/mime": "^5.4 || ^6" - }, - "suggest": { - "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", - "doctrine/couchdb": "Allow sending log messages to a CouchDB server", - "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", - "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", - "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", - "ext-mbstring": "Allow to work properly with unicode symbols", - "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", - "ext-openssl": "Required to send log messages using SSL", - "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", - "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", - "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", - "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", - "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" - }, - "time": "2023-02-06T13:44:46+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Monolog\\": "src/Monolog" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jordi Boggiano", - "email": "j.boggiano@seld.be", - "homepage": "https://seld.be" - } - ], - "description": "Sends your logs to files, sockets, inboxes, databases and various web services", - "homepage": "https://github.com/Seldaek/monolog", - "keywords": [ - "log", - "logging", - "psr-3" - ], - "funding": [ - { - "url": "https://github.com/Seldaek", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", - "type": "tidelift" - } - ] - }, - { - "name": "paragonie/constant_time_encoding", - "version": "v2.6.3", - "version_normalized": "2.6.3.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "58c3f47f650c94ec05a151692652a868995d2938" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", - "reference": "58c3f47f650c94ec05a151692652a868995d2938", - "shasum": "" - }, - "require": { - "php": "^7|^8" - }, - "require-dev": { - "phpunit/phpunit": "^6|^7|^8|^9", - "vimeo/psalm": "^1|^2|^3|^4" - }, - "time": "2022-06-14T06:56:20+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "ParagonIE\\ConstantTime\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com", - "role": "Maintainer" - }, - { - "name": "Steve 'Sc00bz' Thomas", - "email": "steve@tobtu.com", - "homepage": "https://www.tobtu.com", - "role": "Original Developer" - } - ], - "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", - "keywords": [ - "base16", - "base32", - "base32_decode", - "base32_encode", - "base64", - "base64_decode", - "base64_encode", - "bin2hex", - "encoding", - "hex", - "hex2bin", - "rfc4648" - ] - }, - { - "name": "paragonie/random_compat", - "version": "v9.99.100", - "version_normalized": "9.99.100.0", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", - "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", - "shasum": "" - }, - "require": { - "php": ">= 7" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*", - "vimeo/psalm": "^1" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "time": "2020-10-15T08:29:30+00:00", - "type": "library", - "installation-source": "dist", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ] - }, - { - "name": "phpseclib/phpseclib", - "version": "3.0.19", - "version_normalized": "3.0.19.0", - "source": { - "type": "git", - "url": "https://github.com/phpseclib/phpseclib.git", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/cc181005cf548bfd8a4896383bb825d859259f95", - "reference": "cc181005cf548bfd8a4896383bb825d859259f95", - "shasum": "" - }, - "require": { - "paragonie/constant_time_encoding": "^1|^2", - "paragonie/random_compat": "^1.4|^2.0|^9.99.99", - "php": ">=5.6.1" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "suggest": { - "ext-dom": "Install the DOM extension to load XML formatted public keys.", - "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", - "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", - "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", - "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." - }, - "time": "2023-03-05T17:13:09+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "phpseclib/bootstrap.php" - ], - "psr-4": { - "phpseclib3\\": "phpseclib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jim Wigginton", - "email": "terrafrost@php.net", - "role": "Lead Developer" - }, - { - "name": "Patrick Monnerat", - "email": "pm@datasphere.ch", - "role": "Developer" - }, - { - "name": "Andreas Fischer", - "email": "bantu@phpbb.com", - "role": "Developer" - }, - { - "name": "Hans-Jürgen Petrich", - "email": "petrich@tronic-media.com", - "role": "Developer" - }, - { - "name": "Graham Campbell", - "email": "graham@alt-three.com", - "role": "Developer" - } - ], - "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", - "homepage": "http://phpseclib.sourceforge.net", - "keywords": [ - "BigInteger", - "aes", - "asn.1", - "asn1", - "blowfish", - "crypto", - "cryptography", - "encryption", - "rsa", - "security", - "sftp", - "signature", - "signing", - "ssh", - "twofish", - "x.509", - "x509" - ], - "funding": [ - { - "url": "https://github.com/terrafrost", - "type": "github" - }, - { - "url": "https://www.patreon.com/phpseclib", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", - "type": "tidelift" - } - ] - }, - { - "name": "psr/cache", - "version": "2.0.0", - "version_normalized": "2.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", - "shasum": "" - }, - "require": { - "php": ">=8.0.0" - }, - "time": "2021-02-03T23:23:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "source", - "autoload": { - "psr-4": { - "Psr\\Cache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for caching libraries", - "keywords": [ - "cache", - "psr", - "psr-6" - ] - }, - { - "name": "psr/http-client", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-client.git", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "reference": "0955afe48220520692d2d09f7ab7e0f93ffd6a31", - "shasum": "" - }, - "require": { - "php": "^7.0 || ^8.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "time": "2023-04-10T20:12:12+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Client\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP clients", - "homepage": "https://github.com/php-fig/http-client", - "keywords": [ - "http", - "http-client", - "psr", - "psr-18" - ] - }, - { - "name": "psr/http-factory", - "version": "1.0.2", - "version_normalized": "1.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", - "shasum": "" - }, - "require": { - "php": ">=7.0.0", - "psr/http-message": "^1.0 || ^2.0" - }, - "time": "2023-04-10T20:10:41+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interfaces for PSR-7 HTTP message factories", - "keywords": [ - "factory", - "http", - "message", - "psr", - "psr-17", - "psr-7", - "request", - "response" - ] - }, - { - "name": "psr/http-message", - "version": "1.1", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "time": "2023-04-04T09:50:52+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ] - }, - { - "name": "psr/log", - "version": "1.1.4", - "version_normalized": "1.1.4.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", - "reference": "d49695b909c3b7628b6289db5479a1c204601f11", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "time": "2021-05-03T11:20:27+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Log\\": "Psr/Log/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", - "keywords": [ - "log", - "psr", - "psr-3" - ] - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "version_normalized": "3.0.3.0", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "time": "2019-03-08T08:55:37+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders." - }, - { - "name": "ramsey/collection", - "version": "2.0.0", - "version_normalized": "2.0.0.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/collection.git", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/collection/zipball/a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "reference": "a4b48764bfbb8f3a6a4d1aeb1a35bb5e9ecac4a5", - "shasum": "" - }, - "require": { - "php": "^8.1" - }, - "require-dev": { - "captainhook/plugin-composer": "^5.3", - "ergebnis/composer-normalize": "^2.28.3", - "fakerphp/faker": "^1.21", - "hamcrest/hamcrest-php": "^2.0", - "jangregor/phpstan-prophecy": "^1.0", - "mockery/mockery": "^1.5", - "php-parallel-lint/php-console-highlighter": "^1.0", - "php-parallel-lint/php-parallel-lint": "^1.3", - "phpcsstandards/phpcsutils": "^1.0.0-rc1", - "phpspec/prophecy-phpunit": "^2.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.3", - "phpunit/phpunit": "^9.5", - "psalm/plugin-mockery": "^1.1", - "psalm/plugin-phpunit": "^0.18.4", - "ramsey/coding-standard": "^2.0.3", - "ramsey/conventional-commits": "^1.3", - "vimeo/psalm": "^5.4" - }, - "time": "2022-12-31T21:50:55+00:00", - "type": "library", - "extra": { - "captainhook": { - "force-install": true - }, - "ramsey/conventional-commits": { - "configFile": "conventional-commits.json" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Ramsey\\Collection\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ben Ramsey", - "email": "ben@benramsey.com", - "homepage": "https://benramsey.com" - } - ], - "description": "A PHP library for representing and manipulating collections.", - "keywords": [ - "array", - "collection", - "hash", - "map", - "queue", - "set" - ], - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", - "type": "tidelift" - } - ] - }, - { - "name": "ramsey/uuid", - "version": "4.7.4", - "version_normalized": "4.7.4.0", - "source": { - "type": "git", - "url": "https://github.com/ramsey/uuid.git", - "reference": "60a4c63ab724854332900504274f6150ff26d286" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286", - "reference": "60a4c63ab724854332900504274f6150ff26d286", - "shasum": "" - }, - "require": { - "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", - "ext-json": "*", - "php": "^8.0", - "ramsey/collection": "^1.2 || ^2.0" - }, - "replace": { - "rhumsaa/uuid": "self.version" - }, - "require-dev": { - "captainhook/captainhook": "^5.10", - "captainhook/plugin-composer": "^5.3", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.8", - "ergebnis/composer-normalize": "^2.15", - "mockery/mockery": "^1.3", - "paragonie/random-lib": "^2", - "php-mock/php-mock": "^2.2", - "php-mock/php-mock-mockery": "^1.3", - "php-parallel-lint/php-parallel-lint": "^1.1", - "phpbench/phpbench": "^1.0", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan": "^1.8", - "phpstan/phpstan-mockery": "^1.1", - "phpstan/phpstan-phpunit": "^1.1", - "phpunit/phpunit": "^8.5 || ^9", - "ramsey/composer-repl": "^1.4", - "slevomat/coding-standard": "^8.4", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.9" - }, - "suggest": { - "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", - "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", - "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", - "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", - "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." - }, - "time": "2023-04-15T23:01:58+00:00", - "type": "library", - "extra": { - "captainhook": { - "force-install": true - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "src/functions.php" - ], - "psr-4": { - "Ramsey\\Uuid\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", - "keywords": [ - "guid", - "identifier", - "uuid" - ], - "funding": [ - { - "url": "https://github.com/ramsey", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", - "type": "tidelift" - } - ] - }, - { - "name": "rize/uri-template", - "version": "0.3.5", - "version_normalized": "0.3.5.0", - "source": { - "type": "git", - "url": "https://github.com/rize/UriTemplate.git", - "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/rize/UriTemplate/zipball/5ed4ba8ea34af84485dea815d4b6b620794d1168", - "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.36" - }, - "time": "2022-10-12T17:22:51+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Rize\\": "src/Rize" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marut K", - "homepage": "http://twitter.com/rezigned" - } - ], - "description": "PHP URI Template (RFC 6570) supports both expansion & extraction", - "keywords": [ - "RFC 6570", - "template", - "uri" - ], - "funding": [ - { - "url": "https://www.paypal.me/rezigned", - "type": "custom" - }, - { - "url": "https://github.com/rezigned", - "type": "github" - }, - { - "url": "https://opencollective.com/rize-uri-template", - "type": "open_collective" - } - ] - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.2.1", - "version_normalized": "3.2.1.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "reference": "e2d1534420bd723d0ef5aec58a22c5fe60ce6f5e", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2023-03-01T10:25:55+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.3-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ] - } -] +{ + "packages": [ + { + "name": "brick/math", + "version": "0.11.0", + "version_normalized": "0.11.0.0", + "source": { + "type": "git", + "url": "https://github.com/brick/math.git", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/brick/math/zipball/0ad82ce168c82ba30d1c01ec86116ab52f589478", + "reference": "0ad82ce168c82ba30d1c01ec86116ab52f589478", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.2", + "phpunit/phpunit": "^9.0", + "vimeo/psalm": "5.0.0" + }, + "time": "2023-01-15T23:15:59+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Brick\\Math\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Arbitrary-precision arithmetic library", + "keywords": [ + "Arbitrary-precision", + "BigInteger", + "BigRational", + "arithmetic", + "bigdecimal", + "bignum", + "brick", + "math" + ], + "support": { + "issues": "https://github.com/brick/math/issues", + "source": "https://github.com/brick/math/tree/0.11.0" + }, + "funding": [ + { + "url": "https://github.com/BenMorel", + "type": "github" + } + ], + "install-path": "../brick/math" + }, + { + "name": "firebase/php-jwt", + "version": "v6.9.0", + "version_normalized": "6.9.0.0", + "source": { + "type": "git", + "url": "https://github.com/firebase/php-jwt.git", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" + }, + "time": "2023-10-05T00:24:42+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Firebase\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" + }, + { + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" + } + ], + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", + "keywords": [ + "jwt", + "php" + ], + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" + }, + "install-path": "../firebase/php-jwt" + }, + { + "name": "google/apiclient-services", + "version": "v0.323.0", + "version_normalized": "0.323.0.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-api-php-client-services.git", + "reference": "d5497d30ddfafe7592102ca48bedaf222a4ca7a6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/d5497d30ddfafe7592102ca48bedaf222a4ca7a6", + "reference": "d5497d30ddfafe7592102ca48bedaf222a4ca7a6", + "shasum": "" + }, + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7||^8.5.13" + }, + "time": "2023-11-06T01:08:38+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "autoload.php" + ], + "psr-4": { + "Google\\Service\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Client library for Google APIs", + "homepage": "http://developers.google.com/api-client-library/php", + "keywords": [ + "google" + ], + "support": { + "issues": "https://github.com/googleapis/google-api-php-client-services/issues", + "source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.323.0" + }, + "install-path": "../google/apiclient-services" + }, + { + "name": "google/auth", + "version": "v1.32.1", + "version_normalized": "1.32.1.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-auth-library-php.git", + "reference": "999e9ce8b9d17914f04e1718271a0a46da4de2f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/999e9ce8b9d17914f04e1718271a0a46da4de2f3", + "reference": "999e9ce8b9d17914f04e1718271a0a46da4de2f3", + "shasum": "" + }, + "require": { + "firebase/php-jwt": "^6.0", + "guzzlehttp/guzzle": "^6.2.1|^7.0", + "guzzlehttp/psr7": "^2.4.5", + "php": "^7.4||^8.0", + "psr/cache": "^1.0||^2.0||^3.0", + "psr/http-message": "^1.1||^2.0" + }, + "require-dev": { + "guzzlehttp/promises": "^2.0", + "kelvinmo/simplejwt": "0.7.1", + "phpseclib/phpseclib": "^3.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.0.0", + "sebastian/comparator": ">=1.2.3", + "squizlabs/php_codesniffer": "^3.5" + }, + "suggest": { + "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." + }, + "time": "2023-10-17T21:13:22+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Auth\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Auth Library for PHP", + "homepage": "http://github.com/google/google-auth-library-php", + "keywords": [ + "Authentication", + "google", + "oauth2" + ], + "support": { + "docs": "https://googleapis.github.io/google-auth-library-php/main/", + "issues": "https://github.com/googleapis/google-auth-library-php/issues", + "source": "https://github.com/googleapis/google-auth-library-php/tree/v1.32.1" + }, + "install-path": "../google/auth" + }, + { + "name": "google/cloud-core", + "version": "v1.52.8", + "version_normalized": "1.52.8.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-core.git", + "reference": "2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-core/zipball/2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c", + "reference": "2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c", + "shasum": "" + }, + "require": { + "google/auth": "^1.18", + "guzzlehttp/guzzle": "^6.5.8|^7.4.4", + "guzzlehttp/promises": "^1.4||^2.0", + "guzzlehttp/psr7": "^1.7|^2.0", + "monolog/monolog": "^1.1|^2.0|^3.0", + "php": ">=7.4", + "psr/http-message": "^1.0|^2.0", + "rize/uri-template": "~0.3" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-common-protos": "^0.4", + "google/gax": "^1.24.0", + "opis/closure": "^3", + "phpdocumentor/reflection": "^5.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "opis/closure": "May be used to serialize closures to process jobs in the batch daemon. Please require version ^3.", + "symfony/lock": "Required for the Spanner cached based session pool. Please require the following commit: 3.3.x-dev#1ba6ac9" + }, + "time": "2023-11-02T19:15:44+00:00", + "bin": [ + "bin/google-cloud-batch" + ], + "type": "library", + "extra": { + "component": { + "id": "cloud-core", + "target": "googleapis/google-cloud-php-core.git", + "path": "Core", + "entry": "src/ServiceBuilder.php" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Cloud\\Core\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Google Cloud PHP shared dependency, providing functionality useful to all components.", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-core/tree/v1.52.8" + }, + "install-path": "../google/cloud-core" + }, + { + "name": "google/cloud-storage", + "version": "v1.34.0", + "version_normalized": "1.34.0.0", + "source": { + "type": "git", + "url": "https://github.com/googleapis/google-cloud-php-storage.git", + "reference": "4589dd3c8f4171db4ce3eb335fc7d894661ca0e9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/googleapis/google-cloud-php-storage/zipball/4589dd3c8f4171db4ce3eb335fc7d894661ca0e9", + "reference": "4589dd3c8f4171db4ce3eb335fc7d894661ca0e9", + "shasum": "" + }, + "require": { + "google/cloud-core": "^1.52.7", + "php": ">=7.4", + "ramsey/uuid": "^4.2.3" + }, + "require-dev": { + "erusev/parsedown": "^1.6", + "google/cloud-pubsub": "^1.0", + "phpdocumentor/reflection": "^5.0", + "phpseclib/phpseclib": "^2.0||^3.0", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "2.*" + }, + "suggest": { + "google/cloud-pubsub": "May be used to register a topic to receive bucket notifications.", + "phpseclib/phpseclib": "May be used in place of OpenSSL for creating signed Cloud Storage URLs. Please require version ^2." + }, + "time": "2023-11-02T19:15:44+00:00", + "type": "library", + "extra": { + "component": { + "id": "cloud-storage", + "target": "googleapis/google-cloud-php-storage.git", + "path": "Storage", + "entry": "src/StorageClient.php" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Google\\Cloud\\Storage\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "description": "Cloud Storage Client for PHP", + "support": { + "source": "https://github.com/googleapis/google-cloud-php-storage/tree/v1.34.0" + }, + "install-path": "../google/cloud-storage" + }, + { + "name": "guzzlehttp/guzzle", + "version": "7.8.0", + "version_normalized": "7.8.0.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "reference": "1110f66a6530a40fe7aea0378fe608ee2b2248f9", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "ext-curl": "*", + "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "time": "2023-08-27T10:20:53+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.8.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/guzzle" + }, + { + "name": "guzzlehttp/promises", + "version": "2.0.1", + "version_normalized": "2.0.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/111166291a0f8130081195ac4556a5587d7f1b5d", + "reference": "111166291a0f8130081195ac4556a5587d7f1b5d", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "time": "2023-08-03T15:11:55+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.0.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/promises" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.6.1", + "version_normalized": "2.6.1.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "reference": "be45764272e8873c72dbe3d2edcfdfcc3bc9f727", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.1", + "http-interop/http-factory-tests": "^0.9", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "time": "2023-08-27T10:13:57+00:00", + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.6.1" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "install-path": "../guzzlehttp/psr7" + }, + { + "name": "monolog/monolog", + "version": "2.9.2", + "version_normalized": "2.9.2.0", + "source": { + "type": "git", + "url": "https://github.com/Seldaek/monolog.git", + "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", + "reference": "437cb3628f4cf6042cc10ae97fc2b8472e48ca1f", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "provide": { + "psr/log-implementation": "1.0.0 || 2.0.0 || 3.0.0" + }, + "require-dev": { + "aws/aws-sdk-php": "^2.4.9 || ^3.0", + "doctrine/couchdb": "~1.0@dev", + "elasticsearch/elasticsearch": "^7 || ^8", + "ext-json": "*", + "graylog2/gelf-php": "^1.4.2 || ^2@dev", + "guzzlehttp/guzzle": "^7.4", + "guzzlehttp/psr7": "^2.2", + "mongodb/mongodb": "^1.8", + "php-amqplib/php-amqplib": "~2.4 || ^3", + "phpspec/prophecy": "^1.15", + "phpstan/phpstan": "^0.12.91", + "phpunit/phpunit": "^8.5.14", + "predis/predis": "^1.1 || ^2.0", + "rollbar/rollbar": "^1.3 || ^2 || ^3", + "ruflin/elastica": "^7", + "swiftmailer/swiftmailer": "^5.3|^6.0", + "symfony/mailer": "^5.4 || ^6", + "symfony/mime": "^5.4 || ^6" + }, + "suggest": { + "aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB", + "doctrine/couchdb": "Allow sending log messages to a CouchDB server", + "elasticsearch/elasticsearch": "Allow sending log messages to an Elasticsearch server via official client", + "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", + "ext-curl": "Required to send log messages using the IFTTTHandler, the LogglyHandler, the SendGridHandler, the SlackWebhookHandler or the TelegramBotHandler", + "ext-mbstring": "Allow to work properly with unicode symbols", + "ext-mongodb": "Allow sending log messages to a MongoDB server (via driver)", + "ext-openssl": "Required to send log messages using SSL", + "ext-sockets": "Allow sending log messages to a Syslog server (via UDP driver)", + "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", + "mongodb/mongodb": "Allow sending log messages to a MongoDB server (via library)", + "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", + "rollbar/rollbar": "Allow sending log messages to Rollbar", + "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + }, + "time": "2023-10-27T15:25:26+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Monolog\\": "src/Monolog" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "https://seld.be" + } + ], + "description": "Sends your logs to files, sockets, inboxes, databases and various web services", + "homepage": "https://github.com/Seldaek/monolog", + "keywords": [ + "log", + "logging", + "psr-3" + ], + "support": { + "issues": "https://github.com/Seldaek/monolog/issues", + "source": "https://github.com/Seldaek/monolog/tree/2.9.2" + }, + "funding": [ + { + "url": "https://github.com/Seldaek", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/monolog/monolog", + "type": "tidelift" + } + ], + "install-path": "../monolog/monolog" + }, + { + "name": "paragonie/constant_time_encoding", + "version": "v2.6.3", + "version_normalized": "2.6.3.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/constant_time_encoding.git", + "reference": "58c3f47f650c94ec05a151692652a868995d2938" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/58c3f47f650c94ec05a151692652a868995d2938", + "reference": "58c3f47f650c94ec05a151692652a868995d2938", + "shasum": "" + }, + "require": { + "php": "^7|^8" + }, + "require-dev": { + "phpunit/phpunit": "^6|^7|^8|^9", + "vimeo/psalm": "^1|^2|^3|^4" + }, + "time": "2022-06-14T06:56:20+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "ParagonIE\\ConstantTime\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com", + "role": "Maintainer" + }, + { + "name": "Steve 'Sc00bz' Thomas", + "email": "steve@tobtu.com", + "homepage": "https://www.tobtu.com", + "role": "Original Developer" + } + ], + "description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)", + "keywords": [ + "base16", + "base32", + "base32_decode", + "base32_encode", + "base64", + "base64_decode", + "base64_encode", + "bin2hex", + "encoding", + "hex", + "hex2bin", + "rfc4648" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/constant_time_encoding/issues", + "source": "https://github.com/paragonie/constant_time_encoding" + }, + "install-path": "../paragonie/constant_time_encoding" + }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "version_normalized": "9.99.100.0", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "time": "2020-10-15T08:29:30+00:00", + "type": "library", + "installation-source": "dist", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "install-path": "../paragonie/random_compat" + }, + { + "name": "phpseclib/phpseclib", + "version": "3.0.33", + "version_normalized": "3.0.33.0", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "33fa69b2514a61138dd48e7a49f99445711e0ad0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/33fa69b2514a61138dd48e7a49f99445711e0ad0", + "reference": "33fa69b2514a61138dd48e7a49f99445711e0ad0", + "shasum": "" + }, + "require": { + "paragonie/constant_time_encoding": "^1|^2", + "paragonie/random_compat": "^1.4|^2.0|^9.99.99", + "php": ">=5.6.1" + }, + "require-dev": { + "phpunit/phpunit": "*" + }, + "suggest": { + "ext-dom": "Install the DOM extension to load XML formatted public keys.", + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "time": "2023-10-21T14:00:39+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib3\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "support": { + "issues": "https://github.com/phpseclib/phpseclib/issues", + "source": "https://github.com/phpseclib/phpseclib/tree/3.0.33" + }, + "funding": [ + { + "url": "https://github.com/terrafrost", + "type": "github" + }, + { + "url": "https://www.patreon.com/phpseclib", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib", + "type": "tidelift" + } + ], + "install-path": "../phpseclib/phpseclib" + }, + { + "name": "psr/cache", + "version": "2.0.0", + "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/cache.git", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/cache/zipball/213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "reference": "213f9dbc5b9bfbc4f8db86d2838dc968752ce13b", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "time": "2021-02-03T23:23:37+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for caching libraries", + "keywords": [ + "cache", + "psr", + "psr-6" + ], + "support": { + "source": "https://github.com/php-fig/cache/tree/2.0.0" + }, + "install-path": "../psr/cache" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "version_normalized": "1.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "time": "2023-09-23T14:17:50+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "install-path": "../psr/http-client" + }, + { + "name": "psr/http-factory", + "version": "1.0.2", + "version_normalized": "1.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "e616d01114759c4c489f93b099585439f795fe35" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", + "reference": "e616d01114759c4c489f93b099585439f795fe35", + "shasum": "" + }, + "require": { + "php": ">=7.0.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "time": "2023-04-10T20:10:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + }, + "install-path": "../psr/http-factory" + }, + { + "name": "psr/http-message", + "version": "2.0", + "version_normalized": "2.0.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "time": "2023-04-04T09:54:51+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "install-path": "../psr/http-message" + }, + { + "name": "psr/log", + "version": "1.1.4", + "version_normalized": "1.1.4.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/d49695b909c3b7628b6289db5479a1c204601f11", + "reference": "d49695b909c3b7628b6289db5479a1c204601f11", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "time": "2021-05-03T11:20:27+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1.x-dev" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/1.1.4" + }, + "install-path": "../psr/log" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "version_normalized": "3.0.3.0", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "time": "2019-03-08T08:55:37+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "install-path": "../ralouphie/getallheaders" + }, + { + "name": "ramsey/collection", + "version": "1.3.0", + "version_normalized": "1.3.0.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/collection.git", + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/collection/zipball/ad7475d1c9e70b190ecffc58f2d989416af339b4", + "reference": "ad7475d1c9e70b190ecffc58f2d989416af339b4", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "symfony/polyfill-php81": "^1.23" + }, + "require-dev": { + "captainhook/plugin-composer": "^5.3", + "ergebnis/composer-normalize": "^2.28.3", + "fakerphp/faker": "^1.21", + "hamcrest/hamcrest-php": "^2.0", + "jangregor/phpstan-prophecy": "^1.0", + "mockery/mockery": "^1.5", + "php-parallel-lint/php-console-highlighter": "^1.0", + "php-parallel-lint/php-parallel-lint": "^1.3", + "phpcsstandards/phpcsutils": "^1.0.0-rc1", + "phpspec/prophecy-phpunit": "^2.0", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.9", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5", + "psalm/plugin-mockery": "^1.1", + "psalm/plugin-phpunit": "^0.18.4", + "ramsey/coding-standard": "^2.0.3", + "ramsey/conventional-commits": "^1.3", + "vimeo/psalm": "^5.4" + }, + "time": "2022-12-27T19:12:24+00:00", + "type": "library", + "extra": { + "captainhook": { + "force-install": true + }, + "ramsey/conventional-commits": { + "configFile": "conventional-commits.json" + } + }, + "installation-source": "dist", + "autoload": { + "psr-4": { + "Ramsey\\Collection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ben Ramsey", + "email": "ben@benramsey.com", + "homepage": "https://benramsey.com" + } + ], + "description": "A PHP library for representing and manipulating collections.", + "keywords": [ + "array", + "collection", + "hash", + "map", + "queue", + "set" + ], + "support": { + "issues": "https://github.com/ramsey/collection/issues", + "source": "https://github.com/ramsey/collection/tree/1.3.0" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/collection", + "type": "tidelift" + } + ], + "install-path": "../ramsey/collection" + }, + { + "name": "ramsey/uuid", + "version": "4.7.4", + "version_normalized": "4.7.4.0", + "source": { + "type": "git", + "url": "https://github.com/ramsey/uuid.git", + "reference": "60a4c63ab724854332900504274f6150ff26d286" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/60a4c63ab724854332900504274f6150ff26d286", + "reference": "60a4c63ab724854332900504274f6150ff26d286", + "shasum": "" + }, + "require": { + "brick/math": "^0.8.8 || ^0.9 || ^0.10 || ^0.11", + "ext-json": "*", + "php": "^8.0", + "ramsey/collection": "^1.2 || ^2.0" + }, + "replace": { + "rhumsaa/uuid": "self.version" + }, + "require-dev": { + "captainhook/captainhook": "^5.10", + "captainhook/plugin-composer": "^5.3", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", + "doctrine/annotations": "^1.8", + "ergebnis/composer-normalize": "^2.15", + "mockery/mockery": "^1.3", + "paragonie/random-lib": "^2", + "php-mock/php-mock": "^2.2", + "php-mock/php-mock-mockery": "^1.3", + "php-parallel-lint/php-parallel-lint": "^1.1", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^8.5 || ^9", + "ramsey/composer-repl": "^1.4", + "slevomat/coding-standard": "^8.4", + "squizlabs/php_codesniffer": "^3.5", + "vimeo/psalm": "^4.9" + }, + "suggest": { + "ext-bcmath": "Enables faster math with arbitrary-precision integers using BCMath.", + "ext-gmp": "Enables faster math with arbitrary-precision integers using GMP.", + "ext-uuid": "Enables the use of PeclUuidTimeGenerator and PeclUuidRandomGenerator.", + "paragonie/random-lib": "Provides RandomLib for use with the RandomLibAdapter", + "ramsey/uuid-doctrine": "Allows the use of Ramsey\\Uuid\\Uuid as Doctrine field type." + }, + "time": "2023-04-15T23:01:58+00:00", + "type": "library", + "extra": { + "captainhook": { + "force-install": true + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "src/functions.php" + ], + "psr-4": { + "Ramsey\\Uuid\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A PHP library for generating and working with universally unique identifiers (UUIDs).", + "keywords": [ + "guid", + "identifier", + "uuid" + ], + "support": { + "issues": "https://github.com/ramsey/uuid/issues", + "source": "https://github.com/ramsey/uuid/tree/4.7.4" + }, + "funding": [ + { + "url": "https://github.com/ramsey", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/ramsey/uuid", + "type": "tidelift" + } + ], + "install-path": "../ramsey/uuid" + }, + { + "name": "rize/uri-template", + "version": "0.3.5", + "version_normalized": "0.3.5.0", + "source": { + "type": "git", + "url": "https://github.com/rize/UriTemplate.git", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/rize/UriTemplate/zipball/5ed4ba8ea34af84485dea815d4b6b620794d1168", + "reference": "5ed4ba8ea34af84485dea815d4b6b620794d1168", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.36" + }, + "time": "2022-10-12T17:22:51+00:00", + "type": "library", + "installation-source": "dist", + "autoload": { + "psr-4": { + "Rize\\": "src/Rize" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marut K", + "homepage": "http://twitter.com/rezigned" + } + ], + "description": "PHP URI Template (RFC 6570) supports both expansion & extraction", + "keywords": [ + "RFC 6570", + "template", + "uri" + ], + "support": { + "issues": "https://github.com/rize/UriTemplate/issues", + "source": "https://github.com/rize/UriTemplate/tree/0.3.5" + }, + "funding": [ + { + "url": "https://www.paypal.me/rezigned", + "type": "custom" + }, + { + "url": "https://github.com/rezigned", + "type": "github" + }, + { + "url": "https://opencollective.com/rize-uri-template", + "type": "open_collective" + } + ], + "install-path": "../rize/uri-template" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.0.2", + "version_normalized": "3.0.2.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "reference": "26954b3d62a6c5fd0ea8a2a00c0353a14978d05c", + "shasum": "" + }, + "require": { + "php": ">=8.0.2" + }, + "time": "2022-01-02T09:55:41+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + }, + "thanks": { + "name": "symfony/contracts", + "url": "https://github.com/symfony/contracts" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.0.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/deprecation-contracts" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.28.0", + "version_normalized": "1.28.0.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/7581cd600fa9fd681b797d00b02f068e2f13263b", + "reference": "7581cd600fa9fd681b797d00b02f068e2f13263b", + "shasum": "" + }, + "require": { + "php": ">=7.1" + }, + "time": "2023-01-26T09:26:14+00:00", + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.28-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" + } + }, + "installation-source": "dist", + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.28.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "install-path": "../symfony/polyfill-php81" + } + ], + "dev": false, + "dev-package-names": [] +} diff --git a/lib/Google/vendor/composer/installed.php b/lib/Google/vendor/composer/installed.php new file mode 100644 index 000000000..dd404f09d --- /dev/null +++ b/lib/Google/vendor/composer/installed.php @@ -0,0 +1,269 @@ + array( + 'name' => 'google/apiclient', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'f7f20f2eef1ca5dc4e2614c43dd40bb5689ccda3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev' => false, + ), + 'versions' => array( + 'brick/math' => array( + 'pretty_version' => '0.11.0', + 'version' => '0.11.0.0', + 'reference' => '0ad82ce168c82ba30d1c01ec86116ab52f589478', + 'type' => 'library', + 'install_path' => __DIR__ . '/../brick/math', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'firebase/php-jwt' => array( + 'pretty_version' => 'v6.9.0', + 'version' => '6.9.0.0', + 'reference' => 'f03270e63eaccf3019ef0f32849c497385774e11', + 'type' => 'library', + 'install_path' => __DIR__ . '/../firebase/php-jwt', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/apiclient' => array( + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => 'f7f20f2eef1ca5dc4e2614c43dd40bb5689ccda3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../../', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/apiclient-services' => array( + 'pretty_version' => 'v0.323.0', + 'version' => '0.323.0.0', + 'reference' => 'd5497d30ddfafe7592102ca48bedaf222a4ca7a6', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/apiclient-services', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/auth' => array( + 'pretty_version' => 'v1.32.1', + 'version' => '1.32.1.0', + 'reference' => '999e9ce8b9d17914f04e1718271a0a46da4de2f3', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/auth', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/cloud-core' => array( + 'pretty_version' => 'v1.52.8', + 'version' => '1.52.8.0', + 'reference' => '2ebcaa410f7e92dca5677dd9cc4ec1f9f315e83c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/cloud-core', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'google/cloud-storage' => array( + 'pretty_version' => 'v1.34.0', + 'version' => '1.34.0.0', + 'reference' => '4589dd3c8f4171db4ce3eb335fc7d894661ca0e9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../google/cloud-storage', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/guzzle' => array( + 'pretty_version' => '7.8.0', + 'version' => '7.8.0.0', + 'reference' => '1110f66a6530a40fe7aea0378fe608ee2b2248f9', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/guzzle', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/promises' => array( + 'pretty_version' => '2.0.1', + 'version' => '2.0.1.0', + 'reference' => '111166291a0f8130081195ac4556a5587d7f1b5d', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/promises', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'guzzlehttp/psr7' => array( + 'pretty_version' => '2.6.1', + 'version' => '2.6.1.0', + 'reference' => 'be45764272e8873c72dbe3d2edcfdfcc3bc9f727', + 'type' => 'library', + 'install_path' => __DIR__ . '/../guzzlehttp/psr7', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'monolog/monolog' => array( + 'pretty_version' => '2.9.2', + 'version' => '2.9.2.0', + 'reference' => '437cb3628f4cf6042cc10ae97fc2b8472e48ca1f', + 'type' => 'library', + 'install_path' => __DIR__ . '/../monolog/monolog', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'paragonie/constant_time_encoding' => array( + 'pretty_version' => 'v2.6.3', + 'version' => '2.6.3.0', + 'reference' => '58c3f47f650c94ec05a151692652a868995d2938', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/constant_time_encoding', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'paragonie/random_compat' => array( + 'pretty_version' => 'v9.99.100', + 'version' => '9.99.100.0', + 'reference' => '996434e5492cb4c3edcb9168db6fbb1359ef965a', + 'type' => 'library', + 'install_path' => __DIR__ . '/../paragonie/random_compat', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'phpseclib/phpseclib' => array( + 'pretty_version' => '3.0.33', + 'version' => '3.0.33.0', + 'reference' => '33fa69b2514a61138dd48e7a49f99445711e0ad0', + 'type' => 'library', + 'install_path' => __DIR__ . '/../phpseclib/phpseclib', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/cache' => array( + 'pretty_version' => '2.0.0', + 'version' => '2.0.0.0', + 'reference' => '213f9dbc5b9bfbc4f8db86d2838dc968752ce13b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/cache', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client' => array( + 'pretty_version' => '1.0.3', + 'version' => '1.0.3.0', + 'reference' => 'bb5906edc1c324c9a05aa0873d40117941e5fa90', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-client', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-client-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-factory' => array( + 'pretty_version' => '1.0.2', + 'version' => '1.0.2.0', + 'reference' => 'e616d01114759c4c489f93b099585439f795fe35', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-factory', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-factory-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/http-message' => array( + 'pretty_version' => '2.0', + 'version' => '2.0.0.0', + 'reference' => '402d35bcb92c70c026d1a6a9883f06b2ead23d71', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/http-message', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/http-message-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0', + ), + ), + 'psr/log' => array( + 'pretty_version' => '1.1.4', + 'version' => '1.1.4.0', + 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', + 'type' => 'library', + 'install_path' => __DIR__ . '/../psr/log', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'psr/log-implementation' => array( + 'dev_requirement' => false, + 'provided' => array( + 0 => '1.0.0 || 2.0.0 || 3.0.0', + ), + ), + 'ralouphie/getallheaders' => array( + 'pretty_version' => '3.0.3', + 'version' => '3.0.3.0', + 'reference' => '120b605dfeb996808c31b6477290a714d356e822', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ralouphie/getallheaders', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ramsey/collection' => array( + 'pretty_version' => '1.3.0', + 'version' => '1.3.0.0', + 'reference' => 'ad7475d1c9e70b190ecffc58f2d989416af339b4', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ramsey/collection', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'ramsey/uuid' => array( + 'pretty_version' => '4.7.4', + 'version' => '4.7.4.0', + 'reference' => '60a4c63ab724854332900504274f6150ff26d286', + 'type' => 'library', + 'install_path' => __DIR__ . '/../ramsey/uuid', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'rhumsaa/uuid' => array( + 'dev_requirement' => false, + 'replaced' => array( + 0 => '4.7.4', + ), + ), + 'rize/uri-template' => array( + 'pretty_version' => '0.3.5', + 'version' => '0.3.5.0', + 'reference' => '5ed4ba8ea34af84485dea815d4b6b620794d1168', + 'type' => 'library', + 'install_path' => __DIR__ . '/../rize/uri-template', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/deprecation-contracts' => array( + 'pretty_version' => 'v3.0.2', + 'version' => '3.0.2.0', + 'reference' => '26954b3d62a6c5fd0ea8a2a00c0353a14978d05c', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', + 'aliases' => array(), + 'dev_requirement' => false, + ), + 'symfony/polyfill-php81' => array( + 'pretty_version' => 'v1.28.0', + 'version' => '1.28.0.0', + 'reference' => '7581cd600fa9fd681b797d00b02f068e2f13263b', + 'type' => 'library', + 'install_path' => __DIR__ . '/../symfony/polyfill-php81', + 'aliases' => array(), + 'dev_requirement' => false, + ), + ), +); diff --git a/lib/Google/vendor/composer/platform_check.php b/lib/Google/vendor/composer/platform_check.php new file mode 100644 index 000000000..b168ddd5d --- /dev/null +++ b/lib/Google/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 80002)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 8.0.2". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md index 35e97fe86..4279dfd23 100644 --- a/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md +++ b/lib/Google/vendor/firebase/php-jwt/CHANGELOG.md @@ -1,5 +1,51 @@ # Changelog +## [6.9.0](https://github.com/firebase/php-jwt/compare/v6.8.1...v6.9.0) (2023-10-04) + + +### Features + +* add payload to jwt exception ([#521](https://github.com/firebase/php-jwt/issues/521)) ([175edf9](https://github.com/firebase/php-jwt/commit/175edf958bb61922ec135b2333acf5622f2238a2)) + +## [6.8.1](https://github.com/firebase/php-jwt/compare/v6.8.0...v6.8.1) (2023-07-14) + + +### Bug Fixes + +* accept float claims but round down to ignore them ([#492](https://github.com/firebase/php-jwt/issues/492)) ([3936842](https://github.com/firebase/php-jwt/commit/39368423beeaacb3002afa7dcb75baebf204fe7e)) +* different BeforeValidException messages for nbf and iat ([#526](https://github.com/firebase/php-jwt/issues/526)) ([0a53cf2](https://github.com/firebase/php-jwt/commit/0a53cf2986e45c2bcbf1a269f313ebf56a154ee4)) + +## [6.8.0](https://github.com/firebase/php-jwt/compare/v6.7.0...v6.8.0) (2023-06-14) + + +### Features + +* add support for P-384 curve ([#515](https://github.com/firebase/php-jwt/issues/515)) ([5de4323](https://github.com/firebase/php-jwt/commit/5de4323f4baf4d70bca8663bd87682a69c656c3d)) + + +### Bug Fixes + +* handle invalid http responses ([#508](https://github.com/firebase/php-jwt/issues/508)) ([91c39c7](https://github.com/firebase/php-jwt/commit/91c39c72b22fc3e1191e574089552c1f2041c718)) + +## [6.7.0](https://github.com/firebase/php-jwt/compare/v6.6.0...v6.7.0) (2023-06-14) + + +### Features + +* add ed25519 support to JWK (public keys) ([#452](https://github.com/firebase/php-jwt/issues/452)) ([e53979a](https://github.com/firebase/php-jwt/commit/e53979abae927de916a75b9d239cfda8ce32be2a)) + +## [6.6.0](https://github.com/firebase/php-jwt/compare/v6.5.0...v6.6.0) (2023-06-13) + + +### Features + +* allow get headers when decoding token ([#442](https://github.com/firebase/php-jwt/issues/442)) ([fb85f47](https://github.com/firebase/php-jwt/commit/fb85f47cfaeffdd94faf8defdf07164abcdad6c3)) + + +### Bug Fixes + +* only check iat if nbf is not used ([#493](https://github.com/firebase/php-jwt/issues/493)) ([398ccd2](https://github.com/firebase/php-jwt/commit/398ccd25ea12fa84b9e4f1085d5ff448c21ec797)) + ## [6.5.0](https://github.com/firebase/php-jwt/compare/v6.4.0...v6.5.0) (2023-05-12) diff --git a/lib/Google/vendor/firebase/php-jwt/README.md b/lib/Google/vendor/firebase/php-jwt/README.md index f03826673..701de23a8 100644 --- a/lib/Google/vendor/firebase/php-jwt/README.md +++ b/lib/Google/vendor/firebase/php-jwt/README.md @@ -45,9 +45,12 @@ $payload = [ */ $jwt = JWT::encode($payload, $key, 'HS256'); $decoded = JWT::decode($jwt, new Key($key, 'HS256')); - print_r($decoded); +// Pass a stdClass in as the third parameter to get the decoded header values +$decoded = JWT::decode($jwt, new Key($key, 'HS256'), $headers = new stdClass()); +print_r($headers); + /* NOTE: This will now be an object instead of an associative array. To get an associative array, you will need to cast it as such: @@ -70,8 +73,8 @@ Example encode/decode headers Decoding the JWT headers without verifying the JWT first is NOT recommended, and is not supported by this library. This is because without verifying the JWT, the header values could have been tampered with. Any value pulled from an unverified header should be treated as if it could be any string sent in from an -attacker. If this is something you still want to do in your application for whatever reason, it's possible to -decode the header values manually simply by calling `json_decode` and `base64_decode` on the JWT +attacker. If this is something you still want to do in your application for whatever reason, it's possible to +decode the header values manually simply by calling `json_decode` and `base64_decode` on the JWT header part: ```php use Firebase\JWT\JWT; @@ -373,6 +376,8 @@ All exceptions in the `Firebase\JWT` namespace extend `UnexpectedValueException` like this: ```php +use Firebase\JWT\JWT; +use UnexpectedValueException; try { $decoded = JWT::decode($payload, $keys); } catch (LogicException $e) { diff --git a/lib/Google/vendor/firebase/php-jwt/src/BeforeValidException.php b/lib/Google/vendor/firebase/php-jwt/src/BeforeValidException.php index c147852b9..595164bf3 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/BeforeValidException.php +++ b/lib/Google/vendor/firebase/php-jwt/src/BeforeValidException.php @@ -2,6 +2,17 @@ namespace Firebase\JWT; -class BeforeValidException extends \UnexpectedValueException +class BeforeValidException extends \UnexpectedValueException implements JWTExceptionWithPayloadInterface { + private object $payload; + + public function setPayload(object $payload): void + { + $this->payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } } diff --git a/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php b/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php index baf801f13..ee529f9f5 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php +++ b/lib/Google/vendor/firebase/php-jwt/src/CachedKeySet.php @@ -178,6 +178,16 @@ private function keyIdExists(string $keyId): bool } $request = $this->httpFactory->createRequest('GET', $this->jwksUri); $jwksResponse = $this->httpClient->sendRequest($request); + if ($jwksResponse->getStatusCode() !== 200) { + throw new UnexpectedValueException( + sprintf('HTTP Error: %d %s for URI "%s"', + $jwksResponse->getStatusCode(), + $jwksResponse->getReasonPhrase(), + $this->jwksUri, + ), + $jwksResponse->getStatusCode() + ); + } $this->keySet = $this->formatJwksForCache((string) $jwksResponse->getBody()); if (!isset($this->keySet[$keyId])) { diff --git a/lib/Google/vendor/firebase/php-jwt/src/ExpiredException.php b/lib/Google/vendor/firebase/php-jwt/src/ExpiredException.php index 81ba52d43..12fef0944 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/ExpiredException.php +++ b/lib/Google/vendor/firebase/php-jwt/src/ExpiredException.php @@ -2,6 +2,17 @@ namespace Firebase\JWT; -class ExpiredException extends \UnexpectedValueException +class ExpiredException extends \UnexpectedValueException implements JWTExceptionWithPayloadInterface { + private object $payload; + + public function setPayload(object $payload): void + { + $this->payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } } diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWK.php b/lib/Google/vendor/firebase/php-jwt/src/JWK.php index c7eff8ae4..63fb2484b 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/JWK.php +++ b/lib/Google/vendor/firebase/php-jwt/src/JWK.php @@ -27,10 +27,16 @@ class JWK private const EC_CURVES = [ 'P-256' => '1.2.840.10045.3.1.7', // Len: 64 'secp256k1' => '1.3.132.0.10', // Len: 64 - // 'P-384' => '1.3.132.0.34', // Len: 96 (not yet supported) + 'P-384' => '1.3.132.0.34', // Len: 96 // 'P-521' => '1.3.132.0.35', // Len: 132 (not supported) ]; + // For keys with "kty" equal to "OKP" (Octet Key Pair), the "crv" parameter must contain the key subtype. + // This library supports the following subtypes: + private const OKP_SUBTYPES = [ + 'Ed25519' => true, // RFC 8037 + ]; + /** * Parse a set of JWK keys * @@ -145,8 +151,28 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key $publicKey = self::createPemFromCrvAndXYCoordinates($jwk['crv'], $jwk['x'], $jwk['y']); return new Key($publicKey, $jwk['alg']); + case 'OKP': + if (isset($jwk['d'])) { + // The key is actually a private key + throw new UnexpectedValueException('Key data must be for a public key'); + } + + if (!isset($jwk['crv'])) { + throw new UnexpectedValueException('crv not set'); + } + + if (empty(self::OKP_SUBTYPES[$jwk['crv']])) { + throw new DomainException('Unrecognised or unsupported OKP key subtype'); + } + + if (empty($jwk['x'])) { + throw new UnexpectedValueException('x not set'); + } + + // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. + $publicKey = JWT::convertBase64urlToBase64($jwk['x']); + return new Key($publicKey, $jwk['alg']); default: - // Currently only RSA is supported break; } @@ -156,7 +182,7 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key /** * Converts the EC JWK values to pem format. * - * @param string $crv The EC curve (only P-256 is supported) + * @param string $crv The EC curve (only P-256 & P-384 is supported) * @param string $x The EC x-coordinate * @param string $y The EC y-coordinate * diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWT.php b/lib/Google/vendor/firebase/php-jwt/src/JWT.php index c83ff0990..6efcbb56d 100644 --- a/lib/Google/vendor/firebase/php-jwt/src/JWT.php +++ b/lib/Google/vendor/firebase/php-jwt/src/JWT.php @@ -78,6 +78,7 @@ class JWT * Supported algorithms are 'ES384','ES256', * 'HS256', 'HS384', 'HS512', 'RS256', 'RS384' * and 'RS512'. + * @param stdClass $headers Optional. Populates stdClass with headers. * * @return stdClass The JWT's payload as a PHP object * @@ -94,7 +95,8 @@ class JWT */ public static function decode( string $jwt, - $keyOrKeyArray + $keyOrKeyArray, + stdClass &$headers = null ): stdClass { // Validate JWT $timestamp = \is_null(static::$timestamp) ? \time() : static::$timestamp; @@ -111,6 +113,9 @@ public static function decode( if (null === ($header = static::jsonDecode($headerRaw))) { throw new UnexpectedValueException('Invalid header encoding'); } + if ($headers !== null) { + $headers = $header; + } $payloadRaw = static::urlsafeB64Decode($bodyb64); if (null === ($payload = static::jsonDecode($payloadRaw))) { throw new UnexpectedValueException('Invalid claims encoding'); @@ -147,24 +152,30 @@ public static function decode( // Check the nbf if it is defined. This is the time that the // token can actually be used. If it's not yet that time, abort. - if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) { - throw new BeforeValidException( - 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf) + if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf) ); + $ex->setPayload($payload); + throw $ex; } // Check that this token has been created before 'now'. This prevents // using tokens that have been created for later use (and haven't // correctly used the nbf claim). - if (isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { - throw new BeforeValidException( - 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat) + if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat) ); + $ex->setPayload($payload); + throw $ex; } // Check if this token has expired. if (isset($payload->exp) && ($timestamp - static::$leeway) >= $payload->exp) { - throw new ExpiredException('Expired token'); + $ex = new ExpiredException('Expired token'); + $ex->setPayload($payload); + throw $ex; } return $payload; @@ -215,7 +226,7 @@ public static function encode( * * @param string $msg The message to sign * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key. - * @param string $alg Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', + * @param string $alg Supported algorithms are 'EdDSA', 'ES384', 'ES256', 'ES256K', 'HS256', * 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' * * @return string An encrypted message @@ -278,7 +289,7 @@ public static function sign( * * @param string $msg The original message (header and body) * @param string $signature The original signature - * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For Ed*, ES*, HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey * @param string $alg The algorithm * * @return bool @@ -399,13 +410,28 @@ public static function jsonEncode(array $input): string * @throws InvalidArgumentException invalid base64 characters */ public static function urlsafeB64Decode(string $input): string + { + return \base64_decode(self::convertBase64UrlToBase64($input)); + } + + /** + * Convert a string in the base64url (URL-safe Base64) encoding to standard base64. + * + * @param string $input A Base64 encoded string with URL-safe characters (-_ and no padding) + * + * @return string A Base64 encoded string with standard characters (+/) and padding (=), when + * needed. + * + * @see https://www.rfc-editor.org/rfc/rfc4648 + */ + public static function convertBase64UrlToBase64(string $input): string { $remainder = \strlen($input) % 4; if ($remainder) { $padlen = 4 - $remainder; $input .= \str_repeat('=', $padlen); } - return \base64_decode(\strtr($input, '-_', '+/')); + return \strtr($input, '-_', '+/'); } /** diff --git a/lib/Google/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php b/lib/Google/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php new file mode 100644 index 000000000..7933ed68b --- /dev/null +++ b/lib/Google/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php @@ -0,0 +1,20 @@ + 'Google_Client', + 'Google\\Service' => 'Google_Service', + 'Google\\Service\\Resource' => 'Google_Service_Resource', + 'Google\\Model' => 'Google_Model', + 'Google\\Collection' => 'Google_Collection', + ]; + foreach ($servicesClassMap as $alias => $class) { + class_alias($class, $alias); + } + } +} +spl_autoload_register(function ($class) { + if (0 === strpos($class, 'Google_Service_')) { + // Autoload the new class, which will also create an alias for the + // old class by changing underscores to namespaces: + // Google_Service_Speech_Resource_Operations + // => Google\Service\Speech\Resource\Operations + $classExists = class_exists($newClass = str_replace('_', '\\', $class)); + if ($classExists) { + return true; + } + } +}, true, true); diff --git a/lib/Google/vendor/google/apiclient-services/composer.json b/lib/Google/vendor/google/apiclient-services/composer.json new file mode 100644 index 000000000..ecc41f4e1 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/composer.json @@ -0,0 +1,27 @@ +{ + "name": "google/apiclient-services", + "type": "library", + "description": "Client library for Google APIs", + "keywords": ["google"], + "homepage": "http://developers.google.com/api-client-library/php", + "license": "Apache-2.0", + "require": { + "php": "^7.4||^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^5.7||^8.5.13" + }, + "autoload": { + "psr-4": { + "Google\\Service\\": "src" + }, + "files": [ + "autoload.php" + ] + }, + "autoload-dev": { + "psr-4": { + "Google\\": "tests/mocks" + } + } +} diff --git a/lib/Google/src/Service/Storage.php b/lib/Google/vendor/google/apiclient-services/src/Storage.php similarity index 79% rename from lib/Google/src/Service/Storage.php rename to lib/Google/vendor/google/apiclient-services/src/Storage.php index ae676e286..9f8fb34e4 100644 --- a/lib/Google/src/Service/Storage.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage.php @@ -50,13 +50,16 @@ class Storage extends \Google\Service const DEVSTORAGE_READ_WRITE = "https://www.googleapis.com/auth/devstorage.read_write"; + public $anywhereCache; public $bucketAccessControls; public $buckets; public $channels; public $defaultObjectAccessControls; + public $managedFolders; public $notifications; public $objectAccessControls; public $objects; + public $operations; public $projects_hmacKeys; public $projects_serviceAccount; @@ -76,6 +79,119 @@ public function __construct($clientOrConfig = [], $rootUrl = null) $this->version = 'v1'; $this->serviceName = 'storage'; + $this->anywhereCache = new Storage\Resource\AnywhereCache( + $this, + $this->serviceName, + 'anywhereCache', + [ + 'methods' => [ + 'disable' => [ + 'path' => 'b/{bucket}/anywhereCaches/{anywhereCacheId}/disable', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'anywhereCacheId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'get' => [ + 'path' => 'b/{bucket}/anywhereCaches/{anywhereCacheId}', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'anywhereCacheId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'insert' => [ + 'path' => 'b/{bucket}/anywhereCaches', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'list' => [ + 'path' => 'b/{bucket}/anywhereCache', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'pageSize' => [ + 'location' => 'query', + 'type' => 'integer', + ], + 'pageToken' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'pause' => [ + 'path' => 'b/{bucket}/anywhereCaches/{anywhereCacheId}/pause', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'anywhereCacheId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'resume' => [ + 'path' => 'b/{bucket}/anywhereCaches/{anywhereCacheId}/resume', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'anywhereCacheId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'update' => [ + 'path' => 'b/{bucket}/anywhereCaches/{anywhereCacheId}', + 'httpMethod' => 'PATCH', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'anywhereCacheId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ], + ] + ] + ); $this->bucketAccessControls = new Storage\Resource\BucketAccessControls( $this, $this->serviceName, @@ -271,6 +387,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'type' => 'string', 'required' => true, ], + 'enableObjectRetention' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'predefinedAcl' => [ 'location' => 'query', 'type' => 'string', @@ -579,6 +699,161 @@ public function __construct($clientOrConfig = [], $rootUrl = null) ] ] ); + $this->managedFolders = new Storage\Resource\ManagedFolders( + $this, + $this->serviceName, + 'managedFolders', + [ + 'methods' => [ + 'delete' => [ + 'path' => 'b/{bucket}/managedFolders/{managedFolder}', + 'httpMethod' => 'DELETE', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'managedFolder' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'ifMetagenerationMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'ifMetagenerationNotMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'get' => [ + 'path' => 'b/{bucket}/managedFolders/{managedFolder}', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'managedFolder' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'ifMetagenerationMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'ifMetagenerationNotMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'getIamPolicy' => [ + 'path' => 'b/{bucket}/managedFolders/{managedFolder}/iam', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'managedFolder' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'optionsRequestedPolicyVersion' => [ + 'location' => 'query', + 'type' => 'integer', + ], + 'userProject' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'insert' => [ + 'path' => 'b/{bucket}/managedFolders', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'list' => [ + 'path' => 'b/{bucket}/managedFolders', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'pageSize' => [ + 'location' => 'query', + 'type' => 'integer', + ], + 'pageToken' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'prefix' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'setIamPolicy' => [ + 'path' => 'b/{bucket}/managedFolders/{managedFolder}/iam', + 'httpMethod' => 'PUT', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'managedFolder' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'userProject' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ],'testIamPermissions' => [ + 'path' => 'b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'managedFolder' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'permissions' => [ + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + 'required' => true, + ], + 'userProject' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ], + ] + ] + ); $this->notifications = new Storage\Resource\Notifications( $this, $this->serviceName, @@ -829,7 +1104,17 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'objects', [ 'methods' => [ - 'compose' => [ + 'bulkRestore' => [ + 'path' => 'b/{bucket}/o/bulkRestore', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'compose' => [ 'path' => 'b/{destinationBucket}/o/{destinationObject}/compose', 'httpMethod' => 'POST', 'parameters' => [ @@ -1018,6 +1303,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'location' => 'query', 'type' => 'string', ], + 'softDeleted' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'userProject' => [ 'location' => 'query', 'type' => 'string', @@ -1113,6 +1402,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'location' => 'query', 'type' => 'string', ], + 'includeFoldersAsPrefixes' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'includeTrailingDelimiter' => [ 'location' => 'query', 'type' => 'boolean', @@ -1137,6 +1430,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'location' => 'query', 'type' => 'string', ], + 'softDeleted' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'startOffset' => [ 'location' => 'query', 'type' => 'string', @@ -1184,6 +1481,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'location' => 'query', 'type' => 'string', ], + 'overrideUnlockedRetention' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'predefinedAcl' => [ 'location' => 'query', 'type' => 'string', @@ -1197,6 +1498,54 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'type' => 'string', ], ], + ],'restore' => [ + 'path' => 'b/{bucket}/o/{object}/restore', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'object' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'copySourceAcl' => [ + 'location' => 'query', + 'type' => 'boolean', + ], + 'generation' => [ + 'location' => 'query', + 'type' => 'string', + 'required' => true, + ], + 'ifGenerationMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'ifGenerationNotMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'ifMetagenerationMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'ifMetagenerationNotMatch' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'projection' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'userProject' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], ],'rewrite' => [ 'path' => 'b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}', 'httpMethod' => 'POST', @@ -1368,6 +1717,10 @@ public function __construct($clientOrConfig = [], $rootUrl = null) 'location' => 'query', 'type' => 'string', ], + 'overrideUnlockedRetention' => [ + 'location' => 'query', + 'type' => 'boolean', + ], 'predefinedAcl' => [ 'location' => 'query', 'type' => 'string', @@ -1435,6 +1788,68 @@ public function __construct($clientOrConfig = [], $rootUrl = null) ] ] ); + $this->operations = new Storage\Resource\Operations( + $this, + $this->serviceName, + 'operations', + [ + 'methods' => [ + 'cancel' => [ + 'path' => 'b/{bucket}/operations/{operationId}/cancel', + 'httpMethod' => 'POST', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'operationId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'get' => [ + 'path' => 'b/{bucket}/operations/{operationId}', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'operationId' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + ], + ],'list' => [ + 'path' => 'b/{bucket}/operations', + 'httpMethod' => 'GET', + 'parameters' => [ + 'bucket' => [ + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ], + 'filter' => [ + 'location' => 'query', + 'type' => 'string', + ], + 'pageSize' => [ + 'location' => 'query', + 'type' => 'integer', + ], + 'pageToken' => [ + 'location' => 'query', + 'type' => 'string', + ], + ], + ], + ] + ] + ); $this->projects_hmacKeys = new Storage\Resource\ProjectsHmacKeys( $this, $this->serviceName, diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCache.php b/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCache.php new file mode 100644 index 000000000..d31c489a5 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCache.php @@ -0,0 +1,224 @@ +admissionPolicy = $admissionPolicy; + } + /** + * @return string + */ + public function getAdmissionPolicy() + { + return $this->admissionPolicy; + } + /** + * @param string + */ + public function setAnywhereCacheId($anywhereCacheId) + { + $this->anywhereCacheId = $anywhereCacheId; + } + /** + * @return string + */ + public function getAnywhereCacheId() + { + return $this->anywhereCacheId; + } + /** + * @param string + */ + public function setBucket($bucket) + { + $this->bucket = $bucket; + } + /** + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + /** + * @param string + */ + public function setCreateTime($createTime) + { + $this->createTime = $createTime; + } + /** + * @return string + */ + public function getCreateTime() + { + return $this->createTime; + } + /** + * @param string + */ + public function setId($id) + { + $this->id = $id; + } + /** + * @return string + */ + public function getId() + { + return $this->id; + } + /** + * @param string + */ + public function setKind($kind) + { + $this->kind = $kind; + } + /** + * @return string + */ + public function getKind() + { + return $this->kind; + } + /** + * @param bool + */ + public function setPendingUpdate($pendingUpdate) + { + $this->pendingUpdate = $pendingUpdate; + } + /** + * @return bool + */ + public function getPendingUpdate() + { + return $this->pendingUpdate; + } + /** + * @param string + */ + public function setSelfLink($selfLink) + { + $this->selfLink = $selfLink; + } + /** + * @return string + */ + public function getSelfLink() + { + return $this->selfLink; + } + /** + * @param string + */ + public function setState($state) + { + $this->state = $state; + } + /** + * @return string + */ + public function getState() + { + return $this->state; + } + /** + * @param string + */ + public function setTtl($ttl) + { + $this->ttl = $ttl; + } + /** + * @return string + */ + public function getTtl() + { + return $this->ttl; + } + /** + * @param string + */ + public function setUpdateTime($updateTime) + { + $this->updateTime = $updateTime; + } + /** + * @return string + */ + public function getUpdateTime() + { + return $this->updateTime; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnywhereCache::class, 'Google_Service_Storage_AnywhereCache'); diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCaches.php b/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCaches.php new file mode 100644 index 000000000..14874aea2 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/AnywhereCaches.php @@ -0,0 +1,79 @@ +items = $items; + } + /** + * @return AnywhereCache[] + */ + public function getItems() + { + return $this->items; + } + /** + * @param string + */ + public function setKind($kind) + { + $this->kind = $kind; + } + /** + * @return string + */ + public function getKind() + { + return $this->kind; + } + /** + * @param string + */ + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + /** + * @return string + */ + public function getNextPageToken() + { + return $this->nextPageToken; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnywhereCaches::class, 'Google_Service_Storage_AnywhereCaches'); diff --git a/lib/Google/src/Service/Storage/Bucket.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php similarity index 92% rename from lib/Google/src/Service/Storage/Bucket.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php index 655fea046..ac732ea62 100644 --- a/lib/Google/src/Service/Storage/Bucket.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Bucket.php @@ -76,6 +76,8 @@ class Bucket extends \Google\Collection * @var string */ public $name; + protected $objectRetentionType = BucketObjectRetention::class; + protected $objectRetentionDataType = ''; protected $ownerType = BucketOwner::class; protected $ownerDataType = ''; /** @@ -96,6 +98,8 @@ class Bucket extends \Google\Collection * @var string */ public $selfLink; + protected $softDeletePolicyType = BucketSoftDeletePolicy::class; + protected $softDeletePolicyDataType = ''; /** * @var string */ @@ -379,6 +383,20 @@ public function getName() { return $this->name; } + /** + * @param BucketObjectRetention + */ + public function setObjectRetention(BucketObjectRetention $objectRetention) + { + $this->objectRetention = $objectRetention; + } + /** + * @return BucketObjectRetention + */ + public function getObjectRetention() + { + return $this->objectRetention; + } /** * @param BucketOwner */ @@ -463,6 +481,20 @@ public function getSelfLink() { return $this->selfLink; } + /** + * @param BucketSoftDeletePolicy + */ + public function setSoftDeletePolicy(BucketSoftDeletePolicy $softDeletePolicy) + { + $this->softDeletePolicy = $softDeletePolicy; + } + /** + * @return BucketSoftDeletePolicy + */ + public function getSoftDeletePolicy() + { + return $this->softDeletePolicy; + } /** * @param string */ diff --git a/lib/Google/src/Service/Storage/BucketAccessControl.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControl.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketAccessControl.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControl.php diff --git a/lib/Google/src/Service/Storage/BucketAccessControlProjectTeam.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControlProjectTeam.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketAccessControlProjectTeam.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControlProjectTeam.php diff --git a/lib/Google/src/Service/Storage/BucketAccessControls.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControls.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketAccessControls.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketAccessControls.php diff --git a/lib/Google/src/Service/Storage/BucketAutoclass.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketAutoclass.php similarity index 64% rename from lib/Google/src/Service/Storage/BucketAutoclass.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketAutoclass.php index 42e8bdcc1..956676ae8 100644 --- a/lib/Google/src/Service/Storage/BucketAutoclass.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketAutoclass.php @@ -23,6 +23,14 @@ class BucketAutoclass extends \Google\Model * @var bool */ public $enabled; + /** + * @var string + */ + public $terminalStorageClass; + /** + * @var string + */ + public $terminalStorageClassUpdateTime; /** * @var string */ @@ -42,6 +50,34 @@ public function getEnabled() { return $this->enabled; } + /** + * @param string + */ + public function setTerminalStorageClass($terminalStorageClass) + { + $this->terminalStorageClass = $terminalStorageClass; + } + /** + * @return string + */ + public function getTerminalStorageClass() + { + return $this->terminalStorageClass; + } + /** + * @param string + */ + public function setTerminalStorageClassUpdateTime($terminalStorageClassUpdateTime) + { + $this->terminalStorageClassUpdateTime = $terminalStorageClassUpdateTime; + } + /** + * @return string + */ + public function getTerminalStorageClassUpdateTime() + { + return $this->terminalStorageClassUpdateTime; + } /** * @param string */ diff --git a/lib/Google/src/Service/Storage/BucketBilling.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketBilling.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketBilling.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketBilling.php diff --git a/lib/Google/src/Service/Storage/BucketCors.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketCors.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketCors.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketCors.php diff --git a/lib/Google/src/Service/Storage/BucketCustomPlacementConfig.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketCustomPlacementConfig.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketCustomPlacementConfig.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketCustomPlacementConfig.php diff --git a/lib/Google/src/Service/Storage/BucketEncryption.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketEncryption.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketEncryption.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketEncryption.php diff --git a/lib/Google/src/Service/Storage/BucketIamConfiguration.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfiguration.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketIamConfiguration.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfiguration.php diff --git a/lib/Google/src/Service/Storage/BucketIamConfigurationBucketPolicyOnly.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfigurationBucketPolicyOnly.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketIamConfigurationBucketPolicyOnly.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfigurationBucketPolicyOnly.php diff --git a/lib/Google/src/Service/Storage/BucketIamConfigurationUniformBucketLevelAccess.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfigurationUniformBucketLevelAccess.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketIamConfigurationUniformBucketLevelAccess.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketIamConfigurationUniformBucketLevelAccess.php diff --git a/lib/Google/src/Service/Storage/BucketLifecycle.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycle.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketLifecycle.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycle.php diff --git a/lib/Google/src/Service/Storage/BucketLifecycleRule.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRule.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketLifecycleRule.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRule.php diff --git a/lib/Google/src/Service/Storage/BucketLifecycleRuleAction.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRuleAction.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketLifecycleRuleAction.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRuleAction.php diff --git a/lib/Google/src/Service/Storage/BucketLifecycleRuleCondition.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRuleCondition.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketLifecycleRuleCondition.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketLifecycleRuleCondition.php diff --git a/lib/Google/src/Service/Storage/BucketLogging.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketLogging.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketLogging.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketLogging.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BucketObjectRetention.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketObjectRetention.php new file mode 100644 index 000000000..5d4a29d9e --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketObjectRetention.php @@ -0,0 +1,44 @@ +mode = $mode; + } + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BucketObjectRetention::class, 'Google_Service_Storage_BucketObjectRetention'); diff --git a/lib/Google/src/Service/Storage/BucketOwner.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketOwner.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketOwner.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketOwner.php diff --git a/lib/Google/src/Service/Storage/BucketRetentionPolicy.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketRetentionPolicy.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketRetentionPolicy.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketRetentionPolicy.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BucketSoftDeletePolicy.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketSoftDeletePolicy.php new file mode 100644 index 000000000..5c28f9b26 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketSoftDeletePolicy.php @@ -0,0 +1,62 @@ +effectiveTime = $effectiveTime; + } + /** + * @return string + */ + public function getEffectiveTime() + { + return $this->effectiveTime; + } + /** + * @param string + */ + public function setRetentionDurationSeconds($retentionDurationSeconds) + { + $this->retentionDurationSeconds = $retentionDurationSeconds; + } + /** + * @return string + */ + public function getRetentionDurationSeconds() + { + return $this->retentionDurationSeconds; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BucketSoftDeletePolicy::class, 'Google_Service_Storage_BucketSoftDeletePolicy'); diff --git a/lib/Google/src/Service/Storage/BucketVersioning.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketVersioning.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketVersioning.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketVersioning.php diff --git a/lib/Google/src/Service/Storage/BucketWebsite.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BucketWebsite.php similarity index 100% rename from lib/Google/src/Service/Storage/BucketWebsite.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/BucketWebsite.php diff --git a/lib/Google/src/Service/Storage/Buckets.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Buckets.php similarity index 100% rename from lib/Google/src/Service/Storage/Buckets.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Buckets.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/BulkRestoreObjectsRequest.php b/lib/Google/vendor/google/apiclient-services/src/Storage/BulkRestoreObjectsRequest.php new file mode 100644 index 000000000..d7feda6f0 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/BulkRestoreObjectsRequest.php @@ -0,0 +1,117 @@ +allowOverwrite = $allowOverwrite; + } + /** + * @return bool + */ + public function getAllowOverwrite() + { + return $this->allowOverwrite; + } + /** + * @param bool + */ + public function setCopySourceAcl($copySourceAcl) + { + $this->copySourceAcl = $copySourceAcl; + } + /** + * @return bool + */ + public function getCopySourceAcl() + { + return $this->copySourceAcl; + } + /** + * @param string[] + */ + public function setMatchGlobs($matchGlobs) + { + $this->matchGlobs = $matchGlobs; + } + /** + * @return string[] + */ + public function getMatchGlobs() + { + return $this->matchGlobs; + } + /** + * @param string + */ + public function setSoftDeletedAfterTime($softDeletedAfterTime) + { + $this->softDeletedAfterTime = $softDeletedAfterTime; + } + /** + * @return string + */ + public function getSoftDeletedAfterTime() + { + return $this->softDeletedAfterTime; + } + /** + * @param string + */ + public function setSoftDeletedBeforeTime($softDeletedBeforeTime) + { + $this->softDeletedBeforeTime = $softDeletedBeforeTime; + } + /** + * @return string + */ + public function getSoftDeletedBeforeTime() + { + return $this->softDeletedBeforeTime; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(BulkRestoreObjectsRequest::class, 'Google_Service_Storage_BulkRestoreObjectsRequest'); diff --git a/lib/Google/src/Service/Storage/Channel.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Channel.php similarity index 100% rename from lib/Google/src/Service/Storage/Channel.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Channel.php diff --git a/lib/Google/src/Service/Storage/ComposeRequest.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequest.php similarity index 100% rename from lib/Google/src/Service/Storage/ComposeRequest.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequest.php diff --git a/lib/Google/src/Service/Storage/ComposeRequestSourceObjects.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequestSourceObjects.php similarity index 100% rename from lib/Google/src/Service/Storage/ComposeRequestSourceObjects.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequestSourceObjects.php diff --git a/lib/Google/src/Service/Storage/ComposeRequestSourceObjectsObjectPreconditions.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequestSourceObjectsObjectPreconditions.php similarity index 100% rename from lib/Google/src/Service/Storage/ComposeRequestSourceObjectsObjectPreconditions.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ComposeRequestSourceObjectsObjectPreconditions.php diff --git a/lib/Google/src/Service/Storage/Expr.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Expr.php similarity index 100% rename from lib/Google/src/Service/Storage/Expr.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Expr.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningListOperationsResponse.php b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningListOperationsResponse.php new file mode 100644 index 000000000..55efd1fed --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningListOperationsResponse.php @@ -0,0 +1,61 @@ +nextPageToken = $nextPageToken; + } + /** + * @return string + */ + public function getNextPageToken() + { + return $this->nextPageToken; + } + /** + * @param GoogleLongrunningOperation[] + */ + public function setOperations($operations) + { + $this->operations = $operations; + } + /** + * @return GoogleLongrunningOperation[] + */ + public function getOperations() + { + return $this->operations; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleLongrunningListOperationsResponse::class, 'Google_Service_Storage_GoogleLongrunningListOperationsResponse'); diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningOperation.php b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningOperation.php new file mode 100644 index 000000000..42db42881 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleLongrunningOperation.php @@ -0,0 +1,114 @@ +done = $done; + } + /** + * @return bool + */ + public function getDone() + { + return $this->done; + } + /** + * @param GoogleRpcStatus + */ + public function setError(GoogleRpcStatus $error) + { + $this->error = $error; + } + /** + * @return GoogleRpcStatus + */ + public function getError() + { + return $this->error; + } + /** + * @param array[] + */ + public function setMetadata($metadata) + { + $this->metadata = $metadata; + } + /** + * @return array[] + */ + public function getMetadata() + { + return $this->metadata; + } + /** + * @param string + */ + public function setName($name) + { + $this->name = $name; + } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * @param array[] + */ + public function setResponse($response) + { + $this->response = $response; + } + /** + * @return array[] + */ + public function getResponse() + { + return $this->response; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleLongrunningOperation::class, 'Google_Service_Storage_GoogleLongrunningOperation'); diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleRpcStatus.php b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleRpcStatus.php new file mode 100644 index 000000000..4a9bf3f05 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/GoogleRpcStatus.php @@ -0,0 +1,81 @@ +code = $code; + } + /** + * @return int + */ + public function getCode() + { + return $this->code; + } + /** + * @param array[] + */ + public function setDetails($details) + { + $this->details = $details; + } + /** + * @return array[] + */ + public function getDetails() + { + return $this->details; + } + /** + * @param string + */ + public function setMessage($message) + { + $this->message = $message; + } + /** + * @return string + */ + public function getMessage() + { + return $this->message; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(GoogleRpcStatus::class, 'Google_Service_Storage_GoogleRpcStatus'); diff --git a/lib/Google/src/Service/Storage/HmacKey.php b/lib/Google/vendor/google/apiclient-services/src/Storage/HmacKey.php similarity index 100% rename from lib/Google/src/Service/Storage/HmacKey.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/HmacKey.php diff --git a/lib/Google/src/Service/Storage/HmacKeyMetadata.php b/lib/Google/vendor/google/apiclient-services/src/Storage/HmacKeyMetadata.php similarity index 100% rename from lib/Google/src/Service/Storage/HmacKeyMetadata.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/HmacKeyMetadata.php diff --git a/lib/Google/src/Service/Storage/HmacKeysMetadata.php b/lib/Google/vendor/google/apiclient-services/src/Storage/HmacKeysMetadata.php similarity index 100% rename from lib/Google/src/Service/Storage/HmacKeysMetadata.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/HmacKeysMetadata.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolder.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolder.php new file mode 100644 index 000000000..cca7d25fa --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolder.php @@ -0,0 +1,170 @@ +bucket = $bucket; + } + /** + * @return string + */ + public function getBucket() + { + return $this->bucket; + } + /** + * @param string + */ + public function setCreateTime($createTime) + { + $this->createTime = $createTime; + } + /** + * @return string + */ + public function getCreateTime() + { + return $this->createTime; + } + /** + * @param string + */ + public function setId($id) + { + $this->id = $id; + } + /** + * @return string + */ + public function getId() + { + return $this->id; + } + /** + * @param string + */ + public function setKind($kind) + { + $this->kind = $kind; + } + /** + * @return string + */ + public function getKind() + { + return $this->kind; + } + /** + * @param string + */ + public function setMetageneration($metageneration) + { + $this->metageneration = $metageneration; + } + /** + * @return string + */ + public function getMetageneration() + { + return $this->metageneration; + } + /** + * @param string + */ + public function setName($name) + { + $this->name = $name; + } + /** + * @return string + */ + public function getName() + { + return $this->name; + } + /** + * @param string + */ + public function setSelfLink($selfLink) + { + $this->selfLink = $selfLink; + } + /** + * @return string + */ + public function getSelfLink() + { + return $this->selfLink; + } + /** + * @param string + */ + public function setUpdateTime($updateTime) + { + $this->updateTime = $updateTime; + } + /** + * @return string + */ + public function getUpdateTime() + { + return $this->updateTime; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagedFolder::class, 'Google_Service_Storage_ManagedFolder'); diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolders.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolders.php new file mode 100644 index 000000000..582c4fe93 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/ManagedFolders.php @@ -0,0 +1,79 @@ +items = $items; + } + /** + * @return ManagedFolder[] + */ + public function getItems() + { + return $this->items; + } + /** + * @param string + */ + public function setKind($kind) + { + $this->kind = $kind; + } + /** + * @return string + */ + public function getKind() + { + return $this->kind; + } + /** + * @param string + */ + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + /** + * @return string + */ + public function getNextPageToken() + { + return $this->nextPageToken; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagedFolders::class, 'Google_Service_Storage_ManagedFolders'); diff --git a/lib/Google/src/Service/Storage/Notification.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Notification.php similarity index 100% rename from lib/Google/src/Service/Storage/Notification.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Notification.php diff --git a/lib/Google/src/Service/Storage/Notifications.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Notifications.php similarity index 100% rename from lib/Google/src/Service/Storage/Notifications.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Notifications.php diff --git a/lib/Google/src/Service/Storage/ObjectAccessControl.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControl.php similarity index 100% rename from lib/Google/src/Service/Storage/ObjectAccessControl.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControl.php diff --git a/lib/Google/src/Service/Storage/ObjectAccessControlProjectTeam.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControlProjectTeam.php similarity index 100% rename from lib/Google/src/Service/Storage/ObjectAccessControlProjectTeam.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControlProjectTeam.php diff --git a/lib/Google/src/Service/Storage/ObjectAccessControls.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControls.php similarity index 100% rename from lib/Google/src/Service/Storage/ObjectAccessControls.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ObjectAccessControls.php diff --git a/lib/Google/src/Service/Storage/Objects.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Objects.php similarity index 100% rename from lib/Google/src/Service/Storage/Objects.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Objects.php diff --git a/lib/Google/src/Service/Storage/Policy.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Policy.php similarity index 100% rename from lib/Google/src/Service/Storage/Policy.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Policy.php diff --git a/lib/Google/src/Service/Storage/PolicyBindings.php b/lib/Google/vendor/google/apiclient-services/src/Storage/PolicyBindings.php similarity index 100% rename from lib/Google/src/Service/Storage/PolicyBindings.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/PolicyBindings.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/AnywhereCache.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/AnywhereCache.php new file mode 100644 index 000000000..5b2a6934a --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/AnywhereCache.php @@ -0,0 +1,142 @@ + + * $storageService = new Google\Service\Storage(...); + * $anywhereCache = $storageService->anywhereCache; + * + */ +class AnywhereCache extends \Google\Service\Resource +{ + /** + * Disables an Anywhere Cache instance. (anywhereCache.disable) + * + * @param string $bucket Name of the partent bucket + * @param string $anywhereCacheId The ID of requested Anywhere Cache instance. + * @param array $optParams Optional parameters. + * @return AnywhereCacheModel + */ + public function disable($bucket, $anywhereCacheId, $optParams = []) + { + $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId]; + $params = array_merge($params, $optParams); + return $this->call('disable', [$params], AnywhereCacheModel::class); + } + /** + * Returns the metadata of an Anywhere Cache instance. (anywhereCache.get) + * + * @param string $bucket Name of the partent bucket + * @param string $anywhereCacheId The ID of requested Anywhere Cache instance. + * @param array $optParams Optional parameters. + * @return AnywhereCacheModel + */ + public function get($bucket, $anywhereCacheId, $optParams = []) + { + $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId]; + $params = array_merge($params, $optParams); + return $this->call('get', [$params], AnywhereCacheModel::class); + } + /** + * Creates an Anywhere Cache instance. (anywhereCache.insert) + * + * @param string $bucket Name of the partent bucket + * @param AnywhereCacheModel $postBody + * @param array $optParams Optional parameters. + * @return GoogleLongrunningOperation + */ + public function insert($bucket, AnywhereCacheModel $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('insert', [$params], GoogleLongrunningOperation::class); + } + /** + * Returns a list of Anywhere Cache instances of the bucket matching the + * criteria. (anywhereCache.listAnywhereCache) + * + * @param string $bucket Name of the partent bucket + * @param array $optParams Optional parameters. + * + * @opt_param int pageSize Maximum number of items return in a single page of + * responses. Maximum 1000. + * @opt_param string pageToken A previously-returned page token representing + * part of the larger set of results to view. + * @return AnywhereCaches + */ + public function listAnywhereCache($bucket, $optParams = []) + { + $params = ['bucket' => $bucket]; + $params = array_merge($params, $optParams); + return $this->call('list', [$params], AnywhereCaches::class); + } + /** + * Pauses an Anywhere Cache instance. (anywhereCache.pause) + * + * @param string $bucket Name of the partent bucket + * @param string $anywhereCacheId The ID of requested Anywhere Cache instance. + * @param array $optParams Optional parameters. + * @return AnywhereCacheModel + */ + public function pause($bucket, $anywhereCacheId, $optParams = []) + { + $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId]; + $params = array_merge($params, $optParams); + return $this->call('pause', [$params], AnywhereCacheModel::class); + } + /** + * Resumes a paused or disabled Anywhere Cache instance. (anywhereCache.resume) + * + * @param string $bucket Name of the partent bucket + * @param string $anywhereCacheId The ID of requested Anywhere Cache instance. + * @param array $optParams Optional parameters. + * @return AnywhereCacheModel + */ + public function resume($bucket, $anywhereCacheId, $optParams = []) + { + $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId]; + $params = array_merge($params, $optParams); + return $this->call('resume', [$params], AnywhereCacheModel::class); + } + /** + * Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance. + * (anywhereCache.update) + * + * @param string $bucket Name of the partent bucket + * @param string $anywhereCacheId The ID of requested Anywhere Cache instance. + * @param AnywhereCacheModel $postBody + * @param array $optParams Optional parameters. + * @return GoogleLongrunningOperation + */ + public function update($bucket, $anywhereCacheId, AnywhereCacheModel $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'anywhereCacheId' => $anywhereCacheId, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('update', [$params], GoogleLongrunningOperation::class); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(AnywhereCache::class, 'Google_Service_Storage_Resource_AnywhereCache'); diff --git a/lib/Google/src/Service/Storage/Resource/BucketAccessControls.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/BucketAccessControls.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/BucketAccessControls.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/BucketAccessControls.php diff --git a/lib/Google/src/Service/Storage/Resource/Buckets.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php similarity index 98% rename from lib/Google/src/Service/Storage/Resource/Buckets.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php index 9ba71daae..8e79cb55b 100644 --- a/lib/Google/src/Service/Storage/Resource/Buckets.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Buckets.php @@ -100,6 +100,8 @@ public function getIamPolicy($bucket, $optParams = []) * @param Bucket $postBody * @param array $optParams Optional parameters. * + * @opt_param bool enableObjectRetention When set to true, object retention is + * enabled for this bucket. * @opt_param string predefinedAcl Apply a predefined set of access controls to * this bucket. * @opt_param string predefinedDefaultObjectAcl Apply a predefined set of diff --git a/lib/Google/src/Service/Storage/Resource/Channels.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Channels.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/Channels.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Channels.php diff --git a/lib/Google/src/Service/Storage/Resource/DefaultObjectAccessControls.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/DefaultObjectAccessControls.php similarity index 99% rename from lib/Google/src/Service/Storage/Resource/DefaultObjectAccessControls.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/DefaultObjectAccessControls.php index 4bd61bcff..ac0002422 100644 --- a/lib/Google/src/Service/Storage/Resource/DefaultObjectAccessControls.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/DefaultObjectAccessControls.php @@ -101,7 +101,7 @@ public function insert($bucket, ObjectAccessControl $postBody, $optParams = []) * value. * @opt_param string userProject The project to be billed for this request. * Required for Requester Pays buckets. - * @return ObjectAccessControls + * @return ObjectAccessControlsModel */ public function listDefaultObjectAccessControls($bucket, $optParams = []) { diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ManagedFolders.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ManagedFolders.php new file mode 100644 index 000000000..d5e06e144 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ManagedFolders.php @@ -0,0 +1,171 @@ + + * $storageService = new Google\Service\Storage(...); + * $managedFolders = $storageService->managedFolders; + * + */ +class ManagedFolders extends \Google\Service\Resource +{ + /** + * Permanently deletes a managed folder. (managedFolders.delete) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param string $managedFolder The managed folder name/path. + * @param array $optParams Optional parameters. + * + * @opt_param string ifMetagenerationMatch If set, only deletes the managed + * folder if its metageneration matches this value. + * @opt_param string ifMetagenerationNotMatch If set, only deletes the managed + * folder if its metageneration does not match this value. + */ + public function delete($bucket, $managedFolder, $optParams = []) + { + $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder]; + $params = array_merge($params, $optParams); + return $this->call('delete', [$params]); + } + /** + * Returns metadata of the specified managed folder. (managedFolders.get) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param string $managedFolder The managed folder name/path. + * @param array $optParams Optional parameters. + * + * @opt_param string ifMetagenerationMatch Makes the return of the managed + * folder metadata conditional on whether the managed folder's current + * metageneration matches the given value. + * @opt_param string ifMetagenerationNotMatch Makes the return of the managed + * folder metadata conditional on whether the managed folder's current + * metageneration does not match the given value. + * @return ManagedFolder + */ + public function get($bucket, $managedFolder, $optParams = []) + { + $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder]; + $params = array_merge($params, $optParams); + return $this->call('get', [$params], ManagedFolder::class); + } + /** + * Returns an IAM policy for the specified managed folder. + * (managedFolders.getIamPolicy) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param string $managedFolder The managed folder name/path. + * @param array $optParams Optional parameters. + * + * @opt_param int optionsRequestedPolicyVersion The IAM policy format version to + * be returned. If the optionsRequestedPolicyVersion is for an older version + * that doesn't support part of the requested IAM policy, the request fails. + * @opt_param string userProject The project to be billed for this request. + * Required for Requester Pays buckets. + * @return Policy + */ + public function getIamPolicy($bucket, $managedFolder, $optParams = []) + { + $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder]; + $params = array_merge($params, $optParams); + return $this->call('getIamPolicy', [$params], Policy::class); + } + /** + * Creates a new managed folder. (managedFolders.insert) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param ManagedFolder $postBody + * @param array $optParams Optional parameters. + * @return ManagedFolder + */ + public function insert($bucket, ManagedFolder $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('insert', [$params], ManagedFolder::class); + } + /** + * Lists managed folders in the given bucket. + * (managedFolders.listManagedFolders) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param array $optParams Optional parameters. + * + * @opt_param int pageSize Maximum number of items return in a single page of + * responses. + * @opt_param string pageToken A previously-returned page token representing + * part of the larger set of results to view. + * @opt_param string prefix The managed folder name/path prefix to filter the + * output list of results. + * @return ManagedFoldersModel + */ + public function listManagedFolders($bucket, $optParams = []) + { + $params = ['bucket' => $bucket]; + $params = array_merge($params, $optParams); + return $this->call('list', [$params], ManagedFoldersModel::class); + } + /** + * Updates an IAM policy for the specified managed folder. + * (managedFolders.setIamPolicy) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param string $managedFolder The managed folder name/path. + * @param Policy $postBody + * @param array $optParams Optional parameters. + * + * @opt_param string userProject The project to be billed for this request. + * Required for Requester Pays buckets. + * @return Policy + */ + public function setIamPolicy($bucket, $managedFolder, Policy $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('setIamPolicy', [$params], Policy::class); + } + /** + * Tests a set of permissions on the given managed folder to see which, if any, + * are held by the caller. (managedFolders.testIamPermissions) + * + * @param string $bucket Name of the bucket containing the managed folder. + * @param string $managedFolder The managed folder name/path. + * @param string|array $permissions Permissions to test. + * @param array $optParams Optional parameters. + * + * @opt_param string userProject The project to be billed for this request. + * Required for Requester Pays buckets. + * @return TestIamPermissionsResponse + */ + public function testIamPermissions($bucket, $managedFolder, $permissions, $optParams = []) + { + $params = ['bucket' => $bucket, 'managedFolder' => $managedFolder, 'permissions' => $permissions]; + $params = array_merge($params, $optParams); + return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(ManagedFolders::class, 'Google_Service_Storage_Resource_ManagedFolders'); diff --git a/lib/Google/src/Service/Storage/Resource/Notifications.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Notifications.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/Notifications.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Notifications.php diff --git a/lib/Google/src/Service/Storage/Resource/ObjectAccessControls.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ObjectAccessControls.php similarity index 89% rename from lib/Google/src/Service/Storage/Resource/ObjectAccessControls.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ObjectAccessControls.php index 7a930ac18..3976d1211 100644 --- a/lib/Google/src/Service/Storage/Resource/ObjectAccessControls.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ObjectAccessControls.php @@ -36,7 +36,8 @@ class ObjectAccessControls extends \Google\Service\Resource * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $entity The entity holding the permission. Can be user-userId, * user-emailAddress, group-groupId, group-emailAddress, allUsers, or * allAuthenticatedUsers. @@ -59,7 +60,8 @@ public function delete($bucket, $object, $entity, $optParams = []) * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $entity The entity holding the permission. Can be user-userId, * user-emailAddress, group-groupId, group-emailAddress, allUsers, or * allAuthenticatedUsers. @@ -83,7 +85,8 @@ public function get($bucket, $object, $entity, $optParams = []) * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param ObjectAccessControl $postBody * @param array $optParams Optional parameters. * @@ -105,7 +108,8 @@ public function insert($bucket, $object, ObjectAccessControl $postBody, $optPara * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param array $optParams Optional parameters. * * @opt_param string generation If present, selects a specific revision of this @@ -125,7 +129,8 @@ public function listObjectAccessControls($bucket, $object, $optParams = []) * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $entity The entity holding the permission. Can be user-userId, * user-emailAddress, group-groupId, group-emailAddress, allUsers, or * allAuthenticatedUsers. @@ -149,7 +154,8 @@ public function patch($bucket, $object, $entity, ObjectAccessControl $postBody, * * @param string $bucket Name of a bucket. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $entity The entity holding the permission. Can be user-userId, * user-emailAddress, group-groupId, group-emailAddress, allUsers, or * allAuthenticatedUsers. diff --git a/lib/Google/src/Service/Storage/Resource/Objects.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php similarity index 83% rename from lib/Google/src/Service/Storage/Resource/Objects.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php index c74c0a9a3..fe3998c99 100644 --- a/lib/Google/src/Service/Storage/Resource/Objects.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Objects.php @@ -17,8 +17,10 @@ namespace Google\Service\Storage\Resource; +use Google\Service\Storage\BulkRestoreObjectsRequest; use Google\Service\Storage\Channel; use Google\Service\Storage\ComposeRequest; +use Google\Service\Storage\GoogleLongrunningOperation; use Google\Service\Storage\Objects as ObjectsModel; use Google\Service\Storage\Policy; use Google\Service\Storage\RewriteResponse; @@ -35,6 +37,21 @@ */ class Objects extends \Google\Service\Resource { + /** + * Initiates a long-running bulk restore operation on the specified bucket. + * (objects.bulkRestore) + * + * @param string $bucket Name of the bucket in which the object resides. + * @param BulkRestoreObjectsRequest $postBody + * @param array $optParams Optional parameters. + * @return GoogleLongrunningOperation + */ + public function bulkRestore($bucket, BulkRestoreObjectsRequest $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('bulkRestore', [$params], GoogleLongrunningOperation::class); + } /** * Concatenates a list of existing objects into a new object in the same bucket. * (objects.compose) @@ -42,8 +59,8 @@ class Objects extends \Google\Service\Resource * @param string $destinationBucket Name of the bucket containing the source * objects. The destination object is stored in this bucket. * @param string $destinationObject Name of the new object. For information - * about how to URL encode object names to be path safe, see Encoding URI Path - * Parts. + * about how to URL encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param ComposeRequest $postBody * @param array $optParams Optional parameters. * @@ -75,11 +92,13 @@ public function compose($destinationBucket, $destinationObject, ComposeRequest $ * @param string $sourceBucket Name of the bucket in which to find the source * object. * @param string $sourceObject Name of the source object. For information about - * how to URL encode object names to be path safe, see Encoding URI Path Parts. + * how to URL encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $destinationBucket Name of the bucket in which to store the new * object. Overrides the provided object metadata's bucket value, if any.For * information about how to URL encode object names to be path safe, see - * Encoding URI Path Parts. + * [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request- + * endpoints#encoding). * @param string $destinationObject Name of the new object. Required when the * object metadata is not otherwise provided. Overrides the object metadata's * name value, if any. @@ -87,9 +106,9 @@ public function compose($destinationBucket, $destinationObject, ComposeRequest $ * @param array $optParams Optional parameters. * * @opt_param string destinationKmsKeyName Resource name of the Cloud KMS key, - * of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys - * /my-key, that will be used to encrypt the object. Overrides the object - * metadata's kms_key_name value, if any. + * of the form projects/my-project/locations/global/keyRings/my- + * kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the + * object metadata's kms_key_name value, if any. * @opt_param string destinationPredefinedAcl Apply a predefined set of access * controls to the destination object. * @opt_param string ifGenerationMatch Makes the operation conditional on @@ -139,7 +158,8 @@ public function copy($sourceBucket, $sourceObject, $destinationBucket, $destinat * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param array $optParams Optional parameters. * * @opt_param string generation If present, permanently deletes a specific @@ -169,7 +189,8 @@ public function delete($bucket, $object, $optParams = []) * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param array $optParams Optional parameters. * * @opt_param string generation If present, selects a specific revision of this @@ -186,6 +207,8 @@ public function delete($bucket, $object, $optParams = []) * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on * whether the object's current metageneration does not match the given value. * @opt_param string projection Set of properties to return. Defaults to noAcl. + * @opt_param bool softDeleted If true, only soft-deleted object versions will + * be listed. The default is false. For more information, see Soft Delete. * @opt_param string userProject The project to be billed for this request. * Required for Requester Pays buckets. * @return StorageObject @@ -201,7 +224,8 @@ public function get($bucket, $object, $optParams = []) * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param array $optParams Optional parameters. * * @opt_param string generation If present, selects a specific revision of this @@ -247,7 +271,8 @@ public function getIamPolicy($bucket, $object, $optParams = []) * @opt_param string name Name of the object. Required when the object metadata * is not otherwise provided. Overrides the object metadata's name value, if * any. For information about how to URL encode object names to be path safe, - * see Encoding URI Path Parts. + * see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request- + * endpoints#encoding). * @opt_param string predefinedAcl Apply a predefined set of access controls to * this object. * @opt_param string projection Set of properties to return. Defaults to noAcl, @@ -278,6 +303,9 @@ public function insert($bucket, StorageObject $postBody, $optParams = []) * lexicographically before endOffset. If startOffset is also set, the objects * listed will have names between startOffset (inclusive) and endOffset * (exclusive). + * @opt_param bool includeFoldersAsPrefixes Only applicable if delimiter is set + * to '/'. If true, will also include folders and managed folders (besides + * objects) in the returned prefixes. * @opt_param bool includeTrailingDelimiter If true, objects that end in exactly * one instance of delimiter will have their metadata included in items in * addition to prefixes. @@ -292,6 +320,8 @@ public function insert($bucket, StorageObject $postBody, $optParams = []) * @opt_param string prefix Filter results to objects whose names begin with * this prefix. * @opt_param string projection Set of properties to return. Defaults to noAcl. + * @opt_param bool softDeleted If true, only soft-deleted object versions will + * be listed. The default is false. For more information, see Soft Delete. * @opt_param string startOffset Filter results to objects whose names are * lexicographically equal to or after startOffset. If endOffset is also set, * the objects listed will have names between startOffset (inclusive) and @@ -313,7 +343,8 @@ public function listObjects($bucket, $optParams = []) * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param StorageObject $postBody * @param array $optParams Optional parameters. * @@ -330,6 +361,9 @@ public function listObjects($bucket, $optParams = []) * whether the object's current metageneration matches the given value. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on * whether the object's current metageneration does not match the given value. + * @opt_param bool overrideUnlockedRetention Must be true to remove the + * retention configuration, reduce its unlocked retention period, or change its + * mode from unlocked to locked. * @opt_param string predefinedAcl Apply a predefined set of access controls to * this object. * @opt_param string projection Set of properties to return. Defaults to full. @@ -343,6 +377,41 @@ public function patch($bucket, $object, StorageObject $postBody, $optParams = [] $params = array_merge($params, $optParams); return $this->call('patch', [$params], StorageObject::class); } + /** + * Restores a soft-deleted object. (objects.restore) + * + * @param string $bucket Name of the bucket in which the object resides. + * @param string $object Name of the object. For information about how to URL + * encode object names to be path safe, see Encoding URI Path Parts. + * @param string $generation Selects a specific revision of this object. + * @param StorageObject $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool copySourceAcl If true, copies the source object's ACL; + * otherwise, uses the bucket's default object ACL. The default is false. + * @opt_param string ifGenerationMatch Makes the operation conditional on + * whether the object's one live generation matches the given value. Setting to + * 0 makes the operation succeed only if there are no live versions of the + * object. + * @opt_param string ifGenerationNotMatch Makes the operation conditional on + * whether none of the object's live generations match the given value. If no + * live object exists, the precondition fails. Setting to 0 makes the operation + * succeed only if there is a live version of the object. + * @opt_param string ifMetagenerationMatch Makes the operation conditional on + * whether the object's one live metageneration matches the given value. + * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on + * whether none of the object's live metagenerations match the given value. + * @opt_param string projection Set of properties to return. Defaults to full. + * @opt_param string userProject The project to be billed for this request. + * Required for Requester Pays buckets. + * @return StorageObject + */ + public function restore($bucket, $object, $generation, StorageObject $postBody, $optParams = []) + { + $params = ['bucket' => $bucket, 'object' => $object, 'generation' => $generation, 'postBody' => $postBody]; + $params = array_merge($params, $optParams); + return $this->call('restore', [$params], StorageObject::class); + } /** * Rewrites a source object to a destination object. Optionally overrides * metadata. (objects.rewrite) @@ -350,20 +419,22 @@ public function patch($bucket, $object, StorageObject $postBody, $optParams = [] * @param string $sourceBucket Name of the bucket in which to find the source * object. * @param string $sourceObject Name of the source object. For information about - * how to URL encode object names to be path safe, see Encoding URI Path Parts. + * how to URL encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string $destinationBucket Name of the bucket in which to store the new * object. Overrides the provided object metadata's bucket value, if any. * @param string $destinationObject Name of the new object. Required when the * object metadata is not otherwise provided. Overrides the object metadata's * name value, if any. For information about how to URL encode object names to - * be path safe, see Encoding URI Path Parts. + * be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param StorageObject $postBody * @param array $optParams Optional parameters. * * @opt_param string destinationKmsKeyName Resource name of the Cloud KMS key, - * of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys - * /my-key, that will be used to encrypt the object. Overrides the object - * metadata's kms_key_name value, if any. + * of the form projects/my-project/locations/global/keyRings/my- + * kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the + * object metadata's kms_key_name value, if any. * @opt_param string destinationPredefinedAcl Apply a predefined set of access * controls to the destination object. * @opt_param string ifGenerationMatch Makes the operation conditional on @@ -422,7 +493,8 @@ public function rewrite($sourceBucket, $sourceObject, $destinationBucket, $desti * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param Policy $postBody * @param array $optParams Optional parameters. * @@ -444,7 +516,8 @@ public function setIamPolicy($bucket, $object, Policy $postBody, $optParams = [] * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param string|array $permissions Permissions to test. * @param array $optParams Optional parameters. * @@ -465,7 +538,8 @@ public function testIamPermissions($bucket, $object, $permissions, $optParams = * * @param string $bucket Name of the bucket in which the object resides. * @param string $object Name of the object. For information about how to URL - * encode object names to be path safe, see Encoding URI Path Parts. + * encode object names to be path safe, see [Encoding URI Path + * Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding). * @param StorageObject $postBody * @param array $optParams Optional parameters. * @@ -482,6 +556,9 @@ public function testIamPermissions($bucket, $object, $permissions, $optParams = * whether the object's current metageneration matches the given value. * @opt_param string ifMetagenerationNotMatch Makes the operation conditional on * whether the object's current metageneration does not match the given value. + * @opt_param bool overrideUnlockedRetention Must be true to remove the + * retention configuration, reduce its unlocked retention period, or change its + * mode from unlocked to locked. * @opt_param string predefinedAcl Apply a predefined set of access controls to * this object. * @opt_param string projection Set of properties to return. Defaults to full. diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php new file mode 100644 index 000000000..bff19b4b4 --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Operations.php @@ -0,0 +1,88 @@ + + * $storageService = new Google\Service\Storage(...); + * $operations = $storageService->operations; + * + */ +class Operations extends \Google\Service\Resource +{ + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not guaranteed. + * (operations.cancel) + * + * @param string $bucket The parent bucket of the operation resource. + * @param string $operationId The ID of the operation resource. + * @param array $optParams Optional parameters. + */ + public function cancel($bucket, $operationId, $optParams = []) + { + $params = ['bucket' => $bucket, 'operationId' => $operationId]; + $params = array_merge($params, $optParams); + return $this->call('cancel', [$params]); + } + /** + * Gets the latest state of a long-running operation. (operations.get) + * + * @param string $bucket The parent bucket of the operation resource. + * @param string $operationId The ID of the operation resource. + * @param array $optParams Optional parameters. + * @return GoogleLongrunningOperation + */ + public function get($bucket, $operationId, $optParams = []) + { + $params = ['bucket' => $bucket, 'operationId' => $operationId]; + $params = array_merge($params, $optParams); + return $this->call('get', [$params], GoogleLongrunningOperation::class); + } + /** + * Lists operations that match the specified filter in the request. + * (operations.listOperations) + * + * @param string $bucket Name of the bucket in which to look for operations. + * @param array $optParams Optional parameters. + * + * @opt_param string filter A filter to narrow down results to a preferred + * subset. The filtering language is documented in more detail in + * [AIP-160](https://google.aip.dev/160). + * @opt_param int pageSize Maximum number of items to return in a single page of + * responses. Fewer total results may be returned than requested. The service + * uses this parameter or 100 items, whichever is smaller. + * @opt_param string pageToken A previously-returned page token representing + * part of the larger set of results to view. + * @return GoogleLongrunningListOperationsResponse + */ + public function listOperations($bucket, $optParams = []) + { + $params = ['bucket' => $bucket]; + $params = array_merge($params, $optParams); + return $this->call('list', [$params], GoogleLongrunningListOperationsResponse::class); + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(Operations::class, 'Google_Service_Storage_Resource_Operations'); diff --git a/lib/Google/src/Service/Storage/Resource/Projects.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Projects.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/Projects.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/Projects.php diff --git a/lib/Google/src/Service/Storage/Resource/ProjectsHmacKeys.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/ProjectsHmacKeys.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsHmacKeys.php diff --git a/lib/Google/src/Service/Storage/Resource/ProjectsServiceAccount.php b/lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsServiceAccount.php similarity index 100% rename from lib/Google/src/Service/Storage/Resource/ProjectsServiceAccount.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/Resource/ProjectsServiceAccount.php diff --git a/lib/Google/src/Service/Storage/RewriteResponse.php b/lib/Google/vendor/google/apiclient-services/src/Storage/RewriteResponse.php similarity index 100% rename from lib/Google/src/Service/Storage/RewriteResponse.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/RewriteResponse.php diff --git a/lib/Google/src/Service/Storage/ServiceAccount.php b/lib/Google/vendor/google/apiclient-services/src/Storage/ServiceAccount.php similarity index 100% rename from lib/Google/src/Service/Storage/ServiceAccount.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/ServiceAccount.php diff --git a/lib/Google/src/Service/Storage/StorageObject.php b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php similarity index 91% rename from lib/Google/src/Service/Storage/StorageObject.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php index 2ca42efcd..cb666b2ae 100644 --- a/lib/Google/src/Service/Storage/StorageObject.php +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObject.php @@ -72,6 +72,10 @@ class StorageObject extends \Google\Collection * @var string */ public $generation; + /** + * @var string + */ + public $hardDeleteTime; /** * @var string */ @@ -106,6 +110,8 @@ class StorageObject extends \Google\Collection public $name; protected $ownerType = StorageObjectOwner::class; protected $ownerDataType = ''; + protected $retentionType = StorageObjectRetention::class; + protected $retentionDataType = ''; /** * @var string */ @@ -118,6 +124,10 @@ class StorageObject extends \Google\Collection * @var string */ public $size; + /** + * @var string + */ + public $softDeleteTime; /** * @var string */ @@ -339,6 +349,20 @@ public function getGeneration() { return $this->generation; } + /** + * @param string + */ + public function setHardDeleteTime($hardDeleteTime) + { + $this->hardDeleteTime = $hardDeleteTime; + } + /** + * @return string + */ + public function getHardDeleteTime() + { + return $this->hardDeleteTime; + } /** * @param string */ @@ -465,6 +489,20 @@ public function getOwner() { return $this->owner; } + /** + * @param StorageObjectRetention + */ + public function setRetention(StorageObjectRetention $retention) + { + $this->retention = $retention; + } + /** + * @return StorageObjectRetention + */ + public function getRetention() + { + return $this->retention; + } /** * @param string */ @@ -507,6 +545,20 @@ public function getSize() { return $this->size; } + /** + * @param string + */ + public function setSoftDeleteTime($softDeleteTime) + { + $this->softDeleteTime = $softDeleteTime; + } + /** + * @return string + */ + public function getSoftDeleteTime() + { + return $this->softDeleteTime; + } /** * @param string */ diff --git a/lib/Google/src/Service/Storage/StorageObjectCustomerEncryption.php b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectCustomerEncryption.php similarity index 100% rename from lib/Google/src/Service/Storage/StorageObjectCustomerEncryption.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectCustomerEncryption.php diff --git a/lib/Google/src/Service/Storage/StorageObjectOwner.php b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectOwner.php similarity index 100% rename from lib/Google/src/Service/Storage/StorageObjectOwner.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectOwner.php diff --git a/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectRetention.php b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectRetention.php new file mode 100644 index 000000000..d871f9afa --- /dev/null +++ b/lib/Google/vendor/google/apiclient-services/src/Storage/StorageObjectRetention.php @@ -0,0 +1,62 @@ +mode = $mode; + } + /** + * @return string + */ + public function getMode() + { + return $this->mode; + } + /** + * @param string + */ + public function setRetainUntilTime($retainUntilTime) + { + $this->retainUntilTime = $retainUntilTime; + } + /** + * @return string + */ + public function getRetainUntilTime() + { + return $this->retainUntilTime; + } +} + +// Adding a class alias for backwards compatibility with the previous class name. +class_alias(StorageObjectRetention::class, 'Google_Service_Storage_StorageObjectRetention'); diff --git a/lib/Google/src/Service/Storage/TestIamPermissionsResponse.php b/lib/Google/vendor/google/apiclient-services/src/Storage/TestIamPermissionsResponse.php similarity index 100% rename from lib/Google/src/Service/Storage/TestIamPermissionsResponse.php rename to lib/Google/vendor/google/apiclient-services/src/Storage/TestIamPermissionsResponse.php diff --git a/lib/Google/vendor/google/auth/composer.json b/lib/Google/vendor/google/auth/composer.json index 47f673c48..9e6466d61 100644 --- a/lib/Google/vendor/google/auth/composer.json +++ b/lib/Google/vendor/google/auth/composer.json @@ -17,13 +17,13 @@ "psr/cache": "^1.0||^2.0||^3.0" }, "require-dev": { - "guzzlehttp/promises": "^1.3", + "guzzlehttp/promises": "^2.0", "squizlabs/php_codesniffer": "^3.5", "phpunit/phpunit": "^9.0.0", "phpspec/prophecy-phpunit": "^2.0", "sebastian/comparator": ">=1.2.3", "phpseclib/phpseclib": "^3.0", - "kelvinmo/simplejwt": "0.7.0" + "kelvinmo/simplejwt": "0.7.1" }, "suggest": { "phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2." diff --git a/lib/Google/vendor/google/auth/src/AccessToken.php b/lib/Google/vendor/google/auth/src/AccessToken.php index 52bad396e..0afc4ca1e 100644 --- a/lib/Google/vendor/google/auth/src/AccessToken.php +++ b/lib/Google/vendor/google/auth/src/AccessToken.php @@ -18,7 +18,6 @@ namespace Google\Auth; use DateTime; -use Exception; use Firebase\JWT\ExpiredException; use Firebase\JWT\JWT; use Firebase\JWT\Key; @@ -312,11 +311,9 @@ private function getCerts($location, $cacheKey, array $options = []) $cacheItem = $this->cache->getItem($cacheKey); $certs = $cacheItem ? $cacheItem->get() : null; - $gotNewCerts = false; + $expireTime = null; if (!$certs) { - $certs = $this->retrieveCertsFromLocation($location, $options); - - $gotNewCerts = true; + list($certs, $expireTime) = $this->retrieveCertsFromLocation($location, $options); } if (!isset($certs['keys'])) { @@ -332,8 +329,8 @@ private function getCerts($location, $cacheKey, array $options = []) // Push caching off until after verifying certs are in a valid format. // Don't want to cache bad data. - if ($gotNewCerts) { - $cacheItem->expiresAt(new DateTime('+1 hour')); + if ($expireTime) { + $cacheItem->expiresAt(new DateTime($expireTime)); $cacheItem->set($certs); $this->cache->save($cacheItem); } @@ -346,13 +343,14 @@ private function getCerts($location, $cacheKey, array $options = []) * * @param string $url location * @param array $options [optional] Configuration options. - * @return array certificates + * @return array{array, string} * @throws InvalidArgumentException If certs could not be retrieved from a local file. * @throws RuntimeException If certs could not be retrieved from a remote location. */ private function retrieveCertsFromLocation($url, array $options = []) { // If we're retrieving a local file, just grab it. + $expireTime = '+1 hour'; if (strpos($url, 'http') !== 0) { if (!file_exists($url)) { throw new InvalidArgumentException(sprintf( @@ -361,14 +359,28 @@ private function retrieveCertsFromLocation($url, array $options = []) )); } - return json_decode((string) file_get_contents($url), true); + return [ + json_decode((string) file_get_contents($url), true), + $expireTime + ]; } $httpHandler = $this->httpHandler; $response = $httpHandler(new Request('GET', $url), $options); if ($response->getStatusCode() == 200) { - return json_decode((string) $response->getBody(), true); + if ($cacheControl = $response->getHeaderLine('Cache-Control')) { + array_map(function ($value) use (&$expireTime) { + list($key, $value) = explode('=', $value) + [null, null]; + if (trim($key) == 'max-age') { + $expireTime = '+' . $value . ' seconds'; + } + }, explode(',', $cacheControl)); + } + return [ + json_decode((string) $response->getBody(), true), + $expireTime + ]; } throw new RuntimeException(sprintf( @@ -409,7 +421,7 @@ private function loadPhpsecPublicKey(string $modulus, string $exponent): string $exponent ]), 256), ]); - return $key->toString('PKCS1'); + return $key->toString('PKCS8'); } /** diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php new file mode 100644 index 000000000..3a8c20eaa --- /dev/null +++ b/lib/Google/vendor/google/auth/src/CredentialSource/AwsNativeSource.php @@ -0,0 +1,360 @@ +audience = $audience; + $this->regionalCredVerificationUrl = $regionalCredVerificationUrl; + $this->regionUrl = $regionUrl; + $this->securityCredentialsUrl = $securityCredentialsUrl; + $this->imdsv2SessionTokenUrl = $imdsv2SessionTokenUrl; + } + + public function fetchSubjectToken(callable $httpHandler = null): string + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $headers = []; + if ($this->imdsv2SessionTokenUrl) { + $headers = [ + 'X-aws-ec2-metadata-token' => self::getImdsV2SessionToken($this->imdsv2SessionTokenUrl, $httpHandler) + ]; + } + + if (!$signingVars = self::getSigningVarsFromEnv()) { + if (!$this->securityCredentialsUrl) { + throw new \LogicException('Unable to get credentials from ENV, and no security credentials URL provided'); + } + $signingVars = self::getSigningVarsFromUrl( + $httpHandler, + $this->securityCredentialsUrl, + self::getRoleName($httpHandler, $this->securityCredentialsUrl, $headers), + $headers + ); + } + + if (!$region = self::getRegionFromEnv()) { + if (!$this->regionUrl) { + throw new \LogicException('Unable to get region from ENV, and no region URL provided'); + } + $region = self::getRegionFromUrl($httpHandler, $this->regionUrl, $headers); + } + $url = str_replace('{region}', $region, $this->regionalCredVerificationUrl); + $host = parse_url($url)['host'] ?? ''; + + // From here we use the signing vars to create the signed request to receive a token + [$accessKeyId, $secretAccessKey, $securityToken] = $signingVars; + $headers = self::getSignedRequestHeaders($region, $host, $accessKeyId, $secretAccessKey, $securityToken); + + // Inject x-goog-cloud-target-resource into header + $headers['x-goog-cloud-target-resource'] = $this->audience; + + // Format headers as they're expected in the subject token + $formattedHeaders= array_map( + fn ($k, $v) => ['key' => $k, 'value' => $v], + array_keys($headers), + $headers, + ); + + $request = [ + 'headers' => $formattedHeaders, + 'method' => 'POST', + 'url' => $url, + ]; + + return urlencode(json_encode($request) ?: ''); + } + + /** + * @internal + */ + public static function getImdsV2SessionToken(string $imdsV2Url, callable $httpHandler): string + { + $headers = [ + 'X-aws-ec2-metadata-token-ttl-seconds' => '21600' + ]; + $request = new Request( + 'PUT', + $imdsV2Url, + $headers + ); + + $response = $httpHandler($request); + return (string) $response->getBody(); + } + + /** + * @see http://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html + * + * @internal + * + * @return array + */ + public static function getSignedRequestHeaders( + string $region, + string $host, + string $accessKeyId, + string $secretAccessKey, + ?string $securityToken + ): array { + $service = 'sts'; + + # Create a date for headers and the credential string in ISO-8601 format + $amzdate = date('Ymd\THis\Z'); + $datestamp = date('Ymd'); # Date w/o time, used in credential scope + + # Create the canonical headers and signed headers. Header names + # must be trimmed and lowercase, and sorted in code point order from + # low to high. Note that there is a trailing \n. + $canonicalHeaders = sprintf("host:%s\nx-amz-date:%s\n", $host, $amzdate); + if ($securityToken) { + $canonicalHeaders .= sprintf("x-amz-security-token:%s\n", $securityToken); + } + + # Step 5: Create the list of signed headers. This lists the headers + # in the canonicalHeaders list, delimited with ";" and in alpha order. + # Note: The request can include any headers; $canonicalHeaders and + # $signedHeaders lists those that you want to be included in the + # hash of the request. "Host" and "x-amz-date" are always required. + $signedHeaders = 'host;x-amz-date'; + if ($securityToken) { + $signedHeaders .= ';x-amz-security-token'; + } + + # Step 6: Create payload hash (hash of the request body content). For GET + # requests, the payload is an empty string (""). + $payloadHash = hash('sha256', ''); + + # Step 7: Combine elements to create canonical request + $canonicalRequest = implode("\n", [ + 'POST', // method + '/', // canonical URL + self::CRED_VERIFICATION_QUERY, // query string + $canonicalHeaders, + $signedHeaders, + $payloadHash + ]); + + # ************* TASK 2: CREATE THE STRING TO SIGN************* + # Match the algorithm to the hashing algorithm you use, either SHA-1 or + # SHA-256 (recommended) + $algorithm = 'AWS4-HMAC-SHA256'; + $scope = implode('/', [$datestamp, $region, $service, 'aws4_request']); + $stringToSign = implode("\n", [$algorithm, $amzdate, $scope, hash('sha256', $canonicalRequest)]); + + # ************* TASK 3: CALCULATE THE SIGNATURE ************* + # Create the signing key using the function defined above. + // (done above) + $signingKey = self::getSignatureKey($secretAccessKey, $datestamp, $region, $service); + + # Sign the string_to_sign using the signing_key + $signature = bin2hex(self::hmacSign($signingKey, $stringToSign)); + + # ************* TASK 4: ADD SIGNING INFORMATION TO THE REQUEST ************* + # The signing information can be either in a query string value or in + # a header named Authorization. This code shows how to use a header. + # Create authorization header and add to request headers + $authorizationHeader = sprintf( + '%s Credential=%s/%s, SignedHeaders=%s, Signature=%s', + $algorithm, + $accessKeyId, + $scope, + $signedHeaders, + $signature + ); + + # The request can include any headers, but MUST include "host", "x-amz-date", + # and (for this scenario) "Authorization". "host" and "x-amz-date" must + # be included in the canonical_headers and signed_headers, as noted + # earlier. Order here is not significant. + $headers = [ + 'host' => $host, + 'x-amz-date' => $amzdate, + 'Authorization' => $authorizationHeader, + ]; + if ($securityToken) { + $headers['x-amz-security-token'] = $securityToken; + } + + return $headers; + } + + /** + * @internal + */ + public static function getRegionFromEnv(): ?string + { + $region = getenv('AWS_REGION'); + if (empty($region)) { + $region = getenv('AWS_DEFAULT_REGION'); + } + return $region ?: null; + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $regionUrl + * @param array $headers Request headers to send in with the request. + */ + public static function getRegionFromUrl(callable $httpHandler, string $regionUrl, array $headers): string + { + // get the region/zone from the region URL + $regionRequest = new Request('GET', $regionUrl, $headers); + $regionResponse = $httpHandler($regionRequest); + + // Remove last character. For example, if us-east-2b is returned, + // the region would be us-east-2. + return substr((string) $regionResponse->getBody(), 0, -1); + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $securityCredentialsUrl + * @param array $headers Request headers to send in with the request. + */ + public static function getRoleName(callable $httpHandler, string $securityCredentialsUrl, array $headers): string + { + // Get the AWS role name + $roleRequest = new Request('GET', $securityCredentialsUrl, $headers); + $roleResponse = $httpHandler($roleRequest); + $roleName = (string) $roleResponse->getBody(); + + return $roleName; + } + + /** + * @internal + * + * @param callable $httpHandler + * @param string $securityCredentialsUrl + * @param array $headers Request headers to send in with the request. + * @return array{string, string, ?string} + */ + public static function getSigningVarsFromUrl( + callable $httpHandler, + string $securityCredentialsUrl, + string $roleName, + array $headers + ): array { + // Get the AWS credentials + $credsRequest = new Request( + 'GET', + $securityCredentialsUrl . '/' . $roleName, + $headers + ); + $credsResponse = $httpHandler($credsRequest); + $awsCreds = json_decode((string) $credsResponse->getBody(), true); + return [ + $awsCreds['AccessKeyId'], // accessKeyId + $awsCreds['SecretAccessKey'], // secretAccessKey + $awsCreds['Token'], // token + ]; + } + + /** + * @internal + * + * @return array{string, string, ?string} + */ + public static function getSigningVarsFromEnv(): ?array + { + $accessKeyId = getenv('AWS_ACCESS_KEY_ID'); + $secretAccessKey = getenv('AWS_SECRET_ACCESS_KEY'); + if ($accessKeyId && $secretAccessKey) { + return [ + $accessKeyId, + $secretAccessKey, + getenv('AWS_SESSION_TOKEN') ?: null, // session token (can be null) + ]; + } + + return null; + } + + /** + * Return HMAC hash in binary string + */ + private static function hmacSign(string $key, string $msg): string + { + return hash_hmac('sha256', self::utf8Encode($msg), $key, true); + } + + /** + * @TODO add a fallback when mbstring is not available + */ + private static function utf8Encode(string $string): string + { + return mb_convert_encoding($string, 'UTF-8', 'ISO-8859-1'); + } + + private static function getSignatureKey( + string $key, + string $dateStamp, + string $regionName, + string $serviceName + ): string { + $kDate = self::hmacSign(self::utf8Encode('AWS4' . $key), $dateStamp); + $kRegion = self::hmacSign($kDate, $regionName); + $kService = self::hmacSign($kRegion, $serviceName); + $kSigning = self::hmacSign($kService, 'aws4_request'); + + return $kSigning; + } +} diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php new file mode 100644 index 000000000..e2afc6c58 --- /dev/null +++ b/lib/Google/vendor/google/auth/src/CredentialSource/FileSource.php @@ -0,0 +1,75 @@ +file = $file; + + if ($format === 'json' && is_null($subjectTokenFieldName)) { + throw new InvalidArgumentException( + 'subject_token_field_name must be set when format is JSON' + ); + } + + $this->format = $format; + $this->subjectTokenFieldName = $subjectTokenFieldName; + } + + public function fetchSubjectToken(callable $httpHandler = null): string + { + $contents = file_get_contents($this->file); + if ($this->format === 'json') { + if (!$json = json_decode((string) $contents, true)) { + throw new UnexpectedValueException( + 'Unable to decode JSON file' + ); + } + if (!isset($json[$this->subjectTokenFieldName])) { + throw new UnexpectedValueException( + 'subject_token_field_name not found in JSON file' + ); + } + $contents = $json[$this->subjectTokenFieldName]; + } + + return $contents; + } +} diff --git a/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php new file mode 100644 index 000000000..0acb3c6ef --- /dev/null +++ b/lib/Google/vendor/google/auth/src/CredentialSource/UrlSource.php @@ -0,0 +1,97 @@ + + */ + private ?array $headers; + + /** + * @param string $url The URL to fetch the subject token from. + * @param string $format The format of the token in the response. Can be null or "json". + * @param string $subjectTokenFieldName The name of the field containing the token in the response. This is required + * when format is "json". + * @param array $headers Request headers to send in with the request to the URL. + */ + public function __construct( + string $url, + string $format = null, + string $subjectTokenFieldName = null, + array $headers = null + ) { + $this->url = $url; + + if ($format === 'json' && is_null($subjectTokenFieldName)) { + throw new InvalidArgumentException( + 'subject_token_field_name must be set when format is JSON' + ); + } + + $this->format = $format; + $this->subjectTokenFieldName = $subjectTokenFieldName; + $this->headers = $headers; + } + + public function fetchSubjectToken(callable $httpHandler = null): string + { + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + + $request = new Request( + 'GET', + $this->url, + $this->headers ?: [] + ); + + $response = $httpHandler($request); + $body = (string) $response->getBody(); + if ($this->format === 'json') { + if (!$json = json_decode((string) $body, true)) { + throw new UnexpectedValueException( + 'Unable to decode JSON response' + ); + } + if (!isset($json[$this->subjectTokenFieldName])) { + throw new UnexpectedValueException( + 'subject_token_field_name not found in JSON file' + ); + } + $body = $json[$this->subjectTokenFieldName]; + } + + return $body; + } +} diff --git a/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php new file mode 100644 index 000000000..b2716bfaa --- /dev/null +++ b/lib/Google/vendor/google/auth/src/Credentials/ExternalAccountCredentials.php @@ -0,0 +1,241 @@ + $jsonKey JSON credentials as an associative array. + */ + public function __construct( + $scope, + array $jsonKey + ) { + if (!array_key_exists('type', $jsonKey)) { + throw new InvalidArgumentException('json key is missing the type field'); + } + if ($jsonKey['type'] !== self::EXTERNAL_ACCOUNT_TYPE) { + throw new InvalidArgumentException(sprintf( + 'expected "%s" type but received "%s"', + self::EXTERNAL_ACCOUNT_TYPE, + $jsonKey['type'] + )); + } + + if (!array_key_exists('token_url', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the token_url field' + ); + } + + if (!array_key_exists('audience', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the audience field' + ); + } + + if (!array_key_exists('subject_token_type', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the subject_token_type field' + ); + } + + if (!array_key_exists('credential_source', $jsonKey)) { + throw new InvalidArgumentException( + 'json key is missing the credential_source field' + ); + } + + if (array_key_exists('service_account_impersonation_url', $jsonKey)) { + $this->serviceAccountImpersonationUrl = $jsonKey['service_account_impersonation_url']; + } + + $this->quotaProject = $jsonKey['quota_project_id'] ?? null; + + $this->auth = new OAuth2([ + 'tokenCredentialUri' => $jsonKey['token_url'], + 'audience' => $jsonKey['audience'], + 'scope' => $scope, + 'subjectTokenType' => $jsonKey['subject_token_type'], + 'subjectTokenFetcher' => self::buildCredentialSource($jsonKey), + ]); + } + + /** + * @param array $jsonKey + */ + private static function buildCredentialSource(array $jsonKey): ExternalAccountCredentialSourceInterface + { + $credentialSource = $jsonKey['credential_source']; + if (isset($credentialSource['file'])) { + return new FileSource( + $credentialSource['file'], + $credentialSource['format']['type'] ?? null, + $credentialSource['format']['subject_token_field_name'] ?? null + ); + } + + if ( + isset($credentialSource['environment_id']) + && 1 === preg_match('/^aws(\d+)$/', $credentialSource['environment_id'], $matches) + ) { + if ($matches[1] !== '1') { + throw new InvalidArgumentException( + "aws version \"$matches[1]\" is not supported in the current build." + ); + } + if (!array_key_exists('regional_cred_verification_url', $credentialSource)) { + throw new InvalidArgumentException( + 'The regional_cred_verification_url field is required for aws1 credential source.' + ); + } + if (!array_key_exists('audience', $jsonKey)) { + throw new InvalidArgumentException( + 'aws1 credential source requires an audience to be set in the JSON file.' + ); + } + + return new AwsNativeSource( + $jsonKey['audience'], + $credentialSource['regional_cred_verification_url'], // $regionalCredVerificationUrl + $credentialSource['region_url'] ?? null, // $regionUrl + $credentialSource['url'] ?? null, // $securityCredentialsUrl + $credentialSource['imdsv2_session_token_url'] ?? null, // $imdsV2TokenUrl + ); + } + + if (isset($credentialSource['url'])) { + return new UrlSource( + $credentialSource['url'], + $credentialSource['format']['type'] ?? null, + $credentialSource['format']['subject_token_field_name'] ?? null, + $credentialSource['headers'] ?? null, + ); + } + + throw new InvalidArgumentException('Unable to determine credential source from json key.'); + } + /** + * @param string $stsToken + * @param callable $httpHandler + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_at + * } + */ + private function getImpersonatedAccessToken(string $stsToken, callable $httpHandler = null): array + { + if (!isset($this->serviceAccountImpersonationUrl)) { + throw new InvalidArgumentException( + 'service_account_impersonation_url must be set in JSON credentials.' + ); + } + $request = new Request( + 'POST', + $this->serviceAccountImpersonationUrl, + [ + 'Content-Type' => 'application/json', + 'Authorization' => 'Bearer ' . $stsToken, + ], + (string) json_encode([ + 'lifetime' => sprintf('%ss', OAuth2::DEFAULT_EXPIRY_SECONDS), + 'scope' => $this->auth->getScope(), + ]), + ); + if (is_null($httpHandler)) { + $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); + } + $response = $httpHandler($request); + $body = json_decode((string) $response->getBody(), true); + return [ + 'access_token' => $body['accessToken'], + 'expires_at' => strtotime($body['expireTime']), + ]; + } + + /** + * @param callable $httpHandler + * + * @return array { + * A set of auth related metadata, containing the following + * + * @type string $access_token + * @type int $expires_at (impersonated service accounts only) + * @type int $expires_in (identity pool only) + * @type string $issued_token_type (identity pool only) + * @type string $token_type (identity pool only) + * } + */ + public function fetchAuthToken(callable $httpHandler = null) + { + $stsToken = $this->auth->fetchAuthToken($httpHandler); + + if (isset($this->serviceAccountImpersonationUrl)) { + return $this->getImpersonatedAccessToken($stsToken['access_token'], $httpHandler); + } + + return $stsToken; + } + + public function getCacheKey() + { + return $this->auth->getCacheKey(); + } + + public function getLastReceivedToken() + { + return $this->auth->getLastReceivedToken(); + } + + /** + * Get the quota project used for this API request + * + * @return string|null + */ + public function getQuotaProject() + { + return $this->quotaProject; + } +} diff --git a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php index 0a2c019de..991589b52 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/GCECredentials.php @@ -100,6 +100,11 @@ class GCECredentials extends CredentialsLoader implements */ const FLAVOR_HEADER = 'Metadata-Flavor'; + /** + * The Linux file which contains the product name. + */ + private const GKE_PRODUCT_NAME_FILE = '/sys/class/dmi/id/product_name'; + /** * Note: the explicit `timeout` and `tries` below is a workaround. The underlying * issue is that resolving an unknown host on some networks will take @@ -340,6 +345,22 @@ public static function onGce(callable $httpHandler = null) } catch (ConnectException $e) { } } + + if (PHP_OS === 'Windows') { + // @TODO: implement GCE residency detection on Windows + return false; + } + + // Detect GCE residency on Linux + return self::detectResidencyLinux(self::GKE_PRODUCT_NAME_FILE); + } + + private static function detectResidencyLinux(string $productNameFile): bool + { + if (file_exists($productNameFile)) { + $productName = trim((string) file_get_contents($productNameFile)); + return 0 === strpos($productName, 'Google'); + } return false; } diff --git a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php index 577fe2298..1b4e46eaf 100644 --- a/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php +++ b/lib/Google/vendor/google/auth/src/Credentials/ImpersonatedServiceAccountCredentials.php @@ -37,13 +37,13 @@ class ImpersonatedServiceAccountCredentials extends CredentialsLoader implements protected $sourceCredentials; /** - * Instantiate an instance of ImpersonatedServiceAccountCredentials from a credentials file that has be created with - * the --impersonated-service-account flag. + * Instantiate an instance of ImpersonatedServiceAccountCredentials from a credentials file that + * has be created with the --impersonated-service-account flag. * - * @param string|string[] $scope the scope of the access request, expressed - * either as an Array or as a space-delimited String. + * @param string|string[] $scope The scope of the access request, expressed either as an + * array or as a space-delimited string. * @param string|array $jsonKey JSON credential file path or JSON credentials - * as an associative array + * as an associative array. */ public function __construct( $scope, @@ -59,24 +59,34 @@ public function __construct( } } if (!array_key_exists('service_account_impersonation_url', $jsonKey)) { - throw new \LogicException('json key is missing the service_account_impersonation_url field'); + throw new \LogicException( + 'json key is missing the service_account_impersonation_url field' + ); } if (!array_key_exists('source_credentials', $jsonKey)) { throw new \LogicException('json key is missing the source_credentials field'); } - $this->impersonatedServiceAccountName = $this->getImpersonatedServiceAccountNameFromUrl($jsonKey['service_account_impersonation_url']); + $this->impersonatedServiceAccountName = $this->getImpersonatedServiceAccountNameFromUrl( + $jsonKey['service_account_impersonation_url'] + ); - $this->sourceCredentials = new UserRefreshCredentials($scope, $jsonKey['source_credentials']); + $this->sourceCredentials = new UserRefreshCredentials( + $scope, + $jsonKey['source_credentials'] + ); } /** - * Helper function for extracting the Server Account Name from the URL saved in the account credentials file - * @param $serviceAccountImpersonationUrl string URL from the 'service_account_impersonation_url' field + * Helper function for extracting the Server Account Name from the URL saved in the account + * credentials file. + * + * @param $serviceAccountImpersonationUrl string URL from "service_account_impersonation_url" * @return string Service account email or ID. */ - private function getImpersonatedServiceAccountNameFromUrl(string $serviceAccountImpersonationUrl) - { + private function getImpersonatedServiceAccountNameFromUrl( + string $serviceAccountImpersonationUrl + ): string { $fields = explode('/', $serviceAccountImpersonationUrl); $lastField = end($fields); $splitter = explode(':', $lastField); diff --git a/lib/Google/vendor/google/auth/src/CredentialsLoader.php b/lib/Google/vendor/google/auth/src/CredentialsLoader.php index ada8e759c..9e28701ed 100644 --- a/lib/Google/vendor/google/auth/src/CredentialsLoader.php +++ b/lib/Google/vendor/google/auth/src/CredentialsLoader.php @@ -17,6 +17,7 @@ namespace Google\Auth; +use Google\Auth\Credentials\ExternalAccountCredentials; use Google\Auth\Credentials\ImpersonatedServiceAccountCredentials; use Google\Auth\Credentials\InsecureCredentials; use Google\Auth\Credentials\ServiceAccountCredentials; @@ -32,6 +33,8 @@ abstract class CredentialsLoader implements FetchAuthTokenInterface, UpdateMetadataInterface { + use UpdateMetadataTrait; + const TOKEN_CREDENTIAL_URI = 'https://oauth2.googleapis.com/token'; const ENV_VAR = 'GOOGLE_APPLICATION_CREDENTIALS'; const QUOTA_PROJECT_ENV_VAR = 'GOOGLE_CLOUD_QUOTA_PROJECT'; @@ -122,7 +125,7 @@ public static function fromWellKnownFile() * user-defined scopes exist, expressed either as an Array or as a * space-delimited string. * - * @return ServiceAccountCredentials|UserRefreshCredentials|ImpersonatedServiceAccountCredentials + * @return ServiceAccountCredentials|UserRefreshCredentials|ImpersonatedServiceAccountCredentials|ExternalAccountCredentials */ public static function makeCredentials( $scope, @@ -148,6 +151,11 @@ public static function makeCredentials( return new ImpersonatedServiceAccountCredentials($anyScope, $jsonKey); } + if ($jsonKey['type'] == 'external_account') { + $anyScope = $scope ?: $defaultScope; + return new ExternalAccountCredentials($anyScope, $jsonKey); + } + throw new \InvalidArgumentException('invalid value in the type field'); } @@ -190,44 +198,6 @@ public static function makeInsecureCredentials() return new InsecureCredentials(); } - /** - * export a callback function which updates runtime metadata. - * - * @return callable updateMetadata function - * @deprecated - */ - public function getUpdateMetadataFunc() - { - return [$this, 'updateMetadata']; - } - - /** - * Updates metadata with the authorization token. - * - * @param array $metadata metadata hashmap - * @param string $authUri optional auth uri - * @param callable $httpHandler callback which delivers psr7 request - * @return array updated metadata hashmap - */ - public function updateMetadata( - $metadata, - $authUri = null, - callable $httpHandler = null - ) { - if (isset($metadata[self::AUTH_METADATA_KEY])) { - // Auth metadata has already been set - return $metadata; - } - $result = $this->fetchAuthToken($httpHandler); - $metadata_copy = $metadata; - if (isset($result['access_token'])) { - $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['access_token']]; - } elseif (isset($result['id_token'])) { - $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['id_token']]; - } - return $metadata_copy; - } - /** * Fetch a quota project from the environment variable * GOOGLE_CLOUD_QUOTA_PROJECT. Return null if diff --git a/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php new file mode 100644 index 000000000..b4d00f8b4 --- /dev/null +++ b/lib/Google/vendor/google/auth/src/ExternalAccountCredentialSourceInterface.php @@ -0,0 +1,23 @@ + $config Configuration array */ public function __construct(array $config) @@ -368,6 +433,11 @@ public function __construct(array $config) 'scope' => null, 'additionalClaims' => [], 'codeVerifier' => null, + 'resource' => null, + 'subjectTokenFetcher' => null, + 'subjectTokenType' => null, + 'actorToken' => null, + 'actorTokenType' => null, ], $config); $this->setAuthorizationUri($opts['authorizationUri']); @@ -389,6 +459,14 @@ public function __construct(array $config) $this->setExtensionParams($opts['extensionParams']); $this->setAdditionalClaims($opts['additionalClaims']); $this->setCodeVerifier($opts['codeVerifier']); + + // for STS + $this->resource = $opts['resource']; + $this->subjectTokenFetcher = $opts['subjectTokenFetcher']; + $this->subjectTokenType = $opts['subjectTokenType']; + $this->actorToken = $opts['actorToken']; + $this->actorTokenType = $opts['actorTokenType']; + $this->updateToken($opts); } @@ -493,9 +571,10 @@ public function toJwt(array $config = []) /** * Generates a request for token credentials. * + * @param callable $httpHandler callback which delivers psr7 request * @return RequestInterface the authorization Url. */ - public function generateCredentialsRequest() + public function generateCredentialsRequest(callable $httpHandler = null) { $uri = $this->getTokenCredentialUri(); if (is_null($uri)) { @@ -525,6 +604,19 @@ public function generateCredentialsRequest() case self::JWT_URN: $params['assertion'] = $this->toJwt(); break; + case self::STS_URN: + $token = $this->subjectTokenFetcher->fetchSubjectToken($httpHandler); + $params['subject_token'] = $token; + $params['subject_token_type'] = $this->subjectTokenType; + $params += array_filter([ + 'resource' => $this->resource, + 'audience' => $this->audience, + 'scope' => $this->getScope(), + 'requested_token_type' => self::STS_REQUESTED_TOKEN_TYPE, + 'actor_token' => $this->actorToken, + 'actor_token_type' => $this->actorTokenType, + ]); + break; default: if (!is_null($this->getRedirectUri())) { # Grant type was supposed to be 'authorization_code', as there @@ -563,7 +655,7 @@ public function fetchAuthToken(callable $httpHandler = null) $httpHandler = HttpHandlerFactory::build(HttpClientCache::getHttpClient()); } - $response = $httpHandler($this->generateCredentialsRequest()); + $response = $httpHandler($this->generateCredentialsRequest($httpHandler)); $credentials = $this->parseTokenResponse($response); $this->updateToken($credentials); if (isset($credentials['scope'])) { @@ -685,6 +777,12 @@ public function updateToken(array $config) if (array_key_exists('refresh_token', $opts)) { $this->setRefreshToken($opts['refresh_token']); } + + // Required for STS response. An identifier for the representation of + // the issued security token. + if (array_key_exists('issued_token_type', $opts)) { + $this->issuedTokenType = $opts['issued_token_type']; + } } /** @@ -965,6 +1063,10 @@ public function getGrantType() return self::JWT_URN; } + if (!is_null($this->subjectTokenFetcher) && !is_null($this->subjectTokenType)) { + return self::STS_URN; + } + return null; } @@ -1492,6 +1594,16 @@ public function getAdditionalClaims() return $this->additionalClaims; } + /** + * Gets the additional claims to be included in the JWT token. + * + * @return ?string + */ + public function getIssuedTokenType() + { + return $this->issuedTokenType; + } + /** * The expiration of the last received token. * @@ -1611,7 +1723,7 @@ private function getFirebaseJwtKeys($publicKey, $allowedAlgs) $allowedAlg = null; if (is_string($allowedAlgs)) { - $allowedAlg = $allowedAlg; + $allowedAlg = $allowedAlgs; } elseif (is_array($allowedAlgs)) { if (count($allowedAlgs) > 1) { throw new \InvalidArgumentException( diff --git a/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php new file mode 100644 index 000000000..fd33e0dca --- /dev/null +++ b/lib/Google/vendor/google/auth/src/UpdateMetadataTrait.php @@ -0,0 +1,66 @@ + $metadata metadata hashmap + * @param string $authUri optional auth uri + * @param callable $httpHandler callback which delivers psr7 request + * @return array updated metadata hashmap + */ + public function updateMetadata( + $metadata, + $authUri = null, + callable $httpHandler = null + ) { + if (isset($metadata[self::AUTH_METADATA_KEY])) { + // Auth metadata has already been set + return $metadata; + } + $result = $this->fetchAuthToken($httpHandler); + $metadata_copy = $metadata; + if (isset($result['access_token'])) { + $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['access_token']]; + } elseif (isset($result['id_token'])) { + $metadata_copy[self::AUTH_METADATA_KEY] = ['Bearer ' . $result['id_token']]; + } + return $metadata_copy; + } +} diff --git a/lib/Google/vendor/google/cloud-core/.repo-metadata.json b/lib/Google/vendor/google/cloud-core/.repo-metadata.json index 477240ca5..9f0a1e0ee 100644 --- a/lib/Google/vendor/google/cloud-core/.repo-metadata.json +++ b/lib/Google/vendor/google/cloud-core/.repo-metadata.json @@ -1,4 +1,5 @@ { + "language": "php", "distribution_name": "google/cloud-core", "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-core/latest", diff --git a/lib/Google/vendor/google/cloud-core/VERSION b/lib/Google/vendor/google/cloud-core/VERSION index aa618f0d5..4b7e78db0 100644 --- a/lib/Google/vendor/google/cloud-core/VERSION +++ b/lib/Google/vendor/google/cloud-core/VERSION @@ -1 +1 @@ -1.51.2 +1.52.8 diff --git a/lib/Google/vendor/google/cloud-core/composer.json b/lib/Google/vendor/google/cloud-core/composer.json index 1b1315be6..63aff87d1 100644 --- a/lib/Google/vendor/google/cloud-core/composer.json +++ b/lib/Google/vendor/google/cloud-core/composer.json @@ -7,11 +7,11 @@ "php": ">=7.4", "rize/uri-template": "~0.3", "google/auth": "^1.18", - "guzzlehttp/guzzle": "^5.3|^6.5.7|^7.4.4", - "guzzlehttp/promises": "^1.3", + "guzzlehttp/guzzle": "^6.5.8|^7.4.4", + "guzzlehttp/promises": "^1.4||^2.0", "guzzlehttp/psr7": "^1.7|^2.0", "monolog/monolog": "^1.1|^2.0|^3.0", - "psr/http-message": "^1.0" + "psr/http-message": "^1.0|^2.0" }, "require-dev": { "phpunit/phpunit": "^9.0", @@ -19,7 +19,7 @@ "squizlabs/php_codesniffer": "2.*", "phpdocumentor/reflection": "^5.0", "erusev/parsedown": "^1.6", - "google/gax": "^1.9", + "google/gax": "^1.24.0", "opis/closure": "^3", "google/cloud-common-protos": "^0.4" }, diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php index 2ba2d4208..3ac284cf1 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/BatchTrait.php @@ -161,7 +161,7 @@ abstract protected function getCallback(); * responsible for serializing closures used in the * `$clientConfig`. This is especially important when using the * batch daemon. **Defaults to** - * {@see Google\Cloud\Core\Batch\OpisClosureSerializer} if the + * {@see \Google\Cloud\Core\Batch\OpisClosureSerializer} if the * `opis/closure` library is installed. * } * @throws \InvalidArgumentException diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/HandleFailureTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/HandleFailureTrait.php index 543bff705..32b467efd 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/HandleFailureTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/HandleFailureTrait.php @@ -88,7 +88,7 @@ public function handleFailure($idNum, array $items) if ($this->failureFile) { $fp = @fopen($this->failureFile, 'a'); - @fwrite($fp, serialize([$idNum => $items]) . PHP_EOL); + @fwrite($fp, json_encode(serialize([$idNum => $items])) . PHP_EOL); @fclose($fp); } } diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/InMemoryConfigStorage.php b/lib/Google/vendor/google/cloud-core/src/Batch/InMemoryConfigStorage.php index 941208c31..aa4a1b118 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/InMemoryConfigStorage.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/InMemoryConfigStorage.php @@ -154,8 +154,9 @@ public function clear() * * We want to delay registering the shutdown function. The error * reporter also registers a shutdown function and the order matters. - * {@see Google\ErrorReporting\Bootstrap::init()} - * {@see http://php.net/manual/en/function.register-shutdown-function.php} + * + * @see \Google\Cloud\ErrorReporting\Bootstrap::init() + * @see http://php.net/manual/en/function.register-shutdown-function.php * * @param mixed $item An item to submit. * @param int $idNum A numeric id for the job. diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php index ecc163492..dae64456f 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/InterruptTrait.php @@ -40,7 +40,8 @@ private function setupSignalHandlers() /** * A signal handler for setting the terminate switch. - * {@see http://php.net/manual/en/function.pcntl-signal.php} + * + * @see http://php.net/manual/en/function.pcntl-signal.php * * @param int $signo The received signal. * @param mixed $siginfo [optional] An array representing the signal diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/QueueOverflowException.php b/lib/Google/vendor/google/cloud-core/src/Batch/QueueOverflowException.php index 8359b0234..8424daa53 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/QueueOverflowException.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/QueueOverflowException.php @@ -18,7 +18,7 @@ namespace Google\Cloud\Core\Batch; /** - * Exception thrown in {@see Google\Cloud\Core\Batch\SysvProcessor::submit()} + * Exception thrown in {@see \Google\Cloud\Core\Batch\SysvProcessor::submit()} * method when it cannot add an item to the message queue. * Possible causes include: * diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php index 4b0941fcb..483c7eb3d 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/Retry.php @@ -62,6 +62,11 @@ public function retryAll() continue; } while ($line = fgets($fp)) { + $jsonDecodedValue = json_decode($line); + // Check if data json_encoded after serialization + if ($jsonDecodedValue !== null || $jsonDecodedValue !== false) { + $line = $jsonDecodedValue; + } $a = unserialize($line); $idNum = key($a); $job = $this->runner->getJobFromIdNum($idNum); diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/SerializableClientTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/SerializableClientTrait.php index fc2ca6017..60cd825be 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/SerializableClientTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/SerializableClientTrait.php @@ -48,7 +48,7 @@ trait SerializableClientTrait * responsible for serializing closures used in the * `$clientConfig`. This is especially important when using the * batch daemon. **Defaults to** - * {@see Google\Cloud\Core\Batch\OpisClosureSerializer} if the + * {@see \Google\Cloud\Core\Batch\OpisClosureSerializer} if the * `opis/closure` library is installed. * @type array $clientConfig A config used to construct the client upon * which requests will be made. diff --git a/lib/Google/vendor/google/cloud-core/src/Batch/SimpleJobTrait.php b/lib/Google/vendor/google/cloud-core/src/Batch/SimpleJobTrait.php index 196e38fa2..bdf08669f 100644 --- a/lib/Google/vendor/google/cloud-core/src/Batch/SimpleJobTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/Batch/SimpleJobTrait.php @@ -55,7 +55,7 @@ abstract public function run(); * responsible for serializing closures used in the * `$clientConfig`. This is especially important when using the * batch daemon. **Defaults to** - * {@see Google\Cloud\Core\Batch\OpisClosureSerializer} if the + * {@see \Google\Cloud\Core\Batch\OpisClosureSerializer} if the * `opis/closure` library is installed. * } */ diff --git a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php index ab3a4116e..e5a041311 100644 --- a/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php +++ b/lib/Google/vendor/google/cloud-core/src/ExponentialBackoff.php @@ -135,7 +135,7 @@ public function setDelayFunction(callable $delayFunction) /** * If not set, defaults to using - * {@see Google\Cloud\Core\ExponentialBackoff::calculateDelay()}. + * {@see \Google\Cloud\Core\ExponentialBackoff::calculateDelay()}. * * @param callable $calcDelayFunction * @return void diff --git a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php index 847e43e7a..5a2735361 100644 --- a/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php +++ b/lib/Google/vendor/google/cloud-core/src/GrpcRequestWrapper.php @@ -74,7 +74,7 @@ class GrpcRequestWrapper /** * @param array $config [optional] { * Configuration options. Please see - * {@see Google\Cloud\Core\RequestWrapperTrait::setCommonDefaults()} for + * {@see \Google\Cloud\Core\RequestWrapperTrait::setCommonDefaults()} for * the other available options. * * @type callable $authHttpHandler A handler used to deliver Psr7 diff --git a/lib/Google/vendor/google/cloud-core/src/Iam/Iam.php b/lib/Google/vendor/google/cloud-core/src/Iam/Iam.php index b83e747dc..1f8c08d53 100644 --- a/lib/Google/vendor/google/cloud-core/src/Iam/Iam.php +++ b/lib/Google/vendor/google/cloud-core/src/Iam/Iam.php @@ -23,7 +23,7 @@ * This class is not meant to be used directly. It should be accessed * through other objects which support IAM. * - * Policies can be created using the {@see Google\Cloud\Core\Iam\PolicyBuilder} + * Policies can be created using the {@see \Google\Cloud\Core\Iam\PolicyBuilder} * to help ensure their validity. * * Example: @@ -98,7 +98,7 @@ public function __construct(IamConnectionInterface $connection, $resource, array * * If a policy has already been retrieved from the API, it will be returned. * To fetch a fresh copy of the policy, use - * {@see Google\Cloud\Core\Iam\Iam::reload()}. + * {@see \Google\Cloud\Core\Iam\Iam::reload()}. * * Example: * ``` @@ -136,7 +136,7 @@ public function policy(array $options = []) * ``` * * @param array|PolicyBuilder $policy The new policy, as an array or an - * instance of {@see Google\Cloud\Core\Iam\PolicyBuilder}. + * instance of {@see \Google\Cloud\Core\Iam\PolicyBuilder}. * @param array $options Configuration Options * @return array An array of policy data * @throws \InvalidArgumentException If the given policy is not an array or PolicyBuilder. diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php index d345699eb..477d5f3ea 100644 --- a/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php +++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/LROTrait.php @@ -30,6 +30,7 @@ trait LROTrait { /** * @var LongRunningConnectionInterface + * @internal */ private $lroConnection; @@ -47,6 +48,8 @@ trait LROTrait * Populate required LRO properties. * * @param LongRunningConnectionInterface $lroConnection The LRO Connection. + * This object is created by internal classes, + * and should not be instantiated outside of this context. * @param array $callablesMap An collection of form [(string) typeUrl, (callable) callable] * providing a function to invoke when an operation completes. The * callable Type should correspond to an expected value of diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php index 9b35a5cce..df8c27b6e 100644 --- a/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php +++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningConnectionInterface.php @@ -21,6 +21,7 @@ * Defines the calls required to manage Long Running Operations. * * This interface should be implemented in a service's Connection namespace. + * @internal */ interface LongRunningConnectionInterface { diff --git a/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningOperation.php b/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningOperation.php index 63732d91b..d0decd596 100644 --- a/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningOperation.php +++ b/lib/Google/vendor/google/cloud-core/src/LongRunning/LongRunningOperation.php @@ -30,6 +30,7 @@ class LongRunningOperation /** * @var LongRunningConnectionInterface + * @internal */ private $connection; @@ -61,6 +62,8 @@ class LongRunningOperation /** * @param LongRunningConnectionInterface $connection An implementation * mapping to methods which handle LRO resolution in the service. + * This object is created by internal classes, + * and should not be instantiated outside of this context. * @param string $name The Operation name. * @param array $callablesMap An collection of form [(string) typeUrl, (callable) callable] * providing a function to invoke when an operation completes. The diff --git a/lib/Google/vendor/google/cloud-core/src/Report/EmptyMetadataProvider.php b/lib/Google/vendor/google/cloud-core/src/Report/EmptyMetadataProvider.php index 50c07e92e..32ed9a859 100644 --- a/lib/Google/vendor/google/cloud-core/src/Report/EmptyMetadataProvider.php +++ b/lib/Google/vendor/google/cloud-core/src/Report/EmptyMetadataProvider.php @@ -25,7 +25,8 @@ class EmptyMetadataProvider implements MetadataProviderInterface { /** * Return an array representing MonitoredResource. - * {@see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource} + * + * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource * * @return array */ diff --git a/lib/Google/vendor/google/cloud-core/src/Report/GAEMetadataProvider.php b/lib/Google/vendor/google/cloud-core/src/Report/GAEMetadataProvider.php index 3493f8b98..75caef7a5 100644 --- a/lib/Google/vendor/google/cloud-core/src/Report/GAEMetadataProvider.php +++ b/lib/Google/vendor/google/cloud-core/src/Report/GAEMetadataProvider.php @@ -59,7 +59,8 @@ public function __construct(array $server) /** * Return an array representing MonitoredResource. - * {@see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource} + * + * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource * * @return array */ diff --git a/lib/Google/vendor/google/cloud-core/src/Report/MetadataProviderInterface.php b/lib/Google/vendor/google/cloud-core/src/Report/MetadataProviderInterface.php index 9834fda0d..a1cb5f3b2 100644 --- a/lib/Google/vendor/google/cloud-core/src/Report/MetadataProviderInterface.php +++ b/lib/Google/vendor/google/cloud-core/src/Report/MetadataProviderInterface.php @@ -24,7 +24,8 @@ interface MetadataProviderInterface { /** * Return an array representing MonitoredResource. - * {@see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource} + * + * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource * * @return array */ diff --git a/lib/Google/vendor/google/cloud-core/src/Report/SimpleMetadataProvider.php b/lib/Google/vendor/google/cloud-core/src/Report/SimpleMetadataProvider.php index 12b04679d..288c6886f 100644 --- a/lib/Google/vendor/google/cloud-core/src/Report/SimpleMetadataProvider.php +++ b/lib/Google/vendor/google/cloud-core/src/Report/SimpleMetadataProvider.php @@ -49,7 +49,8 @@ public function __construct( /** * Return an array representing MonitoredResource. - * {@see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource} + * + * @see https://cloud.google.com/logging/docs/reference/v2/rest/v2/MonitoredResource * * @return array */ diff --git a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php index 4b28b58e8..f45e7a7a5 100644 --- a/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php +++ b/lib/Google/vendor/google/cloud-core/src/RequestWrapper.php @@ -95,12 +95,13 @@ class RequestWrapper /** * @param array $config [optional] { * Configuration options. Please see - * {@see Google\Cloud\Core\RequestWrapperTrait::setCommonDefaults()} for + * {@see \Google\Cloud\Core\RequestWrapperTrait::setCommonDefaults()} for * the other available options. * * @type string $componentVersion The current version of the component from * which the request originated. * @type string $accessToken Access token used to sign requests. + * Deprecated: This option is no longer supported. Use the `$credentialsFetcher` option instead. * @type callable $asyncHttpHandler *Experimental* A handler used to * deliver PSR-7 requests asynchronously. Function signature should match: * `function (RequestInterface $request, array $options = []) : PromiseInterface`. diff --git a/lib/Google/vendor/google/cloud-core/src/Retry.php b/lib/Google/vendor/google/cloud-core/src/Retry.php index c2fd34fea..67b6000b4 100644 --- a/lib/Google/vendor/google/cloud-core/src/Retry.php +++ b/lib/Google/vendor/google/cloud-core/src/Retry.php @@ -20,7 +20,7 @@ /** * Retry implementation. * - * Unlike {@see Google\Cloud\Core\ExponentialBackoff}, Retry requires an implementor + * Unlike {@see \Google\Cloud\Core\ExponentialBackoff}, Retry requires an implementor * to supply wait times for each iteration. */ class Retry diff --git a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php index 3214c5e24..b174df812 100644 --- a/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php +++ b/lib/Google/vendor/google/cloud-core/src/ServiceBuilder.php @@ -110,10 +110,10 @@ public function __construct(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type bool $returnInt64AsObject If true, 64 bit integers will be - * returned as a {@see Google\Cloud\Core\Int64} object for 32 bit + * returned as a {@see \Google\Cloud\Core\Int64} object for 32 bit * platform compatibility. **Defaults to** false. * @type string $location If provided, determines the default geographic * location used when creating datasets and managing jobs. Please @@ -141,10 +141,10 @@ public function bigQuery(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type bool $returnInt64AsObject If true, 64 bit integers will be - * returned as a {@see Google\Cloud\Core\Int64} object for 32 bit + * returned as a {@see \Google\Cloud\Core\Int64} object for 32 bit * platform compatibility. **Defaults to** false. * @return DatastoreClient */ @@ -165,10 +165,10 @@ public function datastore(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type bool $returnInt64AsObject If true, 64 bit integers will be - * returned as a {@see Google\Cloud\Core\Int64} object for 32 bit + * returned as a {@see \Google\Cloud\Core\Int64} object for 32 bit * platform compatibility. **Defaults to** false. * @return FirestoreClient */ @@ -189,7 +189,7 @@ public function firestore(array $config = []) * ``` * * @param array $config [optional] Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. * @return LoggingClient */ public function logging(array $config = []) @@ -210,7 +210,7 @@ public function logging(array $config = []) * ``` * * @param array $config [optional] Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. * @return LanguageClient */ public function language(array $config = []) @@ -230,7 +230,7 @@ public function language(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type string $transport The transport type used for requests. May be * either `grpc` or `rest`. **Defaults to** `grpc` if gRPC support @@ -254,10 +254,10 @@ public function pubsub(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type bool $returnInt64AsObject If true, 64 bit integers will be - * returned as a {@see Google\Cloud\Core\Int64} object for 32 bit + * returned as a {@see \Google\Cloud\Core\Int64} object for 32 bit * platform compatibility. **Defaults to** false. * } * @return SpannerClient @@ -282,7 +282,7 @@ public function spanner(array $config = []) * * @param array $config [optional] { * Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the other available options. * * @type string $languageCode The language of the content to * be recognized. Only BCP-47 (e.g., `"en-US"`, `"es-ES"`) @@ -307,7 +307,7 @@ public function speech(array $config = []) * ``` * * @param array $config [optional] Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. * @return StorageClient */ public function storage(array $config = []) @@ -327,7 +327,7 @@ public function storage(array $config = []) * ``` * * @param array $config [optional] Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. * @return TraceClient */ public function trace(array $config = []) @@ -347,7 +347,7 @@ public function trace(array $config = []) * ``` * * @param array $config [optional] Configuration options. See - * {@see Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. + * {@see \Google\Cloud\Core\ServiceBuilder::__construct()} for the available options. * @return VisionClient */ public function vision(array $config = []) diff --git a/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php b/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php index c8e20d45f..3e6c39772 100644 --- a/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php +++ b/lib/Google/vendor/google/cloud-core/src/Testing/TestHelpers.php @@ -131,7 +131,7 @@ public static function snippetBootstrap() */ public static function perfBootstrap() { - $bootstraps = glob(self::projectRoot() .'/*/tests/Perf/bootstrap.php'); + $bootstraps = glob(self::projectRoot() .'/*tests/Perf/bootstrap.php'); foreach ($bootstraps as $bootstrap) { require_once $bootstrap; } @@ -186,7 +186,7 @@ public static function systemBootstrap() SystemTestCase::setupQueue(); - $bootstraps = glob(self::projectRoot() .'/*/tests/System/bootstrap.php'); + $bootstraps = glob(self::projectRoot() .'/*tests/System/bootstrap.php'); foreach ($bootstraps as $bootstrap) { require_once $bootstrap; } diff --git a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php index b47fbc2bb..6e61546fe 100644 --- a/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php +++ b/lib/Google/vendor/google/cloud-core/src/Upload/ResumableUploader.php @@ -52,8 +52,8 @@ class ResumableUploader extends AbstractUploader /** * Classes extending ResumableUploader may provide request headers to be - * included in {@see Google\Cloud\Core\Upload\ResumableUploader::upload()} - * and {@see Google\Cloud\Core\Upload\ResumableUploader::createResumeUri{}}. + * included in {@see \Google\Cloud\Core\Upload\ResumableUploader::upload()} + * and {@see \Google\Cloud\Core\Upload\ResumableUploader::createResumeUri{}}. * * @var array */ @@ -142,7 +142,7 @@ public function resume($resumeUri) * Triggers the upload process. * * Errors are of form [`google.rpc.Status`](https://cloud.google.com/apis/design/errors#error_model), - * and may be obtained via {@see Google\Cloud\Core\Exception\ServiceException::getMetadata()}. + * and may be obtained via {@see \Google\Cloud\Core\Exception\ServiceException::getMetadata()}. * * @return array * @throws ServiceException diff --git a/lib/Google/vendor/google/cloud-storage/.repo-metadata.json b/lib/Google/vendor/google/cloud-storage/.repo-metadata.json index cfa4cf227..cec1634b2 100644 --- a/lib/Google/vendor/google/cloud-storage/.repo-metadata.json +++ b/lib/Google/vendor/google/cloud-storage/.repo-metadata.json @@ -1,4 +1,5 @@ { + "language": "php", "distribution_name": "google/cloud-storage", "release_level": "stable", "client_documentation": "https://cloud.google.com/php/docs/reference/cloud-storage/latest", diff --git a/lib/Google/vendor/google/cloud-storage/VERSION b/lib/Google/vendor/google/cloud-storage/VERSION index 3492b09b4..2b17ffd50 100644 --- a/lib/Google/vendor/google/cloud-storage/VERSION +++ b/lib/Google/vendor/google/cloud-storage/VERSION @@ -1 +1 @@ -1.31.2 +1.34.0 diff --git a/lib/Google/vendor/google/cloud-storage/composer.json b/lib/Google/vendor/google/cloud-storage/composer.json index 703df7e52..a5d1195db 100644 --- a/lib/Google/vendor/google/cloud-storage/composer.json +++ b/lib/Google/vendor/google/cloud-storage/composer.json @@ -5,8 +5,7 @@ "minimum-stability": "stable", "require": { "php": ">=7.4", - "google/cloud-core": "^1.51.1", - "google/crc32": "^0.2.0", + "google/cloud-core": "^1.52.7", "ramsey/uuid": "^4.2.3" }, "require-dev": { diff --git a/lib/Google/vendor/google/cloud-storage/src/Acl.php b/lib/Google/vendor/google/cloud-storage/src/Acl.php index 8cfae7213..c7f19f6d8 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Acl.php +++ b/lib/Google/vendor/google/cloud-storage/src/Acl.php @@ -45,6 +45,7 @@ class Acl /** * @var ConnectionInterface Represents a connection to Cloud Storage. + * @internal */ protected $connection; @@ -55,7 +56,8 @@ class Acl /** * @param ConnectionInterface $connection Represents a connection to - * Cloud Storage. + * Cloud Storage. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param string $type The type of access control this instance applies to. * @param array $identity Represents which bucket, file, or generation this * instance applies to. @@ -78,8 +80,10 @@ public function __construct(ConnectionInterface $connection, $type, array $ident } /** - * Delete access controls on a {@see Google\Cloud\Storage\Bucket} or - * {@see Google\Cloud\Storage\StorageObject} for a specified entity. + * Delete access controls. + * + * Delete access controls on a {@see Bucket} or + * {@see StorageObject} for a specified entity. * * Example: * ``` @@ -104,8 +108,10 @@ public function delete($entity, array $options = []) } /** - * Get access controls on a {@see Google\Cloud\Storage\Bucket} or - * {@see Google\Cloud\Storage\StorageObject}. By default this will return all available + * Get access controls. + * + * Get access controls on a {@see Bucket} or + * {@see StorageObject}. By default this will return all available * access controls. You may optionally specify a single entity to return * details for as well. * @@ -139,8 +145,10 @@ public function get(array $options = []) } /** - * Add access controls on a {@see Google\Cloud\Storage\Bucket} or - * {@see Google\Cloud\Storage\StorageObject}. + * Add access controls. + * + * Add access controls on a {@see Bucket} or + * {@see StorageObject}. * * Example: * ``` @@ -171,8 +179,9 @@ public function add($entity, $role, array $options = []) } /** - * Update access controls on a {@see Google\Cloud\Storage\Bucket} or - * {@see Google\Cloud\Storage\StorageObject}. + * Update access controls. + * + * Update access controls on a {@see Bucket} or {@see StorageObject}. * * Example: * ``` diff --git a/lib/Google/vendor/google/cloud-storage/src/Bucket.php b/lib/Google/vendor/google/cloud-storage/src/Bucket.php index abad33b77..68279fb11 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Bucket.php +++ b/lib/Google/vendor/google/cloud-storage/src/Bucket.php @@ -65,6 +65,7 @@ class Bucket /** * @var ConnectionInterface Represents a connection to Cloud Storage. + * @internal */ private $connection; @@ -95,7 +96,8 @@ class Bucket /** * @param ConnectionInterface $connection Represents a connection to Cloud - * Storage. + * Storage. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param string $name The bucket's name. * @param array $info [optional] The bucket's metadata. */ @@ -564,8 +566,10 @@ public function getStreamableUploader($data, array $options = []) /** * Lazily instantiates an object. There are no network requests made at this - * point. To see the operations that can be performed on an object please - * see {@see Google\Cloud\Storage\StorageObject}. + * point. + * + * To see the operations that can be performed on an object please + * see {@see StorageObject}. * * Example: * ``` @@ -647,6 +651,9 @@ public function object($name, array $options = []) * distinct results. **Defaults to** `false`. * @type string $fields Selector which will cause the response to only * return the specified fields. + * @type string $matchGlob A glob pattern to filter results. The string + * value must be UTF-8 encoded. See: + * https://cloud.google.com/storage/docs/json_api/v1/objects/list#list-object-glob * } * @return ObjectIterator */ @@ -756,7 +763,7 @@ function (array $object) { * } * @return Notification * @throws \InvalidArgumentException When providing a type other than string - * or {@see Google\Cloud\PubSub\Topic} as $topic. + * or {@see \Google\Cloud\PubSub\Topic} as $topic. * @throws GoogleException When a project ID has not been detected. * @experimental The experimental flag means that while we believe this * method or class is ready for use, it may change before release in @@ -782,8 +789,10 @@ public function createNotification($topic, array $options = []) /** * Lazily instantiates a notification. There are no network requests made at - * this point. To see the operations that can be performed on a notification - * please see {@see Google\Cloud\Storage\Notification}. + * this point. + * + * To see the operations that can be performed on a notification + * please see {@see Notification}. * * Example: * ``` @@ -948,6 +957,8 @@ public function delete(array $options = []) * Buckets can have either StorageClass OLM rules or Autoclass, * but not both. When Autoclass is enabled on a bucket, adding * StorageClass OLM rules will result in failure. + * For more information, refer to + * [Storage Autoclass](https://cloud.google.com/storage/docs/autoclass) * @type array $versioning The bucket's versioning configuration. * @type array $website The bucket's website configuration. * @type array $billing The bucket's billing configuration. @@ -970,7 +981,7 @@ public function delete(array $options = []) * occurs, signified by the hold's release. * @type array $retentionPolicy Defines the retention policy for a * bucket. In order to lock a retention policy, please see - * {@see Google\Cloud\Storage\Bucket::lockRetentionPolicy()}. + * {@see Bucket::lockRetentionPolicy()}. * @type int $retentionPolicy.retentionPeriod Specifies the duration * that objects need to be retained, in seconds. Retention * duration must be greater than zero and less than 100 years. @@ -1182,8 +1193,8 @@ public function name() * replace the configuration with the rules provided by this builder. * * This builder is intended to be used in tandem with - * {@see Google\Cloud\Storage\StorageClient::createBucket()} and - * {@see Google\Cloud\Storage\Bucket::update()}. + * {@see StorageClient::createBucket()} and + * {@see Bucket::update()}. * * Example: * ``` @@ -1213,13 +1224,15 @@ public static function lifecycle(array $lifecycle = []) /** * Retrieves a lifecycle builder preconfigured with the lifecycle rules that - * already exists on the bucket. Use this if you want to make updates to an + * already exists on the bucket. + * + * Use this if you want to make updates to an * existing configuration without removing existing rules, as would be the - * case when using {@see Google\Cloud\Storage\Bucket::lifecycle()}. + * case when using {@see Bucket::lifecycle()}. * * This builder is intended to be used in tandem with - * {@see Google\Cloud\Storage\StorageClient::createBucket()} and - * {@see Google\Cloud\Storage\Bucket::update()}. + * {@see StorageClient::createBucket()} and + * {@see Bucket::update()}. * * Please note, this method may trigger a network request in order to fetch * the existing lifecycle rules from the server. @@ -1341,8 +1354,8 @@ public function iam() * metageneration value will need to be available. It can either be supplied * explicitly through the `ifMetagenerationMatch` option or detected for you * by ensuring a value is cached locally (by calling - * {@see Google\Cloud\Storage\Bucket::reload()} or - * {@see Google\Cloud\Storage\Bucket::info()}, for example). + * {@see Bucket::reload()} or + * {@see Bucket::info()}, for example). * * Example: * ``` @@ -1414,7 +1427,7 @@ public function lockRetentionPolicy(array $options = []) * @see https://cloud.google.com/storage/docs/access-control/signed-urls Signed URLs * * @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL - * will expire. May provide an instance of {@see Google\Cloud\Core\Timestamp}, + * will expire. May provide an instance of {@see \Google\Cloud\Core\Timestamp}, * [http://php.net/datetimeimmutable](`\DateTimeImmutable`), or a * UNIX timestamp as an integer. * @param array $options { @@ -1520,7 +1533,7 @@ public function signedUrl($expires, array $options = []) * @param string $objectName The path to the file in Google Cloud Storage, * relative to the bucket. * @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL - * will expire. May provide an instance of {@see Google\Cloud\Core\Timestamp}, + * will expire. May provide an instance of {@see \Google\Cloud\Core\Timestamp}, * [http://php.net/datetimeimmutable](`\DateTimeImmutable`), or a * UNIX timestamp as an integer. * @param array $options [optional] { diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php b/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php index 819597029..71df234e5 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/ConnectionInterface.php @@ -20,6 +20,8 @@ /** * Represents a connection to * [Cloud Storage](https://cloud.google.com/storage/). + * + * @internal */ interface ConnectionInterface { diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/IamBucket.php b/lib/Google/vendor/google/cloud-storage/src/Connection/IamBucket.php index 4a1d2511c..084ced8f6 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/IamBucket.php +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/IamBucket.php @@ -21,6 +21,8 @@ /** * IAM Implementation for GCS Buckets + * + * @internal */ class IamBucket implements IamConnectionInterface { diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php index 4cab69fc6..b32ed878d 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/Rest.php @@ -29,8 +29,6 @@ use Google\Cloud\Core\UriTrait; use Google\Cloud\Storage\Connection\ConnectionInterface; use Google\Cloud\Storage\StorageClient; -use Google\CRC32\Builtin; -use Google\CRC32\CRC32; use GuzzleHttp\Exception\RequestException; use GuzzleHttp\Psr7\MimeType; use GuzzleHttp\Psr7\Request; @@ -43,6 +41,8 @@ /** * Implementation of the * [Google Cloud Storage JSON API](https://cloud.google.com/storage/docs/json_api/). + * + * @internal */ class Rest implements ConnectionInterface { @@ -660,21 +660,15 @@ private function chooseValidationMethod(array $args) private function crcFromStream(StreamInterface $data) { $pos = $data->tell(); - - if ($pos > 0) { - $data->rewind(); - } - - $crc32c = CRC32::create(CRC32::CASTAGNOLI); - $data->rewind(); + $crc32c = hash_init('crc32c'); while (!$data->eof()) { - $crc32c->update($data->read(1048576)); + $buffer = $data->read(1048576); + hash_update($crc32c, $buffer); } - $data->seek($pos); - - return base64_encode($crc32c->hash(true)); + $hash = hash_final($crc32c, true); + return base64_encode($hash); } /** @@ -692,13 +686,12 @@ protected function crc32cExtensionLoaded() /** * Check if hash() supports crc32c. * - * Protected access for unit testing. - * + * @deprecated * @return bool */ protected function supportsBuiltinCrc32c() { - return Builtin::supports(CRC32::CASTAGNOLI); + return extension_loaded('hash') && in_array('crc32c', hash_algos()); } /** diff --git a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json index f503978ce..f4a150b2f 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json +++ b/lib/Google/vendor/google/cloud-storage/src/Connection/ServiceDefinition/storage-v1.json @@ -1,4278 +1,5077 @@ { - "kind": "discovery#restDescription", - "version": "v1", - "id": "storage:v1", - "rootUrl": "https://storage.googleapis.com/", - "mtlsRootUrl": "https://storage.mtls.googleapis.com/", - "baseUrl": "https://storage.googleapis.com/storage/v1/", - "basePath": "/storage/v1/", - "servicePath": "storage/v1/", - "batchPath": "batch/storage/v1", - "discoveryVersion": "v1", - "name": "storage", - "title": "Cloud Storage JSON API", - "description": "Stores and retrieves potentially large, immutable data objects.", - "ownerDomain": "google.com", - "ownerName": "Google", - "icons": { - "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", - "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + "kind": "discovery#restDescription", + "version": "v1", + "id": "storage:v1", + "rootUrl": "https://storage.googleapis.com/", + "mtlsRootUrl": "https://storage.mtls.googleapis.com/", + "baseUrl": "https://storage.googleapis.com/storage/v1/", + "basePath": "/storage/v1/", + "servicePath": "storage/v1/", + "batchPath": "batch/storage/v1", + "discoveryVersion": "v1", + "name": "storage", + "title": "Cloud Storage JSON API", + "description": "Stores and retrieves potentially large, immutable data objects.", + "ownerDomain": "google.com", + "ownerName": "Google", + "icons": { + "x16": "https://www.google.com/images/icons/product/cloud_storage-16.png", + "x32": "https://www.google.com/images/icons/product/cloud_storage-32.png" + }, + "documentationLink": "https://developers.google.com/storage/docs/json_api/", + "labels": [ + "labs" + ], + "protocol": "rest", + "parameters": { + "alt": { + "type": "string", + "description": "Data format for the response.", + "default": "json", + "enum": [ + "json" + ], + "enumDescriptions": [ + "Responses with Content-Type of application/json" + ], + "location": "query" }, - "documentationLink": "https://developers.google.com/storage/docs/json_api/", - "labels": [ - "labs" - ], - "protocol": "rest", - "parameters": { - "alt": { - "type": "string", - "description": "Data format for the response.", - "default": "json", - "enum": [ - "json" - ], - "enumDescriptions": [ - "Responses with Content-Type of application/json" - ], - "location": "query" - }, - "fields": { - "type": "string", - "description": "Selector specifying which fields to include in a partial response.", - "location": "query" - }, - "key": { - "type": "string", - "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", - "location": "query" - }, - "oauth_token": { - "type": "string", - "description": "OAuth 2.0 token for the current user.", - "location": "query" - }, - "prettyPrint": { - "type": "boolean", - "description": "Returns response with indentations and line breaks.", - "default": "true", - "location": "query" - }, - "quotaUser": { - "type": "string", - "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", - "location": "query" - }, - "userIp": { - "type": "string", - "description": "Deprecated. Please use quotaUser instead.", - "location": "query" + "fields": { + "type": "string", + "description": "Selector specifying which fields to include in a partial response.", + "location": "query" + }, + "key": { + "type": "string", + "description": "API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.", + "location": "query" + }, + "oauth_token": { + "type": "string", + "description": "OAuth 2.0 token for the current user.", + "location": "query" + }, + "prettyPrint": { + "type": "boolean", + "description": "Returns response with indentations and line breaks.", + "default": "true", + "location": "query" + }, + "quotaUser": { + "type": "string", + "description": "An opaque string that represents a user for quota purposes. Must not exceed 40 characters.", + "location": "query" + }, + "userIp": { + "type": "string", + "description": "Deprecated. Please use quotaUser instead.", + "location": "query" }, "uploadType": { - "type": "string", - "description": "Upload protocol for media (e.g. \"media\", \"multipart\", \"resumable\").", - "location": "query" + "type": "string", + "description": "Upload protocol for media (e.g. \"media\", \"multipart\", \"resumable\").", + "location": "query" + } + }, + "auth": { + "oauth2": { + "scopes": { + "https://www.googleapis.com/auth/cloud-platform": { + "description": "View and manage your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/cloud-platform.read-only": { + "description": "View your data across Google Cloud Platform services" + }, + "https://www.googleapis.com/auth/devstorage.full_control": { + "description": "Manage your data and permissions in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_only": { + "description": "View your data in Google Cloud Storage" + }, + "https://www.googleapis.com/auth/devstorage.read_write": { + "description": "Manage your data in Google Cloud Storage" + } } - }, - "auth": { - "oauth2": { - "scopes": { - "https://www.googleapis.com/auth/cloud-platform": { - "description": "View and manage your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/cloud-platform.read-only": { - "description": "View your data across Google Cloud Platform services" - }, - "https://www.googleapis.com/auth/devstorage.full_control": { - "description": "Manage your data and permissions in Google Cloud Storage" - }, - "https://www.googleapis.com/auth/devstorage.read_only": { - "description": "View your data in Google Cloud Storage" + } + }, + "schemas": { + "Bucket": { + "id": "Bucket", + "type": "object", + "description": "A bucket.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the bucket.", + "items": { + "$ref": "BucketAccessControl" }, - "https://www.googleapis.com/auth/devstorage.read_write": { - "description": "Manage your data in Google Cloud Storage" + "annotations": { + "required": [ + "storage.buckets.update" + ] } - } - } - }, - "schemas": { - "Bucket": { - "id": "Bucket", - "type": "object", - "description": "A bucket.", - "properties": { - "acl": { - "type": "array", - "description": "Access controls on the bucket.", - "items": { - "$ref": "BucketAccessControl" - }, - "annotations": { - "required": [ - "storage.buckets.update" - ] + }, + "billing": { + "type": "object", + "description": "The bucket's billing configuration.", + "properties": { + "requesterPays": { + "type": "boolean", + "description": "When set to true, Requester Pays is enabled for this bucket." } - }, - "billing": { + } + }, + "cors": { + "type": "array", + "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", + "items": { "type": "object", - "description": "The bucket's billing configuration.", "properties": { - "requesterPays": { - "type": "boolean", - "description": "When set to true, Requester Pays is enabled for this bucket." + "maxAgeSeconds": { + "type": "integer", + "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", + "format": "int32" + }, + "method": { + "type": "array", + "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".", + "items": { + "type": "string" + } + }, + "origin": { + "type": "array", + "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", + "items": { + "type": "string" + } + }, + "responseHeader": { + "type": "array", + "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", + "items": { + "type": "string" + } } } - }, - "cors": { - "type": "array", - "description": "The bucket's Cross-Origin Resource Sharing (CORS) configuration.", - "items": { + } + }, + "customPlacementConfig": { + "type": "object", + "description": "The bucket's custom placement configuration for Custom Dual Regions.", + "properties": { + "dataLocations": { + "type": "array", + "description": "The list of regional locations in which data is placed.", + "items": { + "type": "string" + } + } + } + }, + "defaultEventBasedHold": { + "type": "boolean", + "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed." + }, + "defaultObjectAcl": { + "type": "array", + "description": "Default access controls to apply to new objects when no ACL is provided.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "encryption": { + "type": "object", + "description": "Encryption configuration for a bucket.", + "properties": { + "defaultKmsKeyName": { + "type": "string", + "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified." + } + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the bucket." + }, + "iamConfiguration": { + "type": "object", + "description": "The bucket's IAM configuration.", + "properties": { + "bucketPolicyOnly": { "type": "object", + "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.", "properties": { - "maxAgeSeconds": { - "type": "integer", - "description": "The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses.", - "format": "int32" - }, - "method": { - "type": "array", - "description": "The list of HTTP methods on which to include CORS response headers, (GET, OPTIONS, POST, etc) Note: \"*\" is permitted in the list of methods, and means \"any method\".", - "items": { - "type": "string" - } - }, - "origin": { - "type": "array", - "description": "The list of Origins eligible to receive CORS response headers. Note: \"*\" is permitted in the list of origins, and means \"any Origin\".", - "items": { - "type": "string" - } + "enabled": { + "type": "boolean", + "description": "If set, access is controlled only by bucket-level or above IAM policies." }, - "responseHeader": { - "type": "array", - "description": "The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains.", - "items": { - "type": "string" - } + "lockedTime": { + "type": "string", + "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.", + "format": "date-time" } } - } - }, - "customPlacementConfig": { - "type": "object", - "description": "The bucket's custom placement configuration for Custom Dual Regions.", - "properties": { - "dataLocations": { - "type": "array", - "description": "The list of regional locations in which data is placed.", - "items": { - "type": "string" - } + }, + "uniformBucketLevelAccess": { + "type": "object", + "description": "The bucket's uniform bucket-level access configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "If set, access is controlled only by bucket-level or above IAM policies." + }, + "lockedTime": { + "type": "string", + "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.", + "format": "date-time" } - } - }, - "defaultEventBasedHold": { - "type": "boolean", - "description": "The default value for event-based hold on newly created objects in this bucket. Event-based hold is a way to retain objects indefinitely until an event occurs, signified by the hold's release. After being released, such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false. Objects under event-based hold cannot be deleted, overwritten or archived until the hold is removed." - }, - "defaultObjectAcl": { - "type": "array", - "description": "Default access controls to apply to new objects when no ACL is provided.", - "items": { - "$ref": "ObjectAccessControl" - } - }, - "encryption": { - "type": "object", - "description": "Encryption configuration for a bucket.", - "properties": { - "defaultKmsKeyName": { - "type": "string", - "description": "A Cloud KMS key that will be used to encrypt objects inserted into this bucket, if no encryption method is specified." } + }, + "publicAccessPrevention": { + "type": "string", + "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported." } - }, - "etag": { + } + }, + "id": { + "type": "string", + "description": "The ID of the bucket. For buckets, the id and name properties are the same." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For buckets, this is always storage#bucket.", + "default": "storage#bucket" + }, + "labels": { + "type": "object", + "description": "User-provided labels, in key/value pairs.", + "additionalProperties": { "type": "string", - "description": "HTTP 1.1 Entity tag for the bucket." - }, - "iamConfiguration": { - "type": "object", - "description": "The bucket's IAM configuration.", - "properties": { - "bucketPolicyOnly": { - "type": "object", - "description": "The bucket's uniform bucket-level access configuration. The feature was formerly known as Bucket Policy Only. For backward compatibility, this field will be populated with identical information as the uniformBucketLevelAccess field. We recommend using the uniformBucketLevelAccess field to enable and disable the feature.", - "properties": { - "enabled": { - "type": "boolean", - "description": "If set, access is controlled only by bucket-level or above IAM policies." - }, - "lockedTime": { - "type": "string", - "description": "The deadline for changing iamConfiguration.bucketPolicyOnly.enabled from true to false in RFC 3339 format. iamConfiguration.bucketPolicyOnly.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time" - } - } - }, - "uniformBucketLevelAccess": { + "description": "An individual label entry." + } + }, + "lifecycle": { + "type": "object", + "description": "The bucket's lifecycle configuration. See lifecycle management for more information.", + "properties": { + "rule": { + "type": "array", + "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", + "items": { "type": "object", - "description": "The bucket's uniform bucket-level access configuration.", "properties": { - "enabled": { - "type": "boolean", - "description": "If set, access is controlled only by bucket-level or above IAM policies." - }, - "lockedTime": { - "type": "string", - "description": "The deadline for changing iamConfiguration.uniformBucketLevelAccess.enabled from true to false in RFC 3339 format. iamConfiguration.uniformBucketLevelAccess.enabled may be changed from true to false until the locked time, after which the field is immutable.", - "format": "date-time" - } - } - }, - "publicAccessPrevention": { - "type": "string", - "description": "The bucket's Public Access Prevention configuration. Currently, 'inherited' and 'enforced' are supported." - } - } - }, - "id": { - "type": "string", - "description": "The ID of the bucket. For buckets, the id and name properties are the same." - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For buckets, this is always storage#bucket.", - "default": "storage#bucket" - }, - "labels": { - "type": "object", - "description": "User-provided labels, in key/value pairs.", - "additionalProperties": { - "type": "string", - "description": "An individual label entry." - } - }, - "lifecycle": { - "type": "object", - "description": "The bucket's lifecycle configuration. See lifecycle management for more information.", - "properties": { - "rule": { - "type": "array", - "description": "A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.", - "items": { - "type": "object", - "properties": { - "action": { - "type": "object", - "description": "The action to take.", - "properties": { - "storageClass": { - "type": "string", - "description": "Target storage class. Required iff the type of the action is SetStorageClass." - }, - "type": { - "type": "string", + "action": { + "type": "object", + "description": "The action to take.", + "properties": { + "storageClass": { + "type": "string", + "description": "Target storage class. Required iff the type of the action is SetStorageClass." + }, + "type": { + "type": "string", "description": "Type of the action. Currently, only Delete, SetStorageClass, and AbortIncompleteMultipartUpload are supported." - } } - }, - "condition": { - "type": "object", - "description": "The condition(s) under which the action will be taken.", - "properties": { - "age": { - "type": "integer", - "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", - "format": "int32" - }, - "createdBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.", - "format": "date" - }, - "customTimeBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", - "format": "date" - }, - "daysSinceCustomTime": { - "type": "integer", - "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.", - "format": "int32" - }, - "daysSinceNoncurrentTime": { - "type": "integer", - "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.", - "format": "int32" - }, - "isLive": { - "type": "boolean", - "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects." - }, - "matchesPattern": { - "type": "string", - "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released." - }, - "matchesPrefix": { - "type": "array", - "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.", - "items": { - "type": "string" - } - }, - "matchesSuffix": { - "type": "array", - "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.", - "items": { - "type": "string" - } - }, - "matchesStorageClass": { - "type": "array", - "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.", - "items": { - "type": "string" - } - }, - "noncurrentTimeBefore": { - "type": "string", - "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", - "format": "date" - }, - "numNewerVersions": { - "type": "integer", - "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", - "format": "int32" + } + }, + "condition": { + "type": "object", + "description": "The condition(s) under which the action will be taken.", + "properties": { + "age": { + "type": "integer", + "description": "Age of an object (in days). This condition is satisfied when an object reaches the specified age.", + "format": "int32" + }, + "createdBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when an object is created before midnight of the specified date in UTC.", + "format": "date" + }, + "customTimeBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the custom time on an object is before this date in UTC.", + "format": "date" + }, + "daysSinceCustomTime": { + "type": "integer", + "description": "Number of days elapsed since the user-specified timestamp set on an object. The condition is satisfied if the days elapsed is at least this number. If no custom timestamp is specified on an object, the condition does not apply.", + "format": "int32" + }, + "daysSinceNoncurrentTime": { + "type": "integer", + "description": "Number of days elapsed since the noncurrent timestamp of an object. The condition is satisfied if the days elapsed is at least this number. This condition is relevant only for versioned objects. The value of the field must be a nonnegative integer. If it's zero, the object version will become eligible for Lifecycle action as soon as it becomes noncurrent.", + "format": "int32" + }, + "isLive": { + "type": "boolean", + "description": "Relevant only for versioned objects. If the value is true, this condition matches live objects; if the value is false, it matches archived objects." + }, + "matchesPattern": { + "type": "string", + "description": "A regular expression that satisfies the RE2 syntax. This condition is satisfied when the name of the object matches the RE2 pattern. Note: This feature is currently in the \"Early Access\" launch stage and is only available to a whitelisted set of users; that means that this feature may be changed in backward-incompatible ways and that it is not guaranteed to be released." + }, + "matchesPrefix": { + "type": "array", + "description": "List of object name prefixes. This condition will be satisfied when at least one of the prefixes exactly matches the beginning of the object name.", + "items": { + "type": "string" + } + }, + "matchesSuffix": { + "type": "array", + "description": "List of object name suffixes. This condition will be satisfied when at least one of the suffixes exactly matches the end of the object name.", + "items": { + "type": "string" } + }, + "matchesStorageClass": { + "type": "array", + "description": "Objects having any of the storage classes specified by this condition will be matched. Values include MULTI_REGIONAL, REGIONAL, NEARLINE, COLDLINE, ARCHIVE, STANDARD, and DURABLE_REDUCED_AVAILABILITY.", + "items": { + "type": "string" + } + }, + "noncurrentTimeBefore": { + "type": "string", + "description": "A date in RFC 3339 format with only the date part (for instance, \"2013-01-15\"). This condition is satisfied when the noncurrent time on an object is before this date in UTC. This condition is relevant only for versioned objects.", + "format": "date" + }, + "numNewerVersions": { + "type": "integer", + "description": "Relevant only for versioned objects. If the value is N, this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.", + "format": "int32" } } } } } } - }, + } + }, "autoclass": { - "type": "object", - "description": "The bucket's Autoclass configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "Whether or not Autoclass is enabled on this bucket" - }, - "toggleTime": { - "type": "string", - "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.", - "format": "date-time" - } + "type": "object", + "description": "The bucket's Autoclass configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "Whether or not Autoclass is enabled on this bucket" + }, + "toggleTime": { + "type": "string", + "description": "A date and time in RFC 3339 format representing the instant at which \"enabled\" was last toggled.", + "format": "date-time" + }, + "terminalStorageClass": { + "type": "string", + "description": "The storage class that objects in the bucket eventually transition to if they are not read for a certain length of time. Valid values are NEARLINE and ARCHIVE." + }, + "terminalStorageClassUpdateTime": { + "type": "string", + "description": "A date and time in RFC 3339 format representing the time of the most recent update to \"terminalStorageClass\".", + "format": "date-time" } + } }, - "location": { - "type": "string", - "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list." - }, - "locationType": { - "type": "string", - "description": "The type of the bucket location." - }, - "logging": { - "type": "object", - "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", - "properties": { - "logBucket": { - "type": "string", - "description": "The destination bucket where the current bucket's logs should be placed." - }, - "logObjectPrefix": { - "type": "string", - "description": "A prefix for log object names." - } + "location": { + "type": "string", + "description": "The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US. See the developer's guide for the authoritative list." + }, + "locationType": { + "type": "string", + "description": "The type of the bucket location." + }, + "logging": { + "type": "object", + "description": "The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs.", + "properties": { + "logBucket": { + "type": "string", + "description": "The destination bucket where the current bucket's logs should be placed." + }, + "logObjectPrefix": { + "type": "string", + "description": "A prefix for log object names." } - }, - "metageneration": { - "type": "string", - "description": "The metadata generation of this bucket.", - "format": "int64" - }, - "name": { - "type": "string", - "description": "The name of the bucket.", - "annotations": { - "required": [ - "storage.buckets.insert" - ] + } + }, + "metageneration": { + "type": "string", + "description": "The metadata generation of this bucket.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the bucket.", + "annotations": { + "required": [ + "storage.buckets.insert" + ] + } + }, + "owner": { + "type": "object", + "description": "The owner of the bucket. This is always the project team's owner group.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form project-owner-projectId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." } - }, - "owner": { - "type": "object", - "description": "The owner of the bucket. This is always the project team's owner group.", - "properties": { - "entity": { - "type": "string", - "description": "The entity, in the form project-owner-projectId." - }, - "entityId": { - "type": "string", - "description": "The ID for the entity." - } + } + }, + "projectNumber": { + "type": "string", + "description": "The project number of the project the bucket belongs to.", + "format": "uint64" + }, + "retentionPolicy": { + "type": "object", + "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.", + "properties": { + "effectiveTime": { + "type": "string", + "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.", + "format": "date-time" + }, + "isLocked": { + "type": "boolean", + "description": "Once locked, an object retention policy cannot be modified." + }, + "retentionPeriod": { + "type": "string", + "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.", + "format": "int64" } - }, - "projectNumber": { - "type": "string", - "description": "The project number of the project the bucket belongs to.", - "format": "uint64" - }, - "retentionPolicy": { - "type": "object", - "description": "The bucket's retention policy. The retention policy enforces a minimum retention time for all objects contained in the bucket, based on their creation time. Any attempt to overwrite or delete objects younger than the retention period will result in a PERMISSION_DENIED error. An unlocked retention policy can be modified or removed from the bucket via a storage.buckets.update operation. A locked retention policy cannot be removed or shortened in duration for the lifetime of the bucket. Attempting to remove or decrease period of a locked retention policy will result in a PERMISSION_DENIED error.", - "properties": { - "effectiveTime": { - "type": "string", - "description": "Server-determined value that indicates the time from which policy was enforced and effective. This value is in RFC 3339 format.", - "format": "date-time" - }, - "isLocked": { - "type": "boolean", - "description": "Once locked, an object retention policy cannot be modified." - }, - "retentionPeriod": { - "type": "string", - "description": "The duration in seconds that objects need to be retained. Retention duration must be greater than zero and less than 100 years. Note that enforcement of retention periods less than a day is not guaranteed. Such periods should only be used for testing purposes.", - "format": "int64" - } + } + }, + "objectRetention": { + "type": "object", + "description": "The bucket's object retention config.", + "properties": { + "mode": { + "type": "string", + "description": "The bucket's object retention mode. Can be Enabled." } - }, - "rpo": { - "type": "string", - "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket." - }, - "selfLink": { - "type": "string", - "description": "The URI of this bucket." - }, - "storageClass": { - "type": "string", - "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes." - }, - "timeCreated": { - "type": "string", - "description": "The creation time of the bucket in RFC 3339 format.", - "format": "date-time" - }, - "updated": { - "type": "string", - "description": "The modification time of the bucket in RFC 3339 format.", - "format": "date-time" - }, - "versioning": { - "type": "object", - "description": "The bucket's versioning configuration.", - "properties": { - "enabled": { - "type": "boolean", - "description": "While set to true, versioning is fully enabled for this bucket." - } + } + }, + "rpo": { + "type": "string", + "description": "The Recovery Point Objective (RPO) of this bucket. Set to ASYNC_TURBO to turn on Turbo Replication on a bucket." + }, + "selfLink": { + "type": "string", + "description": "The URI of this bucket." + }, + "softDeletePolicy": { + "type": "object", + "description": "The bucket's soft delete policy, which defines the period of time that soft-deleted objects will be retained, and cannot be permanently deleted.", + "properties": { + "retentionDurationSeconds": { + "type": "string", + "description": "The period of time in seconds, that soft-deleted objects in the bucket will be retained and cannot be permanently deleted.", + "format": "int64" + }, + "effectiveTime": { + "type": "string", + "description": "Server-determined value that indicates the time from which the policy, or one with a greater retention, was effective. This value is in RFC 3339 format.", + "format": "date-time" } - }, - "website": { - "type": "object", - "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.", - "properties": { - "mainPageSuffix": { - "type": "string", - "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages." - }, - "notFoundPage": { - "type": "string", - "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result." - } + } + }, + "storageClass": { + "type": "string", + "description": "The bucket's default storage class, used whenever no storageClass is specified for a newly-created object. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Values include MULTI_REGIONAL, REGIONAL, STANDARD, NEARLINE, COLDLINE, ARCHIVE, and DURABLE_REDUCED_AVAILABILITY. If this value is not specified when the bucket is created, it will default to STANDARD. For more information, see storage classes." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the bucket in RFC 3339 format.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The modification time of the bucket in RFC 3339 format.", + "format": "date-time" + }, + "versioning": { + "type": "object", + "description": "The bucket's versioning configuration.", + "properties": { + "enabled": { + "type": "boolean", + "description": "While set to true, versioning is fully enabled for this bucket." } - }, - "satisfiesPZS": { - "type": "boolean", - "description": "Reserved for future use." } - } - }, - "BucketAccessControl": { - "id": "BucketAccessControl", - "type": "object", - "description": "An access-control entry.", - "properties": { - "bucket": { - "type": "string", - "description": "The name of the bucket." - }, - "domain": { - "type": "string", - "description": "The domain associated with the entity, if any." - }, - "email": { - "type": "string", - "description": "The email address associated with the entity, if any." - }, - "entity": { - "type": "string", - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] + }, + "website": { + "type": "object", + "description": "The bucket's website configuration, controlling how the service behaves when accessing bucket contents as a web site. See the Static Website Examples for more information.", + "properties": { + "mainPageSuffix": { + "type": "string", + "description": "If the requested object path is missing, the service will ensure the path has a trailing '/', append this suffix, and attempt to retrieve the resulting object. This allows the creation of index.html objects to represent directory pages." + }, + "notFoundPage": { + "type": "string", + "description": "If the requested object path is missing, and any mainPageSuffix object is missing, if applicable, the service will return the named object from this bucket as the content for a 404 Not Found result." } - }, - "entityId": { - "type": "string", - "description": "The ID for the entity, if any." - }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the access-control entry." - }, - "id": { - "type": "string", - "description": "The ID of the access-control entry." - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", - "default": "storage#bucketAccessControl" - }, - "projectTeam": { - "type": "object", - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "type": "string", - "description": "The project number." - }, - "team": { - "type": "string", - "description": "The team." - } - } - }, - "role": { - "type": "string", - "description": "The access permission for the entity.", - "annotations": { - "required": [ - "storage.bucketAccessControls.insert" - ] + } + }, + "satisfiesPZS": { + "type": "boolean", + "description": "Reserved for future use." + } + } + }, + "BucketAccessControl": { + "id": "BucketAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For bucket access control entries, this is always storage#bucketAccessControl.", + "default": "storage#bucketAccessControl" + }, + "projectTeam": { + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team." } - }, - "selfLink": { - "type": "string", - "description": "The link to this access-control entry." } + }, + "role": { + "type": "string", + "description": "The access permission for the entity.", + "annotations": { + "required": [ + "storage.bucketAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." } - }, - "BucketAccessControls": { - "id": "BucketAccessControls", - "type": "object", - "description": "An access-control list.", - "properties": { + } + }, + "BucketAccessControls": { + "id": "BucketAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "BucketAccessControl" - } - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", - "default": "storage#bucketAccessControls" + "$ref": "BucketAccessControl" } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of bucket access control entries, this is always storage#bucketAccessControls.", + "default": "storage#bucketAccessControls" } - }, - "Buckets": { - "id": "Buckets", - "type": "object", - "description": "A list of buckets.", - "properties": { + } + }, + "Buckets": { + "id": "Buckets", + "type": "object", + "description": "A list of buckets.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Bucket" - } - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", - "default": "storage#buckets" - }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + "$ref": "Bucket" } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of buckets, this is always storage#buckets.", + "default": "storage#buckets" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." } - }, - "Channel": { - "id": "Channel", - "type": "object", - "description": "An notification channel used to watch for resource changes.", - "properties": { - "address": { - "type": "string", - "description": "The address where notifications are delivered for this channel." - }, - "expiration": { - "type": "string", - "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", - "format": "int64" - }, - "id": { - "type": "string", - "description": "A UUID or similar unique string that identifies this channel." - }, - "kind": { - "type": "string", - "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".", - "default": "api#channel" - }, - "params": { - "type": "object", - "description": "Additional parameters controlling delivery channel behavior. Optional.", - "additionalProperties": { - "type": "string", - "description": "Declares a new parameter by name." - } - }, - "payload": { - "type": "boolean", - "description": "A Boolean value to indicate whether payload is wanted. Optional." - }, - "resourceId": { - "type": "string", - "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions." - }, - "resourceUri": { - "type": "string", - "description": "A version-specific identifier for the watched resource." - }, - "token": { - "type": "string", - "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional." - }, - "type": { + } + }, + "Channel": { + "id": "Channel", + "type": "object", + "description": "An notification channel used to watch for resource changes.", + "properties": { + "address": { + "type": "string", + "description": "The address where notifications are delivered for this channel." + }, + "expiration": { + "type": "string", + "description": "Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "A UUID or similar unique string that identifies this channel." + }, + "kind": { + "type": "string", + "description": "Identifies this as a notification channel used to watch for changes to a resource, which is \"api#channel\".", + "default": "api#channel" + }, + "params": { + "type": "object", + "description": "Additional parameters controlling delivery channel behavior. Optional.", + "additionalProperties": { "type": "string", - "description": "The type of delivery mechanism used for this channel." + "description": "Declares a new parameter by name." } + }, + "payload": { + "type": "boolean", + "description": "A Boolean value to indicate whether payload is wanted. Optional." + }, + "resourceId": { + "type": "string", + "description": "An opaque ID that identifies the resource being watched on this channel. Stable across different API versions." + }, + "resourceUri": { + "type": "string", + "description": "A version-specific identifier for the watched resource." + }, + "token": { + "type": "string", + "description": "An arbitrary string delivered to the target address with each notification delivered over this channel. Optional." + }, + "type": { + "type": "string", + "description": "The type of delivery mechanism used for this channel." } - }, - "ComposeRequest": { - "id": "ComposeRequest", - "type": "object", - "description": "A Compose request.", - "properties": { - "destination": { - "$ref": "Object", - "description": "Properties of the resulting object." - }, - "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#composeRequest" - }, - "sourceObjects": { - "type": "array", - "description": "The list of source objects that will be concatenated into a single object.", - "items": { - "type": "object", - "properties": { - "generation": { - "type": "string", - "description": "The generation of this object to use as the source.", - "format": "int64" - }, - "name": { - "type": "string", - "description": "The source object's name. All source objects must reside in the same bucket.", - "annotations": { - "required": [ - "storage.objects.compose" - ] - } - }, - "objectPreconditions": { - "type": "object", - "description": "Conditions that must be met for this operation to execute.", - "properties": { - "ifGenerationMatch": { - "type": "string", - "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", - "format": "int64" - } + } + }, + "ComposeRequest": { + "id": "ComposeRequest", + "type": "object", + "description": "A Compose request.", + "properties": { + "destination": { + "$ref": "Object", + "description": "Properties of the resulting object." + }, + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#composeRequest" + }, + "sourceObjects": { + "type": "array", + "description": "The list of source objects that will be concatenated into a single object.", + "items": { + "type": "object", + "properties": { + "generation": { + "type": "string", + "description": "The generation of this object to use as the source.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The source object's name. All source objects must reside in the same bucket.", + "annotations": { + "required": [ + "storage.objects.compose" + ] + } + }, + "objectPreconditions": { + "type": "object", + "description": "Conditions that must be met for this operation to execute.", + "properties": { + "ifGenerationMatch": { + "type": "string", + "description": "Only perform the composition if the generation of the source object that would be used matches this value. If this value and a generation are both specified, they must be the same value or the call will fail.", + "format": "int64" } } } - }, - "annotations": { - "required": [ - "storage.objects.compose" - ] } - } - } - }, - "Expr": { - "id": "Expr", - "type": "object", - "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"", - "properties": { - "description": { - "type": "string", - "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." }, - "expression": { - "type": "string", - "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported." - }, - "location": { - "type": "string", - "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." - }, - "title": { - "type": "string", - "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." + "annotations": { + "required": [ + "storage.objects.compose" + ] } } - }, - "HmacKey": { - "id": "HmacKey", - "type": "object", - "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.", - "properties": { - "kind": { - "type": "string", - "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.", - "default": "storage#hmacKey" - }, - "metadata": { - "$ref": "HmacKeyMetadata", - "description": "Key metadata." - }, - "secret": { - "type": "string", - "description": "HMAC secret key material." - } + } + }, + "Expr": { + "id": "Expr", + "type": "object", + "description": "Represents an expression text. Example: title: \"User account presence\" description: \"Determines whether the request has a user account\" expression: \"size(request.user) > 0\"", + "properties": { + "description": { + "type": "string", + "description": "An optional description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI." + }, + "expression": { + "type": "string", + "description": "Textual representation of an expression in Common Expression Language syntax. The application context of the containing message determines which well-known feature set of CEL is supported." + }, + "location": { + "type": "string", + "description": "An optional string indicating the location of the expression for error reporting, e.g. a file name and a position in the file." + }, + "title": { + "type": "string", + "description": "An optional title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression." } - }, - "HmacKeyMetadata": { - "id": "HmacKeyMetadata", - "type": "object", - "description": "JSON template to produce a JSON-style HMAC Key metadata resource.", - "properties": { - "accessId": { - "type": "string", - "description": "The ID of the HMAC Key." - }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the HMAC key." - }, - "id": { - "type": "string", - "description": "The ID of the HMAC key, including the Project ID and the Access ID." - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.", - "default": "storage#hmacKeyMetadata" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account to which the key authenticates." - }, - "selfLink": { - "type": "string", - "description": "The link to this resource." - }, - "serviceAccountEmail": { - "type": "string", - "description": "The email address of the key's associated service account." - }, - "state": { - "type": "string", - "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED." + } + }, + "GoogleLongrunningOperation": { + "description": "This resource represents a long-running operation that is the result of a network API call.", + "id": "GoogleLongrunningOperation", + "properties": { + "done": { + "description": "If the value is \"false\", it means the operation is still in progress. If \"true\", the operation is completed, and either \"error\" or \"response\" is available.", + "type": "boolean" + }, + "error": { + "$ref": "GoogleRpcStatus", + "description": "The error result of the operation in case of failure or cancellation." + }, + "metadata": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" }, - "timeCreated": { - "type": "string", - "description": "The creation time of the HMAC key in RFC 3339 format.", - "format": "date-time" + "description": "Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.", + "type": "object" + }, + "name": { + "description": "The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the \"name\" should be a resource name ending with \"operations/{operationId}\".", + "type": "string" + }, + "response": { + "additionalProperties": { + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" }, - "updated": { - "type": "string", - "description": "The last modification time of the HMAC key metadata in RFC 3339 format.", - "format": "date-time" - } + "description": "The normal response of the operation in case of success. If the original method returns no data on success, such as \"Delete\", the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type \"XxxResponse\", where \"Xxx\" is the original method name. For example, if the original method name is \"TakeSnapshot()\", the inferred response type is \"TakeSnapshotResponse\".", + "type": "object" } }, - "HmacKeysMetadata": { - "id": "HmacKeysMetadata", - "type": "object", - "description": "A list of hmacKeys.", - "properties": { + "type": "object" + }, + "GoogleLongrunningListOperationsResponse": { + "description": "The response message for storage.buckets.operations.list.", + "id": "GoogleLongrunningListOperationsResponse", + "properties": { + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "operations": { + "description": "A list of operations that matches the specified filter in the request.", "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "HmacKeyMetadata" - } - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.", - "default": "storage#hmacKeysMetadata" + "$ref": "GoogleLongrunningOperation" }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." - } + "type": "array" } }, - "Notification": { - "id": "Notification", - "type": "object", - "description": "A subscription to receive Google PubSub notifications.", - "properties": { - "custom_attributes": { - "type": "object", - "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.", + "type": "object" + }, + "GoogleRpcStatus": { + "description": "The \"Status\" type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each \"Status\" message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).", + "id": "GoogleRpcStatus", + "properties": { + "code": { + "description": "The status code, which should be an enum value of google.rpc.Code.", + "format": "int32", + "type": "integer" + }, + "details": { + "description": "A list of messages that carry the error details. There is a common set of message types for APIs to use.", + "items": { "additionalProperties": { - "type": "string" - } - }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for this subscription notification." - }, - "event_types": { - "type": "array", - "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.", - "items": { - "type": "string" - } - }, - "id": { - "type": "string", - "description": "The ID of the notification." - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "default": "storage#notification" - }, - "object_name_prefix": { - "type": "string", - "description": "If present, only apply this notification configuration to object names that begin with this prefix." - }, - "payload_format": { - "type": "string", - "description": "The desired content of the Payload.", - "default": "JSON_API_V1", - "annotations": { - "required": [ - "storage.notifications.insert" - ] - } - }, - "selfLink": { - "type": "string", - "description": "The canonical URL of this notification." + "description": "Properties of the object. Contains field @type with type URL.", + "type": "any" + }, + "type": "object" }, - "topic": { - "type": "string", - "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'", - "annotations": { - "required": [ - "storage.notifications.insert" - ] - } - } + "type": "array" + }, + "message": { + "description": "A developer-facing error message, which should be in English.", + "type": "string" } }, - "Notifications": { - "id": "Notifications", - "type": "object", - "description": "A list of notification subscriptions.", - "properties": { + "type": "object" + }, + "HmacKey": { + "id": "HmacKey", + "type": "object", + "description": "JSON template to produce a JSON-style HMAC Key resource for Create responses.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is. For HMAC keys, this is always storage#hmacKey.", + "default": "storage#hmacKey" + }, + "metadata": { + "$ref": "HmacKeyMetadata", + "description": "Key metadata." + }, + "secret": { + "type": "string", + "description": "HMAC secret key material." + } + } + }, + "HmacKeyMetadata": { + "id": "HmacKeyMetadata", + "type": "object", + "description": "JSON template to produce a JSON-style HMAC Key metadata resource.", + "properties": { + "accessId": { + "type": "string", + "description": "The ID of the HMAC Key." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the HMAC key." + }, + "id": { + "type": "string", + "description": "The ID of the HMAC key, including the Project ID and the Access ID." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For HMAC Key metadata, this is always storage#hmacKeyMetadata.", + "default": "storage#hmacKeyMetadata" + }, + "projectId": { + "type": "string", + "description": "Project ID owning the service account to which the key authenticates." + }, + "selfLink": { + "type": "string", + "description": "The link to this resource." + }, + "serviceAccountEmail": { + "type": "string", + "description": "The email address of the key's associated service account." + }, + "state": { + "type": "string", + "description": "The state of the key. Can be one of ACTIVE, INACTIVE, or DELETED." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the HMAC key in RFC 3339 format.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The last modification time of the HMAC key metadata in RFC 3339 format.", + "format": "date-time" + } + } + }, + "HmacKeysMetadata": { + "id": "HmacKeysMetadata", + "type": "object", + "description": "A list of hmacKeys.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Notification" - } - }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.", - "default": "storage#notifications" + "$ref": "HmacKeyMetadata" } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of hmacKeys, this is always storage#hmacKeysMetadata.", + "default": "storage#hmacKeysMetadata" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." } - }, - "Object": { - "id": "Object", - "type": "object", - "description": "An object.", - "properties": { - "acl": { - "type": "array", - "description": "Access controls on the object.", - "items": { - "$ref": "ObjectAccessControl" - }, - "annotations": { - "required": [ - "storage.objects.update" - ] - } - }, - "bucket": { - "type": "string", - "description": "The name of the bucket containing this object." - }, - "cacheControl": { - "type": "string", - "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600." - }, - "componentCount": { - "type": "integer", - "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.", - "format": "int32" - }, - "contentDisposition": { - "type": "string", - "description": "Content-Disposition of the object data." - }, - "contentEncoding": { - "type": "string", - "description": "Content-Encoding of the object data." - }, - "contentLanguage": { - "type": "string", - "description": "Content-Language of the object data." - }, - "contentType": { - "type": "string", - "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream." - }, - "crc32c": { - "type": "string", - "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." - }, - "customTime": { - "type": "string", - "description": "A timestamp in RFC 3339 format specified by the user for an object.", - "format": "date-time" - }, - "customerEncryption": { - "type": "object", - "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.", - "properties": { - "encryptionAlgorithm": { - "type": "string", - "description": "The encryption algorithm." - }, - "keySha256": { - "type": "string", - "description": "SHA256 hash value of the encryption key." - } + } + }, + "ManagedFolder": { + "id": "ManagedFolder", + "type": "object", + "description": "A managed folder.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket containing this managed folder." + }, + "id": { + "type": "string", + "description": "The ID of the managed folder, including the bucket name and managed folder name." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For managed folders, this is always storage#managedFolder.", + "default": "storage#managedFolder" + }, + "metageneration": { + "type": "string", + "description": "The version of the metadata for this managed folder. Used for preconditions and for detecting changes in metadata.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the managed folder. Required if not specified by URL parameter." + }, + "selfLink": { + "type": "string", + "description": "The link to this managed folder." + }, + "createTime": { + "type": "string", + "description": "The creation time of the managed folder in RFC 3339 format.", + "format": "date-time" + }, + "updateTime": { + "type": "string", + "description": "The last update time of the managed folder metadata in RFC 3339 format.", + "format": "date-time" + } + } + }, + "ManagedFolders": { + "id": "ManagedFolders", + "type": "object", + "description": "A list of managed folders.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "ManagedFolder" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of managed folders, this is always storage#managedFolders.", + "default": "storage#managedFolders" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + } + } + }, + "Notification": { + "id": "Notification", + "type": "object", + "description": "A subscription to receive Google PubSub notifications.", + "properties": { + "custom_attributes": { + "type": "object", + "description": "An optional list of additional attributes to attach to each Cloud PubSub message published for this notification subscription.", + "additionalProperties": { + "type": "string" + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for this subscription notification." + }, + "event_types": { + "type": "array", + "description": "If present, only send notifications about listed event types. If empty, sent notifications for all event types.", + "items": { + "type": "string" + } + }, + "id": { + "type": "string", + "description": "The ID of the notification." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For notifications, this is always storage#notification.", + "default": "storage#notification" + }, + "object_name_prefix": { + "type": "string", + "description": "If present, only apply this notification configuration to object names that begin with this prefix." + }, + "payload_format": { + "type": "string", + "description": "The desired content of the Payload.", + "default": "JSON_API_V1", + "annotations": { + "required": [ + "storage.notifications.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The canonical URL of this notification." + }, + "topic": { + "type": "string", + "description": "The Cloud PubSub topic to which this subscription publishes. Formatted as: '//pubsub.googleapis.com/projects/{project-identifier}/topics/{my-topic}'", + "annotations": { + "required": [ + "storage.notifications.insert" + ] + } + } + } + }, + "Notifications": { + "id": "Notifications", + "type": "object", + "description": "A list of notification subscriptions.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Notification" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of notifications, this is always storage#notifications.", + "default": "storage#notifications" + } + } + }, + "Object": { + "id": "Object", + "type": "object", + "description": "An object.", + "properties": { + "acl": { + "type": "array", + "description": "Access controls on the object.", + "items": { + "$ref": "ObjectAccessControl" + }, + "annotations": { + "required": [ + "storage.objects.update" + ] + } + }, + "bucket": { + "type": "string", + "description": "The name of the bucket containing this object." + }, + "cacheControl": { + "type": "string", + "description": "Cache-Control directive for the object data. If omitted, and the object is accessible to all anonymous users, the default will be public, max-age=3600." + }, + "componentCount": { + "type": "integer", + "description": "Number of underlying components that make up this object. Components are accumulated by compose operations.", + "format": "int32" + }, + "contentDisposition": { + "type": "string", + "description": "Content-Disposition of the object data." + }, + "contentEncoding": { + "type": "string", + "description": "Content-Encoding of the object data." + }, + "contentLanguage": { + "type": "string", + "description": "Content-Language of the object data." + }, + "contentType": { + "type": "string", + "description": "Content-Type of the object data. If an object is stored without a Content-Type, it is served as application/octet-stream." + }, + "crc32c": { + "type": "string", + "description": "CRC32c checksum, as described in RFC 4960, Appendix B; encoded using base64 in big-endian byte order. For more information about using the CRC32c checksum, see Hashes and ETags: Best Practices." + }, + "customTime": { + "type": "string", + "description": "A timestamp in RFC 3339 format specified by the user for an object.", + "format": "date-time" + }, + "customerEncryption": { + "type": "object", + "description": "Metadata of customer-supplied encryption key, if the object is encrypted by such a key.", + "properties": { + "encryptionAlgorithm": { + "type": "string", + "description": "The encryption algorithm." + }, + "keySha256": { + "type": "string", + "description": "SHA256 hash value of the encryption key." + } + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the object." + }, + "eventBasedHold": { + "type": "boolean", + "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false." + }, + "generation": { + "type": "string", + "description": "The content generation of this object. Used for object versioning.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the object, including the bucket name, object name, and generation number." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For objects, this is always storage#object.", + "default": "storage#object" + }, + "kmsKeyName": { + "type": "string", + "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request." + }, + "md5Hash": { + "type": "string", + "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." + }, + "mediaLink": { + "type": "string", + "description": "Media download link." + }, + "metadata": { + "type": "object", + "description": "User-provided metadata, in key/value pairs.", + "additionalProperties": { + "type": "string", + "description": "An individual metadata entry." + } + }, + "metageneration": { + "type": "string", + "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", + "format": "int64" + }, + "name": { + "type": "string", + "description": "The name of the object. Required if not specified by URL parameter." + }, + "owner": { + "type": "object", + "description": "The owner of the object. This will always be the uploader of the object.", + "properties": { + "entity": { + "type": "string", + "description": "The entity, in the form user-userId." + }, + "entityId": { + "type": "string", + "description": "The ID for the entity." + } + } + }, + "retentionExpirationTime": { + "type": "string", + "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).", + "format": "date-time" + }, + "retention": { + "type": "object", + "description": "A collection of object level retention parameters.", + "properties": { + "retainUntilTime": { + "type": "string", + "description": "A time in RFC 3339 format until which object retention protects this object.", + "format": "date-time" + }, + "mode": { + "type": "string", + "description": "The bucket's object retention mode, can only be Unlocked or Locked." + } + } + }, + "selfLink": { + "type": "string", + "description": "The link to this object." + }, + "size": { + "type": "string", + "description": "Content-Length of the data in bytes.", + "format": "uint64" + }, + "storageClass": { + "type": "string", + "description": "Storage class of the object." + }, + "temporaryHold": { + "type": "boolean", + "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object." + }, + "timeCreated": { + "type": "string", + "description": "The creation time of the object in RFC 3339 format.", + "format": "date-time" + }, + "timeDeleted": { + "type": "string", + "description": "The time at which the object became noncurrent in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", + "format": "date-time" + }, + "softDeleteTime": { + "type": "string", + "description": "The time at which the object became soft-deleted in RFC 3339 format.", + "format": "date-time" + }, + "hardDeleteTime": { + "type": "string", + "description": "This is the time (in the future) when the soft-deleted object will no longer be restorable. It is equal to the soft delete time plus the current soft delete retention duration of the bucket.", + "format": "date-time" + }, + "timeStorageClassUpdated": { + "type": "string", + "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.", + "format": "date-time" + }, + "updated": { + "type": "string", + "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.", + "format": "date-time" + } + } + }, + "ObjectAccessControl": { + "id": "ObjectAccessControl", + "type": "object", + "description": "An access-control entry.", + "properties": { + "bucket": { + "type": "string", + "description": "The name of the bucket." + }, + "domain": { + "type": "string", + "description": "The domain associated with the entity, if any." + }, + "email": { + "type": "string", + "description": "The email address associated with the entity, if any." + }, + "entity": { + "type": "string", + "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", + "annotations": { + "required": [ + "storage.defaultObjectAccessControls.insert", + "storage.objectAccessControls.insert" + ] + } + }, + "entityId": { + "type": "string", + "description": "The ID for the entity, if any." + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the access-control entry." + }, + "generation": { + "type": "string", + "description": "The content generation of the object, if applied to an object.", + "format": "int64" + }, + "id": { + "type": "string", + "description": "The ID of the access-control entry." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", + "default": "storage#objectAccessControl" + }, + "object": { + "type": "string", + "description": "The name of the object, if applied to an object." + }, + "projectTeam": { + "type": "object", + "description": "The project team associated with the entity, if any.", + "properties": { + "projectNumber": { + "type": "string", + "description": "The project number." + }, + "team": { + "type": "string", + "description": "The team." + } + } + }, + "role": { + "type": "string", + "description": "The access permission for the entity.", + "annotations": { + "required": [ + "storage.defaultObjectAccessControls.insert", + "storage.objectAccessControls.insert" + ] + } + }, + "selfLink": { + "type": "string", + "description": "The link to this access-control entry." + } + } + }, + "ObjectAccessControls": { + "id": "ObjectAccessControls", + "type": "object", + "description": "An access-control list.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "ObjectAccessControl" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", + "default": "storage#objectAccessControls" + } + } + }, + "Objects": { + "id": "Objects", + "type": "object", + "description": "A list of objects.", + "properties": { + "items": { + "type": "array", + "description": "The list of items.", + "items": { + "$ref": "Object" + } + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For lists of objects, this is always storage#objects.", + "default": "storage#objects" + }, + "nextPageToken": { + "type": "string", + "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." + }, + "prefixes": { + "type": "array", + "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", + "items": { + "type": "string" + } + } + } + }, + "Policy": { + "id": "Policy", + "type": "object", + "description": "A bucket/object/managedFolder IAM policy.", + "properties": { + "bindings": { + "type": "array", + "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.", + "items": { + "type": "object", + "properties": { + "condition": { + "$ref": "Expr", + "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently." + }, + "members": { + "type": "array", + "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project", + "items": { + "type": "string" + }, + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + }, + "role": { + "type": "string", + "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.", + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + } + } + }, + "annotations": { + "required": [ + "storage.buckets.setIamPolicy", + "storage.objects.setIamPolicy", + "storage.managedFolders.setIamPolicy" + ] + } + }, + "etag": { + "type": "string", + "description": "HTTP 1.1 Entity tag for the policy.", + "format": "byte" + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.", + "default": "storage#policy" + }, + "resourceId": { + "type": "string", + "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, projects/_/buckets/bucket/objects/object for objects, and projects/_/buckets/bucket/managedFolders/managedFolder. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." + }, + "version": { + "type": "integer", + "description": "The IAM policy format version.", + "format": "int32" + } + } + }, + "RewriteResponse": { + "id": "RewriteResponse", + "type": "object", + "description": "A rewrite response.", + "properties": { + "done": { + "type": "boolean", + "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." + }, + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#rewriteResponse" + }, + "objectSize": { + "type": "string", + "description": "The total size of the object being copied in bytes. This property is always present in the response.", + "format": "int64" + }, + "resource": { + "$ref": "Object", + "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." + }, + "rewriteToken": { + "type": "string", + "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." + }, + "totalBytesRewritten": { + "type": "string", + "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", + "format": "int64" + } + } + }, + "ServiceAccount": { + "id": "ServiceAccount", + "type": "object", + "description": "A subscription to receive Google PubSub notifications.", + "properties": { + "email_address": { + "type": "string", + "description": "The ID of the notification." + }, + "kind": { + "type": "string", + "description": "The kind of item this is. For notifications, this is always storage#notification.", + "default": "storage#serviceAccount" + } + } + }, + "TestIamPermissionsResponse": { + "id": "TestIamPermissionsResponse", + "type": "object", + "description": "A storage.(buckets|objects|managedFolders).testIamPermissions response.", + "properties": { + "kind": { + "type": "string", + "description": "The kind of item this is.", + "default": "storage#testIamPermissionsResponse" + }, + "permissions": { + "type": "array", + "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets, objects, or managedFolders. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata. \n- storage.managedFolders.delete \u2014 Delete managed folder. \n- storage.managedFolders.get \u2014 Read managed folder metadata. \n- storage.managedFolders.getIamPolicy \u2014 Read managed folder IAM policy. \n- storage.managedFolders.create \u2014 Create managed folder. \n- storage.managedFolders.list \u2014 List managed folders. \n- storage.managedFolders.setIamPolicy \u2014 Update managed folder IAM policy.", + "items": { + "type": "string" + } + } + } + }, + "BulkRestoreObjectsRequest": { + "id": "BulkRestoreObjectsRequest", + "type": "object", + "description": "A bulk restore objects request.", + "properties": { + "allowOverwrite": { + "type": "boolean", + "description": "If false (default), the restore will not overwrite live objects with the same name at the destination. This means some deleted objects may be skipped. If true, live objects will be overwritten resulting in a noncurrent object (if versioning is enabled). If versioning is not enabled, overwriting the object will result in a soft-deleted object. In either case, if a noncurrent object already exists with the same name, a live version can be written without issue." + }, + "softDeletedAfterTime": { + "type": "string", + "description": "Restores only the objects that were soft-deleted after this time.", + "format": "date-time" + }, + "softDeletedBeforeTime": { + "type": "string", + "description": "Restores only the objects that were soft-deleted before this time.", + "format": "date-time" + }, + "matchGlobs": { + "type": "array", + "description": "Restores only the objects matching any of the specified glob(s). If this parameter is not specified, all objects will be restored within the specified time range.", + "items": { + "type": "string" + } + }, + "copySourceAcl": { + "type": "boolean", + "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false." + } + } + } + }, + "resources": { + "bucketAccessControls": { + "methods": { + "delete": { + "id": "storage.bucketAccessControls.delete", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.bucketAccessControls.get", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.bucketAccessControls.insert", + "path": "b/{bucket}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.bucketAccessControls.list", + "path": "b/{bucket}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "BucketAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.bucketAccessControls.patch", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Patches an ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.bucketAccessControls.update", + "path": "b/{bucket}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "BucketAccessControl" + }, + "response": { + "$ref": "BucketAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "buckets": { + "methods": { + "delete": { + "id": "storage.buckets.delete", + "path": "b/{bucket}", + "httpMethod": "DELETE", + "description": "Permanently deletes an empty bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If set, only deletes the bucket if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the bucket if its metageneration does not match this value.", + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.buckets.get", + "path": "b/{bucket}", + "httpMethod": "GET", + "description": "Returns metadata for the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "getIamPolicy": { + "id": "storage.buckets.getIamPolicy", + "path": "b/{bucket}/iam", + "httpMethod": "GET", + "description": "Returns an IAM policy for the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "optionsRequestedPolicyVersion": { + "type": "integer", + "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the object." + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Policy" }, - "eventBasedHold": { - "type": "boolean", - "description": "Whether an object is under event-based hold. Event-based hold is a way to retain objects until an event occurs, which is signified by the hold's release (i.e. this value is set to false). After being released (set to false), such objects will be subject to bucket-level retention (if any). One sample use case of this flag is for banks to hold loan documents for at least 3 years after loan is paid in full. Here, bucket-level retention is 3 years and the event is the loan being paid in full. In this example, these objects will be held intact for any number of years until the event has occurred (event-based hold on the object is released) and then 3 more years after that. That means retention duration of the objects begins from the moment event-based hold transitioned from true to false." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.buckets.insert", + "path": "b", + "httpMethod": "POST", + "description": "Creates a new bucket.", + "parameters": { + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + }, + "enableObjectRetention": { + "type": "boolean", + "description": "When set to true, object retention is enabled for this bucket.", + "default": "false", + "location": "query" + } }, - "generation": { - "type": "string", - "description": "The content generation of this object. Used for object versioning.", - "format": "int64" + "parameterOrder": [ + "project" + ], + "request": { + "$ref": "Bucket" }, - "id": { - "type": "string", - "description": "The ID of the object, including the bucket name, object name, and generation number." + "response": { + "$ref": "Bucket" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For objects, this is always storage#object.", - "default": "storage#object" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.buckets.list", + "path": "b", + "httpMethod": "GET", + "description": "Retrieves a list of buckets for a given project.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "Filter results to buckets whose names begin with this prefix.", + "location": "query" + }, + "project": { + "type": "string", + "description": "A valid API project identifier.", + "required": true, + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } }, - "kmsKeyName": { - "type": "string", - "description": "Not currently supported. Specifying the parameter causes the request to fail with status code 400 - Bad Request." + "parameterOrder": [ + "project" + ], + "response": { + "$ref": "Buckets" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "lockRetentionPolicy": { + "id": "storage.buckets.lockRetentionPolicy", + "path": "b/{bucket}/lockRetentionPolicy", + "httpMethod": "POST", + "description": "Locks retention policy on a bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", + "required": true, + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "md5Hash": { - "type": "string", - "description": "MD5 hash of the data; encoded using base64. For more information about using the MD5 hash, see Hashes and ETags: Best Practices." + "parameterOrder": [ + "bucket", + "ifMetagenerationMatch" + ], + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "patch": { + "id": "storage.buckets.patch", + "path": "b/{bucket}", + "httpMethod": "PATCH", + "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "mediaLink": { - "type": "string", - "description": "Media download link." + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" }, - "metadata": { - "type": "object", - "description": "User-provided metadata, in key/value pairs.", - "additionalProperties": { + "response": { + "$ref": "Bucket" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "setIamPolicy": { + "id": "storage.buckets.setIamPolicy", + "path": "b/{bucket}/iam", + "httpMethod": "PUT", + "description": "Updates an IAM policy for the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { "type": "string", - "description": "An individual metadata entry." + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } }, - "metageneration": { - "type": "string", - "description": "The version of the metadata for this object at this generation. Used for preconditions and for detecting changes in metadata. A metageneration number is only meaningful in the context of a particular generation of a particular object.", - "format": "int64" + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Policy" }, - "name": { - "type": "string", - "description": "The name of the object. Required if not specified by URL parameter." + "response": { + "$ref": "Policy" }, - "owner": { - "type": "object", - "description": "The owner of the object. This will always be the uploader of the object.", - "properties": { - "entity": { - "type": "string", - "description": "The entity, in the form user-userId." - }, - "entityId": { - "type": "string", - "description": "The ID for the entity." - } + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "testIamPermissions": { + "id": "storage.buckets.testIamPermissions", + "path": "b/{bucket}/iam/testPermissions", + "httpMethod": "GET", + "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } }, - "retentionExpirationTime": { - "type": "string", - "description": "A server-determined value that specifies the earliest time that the object's retention period expires. This value is in RFC 3339 format. Note 1: This field is not provided for objects with an active event-based hold, since retention expiration is unknown until the hold is removed. Note 2: This value can be provided even when temporary hold is set (so that the user can reason about policy without having to first unset the temporary hold).", - "format": "date-time" + "parameterOrder": [ + "bucket", + "permissions" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.buckets.update", + "path": "b/{bucket}", + "httpMethod": "PUT", + "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this bucket.", + "enum": [ + "authenticatedRead", + "private", + "projectPrivate", + "publicRead", + "publicReadWrite" + ], + "enumDescriptions": [ + "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", + "Project team owners get OWNER access.", + "Project team members get access according to their roles.", + "Project team owners get OWNER access, and allUsers get READER access.", + "Project team owners get OWNER access, and allUsers get WRITER access." + ], + "location": "query" + }, + "predefinedDefaultObjectAcl": { + "type": "string", + "description": "Apply a predefined set of default object access controls to this bucket.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit owner, acl and defaultObjectAcl properties." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "selfLink": { - "type": "string", - "description": "The link to this object." + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Bucket" }, - "size": { - "type": "string", - "description": "Content-Length of the data in bytes.", - "format": "uint64" + "response": { + "$ref": "Bucket" }, - "storageClass": { - "type": "string", - "description": "Storage class of the object." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "operations": { + "methods": { + "cancel": { + "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed.", + "path": "b/{bucket}/operations/{operationId}/cancel", + "httpMethod": "POST", + "id": "storage.buckets.operations.cancel", + "parameterOrder": [ + "bucket", + "operationId" + ], + "parameters": { + "bucket": { + "description": "The parent bucket of the operation resource.", + "location": "path", + "required": true, + "type": "string" + }, + "operationId": { + "description": "The ID of the operation resource.", + "location": "path", + "required": true, + "type": "string" + } }, - "temporaryHold": { - "type": "boolean", - "description": "Whether an object is under temporary hold. While this flag is set to true, the object is protected against deletion and overwrites. A common use case of this flag is regulatory investigations where objects need to be retained while the investigation is ongoing. Note that unlike event-based hold, temporary hold does not impact retention expiration time of an object." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "description": "Gets the latest state of a long-running operation.", + "path": "b/{bucket}/operations/{operationId}", + "httpMethod": "GET", + "id": "storage.buckets.operations.get", + "parameterOrder": [ + "bucket", + "operationId" + ], + "parameters": { + "bucket": { + "description": "The parent bucket of the operation resource.", + "location": "path", + "required": true, + "type": "string" + }, + "operationId": { + "description": "The ID of the operation resource.", + "location": "path", + "required": true, + "type": "string" + } }, - "timeCreated": { - "type": "string", - "description": "The creation time of the object in RFC 3339 format.", - "format": "date-time" + "response": { + "$ref": "GoogleLongrunningOperation" }, - "timeDeleted": { - "type": "string", - "description": "The deletion time of the object in RFC 3339 format. Will be returned if and only if this version of the object has been deleted.", - "format": "date-time" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "description": "Lists operations that match the specified filter in the request.", + "path": "b/{bucket}/operations", + "httpMethod": "GET", + "id": "storage.buckets.operations.list", + "parameterOrder": [ + "bucket" + ], + "parameters": { + "filter": { + "description": "A filter to narrow down results to a preferred subset. The filtering language is documented in more detail in [AIP-160](https://google.aip.dev/160).", + "location": "query", + "type": "string" + }, + "bucket": { + "description": "Name of the bucket in which to look for operations.", + "location": "path", + "required": true, + "type": "string" + }, + "pageSize": { + "description": "Maximum number of items to return in a single page of responses. Fewer total results may be returned than requested. The service uses this parameter or 100 items, whichever is smaller.", + "minimum": "0", + "format": "int32", + "location": "query", + "type": "integer" + }, + "pageToken": { + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query", + "type": "string" + } }, - "timeStorageClassUpdated": { - "type": "string", - "description": "The time at which the object's storage class was last changed. When the object is initially created, it will be set to timeCreated.", - "format": "date-time" + "response": { + "$ref": "GoogleLongrunningListOperationsResponse" }, - "updated": { - "type": "string", - "description": "The modification time of the object metadata in RFC 3339 format. Set initially to object creation time and then updated whenever any metadata of the object changes. This includes changes made by a requester, such as modifying custom metadata, as well as changes made by Cloud Storage on behalf of a requester, such as changing the storage class based on an Object Lifecycle Configuration.", - "format": "date-time" - } + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } - }, - "ObjectAccessControl": { - "id": "ObjectAccessControl", - "type": "object", - "description": "An access-control entry.", - "properties": { - "bucket": { - "type": "string", - "description": "The name of the bucket." - }, - "domain": { - "type": "string", - "description": "The domain associated with the entity, if any." + } + }, + "channels": { + "methods": { + "stop": { + "id": "storage.channels.stop", + "path": "channels/stop", + "httpMethod": "POST", + "description": "Stop watching resources through this channel", + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + } + } + }, + "defaultObjectAccessControls": { + "methods": { + "delete": { + "id": "storage.defaultObjectAccessControls.delete", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "email": { - "type": "string", - "description": "The email address associated with the entity, if any." + "parameterOrder": [ + "bucket", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.defaultObjectAccessControls.get", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "GET", + "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "entity": { - "type": "string", - "description": "The entity holding the permission, in one of the following forms: \n- user-userId \n- user-email \n- group-groupId \n- group-email \n- domain-domain \n- project-team-projectId \n- allUsers \n- allAuthenticatedUsers Examples: \n- The user liz@example.com would be user-liz@example.com. \n- The group example@googlegroups.com would be group-example@googlegroups.com. \n- To refer to all members of the Google Apps for Business domain example.com, the entity would be domain-example.com.", - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] + "parameterOrder": [ + "bucket", + "entity" + ], + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.defaultObjectAccessControls.insert", + "path": "b/{bucket}/defaultObjectAcl", + "httpMethod": "POST", + "description": "Creates a new default object ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } }, - "entityId": { - "type": "string", - "description": "The ID for the entity, if any." + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "ObjectAccessControl" }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the access-control entry." + "response": { + "$ref": "ObjectAccessControl" }, - "generation": { - "type": "string", - "description": "The content generation of the object, if applied to an object.", - "format": "int64" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.defaultObjectAccessControls.list", + "path": "b/{bucket}/defaultObjectAcl", + "httpMethod": "GET", + "description": "Retrieves default object ACL entries on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "id": { - "type": "string", - "description": "The ID of the access-control entry." + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "ObjectAccessControls" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For object access control entries, this is always storage#objectAccessControl.", - "default": "storage#objectAccessControl" + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.defaultObjectAccessControls.patch", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "PATCH", + "description": "Patches a default object ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "object": { - "type": "string", - "description": "The name of the object, if applied to an object." + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" }, - "projectTeam": { - "type": "object", - "description": "The project team associated with the entity, if any.", - "properties": { - "projectNumber": { - "type": "string", - "description": "The project number." - }, - "team": { - "type": "string", - "description": "The team." - } - } + "response": { + "$ref": "ObjectAccessControl" }, - "role": { - "type": "string", - "description": "The access permission for the entity.", - "annotations": { - "required": [ - "storage.defaultObjectAccessControls.insert", - "storage.objectAccessControls.insert" - ] + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.defaultObjectAccessControls.update", + "path": "b/{bucket}/defaultObjectAcl/{entity}", + "httpMethod": "PUT", + "description": "Updates a default object ACL entry on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" + }, + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } }, - "selfLink": { - "type": "string", - "description": "The link to this access-control entry." - } - } - }, - "ObjectAccessControls": { - "id": "ObjectAccessControls", - "type": "object", - "description": "An access-control list.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "ObjectAccessControl" - } + "parameterOrder": [ + "bucket", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of object access control entries, this is always storage#objectAccessControls.", - "default": "storage#objectAccessControls" - } + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] } - }, - "Objects": { - "id": "Objects", - "type": "object", - "description": "A list of objects.", - "properties": { - "items": { - "type": "array", - "description": "The list of items.", - "items": { - "$ref": "Object" + } + }, + "managedFolders": { + "methods": { + "delete": { + "id": "storage.managedFolders.delete", + "path": "b/{bucket}/managedFolders/{managedFolder}", + "httpMethod": "DELETE", + "description": "Permanently deletes a managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "If set, only deletes the managed folder if its metageneration matches this value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "If set, only deletes the managed folder if its metageneration does not match this value.", + "format": "int64", + "location": "query" } }, - "kind": { - "type": "string", - "description": "The kind of item this is. For lists of objects, this is always storage#objects.", - "default": "storage#objects" - }, - "nextPageToken": { - "type": "string", - "description": "The continuation token, used to page through large result sets. Provide this value in a subsequent request to return the next page of results." - }, - "prefixes": { - "type": "array", - "description": "The list of prefixes of objects matching-but-not-listed up to and including the requested delimiter.", - "items": { - "type": "string" + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.managedFolders.get", + "path": "b/{bucket}/managedFolders/{managedFolder}", + "httpMethod": "GET", + "description": "Returns metadata of the specified managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the return of the managed folder metadata conditional on whether the managed folder's current metageneration does not match the given value.", + "format": "int64", + "location": "query" } - } - } - }, - "Policy": { - "id": "Policy", - "type": "object", - "description": "A bucket/object IAM policy.", - "properties": { - "bindings": { - "type": "array", - "description": "An association between a role, which comes with a set of permissions, and members who may assume that role.", - "items": { - "type": "object", - "properties": { - "condition": { - "$ref": "Expr", - "description": "The condition that is associated with this binding. NOTE: an unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently." - }, - "members": { - "type": "array", - "description": "A collection of identifiers for members who may assume the provided role. Recognized identifiers are as follows: \n- allUsers \u2014 A special identifier that represents anyone on the internet; with or without a Google account. \n- allAuthenticatedUsers \u2014 A special identifier that represents anyone who is authenticated with a Google account or a service account. \n- user:emailid \u2014 An email address that represents a specific account. For example, user:alice@gmail.com or user:joe@example.com. \n- serviceAccount:emailid \u2014 An email address that represents a service account. For example, serviceAccount:my-other-app@appspot.gserviceaccount.com . \n- group:emailid \u2014 An email address that represents a Google group. For example, group:admins@example.com. \n- domain:domain \u2014 A Google Apps domain name that represents all the users of that domain. For example, domain:google.com or domain:example.com. \n- projectOwner:projectid \u2014 Owners of the given project. For example, projectOwner:my-example-project \n- projectEditor:projectid \u2014 Editors of the given project. For example, projectEditor:my-example-project \n- projectViewer:projectid \u2014 Viewers of the given project. For example, projectViewer:my-example-project", - "items": { - "type": "string" - }, - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] - } - }, - "role": { - "type": "string", - "description": "The role to which members belong. Two types of roles are supported: new IAM roles, which grant permissions that do not map directly to those provided by ACLs, and legacy IAM roles, which do map directly to ACL permissions. All roles are of the format roles/storage.specificRole.\nThe new IAM roles are: \n- roles/storage.admin \u2014 Full control of Google Cloud Storage resources. \n- roles/storage.objectViewer \u2014 Read-Only access to Google Cloud Storage objects. \n- roles/storage.objectCreator \u2014 Access to create objects in Google Cloud Storage. \n- roles/storage.objectAdmin \u2014 Full control of Google Cloud Storage objects. The legacy IAM roles are: \n- roles/storage.legacyObjectReader \u2014 Read-only access to objects without listing. Equivalent to an ACL entry on an object with the READER role. \n- roles/storage.legacyObjectOwner \u2014 Read/write access to existing objects without listing. Equivalent to an ACL entry on an object with the OWNER role. \n- roles/storage.legacyBucketReader \u2014 Read access to buckets with object listing. Equivalent to an ACL entry on a bucket with the READER role. \n- roles/storage.legacyBucketWriter \u2014 Read access to buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the WRITER role. \n- roles/storage.legacyBucketOwner \u2014 Read and write access to existing buckets with object listing/creation/deletion. Equivalent to an ACL entry on a bucket with the OWNER role.", - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] - } - } - } + }, + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "response": { + "$ref": "ManagedFolder" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "getIamPolicy": { + "id": "storage.managedFolders.getIamPolicy", + "path": "b/{bucket}/managedFolders/{managedFolder}/iam", + "httpMethod": "GET", + "description": "Returns an IAM policy for the specified managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "optionsRequestedPolicyVersion": { + "type": "integer", + "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", + "format": "int32", + "minimum": "1", + "location": "query" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" }, - "annotations": { - "required": [ - "storage.buckets.setIamPolicy", - "storage.objects.setIamPolicy" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.managedFolders.insert", + "path": "b/{bucket}/managedFolders", + "httpMethod": "POST", + "description": "Creates a new managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" } }, - "etag": { - "type": "string", - "description": "HTTP 1.1 Entity tag for the policy.", - "format": "byte" + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "ManagedFolder" }, - "kind": { - "type": "string", - "description": "The kind of item this is. For policies, this is always storage#policy. This field is ignored on input.", - "default": "storage#policy" + "response": { + "$ref": "ManagedFolder" }, - "resourceId": { - "type": "string", - "description": "The ID of the resource to which this policy belongs. Will be of the form projects/_/buckets/bucket for buckets, and projects/_/buckets/bucket/objects/object for objects. A specific generation may be specified by appending #generationNumber to the end of the object name, e.g. projects/_/buckets/my-bucket/objects/data.txt#17. The current generation can be denoted with #0. This field is ignored on input." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.managedFolders.list", + "path": "b/{bucket}/managedFolders", + "httpMethod": "GET", + "description": "Lists managed folders in the given bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "pageSize": { + "type": "integer", + "description": "Maximum number of items return in a single page of responses.", + "format": "int32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" + }, + "prefix": { + "type": "string", + "description": "The managed folder name/path prefix to filter the output list of results.", + "location": "query" + } }, - "version": { - "type": "integer", - "description": "The IAM policy format version.", - "format": "int32" - } - } - }, - "RewriteResponse": { - "id": "RewriteResponse", - "type": "object", - "description": "A rewrite response.", - "properties": { - "done": { - "type": "boolean", - "description": "true if the copy is finished; otherwise, false if the copy is in progress. This property is always present in the response." - }, - "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#rewriteResponse" + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "ManagedFolders" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "setIamPolicy": { + "id": "storage.managedFolders.setIamPolicy", + "path": "b/{bucket}/managedFolders/{managedFolder}/iam", + "httpMethod": "PUT", + "description": "Updates an IAM policy for the specified managed folder.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "objectSize": { - "type": "string", - "description": "The total size of the object being copied in bytes. This property is always present in the response.", - "format": "int64" + "parameterOrder": [ + "bucket", + "managedFolder" + ], + "request": { + "$ref": "Policy" }, - "resource": { - "$ref": "Object", - "description": "A resource containing the metadata for the copied-to object. This property is present in the response only when copying completes." + "response": { + "$ref": "Policy" }, - "rewriteToken": { - "type": "string", - "description": "A token to use in subsequent requests to continue copying data. This token is present in the response only when there is more data to copy." + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "testIamPermissions": { + "id": "storage.managedFolders.testIamPermissions", + "path": "b/{bucket}/managedFolders/{managedFolder}/iam/testPermissions", + "httpMethod": "GET", + "description": "Tests a set of permissions on the given managed folder to see which, if any, are held by the caller.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket containing the managed folder.", + "required": true, + "location": "path" + }, + "managedFolder": { + "type": "string", + "description": "The managed folder name/path.", + "required": true, + "location": "path" + }, + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "totalBytesRewritten": { - "type": "string", - "description": "The total bytes written so far, which can be used to provide a waiting user with a progress indicator. This property is always present in the response.", - "format": "int64" - } + "parameterOrder": [ + "bucket", + "managedFolder", + "permissions" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } - }, - "ServiceAccount": { - "id": "ServiceAccount", - "type": "object", - "description": "A subscription to receive Google PubSub notifications.", - "properties": { - "email_address": { - "type": "string", - "description": "The ID of the notification." + } + }, + "notifications": { + "methods": { + "delete": { + "id": "storage.notifications.delete", + "path": "b/{bucket}/notificationConfigs/{notification}", + "httpMethod": "DELETE", + "description": "Permanently deletes a notification subscription.", + "parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "notification": { + "type": "string", + "description": "ID of the notification to delete.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "kind": { - "type": "string", - "description": "The kind of item this is. For notifications, this is always storage#notification.", - "default": "storage#serviceAccount" - } - } - }, - "TestIamPermissionsResponse": { - "id": "TestIamPermissionsResponse", - "type": "object", - "description": "A storage.(buckets|objects).testIamPermissions response.", - "properties": { - "kind": { - "type": "string", - "description": "The kind of item this is.", - "default": "storage#testIamPermissionsResponse" + "parameterOrder": [ + "bucket", + "notification" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.notifications.get", + "path": "b/{bucket}/notificationConfigs/{notification}", + "httpMethod": "GET", + "description": "View a notification configuration.", + "parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "notification": { + "type": "string", + "description": "Notification ID", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "permissions": { - "type": "array", - "description": "The permissions held by the caller. Permissions are always of the format storage.resource.capability, where resource is one of buckets or objects. The supported permissions are as follows: \n- storage.buckets.delete \u2014 Delete bucket. \n- storage.buckets.get \u2014 Read bucket metadata. \n- storage.buckets.getIamPolicy \u2014 Read bucket IAM policy. \n- storage.buckets.create \u2014 Create bucket. \n- storage.buckets.list \u2014 List buckets. \n- storage.buckets.setIamPolicy \u2014 Update bucket IAM policy. \n- storage.buckets.update \u2014 Update bucket metadata. \n- storage.objects.delete \u2014 Delete object. \n- storage.objects.get \u2014 Read object data and metadata. \n- storage.objects.getIamPolicy \u2014 Read object IAM policy. \n- storage.objects.create \u2014 Create object. \n- storage.objects.list \u2014 List objects. \n- storage.objects.setIamPolicy \u2014 Update object IAM policy. \n- storage.objects.update \u2014 Update object metadata.", - "items": { - "type": "string" + "parameterOrder": [ + "bucket", + "notification" + ], + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.notifications.insert", + "path": "b/{bucket}/notificationConfigs", + "httpMethod": "POST", + "description": "Creates a notification subscription for a given bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "The parent bucket of the notification.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" } - } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Notification" + }, + "response": { + "$ref": "Notification" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "list": { + "id": "storage.notifications.list", + "path": "b/{bucket}/notificationConfigs", + "httpMethod": "GET", + "description": "Retrieves a list of notification subscriptions for a given bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a Google Cloud Storage bucket.", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Notifications" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } } }, - "resources": { - "bucketAccessControls": { - "methods": { - "delete": { - "id": "storage.bucketAccessControls.delete", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "objectAccessControls": { + "methods": { + "delete": { + "id": "storage.objectAccessControls.delete", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "DELETE", + "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "get": { - "id": "storage.bucketAccessControls.get", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "GET", - "description": "Returns the ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "get": { + "id": "storage.objectAccessControls.get", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "GET", + "description": "Returns the ACL entry for the specified entity on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "response": { - "$ref": "BucketAccessControl" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.bucketAccessControls.insert", - "path": "b/{bucket}/acl", - "httpMethod": "POST", - "description": "Creates a new ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "insert": { + "id": "storage.objectAccessControls.insert", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "POST", + "description": "Creates a new ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "BucketAccessControl" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "BucketAccessControl" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "list": { - "id": "storage.bucketAccessControls.list", - "path": "b/{bucket}/acl", - "httpMethod": "GET", - "description": "Retrieves ACL entries on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "list": { + "id": "storage.objectAccessControls.list", + "path": "b/{bucket}/o/{object}/acl", + "httpMethod": "GET", + "description": "Retrieves ACL entries on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "BucketAccessControls" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "patch": { - "id": "storage.bucketAccessControls.patch", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "PATCH", - "description": "Patches an ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "ObjectAccessControls" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "patch": { + "id": "storage.objectAccessControls.patch", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PATCH", + "description": "Patches an ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "BucketAccessControl" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "BucketAccessControl" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "update": { - "id": "storage.bucketAccessControls.update", - "path": "b/{bucket}/acl/{entity}", - "httpMethod": "PUT", - "description": "Updates an ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "update": { + "id": "storage.objectAccessControls.update", + "path": "b/{bucket}/o/{object}/acl/{entity}", + "httpMethod": "PUT", + "description": "Updates an ACL entry on the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of a bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "entity": { + "type": "string", + "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "BucketAccessControl" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "BucketAccessControl" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object", + "entity" + ], + "request": { + "$ref": "ObjectAccessControl" + }, + "response": { + "$ref": "ObjectAccessControl" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] } - }, - "buckets": { - "methods": { - "delete": { - "id": "storage.buckets.delete", - "path": "b/{bucket}", - "httpMethod": "DELETE", - "description": "Permanently deletes an empty bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "If set, only deletes the bucket if its metageneration matches this value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "If set, only deletes the bucket if its metageneration does not match this value.", - "format": "int64", - "location": "query" + } + }, + "objects": { + "methods": { + "compose": { + "id": "storage.objects.compose", + "path": "b/{destinationBucket}/o/{destinationObject}/compose", + "httpMethod": "POST", + "description": "Concatenates a list of existing objects into a new object in the same bucket.", + "parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "destinationObject": { + "type": "string", + "description": "Name of the new object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.buckets.get", - "path": "b/{bucket}", - "httpMethod": "GET", - "description": "Returns metadata for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Bucket" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "getIamPolicy": { - "id": "storage.buckets.getIamPolicy", - "path": "b/{bucket}/iam", - "httpMethod": "GET", - "description": "Returns an IAM policy for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "optionsRequestedPolicyVersion": { - "type": "integer", - "description": "The IAM policy format version to be returned. If the optionsRequestedPolicyVersion is for an older version that doesn't support part of the requested IAM policy, the request fails.", - "format": "int32", - "minimum": "1", - "location": "query" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Policy" + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "insert": { - "id": "storage.buckets.insert", - "path": "b", - "httpMethod": "POST", - "description": "Creates a new bucket.", - "parameters": { - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "project": { - "type": "string", - "description": "A valid API project identifier.", - "required": true, - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the bucket resource specifies acl or defaultObjectAcl properties, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "project" - ], - "request": { - "$ref": "Bucket" + "parameterOrder": [ + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "ComposeRequest" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "copy": { + "id": "storage.objects.copy", + "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", + "httpMethod": "POST", + "description": "Copies a source object to a destination object. Optionally overrides metadata.", + "parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "response": { - "$ref": "Bucket" + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "list": { - "id": "storage.buckets.list", - "path": "b", - "httpMethod": "GET", - "description": "Retrieves a list of buckets for a given project.", - "parameters": { - "maxResults": { - "type": "integer", - "description": "Maximum number of buckets to return in a single response. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to buckets whose names begin with this prefix.", - "location": "query" - }, - "project": { - "type": "string", - "description": "A valid API project identifier.", - "required": true, - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "project" - ], - "response": { - "$ref": "Buckets" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "lockRetentionPolicy": { - "id": "storage.buckets.lockRetentionPolicy", - "path": "b/{bucket}/lockRetentionPolicy", - "httpMethod": "POST", - "description": "Locks retention policy on a bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether bucket's current metageneration matches the given value.", - "required": true, - "format": "int64", - "location": "query" + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "ifMetagenerationMatch" - ], - "response": { - "$ref": "Bucket" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "patch": { - "id": "storage.buckets.patch", - "path": "b/{bucket}", - "httpMethod": "PATCH", - "description": "Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Bucket" + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Bucket" + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "setIamPolicy": { - "id": "storage.buckets.setIamPolicy", - "path": "b/{bucket}/iam", - "httpMethod": "PUT", - "description": "Updates an IAM policy for the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Policy" + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "response": { - "$ref": "Policy" + "sourceBucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "testIamPermissions": { - "id": "storage.buckets.testIamPermissions", - "path": "b/{bucket}/iam/testPermissions", - "httpMethod": "GET", - "description": "Tests a set of permissions on the given bucket to see which, if any, are held by the caller.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "permissions": { - "type": "string", - "description": "Permissions to test.", - "required": true, - "repeated": true, - "location": "query" + "sourceGeneration": { + "type": "string", + "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "permissions" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "update": { - "id": "storage.buckets.update", - "path": "b/{bucket}", - "httpMethod": "PUT", - "description": "Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the return of the bucket metadata conditional on whether the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this bucket.", - "enum": [ - "authenticatedRead", - "private", - "projectPrivate", - "publicRead", - "publicReadWrite" - ], - "enumDescriptions": [ - "Project team owners get OWNER access, and allAuthenticatedUsers get READER access.", - "Project team owners get OWNER access.", - "Project team members get access according to their roles.", - "Project team owners get OWNER access, and allUsers get READER access.", - "Project team owners get OWNER access, and allUsers get WRITER access." - ], - "location": "query" - }, - "predefinedDefaultObjectAcl": { - "type": "string", - "description": "Apply a predefined set of default object access controls to this bucket.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit owner, acl and defaultObjectAcl properties." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "delete": { + "id": "storage.objects.delete", + "path": "b/{bucket}/o/{object}", + "httpMethod": "DELETE", + "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Bucket" + "generation": { + "type": "string", + "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Bucket" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "channels": { - "methods": { - "stop": { - "id": "storage.channels.stop", - "path": "channels/stop", - "httpMethod": "POST", - "description": "Stop watching resources through this channel", - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "defaultObjectAccessControls": { - "methods": { - "delete": { - "id": "storage.defaultObjectAccessControls.delete", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the default object ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "get": { - "id": "storage.defaultObjectAccessControls.get", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "GET", - "description": "Returns the default object ACL entry for the specified entity on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.objects.get", + "path": "b/{bucket}/o/{object}", + "httpMethod": "GET", + "description": "Retrieves an object or its metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "response": { - "$ref": "ObjectAccessControl" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.defaultObjectAccessControls.insert", - "path": "b/{bucket}/defaultObjectAcl", - "httpMethod": "POST", - "description": "Creates a new default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "ObjectAccessControl" + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", + "location": "query" + } }, - "list": { - "id": "storage.defaultObjectAccessControls.list", - "path": "b/{bucket}/defaultObjectAcl", - "httpMethod": "GET", - "description": "Retrieves default object ACL entries on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "If present, only return default ACL listing if the bucket's current metageneration matches this value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "If present, only return default ACL listing if the bucket's current metageneration does not match the given value.", - "format": "int64", - "location": "query" + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaDownload": true, + "useMediaDownloadService": true + }, + "getIamPolicy": { + "id": "storage.objects.getIamPolicy", + "path": "b/{bucket}/o/{object}/iam", + "httpMethod": "GET", + "description": "Returns an IAM policy for the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "ObjectAccessControls" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "patch": { - "id": "storage.defaultObjectAccessControls.patch", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "PATCH", - "description": "Patches a default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket", + "object" + ], + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "insert": { + "id": "storage.objects.insert", + "path": "b/{bucket}/o", + "httpMethod": "POST", + "description": "Stores a new object and metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "contentEncoding": { + "type": "string", + "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", + "location": "query" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "id": "storage.defaultObjectAccessControls.update", - "path": "b/{bucket}/defaultObjectAcl/{entity}", - "httpMethod": "PUT", - "description": "Updates a default object ACL entry on the specified bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" + "kmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "name": { + "type": "string", + "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "notifications": { - "methods": { - "delete": { - "id": "storage.notifications.delete", - "path": "b/{bucket}/notificationConfigs/{notification}", - "httpMethod": "DELETE", - "description": "Permanently deletes a notification subscription.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" - }, - "notification": { - "type": "string", - "description": "ID of the notification to delete.", - "required": true, - "location": "path" + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "parameterOrder": [ - "bucket", - "notification" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "get": { - "id": "storage.notifications.get", - "path": "b/{bucket}/notificationConfigs/{notification}", - "httpMethod": "GET", - "description": "View a notification configuration.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" - }, - "notification": { - "type": "string", - "description": "Notification ID", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsMediaUpload": true, + "mediaUpload": { + "accept": [ + "*/*" + ], + "protocols": { + "simple": { + "multipart": true, + "path": "/upload/storage/v1/b/{bucket}/o" + }, + "resumable": { + "multipart": true, + "path": "/resumable/upload/storage/v1/b/{bucket}/o" } + } + } + }, + "list": { + "id": "storage.objects.list", + "path": "b/{bucket}/o", + "httpMethod": "GET", + "description": "Retrieves a list of objects matching the criteria.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "notification" - ], - "response": { - "$ref": "Notification" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "insert": { - "id": "storage.notifications.insert", - "path": "b/{bucket}/notificationConfigs", - "httpMethod": "POST", - "description": "Creates a notification subscription for a given bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "The parent bucket of the notification.", - "required": true, - "location": "path" + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "endOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" + }, + "includeTrailingDelimiter": { + "type": "boolean", + "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Notification" + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "response": { - "$ref": "Notification" + "startOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + }, + "versions": { + "type": "boolean", + "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" + }, + "matchGlob": { + "type": "string", + "description": "Filter results to objects and prefixes that match this glob pattern.", + "location": "query" + }, + "softDeleted": { + "type": "boolean", + "description": "If true, only soft-deleted object versions will be listed. The default is false. For more information, see Soft Delete.", + "location": "query" + }, + "includeFoldersAsPrefixes": { + "type": "boolean", + "description": "Only applicable if delimiter is set to '/'. If true, will also include folders and managed folders (besides objects) in the returned prefixes.", + "location": "query" + } }, - "list": { - "id": "storage.notifications.list", - "path": "b/{bucket}/notificationConfigs", - "httpMethod": "GET", - "description": "Retrieves a list of notification subscriptions for a given bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a Google Cloud Storage bucket.", - "required": true, - "location": "path" + "parameterOrder": [ + "bucket" + ], + "response": { + "$ref": "Objects" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsSubscription": true + }, + "patch": { + "id": "storage.objects.patch", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PATCH", + "description": "Patches an object's metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Notifications" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } - } - }, - "objectAccessControls": { - "methods": { - "delete": { - "id": "storage.objectAccessControls.delete", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "DELETE", - "description": "Permanently deletes the ACL entry for the specified entity on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "get": { - "id": "storage.objectAccessControls.get", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "GET", - "description": "Returns the ACL entry for the specified entity on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "response": { - "$ref": "ObjectAccessControl" + "overrideUnlockedRetention": { + "type": "boolean", + "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "insert": { - "id": "storage.objectAccessControls.insert", - "path": "b/{bucket}/o/{object}/acl", - "httpMethod": "POST", - "description": "Creates a new ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "ObjectAccessControl" + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request, for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "rewrite": { + "id": "storage.objects.rewrite", + "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", + "httpMethod": "POST", + "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", + "parameters": { + "destinationBucket": { + "type": "string", + "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", + "required": true, + "location": "path" + }, + "destinationKmsKeyName": { + "type": "string", + "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "destinationObject": { + "type": "string", + "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "list": { - "id": "storage.objectAccessControls.list", - "path": "b/{bucket}/o/{object}/acl", - "httpMethod": "GET", - "description": "Retrieves ACL entries on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "destinationPredefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to the destination object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "ObjectAccessControls" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "patch": { - "id": "storage.objectAccessControls.patch", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "PATCH", - "description": "Patches an ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" + "ifSourceGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "ifSourceGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "update": { - "id": "storage.objectAccessControls.update", - "path": "b/{bucket}/o/{object}/acl/{entity}", - "httpMethod": "PUT", - "description": "Updates an ACL entry on the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of a bucket.", - "required": true, - "location": "path" - }, - "entity": { - "type": "string", - "description": "The entity holding the permission. Can be user-userId, user-emailAddress, group-groupId, group-emailAddress, allUsers, or allAuthenticatedUsers.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "ifSourceMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "ifSourceMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object", - "entity" - ], - "request": { - "$ref": "ObjectAccessControl" + "maxBytesRewrittenPerCall": { + "type": "string", + "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "ObjectAccessControl" + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "objects": { - "methods": { - "compose": { - "id": "storage.objects.compose", - "path": "b/{destinationBucket}/o/{destinationObject}/compose", - "httpMethod": "POST", - "description": "Concatenates a list of existing objects into a new object in the same bucket.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket containing the source objects. The destination object is stored in this bucket.", - "required": true, - "location": "path" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "kmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" + "rewriteToken": { + "type": "string", + "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "sourceBucket": { + "type": "string", + "description": "Name of the bucket in which to find the source object.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "ComposeRequest" + "sourceGeneration": { + "type": "string", + "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Object" + "sourceObject": { + "type": "string", + "description": "Name of the source object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "copy": { - "id": "storage.objects.copy", - "path": "b/{sourceBucket}/o/{sourceObject}/copyTo/b/{destinationBucket}/o/{destinationObject}", - "httpMethod": "POST", - "description": "Copies a source object to a destination object. Optionally overrides metadata.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "destinationKmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any.", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "sourceBucket": { - "type": "string", - "description": "Name of the bucket in which to find the source object.", - "required": true, - "location": "path" - }, - "sourceGeneration": { - "type": "string", - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "sourceObject": { - "type": "string", - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "parameterOrder": [ + "sourceBucket", + "sourceObject", + "destinationBucket", + "destinationObject" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "RewriteResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "setIamPolicy": { + "id": "storage.objects.setIamPolicy", + "path": "b/{bucket}/o/{object}/iam", + "httpMethod": "PUT", + "description": "Updates an IAM policy for the specified object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "Object" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Object" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "delete": { - "id": "storage.objects.delete", - "path": "b/{bucket}/o/{object}", - "httpMethod": "DELETE", - "description": "Deletes an object and its metadata. Deletions are permanent if versioning is not enabled for the bucket, or if the generation parameter is used.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, permanently deletes a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Policy" + }, + "response": { + "$ref": "Policy" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "testIamPermissions": { + "id": "storage.objects.testIamPermissions", + "path": "b/{bucket}/o/{object}/iam/testPermissions", + "httpMethod": "GET", + "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "object" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "get": { - "id": "storage.objects.get", - "path": "b/{bucket}/o/{object}", - "httpMethod": "GET", - "description": "Retrieves an object or its metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "Object" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaDownload": true, - "useMediaDownloadService": true - }, - "getIamPolicy": { - "id": "storage.objects.getIamPolicy", - "path": "b/{bucket}/o/{object}/iam", - "httpMethod": "GET", - "description": "Returns an IAM policy for the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "permissions": { + "type": "string", + "description": "Permissions to test.", + "required": true, + "repeated": true, + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "response": { - "$ref": "Policy" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "insert": { - "id": "storage.objects.insert", - "path": "b/{bucket}/o", - "httpMethod": "POST", - "description": "Stores a new object and metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "required": true, - "location": "path" - }, - "contentEncoding": { - "type": "string", - "description": "If set, sets the contentEncoding property of the final object to this value. Setting this parameter is equivalent to setting the contentEncoding metadata property. This can be useful when uploading an object with uploadType=media to indicate the encoding of the content being uploaded.", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "kmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "name": { - "type": "string", - "description": "Name of the object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "location": "query" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "parameterOrder": [ + "bucket", + "object", + "permissions" + ], + "response": { + "$ref": "TestIamPermissionsResponse" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "update": { + "id": "storage.objects.update", + "path": "b/{bucket}/o/{object}", + "httpMethod": "PUT", + "description": "Updates an object's metadata.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Object" + "generation": { + "type": "string", + "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Object" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsMediaUpload": true, - "mediaUpload": { - "accept": [ - "*/*" - ], - "protocols": { - "simple": { - "multipart": true, - "path": "/upload/storage/v1/b/{bucket}/o" - }, - "resumable": { - "multipart": true, - "path": "/resumable/upload/storage/v1/b/{bucket}/o" - } - } - } - }, - "list": { - "id": "storage.objects.list", - "path": "b/{bucket}/o", - "httpMethod": "GET", - "description": "Retrieves a list of objects matching the criteria.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to look for objects.", - "required": true, - "location": "path" - }, - "delimiter": { - "type": "string", - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query" - }, - "endOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "includeTrailingDelimiter": { - "type": "boolean", - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "startOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - }, - "versions": { - "type": "boolean", - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query" - } + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "response": { - "$ref": "Objects" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - }, - "patch": { - "id": "storage.objects.patch", - "path": "b/{bucket}/o/{object}", - "httpMethod": "PATCH", - "description": "Patches an object's metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request, for Requester Pays buckets.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", + "format": "int64", + "location": "query" + }, + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", + "format": "int64", + "location": "query" + }, + "overrideUnlockedRetention": { + "type": "boolean", + "description": "Must be true to remove the retention configuration, reduce its unlocked retention period, or change its mode from unlocked to locked.", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Object" + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see [Encoding URI Path Parts](https://cloud.google.com/storage/docs/request-endpoints#encoding).", + "required": true, + "location": "path" }, - "response": { - "$ref": "Object" + "predefinedAcl": { + "type": "string", + "description": "Apply a predefined set of access controls to this object.", + "enum": [ + "authenticatedRead", + "bucketOwnerFullControl", + "bucketOwnerRead", + "private", + "projectPrivate", + "publicRead" + ], + "enumDescriptions": [ + "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", + "Object owner gets OWNER access, and project team owners get OWNER access.", + "Object owner gets OWNER access, and project team owners get READER access.", + "Object owner gets OWNER access.", + "Object owner gets OWNER access, and project team members get access according to their roles.", + "Object owner gets OWNER access, and allUsers get READER access." + ], + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } }, - "rewrite": { - "id": "storage.objects.rewrite", - "path": "b/{sourceBucket}/o/{sourceObject}/rewriteTo/b/{destinationBucket}/o/{destinationObject}", - "httpMethod": "POST", - "description": "Rewrites a source object to a destination object. Optionally overrides metadata.", - "parameters": { - "destinationBucket": { - "type": "string", - "description": "Name of the bucket in which to store the new object. Overrides the provided object metadata's bucket value, if any.", - "required": true, - "location": "path" - }, - "destinationKmsKeyName": { - "type": "string", - "description": "Resource name of the Cloud KMS key, of the form projects/my-project/locations/global/keyRings/my-kr/cryptoKeys/my-key, that will be used to encrypt the object. Overrides the object metadata's kms_key_name value, if any.", - "location": "query" - }, - "destinationObject": { - "type": "string", - "description": "Name of the new object. Required when the object metadata is not otherwise provided. Overrides the object metadata's name value, if any. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "destinationPredefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to the destination object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the destination object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current generation does not match the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifSourceMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the source object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "maxBytesRewrittenPerCall": { - "type": "string", - "description": "The maximum number of bytes that will be rewritten per rewrite request. Most callers shouldn't need to specify this parameter - it is primarily in place to support testing. If specified the value must be an integral multiple of 1 MiB (1048576). Also, this only applies to requests where the source and destination span locations and/or storage classes. Finally, this value must not change across rewrite calls else you'll get an error that the rewriteToken is invalid.", - "format": "int64", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl, unless the object resource specifies the acl property, when it defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "rewriteToken": { - "type": "string", - "description": "Include this field (from the previous rewrite response) on each rewrite request after the first one, until the rewrite response 'done' flag is true. Calls that provide a rewriteToken can omit all other request fields, but if included those fields must match the values provided in the first rewrite request.", - "location": "query" - }, - "sourceBucket": { - "type": "string", - "description": "Name of the bucket in which to find the source object.", - "required": true, - "location": "path" - }, - "sourceGeneration": { - "type": "string", - "description": "If present, selects a specific revision of the source object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "sourceObject": { - "type": "string", - "description": "Name of the source object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "watchAll": { + "id": "storage.objects.watchAll", + "path": "b/{bucket}/o/watch", + "httpMethod": "POST", + "description": "Watch for changes on all objects in a bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which to look for objects.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "sourceBucket", - "sourceObject", - "destinationBucket", - "destinationObject" - ], - "request": { - "$ref": "Object" + "delimiter": { + "type": "string", + "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", + "location": "query" }, - "response": { - "$ref": "RewriteResponse" + "endOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" + }, + "includeTrailingDelimiter": { + "type": "boolean", + "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", + "location": "query" + }, + "maxResults": { + "type": "integer", + "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", + "default": "1000", + "format": "uint32", + "minimum": "0", + "location": "query" + }, + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "setIamPolicy": { - "id": "storage.objects.setIamPolicy", - "path": "b/{bucket}/o/{object}/iam", - "httpMethod": "PUT", - "description": "Updates an IAM policy for the specified object.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" + "prefix": { + "type": "string", + "description": "Filter results to objects whose names begin with this prefix.", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to noAcl.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Policy" + "startOffset": { + "type": "string", + "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", + "location": "query" }, - "response": { - "$ref": "Policy" + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "versions": { + "type": "boolean", + "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", + "location": "query" + } }, - "testIamPermissions": { - "id": "storage.objects.testIamPermissions", - "path": "b/{bucket}/o/{object}/iam/testPermissions", - "httpMethod": "GET", - "description": "Tests a set of permissions on the given object to see which, if any, are held by the caller.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "permissions": { - "type": "string", - "description": "Permissions to test.", - "required": true, - "repeated": true, - "location": "query" + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "Channel", + "parameterName": "resource" + }, + "response": { + "$ref": "Channel" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ], + "supportsSubscription": true + }, + "restore": { + "id": "storage.objects.restore", + "path": "b/{bucket}/o/{object}/restore", + "httpMethod": "POST", + "description": "Restores a soft-deleted object.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "generation": { + "type": "string", + "description": "Selects a specific revision of this object.", + "required": true, + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket", - "object", - "permissions" - ], - "response": { - "$ref": "TestIamPermissionsResponse" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - }, - "update": { - "id": "storage.objects.update", - "path": "b/{bucket}/o/{object}", - "httpMethod": "PUT", - "description": "Updates an object's metadata.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which the object resides.", - "required": true, - "location": "path" - }, - "generation": { - "type": "string", - "description": "If present, selects a specific revision of this object (as opposed to the latest version, the default).", - "format": "int64", - "location": "query" - }, - "ifGenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", - "format": "int64", - "location": "query" - }, - "ifGenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current generation does not match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration matches the given value.", - "format": "int64", - "location": "query" - }, - "ifMetagenerationNotMatch": { - "type": "string", - "description": "Makes the operation conditional on whether the object's current metageneration does not match the given value.", - "format": "int64", - "location": "query" - }, - "object": { - "type": "string", - "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", - "required": true, - "location": "path" - }, - "predefinedAcl": { - "type": "string", - "description": "Apply a predefined set of access controls to this object.", - "enum": [ - "authenticatedRead", - "bucketOwnerFullControl", - "bucketOwnerRead", - "private", - "projectPrivate", - "publicRead" - ], - "enumDescriptions": [ - "Object owner gets OWNER access, and allAuthenticatedUsers get READER access.", - "Object owner gets OWNER access, and project team owners get OWNER access.", - "Object owner gets OWNER access, and project team owners get READER access.", - "Object owner gets OWNER access.", - "Object owner gets OWNER access, and project team members get access according to their roles.", - "Object owner gets OWNER access, and allUsers get READER access." - ], - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to full.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - } + "object": { + "type": "string", + "description": "Name of the object. For information about how to URL encode object names to be path safe, see Encoding URI Path Parts.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "bucket", - "object" - ], - "request": { - "$ref": "Object" + "ifGenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's one live generation matches the given value. Setting to 0 makes the operation succeed only if there are no live versions of the object.", + "format": "int64", + "location": "query" }, - "response": { - "$ref": "Object" + "ifGenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether none of the object's live generations match the given value. If no live object exists, the precondition fails. Setting to 0 makes the operation succeed only if there is a live version of the object.", + "format": "int64", + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - }, - "watchAll": { - "id": "storage.objects.watchAll", - "path": "b/{bucket}/o/watch", - "httpMethod": "POST", - "description": "Watch for changes on all objects in a bucket.", - "parameters": { - "bucket": { - "type": "string", - "description": "Name of the bucket in which to look for objects.", - "required": true, - "location": "path" - }, - "delimiter": { - "type": "string", - "description": "Returns results in a directory-like mode. items will contain only objects whose names, aside from the prefix, do not contain delimiter. Objects whose names, aside from the prefix, contain delimiter will have their name, truncated after the delimiter, returned in prefixes. Duplicate prefixes are omitted.", - "location": "query" - }, - "endOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically before endOffset. If startOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "includeTrailingDelimiter": { - "type": "boolean", - "description": "If true, objects that end in exactly one instance of delimiter will have their metadata included in items in addition to prefixes.", - "location": "query" - }, - "maxResults": { - "type": "integer", - "description": "Maximum number of items plus prefixes to return in a single page of responses. As duplicate prefixes are omitted, fewer total results may be returned than requested. The service will use this parameter or 1,000 items, whichever is smaller.", - "default": "1000", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "prefix": { - "type": "string", - "description": "Filter results to objects whose names begin with this prefix.", - "location": "query" - }, - "projection": { - "type": "string", - "description": "Set of properties to return. Defaults to noAcl.", - "enum": [ - "full", - "noAcl" - ], - "enumDescriptions": [ - "Include all properties.", - "Omit the owner, acl property." - ], - "location": "query" - }, - "startOffset": { - "type": "string", - "description": "Filter results to objects whose names are lexicographically equal to or after startOffset. If endOffset is also set, the objects listed will have names between startOffset (inclusive) and endOffset (exclusive).", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request. Required for Requester Pays buckets.", - "location": "query" - }, - "versions": { - "type": "boolean", - "description": "If true, lists all versions of an object as distinct results. The default is false. For more information, see Object Versioning.", - "location": "query" - } + "ifMetagenerationMatch": { + "type": "string", + "description": "Makes the operation conditional on whether the object's one live metageneration matches the given value.", + "format": "int64", + "location": "query" }, - "parameterOrder": [ - "bucket" - ], - "request": { - "$ref": "Channel", - "parameterName": "resource" - }, - "response": { - "$ref": "Channel" - }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ], - "supportsSubscription": true - } + "ifMetagenerationNotMatch": { + "type": "string", + "description": "Makes the operation conditional on whether none of the object's live metagenerations match the given value.", + "format": "int64", + "location": "query" + }, + "copySourceAcl": { + "type": "boolean", + "description": "If true, copies the source object's ACL; otherwise, uses the bucket's default object ACL. The default is false.", + "location": "query" + }, + "projection": { + "type": "string", + "description": "Set of properties to return. Defaults to full.", + "enum": [ + "full", + "noAcl" + ], + "enumDescriptions": [ + "Include all properties.", + "Omit the owner, acl property." + ], + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request. Required for Requester Pays buckets.", + "location": "query" + } + }, + "parameterOrder": [ + "bucket", + "object" + ], + "request": { + "$ref": "Object" + }, + "response": { + "$ref": "Object" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "bulkRestore": { + "id": "storage.objects.bulkRestore", + "path": "b/{bucket}/o/bulkRestore", + "httpMethod": "POST", + "description": "Initiates a long-running bulk restore operation on the specified bucket.", + "parameters": { + "bucket": { + "type": "string", + "description": "Name of the bucket in which the object resides.", + "required": true, + "location": "path" + } + }, + "parameterOrder": [ + "bucket" + ], + "request": { + "$ref": "BulkRestoreObjectsRequest" + }, + "response": { + "$ref": "GoogleLongrunningOperation" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } - }, - "projects": { - "resources": { - "hmacKeys": { - "methods": { - "create": { - "id": "storage.projects.hmacKeys.create", - "path": "projects/{projectId}/hmacKeys", - "httpMethod": "POST", - "description": "Creates a new HMAC key for the specified service account.", - "parameters": { - "projectId": { - "type": "string", - "description": "Project ID owning the service account.", - "required": true, - "location": "path" - }, - "serviceAccountEmail": { - "type": "string", - "description": "Email address of the service account.", - "required": true, - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + } + }, + "projects": { + "resources": { + "hmacKeys": { + "methods": { + "create": { + "id": "storage.projects.hmacKeys.create", + "path": "projects/{projectId}/hmacKeys", + "httpMethod": "POST", + "description": "Creates a new HMAC key for the specified service account.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID owning the service account.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "projectId", - "serviceAccountEmail" - ], - "response": { - "$ref": "HmacKey" + "serviceAccountEmail": { + "type": "string", + "description": "Email address of the service account.", + "required": true, + "location": "query" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } }, - "delete": { - "id": "storage.projects.hmacKeys.delete", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "DELETE", - "description": "Deletes an HMAC key.", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key to be deleted.", - "required": true, - "location": "path" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the requested key", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } - }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_write" - ] + "parameterOrder": [ + "projectId", + "serviceAccountEmail" + ], + "response": { + "$ref": "HmacKey" }, - "get": { - "id": "storage.projects.hmacKeys.get", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "GET", - "description": "Retrieves an HMAC key's metadata", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key.", - "required": true, - "location": "path" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account of the requested key.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + }, + "delete": { + "id": "storage.projects.hmacKeys.delete", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "DELETE", + "description": "Deletes an HMAC key.", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key to be deleted.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "response": { - "$ref": "HmacKeyMetadata" + "projectId": { + "type": "string", + "description": "Project ID owning the requested key", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } }, - "list": { - "id": "storage.projects.hmacKeys.list", - "path": "projects/{projectId}/hmacKeys", - "httpMethod": "GET", - "description": "Retrieves a list of HMAC keys matching the criteria.", - "parameters": { - "maxResults": { - "type": "integer", - "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", - "default": "250", - "format": "uint32", - "minimum": "0", - "location": "query" - }, - "pageToken": { - "type": "string", - "description": "A previously-returned page token representing part of the larger set of results to view.", - "location": "query" - }, - "projectId": { - "type": "string", - "description": "Name of the project in which to look for HMAC keys.", - "required": true, - "location": "path" - }, - "serviceAccountEmail": { - "type": "string", - "description": "If present, only keys for the given service account are returned.", - "location": "query" - }, - "showDeletedKeys": { - "type": "boolean", - "description": "Whether or not to show keys in the DELETED state.", - "location": "query" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + "parameterOrder": [ + "projectId", + "accessId" + ], + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_write" + ] + }, + "get": { + "id": "storage.projects.hmacKeys.get", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "GET", + "description": "Retrieves an HMAC key's metadata", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "HmacKeysMetadata" + "projectId": { + "type": "string", + "description": "Project ID owning the service account of the requested key.", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only" - ] + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } }, - "update": { - "id": "storage.projects.hmacKeys.update", - "path": "projects/{projectId}/hmacKeys/{accessId}", - "httpMethod": "PUT", - "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", - "parameters": { - "accessId": { - "type": "string", - "description": "Name of the HMAC key being updated.", - "required": true, - "location": "path" - }, - "projectId": { - "type": "string", - "description": "Project ID owning the service account of the updated key.", - "required": true, - "location": "path" - }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + "parameterOrder": [ + "projectId", + "accessId" + ], + "response": { + "$ref": "HmacKeyMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "list": { + "id": "storage.projects.hmacKeys.list", + "path": "projects/{projectId}/hmacKeys", + "httpMethod": "GET", + "description": "Retrieves a list of HMAC keys matching the criteria.", + "parameters": { + "maxResults": { + "type": "integer", + "description": "Maximum number of items to return in a single page of responses. The service uses this parameter or 250 items, whichever is smaller. The max number of items per page will also be limited by the number of distinct service accounts in the response. If the number of service accounts in a single response is too high, the page will truncated and a next page token will be returned.", + "default": "250", + "format": "uint32", + "minimum": "0", + "location": "query" }, - "parameterOrder": [ - "projectId", - "accessId" - ], - "request": { - "$ref": "HmacKeyMetadata" + "pageToken": { + "type": "string", + "description": "A previously-returned page token representing part of the larger set of results to view.", + "location": "query" }, - "response": { - "$ref": "HmacKeyMetadata" + "projectId": { + "type": "string", + "description": "Name of the project in which to look for HMAC keys.", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/devstorage.full_control" - ] - } - } - }, - "serviceAccount": { - "methods": { - "get": { - "id": "storage.projects.serviceAccount.get", - "path": "projects/{projectId}/serviceAccount", - "httpMethod": "GET", - "description": "Get the email address of this project's Google Cloud Storage service account.", - "parameters": { - "projectId": { - "type": "string", - "description": "Project ID", - "required": true, - "location": "path" + "serviceAccountEmail": { + "type": "string", + "description": "If present, only keys for the given service account are returned.", + "location": "query" }, - "userProject": { - "type": "string", - "description": "The project to be billed for this request.", - "location": "query" - } + "showDeletedKeys": { + "type": "boolean", + "description": "Whether or not to show keys in the DELETED state.", + "location": "query" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "HmacKeysMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only" + ] + }, + "update": { + "id": "storage.projects.hmacKeys.update", + "path": "projects/{projectId}/hmacKeys/{accessId}", + "httpMethod": "PUT", + "description": "Updates the state of an HMAC key. See the HMAC Key resource descriptor for valid states.", + "parameters": { + "accessId": { + "type": "string", + "description": "Name of the HMAC key being updated.", + "required": true, + "location": "path" }, - "parameterOrder": [ - "projectId" - ], - "response": { - "$ref": "ServiceAccount" + "projectId": { + "type": "string", + "description": "Project ID owning the service account of the updated key.", + "required": true, + "location": "path" }, - "scopes": [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-platform.read-only", - "https://www.googleapis.com/auth/devstorage.full_control", - "https://www.googleapis.com/auth/devstorage.read_only", - "https://www.googleapis.com/auth/devstorage.read_write" - ] - } + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId", + "accessId" + ], + "request": { + "$ref": "HmacKeyMetadata" + }, + "response": { + "$ref": "HmacKeyMetadata" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/devstorage.full_control" + ] + } + } + }, + "serviceAccount": { + "methods": { + "get": { + "id": "storage.projects.serviceAccount.get", + "path": "projects/{projectId}/serviceAccount", + "httpMethod": "GET", + "description": "Get the email address of this project's Google Cloud Storage service account.", + "parameters": { + "projectId": { + "type": "string", + "description": "Project ID", + "required": true, + "location": "path" + }, + "userProject": { + "type": "string", + "description": "The project to be billed for this request.", + "location": "query" + } + }, + "parameterOrder": [ + "projectId" + ], + "response": { + "$ref": "ServiceAccount" + }, + "scopes": [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-platform.read-only", + "https://www.googleapis.com/auth/devstorage.full_control", + "https://www.googleapis.com/auth/devstorage.read_only", + "https://www.googleapis.com/auth/devstorage.read_write" + ] } } } } - }, - "revision": "20220718", - "etag": "\"33383537313931303639303633323338353436\"" + } + }, + "revision": "20231012", + "etag": "\"3133333835393639383131353638313238353437\"" } diff --git a/lib/Google/vendor/google/cloud-storage/src/HmacKey.php b/lib/Google/vendor/google/cloud-storage/src/HmacKey.php index e23f3de39..b64dd3d6c 100644 --- a/lib/Google/vendor/google/cloud-storage/src/HmacKey.php +++ b/lib/Google/vendor/google/cloud-storage/src/HmacKey.php @@ -34,6 +34,7 @@ class HmacKey { /** * @var ConnectionInterface + * @internal */ private $connection; @@ -54,6 +55,8 @@ class HmacKey /** * @param ConnectionInterface $connection A connection to Cloud Storage. + * This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param string $projectId The current project ID. * @param string $accessId The key identifier. * @param array|null $info The key metadata. @@ -170,7 +173,7 @@ public function update($state, array $options = []) * Delete the HMAC Key. * * Key state must be set to `INACTIVE` prior to deletion. See - * {@see Google\Cloud\Storage\HmacKey::update()} for details. + * {@see HmacKey::update()} for details. * * Example: * ``` diff --git a/lib/Google/vendor/google/cloud-storage/src/Lifecycle.php b/lib/Google/vendor/google/cloud-storage/src/Lifecycle.php index 14f45d0ab..88a9966a3 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Lifecycle.php +++ b/lib/Google/vendor/google/cloud-storage/src/Lifecycle.php @@ -26,8 +26,8 @@ * * This builder does not execute any network requests and is intended to be used * in combination with either - * {@see Google\Cloud\Storage\StorageClient::createBucket()} - * or {@see Google\Cloud\Storage\Bucket::update()}. + * {@see StorageClient::createBucket()} + * or {@see Bucket::update()}. * * Example: * ``` diff --git a/lib/Google/vendor/google/cloud-storage/src/Notification.php b/lib/Google/vendor/google/cloud-storage/src/Notification.php index 67ab58a5a..3caa2b128 100644 --- a/lib/Google/vendor/google/cloud-storage/src/Notification.php +++ b/lib/Google/vendor/google/cloud-storage/src/Notification.php @@ -30,7 +30,7 @@ * and the object that changed. * * To utilize this class and see more examples, please see the relevant - * notifications based methods exposed on {@see Google\Cloud\Storage\Bucket}. + * notifications based methods exposed on {@see Bucket}. * * Example: * ``` @@ -55,6 +55,7 @@ class Notification /** * @var ConnectionInterface Represents a connection to Cloud Storage. + * @internal */ private $connection; @@ -70,7 +71,8 @@ class Notification /** * @param ConnectionInterface $connection Represents a connection to Cloud - * Storage. + * Storage. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param string $id The notification's ID. * @param string $bucket The name of the bucket associated with this * notification. diff --git a/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php b/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php index 0490e3c3c..254bc5e70 100644 --- a/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php +++ b/lib/Google/vendor/google/cloud-storage/src/ObjectIterator.php @@ -20,7 +20,9 @@ use Google\Cloud\Core\Iterator\ItemIteratorTrait; /** - * Iterates over a set of {@see Google\Cloud\Storage\StorageObject} items. + * ObjectIterator + * + * Iterates over a set of {@see StorageObject} items. */ class ObjectIterator implements \Iterator { diff --git a/lib/Google/vendor/google/cloud-storage/src/ObjectPageIterator.php b/lib/Google/vendor/google/cloud-storage/src/ObjectPageIterator.php index 0d8afb3d9..11ba03dc4 100644 --- a/lib/Google/vendor/google/cloud-storage/src/ObjectPageIterator.php +++ b/lib/Google/vendor/google/cloud-storage/src/ObjectPageIterator.php @@ -20,8 +20,10 @@ use Google\Cloud\Core\Iterator\PageIteratorTrait; /** + * ObjectPageIterator + * * Iterates over a set of pages containing - * {@see Google\Cloud\Storage\StorageObject} items. + * {@see StorageObject} items. */ class ObjectPageIterator implements \Iterator { diff --git a/lib/Google/vendor/google/cloud-storage/src/ReadStream.php b/lib/Google/vendor/google/cloud-storage/src/ReadStream.php index 33e55094c..cfae74d8e 100644 --- a/lib/Google/vendor/google/cloud-storage/src/ReadStream.php +++ b/lib/Google/vendor/google/cloud-storage/src/ReadStream.php @@ -47,7 +47,7 @@ public function __construct(StreamInterface $stream) * * @return int The size of the stream. */ - public function getSize() + public function getSize(): ?int { return $this->stream->getSize() ?: $this->getSizeFromMetadata(); } @@ -58,7 +58,7 @@ public function getSize() * * @return int The Size of the stream */ - private function getSizeFromMetadata() + private function getSizeFromMetadata(): int { foreach ($this->stream->getMetadata('wrapper_data') as $value) { if (substr($value, 0, 15) == "Content-Length:") { @@ -78,7 +78,7 @@ private function getSizeFromMetadata() * @param int $length The number of bytes to read. * @return string Read bytes from the underlying stream. */ - public function read($length) + public function read($length): string { $data = ''; do { diff --git a/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php b/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php index 33f6df6c9..bf48ab81f 100644 --- a/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php +++ b/lib/Google/vendor/google/cloud-storage/src/SigningHelper.php @@ -60,14 +60,15 @@ public static function getHelper() * Sign using the version inferred from `$options.version`. * * @param ConnectionInterface $connection A connection to the Cloud Storage - * API. + * API. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param Timestamp|\DateTimeInterface|int $expires The signed URL * expiration. * @param string $resource The URI to the storage resource, preceded by a * leading slash. * @param int|null $generation The resource generation. * @param array $options Configuration options. See - * {@see Google\Cloud\Storage\StorageObject::signedUrl()} for + * {@see StorageObject::signedUrl()} for * details. * @return string * @throws \InvalidArgumentException @@ -110,14 +111,15 @@ public function sign(ConnectionInterface $connection, $expires, $resource, $gene * This method will be deprecated in the future. * * @param ConnectionInterface $connection A connection to the Cloud Storage - * API. + * API. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param Timestamp|\DateTimeInterface|int $expires The signed URL * expiration. * @param string $resource The URI to the storage resource, preceded by a * leading slash. * @param int|null $generation The resource generation. * @param array $options Configuration options. See - * {@see Google\Cloud\Storage\StorageObject::signedUrl()} for + * {@see StorageObject::signedUrl()} for * details. * @return string * @throws \InvalidArgumentException @@ -206,14 +208,15 @@ public function v2Sign(ConnectionInterface $connection, $expires, $resource, $ge * Sign a storage URL using Google Signed URLs v4. * * @param ConnectionInterface $connection A connection to the Cloud Storage - * API. + * API. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param Timestamp|\DateTimeInterface|int $expires The signed URL * expiration. * @param string $resource The URI to the storage resource, preceded by a * leading slash. * @param int|null $generation The resource generation. * @param array $options Configuration options. See - * {@see Google\Cloud\Storage\StorageObject::signedUrl()} for + * {@see StorageObject::signedUrl()} for * details. * @return string * @throws \InvalidArgumentException @@ -362,12 +365,14 @@ public function v4Sign(ConnectionInterface $connection, $expires, $resource, $ge * Create an HTTP POST policy using v4 signing. * * @param ConnectionInterface $connection A Connection to Google Cloud Storage. + * This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param Timestamp|\DateTimeInterface|int $expires The signed URL * expiration. * @param string $resource The URI to the storage resource, preceded by a * leading slash. * @param array $options Configuration options. See - * {@see Google\Cloud\Storage\Bucket::generateSignedPostPolicyV4()} for details. + * {@see Bucket::generateSignedPostPolicyV4()} for details. * @return array An associative array, containing (string) `uri` and * (array) `fields` keys. */ @@ -780,6 +785,8 @@ private function normalizeCanonicalRequestResource($resource, $bucketBoundHostna * Get the credentials for use with signing. * * @param ConnectionInterface $connection A Storage connection object. + * This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param array $options Configuration options. * @return array A list containing a credentials object at index 0 and the * modified options at index 1. diff --git a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php index 723c1a0b3..8613e0a5e 100644 --- a/lib/Google/vendor/google/cloud-storage/src/StorageClient.php +++ b/lib/Google/vendor/google/cloud-storage/src/StorageClient.php @@ -47,7 +47,7 @@ class StorageClient use ArrayTrait; use ClientTrait; - const VERSION = '1.31.2'; + const VERSION = '1.34.0'; const FULL_CONTROL_SCOPE = 'https://www.googleapis.com/auth/devstorage.full_control'; const READ_ONLY_SCOPE = 'https://www.googleapis.com/auth/devstorage.read_only'; @@ -73,6 +73,7 @@ class StorageClient /** * @var ConnectionInterface Represents a connection to Storage. + * @internal */ protected $connection; @@ -126,9 +127,10 @@ public function __construct(array $config = []) } /** - * Lazily instantiates a bucket. There are no network requests made at this - * point. To see the operations that can be performed on a bucket please - * see {@see Google\Cloud\Storage\Bucket}. + * Lazily instantiates a bucket. + * + * There are no network requests made at this point. To see the operations + * that can be performed on a bucket please see {@see Bucket}. * * If `$userProject` is set to true, the current project ID (used to * instantiate the client) will be billed for all requests. If @@ -306,6 +308,8 @@ function (array $bucket) use ($userProject) { * Buckets can have either StorageClass OLM rules or Autoclass, * but not both. When Autoclass is enabled on a bucket, adding * StorageClass OLM rules will result in failure. + * For more information, refer to + * [Storage Autoclass](https://cloud.google.com/storage/docs/autoclass) * @type array $versioning The bucket's versioning configuration. * @type array $website The bucket's website configuration. * @type array $billing The bucket's billing configuration. @@ -335,7 +339,7 @@ function (array $bucket) use ($userProject) { * occurs, signified by the hold's release. * @type array $retentionPolicy Defines the retention policy for a * bucket. In order to lock a retention policy, please see - * {@see Google\Cloud\Storage\Bucket::lockRetentionPolicy()}. + * {@see Bucket::lockRetentionPolicy()}. * @type int $retentionPolicy.retentionPeriod Specifies the retention * period for objects in seconds. During the retention period an * object cannot be overwritten or deleted. Retention period must @@ -415,7 +419,7 @@ public function unregisterStreamWrapper($protocol = null) * @param string $uri The URI to accept an upload request. * @param string|resource|StreamInterface $data The data to be uploaded * @param array $options [optional] Configuration Options. Refer to - * {@see Google\Cloud\Core\Upload\AbstractUploader::__construct()}. + * {@see \Google\Cloud\Core\Upload\AbstractUploader::__construct()}. * @return SignedUrlUploader */ public function signedUrlUploader($uri, $data, array $options = []) diff --git a/lib/Google/vendor/google/cloud-storage/src/StorageObject.php b/lib/Google/vendor/google/cloud-storage/src/StorageObject.php index c910aa2e6..724782b3b 100644 --- a/lib/Google/vendor/google/cloud-storage/src/StorageObject.php +++ b/lib/Google/vendor/google/cloud-storage/src/StorageObject.php @@ -57,6 +57,7 @@ class StorageObject /** * @var ConnectionInterface Represents a connection to Cloud Storage. + * @internal */ protected $connection; @@ -77,7 +78,8 @@ class StorageObject /** * @param ConnectionInterface $connection Represents a connection to Cloud - * Storage. + * Storage. This object is created by StorageClient, + * and should not be instantiated outside of this client. * @param string $name The object's name. * @param string $bucket The name of the bucket the object is contained in. * @param string $generation [optional] The generation of the object. @@ -546,7 +548,7 @@ public function rename($name, array $options = []) * Download an object as a string. * * For an example of setting the range header to download a subrange of the - * object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}. + * object please see {@see StorageObject::downloadAsStream()}. * * Example: * ``` @@ -580,7 +582,7 @@ public function downloadAsString(array $options = []) * Download an object to a specified location. * * For an example of setting the range header to download a subrange of the - * object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}. + * object please see {@see StorageObject::downloadAsStream()}. * * Example: * ``` @@ -684,7 +686,7 @@ public function downloadAsStream(array $options = []) * Asynchronously download an object as a stream. * * For an example of setting the range header to download a subrange of the - * object please see {@see Google\Cloud\Storage\StorageObject::downloadAsStream()}. + * object please see {@see StorageObject::downloadAsStream()}. * * Example: * ``` @@ -700,7 +702,7 @@ public function downloadAsStream(array $options = []) * * ``` * // Download all objects in a bucket asynchronously. - * use GuzzleHttp\Promise; + * use GuzzleHttp\Promise\Utils; * use Psr\Http\Message\StreamInterface; * * $promises = []; @@ -712,7 +714,7 @@ public function downloadAsStream(array $options = []) * }); * } * - * Promise\unwrap($promises); + * Utils::unwrap($promises); * ``` * * @see https://cloud.google.com/storage/docs/json_api/v1/objects/get Objects get API documentation. @@ -763,10 +765,10 @@ public function downloadAsStreamAsync(array $options = []) * Token Creator" IAM role. * * Additionally, signing using IAM requires different scopes. When creating - * an instance of {@see Google\Cloud\Storage\StorageClient}, provide the + * an instance of {@see StorageClient}, provide the * `https://www.googleapis.com/auth/cloud-platform` scopein `$options.scopes`. * This scope may be used entirely in place of the scopes provided in - * {@see Google\Cloud\Storage\StorageClient}. + * {@see StorageClient}. * * App Engine and Compute Engine will attempt to sign URLs using IAM. * @@ -811,7 +813,7 @@ public function downloadAsStreamAsync(array $options = []) * @see https://cloud.google.com/storage/docs/access-control/signed-urls Signed URLs * * @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL - * will expire. May provide an instance of {@see Google\Cloud\Core\Timestamp}, + * will expire. May provide an instance of {@see \Google\Cloud\Core\Timestamp}, * [http://php.net/datetimeimmutable](`\DateTimeImmutable`), or a * UNIX timestamp as an integer. * @param array $options { @@ -904,7 +906,7 @@ public function signedUrl($expires, array $options = []) /** * Create a Signed Upload URL for this object. * - * This method differs from {@see Google\Cloud\Storage\StorageObject::signedUrl()} + * This method differs from {@see StorageObject::signedUrl()} * in that it allows you to initiate a new resumable upload session. This * can be used to allow non-authenticated users to insert an object into a * bucket. @@ -915,7 +917,7 @@ public function signedUrl($expires, array $options = []) * more information. * * If you prefer to skip this initial step, you may find - * {@see Google\Cloud\Storage\StorageObject::beginSignedUploadSession()} to + * {@see StorageObject::beginSignedUploadSession()} to * fit your needs. Note that `beginSignedUploadSession()` cannot be used * with Google Cloud PHP's Signed URL Uploader, and does not support a * configurable expiration date. @@ -933,7 +935,7 @@ public function signedUrl($expires, array $options = []) * ``` * * @param Timestamp|\DateTimeInterface|int $expires Specifies when the URL - * will expire. May provide an instance of {@see Google\Cloud\Core\Timestamp}, + * will expire. May provide an instance of {@see \Google\Cloud\Core\Timestamp}, * [http://php.net/datetimeimmutable](`\DateTimeImmutable`), or a * UNIX timestamp as an integer. * @param array $options { @@ -1014,7 +1016,7 @@ public function signedUploadUrl($expires, array $options = []) * Create a signed URL upload session. * * The returned URL differs from the return value of - * {@see Google\Cloud\Storage\StorageObject::signedUploadUrl()} in that it + * {@see StorageObject::signedUploadUrl()} in that it * is ready to accept upload data immediately via an HTTP PUT request. * * Because an upload session is created by the client, the expiration date diff --git a/lib/Google/vendor/google/cloud-storage/src/WriteStream.php b/lib/Google/vendor/google/cloud-storage/src/WriteStream.php index c78bcc91a..ba5d07fbc 100644 --- a/lib/Google/vendor/google/cloud-storage/src/WriteStream.php +++ b/lib/Google/vendor/google/cloud-storage/src/WriteStream.php @@ -60,7 +60,7 @@ public function __construct(AbstractUploader $uploader = null, $options = []) /** * Close the stream. Uploads any remaining data. */ - public function close() + public function close(): void { if ($this->uploader && $this->hasWritten) { $this->uploader->upload(); @@ -75,7 +75,7 @@ public function close() * @return int The number of bytes written * @throws \RuntimeException */ - public function write($data) + public function write($data): int { if (!isset($this->uploader)) { throw new \RuntimeException("No uploader set."); @@ -98,12 +98,12 @@ public function write($data) * * @param AbstractUploader $uploader The new uploader to use. */ - public function setUploader($uploader) + public function setUploader($uploader): void { $this->uploader = $uploader; } - private function getChunkedWriteSize() + private function getChunkedWriteSize(): int { return (int) floor($this->getSize() / $this->chunkSize) * $this->chunkSize; } diff --git a/lib/Google/vendor/google/crc32/.github/workflows/test.yml b/lib/Google/vendor/google/crc32/.github/workflows/test.yml deleted file mode 100644 index d5a072b40..000000000 --- a/lib/Google/vendor/google/crc32/.github/workflows/test.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: PHP CRC32 - -on: [push] - -jobs: - lint: - runs-on: ubuntu-latest - strategy: - matrix: - # No need to lint on every version, so pin this to the most recent version. - php-version: ['8.2'] - - steps: - - uses: actions/checkout@v3 - - - name: Setup PHP ${{ matrix.php-version }} with tools - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: php-cs-fixer - - - name: Lint - run: make lint - - test: - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest] - php-version: ['7.4', '8.0', '8.1', '8.2'] - - steps: - - uses: actions/checkout@v3 - - - name: Setup PHP ${{ matrix.php-version }} with tools - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php-version }} - tools: phpunit phpize php-config - - - name: Install dependencies - run: composer install --prefer-dist - - - name: Test - run: make test diff --git a/lib/Google/vendor/google/crc32/.gitignore b/lib/Google/vendor/google/crc32/.gitignore deleted file mode 100644 index c9860255d..000000000 --- a/lib/Google/vendor/google/crc32/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -vendor -.php_cs.cache -ext/.deps -ext/crc32c -*~ -composer.lock diff --git a/lib/Google/vendor/google/crc32/CONTRIBUTING.md b/lib/Google/vendor/google/crc32/CONTRIBUTING.md deleted file mode 100644 index ae4e04324..000000000 --- a/lib/Google/vendor/google/crc32/CONTRIBUTING.md +++ /dev/null @@ -1,28 +0,0 @@ -# How to Contribute - -We'd love to accept your patches and contributions to this project. There are -just a few small guidelines you need to follow. - -## Contributor License Agreement - -Contributions to this project must be accompanied by a Contributor License -Agreement. You (or your employer) retain the copyright to your contribution; -this simply gives us permission to use and redistribute your contributions as -part of the project. Head over to to see -your current agreements on file or to sign a new one. - -You generally only need to submit a CLA once, so if you've already submitted one -(even if it was for a different project), you probably don't need to do it -again. - -## Code reviews - -All submissions, including submissions by project members, require review. We -use GitHub pull requests for this purpose. Consult -[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more -information on using pull requests. - -## Community Guidelines - -This project follows [Google's Open Source Community -Guidelines](https://opensource.google.com/conduct/). \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/LICENSE b/lib/Google/vendor/google/crc32/LICENSE deleted file mode 100644 index 261eeb9e9..000000000 --- a/lib/Google/vendor/google/crc32/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/lib/Google/vendor/google/crc32/Makefile b/lib/Google/vendor/google/crc32/Makefile deleted file mode 100644 index 8bd47ccc6..000000000 --- a/lib/Google/vendor/google/crc32/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -## -# Copyright 2019 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## - -.PHONY : all clean benchmark test test_all lint ext ext_test - -COMPOSER ?= composer -PHP_CS_FIXER ?= vendor/bin/php-cs-fixer -PHP_UNIT ?= vendor/bin/phpunit - -PHP_BIN ?= $(shell php-config --prefix)/bin -PHP ?= $(PHP_BIN)/php -PHP_CONFIG ?= $(PHP_BIN)/php-config -PHPIZE ?= $(PHP_BIN)/phpize - -all: lint test - -clean: - -rm -r .php_cs.cache - $(MAKE) -C ext clean - -vendor: composer.lock -composer.lock: composer.json - $(COMPOSER) update - touch composer.lock - -lint: vendor - $(PHP_CS_FIXER) fix --dry-run --diff src - $(PHP_CS_FIXER) fix --dry-run --diff crc32_benchmark.php - $(PHP_CS_FIXER) fix --dry-run --diff tests - $(PHP_CS_FIXER) fix --dry-run --diff ext/tests - -benchmark: ext vendor - $(PHP) -d extension=ext/modules/crc32c.so crc32_benchmark.php - -test: ext vendor - $(PHP) -v - $(PHP) -d extension=ext/modules/crc32c.so $(PHP_UNIT) tests/ - -# Test all the local versions of PHP -test_all: - for phpize in $$(ls $$(brew --prefix)/Cellar/php*/*/bin/phpize); do \ - NO_INTERACTION=1 \ - PHP_BIN=$$(dirname $$phpize) \ - $(MAKE) clean test; \ - done - -ext: ext/modules/crc32c.so - -ext_test: ext - NO_INTERACTION=1 $(MAKE) -C ext test - -ext/modules/crc32c.so: ext/hash_crc32c.c ext/php_crc32c.c ext/php_crc32c.h - cd ext && \ - ./install_crc32c.sh && \ - $(PHPIZE) && \ - ./configure \ - --with-php-config=$(PHP_CONFIG) && \ - $(MAKE) diff --git a/lib/Google/vendor/google/crc32/README.md b/lib/Google/vendor/google/crc32/README.md deleted file mode 100644 index c2bbc58e3..000000000 --- a/lib/Google/vendor/google/crc32/README.md +++ /dev/null @@ -1,138 +0,0 @@ -# php-crc32 - -![Build Status](https://github.com/google/php-crc32/actions/workflows/test.yml/badge.svg) - -by [Andrew Brampton](https://bramp.net) - -**Deprecated**: Since PHP 8.0, the crc32 algorithms within PHP are using [hardware accelerated instructions](https://github.com/php/php-src/commit/c3299d7dab15aeed52a34535f1967d426f5327de), and are surprisingly fast. Thus this extension is not needed anymore! - -CRC32 implementations, that support all crc32 polynomials, as well as (if you -install the pecl extension) hardware accelerated versions of CRC32C (Castagnoli). - -Supports PHP 7.4 though PHP 8.2. Older PHP versions are supported with "v0.1.0". - -# Usage - -```php -require 'vendor/autoload.php'; - -use Google\CRC32\CRC32; - -$crc = CRC32::create(CRC32::CASTAGNOLI); -$crc->update('hello'); -echo $crc->hash(); -``` - -Depending on the environment and the polynomial, `CRC32::create` will choose -the fastest available version, and return one of the following classes: - -* `Google\CRC32\PHP` - A pure PHP implementation. -* `Google\CRC32\Builtin` - A [PHP Hash framework](http://php.net/manual/en/book.hash.php) implementation. -* `Google\CRC32\Google` - A hardware accelerated implementation (using [google/crc32c](https://github.com/google/crc32c)). - -When reading 1M byte chunks, using `CRC32::CASTAGNOLI` with PHP 7.4 on a 2014 Macbook Pro we get the following performance (higher is better): - -``` -Google\CRC32\PHP 12.27 MB/s -Google\CRC32\Builtin 468.74 MB/s (available since PHP 7.4) -Google\CRC32\Google 24,684.46 MB/s (using crc32c.so) -``` - -# Install - -```shell -$ composer require google/crc32 -``` - -# crc32c.so - -To use the hardware accelerated, a custom PHP extension must be installed. This makes use of [google/crc32c](https://github.com/google/crc32c) which provides a highly optomised `CRC32C` (Castagnoli) implementation using the SSE 4.2 instruction set of Intel CPUs. - -The extension can be installed from pecl, or compiled from stratch. - -```shell -TODO pecl install crc32c -``` - -Once installed or compiled, you'll need to add `extension=crc32c.so` to your php.ini file. - -## Compile (Linux / Mac) - -Ensure that [composer](https://getcomposer.org), build tools (e.g [build-essential](https://packages.debian.org/sid/devel/build-essential), [cmake](https://packages.debian.org/sid/devel/cmake), etc), and php dev headers (e.g [php-dev](https://packages.debian.org/sid/php/php-dev)) are installed. - -Simple (using Makefile): - -```shell -make test -``` - -Alternatively (manually): - -```shell -cd ext - -# Install the google/crc32c library -./install_crc32c.sh # From source (recommended) - -# or use your favorite package manager, e.g. -# brew install crc32c - -# Prepare the build environment -phpize -./configure - -# or if using a custom crc32c -# ./configure --with-crc32c=$(brew --prefix crc32c) - -## Build and test -make test -``` - -The extension will now be at `ext/modules/crc32c.so`. This file should be copied to your [extension directory](https://php.net/extension-dir) and reference in your php.ini. - -``` -# php.ini -extension=crc32c.so -``` - -## Testing - -`make test` will test with the current PHP. `make test_all` will search for available -PHP installs, and test with all of them. - -## Benchmark - -To compare the performance of the different `CRC32C` implementations, run `make benchmark`. - -# Related - -* https://bugs.php.net/bug.php?id=71890 - -# TODO - -- [ ] Test if this works on 32 bit machine. -- [x] Add php unit (or similar) testing. -- [x] Publish to packagist -- [ ] Publish to pecl (https://pecl.php.net/account-request.php) -- [x] Update instructions for linux. - - -# Licence (Apache 2) - -*This is not an official Google product (experimental or otherwise), it is just code that happens to be owned by Google.* - -``` -Copyright 2023 Google Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -``` diff --git a/lib/Google/vendor/google/crc32/composer.json b/lib/Google/vendor/google/crc32/composer.json deleted file mode 100644 index a253cd7e4..000000000 --- a/lib/Google/vendor/google/crc32/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "google/crc32", - "description": "Various CRC32 implementations", - "homepage": "https://github.com/google/php-crc32", - "type": "library", - "license": "Apache-2.0", - "authors": [ - { - "name": "Andrew Brampton", - "email": "bramp@google.com" - } - ], - "require": { - "php": ">=7.4" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "v3.15", - "phpunit/phpunit": "^9" - }, - "autoload": { - "psr-4": { - "Google\\CRC32\\": "src" - } - } -} diff --git a/lib/Google/vendor/google/crc32/crc32_benchmark.php b/lib/Google/vendor/google/crc32/crc32_benchmark.php deleted file mode 100644 index 065bdc275..000000000 --- a/lib/Google/vendor/google/crc32/crc32_benchmark.php +++ /dev/null @@ -1,112 +0,0 @@ -update($chunk); - - $i++; - $now = microtime(true); - $duration = ($now - $start); - - if ($duration >= max_duration) { - break; - } - if ($duration >= min_duration && $i >= min_iterations) { - break; - } - } - - // Very quick sanity check - if ($crc->hash() == '00000000') { - exit($name . ' crc check failed'); - } - - - $bytes = $i * $chunk_size; - - echo sprintf("%s\t%10d\t%5d\t%8.2f MB/s\n", $name, $chunk_size, $i, $bytes / ($now - $start) / 1000000); -} - -foreach (array(256, 4096, 1048576, 16777216) as $chunk_size) { - test(new PHP(CRC32::CASTAGNOLI), $chunk_size); - //test(new PHPSlicedBy4(CRC32::CASTAGNOLI), $chunk_size); - test(new Builtin(CRC32::CASTAGNOLI), $chunk_size); - test(new Google(), $chunk_size); -} diff --git a/lib/Google/vendor/google/crc32/ext/.gitignore b/lib/Google/vendor/google/crc32/ext/.gitignore deleted file mode 100644 index 91bef2522..000000000 --- a/lib/Google/vendor/google/crc32/ext/.gitignore +++ /dev/null @@ -1,35 +0,0 @@ -*.lo -*.la -.libs -acinclude.m4 -aclocal.m4 -autom4te.cache -build -config.guess -config.h -config.h.in -config.log -config.nice -config.status -config.sub -configure -configure.ac -configure.in -include -install-sh -libtool -ltmain.sh -Makefile -Makefile.fragments -Makefile.global -Makefile.objects -missing -mkinstalldirs -modules -run-tests.php -tests/*/*.diff -tests/*/*.out -tests/*/*.php -tests/*/*.exp -tests/*/*.log -tests/*/*.sh diff --git a/lib/Google/vendor/google/crc32/ext/config.m4 b/lib/Google/vendor/google/crc32/ext/config.m4 deleted file mode 100644 index c3d3d2e89..000000000 --- a/lib/Google/vendor/google/crc32/ext/config.m4 +++ /dev/null @@ -1,63 +0,0 @@ -dnl Copyright 2019 Google Inc. All Rights Reserved. -dnl -dnl Licensed under the Apache License, Version 2.0 (the "License"); -dnl you may not use this file except in compliance with the License. -dnl You may obtain a copy of the License at -dnl -dnl http://www.apache.org/licenses/LICENSE-2.0 -dnl -dnl Unless required by applicable law or agreed to in writing, software -dnl distributed under the License is distributed on an "AS-IS" BASIS, -dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -dnl See the License for the specific language governing permissions and -dnl limitations under the License. -dnl - -PHP_ARG_WITH(crc32c, for crc32c support, -[ --with-crc32c[=DIR] Include crc32c support. File is the optional path to google/crc32c]) - -if test "$PHP_CRC32C" != "no"; then - PHP_REQUIRE_CXX() # The external crc32c library uses C++. - - if test -r $PHP_CRC32C/; then - SEARCH_PATH=$PHP_CRC32C - else - SEARCH_PATH="$PWD/crc32c/build /usr/local /usr" - fi - - - AC_MSG_CHECKING([for crc32c files]) - SEARCH_FOR="include/crc32c/crc32c.h" - - for i in $SEARCH_PATH ; do - if test -r $i/$SEARCH_FOR; then - CRC32C_DIR=$i - AC_MSG_RESULT(found in $i) - fi - done - - # --with-crc32c -> check with-path - if test -z "$CRC32C_DIR"; then - AC_MSG_RESULT([not found]) - AC_MSG_ERROR([Please install the google/crc32c package, and use --with-crc32c]) - fi - - # --with-crc32c -> add include path - PHP_ADD_INCLUDE($CRC32C_DIR/include) - - # --with-crc32c -> check for lib and symbol presence - LIBNAME=crc32c - LIBSYMBOL=crc32c_extend - - PHP_CHECK_LIBRARY($LIBNAME, $LIBSYMBOL, - [ - PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $CRC32C_DIR/$PHP_LIBDIR, CRC32C_SHARED_LIBADD) - ],[ - AC_MSG_FAILURE([wrong crc32c lib version or lib not found]) - ],[ - -L$CRC32C_DIR/$PHP_LIBDIR -lm - ]) - - PHP_SUBST(CRC32C_SHARED_LIBADD) - PHP_NEW_EXTENSION(crc32c, hash_crc32c.c php_crc32c.c, $ext_shared, , -Wall -Werror) -fi diff --git a/lib/Google/vendor/google/crc32/ext/hash_crc32c.c b/lib/Google/vendor/google/crc32/ext/hash_crc32c.c deleted file mode 100644 index a622a1c6f..000000000 --- a/lib/Google/vendor/google/crc32/ext/hash_crc32c.c +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Copyright 2019 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * crc32c hash extension for PHP - * - * This file contains the crc32c hash function for - * http://php.net/manual/en/function.hash.php - */ -#include "php_crc32c.h" - -#include "ext/hash/php_hash.h" -#include "ext/hash/php_hash_crc32.h" - -#include "crc32c/crc32c.h" - -PHP_HASH_API void CRC32CInit(PHP_CRC32_CTX *context -#if PHP_API_VERSION >= 20201213 -, ZEND_ATTRIBUTE_UNUSED HashTable *args -#endif -) -{ - context->state = 0; -} - -PHP_HASH_API void CRC32CUpdate(PHP_CRC32_CTX *context, const unsigned char *input, size_t len) -{ - context->state = crc32c_extend(context->state, input, len); -} - -PHP_HASH_API void CRC32CFinal(uint8_t crc[4], PHP_CRC32_CTX *context) -{ - int2byte(context->state, crc); - context->state = 0; -} - -PHP_HASH_API int CRC32CCopy(const php_hash_ops *ops, PHP_CRC32_CTX *orig_context, PHP_CRC32_CTX *copy_context) -{ - copy_context->state = orig_context->state; - return SUCCESS; -} - -const php_hash_ops crc32_ops = { -#if PHP_API_VERSION >= 20200620 - "crc32c", -#endif - (php_hash_init_func_t) CRC32CInit, - (php_hash_update_func_t) CRC32CUpdate, - (php_hash_final_func_t) CRC32CFinal, - (php_hash_copy_func_t) CRC32CCopy, -#if PHP_API_VERSION >= 20200620 - php_hash_serialize, - php_hash_unserialize, - PHP_CRC32_SPEC, -#endif - 4, /* what to say here? */ - 4, - sizeof(PHP_CRC32_CTX), -#if PHP_API_VERSION >= 20170718 - 0 -#endif -}; \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/ext/install_crc32c.sh b/lib/Google/vendor/google/crc32/ext/install_crc32c.sh deleted file mode 100755 index 96b27c52d..000000000 --- a/lib/Google/vendor/google/crc32/ext/install_crc32c.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh -# Used to build and install the google/crc32c library. - -## -# Copyright 2019 Google Inc. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -## - -git clone https://github.com/google/crc32c - -cd crc32c -git submodule update --init --recursive - -mkdir build -cd build -cmake -DCRC32C_BUILD_TESTS=0 \ - -DCRC32C_BUILD_BENCHMARKS=0 \ - -DCRC32C_USE_GLOG=0 \ - -DBUILD_SHARED_LIBS=0 \ - -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \ - -DCMAKE_INSTALL_PREFIX:PATH=$PWD \ - .. -cmake --build . --target install diff --git a/lib/Google/vendor/google/crc32/ext/php_crc32c.c b/lib/Google/vendor/google/crc32/ext/php_crc32c.c deleted file mode 100644 index ba08657be..000000000 --- a/lib/Google/vendor/google/crc32/ext/php_crc32c.c +++ /dev/null @@ -1,174 +0,0 @@ -/** - * Copyright 2019 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * crc32c extension for PHP - * - * This file sets up the crc32c module, and provide the 'crc32c' function. - */ - -#include "php_crc32c.h" - -#include "ext/hash/php_hash.h" -#include "ext/standard/info.h" - -#include "crc32c/crc32c.h" - -extern const php_hash_ops crc32_ops; - -static uint32_t byte2int(const uint8_t hash[4]) { - return (hash[0] << 24) | (hash[1] << 16) | (hash[2] << 8) | hash[3]; -} - -/* {{{ int crc32c( string $data [, int $crc ] ) - */ -PHP_FUNCTION(crc32c) -{ - char *data_arg = NULL; - size_t data_len = 0; - char *crc_arg = NULL; - size_t crc_len = 0; - -#if PHP_API_VERSION >= 20151012 /* >= PHP 7.0 */ - // fast_zpp is a faster way to parse paramters. - ZEND_PARSE_PARAMETERS_START(1, 2) - Z_PARAM_STRING(data_arg, data_len) - Z_PARAM_OPTIONAL - Z_PARAM_STRING_EX(crc_arg, crc_len, /* check_null */ 1, 0) - ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); -#else - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|s!", &data_arg, &data_len, &crc_arg, &crc_len) == FAILURE) { - RETURN_BOOL(false); - } -#endif - - uint32_t crc = 0; - - if (crc_len == 4) { - crc = byte2int((uint8_t *)crc_arg); - - } else if (crc_arg != NULL) { - zend_error(E_WARNING, "crc32c(): Supplied crc must be a 4 byte string"); - RETURN_BOOL(false); - } - - crc = crc32c_extend(crc, (const uint8_t *)data_arg, data_len); - - uint8_t hash[4]; - int2byte(crc, hash); - -#if PHP_API_VERSION >= 20151012 /* >= PHP 7.0 */ - RETURN_STRINGL((const char *)hash, sizeof(hash)); -#else - RETURN_STRINGL((const char *)hash, sizeof(hash), /* dup */ 1); -#endif -} -/* }}}*/ - - -/* {{{ PHP_RINIT_FUNCTION - */ -PHP_RINIT_FUNCTION(crc32c) -{ -#if PHP_VERSION_ID >= 70000 -# if defined(ZTS) && defined(COMPILE_DL_CRC32C) - ZEND_TSRMLS_CACHE_UPDATE(); -# endif -#endif - - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINIT_FUNCTION - */ -PHP_MINIT_FUNCTION(crc32c) -{ - php_hash_register_algo("crc32c", &crc32_ops); - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MSHUTDOWN_FUNCTION - */ -PHP_MSHUTDOWN_FUNCTION(crc32c) -{ - // TODO Unregister php_hash_register_algo - return SUCCESS; -} -/* }}} */ - -/* {{{ PHP_MINFO_FUNCTION - */ -PHP_MINFO_FUNCTION(crc32c) -{ - php_info_print_table_start(); - php_info_print_table_header(2, "Google CRC32C support", "enabled"); - php_info_print_table_end(); -} -/* }}} */ - -/* {{{ arginfo - */ -ZEND_BEGIN_ARG_INFO_EX(arginfo_crc32c, 0, 0, 1) - ZEND_ARG_INFO(0, str) - ZEND_ARG_INFO(0, crc) -ZEND_END_ARG_INFO() -/* }}} */ - -/* {{{ crc32c_functions[] - */ -static const zend_function_entry crc32c_functions[] = { - PHP_FE(crc32c, arginfo_crc32c) - PHP_FE_END -}; -/* }}} */ - -/* {{{ crc32c_deps - */ -static const zend_module_dep crc32c_deps[] = { - ZEND_MOD_REQUIRED("hash") - ZEND_MOD_END -}; -/* }}} */ - -/* {{{ crc32c_module_entry - */ -zend_module_entry crc32c_module_entry = { - STANDARD_MODULE_HEADER_EX, NULL, - crc32c_deps, /* Module dependencies */ - "crc32c", /* Extension name */ - crc32c_functions, /* zend_function_entry */ - PHP_MINIT(crc32c), /* PHP_MINIT - Module initialization */ - PHP_MSHUTDOWN(crc32c), /* PHP_MSHUTDOWN - Module shutdown */ - PHP_RINIT(crc32c), /* PHP_RINIT - Request initialization */ - NULL, /* PHP_RSHUTDOWN - Request shutdown */ - PHP_MINFO(crc32c), /* PHP_MINFO - Module info */ - PHP_CRC32C_VERSION, /* Version */ - STANDARD_MODULE_PROPERTIES -}; -/* }}} */ - -#ifdef COMPILE_DL_CRC32C - -# if PHP_VERSION_ID >= 70000 -# ifdef ZTS -ZEND_TSRMLS_CACHE_DEFINE() -# endif -# endif /* PHP_VERSION_ID >= 70000 */ - -ZEND_GET_MODULE(crc32c) -#endif /* COMPILE_DL_CRC32C */ diff --git a/lib/Google/vendor/google/crc32/ext/php_crc32c.h b/lib/Google/vendor/google/crc32/ext/php_crc32c.h deleted file mode 100644 index 661d79f20..000000000 --- a/lib/Google/vendor/google/crc32/ext/php_crc32c.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * Copyright 2019 Google Inc. All Rights Reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/** - * crc32c extension for PHP - */ -#ifndef PHP_CRC32C_H -# define PHP_CRC32C_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include "php.h" - -#include -#include - -#ifdef ZTS -# include "TSRM.h" -#endif - -extern zend_module_entry crc32c_module_entry; - -# define PHP_CRC32C_VERSION "1.0.0" - -# if PHP_VERSION_ID >= 70000 -# if defined(ZTS) && defined(COMPILE_DL_CRC32C) -ZEND_TSRMLS_CACHE_EXTERN() -# endif -# endif - -static void int2byte(uint32_t i, uint8_t b[4]) { - b[0] = (uint8_t) ((i >> 24) & 0xff); - b[1] = (uint8_t) ((i >> 16) & 0xff); - b[2] = (uint8_t) ((i >> 8) & 0xff); - b[3] = (uint8_t) (i & 0xff); -} - -#endif /* PHP_CRC32C_H */ diff --git a/lib/Google/vendor/google/crc32/ext/tests/001_loaded.phpt b/lib/Google/vendor/google/crc32/ext/tests/001_loaded.phpt deleted file mode 100644 index 8787e9d40..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/001_loaded.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -crc32c() is loadable ---SKIPIF-- - ---FILE-- - ---EXPECT-- -The extension "crc32c" is available diff --git a/lib/Google/vendor/google/crc32/ext/tests/002_basic.phpt b/lib/Google/vendor/google/crc32/ext/tests/002_basic.phpt deleted file mode 100644 index 9d265b8b9..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/002_basic.phpt +++ /dev/null @@ -1,93 +0,0 @@ ---TEST-- -crc32c() basic tests ---SKIPIF-- - ---FILE-- -?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"), "\n"; -?> ---EXPECT-- -00000000 -c1d04330 -e2a22936 -364b3fb7 -92c80a31 -c450d697 -53bceff1 -e627f441 -0a9421b7 -2ddc99fc -e6599437 -9ee6ef25 -a245d57d -477a6781 -02bd79d0 -5e405e93 -516ad412 -b2cc01fe -0e28207f -be93f964 -9e3be0c3 -f505ef04 -85d3dc82 -c5142380 -75eb77dd -91ebe9f7 -f0b1168e -572b74e2 -8a58a6d5 -9c426c50 -735400a4 -bec49c95 -a95a2079 -de2e65c5 -297a88ed -66ed1d8b -dcded527 -9c44184b diff --git a/lib/Google/vendor/google/crc32/ext/tests/003_extend.phpt b/lib/Google/vendor/google/crc32/ext/tests/003_extend.phpt deleted file mode 100644 index e1d41046b..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/003_extend.phpt +++ /dev/null @@ -1,47 +0,0 @@ ---TEST-- -crc32c() extend tests ---SKIPIF-- - ---FILE-- - ---EXPECT-- -2c775665 -2c775665 -5e2b5be5 -319897cd -2f6298bc -86bd0651 -a245d57d -a245d57d \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/ext/tests/004_error.phpt b/lib/Google/vendor/google/crc32/ext/tests/004_error.phpt deleted file mode 100644 index c5da06410..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/004_error.phpt +++ /dev/null @@ -1,36 +0,0 @@ ---TEST-- -crc32c() errors test ---SKIPIF-- - ---FILE-- - ---EXPECTF-- -string(4) ",wVe" - -Warning: crc32c(): Supplied crc must be a 4 byte string in %s on line %d -bool(false) - -Warning: crc32c(): Supplied crc must be a 4 byte string in %s on line %d -bool(false) - -Warning: crc32c(): Supplied crc must be a 4 byte string in %s on line %d -bool(false) - -Warning: crc32c(): Supplied crc must be a 4 byte string in %s on line %d -bool(false) \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/ext/tests/005_hash.phpt b/lib/Google/vendor/google/crc32/ext/tests/005_hash.phpt deleted file mode 100644 index e82f4417d..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/005_hash.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -crc32c() hash tests ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -a245d57d \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/ext/tests/006_serialize.phpt b/lib/Google/vendor/google/crc32/ext/tests/006_serialize.phpt deleted file mode 100644 index 7b2b2ac45..000000000 --- a/lib/Google/vendor/google/crc32/ext/tests/006_serialize.phpt +++ /dev/null @@ -1,26 +0,0 @@ ---TEST-- -crc32c() serialize tests ---SKIPIF-- - ---FILE-- - ---EXPECT-- -bool(true) -a245d57d \ No newline at end of file diff --git a/lib/Google/vendor/google/crc32/src/Builtin.php b/lib/Google/vendor/google/crc32/src/Builtin.php deleted file mode 100644 index 9cb10854c..000000000 --- a/lib/Google/vendor/google/crc32/src/Builtin.php +++ /dev/null @@ -1,88 +0,0 @@ - 'crc32b', - CRC32::CASTAGNOLI => 'crc32c', // Added since PHP 7.4 - ]; - - /** - * Returns true if this $polynomial is supported by the builtin PHP hash function. - * - * @param integer $polynomial The polynomial - * - * @return boolean - */ - public static function supports($polynomial) - { - if (!isset(self::$mapping[$polynomial])) { - return false; - } - $algo = self::$mapping[$polynomial]; - return in_array($algo, hash_algos()); - } - - public function __construct($polynomial) - { - if (!self::supports($polynomial)) { - throw new \InvalidArgumentException("hash_algos() does not list this polynomial."); - } - - $this->algo = self::$mapping[$polynomial]; - $this->reset(); - } - - public function reset() - { - $this->hc = hash_init($this->algo); - } - - public function update($data) - { - hash_update($this->hc, $data); - } - - public function hash($raw_output = false) - { - // hash_final will destory the Hash Context resource, so operate on a copy. - $hc = hash_copy($this->hc); - return hash_final($hc, $raw_output); - } - - public function version() - { - return $this->algo . ' PHP HASH'; - } - - public function __clone() - { - $this->hc = hash_copy($this->hc); - } -} diff --git a/lib/Google/vendor/google/crc32/src/CRC32.php b/lib/Google/vendor/google/crc32/src/CRC32.php deleted file mode 100644 index 278283c40..000000000 --- a/lib/Google/vendor/google/crc32/src/CRC32.php +++ /dev/null @@ -1,112 +0,0 @@ -update('hello'); - * - * echo $crc->hash(); - * ``` - */ -class CRC32 -{ - use CRCTrait; - - /** - * IEEE polynomial as used by ethernet (IEEE 802.3), v.42, fddi, gzip, - * zip, png, ... - */ - public const IEEE = 0xedb88320; - - /** - * Castagnoli's polynomial, used in iSCSI, SCTP, Google Cloud Storage, - * Apache Kafka, and has hardware-accelerated in modern intel CPUs. - * https://doi.org/10.1109/26.231911 - */ - public const CASTAGNOLI = 0x82f63b78; - - /** - * Koopman's polynomial. - * https://doi.org/10.1109/DSN.2002.1028931 - */ - public const KOOPMAN = 0xeb31d82e; - - /** - * The size of the checksum in bytes. - */ - public const SIZE = 4; - - private static $mapping = [ - self::IEEE => 'IEEE', - self::CASTAGNOLI => 'Castagnoli', - self::KOOPMAN => 'Koopman', - ]; - - private function __construct() - { - // Prevent instantiation. - } - - /** - * Returns the best CRC implementation available on this machine. - * - * @param integer $polynomial The CRC polynomial. Use a 32-bit number, - * or one of the supplied constants, CRC32::IEEE, - * CRC32::CASTAGNOLI, or CRC32::KOOPMAN. - * - * @return CRC32Interface - */ - public static function create($polynomial) - { - if (Google::supports($polynomial) && function_exists('crc32c')) { - return new Google(); - } - - if (Builtin::supports($polynomial)) { - return new Builtin($polynomial); - } - - // Fallback to the pure PHP version - return new PHP($polynomial); - } - - /** - * Prints the human friendly name for this polynomial. - * - * @param integer $polynomial The CRC polynomial. - * - * @return string - */ - public static function string($polynomial) - { - if (isset(self::$mapping[$polynomial])) { - return self::$mapping[$polynomial]; - } - return '0x' . self::int2hex($polynomial); - } -} diff --git a/lib/Google/vendor/google/crc32/src/CRCInterface.php b/lib/Google/vendor/google/crc32/src/CRCInterface.php deleted file mode 100644 index 1d9c06312..000000000 --- a/lib/Google/vendor/google/crc32/src/CRCInterface.php +++ /dev/null @@ -1,59 +0,0 @@ -reset(); - } - - public function reset() - { - $this->crc = hex2bin('00000000'); - } - - public function update($data) - { - $this->crc = crc32c($data, $this->crc); - } - - public function hash($raw_output = false) - { - if ($raw_output === true) { - return $this->crc; - } - return bin2hex($this->crc); - } - - public function version() - { - return 'Hardware accelerated (https://github.com/google/crc32c)'; - } -} diff --git a/lib/Google/vendor/google/crc32/src/PHP.php b/lib/Google/vendor/google/crc32/src/PHP.php deleted file mode 100644 index 28ee3cf59..000000000 --- a/lib/Google/vendor/google/crc32/src/PHP.php +++ /dev/null @@ -1,80 +0,0 @@ -polynomial = $polynomial; - $this->table = Table::get($polynomial); - $this->reset(); - } - - - public function reset() - { - $this->crc = ~0; - } - - public function update($data) - { - $crc = $this->crc; - $table = $this->table; - $len = strlen($data); - for ($i = 0; $i < $len; ++$i) { - $crc = (($crc >> 8) & 0xffffff) ^ $table[($crc ^ ord($data[$i])) & 0xff]; - } - $this->crc = $crc; - } - - public function hash($raw_output = false) - { - return $this->crcHash(~$this->crc, $raw_output); - } - - public function version() - { - return 'crc32(' . $this->int2hex($this->polynomial) . ') software version'; - } -} diff --git a/lib/Google/vendor/google/crc32/src/PHPSlicedBy4.php b/lib/Google/vendor/google/crc32/src/PHPSlicedBy4.php deleted file mode 100644 index 9a165e725..000000000 --- a/lib/Google/vendor/google/crc32/src/PHPSlicedBy4.php +++ /dev/null @@ -1,108 +0,0 @@ -polynomial = $polynomial; - $this->table = Table::create4($polynomial); - $this->reset(); - } - - public function reset() - { - $this->crc = ~0; - } - - public function update($data) - { - $crc = $this->crc; - $table0 = $this->table[0]; - $table1 = $this->table[1]; - $table2 = $this->table[2]; - $table3 = $this->table[3]; - - $len = strlen($data); - $remain = ($len % 4); - $len1 = $len - $remain; - for ($i = 0; $i < $len1; $i += 4) { - $b = (ord($data[$i+3])<<24) | - (ord($data[$i+2])<<16) | - (ord($data[$i+1])<<8) | - (ord($data[$i])); - - $crc = ($crc ^ $b) & 0xffffffff; - - $crc = $table3[ $crc & 0xff] ^ - $table2[($crc>>8) & 0xff] ^ - $table1[($crc>>16) & 0xff] ^ - $table0[($crc>>24) & 0xff]; - } - - switch ($remain) { - case 3: - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i])) & 0xff]; - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i+1])) & 0xff]; - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i+2])) & 0xff]; - break; - case 2: - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i])) & 0xff]; - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i+1])) & 0xff]; - break; - case 1: - $crc = (($crc >> 8) & 0xffffff) ^ $table0[($crc ^ ord($data[$i])) & 0xff]; - break; - case 0: - } - - $this->crc = $crc; - } - - public function hash($raw_output = false) - { - return $this->crcHash(~$this->crc, $raw_output); - } - - public function version() - { - return 'crc32(' . $this->int2hex($this->polynomial) . ') software version'; - } -} diff --git a/lib/Google/vendor/google/crc32/src/Table.php b/lib/Google/vendor/google/crc32/src/Table.php deleted file mode 100644 index 3dee7c20e..000000000 --- a/lib/Google/vendor/google/crc32/src/Table.php +++ /dev/null @@ -1,113 +0,0 @@ - $value) { - echo "0x" . int2hex($value) . ","; - if ($i % 4 == 3) { - echo "\n"; - } else { - echo " "; - } - } - - echo "\n\n"; - } - - /** - * Gets a CRC table, by creating it, or using a previously cached result. - * - * @param integer $polynomial The polynomial - * - * @return array The table - */ - public static function get($polynomial) - { - if (isset(self::$tables[$polynomial])) { - return self::$tables[$polynomial]; - } - self::$tables[$polynomial] = self::create($polynomial); - return self::$tables[$polynomial]; - } - - /** - * Create a CRC table. - * - * @param integer $polynomial The polynomial. - * - * @return array The table. - */ - public static function create($polynomial) - { - $table = array_fill(0, 256, 0); - - for ($i = 0; $i < 256; $i++) { - $crc = $i; - for ($j = 0; $j < 8; $j++) { - if ($crc & 1 == 1) { - $crc = ($crc >> 1) ^ $polynomial; - } else { - $crc >>= 1; - } - } - $table[$i] = $crc; - } - - return $table; - } - - /** - * Create a CRC table sliced by 4. - * - * @param integer $polynomial The polynomial. - * - * @return array The table. - */ - public static function create4($polynomial) - { - $table = array_fill(0, 4, array_fill(0, 256, 0)); - $table[0] = self::create($polynomial); - - for ($i = 0; $i < 256; $i++) { - // for Slicing-by-4 and Slicing-by-8 - $table[1][$i] = ($table[0][$i] >> 8) ^ $table[0][$table[0][$i] & 0xFF]; - $table[2][$i] = ($table[1][$i] >> 8) ^ $table[0][$table[1][$i] & 0xFF]; - $table[3][$i] = ($table[2][$i] >> 8) ^ $table[0][$table[2][$i] & 0xFF]; - - /* - // only Slicing-by-8 - $table[4][$i] = ($table[3][$i] >> 8) ^ $table[0][$table[3][$i] & 0xFF]; - $table[5][$i] = ($table[4][$i] >> 8) ^ $table[0][$table[4][$i] & 0xFF]; - $table[6][$i] = ($table[5][$i] >> 8) ^ $table[0][$table[5][$i] & 0xFF]; - $table[7][$i] = ($table[6][$i] >> 8) ^ $table[0][$table[6][$i] & 0xFF]; - */ - } - return $table; - } -} diff --git a/lib/Google/vendor/google/crc32/tests/BuiltinTest.php b/lib/Google/vendor/google/crc32/tests/BuiltinTest.php deleted file mode 100644 index af4857ea8..000000000 --- a/lib/Google/vendor/google/crc32/tests/BuiltinTest.php +++ /dev/null @@ -1,50 +0,0 @@ -expectException('InvalidArgumentException'); - - new Builtin(CRC32::KOOPMAN); - } - - /** - * @dataProvider supports - */ - public function testSupports($algo, $expected) - { - $this->assertEquals($expected, Builtin::supports($algo)); - } - - public function supports() - { - return [ - 'IEEE' => [CRC32::IEEE, true], - 'CASTAGNOLI' => [CRC32::CASTAGNOLI, true], - 'KOOPMAN' => [CRC32::KOOPMAN, false], - ]; - } -} diff --git a/lib/Google/vendor/google/crc32/tests/CRC32Test.php b/lib/Google/vendor/google/crc32/tests/CRC32Test.php deleted file mode 100644 index 71bd31544..000000000 --- a/lib/Google/vendor/google/crc32/tests/CRC32Test.php +++ /dev/null @@ -1,158 +0,0 @@ -update($input); - - $this->assertEquals( - $expected, - $crc->hash(false), - 'hash(' . $input . ')' - ); - - $this->assertEquals( - $expected, - $crc->hash(false), - 'hash(' . $input . ') again' - ); - } - - /** - * @dataProvider data - */ - public function testHashRaw($crc_class, $poly, $input, $expected) - { - $crc = new $crc_class($poly); - $crc->update($input); - - $this->assertEquals( - hex2bin($expected), - $crc->hash(true), - 'hash(' . $input . ', true)' - ); - } - - /** - * Extended hashing. Read increasingly sized chunks of input. - * @dataProvider data - */ - public function testExtendedHash($crc_class, $poly, $input, $expected) - { - $crc = new $crc_class($poly); - - $start = 0; - $len = 1; - while ($start < strlen($input)) { - $chunk = substr($input, $start, $len); - $crc->update($chunk); - - $start += $len; - $len *= 2; - } - - $this->assertEquals( - $expected, - $crc->hash(), - 'hash(' . $input . ')' - ); - } - - /** - * @dataProvider crcs - */ - public function testReset($crc_class, $poly) - { - $data = array( - 'abc' => array( - CRC32::IEEE => '352441c2', - CRC32::CASTAGNOLI => '364b3fb7'), - 'abcdef' => array( - CRC32::IEEE => '4b8e39ef', - CRC32::CASTAGNOLI => '53bceff1'), - ); - - $crc = new $crc_class($poly); - $this->assertEquals('00000000', $crc->hash()); - - $crc->update('abc'); - $this->assertEquals($data['abc'][$poly], $crc->hash()); - - $crc->reset(); - $this->assertEquals('00000000', $crc->hash()); - - $crc->update('abcdef'); - $this->assertEquals($data['abcdef'][$poly], $crc->hash()); - } - - /** - * @dataProvider crcs - */ - public function testClone($crc_class, $poly) - { - $data = array( - 'abc' => array( - CRC32::IEEE => '352441c2', - CRC32::CASTAGNOLI => '364b3fb7'), - 'abcdefgh' => array( - CRC32::IEEE => 'aeef2a50', - CRC32::CASTAGNOLI => '0a9421b7'), - ); - - $a = new $crc_class($poly); - $a->update('abc'); - - $b = clone $a; - $b->update('defgh'); - - // $b should be updated, but $a should stay the same. - $this->assertEquals( - $data['abc'][$poly], - $a->hash(), - '$a->update("abc")' - ); - - $this->assertEquals( - $data['abcdefgh'][$poly], - $b->hash(), - 'clone($a)->update("abcdefgh")' - ); - } -} diff --git a/lib/Google/vendor/google/crc32/tests/DataIterator.php b/lib/Google/vendor/google/crc32/tests/DataIterator.php deleted file mode 100644 index 486d83360..000000000 --- a/lib/Google/vendor/google/crc32/tests/DataIterator.php +++ /dev/null @@ -1,204 +0,0 @@ -crcs, 'Google\CRC32\Google'); - } - } - - public function rewind(): void - { - reset($this->crcs); - reset($this->algos); - } - - public function valid(): bool - { - return current($this->crcs) !== false && - current($this->algos) !== false; - } - - #[\ReturnTypeWillChange] - public function key() - { - return $this->count; - } - - #[\ReturnTypeWillChange] - public function current() - { - return [current($this->crcs), current($this->algos)]; - } - - public function next(): void - { - $this->count++; - if (next($this->algos) === false) { - reset($this->algos); - next($this->crcs); - } - - // Skip unsupported polynomials - if ($this->valid()) { - $crc_class = current($this->crcs); - $poly = current($this->algos); - if (!$crc_class::supports($poly)) { - $this->next(); - } - } - } -} - -class DataIterator implements Iterator -{ - protected $crcs = [ - 'Google\CRC32\PHP', - 'Google\CRC32\PHPSlicedBy4', - 'Google\CRC32\Builtin', - ]; - - protected $algos = [ - CRC32::IEEE, - CRC32::CASTAGNOLI - ]; - - /** - * Various test data, taken from: - * * https://github.com/php/php-src/blob/master/ext/hash/tests/crc32.phpt - * * https://golang.org/src/hash/crc32/crc32_test.go - * * https://tools.ietf.org/html/rfc3720#appendix-B.4 - * - * @var array Hashes for CRC32::IEEE and CRC32::CASTAGNOLI - */ - protected $data = [ - '' => array('00000000', '00000000'), - 'a' => array('e8b7be43', 'c1d04330'), - 'ab' => array('9e83486d', 'e2a22936'), - 'abc' => array('352441c2', '364b3fb7'), - 'abcd' => array('ed82cd11', '92c80a31'), - 'abcde' => array('8587d865', 'c450d697'), - 'abcdef' => array('4b8e39ef', '53bceff1'), - 'abcdefg' => array('312a6aa6', 'e627f441'), - 'abcdefgh' => array('aeef2a50', '0a9421b7'), - 'abcdefghi' => array('8da988af', '2ddc99fc'), - 'abcdefghij' => array('3981703a', 'e6599437'), - 'abcdefghijklmnopqrstuvwxyz' => array('4c2750bd', '9ee6ef25'), - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' => array('1fc2e6d2', 'a245d57d'), - '12345678901234567890123456789012345678901234567890123456789012345678901234567890' => array('7ca94a72', '477a6781'), - 'message digest' => array('20159d7f', '02bd79d0'), - "I can't remember anything" => array('69147a4e', '5e405e93'), - "I can't remember anythingCan’t tell if this is true or dream" => array('3ee63999', '516ad412'), - 'Discard medicine more than two years old.' => array('6b9cdfe7', 'b2cc01fe'), - 'He who has a shady past knows that nice guys finish last.' => array('c90ef73f', '0e28207f'), - "I wouldn't marry him with a ten foot pole." => array('b902341f', 'be93f964'), - "Free! Free!/A trip/to Mars/for 900/empty jars/Burma Shave" => array('042080e8', '9e3be0c3'), - "The days of the digital watch are numbered. -Tom Stoppard" => array('154c6d11', 'f505ef04'), - "Nepal premier won't resign." => array('4c418325', '85d3dc82'), - "For every action there is an equal and opposite government program." => array('33955150', 'c5142380'), - "His money is twice tainted: 'taint yours and 'taint mine." => array('26216a4b', '75eb77dd'), - "There is no reason for any individual to have a computer in their home. -Ken Olsen, 1977" => array('1abbe45e', '91ebe9f7'), - "It's a tiny change to the code and not completely disgusting. - Bob Manchek" => array('c89a94f7', 'f0b1168e'), - "size: a.out: bad magic" => array('ab3abe14', '572b74e2'), - "The major problem is with sendmail. -Mark Horton" => array('bab102b6', '8a58a6d5'), - "Give me a rock, paper and scissors and I will move the world. CCFestoon" => array('999149d7', '9c426c50'), - "If the enemy is within range, then so are you." => array('6d52a33c', '735400a4'), - "It's well we cannot hear the screams/That we create in others' dreams." => array('90631e8d', 'bec49c95'), - "You remind me of a TV show, but that's all right: I watch it anyway." => array('78309130', 'a95a2079'), - "C is as portable as Stonehedge!!" => array('7d0a377f', 'de2e65c5'), - "Even if I could be Shakespeare, I think I should still choose to be Faraday. - A. Huxley" => array('8c79fd79', '297a88ed'), - "The fugacity of a constituent in a mixture of gases at a given temperature is proportional to its mole fraction. Lewis-Randall Rule" => array('a20b7167', '66ed1d8b'), - "How can you write a big system without C++? -Paul Glick" => array('8e0bb443', 'dcded527'), - "\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\v\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#\$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" => array('29058c73', '9c44184b') - ]; - - protected $count = 0; - - public function __construct() - { - if (extension_loaded('crc32c')) { - array_push($this->crcs, 'Google\CRC32\Google'); - } - } - - public function rewind(): void - { - reset($this->crcs); - reset($this->algos); - reset($this->data); - } - - public function valid(): bool - { - return current($this->crcs) !== false && - current($this->algos) !== false && - current($this->data) !== false; - } - - #[\ReturnTypeWillChange] - public function key() - { - return $this->count; - } - - #[\ReturnTypeWillChange] - public function current() - { - return [current($this->crcs), current($this->algos), key($this->data), current($this->data)[key($this->algos)]]; - } - - public function next(): void - { - $this->count++; - if (next($this->data) === false) { - reset($this->data); - if (next($this->algos) === false) { - reset($this->algos); - next($this->crcs); - } - } - - // Skip unsupported polynomials - if ($this->valid()) { - $crc_class = current($this->crcs); - $poly = current($this->algos); - if (!$crc_class::supports($poly)) { - $this->next(); - } - } - } -} diff --git a/lib/Google/vendor/google/crc32/tests/GoogleTest.php b/lib/Google/vendor/google/crc32/tests/GoogleTest.php deleted file mode 100644 index b27f7b73c..000000000 --- a/lib/Google/vendor/google/crc32/tests/GoogleTest.php +++ /dev/null @@ -1,56 +0,0 @@ -markTestSkipped(); - return; - } - - $this->expectException('InvalidArgumentException'); - - new Google(); - } - - /** - * @dataProvider supports - */ - public function testSupports($algo, $expected) - { - $this->assertEquals($expected, Google::supports($algo)); - } - - public function supports() - { - return [ - 'IEEE' => [CRC32::IEEE, false], - 'CASTAGNOLI' => [CRC32::CASTAGNOLI, true], - 'KOOPMAN' => [CRC32::KOOPMAN, false], - ]; - } -} diff --git a/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md index 1144eb763..990b86c9e 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md +++ b/lib/Google/vendor/guzzlehttp/guzzle/CHANGELOG.md @@ -3,6 +3,21 @@ Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version. +## 7.8.0 - 2023-08-27 + +### Added + +- Support for PHP 8.3 +- Added automatic closing of handles on `CurlFactory` object destruction + + +## 7.7.1 - 2023-08-27 + +### Changed + +- Remove the need for `AllowDynamicProperties` in `CurlMultiHandler` + + ## 7.7.0 - 2023-05-21 ### Added diff --git a/lib/Google/vendor/guzzlehttp/guzzle/UPGRADING.md b/lib/Google/vendor/guzzlehttp/guzzle/UPGRADING.md index 45417a7e1..8fa0afb5d 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/UPGRADING.md +++ b/lib/Google/vendor/guzzlehttp/guzzle/UPGRADING.md @@ -27,7 +27,7 @@ Please make sure: - Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed. Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative. - Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed. -- Request option `exception` is removed. Please use `http_errors`. +- Request option `exceptions` is removed. Please use `http_errors`. - Request option `save_to` is removed. Please use `sink`. - Pool option `pool_size` is removed. Please use `concurrency`. - We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility. diff --git a/lib/Google/vendor/guzzlehttp/guzzle/composer.json b/lib/Google/vendor/guzzlehttp/guzzle/composer.json index 3207f8c3a..72defd614 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/composer.json +++ b/lib/Google/vendor/guzzlehttp/guzzle/composer.json @@ -53,8 +53,8 @@ "require": { "php": "^7.2.5 || ^8.0", "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0", - "guzzlehttp/psr7": "^1.9.1 || ^2.4.5", + "guzzlehttp/promises": "^1.5.3 || ^2.0.1", + "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" }, diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php index 9b0d71070..bc6efc90f 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Client.php @@ -202,7 +202,7 @@ public function request(string $method, $uri = '', array $options = []): Respons * * @deprecated Client::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(?string $option = null) + public function getConfig(string $option = null) { return $option === null ? $this->config diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php index 6aaee61af..1788e16ab 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/ClientInterface.php @@ -80,5 +80,5 @@ public function requestAsync(string $method, $uri, array $options = []): Promise * * @deprecated ClientInterface::getConfig will be removed in guzzlehttp/guzzle:8.0. */ - public function getConfig(?string $option = null); + public function getConfig(string $option = null); } diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php index b4ced5a1a..fa2b10a8c 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJar.php @@ -96,9 +96,6 @@ public function getCookieByName(string $name): ?SetCookie return null; } - /** - * {@inheritDoc} - */ public function toArray(): array { return \array_map(static function (SetCookie $cookie): array { @@ -106,10 +103,7 @@ public function toArray(): array }, $this->getIterator()->getArrayCopy()); } - /** - * {@inheritDoc} - */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void + public function clear(string $domain = null, string $path = null, string $name = null): void { if (!$domain) { $this->cookies = []; @@ -126,25 +120,22 @@ static function (SetCookie $cookie) use ($domain): bool { $this->cookies = \array_filter( $this->cookies, static function (SetCookie $cookie) use ($path, $domain): bool { - return !($cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); + return !($cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); } ); } else { $this->cookies = \array_filter( $this->cookies, static function (SetCookie $cookie) use ($path, $domain, $name) { - return !($cookie->getName() == $name && - $cookie->matchesPath($path) && - $cookie->matchesDomain($domain)); + return !($cookie->getName() == $name + && $cookie->matchesPath($path) + && $cookie->matchesDomain($domain)); } ); } } - /** - * {@inheritDoc} - */ public function clearSessionCookies(): void { $this->cookies = \array_filter( @@ -155,9 +146,6 @@ static function (SetCookie $cookie): bool { ); } - /** - * {@inheritDoc} - */ public function setCookie(SetCookie $cookie): bool { // If the name string is empty (but not 0), ignore the set-cookie @@ -182,9 +170,9 @@ public function setCookie(SetCookie $cookie): bool foreach ($this->cookies as $i => $c) { // Two cookies are identical, when their path, and domain are // identical. - if ($c->getPath() != $cookie->getPath() || - $c->getDomain() != $cookie->getDomain() || - $c->getName() != $cookie->getName() + if ($c->getPath() != $cookie->getPath() + || $c->getDomain() != $cookie->getDomain() + || $c->getName() != $cookie->getName() ) { continue; } @@ -286,10 +274,10 @@ public function withCookieHeader(RequestInterface $request): RequestInterface $path = $uri->getPath() ?: '/'; foreach ($this->cookies as $cookie) { - if ($cookie->matchesPath($path) && - $cookie->matchesDomain($host) && - !$cookie->isExpired() && - (!$cookie->getSecure() || $scheme === 'https') + if ($cookie->matchesPath($path) + && $cookie->matchesDomain($host) + && !$cookie->isExpired() + && (!$cookie->getSecure() || $scheme === 'https') ) { $values[] = $cookie->getName().'=' .$cookie->getValue(); diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php index 50bc36398..8c55cc6f7 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Cookie/CookieJarInterface.php @@ -14,6 +14,7 @@ * cookies from a file, database, etc. * * @see https://docs.python.org/2/library/cookielib.html Inspiration + * * @extends \IteratorAggregate */ interface CookieJarInterface extends \Countable, \IteratorAggregate @@ -61,7 +62,7 @@ public function setCookie(SetCookie $cookie): bool; * @param string|null $path Clears cookies matching a domain and path * @param string|null $name Clears cookies matching a domain, path, and name */ - public function clear(?string $domain = null, ?string $path = null, ?string $name = null): void; + public function clear(string $domain = null, string $path = null, string $name = null): void; /** * Discard all sessions cookies. diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php index 3a6a8db26..be88d9e49 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php @@ -367,11 +367,11 @@ private function applyHandlerOptions(EasyHandle $easy, array &$conf): void // If it's a directory or a link to a directory use CURLOPT_CAPATH. // If not, it's probably a file, or a link to a file, so use CURLOPT_CAINFO. if ( - \is_dir($options['verify']) || - ( - \is_link($options['verify']) === true && - ($verifyLink = \readlink($options['verify'])) !== false && - \is_dir($verifyLink) + \is_dir($options['verify']) + || ( + \is_link($options['verify']) === true + && ($verifyLink = \readlink($options['verify'])) !== false + && \is_dir($verifyLink) ) ) { $conf[\CURLOPT_CAPATH] = $options['verify']; @@ -627,4 +627,12 @@ private function createHeaderFn(EasyHandle $easy): callable return \strlen($h); }; } + + public function __destruct() + { + foreach ($this->handles as $id => $handle) { + \curl_close($handle); + unset($this->handles[$id]); + } + } } diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php index f0acde145..a64e1821a 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php @@ -15,11 +15,8 @@ * associative array of curl option constants mapping to values in the * **curl** key of the provided request options. * - * @property resource|\CurlMultiHandle $_mh Internal use only. Lazy loaded multi-handle. - * * @final */ -#[\AllowDynamicProperties] class CurlMultiHandler { /** @@ -56,6 +53,9 @@ class CurlMultiHandler */ private $options = []; + /** @var resource|\CurlMultiHandle */ + private $_mh; + /** * This handler accepts the following options: * @@ -79,6 +79,10 @@ public function __construct(array $options = []) } $this->options = $options['options'] ?? []; + + // unsetting the property forces the first access to go through + // __get(). + unset($this->_mh); } /** diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php b/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php index 1ce9c4b19..6cb12f07a 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/HandlerStack.php @@ -44,7 +44,7 @@ class HandlerStack * handler is provided, the best handler for your * system will be utilized. */ - public static function create(?callable $handler = null): self + public static function create(callable $handler = null): self { $stack = new self($handler ?: Utils::chooseHandler()); $stack->push(Middleware::httpErrors(), 'http_errors'); @@ -131,7 +131,7 @@ public function hasHandler(): bool * @param callable(callable): callable $middleware Middleware function * @param string $name Name to register for this middleware. */ - public function unshift(callable $middleware, ?string $name = null): void + public function unshift(callable $middleware, string $name = null): void { \array_unshift($this->stack, [$middleware, $name]); $this->cached = null; diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php index 9b77eee83..04e9eb37a 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatter.php @@ -68,7 +68,7 @@ public function __construct(?string $template = self::CLF) * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string + public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string { $cache = []; diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php index a39ac248e..47934614a 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/MessageFormatterInterface.php @@ -14,5 +14,5 @@ interface MessageFormatterInterface * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ - public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null): string; + public function format(RequestInterface $request, ResponseInterface $response = null, \Throwable $error = null): string; } diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php b/lib/Google/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php index f32808a75..7aa21a623 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php @@ -166,8 +166,8 @@ public function modifyRequest(RequestInterface $request, array $options, Respons // not forcing RFC compliance, but rather emulating what all browsers // would do. $statusCode = $response->getStatusCode(); - if ($statusCode == 303 || - ($statusCode <= 302 && !$options['allow_redirects']['strict']) + if ($statusCode == 303 + || ($statusCode <= 302 && !$options['allow_redirects']['strict']) ) { $safeMethods = ['GET', 'HEAD', 'OPTIONS']; $requestMethod = $request->getMethod(); diff --git a/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php b/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php index 93fa334c8..2ce9e38f2 100644 --- a/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php +++ b/lib/Google/vendor/guzzlehttp/guzzle/src/TransferStats.php @@ -46,8 +46,8 @@ final class TransferStats */ public function __construct( RequestInterface $request, - ?ResponseInterface $response = null, - ?float $transferTime = null, + ResponseInterface $response = null, + float $transferTime = null, $handlerErrorData = null, array $handlerStats = [] ) { diff --git a/lib/Google/vendor/guzzlehttp/promises/.editorconfig b/lib/Google/vendor/guzzlehttp/promises/.editorconfig deleted file mode 100644 index 677e36e29..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -indent_size = 4 -indent_style = space -insert_final_newline = true -trim_trailing_whitespace = true diff --git a/lib/Google/vendor/guzzlehttp/promises/.gitattributes b/lib/Google/vendor/guzzlehttp/promises/.gitattributes deleted file mode 100644 index 4a4b968ca..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.gitattributes +++ /dev/null @@ -1,12 +0,0 @@ -.editorconfig export-ignore -.gitattributes export-ignore -/.github/ export-ignore -.gitignore export-ignore -/.travis.yml export-ignore -/.php-cs-fixer.dist.php export-ignore -/phpstan-baseline.neon export-ignore -/phpstan.neon.dist export-ignore -/phpunit.xml.dist export-ignore -/psalm.xml export-ignore -/tests/ export-ignore -/Makefile export-ignore diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/.editorconfig b/lib/Google/vendor/guzzlehttp/promises/.github/.editorconfig deleted file mode 100644 index 7bd3346f2..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/.editorconfig +++ /dev/null @@ -1,2 +0,0 @@ -[*.yml] -indent_size = 2 diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/FUNDING.yml b/lib/Google/vendor/guzzlehttp/promises/.github/FUNDING.yml deleted file mode 100644 index d00f85ddd..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/FUNDING.yml +++ /dev/null @@ -1,2 +0,0 @@ -github: [Nyholm, GrahamCampbell] -tidelift: "packagist/guzzlehttp/promises" diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/stale.yml b/lib/Google/vendor/guzzlehttp/promises/.github/stale.yml deleted file mode 100644 index 53faa71bd..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/stale.yml +++ /dev/null @@ -1,14 +0,0 @@ -daysUntilStale: 120 -daysUntilClose: 14 -exemptLabels: - - lifecycle/keep-open - - lifecycle/ready-for-merge -# Label to use when marking an issue as stale -staleLabel: lifecycle/stale -# Comment to post when marking an issue as stale. Set to `false` to disable -markComment: > - This issue has been automatically marked as stale because it has not had - recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you - for your contributions. -# Comment to post when closing a stale issue. Set to `false` to disable -closeComment: false diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/checks.yml b/lib/Google/vendor/guzzlehttp/promises/.github/workflows/checks.yml deleted file mode 100644 index ec10a83e9..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/checks.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Checks - -on: - push: - branches: - pull_request: - -permissions: - contents: read - -jobs: - composer-normalize: - name: Composer Normalize - runs-on: ubuntu-22.04 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Composer normalize - uses: docker://ergebnis/composer-normalize-action diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/ci.yml b/lib/Google/vendor/guzzlehttp/promises/.github/workflows/ci.yml deleted file mode 100644 index bb80fb57e..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/ci.yml +++ /dev/null @@ -1,65 +0,0 @@ -name: CI - -on: - push: - branches: - pull_request: - -permissions: - contents: read - -jobs: - build: - name: Build - runs-on: ubuntu-22.04 - strategy: - max-parallel: 10 - matrix: - php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] - - steps: - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: ${{ matrix.php }} - ini-values: error_reporting=E_ALL - coverage: none - tools: flex - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download dependencies - run: composer update --no-interaction --optimize-autoloader --prefer-stable - - - name: Run PHP < 8 tests - run: ./vendor/bin/simple-phpunit - if: matrix.php < 8 - - - name: Run PHP >= 8 tests - run: ./vendor/bin/simple-phpunit - env: - SYMFONY_PHPUNIT_VERSION: 9.5 - if: matrix.php >= 8 - - lowest: - name: Lowest deps - runs-on: ubuntu-22.04 - steps: - - name: Set up PHP - uses: shivammathur/setup-php@v2 - with: - php-version: 7.3 - ini-values: error_reporting=E_ALL - coverage: pcov - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download dependencies - run: composer update --no-interaction --optimize-autoloader --prefer-stable --prefer-lowest - - - name: Run tests - env: - SYMFONY_DEPRECATIONS_HELPER: "max[self]=0" - run: ./vendor/bin/simple-phpunit --coverage-text diff --git a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/static.yml b/lib/Google/vendor/guzzlehttp/promises/.github/workflows/static.yml deleted file mode 100644 index 9e6e1e0a0..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.github/workflows/static.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Static analysis - -on: - push: - branches: - pull_request: - -permissions: - contents: read - -jobs: - phpstan: - name: PHPStan - runs-on: ubuntu-22.04 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Download dependencies - run: | - composer update --no-interaction --optimize-autoloader - - - name: PHPStan - uses: docker://oskarstark/phpstan-ga:1.6.0 - with: - entrypoint: /composer/vendor/bin/phpstan - args: analyze --no-progress - - php-cs-fixer: - name: PHP-CS-Fixer - runs-on: ubuntu-22.04 - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '7.4' - coverage: none - extensions: mbstring - - - name: Download dependencies - run: composer update --no-interaction --no-progress - - - name: Download PHP CS Fixer - run: composer require "friendsofphp/php-cs-fixer:3.10.0" - - - name: Execute PHP CS Fixer - run: vendor/bin/php-cs-fixer fix --diff --dry-run - - psalm: - name: Psalm - runs-on: ubuntu-22.04 - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Psalm - uses: docker://vimeo/psalm-github-actions diff --git a/lib/Google/vendor/guzzlehttp/promises/.gitignore b/lib/Google/vendor/guzzlehttp/promises/.gitignore deleted file mode 100644 index 09d91da6e..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -artifacts/ -vendor/ -composer.lock -phpunit.xml -.php-cs-fixer.php -.php-cs-fixer.cache -.phpunit.result.cache diff --git a/lib/Google/vendor/guzzlehttp/promises/.php-cs-fixer.dist.php b/lib/Google/vendor/guzzlehttp/promises/.php-cs-fixer.dist.php deleted file mode 100644 index fcfbd02b8..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.php-cs-fixer.dist.php +++ /dev/null @@ -1,87 +0,0 @@ -setRiskyAllowed(true) - ->setRules([ - '@PSR2' => true, - 'array_syntax' => ['syntax' => 'short'], - 'binary_operator_spaces' => ['operators' => ['=>' => null]], - 'blank_line_after_opening_tag' => true, - 'class_attributes_separation' => ['elements' => ['method' => 'one']], - 'compact_nullable_typehint' => true, - 'concat_space' => ['spacing' => 'one'], - 'declare_equal_normalize' => ['space' => 'none'], - 'declare_strict_types' => false, - 'dir_constant' => true, - 'fully_qualified_strict_types' => true, - 'function_to_constant' => true, - 'function_typehint_space' => true, - 'header_comment' => false, - 'list_syntax' => ['syntax' => 'short'], - 'lowercase_cast' => true, - 'magic_method_casing' => true, - 'modernize_types_casting' => true, - 'multiline_comment_opening_closing' => true, - //'native_constant_invocation' => true, - 'no_alias_functions' => true, - 'no_alternative_syntax' => true, - 'no_blank_lines_after_phpdoc' => true, - 'no_empty_comment' => true, - 'no_empty_phpdoc' => true, - 'no_extra_blank_lines' => true, - 'no_leading_import_slash' => true, - 'no_leading_namespace_whitespace' => true, - 'no_spaces_around_offset' => true, - 'no_superfluous_phpdoc_tags' => ['allow_mixed' => true], - 'no_trailing_comma_in_singleline_array' => true, - 'no_unneeded_control_parentheses' => true, - 'no_unset_cast' => true, - 'no_unused_imports' => true, - 'no_useless_else' => true, - 'no_useless_return' => true, - 'no_whitespace_in_blank_line' => true, - 'normalize_index_brace' => true, - 'ordered_imports' => true, - 'php_unit_construct' => true, - 'php_unit_dedicate_assert' => ['target' => 'newest'], - 'php_unit_dedicate_assert_internal_type' => ['target' => 'newest'], - 'php_unit_expectation' => ['target' => 'newest'], - 'php_unit_mock' => ['target' => 'newest'], - 'php_unit_mock_short_will_return' => true, - 'php_unit_no_expectation_annotation' => ['target' => 'newest'], - 'php_unit_test_annotation' => ['style' => 'prefix'], - //'php_unit_test_case_static_method_calls' => ['call_type' => 'self'], - 'phpdoc_align' => ['align' => 'vertical'], - //'phpdoc_line_span' => ['method' => 'multi', 'property' => 'multi'], - 'phpdoc_no_package' => true, - 'phpdoc_no_useless_inheritdoc' => true, - 'phpdoc_scalar' => true, - 'phpdoc_separation' => true, - 'phpdoc_single_line_var_spacing' => true, - 'phpdoc_trim' => true, - 'phpdoc_trim_consecutive_blank_line_separation' => true, - 'phpdoc_types' => true, - 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], - 'phpdoc_var_without_name' => true, - 'return_assignment' => true, - 'self_static_accessor' => true, - 'short_scalar_cast' => true, - 'single_trait_insert_per_statement' => true, - 'standardize_not_equals' => true, - //'static_lambda' => true, - 'ternary_to_null_coalescing' => true, - 'trim_array_spaces' => true, - 'visibility_required' => ['elements' => ['property', 'method']], - 'yoda_style' => false, - // 'native_function_invocation' => true, - 'braces' => ['allow_single_line_closure'=>true], - ]) - ->setFinder( - PhpCsFixer\Finder::create() - ->in(__DIR__.'/src') - ->in(__DIR__.'/tests') - ->name('*.php') - ) -; - -return $config; diff --git a/lib/Google/vendor/guzzlehttp/promises/.travis.yml b/lib/Google/vendor/guzzlehttp/promises/.travis.yml deleted file mode 100644 index 04735a674..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: php - -dist: trusty - -matrix: - include: - - php: 5.5.9 - - php: hhvm-3.24 - fast_finish: true - -before_install: - - if [[ "$TRAVIS_PHP_VERSION" != "hhvm-3.24" ]]; then echo "xdebug.overload_var_dump = 1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi - -install: - - travis_retry composer update - - travis_retry ./vendor/bin/simple-phpunit install - -script: - - ./vendor/bin/simple-phpunit diff --git a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md index 2e1a2f384..eaf2af426 100644 --- a/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md +++ b/lib/Google/vendor/guzzlehttp/promises/CHANGELOG.md @@ -1,17 +1,43 @@ # CHANGELOG + +## 2.0.1 - 2023-08-03 + +### Changed + +- PHP 8.3 support + + +## 2.0.0 - 2023-05-21 + +### Added + +- Added PHP 7 type hints + +### Changed + +- All previously non-final non-exception classes have been marked as soft-final + +### Removed + +- Dropped PHP < 7.2 support +- All functions in the `GuzzleHttp\Promise` namespace + + ## 1.5.3 - 2023-05-21 ### Changed - Removed remaining usage of deprecated functions + ## 1.5.2 - 2022-08-07 ### Changed - Officially support PHP 8.2 + ## 1.5.1 - 2021-10-22 ### Fixed @@ -19,6 +45,7 @@ - Revert "Call handler when waiting on fulfilled/rejected Promise" - Fix pool memory leak when empty array of promises provided + ## 1.5.0 - 2021-10-07 ### Changed @@ -30,12 +57,14 @@ - Fix manually settle promises generated with `Utils::task` + ## 1.4.1 - 2021-02-18 ### Fixed - Fixed `each_limit` skipping promises and failing + ## 1.4.0 - 2020-09-30 ### Added diff --git a/lib/Google/vendor/guzzlehttp/promises/Makefile b/lib/Google/vendor/guzzlehttp/promises/Makefile deleted file mode 100644 index 8d5b3ef95..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -all: clean test - -test: - vendor/bin/phpunit - -coverage: - vendor/bin/phpunit --coverage-html=artifacts/coverage - -view-coverage: - open artifacts/coverage/index.html - -clean: - rm -rf artifacts/* diff --git a/lib/Google/vendor/guzzlehttp/promises/README.md b/lib/Google/vendor/guzzlehttp/promises/README.md index 1ea667ab9..a32d3d29c 100644 --- a/lib/Google/vendor/guzzlehttp/promises/README.md +++ b/lib/Google/vendor/guzzlehttp/promises/README.md @@ -29,6 +29,21 @@ for a general introduction to promises. `GuzzleHttp\Promise\Coroutine::of()`. +## Installation + +```shell +composer require guzzlehttp/promises +``` + + +## Version Guidance + +| Version | Status | PHP Version | +|---------|------------------------|--------------| +| 1.x | Bug and security fixes | >=5.5,<8.3 | +| 2.x | Latest | >=7.2.5,<8.4 | + + ## Quick Start A *promise* represents the eventual result of an asynchronous operation. The @@ -430,8 +445,6 @@ $loop = React\EventLoop\Factory::create(); $loop->addPeriodicTimer(0, [$queue, 'run']); ``` -*TODO*: Perhaps adding a `futureTick()` on each tick would be faster? - ## Implementation Notes @@ -501,8 +514,8 @@ $promise->resolve('foo'); A static API was first introduced in 1.4.0, in order to mitigate problems with functions conflicting between global and local copies of the package. The -function API will be removed in 2.0.0. A migration table has been provided here -for your convenience: +function API was removed in 2.0.0. A migration table has been provided here for +your convenience: | Original Function | Replacement Method | |----------------|----------------| diff --git a/lib/Google/vendor/guzzlehttp/promises/composer.json b/lib/Google/vendor/guzzlehttp/promises/composer.json index 966e3e3a8..fc1989ec1 100644 --- a/lib/Google/vendor/guzzlehttp/promises/composer.json +++ b/lib/Google/vendor/guzzlehttp/promises/composer.json @@ -26,27 +26,32 @@ } ], "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.1", + "phpunit/phpunit": "^8.5.29 || ^9.5.23" }, "autoload": { "psr-4": { "GuzzleHttp\\Promise\\": "src/" - }, - "files": ["src/functions_include.php"] + } }, "autoload-dev": { "psr-4": { "GuzzleHttp\\Promise\\Tests\\": "tests/" } }, - "scripts": { - "test": "vendor/bin/simple-phpunit", - "test-ci": "vendor/bin/simple-phpunit --coverage-text" + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } }, "config": { + "allow-plugins": { + "bamarni/composer-bin-plugin": true + }, "preferred-install": "dist", "sort-packages": true } diff --git a/lib/Google/vendor/guzzlehttp/promises/phpstan-baseline.neon b/lib/Google/vendor/guzzlehttp/promises/phpstan-baseline.neon deleted file mode 100644 index 6e99b21b2..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/phpstan-baseline.neon +++ /dev/null @@ -1,37 +0,0 @@ -parameters: - ignoreErrors: - - - message: "#^Cannot call method reject\\(\\) on null\\.$#" - count: 1 - path: src/EachPromise.php - - - - message: "#^Dead catch \\- Exception is already caught above\\.$#" - count: 2 - path: src/EachPromise.php - - - - message: "#^Dead catch \\- Exception is already caught above\\.$#" - count: 1 - path: src/FulfilledPromise.php - - - - message: "#^Dead catch \\- Exception is already caught above\\.$#" - count: 2 - path: src/Promise.php - - - - message: "#^Dead catch \\- Exception is already caught above\\.$#" - count: 1 - path: src/RejectedPromise.php - - - - message: "#^Dead catch \\- Exception is already caught above\\.$#" - count: 2 - path: src/Utils.php - - - - message: "#^Dead catch \\- GuzzleHttp\\\\Promise\\\\RejectionException is never thrown in the try block\\.$#" - count: 1 - path: src/Utils.php - diff --git a/lib/Google/vendor/guzzlehttp/promises/phpstan.neon.dist b/lib/Google/vendor/guzzlehttp/promises/phpstan.neon.dist deleted file mode 100644 index bc0f2c3a4..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/phpstan.neon.dist +++ /dev/null @@ -1,7 +0,0 @@ -includes: - - phpstan-baseline.neon - -parameters: - level: 5 - paths: - - src diff --git a/lib/Google/vendor/guzzlehttp/promises/phpunit.xml.dist b/lib/Google/vendor/guzzlehttp/promises/phpunit.xml.dist deleted file mode 100644 index 6163dba5b..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/phpunit.xml.dist +++ /dev/null @@ -1,21 +0,0 @@ - - - - - tests/ - - - - - src/ - - src/ - - - - diff --git a/lib/Google/vendor/guzzlehttp/promises/psalm.xml b/lib/Google/vendor/guzzlehttp/promises/psalm.xml deleted file mode 100644 index 3e4e3d085..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/lib/Google/vendor/guzzlehttp/promises/src/AggregateException.php b/lib/Google/vendor/guzzlehttp/promises/src/AggregateException.php index d2b5712b9..40ffdbcf1 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/AggregateException.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/AggregateException.php @@ -1,5 +1,7 @@ generator = $generatorFn(); - $this->result = new Promise(function () { + $this->result = new Promise(function (): void { while (isset($this->currentPromise)) { $this->currentPromise->wait(); } }); try { $this->nextCoroutine($this->generator->current()); - } catch (\Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } @@ -78,10 +77,8 @@ public function __construct(callable $generatorFn) /** * Create a new coroutine. - * - * @return self */ - public static function of(callable $generatorFn) + public static function of(callable $generatorFn): self { return new self($generatorFn); } @@ -89,42 +86,42 @@ public static function of(callable $generatorFn) public function then( callable $onFulfilled = null, callable $onRejected = null - ) { + ): PromiseInterface { return $this->result->then($onFulfilled, $onRejected); } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->result->otherwise($onRejected); } - public function wait($unwrap = true) + public function wait(bool $unwrap = true) { return $this->result->wait($unwrap); } - public function getState() + public function getState(): string { return $this->result->getState(); } - public function resolve($value) + public function resolve($value): void { $this->result->resolve($value); } - public function reject($reason) + public function reject($reason): void { $this->result->reject($reason); } - public function cancel() + public function cancel(): void { $this->currentPromise->cancel(); $this->result->cancel(); } - private function nextCoroutine($yielded) + private function nextCoroutine($yielded): void { $this->currentPromise = Create::promiseFor($yielded) ->then([$this, '_handleSuccess'], [$this, '_handleFailure']); @@ -133,7 +130,7 @@ private function nextCoroutine($yielded) /** * @internal */ - public function _handleSuccess($value) + public function _handleSuccess($value): void { unset($this->currentPromise); try { @@ -143,8 +140,6 @@ public function _handleSuccess($value) } else { $this->result->resolve($value); } - } catch (Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } @@ -153,15 +148,13 @@ public function _handleSuccess($value) /** * @internal */ - public function _handleFailure($reason) + public function _handleFailure($reason): void { unset($this->currentPromise); try { $nextYield = $this->generator->throw(Create::exceptionFor($reason)); // The throw was caught, so keep iterating on the coroutine $this->nextCoroutine($nextYield); - } catch (Exception $exception) { - $this->result->reject($exception); } catch (Throwable $throwable) { $this->result->reject($throwable); } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Create.php b/lib/Google/vendor/guzzlehttp/promises/src/Create.php index 8d038e9c1..9d3fc4a1e 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/Create.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/Create.php @@ -1,5 +1,7 @@ then([$promise, 'resolve'], [$promise, 'reject']); + return $promise; } @@ -34,10 +35,8 @@ public static function promiseFor($value) * If the provided reason is a promise, then it is returned as-is. * * @param mixed $reason Promise or reason. - * - * @return PromiseInterface */ - public static function rejectionFor($reason) + public static function rejectionFor($reason): PromiseInterface { if ($reason instanceof PromiseInterface) { return $reason; @@ -50,12 +49,10 @@ public static function rejectionFor($reason) * Create an exception for a rejected promise value. * * @param mixed $reason - * - * @return \Exception|\Throwable */ - public static function exceptionFor($reason) + public static function exceptionFor($reason): \Throwable { - if ($reason instanceof \Exception || $reason instanceof \Throwable) { + if ($reason instanceof \Throwable) { return $reason; } @@ -66,10 +63,8 @@ public static function exceptionFor($reason) * Returns an iterator for the given value. * * @param mixed $value - * - * @return \Iterator */ - public static function iterFor($value) + public static function iterFor($value): \Iterator { if ($value instanceof \Iterator) { return $value; diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Each.php b/lib/Google/vendor/guzzlehttp/promises/src/Each.php index ff8efd734..1a7aa0fb6 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/Each.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/Each.php @@ -1,5 +1,7 @@ $onFulfilled, - 'rejected' => $onRejected + 'rejected' => $onRejected, ]))->promise(); } @@ -46,19 +46,17 @@ public static function of( * @param int|callable $concurrency * @param callable $onFulfilled * @param callable $onRejected - * - * @return PromiseInterface */ public static function ofLimit( $iterable, $concurrency, callable $onFulfilled = null, callable $onRejected = null - ) { + ): PromiseInterface { return (new EachPromise($iterable, [ - 'fulfilled' => $onFulfilled, - 'rejected' => $onRejected, - 'concurrency' => $concurrency + 'fulfilled' => $onFulfilled, + 'rejected' => $onRejected, + 'concurrency' => $concurrency, ]))->promise(); } @@ -70,19 +68,17 @@ public static function ofLimit( * @param mixed $iterable * @param int|callable $concurrency * @param callable $onFulfilled - * - * @return PromiseInterface */ public static function ofLimitAll( $iterable, $concurrency, callable $onFulfilled = null - ) { + ): PromiseInterface { return self::ofLimit( $iterable, $concurrency, $onFulfilled, - function ($reason, $idx, PromiseInterface $aggregate) { + function ($reason, $idx, PromiseInterface $aggregate): void { $aggregate->reject($reason); } ); diff --git a/lib/Google/vendor/guzzlehttp/promises/src/EachPromise.php b/lib/Google/vendor/guzzlehttp/promises/src/EachPromise.php index 280d79950..28dd9793a 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/EachPromise.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/EachPromise.php @@ -1,10 +1,14 @@ aggregate) { return $this->aggregate; @@ -82,21 +86,18 @@ public function promise() $this->refillPending(); } catch (\Throwable $e) { $this->aggregate->reject($e); - } catch (\Exception $e) { - $this->aggregate->reject($e); } /** * @psalm-suppress NullableReturnStatement - * @phpstan-ignore-next-line */ return $this->aggregate; } - private function createPromise() + private function createPromise(): void { $this->mutex = false; - $this->aggregate = new Promise(function () { + $this->aggregate = new Promise(function (): void { if ($this->checkIfFinished()) { return; } @@ -113,7 +114,7 @@ private function createPromise() }); // Clear the references when the promise is resolved. - $clearFn = function () { + $clearFn = function (): void { $this->iterable = $this->concurrency = $this->pending = null; $this->onFulfilled = $this->onRejected = null; $this->nextPendingIndex = 0; @@ -122,11 +123,13 @@ private function createPromise() $this->aggregate->then($clearFn, $clearFn); } - private function refillPending() + private function refillPending(): void { if (!$this->concurrency) { // Add all pending promises. - while ($this->addPending() && $this->advanceIterator()); + while ($this->addPending() && $this->advanceIterator()) { + } + return; } @@ -147,10 +150,11 @@ private function refillPending() // next value to yield until promise callbacks are called. while (--$concurrency && $this->advanceIterator() - && $this->addPending()); + && $this->addPending()) { + } } - private function addPending() + private function addPending(): bool { if (!$this->iterable || !$this->iterable->valid()) { return false; @@ -164,7 +168,7 @@ private function addPending() $idx = $this->nextPendingIndex++; $this->pending[$idx] = $promise->then( - function ($value) use ($idx, $key) { + function ($value) use ($idx, $key): void { if ($this->onFulfilled) { call_user_func( $this->onFulfilled, @@ -175,7 +179,7 @@ function ($value) use ($idx, $key) { } $this->step($idx); }, - function ($reason) use ($idx, $key) { + function ($reason) use ($idx, $key): void { if ($this->onRejected) { call_user_func( $this->onRejected, @@ -191,7 +195,7 @@ function ($reason) use ($idx, $key) { return true; } - private function advanceIterator() + private function advanceIterator(): bool { // Place a lock on the iterator so that we ensure to not recurse, // preventing fatal generator errors. @@ -204,19 +208,17 @@ private function advanceIterator() try { $this->iterable->next(); $this->mutex = false; + return true; } catch (\Throwable $e) { $this->aggregate->reject($e); $this->mutex = false; - return false; - } catch (\Exception $e) { - $this->aggregate->reject($e); - $this->mutex = false; + return false; } } - private function step($idx) + private function step(int $idx): void { // If the promise was already resolved, then ignore this step. if (Is::settled($this->aggregate)) { @@ -234,11 +236,12 @@ private function step($idx) } } - private function checkIfFinished() + private function checkIfFinished(): bool { if (!$this->pending && !$this->iterable->valid()) { // Resolve the promise if there's nothing left to do. $this->aggregate->resolve(null); + return true; } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php b/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php index 98f72a62a..ab7129659 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/FulfilledPromise.php @@ -1,5 +1,7 @@ value; - $queue->add(static function () use ($p, $value, $onFulfilled) { + $queue->add(static function () use ($p, $value, $onFulfilled): void { if (Is::pending($p)) { try { $p->resolve($onFulfilled($value)); } catch (\Throwable $e) { $p->reject($e); - } catch (\Exception $e) { - $p->reject($e); } } }); @@ -50,34 +55,34 @@ public function then( return $p; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true, $defaultDelivery = null) + public function wait(bool $unwrap = true) { return $unwrap ? $this->value : null; } - public function getState() + public function getState(): string { return self::FULFILLED; } - public function resolve($value) + public function resolve($value): void { if ($value !== $this->value) { - throw new \LogicException("Cannot resolve a fulfilled promise"); + throw new \LogicException('Cannot resolve a fulfilled promise'); } } - public function reject($reason) + public function reject($reason): void { - throw new \LogicException("Cannot reject a fulfilled promise"); + throw new \LogicException('Cannot reject a fulfilled promise'); } - public function cancel() + public function cancel(): void { // pass } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Is.php b/lib/Google/vendor/guzzlehttp/promises/src/Is.php index c3ed8d014..f3f050384 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/Is.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/Is.php @@ -1,45 +1,39 @@ getState() === PromiseInterface::PENDING; } /** * Returns true if a promise is fulfilled or rejected. - * - * @return bool */ - public static function settled(PromiseInterface $promise) + public static function settled(PromiseInterface $promise): bool { return $promise->getState() !== PromiseInterface::PENDING; } /** * Returns true if a promise is fulfilled. - * - * @return bool */ - public static function fulfilled(PromiseInterface $promise) + public static function fulfilled(PromiseInterface $promise): bool { return $promise->getState() === PromiseInterface::FULFILLED; } /** * Returns true if a promise is rejected. - * - * @return bool */ - public static function rejected(PromiseInterface $promise) + public static function rejected(PromiseInterface $promise): bool { return $promise->getState() === PromiseInterface::REJECTED; } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/Promise.php b/lib/Google/vendor/guzzlehttp/promises/src/Promise.php index 75939057b..1b07bdc9a 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/Promise.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/Promise.php @@ -1,11 +1,15 @@ state === self::PENDING) { $p = new Promise(null, [$this, 'cancel']); $this->handlers[] = [$p, $onFulfilled, $onRejected]; $p->waitList = $this->waitList; $p->waitList[] = $this; + return $p; } // Return a fulfilled promise and immediately invoke any callbacks. if ($this->state === self::FULFILLED) { $promise = Create::promiseFor($this->result); + return $onFulfilled ? $promise->then($onFulfilled) : $promise; } // It's either cancelled or rejected, so return a rejected promise // and immediately invoke any callbacks. $rejection = Create::rejectionFor($this->result); + return $onRejected ? $rejection->then(null, $onRejected) : $rejection; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true) + public function wait(bool $unwrap = true) { $this->waitIfPending(); @@ -73,12 +80,12 @@ public function wait($unwrap = true) } } - public function getState() + public function getState(): string { return $this->state; } - public function cancel() + public function cancel(): void { if ($this->state !== self::PENDING) { return; @@ -93,8 +100,6 @@ public function cancel() $fn(); } catch (\Throwable $e) { $this->reject($e); - } catch (\Exception $e) { - $this->reject($e); } } @@ -105,17 +110,17 @@ public function cancel() } } - public function resolve($value) + public function resolve($value): void { $this->settle(self::FULFILLED, $value); } - public function reject($reason) + public function reject($reason): void { $this->settle(self::REJECTED, $reason); } - private function settle($state, $value) + private function settle(string $state, $value): void { if ($this->state !== self::PENDING) { // Ignore calls with the same resolution. @@ -148,7 +153,7 @@ private function settle($state, $value) if (!is_object($value) || !method_exists($value, 'then')) { $id = $state === self::FULFILLED ? 1 : 2; // It's a success, so resolve the handlers in the queue. - Utils::queue()->add(static function () use ($id, $value, $handlers) { + Utils::queue()->add(static function () use ($id, $value, $handlers): void { foreach ($handlers as $handler) { self::callHandler($id, $value, $handler); } @@ -159,12 +164,12 @@ private function settle($state, $value) } else { // Resolve the handlers when the forwarded promise is resolved. $value->then( - static function ($value) use ($handlers) { + static function ($value) use ($handlers): void { foreach ($handlers as $handler) { self::callHandler(1, $value, $handler); } }, - static function ($reason) use ($handlers) { + static function ($reason) use ($handlers): void { foreach ($handlers as $handler) { self::callHandler(2, $reason, $handler); } @@ -180,7 +185,7 @@ static function ($reason) use ($handlers) { * @param mixed $value Value to pass to the callback. * @param array $handler Array of handler data (promise and callbacks). */ - private static function callHandler($index, $value, array $handler) + private static function callHandler(int $index, $value, array $handler): void { /** @var PromiseInterface $promise */ $promise = $handler[0]; @@ -211,12 +216,10 @@ private static function callHandler($index, $value, array $handler) } } catch (\Throwable $reason) { $promise->reject($reason); - } catch (\Exception $reason) { - $promise->reject($reason); } } - private function waitIfPending() + private function waitIfPending(): void { if ($this->state !== self::PENDING) { return; @@ -227,9 +230,9 @@ private function waitIfPending() } else { // If there's no wait function, then reject the promise. $this->reject('Cannot wait on a promise that has ' - . 'no internal wait function. You must provide a wait ' - . 'function when constructing the promise to be able to ' - . 'wait on a promise.'); + .'no internal wait function. You must provide a wait ' + .'function when constructing the promise to be able to ' + .'wait on a promise.'); } Utils::queue()->run(); @@ -240,13 +243,13 @@ private function waitIfPending() } } - private function invokeWaitFn() + private function invokeWaitFn(): void { try { $wfn = $this->waitFn; $this->waitFn = null; $wfn(true); - } catch (\Exception $reason) { + } catch (\Throwable $reason) { if ($this->state === self::PENDING) { // The promise has not been resolved yet, so reject the promise // with the exception. @@ -259,7 +262,7 @@ private function invokeWaitFn() } } - private function invokeWaitList() + private function invokeWaitList(): void { $waitList = $this->waitList; $this->waitList = null; diff --git a/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php b/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php index e59833143..2824802bb 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/PromiseInterface.php @@ -1,5 +1,7 @@ reason; $p = new Promise([$queue, 'run']); - $queue->add(static function () use ($p, $reason, $onRejected) { + $queue->add(static function () use ($p, $reason, $onRejected): void { if (Is::pending($p)) { try { // Return a resolved promise if onRejected does not throw. @@ -43,9 +50,6 @@ public function then( } catch (\Throwable $e) { // onRejected threw, so return a rejected promise. $p->reject($e); - } catch (\Exception $e) { - // onRejected threw, so return a rejected promise. - $p->reject($e); } } }); @@ -53,12 +57,12 @@ public function then( return $p; } - public function otherwise(callable $onRejected) + public function otherwise(callable $onRejected): PromiseInterface { return $this->then(null, $onRejected); } - public function wait($unwrap = true, $defaultDelivery = null) + public function wait(bool $unwrap = true) { if ($unwrap) { throw Create::exceptionFor($this->reason); @@ -67,24 +71,24 @@ public function wait($unwrap = true, $defaultDelivery = null) return null; } - public function getState() + public function getState(): string { return self::REJECTED; } - public function resolve($value) + public function resolve($value): void { - throw new \LogicException("Cannot resolve a rejected promise"); + throw new \LogicException('Cannot resolve a rejected promise'); } - public function reject($reason) + public function reject($reason): void { if ($reason !== $this->reason) { - throw new \LogicException("Cannot reject a rejected promise"); + throw new \LogicException('Cannot reject a rejected promise'); } } - public function cancel() + public function cancel(): void { // pass } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php b/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php index e2f137707..47dca8624 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/RejectionException.php @@ -1,5 +1,7 @@ reason = $reason; $message = 'The promise was rejected'; if ($description) { - $message .= ' with reason: ' . $description; + $message .= ' with reason: '.$description; } elseif (is_string($reason) || (is_object($reason) && method_exists($reason, '__toString')) ) { - $message .= ' with reason: ' . $this->reason; + $message .= ' with reason: '.$this->reason; } elseif ($reason instanceof \JsonSerializable) { - $message .= ' with reason: ' - . json_encode($this->reason, JSON_PRETTY_PRINT); + $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT); } parent::__construct($message); diff --git a/lib/Google/vendor/guzzlehttp/promises/src/TaskQueue.php b/lib/Google/vendor/guzzlehttp/promises/src/TaskQueue.php index f0fba2c59..503e0b2da 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/TaskQueue.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/TaskQueue.php @@ -1,5 +1,7 @@ run(); + * + * @final */ class TaskQueue implements TaskQueueInterface { private $enableShutdown = true; private $queue = []; - public function __construct($withShutdown = true) + public function __construct(bool $withShutdown = true) { if ($withShutdown) { - register_shutdown_function(function () { + register_shutdown_function(function (): void { if ($this->enableShutdown) { // Only run the tasks if an E_ERROR didn't occur. $err = error_get_last(); @@ -31,17 +35,17 @@ public function __construct($withShutdown = true) } } - public function isEmpty() + public function isEmpty(): bool { return !$this->queue; } - public function add(callable $task) + public function add(callable $task): void { $this->queue[] = $task; } - public function run() + public function run(): void { while ($task = array_shift($this->queue)) { /** @var callable $task */ @@ -60,7 +64,7 @@ public function run() * * Note: This shutdown will occur before any destructors are triggered. */ - public function disableShutdown() + public function disableShutdown(): void { $this->enableShutdown = false; } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/TaskQueueInterface.php b/lib/Google/vendor/guzzlehttp/promises/src/TaskQueueInterface.php index 723d4d54e..34c561a48 100644 --- a/lib/Google/vendor/guzzlehttp/promises/src/TaskQueueInterface.php +++ b/lib/Google/vendor/guzzlehttp/promises/src/TaskQueueInterface.php @@ -1,24 +1,24 @@ * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface + * @param TaskQueueInterface|null $assign Optionally specify a new queue instance. */ - public static function queue(TaskQueueInterface $assign = null) + public static function queue(TaskQueueInterface $assign = null): TaskQueueInterface { static $queue; @@ -39,22 +39,18 @@ public static function queue(TaskQueueInterface $assign = null) * returns a promise that is fulfilled or rejected with the result. * * @param callable $task Task function to run. - * - * @return PromiseInterface */ - public static function task(callable $task) + public static function task(callable $task): PromiseInterface { $queue = self::queue(); $promise = new Promise([$queue, 'run']); - $queue->add(function () use ($task, $promise) { + $queue->add(function () use ($task, $promise): void { try { if (Is::pending($promise)) { $promise->resolve($task()); } } catch (\Throwable $e) { $promise->reject($e); - } catch (\Exception $e) { - $promise->reject($e); } }); @@ -72,22 +68,18 @@ public static function task(callable $task) * key mapping to the rejection reason of the promise. * * @param PromiseInterface $promise Promise or value. - * - * @return array */ - public static function inspect(PromiseInterface $promise) + public static function inspect(PromiseInterface $promise): array { try { return [ 'state' => PromiseInterface::FULFILLED, - 'value' => $promise->wait() + 'value' => $promise->wait(), ]; } catch (RejectionException $e) { return ['state' => PromiseInterface::REJECTED, 'reason' => $e->getReason()]; } catch (\Throwable $e) { return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; - } catch (\Exception $e) { - return ['state' => PromiseInterface::REJECTED, 'reason' => $e]; } } @@ -100,10 +92,8 @@ public static function inspect(PromiseInterface $promise) * @see inspect for the inspection state array format. * * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array */ - public static function inspectAll($promises) + public static function inspectAll($promises): array { $results = []; foreach ($promises as $key => $promise) { @@ -122,12 +112,9 @@ public static function inspectAll($promises) * * @param iterable $promises Iterable of PromiseInterface objects to wait on. * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 + * @throws \Throwable on error */ - public static function unwrap($promises) + public static function unwrap($promises): array { $results = []; foreach ($promises as $key => $promise) { @@ -147,22 +134,21 @@ public static function unwrap($promises) * * @param mixed $promises Promises or values. * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface */ - public static function all($promises, $recursive = false) + public static function all($promises, bool $recursive = false): PromiseInterface { $results = []; $promise = Each::of( $promises, - function ($value, $idx) use (&$results) { + function ($value, $idx) use (&$results): void { $results[$idx] = $value; }, - function ($reason, $idx, Promise $aggregate) { + function ($reason, $idx, Promise $aggregate): void { $aggregate->reject($reason); } )->then(function () use (&$results) { ksort($results); + return $results; }); @@ -173,6 +159,7 @@ function ($reason, $idx, Promise $aggregate) { return self::all($promises, $recursive); } } + return $results; }); } @@ -193,17 +180,15 @@ function ($reason, $idx, Promise $aggregate) { * * @param int $count Total number of promises. * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function some($count, $promises) + public static function some(int $count, $promises): PromiseInterface { $results = []; $rejections = []; return Each::of( $promises, - function ($value, $idx, PromiseInterface $p) use (&$results, $count) { + function ($value, $idx, PromiseInterface $p) use (&$results, $count): void { if (Is::settled($p)) { return; } @@ -212,7 +197,7 @@ function ($value, $idx, PromiseInterface $p) use (&$results, $count) { $p->resolve(null); } }, - function ($reason) use (&$rejections) { + function ($reason) use (&$rejections): void { $rejections[] = $reason; } )->then( @@ -224,6 +209,7 @@ function () use (&$results, &$rejections, $count) { ); } ksort($results); + return array_values($results); } ); @@ -234,10 +220,8 @@ function () use (&$results, &$rejections, $count) { * fulfillment value is not an array of 1 but the value directly. * * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function any($promises) + public static function any($promises): PromiseInterface { return self::some(1, $promises)->then(function ($values) { return $values[0]; @@ -253,23 +237,22 @@ public static function any($promises) * @see inspect for the inspection state array format. * * @param mixed $promises Promises or values. - * - * @return PromiseInterface */ - public static function settle($promises) + public static function settle($promises): PromiseInterface { $results = []; return Each::of( $promises, - function ($value, $idx) use (&$results) { + function ($value, $idx) use (&$results): void { $results[$idx] = ['state' => PromiseInterface::FULFILLED, 'value' => $value]; }, - function ($reason, $idx) use (&$results) { + function ($reason, $idx) use (&$results): void { $results[$idx] = ['state' => PromiseInterface::REJECTED, 'reason' => $reason]; } )->then(function () use (&$results) { ksort($results); + return $results; }); } diff --git a/lib/Google/vendor/guzzlehttp/promises/src/functions.php b/lib/Google/vendor/guzzlehttp/promises/src/functions.php deleted file mode 100644 index c03d39d02..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/src/functions.php +++ /dev/null @@ -1,363 +0,0 @@ - - * while ($eventLoop->isRunning()) { - * GuzzleHttp\Promise\queue()->run(); - * } - * - * - * @param TaskQueueInterface $assign Optionally specify a new queue instance. - * - * @return TaskQueueInterface - * - * @deprecated queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead. - */ -function queue(TaskQueueInterface $assign = null) -{ - return Utils::queue($assign); -} - -/** - * Adds a function to run in the task queue when it is next `run()` and returns - * a promise that is fulfilled or rejected with the result. - * - * @param callable $task Task function to run. - * - * @return PromiseInterface - * - * @deprecated task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead. - */ -function task(callable $task) -{ - return Utils::task($task); -} - -/** - * Creates a promise for a value if the value is not a promise. - * - * @param mixed $value Promise or value. - * - * @return PromiseInterface - * - * @deprecated promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead. - */ -function promise_for($value) -{ - return Create::promiseFor($value); -} - -/** - * Creates a rejected promise for a reason if the reason is not a promise. If - * the provided reason is a promise, then it is returned as-is. - * - * @param mixed $reason Promise or reason. - * - * @return PromiseInterface - * - * @deprecated rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead. - */ -function rejection_for($reason) -{ - return Create::rejectionFor($reason); -} - -/** - * Create an exception for a rejected promise value. - * - * @param mixed $reason - * - * @return \Exception|\Throwable - * - * @deprecated exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead. - */ -function exception_for($reason) -{ - return Create::exceptionFor($reason); -} - -/** - * Returns an iterator for the given value. - * - * @param mixed $value - * - * @return \Iterator - * - * @deprecated iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead. - */ -function iter_for($value) -{ - return Create::iterFor($value); -} - -/** - * Synchronously waits on a promise to resolve and returns an inspection state - * array. - * - * Returns a state associative array containing a "state" key mapping to a - * valid promise state. If the state of the promise is "fulfilled", the array - * will contain a "value" key mapping to the fulfilled value of the promise. If - * the promise is rejected, the array will contain a "reason" key mapping to - * the rejection reason of the promise. - * - * @param PromiseInterface $promise Promise or value. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead. - */ -function inspect(PromiseInterface $promise) -{ - return Utils::inspect($promise); -} - -/** - * Waits on all of the provided promises, but does not unwrap rejected promises - * as thrown exception. - * - * Returns an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param PromiseInterface[] $promises Traversable of promises to wait upon. - * - * @return array - * - * @deprecated inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead. - */ -function inspect_all($promises) -{ - return Utils::inspectAll($promises); -} - -/** - * Waits on all of the provided promises and returns the fulfilled values. - * - * Returns an array that contains the value of each promise (in the same order - * the promises were provided). An exception is thrown if any of the promises - * are rejected. - * - * @param iterable $promises Iterable of PromiseInterface objects to wait on. - * - * @return array - * - * @throws \Exception on error - * @throws \Throwable on error in PHP >=7 - * - * @deprecated unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead. - */ -function unwrap($promises) -{ - return Utils::unwrap($promises); -} - -/** - * Given an array of promises, return a promise that is fulfilled when all the - * items in the array are fulfilled. - * - * The promise's fulfillment value is an array with fulfillment values at - * respective positions to the original array. If any promise in the array - * rejects, the returned promise is rejected with the rejection reason. - * - * @param mixed $promises Promises or values. - * @param bool $recursive If true, resolves new promises that might have been added to the stack during its own resolution. - * - * @return PromiseInterface - * - * @deprecated all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead. - */ -function all($promises, $recursive = false) -{ - return Utils::all($promises, $recursive); -} - -/** - * Initiate a competitive race between multiple promises or values (values will - * become immediately fulfilled promises). - * - * When count amount of promises have been fulfilled, the returned promise is - * fulfilled with an array that contains the fulfillment values of the winners - * in order of resolution. - * - * This promise is rejected with a {@see AggregateException} if the number of - * fulfilled promises is less than the desired $count. - * - * @param int $count Total number of promises. - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead. - */ -function some($count, $promises) -{ - return Utils::some($count, $promises); -} - -/** - * Like some(), with 1 as count. However, if the promise fulfills, the - * fulfillment value is not an array of 1 but the value directly. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead. - */ -function any($promises) -{ - return Utils::any($promises); -} - -/** - * Returns a promise that is fulfilled when all of the provided promises have - * been fulfilled or rejected. - * - * The returned promise is fulfilled with an array of inspection state arrays. - * - * @see inspect for the inspection state array format. - * - * @param mixed $promises Promises or values. - * - * @return PromiseInterface - * - * @deprecated settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead. - */ -function settle($promises) -{ - return Utils::settle($promises); -} - -/** - * Given an iterator that yields promises or values, returns a promise that is - * fulfilled with a null value when the iterator has been consumed or the - * aggregate promise has been fulfilled or rejected. - * - * $onFulfilled is a function that accepts the fulfilled value, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * $onRejected is a function that accepts the rejection reason, iterator index, - * and the aggregate promise. The callback can invoke any necessary side - * effects and choose to resolve or reject the aggregate if needed. - * - * @param mixed $iterable Iterator or array to iterate over. - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each will be removed in guzzlehttp/promises:2.0. Use Each::of instead. - */ -function each( - $iterable, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::of($iterable, $onFulfilled, $onRejected); -} - -/** - * Like each, but only allows a certain number of outstanding promises at any - * given time. - * - * $concurrency may be an integer or a function that accepts the number of - * pending promises and returns a numeric concurrency limit value to allow for - * dynamic a concurrency size. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * @param callable $onRejected - * - * @return PromiseInterface - * - * @deprecated each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead. - */ -function each_limit( - $iterable, - $concurrency, - callable $onFulfilled = null, - callable $onRejected = null -) { - return Each::ofLimit($iterable, $concurrency, $onFulfilled, $onRejected); -} - -/** - * Like each_limit, but ensures that no promise in the given $iterable argument - * is rejected. If any promise is rejected, then the aggregate promise is - * rejected with the encountered rejection. - * - * @param mixed $iterable - * @param int|callable $concurrency - * @param callable $onFulfilled - * - * @return PromiseInterface - * - * @deprecated each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead. - */ -function each_limit_all( - $iterable, - $concurrency, - callable $onFulfilled = null -) { - return Each::ofLimitAll($iterable, $concurrency, $onFulfilled); -} - -/** - * Returns true if a promise is fulfilled. - * - * @return bool - * - * @deprecated is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead. - */ -function is_fulfilled(PromiseInterface $promise) -{ - return Is::fulfilled($promise); -} - -/** - * Returns true if a promise is rejected. - * - * @return bool - * - * @deprecated is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead. - */ -function is_rejected(PromiseInterface $promise) -{ - return Is::rejected($promise); -} - -/** - * Returns true if a promise is fulfilled or rejected. - * - * @return bool - * - * @deprecated is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead. - */ -function is_settled(PromiseInterface $promise) -{ - return Is::settled($promise); -} - -/** - * Create a new coroutine. - * - * @see Coroutine - * - * @return PromiseInterface - * - * @deprecated coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead. - */ -function coroutine(callable $generatorFn) -{ - return Coroutine::of($generatorFn); -} diff --git a/lib/Google/vendor/guzzlehttp/promises/src/functions_include.php b/lib/Google/vendor/guzzlehttp/promises/src/functions_include.php deleted file mode 100644 index 34cd1710a..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/src/functions_include.php +++ /dev/null @@ -1,6 +0,0 @@ -assertStringContainsString('foo', $e->getMessage()); - $this->assertSame(['baz', 'bar'], $e->getReason()); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/CoroutineTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/CoroutineTest.php deleted file mode 100644 index ed91a8cc4..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/CoroutineTest.php +++ /dev/null @@ -1,113 +0,0 @@ -assertInstanceOf(P\Coroutine::class, P\Coroutine::of($fn)); - } - - /** - * @dataProvider promiseInterfaceMethodProvider - * - * @param string $method - * @param array $args - */ - public function testShouldProxyPromiseMethodsToResultPromise($method, $args = []) - { - $coroutine = new Coroutine(function () { yield 0; }); - $mockPromise = $this->getMockForAbstractClass(PromiseInterface::class); - call_user_func_array([$mockPromise->expects($this->once())->method($method), 'with'], $args); - - $resultPromiseProp = (new ReflectionClass(Coroutine::class))->getProperty('result'); - $resultPromiseProp->setAccessible(true); - $resultPromiseProp->setValue($coroutine, $mockPromise); - - call_user_func_array([$coroutine, $method], $args); - } - - public function promiseInterfaceMethodProvider() - { - return [ - ['then', [null, null]], - ['otherwise', [function () {}]], - ['wait', [true]], - ['getState', []], - ['resolve', [null]], - ['reject', [null]], - ]; - } - - public function testShouldCancelResultPromiseAndOutsideCurrentPromise() - { - $coroutine = new Coroutine(function () { yield 0; }); - - $mockPromises = [ - 'result' => $this->getMockForAbstractClass(PromiseInterface::class), - 'currentPromise' => $this->getMockForAbstractClass(PromiseInterface::class), - ]; - foreach ($mockPromises as $propName => $mockPromise) { - /** - * @var $mockPromise \PHPUnit_Framework_MockObject_MockObject - */ - $mockPromise->expects($this->once()) - ->method('cancel') - ->with(); - - $promiseProp = (new ReflectionClass(Coroutine::class))->getProperty($propName); - $promiseProp->setAccessible(true); - $promiseProp->setValue($coroutine, $mockPromise); - } - - $coroutine->cancel(); - } - - public function testWaitShouldResolveChainedCoroutines() - { - $promisor = function () { - return P\Coroutine::of(function () { - yield $promise = new Promise(function () use (&$promise) { - $promise->resolve(1); - }); - }); - }; - - $promise = $promisor()->then($promisor)->then($promisor); - - $this->assertSame(1, $promise->wait()); - } - - public function testWaitShouldHandleIntermediateErrors() - { - $promise = P\Coroutine::of(function () { - yield $promise = new Promise(function () use (&$promise) { - $promise->resolve(1); - }); - }) - ->then(function () { - return P\Coroutine::of(function () { - yield $promise = new Promise(function () use (&$promise) { - $promise->reject(new \Exception); - }); - }); - }) - ->otherwise(function (\Exception $error = null) { - if (!$error) { - self::fail('Error did not propagate.'); - } - return 3; - }); - - $this->assertSame(3, $promise->wait()); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/CreateTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/CreateTest.php deleted file mode 100644 index a4cc9317d..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/CreateTest.php +++ /dev/null @@ -1,56 +0,0 @@ -assertInstanceOf(FulfilledPromise::class, $p); - } - - public function testReturnsPromiseForPromise() - { - $p = new Promise(); - $this->assertSame($p, P\Create::promiseFor($p)); - } - - public function testReturnsPromiseForThennable() - { - $p = new Thennable(); - $wrapped = P\Create::promiseFor($p); - $this->assertNotSame($p, $wrapped); - $this->assertInstanceOf(PromiseInterface::class, $wrapped); - $p->resolve('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $wrapped->wait()); - } - - public function testReturnsRejection() - { - $p = P\Create::rejectionFor('fail'); - $this->assertInstanceOf(RejectedPromise::class, $p); - $this->assertSame('fail', PropertyHelper::get($p, 'reason')); - } - - public function testReturnsPromisesAsIsInRejectionFor() - { - $a = new Promise(); - $b = P\Create::rejectionFor($a); - $this->assertSame($a, $b); - } - - public function testIterForReturnsIterator() - { - $iter = new \ArrayIterator(); - $this->assertSame($iter, P\Create::iterFor($iter)); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/EachPromiseTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/EachPromiseTest.php deleted file mode 100644 index d5dc9cfea..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/EachPromiseTest.php +++ /dev/null @@ -1,430 +0,0 @@ - 100]); - $this->assertSame($each->promise(), $each->promise()); - } - - public function testResolvesInCaseOfAnEmptyList() - { - $promises = []; - $each = new EachPromise($promises); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertTrue(P\Is::fulfilled($p)); - } - - public function testResolvesInCaseOfAnEmptyListAndInvokesFulfilled() - { - $promises = []; - $each = new EachPromise($promises); - $p = $each->promise(); - $onFulfilledCalled = false; - $onRejectedCalled = false; - $p->then( - function () use (&$onFulfilledCalled) { - $onFulfilledCalled = true; - }, - function () use (&$onRejectedCalled) { - $onRejectedCalled = true; - } - ); - $this->assertNull($p->wait()); - $this->assertTrue(P\Is::fulfilled($p)); - $this->assertTrue($onFulfilledCalled); - $this->assertFalse($onRejectedCalled); - } - - public function testInvokesAllPromises() - { - $promises = [new Promise(), new Promise(), new Promise()]; - $called = []; - $each = new EachPromise($promises, [ - 'fulfilled' => function ($value) use (&$called) { - $called[] = $value; - } - ]); - $p = $each->promise(); - $promises[0]->resolve('a'); - $promises[1]->resolve('c'); - $promises[2]->resolve('b'); - P\Utils::queue()->run(); - $this->assertSame(['a', 'c', 'b'], $called); - $this->assertTrue(P\Is::fulfilled($p)); - } - - public function testIsWaitable() - { - $a = $this->createSelfResolvingPromise('a'); - $b = $this->createSelfResolvingPromise('b'); - $called = []; - $each = new EachPromise([$a, $b], [ - 'fulfilled' => function ($value) use (&$called) { $called[] = $value; } - ]); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertTrue(P\Is::fulfilled($p)); - $this->assertSame(['a', 'b'], $called); - } - - public function testCanResolveBeforeConsumingAll() - { - $called = 0; - $a = $this->createSelfResolvingPromise('a'); - $b = new Promise(function () { $this->fail(); }); - $each = new EachPromise([$a, $b], [ - 'fulfilled' => function ($value, $idx, Promise $aggregate) use (&$called) { - $this->assertSame($idx, 0); - $this->assertSame('a', $value); - $aggregate->resolve(null); - $called++; - }, - 'rejected' => function (\Exception $reason) { - $this->fail($reason->getMessage()); - } - ]); - $p = $each->promise(); - $p->wait(); - $this->assertNull($p->wait()); - $this->assertSame(1, $called); - $this->assertTrue(P\Is::fulfilled($a)); - $this->assertTrue(P\Is::pending($b)); - // Resolving $b has no effect on the aggregate promise. - $b->resolve('foo'); - $this->assertSame(1, $called); - } - - public function testLimitsPendingPromises() - { - $pending = [new Promise(), new Promise(), new Promise(), new Promise()]; - $promises = new \ArrayIterator($pending); - $each = new EachPromise($promises, ['concurrency' => 2]); - $p = $each->promise(); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - $pending[0]->resolve('a'); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - $this->assertTrue($promises->valid()); - $pending[1]->resolve('b'); - P\Utils::queue()->run(); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - $this->assertTrue($promises->valid()); - $promises[2]->resolve('c'); - P\Utils::queue()->run(); - $this->assertCount(1, PropertyHelper::get($each, 'pending')); - $this->assertTrue(P\Is::pending($p)); - $promises[3]->resolve('d'); - P\Utils::queue()->run(); - $this->assertNull(PropertyHelper::get($each, 'pending')); - $this->assertTrue(P\Is::fulfilled($p)); - $this->assertFalse($promises->valid()); - } - - public function testDynamicallyLimitsPendingPromises() - { - $calls = []; - $pendingFn = function ($count) use (&$calls) { - $calls[] = $count; - return 2; - }; - $pending = [new Promise(), new Promise(), new Promise(), new Promise()]; - $promises = new \ArrayIterator($pending); - $each = new EachPromise($promises, ['concurrency' => $pendingFn]); - $p = $each->promise(); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - $pending[0]->resolve('a'); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - $this->assertTrue($promises->valid()); - $pending[1]->resolve('b'); - $this->assertCount(2, PropertyHelper::get($each, 'pending')); - P\Utils::queue()->run(); - $this->assertTrue($promises->valid()); - $promises[2]->resolve('c'); - P\Utils::queue()->run(); - $this->assertCount(1, PropertyHelper::get($each, 'pending')); - $this->assertTrue(P\Is::pending($p)); - $promises[3]->resolve('d'); - P\Utils::queue()->run(); - $this->assertNull(PropertyHelper::get($each, 'pending')); - $this->assertTrue(P\Is::fulfilled($p)); - $this->assertSame([0, 1, 1, 1], $calls); - $this->assertFalse($promises->valid()); - } - - public function testClearsReferencesWhenResolved() - { - $called = false; - $a = new Promise(function () use (&$a, &$called) { - $a->resolve('a'); - $called = true; - }); - $each = new EachPromise([$a], [ - 'concurrency' => function () { return 1; }, - 'fulfilled' => function () {}, - 'rejected' => function () {} - ]); - $each->promise()->wait(); - $this->assertNull(PropertyHelper::get($each, 'onFulfilled')); - $this->assertNull(PropertyHelper::get($each, 'onRejected')); - $this->assertNull(PropertyHelper::get($each, 'iterable')); - $this->assertNull(PropertyHelper::get($each, 'pending')); - $this->assertNull(PropertyHelper::get($each, 'concurrency')); - $this->assertTrue($called); - } - - public function testCanBeCancelled() - { - $called = false; - $a = new FulfilledPromise('a'); - $b = new Promise(function () use (&$called) { $called = true; }); - $each = new EachPromise([$a, $b], [ - 'fulfilled' => function ($value, $idx, Promise $aggregate) { - $aggregate->cancel(); - }, - 'rejected' => function ($reason) use (&$called) { - $called = true; - }, - ]); - $p = $each->promise(); - $p->wait(false); - $this->assertTrue(P\Is::fulfilled($a)); - $this->assertTrue(P\Is::pending($b)); - $this->assertTrue(P\Is::rejected($p)); - $this->assertFalse($called); - } - - public function testDoesNotBlowStackWithFulfilledPromises() - { - $pending = []; - for ($i = 0; $i < 100; $i++) { - $pending[] = new FulfilledPromise($i); - } - $values = []; - $each = new EachPromise($pending, [ - 'fulfilled' => function ($value) use (&$values) { - $values[] = $value; - } - ]); - $called = false; - $each->promise()->then(function () use (&$called) { - $called = true; - }); - $this->assertFalse($called); - P\Utils::queue()->run(); - $this->assertTrue($called); - $this->assertSame(range(0, 99), $values); - } - - public function testDoesNotBlowStackWithRejectedPromises() - { - $pending = []; - for ($i = 0; $i < 100; $i++) { - $pending[] = new RejectedPromise($i); - } - $values = []; - $each = new EachPromise($pending, [ - 'rejected' => function ($value) use (&$values) { - $values[] = $value; - } - ]); - $called = false; - $each->promise()->then( - function () use (&$called) { $called = true; }, - function () { $this->fail('Should not have rejected.'); } - ); - $this->assertFalse($called); - P\Utils::queue()->run(); - $this->assertTrue($called); - $this->assertSame(range(0, 99), $values); - } - - public function testReturnsPromiseForWhatever() - { - $called = []; - $arr = ['a', 'b']; - $each = new EachPromise($arr, [ - 'fulfilled' => function ($v) use (&$called) { $called[] = $v; } - ]); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertSame(['a', 'b'], $called); - } - - public function testRejectsAggregateWhenNextThrows() - { - $iter = function () { - yield 'a'; - throw new \Exception('Failure'); - }; - $each = new EachPromise($iter()); - $p = $each->promise(); - $e = null; - $received = null; - $p->then(null, function ($reason) use (&$e) { $e = $reason; }); - P\Utils::queue()->run(); - $this->assertInstanceOf(\Exception::class, $e); - $this->assertSame('Failure', $e->getMessage()); - } - - public function testDoesNotCallNextOnIteratorUntilNeededWhenWaiting() - { - $results = []; - $values = [10]; - $remaining = 9; - $iter = function () use (&$values) { - while ($value = array_pop($values)) { - yield $value; - } - }; - $each = new EachPromise($iter(), [ - 'concurrency' => 1, - 'fulfilled' => function ($r) use (&$results, &$values, &$remaining) { - $results[] = $r; - if ($remaining > 0) { - $values[] = $remaining--; - } - } - ]); - $each->promise()->wait(); - $this->assertSame(range(10, 1), $results); - } - - public function testDoesNotCallNextOnIteratorUntilNeededWhenAsync() - { - $firstPromise = new Promise(); - $pending = [$firstPromise]; - $values = [$firstPromise]; - $results = []; - $remaining = 9; - $iter = function () use (&$values) { - while ($value = array_pop($values)) { - yield $value; - } - }; - $each = new EachPromise($iter(), [ - 'concurrency' => 1, - 'fulfilled' => function ($r) use (&$results, &$values, &$remaining, &$pending) { - $results[] = $r; - if ($remaining-- > 0) { - $pending[] = $values[] = new Promise(); - } - } - ]); - $i = 0; - $each->promise(); - while ($promise = array_pop($pending)) { - $promise->resolve($i++); - P\Utils::queue()->run(); - } - $this->assertSame(range(0, 9), $results); - } - - private function createSelfResolvingPromise($value) - { - $p = new Promise(function () use (&$p, $value) { - $p->resolve($value); - }); - $trickCsFixer = true; - - return $p; - } - - public function testMutexPreventsGeneratorRecursion() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $results = $promises = []; - for ($i = 0; $i < 20; $i++) { - $p = $this->createSelfResolvingPromise($i); - $pending[] = $p; - $promises[] = $p; - } - - $iter = function () use (&$promises, &$pending) { - foreach ($promises as $promise) { - // Resolve a promises, which will trigger the then() function, - // which would cause the EachPromise to try to add more - // promises to the queue. Without a lock, this would trigger - // a "Cannot resume an already running generator" fatal error. - if ($p = array_pop($pending)) { - $p->wait(); - } - yield $promise; - } - }; - - $each = new EachPromise($iter(), [ - 'concurrency' => 5, - 'fulfilled' => function ($r) use (&$results, &$pending) { - $results[] = $r; - } - ]); - - $each->promise()->wait(); - $this->assertCount(20, $results); - } - - public function testIteratorWithSameKey() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $iter = function () { - yield 'foo' => $this->createSelfResolvingPromise(1); - yield 'foo' => $this->createSelfResolvingPromise(2); - yield 1 => $this->createSelfResolvingPromise(3); - yield 1 => $this->createSelfResolvingPromise(4); - }; - $called = 0; - $each = new EachPromise($iter(), [ - 'fulfilled' => function ($value, $idx, Promise $aggregate) use (&$called) { - $called++; - if ($value < 3) { - $this->assertSame('foo', $idx); - } else { - $this->assertSame(1, $idx); - } - }, - ]); - $each->promise()->wait(); - $this->assertSame(4, $called); - } - - public function testIsWaitableWhenLimited() - { - $promises = [ - $this->createSelfResolvingPromise('a'), - $this->createSelfResolvingPromise('c'), - $this->createSelfResolvingPromise('b'), - $this->createSelfResolvingPromise('d') - ]; - $called = []; - $each = new EachPromise($promises, [ - 'concurrency' => 2, - 'fulfilled' => function ($value) use (&$called) { - $called[] = $value; - } - ]); - $p = $each->promise(); - $this->assertNull($p->wait()); - $this->assertSame(['a', 'c', 'b', 'd'], $called); - $this->assertTrue(P\Is::fulfilled($p)); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/EachTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/EachTest.php deleted file mode 100644 index b6473b866..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/EachTest.php +++ /dev/null @@ -1,34 +0,0 @@ -resolve('a'); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::fulfilled($aggregate)); - } - - public function testEachLimitAllRejectsOnFailure() - { - $p = [new FulfilledPromise('a'), new RejectedPromise('b')]; - $aggregate = P\Each::ofLimitAll($p, 2); - - P\Utils::queue()->run(); - $this->assertTrue(P\Is::rejected($aggregate)); - - $result = P\Utils::inspect($aggregate); - $this->assertSame('b', $result['reason']); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php deleted file mode 100644 index 2bbc6a8d6..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/FulfilledPromiseTest.php +++ /dev/null @@ -1,113 +0,0 @@ -assertTrue(P\Is::fulfilled($p)); - $this->assertSame('foo', $p->wait(true)); - } - - public function testCannotCancel() - { - $p = new FulfilledPromise('foo'); - $this->assertTrue(P\Is::fulfilled($p)); - $p->cancel(); - $this->assertSame('foo', $p->wait()); - } - - /** - * @expectedExceptionMessage Cannot resolve a fulfilled promise - */ - public function testCannotResolve() - { - $this->expectException(\LogicException::class); - - $p = new FulfilledPromise('foo'); - $p->resolve('bar'); - } - - /** - * @expectedExceptionMessage Cannot reject a fulfilled promise - */ - public function testCannotReject() - { - $this->expectException(\LogicException::class); - - $p = new FulfilledPromise('foo'); - $p->reject('bar'); - } - - public function testCanResolveWithSameValue() - { - $p = new FulfilledPromise('foo'); - $p->resolve('foo'); - $this->assertSame('foo', $p->wait()); - } - - public function testCannotResolveWithPromise() - { - $this->expectException(\InvalidArgumentException::class); - - new FulfilledPromise(new Promise()); - } - - public function testReturnsSelfWhenNoOnFulfilled() - { - $p = new FulfilledPromise('a'); - $this->assertSame($p, $p->then()); - } - - public function testAsynchronouslyInvokesOnFulfilled() - { - $p = new FulfilledPromise('a'); - $r = null; - $f = function ($d) use (&$r) { $r = $d; }; - $p2 = $p->then($f); - $this->assertNotSame($p, $p2); - $this->assertNull($r); - P\Utils::queue()->run(); - $this->assertSame('a', $r); - } - - public function testReturnsNewRejectedWhenOnFulfilledFails() - { - $p = new FulfilledPromise('a'); - $f = function () { throw new \Exception('b'); }; - $p2 = $p->then($f); - $this->assertNotSame($p, $p2); - try { - $p2->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertSame('b', $e->getMessage()); - } - } - - public function testOtherwiseIsSugarForRejections() - { - $c = null; - $p = new FulfilledPromise('foo'); - $p->otherwise(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - } - - public function testDoesNotTryToFulfillTwiceDuringTrampoline() - { - $fp = new FulfilledPromise('a'); - $t1 = $fp->then(function ($v) { return $v . ' b'; }); - $t1->resolve('why!'); - $this->assertSame('why!', $t1->wait()); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/IsTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/IsTest.php deleted file mode 100644 index 0a7ade3fd..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/IsTest.php +++ /dev/null @@ -1,40 +0,0 @@ -assertTrue(P\Is::fulfilled($p)); - $this->assertFalse(P\Is::rejected($p)); - } - - public function testKnowsIfRejected() - { - $p = new RejectedPromise(null); - $this->assertTrue(P\Is::rejected($p)); - $this->assertFalse(P\Is::fulfilled($p)); - } - - public function testKnowsIfSettled() - { - $p = new RejectedPromise(null); - $this->assertTrue(P\Is::settled($p)); - $this->assertFalse(P\Is::pending($p)); - } - - public function testKnowsIfPending() - { - $p = new Promise(); - $this->assertFalse(P\Is::settled($p)); - $this->assertTrue(P\Is::pending($p)); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php b/lib/Google/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php deleted file mode 100644 index bb1bc763e..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/NotPromiseInstance.php +++ /dev/null @@ -1,49 +0,0 @@ -nextPromise = new Promise(); - } - - public function then(callable $res = null, callable $rej = null) - { - return $this->nextPromise->then($res, $rej); - } - - public function otherwise(callable $onRejected) - { - return $this->then($onRejected); - } - - public function resolve($value) - { - $this->nextPromise->resolve($value); - } - - public function reject($reason) - { - $this->nextPromise->reject($reason); - } - - public function wait($unwrap = true, $defaultResolution = null) - { - } - - public function cancel() - { - } - - public function getState() - { - return $this->nextPromise->getState(); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/PromiseTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/PromiseTest.php deleted file mode 100644 index 7e4e91428..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/PromiseTest.php +++ /dev/null @@ -1,761 +0,0 @@ -expectException(\LogicException::class); - $this->expectExceptionMessage('The promise is already fulfilled'); - - $p = new Promise(); - $p->resolve('foo'); - $p->resolve('bar'); - $this->assertSame('foo', $p->wait()); - } - - public function testCanResolveWithSameValue() - { - $p = new Promise(); - $p->resolve('foo'); - $p->resolve('foo'); - $this->assertSame('foo', $p->wait()); - } - - public function testCannotRejectNonPendingPromise() - { - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Cannot change a fulfilled promise to rejected'); - - $p = new Promise(); - $p->resolve('foo'); - $p->reject('bar'); - $this->assertSame('foo', $p->wait()); - } - - public function testCanRejectWithSameValue() - { - $p = new Promise(); - $p->reject('foo'); - $p->reject('foo'); - $this->assertTrue(P\Is::rejected($p)); - } - - public function testCannotRejectResolveWithSameValue() - { - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Cannot change a fulfilled promise to rejected'); - - $p = new Promise(); - $p->resolve('foo'); - $p->reject('foo'); - } - - public function testInvokesWaitFunction() - { - $p = new Promise(function () use (&$p) { - $p->resolve('10'); - }); - $this->assertSame('10', $p->wait()); - } - - public function testRejectsAndThrowsWhenWaitFailsToResolve() - { - $this->expectException(\GuzzleHttp\Promise\RejectionException::class); - $this->expectExceptionMessage('The promise was rejected with reason: Invoking the wait callback did not resolve the promise'); - - $p = new Promise(function () {}); - $p->wait(); - } - - public function testThrowsWhenUnwrapIsRejectedWithNonException() - { - $this->expectException(\GuzzleHttp\Promise\RejectionException::class); - $this->expectExceptionMessage('The promise was rejected with reason: foo'); - - $p = new Promise(function () use (&$p) { - $p->reject('foo'); - }); - $p->wait(); - } - - public function testThrowsWhenUnwrapIsRejectedWithException() - { - $this->expectException(\UnexpectedValueException::class); - $this->expectExceptionMessage('foo'); - - $e = new \UnexpectedValueException('foo'); - $p = new Promise(function () use (&$p, $e) { - $p->reject($e); - }); - $p->wait(); - } - - public function testDoesNotUnwrapExceptionsWhenDisabled() - { - $p = new Promise(function () use (&$p) { - $p->reject('foo'); - }); - $this->assertTrue(P\Is::pending($p)); - $p->wait(false); - $this->assertTrue(P\Is::rejected($p)); - } - - public function testRejectsSelfWhenWaitThrows() - { - $e = new \UnexpectedValueException('foo'); - $p = new Promise(function () use ($e) { - throw $e; - }); - try { - $p->wait(); - $this->fail(); - } catch (\UnexpectedValueException $e) { - $this->assertTrue(P\Is::rejected($p)); - } - } - - public function testWaitsOnNestedPromises() - { - $p = new Promise(function () use (&$p) { - $p->resolve('_'); - }); - $p2 = new Promise(function () use (&$p2) { - $p2->resolve('foo'); - }); - $p3 = $p->then(function () use ($p2) { - return $p2; - }); - $this->assertSame('foo', $p3->wait()); - } - - public function testThrowsWhenWaitingOnPromiseWithNoWaitFunction() - { - $this->expectException(\GuzzleHttp\Promise\RejectionException::class); - - $p = new Promise(); - $p->wait(); - } - - public function testThrowsWaitExceptionAfterPromiseIsResolved() - { - $p = new Promise(function () use (&$p) { - $p->reject('Foo!'); - throw new \Exception('Bar?'); - }); - - try { - $p->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertSame('Bar?', $e->getMessage()); - } - } - - public function testGetsActualWaitValueFromThen() - { - $p = new Promise(function () use (&$p) { - $p->reject('Foo!'); - }); - $p2 = $p->then(null, function ($reason) { - return new RejectedPromise([$reason]); - }); - - try { - $p2->wait(); - $this->fail('Should have thrown'); - } catch (RejectionException $e) { - $this->assertSame(['Foo!'], $e->getReason()); - } - } - - public function testWaitBehaviorIsBasedOnLastPromiseInChain() - { - $p3 = new Promise(function () use (&$p3) { - $p3->resolve('Whoop'); - }); - $p2 = new Promise(function () use (&$p2, $p3) { - $p2->reject($p3); - }); - $p = new Promise(function () use (&$p, $p2) { - $p->reject($p2); - }); - $this->assertSame('Whoop', $p->wait()); - } - - public function testWaitsOnAPromiseChainEvenWhenNotUnwrapped() - { - $p2 = new Promise(function () use (&$p2) { - $p2->reject('Fail'); - }); - $p = new Promise(function () use ($p2, &$p) { - $p->resolve($p2); - }); - $p->wait(false); - $this->assertTrue(P\Is::rejected($p2)); - } - - public function testCannotCancelNonPending() - { - $p = new Promise(); - $p->resolve('foo'); - $p->cancel(); - $this->assertTrue(P\Is::fulfilled($p)); - } - - public function testCancelsPromiseWhenNoCancelFunction() - { - $this->expectException(\GuzzleHttp\Promise\CancellationException::class); - - $p = new Promise(); - $p->cancel(); - $this->assertTrue(P\Is::rejected($p)); - $p->wait(); - } - - public function testCancelsPromiseWithCancelFunction() - { - $called = false; - $p = new Promise(null, function () use (&$called) { - $called = true; - }); - $p->cancel(); - $this->assertTrue(P\Is::rejected($p)); - $this->assertTrue($called); - } - - public function testCancelsUppermostPendingPromise() - { - $called = false; - $p1 = new Promise(null, function () use (&$called) { - $called = true; - }); - $p2 = $p1->then(function () {}); - $p3 = $p2->then(function () {}); - $p4 = $p3->then(function () {}); - $p3->cancel(); - $this->assertTrue(P\Is::rejected($p1)); - $this->assertTrue(P\Is::rejected($p2)); - $this->assertTrue(P\Is::rejected($p3)); - $this->assertTrue(P\Is::pending($p4)); - $this->assertTrue($called); - - try { - $p3->wait(); - $this->fail(); - } catch (CancellationException $e) { - $this->assertStringContainsString('cancelled', $e->getMessage()); - } - - try { - $p4->wait(); - $this->fail(); - } catch (CancellationException $e) { - $this->assertStringContainsString('cancelled', $e->getMessage()); - } - - $this->assertTrue(P\Is::rejected($p4)); - } - - public function testCancelsChildPromises() - { - $called1 = $called2 = $called3 = false; - $p1 = new Promise(null, function () use (&$called1) { - $called1 = true; - }); - $p2 = new Promise(null, function () use (&$called2) { - $called2 = true; - }); - $p3 = new Promise(null, function () use (&$called3) { - $called3 = true; - }); - $p4 = $p2->then(function () use ($p3) { - return $p3; - }); - $p5 = $p4->then(function () { - $this->fail(); - }); - $p4->cancel(); - $this->assertTrue(P\Is::pending($p1)); - $this->assertTrue(P\Is::rejected($p2)); - $this->assertTrue(P\Is::pending($p3)); - $this->assertTrue(P\Is::rejected($p4)); - $this->assertTrue(P\Is::pending($p5)); - $this->assertFalse($called1); - $this->assertTrue($called2); - $this->assertFalse($called3); - } - - public function testRejectsPromiseWhenCancelFails() - { - $called = false; - $p = new Promise(null, function () use (&$called) { - $called = true; - throw new \Exception('e'); - }); - $p->cancel(); - $this->assertTrue(P\Is::rejected($p)); - $this->assertTrue($called); - try { - $p->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertSame('e', $e->getMessage()); - } - } - - public function testCreatesPromiseWhenFulfilledAfterThen() - { - $p = new Promise(); - $carry = null; - $p2 = $p->then(function ($v) use (&$carry) { - $carry = $v; - }); - $this->assertNotSame($p, $p2); - $p->resolve('foo'); - P\Utils::queue()->run(); - - $this->assertSame('foo', $carry); - } - - public function testCreatesPromiseWhenFulfilledBeforeThen() - { - $p = new Promise(); - $p->resolve('foo'); - $carry = null; - $p2 = $p->then(function ($v) use (&$carry) { - $carry = $v; - }); - $this->assertNotSame($p, $p2); - $this->assertNull($carry); - P\Utils::queue()->run(); - $this->assertSame('foo', $carry); - } - - public function testCreatesPromiseWhenFulfilledWithNoCallback() - { - $p = new Promise(); - $p->resolve('foo'); - $p2 = $p->then(); - $this->assertNotSame($p, $p2); - $this->assertInstanceOf(FulfilledPromise::class, $p2); - } - - public function testCreatesPromiseWhenRejectedAfterThen() - { - $p = new Promise(); - $carry = null; - $p2 = $p->then(null, function ($v) use (&$carry) { - $carry = $v; - }); - $this->assertNotSame($p, $p2); - $p->reject('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $carry); - } - - public function testCreatesPromiseWhenRejectedBeforeThen() - { - $p = new Promise(); - $p->reject('foo'); - $carry = null; - $p2 = $p->then(null, function ($v) use (&$carry) { - $carry = $v; - }); - $this->assertNotSame($p, $p2); - $this->assertNull($carry); - P\Utils::queue()->run(); - $this->assertSame('foo', $carry); - } - - public function testCreatesPromiseWhenRejectedWithNoCallback() - { - $p = new Promise(); - $p->reject('foo'); - $p2 = $p->then(); - $this->assertNotSame($p, $p2); - $this->assertInstanceOf(RejectedPromise::class, $p2); - } - - public function testInvokesWaitFnsForThens() - { - $p = new Promise(function () use (&$p) { - $p->resolve('a'); - }); - $p2 = $p - ->then(function ($v) { - return $v . '-1-'; - }) - ->then(function ($v) { - return $v . '2'; - }); - $this->assertSame('a-1-2', $p2->wait()); - } - - public function testStacksThenWaitFunctions() - { - $p1 = new Promise(function () use (&$p1) { - $p1->resolve('a'); - }); - $p2 = new Promise(function () use (&$p2) { - $p2->resolve('b'); - }); - $p3 = new Promise(function () use (&$p3) { - $p3->resolve('c'); - }); - $p4 = $p1 - ->then(function () use ($p2) { - return $p2; - }) - ->then(function () use ($p3) { - return $p3; - }); - $this->assertSame('c', $p4->wait()); - } - - public function testForwardsFulfilledDownChainBetweenGaps() - { - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(function ($v) use (&$r) { - $r = $v; - return $v . '2'; - }) - ->then(function ($v) use (&$r2) { - $r2 = $v; - }); - $p->resolve('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $r); - $this->assertSame('foo2', $r2); - } - - public function testForwardsRejectedPromisesDownChainBetweenGaps() - { - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r) { - $r = $v; - return $v . '2'; - }) - ->then(function ($v) use (&$r2) { - $r2 = $v; - }); - $p->reject('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $r); - $this->assertSame('foo2', $r2); - } - - public function testForwardsThrownPromisesDownChainBetweenGaps() - { - $e = new \Exception(); - $p = new Promise(); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r, $e) { - $r = $v; - throw $e; - }) - ->then( - null, - function ($v) use (&$r2) { - $r2 = $v; - } - ); - $p->reject('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $r); - $this->assertSame($e, $r2); - } - - public function testForwardsReturnedRejectedPromisesDownChainBetweenGaps() - { - $p = new Promise(); - $rejected = new RejectedPromise('bar'); - $r = $r2 = null; - $p->then(null, null) - ->then(null, function ($v) use (&$r, $rejected) { - $r = $v; - return $rejected; - }) - ->then( - null, - function ($v) use (&$r2) { - $r2 = $v; - } - ); - $p->reject('foo'); - P\Utils::queue()->run(); - $this->assertSame('foo', $r); - $this->assertSame('bar', $r2); - try { - $p->wait(); - } catch (RejectionException $e) { - $this->assertSame('foo', $e->getReason()); - } - } - - public function testForwardsHandlersToNextPromise() - { - $p = new Promise(); - $p2 = new Promise(); - $resolved = null; - $p - ->then(function ($v) use ($p2) { - return $p2; - }) - ->then(function ($value) use (&$resolved) { - $resolved = $value; - }); - $p->resolve('a'); - $p2->resolve('b'); - P\Utils::queue()->run(); - $this->assertSame('b', $resolved); - } - - public function testRemovesReferenceFromChildWhenParentWaitedUpon() - { - $r = null; - $p = new Promise(function () use (&$p) { - $p->resolve('a'); - }); - $p2 = new Promise(function () use (&$p2) { - $p2->resolve('b'); - }); - $pb = $p->then( - function ($v) use ($p2, &$r) { - $r = $v; - return $p2; - } - ) - ->then(function ($v) { - return $v . '.'; - }); - $this->assertSame('a', $p->wait()); - $this->assertSame('b', $p2->wait()); - $this->assertSame('b.', $pb->wait()); - $this->assertSame('a', $r); - } - - public function testForwardsHandlersWhenFulfilledPromiseIsReturned() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->resolve('foo'); - $p2->then(function ($v) use (&$res) { - $res[] = 'A:' . $v; - }); - // $res is A:foo - $p - ->then(function () use ($p2, &$res) { - $res[] = 'B'; - return $p2; - }) - ->then(function ($v) use (&$res) { - $res[] = 'C:' . $v; - }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { - $res[] = 'D:' . $v; - }); - P\Utils::queue()->run(); - $this->assertSame(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testForwardsHandlersWhenRejectedPromiseIsReturned() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->reject('foo'); - $p2->then(null, function ($v) use (&$res) { - $res[] = 'A:' . $v; - }); - $p->then(null, function () use ($p2, &$res) { - $res[] = 'B'; - return $p2; - }) - ->then(null, function ($v) use (&$res) { - $res[] = 'C:' . $v; - }); - $p->reject('a'); - $p->then(null, function ($v) use (&$res) { - $res[] = 'D:' . $v; - }); - P\Utils::queue()->run(); - $this->assertSame(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testDoesNotForwardRejectedPromise() - { - $res = []; - $p = new Promise(); - $p2 = new Promise(); - $p2->cancel(); - $p2->then(function ($v) use (&$res) { - $res[] = "B:$v"; - return $v; - }); - $p->then(function ($v) use ($p2, &$res) { - $res[] = "B:$v"; - return $p2; - }) - ->then(function ($v) use (&$res) { - $res[] = 'C:' . $v; - }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { - $res[] = 'D:' . $v; - }); - P\Utils::queue()->run(); - $this->assertSame(['B:a', 'D:a'], $res); - } - - public function testRecursivelyForwardsWhenOnlyThennable() - { - $res = []; - $p = new Promise(); - $p2 = new Thennable(); - $p2->resolve('foo'); - $p2->then(function ($v) use (&$res) { - $res[] = 'A:' . $v; - }); - $p->then(function () use ($p2, &$res) { - $res[] = 'B'; - return $p2; - }) - ->then(function ($v) use (&$res) { - $res[] = 'C:' . $v; - }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { - $res[] = 'D:' . $v; - }); - P\Utils::queue()->run(); - $this->assertSame(['A:foo', 'B', 'D:a', 'C:foo'], $res); - } - - public function testRecursivelyForwardsWhenNotInstanceOfPromise() - { - $res = []; - $p = new Promise(); - $p2 = new NotPromiseInstance(); - $p2->then(function ($v) use (&$res) { - $res[] = 'A:' . $v; - }); - $p->then(function () use ($p2, &$res) { - $res[] = 'B'; - return $p2; - }) - ->then(function ($v) use (&$res) { - $res[] = 'C:' . $v; - }); - $p->resolve('a'); - $p->then(function ($v) use (&$res) { - $res[] = 'D:' . $v; - }); - P\Utils::queue()->run(); - $this->assertSame(['B', 'D:a'], $res); - $p2->resolve('foo'); - P\Utils::queue()->run(); - $this->assertSame(['B', 'D:a', 'A:foo', 'C:foo'], $res); - } - - public function testCannotResolveWithSelf() - { - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Cannot fulfill or reject a promise with itself'); - - $p = new Promise(); - $p->resolve($p); - } - - public function testCannotRejectWithSelf() - { - $this->expectException(\LogicException::class); - $this->expectExceptionMessage('Cannot fulfill or reject a promise with itself'); - - $p = new Promise(); - $p->reject($p); - } - - public function testDoesNotBlowStackWhenWaitingOnNestedThens() - { - $inner = new Promise(function () use (&$inner) { - $inner->resolve(0); - }); - $prev = $inner; - for ($i = 1; $i < 100; $i++) { - $prev = $prev->then(function ($i) { - return $i + 1; - }); - } - - $parent = new Promise(function () use (&$parent, $prev) { - $parent->resolve($prev); - }); - - $this->assertSame(99, $parent->wait()); - } - - public function testOtherwiseIsSugarForRejections() - { - $p = new Promise(); - $p->reject('foo'); - $p->otherwise(function ($v) use (&$c) { - $c = $v; - }); - P\Utils::queue()->run(); - $this->assertSame($c, 'foo'); - } - - public function testRepeatedWaitFulfilled() - { - $promise = new Promise(function () use (&$promise) { - $promise->resolve('foo'); - }); - - $this->assertSame('foo', $promise->wait()); - $this->assertSame('foo', $promise->wait()); - } - - public function testRepeatedWaitRejected() - { - $promise = new Promise(function () use (&$promise) { - $promise->reject(new \RuntimeException('foo')); - }); - - $exceptionCount = 0; - try { - $promise->wait(); - } catch (\Exception $e) { - $this->assertSame('foo', $e->getMessage()); - $exceptionCount++; - } - - try { - $promise->wait(); - } catch (\Exception $e) { - $this->assertSame('foo', $e->getMessage()); - $exceptionCount++; - } - - $this->assertSame(2, $exceptionCount); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/PropertyHelper.php b/lib/Google/vendor/guzzlehttp/promises/tests/PropertyHelper.php deleted file mode 100644 index d7757b09a..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/PropertyHelper.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ -class PropertyHelper -{ - /** - * @param object $object - * @param string $property - * - * @throws \ReflectionException - */ - public static function get($object, $property) - { - $property = (new \ReflectionObject($object))->getProperty($property); - $property->setAccessible(true); - - return $property->getValue($object); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php deleted file mode 100644 index 78b72cec1..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/RejectedPromiseTest.php +++ /dev/null @@ -1,149 +0,0 @@ -assertTrue(P\Is::rejected($p)); - try { - $p->wait(true); - $this->fail(); - } catch (\Exception $e) { - $this->assertTrue(P\Is::rejected($p)); - $this->assertStringContainsString('foo', $e->getMessage()); - } - } - - public function testCannotCancel() - { - $p = new RejectedPromise('foo'); - $p->cancel(); - $this->assertTrue(P\Is::rejected($p)); - } - - /** - * @exepctedExceptionMessage Cannot resolve a rejected promise - */ - public function testCannotResolve() - { - $this->expectException(\LogicException::class); - - $p = new RejectedPromise('foo'); - $p->resolve('bar'); - } - - /** - * @expectedExceptionMessage Cannot reject a rejected promise - */ - public function testCannotReject() - { - $this->expectException(\LogicException::class); - - $p = new RejectedPromise('foo'); - $p->reject('bar'); - } - - public function testCanRejectWithSameValue() - { - $p = new RejectedPromise('foo'); - $p->reject('foo'); - $this->assertTrue(P\Is::rejected($p)); - } - - public function testThrowsSpecificException() - { - $e = new \Exception(); - $p = new RejectedPromise($e); - try { - $p->wait(true); - $this->fail(); - } catch (\Exception $e2) { - $this->assertSame($e, $e2); - } - } - - public function testCannotResolveWithPromise() - { - $this->expectException(\InvalidArgumentException::class); - - new RejectedPromise(new Promise()); - } - - public function testReturnsSelfWhenNoOnReject() - { - $p = new RejectedPromise('a'); - $this->assertSame($p, $p->then()); - } - - public function testInvokesOnRejectedAsynchronously() - { - $p = new RejectedPromise('a'); - $r = null; - $f = function ($reason) use (&$r) { $r = $reason; }; - $p->then(null, $f); - $this->assertNull($r); - P\Utils::queue()->run(); - $this->assertSame('a', $r); - } - - public function testReturnsNewRejectedWhenOnRejectedFails() - { - $p = new RejectedPromise('a'); - $f = function () { throw new \Exception('b'); }; - $p2 = $p->then(null, $f); - $this->assertNotSame($p, $p2); - try { - $p2->wait(); - $this->fail(); - } catch (\Exception $e) { - $this->assertSame('b', $e->getMessage()); - } - } - - public function testWaitingIsNoOp() - { - $p = new RejectedPromise('a'); - $p->wait(false); - $this->assertTrue(P\Is::rejected($p)); - } - - public function testOtherwiseIsSugarForRejections() - { - $p = new RejectedPromise('foo'); - $p->otherwise(function ($v) use (&$c) { $c = $v; }); - P\Utils::queue()->run(); - $this->assertSame('foo', $c); - } - - public function testCanResolveThenWithSuccess() - { - $actual = null; - $p = new RejectedPromise('foo'); - $p->otherwise(function ($v) { - return $v . ' bar'; - })->then(function ($v) use (&$actual) { - $actual = $v; - }); - P\Utils::queue()->run(); - $this->assertSame('foo bar', $actual); - } - - public function testDoesNotTryToRejectTwiceDuringTrampoline() - { - $fp = new RejectedPromise('a'); - $t1 = $fp->then(null, function ($v) { return $v . ' b'; }); - $t1->resolve('why!'); - $this->assertSame('why!', $t1->wait()); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php deleted file mode 100644 index 0d2e9730e..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/RejectionExceptionTest.php +++ /dev/null @@ -1,28 +0,0 @@ -assertSame($thing, $e->getReason()); - $this->assertSame('The promise was rejected with reason: foo', $e->getMessage()); - } - - public function testCanGetReasonMessageFromJson() - { - $reason = new Thing2(); - $e = new RejectionException($reason); - $this->assertStringContainsString("{}", $e->getMessage()); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/TaskQueueTest.php b/lib/Google/vendor/guzzlehttp/promises/tests/TaskQueueTest.php deleted file mode 100644 index ad8be7722..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/TaskQueueTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertTrue($tq->isEmpty()); - } - - public function testKnowsIfFull() - { - $tq = new TaskQueue(false); - $tq->add(function () {}); - $this->assertFalse($tq->isEmpty()); - } - - public function testExecutesTasksInOrder() - { - $tq = new TaskQueue(false); - $called = []; - $tq->add(function () use (&$called) { $called[] = 'a'; }); - $tq->add(function () use (&$called) { $called[] = 'b'; }); - $tq->add(function () use (&$called) { $called[] = 'c'; }); - $tq->run(); - $this->assertSame(['a', 'b', 'c'], $called); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/Thennable.php b/lib/Google/vendor/guzzlehttp/promises/tests/Thennable.php deleted file mode 100644 index d3f326521..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/Thennable.php +++ /dev/null @@ -1,25 +0,0 @@ -nextPromise = new Promise(); - } - - public function then(callable $res = null, callable $rej = null) - { - return $this->nextPromise->then($res, $rej); - } - - public function resolve($value) - { - $this->nextPromise->resolve($value); - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/Thing1.php b/lib/Google/vendor/guzzlehttp/promises/tests/Thing1.php deleted file mode 100644 index 6902cbd6c..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/Thing1.php +++ /dev/null @@ -1,18 +0,0 @@ -message = $message; - } - - public function __toString() - { - return $this->message; - } -} diff --git a/lib/Google/vendor/guzzlehttp/promises/tests/Thing2.php b/lib/Google/vendor/guzzlehttp/promises/tests/Thing2.php deleted file mode 100644 index c762ea974..000000000 --- a/lib/Google/vendor/guzzlehttp/promises/tests/Thing2.php +++ /dev/null @@ -1,12 +0,0 @@ -resolve('a'); }); - $b = new Promise(function () use (&$b) { $b->reject('b'); }); - $c = new Promise(function () use (&$c, $e) { $c->reject($e); }); - $results = P\Utils::inspectAll([$a, $b, $c]); - $this->assertSame([ - ['state' => 'fulfilled', 'value' => 'a'], - ['state' => 'rejected', 'reason' => 'b'], - ['state' => 'rejected', 'reason' => $e] - ], $results); - } - - public function testUnwrapsPromisesWithNoDefaultAndFailure() - { - $this->expectException(\GuzzleHttp\Promise\RejectionException::class); - - $promises = [new FulfilledPromise('a'), new Promise()]; - P\Utils::unwrap($promises); - } - - public function testUnwrapsPromisesWithNoDefault() - { - $promises = [new FulfilledPromise('a')]; - $this->assertSame(['a'], P\Utils::unwrap($promises)); - } - - public function testUnwrapsPromisesWithKeys() - { - $promises = [ - 'foo' => new FulfilledPromise('a'), - 'bar' => new FulfilledPromise('b'), - ]; - $this->assertSame([ - 'foo' => 'a', - 'bar' => 'b' - ], P\Utils::unwrap($promises)); - } - - public function testAllAggregatesSortedArray() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = P\Utils::all([$a, $b, $c]); - $b->resolve('b'); - $a->resolve('a'); - $c->resolve('c'); - $d->then( - function ($value) use (&$result) { $result = $value; }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\Utils::queue()->run(); - $this->assertSame(['a', 'b', 'c'], $result); - } - - public function testPromisesDynamicallyAddedToStack() - { - $promises = new \ArrayIterator(); - $counter = 0; - $promises['a'] = new FulfilledPromise('a'); - $promises['b'] = $promise = new Promise(function () use (&$promise, &$promises, &$counter) { - $counter++; // Make sure the wait function is called only once - $promise->resolve('b'); - $promises['c'] = $subPromise = new Promise(function () use (&$subPromise) { - $subPromise->resolve('c'); - }); - }); - $result = P\Utils::all($promises, true)->wait(); - $this->assertCount(3, $promises); - $this->assertCount(3, $result); - $this->assertSame($result['c'], 'c'); - $this->assertSame(1, $counter); - } - - public function testAllThrowsWhenAnyRejected() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = P\Utils::all([$a, $b, $c]); - $b->resolve('b'); - $a->reject('fail'); - $c->resolve('c'); - $d->then( - function ($value) use (&$result) { $result = $value; }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\Utils::queue()->run(); - $this->assertSame('fail', $result); - } - - public function testSomeAggregatesSortedArrayWithMax() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = P\Utils::some(2, [$a, $b, $c]); - $b->resolve('b'); - $c->resolve('c'); - $a->resolve('a'); - $d->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame(['b', 'c'], $result); - } - - public function testSomeRejectsWhenTooManyRejections() - { - $a = new Promise(); - $b = new Promise(); - $d = P\Utils::some(2, [$a, $b]); - $a->reject('bad'); - $b->resolve('good'); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::rejected($d)); - $d->then(null, function ($reason) use (&$called) { - $called = $reason; - }); - P\Utils::queue()->run(); - $this->assertInstanceOf(AggregateException::class, $called); - $this->assertContains('bad', $called->getReason()); - } - - public function testCanWaitUntilSomeCountIsSatisfied() - { - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $b = new Promise(function () use (&$b) { $b->resolve('b'); }); - $c = new Promise(function () use (&$c) { $c->resolve('c'); }); - $d = P\Utils::some(2, [$a, $b, $c]); - $this->assertSame(['a', 'b'], $d->wait()); - } - - public function testThrowsIfImpossibleToWaitForSomeCount() - { - $this->expectException(\GuzzleHttp\Promise\AggregateException::class); - $this->expectExceptionMessage('Not enough promises to fulfill count'); - - $a = new Promise(function () use (&$a) { $a->resolve('a'); }); - $d = P\Utils::some(2, [$a]); - $d->wait(); - } - - public function testThrowsIfResolvedWithoutCountTotalResults() - { - $this->expectException(\GuzzleHttp\Promise\AggregateException::class); - $this->expectExceptionMessage('Not enough promises to fulfill count'); - - $a = new Promise(); - $b = new Promise(); - $d = P\Utils::some(3, [$a, $b]); - $a->resolve('a'); - $b->resolve('b'); - $d->wait(); - } - - public function testAnyReturnsFirstMatch() - { - $a = new Promise(); - $b = new Promise(); - $c = P\Utils::any([$a, $b]); - $b->resolve('b'); - $a->resolve('a'); - $c->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame('b', $result); - } - - public function testSettleFulfillsWithFulfilledAndRejected() - { - $a = new Promise(); - $b = new Promise(); - $c = new Promise(); - $d = P\Utils::settle([$a, $b, $c]); - $b->resolve('b'); - $c->resolve('c'); - $a->reject('a'); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::fulfilled($d)); - $d->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame([ - ['state' => 'rejected', 'reason' => 'a'], - ['state' => 'fulfilled', 'value' => 'b'], - ['state' => 'fulfilled', 'value' => 'c'] - ], $result); - } - - public function testCanInspectFulfilledPromise() - { - $p = new FulfilledPromise('foo'); - $this->assertSame([ - 'state' => 'fulfilled', - 'value' => 'foo' - ], P\Utils::inspect($p)); - } - - public function testCanInspectRejectedPromise() - { - $p = new RejectedPromise('foo'); - $this->assertSame([ - 'state' => 'rejected', - 'reason' => 'foo' - ], P\Utils::inspect($p)); - } - - public function testCanInspectRejectedPromiseWithNormalException() - { - $e = new \Exception('foo'); - $p = new RejectedPromise($e); - $this->assertSame([ - 'state' => 'rejected', - 'reason' => $e - ], P\Utils::inspect($p)); - } - - public function testReturnsTrampoline() - { - $this->assertInstanceOf(TaskQueue::class, P\Utils::queue()); - $this->assertSame(P\Utils::queue(), P\Utils::queue()); - } - - public function testCanScheduleThunk() - { - $tramp = P\Utils::queue(); - $promise = P\Utils::task(function () { return 'Hi!'; }); - $c = null; - $promise->then(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - $tramp->run(); - $this->assertSame('Hi!', $c); - } - - public function testCanScheduleThunkWithRejection() - { - $tramp = P\Utils::queue(); - $promise = P\Utils::task(function () { throw new \Exception('Hi!'); }); - $c = null; - $promise->otherwise(function ($v) use (&$c) { $c = $v; }); - $this->assertNull($c); - $tramp->run(); - $this->assertSame('Hi!', $c->getMessage()); - } - - public function testCanScheduleThunkWithWait() - { - $tramp = P\Utils::queue(); - $promise = P\Utils::task(function () { return 'a'; }); - $this->assertSame('a', $promise->wait()); - $tramp->run(); - } - - public function testYieldsFromCoroutine() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = P\Coroutine::of(function () { - $value = (yield new FulfilledPromise('a')); - yield $value . 'b'; - }); - $promise->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame('ab', $result); - } - - public function testCanCatchExceptionsInCoroutine() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = P\Coroutine::of(function () { - try { - yield new RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (RejectionException $e) { - $value = (yield new FulfilledPromise($e->getReason())); - yield $value . 'b'; - } - }); - $promise->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::fulfilled($promise)); - $this->assertSame('ab', $result); - } - - /** - * @dataProvider rejectsParentExceptionProvider - */ - public function testRejectsParentExceptionWhenException(PromiseInterface $promise) - { - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\Utils::queue()->run(); - $this->assertInstanceOf(\Exception::class, $result); - $this->assertSame('a', $result->getMessage()); - } - - public function rejectsParentExceptionProvider() - { - return [ - [P\Coroutine::of(function () { - yield new FulfilledPromise(0); - throw new \Exception('a'); - })], - [P\Coroutine::of(function () { - throw new \Exception('a'); - yield new FulfilledPromise(0); - })], - ]; - } - - public function testCanRejectFromRejectionCallback() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = P\Coroutine::of(function () { - yield new FulfilledPromise(0); - yield new RejectedPromise('no!'); - }); - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - P\Utils::queue()->run(); - $this->assertInstanceOf(RejectionException::class, $result); - $this->assertSame('no!', $result->getReason()); - } - - public function testCanAsyncReject() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $rej = new Promise(); - $promise = P\Coroutine::of(function () use ($rej) { - yield new FulfilledPromise(0); - yield $rej; - }); - $promise->then( - function () { $this->fail(); }, - function ($reason) use (&$result) { $result = $reason; } - ); - $rej->reject('no!'); - P\Utils::queue()->run(); - $this->assertInstanceOf(RejectionException::class, $result); - $this->assertSame('no!', $result->getReason()); - } - - public function testCanCatchAndThrowOtherException() - { - $promise = P\Coroutine::of(function () { - try { - yield new RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (RejectionException $e) { - throw new \Exception('foo'); - } - }); - $promise->otherwise(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::rejected($promise)); - $this->assertStringContainsString('foo', $result->getMessage()); - } - - public function testCanCatchAndYieldOtherException() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = P\Coroutine::of(function () { - try { - yield new RejectedPromise('a'); - $this->fail('Should have thrown into the coroutine!'); - } catch (RejectionException $e) { - yield new RejectedPromise('foo'); - } - }); - $promise->otherwise(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertTrue(P\Is::rejected($promise)); - $this->assertStringContainsString('foo', $result->getMessage()); - } - - public function createLotsOfSynchronousPromise() - { - return P\Coroutine::of(function () { - $value = 0; - for ($i = 0; $i < 1000; $i++) { - $value = (yield new FulfilledPromise($i)); - } - yield $value; - }); - } - - public function testLotsOfSynchronousDoesNotBlowStack() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = $this->createLotsOfSynchronousPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\Utils::queue()->run(); - $this->assertSame(999, $r); - } - - public function testLotsOfSynchronousWaitDoesNotBlowStack() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = $this->createLotsOfSynchronousPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - $this->assertSame(999, $promise->wait()); - $this->assertSame(999, $r); - } - - private function createLotsOfFlappingPromise() - { - return P\Coroutine::of(function () { - $value = 0; - for ($i = 0; $i < 1000; $i++) { - try { - if ($i % 2) { - $value = (yield new FulfilledPromise($i)); - } else { - $value = (yield new RejectedPromise($i)); - } - } catch (\Exception $e) { - $value = (yield new FulfilledPromise($i)); - } - } - yield $value; - }); - } - - public function testLotsOfTryCatchingDoesNotBlowStack() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = $this->createLotsOfFlappingPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\Utils::queue()->run(); - $this->assertSame(999, $r); - } - - public function testLotsOfTryCatchingWaitingDoesNotBlowStack() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promise = $this->createLotsOfFlappingPromise(); - $promise->then(function ($v) use (&$r) { $r = $v; }); - $this->assertSame(999, $promise->wait()); - $this->assertSame(999, $r); - } - - public function testAsyncPromisesWithCorrectlyYieldedValues() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promises = [ - new Promise(), - new Promise(), - new Promise(), - ]; - - eval(' - $promise = \GuzzleHttp\Promise\Coroutine::of(function () use ($promises) { - $value = null; - $this->assertSame(\'skip\', (yield new \GuzzleHttp\Promise\FulfilledPromise(\'skip\'))); - foreach ($promises as $idx => $p) { - $value = (yield $p); - $this->assertSame($idx, $value); - $this->assertSame(\'skip\', (yield new \GuzzleHttp\Promise\FulfilledPromise(\'skip\'))); - } - $this->assertSame(\'skip\', (yield new \GuzzleHttp\Promise\FulfilledPromise(\'skip\'))); - yield $value; - }); -'); - - $promises[0]->resolve(0); - $promises[1]->resolve(1); - $promises[2]->resolve(2); - - $promise->then(function ($v) use (&$r) { $r = $v; }); - P\Utils::queue()->run(); - $this->assertSame(2, $r); - } - - public function testYieldFinalWaitablePromise() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $p1 = new Promise(function () use (&$p1) { - $p1->resolve('skip me'); - }); - $p2 = new Promise(function () use (&$p2) { - $p2->resolve('hello!'); - }); - $co = P\Coroutine::of(function () use ($p1, $p2) { - yield $p1; - yield $p2; - }); - P\Utils::queue()->run(); - $this->assertSame('hello!', $co->wait()); - } - - public function testCanYieldFinalPendingPromise() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $p1 = new Promise(); - $p2 = new Promise(); - $co = P\Coroutine::of(function () use ($p1, $p2) { - yield $p1; - yield $p2; - }); - $p1->resolve('a'); - $p2->resolve('b'); - $co->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame('b', $result); - } - - public function testCanNestYieldsAndFailures() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $p1 = new Promise(); - $p2 = new Promise(); - $p3 = new Promise(); - $p4 = new Promise(); - $p5 = new Promise(); - $co = P\Coroutine::of(function () use ($p1, $p2, $p3, $p4, $p5) { - try { - yield $p1; - } catch (\Exception $e) { - yield $p2; - try { - yield $p3; - yield $p4; - } catch (\Exception $e) { - yield $p5; - } - } - }); - $p1->reject('a'); - $p2->resolve('b'); - $p3->resolve('c'); - $p4->reject('d'); - $p5->resolve('e'); - $co->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame('e', $result); - } - - public function testCanYieldErrorsAndSuccessesWithoutRecursion() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $promises = []; - for ($i = 0; $i < 20; $i++) { - $promises[] = new Promise(); - } - - $co = P\Coroutine::of(function () use ($promises) { - for ($i = 0; $i < 20; $i += 4) { - try { - yield $promises[$i]; - yield $promises[$i + 1]; - } catch (\Exception $e) { - yield $promises[$i + 2]; - yield $promises[$i + 3]; - } - } - }); - - for ($i = 0; $i < 20; $i += 4) { - $promises[$i]->resolve($i); - $promises[$i + 1]->reject($i + 1); - $promises[$i + 2]->resolve($i + 2); - $promises[$i + 3]->resolve($i + 3); - } - - $co->then(function ($value) use (&$result) { $result = $value; }); - P\Utils::queue()->run(); - $this->assertSame(19, $result); - } - - public function testCanWaitOnPromiseAfterFulfilled() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $f = function () { - static $i = 0; - $i++; - return $p = new Promise(function () use (&$p, $i) { - $p->resolve($i . '-bar'); - }); - }; - - $promises = []; - for ($i = 0; $i < 20; $i++) { - $promises[] = $f(); - } - - $p = P\Coroutine::of(function () use ($promises) { - yield new FulfilledPromise('foo!'); - foreach ($promises as $promise) { - yield $promise; - } - }); - - $this->assertSame('20-bar', $p->wait()); - } - - public function testCanWaitOnErroredPromises() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $p1 = new Promise(function () use (&$p1) { $p1->reject('a'); }); - $p2 = new Promise(function () use (&$p2) { $p2->resolve('b'); }); - $p3 = new Promise(function () use (&$p3) { $p3->resolve('c'); }); - $p4 = new Promise(function () use (&$p4) { $p4->reject('d'); }); - $p5 = new Promise(function () use (&$p5) { $p5->resolve('e'); }); - $p6 = new Promise(function () use (&$p6) { $p6->reject('f'); }); - - $co = P\Coroutine::of(function () use ($p1, $p2, $p3, $p4, $p5, $p6) { - try { - yield $p1; - } catch (\Exception $e) { - yield $p2; - try { - yield $p3; - yield $p4; - } catch (\Exception $e) { - yield $p5; - yield $p6; - } - } - }); - - $res = P\Utils::inspect($co); - $this->assertSame('f', $res['reason']); - } - - public function testCoroutineOtherwiseIntegrationTest() - { - if (defined('HHVM_VERSION')) { - $this->markTestIncomplete('Broken on HHVM.'); - } - - $a = new Promise(); - $b = new Promise(); - $promise = P\Coroutine::of(function () use ($a, $b) { - // Execute the pool of commands concurrently, and process errors. - yield $a; - yield $b; - })->otherwise(function (\Exception $e) { - // Throw errors from the operations as a specific Multipart error. - throw new \OutOfBoundsException('a', 0, $e); - }); - $a->resolve('a'); - $b->reject('b'); - $reason = P\Utils::inspect($promise)['reason']; - $this->assertInstanceOf(\OutOfBoundsException::class, $reason); - $this->assertInstanceOf(RejectionException::class, $reason->getPrevious()); - } - - public function testCanManuallySettleTaskQueueGeneratedPromises() - { - $p1 = P\Utils::task(function () { return 'a'; }); - $p2 = P\Utils::task(function () { return 'b'; }); - $p3 = P\Utils::task(function () { return 'c'; }); - - $p1->cancel(); - $p2->resolve('b2'); - - $results = P\Utils::inspectAll([$p1, $p2, $p3]); - - $this->assertSame([ - ['state' => 'rejected', 'reason' => 'Promise has been cancelled'], - ['state' => 'fulfilled', 'value' => 'b2'], - ['state' => 'fulfilled', 'value' => 'c'] - ], $results); - } -} diff --git a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md index fa716c094..d897feedd 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md +++ b/lib/Google/vendor/guzzlehttp/psr7/CHANGELOG.md @@ -5,7 +5,28 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## Unreleased +## 2.6.1 - 2023-08-27 + +### Fixed + +- Properly handle the fact that PHP transforms numeric strings in array keys to ints + +## 2.6.0 - 2023-08-03 + +### Changed + +- Updated the mime type map to add some new entries, fix a couple of invalid entries, and remove an invalid entry +- Fallback to `application/octet-stream` if we are unable to guess the content type for a multipart file upload + +## 2.5.1 - 2023-08-03 + +### Fixed + +- Corrected mime type for `.acc` files to `audio/aac` + +### Changed + +- PHP 8.3 support ## 2.5.0 - 2023-04-17 diff --git a/lib/Google/vendor/guzzlehttp/psr7/README.md b/lib/Google/vendor/guzzlehttp/psr7/README.md index 9566a7d47..a64ec9046 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/README.md +++ b/lib/Google/vendor/guzzlehttp/psr7/README.md @@ -8,16 +8,24 @@ functionality like query string parsing. ![Static analysis](https://github.com/guzzle/psr7/workflows/Static%20analysis/badge.svg) -# Installation +## Features + +This package comes with a number of stream implementations and stream +decorators. + + +## Installation ```shell composer require guzzlehttp/psr7 ``` -# Stream implementation +## Version Guidance -This package comes with a number of stream implementations and stream -decorators. +| Version | Status | PHP Version | +|---------|---------------------|--------------| +| 1.x | Security fixes only | >=5.4,<8.1 | +| 2.x | Latest | >=7.2.5,<8.4 | ## AppendStream @@ -855,14 +863,6 @@ This of course assumes they will be resolved against the same base URI. If this equivalence or difference of relative references does not mean anything. -## Version Guidance - -| Version | Status | PHP Version | -|---------|----------------|------------------| -| 1.x | Security fixes | >=5.4,<8.1 | -| 2.x | Latest | ^7.2.5 \|\| ^8.0 | - - ## Security If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information. diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/AppendStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/AppendStream.php index cbcfaee65..ee8f37882 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/AppendStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/AppendStream.php @@ -40,12 +40,14 @@ public function __toString(): string { try { $this->rewind(); + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -138,9 +140,9 @@ public function getSize(): ?int public function eof(): bool { - return !$this->streams || - ($this->current >= count($this->streams) - 1 && - $this->streams[$this->current]->eof()); + return !$this->streams + || ($this->current >= count($this->streams) - 1 + && $this->streams[$this->current]->eof()); } public function rewind(): void @@ -167,7 +169,7 @@ public function seek($offset, $whence = SEEK_SET): void $stream->rewind(); } catch (\Exception $e) { throw new \RuntimeException('Unable to seek stream ' - . $i . ' of the AppendStream', 0, $e); + .$i.' of the AppendStream', 0, $e); } } @@ -197,7 +199,7 @@ public function read($length): string if ($this->current === $total) { break; } - $this->current++; + ++$this->current; } $result = $this->streams[$this->current]->read($remaining); @@ -237,8 +239,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/BufferStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/BufferStream.php index 21be8c0a9..2b0eb77be 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/BufferStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/BufferStream.php @@ -134,8 +134,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/FnStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/FnStream.php index 3a1a9512e..9fdddb9c6 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/FnStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/FnStream.php @@ -18,7 +18,7 @@ final class FnStream implements StreamInterface private const SLOTS = [ '__toString', 'close', 'detach', 'rewind', 'getSize', 'tell', 'eof', 'isSeekable', 'seek', 'isWritable', 'write', - 'isReadable', 'read', 'getContents', 'getMetadata' + 'isReadable', 'read', 'getContents', 'getMetadata', ]; /** @var array */ @@ -33,7 +33,7 @@ public function __construct(array $methods) // Create the functions on the class foreach ($methods as $name => $fn) { - $this->{'_fn_' . $name} = $fn; + $this->{'_fn_'.$name} = $fn; } } @@ -45,7 +45,7 @@ public function __construct(array $methods) public function __get(string $name): void { throw new \BadMethodCallException(str_replace('_fn_', '', $name) - . '() is not implemented in the FnStream'); + .'() is not implemented in the FnStream'); } /** @@ -99,6 +99,7 @@ public function __toString(): string throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -169,8 +170,6 @@ public function getContents(): string } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Header.php b/lib/Google/vendor/guzzlehttp/psr7/src/Header.php index 4d7005b22..6e38e0031 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Header.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Header.php @@ -89,7 +89,7 @@ public static function splitList($values): array $v = ''; $isQuoted = false; $isEscaped = false; - for ($i = 0, $max = \strlen($value); $i < $max; $i++) { + for ($i = 0, $max = \strlen($value); $i < $max; ++$i) { if ($isEscaped) { $v .= $value[$i]; $isEscaped = false; diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php b/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php index 30be222fc..73d17e337 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/HttpFactory.php @@ -23,13 +23,7 @@ * Note: in consuming code it is recommended to require the implemented interfaces * and inject the instance of this class multiple times. */ -final class HttpFactory implements - RequestFactoryInterface, - ResponseFactoryInterface, - ServerRequestFactoryInterface, - StreamFactoryInterface, - UploadedFileFactoryInterface, - UriFactoryInterface +final class HttpFactory implements RequestFactoryInterface, ResponseFactoryInterface, ServerRequestFactoryInterface, StreamFactoryInterface, UploadedFileFactoryInterface, UriFactoryInterface { public function createUploadedFile( StreamInterface $stream, diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/InflateStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/InflateStream.php index 8e00f1c32..599b55da3 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/InflateStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/InflateStream.php @@ -13,9 +13,9 @@ * then appends the zlib.inflate filter. The stream is then converted back * to a Guzzle stream resource to be used as a Guzzle stream. * - * @link http://tools.ietf.org/html/rfc1950 - * @link http://tools.ietf.org/html/rfc1952 - * @link http://php.net/manual/en/filters.compression.php + * @see http://tools.ietf.org/html/rfc1950 + * @see http://tools.ietf.org/html/rfc1952 + * @see http://php.net/manual/en/filters.compression.php */ final class InflateStream implements StreamInterface { diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Message.php b/lib/Google/vendor/guzzlehttp/psr7/src/Message.php index c1e15f826..6e6c3e51b 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Message.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Message.php @@ -18,31 +18,31 @@ final class Message public static function toString(MessageInterface $message): string { if ($message instanceof RequestInterface) { - $msg = trim($message->getMethod() . ' ' - . $message->getRequestTarget()) - . ' HTTP/' . $message->getProtocolVersion(); + $msg = trim($message->getMethod().' ' + .$message->getRequestTarget()) + .' HTTP/'.$message->getProtocolVersion(); if (!$message->hasHeader('host')) { - $msg .= "\r\nHost: " . $message->getUri()->getHost(); + $msg .= "\r\nHost: ".$message->getUri()->getHost(); } } elseif ($message instanceof ResponseInterface) { - $msg = 'HTTP/' . $message->getProtocolVersion() . ' ' - . $message->getStatusCode() . ' ' - . $message->getReasonPhrase(); + $msg = 'HTTP/'.$message->getProtocolVersion().' ' + .$message->getStatusCode().' ' + .$message->getReasonPhrase(); } else { throw new \InvalidArgumentException('Unknown message type'); } foreach ($message->getHeaders() as $name => $values) { - if (strtolower($name) === 'set-cookie') { + if (is_string($name) && strtolower($name) === 'set-cookie') { foreach ($values as $value) { - $msg .= "\r\n{$name}: " . $value; + $msg .= "\r\n{$name}: ".$value; } } else { - $msg .= "\r\n{$name}: " . implode(', ', $values); + $msg .= "\r\n{$name}: ".implode(', ', $values); } } - return "{$msg}\r\n\r\n" . $message->getBody(); + return "{$msg}\r\n\r\n".$message->getBody(); } /** @@ -190,7 +190,7 @@ public static function parseRequestUri(string $path, array $headers): string $host = $headers[reset($hostKey)][0]; $scheme = substr($host, -4) === ':443' ? 'https' : 'http'; - return $scheme . '://' . $host . '/' . ltrim($path, '/'); + return $scheme.'://'.$host.'/'.ltrim($path, '/'); } /** @@ -231,7 +231,7 @@ public static function parseResponse(string $message): ResponseInterface // between status-code and reason-phrase is required. But browsers accept // responses without space and reason as well. if (!preg_match('/^HTTP\/.* [0-9]{3}( .*|$)/', $data['start-line'])) { - throw new \InvalidArgumentException('Invalid response string: ' . $data['start-line']); + throw new \InvalidArgumentException('Invalid response string: '.$data['start-line']); } $parts = explode(' ', $data['start-line'], 3); diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/MessageTrait.php b/lib/Google/vendor/guzzlehttp/psr7/src/MessageTrait.php index 464bdfaa4..e05ebea88 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/MessageTrait.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/MessageTrait.php @@ -12,11 +12,11 @@ */ trait MessageTrait { - /** @var array Map of all registered headers, as original name => array of values */ + /** @var string[][] Map of all registered headers, as original name => array of values */ private $headers = []; - /** @var array Map of lowercase header name => original name at registration */ - private $headerNames = []; + /** @var string[] Map of lowercase header name => original name at registration */ + private $headerNames = []; /** @var string */ private $protocol = '1.1'; @@ -37,6 +37,7 @@ public function withProtocolVersion($version): MessageInterface $new = clone $this; $new->protocol = $version; + return $new; } @@ -135,6 +136,7 @@ public function withBody(StreamInterface $body): MessageInterface $new = clone $this; $new->stream = $body; + return $new; } @@ -224,7 +226,7 @@ private function assertHeader($header): void )); } - if (! preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { + if (!preg_match('/^[a-zA-Z0-9\'`#$%&*+.^_|~!-]+$/D', $header)) { throw new \InvalidArgumentException( sprintf('"%s" is not valid header name.', $header) ); @@ -254,7 +256,7 @@ private function assertValue(string $value): void // Clients must not send a request with line folding and a server sending folded headers is // likely very rare. Line folding is a fairly obscure feature of HTTP/1.1 and thus not accepting // folding is not likely to break any legitimate use case. - if (! preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { + if (!preg_match('/^[\x20\x09\x21-\x7E\x80-\xFF]*$/D', $value)) { throw new \InvalidArgumentException( sprintf('"%s" is not valid header value.', $value) ); diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/MimeType.php b/lib/Google/vendor/guzzlehttp/psr7/src/MimeType.php index 0debbd18c..b131bdbe7 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/MimeType.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/MimeType.php @@ -18,7 +18,7 @@ final class MimeType '7zip' => 'application/x-7z-compressed', '123' => 'application/vnd.lotus-1-2-3', 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-acc', + 'aac' => 'audio/aac', 'aam' => 'application/x-authorware-map', 'aas' => 'application/x-authorware-seg', 'abw' => 'application/x-abiword', @@ -29,6 +29,7 @@ final class MimeType 'acu' => 'application/vnd.acucobol', 'acutc' => 'application/vnd.acucorp', 'adp' => 'audio/adpcm', + 'adts' => 'audio/aac', 'aep' => 'application/vnd.audiograph', 'afm' => 'application/x-font-type1', 'afp' => 'application/vnd.ibm.modcap', @@ -41,11 +42,16 @@ final class MimeType 'air' => 'application/vnd.adobe.air-application-installer-package+zip', 'ait' => 'application/vnd.dvb.ait', 'ami' => 'application/vnd.amiga.ami', + 'aml' => 'application/automationml-aml+xml', + 'amlx' => 'application/automationml-amlx+zip', 'amr' => 'audio/amr', 'apk' => 'application/vnd.android.package-archive', 'apng' => 'image/apng', 'appcache' => 'text/cache-manifest', + 'appinstaller' => 'application/appinstaller', 'application' => 'application/x-ms-application', + 'appx' => 'application/appx', + 'appxbundle' => 'application/appxbundle', 'apr' => 'application/vnd.lotus-approach', 'arc' => 'application/x-freearc', 'arj' => 'application/x-arj', @@ -90,6 +96,7 @@ final class MimeType 'bpk' => 'application/octet-stream', 'bpmn' => 'application/octet-stream', 'bsp' => 'model/vnd.valve.source.compiled-map', + 'btf' => 'image/prs.btif', 'btif' => 'image/prs.btif', 'buffer' => 'application/octet-stream', 'bz' => 'application/x-bzip', @@ -141,6 +148,7 @@ final class MimeType 'cjs' => 'application/node', 'cla' => 'application/vnd.claymore', 'class' => 'application/octet-stream', + 'cld' => 'model/vnd.cld', 'clkk' => 'application/vnd.crick.clicker.keyboard', 'clkp' => 'application/vnd.crick.clicker.palette', 'clkt' => 'application/vnd.crick.clicker.template', @@ -175,6 +183,7 @@ final class MimeType 'csv' => 'text/csv', 'cu' => 'application/cu-seeme', 'curl' => 'text/vnd.curl', + 'cwl' => 'application/cwl', 'cww' => 'application/prs.cww', 'cxt' => 'application/x-director', 'cxx' => 'text/x-c', @@ -197,6 +206,7 @@ final class MimeType 'der' => 'application/x-x509-ca-cert', 'dfac' => 'application/vnd.dreamfactory', 'dgc' => 'application/x-dgc-compressed', + 'dib' => 'image/bmp', 'dic' => 'text/x-c', 'dir' => 'application/x-director', 'dis' => 'application/vnd.mobius.dis', @@ -219,6 +229,7 @@ final class MimeType 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dp' => 'application/vnd.osgi.dp', 'dpg' => 'application/vnd.dpgraph', + 'dpx' => 'image/dpx', 'dra' => 'audio/vnd.dra', 'drle' => 'image/dicom-rle', 'dsc' => 'text/prs.lines.tag', @@ -255,7 +266,6 @@ final class MimeType 'eot' => 'application/vnd.ms-fontobject', 'eps' => 'application/postscript', 'epub' => 'application/epub+zip', - 'es' => 'application/ecmascript', 'es3' => 'application/vnd.eszigno3+xml', 'esa' => 'application/vnd.osgi.subsystem', 'esf' => 'application/vnd.epson.esf', @@ -448,6 +458,7 @@ final class MimeType 'jsonld' => 'application/ld+json', 'jsonml' => 'application/jsonml+json', 'jsx' => 'text/jsx', + 'jt' => 'model/jt', 'jxr' => 'image/jxr', 'jxra' => 'image/jxra', 'jxrs' => 'image/jxrs', @@ -552,7 +563,7 @@ final class MimeType 'mime' => 'message/rfc822', 'mj2' => 'video/mj2', 'mjp2' => 'video/mj2', - 'mjs' => 'application/javascript', + 'mjs' => 'text/javascript', 'mk3d' => 'video/x-matroska', 'mka' => 'audio/x-matroska', 'mkd' => 'text/x-markdown', @@ -602,6 +613,8 @@ final class MimeType 'msg' => 'application/vnd.ms-outlook', 'msh' => 'model/mesh', 'msi' => 'application/x-msdownload', + 'msix' => 'application/msix', + 'msixbundle' => 'application/msixbundle', 'msl' => 'application/vnd.mobius.msl', 'msm' => 'application/octet-stream', 'msp' => 'application/octet-stream', @@ -775,6 +788,8 @@ final class MimeType 'pvb' => 'application/vnd.3gpp.pic-bw-var', 'pwn' => 'application/vnd.3m.post-it-notes', 'pya' => 'audio/vnd.ms-playready.media.pya', + 'pyo' => 'model/vnd.pytha.pyox', + 'pyox' => 'model/vnd.pytha.pyox', 'pyv' => 'video/vnd.ms-playready.media.pyv', 'qam' => 'application/vnd.epson.quickanime', 'qbo' => 'application/vnd.intu.qbo', @@ -923,10 +938,12 @@ final class MimeType 'st' => 'application/vnd.sailingtracker.track', 'stc' => 'application/vnd.sun.xml.calc.template', 'std' => 'application/vnd.sun.xml.draw.template', + 'step' => 'application/STEP', 'stf' => 'application/vnd.wt.stf', 'sti' => 'application/vnd.sun.xml.impress.template', 'stk' => 'application/hyperstudio', 'stl' => 'model/stl', + 'stp' => 'application/STEP', 'stpx' => 'model/step+xml', 'stpxz' => 'model/step-xml+zip', 'stpz' => 'model/step+zip', @@ -1013,10 +1030,12 @@ final class MimeType 'ulx' => 'application/x-glulx', 'umj' => 'application/vnd.umajin', 'unityweb' => 'application/vnd.unity', + 'uo' => 'application/vnd.uoml+xml', 'uoml' => 'application/vnd.uoml+xml', 'uri' => 'text/uri-list', 'uris' => 'text/uri-list', 'urls' => 'text/uri-list', + 'usda' => 'model/vnd.usda', 'usdz' => 'model/vnd.usdz+zip', 'ustar' => 'application/x-ustar', 'utz' => 'application/vnd.uiq.theme', @@ -1096,6 +1115,7 @@ final class MimeType 'webmanifest' => 'application/manifest+json', 'webp' => 'image/webp', 'wg' => 'application/vnd.pmi.widget', + 'wgsl' => 'text/wgsl', 'wgt' => 'application/widget', 'wif' => 'application/watcherinfo+xml', 'wks' => 'application/vnd.ms-works', @@ -1150,9 +1170,10 @@ final class MimeType 'xel' => 'application/xcap-el+xml', 'xenc' => 'application/xenc+xml', 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', + 'xfdf' => 'application/xfdf', 'xfdl' => 'application/vnd.xfdl', 'xht' => 'application/xhtml+xml', + 'xhtm' => 'application/vnd.pwg-xhtml-print+xml', 'xhtml' => 'application/xhtml+xml', 'xhvml' => 'application/xv+xml', 'xif' => 'image/vnd.xiff', @@ -1183,6 +1204,7 @@ final class MimeType 'xpw' => 'application/vnd.intercon.formnet', 'xpx' => 'application/vnd.intercon.formnet', 'xsd' => 'application/xml', + 'xsf' => 'application/prs.xsf+xml', 'xsl' => 'application/xml', 'xslt' => 'application/xslt+xml', 'xsm' => 'application/vnd.syncml+xml', @@ -1218,7 +1240,7 @@ final class MimeType /** * Determines the mimetype of a file by looking at its extension. * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromFilename(string $filename): ?string { @@ -1228,7 +1250,7 @@ public static function fromFilename(string $filename): ?string /** * Maps a file extensions to a mimetype. * - * @link https://raw.githubusercontent.com/jshttp/mime-db/master/db.json + * @see https://raw.githubusercontent.com/jshttp/mime-db/master/db.json */ public static function fromExtension(string $extension): ?string { diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php index 3e12b74d1..41c48eef8 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/MultipartStream.php @@ -60,7 +60,7 @@ private function getHeaders(array $headers): string $str .= "{$key}: {$value}\r\n"; } - return "--{$this->boundary}\r\n" . trim($str) . "\r\n\r\n"; + return "--{$this->boundary}\r\n".trim($str)."\r\n\r\n"; } /** @@ -72,7 +72,7 @@ protected function createStream(array $elements = []): StreamInterface foreach ($elements as $element) { if (!is_array($element)) { - throw new \UnexpectedValueException("An array is expected"); + throw new \UnexpectedValueException('An array is expected'); } $this->addElement($stream, $element); } @@ -137,9 +137,7 @@ private function createElement(string $name, StreamInterface $stream, ?string $f // Set a default Content-Type if one was not supplied $type = $this->getHeader($headers, 'content-type'); if (!$type && ($filename === '0' || $filename)) { - if ($type = MimeType::fromFilename($filename)) { - $headers['Content-Type'] = $type; - } + $headers['Content-Type'] = MimeType::fromFilename($filename) ?? 'application/octet-stream'; } return [$stream, $headers]; diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/PumpStream.php b/lib/Google/vendor/guzzlehttp/psr7/src/PumpStream.php index e90389c3b..5585190cf 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/PumpStream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/PumpStream.php @@ -34,7 +34,7 @@ final class PumpStream implements StreamInterface private $buffer; /** - * @param callable(int): (string|null|false) $source Source of the stream data. The callable MAY + * @param callable(int): (string|false|null) $source Source of the stream data. The callable MAY * accept an integer argument used to control the * amount of data to return. The callable MUST * return a string when called, or false|null on error @@ -60,6 +60,7 @@ public function __toString(): string throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -149,8 +150,6 @@ public function getContents(): string } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) @@ -169,6 +168,7 @@ private function pump(int $length): void $data = call_user_func($this->source, $length); if ($data === false || $data === null) { $this->source = null; + return; } $this->buffer->write($data); diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Query.php b/lib/Google/vendor/guzzlehttp/psr7/src/Query.php index 2faab3a88..8b9492797 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Query.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Query.php @@ -93,7 +93,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri $qs .= $k; $v = is_bool($v) ? (int) $v : $v; if ($v !== null) { - $qs .= '=' . $encoder((string) $v); + $qs .= '='.$encoder((string) $v); } $qs .= '&'; } else { @@ -101,7 +101,7 @@ public static function build(array $params, $encoding = PHP_QUERY_RFC3986): stri $qs .= $k; $vv = is_bool($vv) ? (int) $vv : $vv; if ($vv !== null) { - $qs .= '=' . $encoder((string) $vv); + $qs .= '='.$encoder((string) $vv); } $qs .= '&'; } diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Request.php b/lib/Google/vendor/guzzlehttp/psr7/src/Request.php index b17af66a2..db29d95d3 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Request.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Request.php @@ -69,7 +69,7 @@ public function getRequestTarget(): string $target = '/'; } if ($this->uri->getQuery() != '') { - $target .= '?' . $this->uri->getQuery(); + $target .= '?'.$this->uri->getQuery(); } return $target; @@ -85,6 +85,7 @@ public function withRequestTarget($requestTarget): RequestInterface $new = clone $this; $new->requestTarget = $requestTarget; + return $new; } @@ -98,6 +99,7 @@ public function withMethod($method): RequestInterface $this->assertMethod($method); $new = clone $this; $new->method = strtoupper($method); + return $new; } @@ -131,7 +133,7 @@ private function updateHostFromUri(): void } if (($port = $this->uri->getPort()) !== null) { - $host .= ':' . $port; + $host .= ':'.$port; } if (isset($this->headerNames['host'])) { diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Response.php b/lib/Google/vendor/guzzlehttp/psr7/src/Response.php index 4c6ee6f03..8fc11478b 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Response.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Response.php @@ -138,6 +138,7 @@ public function withStatus($code, $reasonPhrase = ''): ResponseInterface $reasonPhrase = self::PHRASES[$new->statusCode]; } $new->reasonPhrase = (string) $reasonPhrase; + return $new; } diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Rfc7230.php b/lib/Google/vendor/guzzlehttp/psr7/src/Rfc7230.php index 30224018d..8219dba4d 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Rfc7230.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Rfc7230.php @@ -14,7 +14,7 @@ final class Rfc7230 * * Note: header delimiter (\r\n) is modified to \r?\n to accept line feed only delimiters for BC reasons. * - * @link https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 + * @see https://github.com/amphp/http/blob/v1.0.1/src/Rfc7230.php#L12-L15 * * @license https://github.com/amphp/http/blob/v1.0.1/LICENSE */ diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/ServerRequest.php b/lib/Google/vendor/guzzlehttp/psr7/src/ServerRequest.php index b2aa382da..c852d96f5 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/ServerRequest.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/ServerRequest.php @@ -144,10 +144,10 @@ private static function normalizeNestedFileSpec(array $files = []): array foreach (array_keys($files['tmp_name']) as $key) { $spec = [ 'tmp_name' => $files['tmp_name'][$key], - 'size' => $files['size'][$key] ?? null, - 'error' => $files['error'][$key] ?? null, - 'name' => $files['name'][$key] ?? null, - 'type' => $files['type'][$key] ?? null, + 'size' => $files['size'][$key] ?? null, + 'error' => $files['error'][$key] ?? null, + 'name' => $files['name'][$key] ?? null, + 'type' => $files['type'][$key] ?? null, ]; $normalizedFiles[$key] = self::createUploadedFileFromSpec($spec); } @@ -182,7 +182,7 @@ public static function fromGlobals(): ServerRequestInterface private static function extractHostAndPortFromAuthority(string $authority): array { - $uri = 'http://' . $authority; + $uri = 'http://'.$authority; $parts = parse_url($uri); if (false === $parts) { return [null, null]; @@ -286,8 +286,6 @@ public function withQueryParams(array $query): ServerRequestInterface } /** - * {@inheritdoc} - * * @return array|object|null */ public function getParsedBody() @@ -309,8 +307,6 @@ public function getAttributes(): array } /** - * {@inheritdoc} - * * @return mixed */ public function getAttribute($attribute, $default = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Stream.php b/lib/Google/vendor/guzzlehttp/psr7/src/Stream.php index ecd31861e..f730ddacf 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Stream.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Stream.php @@ -61,8 +61,8 @@ public function __construct($stream, array $options = []) $this->stream = $stream; $meta = stream_get_meta_data($this->stream); $this->seekable = $meta['seekable']; - $this->readable = (bool)preg_match(self::READABLE_MODES, $meta['mode']); - $this->writable = (bool)preg_match(self::WRITABLE_MODES, $meta['mode']); + $this->readable = (bool) preg_match(self::READABLE_MODES, $meta['mode']); + $this->writable = (bool) preg_match(self::WRITABLE_MODES, $meta['mode']); $this->uri = $this->getMetadata('uri'); } @@ -80,12 +80,14 @@ public function __toString(): string if ($this->isSeekable()) { $this->seek(0); } + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -145,6 +147,7 @@ public function getSize(): ?int $stats = fstat($this->stream); if (is_array($stats) && isset($stats['size'])) { $this->size = $stats['size']; + return $this->size; } @@ -207,7 +210,7 @@ public function seek($offset, $whence = SEEK_SET): void } if (fseek($this->stream, $offset, $whence) === -1) { throw new \RuntimeException('Unable to seek to stream position ' - . $offset . ' with whence ' . var_export($whence, true)); + .$offset.' with whence '.var_export($whence, true)); } } @@ -261,8 +264,6 @@ public function write($string): int } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php b/lib/Google/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php index 56d4104d4..96196a3ea 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/StreamDecoratorTrait.php @@ -31,6 +31,7 @@ public function __get(string $name) { if ($name === 'stream') { $this->stream = $this->createStream(); + return $this->stream; } @@ -43,12 +44,14 @@ public function __toString(): string if ($this->isSeekable()) { $this->seek(0); } + return $this->getContents(); } catch (\Throwable $e) { if (\PHP_VERSION_ID >= 70400) { throw $e; } trigger_error(sprintf('%s::__toString exception: %s', self::class, (string) $e), E_USER_ERROR); + return ''; } } @@ -79,8 +82,6 @@ public function close(): void } /** - * {@inheritdoc} - * * @return mixed */ public function getMetadata($key = null) diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php b/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php index 2a9346403..b3655cb3a 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/StreamWrapper.php @@ -41,7 +41,7 @@ public static function getResource(StreamInterface $stream) $mode = 'w'; } else { throw new \InvalidArgumentException('The stream must be readable, ' - . 'writable, or both.'); + .'writable, or both.'); } return fopen('guzzle://stream', $mode, false, self::createStreamContext($stream)); @@ -55,7 +55,7 @@ public static function getResource(StreamInterface $stream) public static function createStreamContext(StreamInterface $stream) { return stream_context_create([ - 'guzzle' => ['stream' => $stream] + 'guzzle' => ['stream' => $stream], ]); } @@ -115,7 +115,7 @@ public function stream_seek(int $offset, int $whence): bool */ public function stream_cast(int $cast_as) { - $stream = clone($this->stream); + $stream = clone $this->stream; $resource = $stream->detach(); return $resource ?? false; @@ -127,27 +127,27 @@ public function stream_cast(int $cast_as) public function stream_stat(): array { static $modeMap = [ - 'r' => 33060, + 'r' => 33060, 'rb' => 33060, 'r+' => 33206, - 'w' => 33188, - 'wb' => 33188 + 'w' => 33188, + 'wb' => 33188, ]; return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => $modeMap[$this->mode], - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => $this->stream->getSize() ?: 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, + 'dev' => 0, + 'ino' => 0, + 'mode' => $modeMap[$this->mode], + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => $this->stream->getSize() ?: 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, 'blksize' => 0, - 'blocks' => 0 + 'blocks' => 0, ]; } @@ -157,19 +157,19 @@ public function stream_stat(): array public function url_stat(string $path, int $flags): array { return [ - 'dev' => 0, - 'ino' => 0, - 'mode' => 0, - 'nlink' => 0, - 'uid' => 0, - 'gid' => 0, - 'rdev' => 0, - 'size' => 0, - 'atime' => 0, - 'mtime' => 0, - 'ctime' => 0, + 'dev' => 0, + 'ino' => 0, + 'mode' => 0, + 'nlink' => 0, + 'uid' => 0, + 'gid' => 0, + 'rdev' => 0, + 'size' => 0, + 'atime' => 0, + 'mtime' => 0, + 'ctime' => 0, 'blksize' => 0, - 'blocks' => 0 + 'blocks' => 0, ]; } } diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php index 09e878d3d..fbba7f123 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Uri.php @@ -25,7 +25,7 @@ class Uri implements UriInterface, \JsonSerializable private const HTTP_DEFAULT_HOST = 'localhost'; private const DEFAULT_PORTS = [ - 'http' => 80, + 'http' => 80, 'https' => 443, 'ftp' => 21, 'gopher' => 70, @@ -41,14 +41,14 @@ class Uri implements UriInterface, \JsonSerializable /** * Unreserved characters for use in a regex. * - * @link https://tools.ietf.org/html/rfc3986#section-2.3 + * @see https://tools.ietf.org/html/rfc3986#section-2.3 */ private const CHAR_UNRESERVED = 'a-zA-Z0-9_\-\.~'; /** * Sub-delims for use in a regex. * - * @link https://tools.ietf.org/html/rfc3986#section-2.2 + * @see https://tools.ietf.org/html/rfc3986#section-2.2 */ private const CHAR_SUB_DELIMS = '!\$&\'\(\)\*\+,;='; private const QUERY_SEPARATORS_REPLACEMENT = ['=' => '%3D', '&' => '%26']; @@ -87,6 +87,7 @@ public function __construct(string $uri = '') $this->applyParts($parts); } } + /** * UTF-8 aware \parse_url() replacement. * @@ -121,7 +122,7 @@ static function ($matches) { $url ); - $result = parse_url($prefix . $encodedUrl); + $result = parse_url($prefix.$encodedUrl); if ($result === false) { return false; @@ -161,7 +162,7 @@ public function __toString(): string * `file:///` is the more common syntax for the file scheme anyway (Chrome for example redirects to * that format). * - * @link https://tools.ietf.org/html/rfc3986#section-5.3 + * @see https://tools.ietf.org/html/rfc3986#section-5.3 */ public static function composeComponents(?string $scheme, ?string $authority, string $path, ?string $query, ?string $fragment): string { @@ -169,25 +170,25 @@ public static function composeComponents(?string $scheme, ?string $authority, st // weak type checks to also accept null until we can add scalar type hints if ($scheme != '') { - $uri .= $scheme . ':'; + $uri .= $scheme.':'; } if ($authority != '' || $scheme === 'file') { - $uri .= '//' . $authority; + $uri .= '//'.$authority; } if ($authority != '' && $path != '' && $path[0] != '/') { - $path = '/' . $path; + $path = '/'.$path; } $uri .= $path; if ($query != '') { - $uri .= '?' . $query; + $uri .= '?'.$query; } if ($fragment != '') { - $uri .= '#' . $fragment; + $uri .= '#'.$fragment; } return $uri; @@ -218,7 +219,7 @@ public static function isDefaultPort(UriInterface $uri): bool * @see Uri::isNetworkPathReference * @see Uri::isAbsolutePathReference * @see Uri::isRelativePathReference - * @link https://tools.ietf.org/html/rfc3986#section-4 + * @see https://tools.ietf.org/html/rfc3986#section-4 */ public static function isAbsolute(UriInterface $uri): bool { @@ -230,7 +231,7 @@ public static function isAbsolute(UriInterface $uri): bool * * A relative reference that begins with two slash characters is termed an network-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isNetworkPathReference(UriInterface $uri): bool { @@ -242,7 +243,7 @@ public static function isNetworkPathReference(UriInterface $uri): bool * * A relative reference that begins with a single slash character is termed an absolute-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isAbsolutePathReference(UriInterface $uri): bool { @@ -257,7 +258,7 @@ public static function isAbsolutePathReference(UriInterface $uri): bool * * A relative reference that does not begin with a slash character is termed a relative-path reference. * - * @link https://tools.ietf.org/html/rfc3986#section-4.2 + * @see https://tools.ietf.org/html/rfc3986#section-4.2 */ public static function isRelativePathReference(UriInterface $uri): bool { @@ -276,7 +277,7 @@ public static function isRelativePathReference(UriInterface $uri): bool * @param UriInterface $uri The URI to check * @param UriInterface|null $base An optional base URI to compare against * - * @link https://tools.ietf.org/html/rfc3986#section-4.4 + * @see https://tools.ietf.org/html/rfc3986#section-4.4 */ public static function isSameDocumentReference(UriInterface $uri, UriInterface $base = null): bool { @@ -352,7 +353,7 @@ public static function withQueryValues(UriInterface $uri, array $keyValueArray): /** * Creates a URI from a hash of `parse_url` components. * - * @link http://php.net/manual/en/function.parse-url.php + * @see http://php.net/manual/en/function.parse-url.php * * @throws MalformedUriException If the components do not form a valid URI. */ @@ -374,11 +375,11 @@ public function getAuthority(): string { $authority = $this->host; if ($this->userInfo !== '') { - $authority = $this->userInfo . '@' . $authority; + $authority = $this->userInfo.'@'.$authority; } if ($this->port !== null) { - $authority .= ':' . $this->port; + $authority .= ':'.$this->port; } return $authority; @@ -435,7 +436,7 @@ public function withUserInfo($user, $password = null): UriInterface { $info = $this->filterUserInfoComponent($user); if ($password !== null) { - $info .= ':' . $this->filterUserInfoComponent($password); + $info .= ':'.$this->filterUserInfoComponent($password); } if ($this->userInfo === $info) { @@ -563,7 +564,7 @@ private function applyParts(array $parts): void ? $this->filterQueryAndFragment($parts['fragment']) : ''; if (isset($parts['pass'])) { - $this->userInfo .= ':' . $this->filterUserInfoComponent($parts['pass']); + $this->userInfo .= ':'.$this->filterUserInfoComponent($parts['pass']); } $this->removeDefaultPort(); @@ -595,7 +596,7 @@ private function filterUserInfoComponent($component): string } return preg_replace_callback( - '/(?:[^%' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . ']+|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^%'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.']+|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $component ); @@ -627,7 +628,7 @@ private function filterPort($port): ?int } $port = (int) $port; - if (0 > $port || 0xffff < $port) { + if (0 > $port || 0xFFFF < $port) { throw new \InvalidArgumentException( sprintf('Invalid port: %d. Must be between 0 and 65535', $port) ); @@ -664,7 +665,7 @@ private static function generateQueryString(string $key, ?string $value): string $queryString = strtr($key, self::QUERY_SEPARATORS_REPLACEMENT); if ($value !== null) { - $queryString .= '=' . strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); + $queryString .= '='.strtr($value, self::QUERY_SEPARATORS_REPLACEMENT); } return $queryString; @@ -691,7 +692,7 @@ private function filterPath($path): string } return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/]++|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $path ); @@ -711,7 +712,7 @@ private function filterQueryAndFragment($str): string } return preg_replace_callback( - '/(?:[^' . self::CHAR_UNRESERVED . self::CHAR_SUB_DELIMS . '%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', + '/(?:[^'.self::CHAR_UNRESERVED.self::CHAR_SUB_DELIMS.'%:@\/\?]++|%(?![A-Fa-f0-9]{2}))/', [$this, 'rawurlencodeMatchZero'], $str ); diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/UriNormalizer.php b/lib/Google/vendor/guzzlehttp/psr7/src/UriNormalizer.php index e12971edd..cd4c383aa 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/UriNormalizer.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/UriNormalizer.php @@ -11,7 +11,7 @@ * * @author Tobias Schultze * - * @link https://tools.ietf.org/html/rfc3986#section-6 + * @see https://tools.ietf.org/html/rfc3986#section-6 */ final class UriNormalizer { @@ -119,7 +119,7 @@ final class UriNormalizer * @param UriInterface $uri The URI to normalize * @param int $flags A bitmask of normalizations to apply, see constants * - * @link https://tools.ietf.org/html/rfc3986#section-6.2 + * @see https://tools.ietf.org/html/rfc3986#section-6.2 */ public static function normalize(UriInterface $uri, int $flags = self::PRESERVING_NORMALIZATIONS): UriInterface { @@ -131,8 +131,8 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN $uri = self::decodeUnreservedCharacters($uri); } - if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' && - ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') + if ($flags & self::CONVERT_EMPTY_PATH && $uri->getPath() === '' + && ($uri->getScheme() === 'http' || $uri->getScheme() === 'https') ) { $uri = $uri->withPath('/'); } @@ -174,7 +174,7 @@ public static function normalize(UriInterface $uri, int $flags = self::PRESERVIN * @param UriInterface $uri2 An URI to compare * @param int $normalizations A bitmask of normalizations to apply, see constants * - * @link https://tools.ietf.org/html/rfc3986#section-6.1 + * @see https://tools.ietf.org/html/rfc3986#section-6.1 */ public static function isEquivalent(UriInterface $uri1, UriInterface $uri2, int $normalizations = self::PRESERVING_NORMALIZATIONS): bool { diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/UriResolver.php b/lib/Google/vendor/guzzlehttp/psr7/src/UriResolver.php index 426e5c9ad..38d5793c7 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/UriResolver.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/UriResolver.php @@ -11,14 +11,14 @@ * * @author Tobias Schultze * - * @link https://tools.ietf.org/html/rfc3986#section-5 + * @see https://tools.ietf.org/html/rfc3986#section-5 */ final class UriResolver { /** * Removes dot segments from a path and returns the new path. * - * @link http://tools.ietf.org/html/rfc3986#section-5.2.4 + * @see http://tools.ietf.org/html/rfc3986#section-5.2.4 */ public static function removeDotSegments(string $path): string { @@ -40,7 +40,7 @@ public static function removeDotSegments(string $path): string if ($path[0] === '/' && (!isset($newPath[0]) || $newPath[0] !== '/')) { // Re-add the leading slash if necessary for cases like "/.." - $newPath = '/' . $newPath; + $newPath = '/'.$newPath; } elseif ($newPath !== '' && ($segment === '.' || $segment === '..')) { // Add the trailing slash if necessary // If newPath is not empty, then $segment must be set and is the last segment from the foreach @@ -53,7 +53,7 @@ public static function removeDotSegments(string $path): string /** * Converts the relative URI into a new URI that is resolved against the base URI. * - * @link http://tools.ietf.org/html/rfc3986#section-5.2 + * @see http://tools.ietf.org/html/rfc3986#section-5.2 */ public static function resolve(UriInterface $base, UriInterface $rel): UriInterface { @@ -80,13 +80,13 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf $targetPath = $rel->getPath(); } else { if ($targetAuthority != '' && $base->getPath() === '') { - $targetPath = '/' . $rel->getPath(); + $targetPath = '/'.$rel->getPath(); } else { $lastSlashPos = strrpos($base->getPath(), '/'); if ($lastSlashPos === false) { $targetPath = $rel->getPath(); } else { - $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1) . $rel->getPath(); + $targetPath = substr($base->getPath(), 0, $lastSlashPos + 1).$rel->getPath(); } } } @@ -127,8 +127,8 @@ public static function resolve(UriInterface $base, UriInterface $rel): UriInterf */ public static function relativize(UriInterface $base, UriInterface $target): UriInterface { - if ($target->getScheme() !== '' && - ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') + if ($target->getScheme() !== '' + && ($base->getScheme() !== $target->getScheme() || $target->getAuthority() === '' && $base->getAuthority() !== '') ) { return $target; } @@ -185,7 +185,7 @@ private static function getRelativePath(UriInterface $base, UriInterface $target } } $targetSegments[] = $targetLastSegment; - $relativePath = str_repeat('../', count($sourceSegments)) . implode('/', $targetSegments); + $relativePath = str_repeat('../', count($sourceSegments)).implode('/', $targetSegments); // A reference to am empty last segment or an empty first sub-segment must be prefixed with "./". // This also applies to a segment with a colon character (e.g., "file:colon") that cannot be used diff --git a/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php b/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php index 3a4cf3946..917c05e30 100644 --- a/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php +++ b/lib/Google/vendor/guzzlehttp/psr7/src/Utils.php @@ -90,6 +90,7 @@ public static function copyToString(StreamInterface $stream, int $maxLen = -1): } $buffer .= $buf; } + return $buffer; } @@ -174,7 +175,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): $standardPorts = ['http' => 80, 'https' => 443]; $scheme = $changes['uri']->getScheme(); if (isset($standardPorts[$scheme]) && $port != $standardPorts[$scheme]) { - $changes['set_headers']['Host'] .= ':' . $port; + $changes['set_headers']['Host'] .= ':'.$port; } } } @@ -230,7 +231,7 @@ public static function modifyRequest(RequestInterface $request, array $changes): * @param StreamInterface $stream Stream to read from * @param int|null $maxLength Maximum buffer length */ - public static function readLine(StreamInterface $stream, ?int $maxLength = null): string + public static function readLine(StreamInterface $stream, int $maxLength = null): string { $buffer = ''; $size = 0; @@ -291,6 +292,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt fwrite($stream, (string) $resource); fseek($stream, 0); } + return new Stream($stream, $options); } @@ -308,6 +310,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt fseek($stream, 0); $resource = $stream; } + return new Stream($resource, $options); case 'object': /** @var object $resource */ @@ -320,6 +323,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt } $result = $resource->current(); $resource->next(); + return $result; }, $options); } elseif (method_exists($resource, '__toString')) { @@ -334,7 +338,7 @@ public static function streamFor($resource = '', array $options = []): StreamInt return new PumpStream($resource, $options); } - throw new \InvalidArgumentException('Invalid resource type: ' . gettype($resource)); + throw new \InvalidArgumentException('Invalid resource type: '.gettype($resource)); } /** diff --git a/lib/Google/vendor/monolog/monolog/CHANGELOG.md b/lib/Google/vendor/monolog/monolog/CHANGELOG.md index 8a8c65124..aca1bdd0d 100644 --- a/lib/Google/vendor/monolog/monolog/CHANGELOG.md +++ b/lib/Google/vendor/monolog/monolog/CHANGELOG.md @@ -1,3 +1,9 @@ +### 2.9.2 (2023-10-27) + + * Fixed display_errors parsing in ErrorHandler which did not support string values (#1804) + * Fixed bug where the previous error handler would not be restored in some cases where StreamHandler fails (#1815) + * Fixed normalization error when normalizing incomplete classes (#1833) + ### 2.9.1 (2023-02-06) * Fixed Logger not being serializable anymore (#1792) diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/ErrorHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/ErrorHandler.php index 576f1713f..1406d34e8 100644 --- a/lib/Google/vendor/monolog/monolog/src/Monolog/ErrorHandler.php +++ b/lib/Google/vendor/monolog/monolog/src/Monolog/ErrorHandler.php @@ -198,7 +198,7 @@ private function handleException(\Throwable $e): void ($this->previousExceptionHandler)($e); } - if (!headers_sent() && !ini_get('display_errors')) { + if (!headers_sent() && in_array(strtolower((string) ini_get('display_errors')), ['0', '', 'false', 'off', 'none', 'no'], true)) { http_response_code(500); } diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php index b31b2971a..e6e789833 100644 --- a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php +++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/LineFormatter.php @@ -155,7 +155,7 @@ protected function normalizeException(\Throwable $e, int $depth = 0): string do { $depth++; if ($depth > $this->maxNormalizeDepth) { - $str .= '\n[previous exception] Over ' . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; + $str .= "\n[previous exception] Over " . $this->maxNormalizeDepth . ' levels deep, aborting normalization'; break; } diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php index 5441bc0aa..f926a842f 100644 --- a/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php +++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php @@ -174,6 +174,9 @@ protected function normalize($data, int $depth = 0) if ($data instanceof \JsonSerializable) { /** @var null|scalar|array $value */ $value = $data->jsonSerialize(); + } elseif (\get_class($data) === '__PHP_Incomplete_Class') { + $accessor = new \ArrayObject($data); + $value = (string) $accessor['__PHP_Incomplete_Class_Name']; } elseif (method_exists($data, '__toString')) { /** @var string $value */ $value = $data->__toString(); diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php similarity index 100% rename from lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticSearchHandler.php rename to lib/Google/vendor/monolog/monolog/src/Monolog/Handler/ElasticsearchHandler.php diff --git a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php index 651835122..82c048e1c 100644 --- a/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php +++ b/lib/Google/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php @@ -135,11 +135,14 @@ protected function write(array $record): void $this->createDir($url); $this->errorMessage = null; set_error_handler([$this, 'customErrorHandler']); - $stream = fopen($url, 'a'); - if ($this->filePermission !== null) { - @chmod($url, $this->filePermission); + try { + $stream = fopen($url, 'a'); + if ($this->filePermission !== null) { + @chmod($url, $this->filePermission); + } + } finally { + restore_error_handler(); } - restore_error_handler(); if (!is_resource($stream)) { $this->stream = null; diff --git a/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md b/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md index 5e5c6d99b..4ee6a4f9b 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md +++ b/lib/Google/vendor/phpseclib/phpseclib/BACKERS.md @@ -12,4 +12,5 @@ phpseclib ongoing development is made possible by [Tidelift](https://tidelift.co - [Charles Severance](https://github.com/csev) - [Rachel Fish](https://github.com/itsrachelfish) - Tharyrok -- [cjhaas](https://github.com/cjhaas) \ No newline at end of file +- [cjhaas](https://github.com/cjhaas) +- [istiak-tridip](https://github.com/istiak-tridip) \ No newline at end of file diff --git a/lib/Google/vendor/phpseclib/phpseclib/README.md b/lib/Google/vendor/phpseclib/phpseclib/README.md index 64c06ba28..bbb1e9f06 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/README.md +++ b/lib/Google/vendor/phpseclib/phpseclib/README.md @@ -51,8 +51,7 @@ SSH-2, SFTP, X.509, an arbitrary-precision integer arithmetic library, Ed25519 / * PHP4 compatible * Composer compatible (PSR-0 autoloading) * Install using Composer: `composer require phpseclib/phpseclib:~1.0` -* Install using PEAR: See [phpseclib PEAR Channel Documentation](http://phpseclib.sourceforge.net/pear.htm) -* [Download 1.0.20 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.20.zip/download) +* [Download 1.0.21 as ZIP](http://sourceforge.net/projects/phpseclib/files/phpseclib1.0.21.zip/download) ## Security contact information diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php index 407f03699..256c86906 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/AsymmetricKey.php @@ -130,7 +130,7 @@ protected static function initialize_static_variables() * * @param string $key * @param string $password optional - * @return AsymmetricKey + * @return \phpseclib3\Crypt\Common\PublicKey|\phpseclib3\Crypt\Common\PrivateKey */ public static function load($key, $password = false) { diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php index 2a376f113..00bfdd45c 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Common/SymmetricKey.php @@ -668,11 +668,11 @@ protected static function initialize_static_variables() switch (true) { // PHP_OS & "\xDF\xDF\xDF" == strtoupper(substr(PHP_OS, 0, 3)), but a lot faster case (PHP_OS & "\xDF\xDF\xDF") === 'WIN': - case (php_uname('m') & "\xDF\xDF\xDF") != 'ARM': + case !(is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM'): case defined('PHP_INT_SIZE') && PHP_INT_SIZE == 8: self::$use_reg_intval = true; break; - case (php_uname('m') & "\xDF\xDF\xDF") == 'ARM': + case is_string(php_uname('m')) && (php_uname('m') & "\xDF\xDF\xDF") == 'ARM': switch (true) { /* PHP 7.0.0 introduced a bug that affected 32-bit ARM processors: @@ -917,7 +917,7 @@ public function setKey($key) * @see Crypt/Hash.php * @param string $password * @param string $method - * @param string[] ...$func_args + * @param int|string ...$func_args * @throws \LengthException if pbkdf1 is being used and the derived key length exceeds the hash length * @throws \RuntimeException if bcrypt is being used and a salt isn't provided * @return bool diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php index 7b935cc2d..135719979 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/RSA.php @@ -841,15 +841,15 @@ public function withPadding($padding) self::ENCRYPTION_PKCS1, self::ENCRYPTION_NONE ]; - $numSelected = 0; + $encryptedCount = 0; $selected = 0; foreach ($masks as $mask) { if ($padding & $mask) { $selected = $mask; - $numSelected++; + $encryptedCount++; } } - if ($numSelected > 1) { + if ($encryptedCount > 1) { throw new InconsistentSetupException('Multiple encryption padding modes have been selected; at most only one should be selected'); } $encryptionPadding = $selected; @@ -859,22 +859,26 @@ public function withPadding($padding) self::SIGNATURE_RELAXED_PKCS1, self::SIGNATURE_PKCS1 ]; - $numSelected = 0; + $signatureCount = 0; $selected = 0; foreach ($masks as $mask) { if ($padding & $mask) { $selected = $mask; - $numSelected++; + $signatureCount++; } } - if ($numSelected > 1) { + if ($signatureCount > 1) { throw new InconsistentSetupException('Multiple signature padding modes have been selected; at most only one should be selected'); } $signaturePadding = $selected; $new = clone $this; - $new->encryptionPadding = $encryptionPadding; - $new->signaturePadding = $signaturePadding; + if ($encryptedCount) { + $new->encryptionPadding = $encryptionPadding; + } + if ($signatureCount) { + $new->signaturePadding = $signaturePadding; + } return $new; } diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php index cd8b76272..ff31f9c88 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php @@ -833,7 +833,6 @@ protected function setupInlineCrypt() // Generating encrypt code: $init_encrypt .= ' - static $tables; if (empty($tables)) { $tables = &$this->getTables(); } @@ -890,7 +889,6 @@ protected function setupInlineCrypt() // Generating decrypt code: $init_decrypt .= ' - static $invtables; if (empty($invtables)) { $invtables = &$this->getInvTables(); } @@ -947,7 +945,7 @@ protected function setupInlineCrypt() $this->inline_crypt = $this->createInlineCryptFunction( [ - 'init_crypt' => '', + 'init_crypt' => 'static $tables; static $invtables;', 'init_encrypt' => $init_encrypt, 'init_decrypt' => $init_decrypt, 'encrypt_block' => $encrypt_block, diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php index e21589c51..3096ff1a1 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/ASN1.php @@ -21,7 +21,6 @@ namespace phpseclib3\File; -use DateTime; use phpseclib3\Common\Functions\Strings; use phpseclib3\File\ASN1\Element; use phpseclib3\Math\BigInteger; @@ -205,7 +204,7 @@ public static function decodeBER($encoded) return null; } - return [self::decode_ber($encoded)]; + return [$decoded]; } /** @@ -1403,7 +1402,7 @@ public static function convert($in, $from = self::TYPE_UTF8_STRING, $to = self:: return false; } break; - case ($c & 0x80000000) != 0: + case ($c & (PHP_INT_SIZE == 8 ? 0x80000000 : (1 << 31))) != 0: return false; case $c >= 0x04000000: $v .= chr(0x80 | ($c & 0x3F)); diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php index 7aa278f2a..5e2f073f4 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/File/X509.php @@ -164,7 +164,7 @@ class X509 * * @var array */ - private $CAs; + private $CAs = []; /** * The currently loaded certificate @@ -315,6 +315,10 @@ public function __construct() 'id-at-uniqueIdentifier' => '2.5.4.45', 'id-at-role' => '2.5.4.72', 'id-at-postalAddress' => '2.5.4.16', + 'jurisdictionOfIncorporationCountryName' => '1.3.6.1.4.1.311.60.2.1.3', + 'jurisdictionOfIncorporationStateOrProvinceName' => '1.3.6.1.4.1.311.60.2.1.2', + 'jurisdictionLocalityName' => '1.3.6.1.4.1.311.60.2.1.1', + 'id-at-businessCategory' => '2.5.4.15', //'id-domainComponent' => '0.9.2342.19200300.100.1.25', //'pkcs-9' => '1.2.840.113549.1.9', @@ -1038,7 +1042,8 @@ public function validateURL($url) if ($names = $this->getExtension('id-ce-subjectAltName')) { foreach ($names as $name) { foreach ($name as $key => $value) { - $value = str_replace(['.', '*'], ['\.', '[^.]*'], $value); + $value = preg_quote($value); + $value = str_replace('\*', '[^.]*', $value); switch ($key) { case 'dNSName': /* From RFC2818 "HTTP over TLS": @@ -1538,6 +1543,20 @@ public static function encodeIP($ip) private function translateDNProp($propName) { switch (strtolower($propName)) { + case 'jurisdictionofincorporationcountryname': + case 'jurisdictioncountryname': + case 'jurisdictionc': + return 'jurisdictionOfIncorporationCountryName'; + case 'jurisdictionofincorporationstateorprovincename': + case 'jurisdictionstateorprovincename': + case 'jurisdictionst': + return 'jurisdictionOfIncorporationStateOrProvinceName'; + case 'jurisdictionlocalityname': + case 'jurisdictionl': + return 'jurisdictionLocalityName'; + case 'id-at-businesscategory': + case 'businesscategory': + return 'id-at-businessCategory'; case 'id-at-countryname': case 'countryname': case 'c': @@ -2030,9 +2049,6 @@ public function getChain() if (!is_array($this->currentCert) || !isset($this->currentCert['tbsCertificate'])) { return false; } - if (empty($this->CAs)) { - return $chain; - } while (true) { $currentCert = $chain[count($chain) - 1]; for ($i = 0; $i < count($this->CAs); $i++) { diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php index 70491abd6..3f4dc2ed7 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger.php @@ -29,6 +29,7 @@ use phpseclib3\Exception\BadConfigurationException; use phpseclib3\Math\BigInteger\Engines\Engine; +use UnexpectedValueException; /** * Pure-PHP arbitrary precision integer arithmetic library. Supports base-2, base-10, base-16, and base-256 @@ -100,10 +101,6 @@ public static function setEngine($main, array $modexps = ['DefaultEngine']) /** @var class-string $fqmain */ self::$mainEngine = $fqmain; - if (!in_array('Default', $modexps)) { - $modexps[] = 'DefaultEngine'; - } - $found = false; foreach ($modexps as $modexp) { try { @@ -140,18 +137,23 @@ private static function initialize_static_variables() { if (!isset(self::$mainEngine)) { $engines = [ - ['GMP'], + ['GMP', ['DefaultEngine']], ['PHP64', ['OpenSSL']], ['BCMath', ['OpenSSL']], - ['PHP32', ['OpenSSL']] + ['PHP32', ['OpenSSL']], + ['PHP64', ['DefaultEngine']], + ['PHP32', ['DefaultEngine']] ]; + foreach ($engines as $engine) { try { - self::setEngine($engine[0], isset($engine[1]) ? $engine[1] : []); - break; + self::setEngine($engine[0], $engine[1]); + return; } catch (\Exception $e) { } } + + throw new UnexpectedValueException('No valid BigInteger found. This is only possible when JIT is enabled on Windows and neither the GMP or BCMath extensions are available so either disable JIT or install GMP / BCMath'); } } diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php index 2b00bc37c..abdf3b475 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/Engine.php @@ -644,6 +644,11 @@ protected function powModOuter(Engine $e, Engine $n) return $this->normalize($temp->powModInner($e, $n)); } + if ($this->compare($n) > 0) { + list(, $temp) = $this->divide($n); + return $temp->powModInner($e, $n); + } + return $this->powModInner($e, $n); } diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php index ab9bdc99b..4c30da564 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP.php @@ -1326,4 +1326,18 @@ private function bitwise_small_split($split) return array_reverse($vals); } + + /** + * @return bool + */ + protected static function testJITOnWindows() + { + if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' && function_exists('opcache_get_status') && !defined('PHPSECLIB_ALLOW_JIT')) { + $status = opcache_get_status(); + if ($status && isset($status['jit']) && $status['jit']['enabled'] && $status['jit']['on']) { + return true; + } + } + return false; + } } diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php index 964cd170d..3a775e7db 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP32.php @@ -80,10 +80,10 @@ protected function initialize($base) } $step = count($vals) & 3; if ($step) { - $digit = floor($digit / pow(2, 2 * $step)); + $digit = (int) floor($digit / pow(2, 2 * $step)); } if ($step != 3) { - $digit &= static::MAX_DIGIT; + $digit = (int) fmod($digit, static::BASE_FULL); $i++; } $vals[] = $digit; @@ -102,7 +102,7 @@ protected function initialize($base) */ public static function isValidEngine() { - return PHP_INT_SIZE >= 4; + return PHP_INT_SIZE >= 4 && !self::testJITOnWindows(); } /** diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP64.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP64.php index ca11c08d4..70a2e173b 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP64.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/BigInteger/Engines/PHP64.php @@ -103,7 +103,7 @@ protected function initialize($base) */ public static function isValidEngine() { - return PHP_INT_SIZE >= 8; + return PHP_INT_SIZE >= 8 && !self::testJITOnWindows(); } /** diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php index 748f9a49f..ddb04912d 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Math/PrimeField/Integer.php @@ -312,8 +312,11 @@ public function negate() */ public function toBytes() { - $length = static::$modulo[$this->instanceID]->getLengthInBytes(); - return str_pad($this->value->toBytes(), $length, "\0", STR_PAD_LEFT); + if (isset(static::$modulo[$this->instanceID])) { + $length = static::$modulo[$this->instanceID]->getLengthInBytes(); + return str_pad($this->value->toBytes(), $length, "\0", STR_PAD_LEFT); + } + return $this->value->toBytes(); } /** diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php index 1c675a6e0..cdf0bec69 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php @@ -93,7 +93,7 @@ class SFTP extends SSH2 * @var array * @access private */ - private $packet_types = []; + private static $packet_types = []; /** * Status Codes @@ -102,19 +102,19 @@ class SFTP extends SSH2 * @var array * @access private */ - private $status_codes = []; + private static $status_codes = []; /** @var array */ - private $attributes; + private static $attributes; /** @var array */ - private $open_flags; + private static $open_flags; /** @var array */ - private $open_flags5; + private static $open_flags5; /** @var array */ - private $file_types; + private static $file_types; /** * The Request ID @@ -350,7 +350,9 @@ class SFTP extends SSH2 * * Connects to an SFTP server * - * @param string $host + * $host can either be a string, representing the host, or a stream resource. + * + * @param mixed $host * @param int $port * @param int $timeout */ @@ -360,154 +362,156 @@ public function __construct($host, $port = 22, $timeout = 10) $this->max_sftp_packet = 1 << 15; - $this->packet_types = [ - 1 => 'NET_SFTP_INIT', - 2 => 'NET_SFTP_VERSION', - 3 => 'NET_SFTP_OPEN', - 4 => 'NET_SFTP_CLOSE', - 5 => 'NET_SFTP_READ', - 6 => 'NET_SFTP_WRITE', - 7 => 'NET_SFTP_LSTAT', - 9 => 'NET_SFTP_SETSTAT', - 10 => 'NET_SFTP_FSETSTAT', - 11 => 'NET_SFTP_OPENDIR', - 12 => 'NET_SFTP_READDIR', - 13 => 'NET_SFTP_REMOVE', - 14 => 'NET_SFTP_MKDIR', - 15 => 'NET_SFTP_RMDIR', - 16 => 'NET_SFTP_REALPATH', - 17 => 'NET_SFTP_STAT', - 18 => 'NET_SFTP_RENAME', - 19 => 'NET_SFTP_READLINK', - 20 => 'NET_SFTP_SYMLINK', - 21 => 'NET_SFTP_LINK', - - 101 => 'NET_SFTP_STATUS', - 102 => 'NET_SFTP_HANDLE', - 103 => 'NET_SFTP_DATA', - 104 => 'NET_SFTP_NAME', - 105 => 'NET_SFTP_ATTRS', - - 200 => 'NET_SFTP_EXTENDED' - ]; - $this->status_codes = [ - 0 => 'NET_SFTP_STATUS_OK', - 1 => 'NET_SFTP_STATUS_EOF', - 2 => 'NET_SFTP_STATUS_NO_SUCH_FILE', - 3 => 'NET_SFTP_STATUS_PERMISSION_DENIED', - 4 => 'NET_SFTP_STATUS_FAILURE', - 5 => 'NET_SFTP_STATUS_BAD_MESSAGE', - 6 => 'NET_SFTP_STATUS_NO_CONNECTION', - 7 => 'NET_SFTP_STATUS_CONNECTION_LOST', - 8 => 'NET_SFTP_STATUS_OP_UNSUPPORTED', - 9 => 'NET_SFTP_STATUS_INVALID_HANDLE', - 10 => 'NET_SFTP_STATUS_NO_SUCH_PATH', - 11 => 'NET_SFTP_STATUS_FILE_ALREADY_EXISTS', - 12 => 'NET_SFTP_STATUS_WRITE_PROTECT', - 13 => 'NET_SFTP_STATUS_NO_MEDIA', - 14 => 'NET_SFTP_STATUS_NO_SPACE_ON_FILESYSTEM', - 15 => 'NET_SFTP_STATUS_QUOTA_EXCEEDED', - 16 => 'NET_SFTP_STATUS_UNKNOWN_PRINCIPAL', - 17 => 'NET_SFTP_STATUS_LOCK_CONFLICT', - 18 => 'NET_SFTP_STATUS_DIR_NOT_EMPTY', - 19 => 'NET_SFTP_STATUS_NOT_A_DIRECTORY', - 20 => 'NET_SFTP_STATUS_INVALID_FILENAME', - 21 => 'NET_SFTP_STATUS_LINK_LOOP', - 22 => 'NET_SFTP_STATUS_CANNOT_DELETE', - 23 => 'NET_SFTP_STATUS_INVALID_PARAMETER', - 24 => 'NET_SFTP_STATUS_FILE_IS_A_DIRECTORY', - 25 => 'NET_SFTP_STATUS_BYTE_RANGE_LOCK_CONFLICT', - 26 => 'NET_SFTP_STATUS_BYTE_RANGE_LOCK_REFUSED', - 27 => 'NET_SFTP_STATUS_DELETE_PENDING', - 28 => 'NET_SFTP_STATUS_FILE_CORRUPT', - 29 => 'NET_SFTP_STATUS_OWNER_INVALID', - 30 => 'NET_SFTP_STATUS_GROUP_INVALID', - 31 => 'NET_SFTP_STATUS_NO_MATCHING_BYTE_RANGE_LOCK' - ]; - // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1 - // the order, in this case, matters quite a lot - see \phpseclib3\Net\SFTP::_parseAttributes() to understand why - $this->attributes = [ - 0x00000001 => 'NET_SFTP_ATTR_SIZE', - 0x00000002 => 'NET_SFTP_ATTR_UIDGID', // defined in SFTPv3, removed in SFTPv4+ - 0x00000080 => 'NET_SFTP_ATTR_OWNERGROUP', // defined in SFTPv4+ - 0x00000004 => 'NET_SFTP_ATTR_PERMISSIONS', - 0x00000008 => 'NET_SFTP_ATTR_ACCESSTIME', - 0x00000010 => 'NET_SFTP_ATTR_CREATETIME', // SFTPv4+ - 0x00000020 => 'NET_SFTP_ATTR_MODIFYTIME', - 0x00000040 => 'NET_SFTP_ATTR_ACL', - 0x00000100 => 'NET_SFTP_ATTR_SUBSECOND_TIMES', - 0x00000200 => 'NET_SFTP_ATTR_BITS', // SFTPv5+ - 0x00000400 => 'NET_SFTP_ATTR_ALLOCATION_SIZE', // SFTPv6+ - 0x00000800 => 'NET_SFTP_ATTR_TEXT_HINT', - 0x00001000 => 'NET_SFTP_ATTR_MIME_TYPE', - 0x00002000 => 'NET_SFTP_ATTR_LINK_COUNT', - 0x00004000 => 'NET_SFTP_ATTR_UNTRANSLATED_NAME', - 0x00008000 => 'NET_SFTP_ATTR_CTIME', - // 0x80000000 will yield a floating point on 32-bit systems and converting floating points to integers - // yields inconsistent behavior depending on how php is compiled. so we left shift -1 (which, in - // two's compliment, consists of all 1 bits) by 31. on 64-bit systems this'll yield 0xFFFFFFFF80000000. - // that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored. - (PHP_INT_SIZE == 4 ? -1 : 0xFFFFFFFF) => 'NET_SFTP_ATTR_EXTENDED' - ]; - // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-6.3 - // the flag definitions change somewhat in SFTPv5+. if SFTPv5+ support is added to this library, maybe name - // the array for that $this->open5_flags and similarly alter the constant names. - $this->open_flags = [ - 0x00000001 => 'NET_SFTP_OPEN_READ', - 0x00000002 => 'NET_SFTP_OPEN_WRITE', - 0x00000004 => 'NET_SFTP_OPEN_APPEND', - 0x00000008 => 'NET_SFTP_OPEN_CREATE', - 0x00000010 => 'NET_SFTP_OPEN_TRUNCATE', - 0x00000020 => 'NET_SFTP_OPEN_EXCL', - 0x00000040 => 'NET_SFTP_OPEN_TEXT' // defined in SFTPv4 - ]; - // SFTPv5+ changed the flags up: - // https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-8.1.1.3 - $this->open_flags5 = [ - // when SSH_FXF_ACCESS_DISPOSITION is a 3 bit field that controls how the file is opened - 0x00000000 => 'NET_SFTP_OPEN_CREATE_NEW', - 0x00000001 => 'NET_SFTP_OPEN_CREATE_TRUNCATE', - 0x00000002 => 'NET_SFTP_OPEN_OPEN_EXISTING', - 0x00000003 => 'NET_SFTP_OPEN_OPEN_OR_CREATE', - 0x00000004 => 'NET_SFTP_OPEN_TRUNCATE_EXISTING', - // the rest of the flags are not supported - 0x00000008 => 'NET_SFTP_OPEN_APPEND_DATA', // "the offset field of SS_FXP_WRITE requests is ignored" - 0x00000010 => 'NET_SFTP_OPEN_APPEND_DATA_ATOMIC', - 0x00000020 => 'NET_SFTP_OPEN_TEXT_MODE', - 0x00000040 => 'NET_SFTP_OPEN_BLOCK_READ', - 0x00000080 => 'NET_SFTP_OPEN_BLOCK_WRITE', - 0x00000100 => 'NET_SFTP_OPEN_BLOCK_DELETE', - 0x00000200 => 'NET_SFTP_OPEN_BLOCK_ADVISORY', - 0x00000400 => 'NET_SFTP_OPEN_NOFOLLOW', - 0x00000800 => 'NET_SFTP_OPEN_DELETE_ON_CLOSE', - 0x00001000 => 'NET_SFTP_OPEN_ACCESS_AUDIT_ALARM_INFO', - 0x00002000 => 'NET_SFTP_OPEN_ACCESS_BACKUP', - 0x00004000 => 'NET_SFTP_OPEN_BACKUP_STREAM', - 0x00008000 => 'NET_SFTP_OPEN_OVERRIDE_OWNER', - ]; - // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-5.2 - // see \phpseclib3\Net\SFTP::_parseLongname() for an explanation - $this->file_types = [ - 1 => 'NET_SFTP_TYPE_REGULAR', - 2 => 'NET_SFTP_TYPE_DIRECTORY', - 3 => 'NET_SFTP_TYPE_SYMLINK', - 4 => 'NET_SFTP_TYPE_SPECIAL', - 5 => 'NET_SFTP_TYPE_UNKNOWN', - // the following types were first defined for use in SFTPv5+ - // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-05#section-5.2 - 6 => 'NET_SFTP_TYPE_SOCKET', - 7 => 'NET_SFTP_TYPE_CHAR_DEVICE', - 8 => 'NET_SFTP_TYPE_BLOCK_DEVICE', - 9 => 'NET_SFTP_TYPE_FIFO' - ]; - $this->define_array( - $this->packet_types, - $this->status_codes, - $this->attributes, - $this->open_flags, - $this->open_flags5, - $this->file_types - ); + if (empty(self::$packet_types)) { + self::$packet_types = [ + 1 => 'NET_SFTP_INIT', + 2 => 'NET_SFTP_VERSION', + 3 => 'NET_SFTP_OPEN', + 4 => 'NET_SFTP_CLOSE', + 5 => 'NET_SFTP_READ', + 6 => 'NET_SFTP_WRITE', + 7 => 'NET_SFTP_LSTAT', + 9 => 'NET_SFTP_SETSTAT', + 10 => 'NET_SFTP_FSETSTAT', + 11 => 'NET_SFTP_OPENDIR', + 12 => 'NET_SFTP_READDIR', + 13 => 'NET_SFTP_REMOVE', + 14 => 'NET_SFTP_MKDIR', + 15 => 'NET_SFTP_RMDIR', + 16 => 'NET_SFTP_REALPATH', + 17 => 'NET_SFTP_STAT', + 18 => 'NET_SFTP_RENAME', + 19 => 'NET_SFTP_READLINK', + 20 => 'NET_SFTP_SYMLINK', + 21 => 'NET_SFTP_LINK', + + 101 => 'NET_SFTP_STATUS', + 102 => 'NET_SFTP_HANDLE', + 103 => 'NET_SFTP_DATA', + 104 => 'NET_SFTP_NAME', + 105 => 'NET_SFTP_ATTRS', + + 200 => 'NET_SFTP_EXTENDED' + ]; + self::$status_codes = [ + 0 => 'NET_SFTP_STATUS_OK', + 1 => 'NET_SFTP_STATUS_EOF', + 2 => 'NET_SFTP_STATUS_NO_SUCH_FILE', + 3 => 'NET_SFTP_STATUS_PERMISSION_DENIED', + 4 => 'NET_SFTP_STATUS_FAILURE', + 5 => 'NET_SFTP_STATUS_BAD_MESSAGE', + 6 => 'NET_SFTP_STATUS_NO_CONNECTION', + 7 => 'NET_SFTP_STATUS_CONNECTION_LOST', + 8 => 'NET_SFTP_STATUS_OP_UNSUPPORTED', + 9 => 'NET_SFTP_STATUS_INVALID_HANDLE', + 10 => 'NET_SFTP_STATUS_NO_SUCH_PATH', + 11 => 'NET_SFTP_STATUS_FILE_ALREADY_EXISTS', + 12 => 'NET_SFTP_STATUS_WRITE_PROTECT', + 13 => 'NET_SFTP_STATUS_NO_MEDIA', + 14 => 'NET_SFTP_STATUS_NO_SPACE_ON_FILESYSTEM', + 15 => 'NET_SFTP_STATUS_QUOTA_EXCEEDED', + 16 => 'NET_SFTP_STATUS_UNKNOWN_PRINCIPAL', + 17 => 'NET_SFTP_STATUS_LOCK_CONFLICT', + 18 => 'NET_SFTP_STATUS_DIR_NOT_EMPTY', + 19 => 'NET_SFTP_STATUS_NOT_A_DIRECTORY', + 20 => 'NET_SFTP_STATUS_INVALID_FILENAME', + 21 => 'NET_SFTP_STATUS_LINK_LOOP', + 22 => 'NET_SFTP_STATUS_CANNOT_DELETE', + 23 => 'NET_SFTP_STATUS_INVALID_PARAMETER', + 24 => 'NET_SFTP_STATUS_FILE_IS_A_DIRECTORY', + 25 => 'NET_SFTP_STATUS_BYTE_RANGE_LOCK_CONFLICT', + 26 => 'NET_SFTP_STATUS_BYTE_RANGE_LOCK_REFUSED', + 27 => 'NET_SFTP_STATUS_DELETE_PENDING', + 28 => 'NET_SFTP_STATUS_FILE_CORRUPT', + 29 => 'NET_SFTP_STATUS_OWNER_INVALID', + 30 => 'NET_SFTP_STATUS_GROUP_INVALID', + 31 => 'NET_SFTP_STATUS_NO_MATCHING_BYTE_RANGE_LOCK' + ]; + // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13#section-7.1 + // the order, in this case, matters quite a lot - see \phpseclib3\Net\SFTP::_parseAttributes() to understand why + self::$attributes = [ + 0x00000001 => 'NET_SFTP_ATTR_SIZE', + 0x00000002 => 'NET_SFTP_ATTR_UIDGID', // defined in SFTPv3, removed in SFTPv4+ + 0x00000080 => 'NET_SFTP_ATTR_OWNERGROUP', // defined in SFTPv4+ + 0x00000004 => 'NET_SFTP_ATTR_PERMISSIONS', + 0x00000008 => 'NET_SFTP_ATTR_ACCESSTIME', + 0x00000010 => 'NET_SFTP_ATTR_CREATETIME', // SFTPv4+ + 0x00000020 => 'NET_SFTP_ATTR_MODIFYTIME', + 0x00000040 => 'NET_SFTP_ATTR_ACL', + 0x00000100 => 'NET_SFTP_ATTR_SUBSECOND_TIMES', + 0x00000200 => 'NET_SFTP_ATTR_BITS', // SFTPv5+ + 0x00000400 => 'NET_SFTP_ATTR_ALLOCATION_SIZE', // SFTPv6+ + 0x00000800 => 'NET_SFTP_ATTR_TEXT_HINT', + 0x00001000 => 'NET_SFTP_ATTR_MIME_TYPE', + 0x00002000 => 'NET_SFTP_ATTR_LINK_COUNT', + 0x00004000 => 'NET_SFTP_ATTR_UNTRANSLATED_NAME', + 0x00008000 => 'NET_SFTP_ATTR_CTIME', + // 0x80000000 will yield a floating point on 32-bit systems and converting floating points to integers + // yields inconsistent behavior depending on how php is compiled. so we left shift -1 (which, in + // two's compliment, consists of all 1 bits) by 31. on 64-bit systems this'll yield 0xFFFFFFFF80000000. + // that's not a problem, however, and 'anded' and a 32-bit number, as all the leading 1 bits are ignored. + (PHP_INT_SIZE == 4 ? (-1 << 31) : 0x80000000) => 'NET_SFTP_ATTR_EXTENDED' + ]; + // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-6.3 + // the flag definitions change somewhat in SFTPv5+. if SFTPv5+ support is added to this library, maybe name + // the array for that $this->open5_flags and similarly alter the constant names. + self::$open_flags = [ + 0x00000001 => 'NET_SFTP_OPEN_READ', + 0x00000002 => 'NET_SFTP_OPEN_WRITE', + 0x00000004 => 'NET_SFTP_OPEN_APPEND', + 0x00000008 => 'NET_SFTP_OPEN_CREATE', + 0x00000010 => 'NET_SFTP_OPEN_TRUNCATE', + 0x00000020 => 'NET_SFTP_OPEN_EXCL', + 0x00000040 => 'NET_SFTP_OPEN_TEXT' // defined in SFTPv4 + ]; + // SFTPv5+ changed the flags up: + // https://datatracker.ietf.org/doc/html/draft-ietf-secsh-filexfer-13#section-8.1.1.3 + self::$open_flags5 = [ + // when SSH_FXF_ACCESS_DISPOSITION is a 3 bit field that controls how the file is opened + 0x00000000 => 'NET_SFTP_OPEN_CREATE_NEW', + 0x00000001 => 'NET_SFTP_OPEN_CREATE_TRUNCATE', + 0x00000002 => 'NET_SFTP_OPEN_OPEN_EXISTING', + 0x00000003 => 'NET_SFTP_OPEN_OPEN_OR_CREATE', + 0x00000004 => 'NET_SFTP_OPEN_TRUNCATE_EXISTING', + // the rest of the flags are not supported + 0x00000008 => 'NET_SFTP_OPEN_APPEND_DATA', // "the offset field of SS_FXP_WRITE requests is ignored" + 0x00000010 => 'NET_SFTP_OPEN_APPEND_DATA_ATOMIC', + 0x00000020 => 'NET_SFTP_OPEN_TEXT_MODE', + 0x00000040 => 'NET_SFTP_OPEN_BLOCK_READ', + 0x00000080 => 'NET_SFTP_OPEN_BLOCK_WRITE', + 0x00000100 => 'NET_SFTP_OPEN_BLOCK_DELETE', + 0x00000200 => 'NET_SFTP_OPEN_BLOCK_ADVISORY', + 0x00000400 => 'NET_SFTP_OPEN_NOFOLLOW', + 0x00000800 => 'NET_SFTP_OPEN_DELETE_ON_CLOSE', + 0x00001000 => 'NET_SFTP_OPEN_ACCESS_AUDIT_ALARM_INFO', + 0x00002000 => 'NET_SFTP_OPEN_ACCESS_BACKUP', + 0x00004000 => 'NET_SFTP_OPEN_BACKUP_STREAM', + 0x00008000 => 'NET_SFTP_OPEN_OVERRIDE_OWNER', + ]; + // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-04#section-5.2 + // see \phpseclib3\Net\SFTP::_parseLongname() for an explanation + self::$file_types = [ + 1 => 'NET_SFTP_TYPE_REGULAR', + 2 => 'NET_SFTP_TYPE_DIRECTORY', + 3 => 'NET_SFTP_TYPE_SYMLINK', + 4 => 'NET_SFTP_TYPE_SPECIAL', + 5 => 'NET_SFTP_TYPE_UNKNOWN', + // the following types were first defined for use in SFTPv5+ + // http://tools.ietf.org/html/draft-ietf-secsh-filexfer-05#section-5.2 + 6 => 'NET_SFTP_TYPE_SOCKET', + 7 => 'NET_SFTP_TYPE_CHAR_DEVICE', + 8 => 'NET_SFTP_TYPE_BLOCK_DEVICE', + 9 => 'NET_SFTP_TYPE_FIFO' + ]; + self::define_array( + self::$packet_types, + self::$status_codes, + self::$attributes, + self::$open_flags, + self::$open_flags5, + self::$file_types + ); + } if (!defined('NET_SFTP_QUEUE_SIZE')) { define('NET_SFTP_QUEUE_SIZE', 32); @@ -543,22 +547,7 @@ private function precheck() */ private function partial_init_sftp_connection() { - $this->window_size_server_to_client[self::CHANNEL] = $this->window_size; - - $packet = Strings::packSSH2( - 'CsN3', - NET_SSH2_MSG_CHANNEL_OPEN, - 'session', - self::CHANNEL, - $this->window_size, - 0x4000 - ); - - $this->send_binary_packet($packet); - - $this->channel_status[self::CHANNEL] = NET_SSH2_MSG_CHANNEL_OPEN; - - $response = $this->get_channel_packet(self::CHANNEL, true); + $response = $this->openChannel(self::CHANNEL, true); if ($response === true && $this->isTimeout()) { return false; } @@ -815,7 +804,7 @@ private function logError($response, $status = -1) list($status) = Strings::unpackSSH2('N', $response); } - $error = $this->status_codes[$status]; + $error = self::$status_codes[$status]; if ($this->version > 2) { list($message) = Strings::unpackSSH2('s', $response); @@ -2138,7 +2127,7 @@ public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = - if ($start >= 0) { $offset = $start; - } elseif ($mode & self::RESUME) { + } elseif ($mode & (self::RESUME | self::RESUME_START)) { // if NET_SFTP_OPEN_APPEND worked as it should _size() wouldn't need to be called $size = $this->stat($remote_file)['size']; $offset = $size !== false ? $size : 0; @@ -2210,6 +2199,9 @@ public function put($remote_file, $data, $mode = self::SOURCE_STRING, $start = - if ($local_start >= 0) { fseek($fp, $local_start); $size -= $local_start; + } elseif ($mode & self::RESUME) { + fseek($fp, $offset); + $size -= $offset; } } elseif ($dataCallback) { $size = 0; @@ -2497,14 +2489,6 @@ public function get($remote_file, $local_file = false, $offset = 0, $length = -1 } } - if ($length > 0 && $length <= $offset - $start) { - if ($local_file === false) { - $content = substr($content, 0, $length); - } else { - ftruncate($fp, $length + $res_offset); - } - } - if ($fclose_check) { fclose($fp); @@ -2840,15 +2824,37 @@ public function filegroup($path) return $this->get_stat_cache_prop($path, 'gid'); } + /** + * Recursively go through rawlist() output to get the total filesize + * + * @return int + */ + private static function recursiveFilesize(array $files) + { + $size = 0; + foreach ($files as $name => $file) { + if ($name == '.' || $name == '..') { + continue; + } + $size += is_array($file) ? + self::recursiveFilesize($file) : + $file->size; + } + return $size; + } + /** * Gets file size * * @param string $path + * @param bool $recursive * @return mixed */ - public function filesize($path) + public function filesize($path, $recursive = false) { - return $this->get_stat_cache_prop($path, 'size'); + return !$recursive || $this->filetype($path) != 'dir' ? + $this->get_stat_cache_prop($path, 'size') : + self::recursiveFilesize($this->rawlist($path, true)); } /** @@ -3041,7 +3047,7 @@ protected function parseAttributes(&$response) list($flags) = Strings::unpackSSH2('N', $response); } - foreach ($this->attributes as $key => $value) { + foreach (self::$attributes as $key => $value) { switch ($flags & $key) { case NET_SFTP_ATTR_UIDGID: if ($this->version > 3) { @@ -3272,7 +3278,7 @@ private function send_sftp_packet($type, $data, $request_id = 1) $stop = microtime(true); if (defined('NET_SFTP_LOGGING')) { - $packet_type = '-> ' . $this->packet_types[$type] . + $packet_type = '-> ' . self::$packet_types[$type] . ' (' . round($stop - $start, 4) . 's)'; $this->append_log($packet_type, $data); } @@ -3376,7 +3382,7 @@ private function get_sftp_packet($request_id = null) $packet = Strings::shift($this->packet_buffer, $length); if (defined('NET_SFTP_LOGGING')) { - $packet_type = '<- ' . $this->packet_types[$this->packet_type] . + $packet_type = '<- ' . self::$packet_types[$this->packet_type] . ' (' . round($stop - $start, 4) . 's)'; $this->append_log($packet_type, $packet); } @@ -3420,7 +3426,7 @@ private function append_log($message_number, $message) * * Returns a string if NET_SFTP_LOGGING == self::LOG_COMPLEX, an array if NET_SFTP_LOGGING == self::LOG_SIMPLE and false if !defined('NET_SFTP_LOGGING') * - * @return array|string + * @return array|string|false */ public function getSFTPLog() { diff --git a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php index 9a0133fdc..581b05966 100644 --- a/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php +++ b/lib/Google/vendor/phpseclib/phpseclib/phpseclib/Net/SSH2.php @@ -553,7 +553,7 @@ class SSH2 * @var array * @access private */ - private $message_numbers = []; + private static $message_numbers = []; /** * Disconnection Message 'reason codes' defined in RFC4253 @@ -562,7 +562,7 @@ class SSH2 * @var array * @access private */ - private $disconnect_reasons = []; + private static $disconnect_reasons = []; /** * SSH_MSG_CHANNEL_OPEN_FAILURE 'reason codes', defined in RFC4254 @@ -571,7 +571,7 @@ class SSH2 * @var array * @access private */ - private $channel_open_failure_reasons = []; + private static $channel_open_failure_reasons = []; /** * Terminal Modes @@ -581,7 +581,7 @@ class SSH2 * @var array * @access private */ - private $terminal_modes = []; + private static $terminal_modes = []; /** * SSH_MSG_CHANNEL_EXTENDED_DATA's data_type_codes @@ -591,7 +591,7 @@ class SSH2 * @var array * @access private */ - private $channel_extended_data_type_codes = []; + private static $channel_extended_data_type_codes = []; /** * Send Sequence Number @@ -646,6 +646,14 @@ class SSH2 */ protected $channel_status = []; + /** + * The identifier of the interactive channel which was opened most recently + * + * @see self::getInteractiveChannelId() + * @var int + */ + private $channel_id_last_interactive = 0; + /** * Packet Size * @@ -837,20 +845,6 @@ class SSH2 */ private $request_pty = false; - /** - * Flag set while exec() is running when using enablePTY() - * - * @var bool - */ - private $in_request_pty_exec = false; - - /** - * Flag set after startSubsystem() is called - * - * @var bool - */ - private $in_subsystem; - /** * Contents of stdError * @@ -1093,6 +1087,21 @@ class SSH2 */ private $smartMFA = true; + /** + * How many channels are currently opened + * + * @var int + */ + private $channelCount = 0; + + /** + * Does the server support multiple channels? If not then error out + * when multiple channels are attempted to be opened + * + * @var bool + */ + private $errorOnMultipleChannels; + /** * Default Constructor. * @@ -1105,84 +1114,86 @@ class SSH2 */ public function __construct($host, $port = 22, $timeout = 10) { - $this->message_numbers = [ - 1 => 'NET_SSH2_MSG_DISCONNECT', - 2 => 'NET_SSH2_MSG_IGNORE', - 3 => 'NET_SSH2_MSG_UNIMPLEMENTED', - 4 => 'NET_SSH2_MSG_DEBUG', - 5 => 'NET_SSH2_MSG_SERVICE_REQUEST', - 6 => 'NET_SSH2_MSG_SERVICE_ACCEPT', - 20 => 'NET_SSH2_MSG_KEXINIT', - 21 => 'NET_SSH2_MSG_NEWKEYS', - 30 => 'NET_SSH2_MSG_KEXDH_INIT', - 31 => 'NET_SSH2_MSG_KEXDH_REPLY', - 50 => 'NET_SSH2_MSG_USERAUTH_REQUEST', - 51 => 'NET_SSH2_MSG_USERAUTH_FAILURE', - 52 => 'NET_SSH2_MSG_USERAUTH_SUCCESS', - 53 => 'NET_SSH2_MSG_USERAUTH_BANNER', - - 80 => 'NET_SSH2_MSG_GLOBAL_REQUEST', - 81 => 'NET_SSH2_MSG_REQUEST_SUCCESS', - 82 => 'NET_SSH2_MSG_REQUEST_FAILURE', - 90 => 'NET_SSH2_MSG_CHANNEL_OPEN', - 91 => 'NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION', - 92 => 'NET_SSH2_MSG_CHANNEL_OPEN_FAILURE', - 93 => 'NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST', - 94 => 'NET_SSH2_MSG_CHANNEL_DATA', - 95 => 'NET_SSH2_MSG_CHANNEL_EXTENDED_DATA', - 96 => 'NET_SSH2_MSG_CHANNEL_EOF', - 97 => 'NET_SSH2_MSG_CHANNEL_CLOSE', - 98 => 'NET_SSH2_MSG_CHANNEL_REQUEST', - 99 => 'NET_SSH2_MSG_CHANNEL_SUCCESS', - 100 => 'NET_SSH2_MSG_CHANNEL_FAILURE' - ]; - $this->disconnect_reasons = [ - 1 => 'NET_SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT', - 2 => 'NET_SSH2_DISCONNECT_PROTOCOL_ERROR', - 3 => 'NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED', - 4 => 'NET_SSH2_DISCONNECT_RESERVED', - 5 => 'NET_SSH2_DISCONNECT_MAC_ERROR', - 6 => 'NET_SSH2_DISCONNECT_COMPRESSION_ERROR', - 7 => 'NET_SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE', - 8 => 'NET_SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED', - 9 => 'NET_SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE', - 10 => 'NET_SSH2_DISCONNECT_CONNECTION_LOST', - 11 => 'NET_SSH2_DISCONNECT_BY_APPLICATION', - 12 => 'NET_SSH2_DISCONNECT_TOO_MANY_CONNECTIONS', - 13 => 'NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER', - 14 => 'NET_SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE', - 15 => 'NET_SSH2_DISCONNECT_ILLEGAL_USER_NAME' - ]; - $this->channel_open_failure_reasons = [ - 1 => 'NET_SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED' - ]; - $this->terminal_modes = [ - 0 => 'NET_SSH2_TTY_OP_END' - ]; - $this->channel_extended_data_type_codes = [ - 1 => 'NET_SSH2_EXTENDED_DATA_STDERR' - ]; + if (empty(self::$message_numbers)) { + self::$message_numbers = [ + 1 => 'NET_SSH2_MSG_DISCONNECT', + 2 => 'NET_SSH2_MSG_IGNORE', + 3 => 'NET_SSH2_MSG_UNIMPLEMENTED', + 4 => 'NET_SSH2_MSG_DEBUG', + 5 => 'NET_SSH2_MSG_SERVICE_REQUEST', + 6 => 'NET_SSH2_MSG_SERVICE_ACCEPT', + 20 => 'NET_SSH2_MSG_KEXINIT', + 21 => 'NET_SSH2_MSG_NEWKEYS', + 30 => 'NET_SSH2_MSG_KEXDH_INIT', + 31 => 'NET_SSH2_MSG_KEXDH_REPLY', + 50 => 'NET_SSH2_MSG_USERAUTH_REQUEST', + 51 => 'NET_SSH2_MSG_USERAUTH_FAILURE', + 52 => 'NET_SSH2_MSG_USERAUTH_SUCCESS', + 53 => 'NET_SSH2_MSG_USERAUTH_BANNER', + + 80 => 'NET_SSH2_MSG_GLOBAL_REQUEST', + 81 => 'NET_SSH2_MSG_REQUEST_SUCCESS', + 82 => 'NET_SSH2_MSG_REQUEST_FAILURE', + 90 => 'NET_SSH2_MSG_CHANNEL_OPEN', + 91 => 'NET_SSH2_MSG_CHANNEL_OPEN_CONFIRMATION', + 92 => 'NET_SSH2_MSG_CHANNEL_OPEN_FAILURE', + 93 => 'NET_SSH2_MSG_CHANNEL_WINDOW_ADJUST', + 94 => 'NET_SSH2_MSG_CHANNEL_DATA', + 95 => 'NET_SSH2_MSG_CHANNEL_EXTENDED_DATA', + 96 => 'NET_SSH2_MSG_CHANNEL_EOF', + 97 => 'NET_SSH2_MSG_CHANNEL_CLOSE', + 98 => 'NET_SSH2_MSG_CHANNEL_REQUEST', + 99 => 'NET_SSH2_MSG_CHANNEL_SUCCESS', + 100 => 'NET_SSH2_MSG_CHANNEL_FAILURE' + ]; + self::$disconnect_reasons = [ + 1 => 'NET_SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT', + 2 => 'NET_SSH2_DISCONNECT_PROTOCOL_ERROR', + 3 => 'NET_SSH2_DISCONNECT_KEY_EXCHANGE_FAILED', + 4 => 'NET_SSH2_DISCONNECT_RESERVED', + 5 => 'NET_SSH2_DISCONNECT_MAC_ERROR', + 6 => 'NET_SSH2_DISCONNECT_COMPRESSION_ERROR', + 7 => 'NET_SSH2_DISCONNECT_SERVICE_NOT_AVAILABLE', + 8 => 'NET_SSH2_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED', + 9 => 'NET_SSH2_DISCONNECT_HOST_KEY_NOT_VERIFIABLE', + 10 => 'NET_SSH2_DISCONNECT_CONNECTION_LOST', + 11 => 'NET_SSH2_DISCONNECT_BY_APPLICATION', + 12 => 'NET_SSH2_DISCONNECT_TOO_MANY_CONNECTIONS', + 13 => 'NET_SSH2_DISCONNECT_AUTH_CANCELLED_BY_USER', + 14 => 'NET_SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE', + 15 => 'NET_SSH2_DISCONNECT_ILLEGAL_USER_NAME' + ]; + self::$channel_open_failure_reasons = [ + 1 => 'NET_SSH2_OPEN_ADMINISTRATIVELY_PROHIBITED' + ]; + self::$terminal_modes = [ + 0 => 'NET_SSH2_TTY_OP_END' + ]; + self::$channel_extended_data_type_codes = [ + 1 => 'NET_SSH2_EXTENDED_DATA_STDERR' + ]; - $this->define_array( - $this->message_numbers, - $this->disconnect_reasons, - $this->channel_open_failure_reasons, - $this->terminal_modes, - $this->channel_extended_data_type_codes, - [60 => 'NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ'], - [60 => 'NET_SSH2_MSG_USERAUTH_PK_OK'], - [60 => 'NET_SSH2_MSG_USERAUTH_INFO_REQUEST', - 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE'], - // RFC 4419 - diffie-hellman-group-exchange-sha{1,256} - [30 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST_OLD', - 31 => 'NET_SSH2_MSG_KEXDH_GEX_GROUP', - 32 => 'NET_SSH2_MSG_KEXDH_GEX_INIT', - 33 => 'NET_SSH2_MSG_KEXDH_GEX_REPLY', - 34 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST'], - // RFC 5656 - Elliptic Curves (for curve25519-sha256@libssh.org) - [30 => 'NET_SSH2_MSG_KEX_ECDH_INIT', - 31 => 'NET_SSH2_MSG_KEX_ECDH_REPLY'] - ); + self::define_array( + self::$message_numbers, + self::$disconnect_reasons, + self::$channel_open_failure_reasons, + self::$terminal_modes, + self::$channel_extended_data_type_codes, + [60 => 'NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ'], + [60 => 'NET_SSH2_MSG_USERAUTH_PK_OK'], + [60 => 'NET_SSH2_MSG_USERAUTH_INFO_REQUEST', + 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE'], + // RFC 4419 - diffie-hellman-group-exchange-sha{1,256} + [30 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST_OLD', + 31 => 'NET_SSH2_MSG_KEXDH_GEX_GROUP', + 32 => 'NET_SSH2_MSG_KEXDH_GEX_INIT', + 33 => 'NET_SSH2_MSG_KEXDH_GEX_REPLY', + 34 => 'NET_SSH2_MSG_KEXDH_GEX_REQUEST'], + // RFC 5656 - Elliptic Curves (for curve25519-sha256@libssh.org) + [30 => 'NET_SSH2_MSG_KEX_ECDH_INIT', + 31 => 'NET_SSH2_MSG_KEX_ECDH_REPLY'] + ); + } /** * Typehint is required due to a bug in Psalm: https://github.com/vimeo/psalm/issues/7508 @@ -1269,6 +1280,32 @@ public function sendKEXINITLast() $this->send_kex_first = false; } + /** + * stream_select wrapper + * + * Quoting https://stackoverflow.com/a/14262151/569976, + * "The general approach to `EINTR` is to simply handle the error and retry the operation again" + * + * This wrapper does that loop + */ + private static function stream_select(&$read, &$write, &$except, $seconds, $microseconds = null) + { + $remaining = $seconds + $microseconds / 1000000; + $start = microtime(true); + while (true) { + $result = @stream_select($read, $write, $except, $seconds, $microseconds); + if ($result !== false) { + return $result; + } + $elapsed = microtime(true) - $start; + $seconds = (int) ($remaining - floor($elapsed)); + $microseconds = (int) (1000000 * ($remaining - $seconds)); + if ($elapsed >= $remaining) { + return false; + } + } + } + /** * Connect to an SSHv2 server * @@ -1333,7 +1370,7 @@ private function connect() $start = microtime(true); $sec = (int) floor($this->curTimeout); $usec = (int) (1000000 * ($this->curTimeout - $sec)); - if (@stream_select($read, $write, $except, $sec, $usec) === false) { + if (static::stream_select($read, $write, $except, $sec, $usec) === false) { throw new \RuntimeException('Connection timed out whilst receiving server identification string'); } $elapsed = microtime(true) - $start; @@ -1388,6 +1425,18 @@ private function connect() throw new UnableToConnectException("Cannot connect to SSH $matches[3] servers"); } + // Ubuntu's OpenSSH from 5.8 to 6.9 didn't work with multiple channels. see + // https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1334916 for more info. + // https://lists.ubuntu.com/archives/oneiric-changes/2011-July/005772.html discusses + // when consolekit was incorporated. + // https://marc.info/?l=openssh-unix-dev&m=163409903417589&w=2 discusses some of the + // issues with how Ubuntu incorporated consolekit + $pattern = '#^SSH-2\.0-OpenSSH_([\d.]+)[^ ]* Ubuntu-.*$#'; + $match = preg_match($pattern, $this->server_identifier, $matches); + $match = $match && version_compare('5.8', $matches[1], '<='); + $match = $match && version_compare('6.9', $matches[1], '>='); + $this->errorOnMultipleChannels = $match; + if (!$this->send_id_string_first) { fputs($this->fsock, $this->identifier . "\r\n"); } @@ -2121,7 +2170,7 @@ private static function bad_algorithm_candidate($algorithm) * The $password parameter can be a plaintext password, a \phpseclib3\Crypt\RSA|EC|DSA object, a \phpseclib3\System\SSH\Agent object or an array * * @param string $username - * @param string|AsymmetricKey|array[]|Agent|null ...$args + * @param string|PrivateKey|array[]|Agent|null ...$args * @return bool * @see self::_login() */ @@ -2146,7 +2195,7 @@ public function login($username, ...$args) * Login Helper * * @param string $username - * @param string ...$args + * @param string|PrivateKey|array[]|Agent|null ...$args * @return bool * @see self::_login_helper() */ @@ -2729,32 +2778,11 @@ public function exec($command, callable $callback = null) return false; } - if ($this->in_request_pty_exec) { - throw new \RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.'); - } + //if ($this->isPTYOpen()) { + // throw new \RuntimeException('If you want to run multiple exec()\'s you will need to disable (and re-enable if appropriate) a PTY for each one.'); + //} - // RFC4254 defines the (client) window size as "bytes the other party can send before it must wait for the window to - // be adjusted". 0x7FFFFFFF is, at 2GB, the max size. technically, it should probably be decremented, but, - // honestly, if you're transferring more than 2GB, you probably shouldn't be using phpseclib, anyway. - // see http://tools.ietf.org/html/rfc4254#section-5.2 for more info - $this->window_size_server_to_client[self::CHANNEL_EXEC] = $this->window_size; - // 0x8000 is the maximum max packet size, per http://tools.ietf.org/html/rfc4253#section-6.1, although since PuTTy - // uses 0x4000, that's what will be used here, as well. - $packet_size = 0x4000; - - $packet = Strings::packSSH2( - 'CsN3', - NET_SSH2_MSG_CHANNEL_OPEN, - 'session', - self::CHANNEL_EXEC, - $this->window_size_server_to_client[self::CHANNEL_EXEC], - $packet_size - ); - $this->send_binary_packet($packet); - - $this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_OPEN; - - $this->get_channel_packet(self::CHANNEL_EXEC); + $this->openChannel(self::CHANNEL_EXEC); if ($this->request_pty === true) { $terminal_modes = pack('C', NET_SSH2_TTY_OP_END); @@ -2779,8 +2807,6 @@ public function exec($command, callable $callback = null) $this->disconnect_helper(NET_SSH2_DISCONNECT_BY_APPLICATION); throw new \RuntimeException('Unable to request pseudo-terminal'); } - - $this->in_request_pty_exec = true; } // sending a pty-req SSH_MSG_CHANNEL_REQUEST message is unnecessary and, in fact, in most cases, slows things @@ -2810,7 +2836,8 @@ public function exec($command, callable $callback = null) $this->channel_status[self::CHANNEL_EXEC] = NET_SSH2_MSG_CHANNEL_DATA; - if ($this->in_request_pty_exec) { + if ($this->request_pty === true) { + $this->channel_id_last_interactive = self::CHANNEL_EXEC; return true; } @@ -2836,37 +2863,80 @@ public function exec($command, callable $callback = null) } /** - * Creates an interactive shell + * How many channels are currently open? * - * @see self::read() - * @see self::write() + * @return int + */ + public function getOpenChannelCount() + { + return $this->channelCount; + } + + /** + * Opens a channel + * + * @param string $channel + * @param bool $skip_extended * @return bool - * @throws \UnexpectedValueException on receipt of unexpected packets - * @throws \RuntimeException on other errors */ - private function initShell() + protected function openChannel($channel, $skip_extended = false) { - if ($this->in_request_pty_exec === true) { - return true; + if (isset($this->channel_status[$channel]) && $this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_CLOSE) { + throw new \RuntimeException('Please close the channel (' . $channel . ') before trying to open it again'); + } + + $this->channelCount++; + + if ($this->channelCount > 1 && $this->errorOnMultipleChannels) { + throw new \RuntimeException("Ubuntu's OpenSSH from 5.8 to 6.9 doesn't work with multiple channels"); } - $this->window_size_server_to_client[self::CHANNEL_SHELL] = $this->window_size; + // RFC4254 defines the (client) window size as "bytes the other party can send before it must wait for the window to + // be adjusted". 0x7FFFFFFF is, at 2GB, the max size. technically, it should probably be decremented, but, + // honestly, if you're transferring more than 2GB, you probably shouldn't be using phpseclib, anyway. + // see http://tools.ietf.org/html/rfc4254#section-5.2 for more info + $this->window_size_server_to_client[$channel] = $this->window_size; + // 0x8000 is the maximum max packet size, per http://tools.ietf.org/html/rfc4253#section-6.1, although since PuTTy + // uses 0x4000, that's what will be used here, as well. $packet_size = 0x4000; $packet = Strings::packSSH2( 'CsN3', NET_SSH2_MSG_CHANNEL_OPEN, 'session', - self::CHANNEL_SHELL, - $this->window_size_server_to_client[self::CHANNEL_SHELL], + $channel, + $this->window_size_server_to_client[$channel], $packet_size ); $this->send_binary_packet($packet); - $this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_OPEN; + $this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_OPEN; + + return $this->get_channel_packet($channel, $skip_extended); + } + + /** + * Creates an interactive shell + * + * Returns bool(true) if the shell was opened. + * Returns bool(false) if the shell was already open. + * + * @see self::isShellOpen() + * @see self::read() + * @see self::write() + * @return bool + * @throws InsufficientSetupException if not authenticated + * @throws \UnexpectedValueException on receipt of unexpected packets + * @throws \RuntimeException on other errors + */ + public function openShell() + { + if (!$this->isAuthenticated()) { + throw new InsufficientSetupException('Operation disallowed prior to login()'); + } - $this->get_channel_packet(self::CHANNEL_SHELL); + $this->openChannel(self::CHANNEL_SHELL); $terminal_modes = pack('C', NET_SSH2_TTY_OP_END); $packet = Strings::packSSH2( @@ -2907,14 +2977,18 @@ private function initShell() $this->channel_status[self::CHANNEL_SHELL] = NET_SSH2_MSG_CHANNEL_DATA; + $this->channel_id_last_interactive = self::CHANNEL_SHELL; + $this->bitmap |= self::MASK_SHELL; return true; } /** - * Return the channel to be used with read() / write() - * + * Return the channel to be used with read(), write(), and reset(), if none were specified + * @deprecated for lack of transparency in intended channel target, to be potentially replaced + * with method which guarantees open-ness of all yielded channels and throws + * error for multiple open channels * @see self::read() * @see self::write() * @return int @@ -2922,15 +2996,26 @@ private function initShell() private function get_interactive_channel() { switch (true) { - case $this->in_subsystem: + case $this->is_channel_status_data(self::CHANNEL_SUBSYSTEM): return self::CHANNEL_SUBSYSTEM; - case $this->in_request_pty_exec: + case $this->is_channel_status_data(self::CHANNEL_EXEC): return self::CHANNEL_EXEC; default: return self::CHANNEL_SHELL; } } + /** + * Indicates the DATA status on the given channel + * + * @param int $channel The channel number to evaluate + * @return bool + */ + private function is_channel_status_data($channel) + { + return isset($this->channel_status[$channel]) && $this->channel_status[$channel] == NET_SSH2_MSG_CHANNEL_DATA; + } + /** * Return an available open channel * @@ -2987,26 +3072,41 @@ public function requestAgentForwarding() * Returns when there's a match for $expect, which can take the form of a string literal or, * if $mode == self::READ_REGEX, a regular expression. * + * If not specifying a channel, an open interactive channel will be selected, or, if there are + * no open channels, an interactive shell will be created. If there are multiple open + * interactive channels, a legacy behavior will apply in which channel selection prioritizes + * an active subsystem, the exec pty, and, lastly, the shell. If using multiple interactive + * channels, callers are discouraged from relying on this legacy behavior and should specify + * the intended channel. + * * @see self::write() * @param string $expect - * @param int $mode + * @param int $mode One of the self::READ_* constants + * @param int|null $channel Channel id returned by self::getInteractiveChannelId() * @return string|bool|null * @throws \RuntimeException on connection error + * @throws InsufficientSetupException on unexpected channel status, possibly due to closure */ - public function read($expect = '', $mode = self::READ_SIMPLE) + public function read($expect = '', $mode = self::READ_SIMPLE, $channel = null) { - $this->curTimeout = $this->timeout; - $this->is_timeout = false; - if (!$this->isAuthenticated()) { throw new InsufficientSetupException('Operation disallowed prior to login()'); } - if (!($this->bitmap & self::MASK_SHELL) && !$this->initShell()) { - throw new \RuntimeException('Unable to initiate an interactive shell session'); + $this->curTimeout = $this->timeout; + $this->is_timeout = false; + + if ($channel === null) { + $channel = $this->get_interactive_channel(); } - $channel = $this->get_interactive_channel(); + if (!$this->is_channel_status_data($channel) && empty($this->channel_buffers[$channel])) { + if ($channel != self::CHANNEL_SHELL) { + throw new InsufficientSetupException('Data is not available on channel'); + } elseif (!$this->openShell()) { + throw new \RuntimeException('Unable to initiate an interactive shell session'); + } + } if ($mode == self::READ_NEXT) { return $this->get_channel_packet($channel); @@ -3024,7 +3124,6 @@ public function read($expect = '', $mode = self::READ_SIMPLE) } $response = $this->get_channel_packet($channel); if ($response === true) { - $this->in_request_pty_exec = false; return Strings::shift($this->interactiveBuffer, strlen($this->interactiveBuffer)); } @@ -3035,22 +3134,39 @@ public function read($expect = '', $mode = self::READ_SIMPLE) /** * Inputs a command into an interactive shell. * + * If not specifying a channel, an open interactive channel will be selected, or, if there are + * no open channels, an interactive shell will be created. If there are multiple open + * interactive channels, a legacy behavior will apply in which channel selection prioritizes + * an active subsystem, the exec pty, and, lastly, the shell. If using multiple interactive + * channels, callers are discouraged from relying on this legacy behavior and should specify + * the intended channel. + * * @see SSH2::read() * @param string $cmd + * @param int|null $channel Channel id returned by self::getInteractiveChannelId() * @return void * @throws \RuntimeException on connection error + * @throws InsufficientSetupException on unexpected channel status, possibly due to closure */ - public function write($cmd) + public function write($cmd, $channel = null) { if (!$this->isAuthenticated()) { throw new InsufficientSetupException('Operation disallowed prior to login()'); } - if (!($this->bitmap & self::MASK_SHELL) && !$this->initShell()) { - throw new \RuntimeException('Unable to initiate an interactive shell session'); + if ($channel === null) { + $channel = $this->get_interactive_channel(); } - $this->send_channel_packet($this->get_interactive_channel(), $cmd); + if (!$this->is_channel_status_data($channel)) { + if ($channel != self::CHANNEL_SHELL) { + throw new InsufficientSetupException('Data is not available on channel'); + } elseif (!$this->openShell()) { + throw new \RuntimeException('Unable to initiate an interactive shell session'); + } + } + + $this->send_channel_packet($channel, $cmd); } /** @@ -3068,22 +3184,7 @@ public function write($cmd) */ public function startSubsystem($subsystem) { - $this->window_size_server_to_client[self::CHANNEL_SUBSYSTEM] = $this->window_size; - - $packet = Strings::packSSH2( - 'CsN3', - NET_SSH2_MSG_CHANNEL_OPEN, - 'session', - self::CHANNEL_SUBSYSTEM, - $this->window_size, - 0x4000 - ); - - $this->send_binary_packet($packet); - - $this->channel_status[self::CHANNEL_SUBSYSTEM] = NET_SSH2_MSG_CHANNEL_OPEN; - - $this->get_channel_packet(self::CHANNEL_SUBSYSTEM); + $this->openChannel(self::CHANNEL_SUBSYSTEM); $packet = Strings::packSSH2( 'CNsCs', @@ -3103,8 +3204,7 @@ public function startSubsystem($subsystem) $this->channel_status[self::CHANNEL_SUBSYSTEM] = NET_SSH2_MSG_CHANNEL_DATA; - $this->bitmap |= self::MASK_SHELL; - $this->in_subsystem = true; + $this->channel_id_last_interactive = self::CHANNEL_SUBSYSTEM; return true; } @@ -3117,8 +3217,9 @@ public function startSubsystem($subsystem) */ public function stopSubsystem() { - $this->in_subsystem = false; - $this->close_channel(self::CHANNEL_SUBSYSTEM); + if ($this->isInteractiveChannelOpen(self::CHANNEL_SUBSYSTEM)) { + $this->close_channel(self::CHANNEL_SUBSYSTEM); + } return true; } @@ -3127,10 +3228,23 @@ public function stopSubsystem() * * If read() timed out you might want to just close the channel and have it auto-restart on the next read() call * + * If not specifying a channel, an open interactive channel will be selected. If there are + * multiple open interactive channels, a legacy behavior will apply in which channel selection + * prioritizes an active subsystem, the exec pty, and, lastly, the shell. If using multiple + * interactive channels, callers are discouraged from relying on this legacy behavior and + * should specify the intended channel. + * + * @param int|null $channel Channel id returned by self::getInteractiveChannelId() + * @return void */ - public function reset() + public function reset($channel = null) { - $this->close_channel($this->get_interactive_channel()); + if ($channel === null) { + $channel = $this->get_interactive_channel(); + } + if ($this->isInteractiveChannelOpen($channel)) { + $this->close_channel($channel); + } } /** @@ -3176,7 +3290,7 @@ public function __destruct() */ public function isConnected() { - return (bool) ($this->bitmap & self::MASK_CONNECTED); + return ($this->bitmap & self::MASK_CONNECTED) && is_resource($this->fsock) && !feof($this->fsock); } /** @@ -3189,6 +3303,49 @@ public function isAuthenticated() return (bool) ($this->bitmap & self::MASK_LOGIN); } + /** + * Is the interactive shell active? + * + * @return bool + */ + public function isShellOpen() + { + return $this->isInteractiveChannelOpen(self::CHANNEL_SHELL); + } + + /** + * Is the exec pty active? + * + * @return bool + */ + public function isPTYOpen() + { + return $this->isInteractiveChannelOpen(self::CHANNEL_EXEC); + } + + /** + * Is the given interactive channel active? + * + * @param int $channel Channel id returned by self::getInteractiveChannelId() + * @return bool + */ + public function isInteractiveChannelOpen($channel) + { + return $this->isAuthenticated() && $this->is_channel_status_data($channel); + } + + /** + * Returns a channel identifier, presently of the last interactive channel opened, regardless of current status. + * Returns 0 if no interactive channel has been opened. + * + * @see self::isInteractiveChannelOpen() + * @return int + */ + public function getInteractiveChannelId() + { + return $this->channel_id_last_interactive; + } + /** * Pings a server connection, or tries to reconnect if the connection has gone down * @@ -3205,23 +3362,8 @@ public function ping() return false; } - $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE] = $this->window_size; - $packet_size = 0x4000; - $packet = Strings::packSSH2( - 'CsN3', - NET_SSH2_MSG_CHANNEL_OPEN, - 'session', - self::CHANNEL_KEEP_ALIVE, - $this->window_size_server_to_client[self::CHANNEL_KEEP_ALIVE], - $packet_size - ); - try { - $this->send_binary_packet($packet); - - $this->channel_status[self::CHANNEL_KEEP_ALIVE] = NET_SSH2_MSG_CHANNEL_OPEN; - - $response = $this->get_channel_packet(self::CHANNEL_KEEP_ALIVE); + $this->openChannel(self::CHANNEL_KEEP_ALIVE); } catch (\RuntimeException $e) { return $this->reconnect(); } @@ -3283,9 +3425,9 @@ private function get_binary_packet($skip_channel_filter = false) if (!$this->curTimeout) { if ($this->keepAlive <= 0) { - @stream_select($read, $write, $except, null); + static::stream_select($read, $write, $except, null); } else { - if (!@stream_select($read, $write, $except, $this->keepAlive)) { + if (!static::stream_select($read, $write, $except, $this->keepAlive)) { $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); return $this->get_binary_packet(true); } @@ -3299,7 +3441,7 @@ private function get_binary_packet($skip_channel_filter = false) $start = microtime(true); if ($this->keepAlive > 0 && $this->keepAlive < $this->curTimeout) { - if (!@stream_select($read, $write, $except, $this->keepAlive)) { + if (!static::stream_select($read, $write, $except, $this->keepAlive)) { $this->send_binary_packet(pack('CN', NET_SSH2_MSG_IGNORE, 0)); $elapsed = microtime(true) - $start; $this->curTimeout -= $elapsed; @@ -3313,7 +3455,7 @@ private function get_binary_packet($skip_channel_filter = false) $usec = (int) (1000000 * ($this->curTimeout - $sec)); // this can return a "stream_select(): unable to select [4]: Interrupted system call" error - if (!@stream_select($read, $write, $except, $sec, $usec)) { + if (!static::stream_select($read, $write, $except, $sec, $usec)) { $this->is_timeout = true; return true; } @@ -3504,7 +3646,7 @@ private function get_binary_packet($skip_channel_filter = false) if (defined('NET_SSH2_LOGGING')) { $current = microtime(true); - $message_number = isset($this->message_numbers[ord($payload[0])]) ? $this->message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')'; + $message_number = isset(self::$message_numbers[ord($payload[0])]) ? self::$message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')'; $message_number = '<- ' . $message_number . ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; $this->append_log($message_number, $payload); @@ -3586,7 +3728,7 @@ private function filter($payload, $skip_channel_filter) case NET_SSH2_MSG_DISCONNECT: Strings::shift($payload, 1); list($reason_code, $message) = Strings::unpackSSH2('Ns', $payload); - $this->errors[] = 'SSH_MSG_DISCONNECT: ' . $this->disconnect_reasons[$reason_code] . "\r\n$message"; + $this->errors[] = 'SSH_MSG_DISCONNECT: ' . self::$disconnect_reasons[$reason_code] . "\r\n$message"; $this->bitmap = 0; return false; case NET_SSH2_MSG_IGNORE: @@ -3773,9 +3915,8 @@ public function enablePTY() */ public function disablePTY() { - if ($this->in_request_pty_exec) { + if ($this->isPTYOpen()) { $this->close_channel(self::CHANNEL_EXEC); - $this->in_request_pty_exec = false; } $this->request_pty = false; } @@ -3801,6 +3942,7 @@ public function isPTYEnabled() * - if the connection times out * - if the channel status is CHANNEL_OPEN and the response was CHANNEL_OPEN_CONFIRMATION * - if the channel status is CHANNEL_REQUEST and the response was CHANNEL_SUCCESS + * - if the channel status is CHANNEL_CLOSE and the response was CHANNEL_CLOSE * * bool(false) is returned if: * @@ -3968,7 +4110,10 @@ protected function get_channel_packet($client_channel, $skip_extended = false) throw new \RuntimeException('Unable to fulfill channel request'); } case NET_SSH2_MSG_CHANNEL_CLOSE: - return $type == NET_SSH2_MSG_CHANNEL_CLOSE ? true : $this->get_channel_packet($client_channel, $skip_extended); + if ($client_channel == $channel && $type == NET_SSH2_MSG_CHANNEL_CLOSE) { + return true; + } + return $this->get_channel_packet($client_channel, $skip_extended); } } @@ -4003,14 +4148,15 @@ protected function get_channel_packet($client_channel, $skip_extended = false) case NET_SSH2_MSG_CHANNEL_CLOSE: $this->curTimeout = 5; - if ($this->bitmap & self::MASK_SHELL) { - $this->bitmap &= ~self::MASK_SHELL; - } + $this->close_channel_bitmap($channel); + if ($this->channel_status[$channel] != NET_SSH2_MSG_CHANNEL_EOF) { $this->send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$channel])); } $this->channel_status[$channel] = NET_SSH2_MSG_CHANNEL_CLOSE; + $this->channelCount--; + if ($client_channel == $channel) { return true; } @@ -4157,7 +4303,7 @@ protected function send_binary_packet($data, $logged = null) if (defined('NET_SSH2_LOGGING')) { $current = microtime(true); - $message_number = isset($this->message_numbers[ord($logged[0])]) ? $this->message_numbers[ord($logged[0])] : 'UNKNOWN (' . ord($logged[0]) . ')'; + $message_number = isset(self::$message_numbers[ord($logged[0])]) ? self::$message_numbers[ord($logged[0])] : 'UNKNOWN (' . ord($logged[0]) . ')'; $message_number = '-> ' . $message_number . ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; $this->append_log($message_number, $logged); @@ -4166,7 +4312,10 @@ protected function send_binary_packet($data, $logged = null) if (strlen($packet) != $sent) { $this->bitmap = 0; - throw new \RuntimeException("Only $sent of " . strlen($packet) . " bytes were sent"); + $message = $sent === false ? + 'Unable to write ' . strlen($packet) . ' bytes' : + "Only $sent of " . strlen($packet) . " bytes were sent"; + throw new \RuntimeException($message); } } @@ -4342,22 +4491,36 @@ private function close_channel($client_channel, $want_reply = false) } $this->channel_status[$client_channel] = NET_SSH2_MSG_CHANNEL_CLOSE; + $this->channelCount--; $this->curTimeout = 5; while (!is_bool($this->get_channel_packet($client_channel))) { } - if ($this->is_timeout) { - $this->disconnect(); - } - if ($want_reply) { $this->send_binary_packet(pack('CN', NET_SSH2_MSG_CHANNEL_CLOSE, $this->server_channels[$client_channel])); } - if ($this->bitmap & self::MASK_SHELL) { - $this->bitmap &= ~self::MASK_SHELL; + $this->close_channel_bitmap($client_channel); + } + + /** + * Maintains execution state bitmap in response to channel closure + * + * @param int $client_channel The channel number to maintain closure status of + * @return void + */ + private function close_channel_bitmap($client_channel) + { + switch ($client_channel) { + case self::CHANNEL_SHELL: + // Shell status has been maintained in the bitmap for backwards + // compatibility sake, but can be removed going forward + if ($this->bitmap & self::MASK_SHELL) { + $this->bitmap &= ~self::MASK_SHELL; + } + break; } } @@ -4395,7 +4558,7 @@ protected function disconnect_helper($reason) * @param mixed[] ...$args * @access protected */ - protected function define_array(...$args) + protected static function define_array(...$args) { foreach ($args as $arg) { foreach ($arg as $key => $value) { @@ -4800,6 +4963,14 @@ public function getAlgorithmsNegotiated() ]; } + /** + * Force multiple channels (even if phpseclib has decided to disable them) + */ + public function forceMultipleChannels() + { + $this->errorOnMultipleChannels = false; + } + /** * Allows you to set the terminal * diff --git a/lib/Google/vendor/psr/cache/src/CacheItemInterface.php b/lib/Google/vendor/psr/cache/src/CacheItemInterface.php index 5e736e382..893315e6e 100644 --- a/lib/Google/vendor/psr/cache/src/CacheItemInterface.php +++ b/lib/Google/vendor/psr/cache/src/CacheItemInterface.php @@ -86,7 +86,7 @@ public function set(mixed $value); * @return static * The called object. */ - public function expiresAt($expiration); + public function expiresAt(?\DateTimeInterface $expiration); /** * Sets the expiration time for this cache item. @@ -101,5 +101,5 @@ public function expiresAt($expiration); * @return static * The called object. */ - public function expiresAfter($time); + public function expiresAfter(int|\DateInterval|null $time); } diff --git a/lib/Google/vendor/psr/http-client/CHANGELOG.md b/lib/Google/vendor/psr/http-client/CHANGELOG.md index e2dc25f51..babba7c7b 100644 --- a/lib/Google/vendor/psr/http-client/CHANGELOG.md +++ b/lib/Google/vendor/psr/http-client/CHANGELOG.md @@ -2,6 +2,14 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 1.0.3 + +Add `source` link in composer.json. No code changes. + +## 1.0.2 + +Allow PSR-7 (psr/http-message) 2.0. No code changes. + ## 1.0.1 Allow installation with PHP 8. No code changes. diff --git a/lib/Google/vendor/psr/http-client/composer.json b/lib/Google/vendor/psr/http-client/composer.json index e4cab2f3e..6fed350be 100644 --- a/lib/Google/vendor/psr/http-client/composer.json +++ b/lib/Google/vendor/psr/http-client/composer.json @@ -10,6 +10,9 @@ "homepage": "https://www.php-fig.org/" } ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, "require": { "php": "^7.0 || ^8.0", "psr/http-message": "^1.0 || ^2.0" diff --git a/lib/Google/vendor/psr/http-message/composer.json b/lib/Google/vendor/psr/http-message/composer.json index 56e8c0a6d..c66e5aba4 100644 --- a/lib/Google/vendor/psr/http-message/composer.json +++ b/lib/Google/vendor/psr/http-message/composer.json @@ -7,7 +7,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "require": { @@ -20,7 +20,7 @@ }, "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } } } diff --git a/lib/Google/vendor/psr/http-message/src/MessageInterface.php b/lib/Google/vendor/psr/http-message/src/MessageInterface.php index 8cdb4ed63..a83c98518 100644 --- a/lib/Google/vendor/psr/http-message/src/MessageInterface.php +++ b/lib/Google/vendor/psr/http-message/src/MessageInterface.php @@ -1,7 +1,5 @@ data[$offset]); } @@ -80,12 +82,13 @@ public function offsetExists(mixed $offset): bool * * @param array-key $offset The offset for which a value should be returned. * - * @return T the value stored at the offset, or null if the offset + * @return T|null the value stored at the offset, or null if the offset * does not exist. */ - public function offsetGet(mixed $offset): mixed + #[\ReturnTypeWillChange] // phpcs:ignore + public function offsetGet($offset) { - return $this->data[$offset]; + return $this->data[$offset] ?? null; } /** @@ -93,11 +96,12 @@ public function offsetGet(mixed $offset): mixed * * @link http://php.net/manual/en/arrayaccess.offsetset.php ArrayAccess::offsetSet() * - * @param array-key | null $offset The offset to set. If `null`, the value - * may be set at a numerically-indexed offset. + * @param array-key|null $offset The offset to set. If `null`, the value may be + * set at a numerically-indexed offset. * @param T $value The value to set at the given offset. */ - public function offsetSet(mixed $offset, mixed $value): void + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function offsetSet($offset, $value): void { if ($offset === null) { $this->data[] = $value; @@ -113,11 +117,25 @@ public function offsetSet(mixed $offset, mixed $value): void * * @param array-key $offset The offset to remove from the array. */ - public function offsetUnset(mixed $offset): void + public function offsetUnset($offset): void { unset($this->data[$offset]); } + /** + * Returns a serialized string representation of this array object. + * + * @deprecated The Serializable interface will go away in PHP 9. + * + * @link http://php.net/manual/en/serializable.serialize.php Serializable::serialize() + * + * @return string a PHP serialized string. + */ + public function serialize(): string + { + return serialize($this->data); + } + /** * Returns data suitable for PHP serialization. * @@ -131,6 +149,25 @@ public function __serialize(): array return $this->data; } + /** + * Converts a serialized string representation into an instance object. + * + * @deprecated The Serializable interface will go away in PHP 9. + * + * @link http://php.net/manual/en/serializable.unserialize.php Serializable::unserialize() + * + * @param string $serialized A PHP serialized string to unserialize. + * + * @phpcsSuppress SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + */ + public function unserialize($serialized): void + { + /** @var array $data */ + $data = unserialize($serialized, ['allowed_classes' => false]); + + $this->data = $data; + } + /** * Adds unserialized data to the object. * @@ -166,6 +203,6 @@ public function toArray(): array public function isEmpty(): bool { - return $this->data === []; + return count($this->data) === 0; } } diff --git a/lib/Google/vendor/ramsey/collection/src/AbstractCollection.php b/lib/Google/vendor/ramsey/collection/src/AbstractCollection.php index 8cb21ec02..38ef7144c 100644 --- a/lib/Google/vendor/ramsey/collection/src/AbstractCollection.php +++ b/lib/Google/vendor/ramsey/collection/src/AbstractCollection.php @@ -17,27 +17,27 @@ use Closure; use Ramsey\Collection\Exception\CollectionMismatchException; use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\InvalidPropertyOrMethod; -use Ramsey\Collection\Exception\NoSuchElementException; -use Ramsey\Collection\Exception\UnsupportedOperationException; +use Ramsey\Collection\Exception\InvalidSortOrderException; +use Ramsey\Collection\Exception\OutOfBoundsException; use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueExtractorTrait; use Ramsey\Collection\Tool\ValueToStringTrait; use function array_filter; -use function array_key_first; -use function array_key_last; use function array_map; use function array_merge; -use function array_reduce; use function array_search; use function array_udiff; use function array_uintersect; +use function current; +use function end; use function in_array; use function is_int; use function is_object; +use function reset; use function spl_object_id; use function sprintf; +use function unserialize; use function usort; /** @@ -55,24 +55,27 @@ abstract class AbstractCollection extends AbstractArray implements CollectionInt use ValueExtractorTrait; /** - * @throws InvalidArgumentException if $element is of the wrong type. + * @inheritDoc */ - public function add(mixed $element): bool + public function add($element): bool { $this[] = $element; return true; } - public function contains(mixed $element, bool $strict = true): bool + /** + * @inheritDoc + */ + public function contains($element, bool $strict = true): bool { return in_array($element, $this->data, $strict); } /** - * @throws InvalidArgumentException if $element is of the wrong type. + * @inheritDoc */ - public function offsetSet(mixed $offset, mixed $value): void + public function offsetSet($offset, $value): void { if ($this->checkType($this->getType(), $value) === false) { throw new InvalidArgumentException( @@ -88,7 +91,10 @@ public function offsetSet(mixed $offset, mixed $value): void } } - public function remove(mixed $element): bool + /** + * @inheritDoc + */ + public function remove($element): bool { if (($position = array_search($element, $this->data, true)) !== false) { unset($this[$position]); @@ -100,11 +106,6 @@ public function remove(mixed $element): bool } /** - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call column() on this - * collection. - * * @inheritDoc */ public function column(string $propertyOrMethod): array @@ -112,55 +113,55 @@ public function column(string $propertyOrMethod): array $temp = []; foreach ($this->data as $item) { + /** @var mixed $value */ + $value = $this->extractValue($item, $propertyOrMethod); + /** @psalm-suppress MixedAssignment */ - $temp[] = $this->extractValue($item, $propertyOrMethod); + $temp[] = $value; } return $temp; } /** - * @return T - * - * @throws NoSuchElementException if this collection is empty. + * @inheritDoc */ - public function first(): mixed + public function first() { - $firstIndex = array_key_first($this->data); - - if ($firstIndex === null) { - throw new NoSuchElementException('Can\'t determine first item. Collection is empty'); + if ($this->isEmpty()) { + throw new OutOfBoundsException('Can\'t determine first item. Collection is empty'); } - return $this->data[$firstIndex]; + reset($this->data); + + /** @var T $first */ + $first = current($this->data); + + return $first; } /** - * @return T - * - * @throws NoSuchElementException if this collection is empty. + * @inheritDoc */ - public function last(): mixed + public function last() { - $lastIndex = array_key_last($this->data); - - if ($lastIndex === null) { - throw new NoSuchElementException('Can\'t determine last item. Collection is empty'); + if ($this->isEmpty()) { + throw new OutOfBoundsException('Can\'t determine last item. Collection is empty'); } - return $this->data[$lastIndex]; + /** @var T $item */ + $item = end($this->data); + reset($this->data); + + return $item; } - /** - * @return CollectionInterface - * - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call sort() on this - * collection. - */ - public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): CollectionInterface + public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): CollectionInterface { + if (!in_array($order, [self::SORT_ASC, self::SORT_DESC], true)) { + throw new InvalidSortOrderException('Invalid sort order given: ' . $order); + } + $collection = clone $this; usort( @@ -169,25 +170,20 @@ public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascen * @param T $a * @param T $b */ - function (mixed $a, mixed $b) use ($propertyOrMethod, $order): int { + function ($a, $b) use ($propertyOrMethod, $order): int { /** @var mixed $aValue */ $aValue = $this->extractValue($a, $propertyOrMethod); /** @var mixed $bValue */ $bValue = $this->extractValue($b, $propertyOrMethod); - return ($aValue <=> $bValue) * ($order === Sort::Descending ? -1 : 1); + return ($aValue <=> $bValue) * ($order === self::SORT_DESC ? -1 : 1); }, ); return $collection; } - /** - * @param callable(T): bool $callback A callable to use for filtering elements. - * - * @return CollectionInterface - */ public function filter(callable $callback): CollectionInterface { $collection = clone $this; @@ -197,66 +193,23 @@ public function filter(callable $callback): CollectionInterface } /** - * @return CollectionInterface - * - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call where() on this - * collection. + * {@inheritdoc} */ - public function where(?string $propertyOrMethod, mixed $value): CollectionInterface + public function where(string $propertyOrMethod, $value): CollectionInterface { - return $this->filter( - /** - * @param T $item - */ - function (mixed $item) use ($propertyOrMethod, $value): bool { - /** @var mixed $accessorValue */ - $accessorValue = $this->extractValue($item, $propertyOrMethod); + return $this->filter(function ($item) use ($propertyOrMethod, $value) { + /** @var mixed $accessorValue */ + $accessorValue = $this->extractValue($item, $propertyOrMethod); - return $accessorValue === $value; - }, - ); + return $accessorValue === $value; + }); } - /** - * @param callable(T): TCallbackReturn $callback A callable to apply to each - * item of the collection. - * - * @return CollectionInterface - * - * @template TCallbackReturn - */ public function map(callable $callback): CollectionInterface { - /** @var Collection */ return new Collection('mixed', array_map($callback, $this->data)); } - /** - * @param callable(TCarry, T): TCarry $callback A callable to apply to each - * item of the collection to reduce it to a single value. - * @param TCarry $initial This is the initial value provided to the callback. - * - * @return TCarry - * - * @template TCarry - */ - public function reduce(callable $callback, mixed $initial): mixed - { - /** @var TCarry */ - return array_reduce($this->data, $callback, $initial); - } - - /** - * @param CollectionInterface $other The collection to check for divergent - * items. - * - * @return CollectionInterface - * - * @throws CollectionMismatchException if the compared collections are of - * differing types. - */ public function diff(CollectionInterface $other): CollectionInterface { $this->compareCollectionTypes($other); @@ -273,15 +226,6 @@ public function diff(CollectionInterface $other): CollectionInterface return $collection; } - /** - * @param CollectionInterface $other The collection to check for - * intersecting items. - * - * @return CollectionInterface - * - * @throws CollectionMismatchException if the compared collections are of - * differing types. - */ public function intersect(CollectionInterface $other): CollectionInterface { $this->compareCollectionTypes($other); @@ -295,15 +239,6 @@ public function intersect(CollectionInterface $other): CollectionInterface return $collection; } - /** - * @param CollectionInterface ...$collections The collections to merge. - * - * @return CollectionInterface - * - * @throws CollectionMismatchException if unable to merge any of the given - * collections or items within the given collections due to type - * mismatch errors. - */ public function merge(CollectionInterface ...$collections): CollectionInterface { $mergedCollection = clone $this; @@ -339,10 +274,19 @@ public function merge(CollectionInterface ...$collections): CollectionInterface return $mergedCollection; } + /** + * @inheritDoc + */ + public function unserialize($serialized): void + { + /** @var array $data */ + $data = unserialize($serialized, ['allowed_classes' => [$this->getType()]]); + + $this->data = $data; + } + /** * @param CollectionInterface $other - * - * @throws CollectionMismatchException */ private function compareCollectionTypes(CollectionInterface $other): void { @@ -363,7 +307,7 @@ private function getComparator(): Closure * @param T $a * @param T $b */ - function (mixed $a, mixed $b): int { + function ($a, $b): int { // If the two values are object, we convert them to unique scalars. // If the collection contains mixed values (unlikely) where some are objects // and some are not, we leave them as they are. @@ -383,11 +327,15 @@ function (mixed $a, mixed $b): int { */ private function getUniformType(CollectionInterface $collection): string { - return match ($collection->getType()) { - 'integer' => 'int', - 'boolean' => 'bool', - 'double' => 'float', - default => $collection->getType(), - }; + switch ($collection->getType()) { + case 'integer': + return 'int'; + case 'boolean': + return 'bool'; + case 'double': + return 'float'; + default: + return $collection->getType(); + } } } diff --git a/lib/Google/vendor/ramsey/collection/src/AbstractSet.php b/lib/Google/vendor/ramsey/collection/src/AbstractSet.php index 7186939d7..1126ccb0a 100644 --- a/lib/Google/vendor/ramsey/collection/src/AbstractSet.php +++ b/lib/Google/vendor/ramsey/collection/src/AbstractSet.php @@ -24,7 +24,10 @@ */ abstract class AbstractSet extends AbstractCollection { - public function add(mixed $element): bool + /** + * @inheritDoc + */ + public function add($element): bool { if ($this->contains($element)) { return false; @@ -33,7 +36,10 @@ public function add(mixed $element): bool return parent::add($element); } - public function offsetSet(mixed $offset, mixed $value): void + /** + * @inheritDoc + */ + public function offsetSet($offset, $value): void { if ($this->contains($value)) { return; diff --git a/lib/Google/vendor/ramsey/collection/src/ArrayInterface.php b/lib/Google/vendor/ramsey/collection/src/ArrayInterface.php index bc7f6f424..27af6102b 100644 --- a/lib/Google/vendor/ramsey/collection/src/ArrayInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/ArrayInterface.php @@ -17,6 +17,7 @@ use ArrayAccess; use Countable; use IteratorAggregate; +use Serializable; /** * `ArrayInterface` provides traversable array functionality to data types. @@ -28,7 +29,8 @@ interface ArrayInterface extends ArrayAccess, Countable, - IteratorAggregate + IteratorAggregate, + Serializable { /** * Removes all items from this array. diff --git a/lib/Google/vendor/ramsey/collection/src/Collection.php b/lib/Google/vendor/ramsey/collection/src/Collection.php index 44d26bf2e..532b971b6 100644 --- a/lib/Google/vendor/ramsey/collection/src/Collection.php +++ b/lib/Google/vendor/ramsey/collection/src/Collection.php @@ -75,16 +75,25 @@ */ class Collection extends AbstractCollection { + /** + * The type of elements stored in this collection. + * + * A collection's type is immutable once it is set. For this reason, this + * property is set private. + */ + private string $collectionType; + /** * Constructs a collection object of the specified type, optionally with the * specified data. * - * @param string $collectionType The type or class name associated with this + * @param string $collectionType The type (FQCN) associated with this * collection. * @param array $data The initial items to store in the collection. */ - public function __construct(private readonly string $collectionType, array $data = []) + public function __construct(string $collectionType, array $data = []) { + $this->collectionType = $collectionType; parent::__construct($data); } diff --git a/lib/Google/vendor/ramsey/collection/src/CollectionInterface.php b/lib/Google/vendor/ramsey/collection/src/CollectionInterface.php index e3ad01470..9f86a2837 100644 --- a/lib/Google/vendor/ramsey/collection/src/CollectionInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/CollectionInterface.php @@ -14,14 +14,8 @@ namespace Ramsey\Collection; -use Ramsey\Collection\Exception\CollectionMismatchException; -use Ramsey\Collection\Exception\InvalidArgumentException; -use Ramsey\Collection\Exception\InvalidPropertyOrMethod; -use Ramsey\Collection\Exception\NoSuchElementException; -use Ramsey\Collection\Exception\UnsupportedOperationException; - /** - * A collection represents a group of values, known as its elements. + * A collection represents a group of objects, known as its elements. * * Some collections allow duplicate elements and others do not. Some are ordered * and others unordered. @@ -31,6 +25,16 @@ */ interface CollectionInterface extends ArrayInterface { + /** + * Ascending sort type. + */ + public const SORT_ASC = 'asc'; + + /** + * Descending sort type. + */ + public const SORT_DESC = 'desc'; + /** * Ensures that this collection contains the specified element (optional * operation). @@ -54,11 +58,9 @@ interface CollectionInterface extends ArrayInterface * @param T $element The element to add to the collection. * * @return bool `true` if this collection changed as a result of the call. - * - * @throws InvalidArgumentException if the collection refuses to add the - * $element for any reason other than that it already contains the element. */ - public function add(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function add($element): bool; /** * Returns `true` if this collection contains the specified element. @@ -66,7 +68,8 @@ public function add(mixed $element): bool; * @param T $element The element to check whether the collection contains. * @param bool $strict Whether to perform a strict type check on the value. */ - public function contains(mixed $element, bool $strict = true): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function contains($element, bool $strict = true): bool; /** * Returns the type associated with this collection. @@ -81,20 +84,15 @@ public function getType(): string; * * @return bool `true` if an element was removed as a result of this call. */ - public function remove(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function remove($element): bool; /** - * Returns the values from the given property, method, or array key. - * - * @param string $propertyOrMethod The name of the property, method, or - * array key to evaluate and return. + * Returns the values from the given property or method. * - * @return array + * @param string $propertyOrMethod The property or method name to filter by. * - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call column() on this - * collection. + * @return list */ public function column(string $propertyOrMethod): array; @@ -102,41 +100,29 @@ public function column(string $propertyOrMethod): array; * Returns the first item of the collection. * * @return T - * - * @throws NoSuchElementException if this collection is empty. */ - public function first(): mixed; + public function first(); /** * Returns the last item of the collection. * * @return T - * - * @throws NoSuchElementException if this collection is empty. */ - public function last(): mixed; + public function last(); /** - * Sort the collection by a property, method, or array key with the given - * sort order. - * - * If $propertyOrMethod is `null`, this will sort by comparing each element. + * Sort the collection by a property or method with the given sort order. * * This will always leave the original collection untouched and will return * a new one. * - * @param string | null $propertyOrMethod The property, method, or array key - * to sort by. - * @param Sort $order The sort order for the resulting collection. + * @param string $propertyOrMethod The property or method to sort by. + * @param string $order The sort order for the resulting collection (one of + * this interface's `SORT_*` constants). * * @return CollectionInterface - * - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call sort() on this - * collection. */ - public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascending): self; + public function sort(string $propertyOrMethod, string $order = self::SORT_ASC): self; /** * Filter out items of the collection which don't match the criteria of @@ -148,31 +134,25 @@ public function sort(?string $propertyOrMethod = null, Sort $order = Sort::Ascen * See the {@link http://php.net/manual/en/function.array-filter.php PHP array_filter() documentation} * for examples of how the `$callback` parameter works. * - * @param callable(T): bool $callback A callable to use for filtering elements. + * @param callable(T):bool $callback A callable to use for filtering elements. * * @return CollectionInterface */ public function filter(callable $callback): self; /** - * Create a new collection where the result of the given property, method, - * or array key of each item in the collection equals the given value. + * Create a new collection where items match the criteria of given callback. * * This will always leave the original collection untouched and will return * a new one. * - * @param string | null $propertyOrMethod The property, method, or array key - * to evaluate. If `null`, the element itself is compared to $value. + * @param string $propertyOrMethod The property or method to evaluate. * @param mixed $value The value to match. * * @return CollectionInterface - * - * @throws InvalidPropertyOrMethod if the $propertyOrMethod does not exist - * on the elements in this collection. - * @throws UnsupportedOperationException if unable to call where() on this - * collection. */ - public function where(?string $propertyOrMethod, mixed $value): self; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function where(string $propertyOrMethod, $value): self; /** * Apply a given callback method on each item of the collection. @@ -184,7 +164,7 @@ public function where(?string $propertyOrMethod, mixed $value): self; * See the {@link http://php.net/manual/en/function.array-map.php PHP array_map() documentation} * for examples of how the `$callback` parameter works. * - * @param callable(T): TCallbackReturn $callback A callable to apply to each + * @param callable(T):TCallbackReturn $callback A callable to apply to each * item of the collection. * * @return CollectionInterface @@ -193,23 +173,6 @@ public function where(?string $propertyOrMethod, mixed $value): self; */ public function map(callable $callback): self; - /** - * Apply a given callback method on each item of the collection - * to reduce it to a single value. - * - * See the {@link http://php.net/manual/en/function.array-reduce.php PHP array_reduce() documentation} - * for examples of how the `$callback` and `$initial` parameters work. - * - * @param callable(TCarry, T): TCarry $callback A callable to apply to each - * item of the collection to reduce it to a single value. - * @param TCarry $initial This is the initial value provided to the callback. - * - * @return TCarry - * - * @template TCarry - */ - public function reduce(callable $callback, mixed $initial): mixed; - /** * Create a new collection with divergent items between current and given * collection. @@ -218,9 +181,6 @@ public function reduce(callable $callback, mixed $initial): mixed; * items. * * @return CollectionInterface - * - * @throws CollectionMismatchException if the compared collections are of - * differing types. */ public function diff(CollectionInterface $other): self; @@ -232,9 +192,6 @@ public function diff(CollectionInterface $other): self; * intersecting items. * * @return CollectionInterface - * - * @throws CollectionMismatchException if the compared collections are of - * differing types. */ public function intersect(CollectionInterface $other): self; @@ -244,10 +201,6 @@ public function intersect(CollectionInterface $other): self; * @param CollectionInterface ...$collections The collections to merge. * * @return CollectionInterface - * - * @throws CollectionMismatchException if unable to merge any of the given - * collections or items within the given collections due to type - * mismatch errors. */ public function merge(CollectionInterface ...$collections): self; } diff --git a/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueue.php b/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueue.php index 62947a24f..4d1f71ea4 100644 --- a/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueue.php +++ b/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueue.php @@ -17,10 +17,6 @@ use Ramsey\Collection\Exception\InvalidArgumentException; use Ramsey\Collection\Exception\NoSuchElementException; -use function array_key_last; -use function array_pop; -use function array_unshift; - /** * This class provides a basic implementation of `DoubleEndedQueueInterface`, to * minimize the effort required to implement this interface. @@ -32,21 +28,33 @@ class DoubleEndedQueue extends Queue implements DoubleEndedQueueInterface { /** - * Constructs a double-ended queue (dequeue) object of the specified type, - * optionally with the specified data. - * - * @param string $queueType The type or class name associated with this dequeue. - * @param array $data The initial items to store in the dequeue. + * Index of the last element in the queue. + */ + private int $tail = -1; + + /** + * @inheritDoc */ - public function __construct(private readonly string $queueType, array $data = []) + public function offsetSet($offset, $value): void { - parent::__construct($this->queueType, $data); + if ($this->checkType($this->getType(), $value) === false) { + throw new InvalidArgumentException( + 'Value must be of type ' . $this->getType() . '; value is ' + . $this->toolValueToString($value), + ); + } + + $this->tail++; + + $this->data[$this->tail] = $value; } /** * @throws InvalidArgumentException if $element is of the wrong type + * + * @inheritDoc */ - public function addFirst(mixed $element): bool + public function addFirst($element): bool { if ($this->checkType($this->getType(), $element) === false) { throw new InvalidArgumentException( @@ -55,112 +63,125 @@ public function addFirst(mixed $element): bool ); } - array_unshift($this->data, $element); + $this->index--; + + $this->data[$this->index] = $element; return true; } /** - * @throws InvalidArgumentException if $element is of the wrong type + * @inheritDoc */ - public function addLast(mixed $element): bool + public function addLast($element): bool { return $this->add($element); } - public function offerFirst(mixed $element): bool + /** + * @inheritDoc + */ + public function offerFirst($element): bool { try { return $this->addFirst($element); - } catch (InvalidArgumentException) { + } catch (InvalidArgumentException $e) { return false; } } - public function offerLast(mixed $element): bool + /** + * @inheritDoc + */ + public function offerLast($element): bool { return $this->offer($element); } /** - * @return T the first element in this queue. - * - * @throws NoSuchElementException if the queue is empty + * @inheritDoc */ - public function removeFirst(): mixed + public function removeFirst() { return $this->remove(); } /** - * @return T the last element in this queue. - * - * @throws NoSuchElementException if this queue is empty. + * @inheritDoc */ - public function removeLast(): mixed + public function removeLast() { - return $this->pollLast() ?? throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); + $tail = $this->pollLast(); + + if ($tail === null) { + throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); + } + + return $tail; } /** - * @return T | null the head of this queue, or `null` if this queue is empty. + * @inheritDoc */ - public function pollFirst(): mixed + public function pollFirst() { return $this->poll(); } /** - * @return T | null the tail of this queue, or `null` if this queue is empty. + * @inheritDoc */ - public function pollLast(): mixed + public function pollLast() { - return array_pop($this->data); + if ($this->count() === 0) { + return null; + } + + $tail = $this[$this->tail]; + + unset($this[$this->tail]); + $this->tail--; + + return $tail; } /** - * @return T the head of this queue. - * - * @throws NoSuchElementException if this queue is empty. + * @inheritDoc */ - public function firstElement(): mixed + public function firstElement() { return $this->element(); } /** - * @return T the tail of this queue. - * - * @throws NoSuchElementException if this queue is empty. + * @inheritDoc */ - public function lastElement(): mixed + public function lastElement() { - return $this->peekLast() ?? throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); + if ($this->count() === 0) { + throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); + } + + return $this->data[$this->tail]; } /** - * @return T | null the head of this queue, or `null` if this queue is empty. + * @inheritDoc */ - public function peekFirst(): mixed + public function peekFirst() { return $this->peek(); } /** - * @return T | null the tail of this queue, or `null` if this queue is empty. + * @inheritDoc */ - public function peekLast(): mixed + public function peekLast() { - $lastIndex = array_key_last($this->data); - - if ($lastIndex === null) { + if ($this->count() === 0) { return null; } - return $this->data[$lastIndex]; + return $this->data[$this->tail]; } } diff --git a/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php b/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php index 15cc0e97b..3fa4ecab8 100644 --- a/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/DoubleEndedQueueInterface.php @@ -181,7 +181,8 @@ interface DoubleEndedQueueInterface extends QueueInterface * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - public function addFirst(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function addFirst($element): bool; /** * Inserts the specified element at the end of this queue if it is possible @@ -201,7 +202,8 @@ public function addFirst(mixed $element): bool; * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - public function addLast(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function addLast($element): bool; /** * Inserts the specified element at the front of this queue if it is @@ -215,7 +217,8 @@ public function addLast(mixed $element): bool; * * @return bool `true` if the element was added to this queue, else `false`. */ - public function offerFirst(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function offerFirst($element): bool; /** * Inserts the specified element at the end of this queue if it is possible @@ -229,7 +232,8 @@ public function offerFirst(mixed $element): bool; * * @return bool `true` if the element was added to this queue, else `false`. */ - public function offerLast(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function offerLast($element): bool; /** * Retrieves and removes the head of this queue. @@ -241,7 +245,7 @@ public function offerLast(mixed $element): bool; * * @throws NoSuchElementException if this queue is empty. */ - public function removeFirst(): mixed; + public function removeFirst(); /** * Retrieves and removes the tail of this queue. @@ -253,23 +257,23 @@ public function removeFirst(): mixed; * * @throws NoSuchElementException if this queue is empty. */ - public function removeLast(): mixed; + public function removeLast(); /** * Retrieves and removes the head of this queue, or returns `null` if this * queue is empty. * - * @return T | null the head of this queue, or `null` if this queue is empty. + * @return T|null the head of this queue, or `null` if this queue is empty. */ - public function pollFirst(): mixed; + public function pollFirst(); /** * Retrieves and removes the tail of this queue, or returns `null` if this * queue is empty. * - * @return T | null the tail of this queue, or `null` if this queue is empty. + * @return T|null the tail of this queue, or `null` if this queue is empty. */ - public function pollLast(): mixed; + public function pollLast(); /** * Retrieves, but does not remove, the head of this queue. @@ -281,7 +285,7 @@ public function pollLast(): mixed; * * @throws NoSuchElementException if this queue is empty. */ - public function firstElement(): mixed; + public function firstElement(); /** * Retrieves, but does not remove, the tail of this queue. @@ -293,21 +297,21 @@ public function firstElement(): mixed; * * @throws NoSuchElementException if this queue is empty. */ - public function lastElement(): mixed; + public function lastElement(); /** * Retrieves, but does not remove, the head of this queue, or returns `null` * if this queue is empty. * - * @return T | null the head of this queue, or `null` if this queue is empty. + * @return T|null the head of this queue, or `null` if this queue is empty. */ - public function peekFirst(): mixed; + public function peekFirst(); /** * Retrieves, but does not remove, the tail of this queue, or returns `null` * if this queue is empty. * - * @return T | null the tail of this queue, or `null` if this queue is empty. + * @return T|null the tail of this queue, or `null` if this queue is empty. */ - public function peekLast(): mixed; + public function peekLast(); } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php b/lib/Google/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php index 42f5be2df..7058bcf6e 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/CollectionMismatchException.php @@ -19,6 +19,6 @@ /** * Thrown when attempting to operate on collections of differing types. */ -class CollectionMismatchException extends RuntimeException implements CollectionException +class CollectionMismatchException extends RuntimeException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php b/lib/Google/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php index 7b41b4a7c..dcc3eac60 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/InvalidArgumentException.php @@ -14,11 +14,9 @@ namespace Ramsey\Collection\Exception; -use InvalidArgumentException as PhpInvalidArgumentException; - /** * Thrown to indicate an argument is not of the expected type. */ -class InvalidArgumentException extends PhpInvalidArgumentException implements CollectionException +class InvalidArgumentException extends \InvalidArgumentException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/CollectionException.php b/lib/Google/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php similarity index 70% rename from lib/Google/vendor/ramsey/collection/src/Exception/CollectionException.php rename to lib/Google/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php index 4aa92bed8..4491429c7 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/CollectionException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/InvalidSortOrderException.php @@ -14,8 +14,11 @@ namespace Ramsey\Collection\Exception; -use Throwable; +use RuntimeException; -interface CollectionException extends Throwable +/** + * Thrown when attempting to use a sort order that is not recognized. + */ +class InvalidSortOrderException extends RuntimeException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/NoSuchElementException.php b/lib/Google/vendor/ramsey/collection/src/Exception/NoSuchElementException.php index cd98f0c0f..cabcb9d88 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/NoSuchElementException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/NoSuchElementException.php @@ -19,6 +19,6 @@ /** * Thrown when attempting to access an element that does not exist. */ -class NoSuchElementException extends RuntimeException implements CollectionException +class NoSuchElementException extends RuntimeException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php b/lib/Google/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php index c75294e53..4e9d16fa3 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/OutOfBoundsException.php @@ -14,11 +14,9 @@ namespace Ramsey\Collection\Exception; -use OutOfBoundsException as PhpOutOfBoundsException; - /** * Thrown when attempting to access an element out of the range of the collection. */ -class OutOfBoundsException extends PhpOutOfBoundsException implements CollectionException +class OutOfBoundsException extends \OutOfBoundsException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php b/lib/Google/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php index d074f45fd..9b6228971 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/UnsupportedOperationException.php @@ -19,6 +19,6 @@ /** * Thrown to indicate that the requested operation is not supported. */ -class UnsupportedOperationException extends RuntimeException implements CollectionException +class UnsupportedOperationException extends RuntimeException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php b/lib/Google/vendor/ramsey/collection/src/Exception/ValueExtractionException.php similarity index 62% rename from lib/Google/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php rename to lib/Google/vendor/ramsey/collection/src/Exception/ValueExtractionException.php index a53be14aa..32f2a175f 100644 --- a/lib/Google/vendor/ramsey/collection/src/Exception/InvalidPropertyOrMethod.php +++ b/lib/Google/vendor/ramsey/collection/src/Exception/ValueExtractionException.php @@ -17,10 +17,8 @@ use RuntimeException; /** - * Thrown when attempting to evaluate a property, method, or array key - * that doesn't exist on an element or cannot otherwise be evaluated in the - * current context. + * Thrown when attempting to extract a value for a method or property that does not exist. */ -class InvalidPropertyOrMethod extends RuntimeException implements CollectionException +class ValueExtractionException extends RuntimeException { } diff --git a/lib/Google/vendor/ramsey/collection/src/Map/AbstractMap.php b/lib/Google/vendor/ramsey/collection/src/Map/AbstractMap.php index 7a851a80f..378807289 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/AbstractMap.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/AbstractMap.php @@ -16,7 +16,6 @@ use Ramsey\Collection\AbstractArray; use Ramsey\Collection\Exception\InvalidArgumentException; -use Traversable; use function array_key_exists; use function array_keys; @@ -27,37 +26,16 @@ * This class provides a basic implementation of `MapInterface`, to minimize the * effort required to implement this interface. * - * @template K of array-key * @template T * @extends AbstractArray - * @implements MapInterface + * @implements MapInterface */ abstract class AbstractMap extends AbstractArray implements MapInterface { /** - * @param array $data The initial items to add to this map. - */ - public function __construct(array $data = []) - { - parent::__construct($data); - } - - /** - * @return Traversable - */ - public function getIterator(): Traversable - { - return parent::getIterator(); - } - - /** - * @param K $offset The offset to set - * @param T $value The value to set at the given offset. - * * @inheritDoc - * @psalm-suppress MoreSpecificImplementedParamType,DocblockTypeContradiction */ - public function offsetSet(mixed $offset, mixed $value): void + public function offsetSet($offset, $value): void { if ($offset === null) { throw new InvalidArgumentException( @@ -69,12 +47,18 @@ public function offsetSet(mixed $offset, mixed $value): void $this->data[$offset] = $value; } - public function containsKey(int | string $key): bool + /** + * @inheritDoc + */ + public function containsKey($key): bool { return array_key_exists($key, $this->data); } - public function containsValue(mixed $value): bool + /** + * @inheritDoc + */ + public function containsValue($value): bool { return in_array($value, $this->data, true); } @@ -88,24 +72,21 @@ public function keys(): array } /** - * @param K $key The key to return from the map. - * @param T | null $defaultValue The default value to use if `$key` is not found. - * - * @return T | null the value or `null` if the key could not be found. + * @inheritDoc */ - public function get(int | string $key, mixed $defaultValue = null): mixed + public function get($key, $defaultValue = null) { - return $this[$key] ?? $defaultValue; + if (!$this->containsKey($key)) { + return $defaultValue; + } + + return $this[$key]; } /** - * @param K $key The key to put or replace in the map. - * @param T $value The value to store at `$key`. - * - * @return T | null the previous value associated with key, or `null` if - * there was no mapping for `$key`. + * @inheritDoc */ - public function put(int | string $key, mixed $value): mixed + public function put($key, $value) { $previousValue = $this->get($key); $this[$key] = $value; @@ -114,13 +95,9 @@ public function put(int | string $key, mixed $value): mixed } /** - * @param K $key The key to put in the map. - * @param T $value The value to store at `$key`. - * - * @return T | null the previous value associated with key, or `null` if - * there was no mapping for `$key`. + * @inheritDoc */ - public function putIfAbsent(int | string $key, mixed $value): mixed + public function putIfAbsent($key, $value) { $currentValue = $this->get($key); @@ -132,12 +109,9 @@ public function putIfAbsent(int | string $key, mixed $value): mixed } /** - * @param K $key The key to remove from the map. - * - * @return T | null the previous value associated with key, or `null` if - * there was no mapping for `$key`. + * @inheritDoc */ - public function remove(int | string $key): mixed + public function remove($key) { $previousValue = $this->get($key); unset($this[$key]); @@ -145,7 +119,10 @@ public function remove(int | string $key): mixed return $previousValue; } - public function removeIf(int | string $key, mixed $value): bool + /** + * @inheritDoc + */ + public function removeIf($key, $value): bool { if ($this->get($key) === $value) { unset($this[$key]); @@ -157,13 +134,9 @@ public function removeIf(int | string $key, mixed $value): bool } /** - * @param K $key The key to replace. - * @param T $value The value to set at `$key`. - * - * @return T | null the previous value associated with key, or `null` if - * there was no mapping for `$key`. + * @inheritDoc */ - public function replace(int | string $key, mixed $value): mixed + public function replace($key, $value) { $currentValue = $this->get($key); @@ -174,7 +147,10 @@ public function replace(int | string $key, mixed $value): mixed return $currentValue; } - public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool + /** + * @inheritDoc + */ + public function replaceIf($key, $oldValue, $newValue): bool { if ($this->get($key) === $oldValue) { $this[$key] = $newValue; @@ -184,20 +160,4 @@ public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): return false; } - - /** - * @return array - */ - public function __serialize(): array - { - return parent::__serialize(); - } - - /** - * @return array - */ - public function toArray(): array - { - return parent::toArray(); - } } diff --git a/lib/Google/vendor/ramsey/collection/src/Map/AbstractTypedMap.php b/lib/Google/vendor/ramsey/collection/src/Map/AbstractTypedMap.php index 92fdcd54c..486dc2e29 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/AbstractTypedMap.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/AbstractTypedMap.php @@ -18,14 +18,16 @@ use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueToStringTrait; +use function var_export; + /** * This class provides a basic implementation of `TypedMapInterface`, to * minimize the effort required to implement this interface. * * @template K of array-key * @template T - * @extends AbstractMap - * @implements TypedMapInterface + * @extends AbstractMap + * @implements TypedMapInterface */ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface { @@ -33,14 +35,20 @@ abstract class AbstractTypedMap extends AbstractMap implements TypedMapInterface use ValueToStringTrait; /** - * @param K $offset + * @param K|null $offset * @param T $value * * @inheritDoc - * @psalm-suppress MoreSpecificImplementedParamType */ - public function offsetSet(mixed $offset, mixed $value): void + public function offsetSet($offset, $value): void { + if ($offset === null) { + throw new InvalidArgumentException( + 'Map elements are key/value pairs; a key must be provided for ' + . 'value ' . var_export($value, true), + ); + } + if ($this->checkType($this->getKeyType(), $offset) === false) { throw new InvalidArgumentException( 'Key must be of type ' . $this->getKeyType() . '; key is ' diff --git a/lib/Google/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php b/lib/Google/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php index 34e4e853b..79a314d96 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/AssociativeArrayMap.php @@ -17,7 +17,8 @@ /** * `AssociativeArrayMap` represents a standard associative array object. * - * @extends AbstractMap + * @template T + * @extends AbstractMap */ class AssociativeArrayMap extends AbstractMap { diff --git a/lib/Google/vendor/ramsey/collection/src/Map/MapInterface.php b/lib/Google/vendor/ramsey/collection/src/Map/MapInterface.php index 22ba1bdd1..6ed0b2967 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/MapInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/MapInterface.php @@ -21,7 +21,6 @@ * * A map cannot contain duplicate keys; each key can map to at most one value. * - * @template K of array-key * @template T * @extends ArrayInterface */ @@ -30,9 +29,9 @@ interface MapInterface extends ArrayInterface /** * Returns `true` if this map contains a mapping for the specified key. * - * @param K $key The key to check in the map. + * @param array-key $key The key to check in the map. */ - public function containsKey(int | string $key): bool; + public function containsKey($key): bool; /** * Returns `true` if this map maps one or more keys to the specified value. @@ -41,12 +40,13 @@ public function containsKey(int | string $key): bool; * * @param T $value The value to check in the map. */ - public function containsValue(mixed $value): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function containsValue($value): bool; /** * Return an array of the keys contained in this map. * - * @return list + * @return list */ public function keys(): array; @@ -55,12 +55,13 @@ public function keys(): array; * map contains no mapping for the key, or (optionally) `$defaultValue` if * this map contains no mapping for the key. * - * @param K $key The key to return from the map. - * @param T | null $defaultValue The default value to use if `$key` is not found. + * @param array-key $key The key to return from the map. + * @param T|null $defaultValue The default value to use if `$key` is not found. * - * @return T | null the value or `null` if the key could not be found. + * @return T|null the value or `null` if the key could not be found. */ - public function get(int | string $key, mixed $defaultValue = null): mixed; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function get($key, $defaultValue = null); /** * Associates the specified value with the specified key in this map. @@ -68,13 +69,14 @@ public function get(int | string $key, mixed $defaultValue = null): mixed; * If the map previously contained a mapping for the key, the old value is * replaced by the specified value. * - * @param K $key The key to put or replace in the map. + * @param array-key $key The key to put or replace in the map. * @param T $value The value to store at `$key`. * - * @return T | null the previous value associated with key, or `null` if + * @return T|null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - public function put(int | string $key, mixed $value): mixed; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function put($key, $value); /** * Associates the specified value with the specified key in this map only if @@ -83,23 +85,25 @@ public function put(int | string $key, mixed $value): mixed; * If there is already a value associated with `$key`, this returns that * value without replacing it. * - * @param K $key The key to put in the map. + * @param array-key $key The key to put in the map. * @param T $value The value to store at `$key`. * - * @return T | null the previous value associated with key, or `null` if + * @return T|null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - public function putIfAbsent(int | string $key, mixed $value): mixed; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function putIfAbsent($key, $value); /** * Removes the mapping for a key from this map if it is present. * - * @param K $key The key to remove from the map. + * @param array-key $key The key to remove from the map. * - * @return T | null the previous value associated with key, or `null` if + * @return T|null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - public function remove(int | string $key): mixed; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function remove($key); /** * Removes the entry for the specified key only if it is currently mapped to @@ -107,24 +111,26 @@ public function remove(int | string $key): mixed; * * This performs a strict type check on the value. * - * @param K $key The key to remove from the map. + * @param array-key $key The key to remove from the map. * @param T $value The value to match. * * @return bool true if the value was removed. */ - public function removeIf(int | string $key, mixed $value): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function removeIf($key, $value): bool; /** * Replaces the entry for the specified key only if it is currently mapped * to some value. * - * @param K $key The key to replace. + * @param array-key $key The key to replace. * @param T $value The value to set at `$key`. * - * @return T | null the previous value associated with key, or `null` if + * @return T|null the previous value associated with key, or `null` if * there was no mapping for `$key`. */ - public function replace(int | string $key, mixed $value): mixed; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function replace($key, $value); /** * Replaces the entry for the specified key only if currently mapped to the @@ -132,11 +138,12 @@ public function replace(int | string $key, mixed $value): mixed; * * This performs a strict type check on the value. * - * @param K $key The key to remove from the map. + * @param array-key $key The key to remove from the map. * @param T $oldValue The value to match. * @param T $newValue The value to use as a replacement. * * @return bool true if the value was replaced. */ - public function replaceIf(int | string $key, mixed $oldValue, mixed $newValue): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function replaceIf($key, $oldValue, $newValue): bool; } diff --git a/lib/Google/vendor/ramsey/collection/src/Map/NamedParameterMap.php b/lib/Google/vendor/ramsey/collection/src/Map/NamedParameterMap.php index f948e476c..6e391e970 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/NamedParameterMap.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/NamedParameterMap.php @@ -21,12 +21,13 @@ use function array_combine; use function array_key_exists; use function is_int; +use function var_export; /** * `NamedParameterMap` represents a mapping of values to a set of named keys * that may optionally be typed * - * @extends AbstractMap + * @extends AbstractMap */ class NamedParameterMap extends AbstractMap { @@ -38,13 +39,13 @@ class NamedParameterMap extends AbstractMap * * @var array */ - private readonly array $namedParameters; + protected array $namedParameters; /** * Constructs a new `NamedParameterMap`. * * @param array $namedParameters The named parameters defined for this map. - * @param array $data An initial set of data to set on this map. + * @param array $data An initial set of data to set on this map. */ public function __construct(array $namedParameters, array $data = []) { @@ -62,12 +63,22 @@ public function getNamedParameters(): array return $this->namedParameters; } - public function offsetSet(mixed $offset, mixed $value): void + /** + * @inheritDoc + */ + public function offsetSet($offset, $value): void { + if ($offset === null) { + throw new InvalidArgumentException( + 'Map elements are key/value pairs; a key must be provided for ' + . 'value ' . var_export($value, true), + ); + } + if (!array_key_exists($offset, $this->namedParameters)) { throw new InvalidArgumentException( 'Attempting to set value for unconfigured parameter \'' - . $this->toolValueToString($offset) . '\'', + . $offset . '\'', ); } diff --git a/lib/Google/vendor/ramsey/collection/src/Map/TypedMap.php b/lib/Google/vendor/ramsey/collection/src/Map/TypedMap.php index f914d9c70..77ef8d314 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/TypedMap.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/TypedMap.php @@ -14,6 +14,8 @@ namespace Ramsey\Collection\Map; +use Ramsey\Collection\Tool\TypeTrait; + /** * A `TypedMap` represents a map of elements where key and value are typed. * @@ -84,6 +86,24 @@ */ class TypedMap extends AbstractTypedMap { + use TypeTrait; + + /** + * The data type of keys stored in this collection. + * + * A map key's type is immutable once it is set. For this reason, this + * property is set private. + */ + private string $keyType; + + /** + * The data type of values stored in this collection. + * + * A map value's type is immutable once it is set. For this reason, this + * property is set private. + */ + private string $valueType; + /** * Constructs a map object of the specified key and value types, * optionally with the specified data. @@ -92,11 +112,11 @@ class TypedMap extends AbstractTypedMap * @param string $valueType The data type of the map's values. * @param array $data The initial data to set for this map. */ - public function __construct( - private readonly string $keyType, - private readonly string $valueType, - array $data = [], - ) { + public function __construct(string $keyType, string $valueType, array $data = []) + { + $this->keyType = $keyType; + $this->valueType = $valueType; + parent::__construct($data); } diff --git a/lib/Google/vendor/ramsey/collection/src/Map/TypedMapInterface.php b/lib/Google/vendor/ramsey/collection/src/Map/TypedMapInterface.php index 5a44f0647..0308109cc 100644 --- a/lib/Google/vendor/ramsey/collection/src/Map/TypedMapInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/Map/TypedMapInterface.php @@ -18,9 +18,8 @@ * A `TypedMapInterface` represents a map of elements where key and value are * typed. * - * @template K of array-key * @template T - * @extends MapInterface + * @extends MapInterface */ interface TypedMapInterface extends MapInterface { diff --git a/lib/Google/vendor/ramsey/collection/src/Queue.php b/lib/Google/vendor/ramsey/collection/src/Queue.php index 0f5b33740..bc8c24e1c 100644 --- a/lib/Google/vendor/ramsey/collection/src/Queue.php +++ b/lib/Google/vendor/ramsey/collection/src/Queue.php @@ -19,8 +19,6 @@ use Ramsey\Collection\Tool\TypeTrait; use Ramsey\Collection\Tool\ValueToStringTrait; -use function array_key_first; - /** * This class provides a basic implementation of `QueueInterface`, to minimize * the effort required to implement this interface. @@ -34,15 +32,29 @@ class Queue extends AbstractArray implements QueueInterface use TypeTrait; use ValueToStringTrait; + /** + * The type of elements stored in this queue. + * + * A queue's type is immutable once it is set. For this reason, this + * property is set private. + */ + private string $queueType; + + /** + * The index of the head of the queue. + */ + protected int $index = 0; + /** * Constructs a queue object of the specified type, optionally with the * specified data. * - * @param string $queueType The type or class name associated with this queue. - * @param array $data The initial items to store in the queue. + * @param string $queueType The type (FQCN) associated with this queue. + * @param array $data The initial items to store in the collection. */ - public function __construct(private readonly string $queueType, array $data = []) + public function __construct(string $queueType, array $data = []) { + $this->queueType = $queueType; parent::__construct($data); } @@ -53,9 +65,9 @@ public function __construct(private readonly string $queueType, array $data = [] * serves only to fulfill the `ArrayAccess` interface requirements. It is * invoked by other operations when adding values to the queue. * - * @throws InvalidArgumentException if $value is of the wrong type. + * @throws InvalidArgumentException if $value is of the wrong type */ - public function offsetSet(mixed $offset, mixed $value): void + public function offsetSet($offset, $value): void { if ($this->checkType($this->getType(), $value) === false) { throw new InvalidArgumentException( @@ -68,9 +80,11 @@ public function offsetSet(mixed $offset, mixed $value): void } /** - * @throws InvalidArgumentException if $value is of the wrong type. + * @throws InvalidArgumentException if $value is of the wrong type + * + * @inheritDoc */ - public function add(mixed $element): bool + public function add($element): bool { $this[] = $element; @@ -78,67 +92,74 @@ public function add(mixed $element): bool } /** - * @return T - * - * @throws NoSuchElementException if this queue is empty. + * @inheritDoc */ - public function element(): mixed + public function element() { - return $this->peek() ?? throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); + $element = $this->peek(); + + if ($element === null) { + throw new NoSuchElementException( + 'Can\'t return element from Queue. Queue is empty.', + ); + } + + return $element; } - public function offer(mixed $element): bool + /** + * @inheritDoc + */ + public function offer($element): bool { try { return $this->add($element); - } catch (InvalidArgumentException) { + } catch (InvalidArgumentException $e) { return false; } } /** - * @return T | null + * @inheritDoc */ - public function peek(): mixed + public function peek() { - $index = array_key_first($this->data); - - if ($index === null) { + if ($this->count() === 0) { return null; } - return $this[$index]; + return $this[$this->index]; } /** - * @return T | null + * @inheritDoc */ - public function poll(): mixed + public function poll() { - $index = array_key_first($this->data); - - if ($index === null) { + if ($this->count() === 0) { return null; } - $head = $this[$index]; - unset($this[$index]); + $head = $this[$this->index]; + + unset($this[$this->index]); + $this->index++; return $head; } /** - * @return T - * - * @throws NoSuchElementException if this queue is empty. + * @inheritDoc */ - public function remove(): mixed + public function remove() { - return $this->poll() ?? throw new NoSuchElementException( - 'Can\'t return element from Queue. Queue is empty.', - ); + $head = $this->poll(); + + if ($head === null) { + throw new NoSuchElementException('Can\'t return element from Queue. Queue is empty.'); + } + + return $head; } public function getType(): string diff --git a/lib/Google/vendor/ramsey/collection/src/QueueInterface.php b/lib/Google/vendor/ramsey/collection/src/QueueInterface.php index f29ce43ab..4f91487fa 100644 --- a/lib/Google/vendor/ramsey/collection/src/QueueInterface.php +++ b/lib/Google/vendor/ramsey/collection/src/QueueInterface.php @@ -129,7 +129,8 @@ interface QueueInterface extends ArrayInterface * Implementations should use a more-specific exception that extends * `\RuntimeException`. */ - public function add(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function add($element): bool; /** * Retrieves, but does not remove, the head of this queue. @@ -143,7 +144,7 @@ public function add(mixed $element): bool; * * @throws NoSuchElementException if this queue is empty. */ - public function element(): mixed; + public function element(); /** * Inserts the specified element into this queue if it is possible to do so @@ -159,7 +160,8 @@ public function element(): mixed; * * @return bool `true` if the element was added to this queue, else `false`. */ - public function offer(mixed $element): bool; + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + public function offer($element): bool; /** * Retrieves, but does not remove, the head of this queue, or returns `null` @@ -167,9 +169,9 @@ public function offer(mixed $element): bool; * * @see self::element() * - * @return T | null the head of this queue, or `null` if this queue is empty. + * @return T|null the head of this queue, or `null` if this queue is empty. */ - public function peek(): mixed; + public function peek(); /** * Retrieves and removes the head of this queue, or returns `null` @@ -177,9 +179,9 @@ public function peek(): mixed; * * @see self::remove() * - * @return T | null the head of this queue, or `null` if this queue is empty. + * @return T|null the head of this queue, or `null` if this queue is empty. */ - public function poll(): mixed; + public function poll(); /** * Retrieves and removes the head of this queue. @@ -193,7 +195,7 @@ public function poll(): mixed; * * @throws NoSuchElementException if this queue is empty. */ - public function remove(): mixed; + public function remove(); /** * Returns the type associated with this queue. diff --git a/lib/Google/vendor/ramsey/collection/src/Set.php b/lib/Google/vendor/ramsey/collection/src/Set.php index aa93351c4..c1d37ccca 100644 --- a/lib/Google/vendor/ramsey/collection/src/Set.php +++ b/lib/Google/vendor/ramsey/collection/src/Set.php @@ -28,7 +28,7 @@ * $foo = new \My\Foo(); * $set = new Set(\My\Foo::class); * - * $set->add($foo); // returns TRUE, the element doesn't exist + * $set->add($foo); // returns TRUE, the element don't exists * $set->add($foo); // returns FALSE, the element already exists * * $bar = new \My\Foo(); @@ -40,15 +40,23 @@ */ class Set extends AbstractSet { + /** + * The type of elements stored in this set + * + * A set's type is immutable. For this reason, this property is private. + */ + private string $setType; + /** * Constructs a set object of the specified type, optionally with the * specified data. * - * @param string $setType The type or class name associated with this set. + * @param string $setType The type (FQCN) associated with this set. * @param array $data The initial items to store in the set. */ - public function __construct(private readonly string $setType, array $data = []) + public function __construct(string $setType, array $data = []) { + $this->setType = $setType; parent::__construct($data); } diff --git a/lib/Google/vendor/ramsey/collection/src/Sort.php b/lib/Google/vendor/ramsey/collection/src/Sort.php deleted file mode 100644 index 0c3c19213..000000000 --- a/lib/Google/vendor/ramsey/collection/src/Sort.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @license http://opensource.org/licenses/MIT MIT - */ - -declare(strict_types=1); - -namespace Ramsey\Collection; - -/** - * Collection sorting - */ -enum Sort: string -{ - /** - * Sort items in a collection in ascending order. - */ - case Ascending = 'asc'; - - /** - * Sort items in a collection in descending order. - */ - case Descending = 'desc'; -} diff --git a/lib/Google/vendor/ramsey/collection/src/Tool/TypeTrait.php b/lib/Google/vendor/ramsey/collection/src/Tool/TypeTrait.php index ac51b7f10..728d44b65 100644 --- a/lib/Google/vendor/ramsey/collection/src/Tool/TypeTrait.php +++ b/lib/Google/vendor/ramsey/collection/src/Tool/TypeTrait.php @@ -36,22 +36,39 @@ trait TypeTrait * @param string $type The type to check the value against. * @param mixed $value The value to check. */ - protected function checkType(string $type, mixed $value): bool + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + protected function checkType(string $type, $value): bool { - return match ($type) { - 'array' => is_array($value), - 'bool', 'boolean' => is_bool($value), - 'callable' => is_callable($value), - 'float', 'double' => is_float($value), - 'int', 'integer' => is_int($value), - 'null' => $value === null, - 'numeric' => is_numeric($value), - 'object' => is_object($value), - 'resource' => is_resource($value), - 'scalar' => is_scalar($value), - 'string' => is_string($value), - 'mixed' => true, - default => $value instanceof $type, - }; + switch ($type) { + case 'array': + return is_array($value); + case 'bool': + case 'boolean': + return is_bool($value); + case 'callable': + return is_callable($value); + case 'float': + case 'double': + return is_float($value); + case 'int': + case 'integer': + return is_int($value); + case 'null': + return $value === null; + case 'numeric': + return is_numeric($value); + case 'object': + return is_object($value); + case 'resource': + return is_resource($value); + case 'scalar': + return is_scalar($value); + case 'string': + return is_string($value); + case 'mixed': + return true; + default: + return $value instanceof $type; + } } } diff --git a/lib/Google/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php b/lib/Google/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php index 44c422252..e10824283 100644 --- a/lib/Google/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php +++ b/lib/Google/vendor/ramsey/collection/src/Tool/ValueExtractorTrait.php @@ -14,10 +14,9 @@ namespace Ramsey\Collection\Tool; -use Ramsey\Collection\Exception\InvalidPropertyOrMethod; -use Ramsey\Collection\Exception\UnsupportedOperationException; +use Ramsey\Collection\Exception\ValueExtractionException; -use function is_array; +use function get_class; use function is_object; use function method_exists; use function property_exists; @@ -29,53 +28,34 @@ trait ValueExtractorTrait { /** - * Extracts the value of the given property, method, or array key from the - * element. + * Extracts the value of the given property or method from the object. * - * If `$propertyOrMethod` is `null`, we return the element as-is. - * - * @param mixed $element The element to extract the value from. - * @param string | null $propertyOrMethod The property or method for which the + * @param mixed $object The object to extract the value from. + * @param string $propertyOrMethod The property or method for which the * value should be extracted. * - * @return mixed the value extracted from the specified property, method, - * or array key, or the element itself. + * @return mixed the value extracted from the specified property or method. * - * @throws InvalidPropertyOrMethod - * @throws UnsupportedOperationException + * @throws ValueExtractionException if the method or property is not defined. */ - protected function extractValue(mixed $element, ?string $propertyOrMethod): mixed + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + protected function extractValue($object, string $propertyOrMethod) { - if ($propertyOrMethod === null) { - return $element; - } - - if (!is_object($element) && !is_array($element)) { - throw new UnsupportedOperationException(sprintf( - 'The collection type "%s" does not support the $propertyOrMethod parameter', - $this->getType(), - )); - } - - if (is_array($element)) { - return $element[$propertyOrMethod] ?? throw new InvalidPropertyOrMethod(sprintf( - 'Key or index "%s" not found in collection elements', - $propertyOrMethod, - )); + if (!is_object($object)) { + throw new ValueExtractionException('Unable to extract a value from a non-object'); } - if (property_exists($element, $propertyOrMethod)) { - return $element->$propertyOrMethod; + if (property_exists($object, $propertyOrMethod)) { + return $object->$propertyOrMethod; } - if (method_exists($element, $propertyOrMethod)) { - return $element->{$propertyOrMethod}(); + if (method_exists($object, $propertyOrMethod)) { + return $object->{$propertyOrMethod}(); } - throw new InvalidPropertyOrMethod(sprintf( - 'Method or property "%s" not defined in %s', - $propertyOrMethod, - $element::class, - )); + throw new ValueExtractionException( + // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall + sprintf('Method or property "%s" not defined in %s', $propertyOrMethod, get_class($object)), + ); } } diff --git a/lib/Google/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php b/lib/Google/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php index 64fc5fa42..cacefc8b6 100644 --- a/lib/Google/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php +++ b/lib/Google/vendor/ramsey/collection/src/Tool/ValueToStringTrait.php @@ -16,7 +16,7 @@ use DateTimeInterface; -use function assert; +use function get_class; use function get_resource_type; use function is_array; use function is_bool; @@ -24,6 +24,7 @@ use function is_object; use function is_resource; use function is_scalar; +use function var_export; /** * Provides functionality to express a value as string @@ -45,7 +46,8 @@ trait ValueToStringTrait * * @param mixed $value the value to return as a string. */ - protected function toolValueToString(mixed $value): string + // phpcs:ignore SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint + protected function toolValueToString($value): string { // null if ($value === null) { @@ -72,8 +74,12 @@ protected function toolValueToString(mixed $value): string return '(' . get_resource_type($value) . ' resource #' . (int) $value . ')'; } + // If we don't know what it is, use var_export(). + if (!is_object($value)) { + return '(' . var_export($value, true) . ')'; + } + // From here, $value should be an object. - assert(is_object($value)); // __toString() is implemented if (is_callable([$value, '__toString'])) { @@ -86,6 +92,7 @@ protected function toolValueToString(mixed $value): string } // unknown type - return '(' . $value::class . ' Object)'; + // phpcs:ignore SlevomatCodingStandard.Classes.ModernClassNameReference.ClassNameReferencedViaFunctionCall + return '(' . get_class($value) . ' Object)'; } } diff --git a/lib/Google/vendor/ramsey/uuid/src/Uuid.php b/lib/Google/vendor/ramsey/uuid/src/Uuid.php index 18525d0c0..e0384a50c 100644 --- a/lib/Google/vendor/ramsey/uuid/src/Uuid.php +++ b/lib/Google/vendor/ramsey/uuid/src/Uuid.php @@ -310,7 +310,7 @@ public function __serialize(): array * @param string $data The serialized PHP string to unserialize into * a UuidInterface instance */ - public function unserialize($data): void + public function unserialize(string $data): void { if (strlen($data) === 16) { /** @var Uuid $uuid */ diff --git a/lib/Google/vendor/symfony/deprecation-contracts/.gitignore b/lib/Google/vendor/symfony/deprecation-contracts/.gitignore new file mode 100644 index 000000000..c49a5d8df --- /dev/null +++ b/lib/Google/vendor/symfony/deprecation-contracts/.gitignore @@ -0,0 +1,3 @@ +vendor/ +composer.lock +phpunit.xml diff --git a/lib/Google/vendor/symfony/deprecation-contracts/LICENSE b/lib/Google/vendor/symfony/deprecation-contracts/LICENSE index 0ed3a2465..406242ff2 100644 --- a/lib/Google/vendor/symfony/deprecation-contracts/LICENSE +++ b/lib/Google/vendor/symfony/deprecation-contracts/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-present Fabien Potencier +Copyright (c) 2020-2022 Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Google/vendor/symfony/deprecation-contracts/README.md b/lib/Google/vendor/symfony/deprecation-contracts/README.md index 9814864c0..4957933a6 100644 --- a/lib/Google/vendor/symfony/deprecation-contracts/README.md +++ b/lib/Google/vendor/symfony/deprecation-contracts/README.md @@ -22,5 +22,5 @@ trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use This will generate the following message: `Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` -While not recommended, the deprecation notices can be completely ignored by declaring an empty +While not necessarily recommended, the deprecation notices can be completely ignored by declaring an empty `function trigger_deprecation() {}` in your application. diff --git a/lib/Google/vendor/symfony/deprecation-contracts/composer.json b/lib/Google/vendor/symfony/deprecation-contracts/composer.json index 774200fdc..1c1b4ba0e 100644 --- a/lib/Google/vendor/symfony/deprecation-contracts/composer.json +++ b/lib/Google/vendor/symfony/deprecation-contracts/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=8.1" + "php": ">=8.0.2" }, "autoload": { "files": [ @@ -25,7 +25,7 @@ "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "3.3-dev" + "dev-main": "3.0-dev" }, "thanks": { "name": "symfony/contracts", diff --git a/vendor/symfony/deprecation-contracts/LICENSE b/lib/Google/vendor/symfony/polyfill-php81/LICENSE similarity index 95% rename from vendor/symfony/deprecation-contracts/LICENSE rename to lib/Google/vendor/symfony/polyfill-php81/LICENSE index 0ed3a2465..99c6bdf35 100644 --- a/vendor/symfony/deprecation-contracts/LICENSE +++ b/lib/Google/vendor/symfony/polyfill-php81/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2020-present Fabien Potencier +Copyright (c) 2021-present Fabien Potencier Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/Google/vendor/symfony/polyfill-php81/Php81.php b/lib/Google/vendor/symfony/polyfill-php81/Php81.php new file mode 100644 index 000000000..f0507b765 --- /dev/null +++ b/lib/Google/vendor/symfony/polyfill-php81/Php81.php @@ -0,0 +1,37 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Polyfill\Php81; + +/** + * @author Nicolas Grekas + * + * @internal + */ +final class Php81 +{ + public static function array_is_list(array $array): bool + { + if ([] === $array || $array === array_values($array)) { + return true; + } + + $nextKey = -1; + + foreach ($array as $k => $v) { + if ($k !== ++$nextKey) { + return false; + } + } + + return true; + } +} diff --git a/lib/Google/vendor/symfony/polyfill-php81/README.md b/lib/Google/vendor/symfony/polyfill-php81/README.md new file mode 100644 index 000000000..c07ef7820 --- /dev/null +++ b/lib/Google/vendor/symfony/polyfill-php81/README.md @@ -0,0 +1,18 @@ +Symfony Polyfill / Php81 +======================== + +This component provides features added to PHP 8.1 core: + +- [`array_is_list`](https://php.net/array_is_list) +- [`enum_exists`](https://php.net/enum-exists) +- [`MYSQLI_REFRESH_REPLICA`](https://php.net/mysqli.constants#constantmysqli-refresh-replica) constant +- [`ReturnTypeWillChange`](https://wiki.php.net/rfc/internal_method_return_types) +- [`CURLStringFile`](https://php.net/CURLStringFile) (but only if PHP >= 7.4 is used) + +More information can be found in the +[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). + +License +======= + +This library is released under the [MIT license](LICENSE). diff --git a/lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php b/lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php new file mode 100644 index 000000000..eb5952ee3 --- /dev/null +++ b/lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/CURLStringFile.php @@ -0,0 +1,51 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +if (\PHP_VERSION_ID >= 70400 && extension_loaded('curl')) { + /** + * @property string $data + */ + class CURLStringFile extends CURLFile + { + private $data; + + public function __construct(string $data, string $postname, string $mime = 'application/octet-stream') + { + $this->data = $data; + parent::__construct('data://application/octet-stream;base64,'.base64_encode($data), $mime, $postname); + } + + public function __set(string $name, $value): void + { + if ('data' !== $name) { + $this->$name = $value; + + return; + } + + if (is_object($value) ? !method_exists($value, '__toString') : !is_scalar($value)) { + throw new \TypeError('Cannot assign '.gettype($value).' to property CURLStringFile::$data of type string'); + } + + $this->name = 'data://application/octet-stream;base64,'.base64_encode($value); + } + + public function __isset(string $name): bool + { + return isset($this->$name); + } + + public function &__get(string $name) + { + return $this->$name; + } + } +} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php b/lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php similarity index 59% rename from vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php rename to lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php index bd1212f6e..cb7720a8d 100644 --- a/vendor/symfony/polyfill-php80/Resources/stubs/PhpToken.php +++ b/lib/Google/vendor/symfony/polyfill-php81/Resources/stubs/ReturnTypeWillChange.php @@ -9,8 +9,12 @@ * file that was distributed with this source code. */ -if (\PHP_VERSION_ID < 80000 && extension_loaded('tokenizer')) { - class PhpToken extends Symfony\Polyfill\Php80\PhpToken +if (\PHP_VERSION_ID < 80100) { + #[Attribute(Attribute::TARGET_METHOD)] + final class ReturnTypeWillChange { + public function __construct() + { + } } } diff --git a/lib/Google/vendor/symfony/polyfill-php81/bootstrap.php b/lib/Google/vendor/symfony/polyfill-php81/bootstrap.php new file mode 100644 index 000000000..9f872e02f --- /dev/null +++ b/lib/Google/vendor/symfony/polyfill-php81/bootstrap.php @@ -0,0 +1,28 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Symfony\Polyfill\Php81 as p; + +if (\PHP_VERSION_ID >= 80100) { + return; +} + +if (defined('MYSQLI_REFRESH_SLAVE') && !defined('MYSQLI_REFRESH_REPLICA')) { + define('MYSQLI_REFRESH_REPLICA', 64); +} + +if (!function_exists('array_is_list')) { + function array_is_list(array $array): bool { return p\Php81::array_is_list($array); } +} + +if (!function_exists('enum_exists')) { + function enum_exists(string $enum, bool $autoload = true): bool { return $autoload && class_exists($enum) && false; } +} diff --git a/vendor/symfony/polyfill-php73/composer.json b/lib/Google/vendor/symfony/polyfill-php81/composer.json similarity index 80% rename from vendor/symfony/polyfill-php73/composer.json rename to lib/Google/vendor/symfony/polyfill-php81/composer.json index b5c58ec19..e02d673d4 100644 --- a/vendor/symfony/polyfill-php73/composer.json +++ b/lib/Google/vendor/symfony/polyfill-php81/composer.json @@ -1,7 +1,7 @@ { - "name": "symfony/polyfill-php73", + "name": "symfony/polyfill-php81", "type": "library", - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", "keywords": ["polyfill", "shim", "compatibility", "portable"], "homepage": "https://symfony.com", "license": "MIT", @@ -19,14 +19,14 @@ "php": ">=7.1" }, "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php73\\": "" }, + "psr-4": { "Symfony\\Polyfill\\Php81\\": "" }, "files": [ "bootstrap.php" ], "classmap": [ "Resources/stubs" ] }, "minimum-stability": "dev", "extra": { "branch-alias": { - "dev-main": "1.27-dev" + "dev-main": "1.28-dev" }, "thanks": { "name": "symfony/polyfill", diff --git a/lib/classes/class-api.php b/lib/classes/class-api.php index eb0f7eaf1..6d4e0de12 100644 --- a/lib/classes/class-api.php +++ b/lib/classes/class-api.php @@ -85,7 +85,7 @@ static public function updateSettings(\WP_REST_Request $request) { if (self::$tokenData === null || empty(self::$tokenData->user_id)) { return new \WP_Error('unauthorized', 'Auth token looks incorrect', ['status' => 401]); } - $is_gae = isset($_SERVER["GAE_VERSION"]) ? true : false; + $is_gae = apply_filters('wp_stateless_is_app_engine', false); $upload_dir = wp_upload_dir(); $is_upload_dir_writable = is_writable($upload_dir['basedir']); diff --git a/lib/classes/class-bootstrap.php b/lib/classes/class-bootstrap.php index 5708ce9bb..abc8e6f14 100644 --- a/lib/classes/class-bootstrap.php +++ b/lib/classes/class-bootstrap.php @@ -54,6 +54,13 @@ final class Bootstrap extends \UsabilityDynamics\WP\Bootstrap_Plugin { * @author peshkov@UD */ protected function __construct($args) { + /** + * Need to be loaded before plugin initialization. + */ + if ( !(defined('WP_STATELESS_COMPATIBILITY_GAE') && !WP_STATELESS_COMPATIBILITY_GAE) ) { + AppEngine::instance(); + } + parent::__construct($args); /** @@ -73,6 +80,7 @@ protected function __construct($args) { // Initialize compatibility modules. add_action('plugins_loaded', function () { new Module(); + DynamicImageSupport::instance(); }); /** @@ -220,6 +228,19 @@ public function init() { * Replacing local path to gs:// for using it on StreamWrapper */ add_filter('upload_dir', array($this, 'filter_upload_dir'), 99); + + /** + * Stateless mode working only with GD library + */ + add_filter('wp_image_editors', array($this, 'select_wp_image_editors')); + + /** + * Init GS client + */ + global $gs_client; + if ($gs_client = $this->init_gs_client()) { + StreamWrapper::register($gs_client); + } } if ($this->get('sm.delete_remote') == 'true') { @@ -246,7 +267,9 @@ public function init() { */ add_filter('wp_image_editors', array($this, 'select_wp_image_editors')); - //init GS client + /** + * Init GS client + */ global $gs_client; if ($gs_client = $this->init_gs_client()) { StreamWrapper::register($gs_client); @@ -723,9 +746,9 @@ public function api_init() { * @return array */ public function attachment_modal_meta_box_callback($form_fields, $post) { - - //do not show on media edit page, only on modal - if (isset($_GET['post'])) { + // Do not show on media edit page, only on modal + // Do not show if we are not in Media Library + if ( isset($_GET['post']) || wp_doing_ajax() ) { return $form_fields; } diff --git a/lib/classes/class-compatibility.php b/lib/classes/class-compatibility.php index 3880795d5..79eae1abb 100644 --- a/lib/classes/class-compatibility.php +++ b/lib/classes/class-compatibility.php @@ -25,7 +25,7 @@ abstract class Compatibility { * ['WP_STATELESS_MEDIA_ON_FLY' => 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT'] */ protected $constant = ''; - protected $enabled = false; + protected $enabled = true; protected $description = ''; protected $plugin_file = null; protected $theme_name = null; diff --git a/lib/classes/compatibility/dynamic-image-support.php b/lib/classes/class-dynamic-image-support.php similarity index 57% rename from lib/classes/compatibility/dynamic-image-support.php rename to lib/classes/class-dynamic-image-support.php index ffe2b3ad2..6dc0f9de2 100644 --- a/lib/classes/compatibility/dynamic-image-support.php +++ b/lib/classes/class-dynamic-image-support.php @@ -1,48 +1,50 @@ 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT']; - protected $description = 'Upload image thumbnails generated by your theme and plugins that do not register media objects with the media library. This could be significantly impact performance negatively.'; - protected $first_party = true; + /** + * Class DynamicImageSupport + * + * @package wpCloud\StatelessMedia + */ + class DynamicImageSupport { + use Singleton; + + const ID = 'dynamic-image-support'; public function __construct() { - $modules = get_option('stateless-modules', array()); + // On Google App Engine not working + if ( apply_filters('wp_stateless_is_app_engine', false) ) { + return; + } - if (empty($modules[$this->id])) { - // Legacy settings - $this->enabled = get_option('sm_on_fly', false); + $enabled = ud_get_stateless_media()->get( 'sm.dynamic_image_support', false ) == 'true'; + + // Legacy setting + if (!$enabled) { + $enabled = get_option('sm_on_fly', false); } - $this->init(); + if ($enabled) { + $this->init_module(); + } } /** - * @param $sm + * Initialize module */ - public function module_init($sm) { - /** - * On Google App Engine not working - */ - if (isset($_SERVER["GAE_VERSION"])) return; - /** - * Handle any other on fly generated media - * 7d23984e Anton Korotkov, 2 years ago (February 19th, 2016 9:02am) new options added - */ + private function init_module() { + // Handle any other on fly generated media add_filter('image_make_intermediate_size', array($this, 'handle_on_fly')); } diff --git a/lib/classes/class-errors.php b/lib/classes/class-errors.php index e424e4ecc..13bf7e85d 100644 --- a/lib/classes/class-errors.php +++ b/lib/classes/class-errors.php @@ -89,6 +89,24 @@ public function __construct( $args ) { add_action( 'wp_ajax_stateless_enable_notice_button_action', array( $this, 'stateless_enable_notice_button_action' ) ); } + /** + * Prevents adding duplicating messages + * Some triggers may happen few times during site load (like 'switch_blog' hook) + * adding the same message several times is not necessary + * + * @param string $collection + * @param string $message + */ + private function add_message( &$collection, $message ) { + $exiting_keys = array_column($collection, 'key'); + + if ( in_array( $message['key'], $exiting_keys ) ) { + return; + } + + $collection[] = $message; + } + /** * Add new message for admin notices * @@ -99,7 +117,7 @@ public function __construct( $args ) { public function add( $message, $type = 'error' ) { switch( $type ) { case 'error': - $this->errors[] = $message; + $this->add_message($this->errors, $message); break; case 'message': case 'warning': @@ -115,7 +133,7 @@ public function add( $message, $type = 'error' ) { if(empty($message['key'])){ $message['key'] = md5( $message['title'] ); } - $this->notices[] = $message; + $this->add_message($this->notices, $message); break; } } diff --git a/lib/classes/class-google-app-engine.php b/lib/classes/class-google-app-engine.php new file mode 100644 index 000000000..3dd7c158b --- /dev/null +++ b/lib/classes/class-google-app-engine.php @@ -0,0 +1,93 @@ +set('sm.readonly.mode', 'app_engine'); + } + + /** + * Add admin message if we are running on Google App Engine + */ + public function add_message() { + if ( !apply_filters('wp_stateless_is_app_engine', false) ) { + return; + } + + ud_get_stateless_media()->errors->add(array( + 'key' => 'stateless_app_engine_auto_mode', + 'button' => 'View Settings', + 'button_link' => admin_url('upload.php?page=stateless-settings'), + 'title' => sprintf(__('Stateless Mode Enabled Automatically.', ud_get_stateless_media()->domain)), + 'message' => sprintf(__('We detected that you are running Google App Engine. This platform does not allow you to save files locally, + so we have automatically enabled Stateless mode. + In this mode, your files will only be stored on Google Cloud Storage.', ud_get_stateless_media()->domain) + ), + ), 'notice'); + } + } + } +} diff --git a/lib/classes/class-module.php b/lib/classes/class-module.php index 1fe19699f..7d236f487 100644 --- a/lib/classes/class-module.php +++ b/lib/classes/class-module.php @@ -22,66 +22,6 @@ class Module { */ public function __construct() { add_action('admin_init', array($this, 'save_modules'), 1); - - /** - * Dynamic Image Support - */ - new DynamicImageSupport(); - - /** - * Google App Engine - */ - new GoogleAppEngine(); - - /** - * Support for Imagify - */ - new Imagify(); - - /** - * Support for ShortPixel Image Optimizer - */ - new ShortPixel(); - - /** - * Support for SiteOrigin CSS files - */ - new SOCSS(); - - /** - * Support for SiteOrigin widget CSS files - */ - new SOWidgetCSS(); - - /** - * VidoRev - */ - new VidoRev(); - - /** - * WP Retina 2x - */ - new WPRetina2x(); - - /** - * Support for WPForms - */ - new WPSmush(); - - /** - * Support for WPForms - */ - new CompatibilityWooExtraProductOptions(); - - /** - * Support for WPBakery Page Builder - */ - new WPBakeryPageBuilder(); - - /** - * Support for WPForms - */ - new WPForms(); } /** diff --git a/lib/classes/class-settings.php b/lib/classes/class-settings.php index 04adb0752..ca80df190 100644 --- a/lib/classes/class-settings.php +++ b/lib/classes/class-settings.php @@ -45,6 +45,7 @@ final class Settings extends \UsabilityDynamics\Settings { 'custom_domain' => array('WP_STATELESS_MEDIA_CUSTOM_DOMAIN', ''), 'organize_media' => array('', 'true'), 'hashify_file_name' => array(['WP_STATELESS_MEDIA_HASH_FILENAME' => 'WP_STATELESS_MEDIA_CACHE_BUSTING'], 'false'), + 'dynamic_image_support' => array(['WP_STATELESS_MEDIA_ON_FLY' => 'WP_STATELESS_DYNAMIC_IMAGE_SUPPORT'], 'false'), ); private $network_only_settings = array( @@ -297,6 +298,8 @@ public function refresh() { } $this->set( 'sm.strings', $this->strings ); + + do_action('wp_stateless_settings_refresh', $this); } /** @@ -411,8 +414,6 @@ public function parse_root_dir_wildcards ( $path ) { return $result; } - - /** * Add menu options */ diff --git a/lib/classes/class-upgrader.php b/lib/classes/class-upgrader.php index 960afe9ef..712071a36 100644 --- a/lib/classes/class-upgrader.php +++ b/lib/classes/class-upgrader.php @@ -131,6 +131,20 @@ private static function upgrade() { if ($sm_mode == 'stateless') update_option('sm_mode', 'ephemeral'); } + /** + * Upgrade to v4.0 + */ + if ( $version && version_compare($version, '4.0', '<') ) { + $modules = get_option('stateless-modules', []); + + if ( is_array($modules) && isset($modules['dynamic-image-support']) ) { + update_option('sm_dynamic_image_support', $modules['dynamic-image-support']); + + unset($modules['dynamic-image-support']); + update_option('stateless-modules', $modules); + } + } + update_option('wp_sm_version', ud_get_stateless_media()->args['version']); } @@ -179,6 +193,20 @@ private static function upgrade_network($version) { if ($sm_mode_site == 'stateless') update_site_option('sm_mode', 'ephemeral'); } + /** + * Upgrade to v4.0 + */ + if ( $version && version_compare($version, '4.0', '<') ) { + $modules = get_site_option('stateless-modules', []); + + if ( is_array($modules) && isset($modules['dynamic-image-support']) ) { + update_site_option('sm_dynamic_image_support', $modules['dynamic-image-support']); + + unset($modules['dynamic-image-support']); + update_site_option('stateless-modules', $modules); + } + } + update_site_option('wp_sm_version', ud_get_stateless_media()->args['version']); } diff --git a/lib/classes/class-utility.php b/lib/classes/class-utility.php index 5c00314fa..b5d596967 100644 --- a/lib/classes/class-utility.php +++ b/lib/classes/class-utility.php @@ -309,7 +309,8 @@ public static function add_media($metadata, $attachment_id, $force = false, $arg 'contentDisposition' => $_contentDisposition, )); - if ($sm_mode == 'stateless' && !wp_doing_ajax() && !wp_doing_cron()) { + if ($sm_mode == 'stateless' && !wp_doing_ajax() && !wp_doing_cron() + || ($sm_mode == 'stateless' && wp_doing_ajax()) ) { global $gs_client; $media_args = wp_parse_args($media_args, array( diff --git a/lib/classes/compatibility/google-app-engine.php b/lib/classes/compatibility/google-app-engine.php deleted file mode 100644 index 7fefae956..000000000 --- a/lib/classes/compatibility/google-app-engine.php +++ /dev/null @@ -1,38 +0,0 @@ - 'WP_STATELESS_COMPATIBILITY_GAE']; - protected $description = 'Ensures compatibility between WordPress media and Google App Engine in Stateless mode.'; - protected $server_constant = 'GAE_VERSION'; - protected $sm_mode_required = 'stateless'; - - public function __construct() { - $modules = get_option('stateless-modules', array()); - - if (empty($modules[$this->id])) { - // Legacy settings - $this->enabled = get_option('sm_gae', false); - } - - $this->init(); - } - - public function module_init($sm) { - } - } - } -} diff --git a/lib/classes/compatibility/imagify.php b/lib/classes/compatibility/imagify.php deleted file mode 100644 index f3eb56f26..000000000 --- a/lib/classes/compatibility/imagify.php +++ /dev/null @@ -1,304 +0,0 @@ -is_extension_supported()) { - return false; - } - } elseif (function_exists('imagify_is_attachment_mime_type_supported')) { - // Use `imagify_is_attachment_mime_type_supported( $attachment_id )`. - if (!imagify_is_attachment_mime_type_supported($attachment_id)) { - return false; - } - } elseif (!wp_attachment_is_image($attachment_id)) { - return false; - } - - return true; - } - - /** - * Added fix for Imagify version 1.9 - * In Ephemeral mode remove files from server after optimization process `imagify_after_optimize_file` - * @param $return - * @param $metadata - * @param $attachment_id - * @param bool $force - * @param array $args - * @return bool - * @author palant@ud - */ - public function skip_remove_media($return, $metadata, $attachment_id, $force = false, $args = array()) { - global $doing_manual_sync; - - if ($force || $doing_manual_sync || !get_imagify_option('auto_optimize')) return false; - - $imagify = new \Imagify\Optimization\File(get_attached_file($attachment_id)); - - if (is_callable(array($imagify, 'is_supported'))) { - if (!$imagify->is_supported(imagify_get_mime_types())) { - return false; - } - } elseif (function_exists('imagify_is_attachment_mime_type_supported')) { - // Use `imagify_is_attachment_mime_type_supported( $attachment_id )`. - if (!imagify_is_attachment_mime_type_supported($attachment_id)) { - return false; - } - } elseif (!wp_attachment_is_image($attachment_id)) { - return false; - } - - return true; - } - - /** - * Try to restore images before compression - * - * @param $attachment_id - * @return mixed - */ - public function fix_missing_file($attachment_id) { - /** - * If mode is ephemeral then we change it to cdn in order images not being deleted before optimization - * Remember that we changed mode via global var - */ - if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { - ud_get_stateless_media()->set('sm.mode', 'cdn'); - global $wp_stateless_imagify_mode; - $wp_stateless_imagify_mode = 'ephemeral'; - } - - $upload_basedir = wp_upload_dir(); - $upload_basedir = trailingslashit($upload_basedir['basedir']); - $meta_data = wp_get_attachment_metadata($attachment_id); - $file = $upload_basedir . $meta_data['file']; - - /** - * Try to get all missing files from GCS - */ - if (!file_exists($file)) { - ud_get_stateless_media()->get_client()->get_media(apply_filters('wp_stateless_file_name', $meta_data['file']), true, $file); - } - - if (!empty($meta_data['sizes']) && is_array($meta_data['sizes'])) { - $upload_basedir = trailingslashit(dirname($file)); - foreach ($meta_data['sizes'] as $image) { - if (!empty($image['gs_name']) && !file_exists($file = $upload_basedir . $image['file'])) { - ud_get_stateless_media()->get_client()->get_media(apply_filters('wp_stateless_file_name', $image['gs_name']), true, $file); - } - } - } - } - - /** - * If image size not exist then upload it to GS. - * - * $args = array( - * 'thumbnail' => $thumbnail, - * 'p_img_large' => $p_img_large, - * ) - * @param $id - */ - public function after_imagify_optimize_attachment($id) { - /** - * Restore ephemeral mode if needed - */ - global $wp_stateless_imagify_mode; - if ($wp_stateless_imagify_mode == 'ephemeral') { - ud_get_stateless_media()->set('sm.mode', 'ephemeral'); - } - - $metadata = wp_get_attachment_metadata($id); - ud_get_stateless_media()->add_media($metadata, $id, true); - - // Sync backup file with GCS - if (current_filter() == 'after_imagify_optimize_attachment') { - /** - * If mode is ephemeral then we change it to cdn in order images not being deleted before optimization - * Remember that we changed mode via global var - * @todo remove if Imagify implement "imagify_has_backup" filter. - */ - if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { - ud_get_stateless_media()->set('sm.mode', 'cdn'); - global $wp_stateless_imagify_mode; - $wp_stateless_imagify_mode = 'ephemeral'; - } - - $file_path = get_attached_file($id); - $backup_path = get_imagify_attachment_backup_path($file_path); - if (file_exists($backup_path)) { - $overwrite = apply_filters('imagify_backup_overwrite_backup', false, $file_path, $backup_path); - // wp_stateless_file_name filter will remove the basedir from the path and prepend with root dir. - $name = apply_filters('wp_stateless_file_name', $backup_path); - do_action('sm:sync::syncFile', $name, $backup_path, $overwrite); - } - } - } - - /** - * Restore backup file from GCS if not exist. - * @param $id - */ - public function get_image_from_gcs($id) { - $file_path = get_attached_file($id); - $backup_path = get_imagify_attachment_backup_path($file_path); - if (!file_exists($backup_path)) { - $upload_dir = wp_upload_dir(); - $name = str_replace(trailingslashit($upload_dir['basedir']), '', $backup_path); - $name = apply_filters('wp_stateless_file_name', $name); - do_action('sm:sync::syncFile', $name, $backup_path, true); - } - } - - /** - * Check if backup exists in GCS. - * @param $return - * @param $has_backup - * @return bool - */ - public function imagify_has_backup($return, $has_backup) { - if (!$return && $has_backup) { - $name = apply_filters('wp_stateless_file_name', $has_backup); - $return = (bool) apply_filters('sm:sync::queue_is_exists', $name); - } - return $return; - } - - /** - * Synchronization after optmize process - * @param $file - * @param array $args - */ - public function imagify_after_optimize_file($file, $args = array()) { - - global $wp_stateless_imagify_mode; - if ($wp_stateless_imagify_mode == 'ephemeral') { - ud_get_stateless_media()->set('sm.mode', 'ephemeral'); - } - - $name = apply_filters('wp_stateless_file_name', basename($file)); - - if (file_exists($file)) { - add_filter('upload_mimes', array($this, 'add_webp_mime'), 10, 2); - /** - * Media already on GCS, so only replacing data on it. For webp format adding path and status to wp_sm_sync table - */ - do_action('sm:sync::syncFile', $name, $file, true, array('use_root' => true, 'skip_db' => (substr($name, -4) == "webp" ? false : true))); - remove_filter('upload_mimes', array($this, 'add_webp_mime'), 10); - } - } - - /** - * @param $return - * @param $process - * @param $file - * @param $thumb_size - * @param $optimization_level - * @param $webp - * @param $is_disabled - * @return mixed - */ - public function imagify_before_optimize_size($return, $process, $file, $thumb_size, $optimization_level, $webp, $is_disabled) { - - try { - $attachment_id = $this->getProperties($this->getProperties($this->getProperties($process)['data'])['media'])['id']; - - $full_size_path = $file->get_path(); - $name = apply_filters('wp_stateless_file_name', basename($full_size_path), true, $attachment_id); - do_action('sm:sync::syncFile', $name, $full_size_path, true, ['download' => true]); - // error_log("\n\ndo_action( 'sm:sync::syncFile', $name, $full_size_path, true, ['download' => true] );"); - } catch (\Throwable $th) { - //throw $th; - } - return $return; - } - - /** - * Get properties from protected value - * @param $process - * @return array - */ - public function getProperties($process) { - $properties = array(); - try { - $rc = new \ReflectionClass($process); - do { - $rp = array(); - /* @var $p \ReflectionProperty */ - foreach ($rc->getProperties() as $p) { - $p->setAccessible(true); - $rp[$p->getName()] = $p->getValue($process); - } - $properties = array_merge($rp, $properties); - } while ($rc = $rc->getParentClass()); - } catch (\ReflectionException $e) { - } - return $properties; - } - } - } -} diff --git a/lib/classes/compatibility/js/shortpixel.js b/lib/classes/compatibility/js/shortpixel.js deleted file mode 100644 index 7e6ac8322..000000000 --- a/lib/classes/compatibility/js/shortpixel.js +++ /dev/null @@ -1,18 +0,0 @@ -/** - * Overriding sliderUpdate() function of shortpixel-image-optimiser\res\js\short-pixel.js - * We need to replace sites url with GCS url - */ - -// backing up original function -var _bk_sliderUpdate = sliderUpdate; - -// overriding the original function -sliderUpdate = function sliderUpdate(id, thumb, bkThumb, percent, filename) { - // replacing sites url with GCS url. - thumb = thumb.replace( - _stateless_short_pixel.baseurl, - _stateless_short_pixel.bucketLink - ); - // using original function aftr altering thumb url. - _bk_sliderUpdate(id, thumb, bkThumb, percent, filename); -}; \ No newline at end of file diff --git a/lib/classes/compatibility/shortpixel.php b/lib/classes/compatibility/shortpixel.php deleted file mode 100644 index 863a0200c..000000000 --- a/lib/classes/compatibility/shortpixel.php +++ /dev/null @@ -1,486 +0,0 @@ -path('lib/classes/compatibility/js/shortpixel.js', 'url'), array('shortpixel'), '', true); - - $image_host = ud_get_stateless_media()->get_gs_host(); - $bucketLink = apply_filters('wp_stateless_bucket_link', $image_host); - - wp_localize_script('stateless-short-pixel', '_stateless_short_pixel', array('baseurl' => $upload_dir['baseurl'], 'bucketLink' => $bucketLink,)); - } - - /** - * Return Path of ShortPixel backup path. - * Bypass the checking whether a backup file exist when returning backup path. - * @todo check on GCS if backup really exist. Maybe we can implement transient caching for performance. - * - * @param $ret - * @param $file - * @param $thumbs - * @return string - */ - public function getBackupFolderAny($ret, $file, $thumbs) { - if ($ret == false) { - $fullSubDir = $this->returnSubDir($file); - $ret = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - } - return $ret; - } - - /** - * Check whether image exist on GCS. - * Only when image is not available on server. - * - * @param $return - * @param $path - * @param null $id - * @return bool - */ - public function shortpixel_image_exists($return, $path, $id = null) { - if ($return) return $return; - - $key = "stateless_url_to_postid_" . md5($path); - $return = get_transient($key); - // echo "\npath: $path \nKey: $key\nReturn: $return\nID: $id\n "; - if (!$return) { - // Checking by matching file name in gs_name and $path. - if (!empty($id)) { - $metadata = wp_get_attachment_metadata($id); - $basename = basename($path); - if (!empty($metadata['gs_name'])) { - $gs_basename = basename($metadata['gs_name']); - if ($gs_basename == $basename) { - $return = true; - } - - if (is_array($metadata['sizes'])) { - foreach ($metadata['sizes'] as $key => &$data) { - if (empty($data['gs_name'])) continue; - $gs_basename = basename($data['gs_name']); - if ($gs_basename == $basename) { - $return = true; - } - } - } - } - } // Directly check on GCS if image exist. - else if (empty($id)) { - $wp_uploads_dir = wp_get_upload_dir(); - $gs_name = str_replace(trailingslashit($wp_uploads_dir['basedir']), '', $path); - $gs_name = str_replace(trailingslashit($wp_uploads_dir['baseurl']), '', $gs_name); - $gs_name = str_replace(trailingslashit(ud_get_stateless_media()->get_gs_host()), '', $gs_name); - $gs_name = apply_filters('wp_stateless_file_name', $gs_name); - if ($media = ud_get_stateless_media()->get_client()->media_exists($gs_name)) { - $return = true; - } - } - set_transient($key, $return, 10 * MINUTE_IN_SECONDS); - } - return $return; - } - - /** - * Short-circuit filter. - * We need to remove backup image from GCS when shortpixel tries to delete from server. - * We are returning true to short-circuit in ephemeral mode, because file not exist in server. - * - * @param $return - * @param $paths - * @return bool - */ - public function shortpixel_skip_delete_backups_and_webps($return, $paths) { - if (empty($paths) || !is_array($paths)) return $return; - - $sp__uploads = wp_upload_dir(); - $fullSubDir = $this->returnSubDir($paths[0]); - $backup_path = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - - foreach ($paths as $key => $path) { - // Removing backup - $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename($path)); - do_action('sm:sync::deleteFile', $name); - - // Removing WebP - $backup_images = \WPShortPixelSettings::getOpt('wp-short-create-webp'); - if ($backup_images) { - $name = str_replace($sp__uploads['basedir'], '', $path); - $name = apply_filters('wp_stateless_file_name', $name . '.webp'); - do_action('sm:sync::deleteFile', $name); - } - } - - if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { - return true; - } - // When ephemeral mode isn't set backup files will be available in server. So no short-circuit. - return $return; - } - - /** - * Skip the original backup process in ephemeral mode. - * - * @param $return - * @param $mainPath - * @param $PATHs - * @return bool - */ - public function shortpixel_skip_backup($return, $mainPath, $PATHs) { - if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { - return true; - } - return $return; - } - - /** - * In ephemeral mode we need to take backup directly from original location. - * Because we will skip the backup process of shortpixel. - * - * @param $metadata - * @param $attachment_id - * @return mixed - */ - public function wp_update_attachment_metadata($metadata, $attachment_id) { - if (ud_get_stateless_media()->get('sm.mode') == 'ephemeral') { - $backup_images = \WPShortPixelSettings::getOpt('wp-short-backup_images'); - if ($backup_images) { - $this->sync_backup_file($attachment_id, $metadata, false, array('before_optimization' => true)); - } - } - return $metadata; - } - - /** - * Sync image after optimization. - * - * @param $id - */ - public function shortpixel_image_optimised($id) { - $metadata = wp_get_attachment_metadata($id); - ud_get_stateless_media()->add_media($metadata, $id, true); - // Sync the webp to GCS - $create_webp = \WPShortPixelSettings::getOpt('wp-short-create-webp'); - if ($create_webp) { - $this->sync_webp_file($id, $metadata); - } - // Don't needed in ephemeral mode. In ephemeral mode the back will be sync once on wp_update_attachment_metadata filter. - if (ud_get_stateless_media()->get('sm.mode') !== 'ephemeral') { - $this->sync_backup_file($id, $metadata, true); - } - } - - /** - * Before shortpixel tries to restore from backup we need to make files available on server. - * - * @param $id - * @param null $metadata - */ - public function shortpixel_before_restore_image($id, $metadata = null) { - $this->sync_backup_file($id, $metadata, true, array('download' => true)); - } - - /** - * Disable default shortpixel restore and directly update image on GCS from backup copy in GCS. - * - * @param $return - * @param null $id - * @return bool - */ - public function shortpixel_skip_restore_image($return, $id = null) { - if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { - $this->client = ud_get_stateless_media()->get_client(); - $this->client->copy_media('localhost/ShortpixelBackups/wp-content/uploads/2019/04/htpps.png', 'localhost/2019/04/htpps.png'); - return true; - } - return $return; - } - - /** - * Sync backup image - * - * @param $id - * @param null $metadata - * @param bool $force - * @param array $args - * before_optimization : pass true if you want to sync directly from original path instead of backup path. - */ - public function sync_backup_file($id, $metadata = null, $force = false, $args = array()) { - $args = wp_parse_args($args, array( - 'download' => false, // whether to only download. - 'before_optimization' => false, // whether to delete local file in ephemeral mode. - )); - - /* Get metadata in case if method is called directly. */ - if (empty($metadata)) { - $metadata = wp_get_attachment_metadata($id); - } - /* Now we go through all available image sizes and upload them to Google Storage */ - if (!empty($metadata['sizes']) && is_array($metadata['sizes'])) { - - // Sync backup file with GCS - $file_path = get_attached_file($id); - $fullSubDir = $this->returnSubDir($file_path); - $backup_path = SHORTPIXEL_BACKUP_FOLDER . '/' . $fullSubDir; - if ($args['before_optimization']) { - $upload_dir = wp_upload_dir(); - $backup_path = $upload_dir['basedir'] . '/' . dirname($metadata['file']); - $args = array('ephemeral' => false); - } - - $absolutePath = trailingslashit($backup_path) . basename($metadata['file']); - $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . basename($metadata['file'])); - do_action('sm:sync::syncFile', $name, $absolutePath, $force, $args); - - foreach ((array) $metadata['sizes'] as $image_size => $data) { - $absolutePath = trailingslashit($backup_path) . $data['file']; - $name = apply_filters('wp_stateless_file_name', SHORTPIXEL_BACKUP . '/' . $fullSubDir . $data['file']); - - do_action('sm:sync::syncFile', $name, $absolutePath, $force, $args); - } - } - } - - /** - * Sync from sync tab - * - * @param $id - * @param null $metadata - */ - public function sync_webp_file($id, $metadata = null) { - /* Get metadata in case if method is called directly. */ - if (empty($metadata)) { - $metadata = wp_get_attachment_metadata($id); - } - add_filter('upload_mimes', array($this, 'add_webp_mime'), 10, 2); - // Sync the webp to GCS - ud_get_stateless_media()->add_media($metadata, $id, true, array('is_webp' => '.webp')); - remove_filter('upload_mimes', array($this, 'add_webp_mime'), 10); - } - - /** - * return subdir for that particular attached file - if it's media library then last 3 path items, otherwise substract the uploads path - * Has trailing directory separator (/) - * - * @copied from shortpixel-image-optimiser\class\db\shortpixel-meta-facade.php - * @param type $file - * @return string - */ - public function returnSubDir($file) { - $hp = wp_normalize_path(get_home_path()); - $file = wp_normalize_path($file); - $sp__uploads = wp_upload_dir(); - if (strstr($file, $hp)) { - $path = str_replace($hp, "", $file); - } elseif (strstr($file, dirname(WP_CONTENT_DIR))) { //in some situations the content dir is not inside the root, check this also (ex. single.shortpixel.com) - $path = str_replace(trailingslashit(dirname(WP_CONTENT_DIR)), "", $file); - } elseif ((strstr(realpath($file), realpath($hp)))) { - $path = str_replace(realpath($hp), "", realpath($file)); - } elseif (strstr($file, trailingslashit(dirname(dirname($sp__uploads['basedir']))))) { - $path = str_replace(trailingslashit(dirname(dirname($sp__uploads['basedir']))), "", $file); - } else { - $path = (substr($file, 1)); - } - $pathArr = explode('/', $path); - unset($pathArr[count($pathArr) - 1]); - return implode('/', $pathArr) . '/'; - } - - /** - * Sync images after shortpixel restore them from backup. - * - * @param $attachmentID - */ - public function handleRestoreBackup($attachmentID) { - $metadata = wp_get_attachment_metadata($attachmentID); - $this->add_media($metadata, $attachmentID); - } - - /** - * Customized version of wpCloud\StatelessMedia\Utility::add_media() - * to satisfied our need in restore backup - * If a image isn't restored from backup then ignore it. - * - * @param $metadata - * @param $attachment_id - */ - public static function add_media($metadata, $attachment_id) { - $upload_dir = wp_upload_dir(); - - $client = ud_get_stateless_media()->get_client(); - - if (!is_wp_error($client)) { - - $fullsizepath = wp_normalize_path(get_attached_file($attachment_id)); - // Make non-images uploadable. - if (empty($metadata['file']) && $attachment_id) { - $metadata = array("file" => str_replace(trailingslashit($upload_dir['basedir']), '', get_attached_file($attachment_id))); - } - - $file = wp_normalize_path($metadata['file']); - $image_host = ud_get_stateless_media()->get_gs_host(); - $bucketLink = apply_filters('wp_stateless_bucket_link', $image_host); - $_cacheControl = \wpCloud\StatelessMedia\Utility::getCacheControl($attachment_id, $metadata, null); - $_contentDisposition = \wpCloud\StatelessMedia\Utility::getContentDisposition($attachment_id, $metadata, null); - $_metadata = array("width" => isset($metadata['width']) ? $metadata['width'] : null, "height" => isset($metadata['height']) ? $metadata['height'] : null, 'object-id' => $attachment_id, 'source-id' => md5($attachment_id . ud_get_stateless_media()->get('sm.bucket')), 'file-hash' => md5($metadata['file'])); - - if (file_exists($fullsizepath)) { - $file = apply_filters('wp_stateless_file_name', $file); - - /* Add default image */ - $media = $client->add_media($_mediaOptions = array_filter(array('force' => true, 'name' => $file, 'absolutePath' => wp_normalize_path(get_attached_file($attachment_id)), 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => get_post_mime_type($attachment_id), 'metadata' => $_metadata))); - - // ephemeral mode: we don't need the local version. - if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { - unlink($fullsizepath); - } - } - - /* Now we go through all available image sizes and upload them to Google Storage */ - if (!empty($metadata['sizes']) && is_array($metadata['sizes'])) { - - $path = wp_normalize_path(dirname(get_attached_file($attachment_id))); - $mediaPath = apply_filters('wp_stateless_file_name', trim(dirname($metadata['file']), '\/\\')); - - foreach ((array) $metadata['sizes'] as $image_size => $data) { - - $absolutePath = wp_normalize_path($path . '/' . $data['file']); - - if (!file_exists($absolutePath)) { - continue; - } - - /* Add 'image size' image */ - $media = $client->add_media(array('force' => true, 'name' => $file_path = trim($mediaPath . '/' . $data['file'], '/'), 'absolutePath' => $absolutePath, 'cacheControl' => $_cacheControl, 'contentDisposition' => $_contentDisposition, 'mimeType' => $data['mime-type'], 'metadata' => array_merge($_metadata, array('width' => $data['width'], 'height' => $data['height'], 'child-of' => $attachment_id, 'file-hash' => md5($data['file']))))); - - /* Break if we have errors. */ - if (!is_wp_error($media)) { - // ephemeral mode: we don't need the local version. - if (ud_get_stateless_media()->get('sm.mode') === 'ephemeral') { - unlink($absolutePath); - } - } - } - } - } - } - // End add_media - - /** - * modifying gs_name and absolutePath so that we can upload webp image using the same Utility::add_media function. - * - * @param $args - * @return mixed - */ - public function wp_stateless_add_media_args($args) { - if (!empty($args['is_webp']) && $args['is_webp']) { - if (\file_exists($args['absolutePath'] . '.webp')) { - $args['name'] = $args['name'] . '.webp'; - $args['absolutePath'] = $args['absolutePath'] . '.webp'; - } else { - $pathinfo = pathinfo($args['absolutePath']); - $absolutePath = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '.webp'; - if (file_exists($absolutePath)) { - $args['name'] = $args['name'] . '.webp'; - $args['absolutePath'] = $absolutePath; - } - } - $args['mimeType'] = 'image/webp'; - } - return $args; - } - - /** - * Bypass server url check and return base url for GCS image. - * - * @param $imageBase - * @param $src - * @return mixed - */ - public function shortpixel_webp_image_base($imageBase, $src) { - $gs_link = \ud_get_stateless_media()->convert_to_gs_link($src, true); - if ($gs_link) { - $imageBase = trailingslashit(dirname($gs_link)); - } - return $imageBase; - } - - /** - * @param $URLs - * @param $id - * @return mixed - */ - public function shortpixel_image_urls($URLs, $id) { - foreach ($URLs as $key => $url) { - $url_parts = wp_parse_url($url); - if ($url_parts['host'] == 'storage.googleapis.com') { - if (preg_match("@(^/?.*?/)(.*)@", $url_parts['path'], $matches)) { - $bucket = trim($matches[1], '/'); - $url_parts['path'] = $matches[2]; - $url_parts['host'] = $bucket . '.' . $url_parts['host']; - $URLs[$key] = Utility::join_url($url_parts); - } - } - } - return $URLs; - } - } - } -} diff --git a/lib/classes/compatibility/siteorigin-css.php b/lib/classes/compatibility/siteorigin-css.php deleted file mode 100644 index 325a268d1..000000000 --- a/lib/classes/compatibility/siteorigin-css.php +++ /dev/null @@ -1,73 +0,0 @@ -get_client()->list_objects("prefix=$prefix"); - // $files_array = $object_list->getItems(); - // foreach ($files_array as $file) { - // do_action( 'sm:sync::deleteFile', $file->name ); - // } - } catch (Exception $e) { - } - } - } - - /** - * Change Upload BaseURL when CDN Used. - * @param $url - * @param $scheme - * @param $orig_scheme - * @return string - */ - public function set_url_scheme($url, $scheme, $orig_scheme) { - $position = strpos($url, 'so-css/'); - if ($position !== false) { - $upload_data = wp_upload_dir(); - $name = substr($url, $position); - // We need to get the absolute path before adding the bucket dir to name. - $absolutePath = $upload_data['basedir'] . '/' . $name; - $name = apply_filters('wp_stateless_file_name', $name, 0); - do_action('sm:sync::syncFile', $name, $absolutePath); - // echo "do_action( 'sm:sync::syncFile', $name, $absolutePath);\n"; - $url = ud_get_stateless_media()->get_gs_host() . '/' . $name; - } - return $url; - } - } - } -} diff --git a/lib/classes/compatibility/siteorigin-widget-bundle.php b/lib/classes/compatibility/siteorigin-widget-bundle.php deleted file mode 100644 index 412a3e936..000000000 --- a/lib/classes/compatibility/siteorigin-widget-bundle.php +++ /dev/null @@ -1,85 +0,0 @@ -get_gs_host() . '/' . $name; - } - return $url; - } - - /** - * Clear all SO CSS files from GCS after expired. 7 days - * @param $value - * @param $expiration - * @param $transient - * @return mixed - */ - public function clear_file_cache($value, $expiration, $transient) { - do_action('sm:sync::deleteFiles', 'siteorigin-widgets/'); - return $value; - } - - /** - * Remove single file from GCS - * @param $new_instance - * @param $form_options - * @param $so_widget - * @return mixed - */ - public function delete_file($new_instance, $form_options, $so_widget) { - $new_instance = $so_widget->modify_instance($new_instance); - $style = $so_widget->get_style_name($new_instance); - $hash = $so_widget->get_style_hash($new_instance); - $name = $so_widget->id_base . '-' . $style . '-' . $hash; - - $file = 'siteorigin-widgets/' . $name . '.css'; - do_action('sm:sync::deleteFile', $file); - return $new_instance; - } - } - } -} diff --git a/lib/classes/compatibility/vidorev.php b/lib/classes/compatibility/vidorev.php deleted file mode 100644 index 4ba05c75a..000000000 --- a/lib/classes/compatibility/vidorev.php +++ /dev/null @@ -1,40 +0,0 @@ -get_client(); - - $file_path = apply_filters('wp_stateless_file_name', $file, 0); - $file_info = @getimagesize($file); - - if ($file_info) { - $_metadata = array( - 'width' => $file_info[0], - 'height' => $file_info[1], - 'object-id' => 'unknown', // we really don't know it - 'source-id' => md5($file . ud_get_stateless_media()->get('sm.bucket')), - 'file-hash' => md5($file) - ); - } - - $media = $client->add_media(apply_filters('sm:item:on_fly:before_add', array( - 'use_root' => false, - 'name' => $file_path, - 'absolutePath' => wp_normalize_path($file), - 'cacheControl' => apply_filters('sm:item:cacheControl', 'public, max-age=36000, must-revalidate', $_metadata), - 'contentDisposition' => null, - 'mimeType' => $type, - 'metadata' => $_metadata - ))); - - $upload['url'] = ud_get_stateless_media()->get_gs_host() . '/' . $file_path; - return $upload; - } - } - } -} diff --git a/lib/classes/compatibility/woocommerce.php b/lib/classes/compatibility/woocommerce.php deleted file mode 100644 index 5e2f10aa7..000000000 --- a/lib/classes/compatibility/woocommerce.php +++ /dev/null @@ -1,47 +0,0 @@ -"Over HTTP Check" setting is enabled.'; - protected $plugin_file = 'wp-retina-2x-pro/wp-retina-2x-pro.php'; - protected $sm_mode_not_supported = ['stateless']; - - /** - * @param $sm - */ - public function module_init($sm) { - // Sync image. - // wr2x_before_generate_retina is always called - // where wr2x_before_regenerate called from ajax requests. - add_action('wr2x_before_generate_retina', array($this, 'before_generate_retina')); - add_action('wr2x_retina_file_added', array($this, 'retina_file_added'), 10, 3); - - // Delete retina image from GCS. - add_action('delete_attachment', array($this, 'delete_retina')); - // Manual Sync retina images. - add_action('sm:synced::image', array($this, 'manual_sync_retina'), 10, 2); - - $over_http = get_option('wr2x_over_http_check', false); - if (!$over_http) { - $url = admin_url('admin.php?page=wr2x_settings-menu'); - ud_get_stateless_media()->errors->add(array('key' => "wp-retina-2x-pro-over-http-check", 'title' => sprintf(__("WP Stateless Compatibility: WP Retina 2x Pro", ud_get_stateless_media()->domain)), 'message' => sprintf(__('Please enable the "Over HTTP Check" settings in Meow Apps > Retina.', ud_get_stateless_media()->domain), $url),), 'notice'); - } - } - - /** - * Download image from GCS to server if doesn't exists. - * - * @param int $attachment_id - * @return void - */ - public function before_generate_retina($attachment_id) { - $upload_basedir = wp_upload_dir(); - $upload_basedir = trailingslashit($upload_basedir['basedir']); - $metadata = wp_get_attachment_metadata($attachment_id); - $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - - foreach ($image_sizes as $image) { - if (!empty($image['gs_name']) && !file_exists($image['path'])) { - ud_get_stateless_media()->get_client()->get_media($image['gs_name'], true, $image['path']); - } - } - } - - /** - * Upload retina image to GCS. - * - * @param int $attachment_id - * @param String $retina_file - * @param String $name image size - * @return void - */ - public function retina_file_added($attachment_id, $retina_file, $name) { - $gs_name = apply_filters('wp_stateless_file_name', $retina_file, 0); - do_action('sm:sync::syncFile', $gs_name, $retina_file, true, array('use_root' => true)); - } - - /** - * Delete retina image from GCS - * - * @param int $attachment_id - * @return void - */ - public function delete_retina($attachment_id) { - $metadata = wp_get_attachment_metadata($attachment_id); - $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - $ignore = get_option("wr2x_ignore_sizes"); - if (empty($ignore)) $ignore = array(); - - foreach ($image_sizes as $size => $img) { - if (in_array($size, $ignore)) { - continue; - } - $pathinfo = pathinfo($img['gs_name']); - $gs_name_retina = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '@2x.' . $pathinfo['extension']; - // @todo Sometime relevant file don't exist on GCS. Try to skip those when retina don't exist. - do_action('sm:sync::deleteFile', $gs_name_retina); - } - } - - /** - * Sync retina images when manual sync is triggered. - * - * @param int $attachment_id - * @param array $metadata - * @return void - */ - public function manual_sync_retina($attachment_id, $metadata) { - $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - - $ignore = get_option("wr2x_ignore_sizes"); - if (empty($ignore)) $ignore = array(); - - foreach ($image_sizes as $size => $img) { - if (in_array($size, $ignore)) { - continue; - } - - $pathinfo = pathinfo($img['path']); - $retina_file = trailingslashit($pathinfo['dirname']) . $pathinfo['filename'] . '@2x.' . $pathinfo['extension']; - $gs_name = apply_filters('wp_stateless_file_name', $retina_file, 0); - - // @todo Sometime relevant file don't exist on GCS. Try to skip those when retina don't exist. - do_action('sm:sync::syncFile', $gs_name, $retina_file, false, array('use_root' => true)); - } - } - } - } -} diff --git a/lib/classes/compatibility/wp-smush.php b/lib/classes/compatibility/wp-smush.php deleted file mode 100644 index 948e1c4da..000000000 --- a/lib/classes/compatibility/wp-smush.php +++ /dev/null @@ -1,238 +0,0 @@ -core()->mod->settings->get('auto'); - } else { - global $wpsmush_settings; - $auto_smush = $wpsmush_settings->settings['auto']; - } - - if ( - !$auto_smush || !wp_attachment_is_image($attachment_id) || - !apply_filters('wp_smush_image', true, $attachment_id) || - !( - ((!empty($_POST['action']) && 'upload-attachment' == $_POST['action']) || isset($_POST['post_id'])) && - // And, check if Async is enabled. - defined('WP_SMUSH_ASYNC') && WP_SMUSH_ASYNC) - ) { - return false; - } - return true; - } - - /** - * Sync image after it's been optimized. - * - * @param int $attachment_id attachment id - * @param array $stats compression stats - * - * @return null - */ - public function image_optimized($attachment_id, $stats) { - // Sync the attachment to GCS - ud_get_stateless_media()->add_media(array(), $attachment_id, true); - - // also sync the backup images - $this->sync_backup($attachment_id); - } - - /** - * If local file don't exists then download it from GCS - * - * @param string $file_path Full file path - * @param string $attachment_id - * @param array $size_details Array of width and height for the image - * - * @return null - */ - function maybe_download_file($file_path = '', $attachment_id = '', $size_details = array()) { - if (empty($file_path) || empty($attachment_id)) { - return; - } - - //Download if file not exists - if (!file_exists($file_path)) { - $client = ud_get_stateless_media()->get_client(); - $metadata = wp_get_attachment_metadata($attachment_id); - if (!empty($metadata['gs_name'])) { - $image_sizes = Utility::get_path_and_url($metadata, $attachment_id); - foreach ($image_sizes as $size => $img) { - $client->get_media(apply_filters('wp_stateless_file_name', $img['gs_name']), true, $img['path']); - } - - $gs_name = dirname($metadata['gs_name']) . '/' . basename($file_path); - // We need to remove backup from GCS if it's a restore action - // @todo revise this code - if ($this->hook_from_restore_image()) { - $client->remove_media(apply_filters('wp_stateless_file_name', $gs_name)); - } - } - } - } - - /** - * Remove backup when attachment is removed - * - * @param $attachment_id - */ - function remove_backup($attachment_id) { - $upload_dir = wp_get_upload_dir(); - $metadata = wp_get_attachment_metadata($attachment_id); - $backup_paths = get_post_meta($attachment_id, '_wp_attachment_backup_sizes', true); - - if (!empty($metadata['gs_name']) && !empty($backup_paths) && is_array($backup_paths)) { - // Getting local dir path for backup image - $base_dir = $upload_dir['basedir'] . '/' . dirname($metadata['file']); - // Getting GCS dir name from meta data. In case Bucket Folder used. - $gs_dir = dirname($metadata['gs_name']); - foreach ($backup_paths as $key => $data) { - $gs_name = $gs_dir . '/' . basename($data['file']); - // Path of backup image - $backup_path = $base_dir . '/' . basename($data['file']); - do_action('sm:sync::deleteFile', apply_filters('wp_stateless_file_name', $gs_name), $backup_path); - delete_transient('sm-wp-smush-backup-exists-' . $attachment_id); - } - } - } - - /** - * Checks if we've backup on gcs for the given attachment id and backup path - * - * @param string $attachment_id - * @param string $backup_path - * - * @return bool - */ - function backup_exists_on_gcs($exists, $attachment_id = '', $backup_path = '') { - if (!$exists && $attachment_id) { - if (get_transient('sm-wp-smush-backup-exists-' . $attachment_id)) { - return true; - } - - $metadata = wp_get_attachment_metadata($attachment_id); - if (!empty($metadata['gs_name'])) { - $gs_name = dirname($metadata['gs_name']) . '/' . basename($backup_path); - if (ud_get_stateless_media()->get_client()->media_exists(apply_filters('wp_stateless_file_name', $gs_name))) { - set_transient('sm-wp-smush-backup-exists-' . $attachment_id, true, HOUR_IN_SECONDS); - return true; - } - } - } - - return $exists; - } - - /** - * Sync backup image to GCS - * - * @param $attachment_id - * @param array $metadata - */ - public function sync_backup($attachment_id, $metadata = array()) { - $upload_dir = wp_get_upload_dir(); - if (empty($metadata) || empty($metadata['gs_name'])) { - $metadata = wp_get_attachment_metadata($attachment_id); - } - - // Getting backup path from smush settings in db - $backup_paths = get_post_meta($attachment_id, '_wp_attachment_backup_sizes', true); - - if (!empty($metadata['gs_name']) && !empty($backup_paths) && is_array($backup_paths)) { - // Getting local dir for backup image - $base_dir = $upload_dir['basedir'] . '/' . dirname($metadata['file']); - // Getting GCS dir name from meta data. In case Bucket Folder used. - $gs_dir = dirname($metadata['gs_name']); - - foreach ($backup_paths as $key => $data) { - $gs_name = $gs_dir . '/' . basename($data['file']); - // Path of backup image - $backup_path = $base_dir . '/' . basename($data['file']); - // Sync backup image with GCS - do_action('sm:sync::syncFile', apply_filters('wp_stateless_file_name', $gs_name), $backup_path); - delete_transient('sm-wp-smush-backup-exists-' . $attachment_id); - } - } - } - - /** - * Determine where we hook from - * Is this a hook from wp smush restore image or not. - * - * @return bool - */ - private function hook_from_restore_image() { - $call_stack = debug_backtrace(); - $class_name = class_exists('WpSmushBackup') ? 'WpSmushBackup' : 'WP_Smush_Backup'; - - if (!empty($call_stack) && is_array($call_stack)) { - foreach ($call_stack as $step) { - - if ($step['function'] == 'restore_image' && $step['class'] == $class_name) { - return true; - } - } - } - - return false; - } - } - } -} diff --git a/lib/classes/compatibility/wpbakery-page-builder.php b/lib/classes/compatibility/wpbakery-page-builder.php deleted file mode 100644 index 99defa802..000000000 --- a/lib/classes/compatibility/wpbakery-page-builder.php +++ /dev/null @@ -1,81 +0,0 @@ -enabled) { - // We need to add the filter on construct. Init is too late. - add_filter('vc_wpb_getimagesize', array($this, 'vc_wpb_getimagesize'), 10, 3); - } - } - - /** - * @param $sm - */ - public function module_init($sm) { - // - } - - /** - * If image size not exist then generate size info and update attachment metadata. - * - * $args = array( - * 'thumbnail' => $thumbnail, - * 'p_img_large' => $p_img_large, - * ) - * - * @param $args - * @param $attach_id - * @param $params - * @return mixed - */ - public function vc_wpb_getimagesize($args, $attach_id, $params) { - if (!$this->enabled) return $args; - - $gs_host = ud_get_stateless_media()->get_gs_host(); - $meta_data = wp_get_attachment_metadata($attach_id); - preg_match("/src=[\"|'](.*?)[\"|']/", $args['thumbnail'], $match); - - if (!empty($match[1]) && empty($meta_data['sizes'][$params['thumb_size']])) { - $dir = wp_upload_dir(); - $url = $match[1]; - $path = str_replace($gs_host, '', $url); - $path = trim($path, '/'); - $absolute_path = $dir['basedir'] . '/' . $path; - - $size = getimagesize($absolute_path); - $filetype = wp_check_filetype($absolute_path); - $size_info = array( - 'file' => wp_basename($absolute_path), - 'mime-type' => $filetype['type'], - 'width' => $size[0], - 'height' => $size[1], - ); - $meta_data['sizes'][$params['thumb_size']] = $size_info; - wp_update_attachment_metadata($attach_id, $meta_data); - } - return $args; - } - } - } -} diff --git a/lib/classes/compatibility/wpforms.php b/lib/classes/compatibility/wpforms.php deleted file mode 100644 index 575b048bb..000000000 --- a/lib/classes/compatibility/wpforms.php +++ /dev/null @@ -1,30 +0,0 @@ -meta_box['tabs'] ) ) { + return; + } + + $tabs = (array) $obj->meta_box['tabs']; + foreach ( $tabs as $tab_data ) { + if ( is_string( $tab_data ) ) { + $tab_data = [ 'label' => $tab_data ]; + } + $tab_data = wp_parse_args( $tab_data, [ + 'icon' => '', + 'label' => '', + ] ); + $strpos = [ 'fa', 'fas', 'fa-solid', 'fab', 'fa-brand', 'far', 'fa-regular' ]; + foreach ( $strpos as $value ) { + if ( strpos( $tab_data['icon'], $value ) !== false ) { + wp_enqueue_style( 'font-awesome', 'https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.2.1/css/all.min.css', [], ' 6.2.1' ); + return; + } + } + } } /** @@ -77,7 +112,7 @@ public function closing_div() { // Reset to initial state to be ready for other meta boxes. $this->active = false; - $this->fields_output = array(); + $this->fields_output = []; } /** @@ -98,7 +133,7 @@ public function show_nav( RW_Meta_Box $obj ) { $i = 0; foreach ( $tabs as $key => $tab_data ) { if ( is_string( $tab_data ) ) { - $tab_data = ['label' => $tab_data]; + $tab_data = [ 'label' => $tab_data ]; } $tab_data = wp_parse_args( $tab_data, [ 'icon' => '', @@ -190,7 +225,7 @@ public function capture_fields( $output, $field ) { $tab = $field['tab']; if ( ! isset( $this->fields_output[ $tab ] ) ) { - $this->fields_output[ $tab ] = array(); + $this->fields_output[ $tab ] = []; } $this->fields_output[ $tab ][] = $output; diff --git a/lib/meta-box-tabs/tabs.css b/lib/meta-box-tabs/tabs.css index 6d8142fb3..4153fb05d 100644 --- a/lib/meta-box-tabs/tabs.css +++ b/lib/meta-box-tabs/tabs.css @@ -1,242 +1 @@ -.rwmb-tab-nav { - margin-bottom: -1px; -} - -.rwmb-tab-nav li { - margin: 0; - display: inline-block; -} - -.rwmb-tab-nav .rwmb-tab-active { - border: 1px solid #eee; - border-bottom-color: transparent; - background: #fdfdfd; -} - -.rwmb-tab-nav a { - display: block; - padding: 3px 5px 5px; - text-decoration: none; -} - -.rwmb-tab-nav a:active, .rwmb-tab-nav a:focus { - outline: none; - box-shadow: none; -} - -.rwmb-tab-nav i, -.rwmb-tab-nav img { - vertical-align: middle; - margin-right: .3em; -} - -.rwmb-tab-nav i { - width: 16px; - height: 16px; - font-size: 16px; -} - -.rwmb-tab-nav img { - width: 12px; - height: 12px; - display: inline-block; -} - -.rwmb-tab-active a { - color: #333; -} - -.rwmb-tab-panel { - padding: 10px 5px; - border: 1px solid #eee; - background: #fdfdfd; - display: none; -} - -.rwmb-tabs-box .rwmb-tab-nav li { - background: #ebebeb; - border: 1px solid #e5e5e5; - margin-right: 5px; -} - -.rwmb-tabs-box .rwmb-tab-nav li:hover { - background: #fff; -} - -.rwmb-tabs-box .rwmb-tab-nav a { - color: #777; -} - -.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active { - border-bottom-color: transparent; -} - -.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active, -.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active:hover { - background: #f5f5f5; -} - -.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active a { - color: #555; -} - -.rwmb-tabs-box .rwmb-tab-panel { - background: #f5f5f5; - border: 1px solid #e5e5e5; -} - -.rwmb-tabs-box .rwmb-clone { - background-color: transparent; -} - -.rwmb-tabs-left { - margin: -6px -12px -12px; - display: flex; -} - -.rwmb-tabs-left .rwmb-tab-nav { - margin: 0 -1px 0 0; - border-right: 1px solid #eee; - z-index: 9; - padding: 0 !important; -} - -.rwmb-tabs-left .rwmb-tab-nav li { - display: block; - padding: 0; -} - -.rwmb-tabs-left .rwmb-tab-nav li:first-child { - border-top: none; -} - -.rwmb-tabs-left .rwmb-tab-nav a { - padding: 5px 20px 8px 10px; -} - -.rwmb-tabs-left .rwmb-tab-active { - border-width: 1px 0 1px 0; - border-bottom-color: #eee; - box-shadow: 0 1px 0 rgba(0, 0, 0, 0.02), 0 1px 0 rgba(0, 0, 0, 0.02); - margin-right: -1px; -} - -.rwmb-tabs-left .rwmb-tab-panels { - flex: 1; - border-left: 1px solid #eee; - z-index: 1; -} - -.rwmb-tabs-left .rwmb-tab-panel { - padding: 10px 20px; - background: #fdfdfd; - border: none; -} - -.profile-php .rwmb-tabs-left, -.user-edit-php .rwmb-tabs-left, -.term-php .rwmb-tabs-left, -.edit-tags-php .rwmb-tabs-left, -.rwmb-settings-no-boxes .rwmb-tabs-left { - margin: 0; - flex-wrap: wrap; -} - -.profile-php .rwmb-tabs-left > h2, -.user-edit-php .rwmb-tabs-left > h2, -.term-php .rwmb-tabs-left > h2, -.edit-tags-php .rwmb-tabs-left > h2, -.rwmb-settings-no-boxes .rwmb-tabs-left > h2 { - flex-basis: 100%; -} - -.profile-php .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active, -.user-edit-php .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active, -.term-php .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active, -.edit-tags-php .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active, -.rwmb-settings-no-boxes .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active { - border-bottom: 1px solid #f5f5f5; -} - -.profile-php .rwmb-tabs .rwmb-label, -.profile-php .rwmb-tabs .rwmb-input, -.user-edit-php .rwmb-tabs .rwmb-label, -.user-edit-php .rwmb-tabs .rwmb-input, -.term-php .rwmb-tabs .rwmb-label, -.term-php .rwmb-tabs .rwmb-input, -.edit-tags-php .rwmb-tabs .rwmb-label, -.edit-tags-php .rwmb-tabs .rwmb-input, -.rwmb-settings-no-boxes .rwmb-tabs .rwmb-label, -.rwmb-settings-no-boxes .rwmb-tabs .rwmb-input { - padding: 0; -} - -.rwmb-settings-no-boxes .rwmb-tab-panel .rwmb-field { - padding: 12px 0 0; -} - -@media (max-width: 575px) { - .rwmb-tabs { - margin: -6px -12px -12px; - } - .rwmb-tab-nav { - margin-top: 0; - margin-bottom: 10px; - } - .rwmb-tab-nav li { - display: block; - border-bottom: 1px solid #eee; - } - .rwmb-tab-nav a { - padding: 5px 20px 8px 10px; - } - .rwmb-tab-nav .rwmb-tab-active { - background: #eee; - border-width: 0 0 1px 0; - } - .rwmb-tab-panel { - padding: 10px; - border: none; - background: none; - } - .rwmb-tabs-box .rwmb-tab-nav li { - background: none; - border-width: 0 0 1px 0; - margin-right: 0; - } - .rwmb-tabs-box .rwmb-tab-nav li:hover { - background: none; - } - .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active { - background: #dedede; - } - .rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active:hover { - background: #dedede; - } - .rwmb-tabs-box .rwmb-tab-panel { - border: none; - background: none; - } - .rwmb-tabs-left { - flex-direction: column; - } - .rwmb-tabs-left .rwmb-tab-nav { - width: 100%; - border-right: none; - } - .rwmb-tabs-left .rwmb-tab-nav li { - border-bottom: 1px solid #eee; - } - .rwmb-tabs-left .rwmb-tab-active { - box-shadow: none; - background: #eee; - border-width: 0 0 1px 0; - margin-right: 0; - } - .rwmb-tabs-left .rwmb-tab-panels { - border-left: none; - } - .rwmb-tabs-left .rwmb-tab-panel { - padding: 10px; - } -} +.rwmb-tab-nav{display:flex;margin-bottom:-1px;flex-wrap:wrap;padding:inherit}.rwmb-tab-nav li{margin:0;display:inline-block}.rwmb-tab-nav a{display:flex;align-items:center;gap:4px;padding:8px 12px;line-height:1;text-decoration:none}.rwmb-tab-nav a:active,.rwmb-tab-nav a:focus{outline:none;box-shadow:none}.rwmb-tab-nav i{width:16px;height:16px;font-size:16px}.rwmb-tab-nav i[class^=fa]{width:12px;height:12px;font-size:12px}.rwmb-tab-nav img{width:12px;height:12px;display:inline-block}.rwmb-tab-active{border:1px solid #ccd0d4;border-bottom-color:rgba(0,0,0,0);background:#fff}.rwmb-tab-active a{color:inherit}.rwmb-tab-panels{background:#fff;border:1px solid #ccd0d4}.rwmb-tab-panel{padding:12px;display:none}.rwmb-tabs-box .rwmb-tab-nav li{background:#f5f5f5;border:1px solid #ccd0d4;margin-right:5px}.rwmb-tabs-box .rwmb-tab-nav li:hover{background:#fff}.rwmb-tabs-box .rwmb-tab-nav a{color:inherit}.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active{border-bottom-color:rgba(0,0,0,0)}.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active,.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active:hover{background:#fff}.rwmb-tabs-box .rwmb-clone{background-color:rgba(0,0,0,0)}.rwmb-tabs-left{margin:-6px -12px -12px;display:flex}.rwmb-tabs-left .rwmb-tab-nav{flex-direction:column;margin:0 -1px 0 0;border-right:1px solid #ccd0d4;background:#fafafa}.rwmb-tabs-left .rwmb-tab-nav li{display:block;min-width:180px;border-bottom:1px solid #ccd0d4}.rwmb-tabs-left .rwmb-tab-nav li:first-child{border-top:none}.rwmb-tabs-left .rwmb-tab-nav a{padding:12px}.rwmb-tabs-left .rwmb-tab-active{border-width:0 0 1px 0;margin-right:-1px;z-index:1}.rwmb-tabs-left .rwmb-tab-panels{flex:1;border-width:0 0 0 1px}.rwmb-tabs-left .rwmb-tab-panel{padding:12px 20px;border:none}.rwmb-seamless .rwmb-tabs-left{margin:0;border:1px solid #ccd0d4}.profile-php .rwmb-tabs-left,.user-edit-php .rwmb-tabs-left,.term-php .rwmb-tabs-left,.edit-tags-php .rwmb-tabs-left,.rwmb-settings-no-boxes .rwmb-tabs-left{margin:0;flex-wrap:wrap}.profile-php .rwmb-tabs-left>h2,.user-edit-php .rwmb-tabs-left>h2,.term-php .rwmb-tabs-left>h2,.edit-tags-php .rwmb-tabs-left>h2,.rwmb-settings-no-boxes .rwmb-tabs-left>h2{flex-basis:100%}.profile-php .rwmb-tabs-left .rwmb-tab-nav,.user-edit-php .rwmb-tabs-left .rwmb-tab-nav,.term-php .rwmb-tabs-left .rwmb-tab-nav,.edit-tags-php .rwmb-tabs-left .rwmb-tab-nav,.rwmb-settings-no-boxes .rwmb-tabs-left .rwmb-tab-nav{border:1px solid #ccd0d4}.profile-php .rwmb-tabs-left .rwmb-tab-panels,.user-edit-php .rwmb-tabs-left .rwmb-tab-panels,.term-php .rwmb-tabs-left .rwmb-tab-panels,.edit-tags-php .rwmb-tabs-left .rwmb-tab-panels,.rwmb-settings-no-boxes .rwmb-tabs-left .rwmb-tab-panels{border-width:1px}.profile-php .rwmb-tabs .rwmb-label,.profile-php .rwmb-tabs .rwmb-input,.user-edit-php .rwmb-tabs .rwmb-label,.user-edit-php .rwmb-tabs .rwmb-input,.term-php .rwmb-tabs .rwmb-label,.term-php .rwmb-tabs .rwmb-input,.edit-tags-php .rwmb-tabs .rwmb-label,.edit-tags-php .rwmb-tabs .rwmb-input,.rwmb-settings-no-boxes .rwmb-tabs .rwmb-label,.rwmb-settings-no-boxes .rwmb-tabs .rwmb-input{padding:0}.rwmb-settings-no-boxes .rwmb-tab-panel .rwmb-field{padding:12px 0 0}@media(max-width: 575px){.rwmb-tabs{margin:-6px -12px -12px}.rwmb-tabs>h2{margin-left:12px;margin-right:12px}.rwmb-seamless .rwmb-tabs{margin:0}.rwmb-tab-nav{flex-direction:column;margin-top:0;margin-bottom:0}.rwmb-tab-nav li{display:block;border-bottom:1px solid #ccd0d4}.rwmb-tab-nav a{padding:12px}.rwmb-tab-nav .rwmb-tab-active{border-width:0 0 1px 0}.rwmb-tab-panels{border:none;background:none}.rwmb-tabs-box .rwmb-tab-nav li{border-width:0 0 1px 0;margin-right:0}.rwmb-tabs-box .rwmb-tab-nav .rwmb-tab-active{border-bottom:1px solid #ccd0d4}.rwmb-tabs-left{flex-direction:column}.rwmb-tabs-left .rwmb-tab-nav{width:100%;border-right:none}.rwmb-tabs-left .rwmb-tab-active{margin-right:0}.rwmb-tabs-left .rwmb-tab-panel{padding-left:0;padding-right:0}} diff --git a/lib/meta-box-tabs/tabs.js b/lib/meta-box-tabs/tabs.js index 32d90eb5d..f596dd7f8 100644 --- a/lib/meta-box-tabs/tabs.js +++ b/lib/meta-box-tabs/tabs.js @@ -4,18 +4,21 @@ function switchTab() { $( '.rwmb-tab-nav' ).on( 'click', 'a', e => { e.preventDefault(); - showTab( e.target, e.target.parentNode.dataset.panel ); + showTab( e.target ); } ); } - function showTab( el, tab ) { - var $wrapper = $( el ).closest( '.rwmb-tabs' ), + function showTab( el ) { + var tab = el.closest( 'li' ).dataset.panel, + $wrapper = $( el ).closest( '.rwmb-tabs' ), $tabs = $wrapper.find( '.rwmb-tab-nav > li' ), $panels = $wrapper.find( '.rwmb-tab-panel' ); $tabs.removeClass( 'rwmb-tab-active' ).filter( '[data-panel="' + tab + '"]' ).addClass( 'rwmb-tab-active' ); $panels.hide().filter( '.rwmb-tab-panel-' + tab ).show(); + rwmb.$document.trigger( 'mb_init_editors' ); + // Refresh maps, make sure they're fully loaded, when it's in hidden div (tab). $( window ).trigger( 'rwmb_map_refresh' ); } @@ -36,12 +39,15 @@ function showValidateErrorFields() { var inputSelectors = 'input[class*="rwmb-error"], textarea[class*="rwmb-error"], select[class*="rwmb-error"], button[class*="rwmb-error"]'; $( document ).on( 'after_validate', 'form', e => { - var $input = $( e.target ).find( inputSelectors ); - showTab( $input, $input.closest( '.rwmb-tab-panel' ).data( 'panel' ) ); + var $input = $( e.target ).find( inputSelectors ), + $panel = $input.closest( '.rwmb-tab-panel' ); + if ( $panel.length ) { + showTab( $input.closest( '.rwmb-tabs' ).find( 'li[data-panel="' + $panel.data( 'panel' ) + '"] a' )[ 0 ] ); + } } ); } - $( function() { + $( document ).on( 'mb_ready', function () { switchTab(); tweakForConditionalLogic(); showValidateErrorFields(); diff --git a/readme.txt b/readme.txt index b8bac926d..d6e538e82 100644 --- a/readme.txt +++ b/readme.txt @@ -1,11 +1,11 @@ === WP-Stateless - Google Cloud Storage === -Contributors: usability_dynamics, andypotanin, ideric, maxim.peshkov, Anton Korotkoff, planvova, balexey88 +Contributors: usability_dynamics, andypotanin, ideric, maxim.peshkov, Anton Korotkoff, planvova, balexey Donate link: https://udx.io Tags: google, google cloud, google cloud storage, cdn, uploads, media, stateless, backup License: GPLv2 or later Requires PHP: 8.0 Requires at least: 5.0 -Tested up to: 6.3.1 +Tested up to: 6.4.2 Stable tag: 4.0.0 Upload and serve your WordPress media files from Google Cloud Storage. diff --git a/static/scripts/wp-stateless.js b/static/scripts/wp-stateless.js index cb2469df7..0a9e8cf4c 100644 --- a/static/scripts/wp-stateless.js +++ b/static/scripts/wp-stateless.js @@ -135,6 +135,15 @@ var wpStatelessApp = angular // $scope.apply(); } } + + if (value == 'stateless' && $scope.sm.readonly.hashify_file_name != 'constant' ) { + $scope.backup.dynamic_image_support = $scope.sm.dynamic_image_support + $scope.sm.dynamic_image_support = 'false' + } else { + if ($scope.backup.dynamic_image_support) { + $scope.sm.dynamic_image_support = $scope.backup.dynamic_image_support + } + } }) $scope.$watch('sm.bucket_folder_type', function (value) { diff --git a/static/views/settings_interface.php b/static/views/settings_interface.php index fbbfd79ad..3cccad8d9 100644 --- a/static/views/settings_interface.php +++ b/static/views/settings_interface.php @@ -6,7 +6,7 @@

domain); ?>

+

+ +

+

+ + Not available in Stateless Mode.", ud_get_stateless_media()->domain); ?> + + domain); ?> +

@@ -234,7 +263,7 @@ 'save-settings')); ?> - +
diff --git a/vendor/bin/mozart b/vendor/bin/mozart deleted file mode 100755 index 50ad97f47..000000000 --- a/vendor/bin/mozart +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env php -realpath = realpath($opened_path) ?: $opened_path; - $opened_path = $this->realpath; - $this->handle = fopen($this->realpath, $mode); - $this->position = 0; - - return (bool) $this->handle; - } - - public function stream_read($count) - { - $data = fread($this->handle, $count); - - if ($this->position === 0) { - $data = preg_replace('{^#!.*\r?\n}', '', $data); - } - - $this->position += strlen($data); - - return $data; - } - - public function stream_cast($castAs) - { - return $this->handle; - } - - public function stream_close() - { - fclose($this->handle); - } - - public function stream_lock($operation) - { - return $operation ? flock($this->handle, $operation) : true; - } - - public function stream_seek($offset, $whence) - { - if (0 === fseek($this->handle, $offset, $whence)) { - $this->position = ftell($this->handle); - return true; - } - - return false; - } - - public function stream_tell() - { - return $this->position; - } - - public function stream_eof() - { - return feof($this->handle); - } - - public function stream_stat() - { - return array(); - } - - public function stream_set_option($option, $arg1, $arg2) - { - return true; - } - - public function url_stat($path, $flags) - { - $path = substr($path, 17); - if (file_exists($path)) { - return stat($path); - } - - return false; - } - } - } - - if ( - (function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true)) - || (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper')) - ) { - return include("phpvfscomposer://" . __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'); - } -} - -return include __DIR__ . '/..'.'/coenjacobs/mozart/bin/mozart'; diff --git a/vendor/coenjacobs/mozart/.github/FUNDING.yml b/vendor/coenjacobs/mozart/.github/FUNDING.yml deleted file mode 100644 index d832a23ff..000000000 --- a/vendor/coenjacobs/mozart/.github/FUNDING.yml +++ /dev/null @@ -1,3 +0,0 @@ -# These are supported funding model platforms - -github: [coenjacobs] diff --git a/vendor/coenjacobs/mozart/.github/workflows/analysis.yml b/vendor/coenjacobs/mozart/.github/workflows/analysis.yml deleted file mode 100644 index bed9ebf56..000000000 --- a/vendor/coenjacobs/mozart/.github/workflows/analysis.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Psalm analysis - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - psalm: - name: Psalm - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Psalm - uses: docker://vimeo/psalm-github-actions \ No newline at end of file diff --git a/vendor/coenjacobs/mozart/.github/workflows/docker-latest.yml b/vendor/coenjacobs/mozart/.github/workflows/docker-latest.yml deleted file mode 100644 index f0e5b7792..000000000 --- a/vendor/coenjacobs/mozart/.github/workflows/docker-latest.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Publish latest to Docker Hub - -on: - push: - branches: - - master - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=coenjacobs/mozart - VERSION=latest - TAGS="${DOCKER_IMAGE}:${VERSION}" - echo ::set-output name=tags::${TAGS} - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - target: application - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.prep.outputs.tags }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache diff --git a/vendor/coenjacobs/mozart/.github/workflows/main.yml b/vendor/coenjacobs/mozart/.github/workflows/main.yml deleted file mode 100644 index bef8a5f7c..000000000 --- a/vendor/coenjacobs/mozart/.github/workflows/main.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: Lint and test - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - tests: - runs-on: ubuntu-latest - strategy: - matrix: - php: ['7.3', '7.4', '8.0'] - name: PHP ${{ matrix.php }} tests - steps: - - uses: actions/checkout@v1 - - name: Install PHP - uses: shivammathur/setup-php@1.3.7 - with: - php-version: ${{ matrix.php }} - - name: Debugging - run: | - php --version - php -m - composer --version - - name: Install dependencies - run: composer install --prefer-dist --no-suggest --no-progress - - name: Run tests - run: vendor/bin/phpunit --printer mheap\\GithubActionsReporter\\Printer - lint: - runs-on: ubuntu-latest - name: Lint project files - steps: - - uses: actions/checkout@v1 - - name: Install PHP - uses: shivammathur/setup-php@1.3.7 - with: - php-version: '7.4' - - name: Debugging - run: | - php --version - php -m - composer --version - - name: Install dependencies - run: composer install --prefer-dist --no-suggest --no-progress - - name: Run validate - run: composer run lint diff --git a/vendor/coenjacobs/mozart/.github/workflows/release.yml b/vendor/coenjacobs/mozart/.github/workflows/release.yml deleted file mode 100644 index 074b4a871..000000000 --- a/vendor/coenjacobs/mozart/.github/workflows/release.yml +++ /dev/null @@ -1,92 +0,0 @@ -name: Build, tag and attach releases - -on: release - -jobs: - create-phar: - runs-on: ubuntu-latest - name: Create Mozart phar - steps: - - uses: actions/checkout@v1 - - - name: Install PHP - uses: shivammathur/setup-php@1.3.7 - with: - php-version: 7.3 - - - name: Install dependencies - run: composer install --no-dev --prefer-dist --no-suggest --no-progress - - - name: Create .phar - run: | - wget -O phar-composer.phar https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar - mkdir build - mv vendor build/vendor - mv src build/src - mv bin build/bin - mv composer.json build - php -d phar.readonly=off phar-composer.phar build ./build/ - - - name: Test run mozart - run: php mozart.phar --version - - - uses: meeDamian/github-release@2.0 - with: - token: ${{ secrets.GITHUB_TOKEN }} - files: mozart.phar - gzip: false - allow_override: true - docker: - runs-on: ubuntu-latest - name: Create Docker tag - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Prepare - id: prep - run: | - DOCKER_IMAGE=coenjacobs/mozart - VERSION=${{ github.event.release.tag_name }} - TAGS="${DOCKER_IMAGE}:${VERSION}" - echo ::set-output name=tags::${TAGS} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: all - - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - - - name: Cache Docker layers - uses: actions/cache@v2 - with: - path: /tmp/.buildx-cache - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push - id: docker_build - uses: docker/build-push-action@v2 - with: - builder: ${{ steps.buildx.outputs.name }} - context: . - file: ./Dockerfile - target: application - platforms: linux/amd64 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.prep.outputs.tags }} - cache-from: type=local,src=/tmp/.buildx-cache - cache-to: type=local,dest=/tmp/.buildx-cache - - - name: Image digest - run: echo ${{ steps.docker_build.outputs.digest }} diff --git a/vendor/coenjacobs/mozart/.gitignore b/vendor/coenjacobs/mozart/.gitignore deleted file mode 100644 index 3d6c7cac3..000000000 --- a/vendor/coenjacobs/mozart/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.idea/ -vendor/ - -.DS_Store -composer.lock -.phpunit.result.cache diff --git a/vendor/coenjacobs/mozart/Dockerfile b/vendor/coenjacobs/mozart/Dockerfile deleted file mode 100644 index 240bd4c5b..000000000 --- a/vendor/coenjacobs/mozart/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM composer:2.0.8 - -FROM php:8.0.1-cli-alpine AS base - -FROM base as builder -RUN apk update && apk add git -COPY --from=composer /usr/bin/composer /usr/bin/composer -COPY ./composer.json /mozart/ -WORKDIR /mozart/ -RUN composer install --no-dev -o - -FROM base AS application -RUN mkdir project -WORKDIR /project/ -COPY --from=builder /mozart/ /mozart/ -COPY ./bin/ /mozart/bin/ -COPY ./src/ /mozart/src/ diff --git a/vendor/coenjacobs/mozart/LICENSE b/vendor/coenjacobs/mozart/LICENSE deleted file mode 100644 index 2f9c25703..000000000 --- a/vendor/coenjacobs/mozart/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Coen Jacobs - -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. \ No newline at end of file diff --git a/vendor/coenjacobs/mozart/README.md b/vendor/coenjacobs/mozart/README.md deleted file mode 100644 index cdb239d43..000000000 --- a/vendor/coenjacobs/mozart/README.md +++ /dev/null @@ -1,146 +0,0 @@ -# Mozart [![Latest Stable Version](https://poser.pugx.org/coenjacobs/mozart/v/stable.svg)](https://packagist.org/packages/coenjacobs/mozart) [![License](https://poser.pugx.org/coenjacobs/mozart/license.svg)](https://packagist.org/packages/coenjacobs/mozart) [![Docker Image Pulls](https://img.shields.io/docker/pulls/coenjacobs/mozart.svg)](https://hub.docker.com/r/coenjacobs/mozart) -Composes all dependencies as a package inside a WordPress plugin. Load packages through Composer and have them wrapped inside your own namespace. Gone are the days when plugins could load conflicting versions of the same package, resulting in hard to reproduce bugs. - -This package requires PHP 7.3 or higher in order to run the tool. You can use the resulting files as a bundle, requiring any PHP version you like, even PHP 5.2. - -**Warning:** This package is very experimental and breaking changes are very likely until version 1.0.0 is tagged. Use with caution, always wear a helmet when using this in production environments. - -## Installation -Mozart brings its own dependencies to the table and that potentially introduces its own problems (yes, I realise how meta that is, for a package like this). That's why installing Mozart in isolation, either through the Docker container, the available PHAR file or installing Mozart as a global dependency with Composer is prefered. In all cases, the [configuration](#configuration) still needs to be placed in the `composer.json` file of the project iself. - -### Docker -Pull the Docker image from the registry: - -``` -docker pull coenjacobs/mozart -``` - -Then you can start the container and run the `mozart compose` command in the container. In a single command: - -``` -docker run --rm -it -v ${PWD}:/project/ coenjacobs/mozart /mozart/bin/mozart compose -``` - -Above command automatically adds the current working directory as a volume into the designated directory for the project: `/project/`. In the Docker container, Mozart is installed in the `/mozart/` directory. Using the above command will run Mozart on the current working directory. - -Please note that the Docker image for Mozart is only available starting from the `latest` build of version 0.7.0. The `latest` tag is always the latest build of the `master` branch and not a stable version. You can see [all available tags on Docker Hub](https://hub.docker.com/r/coenjacobs/mozart/tags). - -### PHAR (via Phive) -Mozart can be installed via [Phive](https://github.com/phar-io/phive): - -``` -phive install coenjacobs/mozart --force-accept-unsigned -``` - -Alternatively, the `mozart.phar` file can be [downloaded from the releases page](https://github.com/coenjacobs/mozart/releases) and then be run from your project directory: - -``` -php mozart.phar compose -``` - -### Composer -To install Mozart and its dependencies, without conflicting with the dependencies of your project, it is recommended that you install Mozart as a global package, if you choose to install Mozart via Composer. - -#### Global package -Using the `global` command when installing Mozart, it will be installed as a system wide package: - -``` -composer global require coenjacobs/mozart -``` - -You can then find the bin file named `mozart` inside your `~/.composer/vendor/bin/` directory and run it from your project directory, referencing the full path to the bin file: - -``` -~/.composer/vendor/bin/mozart compose -``` - -#### Development dependency of your project -You can install through Composer in the project itself, only required in development environments: - -``` -composer require coenjacobs/mozart --dev -``` - -This gives you a bin file named `mozart` inside your `vendor/bin` directory, after loading the whole package inside your project. Try running `vendor/bin/mozart` to verify it works. - -After configuring Mozart properly, the `mozart compose` command does all the magic: - -``` -vendor/bin/mozart compose -``` - -## Configuration -Mozart requires little configuration. All you need to do is tell it where the bundled dependencies are going to be stored and what namespace they should be put inside. This configuration needs to be done in the `extra` property of your `composer.json` file: - -``` -"extra": { - "mozart": { - "dep_namespace": "CoenJacobs\\TestProject\\Dependencies\\", - "dep_directory": "/src/Dependencies/", - "classmap_directory": "/classes/dependencies/", - "classmap_prefix": "CJTP_", - "packages": [ - "pimple/pimple" - ], - "exclude_packages": [ - "psr/container" - ], - "override_autoload": { - "google/apiclient": { - "classmap": [ - "src/" - ] - } - }, - "delete_vendor_directories": true - } -}, -``` - -The following configuration values are required: - -- `dep_namespace` defines the root namespace that each package will be put in. Example: Should the package we're loading be using the `Pimple` namespace, then the package will be put inside the `CoenJacobs\\TestProject\\Dependencies\\Pimple` namespace, when using the configuration example above. -- `dep_directory` defines the directory the files of the package will be stored in. Note that the directory needs to correspond to the namespace being used in your autoloader and the namespace defined for the bundled packages. Best results are achieved when your projects are using the [PSR-4 autoloader specification](http://www.php-fig.org/psr/psr-4/). -- `classmap_directory` defines the directory files that are being autoloaded through a classmap, will be stored in. Note that this directory needs to be autoloaded by a classmap in your projects autoloader. -- `classmap_prefix` defines the prefix that will be applied to all classes inside the classmap of the package you bundle. Say a class named `Pimple` and the defined prefix of `CJTP_` will result in the class name `CJTP_Pimple`. - -**Important:** Since Mozart automatically processes the full dependency tree of the packages you specify, you **need to specify all these configuration options**, because you can't reliably determine what kind of autoloaders are being used in the full dependency tree. A package way down the tree might suddenly use a classmap autoloader for example. Make sure you also include the namespace directory and classmap directory in your own autoloader, so they are always loaded. - -The following configuration is optional: - -- `delete_vendor_directories` is a boolean flag to indicate if the packages' vendor directories should be deleted after being processed. _default: true_. -- `packages` is an optional array that defines the packages to be processed by Mozart. The array requires the slugs of packages in the same format as provided in your `composer.json`. Mozart will automatically rewrite dependencies of these packages as well. You don't need to add dependencies of these packages to the list. If this field is absent, all packages listed under composer require will be included. -- `exclude_packages` is an optional array that defines the packages to be excluded from the processing performed by Mozart. This is useful if some of the packages in the `packages` array define dependent packages whose namespaces you want to keep unchanged. The array requires the slugs of the packages, as in the case of the `packages` array. -- `override_autoload` a dictionary, keyed with the package names, of autoload settings to replace those in the original packages' `composer.json` `autoload` property. - -After Composer has loaded the packages as defined in your `composer.json` file, you can now run `mozart compose` and Mozart will bundle your packages according to the above configuration. It is recommended to dump the autoloader after Mozart has finished running, in case there are new classes or namespaces generated that aren't included in the autoloader yet. - -## Scripts -Mozart is designed to install and be forgotten about. Using Composer scripts, the Mozart script can be run as soon as Composer either installs a new package, or updates an already installed one. This ensures that the packages you want to bundle, are always bundled in the latest installed version, automatically. These scripts also offer you the possibility to script dumping the autoloader, after Mozart is finished running: - -``` -"scripts": { - "post-install-cmd": [ - "\"vendor/bin/mozart\" compose", - "composer dump-autoload" - ], - "post-update-cmd": [ - "\"vendor/bin/mozart\" compose", - "composer dump-autoload" - ] -} -``` - -When using Mozart through its Docker container, you can replace the `"\"vendor/bin/mozart\" compose",` lines with the actual commands you use to [run the Docker container](#docker) for your specific project. Running Mozart from inside the Docker container is really fast and shouldn't take more than a couple seconds. - -## Background and philosophy -Mozart is designed to bridge the gap between the WordPress ecosytem and the vast packages ecosystem of PHP as a whole. Since WordPress is such an end-user friendly focussed CMS (for good reasons), there is no place within the ecosystem where an end-user would be burdened with using a developers tool like Composer. Also, since WordPress has to run on basically any hosting infrastructure, running Composer to install packages from the administration panel (trust me, I've tried - it can be done) is a mission impossible to make it happen and compatible with every server out there. - -But why make a new tool for this? There are other tools that enable you to do this, right? Yes, there are now. [PHP-Scoper](https://github.com/humbug/php-scoper), for example. PHP-Scoper is a fantastic tool, that does the job right. But, PHP-Scoper wasn't available back when I started the Mozart project. Also, PHP-Scoper has a few limitations (no support for classmap autoloaders, for example) that were and are still quite common within the WordPress ecosystem. Finally, PHP-Scoper can be quite the tool to add to your development flow, while Mozart was designed to be _simple to implement_, specifically tailored for WordPress projects. - -The key values of what's important to Mozart: -- Must be able to be easily installable by a developer, preferably in a specific version. -- Distribution must be done through an existing package manager or easily maintained separately. -- Shouldn't add a whole layer of complexity to the development process, i.e. learning a whole new tool/language. - -Mozart always has been and always will be geared towards solving the conflicting dependencies problem in the WordPress ecosystem, as efficiently and opinionated as possible. By being opinionated in certain ways and specifically focussed on WordPress projects, Mozart has quickly become easy to understand and implement. diff --git a/vendor/coenjacobs/mozart/bin/mozart b/vendor/coenjacobs/mozart/bin/mozart deleted file mode 100755 index ef2e21ffb..000000000 --- a/vendor/coenjacobs/mozart/bin/mozart +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env php -run(); -}, '0.7.1'); diff --git a/vendor/coenjacobs/mozart/composer.json b/vendor/coenjacobs/mozart/composer.json deleted file mode 100644 index c97d22535..000000000 --- a/vendor/coenjacobs/mozart/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "coenjacobs/mozart", - "description": "Composes all dependencies as a package inside a WordPress plugin", - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "bin": ["bin/mozart"], - "minimum-stability": "dev", - "prefer-stable": true, - "license": "MIT", - "require": { - "php": "^7.3|^8.0", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5", - "league/flysystem": "^1.0" - }, - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "require-dev": { - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5", - "mheap/phpunit-github-actions-printer": "^1.4", - "vimeo/psalm": "^4.4" - }, - "scripts": { - "lint": [ - "composer validate", - "phpcs" - ], - "test": [ - "phpunit" - ] - } -} diff --git a/vendor/coenjacobs/mozart/phpcs.xml b/vendor/coenjacobs/mozart/phpcs.xml deleted file mode 100644 index 2bf4e6c43..000000000 --- a/vendor/coenjacobs/mozart/phpcs.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - Coding standard ruleset based on the PSR-2 coding standard. - - ./src - \ No newline at end of file diff --git a/vendor/coenjacobs/mozart/phpunit.xml b/vendor/coenjacobs/mozart/phpunit.xml deleted file mode 100644 index 6f7b5b5c1..000000000 --- a/vendor/coenjacobs/mozart/phpunit.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - ./tests/ - - - \ No newline at end of file diff --git a/vendor/coenjacobs/mozart/psalm.xml b/vendor/coenjacobs/mozart/psalm.xml deleted file mode 100644 index 30258a709..000000000 --- a/vendor/coenjacobs/mozart/psalm.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - diff --git a/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php b/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php deleted file mode 100644 index 9aa6b218f..000000000 --- a/vendor/coenjacobs/mozart/src/Composer/Autoload/Autoloader.php +++ /dev/null @@ -1,9 +0,0 @@ -files, $value); - } else { - array_push($this->paths, $value); - } - } - } - - /** - * @throws \Exception - * - * @return void - */ - public function getSearchNamespace() - { - throw new \Exception('Classmap autoloaders do not contain a namespace and this method can not be used.'); - } -} diff --git a/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php b/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php deleted file mode 100644 index f8393995c..000000000 --- a/vendor/coenjacobs/mozart/src/Composer/Autoload/NamespaceAutoloader.php +++ /dev/null @@ -1,49 +0,0 @@ - $value) { - $this->namespace = $key; - array_push($this->paths, $value); - } - } - - /** - * @return string - */ - public function getSearchNamespace() - { - return $this->namespace; - } - - /** - * @return string - */ - public function getNamespacePath() - { - return ''; - } -} diff --git a/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php b/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php deleted file mode 100644 index 2a009821a..000000000 --- a/vendor/coenjacobs/mozart/src/Composer/Autoload/Psr0.php +++ /dev/null @@ -1,7 +0,0 @@ -namespace, '\\'); - } - - /** - * @return string - */ - public function getNamespacePath() - { - return str_replace('\\', DIRECTORY_SEPARATOR, $this->namespace); - } -} diff --git a/vendor/coenjacobs/mozart/src/Composer/Package.php b/vendor/coenjacobs/mozart/src/Composer/Package.php deleted file mode 100644 index 78800fe85..000000000 --- a/vendor/coenjacobs/mozart/src/Composer/Package.php +++ /dev/null @@ -1,69 +0,0 @@ -path = $path; - $this->config = json_decode(file_get_contents($this->path . '/composer.json')); - - if (isset($overrideAutoload)) { - $this->config->autoload = $overrideAutoload; - } - } - - /** - * @return void - */ - public function findAutoloaders() - { - $namespace_autoloaders = array( - 'psr-0' => 'CoenJacobs\Mozart\Composer\Autoload\Psr0', - 'psr-4' => 'CoenJacobs\Mozart\Composer\Autoload\Psr4', - 'classmap' => 'CoenJacobs\Mozart\Composer\Autoload\Classmap', - ); - - if (! isset($this->config->autoload)) { - return; - } - - foreach ($namespace_autoloaders as $key => $value) { - if (! isset($this->config->autoload->$key)) { - continue; - } - - $autoloadConfig = (array)$this->config->autoload->$key; - - /** @var Autoloader $autoloader */ - $autoloader = new $value(); - $autoloader->processConfig($autoloadConfig); - - array_push($this->autoloaders, $autoloader); - } - } -} diff --git a/vendor/coenjacobs/mozart/src/Console/Application.php b/vendor/coenjacobs/mozart/src/Console/Application.php deleted file mode 100644 index caa82dd35..000000000 --- a/vendor/coenjacobs/mozart/src/Console/Application.php +++ /dev/null @@ -1,20 +0,0 @@ -add($composeCommand); - } -} diff --git a/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php b/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php deleted file mode 100644 index ced06a510..000000000 --- a/vendor/coenjacobs/mozart/src/Console/Commands/Compose.php +++ /dev/null @@ -1,243 +0,0 @@ -setName('compose'); - $this->setDescription('Composes all dependencies as a package inside a WordPress plugin.'); - $this->setHelp(''); - } - - protected function execute(InputInterface $input, OutputInterface $output) - { - $workingDir = getcwd(); - $this->workingDir = $workingDir; - - $composerFile = $workingDir . DIRECTORY_SEPARATOR. 'composer.json'; - if (!file_exists($composerFile)) { - $output->write('No composer.json found at current directory: ' . $workingDir); - return 1; - } - - $composer = json_decode(file_get_contents($composerFile)); - // If the json was malformed. - if (!is_object($composer)) { - $output->write('Unable to parse composer.json read at: ' . $workingDir); - return 1; - } - - // if `extra` is missing or not an object or if it does not have a `mozart` key which is an object. - if (!isset($composer->extra) || !is_object($composer->extra) - || !isset($composer->extra->mozart) || !is_object($composer->extra->mozart)) { - $output->write('Mozart config not readable in composer.json at extra->mozart'); - return 1; - } - $config = $composer->extra->mozart; - - $config->dep_namespace = preg_replace("/\\\{2,}$/", "\\", "$config->dep_namespace\\"); - - $this->config = $config; - - $require = array(); - if (isset($config->packages) && is_array($config->packages)) { - $require = $config->packages; - } elseif (isset($composer->require) && is_object($composer->require)) { - $require = array_keys(get_object_vars($composer->require)); - } - - $packagesByName = $this->findPackages($require); - $excludedPackagesNames = isset($config->excluded_packages) ? $config->excluded_packages : []; - $packagesToMoveByName = array_diff_key($packagesByName, array_flip($excludedPackagesNames)); - $packages = array_values($packagesToMoveByName); - - foreach ($packages as $package) { - $package->dependencies = array_diff_key($package->dependencies, array_flip($excludedPackagesNames)); - } - - $this->mover = new Mover($workingDir, $config); - $this->replacer = new Replacer($workingDir, $config); - - $this->mover->deleteTargetDirs($packages); - $this->movePackages($packages); - $this->replacePackages($packages); - $this->replaceParentInTree($packages); - $this->replacer->replaceParentClassesInDirectory($this->config->classmap_directory); - - return 0; - } - - /** - * @param $workingDir - * @param $config - * @param array $packages - * - * @return void - */ - protected function movePackages($packages): void - { - foreach ($packages as $package) { - $this->movePackage($package); - } - - $this->mover->deleteEmptyDirs(); - } - - /** - * @param $workingDir - * @param $config - * @param array $packages - * - * @return void - */ - protected function replacePackages($packages): void - { - foreach ($packages as $package) { - $this->replacePackage($package); - } - } - - /** - * Move all the packages over, one by one, starting on the deepest level of dependencies. - * - * @return void - */ - public function movePackage($package): void - { - if (! empty($package->dependencies)) { - foreach ($package->dependencies as $dependency) { - $this->movePackage($dependency); - } - } - - $this->mover->movePackage($package); - } - - /** - * Replace contents of all the packages, one by one, starting on the deepest level of dependencies. - * - * @return void - */ - public function replacePackage($package): void - { - if (! empty($package->dependencies)) { - foreach ($package->dependencies as $dependency) { - $this->replacePackage($dependency); - } - } - - $this->replacer->replacePackage($package); - } - - /** - * Loops through all dependencies and their dependencies and so on... - * will eventually return a list of all packages required by the full tree. - * - * @param ((int|string)|mixed)[] $slugs - * - * @return Package[] - * - * @psalm-return array - */ - private function findPackages(array $slugs): array - { - $packages = []; - - foreach ($slugs as $package_slug) { - $packageDir = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package_slug . DIRECTORY_SEPARATOR; - - if (! is_dir($packageDir)) { - continue; - } - - $autoloaders = null; - if (isset($this->config->override_autoload) && isset($this->config->override_autoload->$package_slug)) { - $autoloaders = $this->config->override_autoload->$package_slug; - } - - $package = new Package($packageDir, $autoloaders); - $package->findAutoloaders(); - - $config = json_decode(file_get_contents($packageDir . 'composer.json')); - - $dependencies = []; - if (isset($config->require)) { - $dependencies = array_keys((array)$config->require); - } - - $package->dependencies = $this->findPackages($dependencies); - $packages[$package_slug] = $package; - } - - return $packages; - } - - /** - * Get an array containing all the dependencies and dependencies - * @param Package $package - * @param array $dependencies - * @return array - */ - private function getAllDependenciesOfPackage(Package $package, $dependencies = []): array - { - if (empty($package->dependencies)) { - return $dependencies; - } - - /** @var Package $dependency */ - foreach ($package->dependencies as $dependency) { - $dependencies[] = $dependency; - } - - foreach ($package->dependencies as $dependency) { - $dependencies = $this->getAllDependenciesOfPackage($dependency, $dependencies); - } - - return $dependencies; - } - - /** - * @param array $packages - */ - private function replaceParentInTree(array $packages): void - { - /** @var Package $package */ - foreach ($packages as $package) { - $dependencies = $this->getAllDependenciesOfPackage($package); - - /** @var Package $dependency */ - foreach ($dependencies as $dependency) { - $this->replacer->replaceParentPackage($dependency, $package); - } - - $this->replaceParentInTree($package->dependencies); - } - } -} diff --git a/vendor/coenjacobs/mozart/src/Mover.php b/vendor/coenjacobs/mozart/src/Mover.php deleted file mode 100644 index 6106bf6c1..000000000 --- a/vendor/coenjacobs/mozart/src/Mover.php +++ /dev/null @@ -1,243 +0,0 @@ -workingDir = $workingDir; - $this->targetDir = $config->dep_directory; - $this->config = $config; - - $this->filesystem = new Filesystem(new Local($this->workingDir)); - } - - /** - * Create the required `dep_directory` and `classmap_directory` and delete targetDirs of packages about to be moved. - * - * @param Package[] $packages The packages that, in the next step, will be moved. - * - * @return void - */ - public function deleteTargetDirs($packages): void - { - $this->filesystem->createDir($this->config->dep_directory); - - $this->filesystem->createDir($this->config->classmap_directory); - - foreach ($packages as $package) { - $this->deleteDepTargetDirs($package); - } - } - - /** - * Delete the directories about to be used for packages earmarked for Mozart namespacing. - * - * @visibility private to allow recursion through packages and subpackages. - * - * @param Package $package - * - * @return void - */ - private function deleteDepTargetDirs($package): void - { - foreach ($package->autoloaders as $packageAutoloader) { - $autoloaderType = get_class($packageAutoloader); - - switch ($autoloaderType) { - case Psr0::class: - case Psr4::class: - $outputDir = $this->config->dep_directory . $packageAutoloader->namespace; - $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); - $this->filesystem->deleteDir($outputDir); - break; - case Classmap::class: - $outputDir = $this->config->classmap_directory . $package->config->name; - $outputDir = str_replace('\\', DIRECTORY_SEPARATOR, $outputDir); - $this->filesystem->deleteDir($outputDir); - break; - } - } - - foreach ($package->dependencies as $subPackage) { - $this->deleteDepTargetDirs($subPackage); - } - } - - public function deleteEmptyDirs(): void - { - if (count($this->filesystem->listContents($this->config->dep_directory, true)) === 0) { - $this->filesystem->deleteDir($this->config->dep_directory); - } - - if (count($this->filesystem->listContents($this->config->classmap_directory, true)) === 0) { - $this->filesystem->deleteDir($this->config->classmap_directory); - } - } - - /** - * @return void - */ - public function movePackage(Package $package) - { - if (in_array($package->config->name, $this->movedPackages)) { - return; - } - - foreach ($package->autoloaders as $autoloader) { - if ($autoloader instanceof NamespaceAutoloader) { - $finder = new Finder(); - - foreach ($autoloader->paths as $path) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR - . $package->config->name . DIRECTORY_SEPARATOR . $path; - - $source_path = str_replace('/', DIRECTORY_SEPARATOR, $source_path); - - $finder->files()->in($source_path); - - foreach ($finder as $file) { - $this->moveFile($package, $autoloader, $file, $path); - } - } - } elseif ($autoloader instanceof Classmap) { - $finder = new Finder(); - - $files_to_move = array(); - - foreach ($autoloader->files as $file) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package->config->name; - $finder->files()->name($file)->in($source_path); - - foreach ($finder as $foundFile) { - $filePath = $foundFile->getRealPath(); - $files_to_move[ $filePath ] = $foundFile; - } - } - - $finder = new Finder(); - - foreach ($autoloader->paths as $path) { - $source_path = $this->workingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $package->config->name . DIRECTORY_SEPARATOR . $path; - - $finder->files()->in($source_path); - - foreach ($finder as $foundFile) { - $filePath = $foundFile->getRealPath(); - $files_to_move[ $filePath ] = $foundFile; - } - } - - foreach ($files_to_move as $foundFile) { - $this->moveFile($package, $autoloader, $foundFile); - } - } - - if (!in_array($package->config->name, $this->movedPackages)) { - $this->movedPackages[] = $package->config->name; - } - } - - if (!isset($this->config->delete_vendor_directories) || $this->config->delete_vendor_directories === true) { - $this->deletePackageVendorDirectories(); - } - } - - /** - * @param Package $package - * @param Autoloader $autoloader - * @param SplFileInfo $file - * @param string $path - * @return string - */ - public function moveFile(Package $package, $autoloader, $file, $path = '') - { - if ($autoloader instanceof NamespaceAutoloader) { - $namespacePath = $autoloader->getNamespacePath(); - $replaceWith = $this->config->dep_directory . $namespacePath; - $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); - - $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name - . DIRECTORY_SEPARATOR . $path; - $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); - $targetFile = str_replace($packageVendorPath, '', $targetFile); - } else { - $namespacePath = $package->config->name; - $replaceWith = $this->config->classmap_directory . DIRECTORY_SEPARATOR . $namespacePath; - $targetFile = str_replace($this->workingDir, $replaceWith, $file->getPathname()); - - $packageVendorPath = DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . $package->config->name - . DIRECTORY_SEPARATOR; - $packageVendorPath = str_replace('/', DIRECTORY_SEPARATOR, $packageVendorPath); - $targetFile = str_replace($packageVendorPath, DIRECTORY_SEPARATOR, $targetFile); - } - - $this->filesystem->copy( - str_replace($this->workingDir, '', $file->getPathname()), - $targetFile - ); - - return $targetFile; - } - - /** - * Deletes all the packages that are moved from the /vendor/ directory to - * prevent packages that are prefixed/namespaced from being used or - * influencing the output of the code. They just need to be gone. - * - * @return void - */ - protected function deletePackageVendorDirectories(): void - { - foreach ($this->movedPackages as $movedPackage) { - $packageDir = 'vendor' . DIRECTORY_SEPARATOR . $movedPackage; - if (!is_dir($packageDir) || is_link($packageDir)) { - continue; - } - - $this->filesystem->deleteDir($packageDir); - - //Delete parent directory too if it became empty - //(because that package was the only one from that vendor) - $parentDir = dirname($packageDir); - if ($this->dirIsEmpty($parentDir)) { - $this->filesystem->deleteDir($parentDir); - } - } - } - - private function dirIsEmpty(string $dir): bool - { - $di = new \RecursiveDirectoryIterator($dir, \FilesystemIterator::SKIP_DOTS); - return iterator_count($di) === 0; - } -} diff --git a/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php b/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php deleted file mode 100644 index 442551e8e..000000000 --- a/vendor/coenjacobs/mozart/src/Replace/BaseReplacer.php +++ /dev/null @@ -1,20 +0,0 @@ -autoloader = $autoloader; - } -} diff --git a/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php b/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php deleted file mode 100644 index 2cc297ed6..000000000 --- a/vendor/coenjacobs/mozart/src/Replace/ClassmapReplacer.php +++ /dev/null @@ -1,64 +0,0 @@ -classmap_prefix . $matches[1]; - $this->saveReplacedClass($matches[1], $replace); - return str_replace($matches[1], $replace, $matches[0]); - }, - $contents - ); - } - - public function saveReplacedClass($classname, string $replacedName): void - { - $this->replacedClasses[ $classname ] = $replacedName; - } -} diff --git a/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php b/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php deleted file mode 100644 index 711ec0863..000000000 --- a/vendor/coenjacobs/mozart/src/Replace/NamespaceReplacer.php +++ /dev/null @@ -1,43 +0,0 @@ -autoloader->getSearchNamespace(), '/'); - $dependencyNamespace = preg_quote($this->dep_namespace, '/'); - - return preg_replace_callback( - " - / # Start the pattern - ([^a-zA-Z0-9_\x7f-\xff]) # Match the non-class character before the namespace - ( # Start the namespace matcher - (?dep_namespace . $matches[2]; - }, - $contents - ); - } -} diff --git a/vendor/coenjacobs/mozart/src/Replace/Replacer.php b/vendor/coenjacobs/mozart/src/Replace/Replacer.php deleted file mode 100644 index 33b1a1509..000000000 --- a/vendor/coenjacobs/mozart/src/Replace/Replacer.php +++ /dev/null @@ -1,11 +0,0 @@ -workingDir = $workingDir; - $this->targetDir = $config->dep_directory; - $this->config = $config; - - $this->filesystem = new Filesystem(new Local($this->workingDir)); - } - - public function replacePackage(Package $package): void - { - foreach ($package->autoloaders as $autoloader) { - $this->replacePackageByAutoloader($package, $autoloader); - } - } - - /** - * @param $targetFile - * @param $autoloader - * - * @return void - */ - public function replaceInFile($targetFile, Autoloader $autoloader): void - { - $targetFile = str_replace($this->workingDir, '', $targetFile); - try { - $contents = $this->filesystem->read($targetFile); - } catch (FileNotFoundException $e) { - return; - } - - if (empty($contents) || false === $contents) { - return; - } - - if ($autoloader instanceof NamespaceAutoloader) { - $replacer = new NamespaceReplacer(); - $replacer->dep_namespace = $this->config->dep_namespace; - } else { - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = $this->config->classmap_prefix; - } - - $replacer->setAutoloader($autoloader); - $contents = $replacer->replace($contents); - - if ($replacer instanceof ClassmapReplacer) { - $this->replacedClasses = array_merge($this->replacedClasses, $replacer->replacedClasses); - } - - $this->filesystem->put($targetFile, $contents); - } - - /** - * @param Package $package - * @param $autoloader - * - * @return void - */ - public function replacePackageByAutoloader(Package $package, Composer\Autoload\Autoloader $autoloader): void - { - if ($autoloader instanceof NamespaceAutoloader) { - $source_path = $this->workingDir . $this->targetDir - . str_replace('\\', DIRECTORY_SEPARATOR, $autoloader->namespace) - . DIRECTORY_SEPARATOR; - $this->replaceInDirectory($autoloader, $source_path); - } elseif ($autoloader instanceof Classmap) { - $finder = new Finder(); - $source_path = $this->workingDir . $this->config->classmap_directory . DIRECTORY_SEPARATOR - . $package->config->name; - $finder->files()->in($source_path); - - foreach ($finder as $foundFile) { - $targetFile = $foundFile->getRealPath(); - - if ('.php' == substr($targetFile, -4, 4)) { - $this->replaceInFile($targetFile, $autoloader); - } - } - } - } - - /** - * @param $autoloader - * @param $directory - * - * @return void - */ - public function replaceParentClassesInDirectory(string $directory): void - { - if (count($this->replacedClasses)===0) { - return; - } - - $directory = trim($directory, '//'); - $finder = new Finder(); - $finder->files()->in($directory); - - $replacedClasses = $this->replacedClasses; - - foreach ($finder as $file) { - $targetFile = $file->getPathName(); - - if ('.php' == substr($targetFile, -4, 4)) { - try { - $contents = $this->filesystem->read($targetFile); - } catch (FileNotFoundException $e) { - continue; - } - - if (empty($contents) || false === $contents) { - continue; - } - - foreach ($replacedClasses as $original => $replacement) { - $contents = preg_replace_callback( - '/(.*)([^a-zA-Z0-9_\x7f-\xff])'. $original . '([^a-zA-Z0-9_\x7f-\xff])/U', - function ($matches) use ($replacement) { - if (preg_match('/(include|require)/', $matches[0], $output_array)) { - return $matches[0]; - } - return $matches[1] . $matches[2] . $replacement . $matches[3]; - }, - $contents - ); - } - - $this->filesystem->put($targetFile, $contents); - } - } - } - - /** - * @param $autoloader - * @param $directory - * - * @return void - */ - public function replaceInDirectory(NamespaceAutoloader $autoloader, string $directory): void - { - $finder = new Finder(); - $finder->files()->in($directory); - - foreach ($finder as $file) { - $targetFile = $file->getPathName(); - - if ('.php' == substr($targetFile, -4, 4)) { - $this->replaceInFile($targetFile, $autoloader); - } - } - } - - /** - * Replace everything in parent package, based on the dependency package. - * This is done to ensure that package A (which requires package B), is also - * updated with the replacements being made in package B. - * - * @param Package $package - * @param Package $parent - * - * @return void - */ - public function replaceParentPackage(Package $package, Package $parent): void - { - foreach ($parent->autoloaders as $parentAutoloader) { - foreach ($package->autoloaders as $autoloader) { - if ($parentAutoloader instanceof NamespaceAutoloader) { - $namespace = str_replace('\\', DIRECTORY_SEPARATOR, $parentAutoloader->namespace); - $directory = $this->workingDir . $this->config->dep_directory . $namespace - . DIRECTORY_SEPARATOR; - - if ($autoloader instanceof NamespaceAutoloader) { - $this->replaceInDirectory($autoloader, $directory); - } else { - $directory = str_replace($this->workingDir, '', $directory); - $this->replaceParentClassesInDirectory($directory); - } - } else { - $directory = $this->workingDir . $this->config->classmap_directory . $parent->config->name; - - if ($autoloader instanceof NamespaceAutoloader) { - $this->replaceInDirectory($autoloader, $directory); - } else { - $directory = str_replace($this->workingDir, '', $directory); - $this->replaceParentClassesInDirectory($directory); - } - } - } - } - } -} diff --git a/vendor/coenjacobs/mozart/tests/Console/Commands/ComposeTest.php b/vendor/coenjacobs/mozart/tests/Console/Commands/ComposeTest.php deleted file mode 100644 index 0203fae49..000000000 --- a/vendor/coenjacobs/mozart/tests/Console/Commands/ComposeTest.php +++ /dev/null @@ -1,225 +0,0 @@ -createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - /** - * When json_decode fails, instead of - * "Trying to get property 'extra' of non-object" - * a better message should be written to the OutputInterface. - * - * @test - */ - public function it_handles_malformed_json_with_grace(): void - { - - $badComposerJson = '{ "name": "coenjacobs/mozart", }'; - - file_put_contents(__DIR__ . '/composer.json', $badComposerJson); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - /** - * When composer.json->extra is absent, instead of - * "Undefined property: stdClass::$extra" - * a better message should be written to the OutputInterface. - * - * @test - */ - public function it_handles_absent_extra_config_with_grace(): void - { - - $badComposerJson = '{ "name": "coenjacobs/mozart" }'; - - file_put_contents(__DIR__ . '/composer.json', $badComposerJson); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - - /** - * When composer.json->extra is not an object, instead of - * "Trying to get property 'mozart' of non-object" - * a better message should be written to the OutputInterface. - * - * @test - */ - public function it_handles_malformed_extra_config_with_grace(): void - { - - $badComposerJson = '{ "name": "coenjacobs/mozart", "extra": [] }'; - - file_put_contents(__DIR__ . '/composer.json', $badComposerJson); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - /** - * When composer.json->extra->mozart is absent, instead of - * "Undefined property: stdClass::$mozart" - * a better message should be written to the OutputInterface. - * - * @test - */ - public function it_handles_absent_mozart_config_with_grace(): void - { - - $badComposerJson = '{ "name": "coenjacobs/mozart", "extra": { "moozart": {} } }'; - - file_put_contents(__DIR__ . '/composer.json', $badComposerJson); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - /** - * When composer.json->extra->mozart is malformed, instead of - * "Undefined property: stdClass::$mozart" - * a better message should be written to the OutputInterface. - * - * is_object() added. - * - * @test - */ - public function it_handles_malformed_mozart_config__with_grace(): void - { - - $badComposerJson = '{ "name": "coenjacobs/mozart", "extra": { "mozart": [] } }'; - - file_put_contents(__DIR__ . '/composer.json', $badComposerJson); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $outputInterfaceMock->expects($this->exactly(1)) - ->method('write'); - - $compose = new class( $inputInterfaceMock, $outputInterfaceMock ) extends Compose { - public function __construct($inputInterfaceMock, $outputInterfaceMock) - { - parent::__construct(); - - $this->execute($inputInterfaceMock, $outputInterfaceMock); - } - }; - } - - public function tearDown(): void - { - parent::tearDown(); - - $composer_json = __DIR__ . '/composer.json'; - if (file_exists($composer_json)) { - unlink($composer_json); - } - } - - public static function tearDownAfterClass(): void - { - parent::tearDownAfterClass(); - chdir(self::$cwd); - } -} diff --git a/vendor/coenjacobs/mozart/tests/MoverTest.php b/vendor/coenjacobs/mozart/tests/MoverTest.php deleted file mode 100644 index 3ec8a1b34..000000000 --- a/vendor/coenjacobs/mozart/tests/MoverTest.php +++ /dev/null @@ -1,230 +0,0 @@ -extra->mozart settings - * - * @var stdClass - */ - protected $config; - - /** - * Set up a common settings object. - */ - public function setUp(): void - { - parent::setUp(); - - $this->testsWorkingDir = __DIR__ . '/temptestdir'; - if (!file_exists($this->testsWorkingDir)) { - mkdir($this->testsWorkingDir); - } - - $config = new class() { - }; - $config->dep_directory = "/dep_directory/"; - $config->classmap_directory = "/classmap_directory/"; - $config->packages = array( - "pimple/pimple", - "ezyang/htmlpurifier" - ); - - $pimpleAutoload = json_decode("{ \"psr-0\" : { \"Pimple\" : [ \"src/\" ] } }"); - $htmlpurifierAutoload = json_decode("{ \"classmap\" : { \"Pimple\" => [ \"library/\" ] } }"); - - $config->override_autoload = array(); - $config->override_autoload["pimple/pimple"] = $pimpleAutoload; - $config->override_autoload["ezyang/htmlpurifier"] = $htmlpurifierAutoload; - - $this->config = $config; - } - - /** - * If the specified `dep_directory` or `classmap_directory` are absent, create them. - * - * @test - */ - public function it_creates_absent_dirs(): void - { - $mover = new Mover($this->testsWorkingDir, $this->config); - - $packages = array(); - - $mover->deleteTargetDirs($packages); - - $this->assertTrue(file_exists($this->testsWorkingDir . DIRECTORY_SEPARATOR - . $this->config->dep_directory)); - $this->assertTrue(file_exists($this->testsWorkingDir . DIRECTORY_SEPARATOR - . $this->config->classmap_directory)); - } - - /** - * If the specified `dep_directory` or `classmap_directory` already exists with contents, it is not an issue. - * - * @test - */ - public function it_is_unpertrubed_by_existing_dirs(): void - { - $mover = new Mover($this->testsWorkingDir, $this->config); - - if (!file_exists($this->testsWorkingDir . $this->config->dep_directory)) { - mkdir($this->testsWorkingDir . $this->config->dep_directory); - } - if (!file_exists($this->testsWorkingDir . $this->config->classmap_directory)) { - mkdir($this->testsWorkingDir . $this->config->classmap_directory); - } - - $this->assertDirectoryExists($this->testsWorkingDir . $this->config->dep_directory); - $this->assertDirectoryExists($this->testsWorkingDir . $this->config->classmap_directory); - - $packages = array(); - - ob_start(); - - $mover->deleteTargetDirs($packages); - - $output = ob_get_clean(); - - $this->assertEmpty($output); - } - - /** - * If the specified `dep_directory` or `classmap_directory` contains a subdir we are going to need when moving, - * delete the subdir. aka: If subfolders exist for dependencies we are about to manage, delete those subfolders. - * - * @test - */ - public function it_deletes_subdirs_for_packages_about_to_be_moved(): void - { - $mover = new Mover($this->testsWorkingDir, $this->config); - - mkdir($this->testsWorkingDir . DIRECTORY_SEPARATOR . $this->config->dep_directory); - mkdir($this->testsWorkingDir . DIRECTORY_SEPARATOR . $this->config->classmap_directory); - - // TODO: Create the subdirs that should be deleted. - mkdir($this->testsWorkingDir . DIRECTORY_SEPARATOR . $this->config->dep_directory . 'Pimple'); - mkdir($this->testsWorkingDir . DIRECTORY_SEPARATOR . $this->config->classmap_directory . 'ezyang'); - - $packages = array(); - foreach ($this->config->packages as $packageString) { - $testDummyComposerDir = $this->testsWorkingDir . DIRECTORY_SEPARATOR . 'vendor' - . DIRECTORY_SEPARATOR . $packageString; - @mkdir($testDummyComposerDir, 0777, true); - $testDummyComposerPath = $testDummyComposerDir . DIRECTORY_SEPARATOR . 'composer.json'; - $testDummyComposerContents = json_encode(new stdClass()); - - file_put_contents($testDummyComposerPath, $testDummyComposerContents); - $parsedPackage = new Package($testDummyComposerDir, $this->config->override_autoload[$packageString]); - $parsedPackage->findAutoloaders(); - $packages[] = $parsedPackage; - } - - $mover->deleteTargetDirs($packages); - - $this->assertDirectoryNotExists($this->testsWorkingDir . $this->config->dep_directory . 'Pimple'); - $this->assertDirectoryNotExists($this->testsWorkingDir . $this->config->dep_directory . 'ezyang'); - } - - /** - * If a file is specified more than once in an autoloader, e.g. is explicitly listed and is also in a folder listed, - * a "File already exists at path" error occurs. - * - * To fix this, we enumerate the files to be copied using a dictionary indexed with the source file path, then loop - * and copy, thus only copying each one once. - * - * Original error: - * "League\Flysystem\FileExistsException : File already exists at path: lib/classes/tecnickcom/tcpdf/tcpdf.php" - * - * Test is using a known problematic autoloader: - * "iio/libmergepdf": { - * "classmap": [ - * "config", - * "include", - * "tcpdf.php", - * "tcpdf_parser.php", - * "tcpdf_import.php", - * "tcpdf_barcodes_1d.php", - * "tcpdf_barcodes_2d.php", - * "include/tcpdf_colors.php", - * "include/tcpdf_filters.php", - * "include/tcpdf_font_data.php", - * "include/tcpdf_fonts.php", - * "include/tcpdf_images.php", - * "include/tcpdf_static.php", - * "include/barcodes/datamatrix.php", - * "include/barcodes/pdf417.php", - * "include/barcodes/qrcode.php" - * ] - * } - * - * @see https://github.com/coenjacobs/mozart/issues/89 - * - * @test - */ - public function it_moves_each_file_once_per_namespace() - { - - // The composer.json with the Mozart requirement and `mozart compose` removed. - copy(__DIR__ . '/issue89-composer.json', $this->testsWorkingDir . '/composer.json'); - - chdir($this->testsWorkingDir); - - exec('composer install'); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $mozartCompose = new Compose(); - - // $this->expectException(League\Flysystem\FileExistsException::class); - - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); - - // On the failing test, an exception was thrown and this line was not reached. - $this->assertEquals(0, $result); - } - - /** - * Delete $this->testsWorkingDir after each test. - * - * @see https://stackoverflow.com/questions/3349753/delete-directory-with-files-in-it - */ - public function tearDown(): void - { - parent::tearDown(); - - $dir = $this->testsWorkingDir; - - $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); - $files = new RecursiveIteratorIterator( - $it, - RecursiveIteratorIterator::CHILD_FIRST - ); - foreach ($files as $file) { - if ($file->isDir()) { - rmdir($file->getRealPath()); - } else { - unlink($file->getRealPath()); - } - } - rmdir($dir); - chdir(__DIR__); - } -} diff --git a/vendor/coenjacobs/mozart/tests/issue89-composer.json b/vendor/coenjacobs/mozart/tests/issue89-composer.json deleted file mode 100644 index c29017200..000000000 --- a/vendor/coenjacobs/mozart/tests/issue89-composer.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "require": { - "iio/libmergepdf": "^4.0" - }, - "extra": { - "mozart": { - "dep_namespace": "MyLibMerge\\Vendor", - "dep_directory": "/lib/packages/", - "classmap_directory": "/lib/classes/", - "classmap_prefix": "MyLibMerge_", - "excluded_packages": [ - ], - "override_autoload": { - }, - "delete_vendor_directories": true - } - } -} \ No newline at end of file diff --git a/vendor/coenjacobs/mozart/tests/replacers/ClassMapReplacerTest.php b/vendor/coenjacobs/mozart/tests/replacers/ClassMapReplacerTest.php deleted file mode 100644 index f14de75b8..000000000 --- a/vendor/coenjacobs/mozart/tests/replacers/ClassMapReplacerTest.php +++ /dev/null @@ -1,155 +0,0 @@ -classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals('class Mozart_Hello_World {', $contents); - } - - /** @test */ - public function it_replaces_abstract_class_declarations(): void - { - $contents = 'abstract class Hello_World {'; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals('abstract class Mozart_Hello_World {', $contents); - } - - /** @test */ - public function it_replaces_interface_class_declarations(): void - { - $contents = 'interface Hello_World {'; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals('interface Mozart_Hello_World {', $contents); - } - - /** @test */ - public function it_replaces_class_declarations_that_extend_other_classes(): void - { - $contents = 'class Hello_World extends Bye_World {'; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals('class Mozart_Hello_World extends Bye_World {', $contents); - } - - /** @test */ - public function it_replaces_class_declarations_that_implement_interfaces(): void - { - $contents = 'class Hello_World implements Bye_World {'; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals('class Mozart_Hello_World implements Bye_World {', $contents); - } - - /** @test */ - public function it_stores_replaced_class_names(): void - { - $contents = 'class Hello_World {'; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $replacer->replace($contents); - $this->assertArrayHasKey('Hello_World', $replacer->replacedClasses); - } - - /** @test */ - public function it_replaces_class_declarations_psr2(): void - { - $contents = "class Hello_World\n{"; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals("class Mozart_Hello_World\n{", $contents); - } - - /** - * @see https://github.com/coenjacobs/mozart/issues/81 - * - * @test - */ - public function it_replaces_class(): void - { - $contents = "class Hello_World"; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $contents = $replacer->replace($contents); - $this->assertEquals("class Mozart_Hello_World", $contents); - } - - - /** - * @see ClassmapReplacerIntegrationTest::test_it_does_not_make_classname_replacement_inside_namespaced_file() - * @see https://github.com/coenjacobs/mozart/issues/93 - * - * @test - */ - public function it_does_not_replace_inside_namespace_multiline(): void - { - $input = " - namespace Mozart; - class Hello_World - "; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $result = $replacer->replace($input); - - $this->assertEquals($input, $result); - } - - /** - * @see ClassmapReplacerIntegrationTest::test_it_does_not_make_classname_replacement_inside_namespaced_file() - * @see https://github.com/coenjacobs/mozart/issues/93 - * - * @test - */ - public function it_does_not_replace_inside_namespace_singleline(): void - { - $input = "namespace Mozart; class Hello_World"; - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $result = $replacer->replace($input); - - $this->assertEquals($input, $result); - } - - /** - * It's possible to have multiple namespaces inside one file. - * - * To have two classes in one file, one in a namespace and the other not, the global namespace needs to be explicit. - * - * @test - */ - public function it_does_not_replace_inside_named_namespace_but_does_inside_explicit_global_namespace(): void - { - - $input = " - namespace My_Project { - class A_Class { } - } - namespace { - class B_Class { } - } - "; - - $replacer = new ClassmapReplacer(); - $replacer->classmap_prefix = 'Mozart_'; - $result = $replacer->replace($input); - - $this->assertStringNotContainsString('Mozart_A_Class', $result); - $this->assertStringContainsString('Mozart_B_Class', $result); - } -} diff --git a/vendor/coenjacobs/mozart/tests/replacers/ClassmapReplacerIntegrationTest.php b/vendor/coenjacobs/mozart/tests/replacers/ClassmapReplacerIntegrationTest.php deleted file mode 100644 index e52422da6..000000000 --- a/vendor/coenjacobs/mozart/tests/replacers/ClassmapReplacerIntegrationTest.php +++ /dev/null @@ -1,137 +0,0 @@ -testsWorkingDir = __DIR__ . '/temptestdir'; - if (!file_exists($this->testsWorkingDir)) { - mkdir($this->testsWorkingDir); - } - - $mozart_config = new class() { - public $dep_namespace = "Mozart"; - public $classmap_prefix = "Mozart_"; - public $dep_directory = "/dep_directory/"; - public $classmap_directory = "/classmap_directory/"; - - }; - - $composer = new class() { - public $repositories = array(); - public $require = array(); - public $minimum_stability = "dev"; - public $extra; - }; - - $composer->extra = new class() { - public $mozart; - }; - - $composer->extra->mozart = $mozart_config; - - $this->composer = $composer; - } - - /** - * Issue #93 shows a classname being updated inside a class whose namespace has also been updated - * by Mozart. - * - * This is caused by the same files being loaded by both a PSR-4 autolaoder and classmap autoloader. - * @see https://github.com/katzgrau/KLogger/blob/de2d3ab6777a393a9879e0496ebb8e0644066e3f/composer.json#L24-L29 - */ - public function test_it_does_not_make_classname_replacement_inside_namespaced_file() - { - - $composer = $this->composer; - - $composer->repositories[] = new class() { - public $url = "https://github.com/BrianHenryIE/bh-wp-logger"; - public $type = "git"; - }; - - $composer->require["brianhenryie/wp-logger"] = "dev-master#dd2bb0665e01e11b282178e76a2334198d3860c5"; - - $composer_json_string = json_encode($composer); - $composer_json_string = str_replace('minimum_stability', 'minimum-stability', $composer_json_string); - - file_put_contents($this->testsWorkingDir . '/composer.json', $composer_json_string); - - chdir($this->testsWorkingDir); - - exec('composer install'); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $mozartCompose = new Compose(); - - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); - - $php_string = file_get_contents($this->testsWorkingDir .'/dep_directory/BrianHenryIE/WP_Logger/class-logger.php'); - - // Confirm problem is gone. - $this->assertStringNotContainsString('class Mozart_Logger extends', $php_string); - - // Confirm solution is correct. - $this->assertStringContainsString('class Logger extends', $php_string); - } - - - /** - * Delete $this->testsWorkingDir after each test. - * - * @see https://stackoverflow.com/questions/3349753/delete-directory-with-files-in-it - */ - public function tearDown(): void - { - parent::tearDown(); - - $dir = $this->testsWorkingDir; - - $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); - $files = new RecursiveIteratorIterator( - $it, - RecursiveIteratorIterator::CHILD_FIRST - ); - foreach ($files as $file) { - if ($file->isDir()) { - rmdir($file->getRealPath()); - } else { - unlink($file->getRealPath()); - } - } - rmdir($dir); - } -} diff --git a/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerIntegrationTest.php b/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerIntegrationTest.php deleted file mode 100644 index 6e388a76f..000000000 --- a/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerIntegrationTest.php +++ /dev/null @@ -1,131 +0,0 @@ -testsWorkingDir = __DIR__ . '/temptestdir'; - if (!file_exists($this->testsWorkingDir)) { - mkdir($this->testsWorkingDir); - } - - $mozart_config = new class() { - public $dep_namespace = "Mozart"; - public $classmap_prefix = "Mozart_"; - public $dep_directory = "/dep_directory/"; - public $classmap_directory = "/classmap_directory/"; - - }; - - $composer = new class() { - public $require = array(); - public $extra; - }; - - $composer->extra = new class() { - public $mozart; - }; - - $composer->extra->mozart = $mozart_config; - - $this->composer = $composer; - } - - /** - * After PR #84, running Mozart on Mpdf began prefixing the class name inside the namespaced file. - * - * The problem coming from the filename matching the namespace name? - * - * dev-master#5d8041fdefc94ff57edcbe83ab468a9988c4fc11 - * - * @see https://github.com/coenjacobs/mozart/pull/84/files - * - * Should be: "class Mpdf implements" because its namespace has already been prefixed. - */ - public function test_it_does_not_make_classname_replacement_inside_namespaced_file() - { - - $composer = $this->composer; - - $composer->require["mpdf/mpdf"] = "8.0.10"; - - file_put_contents($this->testsWorkingDir . '/composer.json', json_encode($composer)); - - chdir($this->testsWorkingDir); - - exec('composer install'); - - $inputInterfaceMock = $this->createMock(InputInterface::class); - $outputInterfaceMock = $this->createMock(OutputInterface::class); - - $mozartCompose = new Compose(); - - $result = $mozartCompose->run($inputInterfaceMock, $outputInterfaceMock); - - $mpdf_php = file_get_contents($this->testsWorkingDir .'/dep_directory/Mpdf/Mpdf.php'); - - // Confirm problem is gone. - $this->assertStringNotContainsString('class Mozart\Mpdf implements', $mpdf_php); - - // Confirm solution is correct. - $this->assertStringContainsString('class Mpdf implements', $mpdf_php); - } - - - /** - * Delete $this->testsWorkingDir after each test. - * - * @see https://stackoverflow.com/questions/3349753/delete-directory-with-files-in-it - */ - public function tearDown(): void - { - parent::tearDown(); - - $dir = $this->testsWorkingDir; - - $it = new RecursiveDirectoryIterator($dir, RecursiveDirectoryIterator::SKIP_DOTS); - $files = new RecursiveIteratorIterator( - $it, - RecursiveIteratorIterator::CHILD_FIRST - ); - foreach ($files as $file) { - if ($file->isDir()) { - rmdir($file->getRealPath()); - } else { - unlink($file->getRealPath()); - } - } - rmdir($dir); - } -} diff --git a/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerTest.php b/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerTest.php deleted file mode 100644 index d317378ab..000000000 --- a/vendor/coenjacobs/mozart/tests/replacers/NamespaceReplacerTest.php +++ /dev/null @@ -1,126 +0,0 @@ -replacer = self::createReplacer('Test\\Test'); - } - - /** - * Creates a NamespaceReplacer, given a namespace and a prefix. - * - * @param string $namespace - * @param string $prefix - * - * @return Psr0 - */ - protected static function createReplacer(string $namespace, string $prefix = self::PREFIX) : NamespaceReplacer - { - $autoloader = new Psr0; - $autoloader->namespace = $namespace; - $replacer = new NamespaceReplacer(); - $replacer->setAutoloader($autoloader); - $replacer->dep_namespace = $prefix; - - return $replacer; - } - - /** @test */ - public function it_replaces_namespace_declarations(): void - { - $contents = 'namespace Test\\Test;'; - $contents = $this->replacer->replace($contents); - - $this->assertEquals('namespace My\\Mozart\\Prefix\\Test\\Test;', $contents); - } - - - /** @test */ - public function it_doesnt_replaces_namespace_inside_namespace(): void - { - $replacer = self::createReplacer('Test'); - - $contents = "namespace Test\\Something;\n\nuse Test\\Test;"; - $contents = $replacer->replace($contents); - - $this->assertEquals("namespace My\\Mozart\\Prefix\\Test\\Something;\n\nuse My\\Mozart\\Prefix\\Test\\Test;", $contents); - } - - /** @test */ - public function it_replaces_partial_namespace_declarations(): void - { - $contents = 'namespace Test\\Test\\Another;'; - $contents = $this->replacer->replace($contents); - - $this->assertEquals('namespace My\\Mozart\\Prefix\\Test\\Test\\Another;', $contents); - } - - /** @test */ - public function it_doesnt_prefix_already_prefixed_namespace(): void - { - $replacer = self::createReplacer('Test\\Another'); - - $contents = 'namespace My\\Mozart\\Prefix\\Test\\Another;'; - $contents = $replacer->replace($contents); - - $this->assertEquals('namespace My\\Mozart\\Prefix\\Test\\Another;', $contents); - } - - /** @test */ - public function it_doesnt_double_replace_namespaces_that_also_exist_inside_another_namespace(): void - { - $chickenReplacer = self::createReplacer('Chicken'); - $eggReplacer = self::createReplacer('Egg'); - - // This is a tricky situation. We are referencing Chicken\Egg, - // but Egg *also* exists as a separate top level class. - $contents = 'use Chicken\\Egg;'; - $expected = 'use My\\Mozart\\Prefix\\Chicken\\Egg;'; - - // First, we test that eggReplacer(chickenReplacer()) yields the expected result. - $this->assertEquals($expected, $eggReplacer->replace($chickenReplacer->replace($contents))); - - // Then, we test that chickenReplacer(eggReplacer()) yields the expected result. - $this->assertEquals($expected, $chickenReplacer->replace($eggReplacer->replace($contents))); - - // Now we do the same thing, but with root-relative references. - $contents = 'use \\Chicken\\Egg;'; - $expected = 'use \\My\\Mozart\\Prefix\\Chicken\\Egg;'; - - // First, we test that eggReplacer(chickenReplacer()) yields the expected result. - $this->assertEquals($expected, $eggReplacer->replace($chickenReplacer->replace($contents))); - - // Then, we test that chickenReplacer(eggReplacer()) yields the expected result. - $this->assertEquals($expected, $chickenReplacer->replace($eggReplacer->replace($contents))); - } - - /** - * @see https://github.com/coenjacobs/mozart/issues/75 - * - * @test - */ - public function it_replaces_namespace_use_as_declarations(): void - { - - $namespace = 'Symfony\Polyfill\Mbstring'; - $prefix = "MBViews\\Dependencies\\"; - - $replacer = self::createReplacer($namespace, $prefix); - - $contents = "use Symfony\Polyfill\Mbstring as p;"; - $expected = "use MBViews\Dependencies\Symfony\Polyfill\Mbstring as p;"; - - $this->assertEquals($expected, $replacer->replace($contents)); - } -} diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 63f1eeb5f..d1dd49388 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -6,13 +6,7 @@ $baseDir = dirname($vendorDir); return array( - 'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', - 'JsonException' => $vendorDir . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'Normalizer' => $vendorDir . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PhpToken' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'UsabilityDynamics\\Job' => $vendorDir . '/udx/lib-utility/lib/class-job.php', 'UsabilityDynamics\\Loader' => $vendorDir . '/udx/lib-utility/lib/class-loader.php', 'UsabilityDynamics\\Settings' => $vendorDir . '/udx/lib-settings/lib/class-settings.php', @@ -21,12 +15,12 @@ 'UsabilityDynamics\\UD_API\\API' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-api.php', 'UsabilityDynamics\\UD_API\\Admin' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-admin.php', 'UsabilityDynamics\\UD_API\\Bootstrap' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-bootstrap.php', - 'UsabilityDynamics\\UD_API\\License_Checker' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-license-checker.php', 'UsabilityDynamics\\UD_API\\Licenses_Table' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-licenses-table.php', 'UsabilityDynamics\\UD_API\\Manager' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-manager.php', 'UsabilityDynamics\\UD_API\\More_Products_Table' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-more-products-table.php', 'UsabilityDynamics\\UD_API\\Scaffold' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-scaffold.php', 'UsabilityDynamics\\UD_API\\UI' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-ui.php', + 'UsabilityDynamics\\UD_API\\Update_Checker' => $vendorDir . '/udx/lib-ud-api-client/lib/classes/class-update-checker.php', 'UsabilityDynamics\\Utility' => $vendorDir . '/udx/lib-utility/lib/class-utility.php', 'UsabilityDynamics\\Utility\\Guid_Fix' => $vendorDir . '/udx/lib-utility/lib/class-guid-fix.php', 'UsabilityDynamics\\WP\\Bootstrap' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php', @@ -35,27 +29,23 @@ 'UsabilityDynamics\\WP\\Dashboard' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-dashboard.php', 'UsabilityDynamics\\WP\\Errors' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-errors.php', 'UsabilityDynamics\\WP\\Scaffold' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-scaffold.php', + 'UsabilityDynamics\\WP\\TGMPA_List_Table' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php', + 'UsabilityDynamics\\WP\\TGM_Bulk_Installer' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php', + 'UsabilityDynamics\\WP\\TGM_Bulk_Installer_Skin' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php', + 'UsabilityDynamics\\WP\\TGM_Plugin_Activation' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php', 'UsabilityDynamics\\WP\\Utility' => $vendorDir . '/udx/lib-wp-bootstrap/lib/classes/class-utility.php', - 'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'WP_Async_Request' => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php', - 'WP_Background_Process' => $vendorDir . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php', 'wpCloud\\StatelessMedia\\API' => $baseDir . '/lib/classes/class-api.php', 'wpCloud\\StatelessMedia\\Ajax' => $baseDir . '/lib/classes/class-ajax.php', + 'wpCloud\\StatelessMedia\\AppEngine' => $baseDir . '/lib/classes/class-google-app-engine.php', 'wpCloud\\StatelessMedia\\Bootstrap' => $baseDir . '/lib/classes/class-bootstrap.php', 'wpCloud\\StatelessMedia\\Compatibility' => $baseDir . '/lib/classes/class-compatibility.php', - 'wpCloud\\StatelessMedia\\CompatibilityWooExtraProductOptions' => $baseDir . '/lib/classes/compatibility/woo-extra-product-options.php', - 'wpCloud\\StatelessMedia\\DynamicImageSupport' => $baseDir . '/lib/classes/compatibility/dynamic-image-support.php', + 'wpCloud\\StatelessMedia\\DynamicImageSupport' => $baseDir . '/lib/classes/class-dynamic-image-support.php', 'wpCloud\\StatelessMedia\\Errors' => $baseDir . '/lib/classes/class-errors.php', 'wpCloud\\StatelessMedia\\FatalException' => $baseDir . '/lib/classes/exception-fatal.php', 'wpCloud\\StatelessMedia\\GS_Client' => $baseDir . '/lib/classes/class-gs-client.php', - 'wpCloud\\StatelessMedia\\GoogleAppEngine' => $baseDir . '/lib/classes/compatibility/google-app-engine.php', - 'wpCloud\\StatelessMedia\\Imagify' => $baseDir . '/lib/classes/compatibility/imagify.php', 'wpCloud\\StatelessMedia\\Logger' => $baseDir . '/lib/classes/class-logger.php', 'wpCloud\\StatelessMedia\\Module' => $baseDir . '/lib/classes/class-module.php', - 'wpCloud\\StatelessMedia\\SOCSS' => $baseDir . '/lib/classes/compatibility/siteorigin-css.php', - 'wpCloud\\StatelessMedia\\SOWidgetCSS' => $baseDir . '/lib/classes/compatibility/siteorigin-widget-bundle.php', 'wpCloud\\StatelessMedia\\Settings' => $baseDir . '/lib/classes/class-settings.php', - 'wpCloud\\StatelessMedia\\ShortPixel' => $baseDir . '/lib/classes/compatibility/shortpixel.php', 'wpCloud\\StatelessMedia\\Singleton' => $baseDir . '/lib/classes/trait-singleton.php', 'wpCloud\\StatelessMedia\\StreamWrapper' => $baseDir . '/lib/classes/class-gs-stream-wrapper.php', 'wpCloud\\StatelessMedia\\SyncNonMedia' => $baseDir . '/lib/classes/class-sync-non-media.php', @@ -69,10 +59,4 @@ 'wpCloud\\StatelessMedia\\UnprocessableException' => $baseDir . '/lib/classes/exception-unprocessable.php', 'wpCloud\\StatelessMedia\\Upgrader' => $baseDir . '/lib/classes/class-upgrader.php', 'wpCloud\\StatelessMedia\\Utility' => $baseDir . '/lib/classes/class-utility.php', - 'wpCloud\\StatelessMedia\\VidoRev' => $baseDir . '/lib/classes/compatibility/vidorev.php', - 'wpCloud\\StatelessMedia\\WPBakeryPageBuilder' => $baseDir . '/lib/classes/compatibility/wpbakery-page-builder.php', - 'wpCloud\\StatelessMedia\\WPForms' => $baseDir . '/lib/classes/compatibility/wpforms.php', - 'wpCloud\\StatelessMedia\\WPRetina2x' => $baseDir . '/lib/classes/compatibility/wp-retina-2x.php', - 'wpCloud\\StatelessMedia\\WPSmush' => $baseDir . '/lib/classes/compatibility/wp-smush.php', - 'wpCloud\\StatelessMedia\\WooCommerce' => $baseDir . '/lib/classes/compatibility/woocommerce.php', ); diff --git a/vendor/composer/autoload_files.php b/vendor/composer/autoload_files.php deleted file mode 100644 index e70959884..000000000 --- a/vendor/composer/autoload_files.php +++ /dev/null @@ -1,17 +0,0 @@ - $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php', -); diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index f69715179..2f0271f50 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -6,20 +6,7 @@ $baseDir = dirname($vendorDir); return array( - 'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'), - 'Symfony\\Polyfill\\Php73\\' => array($vendorDir . '/symfony/polyfill-php73'), - 'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => array($vendorDir . '/symfony/polyfill-intl-normalizer'), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => array($vendorDir . '/symfony/polyfill-intl-grapheme'), - 'Symfony\\Polyfill\\Ctype\\' => array($vendorDir . '/symfony/polyfill-ctype'), - 'Symfony\\Contracts\\Service\\' => array($vendorDir . '/symfony/service-contracts'), - 'Symfony\\Component\\String\\' => array($vendorDir . '/symfony/string'), - 'Symfony\\Component\\Finder\\' => array($vendorDir . '/symfony/finder'), - 'Symfony\\Component\\Console\\' => array($vendorDir . '/symfony/console'), - 'Psr\\Container\\' => array($vendorDir . '/psr/container/src'), - 'League\\MimeTypeDetection\\' => array($vendorDir . '/league/mime-type-detection/src'), - 'League\\Flysystem\\' => array($vendorDir . '/league/flysystem/src'), + 'MetaBox\\' => array($vendorDir . '/wpmetabox/meta-box/src'), 'Firebase\\JWT\\' => array($vendorDir . '/firebase/php-jwt/src'), 'Composer\\Installers\\' => array($vendorDir . '/composer/installers/src/Composer/Installers'), - 'CoenJacobs\\Mozart\\' => array($vendorDir . '/coenjacobs/mozart/src'), ); diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index ea6820089..4388aef1f 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -33,18 +33,6 @@ public static function getLoader() $loader->register(true); - $filesToLoad = \Composer\Autoload\ComposerStaticInitc59d002476a452800baaf79c430753cb::$files; - $requireFile = \Closure::bind(static function ($fileIdentifier, $file) { - if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { - $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; - - require $file; - } - }, null, null); - foreach ($filesToLoad as $fileIdentifier => $file) { - $requireFile($fileIdentifier, $file); - } - return $loader; } } diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5f60a88b8..a3eabcba5 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -6,39 +6,10 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb { - public static $files = array ( - '0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php', - '6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php', - 'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php', - '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php', - '8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php', - 'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php', - '0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php', - 'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php', - ); - public static $prefixLengthsPsr4 = array ( - 'S' => - array ( - 'Symfony\\Polyfill\\Php80\\' => 23, - 'Symfony\\Polyfill\\Php73\\' => 23, - 'Symfony\\Polyfill\\Mbstring\\' => 26, - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => 33, - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => 31, - 'Symfony\\Polyfill\\Ctype\\' => 23, - 'Symfony\\Contracts\\Service\\' => 26, - 'Symfony\\Component\\String\\' => 25, - 'Symfony\\Component\\Finder\\' => 25, - 'Symfony\\Component\\Console\\' => 26, - ), - 'P' => + 'M' => array ( - 'Psr\\Container\\' => 14, - ), - 'L' => - array ( - 'League\\MimeTypeDetection\\' => 25, - 'League\\Flysystem\\' => 17, + 'MetaBox\\' => 8, ), 'F' => array ( @@ -47,62 +18,13 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'C' => array ( 'Composer\\Installers\\' => 20, - 'CoenJacobs\\Mozart\\' => 18, ), ); public static $prefixDirsPsr4 = array ( - 'Symfony\\Polyfill\\Php80\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php80', - ), - 'Symfony\\Polyfill\\Php73\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-php73', - ), - 'Symfony\\Polyfill\\Mbstring\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-mbstring', - ), - 'Symfony\\Polyfill\\Intl\\Normalizer\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer', - ), - 'Symfony\\Polyfill\\Intl\\Grapheme\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme', - ), - 'Symfony\\Polyfill\\Ctype\\' => + 'MetaBox\\' => array ( - 0 => __DIR__ . '/..' . '/symfony/polyfill-ctype', - ), - 'Symfony\\Contracts\\Service\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/service-contracts', - ), - 'Symfony\\Component\\String\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/string', - ), - 'Symfony\\Component\\Finder\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/finder', - ), - 'Symfony\\Component\\Console\\' => - array ( - 0 => __DIR__ . '/..' . '/symfony/console', - ), - 'Psr\\Container\\' => - array ( - 0 => __DIR__ . '/..' . '/psr/container/src', - ), - 'League\\MimeTypeDetection\\' => - array ( - 0 => __DIR__ . '/..' . '/league/mime-type-detection/src', - ), - 'League\\Flysystem\\' => - array ( - 0 => __DIR__ . '/..' . '/league/flysystem/src', + 0 => __DIR__ . '/..' . '/wpmetabox/meta-box/src', ), 'Firebase\\JWT\\' => array ( @@ -112,10 +34,6 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb array ( 0 => __DIR__ . '/..' . '/composer/installers/src/Composer/Installers', ), - 'CoenJacobs\\Mozart\\' => - array ( - 0 => __DIR__ . '/..' . '/coenjacobs/mozart/src', - ), ); public static $prefixesPsr0 = array ( @@ -129,13 +47,7 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb ); public static $classMap = array ( - 'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php', 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'JsonException' => __DIR__ . '/..' . '/symfony/polyfill-php73/Resources/stubs/JsonException.php', - 'Normalizer' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php', - 'PhpToken' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/PhpToken.php', - 'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php', - 'UnhandledMatchError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php', 'UsabilityDynamics\\Job' => __DIR__ . '/..' . '/udx/lib-utility/lib/class-job.php', 'UsabilityDynamics\\Loader' => __DIR__ . '/..' . '/udx/lib-utility/lib/class-loader.php', 'UsabilityDynamics\\Settings' => __DIR__ . '/..' . '/udx/lib-settings/lib/class-settings.php', @@ -144,12 +56,12 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'UsabilityDynamics\\UD_API\\API' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-api.php', 'UsabilityDynamics\\UD_API\\Admin' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-admin.php', 'UsabilityDynamics\\UD_API\\Bootstrap' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-bootstrap.php', - 'UsabilityDynamics\\UD_API\\License_Checker' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-license-checker.php', 'UsabilityDynamics\\UD_API\\Licenses_Table' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-licenses-table.php', 'UsabilityDynamics\\UD_API\\Manager' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-manager.php', 'UsabilityDynamics\\UD_API\\More_Products_Table' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-more-products-table.php', 'UsabilityDynamics\\UD_API\\Scaffold' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-scaffold.php', 'UsabilityDynamics\\UD_API\\UI' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-ui.php', + 'UsabilityDynamics\\UD_API\\Update_Checker' => __DIR__ . '/..' . '/udx/lib-ud-api-client/lib/classes/class-update-checker.php', 'UsabilityDynamics\\Utility' => __DIR__ . '/..' . '/udx/lib-utility/lib/class-utility.php', 'UsabilityDynamics\\Utility\\Guid_Fix' => __DIR__ . '/..' . '/udx/lib-utility/lib/class-guid-fix.php', 'UsabilityDynamics\\WP\\Bootstrap' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php', @@ -158,27 +70,23 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'UsabilityDynamics\\WP\\Dashboard' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-dashboard.php', 'UsabilityDynamics\\WP\\Errors' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-errors.php', 'UsabilityDynamics\\WP\\Scaffold' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-scaffold.php', + 'UsabilityDynamics\\WP\\TGMPA_List_Table' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php', + 'UsabilityDynamics\\WP\\TGM_Bulk_Installer' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php', + 'UsabilityDynamics\\WP\\TGM_Bulk_Installer_Skin' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php', + 'UsabilityDynamics\\WP\\TGM_Plugin_Activation' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php', 'UsabilityDynamics\\WP\\Utility' => __DIR__ . '/..' . '/udx/lib-wp-bootstrap/lib/classes/class-utility.php', - 'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php', - 'WP_Async_Request' => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-async-request.php', - 'WP_Background_Process' => __DIR__ . '/..' . '/deliciousbrains/wp-background-processing/classes/wp-background-process.php', 'wpCloud\\StatelessMedia\\API' => __DIR__ . '/../..' . '/lib/classes/class-api.php', 'wpCloud\\StatelessMedia\\Ajax' => __DIR__ . '/../..' . '/lib/classes/class-ajax.php', + 'wpCloud\\StatelessMedia\\AppEngine' => __DIR__ . '/../..' . '/lib/classes/class-google-app-engine.php', 'wpCloud\\StatelessMedia\\Bootstrap' => __DIR__ . '/../..' . '/lib/classes/class-bootstrap.php', 'wpCloud\\StatelessMedia\\Compatibility' => __DIR__ . '/../..' . '/lib/classes/class-compatibility.php', - 'wpCloud\\StatelessMedia\\CompatibilityWooExtraProductOptions' => __DIR__ . '/../..' . '/lib/classes/compatibility/woo-extra-product-options.php', - 'wpCloud\\StatelessMedia\\DynamicImageSupport' => __DIR__ . '/../..' . '/lib/classes/compatibility/dynamic-image-support.php', + 'wpCloud\\StatelessMedia\\DynamicImageSupport' => __DIR__ . '/../..' . '/lib/classes/class-dynamic-image-support.php', 'wpCloud\\StatelessMedia\\Errors' => __DIR__ . '/../..' . '/lib/classes/class-errors.php', 'wpCloud\\StatelessMedia\\FatalException' => __DIR__ . '/../..' . '/lib/classes/exception-fatal.php', 'wpCloud\\StatelessMedia\\GS_Client' => __DIR__ . '/../..' . '/lib/classes/class-gs-client.php', - 'wpCloud\\StatelessMedia\\GoogleAppEngine' => __DIR__ . '/../..' . '/lib/classes/compatibility/google-app-engine.php', - 'wpCloud\\StatelessMedia\\Imagify' => __DIR__ . '/../..' . '/lib/classes/compatibility/imagify.php', 'wpCloud\\StatelessMedia\\Logger' => __DIR__ . '/../..' . '/lib/classes/class-logger.php', 'wpCloud\\StatelessMedia\\Module' => __DIR__ . '/../..' . '/lib/classes/class-module.php', - 'wpCloud\\StatelessMedia\\SOCSS' => __DIR__ . '/../..' . '/lib/classes/compatibility/siteorigin-css.php', - 'wpCloud\\StatelessMedia\\SOWidgetCSS' => __DIR__ . '/../..' . '/lib/classes/compatibility/siteorigin-widget-bundle.php', 'wpCloud\\StatelessMedia\\Settings' => __DIR__ . '/../..' . '/lib/classes/class-settings.php', - 'wpCloud\\StatelessMedia\\ShortPixel' => __DIR__ . '/../..' . '/lib/classes/compatibility/shortpixel.php', 'wpCloud\\StatelessMedia\\Singleton' => __DIR__ . '/../..' . '/lib/classes/trait-singleton.php', 'wpCloud\\StatelessMedia\\StreamWrapper' => __DIR__ . '/../..' . '/lib/classes/class-gs-stream-wrapper.php', 'wpCloud\\StatelessMedia\\SyncNonMedia' => __DIR__ . '/../..' . '/lib/classes/class-sync-non-media.php', @@ -192,12 +100,6 @@ class ComposerStaticInitc59d002476a452800baaf79c430753cb 'wpCloud\\StatelessMedia\\UnprocessableException' => __DIR__ . '/../..' . '/lib/classes/exception-unprocessable.php', 'wpCloud\\StatelessMedia\\Upgrader' => __DIR__ . '/../..' . '/lib/classes/class-upgrader.php', 'wpCloud\\StatelessMedia\\Utility' => __DIR__ . '/../..' . '/lib/classes/class-utility.php', - 'wpCloud\\StatelessMedia\\VidoRev' => __DIR__ . '/../..' . '/lib/classes/compatibility/vidorev.php', - 'wpCloud\\StatelessMedia\\WPBakeryPageBuilder' => __DIR__ . '/../..' . '/lib/classes/compatibility/wpbakery-page-builder.php', - 'wpCloud\\StatelessMedia\\WPForms' => __DIR__ . '/../..' . '/lib/classes/compatibility/wpforms.php', - 'wpCloud\\StatelessMedia\\WPRetina2x' => __DIR__ . '/../..' . '/lib/classes/compatibility/wp-retina-2x.php', - 'wpCloud\\StatelessMedia\\WPSmush' => __DIR__ . '/../..' . '/lib/classes/compatibility/wp-smush.php', - 'wpCloud\\StatelessMedia\\WooCommerce' => __DIR__ . '/../..' . '/lib/classes/compatibility/woocommerce.php', ); public static function getInitializer(ClassLoader $loader) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index d1abce28a..1dc71e802 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -46,1412 +46,221 @@ ], "install-path": "../ccampbell/chromephp" }, - { - "name": "coenjacobs/mozart", - "version": "0.7.1", - "version_normalized": "0.7.1.0", - "source": { - "type": "git", - "url": "https://github.com/coenjacobs/mozart.git", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/coenjacobs/mozart/zipball/dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "reference": "dbcdeb992d20d9c8914eef090f9a0d684bb1102c", - "shasum": "" - }, - "require": { - "league/flysystem": "^1.0", - "php": "^7.3|^8.0", - "symfony/console": "^4|^5", - "symfony/finder": "^4|^5" - }, - "require-dev": { - "mheap/phpunit-github-actions-printer": "^1.4", - "phpunit/phpunit": "^8.5", - "squizlabs/php_codesniffer": "^3.5", - "vimeo/psalm": "^4.4" - }, - "time": "2021-02-02T21:37:03+00:00", - "bin": [ - "bin/mozart" - ], - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "CoenJacobs\\Mozart\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Coen Jacobs", - "email": "coenjacobs@gmail.com" - } - ], - "description": "Composes all dependencies as a package inside a WordPress plugin", - "funding": [ - { - "url": "https://github.com/coenjacobs", - "type": "github" - } - ], - "install-path": "../coenjacobs/mozart" - }, { "name": "composer/installers", "version": "v1.12.0", "version_normalized": "1.12.0.0", "source": { "type": "git", - "url": "https://github.com/composer/installers.git", - "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", - "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0" - }, - "replace": { - "roundcube/plugin-installer": "*", - "shama/baton": "*" - }, - "require-dev": { - "composer/composer": "1.6.* || ^2.0", - "composer/semver": "^1 || ^3", - "phpstan/phpstan": "^0.12.55", - "phpstan/phpstan-phpunit": "^0.12.16", - "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.3" - }, - "time": "2021-09-13T08:19:44+00:00", - "type": "composer-plugin", - "extra": { - "class": "Composer\\Installers\\Plugin", - "branch-alias": { - "dev-main": "1.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Composer\\Installers\\": "src/Composer/Installers" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Kyle Robinson Young", - "email": "kyle@dontkry.com", - "homepage": "https://github.com/shama" - } - ], - "description": "A multi-framework Composer library installer", - "homepage": "https://composer.github.io/installers/", - "keywords": [ - "Craft", - "Dolibarr", - "Eliasis", - "Hurad", - "ImageCMS", - "Kanboard", - "Lan Management System", - "MODX Evo", - "MantisBT", - "Mautic", - "Maya", - "OXID", - "Plentymarkets", - "Porto", - "RadPHP", - "SMF", - "Starbug", - "Thelia", - "Whmcs", - "WolfCMS", - "agl", - "aimeos", - "annotatecms", - "attogram", - "bitrix", - "cakephp", - "chef", - "cockpit", - "codeigniter", - "concrete5", - "croogo", - "dokuwiki", - "drupal", - "eZ Platform", - "elgg", - "expressionengine", - "fuelphp", - "grav", - "installer", - "itop", - "joomla", - "known", - "kohana", - "laravel", - "lavalite", - "lithium", - "magento", - "majima", - "mako", - "mediawiki", - "miaoxing", - "modulework", - "modx", - "moodle", - "osclass", - "pantheon", - "phpbb", - "piwik", - "ppi", - "processwire", - "puppet", - "pxcms", - "reindex", - "roundcube", - "shopware", - "silverstripe", - "sydes", - "sylius", - "symfony", - "tastyigniter", - "typo3", - "wordpress", - "yawik", - "zend", - "zikula" - ], - "funding": [ - { - "url": "https://packagist.com", - "type": "custom" - }, - { - "url": "https://github.com/composer", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/composer/composer", - "type": "tidelift" - } - ], - "install-path": "./installers" - }, - { - "name": "deliciousbrains/wp-background-processing", - "version": "1.1.0", - "version_normalized": "1.1.0.0", - "source": { - "type": "git", - "url": "https://github.com/deliciousbrains/wp-background-processing.git", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/deliciousbrains/wp-background-processing/zipball/d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", - "reference": "d5ef95cecba7f792ddca3e3bd70ebfb90dc4996d", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpcompatibility/phpcompatibility-wp": "*", - "phpunit/phpunit": "^8.0", - "spryker/code-sniffer": "^0.17.18", - "wp-coding-standards/wpcs": "^2.3", - "yoast/phpunit-polyfills": "^1.0" - }, - "suggest": { - "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library" - }, - "time": "2023-04-18T12:32:25+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "classes/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "GPL-2.0-or-later" - ], - "authors": [ - { - "name": "Delicious Brains", - "email": "nom@deliciousbrains.com" - } - ], - "description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.", - "install-path": "../deliciousbrains/wp-background-processing" - }, - { - "name": "firebase/php-jwt", - "version": "v6.6.0", - "version_normalized": "6.6.0.0", - "source": { - "type": "git", - "url": "https://github.com/firebase/php-jwt.git", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/firebase/php-jwt/zipball/5a9cf79b4a2eb347230384648cc7b0d68cd97faa", - "reference": "5a9cf79b4a2eb347230384648cc7b0d68cd97faa", - "shasum": "" - }, - "require": { - "php": "^7.4||^8.0" - }, - "require-dev": { - "guzzlehttp/guzzle": "^6.5||^7.4", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "psr/cache": "^1.0||^2.0", - "psr/http-client": "^1.0", - "psr/http-factory": "^1.0" - }, - "suggest": { - "ext-sodium": "Support EdDSA (Ed25519) signatures", - "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" - }, - "time": "2023-06-13T17:11:06+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Firebase\\JWT\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Neuman Vong", - "email": "neuman+pear@twilio.com", - "role": "Developer" - }, - { - "name": "Anant Narayanan", - "email": "anant@php.net", - "role": "Developer" - } - ], - "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", - "homepage": "https://github.com/firebase/php-jwt", - "keywords": [ - "jwt", - "php" - ], - "install-path": "../firebase/php-jwt" - }, - { - "name": "league/flysystem", - "version": "1.1.10", - "version_normalized": "1.1.10.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/flysystem.git", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", - "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "league/mime-type-detection": "^1.3", - "php": "^7.2.5 || ^8.0" - }, - "conflict": { - "league/flysystem-sftp": "<1.0.6" - }, - "require-dev": { - "phpspec/prophecy": "^1.11.1", - "phpunit/phpunit": "^8.5.8" - }, - "suggest": { - "ext-ftp": "Allows you to use FTP server storage", - "ext-openssl": "Allows you to use FTPS server storage", - "league/flysystem-aws-s3-v2": "Allows you to use S3 storage with AWS SDK v2", - "league/flysystem-aws-s3-v3": "Allows you to use S3 storage with AWS SDK v3", - "league/flysystem-azure": "Allows you to use Windows Azure Blob storage", - "league/flysystem-cached-adapter": "Flysystem adapter decorator for metadata caching", - "league/flysystem-eventable-filesystem": "Allows you to use EventableFilesystem", - "league/flysystem-rackspace": "Allows you to use Rackspace Cloud Files", - "league/flysystem-sftp": "Allows you to use SFTP server storage via phpseclib", - "league/flysystem-webdav": "Allows you to use WebDAV storage", - "league/flysystem-ziparchive": "Allows you to use ZipArchive adapter", - "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", - "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" - }, - "time": "2022-10-04T09:16:37+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\Flysystem\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frenky.net" - } - ], - "description": "Filesystem abstraction: Many filesystems, one API.", - "keywords": [ - "Cloud Files", - "WebDAV", - "abstraction", - "aws", - "cloud", - "copy.com", - "dropbox", - "file systems", - "files", - "filesystem", - "filesystems", - "ftp", - "rackspace", - "remote", - "s3", - "sftp", - "storage" - ], - "funding": [ - { - "url": "https://offset.earth/frankdejonge", - "type": "other" - } - ], - "install-path": "../league/flysystem" - }, - { - "name": "league/mime-type-detection", - "version": "1.11.0", - "version_normalized": "1.11.0.0", - "source": { - "type": "git", - "url": "https://github.com/thephpleague/mime-type-detection.git", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/thephpleague/mime-type-detection/zipball/ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "reference": "ff6248ea87a9f116e78edd6002e39e5128a0d4dd", - "shasum": "" - }, - "require": { - "ext-fileinfo": "*", - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^3.2", - "phpstan/phpstan": "^0.12.68", - "phpunit/phpunit": "^8.5.8 || ^9.3" - }, - "time": "2022-04-17T13:12:02+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "description": "Mime-type detection for Flysystem", - "funding": [ - { - "url": "https://github.com/frankdejonge", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/league/flysystem", - "type": "tidelift" - } - ], - "install-path": "../league/mime-type-detection" - }, - { - "name": "psr/container", - "version": "2.0.2", - "version_normalized": "2.0.2.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "shasum": "" - }, - "require": { - "php": ">=7.4.0" - }, - "time": "2021-11-05T16:47:00+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "install-path": "../psr/container" - }, - { - "name": "symfony/console", - "version": "v5.4.24", - "version_normalized": "5.4.24.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/console.git", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "reference": "560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "require-dev": { - "psr/log": "^1|^2", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" - }, - "time": "2023-05-26T05:13:16+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Console\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Eases the creation of beautiful and testable command line interfaces", - "homepage": "https://symfony.com", - "keywords": [ - "cli", - "command-line", - "console", - "terminal" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/console" - }, - { - "name": "symfony/deprecation-contracts", - "version": "v3.3.0", - "version_normalized": "3.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", - "shasum": "" - }, - "require": { - "php": ">=8.1" - }, - "time": "2023-05-23T14:45:45+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "function.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/deprecation-contracts" - }, - { - "name": "symfony/finder", - "version": "v5.4.21", - "version_normalized": "5.4.21.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/078e9a5e1871fcfe6a5ce421b539344c21afef19", - "reference": "078e9a5e1871fcfe6a5ce421b539344c21afef19", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "time": "2023-02-16T09:33:00+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Finds files and directories via an intuitive fluent interface", - "homepage": "https://symfony.com", - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/finder" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/5bbc823adecdae860bb64756d639ecfec17b050a", - "reference": "5bbc823adecdae860bb64756d639ecfec17b050a", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-ctype" - }, - { - "name": "symfony/polyfill-intl-grapheme", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/511a08c03c1960e08a883f4cffcacd219b758354", - "reference": "511a08c03c1960e08a883f4cffcacd219b758354", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Grapheme\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's grapheme_* functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "grapheme", - "intl", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-grapheme" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "reference": "19bd1e4fcd5b91116f14d8533c57831ed00571b6", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-intl-normalizer" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "reference": "8ad114f6b39e2c98a8b0e3bd907732c207c2b534", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-mbstring" - }, - { - "name": "symfony/polyfill-php73", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9" + "url": "https://github.com/composer/installers.git", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/9e8ecb5f92152187c4799efd3c96b78ccab18ff9", - "reference": "9e8ecb5f92152187c4799efd3c96b78ccab18ff9", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", "shasum": "" }, "require": { - "php": ">=7.1" - }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "installation-source": "dist", - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php73\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php73" - }, - { - "name": "symfony/polyfill-php80", - "version": "v1.27.0", - "version_normalized": "1.27.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936" + "composer-plugin-api": "^1.0 || ^2.0" }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "reference": "7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936", - "shasum": "" + "replace": { + "roundcube/plugin-installer": "*", + "shama/baton": "*" }, - "require": { - "php": ">=7.1" + "require-dev": { + "composer/composer": "1.6.* || ^2.0", + "composer/semver": "^1 || ^3", + "phpstan/phpstan": "^0.12.55", + "phpstan/phpstan-phpunit": "^0.12.16", + "symfony/phpunit-bridge": "^4.2 || ^5", + "symfony/process": "^2.3" }, - "time": "2022-11-03T14:55:06+00:00", - "type": "library", + "time": "2021-09-13T08:19:44+00:00", + "type": "composer-plugin", "extra": { + "class": "Composer\\Installers\\Plugin", "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "dev-main": "1.x-dev" } }, "installation-source": "dist", "autoload": { - "files": [ - "bootstrap.php" - ], "psr-4": { - "Symfony\\Polyfill\\Php80\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "install-path": "../symfony/polyfill-php80" - }, - { - "name": "symfony/service-contracts", - "version": "v3.3.0", - "version_normalized": "3.3.0.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/service-contracts.git", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "reference": "40da9cc13ec349d9e4966ce18b5fbcd724ab10a4", - "shasum": "" - }, - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "time": "2023-05-23T14:45:45+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "Composer\\Installers\\": "src/Composer/Installers" } }, - "installation-source": "dist", - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Service\\": "" - }, - "exclude-from-classmap": [ - "/Test/" - ] - }, "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Kyle Robinson Young", + "email": "kyle@dontkry.com", + "homepage": "https://github.com/shama" } ], - "description": "Generic abstractions related to writing services", - "homepage": "https://symfony.com", + "description": "A multi-framework Composer library installer", + "homepage": "https://composer.github.io/installers/", "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" + "Craft", + "Dolibarr", + "Eliasis", + "Hurad", + "ImageCMS", + "Kanboard", + "Lan Management System", + "MODX Evo", + "MantisBT", + "Mautic", + "Maya", + "OXID", + "Plentymarkets", + "Porto", + "RadPHP", + "SMF", + "Starbug", + "Thelia", + "Whmcs", + "WolfCMS", + "agl", + "aimeos", + "annotatecms", + "attogram", + "bitrix", + "cakephp", + "chef", + "cockpit", + "codeigniter", + "concrete5", + "croogo", + "dokuwiki", + "drupal", + "eZ Platform", + "elgg", + "expressionengine", + "fuelphp", + "grav", + "installer", + "itop", + "joomla", + "known", + "kohana", + "laravel", + "lavalite", + "lithium", + "magento", + "majima", + "mako", + "mediawiki", + "miaoxing", + "modulework", + "modx", + "moodle", + "osclass", + "pantheon", + "phpbb", + "piwik", + "ppi", + "processwire", + "puppet", + "pxcms", + "reindex", + "roundcube", + "shopware", + "silverstripe", + "sydes", + "sylius", + "symfony", + "tastyigniter", + "typo3", + "wordpress", + "yawik", + "zend", + "zikula" ], "funding": [ { - "url": "https://symfony.com/sponsor", + "url": "https://packagist.com", "type": "custom" }, { - "url": "https://github.com/fabpot", + "url": "https://github.com/composer", "type": "github" }, { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "install-path": "../symfony/service-contracts" + "install-path": "./installers" }, { - "name": "symfony/string", - "version": "v6.3.0", - "version_normalized": "6.3.0.0", + "name": "firebase/php-jwt", + "version": "v6.9.0", + "version_normalized": "6.9.0.0", "source": { "type": "git", - "url": "https://github.com/symfony/string.git", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f" + "url": "https://github.com/firebase/php-jwt.git", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/f2e190ee75ff0f5eced645ec0be5c66fac81f51f", - "reference": "f2e190ee75ff0f5eced645ec0be5c66fac81f51f", + "url": "https://api.github.com/repos/firebase/php-jwt/zipball/f03270e63eaccf3019ef0f32849c497385774e11", + "reference": "f03270e63eaccf3019ef0f32849c497385774e11", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" + "php": "^7.4||^8.0" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "guzzlehttp/guzzle": "^6.5||^7.4", + "phpspec/prophecy-phpunit": "^2.0", + "phpunit/phpunit": "^9.5", + "psr/cache": "^1.0||^2.0", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-sodium": "Support EdDSA (Ed25519) signatures", + "paragonie/sodium_compat": "Support EdDSA (Ed25519) signatures when libsodium is not present" }, - "time": "2023-03-21T21:06:29+00:00", + "time": "2023-10-05T00:24:42+00:00", "type": "library", "installation-source": "dist", "autoload": { - "files": [ - "Resources/functions.php" - ], "psr-4": { - "Symfony\\Component\\String\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] + "Firebase\\JWT\\": "src" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" + "name": "Neuman Vong", + "email": "neuman+pear@twilio.com", + "role": "Developer" }, { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" + "name": "Anant Narayanan", + "email": "anant@php.net", + "role": "Developer" } ], - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "homepage": "https://symfony.com", + "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", + "homepage": "https://github.com/firebase/php-jwt", "keywords": [ - "grapheme", - "i18n", - "string", - "unicode", - "utf-8", - "utf8" - ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } + "jwt", + "php" ], - "install-path": "../symfony/string" + "support": { + "issues": "https://github.com/firebase/php-jwt/issues", + "source": "https://github.com/firebase/php-jwt/tree/v6.9.0" + }, + "install-path": "../firebase/php-jwt" }, { "name": "udx/lib-settings", @@ -1464,8 +273,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip", - "reference": "0.3.0" + "url": "https://github.com/udx/lib-settings/archive/0.3.0.zip" }, "require": { "udx/lib-utility": "~0.3" @@ -1534,8 +342,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip", - "reference": "1.2.1" + "url": "https://github.com/udx/lib-ud-api-client/archive/1.2.1.zip" }, "require": { "php": ">=5.3" @@ -1581,8 +388,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip", - "reference": "0.4.0" + "url": "https://github.com/udx/lib-utility/archive/0.4.0.zip" }, "require-dev": { "phpunit/phpunit": "4.1.*" @@ -1644,8 +450,7 @@ }, "dist": { "type": "zip", - "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip", - "reference": "1.3.0" + "url": "https://github.com/udx/lib-wp-bootstrap/archive/1.3.0.zip" }, "require": { "php": ">=5.3", @@ -1673,22 +478,27 @@ }, { "name": "wpmetabox/meta-box", - "version": "5.6.3", - "version_normalized": "5.6.3.0", + "version": "5.8.2", + "version_normalized": "5.8.2.0", "source": { "type": "git", "url": "https://github.com/wpmetabox/meta-box.git", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856" + "reference": "de583a74171bdee1b5213232a5bf50f82c6fee14" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/c2c4a30ed70163dfdfe93f2865e88a7a45c46856", - "reference": "c2c4a30ed70163dfdfe93f2865e88a7a45c46856", + "url": "https://api.github.com/repos/wpmetabox/meta-box/zipball/de583a74171bdee1b5213232a5bf50f82c6fee14", + "reference": "de583a74171bdee1b5213232a5bf50f82c6fee14", "shasum": "" }, - "time": "2022-04-18T03:20:58+00:00", + "time": "2023-10-13T13:53:33+00:00", "type": "wordpress-plugin", "installation-source": "dist", + "autoload": { + "psr-4": { + "MetaBox\\": "src/" + } + }, "notification-url": "https://packagist.org/downloads/", "license": [ "GPL-2.0" @@ -1712,26 +522,13 @@ "wordpress-plugin", "wp-admin" ], + "support": { + "issues": "https://github.com/wpmetabox/meta-box/issues", + "source": "https://github.com/wpmetabox/meta-box/tree/5.8.2" + }, "install-path": "../wpmetabox/meta-box" } ], - "dev": true, - "dev-package-names": [ - "coenjacobs/mozart", - "deliciousbrains/wp-background-processing", - "league/flysystem", - "league/mime-type-detection", - "psr/container", - "symfony/console", - "symfony/deprecation-contracts", - "symfony/finder", - "symfony/polyfill-ctype", - "symfony/polyfill-intl-grapheme", - "symfony/polyfill-intl-normalizer", - "symfony/polyfill-mbstring", - "symfony/polyfill-php73", - "symfony/polyfill-php80", - "symfony/service-contracts", - "symfony/string" - ] + "dev": false, + "dev-package-names": [] } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 301196736..896b9976c 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,13 +1,13 @@ array( 'name' => 'wpcloud/wp-stateless', - 'pretty_version' => 'dev-latest', - 'version' => 'dev-latest', - 'reference' => '642420f5fd4f9c33c4e07bc1de46107e7d2108ad', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '6526bd59264ab37e0336fb0abf27eea93eaa73ab', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'dev' => true, + 'dev' => false, ), 'versions' => array( 'ccampbell/chromephp' => array( @@ -19,15 +19,6 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'coenjacobs/mozart' => array( - 'pretty_version' => '0.7.1', - 'version' => '0.7.1.0', - 'reference' => 'dbcdeb992d20d9c8914eef090f9a0d684bb1102c', - 'type' => 'library', - 'install_path' => __DIR__ . '/../coenjacobs/mozart', - 'aliases' => array(), - 'dev_requirement' => true, - ), 'composer/installers' => array( 'pretty_version' => 'v1.12.0', 'version' => '1.12.0.0', @@ -37,57 +28,15 @@ 'aliases' => array(), 'dev_requirement' => false, ), - 'deliciousbrains/wp-background-processing' => array( - 'pretty_version' => '1.1.0', - 'version' => '1.1.0.0', - 'reference' => 'd5ef95cecba7f792ddca3e3bd70ebfb90dc4996d', - 'type' => 'library', - 'install_path' => __DIR__ . '/../deliciousbrains/wp-background-processing', - 'aliases' => array(), - 'dev_requirement' => true, - ), 'firebase/php-jwt' => array( - 'pretty_version' => 'v6.6.0', - 'version' => '6.6.0.0', - 'reference' => '5a9cf79b4a2eb347230384648cc7b0d68cd97faa', + 'pretty_version' => 'v6.9.0', + 'version' => '6.9.0.0', + 'reference' => 'f03270e63eaccf3019ef0f32849c497385774e11', 'type' => 'library', 'install_path' => __DIR__ . '/../firebase/php-jwt', 'aliases' => array(), 'dev_requirement' => false, ), - 'league/flysystem' => array( - 'pretty_version' => '1.1.10', - 'version' => '1.1.10.0', - 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/flysystem', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'league/mime-type-detection' => array( - 'pretty_version' => '1.11.0', - 'version' => '1.11.0.0', - 'reference' => 'ff6248ea87a9f116e78edd6002e39e5128a0d4dd', - 'type' => 'library', - 'install_path' => __DIR__ . '/../league/mime-type-detection', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/container' => array( - 'pretty_version' => '2.0.2', - 'version' => '2.0.2.0', - 'reference' => 'c71ecc56dfe541dbd90c5360474fbc405f8d5963', - 'type' => 'library', - 'install_path' => __DIR__ . '/../psr/container', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'psr/log-implementation' => array( - 'dev_requirement' => true, - 'provided' => array( - 0 => '1.0|2.0', - ), - ), 'roundcube/plugin-installer' => array( 'dev_requirement' => false, 'replaced' => array( @@ -100,105 +49,6 @@ 0 => '*', ), ), - 'symfony/console' => array( - 'pretty_version' => 'v5.4.24', - 'version' => '5.4.24.0', - 'reference' => '560fc3ed7a43e6d30ea94a07d77f9a60b8ed0fb8', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/console', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/deprecation-contracts' => array( - 'pretty_version' => 'v3.3.0', - 'version' => '3.3.0.0', - 'reference' => '7c3aff79d10325257a001fcf92d991f24fc967cf', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/deprecation-contracts', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/finder' => array( - 'pretty_version' => 'v5.4.21', - 'version' => '5.4.21.0', - 'reference' => '078e9a5e1871fcfe6a5ce421b539344c21afef19', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/finder', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-ctype' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '5bbc823adecdae860bb64756d639ecfec17b050a', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-ctype', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-intl-grapheme' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '511a08c03c1960e08a883f4cffcacd219b758354', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-intl-normalizer' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '19bd1e4fcd5b91116f14d8533c57831ed00571b6', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-mbstring' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '8ad114f6b39e2c98a8b0e3bd907732c207c2b534', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-php73' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '9e8ecb5f92152187c4799efd3c96b78ccab18ff9', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php73', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/polyfill-php80' => array( - 'pretty_version' => 'v1.27.0', - 'version' => '1.27.0.0', - 'reference' => '7a6ff3f1959bb01aefccb463a0f2cd3d3d2fd936', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/polyfill-php80', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/service-contracts' => array( - 'pretty_version' => 'v3.3.0', - 'version' => '3.3.0.0', - 'reference' => '40da9cc13ec349d9e4966ce18b5fbcd724ab10a4', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/service-contracts', - 'aliases' => array(), - 'dev_requirement' => true, - ), - 'symfony/string' => array( - 'pretty_version' => 'v6.3.0', - 'version' => '6.3.0.0', - 'reference' => 'f2e190ee75ff0f5eced645ec0be5c66fac81f51f', - 'type' => 'library', - 'install_path' => __DIR__ . '/../symfony/string', - 'aliases' => array(), - 'dev_requirement' => true, - ), 'udx/lib-settings' => array( 'pretty_version' => '0.3.0', 'version' => '0.3.0.0', @@ -236,18 +86,18 @@ 'dev_requirement' => false, ), 'wpcloud/wp-stateless' => array( - 'pretty_version' => 'dev-latest', - 'version' => 'dev-latest', - 'reference' => '642420f5fd4f9c33c4e07bc1de46107e7d2108ad', + 'pretty_version' => 'dev-master', + 'version' => 'dev-master', + 'reference' => '6526bd59264ab37e0336fb0abf27eea93eaa73ab', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'wpmetabox/meta-box' => array( - 'pretty_version' => '5.6.3', - 'version' => '5.6.3.0', - 'reference' => 'c2c4a30ed70163dfdfe93f2865e88a7a45c46856', + 'pretty_version' => '5.8.2', + 'version' => '5.8.2.0', + 'reference' => 'de583a74171bdee1b5213232a5bf50f82c6fee14', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../wpmetabox/meta-box', 'aliases' => array(), diff --git a/vendor/deliciousbrains/wp-background-processing/.circleci/config.yml b/vendor/deliciousbrains/wp-background-processing/.circleci/config.yml deleted file mode 100644 index 212e51cee..000000000 --- a/vendor/deliciousbrains/wp-background-processing/.circleci/config.yml +++ /dev/null @@ -1,93 +0,0 @@ -workflows: - version: 2 - main: - jobs: - - php72-build - - php73-build - - php74-build - - php80-build - -version: 2 - -job-references: - mysql_image: &mysql_image - cimg/mysql:5.7 - - setup_environment: &setup_environment - name: "Setup Environment Variables" - command: | - echo "export PATH=$HOME/.composer/vendor/bin:$PATH" >> $BASH_ENV - source /home/circleci/.bashrc - - install_dependencies: &install_dependencies - name: "Install Dependencies" - command: | - sudo apt-get update && sudo apt-get install mysql-client subversion - - php_job: &php_job - environment: - - WP_TESTS_DIR: "/tmp/wordpress-tests-lib" - - WP_CORE_DIR: "/tmp/wordpress/" - steps: - - checkout - - run: php --version - - run: composer --version - - run: *setup_environment - - run: *install_dependencies - - run: - name: "Run Tests" - command: | - rm -rf $WP_TESTS_DIR $WP_CORE_DIR - bash bin/install-wp-tests.sh wordpress_test root '' 127.0.0.1 latest - make test-unit - WP_MULTISITE=1 make test-unit - make test-style - -jobs: - php56-build: - <<: *php_job - docker: - - image: cimg/php:5.6 - - image: *mysql_image - - php70-build: - <<: *php_job - docker: - - image: cimg/php:7.0 - - image: *mysql_image - - php71-build: - <<: *php_job - docker: - - image: cimg/php:7.1 - - image: *mysql_image - - php72-build: - <<: *php_job - docker: - - image: cimg/php:7.2 - - image: *mysql_image - - php73-build: - <<: *php_job - docker: - - image: cimg/php:7.3 - - image: *mysql_image - - php74-build: - <<: *php_job - docker: - - image: cimg/php:7.4 - - image: *mysql_image - - php80-build: - <<: *php_job - docker: - - image: cimg/php:8.0 - - image: *mysql_image - - php81-build: - <<: *php_job - docker: - - image: cimg/php:8.1 - - image: *mysql_image diff --git a/vendor/deliciousbrains/wp-background-processing/.gitignore b/vendor/deliciousbrains/wp-background-processing/.gitignore deleted file mode 100644 index 23505a971..000000000 --- a/vendor/deliciousbrains/wp-background-processing/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/vendor/ -/.idea -*.cache diff --git a/vendor/deliciousbrains/wp-background-processing/.phpcs.xml b/vendor/deliciousbrains/wp-background-processing/.phpcs.xml deleted file mode 100644 index c082481f4..000000000 --- a/vendor/deliciousbrains/wp-background-processing/.phpcs.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - Generally-applicable sniffs for WordPress plugins. - - - . - /vendor/ - /node_modules/ - /tests/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/vendor/deliciousbrains/wp-background-processing/Makefile b/vendor/deliciousbrains/wp-background-processing/Makefile deleted file mode 100644 index 7ad63b81d..000000000 --- a/vendor/deliciousbrains/wp-background-processing/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -.PHONY: test -test: test-unit test-style - -.PHONY: test-unit -test-unit: vendor - vendor/bin/phpunit - -.PHONY: test-style -test-style: vendor - vendor/bin/phpcs - -vendor: composer.json - composer install --ignore-platform-reqs - -.PHONY: clean -clean: - rm -rf vendor - rm -f tests/.phpunit.result.cache diff --git a/vendor/deliciousbrains/wp-background-processing/README.md b/vendor/deliciousbrains/wp-background-processing/README.md deleted file mode 100644 index 923e129d9..000000000 --- a/vendor/deliciousbrains/wp-background-processing/README.md +++ /dev/null @@ -1,376 +0,0 @@ -# WP Background Processing - -WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks. Check out the [example plugin](https://github.com/A5hleyRich/wp-background-processing-example) or read the [accompanying article](https://deliciousbrains.com/background-processing-wordpress/). - -Inspired by [TechCrunch WP Asynchronous Tasks](https://github.com/techcrunch/wp-async-task). - -__Requires PHP 5.6+__ - -## Install - -The recommended way to install this library in your project is by loading it through Composer: - -```shell -composer require deliciousbrains/wp-background-processing -``` - -It is highly recommended to prefix wrap the library class files using [the Mozart package](https://packagist.org/packages/coenjacobs/mozart), to prevent collisions with other projects using this same library. - -## Usage - -### Async Request - -Async requests are useful for pushing slow one-off tasks such as sending emails to a background process. Once the request has been dispatched it will process in the background instantly. - -Extend the `WP_Async_Request` class: - -```php -class WP_Example_Request extends WP_Async_Request { - - /** - * @var string - */ - protected $prefix = 'my_plugin'; - - /** - * @var string - */ - protected $action = 'example_request'; - - /** - * Handle a dispatched request. - * - * Override this method to perform any actions required - * during the async request. - */ - protected function handle() { - // Actions to perform. - } - -} -``` - -#### `protected $prefix` - -Should be set to a unique prefix associated with your plugin, theme, or site's custom function prefix. - -#### `protected $action` - -Should be set to a unique name. - -#### `protected function handle()` - -Should contain any logic to perform during the non-blocking request. The data passed to the request will be accessible via `$_POST`. - -#### Dispatching Requests - -Instantiate your request: - -```php -$this->example_request = new WP_Example_Request(); -``` - -Add data to the request if required: - -```php -$this->example_request->data( array( 'value1' => $value1, 'value2' => $value2 ) ); -``` - -Fire off the request: - -```php -$this->example_request->dispatch(); -``` - -Chaining is also supported: - -```php -$this->example_request->data( array( 'data' => $data ) )->dispatch(); -``` - -### Background Process - -Background processes work in a similar fashion to async requests, but they allow you to queue tasks. Items pushed onto the queue will be processed in the background once the queue has been saved and dispatched. Queues will also scale based on available server resources, so higher end servers will process more items per batch. Once a batch has completed, the next batch will start instantly. - -Health checks run by default every 5 minutes to ensure the queue is running when queued items exist. If the queue has failed it will be restarted. - -Queues work on a first in first out basis, which allows additional items to be pushed to the queue even if it’s already processing. Saving a new batch of queued items and dispatching while another background processing instance is already running will result in the dispatch shortcutting out and the existing instance eventually picking up the new items and processing them when it is their turn. - -Extend the `WP_Background_Process` class: - -```php -class WP_Example_Process extends WP_Background_Process { - - /** - * @var string - */ - protected $prefix = 'my_plugin'; - - /** - * @var string - */ - protected $action = 'example_process'; - - /** - * Perform task with queued item. - * - * Override this method to perform any actions required on each - * queue item. Return the modified item for further processing - * in the next pass through. Or, return false to remove the - * item from the queue. - * - * @param mixed $item Queue item to iterate over. - * - * @return mixed - */ - protected function task( $item ) { - // Actions to perform. - - return false; - } - - /** - * Complete processing. - * - * Override if applicable, but ensure that the below actions are - * performed, or, call parent::complete(). - */ - protected function complete() { - parent::complete(); - - // Show notice to user or perform some other arbitrary task... - } - -} -``` - -#### `protected $prefix` - -Should be set to a unique prefix associated with your plugin, theme, or site's custom function prefix. - -#### `protected $action` - -Should be set to a unique name. - -#### `protected function task( $item )` - -Should contain any logic to perform on the queued item. Return `false` to remove the item from the queue or return `$item` to push it back onto the queue for further processing. If the item has been modified and is pushed back onto the queue the current state will be saved before the batch is exited. - -#### `protected function complete()` - -Optionally contain any logic to perform once the queue has completed. - -#### Dispatching Processes - -Instantiate your process: - -```php -$this->example_process = new WP_Example_Process(); -``` - -**Note:** You must instantiate your process unconditionally. All requests should do this, even if nothing is pushed to the queue. - -Push items to the queue: - -```php -foreach ( $items as $item ) { - $this->example_process->push_to_queue( $item ); -} -``` - -Save and dispatch the queue: - -```php -$this->example_process->save()->dispatch(); -``` - -#### Background Process Status - -A background process can be queued, processing, paused, cancelled, or none of the above (not started or has completed). - -##### Queued - -To check whether a background process has queued items use `is_queued()`. - -```php -if ( $this->example_process->is_queued() ) { - // Do something because background process has queued items, e.g. add notice in admin UI. -} -``` - -##### Processing - -To check whether a background process is currently handling a queue of items use `is_processing()`. - -```php -if ( $this->example_process->is_processing() ) { - // Do something because background process is running, e.g. add notice in admin UI. -} -``` - -##### Paused - -You can pause a background process with `pause()`. - -```php -$this->example_process->pause(); -``` - -The currently processing batch will continue until it either completes or reaches the time or memory limit. At that point it'll unlock the process and either complete the batch if the queue is empty, or perform a dispatch that will result in the handler removing the healthcheck cron and firing a "paused" action. - -To check whether a background process is currently paused use `is_paused()`. - -```php -if ( $this->example_process->is_paused() ) { - // Do something because background process is paused, e.g. add notice in admin UI. -} -``` - -You can perform an action in response to background processing being paused by handling the "paused" action for the background process's identifier ($prefix + $action). - -```php -add_action( 'my_plugin_example_process_paused', function() { - // Do something because background process is paused, e.g. add notice in admin UI. -}); -``` - -You can resume a background process with `resume()`. - -```php -$this->example_process->resume(); -``` - -You can perform an action in response to background processing being resumed by handling the "resumed" action for the background process's identifier ($prefix + $action). - -```php -add_action( 'my_plugin_example_process_resumed', function() { - // Do something because background process is resumed, e.g. add notice in admin UI. -}); -``` - -##### Cancelled - -You can cancel a background process with `cancel()`. - -```php -$this->example_process->cancel(); -``` - -The currently processing batch will continue until it either completes or reaches the time or memory limit. At that point it'll unlock the process and either complete the batch if the queue is empty, or perform a dispatch that will result in the handler removing the healthcheck cron, deleting all batches of queued items and firing a "cancelled" action. - -To check whether a background process is currently cancelled use `is_cancelled()`. - -```php -if ( $this->example_process->is_cancelled() ) { - // Do something because background process is cancelled, e.g. add notice in admin UI. -} -``` - -You can perform an action in response to background processing being cancelled by handling the "cancelled" action for the background process's identifier ($prefix + $action). - -```php -add_action( 'my_plugin_example_process_cancelled', function() { - // Do something because background process is paused, e.g. add notice in admin UI. -}); -``` - -The "cancelled" action fires once the queue has been cleared down and cancelled status removed. After which `is_cancelled()` will no longer be true as the background process is now dormant. - -##### Active - -To check whether a background process has queued items, is processing, is paused, or is cancelling, use `is_active()`. - -```php -if ( $this->example_process->is_active() ) { - // Do something because background process is active, e.g. add notice in admin UI. -} -``` - -If a background process is not active, then it either has not had anything queued yet and not started, or has finished processing all queued items. - -### BasicAuth - -If your site is behind BasicAuth, both async requests and background processes will fail to complete. This is because WP Background Processing relies on the [WordPress HTTP API](https://developer.wordpress.org/plugins/http-api/), which requires you to attach your BasicAuth credentials to requests. The easiest way to do this is using the following filter: - -```php -function wpbp_http_request_args( $r, $url ) { - $r['headers']['Authorization'] = 'Basic ' . base64_encode( USERNAME . ':' . PASSWORD ); - - return $r; -} -add_filter( 'http_request_args', 'wpbp_http_request_args', 10, 2); -``` - -## Contributing - -Contributions are welcome via Pull Requests, but please do raise an issue before -working on anything to discuss the change if there isn't already an issue. If there -is an approved issue you'd like to tackle, please post a comment on it to let people know -you're going to have a go at it so that effort isn't wasted through duplicated work. - -### Unit & Style Tests - -When working on the library, please add unit tests to the appropriate file in the -`tests` directory that cover your changes. - -#### Setting Up - -We use the standard WordPress test libraries for running unit tests. - -Please run the following command to set up the libraries: - -```shell -bin/install-wp-tests.sh db_name db_user db_pass -``` - -Substitute `db_name`, `db_user` and `db_pass` as appropriate. - -Please be aware that running the unit tests is a **destructive operation**, *database -tables will be cleared*, so please use a database name dedicated to running unit tests. -The standard database name usually used by the WordPress community is `wordpress_test`, e.g. - -```shell -bin/install-wp-tests.sh wordpress_test root root -``` - -Please refer to the [Initialize the testing environment locally](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/#3-initialize-the-testing-environment-locally) -section of the WordPress Handbook's [Plugin Integration Tests](https://make.wordpress.org/cli/handbook/misc/plugin-unit-tests/) -entry should you run into any issues. - -#### Running Unit Tests - -To run the unit tests, simply run: - -```shell -make test-unit -``` - -If the `composer` dependencies aren't in place, they'll be automatically installed first. - -#### Running Style Tests - -It's important that the code in the library use a consistent style to aid in quickly -understanding it, and to avoid some common issues. `PHP_Code_Sniffer` is used with -mostly standard WordPress rules to help check for consistency. - -To run the style tests, simply run: - -```shell -make test-style -``` - -If the `composer` dependencies aren't in place, they'll be automatically installed first. - -#### Running All Tests - -To make things super simple, just run the following to run all tests: - -```shell -make -``` - -If the `composer` dependencies aren't in place, they'll be automatically installed first. - -## License - -[GPLv2+](http://www.gnu.org/licenses/gpl-2.0.html) diff --git a/vendor/deliciousbrains/wp-background-processing/bin/install-wp-tests.sh b/vendor/deliciousbrains/wp-background-processing/bin/install-wp-tests.sh deleted file mode 100755 index ee05775c8..000000000 --- a/vendor/deliciousbrains/wp-background-processing/bin/install-wp-tests.sh +++ /dev/null @@ -1,181 +0,0 @@ -#!/usr/bin/env bash - -if [ $# -lt 3 ]; then - echo "usage: $0 [db-host] [wp-version] [skip-database-creation]" - exit 1 -fi - -DB_NAME=$1 -DB_USER=$2 -DB_PASS=$3 -DB_HOST=${4-localhost} -WP_VERSION=${5-latest} -SKIP_DB_CREATE=${6-false} - -TMPDIR=${TMPDIR-/tmp} -TMPDIR=$(echo $TMPDIR | sed -e "s/\/$//") -WP_TESTS_DIR=${WP_TESTS_DIR-$TMPDIR/wordpress-tests-lib} -WP_CORE_DIR=${WP_CORE_DIR-$TMPDIR/wordpress} - -download() { - if [ `which curl` ]; then - curl -s "$1" > "$2"; - elif [ `which wget` ]; then - wget -nv -O "$2" "$1" - fi -} - -if [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+\-(beta|RC)[0-9]+$ ]]; then - WP_BRANCH=${WP_VERSION%\-*} - WP_TESTS_TAG="branches/$WP_BRANCH" - -elif [[ $WP_VERSION =~ ^[0-9]+\.[0-9]+$ ]]; then - WP_TESTS_TAG="branches/$WP_VERSION" -elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then - if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then - # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x - WP_TESTS_TAG="tags/${WP_VERSION%??}" - else - WP_TESTS_TAG="tags/$WP_VERSION" - fi -elif [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - WP_TESTS_TAG="trunk" -else - # http serves a single offer, whereas https serves multiple. we only want one - download http://api.wordpress.org/core/version-check/1.7/ /tmp/wp-latest.json - grep '[0-9]+\.[0-9]+(\.[0-9]+)?' /tmp/wp-latest.json - LATEST_VERSION=$(grep -o '"version":"[^"]*' /tmp/wp-latest.json | sed 's/"version":"//') - if [[ -z "$LATEST_VERSION" ]]; then - echo "Latest WordPress version could not be found" - exit 1 - fi - WP_TESTS_TAG="tags/$LATEST_VERSION" -fi -set -ex - -install_wp() { - - if [ -d $WP_CORE_DIR ]; then - return; - fi - - mkdir -p $WP_CORE_DIR - - if [[ $WP_VERSION == 'nightly' || $WP_VERSION == 'trunk' ]]; then - mkdir -p $TMPDIR/wordpress-trunk - rm -rf $TMPDIR/wordpress-trunk/* - svn export --quiet https://core.svn.wordpress.org/trunk $TMPDIR/wordpress-trunk/wordpress - mv $TMPDIR/wordpress-trunk/wordpress/* $WP_CORE_DIR - else - if [ $WP_VERSION == 'latest' ]; then - local ARCHIVE_NAME='latest' - elif [[ $WP_VERSION =~ [0-9]+\.[0-9]+ ]]; then - # https serves multiple offers, whereas http serves single. - download https://api.wordpress.org/core/version-check/1.7/ $TMPDIR/wp-latest.json - if [[ $WP_VERSION =~ [0-9]+\.[0-9]+\.[0] ]]; then - # version x.x.0 means the first release of the major version, so strip off the .0 and download version x.x - LATEST_VERSION=${WP_VERSION%??} - else - # otherwise, scan the releases and get the most up to date minor version of the major release - local VERSION_ESCAPED=`echo $WP_VERSION | sed 's/\./\\\\./g'` - LATEST_VERSION=$(grep -o '"version":"'$VERSION_ESCAPED'[^"]*' $TMPDIR/wp-latest.json | sed 's/"version":"//' | head -1) - fi - if [[ -z "$LATEST_VERSION" ]]; then - local ARCHIVE_NAME="wordpress-$WP_VERSION" - else - local ARCHIVE_NAME="wordpress-$LATEST_VERSION" - fi - else - local ARCHIVE_NAME="wordpress-$WP_VERSION" - fi - download https://wordpress.org/${ARCHIVE_NAME}.tar.gz $TMPDIR/wordpress.tar.gz - tar --strip-components=1 -zxmf $TMPDIR/wordpress.tar.gz -C $WP_CORE_DIR - fi - - download https://raw.github.com/markoheijnen/wp-mysqli/master/db.php $WP_CORE_DIR/wp-content/db.php -} - -install_test_suite() { - # portable in-place argument for both GNU sed and Mac OSX sed - if [[ $(uname -s) == 'Darwin' ]]; then - local ioption='-i.bak' - else - local ioption='-i' - fi - - # set up testing suite if it doesn't yet exist - if [ ! -d $WP_TESTS_DIR ]; then - # set up testing suite - mkdir -p $WP_TESTS_DIR - rm -rf $WP_TESTS_DIR/{includes,data} - svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/includes/ $WP_TESTS_DIR/includes - svn export --quiet --ignore-externals https://develop.svn.wordpress.org/${WP_TESTS_TAG}/tests/phpunit/data/ $WP_TESTS_DIR/data - fi - - if [ ! -f wp-tests-config.php ]; then - download https://develop.svn.wordpress.org/${WP_TESTS_TAG}/wp-tests-config-sample.php "$WP_TESTS_DIR"/wp-tests-config.php - # remove all forward slashes in the end - WP_CORE_DIR=$(echo $WP_CORE_DIR | sed "s:/\+$::") - sed $ioption "s:dirname( __FILE__ ) . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s:__DIR__ . '/src/':'$WP_CORE_DIR/':" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/youremptytestdbnamehere/$DB_NAME/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourusernamehere/$DB_USER/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s/yourpasswordhere/$DB_PASS/" "$WP_TESTS_DIR"/wp-tests-config.php - sed $ioption "s|localhost|${DB_HOST}|" "$WP_TESTS_DIR"/wp-tests-config.php - fi - -} - -recreate_db() { - shopt -s nocasematch - if [[ $1 =~ ^(y|yes)$ ]] - then - mysqladmin drop $DB_NAME -f --user="$DB_USER" --password="$DB_PASS"$EXTRA - create_db - echo "Recreated the database ($DB_NAME)." - else - echo "Leaving the existing database ($DB_NAME) in place." - fi - shopt -u nocasematch -} - -create_db() { - mysqladmin create $DB_NAME --user="$DB_USER" --password="$DB_PASS"$EXTRA -} - -install_db() { - - if [ ${SKIP_DB_CREATE} = "true" ]; then - return 0 - fi - - # parse DB_HOST for port or socket references - local PARTS=(${DB_HOST//\:/ }) - local DB_HOSTNAME=${PARTS[0]}; - local DB_SOCK_OR_PORT=${PARTS[1]}; - local EXTRA="" - - if ! [ -z $DB_HOSTNAME ] ; then - if [ $(echo $DB_SOCK_OR_PORT | grep -e '^[0-9]\{1,\}$') ]; then - EXTRA=" --host=$DB_HOSTNAME --port=$DB_SOCK_OR_PORT --protocol=tcp" - elif ! [ -z $DB_SOCK_OR_PORT ] ; then - EXTRA=" --socket=$DB_SOCK_OR_PORT" - elif ! [ -z $DB_HOSTNAME ] ; then - EXTRA=" --host=$DB_HOSTNAME --protocol=tcp" - fi - fi - - # create database - if [ $(mysql --user="$DB_USER" --password="$DB_PASS"$EXTRA --execute='show databases;' | grep ^$DB_NAME$) ] - then - echo "Reinstalling will delete the existing test database ($DB_NAME)" - read -p 'Are you sure you want to proceed? [y/N]: ' DELETE_EXISTING_DB - recreate_db $DELETE_EXISTING_DB - else - create_db - fi -} - -install_wp -install_test_suite -install_db diff --git a/vendor/deliciousbrains/wp-background-processing/classes/wp-async-request.php b/vendor/deliciousbrains/wp-background-processing/classes/wp-async-request.php deleted file mode 100644 index 9759ab091..000000000 --- a/vendor/deliciousbrains/wp-background-processing/classes/wp-async-request.php +++ /dev/null @@ -1,202 +0,0 @@ -identifier = $this->prefix . '_' . $this->action; - - add_action( 'wp_ajax_' . $this->identifier, array( $this, 'maybe_handle' ) ); - add_action( 'wp_ajax_nopriv_' . $this->identifier, array( $this, 'maybe_handle' ) ); - } - - /** - * Set data used during the request. - * - * @param array $data Data. - * - * @return $this - */ - public function data( $data ) { - $this->data = $data; - - return $this; - } - - /** - * Dispatch the async request. - * - * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted. - */ - public function dispatch() { - $url = add_query_arg( $this->get_query_args(), $this->get_query_url() ); - $args = $this->get_post_args(); - - return wp_remote_post( esc_url_raw( $url ), $args ); - } - - /** - * Get query args. - * - * @return array - */ - protected function get_query_args() { - if ( property_exists( $this, 'query_args' ) ) { - return $this->query_args; - } - - $args = array( - 'action' => $this->identifier, - 'nonce' => wp_create_nonce( $this->identifier ), - ); - - /** - * Filters the post arguments used during an async request. - * - * @param array $url - */ - return apply_filters( $this->identifier . '_query_args', $args ); - } - - /** - * Get query URL. - * - * @return string - */ - protected function get_query_url() { - if ( property_exists( $this, 'query_url' ) ) { - return $this->query_url; - } - - $url = admin_url( 'admin-ajax.php' ); - - /** - * Filters the post arguments used during an async request. - * - * @param string $url - */ - return apply_filters( $this->identifier . '_query_url', $url ); - } - - /** - * Get post args. - * - * @return array - */ - protected function get_post_args() { - if ( property_exists( $this, 'post_args' ) ) { - return $this->post_args; - } - - $args = array( - 'timeout' => 0.01, - 'blocking' => false, - 'body' => $this->data, - 'cookies' => $_COOKIE, // Passing cookies ensures request is performed as initiating user. - 'sslverify' => apply_filters( 'https_local_ssl_verify', false ), // Local requests, fine to pass false. - ); - - /** - * Filters the post arguments used during an async request. - * - * @param array $args - */ - return apply_filters( $this->identifier . '_post_args', $args ); - } - - /** - * Maybe handle a dispatched request. - * - * Check for correct nonce and pass to handler. - * - * @return void|mixed - */ - public function maybe_handle() { - // Don't lock up other requests while processing. - session_write_close(); - - check_ajax_referer( $this->identifier, 'nonce' ); - - $this->handle(); - - return $this->maybe_wp_die(); - } - - /** - * Should the process exit with wp_die? - * - * @param mixed $return What to return if filter says don't die, default is null. - * - * @return void|mixed - */ - protected function maybe_wp_die( $return = null ) { - /** - * Should wp_die be used? - * - * @return bool - */ - if ( apply_filters( $this->identifier . '_wp_die', true ) ) { - wp_die(); - } - - return $return; - } - - /** - * Handle a dispatched request. - * - * Override this method to perform any actions required - * during the async request. - */ - abstract protected function handle(); -} diff --git a/vendor/deliciousbrains/wp-background-processing/classes/wp-background-process.php b/vendor/deliciousbrains/wp-background-processing/classes/wp-background-process.php deleted file mode 100644 index 82a8e637b..000000000 --- a/vendor/deliciousbrains/wp-background-processing/classes/wp-background-process.php +++ /dev/null @@ -1,733 +0,0 @@ -cron_hook_identifier = $this->identifier . '_cron'; - $this->cron_interval_identifier = $this->identifier . '_cron_interval'; - - add_action( $this->cron_hook_identifier, array( $this, 'handle_cron_healthcheck' ) ); - add_filter( 'cron_schedules', array( $this, 'schedule_cron_healthcheck' ) ); - } - - /** - * Schedule the cron healthcheck and dispatch an async request to start processing the queue. - * - * @access public - * @return array|WP_Error|false HTTP Response array, WP_Error on failure, or false if not attempted. - */ - public function dispatch() { - if ( $this->is_processing() ) { - // Process already running. - return false; - } - - // Schedule the cron healthcheck. - $this->schedule_event(); - - // Perform remote post. - return parent::dispatch(); - } - - /** - * Push to the queue. - * - * Note, save must be called in order to persist queued items to a batch for processing. - * - * @param mixed $data Data. - * - * @return $this - */ - public function push_to_queue( $data ) { - $this->data[] = $data; - - return $this; - } - - /** - * Save the queued items for future processing. - * - * @return $this - */ - public function save() { - $key = $this->generate_key(); - - if ( ! empty( $this->data ) ) { - update_site_option( $key, $this->data ); - } - - // Clean out data so that new data isn't prepended with closed session's data. - $this->data = array(); - - return $this; - } - - /** - * Update a batch's queued items. - * - * @param string $key Key. - * @param array $data Data. - * - * @return $this - */ - public function update( $key, $data ) { - if ( ! empty( $data ) ) { - update_site_option( $key, $data ); - } - - return $this; - } - - /** - * Delete a batch of queued items. - * - * @param string $key Key. - * - * @return $this - */ - public function delete( $key ) { - delete_site_option( $key ); - - return $this; - } - - /** - * Delete entire job queue. - */ - public function delete_all() { - $batches = $this->get_batches(); - - foreach ( $batches as $batch ) { - $this->delete( $batch->key ); - } - - delete_site_option( $this->get_status_key() ); - - $this->cancelled(); - } - - /** - * Cancel job on next batch. - */ - public function cancel() { - update_site_option( $this->get_status_key(), self::STATUS_CANCELLED ); - - // Just in case the job was paused at the time. - $this->dispatch(); - } - - /** - * Has the process been cancelled? - * - * @return bool - */ - public function is_cancelled() { - $status = get_site_option( $this->get_status_key(), 0 ); - - if ( absint( $status ) === self::STATUS_CANCELLED ) { - return true; - } - - return false; - } - - /** - * Called when background process has been cancelled. - */ - protected function cancelled() { - do_action( $this->identifier . '_cancelled' ); - } - - /** - * Pause job on next batch. - */ - public function pause() { - update_site_option( $this->get_status_key(), self::STATUS_PAUSED ); - } - - /** - * Is the job paused? - * - * @return bool - */ - public function is_paused() { - $status = get_site_option( $this->get_status_key(), 0 ); - - if ( absint( $status ) === self::STATUS_PAUSED ) { - return true; - } - - return false; - } - - /** - * Called when background process has been paused. - */ - protected function paused() { - do_action( $this->identifier . '_paused' ); - } - - /** - * Resume job. - */ - public function resume() { - delete_site_option( $this->get_status_key() ); - - $this->schedule_event(); - $this->dispatch(); - $this->resumed(); - } - - /** - * Called when background process has been resumed. - */ - protected function resumed() { - do_action( $this->identifier . '_resumed' ); - } - - /** - * Is queued? - * - * @return bool - */ - public function is_queued() { - return ! $this->is_queue_empty(); - } - - /** - * Is the tool currently active, e.g. starting, working, paused or cleaning up? - * - * @return bool - */ - public function is_active() { - return $this->is_queued() || $this->is_processing() || $this->is_paused() || $this->is_cancelled(); - } - - /** - * Generate key for a batch. - * - * Generates a unique key based on microtime. Queue items are - * given a unique key so that they can be merged upon save. - * - * @param int $length Optional max length to trim key to, defaults to 64 characters. - * @param string $key Optional string to append to identifier before hash, defaults to "batch". - * - * @return string - */ - protected function generate_key( $length = 64, $key = 'batch' ) { - $unique = md5( microtime() . wp_rand() ); - $prepend = $this->identifier . '_' . $key . '_'; - - return substr( $prepend . $unique, 0, $length ); - } - - /** - * Get the status key. - * - * @return string - */ - protected function get_status_key() { - return $this->identifier . '_status'; - } - - /** - * Maybe process a batch of queued items. - * - * Checks whether data exists within the queue and that - * the process is not already running. - */ - public function maybe_handle() { - // Don't lock up other requests while processing. - session_write_close(); - - if ( $this->is_processing() ) { - // Background process already running. - return $this->maybe_wp_die(); - } - - if ( $this->is_cancelled() ) { - $this->clear_scheduled_event(); - $this->delete_all(); - - return $this->maybe_wp_die(); - } - - if ( $this->is_paused() ) { - $this->clear_scheduled_event(); - $this->paused(); - - return $this->maybe_wp_die(); - } - - if ( $this->is_queue_empty() ) { - // No data to process. - return $this->maybe_wp_die(); - } - - check_ajax_referer( $this->identifier, 'nonce' ); - - $this->handle(); - - return $this->maybe_wp_die(); - } - - /** - * Is queue empty? - * - * @return bool - */ - protected function is_queue_empty() { - return empty( $this->get_batch() ); - } - - /** - * Is process running? - * - * Check whether the current process is already running - * in a background process. - * - * @return bool - * - * @deprecated 1.1.0 Superseded. - * @see is_processing() - */ - protected function is_process_running() { - return $this->is_processing(); - } - - /** - * Is the background process currently running? - * - * @return bool - */ - public function is_processing() { - if ( get_site_transient( $this->identifier . '_process_lock' ) ) { - // Process already running. - return true; - } - - return false; - } - - /** - * Lock process. - * - * Lock the process so that multiple instances can't run simultaneously. - * Override if applicable, but the duration should be greater than that - * defined in the time_exceeded() method. - */ - protected function lock_process() { - $this->start_time = time(); // Set start time of current process. - - $lock_duration = ( property_exists( $this, 'queue_lock_time' ) ) ? $this->queue_lock_time : 60; // 1 minute - $lock_duration = apply_filters( $this->identifier . '_queue_lock_time', $lock_duration ); - - set_site_transient( $this->identifier . '_process_lock', microtime(), $lock_duration ); - } - - /** - * Unlock process. - * - * Unlock the process so that other instances can spawn. - * - * @return $this - */ - protected function unlock_process() { - delete_site_transient( $this->identifier . '_process_lock' ); - - return $this; - } - - /** - * Get batch. - * - * @return stdClass Return the first batch of queued items. - */ - protected function get_batch() { - return array_reduce( - $this->get_batches( 1 ), - function ( $carry, $batch ) { - return $batch; - }, - array() - ); - } - - /** - * Get batches. - * - * @param int $limit Number of batches to return, defaults to all. - * - * @return array of stdClass - */ - public function get_batches( $limit = 0 ) { - global $wpdb; - - if ( empty( $limit ) || ! is_int( $limit ) ) { - $limit = 0; - } - - $table = $wpdb->options; - $column = 'option_name'; - $key_column = 'option_id'; - $value_column = 'option_value'; - - if ( is_multisite() ) { - $table = $wpdb->sitemeta; - $column = 'meta_key'; - $key_column = 'meta_id'; - $value_column = 'meta_value'; - } - - $key = $wpdb->esc_like( $this->identifier . '_batch_' ) . '%'; - - $sql = ' - SELECT * - FROM ' . $table . ' - WHERE ' . $column . ' LIKE %s - ORDER BY ' . $key_column . ' ASC - '; - - $args = array( $key ); - - if ( ! empty( $limit ) ) { - $sql .= ' LIMIT %d'; - - $args[] = $limit; - } - - $items = $wpdb->get_results( $wpdb->prepare( $sql, $args ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - - $batches = array(); - - if ( ! empty( $items ) ) { - $batches = array_map( - function ( $item ) use ( $column, $value_column ) { - $batch = new stdClass(); - $batch->key = $item->{$column}; - $batch->data = maybe_unserialize( $item->{$value_column} ); - - return $batch; - }, - $items - ); - } - - return $batches; - } - - /** - * Handle a dispatched request. - * - * Pass each queue item to the task handler, while remaining - * within server memory and time limit constraints. - */ - protected function handle() { - $this->lock_process(); - - /** - * Number of seconds to sleep between batches. Defaults to 0 seconds, minimum 0. - * - * @param int $seconds - */ - $throttle_seconds = max( - 0, - apply_filters( - $this->identifier . '_seconds_between_batches', - apply_filters( - $this->prefix . '_seconds_between_batches', - 0 - ) - ) - ); - - do { - $batch = $this->get_batch(); - - foreach ( $batch->data as $key => $value ) { - $task = $this->task( $value ); - - if ( false !== $task ) { - $batch->data[ $key ] = $task; - } else { - unset( $batch->data[ $key ] ); - } - - // Keep the batch up to date while processing it. - if ( ! empty( $batch->data ) ) { - $this->update( $batch->key, $batch->data ); - } - - // Let the server breathe a little. - sleep( $throttle_seconds ); - - if ( $this->time_exceeded() || $this->memory_exceeded() ) { - // Batch limits reached. - break; - } - } - - // Delete current batch if fully processed. - if ( empty( $batch->data ) ) { - $this->delete( $batch->key ); - } - } while ( ! $this->time_exceeded() && ! $this->memory_exceeded() && ! $this->is_queue_empty() ); - - $this->unlock_process(); - - // Start next batch or complete process. - if ( ! $this->is_queue_empty() ) { - $this->dispatch(); - } else { - $this->complete(); - } - - return $this->maybe_wp_die(); - } - - /** - * Memory exceeded? - * - * Ensures the batch process never exceeds 90% - * of the maximum WordPress memory. - * - * @return bool - */ - protected function memory_exceeded() { - $memory_limit = $this->get_memory_limit() * 0.9; // 90% of max memory - $current_memory = memory_get_usage( true ); - $return = false; - - if ( $current_memory >= $memory_limit ) { - $return = true; - } - - return apply_filters( $this->identifier . '_memory_exceeded', $return ); - } - - /** - * Get memory limit in bytes. - * - * @return int - */ - protected function get_memory_limit() { - if ( function_exists( 'ini_get' ) ) { - $memory_limit = ini_get( 'memory_limit' ); - } else { - // Sensible default. - $memory_limit = '128M'; - } - - if ( ! $memory_limit || -1 === intval( $memory_limit ) ) { - // Unlimited, set to 32GB. - $memory_limit = '32000M'; - } - - return wp_convert_hr_to_bytes( $memory_limit ); - } - - /** - * Time limit exceeded? - * - * Ensures the batch never exceeds a sensible time limit. - * A timeout limit of 30s is common on shared hosting. - * - * @return bool - */ - protected function time_exceeded() { - $finish = $this->start_time + apply_filters( $this->identifier . '_default_time_limit', 20 ); // 20 seconds - $return = false; - - if ( time() >= $finish ) { - $return = true; - } - - return apply_filters( $this->identifier . '_time_exceeded', $return ); - } - - /** - * Complete processing. - * - * Override if applicable, but ensure that the below actions are - * performed, or, call parent::complete(). - */ - protected function complete() { - delete_site_option( $this->get_status_key() ); - - // Remove the cron healthcheck job from the cron schedule. - $this->clear_scheduled_event(); - - $this->completed(); - } - - /** - * Called when background process has completed. - */ - protected function completed() { - do_action( $this->identifier . '_completed' ); - } - - /** - * Schedule the cron healthcheck job. - * - * @access public - * - * @param mixed $schedules Schedules. - * - * @return mixed - */ - public function schedule_cron_healthcheck( $schedules ) { - $interval = apply_filters( $this->cron_interval_identifier, 5 ); - - if ( property_exists( $this, 'cron_interval' ) ) { - $interval = apply_filters( $this->cron_interval_identifier, $this->cron_interval ); - } - - if ( 1 === $interval ) { - $display = __( 'Every Minute' ); - } else { - $display = sprintf( __( 'Every %d Minutes' ), $interval ); - } - - // Adds an "Every NNN Minute(s)" schedule to the existing cron schedules. - $schedules[ $this->cron_interval_identifier ] = array( - 'interval' => MINUTE_IN_SECONDS * $interval, - 'display' => $display, - ); - - return $schedules; - } - - /** - * Handle cron healthcheck event. - * - * Restart the background process if not already running - * and data exists in the queue. - */ - public function handle_cron_healthcheck() { - if ( $this->is_processing() ) { - // Background process already running. - exit; - } - - if ( $this->is_queue_empty() ) { - // No data to process. - $this->clear_scheduled_event(); - exit; - } - - $this->dispatch(); - } - - /** - * Schedule the cron healthcheck event. - */ - protected function schedule_event() { - if ( ! wp_next_scheduled( $this->cron_hook_identifier ) ) { - wp_schedule_event( time(), $this->cron_interval_identifier, $this->cron_hook_identifier ); - } - } - - /** - * Clear scheduled cron healthcheck event. - */ - protected function clear_scheduled_event() { - $timestamp = wp_next_scheduled( $this->cron_hook_identifier ); - - if ( $timestamp ) { - wp_unschedule_event( $timestamp, $this->cron_hook_identifier ); - } - } - - /** - * Cancel the background process. - * - * Stop processing queue items, clear cron job and delete batch. - * - * @deprecated 1.1.0 Superseded. - * @see cancel() - */ - public function cancel_process() { - $this->cancel(); - } - - /** - * Perform task with queued item. - * - * Override this method to perform any actions required on each - * queue item. Return the modified item for further processing - * in the next pass through. Or, return false to remove the - * item from the queue. - * - * @param mixed $item Queue item to iterate over. - * - * @return mixed - */ - abstract protected function task( $item ); -} diff --git a/vendor/deliciousbrains/wp-background-processing/composer.json b/vendor/deliciousbrains/wp-background-processing/composer.json deleted file mode 100644 index 5f65733f8..000000000 --- a/vendor/deliciousbrains/wp-background-processing/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "deliciousbrains/wp-background-processing", - "description": "WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.", - "type": "library", - "require": { - "php": ">=5.6" - }, - "suggest": { - "coenjacobs/mozart": "Easily wrap this library with your own prefix, to prevent collisions when multiple plugins use this library" - }, - "license": "GPL-2.0-or-later", - "authors": [ - { - "name": "Delicious Brains", - "email": "nom@deliciousbrains.com" - } - ], - "autoload": { - "classmap": [ - "classes/" - ] - }, - "require-dev": { - "phpunit/phpunit": "^8.0", - "yoast/phpunit-polyfills": "^1.0", - "spryker/code-sniffer": "^0.17.18", - "phpcompatibility/phpcompatibility-wp": "*", - "wp-coding-standards/wpcs": "^2.3" - }, - "config": { - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - } -} diff --git a/vendor/deliciousbrains/wp-background-processing/composer.lock b/vendor/deliciousbrains/wp-background-processing/composer.lock deleted file mode 100644 index 3674cd539..000000000 --- a/vendor/deliciousbrains/wp-background-processing/composer.lock +++ /dev/null @@ -1,2022 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "a9e05db155afa8fde60a18a19cc4f591", - "packages": [], - "packages-dev": [ - { - "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v1.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHPCSStandards/composer-installer.git", - "reference": "4be43904336affa5c2f70744a348312336afd0da" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/4be43904336affa5c2f70744a348312336afd0da", - "reference": "4be43904336affa5c2f70744a348312336afd0da", - "shasum": "" - }, - "require": { - "composer-plugin-api": "^1.0 || ^2.0", - "php": ">=5.4", - "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" - }, - "require-dev": { - "composer/composer": "*", - "ext-json": "*", - "ext-zip": "*", - "php-parallel-lint/php-parallel-lint": "^1.3.1", - "phpcompatibility/php-compatibility": "^9.0", - "yoast/phpunit-polyfills": "^1.0" - }, - "type": "composer-plugin", - "extra": { - "class": "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" - }, - "autoload": { - "psr-4": { - "PHPCSStandards\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Franck Nijhof", - "email": "franck.nijhof@dealerdirect.com", - "homepage": "http://www.frenck.nl", - "role": "Developer / IT Manager" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCSStandards/composer-installer/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer Standards Composer Installer Plugin", - "homepage": "http://www.dealerdirect.com", - "keywords": [ - "PHPCodeSniffer", - "PHP_CodeSniffer", - "code quality", - "codesniffer", - "composer", - "installer", - "phpcbf", - "phpcs", - "plugin", - "qa", - "quality", - "standard", - "standards", - "style guide", - "stylecheck", - "tests" - ], - "support": { - "issues": "https://github.com/PHPCSStandards/composer-installer/issues", - "source": "https://github.com/PHPCSStandards/composer-installer" - }, - "time": "2023-01-05T11:28:13+00:00" - }, - { - "name": "doctrine/instantiator", - "version": "1.5.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", - "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "require-dev": { - "doctrine/coding-standard": "^9 || ^11", - "ext-pdo": "*", - "ext-phar": "*", - "phpbench/phpbench": "^0.16 || ^1", - "phpstan/phpstan": "^1.4", - "phpstan/phpstan-phpunit": "^1", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.30 || ^5.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "https://ocramius.github.io/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://www.doctrine-project.org/projects/instantiator.html", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.5.0" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2022-12-30T00:15:36+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.11.1", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "shasum": "" - }, - "require": { - "php": "^7.1 || ^8.0" - }, - "conflict": { - "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" - }, - "require-dev": { - "doctrine/collections": "^1.6.8", - "doctrine/common": "^2.13.3 || ^3.2.2", - "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" - }, - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], - "time": "2023-03-08T13:26:56+00:00" - }, - { - "name": "phar-io/manifest", - "version": "2.0.3", - "source": { - "type": "git", - "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-phar": "*", - "ext-xmlwriter": "*", - "phar-io/version": "^3.0.1", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "support": { - "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" - }, - "time": "2021-07-20T11:28:43+00:00" - }, - { - "name": "phar-io/version", - "version": "3.2.1", - "source": { - "type": "git", - "url": "https://github.com/phar-io/version.git", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - }, - { - "name": "Sebastian Heuer", - "email": "sebastian@phpeople.de", - "role": "Developer" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "Developer" - } - ], - "description": "Library for handling version information and constraints", - "support": { - "issues": "https://github.com/phar-io/version/issues", - "source": "https://github.com/phar-io/version/tree/3.2.1" - }, - "time": "2022-02-21T01:04:05+00:00" - }, - { - "name": "phpcompatibility/php-compatibility", - "version": "9.3.5", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", - "shasum": "" - }, - "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" - }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" - }, - "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" - }, - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - } - ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" - }, - "time": "2019-12-27T09:44:58+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.2", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" - }, - "time": "2022-10-25T01:46:02+00:00" - }, - { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", - "source": { - "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "shasum": "" - }, - "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "LGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" - } - ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "static analysis", - "wordpress" - ], - "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" - }, - "time": "2022-10-24T09:00:36+00:00" - }, - { - "name": "phpstan/phpdoc-parser", - "version": "1.18.1", - "source": { - "type": "git", - "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/22dcdfd725ddf99583bfe398fc624ad6c5004a0f", - "reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f", - "shasum": "" - }, - "require": { - "php": "^7.2 || ^8.0" - }, - "require-dev": { - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", - "symfony/process": "^5.2" - }, - "type": "library", - "autoload": { - "psr-4": { - "PHPStan\\PhpDocParser\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "PHPDoc parser with support for nullable, intersection and generic types", - "support": { - "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.18.1" - }, - "time": "2023-04-07T11:51:11+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "7.0.15", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": ">=7.2", - "phpunit/php-file-iterator": "^2.0.2", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^3.1.3 || ^4.0", - "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^4.2.2", - "sebastian/version": "^2.0.1", - "theseer/tokenizer": "^1.1.3" - }, - "require-dev": { - "phpunit/phpunit": "^8.2.2" - }, - "suggest": { - "ext-xdebug": "^2.7.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "7.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-07-26T12:20:09+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "2.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2021-12-02T12:42:26+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "2.1.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:20:02+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "4.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "reference": "a853a0e183b9db7eed023d7933a858fa1c8d25a3", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": "^7.3 || ^8.0" - }, - "require-dev": { - "phpunit/phpunit": "^9.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/master" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "abandoned": true, - "time": "2020-08-04T08:28:15+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "8.5.33", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.3.1", - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", - "php": ">=7.2", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", - "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", - "sebastian/comparator": "^3.0.5", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.5", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", - "sebastian/version": "^2.0.1" - }, - "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "8.5-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.33" - }, - "funding": [ - { - "url": "https://phpunit.de/sponsors.html", - "type": "custom" - }, - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", - "type": "tidelift" - } - ], - "time": "2023-02-27T13:04:50+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, - { - "name": "sebastian/comparator", - "version": "3.0.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "reference": "1dc7ceb4a24aede938c7af2a9ed1de09609ca770", - "shasum": "" - }, - "require": { - "php": ">=7.1", - "sebastian/diff": "^3.0", - "sebastian/exporter": "^3.1" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "https://github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/3.0.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T12:31:48+00:00" - }, - { - "name": "sebastian/diff", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "reference": "14f72dd46eaf2f2293cbe79c93cc0bc43161a211", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5 || ^8.0", - "symfony/process": "^2 || ^3.3 || ^4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff", - "udiff", - "unidiff", - "unified diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.3" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:59:04+00:00" - }, - { - "name": "sebastian/environment", - "version": "4.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "require-dev": { - "phpunit/phpunit": "^7.5" - }, - "suggest": { - "ext-posix": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.2-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:53:42+00:00" - }, - { - "name": "sebastian/exporter", - "version": "3.1.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.1.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-09-14T06:00:17+00:00" - }, - { - "name": "sebastian/global-state", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/de036ec91d55d2a9e0db2ba975b512cdb1c23921", - "reference": "de036ec91d55d2a9e0db2ba975b512cdb1c23921", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "ext-dom": "*", - "phpunit/phpunit": "^8.0" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2022-02-10T06:55:38+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "3.0.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "shasum": "" - }, - "require": { - "php": ">=7.0", - "sebastian/object-reflector": "^1.1.1", - "sebastian/recursion-context": "^3.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:40:27+00:00" - }, - { - "name": "sebastian/object-reflector", - "version": "1.1.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Allows reflection of object attributes, including inherited and non-public ones", - "homepage": "https://github.com/sebastianbergmann/object-reflector/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:37:18+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "3.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", - "shasum": "" - }, - "require": { - "php": ">=7.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:34:24+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "2.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "shasum": "" - }, - "require": { - "php": ">=7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:30:19+00:00" - }, - { - "name": "sebastian/type", - "version": "1.1.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Collection of value objects that represent the types of the PHP type system", - "homepage": "https://github.com/sebastianbergmann/type", - "support": { - "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T07:25:11+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "slevomat/coding-standard", - "version": "8.10.0", - "source": { - "type": "git", - "url": "https://github.com/slevomat/coding-standard.git", - "reference": "c4e213e6e57f741451a08e68ef838802eec92287" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/c4e213e6e57f741451a08e68ef838802eec92287", - "reference": "c4e213e6e57f741451a08e68ef838802eec92287", - "shasum": "" - }, - "require": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": ">=1.18.0 <1.19.0", - "squizlabs/php_codesniffer": "^3.7.1" - }, - "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.4.10|1.10.11", - "phpstan/phpstan-deprecation-rules": "1.1.3", - "phpstan/phpstan-phpunit": "1.0.0|1.3.11", - "phpstan/phpstan-strict-rules": "1.5.1", - "phpunit/phpunit": "7.5.20|8.5.21|9.6.6|10.0.19" - }, - "type": "phpcodesniffer-standard", - "extra": { - "branch-alias": { - "dev-master": "8.x-dev" - } - }, - "autoload": { - "psr-4": { - "SlevomatCodingStandard\\": "SlevomatCodingStandard/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", - "keywords": [ - "dev", - "phpcs" - ], - "support": { - "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.10.0" - }, - "funding": [ - { - "url": "https://github.com/kukulich", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard", - "type": "tidelift" - } - ], - "time": "2023-04-10T07:39:29+00:00" - }, - { - "name": "spryker/code-sniffer", - "version": "0.17.18", - "source": { - "type": "git", - "url": "https://github.com/spryker/code-sniffer.git", - "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/5fb8b573abc4a906d0d364a4a03abd38e565ba29", - "reference": "5fb8b573abc4a906d0d364a4a03abd38e565ba29", - "shasum": "" - }, - "require": { - "php": ">=7.4", - "slevomat/coding-standard": "^7.2.0 || ^8.0.1", - "squizlabs/php_codesniffer": "^3.6.2" - }, - "require-dev": { - "phpstan/phpstan": "^1.0.0", - "phpunit/phpunit": "^9.5" - }, - "bin": [ - "bin/tokenize" - ], - "type": "phpcodesniffer-standard", - "autoload": { - "psr-4": { - "Spryker\\": "Spryker/", - "SprykerStrict\\": "SprykerStrict/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Spryker", - "homepage": "https://spryker.com" - } - ], - "description": "Spryker Code Sniffer Standards", - "homepage": "https://spryker.com", - "keywords": [ - "codesniffer", - "framework", - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/spryker/code-sniffer/issues", - "source": "https://github.com/spryker/code-sniffer" - }, - "time": "2023-01-03T16:08:22+00:00" - }, - { - "name": "squizlabs/php_codesniffer", - "version": "3.7.2", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", - "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", - "keywords": [ - "phpcs", - "standards", - "static analysis" - ], - "support": { - "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", - "source": "https://github.com/squizlabs/PHP_CodeSniffer", - "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" - }, - "time": "2023-02-22T23:07:41+00:00" - }, - { - "name": "theseer/tokenizer", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": "^7.2 || ^8.0" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Arne Blankerts", - "email": "arne@blankerts.de", - "role": "Developer" - } - ], - "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "support": { - "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" - }, - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], - "time": "2021-07-28T10:34:58+00:00" - }, - { - "name": "wp-coding-standards/wpcs", - "version": "2.3.0", - "source": { - "type": "git", - "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "7da1894633f168fe244afc6de00d141f27517b62" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/7da1894633f168fe244afc6de00d141f27517b62", - "reference": "7da1894633f168fe244afc6de00d141f27517b62", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.3.1" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", - "phpcompatibility/php-compatibility": "^9.0", - "phpcsstandards/phpcsdevtools": "^1.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." - }, - "type": "phpcodesniffer-standard", - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" - } - ], - "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", - "keywords": [ - "phpcs", - "standards", - "wordpress" - ], - "support": { - "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", - "source": "https://github.com/WordPress/WordPress-Coding-Standards", - "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" - }, - "time": "2020-05-13T23:57:56+00:00" - }, - { - "name": "yoast/phpunit-polyfills", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "reference": "3b59adeef77fb1c03ff5381dbb9d68b0aaff3171", - "shasum": "" - }, - "require": { - "php": ">=5.4", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" - }, - "require-dev": { - "yoast/yoastcs": "^2.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "2.x-dev" - } - }, - "autoload": { - "files": [ - "phpunitpolyfills-autoload.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Team Yoast", - "email": "support@yoast.com", - "homepage": "https://yoast.com" - }, - { - "name": "Contributors", - "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" - } - ], - "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", - "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", - "keywords": [ - "phpunit", - "polyfill", - "testing" - ], - "support": { - "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", - "source": "https://github.com/Yoast/PHPUnit-Polyfills" - }, - "time": "2023-03-30T23:39:05+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.6" - }, - "platform-dev": [], - "plugin-api-version": "2.3.0" -} diff --git a/vendor/deliciousbrains/wp-background-processing/license.txt b/vendor/deliciousbrains/wp-background-processing/license.txt deleted file mode 100644 index a0939e921..000000000 --- a/vendor/deliciousbrains/wp-background-processing/license.txt +++ /dev/null @@ -1,280 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 51 Franklin St, Fifth Floor, Boston, MA 02110, USA - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/vendor/deliciousbrains/wp-background-processing/phpunit.xml b/vendor/deliciousbrains/wp-background-processing/phpunit.xml deleted file mode 100644 index d6218767c..000000000 --- a/vendor/deliciousbrains/wp-background-processing/phpunit.xml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - ./tests/ - - - diff --git a/vendor/deliciousbrains/wp-background-processing/tests/Test_Setup.php b/vendor/deliciousbrains/wp-background-processing/tests/Test_Setup.php deleted file mode 100644 index cfbaa8ed0..000000000 --- a/vendor/deliciousbrains/wp-background-processing/tests/Test_Setup.php +++ /dev/null @@ -1,19 +0,0 @@ -assertTrue( true ); - } -} diff --git a/vendor/deliciousbrains/wp-background-processing/tests/Test_WP_Background_Process.php b/vendor/deliciousbrains/wp-background-processing/tests/Test_WP_Background_Process.php deleted file mode 100644 index 19926e95b..000000000 --- a/vendor/deliciousbrains/wp-background-processing/tests/Test_WP_Background_Process.php +++ /dev/null @@ -1,589 +0,0 @@ -wpbp = $this->getMockForAbstractClass( WP_Background_Process::class ); - - $this->wpbp->expects( $this->any() ) - ->method( 'task' ) - ->will( $this->returnValue( false ) ); - } - - /** - * Get a property value from WPBP regardless of accessibility. - * - * @param string $name - * - * @return mixed - */ - private function getWPBPProperty( string $name ) { - try { - $property = new ReflectionProperty( 'WP_Background_Process', $name ); - } catch ( Exception $e ) { - return new WP_Error( $e->getCode(), $e->getMessage() ); - } - $property->setAccessible( true ); - - return $property->getValue( $this->wpbp ); - } - - /** - * Execute a method of WPBP regardless of accessibility. - * - * @param string $name Method name. - * @param mixed $args None, one or more args to pass to method. - * - * @return mixed - */ - private function executeWPBPMethod( string $name, ...$args ) { - try { - $method = new ReflectionMethod( 'WP_Background_Process', $name ); - $method->setAccessible( true ); - - return $method->invoke( $this->wpbp, ...$args ); - } catch ( Exception $e ) { - return new WP_Error( $e->getCode(), $e->getMessage() ); - } - } - - /** - * Test push_to_queue. - * - * @return void - */ - public function test_push_to_queue() { - $this->assertClassHasAttribute( 'data', 'WP_Background_Process', 'class has data property' ); - $this->assertEmpty( $this->getWPBPProperty( 'data' ) ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertNotEmpty( $this->getWPBPProperty( 'data' ) ); - $this->assertEquals( array( 'wibble' ), $this->getWPBPProperty( 'data' ) ); - - $this->wpbp->push_to_queue( 'wobble' ); - $this->assertEquals( array( 'wibble', 'wobble' ), $this->getWPBPProperty( 'data' ) ); - } - - /** - * Test save. - * - * @return void - */ - public function test_save() { - $this->assertClassHasAttribute( 'data', 'WP_Background_Process', 'class has data property' ); - $this->assertEmpty( $this->getWPBPProperty( 'data' ) ); - $this->assertEmpty( $this->wpbp->get_batches(), 'no batches until save' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertNotEmpty( $this->getWPBPProperty( 'data' ) ); - $this->assertEquals( array( 'wibble' ), $this->getWPBPProperty( 'data' ) ); - $this->wpbp->save(); - $this->assertEmpty( $this->getWPBPProperty( 'data' ), 'data emptied after save' ); - $this->assertNotEmpty( $this->wpbp->get_batches(), 'batches exist after save' ); - } - - /** - * Test get_batches. - * - * @return void - */ - public function test_get_batches() { - $this->assertEmpty( $this->wpbp->get_batches(), 'no batches until save' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertNotEmpty( $this->getWPBPProperty( 'data' ) ); - $this->assertEquals( array( 'wibble' ), $this->getWPBPProperty( 'data' ) ); - $this->assertEmpty( $this->wpbp->get_batches(), 'no batches until save' ); - - $this->wpbp->push_to_queue( 'wobble' ); - $this->assertEquals( array( 'wibble', 'wobble' ), $this->getWPBPProperty( 'data' ) ); - $this->assertEmpty( $this->wpbp->get_batches(), 'no batches until save' ); - - $this->wpbp->save(); - $first_batch = $this->wpbp->get_batches(); - $this->assertNotEmpty( $first_batch ); - $this->assertCount( 1, $first_batch ); - - $this->wpbp->push_to_queue( 'more wibble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - - $this->wpbp->push_to_queue( 'Wibble wobble all day long.' ); - $this->wpbp->save(); - $this->assertCount( 3, $this->wpbp->get_batches() ); - - $this->assertEquals( $first_batch, $this->wpbp->get_batches( 1 ) ); - $this->assertNotEquals( $first_batch, $this->wpbp->get_batches( 2 ) ); - $this->assertCount( 2, $this->wpbp->get_batches( 2 ) ); - $this->assertCount( 3, $this->wpbp->get_batches( 3 ) ); - $this->assertCount( 3, $this->wpbp->get_batches( 5 ) ); - } - - /** - * Test get_batch. - * - * @return void - */ - public function test_get_batch() { - $this->assertEmpty( $this->executeWPBPMethod( 'get_batch' ), 'no batches until save' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertNotEmpty( $this->getWPBPProperty( 'data' ) ); - $this->assertEquals( array( 'wibble' ), $this->getWPBPProperty( 'data' ) ); - $this->assertEmpty( $this->executeWPBPMethod( 'get_batch' ), 'no batches until save' ); - - $this->wpbp->push_to_queue( 'wobble' ); - $this->assertEquals( array( 'wibble', 'wobble' ), $this->getWPBPProperty( 'data' ) ); - $this->assertEmpty( $this->executeWPBPMethod( 'get_batch' ), 'no batches until save' ); - - $this->wpbp->save(); - $first_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->assertNotEmpty( $first_batch ); - $this->assertInstanceOf( 'stdClass', $first_batch ); - $this->assertEquals( array( 'wibble', 'wobble' ), $first_batch->data ); - - $this->wpbp->push_to_queue( 'more wibble' ); - $this->wpbp->save(); - $second_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->assertNotEmpty( $second_batch ); - $this->assertInstanceOf( 'stdClass', $second_batch ); - $this->assertEquals( $first_batch, $second_batch, 'same 1st batch returned until deleted' ); - - $this->wpbp->delete( $first_batch->key ); - $second_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->assertNotEmpty( $second_batch ); - $this->assertInstanceOf( 'stdClass', $second_batch ); - $this->assertNotEquals( $first_batch, $second_batch, '2nd batch returned as 1st deleted' ); - $this->assertEquals( array( 'more wibble' ), $second_batch->data ); - } - - /** - * Test cancel. - * - * @return void - */ - public function test_cancel() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertFalse( $this->wpbp->is_cancelled() ); - $this->wpbp->cancel(); - $this->assertTrue( $this->wpbp->is_cancelled() ); - } - - /** - * Test pause. - * - * @return void - */ - public function test_pause() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertFalse( $this->wpbp->is_paused() ); - $this->wpbp->pause(); - $this->assertTrue( $this->wpbp->is_paused() ); - } - - /** - * Test resume. - * - * @return void - */ - public function test_resume() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertFalse( $this->wpbp->is_paused() ); - $this->wpbp->pause(); - $this->assertTrue( $this->wpbp->is_paused() ); - $this->wpbp->resume(); - $this->assertFalse( $this->wpbp->is_paused() ); - } - - /** - * Test delete. - * - * @return void - */ - public function test_delete() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $first_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->wpbp->delete( $first_batch->key ); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $second_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->assertNotEquals( $first_batch, $second_batch, '2nd batch returned as 1st deleted' ); - } - - /** - * Test delete_all. - * - * @return void - */ - public function test_delete_all() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->wpbp->delete_all(); - $this->assertCount( 0, $this->wpbp->get_batches() ); - } - - /** - * Test update. - * - * @return void - */ - public function test_update() { - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $first_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->wpbp->update( $first_batch->key, array( 'Wibble wobble all day long!' ) ); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $updated_batch = $this->executeWPBPMethod( 'get_batch' ); - $this->assertNotEquals( $first_batch, $updated_batch, 'fetched updated batch different to 1st fetch' ); - $this->assertEquals( array( 'Wibble wobble all day long!' ), $updated_batch->data, 'fetched updated batch has expected data' ); - } - - /** - * Test maybe_handle when cancelling. - * - * @return void - */ - public function test_maybe_handle_cancelled() { - // Cancelled status results in cleared batches and action fired. - $cancelled_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_cancelled', function () use ( &$cancelled_fired ) { - $cancelled_fired = true; - } ); - // Paused action should not be fired though. - $paused_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_paused', function () use ( &$paused_fired ) { - $paused_fired = true; - } ); - // Completed action should not be fired though. - $completed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_completed', function () use ( &$completed_fired ) { - $completed_fired = true; - } ); - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - update_site_option( $this->executeWPBPMethod( 'get_status_key' ), WP_Background_Process::STATUS_CANCELLED ); - $this->assertTrue( $this->wpbp->is_cancelled(), 'is_cancelled' ); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - $this->wpbp->maybe_handle(); - $this->assertCount( 0, $this->wpbp->get_batches() ); - $this->assertTrue( $cancelled_fired, 'cancelled action fired' ); - $this->assertFalse( $paused_fired, 'paused action still not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - } - - /** - * Test maybe_handle when pausing and resuming. - * - * @return void - */ - public function test_maybe_handle_paused_resumed() { - // Cancelled action should not be fired. - $cancelled_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_cancelled', function () use ( &$cancelled_fired ) { - $cancelled_fired = true; - } ); - // Paused action should fire and batches remain intact. - $paused_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_paused', function () use ( &$paused_fired ) { - $paused_fired = true; - } ); - // Resumed action should fire on resume before batches handled. - $resumed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_resumed', function () use ( &$resumed_fired ) { - $resumed_fired = true; - } ); - // Completed action should fire after batches handled. - $completed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_completed', function () use ( &$completed_fired ) { - $completed_fired = true; - } ); - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->wpbp->pause(); - $this->assertTrue( $this->wpbp->is_paused(), 'is_paused' ); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - $this->wpbp->maybe_handle(); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action still not fired yet' ); - $this->assertTrue( $paused_fired, 'paused action fired' ); - $this->assertFalse( $resumed_fired, 'resumed action still not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - - // Reset for resume and ensure dispatch does nothing to that maybe_handle can be monitored. - $paused_fired = false; - add_filter( 'pre_http_request', '__return_true' ); - $this->wpbp->resume(); - remove_filter( 'pre_http_request', '__return_true' ); - $this->assertFalse( $this->wpbp->is_paused(), 'not is_paused after resume' ); - $this->assertCount( 2, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertTrue( $resumed_fired, 'resumed action fired' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - - // Don't expect resumed to be fired again, and batches to be handled with valid security. - $resumed_fired = false; - $_REQUEST['nonce'] = wp_create_nonce( $this->getWPBPProperty( 'identifier' ) ); - $this->wpbp->maybe_handle(); - $this->assertCount( 0, $this->wpbp->get_batches(), 'after resume all batches processed with maybe_handle' ); - $this->assertFalse( $cancelled_fired, 'cancelled action still not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action still not fired yet' ); - $this->assertTrue( $completed_fired, 'completed action fired' ); - } - - /** - * Test maybe_handle when handling a single batch. - * - * @return void - */ - public function test_maybe_handle_single_batch() { - // Cancelled action should not be fired. - $cancelled_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_cancelled', function () use ( &$cancelled_fired ) { - $cancelled_fired = true; - } ); - // Paused action should not be fired. - $paused_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_paused', function () use ( &$paused_fired ) { - $paused_fired = true; - } ); - // Resumed action should not be fired. - $resumed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_resumed', function () use ( &$resumed_fired ) { - $resumed_fired = true; - } ); - // Completed action should fire after batches handled. - $completed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_completed', function () use ( &$completed_fired ) { - $completed_fired = true; - } ); - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - - $_REQUEST['nonce'] = wp_create_nonce( $this->getWPBPProperty( 'identifier' ) ); - $this->wpbp->maybe_handle(); - $this->assertCount( 0, $this->wpbp->get_batches(), 'after resume all batches processed with maybe_handle' ); - $this->assertFalse( $cancelled_fired, 'cancelled action still not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action still not fired yet' ); - $this->assertTrue( $completed_fired, 'completed action fired' ); - } - - /** - * Test maybe_handle when handling nothing. - * - * @return void - */ - public function test_maybe_handle_nothing() { - // Cancelled action should not be fired. - $cancelled_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_cancelled', function () use ( &$cancelled_fired ) { - $cancelled_fired = true; - } ); - // Paused action should not be fired. - $paused_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_paused', function () use ( &$paused_fired ) { - $paused_fired = true; - } ); - // Resumed action should not be fired. - $resumed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_resumed', function () use ( &$resumed_fired ) { - $resumed_fired = true; - } ); - // Completed action should not be fired. - $completed_fired = false; - add_action( $this->getWPBPProperty( 'identifier' ) . '_completed', function () use ( &$completed_fired ) { - $completed_fired = true; - } ); - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->assertCount( 0, $this->wpbp->get_batches() ); - $this->assertFalse( $cancelled_fired, 'cancelled action not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - - $this->wpbp->maybe_handle(); - $this->assertCount( 0, $this->wpbp->get_batches(), 'after resume all batches processed with maybe_handle' ); - $this->assertFalse( $cancelled_fired, 'cancelled action still not fired yet' ); - $this->assertFalse( $paused_fired, 'paused action not fired yet' ); - $this->assertFalse( $resumed_fired, 'resumed action still not fired yet' ); - $this->assertFalse( $completed_fired, 'completed action not fired yet' ); - } - - /** - * Test is_processing. - * - * @return void - */ - public function test_is_processing() { - $this->assertFalse( $this->wpbp->is_processing(), 'not processing yet' ); - $this->executeWPBPMethod( 'lock_process' ); - $this->assertTrue( $this->wpbp->is_processing(), 'processing' ); - - // With batches to be processed, maybe_handle does nothing as "another instance is processing". - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $this->wpbp->maybe_handle(); - $this->assertCount( 1, $this->wpbp->get_batches() ); - - // Unlock and maybe_handle can process the batch. - $this->executeWPBPMethod( 'unlock_process' ); - $this->assertFalse( $this->wpbp->is_processing(), 'not processing yet' ); - $this->assertCount( 1, $this->wpbp->get_batches() ); - $_REQUEST['nonce'] = wp_create_nonce( $this->getWPBPProperty( 'identifier' ) ); - $this->wpbp->maybe_handle(); - $this->assertCount( 0, $this->wpbp->get_batches() ); - $this->assertFalse( $this->wpbp->is_processing(), 'not left processing on complete' ); - } - - /** - * Test is_queued. - * - * @return void - */ - public function test_is_queued() { - $this->assertFalse( $this->wpbp->is_queued(), 'nothing queued until save' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertFalse( $this->wpbp->is_queued(), 'nothing queued until save' ); - - $this->wpbp->save(); - $this->assertTrue( $this->wpbp->is_queued(), 'queued items exist' ); - - $this->wpbp->push_to_queue( 'wobble' ); - $this->wpbp->save(); - $this->assertTrue( $this->wpbp->is_queued(), 'queued items exist' ); - - $this->wpbp->delete_all(); - $this->assertFalse( $this->wpbp->is_queued(), 'queue emptied' ); - } - - /** - * Test is_active. - * - * @return void - */ - public function test_is_active() { - $this->assertFalse( $this->wpbp->is_active(), 'not queued, processing, paused or cancelling' ); - - // Queued. - $this->wpbp->push_to_queue( 'wibble' ); - $this->assertFalse( $this->wpbp->is_active(), 'nothing queued until save' ); - - $this->wpbp->save(); - $this->assertTrue( $this->wpbp->is_active(), 'queued items exist, so now active' ); - - $this->wpbp->delete_all(); - $this->assertFalse( $this->wpbp->is_active(), 'queue emptied, so no longer active' ); - - // Processing. - $this->executeWPBPMethod( 'lock_process' ); - $this->assertTrue( $this->wpbp->is_active(), 'processing, so now active' ); - - $this->executeWPBPMethod( 'unlock_process' ); - $this->assertFalse( $this->wpbp->is_active(), 'not processing, so no longer active' ); - - // Paused. - $this->wpbp->pause(); - $this->assertTrue( $this->wpbp->is_active(), 'paused, so now active' ); - - $this->wpbp->resume(); - $this->assertFalse( $this->wpbp->is_active(), 'not paused, nothing queued, so no longer active' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertTrue( $this->wpbp->is_active(), 'queued items exist, so now active' ); - $this->wpbp->pause(); - $this->assertTrue( $this->wpbp->is_active(), 'paused, so still active' ); - add_filter( 'pre_http_request', '__return_true' ); - $this->wpbp->resume(); - remove_filter( 'pre_http_request', '__return_true' ); - $this->assertTrue( $this->wpbp->is_active(), 'resumed but with queued items, so still active' ); - $this->wpbp->delete_all(); - $this->assertFalse( $this->wpbp->is_active(), 'queue emptied, so no longer active' ); - - // Cancelled. - add_filter( 'pre_http_request', '__return_true' ); - $this->wpbp->cancel(); - remove_filter( 'pre_http_request', '__return_true' ); - $this->assertTrue( $this->wpbp->is_active(), 'cancelling, so now active' ); - - add_filter( $this->getWPBPProperty( 'identifier' ) . '_wp_die', '__return_false' ); - $this->wpbp->maybe_handle(); - $this->assertFalse( $this->wpbp->is_active(), 'cancel handled, so no longer active' ); - - $this->wpbp->push_to_queue( 'wibble' ); - $this->wpbp->save(); - $this->assertTrue( $this->wpbp->is_active(), 'queued items exist, so now active' ); - add_filter( 'pre_http_request', '__return_true' ); - $this->wpbp->cancel(); - remove_filter( 'pre_http_request', '__return_true' ); - $this->assertTrue( $this->wpbp->is_active(), 'cancelling, so still active' ); - $this->wpbp->maybe_handle(); - $this->assertFalse( $this->wpbp->is_active(), 'cancel handled, queue emptied, so no longer active' ); - } -} diff --git a/vendor/deliciousbrains/wp-background-processing/tests/bootstrap.php b/vendor/deliciousbrains/wp-background-processing/tests/bootstrap.php deleted file mode 100644 index 94036dc18..000000000 --- a/vendor/deliciousbrains/wp-background-processing/tests/bootstrap.php +++ /dev/null @@ -1,38 +0,0 @@ -payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } } diff --git a/vendor/firebase/php-jwt/src/CachedKeySet.php b/vendor/firebase/php-jwt/src/CachedKeySet.php index baf801f13..ee529f9f5 100644 --- a/vendor/firebase/php-jwt/src/CachedKeySet.php +++ b/vendor/firebase/php-jwt/src/CachedKeySet.php @@ -178,6 +178,16 @@ private function keyIdExists(string $keyId): bool } $request = $this->httpFactory->createRequest('GET', $this->jwksUri); $jwksResponse = $this->httpClient->sendRequest($request); + if ($jwksResponse->getStatusCode() !== 200) { + throw new UnexpectedValueException( + sprintf('HTTP Error: %d %s for URI "%s"', + $jwksResponse->getStatusCode(), + $jwksResponse->getReasonPhrase(), + $this->jwksUri, + ), + $jwksResponse->getStatusCode() + ); + } $this->keySet = $this->formatJwksForCache((string) $jwksResponse->getBody()); if (!isset($this->keySet[$keyId])) { diff --git a/vendor/firebase/php-jwt/src/ExpiredException.php b/vendor/firebase/php-jwt/src/ExpiredException.php index 81ba52d43..12fef0944 100644 --- a/vendor/firebase/php-jwt/src/ExpiredException.php +++ b/vendor/firebase/php-jwt/src/ExpiredException.php @@ -2,6 +2,17 @@ namespace Firebase\JWT; -class ExpiredException extends \UnexpectedValueException +class ExpiredException extends \UnexpectedValueException implements JWTExceptionWithPayloadInterface { + private object $payload; + + public function setPayload(object $payload): void + { + $this->payload = $payload; + } + + public function getPayload(): object + { + return $this->payload; + } } diff --git a/vendor/firebase/php-jwt/src/JWK.php b/vendor/firebase/php-jwt/src/JWK.php index c7eff8ae4..63fb2484b 100644 --- a/vendor/firebase/php-jwt/src/JWK.php +++ b/vendor/firebase/php-jwt/src/JWK.php @@ -27,10 +27,16 @@ class JWK private const EC_CURVES = [ 'P-256' => '1.2.840.10045.3.1.7', // Len: 64 'secp256k1' => '1.3.132.0.10', // Len: 64 - // 'P-384' => '1.3.132.0.34', // Len: 96 (not yet supported) + 'P-384' => '1.3.132.0.34', // Len: 96 // 'P-521' => '1.3.132.0.35', // Len: 132 (not supported) ]; + // For keys with "kty" equal to "OKP" (Octet Key Pair), the "crv" parameter must contain the key subtype. + // This library supports the following subtypes: + private const OKP_SUBTYPES = [ + 'Ed25519' => true, // RFC 8037 + ]; + /** * Parse a set of JWK keys * @@ -145,8 +151,28 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key $publicKey = self::createPemFromCrvAndXYCoordinates($jwk['crv'], $jwk['x'], $jwk['y']); return new Key($publicKey, $jwk['alg']); + case 'OKP': + if (isset($jwk['d'])) { + // The key is actually a private key + throw new UnexpectedValueException('Key data must be for a public key'); + } + + if (!isset($jwk['crv'])) { + throw new UnexpectedValueException('crv not set'); + } + + if (empty(self::OKP_SUBTYPES[$jwk['crv']])) { + throw new DomainException('Unrecognised or unsupported OKP key subtype'); + } + + if (empty($jwk['x'])) { + throw new UnexpectedValueException('x not set'); + } + + // This library works internally with EdDSA keys (Ed25519) encoded in standard base64. + $publicKey = JWT::convertBase64urlToBase64($jwk['x']); + return new Key($publicKey, $jwk['alg']); default: - // Currently only RSA is supported break; } @@ -156,7 +182,7 @@ public static function parseKey(array $jwk, string $defaultAlg = null): ?Key /** * Converts the EC JWK values to pem format. * - * @param string $crv The EC curve (only P-256 is supported) + * @param string $crv The EC curve (only P-256 & P-384 is supported) * @param string $x The EC x-coordinate * @param string $y The EC y-coordinate * diff --git a/vendor/firebase/php-jwt/src/JWT.php b/vendor/firebase/php-jwt/src/JWT.php index 7ffb98521..6efcbb56d 100644 --- a/vendor/firebase/php-jwt/src/JWT.php +++ b/vendor/firebase/php-jwt/src/JWT.php @@ -152,24 +152,30 @@ public static function decode( // Check the nbf if it is defined. This is the time that the // token can actually be used. If it's not yet that time, abort. - if (isset($payload->nbf) && $payload->nbf > ($timestamp + static::$leeway)) { - throw new BeforeValidException( - 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->nbf) + if (isset($payload->nbf) && floor($payload->nbf) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with nbf prior to ' . \date(DateTime::ISO8601, (int) $payload->nbf) ); + $ex->setPayload($payload); + throw $ex; } // Check that this token has been created before 'now'. This prevents // using tokens that have been created for later use (and haven't // correctly used the nbf claim). - if (!isset($payload->nbf) && isset($payload->iat) && $payload->iat > ($timestamp + static::$leeway)) { - throw new BeforeValidException( - 'Cannot handle token prior to ' . \date(DateTime::ISO8601, $payload->iat) + if (!isset($payload->nbf) && isset($payload->iat) && floor($payload->iat) > ($timestamp + static::$leeway)) { + $ex = new BeforeValidException( + 'Cannot handle token with iat prior to ' . \date(DateTime::ISO8601, (int) $payload->iat) ); + $ex->setPayload($payload); + throw $ex; } // Check if this token has expired. if (isset($payload->exp) && ($timestamp - static::$leeway) >= $payload->exp) { - throw new ExpiredException('Expired token'); + $ex = new ExpiredException('Expired token'); + $ex->setPayload($payload); + throw $ex; } return $payload; @@ -220,7 +226,7 @@ public static function encode( * * @param string $msg The message to sign * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $key The secret key. - * @param string $alg Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', + * @param string $alg Supported algorithms are 'EdDSA', 'ES384', 'ES256', 'ES256K', 'HS256', * 'HS384', 'HS512', 'RS256', 'RS384', and 'RS512' * * @return string An encrypted message @@ -283,7 +289,7 @@ public static function sign( * * @param string $msg The original message (header and body) * @param string $signature The original signature - * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey + * @param string|resource|OpenSSLAsymmetricKey|OpenSSLCertificate $keyMaterial For Ed*, ES*, HS*, a string key works. for RS*, must be an instance of OpenSSLAsymmetricKey * @param string $alg The algorithm * * @return bool @@ -404,13 +410,28 @@ public static function jsonEncode(array $input): string * @throws InvalidArgumentException invalid base64 characters */ public static function urlsafeB64Decode(string $input): string + { + return \base64_decode(self::convertBase64UrlToBase64($input)); + } + + /** + * Convert a string in the base64url (URL-safe Base64) encoding to standard base64. + * + * @param string $input A Base64 encoded string with URL-safe characters (-_ and no padding) + * + * @return string A Base64 encoded string with standard characters (+/) and padding (=), when + * needed. + * + * @see https://www.rfc-editor.org/rfc/rfc4648 + */ + public static function convertBase64UrlToBase64(string $input): string { $remainder = \strlen($input) % 4; if ($remainder) { $padlen = 4 - $remainder; $input .= \str_repeat('=', $padlen); } - return \base64_decode(\strtr($input, '-_', '+/')); + return \strtr($input, '-_', '+/'); } /** diff --git a/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php b/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php new file mode 100644 index 000000000..7933ed68b --- /dev/null +++ b/vendor/firebase/php-jwt/src/JWTExceptionWithPayloadInterface.php @@ -0,0 +1,20 @@ +pathPrefix = null; - - return; - } - - $this->pathPrefix = rtrim($prefix, '\\/') . $this->pathSeparator; - } - - /** - * Get the path prefix. - * - * @return string|null path prefix or null if pathPrefix is empty - */ - public function getPathPrefix() - { - return $this->pathPrefix; - } - - /** - * Prefix a path. - * - * @param string $path - * - * @return string prefixed path - */ - public function applyPathPrefix($path) - { - return $this->getPathPrefix() . ltrim($path, '\\/'); - } - - /** - * Remove a path prefix. - * - * @param string $path - * - * @return string path without the prefix - */ - public function removePathPrefix($path) - { - return substr($path, strlen((string) $this->getPathPrefix())); - } -} diff --git a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php b/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php deleted file mode 100644 index 25d949ead..000000000 --- a/vendor/league/flysystem/src/Adapter/AbstractFtpAdapter.php +++ /dev/null @@ -1,705 +0,0 @@ -safeStorage = new SafeStorage(); - $this->setConfig($config); - } - - /** - * Set the config. - * - * @param array $config - * - * @return $this - */ - public function setConfig(array $config) - { - foreach ($this->configurable as $setting) { - if ( ! isset($config[$setting])) { - continue; - } - - $method = 'set' . ucfirst($setting); - - if (method_exists($this, $method)) { - $this->$method($config[$setting]); - } - } - - return $this; - } - - /** - * Returns the host. - * - * @return string - */ - public function getHost() - { - return $this->host; - } - - /** - * Set the host. - * - * @param string $host - * - * @return $this - */ - public function setHost($host) - { - $this->host = $host; - - return $this; - } - - /** - * Set the public permission value. - * - * @param int $permPublic - * - * @return $this - */ - public function setPermPublic($permPublic) - { - $this->permPublic = $permPublic; - - return $this; - } - - /** - * Set the private permission value. - * - * @param int $permPrivate - * - * @return $this - */ - public function setPermPrivate($permPrivate) - { - $this->permPrivate = $permPrivate; - - return $this; - } - - /** - * Returns the ftp port. - * - * @return int - */ - public function getPort() - { - return $this->port; - } - - /** - * Returns the root folder to work from. - * - * @return string - */ - public function getRoot() - { - return $this->root; - } - - /** - * Set the ftp port. - * - * @param int|string $port - * - * @return $this - */ - public function setPort($port) - { - $this->port = (int) $port; - - return $this; - } - - /** - * Set the root folder to work from. - * - * @param string $root - * - * @return $this - */ - public function setRoot($root) - { - $this->root = rtrim($root, '\\/') . $this->separator; - - return $this; - } - - /** - * Returns the ftp username. - * - * @return string username - */ - public function getUsername() - { - $username = $this->safeStorage->retrieveSafely('username'); - - return $username !== null ? $username : 'anonymous'; - } - - /** - * Set ftp username. - * - * @param string $username - * - * @return $this - */ - public function setUsername($username) - { - $this->safeStorage->storeSafely('username', $username); - - return $this; - } - - /** - * Returns the password. - * - * @return string password - */ - public function getPassword() - { - return $this->safeStorage->retrieveSafely('password'); - } - - /** - * Set the ftp password. - * - * @param string $password - * - * @return $this - */ - public function setPassword($password) - { - $this->safeStorage->storeSafely('password', $password); - - return $this; - } - - /** - * Returns the amount of seconds before the connection will timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->timeout; - } - - /** - * Set the amount of seconds before the connection should timeout. - * - * @param int $timeout - * - * @return $this - */ - public function setTimeout($timeout) - { - $this->timeout = (int) $timeout; - - return $this; - } - - /** - * Return the FTP system type. - * - * @return string - */ - public function getSystemType() - { - return $this->systemType; - } - - /** - * Set the FTP system type (windows or unix). - * - * @param string $systemType - * - * @return $this - */ - public function setSystemType($systemType) - { - $this->systemType = strtolower($systemType); - - return $this; - } - - /** - * True to enable timestamps for FTP servers that return unix-style listings. - * - * @param bool $bool - * - * @return $this - */ - public function setEnableTimestampsOnUnixListings($bool = false) - { - $this->enableTimestampsOnUnixListings = $bool; - - return $this; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return $this->listDirectoryContents($directory, $recursive); - } - - abstract protected function listDirectoryContents($directory, $recursive = false); - - /** - * Normalize a directory listing. - * - * @param array $listing - * @param string $prefix - * - * @return array directory listing - */ - protected function normalizeListing(array $listing, $prefix = '') - { - $base = $prefix; - $result = []; - $listing = $this->removeDotDirectories($listing); - - while ($item = array_shift($listing)) { - if (preg_match('#^.*:$#', $item)) { - $base = preg_replace('~^\./*|:$~', '', $item); - continue; - } - - $result[] = $this->normalizeObject($item, $base); - } - - return $this->sortListing($result); - } - - /** - * Sort a directory listing. - * - * @param array $result - * - * @return array sorted listing - */ - protected function sortListing(array $result) - { - $compare = function ($one, $two) { - return strnatcmp($one['path'], $two['path']); - }; - - usort($result, $compare); - - return $result; - } - - /** - * Normalize a file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - * - * @throws NotSupportedException - */ - protected function normalizeObject($item, $base) - { - $systemType = $this->systemType ?: $this->detectSystemType($item); - - if ($systemType === 'unix') { - return $this->normalizeUnixObject($item, $base); - } elseif ($systemType === 'windows') { - return $this->normalizeWindowsObject($item, $base); - } - - throw NotSupportedException::forFtpSystemType($systemType); - } - - /** - * Normalize a Unix file entry. - * - * Given $item contains: - * '-rw-r--r-- 1 ftp ftp 409 Aug 19 09:01 file1.txt' - * - * This function will return: - * [ - * 'type' => 'file', - * 'path' => 'file1.txt', - * 'visibility' => 'public', - * 'size' => 409, - * 'timestamp' => 1566205260 - * ] - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeUnixObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 7); - - if (count(explode(' ', $item, 9)) !== 9) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($permissions, /* $number */, /* $owner */, /* $group */, $size, $month, $day, $timeOrYear, $name) = explode(' ', $item, 9); - $type = $this->detectType($permissions); - $path = $base === '' ? $name : $base . $this->separator . $name; - - if ($type === 'dir') { - $result = compact('type', 'path'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - $permissions = $this->normalizePermissions($permissions); - $visibility = $permissions & 0044 ? AdapterInterface::VISIBILITY_PUBLIC : AdapterInterface::VISIBILITY_PRIVATE; - $size = (int) $size; - - $result = compact('type', 'path', 'visibility', 'size'); - if ($this->enableTimestampsOnUnixListings) { - $timestamp = $this->normalizeUnixTimestamp($month, $day, $timeOrYear); - $result += compact('timestamp'); - } - - return $result; - } - - /** - * Only accurate to the minute (current year), or to the day. - * - * Inadequacies in timestamp accuracy are due to limitations of the FTP 'LIST' command - * - * Note: The 'MLSD' command is a machine-readable replacement for 'LIST' - * but many FTP servers do not support it :( - * - * @param string $month e.g. 'Aug' - * @param string $day e.g. '19' - * @param string $timeOrYear e.g. '09:01' OR '2015' - * - * @return int - */ - protected function normalizeUnixTimestamp($month, $day, $timeOrYear) - { - if (is_numeric($timeOrYear)) { - $year = $timeOrYear; - $hour = '00'; - $minute = '00'; - $seconds = '00'; - } else { - $year = date('Y'); - list($hour, $minute) = explode(':', $timeOrYear); - $seconds = '00'; - } - $dateTime = DateTime::createFromFormat('Y-M-j-G:i:s', "{$year}-{$month}-{$day}-{$hour}:{$minute}:{$seconds}"); - - return $dateTime->getTimestamp(); - } - - /** - * Normalize a Windows/DOS file entry. - * - * @param string $item - * @param string $base - * - * @return array normalized file array - */ - protected function normalizeWindowsObject($item, $base) - { - $item = preg_replace('#\s+#', ' ', trim($item), 3); - - if (count(explode(' ', $item, 4)) !== 4) { - throw new RuntimeException("Metadata can't be parsed from item '$item' , not enough parts."); - } - - list($date, $time, $size, $name) = explode(' ', $item, 4); - $path = $base === '' ? $name : $base . $this->separator . $name; - - // Check for the correct date/time format - $format = strlen($date) === 8 ? 'm-d-yH:iA' : 'Y-m-dH:i'; - $dt = DateTime::createFromFormat($format, $date . $time); - $timestamp = $dt ? $dt->getTimestamp() : (int) strtotime("$date $time"); - - if ($size === '') { - $type = 'dir'; - - return compact('type', 'path', 'timestamp'); - } - - $type = 'file'; - $visibility = AdapterInterface::VISIBILITY_PUBLIC; - $size = (int) $size; - - return compact('type', 'path', 'visibility', 'size', 'timestamp'); - } - - /** - * Get the system type from a listing item. - * - * @param string $item - * - * @return string the system type - */ - protected function detectSystemType($item) - { - return preg_match('/^[0-9]{2,4}-[0-9]{2}-[0-9]{2}/', trim($item)) ? 'windows' : 'unix'; - } - - /** - * Get the file type from the permissions. - * - * @param string $permissions - * - * @return string file type - */ - protected function detectType($permissions) - { - return substr($permissions, 0, 1) === 'd' ? 'dir' : 'file'; - } - - /** - * Normalize a permissions string. - * - * @param string $permissions - * - * @return int - */ - protected function normalizePermissions($permissions) - { - if (is_numeric($permissions)) { - return ((int) $permissions) & 0777; - } - - // remove the type identifier - $permissions = substr($permissions, 1); - - // map the string rights to the numeric counterparts - $map = ['-' => '0', 'r' => '4', 'w' => '2', 'x' => '1']; - $permissions = strtr($permissions, $map); - - // split up the permission groups - $parts = str_split($permissions, 3); - - // convert the groups - $mapper = function ($part) { - return array_sum(str_split($part)); - }; - - // converts to decimal number - return octdec(implode('', array_map($mapper, $parts))); - } - - /** - * Filter out dot-directories. - * - * @param array $list - * - * @return array - */ - public function removeDotDirectories(array $list) - { - $filter = function ($line) { - return $line !== '' && ! preg_match('#.* \.(\.)?$|^total#', $line); - }; - - return array_filter($list, $filter); - } - - /** - * @inheritdoc - */ - public function has($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return $this->getMetadata($path); - } - - /** - * Ensure a directory exists. - * - * @param string $dirname - */ - public function ensureDirectory($dirname) - { - $dirname = (string) $dirname; - - if ($dirname !== '' && ! $this->has($dirname)) { - $this->createDir($dirname, new Config()); - } - } - - /** - * @return mixed - */ - public function getConnection() - { - if ( ! $this->isConnected()) { - $this->disconnect(); - $this->connect(); - } - - return $this->connection; - } - - /** - * Get the public permission value. - * - * @return int - */ - public function getPermPublic() - { - return $this->permPublic; - } - - /** - * Get the private permission value. - * - * @return int - */ - public function getPermPrivate() - { - return $this->permPrivate; - } - - /** - * Disconnect on destruction. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Establish a connection. - */ - abstract public function connect(); - - /** - * Close the connection. - */ - abstract public function disconnect(); - - /** - * Check if a connection is active. - * - * @return bool - */ - abstract public function isConnected(); - - protected function escapePath($path) - { - return str_replace(['*', '[', ']'], ['\\*', '\\[', '\\]'], $path); - } -} diff --git a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php b/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php deleted file mode 100644 index fd8d2161e..000000000 --- a/vendor/league/flysystem/src/Adapter/CanOverwriteFiles.php +++ /dev/null @@ -1,12 +0,0 @@ -transferMode = $mode; - - return $this; - } - - /** - * Set if Ssl is enabled. - * - * @param bool $ssl - * - * @return $this - */ - public function setSsl($ssl) - { - $this->ssl = (bool) $ssl; - - return $this; - } - - /** - * Set if passive mode should be used. - * - * @param bool $passive - */ - public function setPassive($passive = true) - { - $this->passive = $passive; - } - - /** - * @param bool $ignorePassiveAddress - */ - public function setIgnorePassiveAddress($ignorePassiveAddress) - { - $this->ignorePassiveAddress = $ignorePassiveAddress; - } - - /** - * @param bool $recurseManually - */ - public function setRecurseManually($recurseManually) - { - $this->recurseManually = $recurseManually; - } - - /** - * @param bool $utf8 - */ - public function setUtf8($utf8) - { - $this->utf8 = (bool) $utf8; - } - - /** - * Connect to the FTP server. - */ - public function connect() - { - $tries = 3; - start_connecting: - - if ($this->ssl) { - $this->connection = @ftp_ssl_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } else { - $this->connection = @ftp_connect($this->getHost(), $this->getPort(), $this->getTimeout()); - } - - if ( ! $this->connection) { - $tries--; - - if ($tries > 0) goto start_connecting; - - throw new ConnectionRuntimeException('Could not connect to host: ' . $this->getHost() . ', port:' . $this->getPort()); - } - - $this->login(); - $this->setUtf8Mode(); - $this->setConnectionPassiveMode(); - $this->setConnectionRoot(); - $this->isPureFtpd = $this->isPureFtpdServer(); - } - - /** - * Set the connection to UTF-8 mode. - */ - protected function setUtf8Mode() - { - if ($this->utf8) { - $response = ftp_raw($this->connection, "OPTS UTF8 ON"); - if (!in_array(substr($response[0], 0, 3), ['200', '202'])) { - throw new ConnectionRuntimeException( - 'Could not set UTF-8 mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - } - - /** - * Set the connections to passive mode. - * - * @throws ConnectionRuntimeException - */ - protected function setConnectionPassiveMode() - { - if (is_bool($this->ignorePassiveAddress) && defined('FTP_USEPASVADDRESS')) { - ftp_set_option($this->connection, FTP_USEPASVADDRESS, ! $this->ignorePassiveAddress); - } - - if ( ! ftp_pasv($this->connection, $this->passive)) { - throw new ConnectionRuntimeException( - 'Could not set passive mode for connection: ' . $this->getHost() . '::' . $this->getPort() - ); - } - } - - /** - * Set the connection root. - */ - protected function setConnectionRoot() - { - $root = $this->getRoot(); - $connection = $this->connection; - - if ($root && ! ftp_chdir($connection, $root)) { - throw new InvalidRootException('Root is invalid or does not exist: ' . $this->getRoot()); - } - - // Store absolute path for further reference. - // This is needed when creating directories and - // initial root was a relative path, else the root - // would be relative to the chdir'd path. - $this->root = ftp_pwd($connection); - } - - /** - * Login. - * - * @throws ConnectionRuntimeException - */ - protected function login() - { - set_error_handler(function () { - }); - $isLoggedIn = ftp_login( - $this->connection, - $this->getUsername(), - $this->getPassword() - ); - restore_error_handler(); - - if ( ! $isLoggedIn) { - $this->disconnect(); - throw new ConnectionRuntimeException( - 'Could not login with connection: ' . $this->getHost() . '::' . $this->getPort( - ) . ', username: ' . $this->getUsername() - ); - } - } - - /** - * Disconnect from the FTP server. - */ - public function disconnect() - { - if ($this->hasFtpConnection()) { - @ftp_close($this->connection); - } - - $this->connection = null; - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $contents); - rewind($stream); - $result = $this->writeStream($path, $stream, $config); - fclose($stream); - - if ($result === false) { - return false; - } - - $result['contents'] = $contents; - $result['mimetype'] = $config->get('mimetype') ?: Util::guessMimeType($path, $contents); - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $this->ensureDirectory(Util::dirname($path)); - - if ( ! ftp_fput($this->getConnection(), $path, $resource, $this->transferMode)) { - return false; - } - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - } - - $type = 'file'; - - return compact('type', 'path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return $this->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return ftp_rename($this->getConnection(), $path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return ftp_delete($this->getConnection(), $path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $connection = $this->getConnection(); - $contents = array_reverse($this->listDirectoryContents($dirname, false)); - - foreach ($contents as $object) { - if ($object['type'] === 'file') { - if ( ! ftp_delete($connection, $object['path'])) { - return false; - } - } elseif ( ! $this->deleteDir($object['path'])) { - return false; - } - } - - return ftp_rmdir($connection, $dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $connection = $this->getConnection(); - $directories = explode('/', $dirname); - - foreach ($directories as $directory) { - if (false === $this->createActualDirectory($directory, $connection)) { - $this->setConnectionRoot(); - - return false; - } - - ftp_chdir($connection, $directory); - } - - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $dirname]; - } - - /** - * Create a directory. - * - * @param string $directory - * @param resource $connection - * - * @return bool - */ - protected function createActualDirectory($directory, $connection) - { - // List the current directory - $listing = ftp_nlist($connection, '.') ?: []; - - foreach ($listing as $key => $item) { - if (preg_match('~^\./.*~', $item)) { - $listing[$key] = substr($item, 2); - } - } - - if (in_array($directory, $listing, true)) { - return true; - } - - return (boolean) ftp_mkdir($connection, $directory); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - if ($path === '') { - return ['type' => 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $listing = $this->ftpRawlist('-A', $path); - - if (empty($listing) || in_array('total 0', $listing, true)) { - return false; - } - - if (preg_match('/.* not found/', $listing[0])) { - return false; - } - - if (preg_match('/^total [0-9]*$/', $listing[0])) { - array_shift($listing); - } - - return $this->normalizeObject($listing[0], ''); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - if ( ! $metadata = $this->getMetadata($path)) { - return false; - } - - $metadata['mimetype'] = MimeType::detectByFilename($path); - - return $metadata; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $timestamp = ftp_mdtm($this->getConnection(), $path); - - return ($timestamp !== -1) ? ['path' => $path, 'timestamp' => $timestamp] : false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - if ( ! $object = $this->readStream($path)) { - return false; - } - - $object['contents'] = stream_get_contents($object['stream']); - fclose($object['stream']); - unset($object['stream']); - - return $object; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $stream = fopen('php://temp', 'w+b'); - $result = ftp_fget($this->getConnection(), $stream, $path, $this->transferMode); - rewind($stream); - - if ( ! $result) { - fclose($stream); - - return false; - } - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $mode = $visibility === AdapterInterface::VISIBILITY_PUBLIC ? $this->getPermPublic() : $this->getPermPrivate(); - - if ( ! ftp_chmod($this->getConnection(), $mode, $path)) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContents($directory, $recursive = true) - { - if ($recursive && $this->recurseManually) { - return $this->listDirectoryContentsRecursive($directory); - } - - $options = $recursive ? '-alnR' : '-aln'; - $listing = $this->ftpRawlist($options, $directory); - - return $listing ? $this->normalizeListing($listing, $directory) : []; - } - - /** - * @inheritdoc - * - * @param string $directory - */ - protected function listDirectoryContentsRecursive($directory) - { - $listing = $this->normalizeListing($this->ftpRawlist('-aln', $directory) ?: [], $directory); - $output = []; - - foreach ($listing as $item) { - $output[] = $item; - if ($item['type'] !== 'dir') { - continue; - } - $output = array_merge($output, $this->listDirectoryContentsRecursive($item['path'])); - } - - return $output; - } - - /** - * Check if the connection is open. - * - * @return bool - * - * @throws ConnectionErrorException - */ - public function isConnected() - { - return $this->hasFtpConnection() && $this->getRawExecResponseCode('NOOP') === 200; - } - - /** - * @return bool - */ - protected function isPureFtpdServer() - { - $response = ftp_raw($this->connection, 'HELP'); - - return stripos(implode(' ', $response), 'Pure-FTPd') !== false; - } - - /** - * The ftp_rawlist function with optional escaping. - * - * @param string $options - * @param string $path - * - * @return array - */ - protected function ftpRawlist($options, $path) - { - $connection = $this->getConnection(); - - if ($this->isPureFtpd) { - $path = str_replace([' ', '[', ']'], ['\ ', '\\[', '\\]'], $path); - } - - return ftp_rawlist($connection, $options . ' ' . $this->escapePath($path)); - } - - private function getRawExecResponseCode($command) - { - $response = @ftp_raw($this->connection, trim($command)) ?: []; - - return (int) preg_replace('/\D/', '', implode(' ', (array) $response)); - } - - private function hasFtpConnection(): bool - { - return is_resource($this->connection) || $this->connection instanceof \FTP\Connection; - } -} diff --git a/vendor/league/flysystem/src/Adapter/Ftpd.php b/vendor/league/flysystem/src/Adapter/Ftpd.php deleted file mode 100644 index 7e71d19f6..000000000 --- a/vendor/league/flysystem/src/Adapter/Ftpd.php +++ /dev/null @@ -1,48 +0,0 @@ - 'dir', 'path' => '']; - } - - if (@ftp_chdir($this->getConnection(), $path) === true) { - $this->setConnectionRoot(); - - return ['type' => 'dir', 'path' => $path]; - } - - $object = ftp_raw($this->getConnection(), 'STAT ' . $this->escapePath($path)); - - if ( ! $object || count($object) < 3) { - return false; - } - - if (substr($object[1], 0, 5) === "ftpd:") { - return false; - } - - return $this->normalizeObject($object[1], ''); - } - - /** - * @inheritdoc - */ - protected function listDirectoryContents($directory, $recursive = true) - { - $listing = ftp_rawlist($this->getConnection(), $this->escapePath($directory), $recursive); - - if ($listing === false || ( ! empty($listing) && substr($listing[0], 0, 5) === "ftpd:")) { - return []; - } - - return $this->normalizeListing($listing, $directory); - } -} diff --git a/vendor/league/flysystem/src/Adapter/Local.php b/vendor/league/flysystem/src/Adapter/Local.php deleted file mode 100644 index 747c463ec..000000000 --- a/vendor/league/flysystem/src/Adapter/Local.php +++ /dev/null @@ -1,533 +0,0 @@ - [ - 'public' => 0644, - 'private' => 0600, - ], - 'dir' => [ - 'public' => 0755, - 'private' => 0700, - ], - ]; - - /** - * @var string - */ - protected $pathSeparator = DIRECTORY_SEPARATOR; - - /** - * @var array - */ - protected $permissionMap; - - /** - * @var int - */ - protected $writeFlags; - - /** - * @var int - */ - private $linkHandling; - - /** - * Constructor. - * - * @param string $root - * @param int $writeFlags - * @param int $linkHandling - * @param array $permissions - * - * @throws LogicException - */ - public function __construct($root, $writeFlags = LOCK_EX, $linkHandling = self::DISALLOW_LINKS, array $permissions = []) - { - $root = is_link($root) ? realpath($root) : $root; - $this->permissionMap = array_replace_recursive(static::$permissions, $permissions); - $this->ensureDirectory($root); - - if ( ! is_dir($root) || ! is_readable($root)) { - throw new LogicException('The root path ' . $root . ' is not readable.'); - } - - $this->setPathPrefix($root); - $this->writeFlags = $writeFlags; - $this->linkHandling = $linkHandling; - } - - /** - * Ensure the root directory exists. - * - * @param string $root root directory path - * - * @return void - * - * @throws Exception in case the root directory can not be created - */ - protected function ensureDirectory($root) - { - if ( ! is_dir($root)) { - $umask = umask(0); - - if ( ! @mkdir($root, $this->permissionMap['dir']['public'], true)) { - $mkdirError = error_get_last(); - } - - umask($umask); - clearstatcache(false, $root); - - if ( ! is_dir($root)) { - $errorMessage = isset($mkdirError['message']) ? $mkdirError['message'] : ''; - throw new Exception(sprintf('Impossible to create the root directory "%s". %s', $root, $errorMessage)); - } - } - } - - /** - * @inheritdoc - */ - public function has($path) - { - $location = $this->applyPathPrefix($path); - - return file_exists($location); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - - if (($size = file_put_contents($location, $contents, $this->writeFlags)) === false) { - return false; - } - - $type = 'file'; - $result = compact('contents', 'type', 'size', 'path'); - - if ($visibility = $config->get('visibility')) { - $result['visibility'] = $visibility; - $this->setVisibility($path, $visibility); - } - - return $result; - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, Config $config) - { - $location = $this->applyPathPrefix($path); - $this->ensureDirectory(dirname($location)); - $stream = fopen($location, 'w+b'); - - if ( ! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) { - return false; - } - - $type = 'file'; - $result = compact('type', 'path'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $location = $this->applyPathPrefix($path); - $stream = fopen($location, 'rb'); - - return ['type' => 'file', 'path' => $path, 'stream' => $stream]; - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, Config $config) - { - return $this->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - $location = $this->applyPathPrefix($path); - $size = file_put_contents($location, $contents, $this->writeFlags); - - if ($size === false) { - return false; - } - - $type = 'file'; - - $result = compact('type', 'path', 'size', 'contents'); - - if ($visibility = $config->get('visibility')) { - $this->setVisibility($path, $visibility); - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function read($path) - { - $location = $this->applyPathPrefix($path); - $contents = @file_get_contents($location); - - if ($contents === false) { - return false; - } - - return ['type' => 'file', 'path' => $path, 'contents' => $contents]; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $parentDirectory = $this->applyPathPrefix(Util::dirname($newpath)); - $this->ensureDirectory($parentDirectory); - - return rename($location, $destination); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $location = $this->applyPathPrefix($path); - $destination = $this->applyPathPrefix($newpath); - $this->ensureDirectory(dirname($destination)); - - return copy($location, $destination); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $location = $this->applyPathPrefix($path); - - return @unlink($location); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $result = []; - $location = $this->applyPathPrefix($directory); - - if ( ! is_dir($location)) { - return []; - } - - $iterator = $recursive ? $this->getRecursiveDirectoryIterator($location) : $this->getDirectoryIterator($location); - - foreach ($iterator as $file) { - $path = $this->getFilePath($file); - - if (preg_match('#(^|/|\\\\)\.{1,2}$#', $path)) { - continue; - } - - $result[] = $this->normalizeFileInfo($file); - } - - unset($iterator); - - return array_filter($result); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $info = new SplFileInfo($location); - - return $this->normalizeFileInfo($info); - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $location = $this->applyPathPrefix($path); - $finfo = new Finfo(FILEINFO_MIME_TYPE); - $mimetype = $finfo->file($location); - - if (in_array($mimetype, ['application/octet-stream', 'inode/x-empty', 'application/x-empty'])) { - $mimetype = Util\MimeType::detectByFilename($location); - } - - return ['path' => $path, 'type' => 'file', 'mimetype' => $mimetype]; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return $this->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $location = $this->applyPathPrefix($path); - clearstatcache(false, $location); - $permissions = octdec(substr(sprintf('%o', fileperms($location)), -4)); - $type = is_dir($location) ? 'dir' : 'file'; - - foreach ($this->permissionMap[$type] as $visibility => $visibilityPermissions) { - if ($visibilityPermissions == $permissions) { - return compact('path', 'visibility'); - } - } - - $visibility = substr(sprintf('%o', fileperms($location)), -4); - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $location = $this->applyPathPrefix($path); - $type = is_dir($location) ? 'dir' : 'file'; - $success = chmod($location, $this->permissionMap[$type][$visibility]); - - if ($success === false) { - return false; - } - - return compact('path', 'visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - $location = $this->applyPathPrefix($dirname); - $umask = umask(0); - $visibility = $config->get('visibility', 'public'); - $return = ['path' => $dirname, 'type' => 'dir']; - - if ( ! is_dir($location)) { - if (false === @mkdir($location, $this->permissionMap['dir'][$visibility], true) - || false === is_dir($location)) { - $return = false; - } - } - - umask($umask); - - return $return; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $location = $this->applyPathPrefix($dirname); - - if ( ! is_dir($location)) { - return false; - } - - $contents = $this->getRecursiveDirectoryIterator($location, RecursiveIteratorIterator::CHILD_FIRST); - - /** @var SplFileInfo $file */ - foreach ($contents as $file) { - $this->guardAgainstUnreadableFileInfo($file); - $this->deleteFileInfoObject($file); - } - - unset($contents); - - return rmdir($location); - } - - /** - * @param SplFileInfo $file - */ - protected function deleteFileInfoObject(SplFileInfo $file) - { - switch ($file->getType()) { - case 'dir': - rmdir($file->getRealPath()); - break; - case 'link': - unlink($file->getPathname()); - break; - default: - unlink($file->getRealPath()); - } - } - - /** - * Normalize the file info. - * - * @param SplFileInfo $file - * - * @return array|void - * - * @throws NotSupportedException - */ - protected function normalizeFileInfo(SplFileInfo $file) - { - if ( ! $file->isLink()) { - return $this->mapFileInfo($file); - } - - if ($this->linkHandling & self::DISALLOW_LINKS) { - throw NotSupportedException::forLink($file); - } - } - - /** - * Get the normalized path from a SplFileInfo object. - * - * @param SplFileInfo $file - * - * @return string - */ - protected function getFilePath(SplFileInfo $file) - { - $location = $file->getPathname(); - $path = $this->removePathPrefix($location); - - return trim(str_replace('\\', '/', $path), '/'); - } - - /** - * @param string $path - * @param int $mode - * - * @return RecursiveIteratorIterator - */ - protected function getRecursiveDirectoryIterator($path, $mode = RecursiveIteratorIterator::SELF_FIRST) - { - return new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($path, FilesystemIterator::SKIP_DOTS), - $mode - ); - } - - /** - * @param string $path - * - * @return DirectoryIterator - */ - protected function getDirectoryIterator($path) - { - $iterator = new DirectoryIterator($path); - - return $iterator; - } - - /** - * @param SplFileInfo $file - * - * @return array - */ - protected function mapFileInfo(SplFileInfo $file) - { - $normalized = [ - 'type' => $file->getType(), - 'path' => $this->getFilePath($file), - ]; - - $normalized['timestamp'] = $file->getMTime(); - - if ($normalized['type'] === 'file') { - $normalized['size'] = $file->getSize(); - } - - return $normalized; - } - - /** - * @param SplFileInfo $file - * - * @throws UnreadableFileException - */ - protected function guardAgainstUnreadableFileInfo(SplFileInfo $file) - { - if ( ! $file->isReadable()) { - throw UnreadableFileException::forFileInfo($file); - } - } -} diff --git a/vendor/league/flysystem/src/Adapter/NullAdapter.php b/vendor/league/flysystem/src/Adapter/NullAdapter.php deleted file mode 100644 index 2527087f7..000000000 --- a/vendor/league/flysystem/src/Adapter/NullAdapter.php +++ /dev/null @@ -1,144 +0,0 @@ -get('visibility')) { - $result['visibility'] = $visibility; - } - - return $result; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, Config $config) - { - return false; - } - - /** - * @inheritdoc - */ - public function read($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - return false; - } - - /** - * @inheritdoc - */ - public function delete($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - return []; - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - return false; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - return compact('visibility'); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, Config $config) - { - return ['path' => $dirname, 'type' => 'dir']; - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - return false; - } -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php deleted file mode 100644 index fc0a747ac..000000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/NotSupportingVisibilityTrait.php +++ /dev/null @@ -1,33 +0,0 @@ -readStream($path); - - if ($response === false || ! is_resource($response['stream'])) { - return false; - } - - $result = $this->writeStream($newpath, $response['stream'], new Config()); - - if ($result !== false && is_resource($response['stream'])) { - fclose($response['stream']); - } - - return $result !== false; - } - - // Required abstract method - - /** - * @param string $path - * - * @return resource - */ - abstract public function readStream($path); - - /** - * @param string $path - * @param resource $resource - * @param Config $config - * - * @return resource - */ - abstract public function writeStream($path, $resource, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php deleted file mode 100644 index 2b31c01d6..000000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedReadingTrait.php +++ /dev/null @@ -1,44 +0,0 @@ -read($path)) { - return false; - } - - $stream = fopen('php://temp', 'w+b'); - fwrite($stream, $data['contents']); - rewind($stream); - $data['stream'] = $stream; - unset($data['contents']); - - return $data; - } - - /** - * Reads a file. - * - * @param string $path - * - * @return array|false - * - * @see League\Flysystem\ReadInterface::read() - */ - abstract public function read($path); -} diff --git a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php b/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php deleted file mode 100644 index 80424960c..000000000 --- a/vendor/league/flysystem/src/Adapter/Polyfill/StreamedTrait.php +++ /dev/null @@ -1,9 +0,0 @@ -stream($path, $resource, $config, 'write'); - } - - /** - * Update a file using a stream. - * - * @param string $path - * @param resource $resource - * @param Config $config Config object or visibility setting - * - * @return mixed false of file metadata - */ - public function updateStream($path, $resource, Config $config) - { - return $this->stream($path, $resource, $config, 'update'); - } - - // Required abstract methods - abstract public function write($pash, $contents, Config $config); - abstract public function update($pash, $contents, Config $config); -} diff --git a/vendor/league/flysystem/src/Adapter/SynologyFtp.php b/vendor/league/flysystem/src/Adapter/SynologyFtp.php deleted file mode 100644 index fe0d344cf..000000000 --- a/vendor/league/flysystem/src/Adapter/SynologyFtp.php +++ /dev/null @@ -1,8 +0,0 @@ -settings = $settings; - } - - /** - * Get a setting. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - public function get($key, $default = null) - { - if ( ! array_key_exists($key, $this->settings)) { - return $this->getDefault($key, $default); - } - - return $this->settings[$key]; - } - - /** - * Check if an item exists by key. - * - * @param string $key - * - * @return bool - */ - public function has($key) - { - if (array_key_exists($key, $this->settings)) { - return true; - } - - return $this->fallback instanceof Config - ? $this->fallback->has($key) - : false; - } - - /** - * Try to retrieve a default setting from a config fallback. - * - * @param string $key - * @param mixed $default - * - * @return mixed config setting or default when not found - */ - protected function getDefault($key, $default) - { - if ( ! $this->fallback) { - return $default; - } - - return $this->fallback->get($key, $default); - } - - /** - * Set a setting. - * - * @param string $key - * @param mixed $value - * - * @return $this - */ - public function set($key, $value) - { - $this->settings[$key] = $value; - - return $this; - } - - /** - * Set the fallback. - * - * @param Config $fallback - * - * @return $this - */ - public function setFallback(Config $fallback) - { - $this->fallback = $fallback; - - return $this; - } -} diff --git a/vendor/league/flysystem/src/ConfigAwareTrait.php b/vendor/league/flysystem/src/ConfigAwareTrait.php deleted file mode 100644 index 202d605da..000000000 --- a/vendor/league/flysystem/src/ConfigAwareTrait.php +++ /dev/null @@ -1,49 +0,0 @@ -config = $config ? Util::ensureConfig($config) : new Config; - } - - /** - * Get the Config. - * - * @return Config config object - */ - public function getConfig() - { - return $this->config; - } - - /** - * Convert a config array to a Config object with the correct fallback. - * - * @param array $config - * - * @return Config - */ - protected function prepareConfig(array $config) - { - $config = new Config($config); - $config->setFallback($this->getConfig()); - - return $config; - } -} diff --git a/vendor/league/flysystem/src/ConnectionErrorException.php b/vendor/league/flysystem/src/ConnectionErrorException.php deleted file mode 100644 index adb651d3d..000000000 --- a/vendor/league/flysystem/src/ConnectionErrorException.php +++ /dev/null @@ -1,9 +0,0 @@ -filesystem->deleteDir($this->path); - } - - /** - * List the directory contents. - * - * @param bool $recursive - * - * @return array|bool directory contents or false - */ - public function getContents($recursive = false) - { - return $this->filesystem->listContents($this->path, $recursive); - } -} diff --git a/vendor/league/flysystem/src/Exception.php b/vendor/league/flysystem/src/Exception.php deleted file mode 100644 index 4596c0a9a..000000000 --- a/vendor/league/flysystem/src/Exception.php +++ /dev/null @@ -1,8 +0,0 @@ -filesystem->has($this->path); - } - - /** - * Read the file. - * - * @return string|false file contents - */ - public function read() - { - return $this->filesystem->read($this->path); - } - - /** - * Read the file as a stream. - * - * @return resource|false file stream - */ - public function readStream() - { - return $this->filesystem->readStream($this->path); - } - - /** - * Write the new file. - * - * @param string $content - * - * @return bool success boolean - */ - public function write($content) - { - return $this->filesystem->write($this->path, $content); - } - - /** - * Write the new file using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function writeStream($resource) - { - return $this->filesystem->writeStream($this->path, $resource); - } - - /** - * Update the file contents. - * - * @param string $content - * - * @return bool success boolean - */ - public function update($content) - { - return $this->filesystem->update($this->path, $content); - } - - /** - * Update the file contents with a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function updateStream($resource) - { - return $this->filesystem->updateStream($this->path, $resource); - } - - /** - * Create the file or update if exists. - * - * @param string $content - * - * @return bool success boolean - */ - public function put($content) - { - return $this->filesystem->put($this->path, $content); - } - - /** - * Create the file or update if exists using a stream. - * - * @param resource $resource - * - * @return bool success boolean - */ - public function putStream($resource) - { - return $this->filesystem->putStream($this->path, $resource); - } - - /** - * Rename the file. - * - * @param string $newpath - * - * @return bool success boolean - */ - public function rename($newpath) - { - if ($this->filesystem->rename($this->path, $newpath)) { - $this->path = $newpath; - - return true; - } - - return false; - } - - /** - * Copy the file. - * - * @param string $newpath - * - * @return File|false new file or false - */ - public function copy($newpath) - { - if ($this->filesystem->copy($this->path, $newpath)) { - return new File($this->filesystem, $newpath); - } - - return false; - } - - /** - * Get the file's timestamp. - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp() - { - return $this->filesystem->getTimestamp($this->path); - } - - /** - * Get the file's mimetype. - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype() - { - return $this->filesystem->getMimetype($this->path); - } - - /** - * Get the file's visibility. - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility() - { - return $this->filesystem->getVisibility($this->path); - } - - /** - * Get the file's metadata. - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata() - { - return $this->filesystem->getMetadata($this->path); - } - - /** - * Get the file size. - * - * @return int|false The file size or false on failure. - */ - public function getSize() - { - return $this->filesystem->getSize($this->path); - } - - /** - * Delete the file. - * - * @return bool success boolean - */ - public function delete() - { - return $this->filesystem->delete($this->path); - } -} diff --git a/vendor/league/flysystem/src/FileExistsException.php b/vendor/league/flysystem/src/FileExistsException.php deleted file mode 100644 index c82e20c16..000000000 --- a/vendor/league/flysystem/src/FileExistsException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File already exists at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/FileNotFoundException.php b/vendor/league/flysystem/src/FileNotFoundException.php deleted file mode 100644 index 989df69bb..000000000 --- a/vendor/league/flysystem/src/FileNotFoundException.php +++ /dev/null @@ -1,37 +0,0 @@ -path = $path; - - parent::__construct('File not found at path: ' . $this->getPath(), $code, $previous); - } - - /** - * Get the path which was not found. - * - * @return string - */ - public function getPath() - { - return $this->path; - } -} diff --git a/vendor/league/flysystem/src/Filesystem.php b/vendor/league/flysystem/src/Filesystem.php deleted file mode 100644 index c4eaf2781..000000000 --- a/vendor/league/flysystem/src/Filesystem.php +++ /dev/null @@ -1,409 +0,0 @@ -adapter = $adapter; - $this->setConfig($config); - } - - /** - * Get the Adapter. - * - * @return AdapterInterface adapter - */ - public function getAdapter() - { - return $this->adapter; - } - - /** - * @inheritdoc - */ - public function has($path) - { - $path = Util::normalizePath($path); - - return strlen($path) === 0 ? false : (bool) $this->getAdapter()->has($path); - } - - /** - * @inheritdoc - */ - public function write($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function writeStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $this->assertAbsent($path); - $config = $this->prepareConfig($config); - - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function put($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - return (bool) $this->getAdapter()->write($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function putStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - Util::rewindStream($resource); - - if ( ! $this->getAdapter() instanceof CanOverwriteFiles && $this->has($path)) { - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - return (bool) $this->getAdapter()->writeStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function readAndDelete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - $contents = $this->read($path); - - if ($contents === false) { - return false; - } - - $this->delete($path); - - return $contents; - } - - /** - * @inheritdoc - */ - public function update($path, $contents, array $config = []) - { - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - - $this->assertPresent($path); - - return (bool) $this->getAdapter()->update($path, $contents, $config); - } - - /** - * @inheritdoc - */ - public function updateStream($path, $resource, array $config = []) - { - if ( ! is_resource($resource) || get_resource_type($resource) !== 'stream') { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #2 to be a valid resource.'); - } - - $path = Util::normalizePath($path); - $config = $this->prepareConfig($config); - $this->assertPresent($path); - Util::rewindStream($resource); - - return (bool) $this->getAdapter()->updateStream($path, $resource, $config); - } - - /** - * @inheritdoc - */ - public function read($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! ($object = $this->getAdapter()->read($path))) { - return false; - } - - return $object['contents']; - } - - /** - * @inheritdoc - */ - public function readStream($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if ( ! $object = $this->getAdapter()->readStream($path)) { - return false; - } - - return $object['stream']; - } - - /** - * @inheritdoc - */ - public function rename($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return (bool) $this->getAdapter()->rename($path, $newpath); - } - - /** - * @inheritdoc - */ - public function copy($path, $newpath) - { - $path = Util::normalizePath($path); - $newpath = Util::normalizePath($newpath); - $this->assertPresent($path); - $this->assertAbsent($newpath); - - return $this->getAdapter()->copy($path, $newpath); - } - - /** - * @inheritdoc - */ - public function delete($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->delete($path); - } - - /** - * @inheritdoc - */ - public function deleteDir($dirname) - { - $dirname = Util::normalizePath($dirname); - - if ($dirname === '') { - throw new RootViolationException('Root directories can not be deleted.'); - } - - return (bool) $this->getAdapter()->deleteDir($dirname); - } - - /** - * @inheritdoc - */ - public function createDir($dirname, array $config = []) - { - $dirname = Util::normalizePath($dirname); - $config = $this->prepareConfig($config); - - return (bool) $this->getAdapter()->createDir($dirname, $config); - } - - /** - * @inheritdoc - */ - public function listContents($directory = '', $recursive = false) - { - $directory = Util::normalizePath($directory); - $contents = $this->getAdapter()->listContents($directory, $recursive); - - return (new ContentListingFormatter($directory, $recursive, $this->config->get('case_sensitive', true))) - ->formatListing($contents); - } - - /** - * @inheritdoc - */ - public function getMimetype($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getMimetype($path)) || ! array_key_exists('mimetype', $object)) { - return false; - } - - return $object['mimetype']; - } - - /** - * @inheritdoc - */ - public function getTimestamp($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getTimestamp($path)) || ! array_key_exists('timestamp', $object)) { - return false; - } - - return (int) $object['timestamp']; - } - - /** - * @inheritdoc - */ - public function getVisibility($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getVisibility($path)) || ! array_key_exists('visibility', $object)) { - return false; - } - - return $object['visibility']; - } - - /** - * @inheritdoc - */ - public function getSize($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - if (( ! $object = $this->getAdapter()->getSize($path)) || ! array_key_exists('size', $object)) { - return false; - } - - return (int) $object['size']; - } - - /** - * @inheritdoc - */ - public function setVisibility($path, $visibility) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return (bool) $this->getAdapter()->setVisibility($path, $visibility); - } - - /** - * @inheritdoc - */ - public function getMetadata($path) - { - $path = Util::normalizePath($path); - $this->assertPresent($path); - - return $this->getAdapter()->getMetadata($path); - } - - /** - * @inheritdoc - */ - public function get($path, Handler $handler = null) - { - $path = Util::normalizePath($path); - - if ( ! $handler) { - $metadata = $this->getMetadata($path); - $handler = ($metadata && $metadata['type'] === 'file') ? new File($this, $path) : new Directory($this, $path); - } - - $handler->setPath($path); - $handler->setFilesystem($this); - - return $handler; - } - - /** - * Assert a file is present. - * - * @param string $path path to file - * - * @throws FileNotFoundException - * - * @return void - */ - public function assertPresent($path) - { - if ($this->config->get('disable_asserts', false) === false && ! $this->has($path)) { - throw new FileNotFoundException($path); - } - } - - /** - * Assert a file is absent. - * - * @param string $path path to file - * - * @throws FileExistsException - * - * @return void - */ - public function assertAbsent($path) - { - if ($this->config->get('disable_asserts', false) === false && $this->has($path)) { - throw new FileExistsException($path); - } - } -} diff --git a/vendor/league/flysystem/src/FilesystemException.php b/vendor/league/flysystem/src/FilesystemException.php deleted file mode 100644 index 3121e533d..000000000 --- a/vendor/league/flysystem/src/FilesystemException.php +++ /dev/null @@ -1,7 +0,0 @@ -path = $path; - $this->filesystem = $filesystem; - } - - /** - * Check whether the entree is a directory. - * - * @return bool - */ - public function isDir() - { - return $this->getType() === 'dir'; - } - - /** - * Check whether the entree is a file. - * - * @return bool - */ - public function isFile() - { - return $this->getType() === 'file'; - } - - /** - * Retrieve the entree type (file|dir). - * - * @return string file or dir - */ - public function getType() - { - $metadata = $this->filesystem->getMetadata($this->path); - - return $metadata ? $metadata['type'] : 'dir'; - } - - /** - * Set the Filesystem object. - * - * @param FilesystemInterface $filesystem - * - * @return $this - */ - public function setFilesystem(FilesystemInterface $filesystem) - { - $this->filesystem = $filesystem; - - return $this; - } - - /** - * Retrieve the Filesystem object. - * - * @return FilesystemInterface - */ - public function getFilesystem() - { - return $this->filesystem; - } - - /** - * Set the entree path. - * - * @param string $path - * - * @return $this - */ - public function setPath($path) - { - $this->path = $path; - - return $this; - } - - /** - * Retrieve the entree path. - * - * @return string path - */ - public function getPath() - { - return $this->path; - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @return mixed - */ - public function __call($method, array $arguments) - { - array_unshift($arguments, $this->path); - $callback = [$this->filesystem, $method]; - - try { - return call_user_func_array($callback, $arguments); - } catch (BadMethodCallException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_called_class() - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/InvalidRootException.php b/vendor/league/flysystem/src/InvalidRootException.php deleted file mode 100644 index 468d1d58c..000000000 --- a/vendor/league/flysystem/src/InvalidRootException.php +++ /dev/null @@ -1,9 +0,0 @@ - Filesystem,] - * - * @throws InvalidArgumentException - */ - public function __construct(array $filesystems = []) - { - $this->mountFilesystems($filesystems); - } - - /** - * Mount filesystems. - * - * @param FilesystemInterface[] $filesystems [:prefix => Filesystem,] - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystems(array $filesystems) - { - foreach ($filesystems as $prefix => $filesystem) { - $this->mountFilesystem($prefix, $filesystem); - } - - return $this; - } - - /** - * Mount filesystems. - * - * @param string $prefix - * @param FilesystemInterface $filesystem - * - * @throws InvalidArgumentException - * - * @return $this - */ - public function mountFilesystem($prefix, FilesystemInterface $filesystem) - { - if ( ! is_string($prefix)) { - throw new InvalidArgumentException(__METHOD__ . ' expects argument #1 to be a string.'); - } - - $this->filesystems[$prefix] = $filesystem; - - return $this; - } - - /** - * Get the filesystem with the corresponding prefix. - * - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return FilesystemInterface - */ - public function getFilesystem($prefix) - { - if ( ! isset($this->filesystems[$prefix])) { - throw new FilesystemNotFoundException('No filesystem mounted with prefix ' . $prefix); - } - - return $this->filesystems[$prefix]; - } - - /** - * Retrieve the prefix from an arguments array. - * - * @param array $arguments - * - * @throws InvalidArgumentException - * - * @return array [:prefix, :arguments] - */ - public function filterPrefix(array $arguments) - { - if (empty($arguments)) { - throw new InvalidArgumentException('At least one argument needed'); - } - - $path = array_shift($arguments); - - if ( ! is_string($path)) { - throw new InvalidArgumentException('First argument should be a string'); - } - - list($prefix, $path) = $this->getPrefixAndPath($path); - array_unshift($arguments, $path); - - return [$prefix, $arguments]; - } - - /** - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listContents($directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $filesystem = $this->getFilesystem($prefix); - $result = $filesystem->listContents($directory, $recursive); - - foreach ($result as &$file) { - $file['filesystem'] = $prefix; - } - - return $result; - } - - /** - * Call forwarder. - * - * @param string $method - * @param array $arguments - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function __call($method, $arguments) - { - list($prefix, $arguments) = $this->filterPrefix($arguments); - - return $this->invokePluginOnFilesystem($method, $arguments, $prefix); - } - - /** - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * @throws FileExistsException - * - * @return bool - */ - public function copy($from, $to, array $config = []) - { - list($prefixFrom, $from) = $this->getPrefixAndPath($from); - - $buffer = $this->getFilesystem($prefixFrom)->readStream($from); - - if ($buffer === false) { - return false; - } - - list($prefixTo, $to) = $this->getPrefixAndPath($to); - - $result = $this->getFilesystem($prefixTo)->writeStream($to, $buffer, $config); - - if (is_resource($buffer)) { - fclose($buffer); - } - - return $result; - } - - /** - * List with plugin adapter. - * - * @param array $keys - * @param string $directory - * @param bool $recursive - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return array - */ - public function listWith(array $keys = [], $directory = '', $recursive = false) - { - list($prefix, $directory) = $this->getPrefixAndPath($directory); - $arguments = [$keys, $directory, $recursive]; - - return $this->invokePluginOnFilesystem('listWith', $arguments, $prefix); - } - - /** - * Move a file. - * - * @param string $from - * @param string $to - * @param array $config - * - * @throws InvalidArgumentException - * @throws FilesystemNotFoundException - * - * @return bool - */ - public function move($from, $to, array $config = []) - { - list($prefixFrom, $pathFrom) = $this->getPrefixAndPath($from); - list($prefixTo, $pathTo) = $this->getPrefixAndPath($to); - - if ($prefixFrom === $prefixTo) { - $filesystem = $this->getFilesystem($prefixFrom); - $renamed = $filesystem->rename($pathFrom, $pathTo); - - if ($renamed && isset($config['visibility'])) { - return $filesystem->setVisibility($pathTo, $config['visibility']); - } - - return $renamed; - } - - $copied = $this->copy($from, $to, $config); - - if ($copied) { - return $this->delete($from); - } - - return false; - } - - /** - * Invoke a plugin on a filesystem mounted on a given prefix. - * - * @param string $method - * @param array $arguments - * @param string $prefix - * - * @throws FilesystemNotFoundException - * - * @return mixed - */ - public function invokePluginOnFilesystem($method, $arguments, $prefix) - { - $filesystem = $this->getFilesystem($prefix); - - try { - return $this->invokePlugin($method, $arguments, $filesystem); - } catch (PluginNotFoundException $e) { - // Let it pass, it's ok, don't panic. - } - - $callback = [$filesystem, $method]; - - return call_user_func_array($callback, $arguments); - } - - /** - * @param string $path - * - * @throws InvalidArgumentException - * - * @return string[] [:prefix, :path] - */ - protected function getPrefixAndPath($path) - { - if (strpos($path, '://') < 1) { - throw new InvalidArgumentException('No prefix detected in path: ' . $path); - } - - return explode('://', $path, 2); - } - - /** - * Check whether a file exists. - * - * @param string $path - * - * @return bool - */ - public function has($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->has($path); - } - - /** - * Read a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents or false on failure. - */ - public function read($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->read($path); - } - - /** - * Retrieves a read-stream for a path. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return resource|false The path resource or false on failure. - */ - public function readStream($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readStream($path); - } - - /** - * Get a file's metadata. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return array|false The file metadata or false on failure. - */ - public function getMetadata($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMetadata($path); - } - - /** - * Get a file's size. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return int|false The file size or false on failure. - */ - public function getSize($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getSize($path); - } - - /** - * Get a file's mime-type. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file mime-type or false on failure. - */ - public function getMimetype($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getMimetype($path); - } - - /** - * Get a file's timestamp. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The timestamp or false on failure. - */ - public function getTimestamp($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getTimestamp($path); - } - - /** - * Get a file's visibility. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The visibility (public|private) or false on failure. - */ - public function getVisibility($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->getVisibility($path); - } - - /** - * Write a new file. - * - * @param string $path The path of the new file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function write($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->write($path, $contents, $config); - } - - /** - * Write a new file using a stream. - * - * @param string $path The path of the new file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileExistsException - * - * @return bool True on success, false on failure. - */ - public function writeStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->writeStream($path, $resource, $config); - } - - /** - * Update an existing file. - * - * @param string $path The path of the existing file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function update($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->update($path, $contents, $config); - } - - /** - * Update an existing file using a stream. - * - * @param string $path The path of the existing file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException If $resource is not a file handle. - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function updateStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->updateStream($path, $resource, $config); - } - - /** - * Rename a file. - * - * @param string $path Path to the existing file. - * @param string $newpath The new path of the file. - * - * @throws FileExistsException Thrown if $newpath exists. - * @throws FileNotFoundException Thrown if $path does not exist. - * - * @return bool True on success, false on failure. - */ - public function rename($path, $newpath) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->rename($path, $newpath); - } - - /** - * Delete a file. - * - * @param string $path - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function delete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->delete($path); - } - - /** - * Delete a directory. - * - * @param string $dirname - * - * @throws RootViolationException Thrown if $dirname is empty. - * - * @return bool True on success, false on failure. - */ - public function deleteDir($dirname) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->deleteDir($dirname); - } - - /** - * Create a directory. - * - * @param string $dirname The name of the new directory. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function createDir($dirname, array $config = []) - { - list($prefix, $dirname) = $this->getPrefixAndPath($dirname); - - return $this->getFilesystem($prefix)->createDir($dirname); - } - - /** - * Set the visibility for a file. - * - * @param string $path The path to the file. - * @param string $visibility One of 'public' or 'private'. - * - * @throws FileNotFoundException - * - * @return bool True on success, false on failure. - */ - public function setVisibility($path, $visibility) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->setVisibility($path, $visibility); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param string $contents The file contents. - * @param array $config An optional configuration array. - * - * @return bool True on success, false on failure. - */ - public function put($path, $contents, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->put($path, $contents, $config); - } - - /** - * Create a file or update if exists. - * - * @param string $path The path to the file. - * @param resource $resource The file handle. - * @param array $config An optional configuration array. - * - * @throws InvalidArgumentException Thrown if $resource is not a resource. - * - * @return bool True on success, false on failure. - */ - public function putStream($path, $resource, array $config = []) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->putStream($path, $resource, $config); - } - - /** - * Read and delete a file. - * - * @param string $path The path to the file. - * - * @throws FileNotFoundException - * - * @return string|false The file contents, or false on failure. - */ - public function readAndDelete($path) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->readAndDelete($path); - } - - /** - * Get a file/directory handler. - * - * @deprecated - * - * @param string $path The path to the file. - * @param Handler $handler An optional existing handler to populate. - * - * @return Handler Either a file or directory handler. - */ - public function get($path, Handler $handler = null) - { - list($prefix, $path) = $this->getPrefixAndPath($path); - - return $this->getFilesystem($prefix)->get($path); - } -} diff --git a/vendor/league/flysystem/src/NotSupportedException.php b/vendor/league/flysystem/src/NotSupportedException.php deleted file mode 100644 index e0a989b22..000000000 --- a/vendor/league/flysystem/src/NotSupportedException.php +++ /dev/null @@ -1,37 +0,0 @@ -getPathname()); - } - - /** - * Create a new exception for a link. - * - * @param string $systemType - * - * @return static - */ - public static function forFtpSystemType($systemType) - { - $message = "The FTP system type '$systemType' is currently not supported."; - - return new static($message); - } -} diff --git a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php b/vendor/league/flysystem/src/Plugin/AbstractPlugin.php deleted file mode 100644 index 0d5678976..000000000 --- a/vendor/league/flysystem/src/Plugin/AbstractPlugin.php +++ /dev/null @@ -1,24 +0,0 @@ -filesystem = $filesystem; - } -} diff --git a/vendor/league/flysystem/src/Plugin/EmptyDir.php b/vendor/league/flysystem/src/Plugin/EmptyDir.php deleted file mode 100644 index b5ae7f582..000000000 --- a/vendor/league/flysystem/src/Plugin/EmptyDir.php +++ /dev/null @@ -1,34 +0,0 @@ -filesystem->listContents($dirname, false); - - foreach ($listing as $item) { - if ($item['type'] === 'dir') { - $this->filesystem->deleteDir($item['path']); - } else { - $this->filesystem->delete($item['path']); - } - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedCopy.php b/vendor/league/flysystem/src/Plugin/ForcedCopy.php deleted file mode 100644 index a41e9f3ae..000000000 --- a/vendor/league/flysystem/src/Plugin/ForcedCopy.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->copy($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ForcedRename.php b/vendor/league/flysystem/src/Plugin/ForcedRename.php deleted file mode 100644 index 3f51cd607..000000000 --- a/vendor/league/flysystem/src/Plugin/ForcedRename.php +++ /dev/null @@ -1,44 +0,0 @@ -filesystem->delete($newpath); - } catch (FileNotFoundException $e) { - // The destination path does not exist. That's ok. - $deleted = true; - } - - if ($deleted) { - return $this->filesystem->rename($path, $newpath); - } - - return false; - } -} diff --git a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php b/vendor/league/flysystem/src/Plugin/GetWithMetadata.php deleted file mode 100644 index 2f13d2fd2..000000000 --- a/vendor/league/flysystem/src/Plugin/GetWithMetadata.php +++ /dev/null @@ -1,51 +0,0 @@ -filesystem->getMetadata($path); - - if ( ! $object) { - return false; - } - - $keys = array_diff($metadata, array_keys($object)); - - foreach ($keys as $key) { - if ( ! method_exists($this->filesystem, $method = 'get' . ucfirst($key))) { - throw new InvalidArgumentException('Could not fetch metadata: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($path); - } - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListFiles.php b/vendor/league/flysystem/src/Plugin/ListFiles.php deleted file mode 100644 index 9669fe7e7..000000000 --- a/vendor/league/flysystem/src/Plugin/ListFiles.php +++ /dev/null @@ -1,35 +0,0 @@ -filesystem->listContents($directory, $recursive); - - $filter = function ($object) { - return $object['type'] === 'file'; - }; - - return array_values(array_filter($contents, $filter)); - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListPaths.php b/vendor/league/flysystem/src/Plugin/ListPaths.php deleted file mode 100644 index 0889d1f8d..000000000 --- a/vendor/league/flysystem/src/Plugin/ListPaths.php +++ /dev/null @@ -1,36 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $object) { - $result[] = $object['path']; - } - - return $result; - } -} diff --git a/vendor/league/flysystem/src/Plugin/ListWith.php b/vendor/league/flysystem/src/Plugin/ListWith.php deleted file mode 100644 index d64debeca..000000000 --- a/vendor/league/flysystem/src/Plugin/ListWith.php +++ /dev/null @@ -1,60 +0,0 @@ -filesystem->listContents($directory, $recursive); - - foreach ($contents as $index => $object) { - if ($object['type'] === 'file') { - $missingKeys = array_diff($keys, array_keys($object)); - $contents[$index] = array_reduce($missingKeys, [$this, 'getMetadataByName'], $object); - } - } - - return $contents; - } - - /** - * Get a meta-data value by key name. - * - * @param array $object - * @param string $key - * - * @return array - */ - protected function getMetadataByName(array $object, $key) - { - $method = 'get' . ucfirst($key); - - if ( ! method_exists($this->filesystem, $method)) { - throw new \InvalidArgumentException('Could not get meta-data for key: ' . $key); - } - - $object[$key] = $this->filesystem->{$method}($object['path']); - - return $object; - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluggableTrait.php b/vendor/league/flysystem/src/Plugin/PluggableTrait.php deleted file mode 100644 index 922edfe52..000000000 --- a/vendor/league/flysystem/src/Plugin/PluggableTrait.php +++ /dev/null @@ -1,97 +0,0 @@ -plugins[$plugin->getMethod()] = $plugin; - - return $this; - } - - /** - * Find a specific plugin. - * - * @param string $method - * - * @throws PluginNotFoundException - * - * @return PluginInterface - */ - protected function findPlugin($method) - { - if ( ! isset($this->plugins[$method])) { - throw new PluginNotFoundException('Plugin not found for method: ' . $method); - } - - return $this->plugins[$method]; - } - - /** - * Invoke a plugin by method name. - * - * @param string $method - * @param array $arguments - * @param FilesystemInterface $filesystem - * - * @throws PluginNotFoundException - * - * @return mixed - */ - protected function invokePlugin($method, array $arguments, FilesystemInterface $filesystem) - { - $plugin = $this->findPlugin($method); - $plugin->setFilesystem($filesystem); - $callback = [$plugin, 'handle']; - - return call_user_func_array($callback, $arguments); - } - - /** - * Plugins pass-through. - * - * @param string $method - * @param array $arguments - * - * @throws BadMethodCallException - * - * @return mixed - */ - public function __call($method, array $arguments) - { - try { - return $this->invokePlugin($method, $arguments, $this); - } catch (PluginNotFoundException $e) { - throw new BadMethodCallException( - 'Call to undefined method ' - . get_class($this) - . '::' . $method - ); - } - } -} diff --git a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php b/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php deleted file mode 100644 index fd1d7e7e3..000000000 --- a/vendor/league/flysystem/src/Plugin/PluginNotFoundException.php +++ /dev/null @@ -1,10 +0,0 @@ -hash = spl_object_hash($this); - static::$safeStorage[$this->hash] = []; - } - - public function storeSafely($key, $value) - { - static::$safeStorage[$this->hash][$key] = $value; - } - - public function retrieveSafely($key) - { - if (array_key_exists($key, static::$safeStorage[$this->hash])) { - return static::$safeStorage[$this->hash][$key]; - } - } - - public function __destruct() - { - unset(static::$safeStorage[$this->hash]); - } -} diff --git a/vendor/league/flysystem/src/UnreadableFileException.php b/vendor/league/flysystem/src/UnreadableFileException.php deleted file mode 100644 index e66803383..000000000 --- a/vendor/league/flysystem/src/UnreadableFileException.php +++ /dev/null @@ -1,18 +0,0 @@ -getRealPath() - ) - ); - } -} diff --git a/vendor/league/flysystem/src/Util.php b/vendor/league/flysystem/src/Util.php deleted file mode 100644 index 1a2db718d..000000000 --- a/vendor/league/flysystem/src/Util.php +++ /dev/null @@ -1,354 +0,0 @@ - '']; - } - - /** - * Normalize a dirname return value. - * - * @param string $dirname - * - * @return string normalized dirname - */ - public static function normalizeDirname($dirname) - { - return $dirname === '.' ? '' : $dirname; - } - - /** - * Get a normalized dirname from a path. - * - * @param string $path - * - * @return string dirname - */ - public static function dirname($path) - { - return static::normalizeDirname(dirname($path)); - } - - /** - * Map result arrays. - * - * @param array $object - * @param array $map - * - * @return array mapped result - */ - public static function map(array $object, array $map) - { - $result = []; - - foreach ($map as $from => $to) { - if ( ! isset($object[$from])) { - continue; - } - - $result[$to] = $object[$from]; - } - - return $result; - } - - /** - * Normalize path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizePath($path) - { - return static::normalizeRelativePath($path); - } - - /** - * Normalize relative directories in a path. - * - * @param string $path - * - * @throws LogicException - * - * @return string - */ - public static function normalizeRelativePath($path) - { - $path = str_replace('\\', '/', $path); - $path = static::removeFunkyWhiteSpace($path); - $parts = []; - - foreach (explode('/', $path) as $part) { - switch ($part) { - case '': - case '.': - break; - - case '..': - if (empty($parts)) { - throw new LogicException( - 'Path is outside of the defined root, path: [' . $path . ']' - ); - } - array_pop($parts); - break; - - default: - $parts[] = $part; - break; - } - } - - $path = implode('/', $parts); - - return $path; - } - - /** - * Rejects unprintable characters and invalid unicode characters. - * - * @param string $path - * - * @return string $path - */ - protected static function removeFunkyWhiteSpace($path) - { - if (preg_match('#\p{C}+#u', $path)) { - throw CorruptedPathDetected::forPath($path); - } - - return $path; - } - - /** - * Normalize prefix. - * - * @param string $prefix - * @param string $separator - * - * @return string normalized path - */ - public static function normalizePrefix($prefix, $separator) - { - return rtrim($prefix, $separator) . $separator; - } - - /** - * Get content size. - * - * @param string $contents - * - * @return int content size - */ - public static function contentSize($contents) - { - return defined('MB_OVERLOAD_STRING') ? mb_strlen($contents, '8bit') : strlen($contents); - } - - /** - * Guess MIME Type based on the path of the file and it's content. - * - * @param string $path - * @param string|resource $content - * - * @return string|null MIME Type or NULL if no extension detected - */ - public static function guessMimeType($path, $content) - { - $mimeType = MimeType::detectByContent($content); - - if ( ! (empty($mimeType) || in_array($mimeType, ['application/x-empty', 'text/plain', 'text/x-asm']))) { - return $mimeType; - } - - return MimeType::detectByFilename($path); - } - - /** - * Emulate directories. - * - * @param array $listing - * - * @return array listing with emulated directories - */ - public static function emulateDirectories(array $listing) - { - $directories = []; - $listedDirectories = []; - - foreach ($listing as $object) { - [$directories, $listedDirectories] = static::emulateObjectDirectories($object, $directories, $listedDirectories); - } - - $directories = array_diff(array_unique($directories), array_unique($listedDirectories)); - - foreach ($directories as $directory) { - $listing[] = static::pathinfo($directory) + ['type' => 'dir']; - } - - return $listing; - } - - /** - * Ensure a Config instance. - * - * @param null|array|Config $config - * - * @return Config config instance - * - * @throw LogicException - */ - public static function ensureConfig($config) - { - if ($config === null) { - return new Config(); - } - - if ($config instanceof Config) { - return $config; - } - - if (is_array($config)) { - return new Config($config); - } - - throw new LogicException('A config should either be an array or a Flysystem\Config object.'); - } - - /** - * Rewind a stream. - * - * @param resource $resource - */ - public static function rewindStream($resource) - { - if (ftell($resource) !== 0 && static::isSeekableStream($resource)) { - rewind($resource); - } - } - - public static function isSeekableStream($resource) - { - $metadata = stream_get_meta_data($resource); - - return $metadata['seekable']; - } - - /** - * Get the size of a stream. - * - * @param resource $resource - * - * @return int|null stream size - */ - public static function getStreamSize($resource) - { - $stat = fstat($resource); - - if ( ! is_array($stat) || ! isset($stat['size'])) { - return null; - } - - return $stat['size']; - } - - /** - * Emulate the directories of a single object. - * - * @param array $object - * @param array $directories - * @param array $listedDirectories - * - * @return array - */ - protected static function emulateObjectDirectories(array $object, array $directories, array $listedDirectories) - { - if ($object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - } - - if ( ! isset($object['dirname']) || trim($object['dirname']) === '') { - return [$directories, $listedDirectories]; - } - - $parent = $object['dirname']; - - while (isset($parent) && trim($parent) !== '' && ! in_array($parent, $directories)) { - $directories[] = $parent; - $parent = static::dirname($parent); - } - - if (isset($object['type']) && $object['type'] === 'dir') { - $listedDirectories[] = $object['path']; - - return [$directories, $listedDirectories]; - } - - return [$directories, $listedDirectories]; - } - - /** - * Returns the trailing name component of the path. - * - * @param string $path - * - * @return string - */ - private static function basename($path) - { - $separators = DIRECTORY_SEPARATOR === '/' ? '/' : '\/'; - - $path = rtrim($path, $separators); - - $basename = preg_replace('#.*?([^' . preg_quote($separators, '#') . ']+$)#', '$1', $path); - - if (DIRECTORY_SEPARATOR === '/') { - return $basename; - } - // @codeCoverageIgnoreStart - // Extra Windows path munging. This is tested via AppVeyor, but code - // coverage is not reported. - - // Handle relative paths with drive letters. c:file.txt. - while (preg_match('#^[a-zA-Z]{1}:[^\\\/]#', $basename)) { - $basename = substr($basename, 2); - } - - // Remove colon for standalone drive letter names. - if (preg_match('#^[a-zA-Z]{1}:$#', $basename)) { - $basename = rtrim($basename, ':'); - } - - return $basename; - // @codeCoverageIgnoreEnd - } -} diff --git a/vendor/league/flysystem/src/Util/ContentListingFormatter.php b/vendor/league/flysystem/src/Util/ContentListingFormatter.php deleted file mode 100644 index ae0d3b91d..000000000 --- a/vendor/league/flysystem/src/Util/ContentListingFormatter.php +++ /dev/null @@ -1,122 +0,0 @@ -directory = rtrim($directory, '/'); - $this->recursive = $recursive; - $this->caseSensitive = $caseSensitive; - } - - /** - * Format contents listing. - * - * @param array $listing - * - * @return array - */ - public function formatListing(array $listing) - { - $listing = array_filter(array_map([$this, 'addPathInfo'], $listing), [$this, 'isEntryOutOfScope']); - - return $this->sortListing(array_values($listing)); - } - - private function addPathInfo(array $entry) - { - return $entry + Util::pathinfo($entry['path']); - } - - /** - * Determine if the entry is out of scope. - * - * @param array $entry - * - * @return bool - */ - private function isEntryOutOfScope(array $entry) - { - if (empty($entry['path']) && $entry['path'] !== '0') { - return false; - } - - if ($this->recursive) { - return $this->residesInDirectory($entry); - } - - return $this->isDirectChild($entry); - } - - /** - * Check if the entry resides within the parent directory. - * - * @param array $entry - * - * @return bool - */ - private function residesInDirectory(array $entry) - { - if ($this->directory === '') { - return true; - } - - return $this->caseSensitive - ? strpos($entry['path'], $this->directory . '/') === 0 - : stripos($entry['path'], $this->directory . '/') === 0; - } - - /** - * Check if the entry is a direct child of the directory. - * - * @param array $entry - * - * @return bool - */ - private function isDirectChild(array $entry) - { - return $this->caseSensitive - ? $entry['dirname'] === $this->directory - : strcasecmp($this->directory, $entry['dirname']) === 0; - } - - /** - * @param array $listing - * - * @return array - */ - private function sortListing(array $listing) - { - usort($listing, function ($a, $b) { - return strcasecmp($a['path'], $b['path']); - }); - - return $listing; - } -} diff --git a/vendor/league/flysystem/src/Util/MimeType.php b/vendor/league/flysystem/src/Util/MimeType.php deleted file mode 100644 index 35cba3fb8..000000000 --- a/vendor/league/flysystem/src/Util/MimeType.php +++ /dev/null @@ -1,80 +0,0 @@ -detectMimeTypeFromBuffer($content); - } - - return 'text/plain'; - } - - /** - * Detects MIME Type based on file extension. - * - * @param string $extension - * - * @return string MIME Type - */ - public static function detectByFileExtension($extension) - { - return static::detector()->detectMimeTypeFromPath('artificial.' . $extension) ?: 'text/plain'; - } - - /** - * @param string $filename - * - * @return string MIME Type - */ - public static function detectByFilename($filename) - { - return static::detector()->detectMimeTypeFromPath($filename) ?: 'text/plain'; - } - - /** - * @return array Map of file extension to MIME Type - */ - public static function getExtensionToMimeTypeMap() - { - return static::$extensionToMimeTypeMap; - } -} diff --git a/vendor/league/flysystem/src/Util/StreamHasher.php b/vendor/league/flysystem/src/Util/StreamHasher.php deleted file mode 100644 index 938ec5db7..000000000 --- a/vendor/league/flysystem/src/Util/StreamHasher.php +++ /dev/null @@ -1,36 +0,0 @@ -algo = $algo; - } - - /** - * @param resource $resource - * - * @return string - */ - public function hash($resource) - { - rewind($resource); - $context = hash_init($this->algo); - hash_update_stream($context, $resource); - fclose($resource); - - return hash_final($context); - } -} diff --git a/vendor/league/mime-type-detection/CHANGELOG.md b/vendor/league/mime-type-detection/CHANGELOG.md deleted file mode 100644 index 2264f7ad8..000000000 --- a/vendor/league/mime-type-detection/CHANGELOG.md +++ /dev/null @@ -1,31 +0,0 @@ -# Changelog - -## 1.10.0 - 2022-04-11 - -### Fixed - -- Added Flysystem v1 inconclusive mime-types and made it configurable as a constructor parameter. - -## 1.9.0 - 2021-11-21 - -### Updated - -- Updated lookup - -## 1.8.0 - 2021-09-25 - -### Added - -- Added the decorator `OverridingExtensionToMimeTypeMap` which allows you to override values. - -## 1.7.0 - 2021-01-18 - -### Added - -- Added a `bufferSampleSize` parameter to the `FinfoMimeTypeDetector` class that allows you to send a reduced content sample which costs less memory. - -## 1.6.0 - 2021-01-18 - -### Changes - -- Updated generated mime-type map diff --git a/vendor/league/mime-type-detection/LICENSE b/vendor/league/mime-type-detection/LICENSE deleted file mode 100644 index 1f0165218..000000000 --- a/vendor/league/mime-type-detection/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013-2022 Frank de Jonge - -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/league/mime-type-detection/composer.json b/vendor/league/mime-type-detection/composer.json deleted file mode 100644 index 80ca1af81..000000000 --- a/vendor/league/mime-type-detection/composer.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "league/mime-type-detection", - "description": "Mime-type detection for Flysystem", - "license": "MIT", - "authors": [ - { - "name": "Frank de Jonge", - "email": "info@frankdejonge.nl" - } - ], - "scripts": { - "test": "vendor/bin/phpunit", - "phpstan": "vendor/bin/phpstan analyse -l 6 src" - }, - "require": { - "php": "^7.2 || ^8.0", - "ext-fileinfo": "*" - }, - "require-dev": { - "phpunit/phpunit": "^8.5.8 || ^9.3", - "phpstan/phpstan": "^0.12.68", - "friendsofphp/php-cs-fixer": "^3.2" - }, - "autoload": { - "psr-4": { - "League\\MimeTypeDetection\\": "src" - } - }, - "config": { - "platform": { - "php": "7.2.0" - } - } -} diff --git a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php deleted file mode 100644 index fc0424161..000000000 --- a/vendor/league/mime-type-detection/src/EmptyExtensionToMimeTypeMap.php +++ /dev/null @@ -1,13 +0,0 @@ -extensions = $extensions ?: new GeneratedExtensionToMimeTypeMap(); - } - - public function detectMimeType(string $path, $contents): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensions->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return null; - } -} diff --git a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php deleted file mode 100644 index 1dad7bc1a..000000000 --- a/vendor/league/mime-type-detection/src/ExtensionToMimeTypeMap.php +++ /dev/null @@ -1,10 +0,0 @@ - - */ - private $inconclusiveMimetypes; - - public function __construct( - string $magicFile = '', - ExtensionToMimeTypeMap $extensionMap = null, - ?int $bufferSampleSize = null, - array $inconclusiveMimetypes = self::INCONCLUSIVE_MIME_TYPES - ) { - $this->finfo = new finfo(FILEINFO_MIME_TYPE, $magicFile); - $this->extensionMap = $extensionMap ?: new GeneratedExtensionToMimeTypeMap(); - $this->bufferSampleSize = $bufferSampleSize; - $this->inconclusiveMimetypes = $inconclusiveMimetypes; - } - - public function detectMimeType(string $path, $contents): ?string - { - $mimeType = is_string($contents) - ? (@$this->finfo->buffer($this->takeSample($contents)) ?: null) - : null; - - if ($mimeType !== null && ! in_array($mimeType, $this->inconclusiveMimetypes)) { - return $mimeType; - } - - return $this->detectMimeTypeFromPath($path); - } - - public function detectMimeTypeFromPath(string $path): ?string - { - $extension = strtolower(pathinfo($path, PATHINFO_EXTENSION)); - - return $this->extensionMap->lookupMimeType($extension); - } - - public function detectMimeTypeFromFile(string $path): ?string - { - return @$this->finfo->file($path) ?: null; - } - - public function detectMimeTypeFromBuffer(string $contents): ?string - { - return @$this->finfo->buffer($this->takeSample($contents)) ?: null; - } - - private function takeSample(string $contents): string - { - if ($this->bufferSampleSize === null) { - return $contents; - } - - return (string) substr($contents, 0, $this->bufferSampleSize); - } -} diff --git a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php b/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php deleted file mode 100644 index f092388dd..000000000 --- a/vendor/league/mime-type-detection/src/GeneratedExtensionToMimeTypeMap.php +++ /dev/null @@ -1,1227 +0,0 @@ - 'application/vnd.1000minds.decision-model+xml', - '3dml' => 'text/vnd.in3d.3dml', - '3ds' => 'image/x-3ds', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gp', - '3gpp' => 'video/3gpp', - '3mf' => 'model/3mf', - '7z' => 'application/x-7z-compressed', - '7zip' => 'application/x-7z-compressed', - '123' => 'application/vnd.lotus-1-2-3', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-acc', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/vnd.nokia.n-gage.ac+xml', - 'ac3' => 'audio/ac3', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'age' => 'application/vnd.age', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/pdf', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'amr' => 'audio/amr', - 'apk' => 'application/vnd.android.package-archive', - 'apng' => 'image/apng', - 'appcache' => 'text/cache-manifest', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'arc' => 'application/x-freearc', - 'arj' => 'application/x-arj', - 'asc' => 'application/pgp-signature', - 'asf' => 'video/x-ms-asf', - 'asm' => 'text/x-asm', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomdeleted' => 'application/atomdeleted+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/x-au', - 'avci' => 'image/avci', - 'avcs' => 'image/avcs', - 'avi' => 'video/x-msvideo', - 'avif' => 'image/avif', - 'aw' => 'application/applixware', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azv' => 'image/vnd.airzip.accelerator.azv', - 'azw' => 'application/vnd.amazon.ebook', - 'b16' => 'image/vnd.pco.b16', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bdoc' => 'application/x-bdoc', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'blb' => 'application/x-blorb', - 'blorb' => 'application/x-blorb', - 'bmi' => 'application/vnd.bmi', - 'bmml' => 'application/vnd.balsamiq.bmml+xml', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'bpmn' => 'application/octet-stream', - 'bsp' => 'model/vnd.valve.source.compiled-map', - 'btif' => 'image/prs.btif', - 'buffer' => 'application/octet-stream', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'cab' => 'application/vnd.ms-cab-compressed', - 'caf' => 'audio/x-caf', - 'cap' => 'application/vnd.tcpdump.pcap', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cb7' => 'application/x-cbr', - 'cba' => 'application/x-cbr', - 'cbr' => 'application/x-cbr', - 'cbt' => 'application/x-cbr', - 'cbz' => 'application/x-cbr', - 'cc' => 'text/x-c', - 'cco' => 'application/x-cocoa', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdfx' => 'application/cdfx+xml', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdr' => 'application/cdr', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfs' => 'application/x-cfs-compressed', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cjs' => 'application/node', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/octet-stream', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'coffee' => 'text/coffeescript', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpl' => 'application/cpl+xml', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'crx' => 'application/x-chrome-extension', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'csh' => 'application/x-csh', - 'csl' => 'application/vnd.citationstyles.style+xml', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'csr' => 'application/octet-stream', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dart' => 'application/vnd.dart', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dbf' => 'application/vnd.dbf', - 'dbk' => 'application/docbook+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'ddf' => 'application/vnd.syncml.dmddf+xml', - 'dds' => 'image/vnd.ms-dds', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dgc' => 'application/x-dgc-compressed', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'disposition-notification' => 'message/disposition-notification', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/octet-stream', - 'dmg' => 'application/x-apple-diskimage', - 'dmn' => 'application/octet-stream', - 'dmp' => 'application/vnd.tcpdump.pcap', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroEnabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'drle' => 'image/dicom-rle', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvb' => 'video/vnd.dvb.file', - 'dvi' => 'application/x-dvi', - 'dwd' => 'application/atsc-dwd+xml', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ear' => 'application/java-archive', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'emf' => 'image/emf', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'emotionml' => 'application/emotionml+xml', - 'emz' => 'application/x-msmetafile', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es' => 'application/ecmascript', - 'es3' => 'application/vnd.eszigno3+xml', - 'esa' => 'application/vnd.osgi.subsystem', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'eva' => 'application/x-eva', - 'evy' => 'application/x-envoy', - 'exe' => 'application/octet-stream', - 'exi' => 'application/exi', - 'exp' => 'application/express', - 'exr' => 'image/aces', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/mp4', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcdt' => 'application/vnd.adobe.formscentral.fcdt', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fdt' => 'application/fdt+xml', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fits' => 'image/fits', - 'flac' => 'audio/x-flac', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'fo' => 'application/vnd.software602.filler.form+xml', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gam' => 'application/x-tads', - 'gbr' => 'application/rpki-ghostbusters', - 'gca' => 'application/x-gca-compressed', - 'gdl' => 'model/vnd.gdl', - 'gdoc' => 'application/vnd.google-apps.document', - 'ged' => 'text/vnd.familysearch.gedcom', - 'geo' => 'application/vnd.dynageo', - 'geojson' => 'application/geo+json', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'glb' => 'model/gltf-binary', - 'gltf' => 'model/gltf+json', - 'gml' => 'application/gml+xml', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gpg' => 'application/gpg-keys', - 'gph' => 'application/vnd.flographit', - 'gpx' => 'application/gpx+xml', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gramps' => 'application/x-gramps-xml', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gsheet' => 'application/vnd.google-apps.spreadsheet', - 'gslides' => 'application/vnd.google-apps.presentation', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxf' => 'application/gxf', - 'gxt' => 'application/vnd.geonext', - 'gz' => 'application/gzip', - 'gzip' => 'application/gzip', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hbs' => 'text/x-handlebars-template', - 'hdd' => 'application/x-virtualbox-hdd', - 'hdf' => 'application/x-hdf', - 'heic' => 'image/heic', - 'heics' => 'image/heic-sequence', - 'heif' => 'image/heif', - 'heifs' => 'image/heif-sequence', - 'hej2' => 'image/hej2k', - 'held' => 'application/atsc-held+xml', - 'hh' => 'text/x-c', - 'hjson' => 'application/hjson', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hsj2' => 'image/hsj2', - 'htc' => 'text/x-component', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'img' => 'application/octet-stream', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ink' => 'application/inkml+xml', - 'inkml' => 'application/inkml+xml', - 'install' => 'application/x-install-instructions', - 'iota' => 'application/vnd.astraea-software.iota', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/x-iso9660-image', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'its' => 'application/its+xml', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jade' => 'text/jade', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'jardiff' => 'application/x-java-archive-diff', - 'java' => 'text/x-java-source', - 'jhc' => 'image/jphc', - 'jisp' => 'application/vnd.jisp', - 'jls' => 'image/jls', - 'jlt' => 'application/vnd.hp-jlyt', - 'jng' => 'image/x-jng', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jp2' => 'image/jp2', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpf' => 'image/jpx', - 'jpg' => 'image/jpeg', - 'jpg2' => 'image/jp2', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jph' => 'image/jph', - 'jpm' => 'video/jpm', - 'jpx' => 'image/jpx', - 'js' => 'application/javascript', - 'json' => 'application/json', - 'json5' => 'application/json5', - 'jsonld' => 'application/ld+json', - 'jsonml' => 'application/jsonml+json', - 'jsx' => 'text/jsx', - 'jxr' => 'image/jxr', - 'jxra' => 'image/jxra', - 'jxrs' => 'image/jxrs', - 'jxs' => 'image/jxs', - 'jxsc' => 'image/jxsc', - 'jxsi' => 'image/jxsi', - 'jxss' => 'image/jxss', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kdb' => 'application/octet-stream', - 'kdbx' => 'application/x-keepass2', - 'key' => 'application/x-iwork-keynote-sffkey', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'kpxx' => 'application/vnd.ds-keypoint', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktx2' => 'image/ktx2', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'less' => 'text/less', - 'lgr' => 'application/lgr+xml', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'litcoffee' => 'text/coffeescript', - 'lnk' => 'application/x-ms-shortcut', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lua' => 'text/x-lua', - 'luac' => 'application/x-lua-bytecode', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm1v' => 'video/mpeg', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'text/plain', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/x-m4a', - 'm4p' => 'application/mp4', - 'm4s' => 'video/iso.segment', - 'm4u' => 'application/vnd.mpegurl', - 'm4v' => 'video/x-m4v', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm21' => 'application/mp21', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'maei' => 'application/mmt-aei+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'manifest' => 'text/cache-manifest', - 'map' => 'application/json', - 'mar' => 'application/octet-stream', - 'markdown' => 'text/markdown', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'md' => 'text/markdown', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'mdx' => 'text/mdx', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'metalink' => 'application/metalink+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mft' => 'application/rpki-manifest', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mie' => 'application/x-mie', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mjs' => 'application/javascript', - 'mk3d' => 'video/x-matroska', - 'mka' => 'audio/x-matroska', - 'mkd' => 'text/x-markdown', - 'mks' => 'video/x-matroska', - 'mkv' => 'video/x-matroska', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mml' => 'text/mathml', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mng' => 'video/x-mng', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mp21' => 'application/mp21', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpd' => 'application/dash+xml', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpf' => 'application/media-policy-dataset+xml', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msg' => 'application/vnd.ms-outlook', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msm' => 'application/octet-stream', - 'msp' => 'application/octet-stream', - 'msty' => 'application/vnd.muvee.style', - 'mtl' => 'model/mtl', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musd' => 'application/mmt-usd+xml', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mvt' => 'application/vnd.mapbox-vector-tile', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxmf' => 'audio/mobile-xmf', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'nfo' => 'text/x-nfo', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nitf' => 'application/vnd.nitf', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nq' => 'application/n-quads', - 'nsc' => 'application/x-conference', - 'nsf' => 'application/vnd.lotus-notes', - 'nt' => 'application/n-triples', - 'ntf' => 'application/vnd.nitf', - 'numbers' => 'application/x-iwork-numbers-sffnumbers', - 'nzb' => 'application/x-nzb', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'obgx' => 'application/vnd.openblox.game+xml', - 'obj' => 'model/obj', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogex' => 'model/vnd.opengex', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'omdoc' => 'application/omdoc+xml', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'opml' => 'text/x-opml', - 'oprc' => 'application/vnd.palm', - 'opus' => 'audio/ogg', - 'org' => 'text/x-org', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'osm' => 'application/vnd.openstreetmap.data+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'font/otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'ova' => 'application/x-virtualbox-ova', - 'ovf' => 'application/x-virtualbox-ovf', - 'owl' => 'application/rdf+xml', - 'oxps' => 'application/oxps', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p7a' => 'application/x-pkcs7-signature', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'p10' => 'application/x-pkcs10', - 'p12' => 'application/x-pkcs12', - 'pac' => 'application/x-ns-proxy-autoconfig', - 'pages' => 'application/x-iwork-pages-sffpages', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcap' => 'application/vnd.tcpdump.pcap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/x-pilot', - 'pde' => 'text/x-processing', - 'pdf' => 'application/pdf', - 'pem' => 'application/x-x509-user-cert', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp', - 'phar' => 'application/octet-stream', - 'php' => 'application/x-httpd-php', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'phtml' => 'application/x-httpd-php', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'pkpass' => 'application/vnd.apple.pkpass', - 'pl' => 'application/x-perl', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pm' => 'application/x-perl', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppa' => 'application/vnd.ms-powerpoint', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroEnabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroEnabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroEnabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'model/prc', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'provx' => 'application/provenance+xml', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'application/x-photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'pti' => 'image/prs.pti', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'raml' => 'application/raml+yaml', - 'rapd' => 'application/route-apd+xml', - 'rar' => 'application/x-rar', - 'ras' => 'image/x-cmu-raster', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'relo' => 'application/p2p-overlay+xml', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'ris' => 'application/x-research-info-systems', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'audio/x-pn-realaudio', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rmvb' => 'application/vnd.rn-realmedia-vbr', - 'rnc' => 'application/relax-ng-compact-syntax', - 'rng' => 'application/xml', - 'roa' => 'application/rpki-roa', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsa' => 'application/x-pkcs7', - 'rsat' => 'application/atsc-rsat+xml', - 'rsd' => 'application/rsd+xml', - 'rsheet' => 'application/urc-ressheet+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'text/rtf', - 'rtx' => 'text/richtext', - 'run' => 'application/x-makeself', - 'rusd' => 'application/route-usd+xml', - 'rv' => 'video/vnd.rn-realvideo', - 's' => 'text/x-asm', - 's3m' => 'audio/s3m', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sass' => 'text/x-sass', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scss' => 'text/x-scss', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'sea' => 'application/octet-stream', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'senmlx' => 'application/senml+xml', - 'sensmlx' => 'application/sensml+xml', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sfv' => 'text/x-sfv', - 'sgi' => 'image/sgi', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shex' => 'text/shex', - 'shf' => 'application/shf+xml', - 'shtml' => 'text/html', - 'sid' => 'image/x-mrsid-image', - 'sieve' => 'application/sieve', - 'sig' => 'application/pgp-signature', - 'sil' => 'audio/silk', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'siv' => 'application/sieve', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slim' => 'text/slim', - 'slm' => 'text/slim', - 'sls' => 'application/route-s-tsid+xml', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'smv' => 'video/x-smv', - 'smzip' => 'application/vnd.stepmania.package', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spdx' => 'text/spdx', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'sql' => 'application/x-sql', - 'src' => 'application/x-wais-source', - 'srt' => 'application/x-subrip', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'ssdl' => 'application/ssdl+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'sst' => 'application/octet-stream', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'model/stl', - 'stpx' => 'model/step+xml', - 'stpxz' => 'model/step-xml+zip', - 'stpz' => 'model/step+zip', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'styl' => 'text/stylus', - 'stylus' => 'text/stylus', - 'sub' => 'text/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'swidtag' => 'application/swid+xml', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 't3' => 'application/x-t3vm-image', - 't38' => 'image/t38', - 'taglet' => 'application/vnd.mynfc', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tap' => 'image/vnd.tencent.tap', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'td' => 'application/urc-targetdesc+xml', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'tfx' => 'image/tiff-fx', - 'tga' => 'image/x-tga', - 'tgz' => 'application/x-tar', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tk' => 'application/x-tcl', - 'tmo' => 'application/vnd.tmobile-livetv', - 'toml' => 'application/toml', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trig' => 'application/trig', - 'trm' => 'application/x-msterminal', - 'ts' => 'video/mp2t', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'font/collection', - 'ttf' => 'font/ttf', - 'ttl' => 'text/turtle', - 'ttml' => 'application/ttml+xml', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u3d' => 'model/u3d', - 'u8dsn' => 'message/global-delivery-status', - 'u8hdr' => 'message/global-headers', - 'u8mdn' => 'message/global-disposition-notification', - 'u8msg' => 'message/global', - 'u32' => 'application/x-authorware-bin', - 'ubj' => 'application/ubjson', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'ulx' => 'application/x-glulx', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'usdz' => 'model/vnd.usdz+zip', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvvz' => 'application/vnd.dece.zip', - 'uvx' => 'application/vnd.dece.unspecified', - 'uvz' => 'application/vnd.dece.zip', - 'vbox' => 'application/x-virtualbox-vbox', - 'vbox-extpack' => 'application/x-virtualbox-vbox-extpack', - 'vcard' => 'text/vcard', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vdi' => 'application/x-virtualbox-vdi', - 'vds' => 'model/vnd.sap.vds', - 'vhd' => 'application/x-virtualbox-vhd', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vlc' => 'application/videolan', - 'vmdk' => 'application/x-virtualbox-vmdk', - 'vob' => 'video/x-ms-vob', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtf' => 'image/vnd.valve.source.texture', - 'vtt' => 'text/vtt', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wadl' => 'application/vnd.sun.wadl+xml', - 'war' => 'application/java-archive', - 'wasm' => 'application/wasm', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'wdp' => 'image/vnd.ms-photo', - 'weba' => 'audio/webm', - 'webapp' => 'application/x-web-app-manifest+json', - 'webm' => 'video/webm', - 'webmanifest' => 'application/manifest+json', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wif' => 'application/watcherinfo+xml', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'image/wmf', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-msmetafile', - 'woff' => 'font/woff', - 'woff2' => 'font/woff2', - 'word' => 'application/msword', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsc' => 'message/vnd.wfa.wsc', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x3d' => 'model/x3d+xml', - 'x3db' => 'model/x3d+fastinfoset', - 'x3dbz' => 'model/x3d+binary', - 'x3dv' => 'model/x3d-vrml', - 'x3dvz' => 'model/x3d+vrml', - 'x3dz' => 'model/x3d+xml', - 'x32' => 'application/x-authorware-bin', - 'x_b' => 'model/vnd.parasolid.transmit.binary', - 'x_t' => 'model/vnd.parasolid.transmit.text', - 'xaml' => 'application/xaml+xml', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xav' => 'application/xcap-att+xml', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xca' => 'application/xcap-caps+xml', - 'xcs' => 'application/calendar+xml', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xel' => 'application/xcap-el+xml', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xl' => 'application/excel', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlf' => 'application/xliff+xml', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroEnabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroEnabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xm' => 'audio/xm', - 'xml' => 'application/xml', - 'xns' => 'application/xcap-ns+xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpl' => 'application/xproc+xml', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsd' => 'application/xml', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'xz' => 'application/x-xz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'ymp' => 'text/x-suse-ymp', - 'z' => 'application/x-compress', - 'z1' => 'application/x-zmachine', - 'z2' => 'application/x-zmachine', - 'z3' => 'application/x-zmachine', - 'z4' => 'application/x-zmachine', - 'z5' => 'application/x-zmachine', - 'z6' => 'application/x-zmachine', - 'z7' => 'application/x-zmachine', - 'z8' => 'application/x-zmachine', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml', - 'zsh' => 'text/x-scriptzsh', - ]; - - public function lookupMimeType(string $extension): ?string - { - return self::MIME_TYPES_FOR_EXTENSIONS[$extension] ?? null; - } -} diff --git a/vendor/league/mime-type-detection/src/MimeTypeDetector.php b/vendor/league/mime-type-detection/src/MimeTypeDetector.php deleted file mode 100644 index 5d799d2a8..000000000 --- a/vendor/league/mime-type-detection/src/MimeTypeDetector.php +++ /dev/null @@ -1,19 +0,0 @@ - $overrides - */ - public function __construct(ExtensionToMimeTypeMap $innerMap, array $overrides) - { - $this->innerMap = $innerMap; - $this->overrides = $overrides; - } - - public function lookupMimeType(string $extension): ?string - { - return $this->overrides[$extension] ?? $this->innerMap->lookupMimeType($extension); - } -} diff --git a/vendor/psr/container/.gitignore b/vendor/psr/container/.gitignore deleted file mode 100644 index b2395aa05..000000000 --- a/vendor/psr/container/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -composer.lock -composer.phar -/vendor/ diff --git a/vendor/psr/container/LICENSE b/vendor/psr/container/LICENSE deleted file mode 100644 index 2877a4894..000000000 --- a/vendor/psr/container/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2016 container-interop -Copyright (c) 2016 PHP Framework Interoperability Group - -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/psr/container/README.md b/vendor/psr/container/README.md deleted file mode 100644 index 1b9d9e570..000000000 --- a/vendor/psr/container/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Container interface -============== - -This repository holds all interfaces related to [PSR-11 (Container Interface)][psr-url]. - -Note that this is not a Container implementation of its own. It is merely abstractions that describe the components of a Dependency Injection Container. - -The installable [package][package-url] and [implementations][implementation-url] are listed on Packagist. - -[psr-url]: https://www.php-fig.org/psr/psr-11/ -[package-url]: https://packagist.org/packages/psr/container -[implementation-url]: https://packagist.org/providers/psr/container-implementation - diff --git a/vendor/psr/container/composer.json b/vendor/psr/container/composer.json deleted file mode 100644 index baf6cd1a0..000000000 --- a/vendor/psr/container/composer.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "psr/container", - "type": "library", - "description": "Common Container Interface (PHP FIG PSR-11)", - "keywords": ["psr", "psr-11", "container", "container-interop", "container-interface"], - "homepage": "https://github.com/php-fig/container", - "license": "MIT", - "authors": [ - { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" - } - ], - "require": { - "php": ">=7.4.0" - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - } -} diff --git a/vendor/psr/container/src/ContainerExceptionInterface.php b/vendor/psr/container/src/ContainerExceptionInterface.php deleted file mode 100644 index 0f213f2fe..000000000 --- a/vendor/psr/container/src/ContainerExceptionInterface.php +++ /dev/null @@ -1,12 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\CompleteCommand; -use Symfony\Component\Console\Command\DumpCompletionCommand; -use Symfony\Component\Console\Command\HelpCommand; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\Command\ListCommand; -use Symfony\Component\Console\Command\SignalableCommandInterface; -use Symfony\Component\Console\CommandLoader\CommandLoaderInterface; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Exception\NamespaceNotFoundException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\DebugFormatterHelper; -use Symfony\Component\Console\Helper\FormatterHelper; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Helper\ProcessHelper; -use Symfony\Component\Console\Helper\QuestionHelper; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\ArrayInput; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\SignalRegistry\SignalRegistry; -use Symfony\Component\Console\Style\SymfonyStyle; -use Symfony\Component\ErrorHandler\ErrorHandler; -use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; -use Symfony\Contracts\Service\ResetInterface; - -/** - * An Application is the container for a collection of commands. - * - * It is the main entry point of a Console application. - * - * This class is optimized for a standard CLI environment. - * - * Usage: - * - * $app = new Application('myapp', '1.0 (stable)'); - * $app->add(new SimpleCommand()); - * $app->run(); - * - * @author Fabien Potencier - */ -class Application implements ResetInterface -{ - private $commands = []; - private $wantHelps = false; - private $runningCommand; - private $name; - private $version; - private $commandLoader; - private $catchExceptions = true; - private $autoExit = true; - private $definition; - private $helperSet; - private $dispatcher; - private $terminal; - private $defaultCommand; - private $singleCommand = false; - private $initialized; - private $signalRegistry; - private $signalsToDispatchEvent = []; - - public function __construct(string $name = 'UNKNOWN', string $version = 'UNKNOWN') - { - $this->name = $name; - $this->version = $version; - $this->terminal = new Terminal(); - $this->defaultCommand = 'list'; - if (\defined('SIGINT') && SignalRegistry::isSupported()) { - $this->signalRegistry = new SignalRegistry(); - $this->signalsToDispatchEvent = [\SIGINT, \SIGTERM, \SIGUSR1, \SIGUSR2]; - } - } - - /** - * @final - */ - public function setDispatcher(EventDispatcherInterface $dispatcher) - { - $this->dispatcher = $dispatcher; - } - - public function setCommandLoader(CommandLoaderInterface $commandLoader) - { - $this->commandLoader = $commandLoader; - } - - public function getSignalRegistry(): SignalRegistry - { - if (!$this->signalRegistry) { - throw new RuntimeException('Signals are not supported. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - return $this->signalRegistry; - } - - public function setSignalsToDispatchEvent(int ...$signalsToDispatchEvent) - { - $this->signalsToDispatchEvent = $signalsToDispatchEvent; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - * - * @throws \Exception When running fails. Bypass this when {@link setCatchExceptions()}. - */ - public function run(InputInterface $input = null, OutputInterface $output = null) - { - if (\function_exists('putenv')) { - @putenv('LINES='.$this->terminal->getHeight()); - @putenv('COLUMNS='.$this->terminal->getWidth()); - } - - if (null === $input) { - $input = new ArgvInput(); - } - - if (null === $output) { - $output = new ConsoleOutput(); - } - - $renderException = function (\Throwable $e) use ($output) { - if ($output instanceof ConsoleOutputInterface) { - $this->renderThrowable($e, $output->getErrorOutput()); - } else { - $this->renderThrowable($e, $output); - } - }; - if ($phpHandler = set_exception_handler($renderException)) { - restore_exception_handler(); - if (!\is_array($phpHandler) || !$phpHandler[0] instanceof ErrorHandler) { - $errorHandler = true; - } elseif ($errorHandler = $phpHandler[0]->setExceptionHandler($renderException)) { - $phpHandler[0]->setExceptionHandler($errorHandler); - } - } - - $this->configureIO($input, $output); - - try { - $exitCode = $this->doRun($input, $output); - } catch (\Exception $e) { - if (!$this->catchExceptions) { - throw $e; - } - - $renderException($e); - - $exitCode = $e->getCode(); - if (is_numeric($exitCode)) { - $exitCode = (int) $exitCode; - if ($exitCode <= 0) { - $exitCode = 1; - } - } else { - $exitCode = 1; - } - } finally { - // if the exception handler changed, keep it - // otherwise, unregister $renderException - if (!$phpHandler) { - if (set_exception_handler($renderException) === $renderException) { - restore_exception_handler(); - } - restore_exception_handler(); - } elseif (!$errorHandler) { - $finalHandler = $phpHandler[0]->setExceptionHandler(null); - if ($finalHandler !== $renderException) { - $phpHandler[0]->setExceptionHandler($finalHandler); - } - } - } - - if ($this->autoExit) { - if ($exitCode > 255) { - $exitCode = 255; - } - - exit($exitCode); - } - - return $exitCode; - } - - /** - * Runs the current application. - * - * @return int 0 if everything went fine, or an error code - */ - public function doRun(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--version', '-V'], true)) { - $output->writeln($this->getLongVersion()); - - return 0; - } - - try { - // Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument. - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - // Errors must be ignored, full binding/validation happens later when the command is known. - } - - $name = $this->getCommandName($input); - if (true === $input->hasParameterOption(['--help', '-h'], true)) { - if (!$name) { - $name = 'help'; - $input = new ArrayInput(['command_name' => $this->defaultCommand]); - } else { - $this->wantHelps = true; - } - } - - if (!$name) { - $name = $this->defaultCommand; - $definition = $this->getDefinition(); - $definition->setArguments(array_merge( - $definition->getArguments(), - [ - 'command' => new InputArgument('command', InputArgument::OPTIONAL, $definition->getArgument('command')->getDescription(), $name), - ] - )); - } - - try { - $this->runningCommand = null; - // the command name MUST be the first element of the input - $command = $this->find($name); - } catch (\Throwable $e) { - if (!($e instanceof CommandNotFoundException && !$e instanceof NamespaceNotFoundException) || 1 !== \count($alternatives = $e->getAlternatives()) || !$input->isInteractive()) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - if (0 === $event->getExitCode()) { - return 0; - } - - $e = $event->getError(); - } - - throw $e; - } - - $alternative = $alternatives[0]; - - $style = new SymfonyStyle($input, $output); - $output->writeln(''); - $formattedBlock = (new FormatterHelper())->formatBlock(sprintf('Command "%s" is not defined.', $name), 'error', true); - $output->writeln($formattedBlock); - if (!$style->confirm(sprintf('Do you want to run "%s" instead? ', $alternative), false)) { - if (null !== $this->dispatcher) { - $event = new ConsoleErrorEvent($input, $output, $e); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - - return $event->getExitCode(); - } - - return 1; - } - - $command = $this->find($alternative); - } - - if ($command instanceof LazyCommand) { - $command = $command->getCommand(); - } - - $this->runningCommand = $command; - $exitCode = $this->doRunCommand($command, $input, $output); - $this->runningCommand = null; - - return $exitCode; - } - - /** - * {@inheritdoc} - */ - public function reset() - { - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Get the helper set associated with the command. - * - * @return HelperSet - */ - public function getHelperSet() - { - if (!$this->helperSet) { - $this->helperSet = $this->getDefaultHelperSet(); - } - - return $this->helperSet; - } - - public function setDefinition(InputDefinition $definition) - { - $this->definition = $definition; - } - - /** - * Gets the InputDefinition related to this Application. - * - * @return InputDefinition - */ - public function getDefinition() - { - if (!$this->definition) { - $this->definition = $this->getDefaultInputDefinition(); - } - - if ($this->singleCommand) { - $inputDefinition = $this->definition; - $inputDefinition->setArguments(); - - return $inputDefinition; - } - - return $this->definition; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ( - CompletionInput::TYPE_ARGUMENT_VALUE === $input->getCompletionType() - && 'command' === $input->getCompletionName() - ) { - $commandNames = []; - foreach ($this->all() as $name => $command) { - // skip hidden commands and aliased commands as they already get added below - if ($command->isHidden() || $command->getName() !== $name) { - continue; - } - $commandNames[] = $command->getName(); - foreach ($command->getAliases() as $name) { - $commandNames[] = $name; - } - } - $suggestions->suggestValues(array_filter($commandNames)); - - return; - } - - if (CompletionInput::TYPE_OPTION_NAME === $input->getCompletionType()) { - $suggestions->suggestOptions($this->getDefinition()->getOptions()); - - return; - } - } - - /** - * Gets the help message. - * - * @return string - */ - public function getHelp() - { - return $this->getLongVersion(); - } - - /** - * Gets whether to catch exceptions or not during commands execution. - * - * @return bool - */ - public function areExceptionsCaught() - { - return $this->catchExceptions; - } - - /** - * Sets whether to catch exceptions or not during commands execution. - */ - public function setCatchExceptions(bool $boolean) - { - $this->catchExceptions = $boolean; - } - - /** - * Gets whether to automatically exit after a command execution or not. - * - * @return bool - */ - public function isAutoExitEnabled() - { - return $this->autoExit; - } - - /** - * Sets whether to automatically exit after a command execution or not. - */ - public function setAutoExit(bool $boolean) - { - $this->autoExit = $boolean; - } - - /** - * Gets the name of the application. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Sets the application name. - **/ - public function setName(string $name) - { - $this->name = $name; - } - - /** - * Gets the application version. - * - * @return string - */ - public function getVersion() - { - return $this->version; - } - - /** - * Sets the application version. - */ - public function setVersion(string $version) - { - $this->version = $version; - } - - /** - * Returns the long version of the application. - * - * @return string - */ - public function getLongVersion() - { - if ('UNKNOWN' !== $this->getName()) { - if ('UNKNOWN' !== $this->getVersion()) { - return sprintf('%s %s', $this->getName(), $this->getVersion()); - } - - return $this->getName(); - } - - return 'Console Tool'; - } - - /** - * Registers a new command. - * - * @return Command - */ - public function register(string $name) - { - return $this->add(new Command($name)); - } - - /** - * Adds an array of command objects. - * - * If a Command is not enabled it will not be added. - * - * @param Command[] $commands An array of commands - */ - public function addCommands(array $commands) - { - foreach ($commands as $command) { - $this->add($command); - } - } - - /** - * Adds a command object. - * - * If a command with the same name already exists, it will be overridden. - * If the command is not enabled it will not be added. - * - * @return Command|null - */ - public function add(Command $command) - { - $this->init(); - - $command->setApplication($this); - - if (!$command->isEnabled()) { - $command->setApplication(null); - - return null; - } - - if (!$command instanceof LazyCommand) { - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - } - - if (!$command->getName()) { - throw new LogicException(sprintf('The command defined in "%s" cannot have an empty name.', get_debug_type($command))); - } - - $this->commands[$command->getName()] = $command; - - foreach ($command->getAliases() as $alias) { - $this->commands[$alias] = $command; - } - - return $command; - } - - /** - * Returns a registered command by name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When given command name does not exist - */ - public function get(string $name) - { - $this->init(); - - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - // When the command has a different name than the one used at the command loader level - if (!isset($this->commands[$name])) { - throw new CommandNotFoundException(sprintf('The "%s" command cannot be found because it is registered under multiple names. Make sure you don\'t set a different name via constructor or "setName()".', $name)); - } - - $command = $this->commands[$name]; - - if ($this->wantHelps) { - $this->wantHelps = false; - - $helpCommand = $this->get('help'); - $helpCommand->setCommand($command); - - return $helpCommand; - } - - return $command; - } - - /** - * Returns true if the command exists, false otherwise. - * - * @return bool - */ - public function has(string $name) - { - $this->init(); - - return isset($this->commands[$name]) || ($this->commandLoader && $this->commandLoader->has($name) && $this->add($this->commandLoader->get($name))); - } - - /** - * Returns an array of all unique namespaces used by currently registered commands. - * - * It does not return the global namespace which always exists. - * - * @return string[] - */ - public function getNamespaces() - { - $namespaces = []; - foreach ($this->all() as $command) { - if ($command->isHidden()) { - continue; - } - - $namespaces[] = $this->extractAllNamespaces($command->getName()); - - foreach ($command->getAliases() as $alias) { - $namespaces[] = $this->extractAllNamespaces($alias); - } - } - - return array_values(array_unique(array_filter(array_merge([], ...$namespaces)))); - } - - /** - * Finds a registered namespace by a name or an abbreviation. - * - * @return string - * - * @throws NamespaceNotFoundException When namespace is incorrect or ambiguous - */ - public function findNamespace(string $namespace) - { - $allNamespaces = $this->getNamespaces(); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $namespace))).'[^:]*'; - $namespaces = preg_grep('{^'.$expr.'}', $allNamespaces); - - if (empty($namespaces)) { - $message = sprintf('There are no commands defined in the "%s" namespace.', $namespace); - - if ($alternatives = $this->findAlternatives($namespace, $allNamespaces)) { - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - - $message .= implode("\n ", $alternatives); - } - - throw new NamespaceNotFoundException($message, $alternatives); - } - - $exact = \in_array($namespace, $namespaces, true); - if (\count($namespaces) > 1 && !$exact) { - throw new NamespaceNotFoundException(sprintf("The namespace \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $namespace, $this->getAbbreviationSuggestions(array_values($namespaces))), array_values($namespaces)); - } - - return $exact ? $namespace : reset($namespaces); - } - - /** - * Finds a command by name or alias. - * - * Contrary to get, this command tries to find the best - * match if you give it an abbreviation of a name or alias. - * - * @return Command - * - * @throws CommandNotFoundException When command name is incorrect or ambiguous - */ - public function find(string $name) - { - $this->init(); - - $aliases = []; - - foreach ($this->commands as $command) { - foreach ($command->getAliases() as $alias) { - if (!$this->has($alias)) { - $this->commands[$alias] = $command; - } - } - } - - if ($this->has($name)) { - return $this->get($name); - } - - $allCommands = $this->commandLoader ? array_merge($this->commandLoader->getNames(), array_keys($this->commands)) : array_keys($this->commands); - $expr = implode('[^:]*:', array_map('preg_quote', explode(':', $name))).'[^:]*'; - $commands = preg_grep('{^'.$expr.'}', $allCommands); - - if (empty($commands)) { - $commands = preg_grep('{^'.$expr.'}i', $allCommands); - } - - // if no commands matched or we just matched namespaces - if (empty($commands) || \count(preg_grep('{^'.$expr.'$}i', $commands)) < 1) { - if (false !== $pos = strrpos($name, ':')) { - // check if a namespace exists and contains commands - $this->findNamespace(substr($name, 0, $pos)); - } - - $message = sprintf('Command "%s" is not defined.', $name); - - if ($alternatives = $this->findAlternatives($name, $allCommands)) { - // remove hidden commands - $alternatives = array_filter($alternatives, function ($name) { - return !$this->get($name)->isHidden(); - }); - - if (1 == \count($alternatives)) { - $message .= "\n\nDid you mean this?\n "; - } else { - $message .= "\n\nDid you mean one of these?\n "; - } - $message .= implode("\n ", $alternatives); - } - - throw new CommandNotFoundException($message, array_values($alternatives)); - } - - // filter out aliases for commands which are already on the list - if (\count($commands) > 1) { - $commandList = $this->commandLoader ? array_merge(array_flip($this->commandLoader->getNames()), $this->commands) : $this->commands; - $commands = array_unique(array_filter($commands, function ($nameOrAlias) use (&$commandList, $commands, &$aliases) { - if (!$commandList[$nameOrAlias] instanceof Command) { - $commandList[$nameOrAlias] = $this->commandLoader->get($nameOrAlias); - } - - $commandName = $commandList[$nameOrAlias]->getName(); - - $aliases[$nameOrAlias] = $commandName; - - return $commandName === $nameOrAlias || !\in_array($commandName, $commands); - })); - } - - if (\count($commands) > 1) { - $usableWidth = $this->terminal->getWidth() - 10; - $abbrevs = array_values($commands); - $maxLen = 0; - foreach ($abbrevs as $abbrev) { - $maxLen = max(Helper::width($abbrev), $maxLen); - } - $abbrevs = array_map(function ($cmd) use ($commandList, $usableWidth, $maxLen, &$commands) { - if ($commandList[$cmd]->isHidden()) { - unset($commands[array_search($cmd, $commands)]); - - return false; - } - - $abbrev = str_pad($cmd, $maxLen, ' ').' '.$commandList[$cmd]->getDescription(); - - return Helper::width($abbrev) > $usableWidth ? Helper::substr($abbrev, 0, $usableWidth - 3).'...' : $abbrev; - }, array_values($commands)); - - if (\count($commands) > 1) { - $suggestions = $this->getAbbreviationSuggestions(array_filter($abbrevs)); - - throw new CommandNotFoundException(sprintf("Command \"%s\" is ambiguous.\nDid you mean one of these?\n%s.", $name, $suggestions), array_values($commands)); - } - } - - $command = $this->get(reset($commands)); - - if ($command->isHidden()) { - throw new CommandNotFoundException(sprintf('The command "%s" does not exist.', $name)); - } - - return $command; - } - - /** - * Gets the commands (registered in the given namespace if provided). - * - * The array keys are the full names and the values the command instances. - * - * @return Command[] - */ - public function all(string $namespace = null) - { - $this->init(); - - if (null === $namespace) { - if (!$this->commandLoader) { - return $this->commands; - } - - $commands = $this->commands; - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - - return $commands; - } - - $commands = []; - foreach ($this->commands as $name => $command) { - if ($namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1)) { - $commands[$name] = $command; - } - } - - if ($this->commandLoader) { - foreach ($this->commandLoader->getNames() as $name) { - if (!isset($commands[$name]) && $namespace === $this->extractNamespace($name, substr_count($namespace, ':') + 1) && $this->has($name)) { - $commands[$name] = $this->get($name); - } - } - } - - return $commands; - } - - /** - * Returns an array of possible abbreviations given a set of names. - * - * @return string[][] - */ - public static function getAbbreviations(array $names) - { - $abbrevs = []; - foreach ($names as $name) { - for ($len = \strlen($name); $len > 0; --$len) { - $abbrev = substr($name, 0, $len); - $abbrevs[$abbrev][] = $name; - } - } - - return $abbrevs; - } - - public function renderThrowable(\Throwable $e, OutputInterface $output): void - { - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - - $this->doRenderThrowable($e, $output); - - if (null !== $this->runningCommand) { - $output->writeln(sprintf('%s', OutputFormatter::escape(sprintf($this->runningCommand->getSynopsis(), $this->getName()))), OutputInterface::VERBOSITY_QUIET); - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } - - protected function doRenderThrowable(\Throwable $e, OutputInterface $output): void - { - do { - $message = trim($e->getMessage()); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $class = get_debug_type($e); - $title = sprintf(' [%s%s] ', $class, 0 !== ($code = $e->getCode()) ? ' ('.$code.')' : ''); - $len = Helper::width($title); - } else { - $len = 0; - } - - if (str_contains($message, "@anonymous\0")) { - $message = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) { - return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0]; - }, $message); - } - - $width = $this->terminal->getWidth() ? $this->terminal->getWidth() - 1 : \PHP_INT_MAX; - $lines = []; - foreach ('' !== $message ? preg_split('/\r?\n/', $message) : [] as $line) { - foreach ($this->splitStringByWidth($line, $width - 4) as $line) { - // pre-format lines to get the right string length - $lineLength = Helper::width($line) + 4; - $lines[] = [$line, $lineLength]; - - $len = max($lineLength, $len); - } - } - - $messages = []; - if (!$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s', OutputFormatter::escape(sprintf('In %s line %s:', basename($e->getFile()) ?: 'n/a', $e->getLine() ?: 'n/a'))); - } - $messages[] = $emptyLine = sprintf('%s', str_repeat(' ', $len)); - if ('' === $message || OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $messages[] = sprintf('%s%s', $title, str_repeat(' ', max(0, $len - Helper::width($title)))); - } - foreach ($lines as $line) { - $messages[] = sprintf(' %s %s', OutputFormatter::escape($line[0]), str_repeat(' ', $len - $line[1])); - } - $messages[] = $emptyLine; - $messages[] = ''; - - $output->writeln($messages, OutputInterface::VERBOSITY_QUIET); - - if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { - $output->writeln('Exception trace:', OutputInterface::VERBOSITY_QUIET); - - // exception related properties - $trace = $e->getTrace(); - - array_unshift($trace, [ - 'function' => '', - 'file' => $e->getFile() ?: 'n/a', - 'line' => $e->getLine() ?: 'n/a', - 'args' => [], - ]); - - for ($i = 0, $count = \count($trace); $i < $count; ++$i) { - $class = $trace[$i]['class'] ?? ''; - $type = $trace[$i]['type'] ?? ''; - $function = $trace[$i]['function'] ?? ''; - $file = $trace[$i]['file'] ?? 'n/a'; - $line = $trace[$i]['line'] ?? 'n/a'; - - $output->writeln(sprintf(' %s%s at %s:%s', $class, $function ? $type.$function.'()' : '', $file, $line), OutputInterface::VERBOSITY_QUIET); - } - - $output->writeln('', OutputInterface::VERBOSITY_QUIET); - } - } while ($e = $e->getPrevious()); - } - - /** - * Configures the input and output instances based on the user arguments and options. - */ - protected function configureIO(InputInterface $input, OutputInterface $output) - { - if (true === $input->hasParameterOption(['--ansi'], true)) { - $output->setDecorated(true); - } elseif (true === $input->hasParameterOption(['--no-ansi'], true)) { - $output->setDecorated(false); - } - - if (true === $input->hasParameterOption(['--no-interaction', '-n'], true)) { - $input->setInteractive(false); - } - - switch ($shellVerbosity = (int) getenv('SHELL_VERBOSITY')) { - case -1: - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - break; - case 1: - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - break; - case 2: - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - break; - case 3: - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - break; - default: - $shellVerbosity = 0; - break; - } - - if (true === $input->hasParameterOption(['--quiet', '-q'], true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_QUIET); - $shellVerbosity = -1; - } else { - if ($input->hasParameterOption('-vvv', true) || $input->hasParameterOption('--verbose=3', true) || 3 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_DEBUG); - $shellVerbosity = 3; - } elseif ($input->hasParameterOption('-vv', true) || $input->hasParameterOption('--verbose=2', true) || 2 === $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERY_VERBOSE); - $shellVerbosity = 2; - } elseif ($input->hasParameterOption('-v', true) || $input->hasParameterOption('--verbose=1', true) || $input->hasParameterOption('--verbose', true) || $input->getParameterOption('--verbose', false, true)) { - $output->setVerbosity(OutputInterface::VERBOSITY_VERBOSE); - $shellVerbosity = 1; - } - } - - if (-1 === $shellVerbosity) { - $input->setInteractive(false); - } - - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$shellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $shellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $shellVerbosity; - } - - /** - * Runs the current command. - * - * If an event dispatcher has been attached to the application, - * events are also dispatched during the life-cycle of the command. - * - * @return int 0 if everything went fine, or an error code - */ - protected function doRunCommand(Command $command, InputInterface $input, OutputInterface $output) - { - foreach ($command->getHelperSet() as $helper) { - if ($helper instanceof InputAwareInterface) { - $helper->setInput($input); - } - } - - if ($this->signalsToDispatchEvent) { - $commandSignals = $command instanceof SignalableCommandInterface ? $command->getSubscribedSignals() : []; - - if ($commandSignals || null !== $this->dispatcher) { - if (!$this->signalRegistry) { - throw new RuntimeException('Unable to subscribe to signal events. Make sure that the `pcntl` extension is installed and that "pcntl_*" functions are not disabled by your php.ini\'s "disable_functions" directive.'); - } - - if (Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - - foreach ([\SIGINT, \SIGTERM] as $signal) { - $this->signalRegistry->register($signal, static function () use ($sttyMode) { - shell_exec('stty '.$sttyMode); - }); - } - } - } - - if (null !== $this->dispatcher) { - foreach ($this->signalsToDispatchEvent as $signal) { - $event = new ConsoleSignalEvent($command, $input, $output, $signal); - - $this->signalRegistry->register($signal, function ($signal, $hasNext) use ($event) { - $this->dispatcher->dispatch($event, ConsoleEvents::SIGNAL); - - // No more handlers, we try to simulate PHP default behavior - if (!$hasNext) { - if (!\in_array($signal, [\SIGUSR1, \SIGUSR2], true)) { - exit(0); - } - } - }); - } - } - - foreach ($commandSignals as $signal) { - $this->signalRegistry->register($signal, [$command, 'handleSignal']); - } - } - - if (null === $this->dispatcher) { - return $command->run($input, $output); - } - - // bind before the console.command event, so the listeners have access to input options/arguments - try { - $command->mergeApplicationDefinition(); - $input->bind($command->getDefinition()); - } catch (ExceptionInterface $e) { - // ignore invalid options/arguments for now, to allow the event listeners to customize the InputDefinition - } - - $event = new ConsoleCommandEvent($command, $input, $output); - $e = null; - - try { - $this->dispatcher->dispatch($event, ConsoleEvents::COMMAND); - - if ($event->commandShouldRun()) { - $exitCode = $command->run($input, $output); - } else { - $exitCode = ConsoleCommandEvent::RETURN_CODE_DISABLED; - } - } catch (\Throwable $e) { - $event = new ConsoleErrorEvent($input, $output, $e, $command); - $this->dispatcher->dispatch($event, ConsoleEvents::ERROR); - $e = $event->getError(); - - if (0 === $exitCode = $event->getExitCode()) { - $e = null; - } - } - - $event = new ConsoleTerminateEvent($command, $input, $output, $exitCode); - $this->dispatcher->dispatch($event, ConsoleEvents::TERMINATE); - - if (null !== $e) { - throw $e; - } - - return $event->getExitCode(); - } - - /** - * Gets the name of the command based on input. - * - * @return string|null - */ - protected function getCommandName(InputInterface $input) - { - return $this->singleCommand ? $this->defaultCommand : $input->getFirstArgument(); - } - - /** - * Gets the default input definition. - * - * @return InputDefinition - */ - protected function getDefaultInputDefinition() - { - return new InputDefinition([ - new InputArgument('command', InputArgument::REQUIRED, 'The command to execute'), - new InputOption('--help', '-h', InputOption::VALUE_NONE, 'Display help for the given command. When no command is given display help for the '.$this->defaultCommand.' command'), - new InputOption('--quiet', '-q', InputOption::VALUE_NONE, 'Do not output any message'), - new InputOption('--verbose', '-v|vv|vvv', InputOption::VALUE_NONE, 'Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug'), - new InputOption('--version', '-V', InputOption::VALUE_NONE, 'Display this application version'), - new InputOption('--ansi', '', InputOption::VALUE_NEGATABLE, 'Force (or disable --no-ansi) ANSI output', null), - new InputOption('--no-interaction', '-n', InputOption::VALUE_NONE, 'Do not ask any interactive question'), - ]); - } - - /** - * Gets the default commands that should always be available. - * - * @return Command[] - */ - protected function getDefaultCommands() - { - return [new HelpCommand(), new ListCommand(), new CompleteCommand(), new DumpCompletionCommand()]; - } - - /** - * Gets the default helper set with the helpers that should always be available. - * - * @return HelperSet - */ - protected function getDefaultHelperSet() - { - return new HelperSet([ - new FormatterHelper(), - new DebugFormatterHelper(), - new ProcessHelper(), - new QuestionHelper(), - ]); - } - - /** - * Returns abbreviated suggestions in string format. - */ - private function getAbbreviationSuggestions(array $abbrevs): string - { - return ' '.implode("\n ", $abbrevs); - } - - /** - * Returns the namespace part of the command name. - * - * This method is not part of public API and should not be used directly. - * - * @return string - */ - public function extractNamespace(string $name, int $limit = null) - { - $parts = explode(':', $name, -1); - - return implode(':', null === $limit ? $parts : \array_slice($parts, 0, $limit)); - } - - /** - * Finds alternative of $name among $collection, - * if nothing is found in $collection, try in $abbrevs. - * - * @return string[] - */ - private function findAlternatives(string $name, iterable $collection): array - { - $threshold = 1e3; - $alternatives = []; - - $collectionParts = []; - foreach ($collection as $item) { - $collectionParts[$item] = explode(':', $item); - } - - foreach (explode(':', $name) as $i => $subname) { - foreach ($collectionParts as $collectionName => $parts) { - $exists = isset($alternatives[$collectionName]); - if (!isset($parts[$i]) && $exists) { - $alternatives[$collectionName] += $threshold; - continue; - } elseif (!isset($parts[$i])) { - continue; - } - - $lev = levenshtein($subname, $parts[$i]); - if ($lev <= \strlen($subname) / 3 || '' !== $subname && str_contains($parts[$i], $subname)) { - $alternatives[$collectionName] = $exists ? $alternatives[$collectionName] + $lev : $lev; - } elseif ($exists) { - $alternatives[$collectionName] += $threshold; - } - } - } - - foreach ($collection as $item) { - $lev = levenshtein($name, $item); - if ($lev <= \strlen($name) / 3 || str_contains($item, $name)) { - $alternatives[$item] = isset($alternatives[$item]) ? $alternatives[$item] - $lev : $lev; - } - } - - $alternatives = array_filter($alternatives, function ($lev) use ($threshold) { return $lev < 2 * $threshold; }); - ksort($alternatives, \SORT_NATURAL | \SORT_FLAG_CASE); - - return array_keys($alternatives); - } - - /** - * Sets the default Command name. - * - * @return $this - */ - public function setDefaultCommand(string $commandName, bool $isSingleCommand = false) - { - $this->defaultCommand = explode('|', ltrim($commandName, '|'))[0]; - - if ($isSingleCommand) { - // Ensure the command exist - $this->find($commandName); - - $this->singleCommand = true; - } - - return $this; - } - - /** - * @internal - */ - public function isSingleCommand(): bool - { - return $this->singleCommand; - } - - private function splitStringByWidth(string $string, int $width): array - { - // str_split is not suitable for multi-byte characters, we should use preg_split to get char array properly. - // additionally, array_slice() is not enough as some character has doubled width. - // we need a function to split string not by character count but by string width - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return str_split($string, $width); - } - - $utf8String = mb_convert_encoding($string, 'utf8', $encoding); - $lines = []; - $line = ''; - - $offset = 0; - while (preg_match('/.{1,10000}/u', $utf8String, $m, 0, $offset)) { - $offset += \strlen($m[0]); - - foreach (preg_split('//u', $m[0]) as $char) { - // test if $char could be appended to current line - if (mb_strwidth($line.$char, 'utf8') <= $width) { - $line .= $char; - continue; - } - // if not, push current line to array and make new line - $lines[] = str_pad($line, $width); - $line = $char; - } - } - - $lines[] = \count($lines) ? str_pad($line, $width) : $line; - - mb_convert_variables($encoding, 'utf8', $lines); - - return $lines; - } - - /** - * Returns all namespaces of the command name. - * - * @return string[] - */ - private function extractAllNamespaces(string $name): array - { - // -1 as third argument is needed to skip the command short name when exploding - $parts = explode(':', $name, -1); - $namespaces = []; - - foreach ($parts as $part) { - if (\count($namespaces)) { - $namespaces[] = end($namespaces).':'.$part; - } else { - $namespaces[] = $part; - } - } - - return $namespaces; - } - - private function init() - { - if ($this->initialized) { - return; - } - $this->initialized = true; - - foreach ($this->getDefaultCommands() as $command) { - $this->add($command); - } - } -} diff --git a/vendor/symfony/console/Attribute/AsCommand.php b/vendor/symfony/console/Attribute/AsCommand.php deleted file mode 100644 index b337f548f..000000000 --- a/vendor/symfony/console/Attribute/AsCommand.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Attribute; - -/** - * Service tag to autoconfigure commands. - */ -#[\Attribute(\Attribute::TARGET_CLASS)] -class AsCommand -{ - public function __construct( - public string $name, - public ?string $description = null, - array $aliases = [], - bool $hidden = false, - ) { - if (!$hidden && !$aliases) { - return; - } - - $name = explode('|', $name); - $name = array_merge($name, $aliases); - - if ($hidden && '' !== $name[0]) { - array_unshift($name, ''); - } - - $this->name = implode('|', $name); - } -} diff --git a/vendor/symfony/console/CHANGELOG.md b/vendor/symfony/console/CHANGELOG.md deleted file mode 100644 index 6662dd1eb..000000000 --- a/vendor/symfony/console/CHANGELOG.md +++ /dev/null @@ -1,217 +0,0 @@ -CHANGELOG -========= - -5.4 ---- - - * Add `TesterTrait::assertCommandIsSuccessful()` to test command - * Deprecate `HelperSet::setCommand()` and `getCommand()` without replacement - -5.3 ---- - - * Add `GithubActionReporter` to render annotations in a Github Action - * Add `InputOption::VALUE_NEGATABLE` flag to handle `--foo`/`--no-foo` options - * Add the `Command::$defaultDescription` static property and the `description` attribute - on the `console.command` tag to allow the `list` command to instantiate commands lazily - * Add option `--short` to the `list` command - * Add support for bright colors - * Add `#[AsCommand]` attribute for declaring commands on PHP 8 - * Add `Helper::width()` and `Helper::length()` - * The `--ansi` and `--no-ansi` options now default to `null`. - -5.2.0 ------ - - * Added `SingleCommandApplication::setAutoExit()` to allow testing via `CommandTester` - * added support for multiline responses to questions through `Question::setMultiline()` - and `Question::isMultiline()` - * Added `SignalRegistry` class to stack signals handlers - * Added support for signals: - * Added `Application::getSignalRegistry()` and `Application::setSignalsToDispatchEvent()` methods - * Added `SignalableCommandInterface` interface - * Added `TableCellStyle` class to customize table cell - * Removed `php ` prefix invocation from help messages. - -5.1.0 ------ - - * `Command::setHidden()` is final since Symfony 5.1 - * Add `SingleCommandApplication` - * Add `Cursor` class - -5.0.0 ------ - - * removed support for finding hidden commands using an abbreviation, use the full name instead - * removed `TableStyle::setCrossingChar()` method in favor of `TableStyle::setDefaultCrossingChar()` - * removed `TableStyle::setHorizontalBorderChar()` method in favor of `TableStyle::setDefaultCrossingChars()` - * removed `TableStyle::getHorizontalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed `TableStyle::setVerticalBorderChar()` method in favor of `TableStyle::setVerticalBorderChars()` - * removed `TableStyle::getVerticalBorderChar()` method in favor of `TableStyle::getBorderChars()` - * removed support for returning `null` from `Command::execute()`, return `0` instead - * `ProcessHelper::run()` accepts only `array|Symfony\Component\Process\Process` for its `command` argument - * `Application::setDispatcher` accepts only `Symfony\Contracts\EventDispatcher\EventDispatcherInterface` - for its `dispatcher` argument - * renamed `Application::renderException()` and `Application::doRenderException()` - to `renderThrowable()` and `doRenderThrowable()` respectively. - -4.4.0 ------ - - * deprecated finding hidden commands using an abbreviation, use the full name instead - * added `Question::setTrimmable` default to true to allow the answer to be trimmed - * added method `minSecondsBetweenRedraws()` and `maxSecondsBetweenRedraws()` on `ProgressBar` - * `Application` implements `ResetInterface` - * marked all dispatched event classes as `@final` - * added support for displaying table horizontally - * deprecated returning `null` from `Command::execute()`, return `0` instead - * Deprecated the `Application::renderException()` and `Application::doRenderException()` methods, - use `renderThrowable()` and `doRenderThrowable()` instead. - * added support for the `NO_COLOR` env var (https://no-color.org/) - -4.3.0 ------ - - * added support for hyperlinks - * added `ProgressBar::iterate()` method that simplify updating the progress bar when iterating - * added `Question::setAutocompleterCallback()` to provide a callback function - that dynamically generates suggestions as the user types - -4.2.0 ------ - - * allowed passing commands as `[$process, 'ENV_VAR' => 'value']` to - `ProcessHelper::run()` to pass environment variables - * deprecated passing a command as a string to `ProcessHelper::run()`, - pass it the command as an array of its arguments instead - * made the `ProcessHelper` class final - * added `WrappableOutputFormatterInterface::formatAndWrap()` (implemented in `OutputFormatter`) - * added `capture_stderr_separately` option to `CommandTester::execute()` - -4.1.0 ------ - - * added option to run suggested command if command is not found and only 1 alternative is available - * added option to modify console output and print multiple modifiable sections - * added support for iterable messages in output `write` and `writeln` methods - -4.0.0 ------ - - * `OutputFormatter` throws an exception when unknown options are used - * removed `QuestionHelper::setInputStream()/getInputStream()` - * removed `Application::getTerminalWidth()/getTerminalHeight()` and - `Application::setTerminalDimensions()/getTerminalDimensions()` - * removed `ConsoleExceptionEvent` - * removed `ConsoleEvents::EXCEPTION` - -3.4.0 ------ - - * added `SHELL_VERBOSITY` env var to control verbosity - * added `CommandLoaderInterface`, `FactoryCommandLoader` and PSR-11 - `ContainerCommandLoader` for commands lazy-loading - * added a case-insensitive command name matching fallback - * added static `Command::$defaultName/getDefaultName()`, allowing for - commands to be registered at compile time in the application command loader. - Setting the `$defaultName` property avoids the need for filling the `command` - attribute on the `console.command` tag when using `AddConsoleCommandPass`. - -3.3.0 ------ - - * added `ExceptionListener` - * added `AddConsoleCommandPass` (originally in FrameworkBundle) - * [BC BREAK] `Input::getOption()` no longer returns the default value for options - with value optional explicitly passed empty - * added console.error event to catch exceptions thrown by other listeners - * deprecated console.exception event in favor of console.error - * added ability to handle `CommandNotFoundException` through the - `console.error` event - * deprecated default validation in `SymfonyQuestionHelper::ask` - -3.2.0 ------- - - * added `setInputs()` method to CommandTester for ease testing of commands expecting inputs - * added `setStream()` and `getStream()` methods to Input (implement StreamableInputInterface) - * added StreamableInputInterface - * added LockableTrait - -3.1.0 ------ - - * added truncate method to FormatterHelper - * added setColumnWidth(s) method to Table - -2.8.3 ------ - - * remove readline support from the question helper as it caused issues - -2.8.0 ------ - - * use readline for user input in the question helper when available to allow - the use of arrow keys - -2.6.0 ------ - - * added a Process helper - * added a DebugFormatter helper - -2.5.0 ------ - - * deprecated the dialog helper (use the question helper instead) - * deprecated TableHelper in favor of Table - * deprecated ProgressHelper in favor of ProgressBar - * added ConsoleLogger - * added a question helper - * added a way to set the process name of a command - * added a way to set a default command instead of `ListCommand` - -2.4.0 ------ - - * added a way to force terminal dimensions - * added a convenient method to detect verbosity level - * [BC BREAK] made descriptors use output instead of returning a string - -2.3.0 ------ - - * added multiselect support to the select dialog helper - * added Table Helper for tabular data rendering - * added support for events in `Application` - * added a way to normalize EOLs in `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` - * added a way to set the progress bar progress via the `setCurrent` method - * added support for multiple InputOption shortcuts, written as `'-a|-b|-c'` - * added two additional verbosity levels, VERBOSITY_VERY_VERBOSE and VERBOSITY_DEBUG - -2.2.0 ------ - - * added support for colorization on Windows via ConEmu - * add a method to Dialog Helper to ask for a question and hide the response - * added support for interactive selections in console (DialogHelper::select()) - * added support for autocompletion as you type in Dialog Helper - -2.1.0 ------ - - * added ConsoleOutputInterface - * added the possibility to disable a command (Command::isEnabled()) - * added suggestions when a command does not exist - * added a --raw option to the list command - * added support for STDERR in the console output class (errors are now sent - to STDERR) - * made the defaults (helper set, commands, input definition) in Application - more easily customizable - * added support for the shell even if readline is not available - * added support for process isolation in Symfony shell via - `--process-isolation` switch - * added support for `--`, which disables options parsing after that point - (tokens will be parsed as arguments) diff --git a/vendor/symfony/console/CI/GithubActionReporter.php b/vendor/symfony/console/CI/GithubActionReporter.php deleted file mode 100644 index a15c1ff18..000000000 --- a/vendor/symfony/console/CI/GithubActionReporter.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CI; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Utility class for Github actions. - * - * @author Maxime Steinhausser - */ -class GithubActionReporter -{ - private $output; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L80-L85 - */ - private const ESCAPED_DATA = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ]; - - /** - * @see https://github.com/actions/toolkit/blob/5e5e1b7aacba68a53836a34db4a288c3c1c1585b/packages/core/src/command.ts#L87-L94 - */ - private const ESCAPED_PROPERTIES = [ - '%' => '%25', - "\r" => '%0D', - "\n" => '%0A', - ':' => '%3A', - ',' => '%2C', - ]; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - public static function isGithubActionEnvironment(): bool - { - return false !== getenv('GITHUB_ACTIONS'); - } - - /** - * Output an error using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-an-error-message - */ - public function error(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('error', $message, $file, $line, $col); - } - - /** - * Output a warning using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message - */ - public function warning(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('warning', $message, $file, $line, $col); - } - - /** - * Output a debug log using the Github annotations format. - * - * @see https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#setting-a-debug-message - */ - public function debug(string $message, string $file = null, int $line = null, int $col = null): void - { - $this->log('debug', $message, $file, $line, $col); - } - - private function log(string $type, string $message, string $file = null, int $line = null, int $col = null): void - { - // Some values must be encoded. - $message = strtr($message, self::ESCAPED_DATA); - - if (!$file) { - // No file provided, output the message solely: - $this->output->writeln(sprintf('::%s::%s', $type, $message)); - - return; - } - - $this->output->writeln(sprintf('::%s file=%s,line=%s,col=%s::%s', $type, strtr($file, self::ESCAPED_PROPERTIES), strtr($line ?? 1, self::ESCAPED_PROPERTIES), strtr($col ?? 0, self::ESCAPED_PROPERTIES), $message)); - } -} diff --git a/vendor/symfony/console/Color.php b/vendor/symfony/console/Color.php deleted file mode 100644 index 22a4ce9ff..000000000 --- a/vendor/symfony/console/Color.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Fabien Potencier - */ -final class Color -{ - private const COLORS = [ - 'black' => 0, - 'red' => 1, - 'green' => 2, - 'yellow' => 3, - 'blue' => 4, - 'magenta' => 5, - 'cyan' => 6, - 'white' => 7, - 'default' => 9, - ]; - - private const BRIGHT_COLORS = [ - 'gray' => 0, - 'bright-red' => 1, - 'bright-green' => 2, - 'bright-yellow' => 3, - 'bright-blue' => 4, - 'bright-magenta' => 5, - 'bright-cyan' => 6, - 'bright-white' => 7, - ]; - - private const AVAILABLE_OPTIONS = [ - 'bold' => ['set' => 1, 'unset' => 22], - 'underscore' => ['set' => 4, 'unset' => 24], - 'blink' => ['set' => 5, 'unset' => 25], - 'reverse' => ['set' => 7, 'unset' => 27], - 'conceal' => ['set' => 8, 'unset' => 28], - ]; - - private $foreground; - private $background; - private $options = []; - - public function __construct(string $foreground = '', string $background = '', array $options = []) - { - $this->foreground = $this->parseColor($foreground); - $this->background = $this->parseColor($background, true); - - foreach ($options as $option) { - if (!isset(self::AVAILABLE_OPTIONS[$option])) { - throw new InvalidArgumentException(sprintf('Invalid option specified: "%s". Expected one of (%s).', $option, implode(', ', array_keys(self::AVAILABLE_OPTIONS)))); - } - - $this->options[$option] = self::AVAILABLE_OPTIONS[$option]; - } - } - - public function apply(string $text): string - { - return $this->set().$text.$this->unset(); - } - - public function set(): string - { - $setCodes = []; - if ('' !== $this->foreground) { - $setCodes[] = $this->foreground; - } - if ('' !== $this->background) { - $setCodes[] = $this->background; - } - foreach ($this->options as $option) { - $setCodes[] = $option['set']; - } - if (0 === \count($setCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $setCodes)); - } - - public function unset(): string - { - $unsetCodes = []; - if ('' !== $this->foreground) { - $unsetCodes[] = 39; - } - if ('' !== $this->background) { - $unsetCodes[] = 49; - } - foreach ($this->options as $option) { - $unsetCodes[] = $option['unset']; - } - if (0 === \count($unsetCodes)) { - return ''; - } - - return sprintf("\033[%sm", implode(';', $unsetCodes)); - } - - private function parseColor(string $color, bool $background = false): string - { - if ('' === $color) { - return ''; - } - - if ('#' === $color[0]) { - $color = substr($color, 1); - - if (3 === \strlen($color)) { - $color = $color[0].$color[0].$color[1].$color[1].$color[2].$color[2]; - } - - if (6 !== \strlen($color)) { - throw new InvalidArgumentException(sprintf('Invalid "%s" color.', $color)); - } - - return ($background ? '4' : '3').$this->convertHexColorToAnsi(hexdec($color)); - } - - if (isset(self::COLORS[$color])) { - return ($background ? '4' : '3').self::COLORS[$color]; - } - - if (isset(self::BRIGHT_COLORS[$color])) { - return ($background ? '10' : '9').self::BRIGHT_COLORS[$color]; - } - - throw new InvalidArgumentException(sprintf('Invalid "%s" color; expected one of (%s).', $color, implode(', ', array_merge(array_keys(self::COLORS), array_keys(self::BRIGHT_COLORS))))); - } - - private function convertHexColorToAnsi(int $color): string - { - $r = ($color >> 16) & 255; - $g = ($color >> 8) & 255; - $b = $color & 255; - - // see https://github.com/termstandard/colors/ for more information about true color support - if ('truecolor' !== getenv('COLORTERM')) { - return (string) $this->degradeHexColorToAnsi($r, $g, $b); - } - - return sprintf('8;2;%d;%d;%d', $r, $g, $b); - } - - private function degradeHexColorToAnsi(int $r, int $g, int $b): int - { - if (0 === round($this->getSaturation($r, $g, $b) / 50)) { - return 0; - } - - return (round($b / 255) << 2) | (round($g / 255) << 1) | round($r / 255); - } - - private function getSaturation(int $r, int $g, int $b): int - { - $r = $r / 255; - $g = $g / 255; - $b = $b / 255; - $v = max($r, $g, $b); - - if (0 === $diff = $v - min($r, $g, $b)) { - return 0; - } - - return (int) $diff * 100 / $v; - } -} diff --git a/vendor/symfony/console/Command/Command.php b/vendor/symfony/console/Command/Command.php deleted file mode 100644 index cfa18361e..000000000 --- a/vendor/symfony/console/Command/Command.php +++ /dev/null @@ -1,710 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Attribute\AsCommand; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Base class for all commands. - * - * @author Fabien Potencier - */ -class Command -{ - // see https://tldp.org/LDP/abs/html/exitcodes.html - public const SUCCESS = 0; - public const FAILURE = 1; - public const INVALID = 2; - - /** - * @var string|null The default command name - */ - protected static $defaultName; - - /** - * @var string|null The default command description - */ - protected static $defaultDescription; - - private $application; - private $name; - private $processTitle; - private $aliases = []; - private $definition; - private $hidden = false; - private $help = ''; - private $description = ''; - private $fullDefinition; - private $ignoreValidationErrors = false; - private $code; - private $synopsis = []; - private $usages = []; - private $helperSet; - - /** - * @return string|null - */ - public static function getDefaultName() - { - $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->name; - } - - $r = new \ReflectionProperty($class, 'defaultName'); - - return $class === $r->class ? static::$defaultName : null; - } - - public static function getDefaultDescription(): ?string - { - $class = static::class; - - if (\PHP_VERSION_ID >= 80000 && $attribute = (new \ReflectionClass($class))->getAttributes(AsCommand::class)) { - return $attribute[0]->newInstance()->description; - } - - $r = new \ReflectionProperty($class, 'defaultDescription'); - - return $class === $r->class ? static::$defaultDescription : null; - } - - /** - * @param string|null $name The name of the command; passing null means it must be set in configure() - * - * @throws LogicException When the command name is empty - */ - public function __construct(string $name = null) - { - $this->definition = new InputDefinition(); - - if (null === $name && null !== $name = static::getDefaultName()) { - $aliases = explode('|', $name); - - if ('' === $name = array_shift($aliases)) { - $this->setHidden(true); - $name = array_shift($aliases); - } - - $this->setAliases($aliases); - } - - if (null !== $name) { - $this->setName($name); - } - - if ('' === $this->description) { - $this->setDescription(static::getDefaultDescription() ?? ''); - } - - $this->configure(); - } - - /** - * Ignores validation errors. - * - * This is mainly useful for the help command. - */ - public function ignoreValidationErrors() - { - $this->ignoreValidationErrors = true; - } - - public function setApplication(Application $application = null) - { - $this->application = $application; - if ($application) { - $this->setHelperSet($application->getHelperSet()); - } else { - $this->helperSet = null; - } - - $this->fullDefinition = null; - } - - public function setHelperSet(HelperSet $helperSet) - { - $this->helperSet = $helperSet; - } - - /** - * Gets the helper set. - * - * @return HelperSet|null - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Gets the application instance for this command. - * - * @return Application|null - */ - public function getApplication() - { - return $this->application; - } - - /** - * Checks whether the command is enabled or not in the current environment. - * - * Override this to check for x or y and return false if the command cannot - * run properly under the current conditions. - * - * @return bool - */ - public function isEnabled() - { - return true; - } - - /** - * Configures the current command. - */ - protected function configure() - { - } - - /** - * Executes the current command. - * - * This method is not abstract because you can use this class - * as a concrete class. In this case, instead of defining the - * execute() method, you set the code to execute by passing - * a Closure to the setCode() method. - * - * @return int 0 if everything went fine, or an exit code - * - * @throws LogicException When this abstract method is not implemented - * - * @see setCode() - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - throw new LogicException('You must override the execute() method in the concrete command class.'); - } - - /** - * Interacts with the user. - * - * This method is executed before the InputDefinition is validated. - * This means that this is the only place where the command can - * interactively ask for values of missing required arguments. - */ - protected function interact(InputInterface $input, OutputInterface $output) - { - } - - /** - * Initializes the command after the input has been bound and before the input - * is validated. - * - * This is mainly useful when a lot of commands extends one main command - * where some things need to be initialized based on the input arguments and options. - * - * @see InputInterface::bind() - * @see InputInterface::validate() - */ - protected function initialize(InputInterface $input, OutputInterface $output) - { - } - - /** - * Runs the command. - * - * The code to execute is either defined directly with the - * setCode() method or by overriding the execute() method - * in a sub-class. - * - * @return int The command exit code - * - * @throws ExceptionInterface When input binding fails. Bypass this by calling {@link ignoreValidationErrors()}. - * - * @see setCode() - * @see execute() - */ - public function run(InputInterface $input, OutputInterface $output) - { - // add the application arguments and options - $this->mergeApplicationDefinition(); - - // bind the input against the command specific arguments/options - try { - $input->bind($this->getDefinition()); - } catch (ExceptionInterface $e) { - if (!$this->ignoreValidationErrors) { - throw $e; - } - } - - $this->initialize($input, $output); - - if (null !== $this->processTitle) { - if (\function_exists('cli_set_process_title')) { - if (!@cli_set_process_title($this->processTitle)) { - if ('Darwin' === \PHP_OS) { - $output->writeln('Running "cli_set_process_title" as an unprivileged user is not supported on MacOS.', OutputInterface::VERBOSITY_VERY_VERBOSE); - } else { - cli_set_process_title($this->processTitle); - } - } - } elseif (\function_exists('setproctitle')) { - setproctitle($this->processTitle); - } elseif (OutputInterface::VERBOSITY_VERY_VERBOSE === $output->getVerbosity()) { - $output->writeln('Install the proctitle PECL to be able to change the process title.'); - } - } - - if ($input->isInteractive()) { - $this->interact($input, $output); - } - - // The command name argument is often omitted when a command is executed directly with its run() method. - // It would fail the validation if we didn't make sure the command argument is present, - // since it's required by the application. - if ($input->hasArgument('command') && null === $input->getArgument('command')) { - $input->setArgument('command', $this->getName()); - } - - $input->validate(); - - if ($this->code) { - $statusCode = ($this->code)($input, $output); - } else { - $statusCode = $this->execute($input, $output); - - if (!\is_int($statusCode)) { - throw new \TypeError(sprintf('Return value of "%s::execute()" must be of the type int, "%s" returned.', static::class, get_debug_type($statusCode))); - } - } - - return is_numeric($statusCode) ? (int) $statusCode : 0; - } - - /** - * Adds suggestions to $suggestions for the current completion input (e.g. option or argument). - */ - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - } - - /** - * Sets the code to execute when running this command. - * - * If this method is used, it overrides the code defined - * in the execute() method. - * - * @param callable $code A callable(InputInterface $input, OutputInterface $output) - * - * @return $this - * - * @throws InvalidArgumentException - * - * @see execute() - */ - public function setCode(callable $code) - { - if ($code instanceof \Closure) { - $r = new \ReflectionFunction($code); - if (null === $r->getClosureThis()) { - set_error_handler(static function () {}); - try { - if ($c = \Closure::bind($code, $this)) { - $code = $c; - } - } finally { - restore_error_handler(); - } - } - } - - $this->code = $code; - - return $this; - } - - /** - * Merges the application definition with the command definition. - * - * This method is not part of public API and should not be used directly. - * - * @param bool $mergeArgs Whether to merge or not the Application definition arguments to Command definition arguments - * - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true) - { - if (null === $this->application) { - return; - } - - $this->fullDefinition = new InputDefinition(); - $this->fullDefinition->setOptions($this->definition->getOptions()); - $this->fullDefinition->addOptions($this->application->getDefinition()->getOptions()); - - if ($mergeArgs) { - $this->fullDefinition->setArguments($this->application->getDefinition()->getArguments()); - $this->fullDefinition->addArguments($this->definition->getArguments()); - } else { - $this->fullDefinition->setArguments($this->definition->getArguments()); - } - } - - /** - * Sets an array of argument and option instances. - * - * @param array|InputDefinition $definition An array of argument and option instances or a definition instance - * - * @return $this - */ - public function setDefinition($definition) - { - if ($definition instanceof InputDefinition) { - $this->definition = $definition; - } else { - $this->definition->setDefinition($definition); - } - - $this->fullDefinition = null; - - return $this; - } - - /** - * Gets the InputDefinition attached to this Command. - * - * @return InputDefinition - */ - public function getDefinition() - { - return $this->fullDefinition ?? $this->getNativeDefinition(); - } - - /** - * Gets the InputDefinition to be used to create representations of this Command. - * - * Can be overridden to provide the original command representation when it would otherwise - * be changed by merging with the application InputDefinition. - * - * This method is not part of public API and should not be used directly. - * - * @return InputDefinition - */ - public function getNativeDefinition() - { - if (null === $this->definition) { - throw new LogicException(sprintf('Command class "%s" is not correctly initialized. You probably forgot to call the parent constructor.', static::class)); - } - - return $this->definition; - } - - /** - * Adds an argument. - * - * @param int|null $mode The argument mode: InputArgument::REQUIRED or InputArgument::OPTIONAL - * @param mixed $default The default value (for InputArgument::OPTIONAL mode only) - * - * @return $this - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null) - { - $this->definition->addArgument(new InputArgument($name, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addArgument(new InputArgument($name, $mode, $description, $default)); - } - - return $this; - } - - /** - * Adds an option. - * - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the InputOption::VALUE_* constants - * @param mixed $default The default value (must be null for InputOption::VALUE_NONE) - * - * @return $this - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) - { - $this->definition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - if (null !== $this->fullDefinition) { - $this->fullDefinition->addOption(new InputOption($name, $shortcut, $mode, $description, $default)); - } - - return $this; - } - - /** - * Sets the name of the command. - * - * This method can set both the namespace and the name if - * you separate them by a colon (:) - * - * $command->setName('foo:bar'); - * - * @return $this - * - * @throws InvalidArgumentException When the name is invalid - */ - public function setName(string $name) - { - $this->validateName($name); - - $this->name = $name; - - return $this; - } - - /** - * Sets the process title of the command. - * - * This feature should be used only when creating a long process command, - * like a daemon. - * - * @return $this - */ - public function setProcessTitle(string $title) - { - $this->processTitle = $title; - - return $this; - } - - /** - * Returns the command name. - * - * @return string|null - */ - public function getName() - { - return $this->name; - } - - /** - * @param bool $hidden Whether or not the command should be hidden from the list of commands - * The default value will be true in Symfony 6.0 - * - * @return $this - * - * @final since Symfony 5.1 - */ - public function setHidden(bool $hidden /* = true */) - { - $this->hidden = $hidden; - - return $this; - } - - /** - * @return bool whether the command should be publicly shown or not - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets the description for the command. - * - * @return $this - */ - public function setDescription(string $description) - { - $this->description = $description; - - return $this; - } - - /** - * Returns the description for the command. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Sets the help for the command. - * - * @return $this - */ - public function setHelp(string $help) - { - $this->help = $help; - - return $this; - } - - /** - * Returns the help for the command. - * - * @return string - */ - public function getHelp() - { - return $this->help; - } - - /** - * Returns the processed help for the command replacing the %command.name% and - * %command.full_name% patterns with the real values dynamically. - * - * @return string - */ - public function getProcessedHelp() - { - $name = $this->name; - $isSingleCommand = $this->application && $this->application->isSingleCommand(); - - $placeholders = [ - '%command.name%', - '%command.full_name%', - ]; - $replacements = [ - $name, - $isSingleCommand ? $_SERVER['PHP_SELF'] : $_SERVER['PHP_SELF'].' '.$name, - ]; - - return str_replace($placeholders, $replacements, $this->getHelp() ?: $this->getDescription()); - } - - /** - * Sets the aliases for the command. - * - * @param string[] $aliases An array of aliases for the command - * - * @return $this - * - * @throws InvalidArgumentException When an alias is invalid - */ - public function setAliases(iterable $aliases) - { - $list = []; - - foreach ($aliases as $alias) { - $this->validateName($alias); - $list[] = $alias; - } - - $this->aliases = \is_array($aliases) ? $aliases : $list; - - return $this; - } - - /** - * Returns the aliases for the command. - * - * @return array - */ - public function getAliases() - { - return $this->aliases; - } - - /** - * Returns the synopsis for the command. - * - * @param bool $short Whether to show the short version of the synopsis (with options folded) or not - * - * @return string - */ - public function getSynopsis(bool $short = false) - { - $key = $short ? 'short' : 'long'; - - if (!isset($this->synopsis[$key])) { - $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short))); - } - - return $this->synopsis[$key]; - } - - /** - * Add a command usage example, it'll be prefixed with the command name. - * - * @return $this - */ - public function addUsage(string $usage) - { - if (!str_starts_with($usage, $this->name)) { - $usage = sprintf('%s %s', $this->name, $usage); - } - - $this->usages[] = $usage; - - return $this; - } - - /** - * Returns alternative usages of the command. - * - * @return array - */ - public function getUsages() - { - return $this->usages; - } - - /** - * Gets a helper instance by name. - * - * @return mixed - * - * @throws LogicException if no HelperSet is defined - * @throws InvalidArgumentException if the helper is not defined - */ - public function getHelper(string $name) - { - if (null === $this->helperSet) { - throw new LogicException(sprintf('Cannot retrieve helper "%s" because there is no HelperSet defined. Did you forget to add your command to the application or to set the application on the command using the setApplication() method? You can also set the HelperSet directly using the setHelperSet() method.', $name)); - } - - return $this->helperSet->get($name); - } - - /** - * Validates a command name. - * - * It must be non-empty and parts can optionally be separated by ":". - * - * @throws InvalidArgumentException When the name is invalid - */ - private function validateName(string $name) - { - if (!preg_match('/^[^\:]++(\:[^\:]++)*$/', $name)) { - throw new InvalidArgumentException(sprintf('Command name "%s" is invalid.', $name)); - } - } -} diff --git a/vendor/symfony/console/Command/CompleteCommand.php b/vendor/symfony/console/Command/CompleteCommand.php deleted file mode 100644 index 0e35143c3..000000000 --- a/vendor/symfony/console/Command/CompleteCommand.php +++ /dev/null @@ -1,205 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Completion\Output\BashCompletionOutput; -use Symfony\Component\Console\Completion\Output\CompletionOutputInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; -use Symfony\Component\Console\Exception\ExceptionInterface; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Responsible for providing the values to the shell completion. - * - * @author Wouter de Jong - */ -final class CompleteCommand extends Command -{ - protected static $defaultName = '|_complete'; - protected static $defaultDescription = 'Internal command to provide shell completion suggestions'; - - private $completionOutputs; - - private $isDebug = false; - - /** - * @param array> $completionOutputs A list of additional completion outputs, with shell name as key and FQCN as value - */ - public function __construct(array $completionOutputs = []) - { - // must be set before the parent constructor, as the property value is used in configure() - $this->completionOutputs = $completionOutputs + ['bash' => BashCompletionOutput::class]; - - parent::__construct(); - } - - protected function configure(): void - { - $this - ->addOption('shell', 's', InputOption::VALUE_REQUIRED, 'The shell type ("'.implode('", "', array_keys($this->completionOutputs)).'")') - ->addOption('input', 'i', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'An array of input tokens (e.g. COMP_WORDS or argv)') - ->addOption('current', 'c', InputOption::VALUE_REQUIRED, 'The index of the "input" array that the cursor is in (e.g. COMP_CWORD)') - ->addOption('symfony', 'S', InputOption::VALUE_REQUIRED, 'The version of the completion script') - ; - } - - protected function initialize(InputInterface $input, OutputInterface $output) - { - $this->isDebug = filter_var(getenv('SYMFONY_COMPLETION_DEBUG'), \FILTER_VALIDATE_BOOLEAN); - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - try { - // uncomment when a bugfix or BC break has been introduced in the shell completion scripts - // $version = $input->getOption('symfony'); - // if ($version && version_compare($version, 'x.y', '>=')) { - // $message = sprintf('Completion script version is not supported ("%s" given, ">=x.y" required).', $version); - // $this->log($message); - - // $output->writeln($message.' Install the Symfony completion script again by using the "completion" command.'); - - // return 126; - // } - - $shell = $input->getOption('shell'); - if (!$shell) { - throw new \RuntimeException('The "--shell" option must be set.'); - } - - if (!$completionOutput = $this->completionOutputs[$shell] ?? false) { - throw new \RuntimeException(sprintf('Shell completion is not supported for your shell: "%s" (supported: "%s").', $shell, implode('", "', array_keys($this->completionOutputs)))); - } - - $completionInput = $this->createCompletionInput($input); - $suggestions = new CompletionSuggestions(); - - $this->log([ - '', - ''.date('Y-m-d H:i:s').'', - 'Input: ("|" indicates the cursor position)', - ' '.(string) $completionInput, - 'Command:', - ' '.(string) implode(' ', $_SERVER['argv']), - 'Messages:', - ]); - - $command = $this->findCommand($completionInput, $output); - if (null === $command) { - $this->log(' No command found, completing using the Application class.'); - - $this->getApplication()->complete($completionInput, $suggestions); - } elseif ( - $completionInput->mustSuggestArgumentValuesFor('command') - && $command->getName() !== $completionInput->getCompletionValue() - && !\in_array($completionInput->getCompletionValue(), $command->getAliases(), true) - ) { - $this->log(' No command found, completing using the Application class.'); - - // expand shortcut names ("cache:cl") into their full name ("cache:clear") - $suggestions->suggestValues(array_filter(array_merge([$command->getName()], $command->getAliases()))); - } else { - $command->mergeApplicationDefinition(); - $completionInput->bind($command->getDefinition()); - - if (CompletionInput::TYPE_OPTION_NAME === $completionInput->getCompletionType()) { - $this->log(' Completing option names for the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' command.'); - - $suggestions->suggestOptions($command->getDefinition()->getOptions()); - } else { - $this->log([ - ' Completing using the '.\get_class($command instanceof LazyCommand ? $command->getCommand() : $command).' class.', - ' Completing '.$completionInput->getCompletionType().' for '.$completionInput->getCompletionName().'', - ]); - if (null !== $compval = $completionInput->getCompletionValue()) { - $this->log(' Current value: '.$compval.''); - } - - $command->complete($completionInput, $suggestions); - } - } - - /** @var CompletionOutputInterface $completionOutput */ - $completionOutput = new $completionOutput(); - - $this->log('Suggestions:'); - if ($options = $suggestions->getOptionSuggestions()) { - $this->log(' --'.implode(' --', array_map(function ($o) { return $o->getName(); }, $options))); - } elseif ($values = $suggestions->getValueSuggestions()) { - $this->log(' '.implode(' ', $values)); - } else { - $this->log(' No suggestions were provided'); - } - - $completionOutput->write($suggestions, $output); - } catch (\Throwable $e) { - $this->log([ - 'Error!', - (string) $e, - ]); - - if ($output->isDebug()) { - throw $e; - } - - return 2; - } - - return 0; - } - - private function createCompletionInput(InputInterface $input): CompletionInput - { - $currentIndex = $input->getOption('current'); - if (!$currentIndex || !ctype_digit($currentIndex)) { - throw new \RuntimeException('The "--current" option must be set and it must be an integer.'); - } - - $completionInput = CompletionInput::fromTokens($input->getOption('input'), (int) $currentIndex); - - try { - $completionInput->bind($this->getApplication()->getDefinition()); - } catch (ExceptionInterface $e) { - } - - return $completionInput; - } - - private function findCommand(CompletionInput $completionInput, OutputInterface $output): ?Command - { - try { - $inputName = $completionInput->getFirstArgument(); - if (null === $inputName) { - return null; - } - - return $this->getApplication()->find($inputName); - } catch (CommandNotFoundException $e) { - } - - return null; - } - - private function log($messages): void - { - if (!$this->isDebug) { - return; - } - - $commandName = basename($_SERVER['argv'][0]); - file_put_contents(sys_get_temp_dir().'/sf_'.$commandName.'.log', implode(\PHP_EOL, (array) $messages).\PHP_EOL, \FILE_APPEND); - } -} diff --git a/vendor/symfony/console/Command/DumpCompletionCommand.php b/vendor/symfony/console/Command/DumpCompletionCommand.php deleted file mode 100644 index eaf22be1a..000000000 --- a/vendor/symfony/console/Command/DumpCompletionCommand.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Process; - -/** - * Dumps the completion script for the current shell. - * - * @author Wouter de Jong - */ -final class DumpCompletionCommand extends Command -{ - protected static $defaultName = 'completion'; - protected static $defaultDescription = 'Dump the shell completion script'; - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('shell')) { - $suggestions->suggestValues($this->getSupportedShells()); - } - } - - protected function configure() - { - $fullCommand = $_SERVER['PHP_SELF']; - $commandName = basename($fullCommand); - $fullCommand = @realpath($fullCommand) ?: $fullCommand; - - $this - ->setHelp(<<%command.name% command dumps the shell completion script required -to use shell autocompletion (currently only bash completion is supported). - -Static installation -------------------- - -Dump the script to a global completion file and restart your shell: - - %command.full_name% bash | sudo tee /etc/bash_completion.d/{$commandName} - -Or dump the script to a local file and source it: - - %command.full_name% bash > completion.sh - - # source the file whenever you use the project - source completion.sh - - # or add this line at the end of your "~/.bashrc" file: - source /path/to/completion.sh - -Dynamic installation --------------------- - -Add this to the end of your shell configuration file (e.g. "~/.bashrc"): - - eval "$({$fullCommand} completion bash)" -EOH - ) - ->addArgument('shell', InputArgument::OPTIONAL, 'The shell type (e.g. "bash"), the value of the "$SHELL" env var will be used if this is not given') - ->addOption('debug', null, InputOption::VALUE_NONE, 'Tail the completion debug log') - ; - } - - protected function execute(InputInterface $input, OutputInterface $output): int - { - $commandName = basename($_SERVER['argv'][0]); - - if ($input->getOption('debug')) { - $this->tailDebugLog($commandName, $output); - - return 0; - } - - $shell = $input->getArgument('shell') ?? self::guessShell(); - $completionFile = __DIR__.'/../Resources/completion.'.$shell; - if (!file_exists($completionFile)) { - $supportedShells = $this->getSupportedShells(); - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - if ($shell) { - $output->writeln(sprintf('Detected shell "%s", which is not supported by Symfony shell completion (supported shells: "%s").', $shell, implode('", "', $supportedShells))); - } else { - $output->writeln(sprintf('Shell not detected, Symfony shell completion only supports "%s").', implode('", "', $supportedShells))); - } - - return 2; - } - - $output->write(str_replace(['{{ COMMAND_NAME }}', '{{ VERSION }}'], [$commandName, $this->getApplication()->getVersion()], file_get_contents($completionFile))); - - return 0; - } - - private static function guessShell(): string - { - return basename($_SERVER['SHELL'] ?? ''); - } - - private function tailDebugLog(string $commandName, OutputInterface $output): void - { - $debugFile = sys_get_temp_dir().'/sf_'.$commandName.'.log'; - if (!file_exists($debugFile)) { - touch($debugFile); - } - $process = new Process(['tail', '-f', $debugFile], null, null, null, 0); - $process->run(function (string $type, string $line) use ($output): void { - $output->write($line); - }); - } - - /** - * @return string[] - */ - private function getSupportedShells(): array - { - $shells = []; - - foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) { - if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) { - $shells[] = $file->getExtension(); - } - } - - return $shells; - } -} diff --git a/vendor/symfony/console/Command/HelpCommand.php b/vendor/symfony/console/Command/HelpCommand.php deleted file mode 100644 index c66ef463e..000000000 --- a/vendor/symfony/console/Command/HelpCommand.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * HelpCommand displays the help for a given command. - * - * @author Fabien Potencier - */ -class HelpCommand extends Command -{ - private $command; - - /** - * {@inheritdoc} - */ - protected function configure() - { - $this->ignoreValidationErrors(); - - $this - ->setName('help') - ->setDefinition([ - new InputArgument('command_name', InputArgument::OPTIONAL, 'The command name', 'help'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command help'), - ]) - ->setDescription('Display help for a command') - ->setHelp(<<<'EOF' -The %command.name% command displays help for a given command: - - %command.full_name% list - -You can also output the help in other formats by using the --format option: - - %command.full_name% --format=xml list - -To display the list of available commands, please use the list command. -EOF - ) - ; - } - - public function setCommand(Command $command) - { - $this->command = $command; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - if (null === $this->command) { - $this->command = $this->getApplication()->find($input->getArgument('command_name')); - } - - $helper = new DescriptorHelper(); - $helper->describe($output, $this->command, [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - ]); - - $this->command = null; - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('command_name')) { - $descriptor = new ApplicationDescription($this->getApplication()); - $suggestions->suggestValues(array_keys($descriptor->getCommands())); - - return; - } - - if ($input->mustSuggestOptionValuesFor('format')) { - $helper = new DescriptorHelper(); - $suggestions->suggestValues($helper->getFormats()); - } - } -} diff --git a/vendor/symfony/console/Command/LazyCommand.php b/vendor/symfony/console/Command/LazyCommand.php deleted file mode 100644 index e576ad03f..000000000 --- a/vendor/symfony/console/Command/LazyCommand.php +++ /dev/null @@ -1,218 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Helper\HelperSet; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Nicolas Grekas - */ -final class LazyCommand extends Command -{ - private $command; - private $isEnabled; - - public function __construct(string $name, array $aliases, string $description, bool $isHidden, \Closure $commandFactory, ?bool $isEnabled = true) - { - $this->setName($name) - ->setAliases($aliases) - ->setHidden($isHidden) - ->setDescription($description); - - $this->command = $commandFactory; - $this->isEnabled = $isEnabled; - } - - public function ignoreValidationErrors(): void - { - $this->getCommand()->ignoreValidationErrors(); - } - - public function setApplication(Application $application = null): void - { - if ($this->command instanceof parent) { - $this->command->setApplication($application); - } - - parent::setApplication($application); - } - - public function setHelperSet(HelperSet $helperSet): void - { - if ($this->command instanceof parent) { - $this->command->setHelperSet($helperSet); - } - - parent::setHelperSet($helperSet); - } - - public function isEnabled(): bool - { - return $this->isEnabled ?? $this->getCommand()->isEnabled(); - } - - public function run(InputInterface $input, OutputInterface $output): int - { - return $this->getCommand()->run($input, $output); - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - $this->getCommand()->complete($input, $suggestions); - } - - /** - * @return $this - */ - public function setCode(callable $code): self - { - $this->getCommand()->setCode($code); - - return $this; - } - - /** - * @internal - */ - public function mergeApplicationDefinition(bool $mergeArgs = true): void - { - $this->getCommand()->mergeApplicationDefinition($mergeArgs); - } - - /** - * @return $this - */ - public function setDefinition($definition): self - { - $this->getCommand()->setDefinition($definition); - - return $this; - } - - public function getDefinition(): InputDefinition - { - return $this->getCommand()->getDefinition(); - } - - public function getNativeDefinition(): InputDefinition - { - return $this->getCommand()->getNativeDefinition(); - } - - /** - * @return $this - */ - public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addArgument($name, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self - { - $this->getCommand()->addOption($name, $shortcut, $mode, $description, $default); - - return $this; - } - - /** - * @return $this - */ - public function setProcessTitle(string $title): self - { - $this->getCommand()->setProcessTitle($title); - - return $this; - } - - /** - * @return $this - */ - public function setHelp(string $help): self - { - $this->getCommand()->setHelp($help); - - return $this; - } - - public function getHelp(): string - { - return $this->getCommand()->getHelp(); - } - - public function getProcessedHelp(): string - { - return $this->getCommand()->getProcessedHelp(); - } - - public function getSynopsis(bool $short = false): string - { - return $this->getCommand()->getSynopsis($short); - } - - /** - * @return $this - */ - public function addUsage(string $usage): self - { - $this->getCommand()->addUsage($usage); - - return $this; - } - - public function getUsages(): array - { - return $this->getCommand()->getUsages(); - } - - /** - * @return mixed - */ - public function getHelper(string $name) - { - return $this->getCommand()->getHelper($name); - } - - public function getCommand(): parent - { - if (!$this->command instanceof \Closure) { - return $this->command; - } - - $command = $this->command = ($this->command)(); - $command->setApplication($this->getApplication()); - - if (null !== $this->getHelperSet()) { - $command->setHelperSet($this->getHelperSet()); - } - - $command->setName($this->getName()) - ->setAliases($this->getAliases()) - ->setHidden($this->isHidden()) - ->setDescription($this->getDescription()); - - // Will throw if the command is not correctly initialized. - $command->getDefinition(); - - return $command; - } -} diff --git a/vendor/symfony/console/Command/ListCommand.php b/vendor/symfony/console/Command/ListCommand.php deleted file mode 100644 index f04a4ef67..000000000 --- a/vendor/symfony/console/Command/ListCommand.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Descriptor\ApplicationDescription; -use Symfony\Component\Console\Helper\DescriptorHelper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * ListCommand displays the list of all available commands for the application. - * - * @author Fabien Potencier - */ -class ListCommand extends Command -{ - /** - * {@inheritdoc} - */ - protected function configure() - { - $this - ->setName('list') - ->setDefinition([ - new InputArgument('namespace', InputArgument::OPTIONAL, 'The namespace name'), - new InputOption('raw', null, InputOption::VALUE_NONE, 'To output raw command list'), - new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt, xml, json, or md)', 'txt'), - new InputOption('short', null, InputOption::VALUE_NONE, 'To skip describing commands\' arguments'), - ]) - ->setDescription('List commands') - ->setHelp(<<<'EOF' -The %command.name% command lists all commands: - - %command.full_name% - -You can also display the commands for a specific namespace: - - %command.full_name% test - -You can also output the information in other formats by using the --format option: - - %command.full_name% --format=xml - -It's also possible to get raw list of commands (useful for embedding command runner): - - %command.full_name% --raw -EOF - ) - ; - } - - /** - * {@inheritdoc} - */ - protected function execute(InputInterface $input, OutputInterface $output) - { - $helper = new DescriptorHelper(); - $helper->describe($output, $this->getApplication(), [ - 'format' => $input->getOption('format'), - 'raw_text' => $input->getOption('raw'), - 'namespace' => $input->getArgument('namespace'), - 'short' => $input->getOption('short'), - ]); - - return 0; - } - - public function complete(CompletionInput $input, CompletionSuggestions $suggestions): void - { - if ($input->mustSuggestArgumentValuesFor('namespace')) { - $descriptor = new ApplicationDescription($this->getApplication()); - $suggestions->suggestValues(array_keys($descriptor->getNamespaces())); - - return; - } - - if ($input->mustSuggestOptionValuesFor('format')) { - $helper = new DescriptorHelper(); - $suggestions->suggestValues($helper->getFormats()); - } - } -} diff --git a/vendor/symfony/console/Command/LockableTrait.php b/vendor/symfony/console/Command/LockableTrait.php deleted file mode 100644 index b1856dca7..000000000 --- a/vendor/symfony/console/Command/LockableTrait.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Lock\LockFactory; -use Symfony\Component\Lock\LockInterface; -use Symfony\Component\Lock\Store\FlockStore; -use Symfony\Component\Lock\Store\SemaphoreStore; - -/** - * Basic lock feature for commands. - * - * @author Geoffrey Brier - */ -trait LockableTrait -{ - /** @var LockInterface|null */ - private $lock; - - /** - * Locks a command. - */ - private function lock(string $name = null, bool $blocking = false): bool - { - if (!class_exists(SemaphoreStore::class)) { - throw new LogicException('To enable the locking feature you must install the symfony/lock component.'); - } - - if (null !== $this->lock) { - throw new LogicException('A lock is already in place.'); - } - - if (SemaphoreStore::isSupported()) { - $store = new SemaphoreStore(); - } else { - $store = new FlockStore(); - } - - $this->lock = (new LockFactory($store))->createLock($name ?: $this->getName()); - if (!$this->lock->acquire($blocking)) { - $this->lock = null; - - return false; - } - - return true; - } - - /** - * Releases the command lock if there is one. - */ - private function release() - { - if ($this->lock) { - $this->lock->release(); - $this->lock = null; - } - } -} diff --git a/vendor/symfony/console/Command/SignalableCommandInterface.php b/vendor/symfony/console/Command/SignalableCommandInterface.php deleted file mode 100644 index d439728b6..000000000 --- a/vendor/symfony/console/Command/SignalableCommandInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Command; - -/** - * Interface for command reacting to signal. - * - * @author Grégoire Pineau - */ -interface SignalableCommandInterface -{ - /** - * Returns the list of signals to subscribe. - */ - public function getSubscribedSignals(): array; - - /** - * The method will be called when the application is signaled. - */ - public function handleSignal(int $signal): void; -} diff --git a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php b/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php deleted file mode 100644 index 0adaf886f..000000000 --- a/vendor/symfony/console/CommandLoader/CommandLoaderInterface.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Robin Chalas - */ -interface CommandLoaderInterface -{ - /** - * Loads a command. - * - * @return Command - * - * @throws CommandNotFoundException - */ - public function get(string $name); - - /** - * Checks if a command exists. - * - * @return bool - */ - public function has(string $name); - - /** - * @return string[] - */ - public function getNames(); -} diff --git a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php b/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php deleted file mode 100644 index ddccb3d45..000000000 --- a/vendor/symfony/console/CommandLoader/ContainerCommandLoader.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Psr\Container\ContainerInterface; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * Loads commands from a PSR-11 container. - * - * @author Robin Chalas - */ -class ContainerCommandLoader implements CommandLoaderInterface -{ - private $container; - private $commandMap; - - /** - * @param array $commandMap An array with command names as keys and service ids as values - */ - public function __construct(ContainerInterface $container, array $commandMap) - { - $this->container = $container; - $this->commandMap = $commandMap; - } - - /** - * {@inheritdoc} - */ - public function get(string $name) - { - if (!$this->has($name)) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->container->get($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function has(string $name) - { - return isset($this->commandMap[$name]) && $this->container->has($this->commandMap[$name]); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->commandMap); - } -} diff --git a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php b/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php deleted file mode 100644 index 7e2db3464..000000000 --- a/vendor/symfony/console/CommandLoader/FactoryCommandLoader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\CommandLoader; - -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * A simple command loader using factories to instantiate commands lazily. - * - * @author Maxime Steinhausser - */ -class FactoryCommandLoader implements CommandLoaderInterface -{ - private $factories; - - /** - * @param callable[] $factories Indexed by command names - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - /** - * {@inheritdoc} - */ - public function has(string $name) - { - return isset($this->factories[$name]); - } - - /** - * {@inheritdoc} - */ - public function get(string $name) - { - if (!isset($this->factories[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - $factory = $this->factories[$name]; - - return $factory(); - } - - /** - * {@inheritdoc} - */ - public function getNames() - { - return array_keys($this->factories); - } -} diff --git a/vendor/symfony/console/Completion/CompletionInput.php b/vendor/symfony/console/Completion/CompletionInput.php deleted file mode 100644 index 368b94507..000000000 --- a/vendor/symfony/console/Completion/CompletionInput.php +++ /dev/null @@ -1,249 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Input\ArgvInput; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * An input specialized for shell completion. - * - * This input allows unfinished option names or values and exposes what kind of - * completion is expected. - * - * @author Wouter de Jong - */ -final class CompletionInput extends ArgvInput -{ - public const TYPE_ARGUMENT_VALUE = 'argument_value'; - public const TYPE_OPTION_VALUE = 'option_value'; - public const TYPE_OPTION_NAME = 'option_name'; - public const TYPE_NONE = 'none'; - - private $tokens; - private $currentIndex; - private $completionType; - private $completionName = null; - private $completionValue = ''; - - /** - * Converts a terminal string into tokens. - * - * This is required for shell completions without COMP_WORDS support. - */ - public static function fromString(string $inputStr, int $currentIndex): self - { - preg_match_all('/(?<=^|\s)([\'"]?)(.+?)(?tokens = $tokens; - $input->currentIndex = $currentIndex; - - return $input; - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition): void - { - parent::bind($definition); - - $relevantToken = $this->getRelevantToken(); - if ('-' === $relevantToken[0]) { - // the current token is an input option: complete either option name or option value - [$optionToken, $optionValue] = explode('=', $relevantToken, 2) + ['', '']; - - $option = $this->getOptionFromToken($optionToken); - if (null === $option && !$this->isCursorFree()) { - $this->completionType = self::TYPE_OPTION_NAME; - $this->completionValue = $relevantToken; - - return; - } - - if (null !== $option && $option->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $option->getName(); - $this->completionValue = $optionValue ?: (!str_starts_with($optionToken, '--') ? substr($optionToken, 2) : ''); - - return; - } - } - - $previousToken = $this->tokens[$this->currentIndex - 1]; - if ('-' === $previousToken[0] && '' !== trim($previousToken, '-')) { - // check if previous option accepted a value - $previousOption = $this->getOptionFromToken($previousToken); - if (null !== $previousOption && $previousOption->acceptValue()) { - $this->completionType = self::TYPE_OPTION_VALUE; - $this->completionName = $previousOption->getName(); - $this->completionValue = $relevantToken; - - return; - } - } - - // complete argument value - $this->completionType = self::TYPE_ARGUMENT_VALUE; - - foreach ($this->definition->getArguments() as $argumentName => $argument) { - if (!isset($this->arguments[$argumentName])) { - break; - } - - $argumentValue = $this->arguments[$argumentName]; - $this->completionName = $argumentName; - if (\is_array($argumentValue)) { - $this->completionValue = $argumentValue ? $argumentValue[array_key_last($argumentValue)] : null; - } else { - $this->completionValue = $argumentValue; - } - } - - if ($this->currentIndex >= \count($this->tokens)) { - if (!isset($this->arguments[$argumentName]) || $this->definition->getArgument($argumentName)->isArray()) { - $this->completionName = $argumentName; - $this->completionValue = ''; - } else { - // we've reached the end - $this->completionType = self::TYPE_NONE; - $this->completionName = null; - $this->completionValue = ''; - } - } - } - - /** - * Returns the type of completion required. - * - * TYPE_ARGUMENT_VALUE when completing the value of an input argument - * TYPE_OPTION_VALUE when completing the value of an input option - * TYPE_OPTION_NAME when completing the name of an input option - * TYPE_NONE when nothing should be completed - * - * @return string One of self::TYPE_* constants. TYPE_OPTION_NAME and TYPE_NONE are already implemented by the Console component - */ - public function getCompletionType(): string - { - return $this->completionType; - } - - /** - * The name of the input option or argument when completing a value. - * - * @return string|null returns null when completing an option name - */ - public function getCompletionName(): ?string - { - return $this->completionName; - } - - /** - * The value already typed by the user (or empty string). - */ - public function getCompletionValue(): string - { - return $this->completionValue; - } - - public function mustSuggestOptionValuesFor(string $optionName): bool - { - return self::TYPE_OPTION_VALUE === $this->getCompletionType() && $optionName === $this->getCompletionName(); - } - - public function mustSuggestArgumentValuesFor(string $argumentName): bool - { - return self::TYPE_ARGUMENT_VALUE === $this->getCompletionType() && $argumentName === $this->getCompletionName(); - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - try { - return parent::parseToken($token, $parseOptions); - } catch (RuntimeException $e) { - // suppress errors, completed input is almost never valid - } - - return $parseOptions; - } - - private function getOptionFromToken(string $optionToken): ?InputOption - { - $optionName = ltrim($optionToken, '-'); - if (!$optionName) { - return null; - } - - if ('-' === ($optionToken[1] ?? ' ')) { - // long option name - return $this->definition->hasOption($optionName) ? $this->definition->getOption($optionName) : null; - } - - // short option name - return $this->definition->hasShortcut($optionName[0]) ? $this->definition->getOptionForShortcut($optionName[0]) : null; - } - - /** - * The token of the cursor, or the last token if the cursor is at the end of the input. - */ - private function getRelevantToken(): string - { - return $this->tokens[$this->isCursorFree() ? $this->currentIndex - 1 : $this->currentIndex]; - } - - /** - * Whether the cursor is "free" (i.e. at the end of the input preceded by a space). - */ - private function isCursorFree(): bool - { - $nrOfTokens = \count($this->tokens); - if ($this->currentIndex > $nrOfTokens) { - throw new \LogicException('Current index is invalid, it must be the number of input tokens or one more.'); - } - - return $this->currentIndex >= $nrOfTokens; - } - - public function __toString() - { - $str = ''; - foreach ($this->tokens as $i => $token) { - $str .= $token; - - if ($this->currentIndex === $i) { - $str .= '|'; - } - - $str .= ' '; - } - - if ($this->currentIndex > $i) { - $str .= '|'; - } - - return rtrim($str); - } -} diff --git a/vendor/symfony/console/Completion/CompletionSuggestions.php b/vendor/symfony/console/Completion/CompletionSuggestions.php deleted file mode 100644 index d8905e5ee..000000000 --- a/vendor/symfony/console/Completion/CompletionSuggestions.php +++ /dev/null @@ -1,99 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -use Symfony\Component\Console\Input\InputOption; - -/** - * Stores all completion suggestions for the current input. - * - * @author Wouter de Jong - */ -final class CompletionSuggestions -{ - private $valueSuggestions = []; - private $optionSuggestions = []; - - /** - * Add a suggested value for an input option or argument. - * - * @param string|Suggestion $value - * - * @return $this - */ - public function suggestValue($value): self - { - $this->valueSuggestions[] = !$value instanceof Suggestion ? new Suggestion($value) : $value; - - return $this; - } - - /** - * Add multiple suggested values at once for an input option or argument. - * - * @param list $values - * - * @return $this - */ - public function suggestValues(array $values): self - { - foreach ($values as $value) { - $this->suggestValue($value); - } - - return $this; - } - - /** - * Add a suggestion for an input option name. - * - * @return $this - */ - public function suggestOption(InputOption $option): self - { - $this->optionSuggestions[] = $option; - - return $this; - } - - /** - * Add multiple suggestions for input option names at once. - * - * @param InputOption[] $options - * - * @return $this - */ - public function suggestOptions(array $options): self - { - foreach ($options as $option) { - $this->suggestOption($option); - } - - return $this; - } - - /** - * @return InputOption[] - */ - public function getOptionSuggestions(): array - { - return $this->optionSuggestions; - } - - /** - * @return Suggestion[] - */ - public function getValueSuggestions(): array - { - return $this->valueSuggestions; - } -} diff --git a/vendor/symfony/console/Completion/Output/BashCompletionOutput.php b/vendor/symfony/console/Completion/Output/BashCompletionOutput.php deleted file mode 100644 index c6f76eb8f..000000000 --- a/vendor/symfony/console/Completion/Output/BashCompletionOutput.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Wouter de Jong - */ -class BashCompletionOutput implements CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void - { - $values = $suggestions->getValueSuggestions(); - foreach ($suggestions->getOptionSuggestions() as $option) { - $values[] = '--'.$option->getName(); - if ($option->isNegatable()) { - $values[] = '--no-'.$option->getName(); - } - } - $output->writeln(implode("\n", $values)); - } -} diff --git a/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php b/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php deleted file mode 100644 index 659e59655..000000000 --- a/vendor/symfony/console/Completion/Output/CompletionOutputInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion\Output; - -use Symfony\Component\Console\Completion\CompletionSuggestions; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Transforms the {@see CompletionSuggestions} object into output readable by the shell completion. - * - * @author Wouter de Jong - */ -interface CompletionOutputInterface -{ - public function write(CompletionSuggestions $suggestions, OutputInterface $output): void; -} diff --git a/vendor/symfony/console/Completion/Suggestion.php b/vendor/symfony/console/Completion/Suggestion.php deleted file mode 100644 index 6c7bc4dc4..000000000 --- a/vendor/symfony/console/Completion/Suggestion.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Completion; - -/** - * Represents a single suggested value. - * - * @author Wouter de Jong - */ -class Suggestion -{ - private $value; - - public function __construct(string $value) - { - $this->value = $value; - } - - public function getValue(): string - { - return $this->value; - } - - public function __toString(): string - { - return $this->getValue(); - } -} diff --git a/vendor/symfony/console/ConsoleEvents.php b/vendor/symfony/console/ConsoleEvents.php deleted file mode 100644 index 6ae8f32b8..000000000 --- a/vendor/symfony/console/ConsoleEvents.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Event\ConsoleCommandEvent; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleSignalEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; - -/** - * Contains all events dispatched by an Application. - * - * @author Francesco Levorato - */ -final class ConsoleEvents -{ - /** - * The COMMAND event allows you to attach listeners before any command is - * executed by the console. It also allows you to modify the command, input and output - * before they are handed to the command. - * - * @Event("Symfony\Component\Console\Event\ConsoleCommandEvent") - */ - public const COMMAND = 'console.command'; - - /** - * The SIGNAL event allows you to perform some actions - * after the command execution was interrupted. - * - * @Event("Symfony\Component\Console\Event\ConsoleSignalEvent") - */ - public const SIGNAL = 'console.signal'; - - /** - * The TERMINATE event allows you to attach listeners after a command is - * executed by the console. - * - * @Event("Symfony\Component\Console\Event\ConsoleTerminateEvent") - */ - public const TERMINATE = 'console.terminate'; - - /** - * The ERROR event occurs when an uncaught exception or error appears. - * - * This event allows you to deal with the exception/error or - * to modify the thrown exception. - * - * @Event("Symfony\Component\Console\Event\ConsoleErrorEvent") - */ - public const ERROR = 'console.error'; - - /** - * Event aliases. - * - * These aliases can be consumed by RegisterListenersPass. - */ - public const ALIASES = [ - ConsoleCommandEvent::class => self::COMMAND, - ConsoleErrorEvent::class => self::ERROR, - ConsoleSignalEvent::class => self::SIGNAL, - ConsoleTerminateEvent::class => self::TERMINATE, - ]; -} diff --git a/vendor/symfony/console/Cursor.php b/vendor/symfony/console/Cursor.php deleted file mode 100644 index 0c4dafb6c..000000000 --- a/vendor/symfony/console/Cursor.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Pierre du Plessis - */ -final class Cursor -{ - private $output; - private $input; - - /** - * @param resource|null $input - */ - public function __construct(OutputInterface $output, $input = null) - { - $this->output = $output; - $this->input = $input ?? (\defined('STDIN') ? \STDIN : fopen('php://input', 'r+')); - } - - /** - * @return $this - */ - public function moveUp(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dA", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveDown(int $lines = 1): self - { - $this->output->write(sprintf("\x1b[%dB", $lines)); - - return $this; - } - - /** - * @return $this - */ - public function moveRight(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dC", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveLeft(int $columns = 1): self - { - $this->output->write(sprintf("\x1b[%dD", $columns)); - - return $this; - } - - /** - * @return $this - */ - public function moveToColumn(int $column): self - { - $this->output->write(sprintf("\x1b[%dG", $column)); - - return $this; - } - - /** - * @return $this - */ - public function moveToPosition(int $column, int $row): self - { - $this->output->write(sprintf("\x1b[%d;%dH", $row + 1, $column)); - - return $this; - } - - /** - * @return $this - */ - public function savePosition(): self - { - $this->output->write("\x1b7"); - - return $this; - } - - /** - * @return $this - */ - public function restorePosition(): self - { - $this->output->write("\x1b8"); - - return $this; - } - - /** - * @return $this - */ - public function hide(): self - { - $this->output->write("\x1b[?25l"); - - return $this; - } - - /** - * @return $this - */ - public function show(): self - { - $this->output->write("\x1b[?25h\x1b[?0c"); - - return $this; - } - - /** - * Clears all the output from the current line. - * - * @return $this - */ - public function clearLine(): self - { - $this->output->write("\x1b[2K"); - - return $this; - } - - /** - * Clears all the output from the current line after the current position. - */ - public function clearLineAfter(): self - { - $this->output->write("\x1b[K"); - - return $this; - } - - /** - * Clears all the output from the cursors' current position to the end of the screen. - * - * @return $this - */ - public function clearOutput(): self - { - $this->output->write("\x1b[0J"); - - return $this; - } - - /** - * Clears the entire screen. - * - * @return $this - */ - public function clearScreen(): self - { - $this->output->write("\x1b[2J"); - - return $this; - } - - /** - * Returns the current cursor position as x,y coordinates. - */ - public function getCurrentPosition(): array - { - static $isTtySupported; - - if (null === $isTtySupported && \function_exists('proc_open')) { - $isTtySupported = (bool) @proc_open('echo 1 >/dev/null', [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']], $pipes); - } - - if (!$isTtySupported) { - return [1, 1]; - } - - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -icanon -echo'); - - @fwrite($this->input, "\033[6n"); - - $code = trim(fread($this->input, 1024)); - - shell_exec(sprintf('stty %s', $sttyMode)); - - sscanf($code, "\033[%d;%dR", $row, $col); - - return [$col, $row]; - } -} diff --git a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php b/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php deleted file mode 100644 index 1fbb212e7..000000000 --- a/vendor/symfony/console/DependencyInjection/AddConsoleCommandPass.php +++ /dev/null @@ -1,148 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\DependencyInjection; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Command\LazyCommand; -use Symfony\Component\Console\CommandLoader\ContainerCommandLoader; -use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; -use Symfony\Component\DependencyInjection\Reference; -use Symfony\Component\DependencyInjection\TypedReference; - -/** - * Registers console commands. - * - * @author Grégoire Pineau - */ -class AddConsoleCommandPass implements CompilerPassInterface -{ - private $commandLoaderServiceId; - private $commandTag; - private $noPreloadTag; - private $privateTagName; - - public function __construct(string $commandLoaderServiceId = 'console.command_loader', string $commandTag = 'console.command', string $noPreloadTag = 'container.no_preload', string $privateTagName = 'container.private') - { - if (0 < \func_num_args()) { - trigger_deprecation('symfony/console', '5.3', 'Configuring "%s" is deprecated.', __CLASS__); - } - - $this->commandLoaderServiceId = $commandLoaderServiceId; - $this->commandTag = $commandTag; - $this->noPreloadTag = $noPreloadTag; - $this->privateTagName = $privateTagName; - } - - public function process(ContainerBuilder $container) - { - $commandServices = $container->findTaggedServiceIds($this->commandTag, true); - $lazyCommandMap = []; - $lazyCommandRefs = []; - $serviceIds = []; - - foreach ($commandServices as $id => $tags) { - $definition = $container->getDefinition($id); - $definition->addTag($this->noPreloadTag); - $class = $container->getParameterBag()->resolveValue($definition->getClass()); - - if (isset($tags[0]['command'])) { - $aliases = $tags[0]['command']; - } else { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $aliases = str_replace('%', '%%', $class::getDefaultName() ?? ''); - } - - $aliases = explode('|', $aliases ?? ''); - $commandName = array_shift($aliases); - - if ($isHidden = '' === $commandName) { - $commandName = array_shift($aliases); - } - - if (null === $commandName) { - if (!$definition->isPublic() || $definition->isPrivate() || $definition->hasTag($this->privateTagName)) { - $commandId = 'console.command.public_alias.'.$id; - $container->setAlias($commandId, $id)->setPublic(true); - $id = $commandId; - } - $serviceIds[] = $id; - - continue; - } - - $description = $tags[0]['description'] ?? null; - - unset($tags[0]); - $lazyCommandMap[$commandName] = $id; - $lazyCommandRefs[$id] = new TypedReference($id, $class); - - foreach ($aliases as $alias) { - $lazyCommandMap[$alias] = $id; - } - - foreach ($tags as $tag) { - if (isset($tag['command'])) { - $aliases[] = $tag['command']; - $lazyCommandMap[$tag['command']] = $id; - } - - $description = $description ?? $tag['description'] ?? null; - } - - $definition->addMethodCall('setName', [$commandName]); - - if ($aliases) { - $definition->addMethodCall('setAliases', [$aliases]); - } - - if ($isHidden) { - $definition->addMethodCall('setHidden', [true]); - } - - if (!$description) { - if (!$r = $container->getReflectionClass($class)) { - throw new InvalidArgumentException(sprintf('Class "%s" used for service "%s" cannot be found.', $class, $id)); - } - if (!$r->isSubclassOf(Command::class)) { - throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class)); - } - $description = str_replace('%', '%%', $class::getDefaultDescription() ?? ''); - } - - if ($description) { - $definition->addMethodCall('setDescription', [$description]); - - $container->register('.'.$id.'.lazy', LazyCommand::class) - ->setArguments([$commandName, $aliases, $description, $isHidden, new ServiceClosureArgument($lazyCommandRefs[$id])]); - - $lazyCommandRefs[$id] = new Reference('.'.$id.'.lazy'); - } - } - - $container - ->register($this->commandLoaderServiceId, ContainerCommandLoader::class) - ->setPublic(true) - ->addTag($this->noPreloadTag) - ->setArguments([ServiceLocatorTagPass::register($container, $lazyCommandRefs), $lazyCommandMap]); - - $container->setParameter('console.command.ids', $serviceIds); - } -} diff --git a/vendor/symfony/console/Descriptor/ApplicationDescription.php b/vendor/symfony/console/Descriptor/ApplicationDescription.php deleted file mode 100644 index 2a3acc99b..000000000 --- a/vendor/symfony/console/Descriptor/ApplicationDescription.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\CommandNotFoundException; - -/** - * @author Jean-François Simon - * - * @internal - */ -class ApplicationDescription -{ - public const GLOBAL_NAMESPACE = '_global'; - - private $application; - private $namespace; - private $showHidden; - - /** - * @var array - */ - private $namespaces; - - /** - * @var array - */ - private $commands; - - /** - * @var array - */ - private $aliases; - - public function __construct(Application $application, string $namespace = null, bool $showHidden = false) - { - $this->application = $application; - $this->namespace = $namespace; - $this->showHidden = $showHidden; - } - - public function getNamespaces(): array - { - if (null === $this->namespaces) { - $this->inspectApplication(); - } - - return $this->namespaces; - } - - /** - * @return Command[] - */ - public function getCommands(): array - { - if (null === $this->commands) { - $this->inspectApplication(); - } - - return $this->commands; - } - - /** - * @throws CommandNotFoundException - */ - public function getCommand(string $name): Command - { - if (!isset($this->commands[$name]) && !isset($this->aliases[$name])) { - throw new CommandNotFoundException(sprintf('Command "%s" does not exist.', $name)); - } - - return $this->commands[$name] ?? $this->aliases[$name]; - } - - private function inspectApplication() - { - $this->commands = []; - $this->namespaces = []; - - $all = $this->application->all($this->namespace ? $this->application->findNamespace($this->namespace) : null); - foreach ($this->sortCommands($all) as $namespace => $commands) { - $names = []; - - /** @var Command $command */ - foreach ($commands as $name => $command) { - if (!$command->getName() || (!$this->showHidden && $command->isHidden())) { - continue; - } - - if ($command->getName() === $name) { - $this->commands[$name] = $command; - } else { - $this->aliases[$name] = $command; - } - - $names[] = $name; - } - - $this->namespaces[$namespace] = ['id' => $namespace, 'commands' => $names]; - } - } - - private function sortCommands(array $commands): array - { - $namespacedCommands = []; - $globalCommands = []; - $sortedCommands = []; - foreach ($commands as $name => $command) { - $key = $this->application->extractNamespace($name, 1); - if (\in_array($key, ['', self::GLOBAL_NAMESPACE], true)) { - $globalCommands[$name] = $command; - } else { - $namespacedCommands[$key][$name] = $command; - } - } - - if ($globalCommands) { - ksort($globalCommands); - $sortedCommands[self::GLOBAL_NAMESPACE] = $globalCommands; - } - - if ($namespacedCommands) { - ksort($namespacedCommands, \SORT_STRING); - foreach ($namespacedCommands as $key => $commandsSet) { - ksort($commandsSet); - $sortedCommands[$key] = $commandsSet; - } - } - - return $sortedCommands; - } -} diff --git a/vendor/symfony/console/Descriptor/Descriptor.php b/vendor/symfony/console/Descriptor/Descriptor.php deleted file mode 100644 index a3648301f..000000000 --- a/vendor/symfony/console/Descriptor/Descriptor.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Jean-François Simon - * - * @internal - */ -abstract class Descriptor implements DescriptorInterface -{ - /** - * @var OutputInterface - */ - protected $output; - - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, object $object, array $options = []) - { - $this->output = $output; - - switch (true) { - case $object instanceof InputArgument: - $this->describeInputArgument($object, $options); - break; - case $object instanceof InputOption: - $this->describeInputOption($object, $options); - break; - case $object instanceof InputDefinition: - $this->describeInputDefinition($object, $options); - break; - case $object instanceof Command: - $this->describeCommand($object, $options); - break; - case $object instanceof Application: - $this->describeApplication($object, $options); - break; - default: - throw new InvalidArgumentException(sprintf('Object of type "%s" is not describable.', get_debug_type($object))); - } - } - - /** - * Writes content to output. - */ - protected function write(string $content, bool $decorated = false) - { - $this->output->write($content, false, $decorated ? OutputInterface::OUTPUT_NORMAL : OutputInterface::OUTPUT_RAW); - } - - /** - * Describes an InputArgument instance. - */ - abstract protected function describeInputArgument(InputArgument $argument, array $options = []); - - /** - * Describes an InputOption instance. - */ - abstract protected function describeInputOption(InputOption $option, array $options = []); - - /** - * Describes an InputDefinition instance. - */ - abstract protected function describeInputDefinition(InputDefinition $definition, array $options = []); - - /** - * Describes a Command instance. - */ - abstract protected function describeCommand(Command $command, array $options = []); - - /** - * Describes an Application instance. - */ - abstract protected function describeApplication(Application $application, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/DescriptorInterface.php b/vendor/symfony/console/Descriptor/DescriptorInterface.php deleted file mode 100644 index ebea30367..000000000 --- a/vendor/symfony/console/Descriptor/DescriptorInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Descriptor interface. - * - * @author Jean-François Simon - */ -interface DescriptorInterface -{ - public function describe(OutputInterface $output, object $object, array $options = []); -} diff --git a/vendor/symfony/console/Descriptor/JsonDescriptor.php b/vendor/symfony/console/Descriptor/JsonDescriptor.php deleted file mode 100644 index 1d2865941..000000000 --- a/vendor/symfony/console/Descriptor/JsonDescriptor.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * JSON descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class JsonDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeData($this->getInputArgumentData($argument), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeData($this->getInputOptionData($option), $options); - if ($option->isNegatable()) { - $this->writeData($this->getInputOptionData($option, true), $options); - } - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeData($this->getInputDefinitionData($definition), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeData($this->getCommandData($command, $options['short'] ?? false), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace, true); - $commands = []; - - foreach ($description->getCommands() as $command) { - $commands[] = $this->getCommandData($command, $options['short'] ?? false); - } - - $data = []; - if ('UNKNOWN' !== $application->getName()) { - $data['application']['name'] = $application->getName(); - if ('UNKNOWN' !== $application->getVersion()) { - $data['application']['version'] = $application->getVersion(); - } - } - - $data['commands'] = $commands; - - if ($describedNamespace) { - $data['namespace'] = $describedNamespace; - } else { - $data['namespaces'] = array_values($description->getNamespaces()); - } - - $this->writeData($data, $options); - } - - /** - * Writes data as json. - */ - private function writeData(array $data, array $options) - { - $flags = $options['json_encoding'] ?? 0; - - $this->write(json_encode($data, $flags)); - } - - private function getInputArgumentData(InputArgument $argument): array - { - return [ - 'name' => $argument->getName(), - 'is_required' => $argument->isRequired(), - 'is_array' => $argument->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $argument->getDescription()), - 'default' => \INF === $argument->getDefault() ? 'INF' : $argument->getDefault(), - ]; - } - - private function getInputOptionData(InputOption $option, bool $negated = false): array - { - return $negated ? [ - 'name' => '--no-'.$option->getName(), - 'shortcut' => '', - 'accept_value' => false, - 'is_value_required' => false, - 'is_multiple' => false, - 'description' => 'Negate the "--'.$option->getName().'" option', - 'default' => false, - ] : [ - 'name' => '--'.$option->getName(), - 'shortcut' => $option->getShortcut() ? '-'.str_replace('|', '|-', $option->getShortcut()) : '', - 'accept_value' => $option->acceptValue(), - 'is_value_required' => $option->isValueRequired(), - 'is_multiple' => $option->isArray(), - 'description' => preg_replace('/\s*[\r\n]\s*/', ' ', $option->getDescription()), - 'default' => \INF === $option->getDefault() ? 'INF' : $option->getDefault(), - ]; - } - - private function getInputDefinitionData(InputDefinition $definition): array - { - $inputArguments = []; - foreach ($definition->getArguments() as $name => $argument) { - $inputArguments[$name] = $this->getInputArgumentData($argument); - } - - $inputOptions = []; - foreach ($definition->getOptions() as $name => $option) { - $inputOptions[$name] = $this->getInputOptionData($option); - if ($option->isNegatable()) { - $inputOptions['no-'.$name] = $this->getInputOptionData($option, true); - } - } - - return ['arguments' => $inputArguments, 'options' => $inputOptions]; - } - - private function getCommandData(Command $command, bool $short = false): array - { - $data = [ - 'name' => $command->getName(), - 'description' => $command->getDescription(), - ]; - - if ($short) { - $data += [ - 'usage' => $command->getAliases(), - ]; - } else { - $command->mergeApplicationDefinition(false); - - $data += [ - 'usage' => array_merge([$command->getSynopsis()], $command->getUsages(), $command->getAliases()), - 'help' => $command->getProcessedHelp(), - 'definition' => $this->getInputDefinitionData($command->getDefinition()), - ]; - } - - $data['hidden'] = $command->isHidden(); - - return $data; - } -} diff --git a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php b/vendor/symfony/console/Descriptor/MarkdownDescriptor.php deleted file mode 100644 index 21ceca6c2..000000000 --- a/vendor/symfony/console/Descriptor/MarkdownDescriptor.php +++ /dev/null @@ -1,206 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Markdown descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class MarkdownDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - public function describe(OutputInterface $output, object $object, array $options = []) - { - $decorated = $output->isDecorated(); - $output->setDecorated(false); - - parent::describe($output, $object, $options); - - $output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - protected function write(string $content, bool $decorated = true) - { - parent::write($content, $decorated); - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->write( - '#### `'.($argument->getName() ?: '')."`\n\n" - .($argument->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $argument->getDescription())."\n\n" : '') - .'* Is required: '.($argument->isRequired() ? 'yes' : 'no')."\n" - .'* Is array: '.($argument->isArray() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($argument->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $name = '--'.$option->getName(); - if ($option->isNegatable()) { - $name .= '|--no-'.$option->getName(); - } - if ($option->getShortcut()) { - $name .= '|-'.str_replace('|', '|-', $option->getShortcut()).''; - } - - $this->write( - '#### `'.$name.'`'."\n\n" - .($option->getDescription() ? preg_replace('/\s*[\r\n]\s*/', "\n", $option->getDescription())."\n\n" : '') - .'* Accept value: '.($option->acceptValue() ? 'yes' : 'no')."\n" - .'* Is value required: '.($option->isValueRequired() ? 'yes' : 'no')."\n" - .'* Is multiple: '.($option->isArray() ? 'yes' : 'no')."\n" - .'* Is negatable: '.($option->isNegatable() ? 'yes' : 'no')."\n" - .'* Default: `'.str_replace("\n", '', var_export($option->getDefault(), true)).'`' - ); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - if ($showArguments = \count($definition->getArguments()) > 0) { - $this->write('### Arguments'); - foreach ($definition->getArguments() as $argument) { - $this->write("\n\n"); - if (null !== $describeInputArgument = $this->describeInputArgument($argument)) { - $this->write($describeInputArgument); - } - } - } - - if (\count($definition->getOptions()) > 0) { - if ($showArguments) { - $this->write("\n\n"); - } - - $this->write('### Options'); - foreach ($definition->getOptions() as $option) { - $this->write("\n\n"); - if (null !== $describeInputOption = $this->describeInputOption($option)) { - $this->write($describeInputOption); - } - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - if ($options['short'] ?? false) { - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce($command->getAliases(), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - return; - } - - $command->mergeApplicationDefinition(false); - - $this->write( - '`'.$command->getName()."`\n" - .str_repeat('-', Helper::width($command->getName()) + 2)."\n\n" - .($command->getDescription() ? $command->getDescription()."\n\n" : '') - .'### Usage'."\n\n" - .array_reduce(array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()), function ($carry, $usage) { - return $carry.'* `'.$usage.'`'."\n"; - }) - ); - - if ($help = $command->getProcessedHelp()) { - $this->write("\n"); - $this->write($help); - } - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->write("\n\n"); - $this->describeInputDefinition($definition); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - $title = $this->getApplicationTitle($application); - - $this->write($title."\n".str_repeat('=', Helper::width($title))); - - foreach ($description->getNamespaces() as $namespace) { - if (ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->write("\n\n"); - $this->write('**'.$namespace['id'].':**'); - } - - $this->write("\n\n"); - $this->write(implode("\n", array_map(function ($commandName) use ($description) { - return sprintf('* [`%s`](#%s)', $commandName, str_replace(':', '', $description->getCommand($commandName)->getName())); - }, $namespace['commands']))); - } - - foreach ($description->getCommands() as $command) { - $this->write("\n\n"); - if (null !== $describeCommand = $this->describeCommand($command, $options)) { - $this->write($describeCommand); - } - } - } - - private function getApplicationTitle(Application $application): string - { - if ('UNKNOWN' !== $application->getName()) { - if ('UNKNOWN' !== $application->getVersion()) { - return sprintf('%s %s', $application->getName(), $application->getVersion()); - } - - return $application->getName(); - } - - return 'Console Tool'; - } -} diff --git a/vendor/symfony/console/Descriptor/TextDescriptor.php b/vendor/symfony/console/Descriptor/TextDescriptor.php deleted file mode 100644 index fbb140ae7..000000000 --- a/vendor/symfony/console/Descriptor/TextDescriptor.php +++ /dev/null @@ -1,341 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * Text descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class TextDescriptor extends Descriptor -{ - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - if (null !== $argument->getDefault() && (!\is_array($argument->getDefault()) || \count($argument->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($argument->getDefault())); - } else { - $default = ''; - } - - $totalWidth = $options['total_width'] ?? Helper::width($argument->getName()); - $spacingWidth = $totalWidth - \strlen($argument->getName()); - - $this->writeText(sprintf(' %s %s%s%s', - $argument->getName(), - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $argument->getDescription()), - $default - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - if ($option->acceptValue() && null !== $option->getDefault() && (!\is_array($option->getDefault()) || \count($option->getDefault()))) { - $default = sprintf(' [default: %s]', $this->formatDefaultValue($option->getDefault())); - } else { - $default = ''; - } - - $value = ''; - if ($option->acceptValue()) { - $value = '='.strtoupper($option->getName()); - - if ($option->isValueOptional()) { - $value = '['.$value.']'; - } - } - - $totalWidth = $options['total_width'] ?? $this->calculateTotalWidthForOptions([$option]); - $synopsis = sprintf('%s%s', - $option->getShortcut() ? sprintf('-%s, ', $option->getShortcut()) : ' ', - sprintf($option->isNegatable() ? '--%1$s|--no-%1$s' : '--%1$s%2$s', $option->getName(), $value) - ); - - $spacingWidth = $totalWidth - Helper::width($synopsis); - - $this->writeText(sprintf(' %s %s%s%s%s', - $synopsis, - str_repeat(' ', $spacingWidth), - // + 4 = 2 spaces before , 2 spaces after - preg_replace('/\s*[\r\n]\s*/', "\n".str_repeat(' ', $totalWidth + 4), $option->getDescription()), - $default, - $option->isArray() ? ' (multiple values allowed)' : '' - ), $options); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $totalWidth = $this->calculateTotalWidthForOptions($definition->getOptions()); - foreach ($definition->getArguments() as $argument) { - $totalWidth = max($totalWidth, Helper::width($argument->getName())); - } - - if ($definition->getArguments()) { - $this->writeText('Arguments:', $options); - $this->writeText("\n"); - foreach ($definition->getArguments() as $argument) { - $this->describeInputArgument($argument, array_merge($options, ['total_width' => $totalWidth])); - $this->writeText("\n"); - } - } - - if ($definition->getArguments() && $definition->getOptions()) { - $this->writeText("\n"); - } - - if ($definition->getOptions()) { - $laterOptions = []; - - $this->writeText('Options:', $options); - foreach ($definition->getOptions() as $option) { - if (\strlen($option->getShortcut() ?? '') > 1) { - $laterOptions[] = $option; - continue; - } - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - foreach ($laterOptions as $option) { - $this->writeText("\n"); - $this->describeInputOption($option, array_merge($options, ['total_width' => $totalWidth])); - } - } - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $command->mergeApplicationDefinition(false); - - if ($description = $command->getDescription()) { - $this->writeText('Description:', $options); - $this->writeText("\n"); - $this->writeText(' '.$description); - $this->writeText("\n\n"); - } - - $this->writeText('Usage:', $options); - foreach (array_merge([$command->getSynopsis(true)], $command->getAliases(), $command->getUsages()) as $usage) { - $this->writeText("\n"); - $this->writeText(' '.OutputFormatter::escape($usage), $options); - } - $this->writeText("\n"); - - $definition = $command->getDefinition(); - if ($definition->getOptions() || $definition->getArguments()) { - $this->writeText("\n"); - $this->describeInputDefinition($definition, $options); - $this->writeText("\n"); - } - - $help = $command->getProcessedHelp(); - if ($help && $help !== $description) { - $this->writeText("\n"); - $this->writeText('Help:', $options); - $this->writeText("\n"); - $this->writeText(' '.str_replace("\n", "\n ", $help), $options); - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $describedNamespace = $options['namespace'] ?? null; - $description = new ApplicationDescription($application, $describedNamespace); - - if (isset($options['raw_text']) && $options['raw_text']) { - $width = $this->getColumnWidth($description->getCommands()); - - foreach ($description->getCommands() as $command) { - $this->writeText(sprintf("%-{$width}s %s", $command->getName(), $command->getDescription()), $options); - $this->writeText("\n"); - } - } else { - if ('' != $help = $application->getHelp()) { - $this->writeText("$help\n\n", $options); - } - - $this->writeText("Usage:\n", $options); - $this->writeText(" command [options] [arguments]\n\n", $options); - - $this->describeInputDefinition(new InputDefinition($application->getDefinition()->getOptions()), $options); - - $this->writeText("\n"); - $this->writeText("\n"); - - $commands = $description->getCommands(); - $namespaces = $description->getNamespaces(); - if ($describedNamespace && $namespaces) { - // make sure all alias commands are included when describing a specific namespace - $describedNamespaceInfo = reset($namespaces); - foreach ($describedNamespaceInfo['commands'] as $name) { - $commands[$name] = $description->getCommand($name); - } - } - - // calculate max. width based on available commands per namespace - $width = $this->getColumnWidth(array_merge(...array_values(array_map(function ($namespace) use ($commands) { - return array_intersect($namespace['commands'], array_keys($commands)); - }, array_values($namespaces))))); - - if ($describedNamespace) { - $this->writeText(sprintf('Available commands for the "%s" namespace:', $describedNamespace), $options); - } else { - $this->writeText('Available commands:', $options); - } - - foreach ($namespaces as $namespace) { - $namespace['commands'] = array_filter($namespace['commands'], function ($name) use ($commands) { - return isset($commands[$name]); - }); - - if (!$namespace['commands']) { - continue; - } - - if (!$describedNamespace && ApplicationDescription::GLOBAL_NAMESPACE !== $namespace['id']) { - $this->writeText("\n"); - $this->writeText(' '.$namespace['id'].'', $options); - } - - foreach ($namespace['commands'] as $name) { - $this->writeText("\n"); - $spacingWidth = $width - Helper::width($name); - $command = $commands[$name]; - $commandAliases = $name === $command->getName() ? $this->getCommandAliasesText($command) : ''; - $this->writeText(sprintf(' %s%s%s', $name, str_repeat(' ', $spacingWidth), $commandAliases.$command->getDescription()), $options); - } - } - - $this->writeText("\n"); - } - } - - /** - * {@inheritdoc} - */ - private function writeText(string $content, array $options = []) - { - $this->write( - isset($options['raw_text']) && $options['raw_text'] ? strip_tags($content) : $content, - isset($options['raw_output']) ? !$options['raw_output'] : true - ); - } - - /** - * Formats command aliases to show them in the command description. - */ - private function getCommandAliasesText(Command $command): string - { - $text = ''; - $aliases = $command->getAliases(); - - if ($aliases) { - $text = '['.implode('|', $aliases).'] '; - } - - return $text; - } - - /** - * Formats input option/argument default value. - * - * @param mixed $default - */ - private function formatDefaultValue($default): string - { - if (\INF === $default) { - return 'INF'; - } - - if (\is_string($default)) { - $default = OutputFormatter::escape($default); - } elseif (\is_array($default)) { - foreach ($default as $key => $value) { - if (\is_string($value)) { - $default[$key] = OutputFormatter::escape($value); - } - } - } - - return str_replace('\\\\', '\\', json_encode($default, \JSON_UNESCAPED_SLASHES | \JSON_UNESCAPED_UNICODE)); - } - - /** - * @param array $commands - */ - private function getColumnWidth(array $commands): int - { - $widths = []; - - foreach ($commands as $command) { - if ($command instanceof Command) { - $widths[] = Helper::width($command->getName()); - foreach ($command->getAliases() as $alias) { - $widths[] = Helper::width($alias); - } - } else { - $widths[] = Helper::width($command); - } - } - - return $widths ? max($widths) + 2 : 0; - } - - /** - * @param InputOption[] $options - */ - private function calculateTotalWidthForOptions(array $options): int - { - $totalWidth = 0; - foreach ($options as $option) { - // "-" + shortcut + ", --" + name - $nameLength = 1 + max(Helper::width($option->getShortcut()), 1) + 4 + Helper::width($option->getName()); - if ($option->isNegatable()) { - $nameLength += 6 + Helper::width($option->getName()); // |--no- + name - } elseif ($option->acceptValue()) { - $valueLength = 1 + Helper::width($option->getName()); // = + value - $valueLength += $option->isValueOptional() ? 2 : 0; // [ + ] - - $nameLength += $valueLength; - } - $totalWidth = max($totalWidth, $nameLength); - } - - return $totalWidth; - } -} diff --git a/vendor/symfony/console/Descriptor/XmlDescriptor.php b/vendor/symfony/console/Descriptor/XmlDescriptor.php deleted file mode 100644 index 4f7cd8b3e..000000000 --- a/vendor/symfony/console/Descriptor/XmlDescriptor.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Descriptor; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; - -/** - * XML descriptor. - * - * @author Jean-François Simon - * - * @internal - */ -class XmlDescriptor extends Descriptor -{ - public function getInputDefinitionDocument(InputDefinition $definition): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($definitionXML = $dom->createElement('definition')); - - $definitionXML->appendChild($argumentsXML = $dom->createElement('arguments')); - foreach ($definition->getArguments() as $argument) { - $this->appendDocument($argumentsXML, $this->getInputArgumentDocument($argument)); - } - - $definitionXML->appendChild($optionsXML = $dom->createElement('options')); - foreach ($definition->getOptions() as $option) { - $this->appendDocument($optionsXML, $this->getInputOptionDocument($option)); - } - - return $dom; - } - - public function getCommandDocument(Command $command, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($commandXML = $dom->createElement('command')); - - $commandXML->setAttribute('id', $command->getName()); - $commandXML->setAttribute('name', $command->getName()); - $commandXML->setAttribute('hidden', $command->isHidden() ? 1 : 0); - - $commandXML->appendChild($usagesXML = $dom->createElement('usages')); - - $commandXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getDescription()))); - - if ($short) { - foreach ($command->getAliases() as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - } else { - $command->mergeApplicationDefinition(false); - - foreach (array_merge([$command->getSynopsis()], $command->getAliases(), $command->getUsages()) as $usage) { - $usagesXML->appendChild($dom->createElement('usage', $usage)); - } - - $commandXML->appendChild($helpXML = $dom->createElement('help')); - $helpXML->appendChild($dom->createTextNode(str_replace("\n", "\n ", $command->getProcessedHelp()))); - - $definitionXML = $this->getInputDefinitionDocument($command->getDefinition()); - $this->appendDocument($commandXML, $definitionXML->getElementsByTagName('definition')->item(0)); - } - - return $dom; - } - - public function getApplicationDocument(Application $application, string $namespace = null, bool $short = false): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->appendChild($rootXml = $dom->createElement('symfony')); - - if ('UNKNOWN' !== $application->getName()) { - $rootXml->setAttribute('name', $application->getName()); - if ('UNKNOWN' !== $application->getVersion()) { - $rootXml->setAttribute('version', $application->getVersion()); - } - } - - $rootXml->appendChild($commandsXML = $dom->createElement('commands')); - - $description = new ApplicationDescription($application, $namespace, true); - - if ($namespace) { - $commandsXML->setAttribute('namespace', $namespace); - } - - foreach ($description->getCommands() as $command) { - $this->appendDocument($commandsXML, $this->getCommandDocument($command, $short)); - } - - if (!$namespace) { - $rootXml->appendChild($namespacesXML = $dom->createElement('namespaces')); - - foreach ($description->getNamespaces() as $namespaceDescription) { - $namespacesXML->appendChild($namespaceArrayXML = $dom->createElement('namespace')); - $namespaceArrayXML->setAttribute('id', $namespaceDescription['id']); - - foreach ($namespaceDescription['commands'] as $name) { - $namespaceArrayXML->appendChild($commandXML = $dom->createElement('command')); - $commandXML->appendChild($dom->createTextNode($name)); - } - } - } - - return $dom; - } - - /** - * {@inheritdoc} - */ - protected function describeInputArgument(InputArgument $argument, array $options = []) - { - $this->writeDocument($this->getInputArgumentDocument($argument)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputOption(InputOption $option, array $options = []) - { - $this->writeDocument($this->getInputOptionDocument($option)); - } - - /** - * {@inheritdoc} - */ - protected function describeInputDefinition(InputDefinition $definition, array $options = []) - { - $this->writeDocument($this->getInputDefinitionDocument($definition)); - } - - /** - * {@inheritdoc} - */ - protected function describeCommand(Command $command, array $options = []) - { - $this->writeDocument($this->getCommandDocument($command, $options['short'] ?? false)); - } - - /** - * {@inheritdoc} - */ - protected function describeApplication(Application $application, array $options = []) - { - $this->writeDocument($this->getApplicationDocument($application, $options['namespace'] ?? null, $options['short'] ?? false)); - } - - /** - * Appends document children to parent node. - */ - private function appendDocument(\DOMNode $parentNode, \DOMNode $importedParent) - { - foreach ($importedParent->childNodes as $childNode) { - $parentNode->appendChild($parentNode->ownerDocument->importNode($childNode, true)); - } - } - - /** - * Writes DOM document. - */ - private function writeDocument(\DOMDocument $dom) - { - $dom->formatOutput = true; - $this->write($dom->saveXML()); - } - - private function getInputArgumentDocument(InputArgument $argument): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('argument')); - $objectXML->setAttribute('name', $argument->getName()); - $objectXML->setAttribute('is_required', $argument->isRequired() ? 1 : 0); - $objectXML->setAttribute('is_array', $argument->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($argument->getDescription())); - - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - $defaults = \is_array($argument->getDefault()) ? $argument->getDefault() : (\is_bool($argument->getDefault()) ? [var_export($argument->getDefault(), true)] : ($argument->getDefault() ? [$argument->getDefault()] : [])); - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - - return $dom; - } - - private function getInputOptionDocument(InputOption $option): \DOMDocument - { - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--'.$option->getName()); - $pos = strpos($option->getShortcut() ?? '', '|'); - if (false !== $pos) { - $objectXML->setAttribute('shortcut', '-'.substr($option->getShortcut(), 0, $pos)); - $objectXML->setAttribute('shortcuts', '-'.str_replace('|', '|-', $option->getShortcut())); - } else { - $objectXML->setAttribute('shortcut', $option->getShortcut() ? '-'.$option->getShortcut() : ''); - } - $objectXML->setAttribute('accept_value', $option->acceptValue() ? 1 : 0); - $objectXML->setAttribute('is_value_required', $option->isValueRequired() ? 1 : 0); - $objectXML->setAttribute('is_multiple', $option->isArray() ? 1 : 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode($option->getDescription())); - - if ($option->acceptValue()) { - $defaults = \is_array($option->getDefault()) ? $option->getDefault() : (\is_bool($option->getDefault()) ? [var_export($option->getDefault(), true)] : ($option->getDefault() ? [$option->getDefault()] : [])); - $objectXML->appendChild($defaultsXML = $dom->createElement('defaults')); - - if (!empty($defaults)) { - foreach ($defaults as $default) { - $defaultsXML->appendChild($defaultXML = $dom->createElement('default')); - $defaultXML->appendChild($dom->createTextNode($default)); - } - } - } - - if ($option->isNegatable()) { - $dom->appendChild($objectXML = $dom->createElement('option')); - $objectXML->setAttribute('name', '--no-'.$option->getName()); - $objectXML->setAttribute('shortcut', ''); - $objectXML->setAttribute('accept_value', 0); - $objectXML->setAttribute('is_value_required', 0); - $objectXML->setAttribute('is_multiple', 0); - $objectXML->appendChild($descriptionXML = $dom->createElement('description')); - $descriptionXML->appendChild($dom->createTextNode('Negate the "--'.$option->getName().'" option')); - } - - return $dom; - } -} diff --git a/vendor/symfony/console/Event/ConsoleCommandEvent.php b/vendor/symfony/console/Event/ConsoleCommandEvent.php deleted file mode 100644 index 08bd18fd1..000000000 --- a/vendor/symfony/console/Event/ConsoleCommandEvent.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -/** - * Allows to do things before the command is executed, like skipping the command or changing the input. - * - * @author Fabien Potencier - */ -final class ConsoleCommandEvent extends ConsoleEvent -{ - /** - * The return code for skipped commands, this will also be passed into the terminate event. - */ - public const RETURN_CODE_DISABLED = 113; - - /** - * Indicates if the command should be run or skipped. - */ - private $commandShouldRun = true; - - /** - * Disables the command, so it won't be run. - */ - public function disableCommand(): bool - { - return $this->commandShouldRun = false; - } - - public function enableCommand(): bool - { - return $this->commandShouldRun = true; - } - - /** - * Returns true if the command is runnable, false otherwise. - */ - public function commandShouldRun(): bool - { - return $this->commandShouldRun; - } -} diff --git a/vendor/symfony/console/Event/ConsoleErrorEvent.php b/vendor/symfony/console/Event/ConsoleErrorEvent.php deleted file mode 100644 index 57d9b38ba..000000000 --- a/vendor/symfony/console/Event/ConsoleErrorEvent.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to handle throwables thrown while running a command. - * - * @author Wouter de Jong - */ -final class ConsoleErrorEvent extends ConsoleEvent -{ - private $error; - private $exitCode; - - public function __construct(InputInterface $input, OutputInterface $output, \Throwable $error, Command $command = null) - { - parent::__construct($command, $input, $output); - - $this->error = $error; - } - - public function getError(): \Throwable - { - return $this->error; - } - - public function setError(\Throwable $error): void - { - $this->error = $error; - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - - $r = new \ReflectionProperty($this->error, 'code'); - $r->setAccessible(true); - $r->setValue($this->error, $this->exitCode); - } - - public function getExitCode(): int - { - return $this->exitCode ?? (\is_int($this->error->getCode()) && 0 !== $this->error->getCode() ? $this->error->getCode() : 1); - } -} diff --git a/vendor/symfony/console/Event/ConsoleEvent.php b/vendor/symfony/console/Event/ConsoleEvent.php deleted file mode 100644 index be7937d51..000000000 --- a/vendor/symfony/console/Event/ConsoleEvent.php +++ /dev/null @@ -1,67 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Contracts\EventDispatcher\Event; - -/** - * Allows to inspect input and output of a command. - * - * @author Francesco Levorato - */ -class ConsoleEvent extends Event -{ - protected $command; - - private $input; - private $output; - - public function __construct(?Command $command, InputInterface $input, OutputInterface $output) - { - $this->command = $command; - $this->input = $input; - $this->output = $output; - } - - /** - * Gets the command that is executed. - * - * @return Command|null - */ - public function getCommand() - { - return $this->command; - } - - /** - * Gets the input instance. - * - * @return InputInterface - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance. - * - * @return OutputInterface - */ - public function getOutput() - { - return $this->output; - } -} diff --git a/vendor/symfony/console/Event/ConsoleSignalEvent.php b/vendor/symfony/console/Event/ConsoleSignalEvent.php deleted file mode 100644 index ef13ed2f5..000000000 --- a/vendor/symfony/console/Event/ConsoleSignalEvent.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author marie - */ -final class ConsoleSignalEvent extends ConsoleEvent -{ - private $handlingSignal; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $handlingSignal) - { - parent::__construct($command, $input, $output); - $this->handlingSignal = $handlingSignal; - } - - public function getHandlingSignal(): int - { - return $this->handlingSignal; - } -} diff --git a/vendor/symfony/console/Event/ConsoleTerminateEvent.php b/vendor/symfony/console/Event/ConsoleTerminateEvent.php deleted file mode 100644 index 190038d1a..000000000 --- a/vendor/symfony/console/Event/ConsoleTerminateEvent.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Event; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Allows to manipulate the exit code of a command after its execution. - * - * @author Francesco Levorato - */ -final class ConsoleTerminateEvent extends ConsoleEvent -{ - private $exitCode; - - public function __construct(Command $command, InputInterface $input, OutputInterface $output, int $exitCode) - { - parent::__construct($command, $input, $output); - - $this->setExitCode($exitCode); - } - - public function setExitCode(int $exitCode): void - { - $this->exitCode = $exitCode; - } - - public function getExitCode(): int - { - return $this->exitCode; - } -} diff --git a/vendor/symfony/console/EventListener/ErrorListener.php b/vendor/symfony/console/EventListener/ErrorListener.php deleted file mode 100644 index 897d9853f..000000000 --- a/vendor/symfony/console/EventListener/ErrorListener.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\EventListener; - -use Psr\Log\LoggerInterface; -use Symfony\Component\Console\ConsoleEvents; -use Symfony\Component\Console\Event\ConsoleErrorEvent; -use Symfony\Component\Console\Event\ConsoleEvent; -use Symfony\Component\Console\Event\ConsoleTerminateEvent; -use Symfony\Component\EventDispatcher\EventSubscriberInterface; - -/** - * @author James Halsall - * @author Robin Chalas - */ -class ErrorListener implements EventSubscriberInterface -{ - private $logger; - - public function __construct(LoggerInterface $logger = null) - { - $this->logger = $logger; - } - - public function onConsoleError(ConsoleErrorEvent $event) - { - if (null === $this->logger) { - return; - } - - $error = $event->getError(); - - if (!$inputString = $this->getInputString($event)) { - $this->logger->critical('An error occurred while using the console. Message: "{message}"', ['exception' => $error, 'message' => $error->getMessage()]); - - return; - } - - $this->logger->critical('Error thrown while running command "{command}". Message: "{message}"', ['exception' => $error, 'command' => $inputString, 'message' => $error->getMessage()]); - } - - public function onConsoleTerminate(ConsoleTerminateEvent $event) - { - if (null === $this->logger) { - return; - } - - $exitCode = $event->getExitCode(); - - if (0 === $exitCode) { - return; - } - - if (!$inputString = $this->getInputString($event)) { - $this->logger->debug('The console exited with code "{code}"', ['code' => $exitCode]); - - return; - } - - $this->logger->debug('Command "{command}" exited with code "{code}"', ['command' => $inputString, 'code' => $exitCode]); - } - - public static function getSubscribedEvents() - { - return [ - ConsoleEvents::ERROR => ['onConsoleError', -128], - ConsoleEvents::TERMINATE => ['onConsoleTerminate', -128], - ]; - } - - private static function getInputString(ConsoleEvent $event): ?string - { - $commandName = $event->getCommand() ? $event->getCommand()->getName() : null; - $input = $event->getInput(); - - if (method_exists($input, '__toString')) { - if ($commandName) { - return str_replace(["'$commandName'", "\"$commandName\""], $commandName, (string) $input); - } - - return (string) $input; - } - - return $commandName; - } -} diff --git a/vendor/symfony/console/Exception/CommandNotFoundException.php b/vendor/symfony/console/Exception/CommandNotFoundException.php deleted file mode 100644 index 910ae1928..000000000 --- a/vendor/symfony/console/Exception/CommandNotFoundException.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect command name typed in the console. - * - * @author Jérôme Tamarelle - */ -class CommandNotFoundException extends \InvalidArgumentException implements ExceptionInterface -{ - private $alternatives; - - /** - * @param string $message Exception message to throw - * @param string[] $alternatives List of similar defined names - * @param int $code Exception code - * @param \Throwable|null $previous Previous exception used for the exception chaining - */ - public function __construct(string $message, array $alternatives = [], int $code = 0, \Throwable $previous = null) - { - parent::__construct($message, $code, $previous); - - $this->alternatives = $alternatives; - } - - /** - * @return string[] - */ - public function getAlternatives() - { - return $this->alternatives; - } -} diff --git a/vendor/symfony/console/Exception/ExceptionInterface.php b/vendor/symfony/console/Exception/ExceptionInterface.php deleted file mode 100644 index 1624e13d0..000000000 --- a/vendor/symfony/console/Exception/ExceptionInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * ExceptionInterface. - * - * @author Jérôme Tamarelle - */ -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/console/Exception/InvalidArgumentException.php b/vendor/symfony/console/Exception/InvalidArgumentException.php deleted file mode 100644 index 07cc0b61d..000000000 --- a/vendor/symfony/console/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/InvalidOptionException.php b/vendor/symfony/console/Exception/InvalidOptionException.php deleted file mode 100644 index 5cf62792e..000000000 --- a/vendor/symfony/console/Exception/InvalidOptionException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect option name or value typed in the console. - * - * @author Jérôme Tamarelle - */ -class InvalidOptionException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/LogicException.php b/vendor/symfony/console/Exception/LogicException.php deleted file mode 100644 index fc37b8d8a..000000000 --- a/vendor/symfony/console/Exception/LogicException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class LogicException extends \LogicException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/MissingInputException.php b/vendor/symfony/console/Exception/MissingInputException.php deleted file mode 100644 index 04f02ade4..000000000 --- a/vendor/symfony/console/Exception/MissingInputException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents failure to read input from stdin. - * - * @author Gabriel Ostrolucký - */ -class MissingInputException extends RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Exception/NamespaceNotFoundException.php b/vendor/symfony/console/Exception/NamespaceNotFoundException.php deleted file mode 100644 index dd16e4508..000000000 --- a/vendor/symfony/console/Exception/NamespaceNotFoundException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * Represents an incorrect namespace typed in the console. - * - * @author Pierre du Plessis - */ -class NamespaceNotFoundException extends CommandNotFoundException -{ -} diff --git a/vendor/symfony/console/Exception/RuntimeException.php b/vendor/symfony/console/Exception/RuntimeException.php deleted file mode 100644 index 51d7d80ac..000000000 --- a/vendor/symfony/console/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Exception; - -/** - * @author Jérôme Tamarelle - */ -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/console/Formatter/NullOutputFormatter.php b/vendor/symfony/console/Formatter/NullOutputFormatter.php deleted file mode 100644 index d770e1465..000000000 --- a/vendor/symfony/console/Formatter/NullOutputFormatter.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatter implements OutputFormatterInterface -{ - private $style; - - /** - * {@inheritdoc} - */ - public function format(?string $message): ?string - { - return null; - } - - /** - * {@inheritdoc} - */ - public function getStyle(string $name): OutputFormatterStyleInterface - { - // to comply with the interface we must return a OutputFormatterStyleInterface - return $this->style ?? $this->style = new NullOutputFormatterStyle(); - } - - /** - * {@inheritdoc} - */ - public function hasStyle(string $name): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDecorated(): bool - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style): void - { - // do nothing - } -} diff --git a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php b/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php deleted file mode 100644 index 9232510f4..000000000 --- a/vendor/symfony/console/Formatter/NullOutputFormatterStyle.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * @author Tien Xuan Vo - */ -final class NullOutputFormatterStyle implements OutputFormatterStyleInterface -{ - /** - * {@inheritdoc} - */ - public function apply(string $text): string - { - return $text; - } - - /** - * {@inheritdoc} - */ - public function setBackground(string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setForeground(string $color = null): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOption(string $option): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options): void - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function unsetOption(string $option): void - { - // do nothing - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatter.php b/vendor/symfony/console/Formatter/OutputFormatter.php deleted file mode 100644 index 603e5dca0..000000000 --- a/vendor/symfony/console/Formatter/OutputFormatter.php +++ /dev/null @@ -1,285 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Formatter class for console output. - * - * @author Konstantin Kudryashov - * @author Roland Franssen - */ -class OutputFormatter implements WrappableOutputFormatterInterface -{ - private $decorated; - private $styles = []; - private $styleStack; - - public function __clone() - { - $this->styleStack = clone $this->styleStack; - foreach ($this->styles as $key => $value) { - $this->styles[$key] = clone $value; - } - } - - /** - * Escapes "<" and ">" special chars in given text. - * - * @return string - */ - public static function escape(string $text) - { - $text = preg_replace('/([^\\\\]|^)([<>])/', '$1\\\\$2', $text); - - return self::escapeTrailingBackslash($text); - } - - /** - * Escapes trailing "\" in given text. - * - * @internal - */ - public static function escapeTrailingBackslash(string $text): string - { - if (str_ends_with($text, '\\')) { - $len = \strlen($text); - $text = rtrim($text, '\\'); - $text = str_replace("\0", '', $text); - $text .= str_repeat("\0", $len - \strlen($text)); - } - - return $text; - } - - /** - * Initializes console output formatter. - * - * @param OutputFormatterStyleInterface[] $styles Array of "name => FormatterStyle" instances - */ - public function __construct(bool $decorated = false, array $styles = []) - { - $this->decorated = $decorated; - - $this->setStyle('error', new OutputFormatterStyle('white', 'red')); - $this->setStyle('info', new OutputFormatterStyle('green')); - $this->setStyle('comment', new OutputFormatterStyle('yellow')); - $this->setStyle('question', new OutputFormatterStyle('black', 'cyan')); - - foreach ($styles as $name => $style) { - $this->setStyle($name, $style); - } - - $this->styleStack = new OutputFormatterStyleStack(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->decorated = $decorated; - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->decorated; - } - - /** - * {@inheritdoc} - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style) - { - $this->styles[strtolower($name)] = $style; - } - - /** - * {@inheritdoc} - */ - public function hasStyle(string $name) - { - return isset($this->styles[strtolower($name)]); - } - - /** - * {@inheritdoc} - */ - public function getStyle(string $name) - { - if (!$this->hasStyle($name)) { - throw new InvalidArgumentException(sprintf('Undefined style: "%s".', $name)); - } - - return $this->styles[strtolower($name)]; - } - - /** - * {@inheritdoc} - */ - public function format(?string $message) - { - return $this->formatAndWrap($message, 0); - } - - /** - * {@inheritdoc} - */ - public function formatAndWrap(?string $message, int $width) - { - if (null === $message) { - return ''; - } - - $offset = 0; - $output = ''; - $openTagRegex = '[a-z](?:[^\\\\<>]*+ | \\\\.)*'; - $closeTagRegex = '[a-z][^<>]*+'; - $currentLineLength = 0; - preg_match_all("#<(($openTagRegex) | /($closeTagRegex)?)>#ix", $message, $matches, \PREG_OFFSET_CAPTURE); - foreach ($matches[0] as $i => $match) { - $pos = $match[1]; - $text = $match[0]; - - if (0 != $pos && '\\' == $message[$pos - 1]) { - continue; - } - - // add the text up to the next tag - $output .= $this->applyCurrentStyle(substr($message, $offset, $pos - $offset), $output, $width, $currentLineLength); - $offset = $pos + \strlen($text); - - // opening tag? - if ($open = '/' != $text[1]) { - $tag = $matches[1][$i][0]; - } else { - $tag = $matches[3][$i][0] ?? ''; - } - - if (!$open && !$tag) { - // - $this->styleStack->pop(); - } elseif (null === $style = $this->createStyleFromString($tag)) { - $output .= $this->applyCurrentStyle($text, $output, $width, $currentLineLength); - } elseif ($open) { - $this->styleStack->push($style); - } else { - $this->styleStack->pop($style); - } - } - - $output .= $this->applyCurrentStyle(substr($message, $offset), $output, $width, $currentLineLength); - - return strtr($output, ["\0" => '\\', '\\<' => '<', '\\>' => '>']); - } - - /** - * @return OutputFormatterStyleStack - */ - public function getStyleStack() - { - return $this->styleStack; - } - - /** - * Tries to create new style instance from string. - */ - private function createStyleFromString(string $string): ?OutputFormatterStyleInterface - { - if (isset($this->styles[$string])) { - return $this->styles[$string]; - } - - if (!preg_match_all('/([^=]+)=([^;]+)(;|$)/', $string, $matches, \PREG_SET_ORDER)) { - return null; - } - - $style = new OutputFormatterStyle(); - foreach ($matches as $match) { - array_shift($match); - $match[0] = strtolower($match[0]); - - if ('fg' == $match[0]) { - $style->setForeground(strtolower($match[1])); - } elseif ('bg' == $match[0]) { - $style->setBackground(strtolower($match[1])); - } elseif ('href' === $match[0]) { - $url = preg_replace('{\\\\([<>])}', '$1', $match[1]); - $style->setHref($url); - } elseif ('options' === $match[0]) { - preg_match_all('([^,;]+)', strtolower($match[1]), $options); - $options = array_shift($options); - foreach ($options as $option) { - $style->setOption($option); - } - } else { - return null; - } - } - - return $style; - } - - /** - * Applies current style from stack to text, if must be applied. - */ - private function applyCurrentStyle(string $text, string $current, int $width, int &$currentLineLength): string - { - if ('' === $text) { - return ''; - } - - if (!$width) { - return $this->isDecorated() ? $this->styleStack->getCurrent()->apply($text) : $text; - } - - if (!$currentLineLength && '' !== $current) { - $text = ltrim($text); - } - - if ($currentLineLength) { - $prefix = substr($text, 0, $i = $width - $currentLineLength)."\n"; - $text = substr($text, $i); - } else { - $prefix = ''; - } - - preg_match('~(\\n)$~', $text, $matches); - $text = $prefix.preg_replace('~([^\\n]{'.$width.'})\\ *~', "\$1\n", $text); - $text = rtrim($text, "\n").($matches[1] ?? ''); - - if (!$currentLineLength && '' !== $current && "\n" !== substr($current, -1)) { - $text = "\n".$text; - } - - $lines = explode("\n", $text); - - foreach ($lines as $line) { - $currentLineLength += \strlen($line); - if ($width <= $currentLineLength) { - $currentLineLength = 0; - } - } - - if ($this->isDecorated()) { - foreach ($lines as $i => $line) { - $lines[$i] = $this->styleStack->getCurrent()->apply($line); - } - } - - return implode("\n", $lines); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterInterface.php b/vendor/symfony/console/Formatter/OutputFormatterInterface.php deleted file mode 100644 index 0b5f839a2..000000000 --- a/vendor/symfony/console/Formatter/OutputFormatterInterface.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterInterface -{ - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Whether the output will decorate messages. - * - * @return bool - */ - public function isDecorated(); - - /** - * Sets a new style. - */ - public function setStyle(string $name, OutputFormatterStyleInterface $style); - - /** - * Checks if output formatter has style with specified name. - * - * @return bool - */ - public function hasStyle(string $name); - - /** - * Gets style options from style with specified name. - * - * @return OutputFormatterStyleInterface - * - * @throws \InvalidArgumentException When style isn't defined - */ - public function getStyle(string $name); - - /** - * Formats a message according to the given styles. - * - * @return string|null - */ - public function format(?string $message); -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyle.php b/vendor/symfony/console/Formatter/OutputFormatterStyle.php deleted file mode 100644 index 8370ba058..000000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyle.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Color; - -/** - * Formatter style class for defining styles. - * - * @author Konstantin Kudryashov - */ -class OutputFormatterStyle implements OutputFormatterStyleInterface -{ - private $color; - private $foreground; - private $background; - private $options; - private $href; - private $handlesHrefGracefully; - - /** - * Initializes output formatter style. - * - * @param string|null $foreground The style foreground color name - * @param string|null $background The style background color name - */ - public function __construct(string $foreground = null, string $background = null, array $options = []) - { - $this->color = new Color($this->foreground = $foreground ?: '', $this->background = $background ?: '', $this->options = $options); - } - - /** - * {@inheritdoc} - */ - public function setForeground(string $color = null) - { - $this->color = new Color($this->foreground = $color ?: '', $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function setBackground(string $color = null) - { - $this->color = new Color($this->foreground, $this->background = $color ?: '', $this->options); - } - - public function setHref(string $url): void - { - $this->href = $url; - } - - /** - * {@inheritdoc} - */ - public function setOption(string $option) - { - $this->options[] = $option; - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function unsetOption(string $option) - { - $pos = array_search($option, $this->options); - if (false !== $pos) { - unset($this->options[$pos]); - } - - $this->color = new Color($this->foreground, $this->background, $this->options); - } - - /** - * {@inheritdoc} - */ - public function setOptions(array $options) - { - $this->color = new Color($this->foreground, $this->background, $this->options = $options); - } - - /** - * {@inheritdoc} - */ - public function apply(string $text) - { - if (null === $this->handlesHrefGracefully) { - $this->handlesHrefGracefully = 'JetBrains-JediTerm' !== getenv('TERMINAL_EMULATOR') - && (!getenv('KONSOLE_VERSION') || (int) getenv('KONSOLE_VERSION') > 201100) - && !isset($_SERVER['IDEA_INITIAL_DIRECTORY']); - } - - if (null !== $this->href && $this->handlesHrefGracefully) { - $text = "\033]8;;$this->href\033\\$text\033]8;;\033\\"; - } - - return $this->color->apply($text); - } -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php b/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php deleted file mode 100644 index b30560d22..000000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter style interface for defining styles. - * - * @author Konstantin Kudryashov - */ -interface OutputFormatterStyleInterface -{ - /** - * Sets style foreground color. - */ - public function setForeground(string $color = null); - - /** - * Sets style background color. - */ - public function setBackground(string $color = null); - - /** - * Sets some specific style option. - */ - public function setOption(string $option); - - /** - * Unsets some specific style option. - */ - public function unsetOption(string $option); - - /** - * Sets multiple style options at once. - */ - public function setOptions(array $options); - - /** - * Applies the style to a given text. - * - * @return string - */ - public function apply(string $text); -} diff --git a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php b/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php deleted file mode 100644 index fc48dc0e1..000000000 --- a/vendor/symfony/console/Formatter/OutputFormatterStyleStack.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Contracts\Service\ResetInterface; - -/** - * @author Jean-François Simon - */ -class OutputFormatterStyleStack implements ResetInterface -{ - /** - * @var OutputFormatterStyleInterface[] - */ - private $styles; - - private $emptyStyle; - - public function __construct(OutputFormatterStyleInterface $emptyStyle = null) - { - $this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle(); - $this->reset(); - } - - /** - * Resets stack (ie. empty internal arrays). - */ - public function reset() - { - $this->styles = []; - } - - /** - * Pushes a style in the stack. - */ - public function push(OutputFormatterStyleInterface $style) - { - $this->styles[] = $style; - } - - /** - * Pops a style from the stack. - * - * @return OutputFormatterStyleInterface - * - * @throws InvalidArgumentException When style tags incorrectly nested - */ - public function pop(OutputFormatterStyleInterface $style = null) - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - if (null === $style) { - return array_pop($this->styles); - } - - foreach (array_reverse($this->styles, true) as $index => $stackedStyle) { - if ($style->apply('') === $stackedStyle->apply('')) { - $this->styles = \array_slice($this->styles, 0, $index); - - return $stackedStyle; - } - } - - throw new InvalidArgumentException('Incorrectly nested style tag found.'); - } - - /** - * Computes current style with stacks top codes. - * - * @return OutputFormatterStyle - */ - public function getCurrent() - { - if (empty($this->styles)) { - return $this->emptyStyle; - } - - return $this->styles[\count($this->styles) - 1]; - } - - /** - * @return $this - */ - public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle) - { - $this->emptyStyle = $emptyStyle; - - return $this; - } - - /** - * @return OutputFormatterStyleInterface - */ - public function getEmptyStyle() - { - return $this->emptyStyle; - } -} diff --git a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php b/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php deleted file mode 100644 index 42319ee55..000000000 --- a/vendor/symfony/console/Formatter/WrappableOutputFormatterInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Formatter; - -/** - * Formatter interface for console output that supports word wrapping. - * - * @author Roland Franssen - */ -interface WrappableOutputFormatterInterface extends OutputFormatterInterface -{ - /** - * Formats a message according to the given styles, wrapping at `$width` (0 means no wrapping). - */ - public function formatAndWrap(?string $message, int $width); -} diff --git a/vendor/symfony/console/Helper/DebugFormatterHelper.php b/vendor/symfony/console/Helper/DebugFormatterHelper.php deleted file mode 100644 index e258ba050..000000000 --- a/vendor/symfony/console/Helper/DebugFormatterHelper.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Helps outputting debug information when running an external program from a command. - * - * An external program can be a Process, an HTTP request, or anything else. - * - * @author Fabien Potencier - */ -class DebugFormatterHelper extends Helper -{ - private const COLORS = ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white', 'default']; - private $started = []; - private $count = -1; - - /** - * Starts a debug formatting session. - * - * @return string - */ - public function start(string $id, string $message, string $prefix = 'RUN') - { - $this->started[$id] = ['border' => ++$this->count % \count(self::COLORS)]; - - return sprintf("%s %s %s\n", $this->getBorder($id), $prefix, $message); - } - - /** - * Adds progress to a formatting session. - * - * @return string - */ - public function progress(string $id, string $buffer, bool $error = false, string $prefix = 'OUT', string $errorPrefix = 'ERR') - { - $message = ''; - - if ($error) { - if (isset($this->started[$id]['out'])) { - $message .= "\n"; - unset($this->started[$id]['out']); - } - if (!isset($this->started[$id]['err'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $errorPrefix); - $this->started[$id]['err'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $errorPrefix), $buffer); - } else { - if (isset($this->started[$id]['err'])) { - $message .= "\n"; - unset($this->started[$id]['err']); - } - if (!isset($this->started[$id]['out'])) { - $message .= sprintf('%s %s ', $this->getBorder($id), $prefix); - $this->started[$id]['out'] = true; - } - - $message .= str_replace("\n", sprintf("\n%s %s ", $this->getBorder($id), $prefix), $buffer); - } - - return $message; - } - - /** - * Stops a formatting session. - * - * @return string - */ - public function stop(string $id, string $message, bool $successful, string $prefix = 'RES') - { - $trailingEOL = isset($this->started[$id]['out']) || isset($this->started[$id]['err']) ? "\n" : ''; - - if ($successful) { - return sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - } - - $message = sprintf("%s%s %s %s\n", $trailingEOL, $this->getBorder($id), $prefix, $message); - - unset($this->started[$id]['out'], $this->started[$id]['err']); - - return $message; - } - - private function getBorder(string $id): string - { - return sprintf(' ', self::COLORS[$this->started[$id]['border']]); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'debug_formatter'; - } -} diff --git a/vendor/symfony/console/Helper/DescriptorHelper.php b/vendor/symfony/console/Helper/DescriptorHelper.php deleted file mode 100644 index af85e9c0a..000000000 --- a/vendor/symfony/console/Helper/DescriptorHelper.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Descriptor\DescriptorInterface; -use Symfony\Component\Console\Descriptor\JsonDescriptor; -use Symfony\Component\Console\Descriptor\MarkdownDescriptor; -use Symfony\Component\Console\Descriptor\TextDescriptor; -use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * This class adds helper method to describe objects in various formats. - * - * @author Jean-François Simon - */ -class DescriptorHelper extends Helper -{ - /** - * @var DescriptorInterface[] - */ - private $descriptors = []; - - public function __construct() - { - $this - ->register('txt', new TextDescriptor()) - ->register('xml', new XmlDescriptor()) - ->register('json', new JsonDescriptor()) - ->register('md', new MarkdownDescriptor()) - ; - } - - /** - * Describes an object if supported. - * - * Available options are: - * * format: string, the output format name - * * raw_text: boolean, sets output type as raw - * - * @throws InvalidArgumentException when the given format is not supported - */ - public function describe(OutputInterface $output, ?object $object, array $options = []) - { - $options = array_merge([ - 'raw_text' => false, - 'format' => 'txt', - ], $options); - - if (!isset($this->descriptors[$options['format']])) { - throw new InvalidArgumentException(sprintf('Unsupported format "%s".', $options['format'])); - } - - $descriptor = $this->descriptors[$options['format']]; - $descriptor->describe($output, $object, $options); - } - - /** - * Registers a descriptor. - * - * @return $this - */ - public function register(string $format, DescriptorInterface $descriptor) - { - $this->descriptors[$format] = $descriptor; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'descriptor'; - } - - public function getFormats(): array - { - return array_keys($this->descriptors); - } -} diff --git a/vendor/symfony/console/Helper/Dumper.php b/vendor/symfony/console/Helper/Dumper.php deleted file mode 100644 index b013b6c52..000000000 --- a/vendor/symfony/console/Helper/Dumper.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\VarDumper\Cloner\ClonerInterface; -use Symfony\Component\VarDumper\Cloner\VarCloner; -use Symfony\Component\VarDumper\Dumper\CliDumper; - -/** - * @author Roland Franssen - */ -final class Dumper -{ - private $output; - private $dumper; - private $cloner; - private $handler; - - public function __construct(OutputInterface $output, CliDumper $dumper = null, ClonerInterface $cloner = null) - { - $this->output = $output; - $this->dumper = $dumper; - $this->cloner = $cloner; - - if (class_exists(CliDumper::class)) { - $this->handler = function ($var): string { - $dumper = $this->dumper ?? $this->dumper = new CliDumper(null, null, CliDumper::DUMP_LIGHT_ARRAY | CliDumper::DUMP_COMMA_SEPARATOR); - $dumper->setColors($this->output->isDecorated()); - - return rtrim($dumper->dump(($this->cloner ?? $this->cloner = new VarCloner())->cloneVar($var)->withRefHandles(false), true)); - }; - } else { - $this->handler = function ($var): string { - switch (true) { - case null === $var: - return 'null'; - case true === $var: - return 'true'; - case false === $var: - return 'false'; - case \is_string($var): - return '"'.$var.'"'; - default: - return rtrim(print_r($var, true)); - } - }; - } - } - - public function __invoke($var): string - { - return ($this->handler)($var); - } -} diff --git a/vendor/symfony/console/Helper/FormatterHelper.php b/vendor/symfony/console/Helper/FormatterHelper.php deleted file mode 100644 index 92d8dc724..000000000 --- a/vendor/symfony/console/Helper/FormatterHelper.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; - -/** - * The Formatter class provides helpers to format messages. - * - * @author Fabien Potencier - */ -class FormatterHelper extends Helper -{ - /** - * Formats a message within a section. - * - * @return string - */ - public function formatSection(string $section, string $message, string $style = 'info') - { - return sprintf('<%s>[%s] %s', $style, $section, $style, $message); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - * - * @return string - */ - public function formatBlock($messages, string $style, bool $large = false) - { - if (!\is_array($messages)) { - $messages = [$messages]; - } - - $len = 0; - $lines = []; - foreach ($messages as $message) { - $message = OutputFormatter::escape($message); - $lines[] = sprintf($large ? ' %s ' : ' %s ', $message); - $len = max(self::width($message) + ($large ? 4 : 2), $len); - } - - $messages = $large ? [str_repeat(' ', $len)] : []; - for ($i = 0; isset($lines[$i]); ++$i) { - $messages[] = $lines[$i].str_repeat(' ', $len - self::width($lines[$i])); - } - if ($large) { - $messages[] = str_repeat(' ', $len); - } - - for ($i = 0; isset($messages[$i]); ++$i) { - $messages[$i] = sprintf('<%s>%s', $style, $messages[$i], $style); - } - - return implode("\n", $messages); - } - - /** - * Truncates a message to the given length. - * - * @return string - */ - public function truncate(string $message, int $length, string $suffix = '...') - { - $computedLength = $length - self::width($suffix); - - if ($computedLength > self::width($message)) { - return $message; - } - - return self::substr($message, 0, $length).$suffix; - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'formatter'; - } -} diff --git a/vendor/symfony/console/Helper/Helper.php b/vendor/symfony/console/Helper/Helper.php deleted file mode 100644 index c7d3e25d0..000000000 --- a/vendor/symfony/console/Helper/Helper.php +++ /dev/null @@ -1,180 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\String\UnicodeString; - -/** - * Helper is the base class for all helper classes. - * - * @author Fabien Potencier - */ -abstract class Helper implements HelperInterface -{ - protected $helperSet = null; - - /** - * {@inheritdoc} - */ - public function setHelperSet(HelperSet $helperSet = null) - { - $this->helperSet = $helperSet; - } - - /** - * {@inheritdoc} - */ - public function getHelperSet() - { - return $this->helperSet; - } - - /** - * Returns the length of a string, using mb_strwidth if it is available. - * - * @deprecated since Symfony 5.3 - * - * @return int - */ - public static function strlen(?string $string) - { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::width() or Helper::length() instead.', __METHOD__); - - return self::width($string); - } - - /** - * Returns the width of a string, using mb_strwidth if it is available. - * The width is how many characters positions the string will use. - */ - public static function width(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->width(false); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strwidth($string, $encoding); - } - - /** - * Returns the length of a string, using mb_strlen if it is available. - * The length is related to how many bytes the string will use. - */ - public static function length(?string $string): int - { - $string ?? $string = ''; - - if (preg_match('//u', $string)) { - return (new UnicodeString($string))->length(); - } - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return \strlen($string); - } - - return mb_strlen($string, $encoding); - } - - /** - * Returns the subset of a string, using mb_substr if it is available. - * - * @return string - */ - public static function substr(?string $string, int $from, int $length = null) - { - $string ?? $string = ''; - - if (false === $encoding = mb_detect_encoding($string, null, true)) { - return substr($string, $from, $length); - } - - return mb_substr($string, $from, $length, $encoding); - } - - public static function formatTime($secs) - { - static $timeFormats = [ - [0, '< 1 sec'], - [1, '1 sec'], - [2, 'secs', 1], - [60, '1 min'], - [120, 'mins', 60], - [3600, '1 hr'], - [7200, 'hrs', 3600], - [86400, '1 day'], - [172800, 'days', 86400], - ]; - - foreach ($timeFormats as $index => $format) { - if ($secs >= $format[0]) { - if ((isset($timeFormats[$index + 1]) && $secs < $timeFormats[$index + 1][0]) - || $index == \count($timeFormats) - 1 - ) { - if (2 == \count($format)) { - return $format[1]; - } - - return floor($secs / $format[2]).' '.$format[1]; - } - } - } - } - - public static function formatMemory(int $memory) - { - if ($memory >= 1024 * 1024 * 1024) { - return sprintf('%.1f GiB', $memory / 1024 / 1024 / 1024); - } - - if ($memory >= 1024 * 1024) { - return sprintf('%.1f MiB', $memory / 1024 / 1024); - } - - if ($memory >= 1024) { - return sprintf('%d KiB', $memory / 1024); - } - - return sprintf('%d B', $memory); - } - - /** - * @deprecated since Symfony 5.3 - */ - public static function strlenWithoutDecoration(OutputFormatterInterface $formatter, ?string $string) - { - trigger_deprecation('symfony/console', '5.3', 'Method "%s()" is deprecated and will be removed in Symfony 6.0. Use Helper::removeDecoration() instead.', __METHOD__); - - return self::width(self::removeDecoration($formatter, $string)); - } - - public static function removeDecoration(OutputFormatterInterface $formatter, ?string $string) - { - $isDecorated = $formatter->isDecorated(); - $formatter->setDecorated(false); - // remove <...> formatting - $string = $formatter->format($string ?? ''); - // remove already formatted characters - $string = preg_replace("/\033\[[^m]*m/", '', $string ?? ''); - // remove terminal hyperlinks - $string = preg_replace('/\\033]8;[^;]*;[^\\033]*\\033\\\\/', '', $string ?? ''); - $formatter->setDecorated($isDecorated); - - return $string; - } -} diff --git a/vendor/symfony/console/Helper/HelperInterface.php b/vendor/symfony/console/Helper/HelperInterface.php deleted file mode 100644 index fc952b486..000000000 --- a/vendor/symfony/console/Helper/HelperInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * HelperInterface is the interface all helpers must implement. - * - * @author Fabien Potencier - */ -interface HelperInterface -{ - /** - * Sets the helper set associated with this helper. - */ - public function setHelperSet(HelperSet $helperSet = null); - - /** - * Gets the helper set associated with this helper. - * - * @return HelperSet|null - */ - public function getHelperSet(); - - /** - * Returns the canonical name of this helper. - * - * @return string - */ - public function getName(); -} diff --git a/vendor/symfony/console/Helper/HelperSet.php b/vendor/symfony/console/Helper/HelperSet.php deleted file mode 100644 index 719762d24..000000000 --- a/vendor/symfony/console/Helper/HelperSet.php +++ /dev/null @@ -1,108 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * HelperSet represents a set of helpers to be used with a command. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class HelperSet implements \IteratorAggregate -{ - /** @var array */ - private $helpers = []; - private $command; - - /** - * @param Helper[] $helpers An array of helper - */ - public function __construct(array $helpers = []) - { - foreach ($helpers as $alias => $helper) { - $this->set($helper, \is_int($alias) ? null : $alias); - } - } - - public function set(HelperInterface $helper, string $alias = null) - { - $this->helpers[$helper->getName()] = $helper; - if (null !== $alias) { - $this->helpers[$alias] = $helper; - } - - $helper->setHelperSet($this); - } - - /** - * Returns true if the helper if defined. - * - * @return bool - */ - public function has(string $name) - { - return isset($this->helpers[$name]); - } - - /** - * Gets a helper value. - * - * @return HelperInterface - * - * @throws InvalidArgumentException if the helper is not defined - */ - public function get(string $name) - { - if (!$this->has($name)) { - throw new InvalidArgumentException(sprintf('The helper "%s" is not defined.', $name)); - } - - return $this->helpers[$name]; - } - - /** - * @deprecated since Symfony 5.4 - */ - public function setCommand(Command $command = null) - { - trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); - - $this->command = $command; - } - - /** - * Gets the command associated with this helper set. - * - * @return Command - * - * @deprecated since Symfony 5.4 - */ - public function getCommand() - { - trigger_deprecation('symfony/console', '5.4', 'Method "%s()" is deprecated.', __METHOD__); - - return $this->command; - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - return new \ArrayIterator($this->helpers); - } -} diff --git a/vendor/symfony/console/Helper/InputAwareHelper.php b/vendor/symfony/console/Helper/InputAwareHelper.php deleted file mode 100644 index 0d0dba23e..000000000 --- a/vendor/symfony/console/Helper/InputAwareHelper.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Input\InputAwareInterface; -use Symfony\Component\Console\Input\InputInterface; - -/** - * An implementation of InputAwareInterface for Helpers. - * - * @author Wouter J - */ -abstract class InputAwareHelper extends Helper implements InputAwareInterface -{ - protected $input; - - /** - * {@inheritdoc} - */ - public function setInput(InputInterface $input) - { - $this->input = $input; - } -} diff --git a/vendor/symfony/console/Helper/ProcessHelper.php b/vendor/symfony/console/Helper/ProcessHelper.php deleted file mode 100644 index 4ea3d724d..000000000 --- a/vendor/symfony/console/Helper/ProcessHelper.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Process\Exception\ProcessFailedException; -use Symfony\Component\Process\Process; - -/** - * The ProcessHelper class provides helpers to run external processes. - * - * @author Fabien Potencier - * - * @final - */ -class ProcessHelper extends Helper -{ - /** - * Runs an external process. - * - * @param array|Process $cmd An instance of Process or an array of the command and arguments - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - */ - public function run(OutputInterface $output, $cmd, string $error = null, callable $callback = null, int $verbosity = OutputInterface::VERBOSITY_VERY_VERBOSE): Process - { - if (!class_exists(Process::class)) { - throw new \LogicException('The ProcessHelper cannot be run as the Process component is not installed. Try running "compose require symfony/process".'); - } - - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - if ($cmd instanceof Process) { - $cmd = [$cmd]; - } - - if (!\is_array($cmd)) { - throw new \TypeError(sprintf('The "command" argument of "%s()" must be an array or a "%s" instance, "%s" given.', __METHOD__, Process::class, get_debug_type($cmd))); - } - - if (\is_string($cmd[0] ?? null)) { - $process = new Process($cmd); - $cmd = []; - } elseif (($cmd[0] ?? null) instanceof Process) { - $process = $cmd[0]; - unset($cmd[0]); - } else { - throw new \InvalidArgumentException(sprintf('Invalid command provided to "%s()": the command should be an array whose first element is either the path to the binary to run or a "Process" object.', __METHOD__)); - } - - if ($verbosity <= $output->getVerbosity()) { - $output->write($formatter->start(spl_object_hash($process), $this->escapeString($process->getCommandLine()))); - } - - if ($output->isDebug()) { - $callback = $this->wrapCallback($output, $process, $callback); - } - - $process->run($callback, $cmd); - - if ($verbosity <= $output->getVerbosity()) { - $message = $process->isSuccessful() ? 'Command ran successfully' : sprintf('%s Command did not run successfully', $process->getExitCode()); - $output->write($formatter->stop(spl_object_hash($process), $message, $process->isSuccessful())); - } - - if (!$process->isSuccessful() && null !== $error) { - $output->writeln(sprintf('%s', $this->escapeString($error))); - } - - return $process; - } - - /** - * Runs the process. - * - * This is identical to run() except that an exception is thrown if the process - * exits with a non-zero exit code. - * - * @param array|Process $cmd An instance of Process or a command to run - * @param callable|null $callback A PHP callback to run whenever there is some - * output available on STDOUT or STDERR - * - * @throws ProcessFailedException - * - * @see run() - */ - public function mustRun(OutputInterface $output, $cmd, string $error = null, callable $callback = null): Process - { - $process = $this->run($output, $cmd, $error, $callback); - - if (!$process->isSuccessful()) { - throw new ProcessFailedException($process); - } - - return $process; - } - - /** - * Wraps a Process callback to add debugging output. - */ - public function wrapCallback(OutputInterface $output, Process $process, callable $callback = null): callable - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $formatter = $this->getHelperSet()->get('debug_formatter'); - - return function ($type, $buffer) use ($output, $process, $callback, $formatter) { - $output->write($formatter->progress(spl_object_hash($process), $this->escapeString($buffer), Process::ERR === $type)); - - if (null !== $callback) { - $callback($type, $buffer); - } - }; - } - - private function escapeString(string $str): string - { - return str_replace('<', '\\<', $str); - } - - /** - * {@inheritdoc} - */ - public function getName(): string - { - return 'process'; - } -} diff --git a/vendor/symfony/console/Helper/ProgressBar.php b/vendor/symfony/console/Helper/ProgressBar.php deleted file mode 100644 index eb6aacb1a..000000000 --- a/vendor/symfony/console/Helper/ProgressBar.php +++ /dev/null @@ -1,609 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Terminal; - -/** - * The ProgressBar provides helpers to display progress output. - * - * @author Fabien Potencier - * @author Chris Jones - */ -final class ProgressBar -{ - public const FORMAT_VERBOSE = 'verbose'; - public const FORMAT_VERY_VERBOSE = 'very_verbose'; - public const FORMAT_DEBUG = 'debug'; - public const FORMAT_NORMAL = 'normal'; - - private const FORMAT_VERBOSE_NOMAX = 'verbose_nomax'; - private const FORMAT_VERY_VERBOSE_NOMAX = 'very_verbose_nomax'; - private const FORMAT_DEBUG_NOMAX = 'debug_nomax'; - private const FORMAT_NORMAL_NOMAX = 'normal_nomax'; - - private $barWidth = 28; - private $barChar; - private $emptyBarChar = '-'; - private $progressChar = '>'; - private $format; - private $internalFormat; - private $redrawFreq = 1; - private $writeCount; - private $lastWriteTime; - private $minSecondsBetweenRedraws = 0; - private $maxSecondsBetweenRedraws = 1; - private $output; - private $step = 0; - private $max; - private $startTime; - private $stepWidth; - private $percent = 0.0; - private $messages = []; - private $overwrite = true; - private $terminal; - private $previousMessage; - private $cursor; - - private static $formatters; - private static $formats; - - /** - * @param int $max Maximum steps (0 if unknown) - */ - public function __construct(OutputInterface $output, int $max = 0, float $minSecondsBetweenRedraws = 1 / 25) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - $this->output = $output; - $this->setMaxSteps($max); - $this->terminal = new Terminal(); - - if (0 < $minSecondsBetweenRedraws) { - $this->redrawFreq = null; - $this->minSecondsBetweenRedraws = $minSecondsBetweenRedraws; - } - - if (!$this->output->isDecorated()) { - // disable overwrite when output does not support ANSI codes. - $this->overwrite = false; - - // set a reasonable redraw frequency so output isn't flooded - $this->redrawFreq = null; - } - - $this->startTime = time(); - $this->cursor = new Cursor($output); - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - * - * @param string $name The placeholder name (including the delimiter char like %) - * @param callable $callable A PHP callable - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name. - * - * @param string $name The placeholder name (including the delimiter char like %) - */ - public static function getPlaceholderFormatterDefinition(string $name): ?callable - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - /** - * Sets a format for a given name. - * - * This method also allow you to override an existing format. - * - * @param string $name The format name - * @param string $format A format string - */ - public static function setFormatDefinition(string $name, string $format): void - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - self::$formats[$name] = $format; - } - - /** - * Gets the format for a given name. - * - * @param string $name The format name - */ - public static function getFormatDefinition(string $name): ?string - { - if (!self::$formats) { - self::$formats = self::initFormats(); - } - - return self::$formats[$name] ?? null; - } - - /** - * Associates a text with a named placeholder. - * - * The text is displayed when the progress bar is rendered but only - * when the corresponding placeholder is part of the custom format line - * (by wrapping the name with %). - * - * @param string $message The text to associate with the placeholder - * @param string $name The name of the placeholder - */ - public function setMessage(string $message, string $name = 'message') - { - $this->messages[$name] = $message; - } - - public function getMessage(string $name = 'message') - { - return $this->messages[$name]; - } - - public function getStartTime(): int - { - return $this->startTime; - } - - public function getMaxSteps(): int - { - return $this->max; - } - - public function getProgress(): int - { - return $this->step; - } - - private function getStepWidth(): int - { - return $this->stepWidth; - } - - public function getProgressPercent(): float - { - return $this->percent; - } - - public function getBarOffset(): float - { - return floor($this->max ? $this->percent * $this->barWidth : (null === $this->redrawFreq ? (int) (min(5, $this->barWidth / 15) * $this->writeCount) : $this->step) % $this->barWidth); - } - - public function getEstimated(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * $this->max); - } - - public function getRemaining(): float - { - if (!$this->step) { - return 0; - } - - return round((time() - $this->startTime) / $this->step * ($this->max - $this->step)); - } - - public function setBarWidth(int $size) - { - $this->barWidth = max(1, $size); - } - - public function getBarWidth(): int - { - return $this->barWidth; - } - - public function setBarCharacter(string $char) - { - $this->barChar = $char; - } - - public function getBarCharacter(): string - { - return $this->barChar ?? ($this->max ? '=' : $this->emptyBarChar); - } - - public function setEmptyBarCharacter(string $char) - { - $this->emptyBarChar = $char; - } - - public function getEmptyBarCharacter(): string - { - return $this->emptyBarChar; - } - - public function setProgressCharacter(string $char) - { - $this->progressChar = $char; - } - - public function getProgressCharacter(): string - { - return $this->progressChar; - } - - public function setFormat(string $format) - { - $this->format = null; - $this->internalFormat = $format; - } - - /** - * Sets the redraw frequency. - * - * @param int|null $freq The frequency in steps - */ - public function setRedrawFrequency(?int $freq) - { - $this->redrawFreq = null !== $freq ? max(1, $freq) : null; - } - - public function minSecondsBetweenRedraws(float $seconds): void - { - $this->minSecondsBetweenRedraws = $seconds; - } - - public function maxSecondsBetweenRedraws(float $seconds): void - { - $this->maxSecondsBetweenRedraws = $seconds; - } - - /** - * Returns an iterator that will automatically update the progress bar when iterated. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), if null it will be inferred from $iterable - */ - public function iterate(iterable $iterable, int $max = null): iterable - { - $this->start($max ?? (is_countable($iterable) ? \count($iterable) : 0)); - - foreach ($iterable as $key => $value) { - yield $key => $value; - - $this->advance(); - } - - $this->finish(); - } - - /** - * Starts the progress output. - * - * @param int|null $max Number of steps to complete the bar (0 if indeterminate), null to leave unchanged - */ - public function start(int $max = null) - { - $this->startTime = time(); - $this->step = 0; - $this->percent = 0.0; - - if (null !== $max) { - $this->setMaxSteps($max); - } - - $this->display(); - } - - /** - * Advances the progress output X steps. - * - * @param int $step Number of steps to advance - */ - public function advance(int $step = 1) - { - $this->setProgress($this->step + $step); - } - - /** - * Sets whether to overwrite the progressbar, false for new line. - */ - public function setOverwrite(bool $overwrite) - { - $this->overwrite = $overwrite; - } - - public function setProgress(int $step) - { - if ($this->max && $step > $this->max) { - $this->max = $step; - } elseif ($step < 0) { - $step = 0; - } - - $redrawFreq = $this->redrawFreq ?? (($this->max ?: 10) / 10); - $prevPeriod = (int) ($this->step / $redrawFreq); - $currPeriod = (int) ($step / $redrawFreq); - $this->step = $step; - $this->percent = $this->max ? (float) $this->step / $this->max : 0; - $timeInterval = microtime(true) - $this->lastWriteTime; - - // Draw regardless of other limits - if ($this->max === $step) { - $this->display(); - - return; - } - - // Throttling - if ($timeInterval < $this->minSecondsBetweenRedraws) { - return; - } - - // Draw each step period, but not too late - if ($prevPeriod !== $currPeriod || $timeInterval >= $this->maxSecondsBetweenRedraws) { - $this->display(); - } - } - - public function setMaxSteps(int $max) - { - $this->format = null; - $this->max = max(0, $max); - $this->stepWidth = $this->max ? Helper::width((string) $this->max) : 4; - } - - /** - * Finishes the progress output. - */ - public function finish(): void - { - if (!$this->max) { - $this->max = $this->step; - } - - if ($this->step === $this->max && !$this->overwrite) { - // prevent double 100% output - return; - } - - $this->setProgress($this->max); - } - - /** - * Outputs the current progress string. - */ - public function display(): void - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite($this->buildLine()); - } - - /** - * Removes the progress bar from the current line. - * - * This is useful if you wish to write some output - * while a progress bar is running. - * Call display() to show the progress bar again. - */ - public function clear(): void - { - if (!$this->overwrite) { - return; - } - - if (null === $this->format) { - $this->setRealFormat($this->internalFormat ?: $this->determineBestFormat()); - } - - $this->overwrite(''); - } - - private function setRealFormat(string $format) - { - // try to use the _nomax variant if available - if (!$this->max && null !== self::getFormatDefinition($format.'_nomax')) { - $this->format = self::getFormatDefinition($format.'_nomax'); - } elseif (null !== self::getFormatDefinition($format)) { - $this->format = self::getFormatDefinition($format); - } else { - $this->format = $format; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message): void - { - if ($this->previousMessage === $message) { - return; - } - - $originalMessage = $message; - - if ($this->overwrite) { - if (null !== $this->previousMessage) { - if ($this->output instanceof ConsoleSectionOutput) { - $messageLines = explode("\n", $this->previousMessage); - $lineCount = \count($messageLines); - foreach ($messageLines as $messageLine) { - $messageLineLength = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $messageLine)); - if ($messageLineLength > $this->terminal->getWidth()) { - $lineCount += floor($messageLineLength / $this->terminal->getWidth()); - } - } - $this->output->clear($lineCount); - } else { - $lineCount = substr_count($this->previousMessage, "\n"); - for ($i = 0; $i < $lineCount; ++$i) { - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - $this->cursor->moveUp(); - } - - $this->cursor->moveToColumn(1); - $this->cursor->clearLine(); - } - } - } elseif ($this->step > 0) { - $message = \PHP_EOL.$message; - } - - $this->previousMessage = $originalMessage; - $this->lastWriteTime = microtime(true); - - $this->output->write($message); - ++$this->writeCount; - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->max ? self::FORMAT_VERBOSE : self::FORMAT_VERBOSE_NOMAX; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - return $this->max ? self::FORMAT_VERY_VERBOSE : self::FORMAT_VERY_VERBOSE_NOMAX; - case OutputInterface::VERBOSITY_DEBUG: - return $this->max ? self::FORMAT_DEBUG : self::FORMAT_DEBUG_NOMAX; - default: - return $this->max ? self::FORMAT_NORMAL : self::FORMAT_NORMAL_NOMAX; - } - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'bar' => function (self $bar, OutputInterface $output) { - $completeBars = $bar->getBarOffset(); - $display = str_repeat($bar->getBarCharacter(), $completeBars); - if ($completeBars < $bar->getBarWidth()) { - $emptyBars = $bar->getBarWidth() - $completeBars - Helper::length(Helper::removeDecoration($output->getFormatter(), $bar->getProgressCharacter())); - $display .= $bar->getProgressCharacter().str_repeat($bar->getEmptyBarCharacter(), $emptyBars); - } - - return $display; - }, - 'elapsed' => function (self $bar) { - return Helper::formatTime(time() - $bar->getStartTime()); - }, - 'remaining' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the remaining time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getRemaining()); - }, - 'estimated' => function (self $bar) { - if (!$bar->getMaxSteps()) { - throw new LogicException('Unable to display the estimated time if the maximum number of steps is not set.'); - } - - return Helper::formatTime($bar->getEstimated()); - }, - 'memory' => function (self $bar) { - return Helper::formatMemory(memory_get_usage(true)); - }, - 'current' => function (self $bar) { - return str_pad($bar->getProgress(), $bar->getStepWidth(), ' ', \STR_PAD_LEFT); - }, - 'max' => function (self $bar) { - return $bar->getMaxSteps(); - }, - 'percent' => function (self $bar) { - return floor($bar->getProgressPercent() * 100); - }, - ]; - } - - private static function initFormats(): array - { - return [ - self::FORMAT_NORMAL => ' %current%/%max% [%bar%] %percent:3s%%', - self::FORMAT_NORMAL_NOMAX => ' %current% [%bar%]', - - self::FORMAT_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%', - self::FORMAT_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_VERY_VERBOSE => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%', - self::FORMAT_VERY_VERBOSE_NOMAX => ' %current% [%bar%] %elapsed:6s%', - - self::FORMAT_DEBUG => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%', - self::FORMAT_DEBUG_NOMAX => ' %current% [%bar%] %elapsed:6s% %memory:6s%', - ]; - } - - private function buildLine(): string - { - $regex = "{%([a-z\-_]+)(?:\:([^%]+))?%}i"; - $callback = function ($matches) { - if ($formatter = $this::getPlaceholderFormatterDefinition($matches[1])) { - $text = $formatter($this, $this->output); - } elseif (isset($this->messages[$matches[1]])) { - $text = $this->messages[$matches[1]]; - } else { - return $matches[0]; - } - - if (isset($matches[2])) { - $text = sprintf('%'.$matches[2], $text); - } - - return $text; - }; - $line = preg_replace_callback($regex, $callback, $this->format); - - // gets string length for each sub line with multiline format - $linesLength = array_map(function ($subLine) { - return Helper::width(Helper::removeDecoration($this->output->getFormatter(), rtrim($subLine, "\r"))); - }, explode("\n", $line)); - - $linesWidth = max($linesLength); - - $terminalWidth = $this->terminal->getWidth(); - if ($linesWidth <= $terminalWidth) { - return $line; - } - - $this->setBarWidth($this->barWidth - $linesWidth + $terminalWidth); - - return preg_replace_callback($regex, $callback, $this->format); - } -} diff --git a/vendor/symfony/console/Helper/ProgressIndicator.php b/vendor/symfony/console/Helper/ProgressIndicator.php deleted file mode 100644 index 3482343fc..000000000 --- a/vendor/symfony/console/Helper/ProgressIndicator.php +++ /dev/null @@ -1,249 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Kevin Bond - */ -class ProgressIndicator -{ - private const FORMATS = [ - 'normal' => ' %indicator% %message%', - 'normal_no_ansi' => ' %message%', - - 'verbose' => ' %indicator% %message% (%elapsed:6s%)', - 'verbose_no_ansi' => ' %message% (%elapsed:6s%)', - - 'very_verbose' => ' %indicator% %message% (%elapsed:6s%, %memory:6s%)', - 'very_verbose_no_ansi' => ' %message% (%elapsed:6s%, %memory:6s%)', - ]; - - private $output; - private $startTime; - private $format; - private $message; - private $indicatorValues; - private $indicatorCurrent; - private $indicatorChangeInterval; - private $indicatorUpdateTime; - private $started = false; - - /** - * @var array - */ - private static $formatters; - - /** - * @param int $indicatorChangeInterval Change interval in milliseconds - * @param array|null $indicatorValues Animated indicator characters - */ - public function __construct(OutputInterface $output, string $format = null, int $indicatorChangeInterval = 100, array $indicatorValues = null) - { - $this->output = $output; - - if (null === $format) { - $format = $this->determineBestFormat(); - } - - if (null === $indicatorValues) { - $indicatorValues = ['-', '\\', '|', '/']; - } - - $indicatorValues = array_values($indicatorValues); - - if (2 > \count($indicatorValues)) { - throw new InvalidArgumentException('Must have at least 2 indicator value characters.'); - } - - $this->format = self::getFormatDefinition($format); - $this->indicatorChangeInterval = $indicatorChangeInterval; - $this->indicatorValues = $indicatorValues; - $this->startTime = time(); - } - - /** - * Sets the current indicator message. - */ - public function setMessage(?string $message) - { - $this->message = $message; - - $this->display(); - } - - /** - * Starts the indicator output. - */ - public function start(string $message) - { - if ($this->started) { - throw new LogicException('Progress indicator already started.'); - } - - $this->message = $message; - $this->started = true; - $this->startTime = time(); - $this->indicatorUpdateTime = $this->getCurrentTimeInMilliseconds() + $this->indicatorChangeInterval; - $this->indicatorCurrent = 0; - - $this->display(); - } - - /** - * Advances the indicator. - */ - public function advance() - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - if (!$this->output->isDecorated()) { - return; - } - - $currentTime = $this->getCurrentTimeInMilliseconds(); - - if ($currentTime < $this->indicatorUpdateTime) { - return; - } - - $this->indicatorUpdateTime = $currentTime + $this->indicatorChangeInterval; - ++$this->indicatorCurrent; - - $this->display(); - } - - /** - * Finish the indicator with message. - * - * @param $message - */ - public function finish(string $message) - { - if (!$this->started) { - throw new LogicException('Progress indicator has not yet been started.'); - } - - $this->message = $message; - $this->display(); - $this->output->writeln(''); - $this->started = false; - } - - /** - * Gets the format for a given name. - * - * @return string|null - */ - public static function getFormatDefinition(string $name) - { - return self::FORMATS[$name] ?? null; - } - - /** - * Sets a placeholder formatter for a given name. - * - * This method also allow you to override an existing placeholder. - */ - public static function setPlaceholderFormatterDefinition(string $name, callable $callable) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - self::$formatters[$name] = $callable; - } - - /** - * Gets the placeholder formatter for a given name (including the delimiter char like %). - * - * @return callable|null - */ - public static function getPlaceholderFormatterDefinition(string $name) - { - if (!self::$formatters) { - self::$formatters = self::initPlaceholderFormatters(); - } - - return self::$formatters[$name] ?? null; - } - - private function display() - { - if (OutputInterface::VERBOSITY_QUIET === $this->output->getVerbosity()) { - return; - } - - $this->overwrite(preg_replace_callback("{%([a-z\-_]+)(?:\:([^%]+))?%}i", function ($matches) { - if ($formatter = self::getPlaceholderFormatterDefinition($matches[1])) { - return $formatter($this); - } - - return $matches[0]; - }, $this->format ?? '')); - } - - private function determineBestFormat(): string - { - switch ($this->output->getVerbosity()) { - // OutputInterface::VERBOSITY_QUIET: display is disabled anyway - case OutputInterface::VERBOSITY_VERBOSE: - return $this->output->isDecorated() ? 'verbose' : 'verbose_no_ansi'; - case OutputInterface::VERBOSITY_VERY_VERBOSE: - case OutputInterface::VERBOSITY_DEBUG: - return $this->output->isDecorated() ? 'very_verbose' : 'very_verbose_no_ansi'; - default: - return $this->output->isDecorated() ? 'normal' : 'normal_no_ansi'; - } - } - - /** - * Overwrites a previous message to the output. - */ - private function overwrite(string $message) - { - if ($this->output->isDecorated()) { - $this->output->write("\x0D\x1B[2K"); - $this->output->write($message); - } else { - $this->output->writeln($message); - } - } - - private function getCurrentTimeInMilliseconds(): float - { - return round(microtime(true) * 1000); - } - - private static function initPlaceholderFormatters(): array - { - return [ - 'indicator' => function (self $indicator) { - return $indicator->indicatorValues[$indicator->indicatorCurrent % \count($indicator->indicatorValues)]; - }, - 'message' => function (self $indicator) { - return $indicator->message; - }, - 'elapsed' => function (self $indicator) { - return Helper::formatTime(time() - $indicator->startTime); - }, - 'memory' => function () { - return Helper::formatMemory(memory_get_usage(true)); - }, - ]; - } -} diff --git a/vendor/symfony/console/Helper/QuestionHelper.php b/vendor/symfony/console/Helper/QuestionHelper.php deleted file mode 100644 index e236be92a..000000000 --- a/vendor/symfony/console/Helper/QuestionHelper.php +++ /dev/null @@ -1,625 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Cursor; -use Symfony\Component\Console\Exception\MissingInputException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterStyle; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Input\StreamableInputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -use function Symfony\Component\String\s; - -/** - * The QuestionHelper class provides helpers to interact with the user. - * - * @author Fabien Potencier - */ -class QuestionHelper extends Helper -{ - /** - * @var resource|null - */ - private $inputStream; - - private static $stty = true; - private static $stdinIsInteractive; - - /** - * Asks a question to the user. - * - * @return mixed The user answer - * - * @throws RuntimeException If there is no data to read in the input stream - */ - public function ask(InputInterface $input, OutputInterface $output, Question $question) - { - if ($output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - - if (!$input->isInteractive()) { - return $this->getDefaultAnswer($question); - } - - if ($input instanceof StreamableInputInterface && $stream = $input->getStream()) { - $this->inputStream = $stream; - } - - try { - if (!$question->getValidator()) { - return $this->doAsk($output, $question); - } - - $interviewer = function () use ($output, $question) { - return $this->doAsk($output, $question); - }; - - return $this->validateAttempts($interviewer, $output, $question); - } catch (MissingInputException $exception) { - $input->setInteractive(false); - - if (null === $fallbackOutput = $this->getDefaultAnswer($question)) { - throw $exception; - } - - return $fallbackOutput; - } - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return 'question'; - } - - /** - * Prevents usage of stty. - */ - public static function disableStty() - { - self::$stty = false; - } - - /** - * Asks the question to the user. - * - * @return mixed - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function doAsk(OutputInterface $output, Question $question) - { - $this->writePrompt($output, $question); - - $inputStream = $this->inputStream ?: \STDIN; - $autocomplete = $question->getAutocompleterCallback(); - - if (null === $autocomplete || !self::$stty || !Terminal::hasSttyAvailable()) { - $ret = false; - if ($question->isHidden()) { - try { - $hiddenResponse = $this->getHiddenResponse($output, $inputStream, $question->isTrimmable()); - $ret = $question->isTrimmable() ? trim($hiddenResponse) : $hiddenResponse; - } catch (RuntimeException $e) { - if (!$question->isHiddenFallback()) { - throw $e; - } - } - } - - if (false === $ret) { - $isBlocked = stream_get_meta_data($inputStream)['blocked'] ?? true; - - if (!$isBlocked) { - stream_set_blocking($inputStream, true); - } - - $ret = $this->readInput($inputStream, $question); - - if (!$isBlocked) { - stream_set_blocking($inputStream, false); - } - - if (false === $ret) { - throw new MissingInputException('Aborted.'); - } - if ($question->isTrimmable()) { - $ret = trim($ret); - } - } - } else { - $autocomplete = $this->autocomplete($output, $question, $inputStream, $autocomplete); - $ret = $question->isTrimmable() ? trim($autocomplete) : $autocomplete; - } - - if ($output instanceof ConsoleSectionOutput) { - $output->addContent($ret); - } - - $ret = \strlen($ret) > 0 ? $ret : $question->getDefault(); - - if ($normalizer = $question->getNormalizer()) { - return $normalizer($ret); - } - - return $ret; - } - - /** - * @return mixed - */ - private function getDefaultAnswer(Question $question) - { - $default = $question->getDefault(); - - if (null === $default) { - return $default; - } - - if ($validator = $question->getValidator()) { - return \call_user_func($question->getValidator(), $default); - } elseif ($question instanceof ChoiceQuestion) { - $choices = $question->getChoices(); - - if (!$question->isMultiselect()) { - return $choices[$default] ?? $default; - } - - $default = explode(',', $default); - foreach ($default as $k => $v) { - $v = $question->isTrimmable() ? trim($v) : $v; - $default[$k] = $choices[$v] ?? $v; - } - } - - return $default; - } - - /** - * Outputs the question prompt. - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $message = $question->getQuestion(); - - if ($question instanceof ChoiceQuestion) { - $output->writeln(array_merge([ - $question->getQuestion(), - ], $this->formatChoiceQuestionChoices($question, 'info'))); - - $message = $question->getPrompt(); - } - - $output->write($message); - } - - /** - * @return string[] - */ - protected function formatChoiceQuestionChoices(ChoiceQuestion $question, string $tag) - { - $messages = []; - - $maxWidth = max(array_map([__CLASS__, 'width'], array_keys($choices = $question->getChoices()))); - - foreach ($choices as $key => $value) { - $padding = str_repeat(' ', $maxWidth - self::width($key)); - - $messages[] = sprintf(" [<$tag>%s$padding] %s", $key, $value); - } - - return $messages; - } - - /** - * Outputs an error message. - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if (null !== $this->getHelperSet() && $this->getHelperSet()->has('formatter')) { - $message = $this->getHelperSet()->get('formatter')->formatBlock($error->getMessage(), 'error'); - } else { - $message = ''.$error->getMessage().''; - } - - $output->writeln($message); - } - - /** - * Autocompletes a question. - * - * @param resource $inputStream - */ - private function autocomplete(OutputInterface $output, Question $question, $inputStream, callable $autocomplete): string - { - $cursor = new Cursor($output, $inputStream); - - $fullChoice = ''; - $ret = ''; - - $i = 0; - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - - $sttyMode = shell_exec('stty -g'); - $isStdin = 'php://stdin' === (stream_get_meta_data($inputStream)['uri'] ?? null); - $r = [$inputStream]; - $w = []; - - // Disable icanon (so we can fread each keypress) and echo (we'll do echoing here instead) - shell_exec('stty -icanon -echo'); - - // Add highlighted text style - $output->getFormatter()->setStyle('hl', new OutputFormatterStyle('black', 'white')); - - // Read a keypress - while (!feof($inputStream)) { - while ($isStdin && 0 === @stream_select($r, $w, $w, 0, 100)) { - // Give signal handlers a chance to run - $r = [$inputStream]; - } - $c = fread($inputStream, 1); - - // as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false. - if (false === $c || ('' === $ret && '' === $c && null === $question->getDefault())) { - shell_exec('stty '.$sttyMode); - throw new MissingInputException('Aborted.'); - } elseif ("\177" === $c) { // Backspace Character - if (0 === $numMatches && 0 !== $i) { - --$i; - $cursor->moveLeft(s($fullChoice)->slice(-1)->width(false)); - - $fullChoice = self::substr($fullChoice, 0, $i); - } - - if (0 === $i) { - $ofs = -1; - $matches = $autocomplete($ret); - $numMatches = \count($matches); - } else { - $numMatches = 0; - } - - // Pop the last character off the end of our string - $ret = self::substr($ret, 0, $i); - } elseif ("\033" === $c) { - // Did we read an escape sequence? - $c .= fread($inputStream, 2); - - // A = Up Arrow. B = Down Arrow - if (isset($c[2]) && ('A' === $c[2] || 'B' === $c[2])) { - if ('A' === $c[2] && -1 === $ofs) { - $ofs = 0; - } - - if (0 === $numMatches) { - continue; - } - - $ofs += ('A' === $c[2]) ? -1 : 1; - $ofs = ($numMatches + $ofs) % $numMatches; - } - } elseif (\ord($c) < 32) { - if ("\t" === $c || "\n" === $c) { - if ($numMatches > 0 && -1 !== $ofs) { - $ret = (string) $matches[$ofs]; - // Echo out remaining chars for current match - $remainingCharacters = substr($ret, \strlen(trim($this->mostRecentlyEnteredValue($fullChoice)))); - $output->write($remainingCharacters); - $fullChoice .= $remainingCharacters; - $i = (false === $encoding = mb_detect_encoding($fullChoice, null, true)) ? \strlen($fullChoice) : mb_strlen($fullChoice, $encoding); - - $matches = array_filter( - $autocomplete($ret), - function ($match) use ($ret) { - return '' === $ret || str_starts_with($match, $ret); - } - ); - $numMatches = \count($matches); - $ofs = -1; - } - - if ("\n" === $c) { - $output->write($c); - break; - } - - $numMatches = 0; - } - - continue; - } else { - if ("\x80" <= $c) { - $c .= fread($inputStream, ["\xC0" => 1, "\xD0" => 1, "\xE0" => 2, "\xF0" => 3][$c & "\xF0"]); - } - - $output->write($c); - $ret .= $c; - $fullChoice .= $c; - ++$i; - - $tempRet = $ret; - - if ($question instanceof ChoiceQuestion && $question->isMultiselect()) { - $tempRet = $this->mostRecentlyEnteredValue($fullChoice); - } - - $numMatches = 0; - $ofs = 0; - - foreach ($autocomplete($ret) as $value) { - // If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle) - if (str_starts_with($value, $tempRet)) { - $matches[$numMatches++] = $value; - } - } - } - - $cursor->clearLineAfter(); - - if ($numMatches > 0 && -1 !== $ofs) { - $cursor->savePosition(); - // Write highlighted text, complete the partially entered response - $charactersEntered = \strlen(trim($this->mostRecentlyEnteredValue($fullChoice))); - $output->write(''.OutputFormatter::escapeTrailingBackslash(substr($matches[$ofs], $charactersEntered)).''); - $cursor->restorePosition(); - } - } - - // Reset stty so it behaves normally again - shell_exec('stty '.$sttyMode); - - return $fullChoice; - } - - private function mostRecentlyEnteredValue(string $entered): string - { - // Determine the most recent value that the user entered - if (!str_contains($entered, ',')) { - return $entered; - } - - $choices = explode(',', $entered); - if ('' !== $lastChoice = trim($choices[\count($choices) - 1])) { - return $lastChoice; - } - - return $entered; - } - - /** - * Gets a hidden response from user. - * - * @param resource $inputStream The handler resource - * @param bool $trimmable Is the answer trimmable - * - * @throws RuntimeException In case the fallback is deactivated and the response cannot be hidden - */ - private function getHiddenResponse(OutputInterface $output, $inputStream, bool $trimmable = true): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $exe = __DIR__.'/../Resources/bin/hiddeninput.exe'; - - // handle code running from a phar - if ('phar:' === substr(__FILE__, 0, 5)) { - $tmpExe = sys_get_temp_dir().'/hiddeninput.exe'; - copy($exe, $tmpExe); - $exe = $tmpExe; - } - - $sExec = shell_exec('"'.$exe.'"'); - $value = $trimmable ? rtrim($sExec) : $sExec; - $output->writeln(''); - - if (isset($tmpExe)) { - unlink($tmpExe); - } - - return $value; - } - - if (self::$stty && Terminal::hasSttyAvailable()) { - $sttyMode = shell_exec('stty -g'); - shell_exec('stty -echo'); - } elseif ($this->isInteractiveInput($inputStream)) { - throw new RuntimeException('Unable to hide the response.'); - } - - $value = fgets($inputStream, 4096); - - if (self::$stty && Terminal::hasSttyAvailable()) { - shell_exec('stty '.$sttyMode); - } - - if (false === $value) { - throw new MissingInputException('Aborted.'); - } - if ($trimmable) { - $value = trim($value); - } - $output->writeln(''); - - return $value; - } - - /** - * Validates an attempt. - * - * @param callable $interviewer A callable that will ask for a question and return the result - * - * @return mixed The validated response - * - * @throws \Exception In case the max number of attempts has been reached and no valid response has been given - */ - private function validateAttempts(callable $interviewer, OutputInterface $output, Question $question) - { - $error = null; - $attempts = $question->getMaxAttempts(); - - while (null === $attempts || $attempts--) { - if (null !== $error) { - $this->writeError($output, $error); - } - - try { - return $question->getValidator()($interviewer()); - } catch (RuntimeException $e) { - throw $e; - } catch (\Exception $error) { - } - } - - throw $error; - } - - private function isInteractiveInput($inputStream): bool - { - if ('php://stdin' !== (stream_get_meta_data($inputStream)['uri'] ?? null)) { - return false; - } - - if (null !== self::$stdinIsInteractive) { - return self::$stdinIsInteractive; - } - - if (\function_exists('stream_isatty')) { - return self::$stdinIsInteractive = @stream_isatty(fopen('php://stdin', 'r')); - } - - if (\function_exists('posix_isatty')) { - return self::$stdinIsInteractive = @posix_isatty(fopen('php://stdin', 'r')); - } - - if (!\function_exists('shell_exec')) { - return self::$stdinIsInteractive = true; - } - - return self::$stdinIsInteractive = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); - } - - /** - * Reads one or more lines of input and returns what is read. - * - * @param resource $inputStream The handler resource - * @param Question $question The question being asked - * - * @return string|false The input received, false in case input could not be read - */ - private function readInput($inputStream, Question $question) - { - if (!$question->isMultiline()) { - $cp = $this->setIOCodepage(); - $ret = fgets($inputStream, 4096); - - return $this->resetIOCodepage($cp, $ret); - } - - $multiLineStreamReader = $this->cloneInputStream($inputStream); - if (null === $multiLineStreamReader) { - return false; - } - - $ret = ''; - $cp = $this->setIOCodepage(); - while (false !== ($char = fgetc($multiLineStreamReader))) { - if (\PHP_EOL === "{$ret}{$char}") { - break; - } - $ret .= $char; - } - - return $this->resetIOCodepage($cp, $ret); - } - - /** - * Sets console I/O to the host code page. - * - * @return int Previous code page in IBM/EBCDIC format - */ - private function setIOCodepage(): int - { - if (\function_exists('sapi_windows_cp_set')) { - $cp = sapi_windows_cp_get(); - sapi_windows_cp_set(sapi_windows_cp_get('oem')); - - return $cp; - } - - return 0; - } - - /** - * Sets console I/O to the specified code page and converts the user input. - * - * @param string|false $input - * - * @return string|false - */ - private function resetIOCodepage(int $cp, $input) - { - if (0 !== $cp) { - sapi_windows_cp_set($cp); - - if (false !== $input && '' !== $input) { - $input = sapi_windows_cp_conv(sapi_windows_cp_get('oem'), $cp, $input); - } - } - - return $input; - } - - /** - * Clones an input stream in order to act on one instance of the same - * stream without affecting the other instance. - * - * @param resource $inputStream The handler resource - * - * @return resource|null The cloned resource, null in case it could not be cloned - */ - private function cloneInputStream($inputStream) - { - $streamMetaData = stream_get_meta_data($inputStream); - $seekable = $streamMetaData['seekable'] ?? false; - $mode = $streamMetaData['mode'] ?? 'rb'; - $uri = $streamMetaData['uri'] ?? null; - - if (null === $uri) { - return null; - } - - $cloneStream = fopen($uri, $mode); - - // For seekable and writable streams, add all the same data to the - // cloned stream and then seek to the same offset. - if (true === $seekable && !\in_array($mode, ['r', 'rb', 'rt'])) { - $offset = ftell($inputStream); - rewind($inputStream); - stream_copy_to_stream($inputStream, $cloneStream); - fseek($inputStream, $offset); - fseek($cloneStream, $offset); - } - - return $cloneStream; - } -} diff --git a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php b/vendor/symfony/console/Helper/SymfonyQuestionHelper.php deleted file mode 100644 index 01f94aba4..000000000 --- a/vendor/symfony/console/Helper/SymfonyQuestionHelper.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Style\SymfonyStyle; - -/** - * Symfony Style Guide compliant question helper. - * - * @author Kevin Bond - */ -class SymfonyQuestionHelper extends QuestionHelper -{ - /** - * {@inheritdoc} - */ - protected function writePrompt(OutputInterface $output, Question $question) - { - $text = OutputFormatter::escapeTrailingBackslash($question->getQuestion()); - $default = $question->getDefault(); - - if ($question->isMultiline()) { - $text .= sprintf(' (press %s to continue)', $this->getEofShortcut()); - } - - switch (true) { - case null === $default: - $text = sprintf(' %s:', $text); - - break; - - case $question instanceof ConfirmationQuestion: - $text = sprintf(' %s (yes/no) [%s]:', $text, $default ? 'yes' : 'no'); - - break; - - case $question instanceof ChoiceQuestion && $question->isMultiselect(): - $choices = $question->getChoices(); - $default = explode(',', $default); - - foreach ($default as $key => $value) { - $default[$key] = $choices[trim($value)]; - } - - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape(implode(', ', $default))); - - break; - - case $question instanceof ChoiceQuestion: - $choices = $question->getChoices(); - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($choices[$default] ?? $default)); - - break; - - default: - $text = sprintf(' %s [%s]:', $text, OutputFormatter::escape($default)); - } - - $output->writeln($text); - - $prompt = ' > '; - - if ($question instanceof ChoiceQuestion) { - $output->writeln($this->formatChoiceQuestionChoices($question, 'comment')); - - $prompt = $question->getPrompt(); - } - - $output->write($prompt); - } - - /** - * {@inheritdoc} - */ - protected function writeError(OutputInterface $output, \Exception $error) - { - if ($output instanceof SymfonyStyle) { - $output->newLine(); - $output->error($error->getMessage()); - - return; - } - - parent::writeError($output, $error); - } - - private function getEofShortcut(): string - { - if ('Windows' === \PHP_OS_FAMILY) { - return 'Ctrl+Z then Enter'; - } - - return 'Ctrl+D'; - } -} diff --git a/vendor/symfony/console/Helper/Table.php b/vendor/symfony/console/Helper/Table.php deleted file mode 100644 index 5c3447ab3..000000000 --- a/vendor/symfony/console/Helper/Table.php +++ /dev/null @@ -1,915 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\WrappableOutputFormatterInterface; -use Symfony\Component\Console\Output\ConsoleSectionOutput; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Provides helpers to display a table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Abdellatif Ait boudad - * @author Max Grigorian - * @author Dany Maillard - */ -class Table -{ - private const SEPARATOR_TOP = 0; - private const SEPARATOR_TOP_BOTTOM = 1; - private const SEPARATOR_MID = 2; - private const SEPARATOR_BOTTOM = 3; - private const BORDER_OUTSIDE = 0; - private const BORDER_INSIDE = 1; - - private $headerTitle; - private $footerTitle; - - /** - * Table headers. - */ - private $headers = []; - - /** - * Table rows. - */ - private $rows = []; - private $horizontal = false; - - /** - * Column widths cache. - */ - private $effectiveColumnWidths = []; - - /** - * Number of columns cache. - * - * @var int - */ - private $numberOfColumns; - - /** - * @var OutputInterface - */ - private $output; - - /** - * @var TableStyle - */ - private $style; - - /** - * @var array - */ - private $columnStyles = []; - - /** - * User set column widths. - * - * @var array - */ - private $columnWidths = []; - private $columnMaxWidths = []; - - /** - * @var array|null - */ - private static $styles; - - private $rendered = false; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - $this->setStyle('default'); - } - - /** - * Sets a style definition. - */ - public static function setStyleDefinition(string $name, TableStyle $style) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - self::$styles[$name] = $style; - } - - /** - * Gets a style definition by name. - * - * @return TableStyle - */ - public static function getStyleDefinition(string $name) - { - if (!self::$styles) { - self::$styles = self::initStyles(); - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } - - /** - * Sets table style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setStyle($name) - { - $this->style = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current table style. - * - * @return TableStyle - */ - public function getStyle() - { - return $this->style; - } - - /** - * Sets table column style. - * - * @param TableStyle|string $name The style name or a TableStyle instance - * - * @return $this - */ - public function setColumnStyle(int $columnIndex, $name) - { - $this->columnStyles[$columnIndex] = $this->resolveStyle($name); - - return $this; - } - - /** - * Gets the current style for a column. - * - * If style was not set, it returns the global table style. - * - * @return TableStyle - */ - public function getColumnStyle(int $columnIndex) - { - return $this->columnStyles[$columnIndex] ?? $this->getStyle(); - } - - /** - * Sets the minimum width of a column. - * - * @return $this - */ - public function setColumnWidth(int $columnIndex, int $width) - { - $this->columnWidths[$columnIndex] = $width; - - return $this; - } - - /** - * Sets the minimum width of all columns. - * - * @return $this - */ - public function setColumnWidths(array $widths) - { - $this->columnWidths = []; - foreach ($widths as $index => $width) { - $this->setColumnWidth($index, $width); - } - - return $this; - } - - /** - * Sets the maximum width of a column. - * - * Any cell within this column which contents exceeds the specified width will be wrapped into multiple lines, while - * formatted strings are preserved. - * - * @return $this - */ - public function setColumnMaxWidth(int $columnIndex, int $width): self - { - if (!$this->output->getFormatter() instanceof WrappableOutputFormatterInterface) { - throw new \LogicException(sprintf('Setting a maximum column width is only supported when using a "%s" formatter, got "%s".', WrappableOutputFormatterInterface::class, get_debug_type($this->output->getFormatter()))); - } - - $this->columnMaxWidths[$columnIndex] = $width; - - return $this; - } - - /** - * @return $this - */ - public function setHeaders(array $headers) - { - $headers = array_values($headers); - if (!empty($headers) && !\is_array($headers[0])) { - $headers = [$headers]; - } - - $this->headers = $headers; - - return $this; - } - - public function setRows(array $rows) - { - $this->rows = []; - - return $this->addRows($rows); - } - - /** - * @return $this - */ - public function addRows(array $rows) - { - foreach ($rows as $row) { - $this->addRow($row); - } - - return $this; - } - - /** - * @return $this - */ - public function addRow($row) - { - if ($row instanceof TableSeparator) { - $this->rows[] = $row; - - return $this; - } - - if (!\is_array($row)) { - throw new InvalidArgumentException('A row must be an array or a TableSeparator instance.'); - } - - $this->rows[] = array_values($row); - - return $this; - } - - /** - * Adds a row to the table, and re-renders the table. - * - * @return $this - */ - public function appendRow($row): self - { - if (!$this->output instanceof ConsoleSectionOutput) { - throw new RuntimeException(sprintf('Output should be an instance of "%s" when calling "%s".', ConsoleSectionOutput::class, __METHOD__)); - } - - if ($this->rendered) { - $this->output->clear($this->calculateRowCount()); - } - - $this->addRow($row); - $this->render(); - - return $this; - } - - /** - * @return $this - */ - public function setRow($column, array $row) - { - $this->rows[$column] = $row; - - return $this; - } - - /** - * @return $this - */ - public function setHeaderTitle(?string $title): self - { - $this->headerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setFooterTitle(?string $title): self - { - $this->footerTitle = $title; - - return $this; - } - - /** - * @return $this - */ - public function setHorizontal(bool $horizontal = true): self - { - $this->horizontal = $horizontal; - - return $this; - } - - /** - * Renders table to output. - * - * Example: - * - * +---------------+-----------------------+------------------+ - * | ISBN | Title | Author | - * +---------------+-----------------------+------------------+ - * | 99921-58-10-7 | Divine Comedy | Dante Alighieri | - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - * | 960-425-059-0 | The Lord of the Rings | J. R. R. Tolkien | - * +---------------+-----------------------+------------------+ - */ - public function render() - { - $divider = new TableSeparator(); - if ($this->horizontal) { - $rows = []; - foreach ($this->headers[0] ?? [] as $i => $header) { - $rows[$i] = [$header]; - foreach ($this->rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - if (isset($row[$i])) { - $rows[$i][] = $row[$i]; - } elseif ($rows[$i][0] instanceof TableCell && $rows[$i][0]->getColspan() >= 2) { - // Noop, there is a "title" - } else { - $rows[$i][] = null; - } - } - } - } else { - $rows = array_merge($this->headers, [$divider], $this->rows); - } - - $this->calculateNumberOfColumns($rows); - - $rowGroups = $this->buildTableRows($rows); - $this->calculateColumnsWidth($rowGroups); - - $isHeader = !$this->horizontal; - $isFirstRow = $this->horizontal; - $hasTitle = (bool) $this->headerTitle; - - foreach ($rowGroups as $rowGroup) { - $isHeaderSeparatorRendered = false; - - foreach ($rowGroup as $row) { - if ($divider === $row) { - $isHeader = false; - $isFirstRow = true; - - continue; - } - - if ($row instanceof TableSeparator) { - $this->renderRowSeparator(); - - continue; - } - - if (!$row) { - continue; - } - - if ($isHeader && !$isHeaderSeparatorRendered) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $hasTitle = false; - $isHeaderSeparatorRendered = true; - } - - if ($isFirstRow) { - $this->renderRowSeparator( - $isHeader ? self::SEPARATOR_TOP : self::SEPARATOR_TOP_BOTTOM, - $hasTitle ? $this->headerTitle : null, - $hasTitle ? $this->style->getHeaderTitleFormat() : null - ); - $isFirstRow = false; - $hasTitle = false; - } - - if ($this->horizontal) { - $this->renderRow($row, $this->style->getCellRowFormat(), $this->style->getCellHeaderFormat()); - } else { - $this->renderRow($row, $isHeader ? $this->style->getCellHeaderFormat() : $this->style->getCellRowFormat()); - } - } - } - $this->renderRowSeparator(self::SEPARATOR_BOTTOM, $this->footerTitle, $this->style->getFooterTitleFormat()); - - $this->cleanup(); - $this->rendered = true; - } - - /** - * Renders horizontal header separator. - * - * Example: - * - * +-----+-----------+-------+ - */ - private function renderRowSeparator(int $type = self::SEPARATOR_MID, string $title = null, string $titleFormat = null) - { - if (0 === $count = $this->numberOfColumns) { - return; - } - - $borders = $this->style->getBorderChars(); - if (!$borders[0] && !$borders[2] && !$this->style->getCrossingChar()) { - return; - } - - $crossings = $this->style->getCrossingChars(); - if (self::SEPARATOR_MID === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[2], $crossings[8], $crossings[0], $crossings[4]]; - } elseif (self::SEPARATOR_TOP === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[1], $crossings[2], $crossings[3]]; - } elseif (self::SEPARATOR_TOP_BOTTOM === $type) { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[9], $crossings[10], $crossings[11]]; - } else { - [$horizontal, $leftChar, $midChar, $rightChar] = [$borders[0], $crossings[7], $crossings[6], $crossings[5]]; - } - - $markup = $leftChar; - for ($column = 0; $column < $count; ++$column) { - $markup .= str_repeat($horizontal, $this->effectiveColumnWidths[$column]); - $markup .= $column === $count - 1 ? $rightChar : $midChar; - } - - if (null !== $title) { - $titleLength = Helper::width(Helper::removeDecoration($formatter = $this->output->getFormatter(), $formattedTitle = sprintf($titleFormat, $title))); - $markupLength = Helper::width($markup); - if ($titleLength > $limit = $markupLength - 4) { - $titleLength = $limit; - $formatLength = Helper::width(Helper::removeDecoration($formatter, sprintf($titleFormat, ''))); - $formattedTitle = sprintf($titleFormat, Helper::substr($title, 0, $limit - $formatLength - 3).'...'); - } - - $titleStart = intdiv($markupLength - $titleLength, 2); - if (false === mb_detect_encoding($markup, null, true)) { - $markup = substr_replace($markup, $formattedTitle, $titleStart, $titleLength); - } else { - $markup = mb_substr($markup, 0, $titleStart).$formattedTitle.mb_substr($markup, $titleStart + $titleLength); - } - } - - $this->output->writeln(sprintf($this->style->getBorderFormat(), $markup)); - } - - /** - * Renders vertical column separator. - */ - private function renderColumnSeparator(int $type = self::BORDER_OUTSIDE): string - { - $borders = $this->style->getBorderChars(); - - return sprintf($this->style->getBorderFormat(), self::BORDER_OUTSIDE === $type ? $borders[1] : $borders[3]); - } - - /** - * Renders table row. - * - * Example: - * - * | 9971-5-0210-0 | A Tale of Two Cities | Charles Dickens | - */ - private function renderRow(array $row, string $cellFormat, string $firstCellFormat = null) - { - $rowContent = $this->renderColumnSeparator(self::BORDER_OUTSIDE); - $columns = $this->getRowColumns($row); - $last = \count($columns) - 1; - foreach ($columns as $i => $column) { - if ($firstCellFormat && 0 === $i) { - $rowContent .= $this->renderCell($row, $column, $firstCellFormat); - } else { - $rowContent .= $this->renderCell($row, $column, $cellFormat); - } - $rowContent .= $this->renderColumnSeparator($last === $i ? self::BORDER_OUTSIDE : self::BORDER_INSIDE); - } - $this->output->writeln($rowContent); - } - - /** - * Renders table cell with padding. - */ - private function renderCell(array $row, int $column, string $cellFormat): string - { - $cell = $row[$column] ?? ''; - $width = $this->effectiveColumnWidths[$column]; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // add the width of the following columns(numbers of colspan). - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $nextColumn) { - $width += $this->getColumnSeparatorWidth() + $this->effectiveColumnWidths[$nextColumn]; - } - } - - // str_pad won't work properly with multi-byte strings, we need to fix the padding - if (false !== $encoding = mb_detect_encoding($cell, null, true)) { - $width += \strlen($cell) - mb_strwidth($cell, $encoding); - } - - $style = $this->getColumnStyle($column); - - if ($cell instanceof TableSeparator) { - return sprintf($style->getBorderFormat(), str_repeat($style->getBorderChars()[2], $width)); - } - - $width += Helper::length($cell) - Helper::length(Helper::removeDecoration($this->output->getFormatter(), $cell)); - $content = sprintf($style->getCellRowContentFormat(), $cell); - - $padType = $style->getPadType(); - if ($cell instanceof TableCell && $cell->getStyle() instanceof TableCellStyle) { - $isNotStyledByTag = !preg_match('/^<(\w+|(\w+=[\w,]+;?)*)>.+<\/(\w+|(\w+=\w+;?)*)?>$/', $cell); - if ($isNotStyledByTag) { - $cellFormat = $cell->getStyle()->getCellFormat(); - if (!\is_string($cellFormat)) { - $tag = http_build_query($cell->getStyle()->getTagOptions(), '', ';'); - $cellFormat = '<'.$tag.'>%s'; - } - - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= 3; - } - if (strstr($content, '')) { - $content = str_replace('', '', $content); - $width -= \strlen(''); - } - } - - $padType = $cell->getStyle()->getPadByAlign(); - } - - return sprintf($cellFormat, str_pad($content, $width, $style->getPaddingChar(), $padType)); - } - - /** - * Calculate number of columns for this table. - */ - private function calculateNumberOfColumns(array $rows) - { - $columns = [0]; - foreach ($rows as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - $columns[] = $this->getNumberOfColumns($row); - } - - $this->numberOfColumns = max($columns); - } - - private function buildTableRows(array $rows): TableRows - { - /** @var WrappableOutputFormatterInterface $formatter */ - $formatter = $this->output->getFormatter(); - $unmergedRows = []; - for ($rowKey = 0; $rowKey < \count($rows); ++$rowKey) { - $rows = $this->fillNextRows($rows, $rowKey); - - // Remove any new line breaks and replace it with a new line - foreach ($rows[$rowKey] as $column => $cell) { - $colspan = $cell instanceof TableCell ? $cell->getColspan() : 1; - - if (isset($this->columnMaxWidths[$column]) && Helper::width(Helper::removeDecoration($formatter, $cell)) > $this->columnMaxWidths[$column]) { - $cell = $formatter->formatAndWrap($cell, $this->columnMaxWidths[$column] * $colspan); - } - if (!strstr($cell ?? '', "\n")) { - continue; - } - $escaped = implode("\n", array_map([OutputFormatter::class, 'escapeTrailingBackslash'], explode("\n", $cell))); - $cell = $cell instanceof TableCell ? new TableCell($escaped, ['colspan' => $cell->getColspan()]) : $escaped; - $lines = explode("\n", str_replace("\n", "\n", $cell)); - foreach ($lines as $lineKey => $line) { - if ($colspan > 1) { - $line = new TableCell($line, ['colspan' => $colspan]); - } - if (0 === $lineKey) { - $rows[$rowKey][$column] = $line; - } else { - if (!\array_key_exists($rowKey, $unmergedRows) || !\array_key_exists($lineKey, $unmergedRows[$rowKey])) { - $unmergedRows[$rowKey][$lineKey] = $this->copyRow($rows, $rowKey); - } - $unmergedRows[$rowKey][$lineKey][$column] = $line; - } - } - } - } - - return new TableRows(function () use ($rows, $unmergedRows): \Traversable { - foreach ($rows as $rowKey => $row) { - $rowGroup = [$row instanceof TableSeparator ? $row : $this->fillCells($row)]; - - if (isset($unmergedRows[$rowKey])) { - foreach ($unmergedRows[$rowKey] as $row) { - $rowGroup[] = $row instanceof TableSeparator ? $row : $this->fillCells($row); - } - } - yield $rowGroup; - } - }); - } - - private function calculateRowCount(): int - { - $numberOfRows = \count(iterator_to_array($this->buildTableRows(array_merge($this->headers, [new TableSeparator()], $this->rows)))); - - if ($this->headers) { - ++$numberOfRows; // Add row for header separator - } - - if (\count($this->rows) > 0) { - ++$numberOfRows; // Add row for footer separator - } - - return $numberOfRows; - } - - /** - * fill rows that contains rowspan > 1. - * - * @throws InvalidArgumentException - */ - private function fillNextRows(array $rows, int $line): array - { - $unmergedRows = []; - foreach ($rows[$line] as $column => $cell) { - if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) { - throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', get_debug_type($cell))); - } - if ($cell instanceof TableCell && $cell->getRowspan() > 1) { - $nbLines = $cell->getRowspan() - 1; - $lines = [$cell]; - if (strstr($cell, "\n")) { - $lines = explode("\n", str_replace("\n", "\n", $cell)); - $nbLines = \count($lines) > $nbLines ? substr_count($cell, "\n") : $nbLines; - - $rows[$line][$column] = new TableCell($lines[0], ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - unset($lines[0]); - } - - // create a two dimensional array (rowspan x colspan) - $unmergedRows = array_replace_recursive(array_fill($line + 1, $nbLines, []), $unmergedRows); - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - $value = $lines[$unmergedRowKey - $line] ?? ''; - $unmergedRows[$unmergedRowKey][$column] = new TableCell($value, ['colspan' => $cell->getColspan(), 'style' => $cell->getStyle()]); - if ($nbLines === $unmergedRowKey - $line) { - break; - } - } - } - } - - foreach ($unmergedRows as $unmergedRowKey => $unmergedRow) { - // we need to know if $unmergedRow will be merged or inserted into $rows - if (isset($rows[$unmergedRowKey]) && \is_array($rows[$unmergedRowKey]) && ($this->getNumberOfColumns($rows[$unmergedRowKey]) + $this->getNumberOfColumns($unmergedRows[$unmergedRowKey]) <= $this->numberOfColumns)) { - foreach ($unmergedRow as $cellKey => $cell) { - // insert cell into row at cellKey position - array_splice($rows[$unmergedRowKey], $cellKey, 0, [$cell]); - } - } else { - $row = $this->copyRow($rows, $unmergedRowKey - 1); - foreach ($unmergedRow as $column => $cell) { - if (!empty($cell)) { - $row[$column] = $unmergedRow[$column]; - } - } - array_splice($rows, $unmergedRowKey, 0, [$row]); - } - } - - return $rows; - } - - /** - * fill cells for a row that contains colspan > 1. - */ - private function fillCells(iterable $row) - { - $newRow = []; - - foreach ($row as $column => $cell) { - $newRow[] = $cell; - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - foreach (range($column + 1, $column + $cell->getColspan() - 1) as $position) { - // insert empty value at column position - $newRow[] = ''; - } - } - } - - return $newRow ?: $row; - } - - private function copyRow(array $rows, int $line): array - { - $row = $rows[$line]; - foreach ($row as $cellKey => $cellValue) { - $row[$cellKey] = ''; - if ($cellValue instanceof TableCell) { - $row[$cellKey] = new TableCell('', ['colspan' => $cellValue->getColspan()]); - } - } - - return $row; - } - - /** - * Gets number of columns by row. - */ - private function getNumberOfColumns(array $row): int - { - $columns = \count($row); - foreach ($row as $column) { - $columns += $column instanceof TableCell ? ($column->getColspan() - 1) : 0; - } - - return $columns; - } - - /** - * Gets list of columns for the given row. - */ - private function getRowColumns(array $row): array - { - $columns = range(0, $this->numberOfColumns - 1); - foreach ($row as $cellKey => $cell) { - if ($cell instanceof TableCell && $cell->getColspan() > 1) { - // exclude grouped columns. - $columns = array_diff($columns, range($cellKey + 1, $cellKey + $cell->getColspan() - 1)); - } - } - - return $columns; - } - - /** - * Calculates columns widths. - */ - private function calculateColumnsWidth(iterable $groups) - { - for ($column = 0; $column < $this->numberOfColumns; ++$column) { - $lengths = []; - foreach ($groups as $group) { - foreach ($group as $row) { - if ($row instanceof TableSeparator) { - continue; - } - - foreach ($row as $i => $cell) { - if ($cell instanceof TableCell) { - $textContent = Helper::removeDecoration($this->output->getFormatter(), $cell); - $textLength = Helper::width($textContent); - if ($textLength > 0) { - $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan())); - foreach ($contentColumns as $position => $content) { - $row[$i + $position] = $content; - } - } - } - } - - $lengths[] = $this->getCellWidth($row, $column); - } - } - - $this->effectiveColumnWidths[$column] = max($lengths) + Helper::width($this->style->getCellRowContentFormat()) - 2; - } - } - - private function getColumnSeparatorWidth(): int - { - return Helper::width(sprintf($this->style->getBorderFormat(), $this->style->getBorderChars()[3])); - } - - private function getCellWidth(array $row, int $column): int - { - $cellWidth = 0; - - if (isset($row[$column])) { - $cell = $row[$column]; - $cellWidth = Helper::width(Helper::removeDecoration($this->output->getFormatter(), $cell)); - } - - $columnWidth = $this->columnWidths[$column] ?? 0; - $cellWidth = max($cellWidth, $columnWidth); - - return isset($this->columnMaxWidths[$column]) ? min($this->columnMaxWidths[$column], $cellWidth) : $cellWidth; - } - - /** - * Called after rendering to cleanup cache data. - */ - private function cleanup() - { - $this->effectiveColumnWidths = []; - $this->numberOfColumns = null; - } - - /** - * @return array - */ - private static function initStyles(): array - { - $borderless = new TableStyle(); - $borderless - ->setHorizontalBorderChars('=') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ; - - $compact = new TableStyle(); - $compact - ->setHorizontalBorderChars('') - ->setVerticalBorderChars('') - ->setDefaultCrossingChar('') - ->setCellRowContentFormat('%s ') - ; - - $styleGuide = new TableStyle(); - $styleGuide - ->setHorizontalBorderChars('-') - ->setVerticalBorderChars(' ') - ->setDefaultCrossingChar(' ') - ->setCellHeaderFormat('%s') - ; - - $box = (new TableStyle()) - ->setHorizontalBorderChars('─') - ->setVerticalBorderChars('│') - ->setCrossingChars('┼', '┌', '┬', '┐', '┤', '┘', '┴', '└', '├') - ; - - $boxDouble = (new TableStyle()) - ->setHorizontalBorderChars('═', '─') - ->setVerticalBorderChars('║', '│') - ->setCrossingChars('┼', '╔', '╤', '╗', '╢', '╝', '╧', '╚', '╟', '╠', '╪', '╣') - ; - - return [ - 'default' => new TableStyle(), - 'borderless' => $borderless, - 'compact' => $compact, - 'symfony-style-guide' => $styleGuide, - 'box' => $box, - 'box-double' => $boxDouble, - ]; - } - - private function resolveStyle($name): TableStyle - { - if ($name instanceof TableStyle) { - return $name; - } - - if (isset(self::$styles[$name])) { - return self::$styles[$name]; - } - - throw new InvalidArgumentException(sprintf('Style "%s" is not defined.', $name)); - } -} diff --git a/vendor/symfony/console/Helper/TableCell.php b/vendor/symfony/console/Helper/TableCell.php deleted file mode 100644 index 1a7bc6ede..000000000 --- a/vendor/symfony/console/Helper/TableCell.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Abdellatif Ait boudad - */ -class TableCell -{ - private $value; - private $options = [ - 'rowspan' => 1, - 'colspan' => 1, - 'style' => null, - ]; - - public function __construct(string $value = '', array $options = []) - { - $this->value = $value; - - // check option names - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCell does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['style']) && !$options['style'] instanceof TableCellStyle) { - throw new InvalidArgumentException('The style option must be an instance of "TableCellStyle".'); - } - - $this->options = array_merge($this->options, $options); - } - - /** - * Returns the cell value. - * - * @return string - */ - public function __toString() - { - return $this->value; - } - - /** - * Gets number of colspan. - * - * @return int - */ - public function getColspan() - { - return (int) $this->options['colspan']; - } - - /** - * Gets number of rowspan. - * - * @return int - */ - public function getRowspan() - { - return (int) $this->options['rowspan']; - } - - public function getStyle(): ?TableCellStyle - { - return $this->options['style']; - } -} diff --git a/vendor/symfony/console/Helper/TableCellStyle.php b/vendor/symfony/console/Helper/TableCellStyle.php deleted file mode 100644 index 19cd0ffc6..000000000 --- a/vendor/symfony/console/Helper/TableCellStyle.php +++ /dev/null @@ -1,89 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * @author Yewhen Khoptynskyi - */ -class TableCellStyle -{ - public const DEFAULT_ALIGN = 'left'; - - private const TAG_OPTIONS = [ - 'fg', - 'bg', - 'options', - ]; - - private const ALIGN_MAP = [ - 'left' => \STR_PAD_RIGHT, - 'center' => \STR_PAD_BOTH, - 'right' => \STR_PAD_LEFT, - ]; - - private $options = [ - 'fg' => 'default', - 'bg' => 'default', - 'options' => null, - 'align' => self::DEFAULT_ALIGN, - 'cellFormat' => null, - ]; - - public function __construct(array $options = []) - { - if ($diff = array_diff(array_keys($options), array_keys($this->options))) { - throw new InvalidArgumentException(sprintf('The TableCellStyle does not support the following options: \'%s\'.', implode('\', \'', $diff))); - } - - if (isset($options['align']) && !\array_key_exists($options['align'], self::ALIGN_MAP)) { - throw new InvalidArgumentException(sprintf('Wrong align value. Value must be following: \'%s\'.', implode('\', \'', array_keys(self::ALIGN_MAP)))); - } - - $this->options = array_merge($this->options, $options); - } - - public function getOptions(): array - { - return $this->options; - } - - /** - * Gets options we need for tag for example fg, bg. - * - * @return string[] - */ - public function getTagOptions() - { - return array_filter( - $this->getOptions(), - function ($key) { - return \in_array($key, self::TAG_OPTIONS) && isset($this->options[$key]); - }, - \ARRAY_FILTER_USE_KEY - ); - } - - /** - * @return int - */ - public function getPadByAlign() - { - return self::ALIGN_MAP[$this->getOptions()['align']]; - } - - public function getCellFormat(): ?string - { - return $this->getOptions()['cellFormat']; - } -} diff --git a/vendor/symfony/console/Helper/TableRows.php b/vendor/symfony/console/Helper/TableRows.php deleted file mode 100644 index cbc07d294..000000000 --- a/vendor/symfony/console/Helper/TableRows.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * @internal - */ -class TableRows implements \IteratorAggregate -{ - private $generator; - - public function __construct(\Closure $generator) - { - $this->generator = $generator; - } - - public function getIterator(): \Traversable - { - return ($this->generator)(); - } -} diff --git a/vendor/symfony/console/Helper/TableSeparator.php b/vendor/symfony/console/Helper/TableSeparator.php deleted file mode 100644 index e541c5315..000000000 --- a/vendor/symfony/console/Helper/TableSeparator.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -/** - * Marks a row as being a separator. - * - * @author Fabien Potencier - */ -class TableSeparator extends TableCell -{ - public function __construct(array $options = []) - { - parent::__construct('', $options); - } -} diff --git a/vendor/symfony/console/Helper/TableStyle.php b/vendor/symfony/console/Helper/TableStyle.php deleted file mode 100644 index dfc41e6a4..000000000 --- a/vendor/symfony/console/Helper/TableStyle.php +++ /dev/null @@ -1,376 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Helper; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Defines the styles for a Table. - * - * @author Fabien Potencier - * @author Саша Стаменковић - * @author Dany Maillard - */ -class TableStyle -{ - private $paddingChar = ' '; - private $horizontalOutsideBorderChar = '-'; - private $horizontalInsideBorderChar = '-'; - private $verticalOutsideBorderChar = '|'; - private $verticalInsideBorderChar = '|'; - private $crossingChar = '+'; - private $crossingTopRightChar = '+'; - private $crossingTopMidChar = '+'; - private $crossingTopLeftChar = '+'; - private $crossingMidRightChar = '+'; - private $crossingBottomRightChar = '+'; - private $crossingBottomMidChar = '+'; - private $crossingBottomLeftChar = '+'; - private $crossingMidLeftChar = '+'; - private $crossingTopLeftBottomChar = '+'; - private $crossingTopMidBottomChar = '+'; - private $crossingTopRightBottomChar = '+'; - private $headerTitleFormat = ' %s '; - private $footerTitleFormat = ' %s '; - private $cellHeaderFormat = '%s'; - private $cellRowFormat = '%s'; - private $cellRowContentFormat = ' %s '; - private $borderFormat = '%s'; - private $padType = \STR_PAD_RIGHT; - - /** - * Sets padding character, used for cell padding. - * - * @return $this - */ - public function setPaddingChar(string $paddingChar) - { - if (!$paddingChar) { - throw new LogicException('The padding char must not be empty.'); - } - - $this->paddingChar = $paddingChar; - - return $this; - } - - /** - * Gets padding character, used for cell padding. - * - * @return string - */ - public function getPaddingChar() - { - return $this->paddingChar; - } - - /** - * Sets horizontal border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * 1 ISBN 2 Title │ Author ║ - * ╠═══════════════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setHorizontalBorderChars(string $outside, string $inside = null): self - { - $this->horizontalOutsideBorderChar = $outside; - $this->horizontalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Sets vertical border characters. - * - * - * ╔═══════════════╤══════════════════════════╤══════════════════╗ - * ║ ISBN │ Title │ Author ║ - * ╠═══════1═══════╪══════════════════════════╪══════════════════╣ - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * ╟───────2───────┼──────────────────────────┼──────────────────╢ - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * ╚═══════════════╧══════════════════════════╧══════════════════╝ - * - * - * @return $this - */ - public function setVerticalBorderChars(string $outside, string $inside = null): self - { - $this->verticalOutsideBorderChar = $outside; - $this->verticalInsideBorderChar = $inside ?? $outside; - - return $this; - } - - /** - * Gets border characters. - * - * @internal - */ - public function getBorderChars(): array - { - return [ - $this->horizontalOutsideBorderChar, - $this->verticalOutsideBorderChar, - $this->horizontalInsideBorderChar, - $this->verticalInsideBorderChar, - ]; - } - - /** - * Sets crossing characters. - * - * Example: - * - * 1═══════════════2══════════════════════════2══════════════════3 - * ║ ISBN │ Title │ Author ║ - * 8'══════════════0'═════════════════════════0'═════════════════4' - * ║ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri ║ - * ║ 9971-5-0210-0 │ A Tale of Two Cities │ Charles Dickens ║ - * 8───────────────0──────────────────────────0──────────────────4 - * ║ 960-425-059-0 │ The Lord of the Rings │ J. R. R. Tolkien ║ - * ║ 80-902734-1-6 │ And Then There Were None │ Agatha Christie ║ - * 7═══════════════6══════════════════════════6══════════════════5 - * - * - * @param string $cross Crossing char (see #0 of example) - * @param string $topLeft Top left char (see #1 of example) - * @param string $topMid Top mid char (see #2 of example) - * @param string $topRight Top right char (see #3 of example) - * @param string $midRight Mid right char (see #4 of example) - * @param string $bottomRight Bottom right char (see #5 of example) - * @param string $bottomMid Bottom mid char (see #6 of example) - * @param string $bottomLeft Bottom left char (see #7 of example) - * @param string $midLeft Mid left char (see #8 of example) - * @param string|null $topLeftBottom Top left bottom char (see #8' of example), equals to $midLeft if null - * @param string|null $topMidBottom Top mid bottom char (see #0' of example), equals to $cross if null - * @param string|null $topRightBottom Top right bottom char (see #4' of example), equals to $midRight if null - * - * @return $this - */ - public function setCrossingChars(string $cross, string $topLeft, string $topMid, string $topRight, string $midRight, string $bottomRight, string $bottomMid, string $bottomLeft, string $midLeft, string $topLeftBottom = null, string $topMidBottom = null, string $topRightBottom = null): self - { - $this->crossingChar = $cross; - $this->crossingTopLeftChar = $topLeft; - $this->crossingTopMidChar = $topMid; - $this->crossingTopRightChar = $topRight; - $this->crossingMidRightChar = $midRight; - $this->crossingBottomRightChar = $bottomRight; - $this->crossingBottomMidChar = $bottomMid; - $this->crossingBottomLeftChar = $bottomLeft; - $this->crossingMidLeftChar = $midLeft; - $this->crossingTopLeftBottomChar = $topLeftBottom ?? $midLeft; - $this->crossingTopMidBottomChar = $topMidBottom ?? $cross; - $this->crossingTopRightBottomChar = $topRightBottom ?? $midRight; - - return $this; - } - - /** - * Sets default crossing character used for each cross. - * - * @see {@link setCrossingChars()} for setting each crossing individually. - */ - public function setDefaultCrossingChar(string $char): self - { - return $this->setCrossingChars($char, $char, $char, $char, $char, $char, $char, $char, $char); - } - - /** - * Gets crossing character. - * - * @return string - */ - public function getCrossingChar() - { - return $this->crossingChar; - } - - /** - * Gets crossing characters. - * - * @internal - */ - public function getCrossingChars(): array - { - return [ - $this->crossingChar, - $this->crossingTopLeftChar, - $this->crossingTopMidChar, - $this->crossingTopRightChar, - $this->crossingMidRightChar, - $this->crossingBottomRightChar, - $this->crossingBottomMidChar, - $this->crossingBottomLeftChar, - $this->crossingMidLeftChar, - $this->crossingTopLeftBottomChar, - $this->crossingTopMidBottomChar, - $this->crossingTopRightBottomChar, - ]; - } - - /** - * Sets header cell format. - * - * @return $this - */ - public function setCellHeaderFormat(string $cellHeaderFormat) - { - $this->cellHeaderFormat = $cellHeaderFormat; - - return $this; - } - - /** - * Gets header cell format. - * - * @return string - */ - public function getCellHeaderFormat() - { - return $this->cellHeaderFormat; - } - - /** - * Sets row cell format. - * - * @return $this - */ - public function setCellRowFormat(string $cellRowFormat) - { - $this->cellRowFormat = $cellRowFormat; - - return $this; - } - - /** - * Gets row cell format. - * - * @return string - */ - public function getCellRowFormat() - { - return $this->cellRowFormat; - } - - /** - * Sets row cell content format. - * - * @return $this - */ - public function setCellRowContentFormat(string $cellRowContentFormat) - { - $this->cellRowContentFormat = $cellRowContentFormat; - - return $this; - } - - /** - * Gets row cell content format. - * - * @return string - */ - public function getCellRowContentFormat() - { - return $this->cellRowContentFormat; - } - - /** - * Sets table border format. - * - * @return $this - */ - public function setBorderFormat(string $borderFormat) - { - $this->borderFormat = $borderFormat; - - return $this; - } - - /** - * Gets table border format. - * - * @return string - */ - public function getBorderFormat() - { - return $this->borderFormat; - } - - /** - * Sets cell padding type. - * - * @return $this - */ - public function setPadType(int $padType) - { - if (!\in_array($padType, [\STR_PAD_LEFT, \STR_PAD_RIGHT, \STR_PAD_BOTH], true)) { - throw new InvalidArgumentException('Invalid padding type. Expected one of (STR_PAD_LEFT, STR_PAD_RIGHT, STR_PAD_BOTH).'); - } - - $this->padType = $padType; - - return $this; - } - - /** - * Gets cell padding type. - * - * @return int - */ - public function getPadType() - { - return $this->padType; - } - - public function getHeaderTitleFormat(): string - { - return $this->headerTitleFormat; - } - - /** - * @return $this - */ - public function setHeaderTitleFormat(string $format): self - { - $this->headerTitleFormat = $format; - - return $this; - } - - public function getFooterTitleFormat(): string - { - return $this->footerTitleFormat; - } - - /** - * @return $this - */ - public function setFooterTitleFormat(string $format): self - { - $this->footerTitleFormat = $format; - - return $this; - } -} diff --git a/vendor/symfony/console/Input/ArgvInput.php b/vendor/symfony/console/Input/ArgvInput.php deleted file mode 100644 index 675b9ef58..000000000 --- a/vendor/symfony/console/Input/ArgvInput.php +++ /dev/null @@ -1,378 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * ArgvInput represents an input coming from the CLI arguments. - * - * Usage: - * - * $input = new ArgvInput(); - * - * By default, the `$_SERVER['argv']` array is used for the input values. - * - * This can be overridden by explicitly passing the input values in the constructor: - * - * $input = new ArgvInput($_SERVER['argv']); - * - * If you pass it yourself, don't forget that the first element of the array - * is the name of the running application. - * - * When passing an argument to the constructor, be sure that it respects - * the same rules as the argv one. It's almost always better to use the - * `StringInput` when you want to provide your own input. - * - * @author Fabien Potencier - * - * @see http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html - * @see http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html#tag_12_02 - */ -class ArgvInput extends Input -{ - private $tokens; - private $parsed; - - public function __construct(array $argv = null, InputDefinition $definition = null) - { - $argv = $argv ?? $_SERVER['argv'] ?? []; - - // strip the application name - array_shift($argv); - - $this->tokens = $argv; - - parent::__construct($definition); - } - - protected function setTokens(array $tokens) - { - $this->tokens = $tokens; - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - $parseOptions = true; - $this->parsed = $this->tokens; - while (null !== $token = array_shift($this->parsed)) { - $parseOptions = $this->parseToken($token, $parseOptions); - } - } - - protected function parseToken(string $token, bool $parseOptions): bool - { - if ($parseOptions && '' == $token) { - $this->parseArgument($token); - } elseif ($parseOptions && '--' == $token) { - return false; - } elseif ($parseOptions && str_starts_with($token, '--')) { - $this->parseLongOption($token); - } elseif ($parseOptions && '-' === $token[0] && '-' !== $token) { - $this->parseShortOption($token); - } else { - $this->parseArgument($token); - } - - return $parseOptions; - } - - /** - * Parses a short option. - */ - private function parseShortOption(string $token) - { - $name = substr($token, 1); - - if (\strlen($name) > 1) { - if ($this->definition->hasShortcut($name[0]) && $this->definition->getOptionForShortcut($name[0])->acceptValue()) { - // an option with a value (with no space) - $this->addShortOption($name[0], substr($name, 1)); - } else { - $this->parseShortOptionSet($name); - } - } else { - $this->addShortOption($name, null); - } - } - - /** - * Parses a short option set. - * - * @throws RuntimeException When option given doesn't exist - */ - private function parseShortOptionSet(string $name) - { - $len = \strlen($name); - for ($i = 0; $i < $len; ++$i) { - if (!$this->definition->hasShortcut($name[$i])) { - $encoding = mb_detect_encoding($name, null, true); - throw new RuntimeException(sprintf('The "-%s" option does not exist.', false === $encoding ? $name[$i] : mb_substr($name, $i, 1, $encoding))); - } - - $option = $this->definition->getOptionForShortcut($name[$i]); - if ($option->acceptValue()) { - $this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1)); - - break; - } else { - $this->addLongOption($option->getName(), null); - } - } - } - - /** - * Parses a long option. - */ - private function parseLongOption(string $token) - { - $name = substr($token, 2); - - if (false !== $pos = strpos($name, '=')) { - if ('' === $value = substr($name, $pos + 1)) { - array_unshift($this->parsed, $value); - } - $this->addLongOption(substr($name, 0, $pos), $value); - } else { - $this->addLongOption($name, null); - } - } - - /** - * Parses an argument. - * - * @throws RuntimeException When too many arguments are given - */ - private function parseArgument(string $token) - { - $c = \count($this->arguments); - - // if input is expecting another argument, add it - if ($this->definition->hasArgument($c)) { - $arg = $this->definition->getArgument($c); - $this->arguments[$arg->getName()] = $arg->isArray() ? [$token] : $token; - - // if last argument isArray(), append token to last argument - } elseif ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { - $arg = $this->definition->getArgument($c - 1); - $this->arguments[$arg->getName()][] = $token; - - // unexpected argument - } else { - $all = $this->definition->getArguments(); - $symfonyCommandName = null; - if (($inputArgument = $all[$key = array_key_first($all)] ?? null) && 'command' === $inputArgument->getName()) { - $symfonyCommandName = $this->arguments['command'] ?? null; - unset($all[$key]); - } - - if (\count($all)) { - if ($symfonyCommandName) { - $message = sprintf('Too many arguments to "%s" command, expected arguments "%s".', $symfonyCommandName, implode('" "', array_keys($all))); - } else { - $message = sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))); - } - } elseif ($symfonyCommandName) { - $message = sprintf('No arguments expected for "%s" command, got "%s".', $symfonyCommandName, $token); - } else { - $message = sprintf('No arguments expected, got "%s".', $token); - } - - throw new RuntimeException($message); - } - } - - /** - * Adds a short option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new RuntimeException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws RuntimeException When option given doesn't exist - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new RuntimeException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - if (null !== $value) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null !== $value && !$option->acceptValue()) { - throw new RuntimeException(sprintf('The "--%s" option does not accept a value.', $name)); - } - - if (\in_array($value, ['', null], true) && $option->acceptValue() && \count($this->parsed)) { - // if option accepts an optional or mandatory argument - // let's see if there is one provided - $next = array_shift($this->parsed); - if ((isset($next[0]) && '-' !== $next[0]) || \in_array($next, ['', null], true)) { - $value = $next; - } else { - array_unshift($this->parsed, $next); - } - } - - if (null === $value) { - if ($option->isValueRequired()) { - throw new RuntimeException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isArray() && !$option->isValueOptional()) { - $value = true; - } - } - - if ($option->isArray()) { - $this->options[$name][] = $value; - } else { - $this->options[$name] = $value; - } - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - $isOption = false; - foreach ($this->tokens as $i => $token) { - if ($token && '-' === $token[0]) { - if (str_contains($token, '=') || !isset($this->tokens[$i + 1])) { - continue; - } - - // If it's a long option, consider that everything after "--" is the option name. - // Otherwise, use the last char (if it's a short option set, only the last one can take a value with space separator) - $name = '-' === $token[1] ? substr($token, 2) : substr($token, -1); - if (!isset($this->options[$name]) && !$this->definition->hasShortcut($name)) { - // noop - } elseif ((isset($this->options[$name]) || isset($this->options[$name = $this->definition->shortcutToName($name)])) && $this->tokens[$i + 1] === $this->options[$name]) { - $isOption = true; - } - - continue; - } - - if ($isOption) { - $isOption = false; - continue; - } - - return $token; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->tokens as $token) { - if ($onlyParams && '--' === $token) { - return false; - } - foreach ($values as $value) { - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ($token === $value || '' !== $leading && str_starts_with($token, $leading)) { - return true; - } - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) - { - $values = (array) $values; - $tokens = $this->tokens; - - while (0 < \count($tokens)) { - $token = array_shift($tokens); - if ($onlyParams && '--' === $token) { - return $default; - } - - foreach ($values as $value) { - if ($token === $value) { - return array_shift($tokens); - } - // Options with values: - // For long options, test for '--option=' at beginning - // For short options, test for '-o' at beginning - $leading = str_starts_with($value, '--') ? $value.'=' : $value; - if ('' !== $leading && str_starts_with($token, $leading)) { - return substr($token, \strlen($leading)); - } - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $tokens = array_map(function ($token) { - if (preg_match('{^(-[^=]+=)(.+)}', $token, $match)) { - return $match[1].$this->escapeToken($match[2]); - } - - if ($token && '-' !== $token[0]) { - return $this->escapeToken($token); - } - - return $token; - }, $this->tokens); - - return implode(' ', $tokens); - } -} diff --git a/vendor/symfony/console/Input/ArrayInput.php b/vendor/symfony/console/Input/ArrayInput.php deleted file mode 100644 index c65161484..000000000 --- a/vendor/symfony/console/Input/ArrayInput.php +++ /dev/null @@ -1,210 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\InvalidOptionException; - -/** - * ArrayInput represents an input provided as an array. - * - * Usage: - * - * $input = new ArrayInput(['command' => 'foo:bar', 'foo' => 'bar', '--bar' => 'foobar']); - * - * @author Fabien Potencier - */ -class ArrayInput extends Input -{ - private $parameters; - - public function __construct(array $parameters, InputDefinition $definition = null) - { - $this->parameters = $parameters; - - parent::__construct($definition); - } - - /** - * {@inheritdoc} - */ - public function getFirstArgument() - { - foreach ($this->parameters as $param => $value) { - if ($param && \is_string($param) && '-' === $param[0]) { - continue; - } - - return $value; - } - - return null; - } - - /** - * {@inheritdoc} - */ - public function hasParameterOption($values, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if (!\is_int($k)) { - $v = $k; - } - - if ($onlyParams && '--' === $v) { - return false; - } - - if (\in_array($v, $values)) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false) - { - $values = (array) $values; - - foreach ($this->parameters as $k => $v) { - if ($onlyParams && ('--' === $k || (\is_int($k) && '--' === $v))) { - return $default; - } - - if (\is_int($k)) { - if (\in_array($v, $values)) { - return true; - } - } elseif (\in_array($k, $values)) { - return $v; - } - } - - return $default; - } - - /** - * Returns a stringified representation of the args passed to the command. - * - * @return string - */ - public function __toString() - { - $params = []; - foreach ($this->parameters as $param => $val) { - if ($param && \is_string($param) && '-' === $param[0]) { - $glue = ('-' === $param[1]) ? '=' : ' '; - if (\is_array($val)) { - foreach ($val as $v) { - $params[] = $param.('' != $v ? $glue.$this->escapeToken($v) : ''); - } - } else { - $params[] = $param.('' != $val ? $glue.$this->escapeToken($val) : ''); - } - } else { - $params[] = \is_array($val) ? implode(' ', array_map([$this, 'escapeToken'], $val)) : $this->escapeToken($val); - } - } - - return implode(' ', $params); - } - - /** - * {@inheritdoc} - */ - protected function parse() - { - foreach ($this->parameters as $key => $value) { - if ('--' === $key) { - return; - } - if (str_starts_with($key, '--')) { - $this->addLongOption(substr($key, 2), $value); - } elseif (str_starts_with($key, '-')) { - $this->addShortOption(substr($key, 1), $value); - } else { - $this->addArgument($key, $value); - } - } - } - - /** - * Adds a short option value. - * - * @throws InvalidOptionException When option given doesn't exist - */ - private function addShortOption(string $shortcut, $value) - { - if (!$this->definition->hasShortcut($shortcut)) { - throw new InvalidOptionException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - $this->addLongOption($this->definition->getOptionForShortcut($shortcut)->getName(), $value); - } - - /** - * Adds a long option value. - * - * @throws InvalidOptionException When option given doesn't exist - * @throws InvalidOptionException When a required value is missing - */ - private function addLongOption(string $name, $value) - { - if (!$this->definition->hasOption($name)) { - if (!$this->definition->hasNegation($name)) { - throw new InvalidOptionException(sprintf('The "--%s" option does not exist.', $name)); - } - - $optionName = $this->definition->negationToName($name); - $this->options[$optionName] = false; - - return; - } - - $option = $this->definition->getOption($name); - - if (null === $value) { - if ($option->isValueRequired()) { - throw new InvalidOptionException(sprintf('The "--%s" option requires a value.', $name)); - } - - if (!$option->isValueOptional()) { - $value = true; - } - } - - $this->options[$name] = $value; - } - - /** - * Adds an argument value. - * - * @param string|int $name The argument name - * @param mixed $value The value for the argument - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - private function addArgument($name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } -} diff --git a/vendor/symfony/console/Input/Input.php b/vendor/symfony/console/Input/Input.php deleted file mode 100644 index d37460ed3..000000000 --- a/vendor/symfony/console/Input/Input.php +++ /dev/null @@ -1,213 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * Input is the base class for all concrete Input classes. - * - * Three concrete classes are provided by default: - * - * * `ArgvInput`: The input comes from the CLI arguments (argv) - * * `StringInput`: The input is provided as a string - * * `ArrayInput`: The input is provided as an array - * - * @author Fabien Potencier - */ -abstract class Input implements InputInterface, StreamableInputInterface -{ - protected $definition; - protected $stream; - protected $options = []; - protected $arguments = []; - protected $interactive = true; - - public function __construct(InputDefinition $definition = null) - { - if (null === $definition) { - $this->definition = new InputDefinition(); - } else { - $this->bind($definition); - $this->validate(); - } - } - - /** - * {@inheritdoc} - */ - public function bind(InputDefinition $definition) - { - $this->arguments = []; - $this->options = []; - $this->definition = $definition; - - $this->parse(); - } - - /** - * Processes command line arguments. - */ - abstract protected function parse(); - - /** - * {@inheritdoc} - */ - public function validate() - { - $definition = $this->definition; - $givenArguments = $this->arguments; - - $missingArguments = array_filter(array_keys($definition->getArguments()), function ($argument) use ($definition, $givenArguments) { - return !\array_key_exists($argument, $givenArguments) && $definition->getArgument($argument)->isRequired(); - }); - - if (\count($missingArguments) > 0) { - throw new RuntimeException(sprintf('Not enough arguments (missing: "%s").', implode(', ', $missingArguments))); - } - } - - /** - * {@inheritdoc} - */ - public function isInteractive() - { - return $this->interactive; - } - - /** - * {@inheritdoc} - */ - public function setInteractive(bool $interactive) - { - $this->interactive = $interactive; - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return array_merge($this->definition->getArgumentDefaults(), $this->arguments); - } - - /** - * {@inheritdoc} - */ - public function getArgument(string $name) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - return $this->arguments[$name] ?? $this->definition->getArgument($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setArgument(string $name, $value) - { - if (!$this->definition->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $this->arguments[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasArgument(string $name) - { - return $this->definition->hasArgument($name); - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return array_merge($this->definition->getOptionDefaults(), $this->options); - } - - /** - * {@inheritdoc} - */ - public function getOption(string $name) - { - if ($this->definition->hasNegation($name)) { - if (null === $value = $this->getOption($this->definition->negationToName($name))) { - return $value; - } - - return !$value; - } - - if (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - return \array_key_exists($name, $this->options) ? $this->options[$name] : $this->definition->getOption($name)->getDefault(); - } - - /** - * {@inheritdoc} - */ - public function setOption(string $name, $value) - { - if ($this->definition->hasNegation($name)) { - $this->options[$this->definition->negationToName($name)] = !$value; - - return; - } elseif (!$this->definition->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "%s" option does not exist.', $name)); - } - - $this->options[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function hasOption(string $name) - { - return $this->definition->hasOption($name) || $this->definition->hasNegation($name); - } - - /** - * Escapes a token through escapeshellarg if it contains unsafe chars. - * - * @return string - */ - public function escapeToken(string $token) - { - return preg_match('{^[\w-]+$}', $token) ? $token : escapeshellarg($token); - } - - /** - * {@inheritdoc} - */ - public function setStream($stream) - { - $this->stream = $stream; - } - - /** - * {@inheritdoc} - */ - public function getStream() - { - return $this->stream; - } -} diff --git a/vendor/symfony/console/Input/InputArgument.php b/vendor/symfony/console/Input/InputArgument.php deleted file mode 100644 index 8a64f7ac8..000000000 --- a/vendor/symfony/console/Input/InputArgument.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line argument. - * - * @author Fabien Potencier - */ -class InputArgument -{ - public const REQUIRED = 1; - public const OPTIONAL = 2; - public const IS_ARRAY = 4; - - private $name; - private $mode; - private $default; - private $description; - - /** - * @param string $name The argument name - * @param int|null $mode The argument mode: a bit mask of self::REQUIRED, self::OPTIONAL and self::IS_ARRAY - * @param string $description A description text - * @param string|bool|int|float|array|null $default The default value (for self::OPTIONAL mode only) - * - * @throws InvalidArgumentException When argument mode is not valid - */ - public function __construct(string $name, int $mode = null, string $description = '', $default = null) - { - if (null === $mode) { - $mode = self::OPTIONAL; - } elseif ($mode > 7 || $mode < 1) { - throw new InvalidArgumentException(sprintf('Argument mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->mode = $mode; - $this->description = $description; - - $this->setDefault($default); - } - - /** - * Returns the argument name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the argument is required. - * - * @return bool true if parameter mode is self::REQUIRED, false otherwise - */ - public function isRequired() - { - return self::REQUIRED === (self::REQUIRED & $this->mode); - } - - /** - * Returns true if the argument can take multiple values. - * - * @return bool true if mode is self::IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::IS_ARRAY === (self::IS_ARRAY & $this->mode); - } - - /** - * Sets the default value. - * - * @param string|bool|int|float|array|null $default - * - * @throws LogicException When incorrect default value is given - */ - public function setDefault($default = null) - { - if ($this->isRequired() && null !== $default) { - throw new LogicException('Cannot set a default value except for InputArgument::OPTIONAL mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array argument must be an array.'); - } - } - - $this->default = $default; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } -} diff --git a/vendor/symfony/console/Input/InputAwareInterface.php b/vendor/symfony/console/Input/InputAwareInterface.php deleted file mode 100644 index 5a288de5d..000000000 --- a/vendor/symfony/console/Input/InputAwareInterface.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * InputAwareInterface should be implemented by classes that depends on the - * Console Input. - * - * @author Wouter J - */ -interface InputAwareInterface -{ - /** - * Sets the Console Input. - */ - public function setInput(InputInterface $input); -} diff --git a/vendor/symfony/console/Input/InputDefinition.php b/vendor/symfony/console/Input/InputDefinition.php deleted file mode 100644 index 11f704f0e..000000000 --- a/vendor/symfony/console/Input/InputDefinition.php +++ /dev/null @@ -1,424 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * A InputDefinition represents a set of valid command line arguments and options. - * - * Usage: - * - * $definition = new InputDefinition([ - * new InputArgument('name', InputArgument::REQUIRED), - * new InputOption('foo', 'f', InputOption::VALUE_REQUIRED), - * ]); - * - * @author Fabien Potencier - */ -class InputDefinition -{ - private $arguments; - private $requiredCount; - private $lastArrayArgument; - private $lastOptionalArgument; - private $options; - private $negations; - private $shortcuts; - - /** - * @param array $definition An array of InputArgument and InputOption instance - */ - public function __construct(array $definition = []) - { - $this->setDefinition($definition); - } - - /** - * Sets the definition of the input. - */ - public function setDefinition(array $definition) - { - $arguments = []; - $options = []; - foreach ($definition as $item) { - if ($item instanceof InputOption) { - $options[] = $item; - } else { - $arguments[] = $item; - } - } - - $this->setArguments($arguments); - $this->setOptions($options); - } - - /** - * Sets the InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function setArguments(array $arguments = []) - { - $this->arguments = []; - $this->requiredCount = 0; - $this->lastOptionalArgument = null; - $this->lastArrayArgument = null; - $this->addArguments($arguments); - } - - /** - * Adds an array of InputArgument objects. - * - * @param InputArgument[] $arguments An array of InputArgument objects - */ - public function addArguments(?array $arguments = []) - { - if (null !== $arguments) { - foreach ($arguments as $argument) { - $this->addArgument($argument); - } - } - } - - /** - * @throws LogicException When incorrect argument is given - */ - public function addArgument(InputArgument $argument) - { - if (isset($this->arguments[$argument->getName()])) { - throw new LogicException(sprintf('An argument with name "%s" already exists.', $argument->getName())); - } - - if (null !== $this->lastArrayArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an array argument "%s".', $argument->getName(), $this->lastArrayArgument->getName())); - } - - if ($argument->isRequired() && null !== $this->lastOptionalArgument) { - throw new LogicException(sprintf('Cannot add a required argument "%s" after an optional one "%s".', $argument->getName(), $this->lastOptionalArgument->getName())); - } - - if ($argument->isArray()) { - $this->lastArrayArgument = $argument; - } - - if ($argument->isRequired()) { - ++$this->requiredCount; - } else { - $this->lastOptionalArgument = $argument; - } - - $this->arguments[$argument->getName()] = $argument; - } - - /** - * Returns an InputArgument by name or by position. - * - * @param string|int $name The InputArgument name or position - * - * @return InputArgument - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument($name) - { - if (!$this->hasArgument($name)) { - throw new InvalidArgumentException(sprintf('The "%s" argument does not exist.', $name)); - } - - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return $arguments[$name]; - } - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @param string|int $name The InputArgument name or position - * - * @return bool - */ - public function hasArgument($name) - { - $arguments = \is_int($name) ? array_values($this->arguments) : $this->arguments; - - return isset($arguments[$name]); - } - - /** - * Gets the array of InputArgument objects. - * - * @return InputArgument[] - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * Returns the number of InputArguments. - * - * @return int - */ - public function getArgumentCount() - { - return null !== $this->lastArrayArgument ? \PHP_INT_MAX : \count($this->arguments); - } - - /** - * Returns the number of required InputArguments. - * - * @return int - */ - public function getArgumentRequiredCount() - { - return $this->requiredCount; - } - - /** - * @return array - */ - public function getArgumentDefaults() - { - $values = []; - foreach ($this->arguments as $argument) { - $values[$argument->getName()] = $argument->getDefault(); - } - - return $values; - } - - /** - * Sets the InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function setOptions(array $options = []) - { - $this->options = []; - $this->shortcuts = []; - $this->negations = []; - $this->addOptions($options); - } - - /** - * Adds an array of InputOption objects. - * - * @param InputOption[] $options An array of InputOption objects - */ - public function addOptions(array $options = []) - { - foreach ($options as $option) { - $this->addOption($option); - } - } - - /** - * @throws LogicException When option given already exist - */ - public function addOption(InputOption $option) - { - if (isset($this->options[$option->getName()]) && !$option->equals($this->options[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - if (isset($this->negations[$option->getName()])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $option->getName())); - } - - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - if (isset($this->shortcuts[$shortcut]) && !$option->equals($this->options[$this->shortcuts[$shortcut]])) { - throw new LogicException(sprintf('An option with shortcut "%s" already exists.', $shortcut)); - } - } - } - - $this->options[$option->getName()] = $option; - if ($option->getShortcut()) { - foreach (explode('|', $option->getShortcut()) as $shortcut) { - $this->shortcuts[$shortcut] = $option->getName(); - } - } - - if ($option->isNegatable()) { - $negatedName = 'no-'.$option->getName(); - if (isset($this->options[$negatedName])) { - throw new LogicException(sprintf('An option named "%s" already exists.', $negatedName)); - } - $this->negations[$negatedName] = $option->getName(); - } - } - - /** - * Returns an InputOption by name. - * - * @return InputOption - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name) - { - if (!$this->hasOption($name)) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name)); - } - - return $this->options[$name]; - } - - /** - * Returns true if an InputOption object exists by name. - * - * This method can't be used to check if the user included the option when - * executing the command (use getOption() instead). - * - * @return bool - */ - public function hasOption(string $name) - { - return isset($this->options[$name]); - } - - /** - * Gets the array of InputOption objects. - * - * @return InputOption[] - */ - public function getOptions() - { - return $this->options; - } - - /** - * Returns true if an InputOption object exists by shortcut. - * - * @return bool - */ - public function hasShortcut(string $name) - { - return isset($this->shortcuts[$name]); - } - - /** - * Returns true if an InputOption object exists by negated name. - */ - public function hasNegation(string $name): bool - { - return isset($this->negations[$name]); - } - - /** - * Gets an InputOption by shortcut. - * - * @return InputOption - */ - public function getOptionForShortcut(string $shortcut) - { - return $this->getOption($this->shortcutToName($shortcut)); - } - - /** - * @return array - */ - public function getOptionDefaults() - { - $values = []; - foreach ($this->options as $option) { - $values[$option->getName()] = $option->getDefault(); - } - - return $values; - } - - /** - * Returns the InputOption name given a shortcut. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function shortcutToName(string $shortcut): string - { - if (!isset($this->shortcuts[$shortcut])) { - throw new InvalidArgumentException(sprintf('The "-%s" option does not exist.', $shortcut)); - } - - return $this->shortcuts[$shortcut]; - } - - /** - * Returns the InputOption name given a negation. - * - * @throws InvalidArgumentException When option given does not exist - * - * @internal - */ - public function negationToName(string $negation): string - { - if (!isset($this->negations[$negation])) { - throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $negation)); - } - - return $this->negations[$negation]; - } - - /** - * Gets the synopsis. - * - * @return string - */ - public function getSynopsis(bool $short = false) - { - $elements = []; - - if ($short && $this->getOptions()) { - $elements[] = '[options]'; - } elseif (!$short) { - foreach ($this->getOptions() as $option) { - $value = ''; - if ($option->acceptValue()) { - $value = sprintf( - ' %s%s%s', - $option->isValueOptional() ? '[' : '', - strtoupper($option->getName()), - $option->isValueOptional() ? ']' : '' - ); - } - - $shortcut = $option->getShortcut() ? sprintf('-%s|', $option->getShortcut()) : ''; - $negation = $option->isNegatable() ? sprintf('|--no-%s', $option->getName()) : ''; - $elements[] = sprintf('[%s--%s%s%s]', $shortcut, $option->getName(), $value, $negation); - } - } - - if (\count($elements) && $this->getArguments()) { - $elements[] = '[--]'; - } - - $tail = ''; - foreach ($this->getArguments() as $argument) { - $element = '<'.$argument->getName().'>'; - if ($argument->isArray()) { - $element .= '...'; - } - - if (!$argument->isRequired()) { - $element = '['.$element; - $tail .= ']'; - } - - $elements[] = $element; - } - - return implode(' ', $elements).$tail; - } -} diff --git a/vendor/symfony/console/Input/InputInterface.php b/vendor/symfony/console/Input/InputInterface.php deleted file mode 100644 index 628b6037a..000000000 --- a/vendor/symfony/console/Input/InputInterface.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; - -/** - * InputInterface is the interface implemented by all input classes. - * - * @author Fabien Potencier - */ -interface InputInterface -{ - /** - * Returns the first argument from the raw parameters (not parsed). - * - * @return string|null - */ - public function getFirstArgument(); - - /** - * Returns true if the raw parameters (not parsed) contain a value. - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The values to look for in the raw parameters (can be an array) - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return bool - */ - public function hasParameterOption($values, bool $onlyParams = false); - - /** - * Returns the value of a raw option (not parsed). - * - * This method is to be used to introspect the input parameters - * before they have been validated. It must be used carefully. - * Does not necessarily return the correct result for short options - * when multiple flags are combined in the same option. - * - * @param string|array $values The value(s) to look for in the raw parameters (can be an array) - * @param string|bool|int|float|array|null $default The default value to return if no result is found - * @param bool $onlyParams Only check real parameters, skip those following an end of options (--) signal - * - * @return mixed - */ - public function getParameterOption($values, $default = false, bool $onlyParams = false); - - /** - * Binds the current Input instance with the given arguments and options. - * - * @throws RuntimeException - */ - public function bind(InputDefinition $definition); - - /** - * Validates the input. - * - * @throws RuntimeException When not enough arguments are given - */ - public function validate(); - - /** - * Returns all the given arguments merged with the default values. - * - * @return array - */ - public function getArguments(); - - /** - * Returns the argument value for a given argument name. - * - * @return mixed - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function getArgument(string $name); - - /** - * Sets an argument value by name. - * - * @param mixed $value The argument value - * - * @throws InvalidArgumentException When argument given doesn't exist - */ - public function setArgument(string $name, $value); - - /** - * Returns true if an InputArgument object exists by name or position. - * - * @return bool - */ - public function hasArgument(string $name); - - /** - * Returns all the given options merged with the default values. - * - * @return array - */ - public function getOptions(); - - /** - * Returns the option value for a given option name. - * - * @return mixed - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function getOption(string $name); - - /** - * Sets an option value by name. - * - * @param mixed $value The option value - * - * @throws InvalidArgumentException When option given doesn't exist - */ - public function setOption(string $name, $value); - - /** - * Returns true if an InputOption object exists by name. - * - * @return bool - */ - public function hasOption(string $name); - - /** - * Is this input means interactive? - * - * @return bool - */ - public function isInteractive(); - - /** - * Sets the input interactivity. - */ - public function setInteractive(bool $interactive); -} diff --git a/vendor/symfony/console/Input/InputOption.php b/vendor/symfony/console/Input/InputOption.php deleted file mode 100644 index 2bec34fe1..000000000 --- a/vendor/symfony/console/Input/InputOption.php +++ /dev/null @@ -1,231 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a command line option. - * - * @author Fabien Potencier - */ -class InputOption -{ - /** - * Do not accept input for the option (e.g. --yell). This is the default behavior of options. - */ - public const VALUE_NONE = 1; - - /** - * A value must be passed when the option is used (e.g. --iterations=5 or -i5). - */ - public const VALUE_REQUIRED = 2; - - /** - * The option may or may not have a value (e.g. --yell or --yell=loud). - */ - public const VALUE_OPTIONAL = 4; - - /** - * The option accepts multiple values (e.g. --dir=/foo --dir=/bar). - */ - public const VALUE_IS_ARRAY = 8; - - /** - * The option may have either positive or negative value (e.g. --ansi or --no-ansi). - */ - public const VALUE_NEGATABLE = 16; - - private $name; - private $shortcut; - private $mode; - private $default; - private $description; - - /** - * @param string|array|null $shortcut The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts - * @param int|null $mode The option mode: One of the VALUE_* constants - * @param string|bool|int|float|array|null $default The default value (must be null for self::VALUE_NONE) - * - * @throws InvalidArgumentException If option mode is invalid or incompatible - */ - public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null) - { - if (str_starts_with($name, '--')) { - $name = substr($name, 2); - } - - if (empty($name)) { - throw new InvalidArgumentException('An option name cannot be empty.'); - } - - if (empty($shortcut)) { - $shortcut = null; - } - - if (null !== $shortcut) { - if (\is_array($shortcut)) { - $shortcut = implode('|', $shortcut); - } - $shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-')); - $shortcuts = array_filter($shortcuts); - $shortcut = implode('|', $shortcuts); - - if (empty($shortcut)) { - throw new InvalidArgumentException('An option shortcut cannot be empty.'); - } - } - - if (null === $mode) { - $mode = self::VALUE_NONE; - } elseif ($mode >= (self::VALUE_NEGATABLE << 1) || $mode < 1) { - throw new InvalidArgumentException(sprintf('Option mode "%s" is not valid.', $mode)); - } - - $this->name = $name; - $this->shortcut = $shortcut; - $this->mode = $mode; - $this->description = $description; - - if ($this->isArray() && !$this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_IS_ARRAY if the option does not accept a value.'); - } - if ($this->isNegatable() && $this->acceptValue()) { - throw new InvalidArgumentException('Impossible to have an option mode VALUE_NEGATABLE if the option also accepts a value.'); - } - - $this->setDefault($default); - } - - /** - * Returns the option shortcut. - * - * @return string|null - */ - public function getShortcut() - { - return $this->shortcut; - } - - /** - * Returns the option name. - * - * @return string - */ - public function getName() - { - return $this->name; - } - - /** - * Returns true if the option accepts a value. - * - * @return bool true if value mode is not self::VALUE_NONE, false otherwise - */ - public function acceptValue() - { - return $this->isValueRequired() || $this->isValueOptional(); - } - - /** - * Returns true if the option requires a value. - * - * @return bool true if value mode is self::VALUE_REQUIRED, false otherwise - */ - public function isValueRequired() - { - return self::VALUE_REQUIRED === (self::VALUE_REQUIRED & $this->mode); - } - - /** - * Returns true if the option takes an optional value. - * - * @return bool true if value mode is self::VALUE_OPTIONAL, false otherwise - */ - public function isValueOptional() - { - return self::VALUE_OPTIONAL === (self::VALUE_OPTIONAL & $this->mode); - } - - /** - * Returns true if the option can take multiple values. - * - * @return bool true if mode is self::VALUE_IS_ARRAY, false otherwise - */ - public function isArray() - { - return self::VALUE_IS_ARRAY === (self::VALUE_IS_ARRAY & $this->mode); - } - - public function isNegatable(): bool - { - return self::VALUE_NEGATABLE === (self::VALUE_NEGATABLE & $this->mode); - } - - /** - * @param string|bool|int|float|array|null $default - */ - public function setDefault($default = null) - { - if (self::VALUE_NONE === (self::VALUE_NONE & $this->mode) && null !== $default) { - throw new LogicException('Cannot set a default value when using InputOption::VALUE_NONE mode.'); - } - - if ($this->isArray()) { - if (null === $default) { - $default = []; - } elseif (!\is_array($default)) { - throw new LogicException('A default value for an array option must be an array.'); - } - } - - $this->default = $this->acceptValue() || $this->isNegatable() ? $default : false; - } - - /** - * Returns the default value. - * - * @return string|bool|int|float|array|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns the description text. - * - * @return string - */ - public function getDescription() - { - return $this->description; - } - - /** - * Checks whether the given option equals this one. - * - * @return bool - */ - public function equals(self $option) - { - return $option->getName() === $this->getName() - && $option->getShortcut() === $this->getShortcut() - && $option->getDefault() === $this->getDefault() - && $option->isNegatable() === $this->isNegatable() - && $option->isArray() === $this->isArray() - && $option->isValueRequired() === $this->isValueRequired() - && $option->isValueOptional() === $this->isValueOptional() - ; - } -} diff --git a/vendor/symfony/console/Input/StreamableInputInterface.php b/vendor/symfony/console/Input/StreamableInputInterface.php deleted file mode 100644 index d7e462f24..000000000 --- a/vendor/symfony/console/Input/StreamableInputInterface.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -/** - * StreamableInputInterface is the interface implemented by all input classes - * that have an input stream. - * - * @author Robin Chalas - */ -interface StreamableInputInterface extends InputInterface -{ - /** - * Sets the input stream to read from when interacting with the user. - * - * This is mainly useful for testing purpose. - * - * @param resource $stream The input stream - */ - public function setStream($stream); - - /** - * Returns the input stream. - * - * @return resource|null - */ - public function getStream(); -} diff --git a/vendor/symfony/console/Input/StringInput.php b/vendor/symfony/console/Input/StringInput.php deleted file mode 100644 index 56bb66cbf..000000000 --- a/vendor/symfony/console/Input/StringInput.php +++ /dev/null @@ -1,84 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Input; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * StringInput represents an input provided as a string. - * - * Usage: - * - * $input = new StringInput('foo --bar="foobar"'); - * - * @author Fabien Potencier - */ -class StringInput extends ArgvInput -{ - public const REGEX_STRING = '([^\s]+?)(?:\s|(?setTokens($this->tokenize($input)); - } - - /** - * Tokenizes a string. - * - * @throws InvalidArgumentException When unable to parse input (should never happen) - */ - private function tokenize(string $input): array - { - $tokens = []; - $length = \strlen($input); - $cursor = 0; - $token = null; - while ($cursor < $length) { - if ('\\' === $input[$cursor]) { - $token .= $input[++$cursor] ?? ''; - ++$cursor; - continue; - } - - if (preg_match('/\s+/A', $input, $match, 0, $cursor)) { - if (null !== $token) { - $tokens[] = $token; - $token = null; - } - } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, 0, $cursor)) { - $token .= $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, -1))); - } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= stripcslashes(substr($match[0], 1, -1)); - } elseif (preg_match('/'.self::REGEX_UNQUOTED_STRING.'/A', $input, $match, 0, $cursor)) { - $token .= $match[1]; - } else { - // should never happen - throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ...".', substr($input, $cursor, 10))); - } - - $cursor += \strlen($match[0]); - } - - if (null !== $token) { - $tokens[] = $token; - } - - return $tokens; - } -} diff --git a/vendor/symfony/console/LICENSE b/vendor/symfony/console/LICENSE deleted file mode 100644 index 0138f8f07..000000000 --- a/vendor/symfony/console/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/console/Logger/ConsoleLogger.php b/vendor/symfony/console/Logger/ConsoleLogger.php deleted file mode 100644 index 4a10fa172..000000000 --- a/vendor/symfony/console/Logger/ConsoleLogger.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Logger; - -use Psr\Log\AbstractLogger; -use Psr\Log\InvalidArgumentException; -use Psr\Log\LogLevel; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * PSR-3 compliant console logger. - * - * @author Kévin Dunglas - * - * @see https://www.php-fig.org/psr/psr-3/ - */ -class ConsoleLogger extends AbstractLogger -{ - public const INFO = 'info'; - public const ERROR = 'error'; - - private $output; - private $verbosityLevelMap = [ - LogLevel::EMERGENCY => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ALERT => OutputInterface::VERBOSITY_NORMAL, - LogLevel::CRITICAL => OutputInterface::VERBOSITY_NORMAL, - LogLevel::ERROR => OutputInterface::VERBOSITY_NORMAL, - LogLevel::WARNING => OutputInterface::VERBOSITY_NORMAL, - LogLevel::NOTICE => OutputInterface::VERBOSITY_VERBOSE, - LogLevel::INFO => OutputInterface::VERBOSITY_VERY_VERBOSE, - LogLevel::DEBUG => OutputInterface::VERBOSITY_DEBUG, - ]; - private $formatLevelMap = [ - LogLevel::EMERGENCY => self::ERROR, - LogLevel::ALERT => self::ERROR, - LogLevel::CRITICAL => self::ERROR, - LogLevel::ERROR => self::ERROR, - LogLevel::WARNING => self::INFO, - LogLevel::NOTICE => self::INFO, - LogLevel::INFO => self::INFO, - LogLevel::DEBUG => self::INFO, - ]; - private $errored = false; - - public function __construct(OutputInterface $output, array $verbosityLevelMap = [], array $formatLevelMap = []) - { - $this->output = $output; - $this->verbosityLevelMap = $verbosityLevelMap + $this->verbosityLevelMap; - $this->formatLevelMap = $formatLevelMap + $this->formatLevelMap; - } - - /** - * {@inheritdoc} - * - * @return void - */ - public function log($level, $message, array $context = []) - { - if (!isset($this->verbosityLevelMap[$level])) { - throw new InvalidArgumentException(sprintf('The log level "%s" does not exist.', $level)); - } - - $output = $this->output; - - // Write to the error output if necessary and available - if (self::ERROR === $this->formatLevelMap[$level]) { - if ($this->output instanceof ConsoleOutputInterface) { - $output = $output->getErrorOutput(); - } - $this->errored = true; - } - - // the if condition check isn't necessary -- it's the same one that $output will do internally anyway. - // We only do it for efficiency here as the message formatting is relatively expensive. - if ($output->getVerbosity() >= $this->verbosityLevelMap[$level]) { - $output->writeln(sprintf('<%1$s>[%2$s] %3$s', $this->formatLevelMap[$level], $level, $this->interpolate($message, $context)), $this->verbosityLevelMap[$level]); - } - } - - /** - * Returns true when any messages have been logged at error levels. - * - * @return bool - */ - public function hasErrored() - { - return $this->errored; - } - - /** - * Interpolates context values into the message placeholders. - * - * @author PHP Framework Interoperability Group - */ - private function interpolate(string $message, array $context): string - { - if (!str_contains($message, '{')) { - return $message; - } - - $replacements = []; - foreach ($context as $key => $val) { - if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) { - $replacements["{{$key}}"] = $val; - } elseif ($val instanceof \DateTimeInterface) { - $replacements["{{$key}}"] = $val->format(\DateTime::RFC3339); - } elseif (\is_object($val)) { - $replacements["{{$key}}"] = '[object '.\get_class($val).']'; - } else { - $replacements["{{$key}}"] = '['.\gettype($val).']'; - } - } - - return strtr($message, $replacements); - } -} diff --git a/vendor/symfony/console/Output/BufferedOutput.php b/vendor/symfony/console/Output/BufferedOutput.php deleted file mode 100644 index d37c6e323..000000000 --- a/vendor/symfony/console/Output/BufferedOutput.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * @author Jean-François Simon - */ -class BufferedOutput extends Output -{ - private $buffer = ''; - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutput.php b/vendor/symfony/console/Output/ConsoleOutput.php deleted file mode 100644 index f19f9ebf4..000000000 --- a/vendor/symfony/console/Output/ConsoleOutput.php +++ /dev/null @@ -1,172 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * ConsoleOutput is the default class for all CLI output. It uses STDOUT and STDERR. - * - * This class is a convenient wrapper around `StreamOutput` for both STDOUT and STDERR. - * - * $output = new ConsoleOutput(); - * - * This is equivalent to: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * $stdErr = new StreamOutput(fopen('php://stderr', 'w')); - * - * @author Fabien Potencier - */ -class ConsoleOutput extends StreamOutput implements ConsoleOutputInterface -{ - private $stderr; - private $consoleSectionOutputs = []; - - /** - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - parent::__construct($this->openOutputStream(), $verbosity, $decorated, $formatter); - - if (null === $formatter) { - // for BC reasons, stdErr has it own Formatter only when user don't inject a specific formatter. - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated); - - return; - } - - $actualDecorated = $this->isDecorated(); - $this->stderr = new StreamOutput($this->openErrorStream(), $verbosity, $decorated, $this->getFormatter()); - - if (null === $decorated) { - $this->setDecorated($actualDecorated && $this->stderr->isDecorated()); - } - } - - /** - * Creates a new output section. - */ - public function section(): ConsoleSectionOutput - { - return new ConsoleSectionOutput($this->getStream(), $this->consoleSectionOutputs, $this->getVerbosity(), $this->isDecorated(), $this->getFormatter()); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - parent::setDecorated($decorated); - $this->stderr->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - parent::setFormatter($formatter); - $this->stderr->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - parent::setVerbosity($level); - $this->stderr->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getErrorOutput() - { - return $this->stderr; - } - - /** - * {@inheritdoc} - */ - public function setErrorOutput(OutputInterface $error) - { - $this->stderr = $error; - } - - /** - * Returns true if current environment supports writing console output to - * STDOUT. - * - * @return bool - */ - protected function hasStdoutSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Returns true if current environment supports writing console output to - * STDERR. - * - * @return bool - */ - protected function hasStderrSupport() - { - return false === $this->isRunningOS400(); - } - - /** - * Checks if current executing environment is IBM iSeries (OS400), which - * doesn't properly convert character-encodings between ASCII to EBCDIC. - */ - private function isRunningOS400(): bool - { - $checks = [ - \function_exists('php_uname') ? php_uname('s') : '', - getenv('OSTYPE'), - \PHP_OS, - ]; - - return false !== stripos(implode(';', $checks), 'OS400'); - } - - /** - * @return resource - */ - private function openOutputStream() - { - if (!$this->hasStdoutSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDOUT when possible to prevent from opening too many file descriptors - return \defined('STDOUT') ? \STDOUT : (@fopen('php://stdout', 'w') ?: fopen('php://output', 'w')); - } - - /** - * @return resource - */ - private function openErrorStream() - { - if (!$this->hasStderrSupport()) { - return fopen('php://output', 'w'); - } - - // Use STDERR when possible to prevent from opening too many file descriptors - return \defined('STDERR') ? \STDERR : (@fopen('php://stderr', 'w') ?: fopen('php://output', 'w')); - } -} diff --git a/vendor/symfony/console/Output/ConsoleOutputInterface.php b/vendor/symfony/console/Output/ConsoleOutputInterface.php deleted file mode 100644 index 6b6635f58..000000000 --- a/vendor/symfony/console/Output/ConsoleOutputInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -/** - * ConsoleOutputInterface is the interface implemented by ConsoleOutput class. - * This adds information about stderr and section output stream. - * - * @author Dariusz Górecki - */ -interface ConsoleOutputInterface extends OutputInterface -{ - /** - * Gets the OutputInterface for errors. - * - * @return OutputInterface - */ - public function getErrorOutput(); - - public function setErrorOutput(OutputInterface $error); - - public function section(): ConsoleSectionOutput; -} diff --git a/vendor/symfony/console/Output/ConsoleSectionOutput.php b/vendor/symfony/console/Output/ConsoleSectionOutput.php deleted file mode 100644 index 8f1649758..000000000 --- a/vendor/symfony/console/Output/ConsoleSectionOutput.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Terminal; - -/** - * @author Pierre du Plessis - * @author Gabriel Ostrolucký - */ -class ConsoleSectionOutput extends StreamOutput -{ - private $content = []; - private $lines = 0; - private $sections; - private $terminal; - - /** - * @param resource $stream - * @param ConsoleSectionOutput[] $sections - */ - public function __construct($stream, array &$sections, int $verbosity, bool $decorated, OutputFormatterInterface $formatter) - { - parent::__construct($stream, $verbosity, $decorated, $formatter); - array_unshift($sections, $this); - $this->sections = &$sections; - $this->terminal = new Terminal(); - } - - /** - * Clears previous output for this section. - * - * @param int $lines Number of lines to clear. If null, then the entire output of this section is cleared - */ - public function clear(int $lines = null) - { - if (empty($this->content) || !$this->isDecorated()) { - return; - } - - if ($lines) { - array_splice($this->content, -($lines * 2)); // Multiply lines by 2 to cater for each new line added between content - } else { - $lines = $this->lines; - $this->content = []; - } - - $this->lines -= $lines; - - parent::doWrite($this->popStreamContentUntilCurrentSection($lines), false); - } - - /** - * Overwrites the previous output with a new message. - * - * @param array|string $message - */ - public function overwrite($message) - { - $this->clear(); - $this->writeln($message); - } - - public function getContent(): string - { - return implode('', $this->content); - } - - /** - * @internal - */ - public function addContent(string $input) - { - foreach (explode(\PHP_EOL, $input) as $lineContent) { - $this->lines += ceil($this->getDisplayLength($lineContent) / $this->terminal->getWidth()) ?: 1; - $this->content[] = $lineContent; - $this->content[] = \PHP_EOL; - } - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - if (!$this->isDecorated()) { - parent::doWrite($message, $newline); - - return; - } - - $erasedContent = $this->popStreamContentUntilCurrentSection(); - - $this->addContent($message); - - parent::doWrite($message, true); - parent::doWrite($erasedContent, false); - } - - /** - * At initial stage, cursor is at the end of stream output. This method makes cursor crawl upwards until it hits - * current section. Then it erases content it crawled through. Optionally, it erases part of current section too. - */ - private function popStreamContentUntilCurrentSection(int $numberOfLinesToClearFromCurrentSection = 0): string - { - $numberOfLinesToClear = $numberOfLinesToClearFromCurrentSection; - $erasedContent = []; - - foreach ($this->sections as $section) { - if ($section === $this) { - break; - } - - $numberOfLinesToClear += $section->lines; - $erasedContent[] = $section->getContent(); - } - - if ($numberOfLinesToClear > 0) { - // move cursor up n lines - parent::doWrite(sprintf("\x1b[%dA", $numberOfLinesToClear), false); - // erase to end of screen - parent::doWrite("\x1b[0J", false); - } - - return implode('', array_reverse($erasedContent)); - } - - private function getDisplayLength(string $text): int - { - return Helper::width(Helper::removeDecoration($this->getFormatter(), str_replace("\t", ' ', $text))); - } -} diff --git a/vendor/symfony/console/Output/NullOutput.php b/vendor/symfony/console/Output/NullOutput.php deleted file mode 100644 index 3bbe63ea0..000000000 --- a/vendor/symfony/console/Output/NullOutput.php +++ /dev/null @@ -1,128 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\NullOutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * NullOutput suppresses all output. - * - * $output = new NullOutput(); - * - * @author Fabien Potencier - * @author Tobias Schultze - */ -class NullOutput implements OutputInterface -{ - private $formatter; - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - if ($this->formatter) { - return $this->formatter; - } - // to comply with the interface we must return a OutputFormatterInterface - return $this->formatter = new NullOutputFormatter(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return self::VERBOSITY_QUIET; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - // do nothing - } -} diff --git a/vendor/symfony/console/Output/Output.php b/vendor/symfony/console/Output/Output.php deleted file mode 100644 index d7c5fb2d1..000000000 --- a/vendor/symfony/console/Output/Output.php +++ /dev/null @@ -1,174 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * Base class for output classes. - * - * There are five levels of verbosity: - * - * * normal: no option passed (normal output) - * * verbose: -v (more output) - * * very verbose: -vv (highly extended output) - * * debug: -vvv (all debug output) - * * quiet: -q (no output) - * - * @author Fabien Potencier - */ -abstract class Output implements OutputInterface -{ - private $verbosity; - private $formatter; - - /** - * @param int|null $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool $decorated Whether to decorate messages - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - */ - public function __construct(?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - $this->verbosity = $verbosity ?? self::VERBOSITY_NORMAL; - $this->formatter = $formatter ?? new OutputFormatter(); - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->formatter = $formatter; - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->formatter; - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->formatter->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->formatter->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - $this->verbosity = $level; - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return self::VERBOSITY_QUIET === $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return self::VERBOSITY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return self::VERBOSITY_VERY_VERBOSE <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return self::VERBOSITY_DEBUG <= $this->verbosity; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $options = self::OUTPUT_NORMAL) - { - $this->write($messages, true, $options); - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $options = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - $types = self::OUTPUT_NORMAL | self::OUTPUT_RAW | self::OUTPUT_PLAIN; - $type = $types & $options ?: self::OUTPUT_NORMAL; - - $verbosities = self::VERBOSITY_QUIET | self::VERBOSITY_NORMAL | self::VERBOSITY_VERBOSE | self::VERBOSITY_VERY_VERBOSE | self::VERBOSITY_DEBUG; - $verbosity = $verbosities & $options ?: self::VERBOSITY_NORMAL; - - if ($verbosity > $this->getVerbosity()) { - return; - } - - foreach ($messages as $message) { - switch ($type) { - case OutputInterface::OUTPUT_NORMAL: - $message = $this->formatter->format($message); - break; - case OutputInterface::OUTPUT_RAW: - break; - case OutputInterface::OUTPUT_PLAIN: - $message = strip_tags($this->formatter->format($message)); - break; - } - - $this->doWrite($message ?? '', $newline); - } - } - - /** - * Writes a message to the output. - */ - abstract protected function doWrite(string $message, bool $newline); -} diff --git a/vendor/symfony/console/Output/OutputInterface.php b/vendor/symfony/console/Output/OutputInterface.php deleted file mode 100644 index 55caab80b..000000000 --- a/vendor/symfony/console/Output/OutputInterface.php +++ /dev/null @@ -1,110 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * OutputInterface is the interface implemented by all Output classes. - * - * @author Fabien Potencier - */ -interface OutputInterface -{ - public const VERBOSITY_QUIET = 16; - public const VERBOSITY_NORMAL = 32; - public const VERBOSITY_VERBOSE = 64; - public const VERBOSITY_VERY_VERBOSE = 128; - public const VERBOSITY_DEBUG = 256; - - public const OUTPUT_NORMAL = 1; - public const OUTPUT_RAW = 2; - public const OUTPUT_PLAIN = 4; - - /** - * Writes a message to the output. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param bool $newline Whether to add a newline - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function write($messages, bool $newline = false, int $options = 0); - - /** - * Writes a message to the output and adds a newline at the end. - * - * @param string|iterable $messages The message as an iterable of strings or a single string - * @param int $options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL - */ - public function writeln($messages, int $options = 0); - - /** - * Sets the verbosity of the output. - */ - public function setVerbosity(int $level); - - /** - * Gets the current verbosity of the output. - * - * @return int - */ - public function getVerbosity(); - - /** - * Returns whether verbosity is quiet (-q). - * - * @return bool - */ - public function isQuiet(); - - /** - * Returns whether verbosity is verbose (-v). - * - * @return bool - */ - public function isVerbose(); - - /** - * Returns whether verbosity is very verbose (-vv). - * - * @return bool - */ - public function isVeryVerbose(); - - /** - * Returns whether verbosity is debug (-vvv). - * - * @return bool - */ - public function isDebug(); - - /** - * Sets the decorated flag. - */ - public function setDecorated(bool $decorated); - - /** - * Gets the decorated flag. - * - * @return bool - */ - public function isDecorated(); - - public function setFormatter(OutputFormatterInterface $formatter); - - /** - * Returns current output formatter instance. - * - * @return OutputFormatterInterface - */ - public function getFormatter(); -} diff --git a/vendor/symfony/console/Output/StreamOutput.php b/vendor/symfony/console/Output/StreamOutput.php deleted file mode 100644 index 7f5551827..000000000 --- a/vendor/symfony/console/Output/StreamOutput.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * StreamOutput writes the output to a given stream. - * - * Usage: - * - * $output = new StreamOutput(fopen('php://stdout', 'w')); - * - * As `StreamOutput` can use any stream, you can also use a file: - * - * $output = new StreamOutput(fopen('/path/to/output.log', 'a', false)); - * - * @author Fabien Potencier - */ -class StreamOutput extends Output -{ - private $stream; - - /** - * @param resource $stream A stream resource - * @param int $verbosity The verbosity level (one of the VERBOSITY constants in OutputInterface) - * @param bool|null $decorated Whether to decorate messages (null for auto-guessing) - * @param OutputFormatterInterface|null $formatter Output formatter instance (null to use default OutputFormatter) - * - * @throws InvalidArgumentException When first argument is not a real stream - */ - public function __construct($stream, int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = null, OutputFormatterInterface $formatter = null) - { - if (!\is_resource($stream) || 'stream' !== get_resource_type($stream)) { - throw new InvalidArgumentException('The StreamOutput class needs a stream as its first argument.'); - } - - $this->stream = $stream; - - if (null === $decorated) { - $decorated = $this->hasColorSupport(); - } - - parent::__construct($verbosity, $decorated, $formatter); - } - - /** - * Gets the stream attached to this StreamOutput instance. - * - * @return resource - */ - public function getStream() - { - return $this->stream; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - if ($newline) { - $message .= \PHP_EOL; - } - - @fwrite($this->stream, $message); - - fflush($this->stream); - } - - /** - * Returns true if the stream supports colorization. - * - * Colorization is disabled if not supported by the stream: - * - * This is tricky on Windows, because Cygwin, Msys2 etc emulate pseudo - * terminals via named pipes, so we can only check the environment. - * - * Reference: Composer\XdebugHandler\Process::supportsColor - * https://github.com/composer/xdebug-handler - * - * @return bool true if the stream supports colorization, false otherwise - */ - protected function hasColorSupport() - { - // Follow https://no-color.org/ - if (isset($_SERVER['NO_COLOR']) || false !== getenv('NO_COLOR')) { - return false; - } - - if ('Hyper' === getenv('TERM_PROGRAM')) { - return true; - } - - if (\DIRECTORY_SEPARATOR === '\\') { - return (\function_exists('sapi_windows_vt100_support') - && @sapi_windows_vt100_support($this->stream)) - || false !== getenv('ANSICON') - || 'ON' === getenv('ConEmuANSI') - || 'xterm' === getenv('TERM'); - } - - return stream_isatty($this->stream); - } -} diff --git a/vendor/symfony/console/Output/TrimmedBufferOutput.php b/vendor/symfony/console/Output/TrimmedBufferOutput.php deleted file mode 100644 index 3f4d375f4..000000000 --- a/vendor/symfony/console/Output/TrimmedBufferOutput.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Output; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Formatter\OutputFormatterInterface; - -/** - * A BufferedOutput that keeps only the last N chars. - * - * @author Jérémy Derussé - */ -class TrimmedBufferOutput extends Output -{ - private $maxLength; - private $buffer = ''; - - public function __construct(int $maxLength, ?int $verbosity = self::VERBOSITY_NORMAL, bool $decorated = false, OutputFormatterInterface $formatter = null) - { - if ($maxLength <= 0) { - throw new InvalidArgumentException(sprintf('"%s()" expects a strictly positive maxLength. Got %d.', __METHOD__, $maxLength)); - } - - parent::__construct($verbosity, $decorated, $formatter); - $this->maxLength = $maxLength; - } - - /** - * Empties buffer and returns its content. - * - * @return string - */ - public function fetch() - { - $content = $this->buffer; - $this->buffer = ''; - - return $content; - } - - /** - * {@inheritdoc} - */ - protected function doWrite(string $message, bool $newline) - { - $this->buffer .= $message; - - if ($newline) { - $this->buffer .= \PHP_EOL; - } - - $this->buffer = substr($this->buffer, 0 - $this->maxLength); - } -} diff --git a/vendor/symfony/console/Question/ChoiceQuestion.php b/vendor/symfony/console/Question/ChoiceQuestion.php deleted file mode 100644 index bf1f90487..000000000 --- a/vendor/symfony/console/Question/ChoiceQuestion.php +++ /dev/null @@ -1,183 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; - -/** - * Represents a choice question. - * - * @author Fabien Potencier - */ -class ChoiceQuestion extends Question -{ - private $choices; - private $multiselect = false; - private $prompt = ' > '; - private $errorMessage = 'Value "%s" is invalid'; - - /** - * @param string $question The question to ask to the user - * @param array $choices The list of available choices - * @param mixed $default The default answer to return - */ - public function __construct(string $question, array $choices, $default = null) - { - if (!$choices) { - throw new \LogicException('Choice question must have at least 1 choice available.'); - } - - parent::__construct($question, $default); - - $this->choices = $choices; - $this->setValidator($this->getDefaultValidator()); - $this->setAutocompleterValues($choices); - } - - /** - * Returns available choices. - * - * @return array - */ - public function getChoices() - { - return $this->choices; - } - - /** - * Sets multiselect option. - * - * When multiselect is set to true, multiple choices can be answered. - * - * @return $this - */ - public function setMultiselect(bool $multiselect) - { - $this->multiselect = $multiselect; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - /** - * Returns whether the choices are multiselect. - * - * @return bool - */ - public function isMultiselect() - { - return $this->multiselect; - } - - /** - * Gets the prompt for choices. - * - * @return string - */ - public function getPrompt() - { - return $this->prompt; - } - - /** - * Sets the prompt for choices. - * - * @return $this - */ - public function setPrompt(string $prompt) - { - $this->prompt = $prompt; - - return $this; - } - - /** - * Sets the error message for invalid values. - * - * The error message has a string placeholder (%s) for the invalid value. - * - * @return $this - */ - public function setErrorMessage(string $errorMessage) - { - $this->errorMessage = $errorMessage; - $this->setValidator($this->getDefaultValidator()); - - return $this; - } - - private function getDefaultValidator(): callable - { - $choices = $this->choices; - $errorMessage = $this->errorMessage; - $multiselect = $this->multiselect; - $isAssoc = $this->isAssoc($choices); - - return function ($selected) use ($choices, $errorMessage, $multiselect, $isAssoc) { - if ($multiselect) { - // Check for a separated comma values - if (!preg_match('/^[^,]+(?:,[^,]+)*$/', (string) $selected, $matches)) { - throw new InvalidArgumentException(sprintf($errorMessage, $selected)); - } - - $selectedChoices = explode(',', (string) $selected); - } else { - $selectedChoices = [$selected]; - } - - if ($this->isTrimmable()) { - foreach ($selectedChoices as $k => $v) { - $selectedChoices[$k] = trim((string) $v); - } - } - - $multiselectChoices = []; - foreach ($selectedChoices as $value) { - $results = []; - foreach ($choices as $key => $choice) { - if ($choice === $value) { - $results[] = $key; - } - } - - if (\count($results) > 1) { - throw new InvalidArgumentException(sprintf('The provided answer is ambiguous. Value should be one of "%s".', implode('" or "', $results))); - } - - $result = array_search($value, $choices); - - if (!$isAssoc) { - if (false !== $result) { - $result = $choices[$result]; - } elseif (isset($choices[$value])) { - $result = $choices[$value]; - } - } elseif (false === $result && isset($choices[$value])) { - $result = $value; - } - - if (false === $result) { - throw new InvalidArgumentException(sprintf($errorMessage, $value)); - } - - // For associative choices, consistently return the key as string: - $multiselectChoices[] = $isAssoc ? (string) $result : $result; - } - - if ($multiselect) { - return $multiselectChoices; - } - - return current($multiselectChoices); - }; - } -} diff --git a/vendor/symfony/console/Question/ConfirmationQuestion.php b/vendor/symfony/console/Question/ConfirmationQuestion.php deleted file mode 100644 index 4228521b9..000000000 --- a/vendor/symfony/console/Question/ConfirmationQuestion.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -/** - * Represents a yes/no question. - * - * @author Fabien Potencier - */ -class ConfirmationQuestion extends Question -{ - private $trueAnswerRegex; - - /** - * @param string $question The question to ask to the user - * @param bool $default The default answer to return, true or false - * @param string $trueAnswerRegex A regex to match the "yes" answer - */ - public function __construct(string $question, bool $default = true, string $trueAnswerRegex = '/^y/i') - { - parent::__construct($question, $default); - - $this->trueAnswerRegex = $trueAnswerRegex; - $this->setNormalizer($this->getDefaultNormalizer()); - } - - /** - * Returns the default answer normalizer. - */ - private function getDefaultNormalizer(): callable - { - $default = $this->getDefault(); - $regex = $this->trueAnswerRegex; - - return function ($answer) use ($default, $regex) { - if (\is_bool($answer)) { - return $answer; - } - - $answerIsTrue = (bool) preg_match($regex, $answer); - if (false === $default) { - return $answer && $answerIsTrue; - } - - return '' === $answer || $answerIsTrue; - }; - } -} diff --git a/vendor/symfony/console/Question/Question.php b/vendor/symfony/console/Question/Question.php deleted file mode 100644 index 3a73f04b2..000000000 --- a/vendor/symfony/console/Question/Question.php +++ /dev/null @@ -1,299 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Question; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\LogicException; - -/** - * Represents a Question. - * - * @author Fabien Potencier - */ -class Question -{ - private $question; - private $attempts; - private $hidden = false; - private $hiddenFallback = true; - private $autocompleterCallback; - private $validator; - private $default; - private $normalizer; - private $trimmable = true; - private $multiline = false; - - /** - * @param string $question The question to ask to the user - * @param string|bool|int|float|null $default The default answer to return if the user enters nothing - */ - public function __construct(string $question, $default = null) - { - $this->question = $question; - $this->default = $default; - } - - /** - * Returns the question. - * - * @return string - */ - public function getQuestion() - { - return $this->question; - } - - /** - * Returns the default answer. - * - * @return string|bool|int|float|null - */ - public function getDefault() - { - return $this->default; - } - - /** - * Returns whether the user response accepts newline characters. - */ - public function isMultiline(): bool - { - return $this->multiline; - } - - /** - * Sets whether the user response should accept newline characters. - * - * @return $this - */ - public function setMultiline(bool $multiline): self - { - $this->multiline = $multiline; - - return $this; - } - - /** - * Returns whether the user response must be hidden. - * - * @return bool - */ - public function isHidden() - { - return $this->hidden; - } - - /** - * Sets whether the user response must be hidden or not. - * - * @return $this - * - * @throws LogicException In case the autocompleter is also used - */ - public function setHidden(bool $hidden) - { - if ($this->autocompleterCallback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->hidden = $hidden; - - return $this; - } - - /** - * In case the response cannot be hidden, whether to fallback on non-hidden question or not. - * - * @return bool - */ - public function isHiddenFallback() - { - return $this->hiddenFallback; - } - - /** - * Sets whether to fallback on non-hidden question if the response cannot be hidden. - * - * @return $this - */ - public function setHiddenFallback(bool $fallback) - { - $this->hiddenFallback = $fallback; - - return $this; - } - - /** - * Gets values for the autocompleter. - * - * @return iterable|null - */ - public function getAutocompleterValues() - { - $callback = $this->getAutocompleterCallback(); - - return $callback ? $callback('') : null; - } - - /** - * Sets values for the autocompleter. - * - * @return $this - * - * @throws LogicException - */ - public function setAutocompleterValues(?iterable $values) - { - if (\is_array($values)) { - $values = $this->isAssoc($values) ? array_merge(array_keys($values), array_values($values)) : array_values($values); - - $callback = static function () use ($values) { - return $values; - }; - } elseif ($values instanceof \Traversable) { - $valueCache = null; - $callback = static function () use ($values, &$valueCache) { - return $valueCache ?? $valueCache = iterator_to_array($values, false); - }; - } else { - $callback = null; - } - - return $this->setAutocompleterCallback($callback); - } - - /** - * Gets the callback function used for the autocompleter. - */ - public function getAutocompleterCallback(): ?callable - { - return $this->autocompleterCallback; - } - - /** - * Sets the callback function used for the autocompleter. - * - * The callback is passed the user input as argument and should return an iterable of corresponding suggestions. - * - * @return $this - */ - public function setAutocompleterCallback(callable $callback = null): self - { - if ($this->hidden && null !== $callback) { - throw new LogicException('A hidden question cannot use the autocompleter.'); - } - - $this->autocompleterCallback = $callback; - - return $this; - } - - /** - * Sets a validator for the question. - * - * @return $this - */ - public function setValidator(callable $validator = null) - { - $this->validator = $validator; - - return $this; - } - - /** - * Gets the validator for the question. - * - * @return callable|null - */ - public function getValidator() - { - return $this->validator; - } - - /** - * Sets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return $this - * - * @throws InvalidArgumentException in case the number of attempts is invalid - */ - public function setMaxAttempts(?int $attempts) - { - if (null !== $attempts && $attempts < 1) { - throw new InvalidArgumentException('Maximum number of attempts must be a positive value.'); - } - - $this->attempts = $attempts; - - return $this; - } - - /** - * Gets the maximum number of attempts. - * - * Null means an unlimited number of attempts. - * - * @return int|null - */ - public function getMaxAttempts() - { - return $this->attempts; - } - - /** - * Sets a normalizer for the response. - * - * The normalizer can be a callable (a string), a closure or a class implementing __invoke. - * - * @return $this - */ - public function setNormalizer(callable $normalizer) - { - $this->normalizer = $normalizer; - - return $this; - } - - /** - * Gets the normalizer for the response. - * - * The normalizer can ba a callable (a string), a closure or a class implementing __invoke. - * - * @return callable|null - */ - public function getNormalizer() - { - return $this->normalizer; - } - - protected function isAssoc(array $array) - { - return (bool) \count(array_filter(array_keys($array), 'is_string')); - } - - public function isTrimmable(): bool - { - return $this->trimmable; - } - - /** - * @return $this - */ - public function setTrimmable(bool $trimmable): self - { - $this->trimmable = $trimmable; - - return $this; - } -} diff --git a/vendor/symfony/console/README.md b/vendor/symfony/console/README.md deleted file mode 100644 index c4c129989..000000000 --- a/vendor/symfony/console/README.md +++ /dev/null @@ -1,36 +0,0 @@ -Console Component -================= - -The Console component eases the creation of beautiful and testable command line -interfaces. - -Sponsor -------- - -The Console component for Symfony 5.4/6.0 is [backed][1] by [Les-Tilleuls.coop][2]. - -Les-Tilleuls.coop is a team of 50+ Symfony experts who can help you design, develop and -fix your projects. We provide a wide range of professional services including development, -consulting, coaching, training and audits. We also are highly skilled in JS, Go and DevOps. -We are a worker cooperative! - -Help Symfony by [sponsoring][3] its development! - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/console.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) - -Credits -------- - -`Resources/bin/hiddeninput.exe` is a third party binary provided within this -component. Find sources and license at https://github.com/Seldaek/hidden-input. - -[1]: https://symfony.com/backers -[2]: https://les-tilleuls.coop -[3]: https://symfony.com/sponsor diff --git a/vendor/symfony/console/Resources/bin/hiddeninput.exe b/vendor/symfony/console/Resources/bin/hiddeninput.exe deleted file mode 100644 index c8cf65e8d819e6e525121cf6b21f1c2429746038..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9216 zcmeHNe{@sVeZR8hV88~S)=Hp|Mpn({rC^@)BwNOI{ERJXCYlx+k1K6PLHo z_e!z_fhOzeA3JTX&-Z@s{rFOgjEwBlqjr!)9f zjyHz`A+ni`!0Taby{Uj5Y>jQq(k5A+X})PLWAi|{IZbtc8n^^trM{GI=P_15U6d?l zJJ3PW8XjfHpR}6`k{&5@JcEeH_SqQoQbU62o2YS30W)p_t&Fjy*RXQCZt$gCf|ao| zx&3R}m6|-Lfi@pua=$26n(UlnWo$>K67*|+#(qL_An=?l0M02AhOSJDv3;~?1ORfw z76EdK#MpSHqACHLcnJLIYlCSiX4eS@Pr8rN)Xwz0dk7O*y^0_C(Yks2Kvg! z-d-fJ)F9@k?>)m(XqDKIe2OKfhCQde9fpO0ko24yn*4xzX7q+ze`Z*=aJgwV?D?73 zaJ8UkSk|NN>@-|mB*f`EIK7$ElgAB<7p&p`^Vuq$58#;?B^*Bz7&d$B#+AYUC z(^m|`7{lqx&b^5$;i`j|S!+u|lcaQplp_&Nb)!>r>vGh3wb!tW zLq6%bkSt8jO|(vWH>LiPV(Xkp%BiGhl1q!PXXNKVKE!>Y5cHc2%cJOJA{-&ZsSn`T z#8~TA#(HWH4m>uCd+kCMTFgMI*s*n3!iCOwEI`{vGcVhzDu!Lw%-Ea^JATtrF`q3`+#KvvYJ0vM~A}D#LOD zlw`4ncB0U*Jji=--Wz#>I&5?hy;MgYW2u91d8ob=7MWfY`u;7Xe-J{Qsb0=0p|SM2 zG|=~mERIj4?gi)Ew|{LIN#oAsh20k_khIYjJBBN6rrIJ=eQO=nE;rTnPSiaQS$1$# z+|JRh0!IbQIa*f1(TZ}QM;|WO0+jTy(e)ggN4>zqp2E>C>hGPLHjHBh--2%@{EZNE zbUk{<3MABX&20QwK{MxK8`1Vk>^%dO5i@VTfu>NG3$K4NC=hSPsj9UYy`rNO}sBnB9QdKdIk7G+2_amnWstdTYVg z7HgLJGC~XLZG`63GwH8PdO_+G(k6~?J8Wj5mQos#21kC4W#2)guQXI)!z^{@F)U)5 z*re+r(2dib3D4P~%Z6TL=$PIkpmm<_#isu%t=%DcIwNkJhMeJ|bpahHO%8h|y~Ccf zUg#xVk+dyu>Q1O7JZ~8KS>tqi0qK**X*y6yHM71`bT=kFZ=@E%oe2!Km1^2sa>v+onZ%x_>aOJF+N0{i~z|<(IzgT*{0PpQq}E zQpU35@bm;qI?t_znGI&5&4sZV>+%m}w$(4hSDvLk)l<{5XyMlnCl7C%AjM3XnWvVz z{NoFsX)JB)SoqABZxUa*Yq+^^(cbq4mL%^lO12c${z{pf+)|kTTI~nQywyYF6}6|8 zlsN9&{-vwTrTyu<5^90_AsIU-ID#ZG@6d%poU44<**%xVe?`uxf}_Mr$SLHLS|K_N zQnw>(Lr2U=%$-<2D~RSzbG)2W2u^KMDnFFE?GmmbQ)V)fty957F`4OvQ_25E68ITr z5?`suu`|v?r!y=gFOGj$%9IJ zuTP=&2GcnoZZ0qSe6YL-*-lg>Q#>?Ew`a=GDc4vI#<1sNdKn?n7iSj0Orl$-#FMFi zykr>X-Xvi>sVr;92+8*H!r|3L$#o~hXa0z>AmF=z z?|@FF;*S|S0yqsw0j>Z(3mX-HD!|{N-vYc9paC8Ld=|6?00!6(_%lERupO`&um*4k z0b~W>e*uhTe4;V;mq>(ox$9FB`wLt!*DKj~!aOh|fL&#Pg*b??tm%5~_6M#02wqeC zS~wO>TWGnSp^r<0&8f2V6W->w=C+p~daC5e5wNQM*(* z66^}b0(!q3)zq$mu&VnbR#nr3;h5DS*o7{y66=!#;Dy4$pd1ZH<6WEOi0oJ8SxRL* z*v-9@Z^2w%^S(w5dO{_9Duby%2RT~;ppxaE$l()x6&}>7Wcg=u_&>f`Vs8OJGTy{X z2HpG=ThJz<{%|4Qq-~ad0qcrc87n88DHpM(nypwXIkZn<{zIT$ul&BQ?{ApCAZtyr zs2YpNt@x(G*faTU*HCKnAk(G=Tl~>r1QK8LY~J8mFFGoN5iIkYSwlm4Lsj#g4dsE5 zU-4;*Kdh-zv!rT4N$O}Q&n)?v0-9Y)lRFz58^P-KtKonzrfQ1p@0V_10^0||cGRn9 zRG<-#_TEV2nn4{BOh{YVBR4e!V!D?0K%BAlQN!D%M#k1bHypiIHT)5tlj>p0Pp_;+ z!cqC-JIs@JRhB+#teGs$Cib_=(yjRo4OJg^YPg%58aJVsC(LQ?W6%pn!-#aMZwoPcopo^Rn6BE z3=c5&W5~pP(C(-2r;PnH-S0{F`runM0ERCf3rESX$+S(MKOXmKJL9zXF}9-lf^xUs z+bb)+P%L&gV@<4q{6w^xEJ>Y>TQFUeoz0o-yq)jUqww=?wjUO8Y{a5G;DJ0Jr!LL+ zWhgsLuzi&eDrGDn$2DJwpFfH-?SGWbr>qRb?v{P`_%)So)CQgzO^HQ%;y#tJ=knH4 z95jX;^bF#BiuTH^%-j}{9VrZD=R%Q%wselH^p>5 z7d>gWB-st&3Fj%Mt*|tR5iK3J=`xhs&G)I7E>`FO@o7L z@S$B!pYMuzz5DN@X!O4DPm5n@raPJn-Q#o*m*e^5lk$g?0esg%$;>g5QW-|;c=H2GM}bo2tW^D924wmOkrUbWxcQ# z#v6bP%Tdfe~jtCRzAL;-OahZ=#yvUixu2-9fD2j$*|YY`F?0wF-{a# ztr<&kZjZ+81}6ZESqtgW)8kP#s@VLTSUR{}6?U^R*x7RE3Rl&n=VnFFqg9Uqz1n@N9N|=9<4} zuJfy^+}|D9X&vm3MAdqmu0&UMd^=K>b1hLAm_E!$rZC2b;;T~Dl zI`Eo_yRY76uM})|6wk9->of(=9&4jLv5#p@OzS~Yl>@pG)^>6`R+KtL{<4ly4o9WiM!%p_pfROU354)e8PIeE z1_s?#;OX6waNvvb&UQRN(WLbR+}&b#jo&WY-LlwCX}Q*$jGuKYuOGoIoyR(>e}}ix z+t}Q^cEcC8Y{@h}>HmJ^gD!l@gzwHmiBKl26x_lZVZG2UY!`w;RJd122;US&geQdW z3Qq}R!gIo5;ka;0I4c-Jq5X6A6?VzK&c4y!ZXdAUYu{r}*!SBXw?Aor+J4-A(*COb zb^CwV-?3k`zi-cX*c`VzL`RLI(b4MgIrGN z%ojf`E*6)Gg1A9!7q^N##2zsss^V9~-Qt7d!{UDNZ^XY9pA^3@9ui*?e=7c5d`nD; z?}~R(p>y1Kw!>|X4ycYEAkcZa*n-R%y! zqi)Up756UpqwfE7=hfigw$k~G@25gaxF9UGTkV>C(7x1Rbx4jb#|}rxq0vQ!n-c#f J0sQ~1{4brj`U(I5 diff --git a/vendor/symfony/console/Resources/completion.bash b/vendor/symfony/console/Resources/completion.bash deleted file mode 100644 index 64b87ccf7..000000000 --- a/vendor/symfony/console/Resources/completion.bash +++ /dev/null @@ -1,84 +0,0 @@ -# This file is part of the Symfony package. -# -# (c) Fabien Potencier -# -# For the full copyright and license information, please view -# https://symfony.com/doc/current/contributing/code/license.html - -_sf_{{ COMMAND_NAME }}() { - # Use newline as only separator to allow space in completion values - IFS=$'\n' - local sf_cmd="${COMP_WORDS[0]}" - - # for an alias, get the real script behind it - sf_cmd_type=$(type -t $sf_cmd) - if [[ $sf_cmd_type == "alias" ]]; then - sf_cmd=$(alias $sf_cmd | sed -E "s/alias $sf_cmd='(.*)'/\1/") - elif [[ $sf_cmd_type == "file" ]]; then - sf_cmd=$(type -p $sf_cmd) - fi - - if [[ $sf_cmd_type != "function" && ! -x $sf_cmd ]]; then - return 1 - fi - - local cur prev words cword - _get_comp_words_by_ref -n := cur prev words cword - - local completecmd=("$sf_cmd" "_complete" "--no-interaction" "-sbash" "-c$cword" "-S{{ VERSION }}") - for w in ${words[@]}; do - w=$(printf -- '%b' "$w") - # remove quotes from typed values - quote="${w:0:1}" - if [ "$quote" == \' ]; then - w="${w%\'}" - w="${w#\'}" - elif [ "$quote" == \" ]; then - w="${w%\"}" - w="${w#\"}" - fi - # empty values are ignored - if [ ! -z "$w" ]; then - completecmd+=("-i$w") - fi - done - - local sfcomplete - if sfcomplete=$(${completecmd[@]} 2>&1); then - local quote suggestions - quote=${cur:0:1} - - # Use single quotes by default if suggestions contains backslash (FQCN) - if [ "$quote" == '' ] && [[ "$sfcomplete" =~ \\ ]]; then - quote=\' - fi - - if [ "$quote" == \' ]; then - # single quotes: no additional escaping (does not accept ' in values) - suggestions=$(for s in $sfcomplete; do printf $'%q%q%q\n' "$quote" "$s" "$quote"; done) - elif [ "$quote" == \" ]; then - # double quotes: double escaping for \ $ ` " - suggestions=$(for s in $sfcomplete; do - s=${s//\\/\\\\} - s=${s//\$/\\\$} - s=${s//\`/\\\`} - s=${s//\"/\\\"} - printf $'%q%q%q\n' "$quote" "$s" "$quote"; - done) - else - # no quotes: double escaping - suggestions=$(for s in $sfcomplete; do printf $'%q\n' $(printf '%q' "$s"); done) - fi - COMPREPLY=($(IFS=$'\n' compgen -W "$suggestions" -- $(printf -- "%q" "$cur"))) - __ltrim_colon_completions "$cur" - else - if [[ "$sfcomplete" != *"Command \"_complete\" is not defined."* ]]; then - >&2 echo - >&2 echo $sfcomplete - fi - - return 1 - fi -} - -complete -F _sf_{{ COMMAND_NAME }} {{ COMMAND_NAME }} diff --git a/vendor/symfony/console/SignalRegistry/SignalRegistry.php b/vendor/symfony/console/SignalRegistry/SignalRegistry.php deleted file mode 100644 index 6bee24a42..000000000 --- a/vendor/symfony/console/SignalRegistry/SignalRegistry.php +++ /dev/null @@ -1,65 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\SignalRegistry; - -final class SignalRegistry -{ - private $signalHandlers = []; - - public function __construct() - { - if (\function_exists('pcntl_async_signals')) { - pcntl_async_signals(true); - } - } - - public function register(int $signal, callable $signalHandler): void - { - if (!isset($this->signalHandlers[$signal])) { - $previousCallback = pcntl_signal_get_handler($signal); - - if (\is_callable($previousCallback)) { - $this->signalHandlers[$signal][] = $previousCallback; - } - } - - $this->signalHandlers[$signal][] = $signalHandler; - - pcntl_signal($signal, [$this, 'handle']); - } - - public static function isSupported(): bool - { - if (!\function_exists('pcntl_signal')) { - return false; - } - - if (\in_array('pcntl_signal', explode(',', \ini_get('disable_functions')))) { - return false; - } - - return true; - } - - /** - * @internal - */ - public function handle(int $signal): void - { - $count = \count($this->signalHandlers[$signal]); - - foreach ($this->signalHandlers[$signal] as $i => $signalHandler) { - $hasNext = $i !== $count - 1; - $signalHandler($signal, $hasNext); - } - } -} diff --git a/vendor/symfony/console/SingleCommandApplication.php b/vendor/symfony/console/SingleCommandApplication.php deleted file mode 100644 index e93c1821b..000000000 --- a/vendor/symfony/console/SingleCommandApplication.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * @author Grégoire Pineau - */ -class SingleCommandApplication extends Command -{ - private $version = 'UNKNOWN'; - private $autoExit = true; - private $running = false; - - /** - * @return $this - */ - public function setVersion(string $version): self - { - $this->version = $version; - - return $this; - } - - /** - * @final - * - * @return $this - */ - public function setAutoExit(bool $autoExit): self - { - $this->autoExit = $autoExit; - - return $this; - } - - public function run(InputInterface $input = null, OutputInterface $output = null): int - { - if ($this->running) { - return parent::run($input, $output); - } - - // We use the command name as the application name - $application = new Application($this->getName() ?: 'UNKNOWN', $this->version); - $application->setAutoExit($this->autoExit); - // Fix the usage of the command displayed with "--help" - $this->setName($_SERVER['argv'][0]); - $application->add($this); - $application->setDefaultCommand($this->getName(), true); - - $this->running = true; - try { - $ret = $application->run($input, $output); - } finally { - $this->running = false; - } - - return $ret ?? 1; - } -} diff --git a/vendor/symfony/console/Style/OutputStyle.php b/vendor/symfony/console/Style/OutputStyle.php deleted file mode 100644 index 67a98ff07..000000000 --- a/vendor/symfony/console/Style/OutputStyle.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Formatter\OutputFormatterInterface; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; - -/** - * Decorates output to add console style guide helpers. - * - * @author Kevin Bond - */ -abstract class OutputStyle implements OutputInterface, StyleInterface -{ - private $output; - - public function __construct(OutputInterface $output) - { - $this->output = $output; - } - - /** - * {@inheritdoc} - */ - public function newLine(int $count = 1) - { - $this->output->write(str_repeat(\PHP_EOL, $count)); - } - - /** - * @return ProgressBar - */ - public function createProgressBar(int $max = 0) - { - return new ProgressBar($this->output, $max); - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - $this->output->write($messages, $newline, $type); - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) - { - $this->output->writeln($messages, $type); - } - - /** - * {@inheritdoc} - */ - public function setVerbosity(int $level) - { - $this->output->setVerbosity($level); - } - - /** - * {@inheritdoc} - */ - public function getVerbosity() - { - return $this->output->getVerbosity(); - } - - /** - * {@inheritdoc} - */ - public function setDecorated(bool $decorated) - { - $this->output->setDecorated($decorated); - } - - /** - * {@inheritdoc} - */ - public function isDecorated() - { - return $this->output->isDecorated(); - } - - /** - * {@inheritdoc} - */ - public function setFormatter(OutputFormatterInterface $formatter) - { - $this->output->setFormatter($formatter); - } - - /** - * {@inheritdoc} - */ - public function getFormatter() - { - return $this->output->getFormatter(); - } - - /** - * {@inheritdoc} - */ - public function isQuiet() - { - return $this->output->isQuiet(); - } - - /** - * {@inheritdoc} - */ - public function isVerbose() - { - return $this->output->isVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isVeryVerbose() - { - return $this->output->isVeryVerbose(); - } - - /** - * {@inheritdoc} - */ - public function isDebug() - { - return $this->output->isDebug(); - } - - protected function getErrorOutput() - { - if (!$this->output instanceof ConsoleOutputInterface) { - return $this->output; - } - - return $this->output->getErrorOutput(); - } -} diff --git a/vendor/symfony/console/Style/StyleInterface.php b/vendor/symfony/console/Style/StyleInterface.php deleted file mode 100644 index 38d23b77e..000000000 --- a/vendor/symfony/console/Style/StyleInterface.php +++ /dev/null @@ -1,132 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -/** - * Output style helpers. - * - * @author Kevin Bond - */ -interface StyleInterface -{ - /** - * Formats a command title. - */ - public function title(string $message); - - /** - * Formats a section title. - */ - public function section(string $message); - - /** - * Formats a list. - */ - public function listing(array $elements); - - /** - * Formats informational text. - * - * @param string|array $message - */ - public function text($message); - - /** - * Formats a success result bar. - * - * @param string|array $message - */ - public function success($message); - - /** - * Formats an error result bar. - * - * @param string|array $message - */ - public function error($message); - - /** - * Formats an warning result bar. - * - * @param string|array $message - */ - public function warning($message); - - /** - * Formats a note admonition. - * - * @param string|array $message - */ - public function note($message); - - /** - * Formats a caution admonition. - * - * @param string|array $message - */ - public function caution($message); - - /** - * Formats a table. - */ - public function table(array $headers, array $rows); - - /** - * Asks a question. - * - * @return mixed - */ - public function ask(string $question, string $default = null, callable $validator = null); - - /** - * Asks a question with the user input hidden. - * - * @return mixed - */ - public function askHidden(string $question, callable $validator = null); - - /** - * Asks for confirmation. - * - * @return bool - */ - public function confirm(string $question, bool $default = true); - - /** - * Asks a choice question. - * - * @param string|int|null $default - * - * @return mixed - */ - public function choice(string $question, array $choices, $default = null); - - /** - * Add newline(s). - */ - public function newLine(int $count = 1); - - /** - * Starts the progress output. - */ - public function progressStart(int $max = 0); - - /** - * Advances the progress output X steps. - */ - public function progressAdvance(int $step = 1); - - /** - * Finishes the progress output. - */ - public function progressFinish(); -} diff --git a/vendor/symfony/console/Style/SymfonyStyle.php b/vendor/symfony/console/Style/SymfonyStyle.php deleted file mode 100644 index e3c5ac8e7..000000000 --- a/vendor/symfony/console/Style/SymfonyStyle.php +++ /dev/null @@ -1,518 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Style; - -use Symfony\Component\Console\Exception\InvalidArgumentException; -use Symfony\Component\Console\Exception\RuntimeException; -use Symfony\Component\Console\Formatter\OutputFormatter; -use Symfony\Component\Console\Helper\Helper; -use Symfony\Component\Console\Helper\ProgressBar; -use Symfony\Component\Console\Helper\SymfonyQuestionHelper; -use Symfony\Component\Console\Helper\Table; -use Symfony\Component\Console\Helper\TableCell; -use Symfony\Component\Console\Helper\TableSeparator; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutputInterface; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\TrimmedBufferOutput; -use Symfony\Component\Console\Question\ChoiceQuestion; -use Symfony\Component\Console\Question\ConfirmationQuestion; -use Symfony\Component\Console\Question\Question; -use Symfony\Component\Console\Terminal; - -/** - * Output decorator helpers for the Symfony Style Guide. - * - * @author Kevin Bond - */ -class SymfonyStyle extends OutputStyle -{ - public const MAX_LINE_LENGTH = 120; - - private $input; - private $output; - private $questionHelper; - private $progressBar; - private $lineLength; - private $bufferedOutput; - - public function __construct(InputInterface $input, OutputInterface $output) - { - $this->input = $input; - $this->bufferedOutput = new TrimmedBufferOutput(\DIRECTORY_SEPARATOR === '\\' ? 4 : 2, $output->getVerbosity(), false, clone $output->getFormatter()); - // Windows cmd wraps lines as soon as the terminal width is reached, whether there are following chars or not. - $width = (new Terminal())->getWidth() ?: self::MAX_LINE_LENGTH; - $this->lineLength = min($width - (int) (\DIRECTORY_SEPARATOR === '\\'), self::MAX_LINE_LENGTH); - - parent::__construct($this->output = $output); - } - - /** - * Formats a message as a block of text. - * - * @param string|array $messages The message to write in the block - */ - public function block($messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = true) - { - $messages = \is_array($messages) ? array_values($messages) : [$messages]; - - $this->autoPrependBlock(); - $this->writeln($this->createBlock($messages, $type, $style, $prefix, $padding, $escape)); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function title(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('=', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function section(string $message) - { - $this->autoPrependBlock(); - $this->writeln([ - sprintf('%s', OutputFormatter::escapeTrailingBackslash($message)), - sprintf('%s', str_repeat('-', Helper::width(Helper::removeDecoration($this->getFormatter(), $message)))), - ]); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function listing(array $elements) - { - $this->autoPrependText(); - $elements = array_map(function ($element) { - return sprintf(' * %s', $element); - }, $elements); - - $this->writeln($elements); - $this->newLine(); - } - - /** - * {@inheritdoc} - */ - public function text($message) - { - $this->autoPrependText(); - - $messages = \is_array($message) ? array_values($message) : [$message]; - foreach ($messages as $message) { - $this->writeln(sprintf(' %s', $message)); - } - } - - /** - * Formats a command comment. - * - * @param string|array $message - */ - public function comment($message) - { - $this->block($message, null, null, ' // ', false, false); - } - - /** - * {@inheritdoc} - */ - public function success($message) - { - $this->block($message, 'OK', 'fg=black;bg=green', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function error($message) - { - $this->block($message, 'ERROR', 'fg=white;bg=red', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function warning($message) - { - $this->block($message, 'WARNING', 'fg=black;bg=yellow', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function note($message) - { - $this->block($message, 'NOTE', 'fg=yellow', ' ! '); - } - - /** - * Formats an info message. - * - * @param string|array $message - */ - public function info($message) - { - $this->block($message, 'INFO', 'fg=green', ' ', true); - } - - /** - * {@inheritdoc} - */ - public function caution($message) - { - $this->block($message, 'CAUTION', 'fg=white;bg=red', ' ! ', true); - } - - /** - * {@inheritdoc} - */ - public function table(array $headers, array $rows) - { - $this->createTable() - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a horizontal table. - */ - public function horizontalTable(array $headers, array $rows) - { - $this->createTable() - ->setHorizontal(true) - ->setHeaders($headers) - ->setRows($rows) - ->render() - ; - - $this->newLine(); - } - - /** - * Formats a list of key/value horizontally. - * - * Each row can be one of: - * * 'A title' - * * ['key' => 'value'] - * * new TableSeparator() - * - * @param string|array|TableSeparator ...$list - */ - public function definitionList(...$list) - { - $headers = []; - $row = []; - foreach ($list as $value) { - if ($value instanceof TableSeparator) { - $headers[] = $value; - $row[] = $value; - continue; - } - if (\is_string($value)) { - $headers[] = new TableCell($value, ['colspan' => 2]); - $row[] = null; - continue; - } - if (!\is_array($value)) { - throw new InvalidArgumentException('Value should be an array, string, or an instance of TableSeparator.'); - } - $headers[] = key($value); - $row[] = current($value); - } - - $this->horizontalTable($headers, [$row]); - } - - /** - * {@inheritdoc} - */ - public function ask(string $question, string $default = null, callable $validator = null) - { - $question = new Question($question, $default); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function askHidden(string $question, callable $validator = null) - { - $question = new Question($question); - - $question->setHidden(true); - $question->setValidator($validator); - - return $this->askQuestion($question); - } - - /** - * {@inheritdoc} - */ - public function confirm(string $question, bool $default = true) - { - return $this->askQuestion(new ConfirmationQuestion($question, $default)); - } - - /** - * {@inheritdoc} - */ - public function choice(string $question, array $choices, $default = null) - { - if (null !== $default) { - $values = array_flip($choices); - $default = $values[$default] ?? $default; - } - - return $this->askQuestion(new ChoiceQuestion($question, $choices, $default)); - } - - /** - * {@inheritdoc} - */ - public function progressStart(int $max = 0) - { - $this->progressBar = $this->createProgressBar($max); - $this->progressBar->start(); - } - - /** - * {@inheritdoc} - */ - public function progressAdvance(int $step = 1) - { - $this->getProgressBar()->advance($step); - } - - /** - * {@inheritdoc} - */ - public function progressFinish() - { - $this->getProgressBar()->finish(); - $this->newLine(2); - $this->progressBar = null; - } - - /** - * {@inheritdoc} - */ - public function createProgressBar(int $max = 0) - { - $progressBar = parent::createProgressBar($max); - - if ('\\' !== \DIRECTORY_SEPARATOR || 'Hyper' === getenv('TERM_PROGRAM')) { - $progressBar->setEmptyBarCharacter('░'); // light shade character \u2591 - $progressBar->setProgressCharacter(''); - $progressBar->setBarCharacter('▓'); // dark shade character \u2593 - } - - return $progressBar; - } - - /** - * @see ProgressBar::iterate() - */ - public function progressIterate(iterable $iterable, int $max = null): iterable - { - yield from $this->createProgressBar()->iterate($iterable, $max); - - $this->newLine(2); - } - - /** - * @return mixed - */ - public function askQuestion(Question $question) - { - if ($this->input->isInteractive()) { - $this->autoPrependBlock(); - } - - if (!$this->questionHelper) { - $this->questionHelper = new SymfonyQuestionHelper(); - } - - $answer = $this->questionHelper->ask($this->input, $this, $question); - - if ($this->input->isInteractive()) { - $this->newLine(); - $this->bufferedOutput->write("\n"); - } - - return $answer; - } - - /** - * {@inheritdoc} - */ - public function writeln($messages, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::writeln($message, $type); - $this->writeBuffer($message, true, $type); - } - } - - /** - * {@inheritdoc} - */ - public function write($messages, bool $newline = false, int $type = self::OUTPUT_NORMAL) - { - if (!is_iterable($messages)) { - $messages = [$messages]; - } - - foreach ($messages as $message) { - parent::write($message, $newline, $type); - $this->writeBuffer($message, $newline, $type); - } - } - - /** - * {@inheritdoc} - */ - public function newLine(int $count = 1) - { - parent::newLine($count); - $this->bufferedOutput->write(str_repeat("\n", $count)); - } - - /** - * Returns a new instance which makes use of stderr if available. - * - * @return self - */ - public function getErrorStyle() - { - return new self($this->input, $this->getErrorOutput()); - } - - public function createTable(): Table - { - $output = $this->output instanceof ConsoleOutputInterface ? $this->output->section() : $this->output; - $style = clone Table::getStyleDefinition('symfony-style-guide'); - $style->setCellHeaderFormat('%s'); - - return (new Table($output))->setStyle($style); - } - - private function getProgressBar(): ProgressBar - { - if (!$this->progressBar) { - throw new RuntimeException('The ProgressBar is not started.'); - } - - return $this->progressBar; - } - - private function autoPrependBlock(): void - { - $chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2); - - if (!isset($chars[0])) { - $this->newLine(); // empty history, so we should start with a new line. - - return; - } - // Prepend new line for each non LF chars (This means no blank line was output before) - $this->newLine(2 - substr_count($chars, "\n")); - } - - private function autoPrependText(): void - { - $fetched = $this->bufferedOutput->fetch(); - // Prepend new line if last char isn't EOL: - if (!str_ends_with($fetched, "\n")) { - $this->newLine(); - } - } - - private function writeBuffer(string $message, bool $newLine, int $type): void - { - // We need to know if the last chars are PHP_EOL - $this->bufferedOutput->write($message, $newLine, $type); - } - - private function createBlock(iterable $messages, string $type = null, string $style = null, string $prefix = ' ', bool $padding = false, bool $escape = false): array - { - $indentLength = 0; - $prefixLength = Helper::width(Helper::removeDecoration($this->getFormatter(), $prefix)); - $lines = []; - - if (null !== $type) { - $type = sprintf('[%s] ', $type); - $indentLength = \strlen($type); - $lineIndentation = str_repeat(' ', $indentLength); - } - - // wrap and add newlines for each element - foreach ($messages as $key => $message) { - if ($escape) { - $message = OutputFormatter::escape($message); - } - - $decorationLength = Helper::width($message) - Helper::width(Helper::removeDecoration($this->getFormatter(), $message)); - $messageLineLength = min($this->lineLength - $prefixLength - $indentLength + $decorationLength, $this->lineLength); - $messageLines = explode(\PHP_EOL, wordwrap($message, $messageLineLength, \PHP_EOL, true)); - foreach ($messageLines as $messageLine) { - $lines[] = $messageLine; - } - - if (\count($messages) > 1 && $key < \count($messages) - 1) { - $lines[] = ''; - } - } - - $firstLineIndex = 0; - if ($padding && $this->isDecorated()) { - $firstLineIndex = 1; - array_unshift($lines, ''); - $lines[] = ''; - } - - foreach ($lines as $i => &$line) { - if (null !== $type) { - $line = $firstLineIndex === $i ? $type.$line : $lineIndentation.$line; - } - - $line = $prefix.$line; - $line .= str_repeat(' ', max($this->lineLength - Helper::width(Helper::removeDecoration($this->getFormatter(), $line)), 0)); - - if ($style) { - $line = sprintf('<%s>%s', $style, $line); - } - } - - return $lines; - } -} diff --git a/vendor/symfony/console/Terminal.php b/vendor/symfony/console/Terminal.php deleted file mode 100644 index b91e8afc5..000000000 --- a/vendor/symfony/console/Terminal.php +++ /dev/null @@ -1,177 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console; - -class Terminal -{ - private static $width; - private static $height; - private static $stty; - - /** - * Gets the terminal width. - * - * @return int - */ - public function getWidth() - { - $width = getenv('COLUMNS'); - if (false !== $width) { - return (int) trim($width); - } - - if (null === self::$width) { - self::initDimensions(); - } - - return self::$width ?: 80; - } - - /** - * Gets the terminal height. - * - * @return int - */ - public function getHeight() - { - $height = getenv('LINES'); - if (false !== $height) { - return (int) trim($height); - } - - if (null === self::$height) { - self::initDimensions(); - } - - return self::$height ?: 50; - } - - /** - * @internal - */ - public static function hasSttyAvailable(): bool - { - if (null !== self::$stty) { - return self::$stty; - } - - // skip check if shell_exec function is disabled - if (!\function_exists('shell_exec')) { - return false; - } - - return self::$stty = (bool) shell_exec('stty 2> '.('\\' === \DIRECTORY_SEPARATOR ? 'NUL' : '/dev/null')); - } - - private static function initDimensions() - { - if ('\\' === \DIRECTORY_SEPARATOR) { - $ansicon = getenv('ANSICON'); - if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) { - // extract [w, H] from "wxh (WxH)" - // or [w, h] from "wxh" - self::$width = (int) $matches[1]; - self::$height = isset($matches[4]) ? (int) $matches[4] : (int) $matches[2]; - } elseif (!self::hasVt100Support() && self::hasSttyAvailable()) { - // only use stty on Windows if the terminal does not support vt100 (e.g. Windows 7 + git-bash) - // testing for stty in a Windows 10 vt100-enabled console will implicitly disable vt100 support on STDOUT - self::initDimensionsUsingStty(); - } elseif (null !== $dimensions = self::getConsoleMode()) { - // extract [w, h] from "wxh" - self::$width = (int) $dimensions[0]; - self::$height = (int) $dimensions[1]; - } - } else { - self::initDimensionsUsingStty(); - } - } - - /** - * Returns whether STDOUT has vt100 support (some Windows 10+ configurations). - */ - private static function hasVt100Support(): bool - { - return \function_exists('sapi_windows_vt100_support') && sapi_windows_vt100_support(fopen('php://stdout', 'w')); - } - - /** - * Initializes dimensions using the output of an stty columns line. - */ - private static function initDimensionsUsingStty() - { - if ($sttyString = self::getSttyColumns()) { - if (preg_match('/rows.(\d+);.columns.(\d+);/i', $sttyString, $matches)) { - // extract [w, h] from "rows h; columns w;" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } elseif (preg_match('/;.(\d+).rows;.(\d+).columns/i', $sttyString, $matches)) { - // extract [w, h] from "; h rows; w columns" - self::$width = (int) $matches[2]; - self::$height = (int) $matches[1]; - } - } - } - - /** - * Runs and parses mode CON if it's available, suppressing any error output. - * - * @return int[]|null An array composed of the width and the height or null if it could not be parsed - */ - private static function getConsoleMode(): ?array - { - $info = self::readFromProcess('mode CON'); - - if (null === $info || !preg_match('/--------+\r?\n.+?(\d+)\r?\n.+?(\d+)\r?\n/', $info, $matches)) { - return null; - } - - return [(int) $matches[2], (int) $matches[1]]; - } - - /** - * Runs and parses stty -a if it's available, suppressing any error output. - */ - private static function getSttyColumns(): ?string - { - return self::readFromProcess('stty -a | grep columns'); - } - - private static function readFromProcess(string $command): ?string - { - if (!\function_exists('proc_open')) { - return null; - } - - $descriptorspec = [ - 1 => ['pipe', 'w'], - 2 => ['pipe', 'w'], - ]; - - $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0; - - $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]); - if (!\is_resource($process)) { - return null; - } - - $info = stream_get_contents($pipes[1]); - fclose($pipes[1]); - fclose($pipes[2]); - proc_close($process); - - if ($cp) { - sapi_windows_cp_set($cp); - } - - return $info; - } -} diff --git a/vendor/symfony/console/Tester/ApplicationTester.php b/vendor/symfony/console/Tester/ApplicationTester.php deleted file mode 100644 index 3a262e81c..000000000 --- a/vendor/symfony/console/Tester/ApplicationTester.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console applications. - * - * When testing an application, don't forget to disable the auto exit flag: - * - * $application = new Application(); - * $application->setAutoExit(false); - * - * @author Fabien Potencier - */ -class ApplicationTester -{ - use TesterTrait; - - private $application; - - public function __construct(Application $application) - { - $this->application = $application; - } - - /** - * Executes the application. - * - * Available options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @return int The command exit code - */ - public function run(array $input, array $options = []) - { - $prevShellVerbosity = getenv('SHELL_VERBOSITY'); - - try { - $this->input = new ArrayInput($input); - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if ($this->inputs) { - $this->input->setStream(self::createStream($this->inputs)); - } - - $this->initOutput($options); - - return $this->statusCode = $this->application->run($this->input, $this->output); - } finally { - // SHELL_VERBOSITY is set by Application::configureIO so we need to unset/reset it - // to its previous value to avoid one test's verbosity to spread to the following tests - if (false === $prevShellVerbosity) { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY'); - } - unset($_ENV['SHELL_VERBOSITY']); - unset($_SERVER['SHELL_VERBOSITY']); - } else { - if (\function_exists('putenv')) { - @putenv('SHELL_VERBOSITY='.$prevShellVerbosity); - } - $_ENV['SHELL_VERBOSITY'] = $prevShellVerbosity; - $_SERVER['SHELL_VERBOSITY'] = $prevShellVerbosity; - } - } - } -} diff --git a/vendor/symfony/console/Tester/CommandCompletionTester.php b/vendor/symfony/console/Tester/CommandCompletionTester.php deleted file mode 100644 index ade732752..000000000 --- a/vendor/symfony/console/Tester/CommandCompletionTester.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Completion\CompletionInput; -use Symfony\Component\Console\Completion\CompletionSuggestions; - -/** - * Eases the testing of command completion. - * - * @author Jérôme Tamarelle - */ -class CommandCompletionTester -{ - private $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Create completion suggestions from input tokens. - */ - public function complete(array $input): array - { - $currentIndex = \count($input); - if ('' === end($input)) { - array_pop($input); - } - array_unshift($input, $this->command->getName()); - - $completionInput = CompletionInput::fromTokens($input, $currentIndex); - $completionInput->bind($this->command->getDefinition()); - $suggestions = new CompletionSuggestions(); - - $this->command->complete($completionInput, $suggestions); - - $options = []; - foreach ($suggestions->getOptionSuggestions() as $option) { - $options[] = '--'.$option->getName(); - } - - return array_map('strval', array_merge($options, $suggestions->getValueSuggestions())); - } -} diff --git a/vendor/symfony/console/Tester/CommandTester.php b/vendor/symfony/console/Tester/CommandTester.php deleted file mode 100644 index 6c15c25fb..000000000 --- a/vendor/symfony/console/Tester/CommandTester.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; - -/** - * Eases the testing of console commands. - * - * @author Fabien Potencier - * @author Robin Chalas - */ -class CommandTester -{ - use TesterTrait; - - private $command; - - public function __construct(Command $command) - { - $this->command = $command; - } - - /** - * Executes the command. - * - * Available execution options: - * - * * interactive: Sets the input interactive flag - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - * - * @param array $input An array of command arguments and options - * @param array $options An array of execution options - * - * @return int The command exit code - */ - public function execute(array $input, array $options = []) - { - // set the command name automatically if the application requires - // this argument and no command name was passed - if (!isset($input['command']) - && (null !== $application = $this->command->getApplication()) - && $application->getDefinition()->hasArgument('command') - ) { - $input = array_merge(['command' => $this->command->getName()], $input); - } - - $this->input = new ArrayInput($input); - // Use an in-memory input stream even if no inputs are set so that QuestionHelper::ask() does not rely on the blocking STDIN. - $this->input->setStream(self::createStream($this->inputs)); - - if (isset($options['interactive'])) { - $this->input->setInteractive($options['interactive']); - } - - if (!isset($options['decorated'])) { - $options['decorated'] = false; - } - - $this->initOutput($options); - - return $this->statusCode = $this->command->run($this->input, $this->output); - } -} diff --git a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php b/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php deleted file mode 100644 index a47324237..000000000 --- a/vendor/symfony/console/Tester/Constraint/CommandIsSuccessful.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester\Constraint; - -use PHPUnit\Framework\Constraint\Constraint; -use Symfony\Component\Console\Command\Command; - -final class CommandIsSuccessful extends Constraint -{ - /** - * {@inheritdoc} - */ - public function toString(): string - { - return 'is successful'; - } - - /** - * {@inheritdoc} - */ - protected function matches($other): bool - { - return Command::SUCCESS === $other; - } - - /** - * {@inheritdoc} - */ - protected function failureDescription($other): string - { - return 'the command '.$this->toString(); - } - - /** - * {@inheritdoc} - */ - protected function additionalFailureDescription($other): string - { - $mapping = [ - Command::FAILURE => 'Command failed.', - Command::INVALID => 'Command was invalid.', - ]; - - return $mapping[$other] ?? sprintf('Command returned exit status %d.', $other); - } -} diff --git a/vendor/symfony/console/Tester/TesterTrait.php b/vendor/symfony/console/Tester/TesterTrait.php deleted file mode 100644 index f454bbf9d..000000000 --- a/vendor/symfony/console/Tester/TesterTrait.php +++ /dev/null @@ -1,197 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Console\Tester; - -use PHPUnit\Framework\Assert; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\ConsoleOutput; -use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Console\Output\StreamOutput; -use Symfony\Component\Console\Tester\Constraint\CommandIsSuccessful; - -/** - * @author Amrouche Hamza - */ -trait TesterTrait -{ - /** @var StreamOutput */ - private $output; - private $inputs = []; - private $captureStreamsIndependently = false; - /** @var InputInterface */ - private $input; - /** @var int */ - private $statusCode; - - /** - * Gets the display returned by the last execution of the command or application. - * - * @return string - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getDisplay(bool $normalize = false) - { - if (null === $this->output) { - throw new \RuntimeException('Output not initialized, did you execute the command before requesting the display?'); - } - - rewind($this->output->getStream()); - - $display = stream_get_contents($this->output->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the output written to STDERR by the application. - * - * @param bool $normalize Whether to normalize end of lines to \n or not - * - * @return string - */ - public function getErrorOutput(bool $normalize = false) - { - if (!$this->captureStreamsIndependently) { - throw new \LogicException('The error output is not available when the tester is run without "capture_stderr_separately" option set.'); - } - - rewind($this->output->getErrorOutput()->getStream()); - - $display = stream_get_contents($this->output->getErrorOutput()->getStream()); - - if ($normalize) { - $display = str_replace(\PHP_EOL, "\n", $display); - } - - return $display; - } - - /** - * Gets the input instance used by the last execution of the command or application. - * - * @return InputInterface - */ - public function getInput() - { - return $this->input; - } - - /** - * Gets the output instance used by the last execution of the command or application. - * - * @return OutputInterface - */ - public function getOutput() - { - return $this->output; - } - - /** - * Gets the status code returned by the last execution of the command or application. - * - * @return int - * - * @throws \RuntimeException If it's called before the execute method - */ - public function getStatusCode() - { - if (null === $this->statusCode) { - throw new \RuntimeException('Status code not initialized, did you execute the command before requesting the status code?'); - } - - return $this->statusCode; - } - - public function assertCommandIsSuccessful(string $message = ''): void - { - Assert::assertThat($this->statusCode, new CommandIsSuccessful(), $message); - } - - /** - * Sets the user inputs. - * - * @param array $inputs An array of strings representing each input - * passed to the command input stream - * - * @return $this - */ - public function setInputs(array $inputs) - { - $this->inputs = $inputs; - - return $this; - } - - /** - * Initializes the output property. - * - * Available options: - * - * * decorated: Sets the output decorated flag - * * verbosity: Sets the output verbosity flag - * * capture_stderr_separately: Make output of stdOut and stdErr separately available - */ - private function initOutput(array $options) - { - $this->captureStreamsIndependently = \array_key_exists('capture_stderr_separately', $options) && $options['capture_stderr_separately']; - if (!$this->captureStreamsIndependently) { - $this->output = new StreamOutput(fopen('php://memory', 'w', false)); - if (isset($options['decorated'])) { - $this->output->setDecorated($options['decorated']); - } - if (isset($options['verbosity'])) { - $this->output->setVerbosity($options['verbosity']); - } - } else { - $this->output = new ConsoleOutput( - $options['verbosity'] ?? ConsoleOutput::VERBOSITY_NORMAL, - $options['decorated'] ?? null - ); - - $errorOutput = new StreamOutput(fopen('php://memory', 'w', false)); - $errorOutput->setFormatter($this->output->getFormatter()); - $errorOutput->setVerbosity($this->output->getVerbosity()); - $errorOutput->setDecorated($this->output->isDecorated()); - - $reflectedOutput = new \ReflectionObject($this->output); - $strErrProperty = $reflectedOutput->getProperty('stderr'); - $strErrProperty->setAccessible(true); - $strErrProperty->setValue($this->output, $errorOutput); - - $reflectedParent = $reflectedOutput->getParentClass(); - $streamProperty = $reflectedParent->getProperty('stream'); - $streamProperty->setAccessible(true); - $streamProperty->setValue($this->output, fopen('php://memory', 'w', false)); - } - } - - /** - * @return resource - */ - private static function createStream(array $inputs) - { - $stream = fopen('php://memory', 'r+', false); - - foreach ($inputs as $input) { - fwrite($stream, $input.\PHP_EOL); - } - - rewind($stream); - - return $stream; - } -} diff --git a/vendor/symfony/console/composer.json b/vendor/symfony/console/composer.json deleted file mode 100644 index 4fa4964a1..000000000 --- a/vendor/symfony/console/composer.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "symfony/console", - "type": "library", - "description": "Eases the creation of beautiful and testable command line interfaces", - "keywords": ["console", "cli", "command-line", "terminal"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php73": "^1.9", - "symfony/polyfill-php80": "^1.16", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.1|^6.0" - }, - "require-dev": { - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/event-dispatcher": "^4.4|^5.0|^6.0", - "symfony/dependency-injection": "^4.4|^5.0|^6.0", - "symfony/lock": "^4.4|^5.0|^6.0", - "symfony/process": "^4.4|^5.0|^6.0", - "symfony/var-dumper": "^4.4|^5.0|^6.0", - "psr/log": "^1|^2" - }, - "provide": { - "psr/log-implementation": "1.0|2.0" - }, - "suggest": { - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "", - "psr/log": "For using the console logger" - }, - "conflict": { - "psr/log": ">=3", - "symfony/dependency-injection": "<4.4", - "symfony/dotenv": "<5.1", - "symfony/event-dispatcher": "<4.4", - "symfony/lock": "<4.4", - "symfony/process": "<4.4" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Console\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/deprecation-contracts/CHANGELOG.md b/vendor/symfony/deprecation-contracts/CHANGELOG.md deleted file mode 100644 index 7932e2613..000000000 --- a/vendor/symfony/deprecation-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/deprecation-contracts/README.md b/vendor/symfony/deprecation-contracts/README.md deleted file mode 100644 index 9814864c0..000000000 --- a/vendor/symfony/deprecation-contracts/README.md +++ /dev/null @@ -1,26 +0,0 @@ -Symfony Deprecation Contracts -============================= - -A generic function and convention to trigger deprecation notices. - -This package provides a single global function named `trigger_deprecation()` that triggers silenced deprecation notices. - -By using a custom PHP error handler such as the one provided by the Symfony ErrorHandler component, -the triggered deprecations can be caught and logged for later discovery, both on dev and prod environments. - -The function requires at least 3 arguments: - - the name of the Composer package that is triggering the deprecation - - the version of the package that introduced the deprecation - - the message of the deprecation - - more arguments can be provided: they will be inserted in the message using `printf()` formatting - -Example: -```php -trigger_deprecation('symfony/blockchain', '8.9', 'Using "%s" is deprecated, use "%s" instead.', 'bitcoin', 'fabcoin'); -``` - -This will generate the following message: -`Since symfony/blockchain 8.9: Using "bitcoin" is deprecated, use "fabcoin" instead.` - -While not recommended, the deprecation notices can be completely ignored by declaring an empty -`function trigger_deprecation() {}` in your application. diff --git a/vendor/symfony/deprecation-contracts/composer.json b/vendor/symfony/deprecation-contracts/composer.json deleted file mode 100644 index c6d02d874..000000000 --- a/vendor/symfony/deprecation-contracts/composer.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "symfony/deprecation-contracts", - "type": "library", - "description": "A generic function and convention to trigger deprecation notices", - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1" - }, - "autoload": { - "files": [ - "function.php" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/deprecation-contracts/function.php b/vendor/symfony/deprecation-contracts/function.php deleted file mode 100644 index 2d56512ba..000000000 --- a/vendor/symfony/deprecation-contracts/function.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (!function_exists('trigger_deprecation')) { - /** - * Triggers a silenced deprecation notice. - * - * @param string $package The name of the Composer package that is triggering the deprecation - * @param string $version The version of the package that introduced the deprecation - * @param string $message The message of the deprecation - * @param mixed ...$args Values to insert in the message using printf() formatting - * - * @author Nicolas Grekas - */ - 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); - } -} diff --git a/vendor/symfony/finder/CHANGELOG.md b/vendor/symfony/finder/CHANGELOG.md deleted file mode 100644 index 6a44e87c2..000000000 --- a/vendor/symfony/finder/CHANGELOG.md +++ /dev/null @@ -1,87 +0,0 @@ -CHANGELOG -========= - -5.4.0 ------ - - * Deprecate `Comparator::setTarget()` and `Comparator::setOperator()` - * Add a constructor to `Comparator` that allows setting target and operator - * Finder's iterator has now `Symfony\Component\Finder\SplFileInfo` inner type specified - * Add recursive .gitignore files support - -5.0.0 ------ - - * added `$useNaturalSort` argument to `Finder::sortByName()` - -4.3.0 ------ - - * added Finder::ignoreVCSIgnored() to ignore files based on rules listed in .gitignore - -4.2.0 ------ - - * added $useNaturalSort option to Finder::sortByName() method - * the `Finder::sortByName()` method will have a new `$useNaturalSort` - argument in version 5.0, not defining it is deprecated - * added `Finder::reverseSorting()` to reverse the sorting - -4.0.0 ------ - - * removed `ExceptionInterface` - * removed `Symfony\Component\Finder\Iterator\FilterIterator` - -3.4.0 ------ - - * deprecated `Symfony\Component\Finder\Iterator\FilterIterator` - * added Finder::hasResults() method to check if any results were found - -3.3.0 ------ - - * added double-star matching to Glob::toRegex() - -3.0.0 ------ - - * removed deprecated classes - -2.8.0 ------ - - * deprecated adapters and related classes - -2.5.0 ------ - * added support for GLOB_BRACE in the paths passed to Finder::in() - -2.3.0 ------ - - * added a way to ignore unreadable directories (via Finder::ignoreUnreadableDirs()) - * unified the way subfolders that are not executable are handled by always throwing an AccessDeniedException exception - -2.2.0 ------ - - * added Finder::path() and Finder::notPath() methods - * added finder adapters to improve performance on specific platforms - * added support for wildcard characters (glob patterns) in the paths passed - to Finder::in() - -2.1.0 ------ - - * added Finder::sortByAccessedTime(), Finder::sortByChangedTime(), and - Finder::sortByModifiedTime() - * added Countable to Finder - * added support for an array of directories as an argument to - Finder::exclude() - * added searching based on the file content via Finder::contains() and - Finder::notContains() - * added support for the != operator in the Comparator - * [BC BREAK] filter expressions (used for file name and content) are no more - considered as regexps but glob patterns when they are enclosed in '*' or '?' diff --git a/vendor/symfony/finder/Comparator/Comparator.php b/vendor/symfony/finder/Comparator/Comparator.php deleted file mode 100644 index 3af551f4c..000000000 --- a/vendor/symfony/finder/Comparator/Comparator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * @author Fabien Potencier - */ -class Comparator -{ - private $target; - private $operator = '=='; - - public function __construct(string $target = null, string $operator = '==') - { - if (null === $target) { - trigger_deprecation('symfony/finder', '5.4', 'Constructing a "%s" without setting "$target" is deprecated.', __CLASS__); - } - - $this->target = $target; - $this->doSetOperator($operator); - } - - /** - * Gets the target value. - * - * @return string - */ - public function getTarget() - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - return $this->target; - } - - /** - * @deprecated set the target via the constructor instead - */ - public function setTarget(string $target) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the target via the constructor instead.', __METHOD__); - - $this->target = $target; - } - - /** - * Gets the comparison operator. - * - * @return string - */ - public function getOperator() - { - return $this->operator; - } - - /** - * Sets the comparison operator. - * - * @throws \InvalidArgumentException - * - * @deprecated set the operator via the constructor instead - */ - public function setOperator(string $operator) - { - trigger_deprecation('symfony/finder', '5.4', '"%s" is deprecated. Set the operator via the constructor instead.', __METHOD__); - - $this->doSetOperator('' === $operator ? '==' : $operator); - } - - /** - * Tests against the target. - * - * @param mixed $test A test value - * - * @return bool - */ - public function test($test) - { - if (null === $this->target) { - trigger_deprecation('symfony/finder', '5.4', 'Calling "%s" without initializing the target is deprecated.', __METHOD__); - } - - switch ($this->operator) { - case '>': - return $test > $this->target; - case '>=': - return $test >= $this->target; - case '<': - return $test < $this->target; - case '<=': - return $test <= $this->target; - case '!=': - return $test != $this->target; - } - - return $test == $this->target; - } - - private function doSetOperator(string $operator): void - { - if (!\in_array($operator, ['>', '<', '>=', '<=', '==', '!='])) { - throw new \InvalidArgumentException(sprintf('Invalid operator "%s".', $operator)); - } - - $this->operator = $operator; - } -} diff --git a/vendor/symfony/finder/Comparator/DateComparator.php b/vendor/symfony/finder/Comparator/DateComparator.php deleted file mode 100644 index 8f651e148..000000000 --- a/vendor/symfony/finder/Comparator/DateComparator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * DateCompare compiles date comparisons. - * - * @author Fabien Potencier - */ -class DateComparator extends Comparator -{ - /** - * @param string $test A comparison string - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(string $test) - { - if (!preg_match('#^\s*(==|!=|[<>]=?|after|since|before|until)?\s*(.+?)\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a date test.', $test)); - } - - try { - $date = new \DateTime($matches[2]); - $target = $date->format('U'); - } catch (\Exception $e) { - throw new \InvalidArgumentException(sprintf('"%s" is not a valid date.', $matches[2])); - } - - $operator = $matches[1] ?? '=='; - if ('since' === $operator || 'after' === $operator) { - $operator = '>'; - } - - if ('until' === $operator || 'before' === $operator) { - $operator = '<'; - } - - parent::__construct($target, $operator); - } -} diff --git a/vendor/symfony/finder/Comparator/NumberComparator.php b/vendor/symfony/finder/Comparator/NumberComparator.php deleted file mode 100644 index dd3082077..000000000 --- a/vendor/symfony/finder/Comparator/NumberComparator.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Comparator; - -/** - * NumberComparator compiles a simple comparison to an anonymous - * subroutine, which you can call with a value to be tested again. - * - * Now this would be very pointless, if NumberCompare didn't understand - * magnitudes. - * - * The target value may use magnitudes of kilobytes (k, ki), - * megabytes (m, mi), or gigabytes (g, gi). Those suffixed - * with an i use the appropriate 2**n version in accordance with the - * IEC standard: http://physics.nist.gov/cuu/Units/binary.html - * - * Based on the Perl Number::Compare module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - * - * @see http://physics.nist.gov/cuu/Units/binary.html - */ -class NumberComparator extends Comparator -{ - /** - * @param string|null $test A comparison string or null - * - * @throws \InvalidArgumentException If the test is not understood - */ - public function __construct(?string $test) - { - if (null === $test || !preg_match('#^\s*(==|!=|[<>]=?)?\s*([0-9\.]+)\s*([kmg]i?)?\s*$#i', $test, $matches)) { - throw new \InvalidArgumentException(sprintf('Don\'t understand "%s" as a number test.', $test ?? 'null')); - } - - $target = $matches[2]; - if (!is_numeric($target)) { - throw new \InvalidArgumentException(sprintf('Invalid number "%s".', $target)); - } - if (isset($matches[3])) { - // magnitude - switch (strtolower($matches[3])) { - case 'k': - $target *= 1000; - break; - case 'ki': - $target *= 1024; - break; - case 'm': - $target *= 1000000; - break; - case 'mi': - $target *= 1024 * 1024; - break; - case 'g': - $target *= 1000000000; - break; - case 'gi': - $target *= 1024 * 1024 * 1024; - break; - } - } - - parent::__construct($target, $matches[1] ?: '=='); - } -} diff --git a/vendor/symfony/finder/Exception/AccessDeniedException.php b/vendor/symfony/finder/Exception/AccessDeniedException.php deleted file mode 100644 index ee195ea8d..000000000 --- a/vendor/symfony/finder/Exception/AccessDeniedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Jean-François Simon - */ -class AccessDeniedException extends \UnexpectedValueException -{ -} diff --git a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php b/vendor/symfony/finder/Exception/DirectoryNotFoundException.php deleted file mode 100644 index c6cc0f273..000000000 --- a/vendor/symfony/finder/Exception/DirectoryNotFoundException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Exception; - -/** - * @author Andreas Erhard - */ -class DirectoryNotFoundException extends \InvalidArgumentException -{ -} diff --git a/vendor/symfony/finder/Finder.php b/vendor/symfony/finder/Finder.php deleted file mode 100644 index 8cc564cd6..000000000 --- a/vendor/symfony/finder/Finder.php +++ /dev/null @@ -1,806 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -use Symfony\Component\Finder\Comparator\DateComparator; -use Symfony\Component\Finder\Comparator\NumberComparator; -use Symfony\Component\Finder\Exception\DirectoryNotFoundException; -use Symfony\Component\Finder\Iterator\CustomFilterIterator; -use Symfony\Component\Finder\Iterator\DateRangeFilterIterator; -use Symfony\Component\Finder\Iterator\DepthRangeFilterIterator; -use Symfony\Component\Finder\Iterator\ExcludeDirectoryFilterIterator; -use Symfony\Component\Finder\Iterator\FilecontentFilterIterator; -use Symfony\Component\Finder\Iterator\FilenameFilterIterator; -use Symfony\Component\Finder\Iterator\LazyIterator; -use Symfony\Component\Finder\Iterator\SizeRangeFilterIterator; -use Symfony\Component\Finder\Iterator\SortableIterator; - -/** - * Finder allows to build rules to find files and directories. - * - * It is a thin wrapper around several specialized iterator classes. - * - * All rules may be invoked several times. - * - * All methods return the current Finder object to allow chaining: - * - * $finder = Finder::create()->files()->name('*.php')->in(__DIR__); - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class Finder implements \IteratorAggregate, \Countable -{ - public const IGNORE_VCS_FILES = 1; - public const IGNORE_DOT_FILES = 2; - public const IGNORE_VCS_IGNORED_FILES = 4; - - private $mode = 0; - private $names = []; - private $notNames = []; - private $exclude = []; - private $filters = []; - private $depths = []; - private $sizes = []; - private $followLinks = false; - private $reverseSorting = false; - private $sort = false; - private $ignore = 0; - private $dirs = []; - private $dates = []; - private $iterators = []; - private $contains = []; - private $notContains = []; - private $paths = []; - private $notPaths = []; - private $ignoreUnreadableDirs = false; - - private static $vcsPatterns = ['.svn', '_svn', 'CVS', '_darcs', '.arch-params', '.monotone', '.bzr', '.git', '.hg']; - - public function __construct() - { - $this->ignore = static::IGNORE_VCS_FILES | static::IGNORE_DOT_FILES; - } - - /** - * Creates a new Finder. - * - * @return static - */ - public static function create() - { - return new static(); - } - - /** - * Restricts the matching to directories only. - * - * @return $this - */ - public function directories() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_DIRECTORIES; - - return $this; - } - - /** - * Restricts the matching to files only. - * - * @return $this - */ - public function files() - { - $this->mode = Iterator\FileTypeFilterIterator::ONLY_FILES; - - return $this; - } - - /** - * Adds tests for the directory depth. - * - * Usage: - * - * $finder->depth('> 1') // the Finder will start matching at level 1. - * $finder->depth('< 3') // the Finder will descend at most 3 levels of directories below the starting point. - * $finder->depth(['>= 1', '< 3']) - * - * @param string|int|string[]|int[] $levels The depth level expression or an array of depth levels - * - * @return $this - * - * @see DepthRangeFilterIterator - * @see NumberComparator - */ - public function depth($levels) - { - foreach ((array) $levels as $level) { - $this->depths[] = new Comparator\NumberComparator($level); - } - - return $this; - } - - /** - * Adds tests for file dates (last modified). - * - * The date must be something that strtotime() is able to parse: - * - * $finder->date('since yesterday'); - * $finder->date('until 2 days ago'); - * $finder->date('> now - 2 hours'); - * $finder->date('>= 2005-10-15'); - * $finder->date(['>= 2005-10-15', '<= 2006-05-27']); - * - * @param string|string[] $dates A date range string or an array of date ranges - * - * @return $this - * - * @see strtotime - * @see DateRangeFilterIterator - * @see DateComparator - */ - public function date($dates) - { - foreach ((array) $dates as $date) { - $this->dates[] = new Comparator\DateComparator($date); - } - - return $this; - } - - /** - * Adds rules that files must match. - * - * You can use patterns (delimited with / sign), globs or simple strings. - * - * $finder->name('*.php') - * $finder->name('/\.php$/') // same as above - * $finder->name('test.php') - * $finder->name(['test.py', 'test.php']) - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function name($patterns) - { - $this->names = array_merge($this->names, (array) $patterns); - - return $this; - } - - /** - * Adds rules that files must not match. - * - * @param string|string[] $patterns A pattern (a regexp, a glob, or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notName($patterns) - { - $this->notNames = array_merge($this->notNames, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must match. - * - * Strings or PCRE patterns can be used: - * - * $finder->contains('Lorem ipsum') - * $finder->contains('/Lorem ipsum/i') - * $finder->contains(['dolor', '/ipsum/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function contains($patterns) - { - $this->contains = array_merge($this->contains, (array) $patterns); - - return $this; - } - - /** - * Adds tests that file contents must not match. - * - * Strings or PCRE patterns can be used: - * - * $finder->notContains('Lorem ipsum') - * $finder->notContains('/Lorem ipsum/i') - * $finder->notContains(['lorem', '/dolor/i']) - * - * @param string|string[] $patterns A pattern (string or regexp) or an array of patterns - * - * @return $this - * - * @see FilecontentFilterIterator - */ - public function notContains($patterns) - { - $this->notContains = array_merge($this->notContains, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->path('some/special/dir') - * $finder->path('/some\/special\/dir/') // same as above - * $finder->path(['some dir', 'another/dir']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function path($patterns) - { - $this->paths = array_merge($this->paths, (array) $patterns); - - return $this; - } - - /** - * Adds rules that filenames must not match. - * - * You can use patterns (delimited with / sign) or simple strings. - * - * $finder->notPath('some/special/dir') - * $finder->notPath('/some\/special\/dir/') // same as above - * $finder->notPath(['some/file.txt', 'another/file.log']) - * - * Use only / as dirname separator. - * - * @param string|string[] $patterns A pattern (a regexp or a string) or an array of patterns - * - * @return $this - * - * @see FilenameFilterIterator - */ - public function notPath($patterns) - { - $this->notPaths = array_merge($this->notPaths, (array) $patterns); - - return $this; - } - - /** - * Adds tests for file sizes. - * - * $finder->size('> 10K'); - * $finder->size('<= 1Ki'); - * $finder->size(4); - * $finder->size(['> 10K', '< 20K']) - * - * @param string|int|string[]|int[] $sizes A size range string or an integer or an array of size ranges - * - * @return $this - * - * @see SizeRangeFilterIterator - * @see NumberComparator - */ - public function size($sizes) - { - foreach ((array) $sizes as $size) { - $this->sizes[] = new Comparator\NumberComparator($size); - } - - return $this; - } - - /** - * Excludes directories. - * - * Directories passed as argument must be relative to the ones defined with the `in()` method. For example: - * - * $finder->in(__DIR__)->exclude('ruby'); - * - * @param string|array $dirs A directory path or an array of directories - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function exclude($dirs) - { - $this->exclude = array_merge($this->exclude, (array) $dirs); - - return $this; - } - - /** - * Excludes "hidden" directories and files (starting with a dot). - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreDotFiles(bool $ignoreDotFiles) - { - if ($ignoreDotFiles) { - $this->ignore |= static::IGNORE_DOT_FILES; - } else { - $this->ignore &= ~static::IGNORE_DOT_FILES; - } - - return $this; - } - - /** - * Forces the finder to ignore version control directories. - * - * This option is enabled by default. - * - * @return $this - * - * @see ExcludeDirectoryFilterIterator - */ - public function ignoreVCS(bool $ignoreVCS) - { - if ($ignoreVCS) { - $this->ignore |= static::IGNORE_VCS_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_FILES; - } - - return $this; - } - - /** - * Forces Finder to obey .gitignore and ignore files based on rules listed there. - * - * This option is disabled by default. - * - * @return $this - */ - public function ignoreVCSIgnored(bool $ignoreVCSIgnored) - { - if ($ignoreVCSIgnored) { - $this->ignore |= static::IGNORE_VCS_IGNORED_FILES; - } else { - $this->ignore &= ~static::IGNORE_VCS_IGNORED_FILES; - } - - return $this; - } - - /** - * Adds VCS patterns. - * - * @see ignoreVCS() - * - * @param string|string[] $pattern VCS patterns to ignore - */ - public static function addVCSPattern($pattern) - { - foreach ((array) $pattern as $p) { - self::$vcsPatterns[] = $p; - } - - self::$vcsPatterns = array_unique(self::$vcsPatterns); - } - - /** - * Sorts files and directories by an anonymous function. - * - * The anonymous function receives two \SplFileInfo instances to compare. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sort(\Closure $closure) - { - $this->sort = $closure; - - return $this; - } - - /** - * Sorts files and directories by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByName(bool $useNaturalSort = false) - { - $this->sort = $useNaturalSort ? Iterator\SortableIterator::SORT_BY_NAME_NATURAL : Iterator\SortableIterator::SORT_BY_NAME; - - return $this; - } - - /** - * Sorts files and directories by type (directories before files), then by name. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByType() - { - $this->sort = Iterator\SortableIterator::SORT_BY_TYPE; - - return $this; - } - - /** - * Sorts files and directories by the last accessed time. - * - * This is the time that the file was last accessed, read or written to. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByAccessedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_ACCESSED_TIME; - - return $this; - } - - /** - * Reverses the sorting. - * - * @return $this - */ - public function reverseSorting() - { - $this->reverseSorting = true; - - return $this; - } - - /** - * Sorts files and directories by the last inode changed time. - * - * This is the time that the inode information was last modified (permissions, owner, group or other metadata). - * - * On Windows, since inode is not available, changed time is actually the file creation time. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByChangedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_CHANGED_TIME; - - return $this; - } - - /** - * Sorts files and directories by the last modified time. - * - * This is the last time the actual contents of the file were last modified. - * - * This can be slow as all the matching files and directories must be retrieved for comparison. - * - * @return $this - * - * @see SortableIterator - */ - public function sortByModifiedTime() - { - $this->sort = Iterator\SortableIterator::SORT_BY_MODIFIED_TIME; - - return $this; - } - - /** - * Filters the iterator with an anonymous function. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @return $this - * - * @see CustomFilterIterator - */ - public function filter(\Closure $closure) - { - $this->filters[] = $closure; - - return $this; - } - - /** - * Forces the following of symlinks. - * - * @return $this - */ - public function followLinks() - { - $this->followLinks = true; - - return $this; - } - - /** - * Tells finder to ignore unreadable directories. - * - * By default, scanning unreadable directories content throws an AccessDeniedException. - * - * @return $this - */ - public function ignoreUnreadableDirs(bool $ignore = true) - { - $this->ignoreUnreadableDirs = $ignore; - - return $this; - } - - /** - * Searches files and directories which match defined rules. - * - * @param string|string[] $dirs A directory path or an array of directories - * - * @return $this - * - * @throws DirectoryNotFoundException if one of the directories does not exist - */ - public function in($dirs) - { - $resolvedDirs = []; - - foreach ((array) $dirs as $dir) { - if (is_dir($dir)) { - $resolvedDirs[] = [$this->normalizeDir($dir)]; - } elseif ($glob = glob($dir, (\defined('GLOB_BRACE') ? \GLOB_BRACE : 0) | \GLOB_ONLYDIR | \GLOB_NOSORT)) { - sort($glob); - $resolvedDirs[] = array_map([$this, 'normalizeDir'], $glob); - } else { - throw new DirectoryNotFoundException(sprintf('The "%s" directory does not exist.', $dir)); - } - } - - $this->dirs = array_merge($this->dirs, ...$resolvedDirs); - - return $this; - } - - /** - * Returns an Iterator for the current Finder configuration. - * - * This method implements the IteratorAggregate interface. - * - * @return \Iterator - * - * @throws \LogicException if the in() method has not been called - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (0 === \count($this->dirs) && 0 === \count($this->iterators)) { - throw new \LogicException('You must call one of in() or append() methods before iterating over a Finder.'); - } - - if (1 === \count($this->dirs) && 0 === \count($this->iterators)) { - $iterator = $this->searchInDirectory($this->dirs[0]); - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - $iterator = new \AppendIterator(); - foreach ($this->dirs as $dir) { - $iterator->append(new \IteratorIterator(new LazyIterator(function () use ($dir) { - return $this->searchInDirectory($dir); - }))); - } - - foreach ($this->iterators as $it) { - $iterator->append($it); - } - - if ($this->sort || $this->reverseSorting) { - $iterator = (new Iterator\SortableIterator($iterator, $this->sort, $this->reverseSorting))->getIterator(); - } - - return $iterator; - } - - /** - * Appends an existing set of files/directories to the finder. - * - * The set can be another Finder, an Iterator, an IteratorAggregate, or even a plain array. - * - * @return $this - * - * @throws \InvalidArgumentException when the given argument is not iterable - */ - public function append(iterable $iterator) - { - if ($iterator instanceof \IteratorAggregate) { - $this->iterators[] = $iterator->getIterator(); - } elseif ($iterator instanceof \Iterator) { - $this->iterators[] = $iterator; - } elseif (is_iterable($iterator)) { - $it = new \ArrayIterator(); - foreach ($iterator as $file) { - $file = $file instanceof \SplFileInfo ? $file : new \SplFileInfo($file); - $it[$file->getPathname()] = $file; - } - $this->iterators[] = $it; - } else { - throw new \InvalidArgumentException('Finder::append() method wrong argument type.'); - } - - return $this; - } - - /** - * Check if any results were found. - * - * @return bool - */ - public function hasResults() - { - foreach ($this->getIterator() as $_) { - return true; - } - - return false; - } - - /** - * Counts all the results collected by the iterators. - * - * @return int - */ - #[\ReturnTypeWillChange] - public function count() - { - return iterator_count($this->getIterator()); - } - - private function searchInDirectory(string $dir): \Iterator - { - $exclude = $this->exclude; - $notPaths = $this->notPaths; - - if (static::IGNORE_VCS_FILES === (static::IGNORE_VCS_FILES & $this->ignore)) { - $exclude = array_merge($exclude, self::$vcsPatterns); - } - - if (static::IGNORE_DOT_FILES === (static::IGNORE_DOT_FILES & $this->ignore)) { - $notPaths[] = '#(^|/)\..+(/|$)#'; - } - - $minDepth = 0; - $maxDepth = \PHP_INT_MAX; - - foreach ($this->depths as $comparator) { - switch ($comparator->getOperator()) { - case '>': - $minDepth = $comparator->getTarget() + 1; - break; - case '>=': - $minDepth = $comparator->getTarget(); - break; - case '<': - $maxDepth = $comparator->getTarget() - 1; - break; - case '<=': - $maxDepth = $comparator->getTarget(); - break; - default: - $minDepth = $maxDepth = $comparator->getTarget(); - } - } - - $flags = \RecursiveDirectoryIterator::SKIP_DOTS; - - if ($this->followLinks) { - $flags |= \RecursiveDirectoryIterator::FOLLOW_SYMLINKS; - } - - $iterator = new Iterator\RecursiveDirectoryIterator($dir, $flags, $this->ignoreUnreadableDirs); - - if ($exclude) { - $iterator = new Iterator\ExcludeDirectoryFilterIterator($iterator, $exclude); - } - - $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST); - - if ($minDepth > 0 || $maxDepth < \PHP_INT_MAX) { - $iterator = new Iterator\DepthRangeFilterIterator($iterator, $minDepth, $maxDepth); - } - - if ($this->mode) { - $iterator = new Iterator\FileTypeFilterIterator($iterator, $this->mode); - } - - if ($this->names || $this->notNames) { - $iterator = new Iterator\FilenameFilterIterator($iterator, $this->names, $this->notNames); - } - - if ($this->contains || $this->notContains) { - $iterator = new Iterator\FilecontentFilterIterator($iterator, $this->contains, $this->notContains); - } - - if ($this->sizes) { - $iterator = new Iterator\SizeRangeFilterIterator($iterator, $this->sizes); - } - - if ($this->dates) { - $iterator = new Iterator\DateRangeFilterIterator($iterator, $this->dates); - } - - if ($this->filters) { - $iterator = new Iterator\CustomFilterIterator($iterator, $this->filters); - } - - if ($this->paths || $notPaths) { - $iterator = new Iterator\PathFilterIterator($iterator, $this->paths, $notPaths); - } - - if (static::IGNORE_VCS_IGNORED_FILES === (static::IGNORE_VCS_IGNORED_FILES & $this->ignore)) { - $iterator = new Iterator\VcsIgnoredFilterIterator($iterator, $dir); - } - - return $iterator; - } - - /** - * Normalizes given directory names by removing trailing slashes. - * - * Excluding: (s)ftp:// or ssh2.(s)ftp:// wrapper - */ - private function normalizeDir(string $dir): string - { - if ('/' === $dir) { - return $dir; - } - - $dir = rtrim($dir, '/'.\DIRECTORY_SEPARATOR); - - if (preg_match('#^(ssh2\.)?s?ftp://#', $dir)) { - $dir .= '/'; - } - - return $dir; - } -} diff --git a/vendor/symfony/finder/Gitignore.php b/vendor/symfony/finder/Gitignore.php deleted file mode 100644 index d42cca1dc..000000000 --- a/vendor/symfony/finder/Gitignore.php +++ /dev/null @@ -1,93 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Gitignore matches against text. - * - * @author Michael Voříšek - * @author Ahmed Abdou - */ -class Gitignore -{ - /** - * Returns a regexp which is the equivalent of the gitignore pattern. - * - * Format specification: https://git-scm.com/docs/gitignore#_pattern_format - */ - public static function toRegex(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, false); - } - - public static function toRegexMatchingNegatedPatterns(string $gitignoreFileContent): string - { - return self::buildRegex($gitignoreFileContent, true); - } - - private static function buildRegex(string $gitignoreFileContent, bool $inverted): string - { - $gitignoreFileContent = preg_replace('~(? - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Glob matches globbing patterns against text. - * - * if match_glob("foo.*", "foo.bar") echo "matched\n"; - * - * // prints foo.bar and foo.baz - * $regex = glob_to_regex("foo.*"); - * for (['foo.bar', 'foo.baz', 'foo', 'bar'] as $t) - * { - * if (/$regex/) echo "matched: $car\n"; - * } - * - * Glob implements glob(3) style matching that can be used to match - * against text, rather than fetching names from a filesystem. - * - * Based on the Perl Text::Glob module. - * - * @author Fabien Potencier PHP port - * @author Richard Clamp Perl version - * @copyright 2004-2005 Fabien Potencier - * @copyright 2002 Richard Clamp - */ -class Glob -{ - /** - * Returns a regexp which is the equivalent of the glob pattern. - * - * @return string - */ - public static function toRegex(string $glob, bool $strictLeadingDot = true, bool $strictWildcardSlash = true, string $delimiter = '#') - { - $firstByte = true; - $escaping = false; - $inCurlies = 0; - $regex = ''; - $sizeGlob = \strlen($glob); - for ($i = 0; $i < $sizeGlob; ++$i) { - $car = $glob[$i]; - if ($firstByte && $strictLeadingDot && '.' !== $car) { - $regex .= '(?=[^\.])'; - } - - $firstByte = '/' === $car; - - if ($firstByte && $strictWildcardSlash && isset($glob[$i + 2]) && '**' === $glob[$i + 1].$glob[$i + 2] && (!isset($glob[$i + 3]) || '/' === $glob[$i + 3])) { - $car = '[^/]++/'; - if (!isset($glob[$i + 3])) { - $car .= '?'; - } - - if ($strictLeadingDot) { - $car = '(?=[^\.])'.$car; - } - - $car = '/(?:'.$car.')*'; - $i += 2 + isset($glob[$i + 3]); - - if ('/' === $delimiter) { - $car = str_replace('/', '\\/', $car); - } - } - - if ($delimiter === $car || '.' === $car || '(' === $car || ')' === $car || '|' === $car || '+' === $car || '^' === $car || '$' === $car) { - $regex .= "\\$car"; - } elseif ('*' === $car) { - $regex .= $escaping ? '\\*' : ($strictWildcardSlash ? '[^/]*' : '.*'); - } elseif ('?' === $car) { - $regex .= $escaping ? '\\?' : ($strictWildcardSlash ? '[^/]' : '.'); - } elseif ('{' === $car) { - $regex .= $escaping ? '\\{' : '('; - if (!$escaping) { - ++$inCurlies; - } - } elseif ('}' === $car && $inCurlies) { - $regex .= $escaping ? '}' : ')'; - if (!$escaping) { - --$inCurlies; - } - } elseif (',' === $car && $inCurlies) { - $regex .= $escaping ? ',' : '|'; - } elseif ('\\' === $car) { - if ($escaping) { - $regex .= '\\\\'; - $escaping = false; - } else { - $escaping = true; - } - - continue; - } else { - $regex .= $car; - } - $escaping = false; - } - - return $delimiter.'^'.$regex.'$'.$delimiter; - } -} diff --git a/vendor/symfony/finder/Iterator/CustomFilterIterator.php b/vendor/symfony/finder/Iterator/CustomFilterIterator.php deleted file mode 100644 index f7bf19b87..000000000 --- a/vendor/symfony/finder/Iterator/CustomFilterIterator.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * CustomFilterIterator filters files by applying anonymous functions. - * - * The anonymous function receives a \SplFileInfo and must return false - * to remove files. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class CustomFilterIterator extends \FilterIterator -{ - private $filters = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param callable[] $filters An array of PHP callbacks - * - * @throws \InvalidArgumentException - */ - public function __construct(\Iterator $iterator, array $filters) - { - foreach ($filters as $filter) { - if (!\is_callable($filter)) { - throw new \InvalidArgumentException('Invalid PHP callback.'); - } - } - $this->filters = $filters; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - foreach ($this->filters as $filter) { - if (false === $filter($fileinfo)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php deleted file mode 100644 index f592e1913..000000000 --- a/vendor/symfony/finder/Iterator/DateRangeFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\DateComparator; - -/** - * DateRangeFilterIterator filters out files that are not in the given date range (last modified dates). - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class DateRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param DateComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - - if (!file_exists($fileinfo->getPathname())) { - return false; - } - - $filedate = $fileinfo->getMTime(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filedate)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php b/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php deleted file mode 100644 index f593a3f08..000000000 --- a/vendor/symfony/finder/Iterator/DepthRangeFilterIterator.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * DepthRangeFilterIterator limits the directory depth. - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -class DepthRangeFilterIterator extends \FilterIterator -{ - private $minDepth = 0; - - /** - * @param \RecursiveIteratorIterator<\RecursiveIterator> $iterator The Iterator to filter - * @param int $minDepth The min depth - * @param int $maxDepth The max depth - */ - public function __construct(\RecursiveIteratorIterator $iterator, int $minDepth = 0, int $maxDepth = \PHP_INT_MAX) - { - $this->minDepth = $minDepth; - $iterator->setMaxDepth(\PHP_INT_MAX === $maxDepth ? -1 : $maxDepth); - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->getInnerIterator()->getDepth() >= $this->minDepth; - } -} diff --git a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php b/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php deleted file mode 100644 index 39797c82c..000000000 --- a/vendor/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * ExcludeDirectoryFilterIterator filters out directories. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - * - * @implements \RecursiveIterator - */ -class ExcludeDirectoryFilterIterator extends \FilterIterator implements \RecursiveIterator -{ - private $iterator; - private $isRecursive; - private $excludedDirs = []; - private $excludedPattern; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $directories An array of directories to exclude - */ - public function __construct(\Iterator $iterator, array $directories) - { - $this->iterator = $iterator; - $this->isRecursive = $iterator instanceof \RecursiveIterator; - $patterns = []; - foreach ($directories as $directory) { - $directory = rtrim($directory, '/'); - if (!$this->isRecursive || str_contains($directory, '/')) { - $patterns[] = preg_quote($directory, '#'); - } else { - $this->excludedDirs[$directory] = true; - } - } - if ($patterns) { - $this->excludedPattern = '#(?:^|/)(?:'.implode('|', $patterns).')(?:/|$)#'; - } - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if ($this->isRecursive && isset($this->excludedDirs[$this->getFilename()]) && $this->isDir()) { - return false; - } - - if ($this->excludedPattern) { - $path = $this->isDir() ? $this->current()->getRelativePathname() : $this->current()->getRelativePath(); - $path = str_replace('\\', '/', $path); - - return !preg_match($this->excludedPattern, $path); - } - - return true; - } - - /** - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren() - { - return $this->isRecursive && $this->iterator->hasChildren(); - } - - /** - * @return self - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - $children = new self($this->iterator->getChildren(), []); - $children->excludedDirs = $this->excludedDirs; - $children->excludedPattern = $this->excludedPattern; - - return $children; - } -} diff --git a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php b/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php deleted file mode 100644 index 793ae3509..000000000 --- a/vendor/symfony/finder/Iterator/FileTypeFilterIterator.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FileTypeFilterIterator only keeps files, directories, or both. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class FileTypeFilterIterator extends \FilterIterator -{ - public const ONLY_FILES = 1; - public const ONLY_DIRECTORIES = 2; - - private $mode; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param int $mode The mode (self::ONLY_FILES or self::ONLY_DIRECTORIES) - */ - public function __construct(\Iterator $iterator, int $mode) - { - $this->mode = $mode; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (self::ONLY_DIRECTORIES === (self::ONLY_DIRECTORIES & $this->mode) && $fileinfo->isFile()) { - return false; - } elseif (self::ONLY_FILES === (self::ONLY_FILES & $this->mode) && $fileinfo->isDir()) { - return false; - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php b/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php deleted file mode 100644 index 79f8c29d3..000000000 --- a/vendor/symfony/finder/Iterator/FilecontentFilterIterator.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * FilecontentFilterIterator filters files by their contents using patterns (regexps or strings). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class FilecontentFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - if (!$this->matchRegexps && !$this->noMatchRegexps) { - return true; - } - - $fileinfo = $this->current(); - - if ($fileinfo->isDir() || !$fileinfo->isReadable()) { - return false; - } - - $content = $fileinfo->getContents(); - if (!$content) { - return false; - } - - return $this->isAccepted($content); - } - - /** - * Converts string to regexp if necessary. - * - * @param string $str Pattern: string or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php b/vendor/symfony/finder/Iterator/FilenameFilterIterator.php deleted file mode 100644 index 77b3b2419..000000000 --- a/vendor/symfony/finder/Iterator/FilenameFilterIterator.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Glob; - -/** - * FilenameFilterIterator filters files by patterns (a regexp, a glob, or a string). - * - * @author Fabien Potencier - * - * @extends MultiplePcreFilterIterator - */ -class FilenameFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - return $this->isAccepted($this->current()->getFilename()); - } - - /** - * Converts glob to regexp. - * - * PCRE patterns are left unchanged. - * Glob strings are transformed with Glob::toRegex(). - * - * @param string $str Pattern: glob or regexp - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : Glob::toRegex($str); - } -} diff --git a/vendor/symfony/finder/Iterator/LazyIterator.php b/vendor/symfony/finder/Iterator/LazyIterator.php deleted file mode 100644 index 32cc37ff1..000000000 --- a/vendor/symfony/finder/Iterator/LazyIterator.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * @author Jérémy Derussé - * - * @internal - */ -class LazyIterator implements \IteratorAggregate -{ - private $iteratorFactory; - - public function __construct(callable $iteratorFactory) - { - $this->iteratorFactory = $iteratorFactory; - } - - public function getIterator(): \Traversable - { - yield from ($this->iteratorFactory)(); - } -} diff --git a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php b/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php deleted file mode 100644 index 564765d8f..000000000 --- a/vendor/symfony/finder/Iterator/MultiplePcreFilterIterator.php +++ /dev/null @@ -1,117 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * MultiplePcreFilterIterator filters files using patterns (regexps, globs or strings). - * - * @author Fabien Potencier - * - * @template-covariant TKey - * @template-covariant TValue - * - * @extends \FilterIterator - */ -abstract class MultiplePcreFilterIterator extends \FilterIterator -{ - protected $matchRegexps = []; - protected $noMatchRegexps = []; - - /** - * @param \Iterator $iterator The Iterator to filter - * @param string[] $matchPatterns An array of patterns that need to match - * @param string[] $noMatchPatterns An array of patterns that need to not match - */ - public function __construct(\Iterator $iterator, array $matchPatterns, array $noMatchPatterns) - { - foreach ($matchPatterns as $pattern) { - $this->matchRegexps[] = $this->toRegex($pattern); - } - - foreach ($noMatchPatterns as $pattern) { - $this->noMatchRegexps[] = $this->toRegex($pattern); - } - - parent::__construct($iterator); - } - - /** - * Checks whether the string is accepted by the regex filters. - * - * If there is no regexps defined in the class, this method will accept the string. - * Such case can be handled by child classes before calling the method if they want to - * apply a different behavior. - * - * @return bool - */ - protected function isAccepted(string $string) - { - // should at least not match one rule to exclude - foreach ($this->noMatchRegexps as $regex) { - if (preg_match($regex, $string)) { - return false; - } - } - - // should at least match one rule - if ($this->matchRegexps) { - foreach ($this->matchRegexps as $regex) { - if (preg_match($regex, $string)) { - return true; - } - } - - return false; - } - - // If there is no match rules, the file is accepted - return true; - } - - /** - * Checks whether the string is a regex. - * - * @return bool - */ - protected function isRegex(string $str) - { - $availableModifiers = 'imsxuADU'; - - if (\PHP_VERSION_ID >= 80200) { - $availableModifiers .= 'n'; - } - - if (preg_match('/^(.{3,}?)['.$availableModifiers.']*$/', $str, $m)) { - $start = substr($m[1], 0, 1); - $end = substr($m[1], -1); - - if ($start === $end) { - return !preg_match('/[*?[:alnum:] \\\\]/', $start); - } - - foreach ([['{', '}'], ['(', ')'], ['[', ']'], ['<', '>']] as $delimiters) { - if ($start === $delimiters[0] && $end === $delimiters[1]) { - return true; - } - } - } - - return false; - } - - /** - * Converts string into regexp. - * - * @return string - */ - abstract protected function toRegex(string $str); -} diff --git a/vendor/symfony/finder/Iterator/PathFilterIterator.php b/vendor/symfony/finder/Iterator/PathFilterIterator.php deleted file mode 100644 index 7974c4ee3..000000000 --- a/vendor/symfony/finder/Iterator/PathFilterIterator.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * PathFilterIterator filters files by path patterns (e.g. some/special/dir). - * - * @author Fabien Potencier - * @author Włodzimierz Gajda - * - * @extends MultiplePcreFilterIterator - */ -class PathFilterIterator extends MultiplePcreFilterIterator -{ - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $filename = $this->current()->getRelativePathname(); - - if ('\\' === \DIRECTORY_SEPARATOR) { - $filename = str_replace('\\', '/', $filename); - } - - return $this->isAccepted($filename); - } - - /** - * Converts strings to regexp. - * - * PCRE patterns are left unchanged. - * - * Default conversion: - * 'lorem/ipsum/dolor' ==> 'lorem\/ipsum\/dolor/' - * - * Use only / as directory separator (on Windows also). - * - * @param string $str Pattern: regexp or dirname - * - * @return string - */ - protected function toRegex(string $str) - { - return $this->isRegex($str) ? $str : '/'.preg_quote($str, '/').'/'; - } -} diff --git a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php b/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php deleted file mode 100644 index 27589cdd5..000000000 --- a/vendor/symfony/finder/Iterator/RecursiveDirectoryIterator.php +++ /dev/null @@ -1,168 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Exception\AccessDeniedException; -use Symfony\Component\Finder\SplFileInfo; - -/** - * Extends the \RecursiveDirectoryIterator to support relative paths. - * - * @author Victor Berchet - */ -class RecursiveDirectoryIterator extends \RecursiveDirectoryIterator -{ - /** - * @var bool - */ - private $ignoreUnreadableDirs; - - /** - * @var bool - */ - private $rewindable; - - // these 3 properties take part of the performance optimization to avoid redoing the same work in all iterations - private $rootPath; - private $subPath; - private $directorySeparator = '/'; - - /** - * @throws \RuntimeException - */ - public function __construct(string $path, int $flags, bool $ignoreUnreadableDirs = false) - { - if ($flags & (self::CURRENT_AS_PATHNAME | self::CURRENT_AS_SELF)) { - throw new \RuntimeException('This iterator only support returning current as fileinfo.'); - } - - parent::__construct($path, $flags); - $this->ignoreUnreadableDirs = $ignoreUnreadableDirs; - $this->rootPath = $path; - if ('/' !== \DIRECTORY_SEPARATOR && !($flags & self::UNIX_PATHS)) { - $this->directorySeparator = \DIRECTORY_SEPARATOR; - } - } - - /** - * Return an instance of SplFileInfo with support for relative paths. - * - * @return SplFileInfo - */ - #[\ReturnTypeWillChange] - public function current() - { - // the logic here avoids redoing the same work in all iterations - - if (null === $subPathname = $this->subPath) { - $subPathname = $this->subPath = $this->getSubPath(); - } - if ('' !== $subPathname) { - $subPathname .= $this->directorySeparator; - } - $subPathname .= $this->getFilename(); - - if ('/' !== $basePath = $this->rootPath) { - $basePath .= $this->directorySeparator; - } - - return new SplFileInfo($basePath.$subPathname, $this->subPath, $subPathname); - } - - /** - * @param bool $allowLinks - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function hasChildren($allowLinks = false) - { - $hasChildren = parent::hasChildren($allowLinks); - - if (!$hasChildren || !$this->ignoreUnreadableDirs) { - return $hasChildren; - } - - try { - parent::getChildren(); - - return true; - } catch (\UnexpectedValueException $e) { - // If directory is unreadable and finder is set to ignore it, skip children - return false; - } - } - - /** - * @return \RecursiveDirectoryIterator - * - * @throws AccessDeniedException - */ - #[\ReturnTypeWillChange] - public function getChildren() - { - try { - $children = parent::getChildren(); - - if ($children instanceof self) { - // parent method will call the constructor with default arguments, so unreadable dirs won't be ignored anymore - $children->ignoreUnreadableDirs = $this->ignoreUnreadableDirs; - - // performance optimization to avoid redoing the same work in all children - $children->rewindable = &$this->rewindable; - $children->rootPath = $this->rootPath; - } - - return $children; - } catch (\UnexpectedValueException $e) { - throw new AccessDeniedException($e->getMessage(), $e->getCode(), $e); - } - } - - /** - * Do nothing for non rewindable stream. - * - * @return void - */ - #[\ReturnTypeWillChange] - public function rewind() - { - if (false === $this->isRewindable()) { - return; - } - - parent::rewind(); - } - - /** - * Checks if the stream is rewindable. - * - * @return bool - */ - public function isRewindable() - { - if (null !== $this->rewindable) { - return $this->rewindable; - } - - if (false !== $stream = @opendir($this->getPath())) { - $infos = stream_get_meta_data($stream); - closedir($stream); - - if ($infos['seekable']) { - return $this->rewindable = true; - } - } - - return $this->rewindable = false; - } -} diff --git a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php b/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php deleted file mode 100644 index 575bf29b7..000000000 --- a/vendor/symfony/finder/Iterator/SizeRangeFilterIterator.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Comparator\NumberComparator; - -/** - * SizeRangeFilterIterator filters out files that are not in the given size range. - * - * @author Fabien Potencier - * - * @extends \FilterIterator - */ -class SizeRangeFilterIterator extends \FilterIterator -{ - private $comparators = []; - - /** - * @param \Iterator $iterator - * @param NumberComparator[] $comparators - */ - public function __construct(\Iterator $iterator, array $comparators) - { - $this->comparators = $comparators; - - parent::__construct($iterator); - } - - /** - * Filters the iterator values. - * - * @return bool - */ - #[\ReturnTypeWillChange] - public function accept() - { - $fileinfo = $this->current(); - if (!$fileinfo->isFile()) { - return true; - } - - $filesize = $fileinfo->getSize(); - foreach ($this->comparators as $compare) { - if (!$compare->test($filesize)) { - return false; - } - } - - return true; - } -} diff --git a/vendor/symfony/finder/Iterator/SortableIterator.php b/vendor/symfony/finder/Iterator/SortableIterator.php deleted file mode 100644 index 9afde5c25..000000000 --- a/vendor/symfony/finder/Iterator/SortableIterator.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -/** - * SortableIterator applies a sort on a given Iterator. - * - * @author Fabien Potencier - * - * @implements \IteratorAggregate - */ -class SortableIterator implements \IteratorAggregate -{ - public const SORT_BY_NONE = 0; - public const SORT_BY_NAME = 1; - public const SORT_BY_TYPE = 2; - public const SORT_BY_ACCESSED_TIME = 3; - public const SORT_BY_CHANGED_TIME = 4; - public const SORT_BY_MODIFIED_TIME = 5; - public const SORT_BY_NAME_NATURAL = 6; - - private $iterator; - private $sort; - - /** - * @param \Traversable $iterator - * @param int|callable $sort The sort type (SORT_BY_NAME, SORT_BY_TYPE, or a PHP callback) - * - * @throws \InvalidArgumentException - */ - public function __construct(\Traversable $iterator, $sort, bool $reverseOrder = false) - { - $this->iterator = $iterator; - $order = $reverseOrder ? -1 : 1; - - if (self::SORT_BY_NAME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_NAME_NATURAL === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * strnatcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_TYPE === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - if ($a->isDir() && $b->isFile()) { - return -$order; - } elseif ($a->isFile() && $b->isDir()) { - return $order; - } - - return $order * strcmp($a->getRealPath() ?: $a->getPathname(), $b->getRealPath() ?: $b->getPathname()); - }; - } elseif (self::SORT_BY_ACCESSED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getATime() - $b->getATime()); - }; - } elseif (self::SORT_BY_CHANGED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getCTime() - $b->getCTime()); - }; - } elseif (self::SORT_BY_MODIFIED_TIME === $sort) { - $this->sort = static function (\SplFileInfo $a, \SplFileInfo $b) use ($order) { - return $order * ($a->getMTime() - $b->getMTime()); - }; - } elseif (self::SORT_BY_NONE === $sort) { - $this->sort = $order; - } elseif (\is_callable($sort)) { - $this->sort = $reverseOrder ? static function (\SplFileInfo $a, \SplFileInfo $b) use ($sort) { return -$sort($a, $b); } : $sort; - } else { - throw new \InvalidArgumentException('The SortableIterator takes a PHP callable or a valid built-in sort algorithm as an argument.'); - } - } - - /** - * @return \Traversable - */ - #[\ReturnTypeWillChange] - public function getIterator() - { - if (1 === $this->sort) { - return $this->iterator; - } - - $array = iterator_to_array($this->iterator, true); - - if (-1 === $this->sort) { - $array = array_reverse($array); - } else { - uasort($array, $this->sort); - } - - return new \ArrayIterator($array); - } -} diff --git a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php b/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php deleted file mode 100644 index e27158cbd..000000000 --- a/vendor/symfony/finder/Iterator/VcsIgnoredFilterIterator.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder\Iterator; - -use Symfony\Component\Finder\Gitignore; - -final class VcsIgnoredFilterIterator extends \FilterIterator -{ - /** - * @var string - */ - private $baseDir; - - /** - * @var array - */ - private $gitignoreFilesCache = []; - - /** - * @var array - */ - private $ignoredPathsCache = []; - - public function __construct(\Iterator $iterator, string $baseDir) - { - $this->baseDir = $this->normalizePath($baseDir); - - parent::__construct($iterator); - } - - public function accept(): bool - { - $file = $this->current(); - - $fileRealPath = $this->normalizePath($file->getRealPath()); - - return !$this->isIgnored($fileRealPath); - } - - private function isIgnored(string $fileRealPath): bool - { - if (is_dir($fileRealPath) && !str_ends_with($fileRealPath, '/')) { - $fileRealPath .= '/'; - } - - if (isset($this->ignoredPathsCache[$fileRealPath])) { - return $this->ignoredPathsCache[$fileRealPath]; - } - - $ignored = false; - - foreach ($this->parentsDirectoryDownward($fileRealPath) as $parentDirectory) { - if ($this->isIgnored($parentDirectory)) { - // rules in ignored directories are ignored, no need to check further. - break; - } - - $fileRelativePath = substr($fileRealPath, \strlen($parentDirectory) + 1); - - if (null === $regexps = $this->readGitignoreFile("{$parentDirectory}/.gitignore")) { - continue; - } - - [$exclusionRegex, $inclusionRegex] = $regexps; - - if (preg_match($exclusionRegex, $fileRelativePath)) { - $ignored = true; - - continue; - } - - if (preg_match($inclusionRegex, $fileRelativePath)) { - $ignored = false; - } - } - - return $this->ignoredPathsCache[$fileRealPath] = $ignored; - } - - /** - * @return list - */ - private function parentsDirectoryDownward(string $fileRealPath): array - { - $parentDirectories = []; - - $parentDirectory = $fileRealPath; - - while (true) { - $newParentDirectory = \dirname($parentDirectory); - - // dirname('/') = '/' - if ($newParentDirectory === $parentDirectory) { - break; - } - - $parentDirectory = $newParentDirectory; - - if (0 !== strpos($parentDirectory, $this->baseDir)) { - break; - } - - $parentDirectories[] = $parentDirectory; - } - - return array_reverse($parentDirectories); - } - - /** - * @return array{0: string, 1: string}|null - */ - private function readGitignoreFile(string $path): ?array - { - if (\array_key_exists($path, $this->gitignoreFilesCache)) { - return $this->gitignoreFilesCache[$path]; - } - - if (!file_exists($path)) { - return $this->gitignoreFilesCache[$path] = null; - } - - if (!is_file($path) || !is_readable($path)) { - throw new \RuntimeException("The \"ignoreVCSIgnored\" option cannot be used by the Finder as the \"{$path}\" file is not readable."); - } - - $gitignoreFileContent = file_get_contents($path); - - return $this->gitignoreFilesCache[$path] = [ - Gitignore::toRegex($gitignoreFileContent), - Gitignore::toRegexMatchingNegatedPatterns($gitignoreFileContent), - ]; - } - - private function normalizePath(string $path): string - { - if ('\\' === \DIRECTORY_SEPARATOR) { - return str_replace('\\', '/', $path); - } - - return $path; - } -} diff --git a/vendor/symfony/finder/LICENSE b/vendor/symfony/finder/LICENSE deleted file mode 100644 index 0138f8f07..000000000 --- a/vendor/symfony/finder/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2004-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/finder/README.md b/vendor/symfony/finder/README.md deleted file mode 100644 index 22bdeb9bc..000000000 --- a/vendor/symfony/finder/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Finder Component -================ - -The Finder component finds files and directories via an intuitive fluent -interface. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/finder.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/finder/SplFileInfo.php b/vendor/symfony/finder/SplFileInfo.php deleted file mode 100644 index 11604a2ef..000000000 --- a/vendor/symfony/finder/SplFileInfo.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\Finder; - -/** - * Extends \SplFileInfo to support relative paths. - * - * @author Fabien Potencier - */ -class SplFileInfo extends \SplFileInfo -{ - private $relativePath; - private $relativePathname; - - /** - * @param string $file The file name - * @param string $relativePath The relative path - * @param string $relativePathname The relative path name - */ - public function __construct(string $file, string $relativePath, string $relativePathname) - { - parent::__construct($file); - $this->relativePath = $relativePath; - $this->relativePathname = $relativePathname; - } - - /** - * Returns the relative path. - * - * This path does not contain the file name. - * - * @return string - */ - public function getRelativePath() - { - return $this->relativePath; - } - - /** - * Returns the relative path name. - * - * This path contains the file name. - * - * @return string - */ - public function getRelativePathname() - { - return $this->relativePathname; - } - - public function getFilenameWithoutExtension(): string - { - $filename = $this->getFilename(); - - return pathinfo($filename, \PATHINFO_FILENAME); - } - - /** - * Returns the contents of the file. - * - * @return string - * - * @throws \RuntimeException - */ - public function getContents() - { - set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); - try { - $content = file_get_contents($this->getPathname()); - } finally { - restore_error_handler(); - } - if (false === $content) { - throw new \RuntimeException($error); - } - - return $content; - } -} diff --git a/vendor/symfony/finder/composer.json b/vendor/symfony/finder/composer.json deleted file mode 100644 index ef19911da..000000000 --- a/vendor/symfony/finder/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "symfony/finder", - "type": "library", - "description": "Finds files and directories via an intuitive fluent interface", - "keywords": [], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-php80": "^1.16" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\Finder\\": "" }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/symfony/polyfill-ctype/Ctype.php b/vendor/symfony/polyfill-ctype/Ctype.php deleted file mode 100644 index ba75a2c95..000000000 --- a/vendor/symfony/polyfill-ctype/Ctype.php +++ /dev/null @@ -1,232 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Ctype; - -/** - * Ctype implementation through regex. - * - * @internal - * - * @author Gert de Pagter - */ -final class Ctype -{ - /** - * Returns TRUE if every character in text is either a letter or a digit, FALSE otherwise. - * - * @see https://php.net/ctype-alnum - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alnum($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is a letter, FALSE otherwise. - * - * @see https://php.net/ctype-alpha - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_alpha($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Za-z]/', $text); - } - - /** - * Returns TRUE if every character in text is a control character from the current locale, FALSE otherwise. - * - * @see https://php.net/ctype-cntrl - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_cntrl($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\x00-\x1f\x7f]/', $text); - } - - /** - * Returns TRUE if every character in the string text is a decimal digit, FALSE otherwise. - * - * @see https://php.net/ctype-digit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_digit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^0-9]/', $text); - } - - /** - * Returns TRUE if every character in text is printable and actually creates visible output (no white space), FALSE otherwise. - * - * @see https://php.net/ctype-graph - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_graph($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-~]/', $text); - } - - /** - * Returns TRUE if every character in text is a lowercase letter. - * - * @see https://php.net/ctype-lower - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_lower($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^a-z]/', $text); - } - - /** - * Returns TRUE if every character in text will actually create output (including blanks). Returns FALSE if text contains control characters or characters that do not have any output or control function at all. - * - * @see https://php.net/ctype-print - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_print($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^ -~]/', $text); - } - - /** - * Returns TRUE if every character in text is printable, but neither letter, digit or blank, FALSE otherwise. - * - * @see https://php.net/ctype-punct - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_punct($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^!-\/\:-@\[-`\{-~]/', $text); - } - - /** - * Returns TRUE if every character in text creates some sort of white space, FALSE otherwise. Besides the blank character this also includes tab, vertical tab, line feed, carriage return and form feed characters. - * - * @see https://php.net/ctype-space - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_space($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^\s]/', $text); - } - - /** - * Returns TRUE if every character in text is an uppercase letter. - * - * @see https://php.net/ctype-upper - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_upper($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Z]/', $text); - } - - /** - * Returns TRUE if every character in text is a hexadecimal 'digit', that is a decimal digit or a character from [A-Fa-f] , FALSE otherwise. - * - * @see https://php.net/ctype-xdigit - * - * @param mixed $text - * - * @return bool - */ - public static function ctype_xdigit($text) - { - $text = self::convert_int_to_char_for_ctype($text, __FUNCTION__); - - return \is_string($text) && '' !== $text && !preg_match('/[^A-Fa-f0-9]/', $text); - } - - /** - * Converts integers to their char versions according to normal ctype behaviour, if needed. - * - * If an integer between -128 and 255 inclusive is provided, - * it is interpreted as the ASCII value of a single character - * (negative values have 256 added in order to allow characters in the Extended ASCII range). - * Any other integer is interpreted as a string containing the decimal digits of the integer. - * - * @param mixed $int - * @param string $function - * - * @return mixed - */ - private static function convert_int_to_char_for_ctype($int, $function) - { - if (!\is_int($int)) { - return $int; - } - - if ($int < -128 || $int > 255) { - return (string) $int; - } - - if (\PHP_VERSION_ID >= 80100) { - @trigger_error($function.'(): Argument of type int will be interpreted as string in the future', \E_USER_DEPRECATED); - } - - if ($int < 0) { - $int += 256; - } - - return \chr($int); - } -} diff --git a/vendor/symfony/polyfill-ctype/LICENSE b/vendor/symfony/polyfill-ctype/LICENSE deleted file mode 100644 index 3f853aaf3..000000000 --- a/vendor/symfony/polyfill-ctype/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-ctype/README.md b/vendor/symfony/polyfill-ctype/README.md deleted file mode 100644 index b144d03c3..000000000 --- a/vendor/symfony/polyfill-ctype/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Symfony Polyfill / Ctype -======================== - -This component provides `ctype_*` functions to users who run php versions without the ctype extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-ctype/bootstrap.php b/vendor/symfony/polyfill-ctype/bootstrap.php deleted file mode 100644 index d54524b31..000000000 --- a/vendor/symfony/polyfill-ctype/bootstrap.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('ctype_alnum')) { - function ctype_alnum($text) { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha($text) { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl($text) { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit($text) { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph($text) { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower($text) { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print($text) { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct($text) { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space($text) { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper($text) { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit($text) { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/bootstrap80.php b/vendor/symfony/polyfill-ctype/bootstrap80.php deleted file mode 100644 index ab2f8611d..000000000 --- a/vendor/symfony/polyfill-ctype/bootstrap80.php +++ /dev/null @@ -1,46 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Ctype as p; - -if (!function_exists('ctype_alnum')) { - function ctype_alnum(mixed $text): bool { return p\Ctype::ctype_alnum($text); } -} -if (!function_exists('ctype_alpha')) { - function ctype_alpha(mixed $text): bool { return p\Ctype::ctype_alpha($text); } -} -if (!function_exists('ctype_cntrl')) { - function ctype_cntrl(mixed $text): bool { return p\Ctype::ctype_cntrl($text); } -} -if (!function_exists('ctype_digit')) { - function ctype_digit(mixed $text): bool { return p\Ctype::ctype_digit($text); } -} -if (!function_exists('ctype_graph')) { - function ctype_graph(mixed $text): bool { return p\Ctype::ctype_graph($text); } -} -if (!function_exists('ctype_lower')) { - function ctype_lower(mixed $text): bool { return p\Ctype::ctype_lower($text); } -} -if (!function_exists('ctype_print')) { - function ctype_print(mixed $text): bool { return p\Ctype::ctype_print($text); } -} -if (!function_exists('ctype_punct')) { - function ctype_punct(mixed $text): bool { return p\Ctype::ctype_punct($text); } -} -if (!function_exists('ctype_space')) { - function ctype_space(mixed $text): bool { return p\Ctype::ctype_space($text); } -} -if (!function_exists('ctype_upper')) { - function ctype_upper(mixed $text): bool { return p\Ctype::ctype_upper($text); } -} -if (!function_exists('ctype_xdigit')) { - function ctype_xdigit(mixed $text): bool { return p\Ctype::ctype_xdigit($text); } -} diff --git a/vendor/symfony/polyfill-ctype/composer.json b/vendor/symfony/polyfill-ctype/composer.json deleted file mode 100644 index 1b3efff57..000000000 --- a/vendor/symfony/polyfill-ctype/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-ctype", - "type": "library", - "description": "Symfony polyfill for ctype functions", - "keywords": ["polyfill", "compatibility", "portable", "ctype"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-ctype": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Ctype\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php b/vendor/symfony/polyfill-intl-grapheme/Grapheme.php deleted file mode 100644 index 5373f1685..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/Grapheme.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Grapheme; - -\define('SYMFONY_GRAPHEME_CLUSTER_RX', ((float) \PCRE_VERSION < 10 ? (float) \PCRE_VERSION >= 8.32 : (float) \PCRE_VERSION >= 10.39) ? '\X' : Grapheme::GRAPHEME_CLUSTER_RX); - -/** - * Partial intl implementation in pure PHP. - * - * Implemented: - * - grapheme_extract - Extract a sequence of grapheme clusters from a text buffer, which must be encoded in UTF-8 - * - grapheme_stripos - Find position (in grapheme units) of first occurrence of a case-insensitive string - * - grapheme_stristr - Returns part of haystack string from the first occurrence of case-insensitive needle to the end of haystack - * - grapheme_strlen - Get string length in grapheme units - * - grapheme_strpos - Find position (in grapheme units) of first occurrence of a string - * - grapheme_strripos - Find position (in grapheme units) of last occurrence of a case-insensitive string - * - grapheme_strrpos - Find position (in grapheme units) of last occurrence of a string - * - grapheme_strstr - Returns part of haystack string from the first occurrence of needle to the end of haystack - * - grapheme_substr - Return part of a string - * - * @author Nicolas Grekas - * - * @internal - */ -final class Grapheme -{ - // (CRLF|([ZWNJ-ZWJ]|T+|L*(LV?V+|LV|LVT)T*|L+|[^Control])[Extend]*|[Control]) - // This regular expression is a work around for http://bugs.exim.org/1279 - public const GRAPHEME_CLUSTER_RX = '(?:\r\n|(?:[ -~\x{200C}\x{200D}]|[ᆨ-ᇹ]+|[ᄀ-ᅟ]*(?:[가개갸걔거게겨계고과괘괴교구궈궤귀규그긔기까깨꺄꺠꺼께껴꼐꼬꽈꽤꾀꾜꾸꿔꿰뀌뀨끄끠끼나내냐냬너네녀녜노놔놰뇌뇨누눠눼뉘뉴느늬니다대댜댸더데뎌뎨도돠돼되됴두둬뒈뒤듀드듸디따때땨떄떠떼뗘뗴또똬뙈뙤뚀뚜뚸뛔뛰뜌뜨띄띠라래랴럐러레려례로롸뢔뢰료루뤄뤠뤼류르릐리마매먀먜머메며몌모뫄뫠뫼묘무뭐뭬뮈뮤므믜미바배뱌뱨버베벼볘보봐봬뵈뵤부붜붸뷔뷰브븨비빠빼뺘뺴뻐뻬뼈뼤뽀뽜뽸뾔뾰뿌뿨쀄쀠쀼쁘쁴삐사새샤섀서세셔셰소솨쇄쇠쇼수숴쉐쉬슈스싀시싸쌔쌰썌써쎄쎠쎼쏘쏴쐐쐬쑈쑤쒀쒜쒸쓔쓰씌씨아애야얘어에여예오와왜외요우워웨위유으의이자재쟈쟤저제져졔조좌좨죄죠주줘줴쥐쥬즈즤지짜째쨔쨰쩌쩨쪄쪠쪼쫘쫴쬐쬬쭈쭤쮀쮜쮸쯔쯰찌차채챠챼처체쳐쳬초촤쵀최쵸추춰췌취츄츠츼치카캐캬컈커케켜켸코콰쾌쾨쿄쿠쿼퀘퀴큐크킈키타태탸턔터테텨톄토톼퇘퇴툐투퉈퉤튀튜트틔티파패퍄퍠퍼페펴폐포퐈퐤푀표푸풔풰퓌퓨프픠피하해햐햬허헤혀혜호화홰회효후훠훼휘휴흐희히]?[ᅠ-ᆢ]+|[가-힣])[ᆨ-ᇹ]*|[ᄀ-ᅟ]+|[^\p{Cc}\p{Cf}\p{Zl}\p{Zp}])[\p{Mn}\p{Me}\x{09BE}\x{09D7}\x{0B3E}\x{0B57}\x{0BBE}\x{0BD7}\x{0CC2}\x{0CD5}\x{0CD6}\x{0D3E}\x{0D57}\x{0DCF}\x{0DDF}\x{200C}\x{200D}\x{1D165}\x{1D16E}-\x{1D172}]*|[\p{Cc}\p{Cf}\p{Zl}\p{Zp}])'; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - public static function grapheme_extract($s, $size, $type = \GRAPHEME_EXTR_COUNT, $start = 0, &$next = 0) - { - if (0 > $start) { - $start = \strlen($s) + $start; - } - - if (!\is_scalar($s)) { - $hasError = false; - set_error_handler(function () use (&$hasError) { $hasError = true; }); - $next = substr($s, $start); - restore_error_handler(); - if ($hasError) { - substr($s, $start); - $s = ''; - } else { - $s = $next; - } - } else { - $s = substr($s, $start); - } - $size = (int) $size; - $type = (int) $type; - $start = (int) $start; - - if (\GRAPHEME_EXTR_COUNT !== $type && \GRAPHEME_EXTR_MAXBYTES !== $type && \GRAPHEME_EXTR_MAXCHARS !== $type) { - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS'); - } - - if (!isset($s[0]) || 0 > $size || 0 > $start) { - return false; - } - if (0 === $size) { - return ''; - } - - $next = $start; - - $s = preg_split('/('.SYMFONY_GRAPHEME_CLUSTER_RX.')/u', "\r\n".$s, $size + 1, \PREG_SPLIT_NO_EMPTY | \PREG_SPLIT_DELIM_CAPTURE); - - if (!isset($s[1])) { - return false; - } - - $i = 1; - $ret = ''; - - do { - if (\GRAPHEME_EXTR_COUNT === $type) { - --$size; - } elseif (\GRAPHEME_EXTR_MAXBYTES === $type) { - $size -= \strlen($s[$i]); - } else { - $size -= iconv_strlen($s[$i], 'UTF-8//IGNORE'); - } - - if ($size >= 0) { - $ret .= $s[$i]; - } - } while (isset($s[++$i]) && $size > 0); - - $next += \strlen($ret); - - return $ret; - } - - public static function grapheme_strlen($s) - { - preg_replace('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', '', $s, -1, $len); - - return 0 === $len && '' !== $s ? null : $len; - } - - public static function grapheme_substr($s, $start, $len = null) - { - if (null === $len) { - $len = 2147483647; - } - - preg_match_all('/'.SYMFONY_GRAPHEME_CLUSTER_RX.'/u', $s, $s); - - $slen = \count($s[0]); - $start = (int) $start; - - if (0 > $start) { - $start += $slen; - } - if (0 > $start) { - if (\PHP_VERSION_ID < 80000) { - return false; - } - - $start = 0; - } - if ($start >= $slen) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - - $rem = $slen - $start; - - if (0 > $len) { - $len += $rem; - } - if (0 === $len) { - return ''; - } - if (0 > $len) { - return \PHP_VERSION_ID >= 80000 ? '' : false; - } - if ($len > $rem) { - $len = $rem; - } - - return implode('', \array_slice($s[0], $start, $len)); - } - - public static function grapheme_strpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 0); - } - - public static function grapheme_stripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 1); - } - - public static function grapheme_strrpos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 2); - } - - public static function grapheme_strripos($s, $needle, $offset = 0) - { - return self::grapheme_position($s, $needle, $offset, 3); - } - - public static function grapheme_stristr($s, $needle, $beforeNeedle = false) - { - return mb_stristr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - public static function grapheme_strstr($s, $needle, $beforeNeedle = false) - { - return mb_strstr($s, $needle, $beforeNeedle, 'UTF-8'); - } - - private static function grapheme_position($s, $needle, $offset, $mode) - { - $needle = (string) $needle; - if (80000 > \PHP_VERSION_ID && !preg_match('/./us', $needle)) { - return false; - } - $s = (string) $s; - if (!preg_match('/./us', $s)) { - return false; - } - if ($offset > 0) { - $s = self::grapheme_substr($s, $offset); - } elseif ($offset < 0) { - if (2 > $mode) { - $offset += self::grapheme_strlen($s); - $s = self::grapheme_substr($s, $offset); - if (0 > $offset) { - $offset = 0; - } - } elseif (0 > $offset += self::grapheme_strlen($needle)) { - $s = self::grapheme_substr($s, 0, $offset); - $offset = 0; - } else { - $offset = 0; - } - } - - // As UTF-8 is self-synchronizing, and we have ensured the strings are valid UTF-8, - // we can use normal binary string functions here. For case-insensitive searches, - // case fold the strings first. - $caseInsensitive = $mode & 1; - $reverse = $mode & 2; - if ($caseInsensitive) { - // Use the same case folding mode as mbstring does for mb_stripos(). - // Stick to SIMPLE case folding to avoid changing the length of the string, which - // might result in offsets being shifted. - $mode = \defined('MB_CASE_FOLD_SIMPLE') ? \MB_CASE_FOLD_SIMPLE : \MB_CASE_LOWER; - $s = mb_convert_case($s, $mode, 'UTF-8'); - $needle = mb_convert_case($needle, $mode, 'UTF-8'); - - if (!\defined('MB_CASE_FOLD_SIMPLE')) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - $needle = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $needle); - } - } - if ($reverse) { - $needlePos = strrpos($s, $needle); - } else { - $needlePos = strpos($s, $needle); - } - - return false !== $needlePos ? self::grapheme_strlen(substr($s, 0, $needlePos)) + $offset : false; - } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/LICENSE b/vendor/symfony/polyfill-intl-grapheme/LICENSE deleted file mode 100644 index 4cd8bdd30..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-intl-grapheme/README.md b/vendor/symfony/polyfill-intl-grapheme/README.md deleted file mode 100644 index f55d92c5c..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/README.md +++ /dev/null @@ -1,31 +0,0 @@ -Symfony Polyfill / Intl: Grapheme -================================= - -This component provides a partial, native PHP implementation of the -[Grapheme functions](https://php.net/intl.grapheme) from the -[Intl](https://php.net/intl) extension. - -- [`grapheme_extract`](https://php.net/grapheme_extract): Extract a sequence of grapheme - clusters from a text buffer, which must be encoded in UTF-8 -- [`grapheme_stripos`](https://php.net/grapheme_stripos): Find position (in grapheme units) - of first occurrence of a case-insensitive string -- [`grapheme_stristr`](https://php.net/grapheme_stristr): Returns part of haystack string - from the first occurrence of case-insensitive needle to the end of haystack -- [`grapheme_strlen`](https://php.net/grapheme_strlen): Get string length in grapheme units -- [`grapheme_strpos`](https://php.net/grapheme_strpos): Find position (in grapheme units) - of first occurrence of a string -- [`grapheme_strripos`](https://php.net/grapheme_strripos): Find position (in grapheme units) - of last occurrence of a case-insensitive string -- [`grapheme_strrpos`](https://php.net/grapheme_strrpos): Find position (in grapheme units) - of last occurrence of a string -- [`grapheme_strstr`](https://php.net/grapheme_strstr): Returns part of haystack string from - the first occurrence of needle to the end of haystack -- [`grapheme_substr`](https://php.net/grapheme_substr): Return part of a string - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-intl-grapheme/bootstrap.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap.php deleted file mode 100644 index a9ea03c7e..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (extension_loaded('intl')) { - return; -} - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract($haystack, $size, $type = 0, $start = 0, &$next = 0) { return p\Grapheme::grapheme_extract($haystack, $size, $type, $start, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_stripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_stristr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen($input) { return p\Grapheme::grapheme_strlen($input); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strripos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos($haystack, $needle, $offset = 0) { return p\Grapheme::grapheme_strrpos($haystack, $needle, $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr($haystack, $needle, $beforeNeedle = false) { return p\Grapheme::grapheme_strstr($haystack, $needle, $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr($string, $offset, $length = null) { return p\Grapheme::grapheme_substr($string, $offset, $length); } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php b/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php deleted file mode 100644 index b8c078677..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/bootstrap80.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Grapheme as p; - -if (!defined('GRAPHEME_EXTR_COUNT')) { - define('GRAPHEME_EXTR_COUNT', 0); -} -if (!defined('GRAPHEME_EXTR_MAXBYTES')) { - define('GRAPHEME_EXTR_MAXBYTES', 1); -} -if (!defined('GRAPHEME_EXTR_MAXCHARS')) { - define('GRAPHEME_EXTR_MAXCHARS', 2); -} - -if (!function_exists('grapheme_extract')) { - function grapheme_extract(?string $haystack, ?int $size, ?int $type = GRAPHEME_EXTR_COUNT, ?int $offset = 0, &$next = null): string|false { return p\Grapheme::grapheme_extract((string) $haystack, (int) $size, (int) $type, (int) $offset, $next); } -} -if (!function_exists('grapheme_stripos')) { - function grapheme_stripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_stripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_stristr')) { - function grapheme_stristr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_stristr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_strlen')) { - function grapheme_strlen(?string $string): int|false|null { return p\Grapheme::grapheme_strlen((string) $string); } -} -if (!function_exists('grapheme_strpos')) { - function grapheme_strpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strripos')) { - function grapheme_strripos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strripos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strrpos')) { - function grapheme_strrpos(?string $haystack, ?string $needle, ?int $offset = 0): int|false { return p\Grapheme::grapheme_strrpos((string) $haystack, (string) $needle, (int) $offset); } -} -if (!function_exists('grapheme_strstr')) { - function grapheme_strstr(?string $haystack, ?string $needle, ?bool $beforeNeedle = false): string|false { return p\Grapheme::grapheme_strstr((string) $haystack, (string) $needle, (bool) $beforeNeedle); } -} -if (!function_exists('grapheme_substr')) { - function grapheme_substr(?string $string, ?int $offset, ?int $length = null): string|false { return p\Grapheme::grapheme_substr((string) $string, (int) $offset, $length); } -} diff --git a/vendor/symfony/polyfill-intl-grapheme/composer.json b/vendor/symfony/polyfill-intl-grapheme/composer.json deleted file mode 100644 index fde5537fc..000000000 --- a/vendor/symfony/polyfill-intl-grapheme/composer.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "name": "symfony/polyfill-intl-grapheme", - "type": "library", - "description": "Symfony polyfill for intl's grapheme_* functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "grapheme"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Grapheme\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/LICENSE b/vendor/symfony/polyfill-intl-normalizer/LICENSE deleted file mode 100644 index 4cd8bdd30..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Normalizer.php deleted file mode 100644 index 81704ab37..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/Normalizer.php +++ /dev/null @@ -1,310 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Intl\Normalizer; - -/** - * 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. - * See http://www.unicode.org/reports/tr15/ for detailed info about Unicode normalizations. - * - * @author Nicolas Grekas - * - * @internal - */ -class Normalizer -{ - public const FORM_D = \Normalizer::FORM_D; - public const FORM_KD = \Normalizer::FORM_KD; - public const FORM_C = \Normalizer::FORM_C; - public const FORM_KC = \Normalizer::FORM_KC; - public const NFD = \Normalizer::NFD; - public const NFKD = \Normalizer::NFKD; - public const NFC = \Normalizer::NFC; - public const NFKC = \Normalizer::NFKC; - - private static $C; - private static $D; - private static $KD; - private static $cC; - 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"; - - public static function isNormalized(string $s, int $form = self::FORM_C) - { - if (!\in_array($form, [self::NFD, self::NFKD, self::NFC, self::NFKC])) { - return false; - } - if (!isset($s[strspn($s, self::$ASCII)])) { - return true; - } - if (self::NFC == $form && preg_match('//u', $s) && !preg_match('/[^\x00-\x{2FF}]/u', $s)) { - return true; - } - - return self::normalize($s, $form) === $s; - } - - public static function normalize(string $s, int $form = self::FORM_C) - { - if (!preg_match('//u', $s)) { - return false; - } - - switch ($form) { - case self::NFC: $C = true; $K = false; break; - case self::NFD: $C = false; $K = false; break; - case self::NFKC: $C = true; $K = true; break; - case self::NFKD: $C = false; $K = true; break; - default: - if (\defined('Normalizer::NONE') && \Normalizer::NONE == $form) { - return $s; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError('normalizer_normalize(): Argument #2 ($form) must be a a valid normalization form'); - } - - if ('' === $s) { - return ''; - } - - if ($K && null === self::$KD) { - self::$KD = self::getData('compatibilityDecomposition'); - } - - if (null === self::$D) { - self::$D = self::getData('canonicalDecomposition'); - self::$cC = self::getData('combiningClass'); - } - - if (null !== $mbEncoding = (2 /* MB_OVERLOAD_STRING */ & (int) \ini_get('mbstring.func_overload')) ? mb_internal_encoding() : null) { - mb_internal_encoding('8bit'); - } - - $r = self::decompose($s, $K); - - if ($C) { - if (null === self::$C) { - self::$C = self::getData('canonicalComposition'); - } - - $r = self::recompose($r); - } - if (null !== $mbEncoding) { - mb_internal_encoding($mbEncoding); - } - - return $r; - } - - private static function recompose($s) - { - $ASCII = self::$ASCII; - $compMap = self::$C; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - - $result = $tail = ''; - - $i = $s[0] < "\x80" ? 1 : $ulenMask[$s[0] & "\xF0"]; - $len = \strlen($s); - - $lastUchr = substr($s, 0, $i); - $lastUcls = isset($combClass[$lastUchr]) ? 256 : 0; - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - if ($j = strspn($s, $ASCII, $i + 1)) { - $lastUchr .= substr($s, $i, $j); - $i += $j; - } - - $result .= $lastUchr; - $lastUchr = $s[$i]; - $lastUcls = 0; - ++$i; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - - if ($lastUchr < "\xE1\x84\x80" || "\xE1\x84\x92" < $lastUchr - || $uchr < "\xE1\x85\xA1" || "\xE1\x85\xB5" < $uchr - || $lastUcls) { - // Table lookup and combining chars composition - - $ucls = $combClass[$uchr] ?? 0; - - if (isset($compMap[$lastUchr.$uchr]) && (!$lastUcls || $lastUcls < $ucls)) { - $lastUchr = $compMap[$lastUchr.$uchr]; - } elseif ($lastUcls = $ucls) { - $tail .= $uchr; - } else { - if ($tail) { - $lastUchr .= $tail; - $tail = ''; - } - - $result .= $lastUchr; - $lastUchr = $uchr; - } - } else { - // Hangul chars - - $L = \ord($lastUchr[2]) - 0x80; - $V = \ord($uchr[2]) - 0xA1; - $T = 0; - - $uchr = substr($s, $i + $ulen, 3); - - if ("\xE1\x86\xA7" <= $uchr && $uchr <= "\xE1\x87\x82") { - $T = \ord($uchr[2]) - 0xA7; - 0 > $T && $T += 0x40; - $ulen += 3; - } - - $L = 0xAC00 + ($L * 21 + $V) * 28 + $T; - $lastUchr = \chr(0xE0 | $L >> 12).\chr(0x80 | $L >> 6 & 0x3F).\chr(0x80 | $L & 0x3F); - } - - $i += $ulen; - } - - return $result.$lastUchr.$tail; - } - - private static function decompose($s, $c) - { - $result = ''; - - $ASCII = self::$ASCII; - $decompMap = self::$D; - $combClass = self::$cC; - $ulenMask = self::$ulenMask; - if ($c) { - $compatMap = self::$KD; - } - - $c = []; - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - if ($s[$i] < "\x80") { - // ASCII chars - - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $j = 1 + strspn($s, $ASCII, $i + 1); - $result .= substr($s, $i, $j); - $i += $j; - continue; - } - - $ulen = $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if ($uchr < "\xEA\xB0\x80" || "\xED\x9E\xA3" < $uchr) { - // Table lookup - - if ($uchr !== $j = $compatMap[$uchr] ?? ($decompMap[$uchr] ?? $uchr)) { - $uchr = $j; - - $j = \strlen($uchr); - $ulen = $uchr[0] < "\x80" ? 1 : $ulenMask[$uchr[0] & "\xF0"]; - - if ($ulen != $j) { - // Put trailing chars in $s - - $j -= $ulen; - $i -= $j; - - if (0 > $i) { - $s = str_repeat(' ', -$i).$s; - $len -= $i; - $i = 0; - } - - while ($j--) { - $s[$i + $j] = $uchr[$ulen + $j]; - } - - $uchr = substr($uchr, 0, $ulen); - } - } - if (isset($combClass[$uchr])) { - // Combining chars, for sorting - - if (!isset($c[$combClass[$uchr]])) { - $c[$combClass[$uchr]] = ''; - } - $c[$combClass[$uchr]] .= $uchr; - continue; - } - } else { - // Hangul chars - - $uchr = unpack('C*', $uchr); - $j = (($uchr[1] - 224) << 12) + (($uchr[2] - 128) << 6) + $uchr[3] - 0xAC80; - - $uchr = "\xE1\x84".\chr(0x80 + (int) ($j / 588)) - ."\xE1\x85".\chr(0xA1 + (int) (($j % 588) / 28)); - - if ($j %= 28) { - $uchr .= $j < 25 - ? ("\xE1\x86".\chr(0xA7 + $j)) - : ("\xE1\x87".\chr(0x67 + $j)); - } - } - if ($c) { - ksort($c); - $result .= implode('', $c); - $c = []; - } - - $result .= $uchr; - } - - if ($c) { - ksort($c); - $result .= implode('', $c); - } - - return $result; - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/README.md b/vendor/symfony/polyfill-intl-normalizer/README.md deleted file mode 100644 index b9b762e85..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Symfony Polyfill / Intl: Normalizer -=================================== - -This component provides a fallback implementation for the -[`Normalizer`](https://php.net/Normalizer) class provided -by the [Intl](https://php.net/intl) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php b/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php deleted file mode 100644 index 0fdfc890a..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/stubs/Normalizer.php +++ /dev/null @@ -1,17 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '΅' => '΅', - 'Ά' => 'Ά', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ὲ' => 'ὲ', - 'ὴ' => 'ὴ', - 'ὶ' => 'ὶ', - 'ὸ' => 'ὸ', - 'ὺ' => 'ὺ', - 'ὼ' => 'ὼ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'ᾼ' => 'ᾼ', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Ὴ' => 'Ὴ', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ὼ' => 'Ὼ', - 'ῼ' => 'ῼ', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php deleted file mode 100644 index 5a3e8e096..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/canonicalDecomposition.php +++ /dev/null @@ -1,2065 +0,0 @@ - 'À', - 'Á' => 'Á', - 'Â' => 'Â', - 'Ã' => 'Ã', - 'Ä' => 'Ä', - 'Å' => 'Å', - 'Ç' => 'Ç', - 'È' => 'È', - 'É' => 'É', - 'Ê' => 'Ê', - 'Ë' => 'Ë', - 'Ì' => 'Ì', - 'Í' => 'Í', - 'Î' => 'Î', - 'Ï' => 'Ï', - 'Ñ' => 'Ñ', - 'Ò' => 'Ò', - 'Ó' => 'Ó', - 'Ô' => 'Ô', - 'Õ' => 'Õ', - 'Ö' => 'Ö', - 'Ù' => 'Ù', - 'Ú' => 'Ú', - 'Û' => 'Û', - 'Ü' => 'Ü', - 'Ý' => 'Ý', - 'à' => 'à', - 'á' => 'á', - 'â' => 'â', - 'ã' => 'ã', - 'ä' => 'ä', - 'å' => 'å', - 'ç' => 'ç', - 'è' => 'è', - 'é' => 'é', - 'ê' => 'ê', - 'ë' => 'ë', - 'ì' => 'ì', - 'í' => 'í', - 'î' => 'î', - 'ï' => 'ï', - 'ñ' => 'ñ', - 'ò' => 'ò', - 'ó' => 'ó', - 'ô' => 'ô', - 'õ' => 'õ', - 'ö' => 'ö', - 'ù' => 'ù', - 'ú' => 'ú', - 'û' => 'û', - 'ü' => 'ü', - 'ý' => 'ý', - 'ÿ' => 'ÿ', - 'Ā' => 'Ā', - 'ā' => 'ā', - 'Ă' => 'Ă', - 'ă' => 'ă', - 'Ą' => 'Ą', - 'ą' => 'ą', - 'Ć' => 'Ć', - 'ć' => 'ć', - 'Ĉ' => 'Ĉ', - 'ĉ' => 'ĉ', - 'Ċ' => 'Ċ', - 'ċ' => 'ċ', - 'Č' => 'Č', - 'č' => 'č', - 'Ď' => 'Ď', - 'ď' => 'ď', - 'Ē' => 'Ē', - 'ē' => 'ē', - 'Ĕ' => 'Ĕ', - 'ĕ' => 'ĕ', - 'Ė' => 'Ė', - 'ė' => 'ė', - 'Ę' => 'Ę', - 'ę' => 'ę', - 'Ě' => 'Ě', - 'ě' => 'ě', - 'Ĝ' => 'Ĝ', - 'ĝ' => 'ĝ', - 'Ğ' => 'Ğ', - 'ğ' => 'ğ', - 'Ġ' => 'Ġ', - 'ġ' => 'ġ', - 'Ģ' => 'Ģ', - 'ģ' => 'ģ', - 'Ĥ' => 'Ĥ', - 'ĥ' => 'ĥ', - 'Ĩ' => 'Ĩ', - 'ĩ' => 'ĩ', - 'Ī' => 'Ī', - 'ī' => 'ī', - 'Ĭ' => 'Ĭ', - 'ĭ' => 'ĭ', - 'Į' => 'Į', - 'į' => 'į', - 'İ' => 'İ', - 'Ĵ' => 'Ĵ', - 'ĵ' => 'ĵ', - 'Ķ' => 'Ķ', - 'ķ' => 'ķ', - 'Ĺ' => 'Ĺ', - 'ĺ' => 'ĺ', - 'Ļ' => 'Ļ', - 'ļ' => 'ļ', - 'Ľ' => 'Ľ', - 'ľ' => 'ľ', - 'Ń' => 'Ń', - 'ń' => 'ń', - 'Ņ' => 'Ņ', - 'ņ' => 'ņ', - 'Ň' => 'Ň', - 'ň' => 'ň', - 'Ō' => 'Ō', - 'ō' => 'ō', - 'Ŏ' => 'Ŏ', - 'ŏ' => 'ŏ', - 'Ő' => 'Ő', - 'ő' => 'ő', - 'Ŕ' => 'Ŕ', - 'ŕ' => 'ŕ', - 'Ŗ' => 'Ŗ', - 'ŗ' => 'ŗ', - 'Ř' => 'Ř', - 'ř' => 'ř', - 'Ś' => 'Ś', - 'ś' => 'ś', - 'Ŝ' => 'Ŝ', - 'ŝ' => 'ŝ', - 'Ş' => 'Ş', - 'ş' => 'ş', - 'Š' => 'Š', - 'š' => 'š', - 'Ţ' => 'Ţ', - 'ţ' => 'ţ', - 'Ť' => 'Ť', - 'ť' => 'ť', - 'Ũ' => 'Ũ', - 'ũ' => 'ũ', - 'Ū' => 'Ū', - 'ū' => 'ū', - 'Ŭ' => 'Ŭ', - 'ŭ' => 'ŭ', - 'Ů' => 'Ů', - 'ů' => 'ů', - 'Ű' => 'Ű', - 'ű' => 'ű', - 'Ų' => 'Ų', - 'ų' => 'ų', - 'Ŵ' => 'Ŵ', - 'ŵ' => 'ŵ', - 'Ŷ' => 'Ŷ', - 'ŷ' => 'ŷ', - 'Ÿ' => 'Ÿ', - 'Ź' => 'Ź', - 'ź' => 'ź', - 'Ż' => 'Ż', - 'ż' => 'ż', - 'Ž' => 'Ž', - 'ž' => 'ž', - 'Ơ' => 'Ơ', - 'ơ' => 'ơ', - 'Ư' => 'Ư', - 'ư' => 'ư', - 'Ǎ' => 'Ǎ', - 'ǎ' => 'ǎ', - 'Ǐ' => 'Ǐ', - 'ǐ' => 'ǐ', - 'Ǒ' => 'Ǒ', - 'ǒ' => 'ǒ', - 'Ǔ' => 'Ǔ', - 'ǔ' => 'ǔ', - 'Ǖ' => 'Ǖ', - 'ǖ' => 'ǖ', - 'Ǘ' => 'Ǘ', - 'ǘ' => 'ǘ', - 'Ǚ' => 'Ǚ', - 'ǚ' => 'ǚ', - 'Ǜ' => 'Ǜ', - 'ǜ' => 'ǜ', - 'Ǟ' => 'Ǟ', - 'ǟ' => 'ǟ', - 'Ǡ' => 'Ǡ', - 'ǡ' => 'ǡ', - 'Ǣ' => 'Ǣ', - 'ǣ' => 'ǣ', - 'Ǧ' => 'Ǧ', - 'ǧ' => 'ǧ', - 'Ǩ' => 'Ǩ', - 'ǩ' => 'ǩ', - 'Ǫ' => 'Ǫ', - 'ǫ' => 'ǫ', - 'Ǭ' => 'Ǭ', - 'ǭ' => 'ǭ', - 'Ǯ' => 'Ǯ', - 'ǯ' => 'ǯ', - 'ǰ' => 'ǰ', - 'Ǵ' => 'Ǵ', - 'ǵ' => 'ǵ', - 'Ǹ' => 'Ǹ', - 'ǹ' => 'ǹ', - 'Ǻ' => 'Ǻ', - 'ǻ' => 'ǻ', - 'Ǽ' => 'Ǽ', - 'ǽ' => 'ǽ', - 'Ǿ' => 'Ǿ', - 'ǿ' => 'ǿ', - 'Ȁ' => 'Ȁ', - 'ȁ' => 'ȁ', - 'Ȃ' => 'Ȃ', - 'ȃ' => 'ȃ', - 'Ȅ' => 'Ȅ', - 'ȅ' => 'ȅ', - 'Ȇ' => 'Ȇ', - 'ȇ' => 'ȇ', - 'Ȉ' => 'Ȉ', - 'ȉ' => 'ȉ', - 'Ȋ' => 'Ȋ', - 'ȋ' => 'ȋ', - 'Ȍ' => 'Ȍ', - 'ȍ' => 'ȍ', - 'Ȏ' => 'Ȏ', - 'ȏ' => 'ȏ', - 'Ȑ' => 'Ȑ', - 'ȑ' => 'ȑ', - 'Ȓ' => 'Ȓ', - 'ȓ' => 'ȓ', - 'Ȕ' => 'Ȕ', - 'ȕ' => 'ȕ', - 'Ȗ' => 'Ȗ', - 'ȗ' => 'ȗ', - 'Ș' => 'Ș', - 'ș' => 'ș', - 'Ț' => 'Ț', - 'ț' => 'ț', - 'Ȟ' => 'Ȟ', - 'ȟ' => 'ȟ', - 'Ȧ' => 'Ȧ', - 'ȧ' => 'ȧ', - 'Ȩ' => 'Ȩ', - 'ȩ' => 'ȩ', - 'Ȫ' => 'Ȫ', - 'ȫ' => 'ȫ', - 'Ȭ' => 'Ȭ', - 'ȭ' => 'ȭ', - 'Ȯ' => 'Ȯ', - 'ȯ' => 'ȯ', - 'Ȱ' => 'Ȱ', - 'ȱ' => 'ȱ', - 'Ȳ' => 'Ȳ', - 'ȳ' => 'ȳ', - '̀' => '̀', - '́' => '́', - '̓' => '̓', - '̈́' => '̈́', - 'ʹ' => 'ʹ', - ';' => ';', - '΅' => '΅', - 'Ά' => 'Ά', - '·' => '·', - 'Έ' => 'Έ', - 'Ή' => 'Ή', - 'Ί' => 'Ί', - 'Ό' => 'Ό', - 'Ύ' => 'Ύ', - 'Ώ' => 'Ώ', - 'ΐ' => 'ΐ', - 'Ϊ' => 'Ϊ', - 'Ϋ' => 'Ϋ', - 'ά' => 'ά', - 'έ' => 'έ', - 'ή' => 'ή', - 'ί' => 'ί', - 'ΰ' => 'ΰ', - 'ϊ' => 'ϊ', - 'ϋ' => 'ϋ', - 'ό' => 'ό', - 'ύ' => 'ύ', - 'ώ' => 'ώ', - 'ϓ' => 'ϓ', - 'ϔ' => 'ϔ', - 'Ѐ' => 'Ѐ', - 'Ё' => 'Ё', - 'Ѓ' => 'Ѓ', - 'Ї' => 'Ї', - 'Ќ' => 'Ќ', - 'Ѝ' => 'Ѝ', - 'Ў' => 'Ў', - 'Й' => 'Й', - 'й' => 'й', - 'ѐ' => 'ѐ', - 'ё' => 'ё', - 'ѓ' => 'ѓ', - 'ї' => 'ї', - 'ќ' => 'ќ', - 'ѝ' => 'ѝ', - 'ў' => 'ў', - 'Ѷ' => 'Ѷ', - 'ѷ' => 'ѷ', - 'Ӂ' => 'Ӂ', - 'ӂ' => 'ӂ', - 'Ӑ' => 'Ӑ', - 'ӑ' => 'ӑ', - 'Ӓ' => 'Ӓ', - 'ӓ' => 'ӓ', - 'Ӗ' => 'Ӗ', - 'ӗ' => 'ӗ', - 'Ӛ' => 'Ӛ', - 'ӛ' => 'ӛ', - 'Ӝ' => 'Ӝ', - 'ӝ' => 'ӝ', - 'Ӟ' => 'Ӟ', - 'ӟ' => 'ӟ', - 'Ӣ' => 'Ӣ', - 'ӣ' => 'ӣ', - 'Ӥ' => 'Ӥ', - 'ӥ' => 'ӥ', - 'Ӧ' => 'Ӧ', - 'ӧ' => 'ӧ', - 'Ӫ' => 'Ӫ', - 'ӫ' => 'ӫ', - 'Ӭ' => 'Ӭ', - 'ӭ' => 'ӭ', - 'Ӯ' => 'Ӯ', - 'ӯ' => 'ӯ', - 'Ӱ' => 'Ӱ', - 'ӱ' => 'ӱ', - 'Ӳ' => 'Ӳ', - 'ӳ' => 'ӳ', - 'Ӵ' => 'Ӵ', - 'ӵ' => 'ӵ', - 'Ӹ' => 'Ӹ', - 'ӹ' => 'ӹ', - 'آ' => 'آ', - 'أ' => 'أ', - 'ؤ' => 'ؤ', - 'إ' => 'إ', - 'ئ' => 'ئ', - 'ۀ' => 'ۀ', - 'ۂ' => 'ۂ', - 'ۓ' => 'ۓ', - 'ऩ' => 'ऩ', - 'ऱ' => 'ऱ', - 'ऴ' => 'ऴ', - 'क़' => 'क़', - 'ख़' => 'ख़', - 'ग़' => 'ग़', - 'ज़' => 'ज़', - 'ड़' => 'ड़', - 'ढ़' => 'ढ़', - 'फ़' => 'फ़', - 'य़' => 'य़', - 'ো' => 'ো', - 'ৌ' => 'ৌ', - 'ড়' => 'ড়', - 'ঢ়' => 'ঢ়', - 'য়' => 'য়', - 'ਲ਼' => 'ਲ਼', - 'ਸ਼' => 'ਸ਼', - 'ਖ਼' => 'ਖ਼', - 'ਗ਼' => 'ਗ਼', - 'ਜ਼' => 'ਜ਼', - 'ਫ਼' => 'ਫ਼', - 'ୈ' => 'ୈ', - 'ୋ' => 'ୋ', - 'ୌ' => 'ୌ', - 'ଡ଼' => 'ଡ଼', - 'ଢ଼' => 'ଢ଼', - 'ஔ' => 'ஔ', - 'ொ' => 'ொ', - 'ோ' => 'ோ', - 'ௌ' => 'ௌ', - 'ై' => 'ై', - 'ೀ' => 'ೀ', - 'ೇ' => 'ೇ', - 'ೈ' => 'ೈ', - 'ೊ' => 'ೊ', - 'ೋ' => 'ೋ', - 'ൊ' => 'ൊ', - 'ോ' => 'ോ', - 'ൌ' => 'ൌ', - 'ේ' => 'ේ', - 'ො' => 'ො', - 'ෝ' => 'ෝ', - 'ෞ' => 'ෞ', - 'གྷ' => 'གྷ', - 'ཌྷ' => 'ཌྷ', - 'དྷ' => 'དྷ', - 'བྷ' => 'བྷ', - 'ཛྷ' => 'ཛྷ', - 'ཀྵ' => 'ཀྵ', - 'ཱི' => 'ཱི', - 'ཱུ' => 'ཱུ', - 'ྲྀ' => 'ྲྀ', - 'ླྀ' => 'ླྀ', - 'ཱྀ' => 'ཱྀ', - 'ྒྷ' => 'ྒྷ', - 'ྜྷ' => 'ྜྷ', - 'ྡྷ' => 'ྡྷ', - 'ྦྷ' => 'ྦྷ', - 'ྫྷ' => 'ྫྷ', - 'ྐྵ' => 'ྐྵ', - 'ဦ' => 'ဦ', - 'ᬆ' => 'ᬆ', - 'ᬈ' => 'ᬈ', - 'ᬊ' => 'ᬊ', - 'ᬌ' => 'ᬌ', - 'ᬎ' => 'ᬎ', - 'ᬒ' => 'ᬒ', - 'ᬻ' => 'ᬻ', - 'ᬽ' => 'ᬽ', - 'ᭀ' => 'ᭀ', - 'ᭁ' => 'ᭁ', - 'ᭃ' => 'ᭃ', - 'Ḁ' => 'Ḁ', - 'ḁ' => 'ḁ', - 'Ḃ' => 'Ḃ', - 'ḃ' => 'ḃ', - 'Ḅ' => 'Ḅ', - 'ḅ' => 'ḅ', - 'Ḇ' => 'Ḇ', - 'ḇ' => 'ḇ', - 'Ḉ' => 'Ḉ', - 'ḉ' => 'ḉ', - 'Ḋ' => 'Ḋ', - 'ḋ' => 'ḋ', - 'Ḍ' => 'Ḍ', - 'ḍ' => 'ḍ', - 'Ḏ' => 'Ḏ', - 'ḏ' => 'ḏ', - 'Ḑ' => 'Ḑ', - 'ḑ' => 'ḑ', - 'Ḓ' => 'Ḓ', - 'ḓ' => 'ḓ', - 'Ḕ' => 'Ḕ', - 'ḕ' => 'ḕ', - 'Ḗ' => 'Ḗ', - 'ḗ' => 'ḗ', - 'Ḙ' => 'Ḙ', - 'ḙ' => 'ḙ', - 'Ḛ' => 'Ḛ', - 'ḛ' => 'ḛ', - 'Ḝ' => 'Ḝ', - 'ḝ' => 'ḝ', - 'Ḟ' => 'Ḟ', - 'ḟ' => 'ḟ', - 'Ḡ' => 'Ḡ', - 'ḡ' => 'ḡ', - 'Ḣ' => 'Ḣ', - 'ḣ' => 'ḣ', - 'Ḥ' => 'Ḥ', - 'ḥ' => 'ḥ', - 'Ḧ' => 'Ḧ', - 'ḧ' => 'ḧ', - 'Ḩ' => 'Ḩ', - 'ḩ' => 'ḩ', - 'Ḫ' => 'Ḫ', - 'ḫ' => 'ḫ', - 'Ḭ' => 'Ḭ', - 'ḭ' => 'ḭ', - 'Ḯ' => 'Ḯ', - 'ḯ' => 'ḯ', - 'Ḱ' => 'Ḱ', - 'ḱ' => 'ḱ', - 'Ḳ' => 'Ḳ', - 'ḳ' => 'ḳ', - 'Ḵ' => 'Ḵ', - 'ḵ' => 'ḵ', - 'Ḷ' => 'Ḷ', - 'ḷ' => 'ḷ', - 'Ḹ' => 'Ḹ', - 'ḹ' => 'ḹ', - 'Ḻ' => 'Ḻ', - 'ḻ' => 'ḻ', - 'Ḽ' => 'Ḽ', - 'ḽ' => 'ḽ', - 'Ḿ' => 'Ḿ', - 'ḿ' => 'ḿ', - 'Ṁ' => 'Ṁ', - 'ṁ' => 'ṁ', - 'Ṃ' => 'Ṃ', - 'ṃ' => 'ṃ', - 'Ṅ' => 'Ṅ', - 'ṅ' => 'ṅ', - 'Ṇ' => 'Ṇ', - 'ṇ' => 'ṇ', - 'Ṉ' => 'Ṉ', - 'ṉ' => 'ṉ', - 'Ṋ' => 'Ṋ', - 'ṋ' => 'ṋ', - 'Ṍ' => 'Ṍ', - 'ṍ' => 'ṍ', - 'Ṏ' => 'Ṏ', - 'ṏ' => 'ṏ', - 'Ṑ' => 'Ṑ', - 'ṑ' => 'ṑ', - 'Ṓ' => 'Ṓ', - 'ṓ' => 'ṓ', - 'Ṕ' => 'Ṕ', - 'ṕ' => 'ṕ', - 'Ṗ' => 'Ṗ', - 'ṗ' => 'ṗ', - 'Ṙ' => 'Ṙ', - 'ṙ' => 'ṙ', - 'Ṛ' => 'Ṛ', - 'ṛ' => 'ṛ', - 'Ṝ' => 'Ṝ', - 'ṝ' => 'ṝ', - 'Ṟ' => 'Ṟ', - 'ṟ' => 'ṟ', - 'Ṡ' => 'Ṡ', - 'ṡ' => 'ṡ', - 'Ṣ' => 'Ṣ', - 'ṣ' => 'ṣ', - 'Ṥ' => 'Ṥ', - 'ṥ' => 'ṥ', - 'Ṧ' => 'Ṧ', - 'ṧ' => 'ṧ', - 'Ṩ' => 'Ṩ', - 'ṩ' => 'ṩ', - 'Ṫ' => 'Ṫ', - 'ṫ' => 'ṫ', - 'Ṭ' => 'Ṭ', - 'ṭ' => 'ṭ', - 'Ṯ' => 'Ṯ', - 'ṯ' => 'ṯ', - 'Ṱ' => 'Ṱ', - 'ṱ' => 'ṱ', - 'Ṳ' => 'Ṳ', - 'ṳ' => 'ṳ', - 'Ṵ' => 'Ṵ', - 'ṵ' => 'ṵ', - 'Ṷ' => 'Ṷ', - 'ṷ' => 'ṷ', - 'Ṹ' => 'Ṹ', - 'ṹ' => 'ṹ', - 'Ṻ' => 'Ṻ', - 'ṻ' => 'ṻ', - 'Ṽ' => 'Ṽ', - 'ṽ' => 'ṽ', - 'Ṿ' => 'Ṿ', - 'ṿ' => 'ṿ', - 'Ẁ' => 'Ẁ', - 'ẁ' => 'ẁ', - 'Ẃ' => 'Ẃ', - 'ẃ' => 'ẃ', - 'Ẅ' => 'Ẅ', - 'ẅ' => 'ẅ', - 'Ẇ' => 'Ẇ', - 'ẇ' => 'ẇ', - 'Ẉ' => 'Ẉ', - 'ẉ' => 'ẉ', - 'Ẋ' => 'Ẋ', - 'ẋ' => 'ẋ', - 'Ẍ' => 'Ẍ', - 'ẍ' => 'ẍ', - 'Ẏ' => 'Ẏ', - 'ẏ' => 'ẏ', - 'Ẑ' => 'Ẑ', - 'ẑ' => 'ẑ', - 'Ẓ' => 'Ẓ', - 'ẓ' => 'ẓ', - 'Ẕ' => 'Ẕ', - 'ẕ' => 'ẕ', - 'ẖ' => 'ẖ', - 'ẗ' => 'ẗ', - 'ẘ' => 'ẘ', - 'ẙ' => 'ẙ', - 'ẛ' => 'ẛ', - 'Ạ' => 'Ạ', - 'ạ' => 'ạ', - 'Ả' => 'Ả', - 'ả' => 'ả', - 'Ấ' => 'Ấ', - 'ấ' => 'ấ', - 'Ầ' => 'Ầ', - 'ầ' => 'ầ', - 'Ẩ' => 'Ẩ', - 'ẩ' => 'ẩ', - 'Ẫ' => 'Ẫ', - 'ẫ' => 'ẫ', - 'Ậ' => 'Ậ', - 'ậ' => 'ậ', - 'Ắ' => 'Ắ', - 'ắ' => 'ắ', - 'Ằ' => 'Ằ', - 'ằ' => 'ằ', - 'Ẳ' => 'Ẳ', - 'ẳ' => 'ẳ', - 'Ẵ' => 'Ẵ', - 'ẵ' => 'ẵ', - 'Ặ' => 'Ặ', - 'ặ' => 'ặ', - 'Ẹ' => 'Ẹ', - 'ẹ' => 'ẹ', - 'Ẻ' => 'Ẻ', - 'ẻ' => 'ẻ', - 'Ẽ' => 'Ẽ', - 'ẽ' => 'ẽ', - 'Ế' => 'Ế', - 'ế' => 'ế', - 'Ề' => 'Ề', - 'ề' => 'ề', - 'Ể' => 'Ể', - 'ể' => 'ể', - 'Ễ' => 'Ễ', - 'ễ' => 'ễ', - 'Ệ' => 'Ệ', - 'ệ' => 'ệ', - 'Ỉ' => 'Ỉ', - 'ỉ' => 'ỉ', - 'Ị' => 'Ị', - 'ị' => 'ị', - 'Ọ' => 'Ọ', - 'ọ' => 'ọ', - 'Ỏ' => 'Ỏ', - 'ỏ' => 'ỏ', - 'Ố' => 'Ố', - 'ố' => 'ố', - 'Ồ' => 'Ồ', - 'ồ' => 'ồ', - 'Ổ' => 'Ổ', - 'ổ' => 'ổ', - 'Ỗ' => 'Ỗ', - 'ỗ' => 'ỗ', - 'Ộ' => 'Ộ', - 'ộ' => 'ộ', - 'Ớ' => 'Ớ', - 'ớ' => 'ớ', - 'Ờ' => 'Ờ', - 'ờ' => 'ờ', - 'Ở' => 'Ở', - 'ở' => 'ở', - 'Ỡ' => 'Ỡ', - 'ỡ' => 'ỡ', - 'Ợ' => 'Ợ', - 'ợ' => 'ợ', - 'Ụ' => 'Ụ', - 'ụ' => 'ụ', - 'Ủ' => 'Ủ', - 'ủ' => 'ủ', - 'Ứ' => 'Ứ', - 'ứ' => 'ứ', - 'Ừ' => 'Ừ', - 'ừ' => 'ừ', - 'Ử' => 'Ử', - 'ử' => 'ử', - 'Ữ' => 'Ữ', - 'ữ' => 'ữ', - 'Ự' => 'Ự', - 'ự' => 'ự', - 'Ỳ' => 'Ỳ', - 'ỳ' => 'ỳ', - 'Ỵ' => 'Ỵ', - 'ỵ' => 'ỵ', - 'Ỷ' => 'Ỷ', - 'ỷ' => 'ỷ', - 'Ỹ' => 'Ỹ', - 'ỹ' => 'ỹ', - 'ἀ' => 'ἀ', - 'ἁ' => 'ἁ', - 'ἂ' => 'ἂ', - 'ἃ' => 'ἃ', - 'ἄ' => 'ἄ', - 'ἅ' => 'ἅ', - 'ἆ' => 'ἆ', - 'ἇ' => 'ἇ', - 'Ἀ' => 'Ἀ', - 'Ἁ' => 'Ἁ', - 'Ἂ' => 'Ἂ', - 'Ἃ' => 'Ἃ', - 'Ἄ' => 'Ἄ', - 'Ἅ' => 'Ἅ', - 'Ἆ' => 'Ἆ', - 'Ἇ' => 'Ἇ', - 'ἐ' => 'ἐ', - 'ἑ' => 'ἑ', - 'ἒ' => 'ἒ', - 'ἓ' => 'ἓ', - 'ἔ' => 'ἔ', - 'ἕ' => 'ἕ', - 'Ἐ' => 'Ἐ', - 'Ἑ' => 'Ἑ', - 'Ἒ' => 'Ἒ', - 'Ἓ' => 'Ἓ', - 'Ἔ' => 'Ἔ', - 'Ἕ' => 'Ἕ', - 'ἠ' => 'ἠ', - 'ἡ' => 'ἡ', - 'ἢ' => 'ἢ', - 'ἣ' => 'ἣ', - 'ἤ' => 'ἤ', - 'ἥ' => 'ἥ', - 'ἦ' => 'ἦ', - 'ἧ' => 'ἧ', - 'Ἠ' => 'Ἠ', - 'Ἡ' => 'Ἡ', - 'Ἢ' => 'Ἢ', - 'Ἣ' => 'Ἣ', - 'Ἤ' => 'Ἤ', - 'Ἥ' => 'Ἥ', - 'Ἦ' => 'Ἦ', - 'Ἧ' => 'Ἧ', - 'ἰ' => 'ἰ', - 'ἱ' => 'ἱ', - 'ἲ' => 'ἲ', - 'ἳ' => 'ἳ', - 'ἴ' => 'ἴ', - 'ἵ' => 'ἵ', - 'ἶ' => 'ἶ', - 'ἷ' => 'ἷ', - 'Ἰ' => 'Ἰ', - 'Ἱ' => 'Ἱ', - 'Ἲ' => 'Ἲ', - 'Ἳ' => 'Ἳ', - 'Ἴ' => 'Ἴ', - 'Ἵ' => 'Ἵ', - 'Ἶ' => 'Ἶ', - 'Ἷ' => 'Ἷ', - 'ὀ' => 'ὀ', - 'ὁ' => 'ὁ', - 'ὂ' => 'ὂ', - 'ὃ' => 'ὃ', - 'ὄ' => 'ὄ', - 'ὅ' => 'ὅ', - 'Ὀ' => 'Ὀ', - 'Ὁ' => 'Ὁ', - 'Ὂ' => 'Ὂ', - 'Ὃ' => 'Ὃ', - 'Ὄ' => 'Ὄ', - 'Ὅ' => 'Ὅ', - 'ὐ' => 'ὐ', - 'ὑ' => 'ὑ', - 'ὒ' => 'ὒ', - 'ὓ' => 'ὓ', - 'ὔ' => 'ὔ', - 'ὕ' => 'ὕ', - 'ὖ' => 'ὖ', - 'ὗ' => 'ὗ', - 'Ὑ' => 'Ὑ', - 'Ὓ' => 'Ὓ', - 'Ὕ' => 'Ὕ', - 'Ὗ' => 'Ὗ', - 'ὠ' => 'ὠ', - 'ὡ' => 'ὡ', - 'ὢ' => 'ὢ', - 'ὣ' => 'ὣ', - 'ὤ' => 'ὤ', - 'ὥ' => 'ὥ', - 'ὦ' => 'ὦ', - 'ὧ' => 'ὧ', - 'Ὠ' => 'Ὠ', - 'Ὡ' => 'Ὡ', - 'Ὢ' => 'Ὢ', - 'Ὣ' => 'Ὣ', - 'Ὤ' => 'Ὤ', - 'Ὥ' => 'Ὥ', - 'Ὦ' => 'Ὦ', - 'Ὧ' => 'Ὧ', - 'ὰ' => 'ὰ', - 'ά' => 'ά', - 'ὲ' => 'ὲ', - 'έ' => 'έ', - 'ὴ' => 'ὴ', - 'ή' => 'ή', - 'ὶ' => 'ὶ', - 'ί' => 'ί', - 'ὸ' => 'ὸ', - 'ό' => 'ό', - 'ὺ' => 'ὺ', - 'ύ' => 'ύ', - 'ὼ' => 'ὼ', - 'ώ' => 'ώ', - 'ᾀ' => 'ᾀ', - 'ᾁ' => 'ᾁ', - 'ᾂ' => 'ᾂ', - 'ᾃ' => 'ᾃ', - 'ᾄ' => 'ᾄ', - 'ᾅ' => 'ᾅ', - 'ᾆ' => 'ᾆ', - 'ᾇ' => 'ᾇ', - 'ᾈ' => 'ᾈ', - 'ᾉ' => 'ᾉ', - 'ᾊ' => 'ᾊ', - 'ᾋ' => 'ᾋ', - 'ᾌ' => 'ᾌ', - 'ᾍ' => 'ᾍ', - 'ᾎ' => 'ᾎ', - 'ᾏ' => 'ᾏ', - 'ᾐ' => 'ᾐ', - 'ᾑ' => 'ᾑ', - 'ᾒ' => 'ᾒ', - 'ᾓ' => 'ᾓ', - 'ᾔ' => 'ᾔ', - 'ᾕ' => 'ᾕ', - 'ᾖ' => 'ᾖ', - 'ᾗ' => 'ᾗ', - 'ᾘ' => 'ᾘ', - 'ᾙ' => 'ᾙ', - 'ᾚ' => 'ᾚ', - 'ᾛ' => 'ᾛ', - 'ᾜ' => 'ᾜ', - 'ᾝ' => 'ᾝ', - 'ᾞ' => 'ᾞ', - 'ᾟ' => 'ᾟ', - 'ᾠ' => 'ᾠ', - 'ᾡ' => 'ᾡ', - 'ᾢ' => 'ᾢ', - 'ᾣ' => 'ᾣ', - 'ᾤ' => 'ᾤ', - 'ᾥ' => 'ᾥ', - 'ᾦ' => 'ᾦ', - 'ᾧ' => 'ᾧ', - 'ᾨ' => 'ᾨ', - 'ᾩ' => 'ᾩ', - 'ᾪ' => 'ᾪ', - 'ᾫ' => 'ᾫ', - 'ᾬ' => 'ᾬ', - 'ᾭ' => 'ᾭ', - 'ᾮ' => 'ᾮ', - 'ᾯ' => 'ᾯ', - 'ᾰ' => 'ᾰ', - 'ᾱ' => 'ᾱ', - 'ᾲ' => 'ᾲ', - 'ᾳ' => 'ᾳ', - 'ᾴ' => 'ᾴ', - 'ᾶ' => 'ᾶ', - 'ᾷ' => 'ᾷ', - 'Ᾰ' => 'Ᾰ', - 'Ᾱ' => 'Ᾱ', - 'Ὰ' => 'Ὰ', - 'Ά' => 'Ά', - 'ᾼ' => 'ᾼ', - 'ι' => 'ι', - '῁' => '῁', - 'ῂ' => 'ῂ', - 'ῃ' => 'ῃ', - 'ῄ' => 'ῄ', - 'ῆ' => 'ῆ', - 'ῇ' => 'ῇ', - 'Ὲ' => 'Ὲ', - 'Έ' => 'Έ', - 'Ὴ' => 'Ὴ', - 'Ή' => 'Ή', - 'ῌ' => 'ῌ', - '῍' => '῍', - '῎' => '῎', - '῏' => '῏', - 'ῐ' => 'ῐ', - 'ῑ' => 'ῑ', - 'ῒ' => 'ῒ', - 'ΐ' => 'ΐ', - 'ῖ' => 'ῖ', - 'ῗ' => 'ῗ', - 'Ῐ' => 'Ῐ', - 'Ῑ' => 'Ῑ', - 'Ὶ' => 'Ὶ', - 'Ί' => 'Ί', - '῝' => '῝', - '῞' => '῞', - '῟' => '῟', - 'ῠ' => 'ῠ', - 'ῡ' => 'ῡ', - 'ῢ' => 'ῢ', - 'ΰ' => 'ΰ', - 'ῤ' => 'ῤ', - 'ῥ' => 'ῥ', - 'ῦ' => 'ῦ', - 'ῧ' => 'ῧ', - 'Ῠ' => 'Ῠ', - 'Ῡ' => 'Ῡ', - 'Ὺ' => 'Ὺ', - 'Ύ' => 'Ύ', - 'Ῥ' => 'Ῥ', - '῭' => '῭', - '΅' => '΅', - '`' => '`', - 'ῲ' => 'ῲ', - 'ῳ' => 'ῳ', - 'ῴ' => 'ῴ', - 'ῶ' => 'ῶ', - 'ῷ' => 'ῷ', - 'Ὸ' => 'Ὸ', - 'Ό' => 'Ό', - 'Ὼ' => 'Ὼ', - 'Ώ' => 'Ώ', - 'ῼ' => 'ῼ', - '´' => '´', - ' ' => ' ', - ' ' => ' ', - 'Ω' => 'Ω', - 'K' => 'K', - 'Å' => 'Å', - '↚' => '↚', - '↛' => '↛', - '↮' => '↮', - '⇍' => '⇍', - '⇎' => '⇎', - '⇏' => '⇏', - '∄' => '∄', - '∉' => '∉', - '∌' => '∌', - '∤' => '∤', - '∦' => '∦', - '≁' => '≁', - '≄' => '≄', - '≇' => '≇', - '≉' => '≉', - '≠' => '≠', - '≢' => '≢', - '≭' => '≭', - '≮' => '≮', - '≯' => '≯', - '≰' => '≰', - '≱' => '≱', - '≴' => '≴', - '≵' => '≵', - '≸' => '≸', - '≹' => '≹', - '⊀' => '⊀', - '⊁' => '⊁', - '⊄' => '⊄', - '⊅' => '⊅', - '⊈' => '⊈', - '⊉' => '⊉', - '⊬' => '⊬', - '⊭' => '⊭', - '⊮' => '⊮', - '⊯' => '⊯', - '⋠' => '⋠', - '⋡' => '⋡', - '⋢' => '⋢', - '⋣' => '⋣', - '⋪' => '⋪', - '⋫' => '⋫', - '⋬' => '⋬', - '⋭' => '⋭', - '〈' => '〈', - '〉' => '〉', - '⫝̸' => '⫝̸', - 'が' => 'が', - 'ぎ' => 'ぎ', - 'ぐ' => 'ぐ', - 'げ' => 'げ', - 'ご' => 'ご', - 'ざ' => 'ざ', - 'じ' => 'じ', - 'ず' => 'ず', - 'ぜ' => 'ぜ', - 'ぞ' => 'ぞ', - 'だ' => 'だ', - 'ぢ' => 'ぢ', - 'づ' => 'づ', - 'で' => 'で', - 'ど' => 'ど', - 'ば' => 'ば', - 'ぱ' => 'ぱ', - 'び' => 'び', - 'ぴ' => 'ぴ', - 'ぶ' => 'ぶ', - 'ぷ' => 'ぷ', - 'べ' => 'べ', - 'ぺ' => 'ぺ', - 'ぼ' => 'ぼ', - 'ぽ' => 'ぽ', - 'ゔ' => 'ゔ', - 'ゞ' => 'ゞ', - 'ガ' => 'ガ', - 'ギ' => 'ギ', - 'グ' => 'グ', - 'ゲ' => 'ゲ', - 'ゴ' => 'ゴ', - 'ザ' => 'ザ', - 'ジ' => 'ジ', - 'ズ' => 'ズ', - 'ゼ' => 'ゼ', - 'ゾ' => 'ゾ', - 'ダ' => 'ダ', - 'ヂ' => 'ヂ', - 'ヅ' => 'ヅ', - 'デ' => 'デ', - 'ド' => 'ド', - 'バ' => 'バ', - 'パ' => 'パ', - 'ビ' => 'ビ', - 'ピ' => 'ピ', - 'ブ' => 'ブ', - 'プ' => 'プ', - 'ベ' => 'ベ', - 'ペ' => 'ペ', - 'ボ' => 'ボ', - 'ポ' => 'ポ', - 'ヴ' => 'ヴ', - 'ヷ' => 'ヷ', - 'ヸ' => 'ヸ', - 'ヹ' => 'ヹ', - 'ヺ' => 'ヺ', - 'ヾ' => 'ヾ', - '豈' => '豈', - '更' => '更', - '車' => '車', - '賈' => '賈', - '滑' => '滑', - '串' => '串', - '句' => '句', - '龜' => '龜', - '龜' => '龜', - '契' => '契', - '金' => '金', - '喇' => '喇', - '奈' => '奈', - '懶' => '懶', - '癩' => '癩', - '羅' => '羅', - '蘿' => '蘿', - '螺' => '螺', - '裸' => '裸', - '邏' => '邏', - '樂' => '樂', - '洛' => '洛', - '烙' => '烙', - '珞' => '珞', - '落' => '落', - '酪' => '酪', - '駱' => '駱', - '亂' => '亂', - '卵' => '卵', - '欄' => '欄', - '爛' => '爛', - '蘭' => '蘭', - '鸞' => '鸞', - '嵐' => '嵐', - '濫' => '濫', - '藍' => '藍', - '襤' => '襤', - '拉' => '拉', - '臘' => '臘', - '蠟' => '蠟', - '廊' => '廊', - '朗' => '朗', - '浪' => '浪', - '狼' => '狼', - '郎' => '郎', - '來' => '來', - '冷' => '冷', - '勞' => '勞', - '擄' => '擄', - '櫓' => '櫓', - '爐' => '爐', - '盧' => '盧', - '老' => '老', - '蘆' => '蘆', - '虜' => '虜', - '路' => '路', - '露' => '露', - '魯' => '魯', - '鷺' => '鷺', - '碌' => '碌', - '祿' => '祿', - '綠' => '綠', - '菉' => '菉', - '錄' => '錄', - '鹿' => '鹿', - '論' => '論', - '壟' => '壟', - '弄' => '弄', - '籠' => '籠', - '聾' => '聾', - '牢' => '牢', - '磊' => '磊', - '賂' => '賂', - '雷' => '雷', - '壘' => '壘', - '屢' => '屢', - '樓' => '樓', - '淚' => '淚', - '漏' => '漏', - '累' => '累', - '縷' => '縷', - '陋' => '陋', - '勒' => '勒', - '肋' => '肋', - '凜' => '凜', - '凌' => '凌', - '稜' => '稜', - '綾' => '綾', - '菱' => '菱', - '陵' => '陵', - '讀' => '讀', - '拏' => '拏', - '樂' => '樂', - '諾' => '諾', - '丹' => '丹', - '寧' => '寧', - '怒' => '怒', - '率' => '率', - '異' => '異', - '北' => '北', - '磻' => '磻', - '便' => '便', - '復' => '復', - '不' => '不', - '泌' => '泌', - '數' => '數', - '索' => '索', - '參' => '參', - '塞' => '塞', - '省' => '省', - '葉' => '葉', - '說' => '說', - '殺' => '殺', - '辰' => '辰', - '沈' => '沈', - '拾' => '拾', - '若' => '若', - '掠' => '掠', - '略' => '略', - '亮' => '亮', - '兩' => '兩', - '凉' => '凉', - '梁' => '梁', - '糧' => '糧', - '良' => '良', - '諒' => '諒', - '量' => '量', - '勵' => '勵', - '呂' => '呂', - '女' => '女', - '廬' => '廬', - '旅' => '旅', - '濾' => '濾', - '礪' => '礪', - '閭' => '閭', - '驪' => '驪', - '麗' => '麗', - '黎' => '黎', - '力' => '力', - '曆' => '曆', - '歷' => '歷', - '轢' => '轢', - '年' => '年', - '憐' => '憐', - '戀' => '戀', - '撚' => '撚', - '漣' => '漣', - '煉' => '煉', - '璉' => '璉', - '秊' => '秊', - '練' => '練', - '聯' => '聯', - '輦' => '輦', - '蓮' => '蓮', - '連' => '連', - '鍊' => '鍊', - '列' => '列', - '劣' => '劣', - '咽' => '咽', - '烈' => '烈', - '裂' => '裂', - '說' => '說', - '廉' => '廉', - '念' => '念', - '捻' => '捻', - '殮' => '殮', - '簾' => '簾', - '獵' => '獵', - '令' => '令', - '囹' => '囹', - '寧' => '寧', - '嶺' => '嶺', - '怜' => '怜', - '玲' => '玲', - '瑩' => '瑩', - '羚' => '羚', - '聆' => '聆', - '鈴' => '鈴', - '零' => '零', - '靈' => '靈', - '領' => '領', - '例' => '例', - '禮' => '禮', - '醴' => '醴', - '隸' => '隸', - '惡' => '惡', - '了' => '了', - '僚' => '僚', - '寮' => '寮', - '尿' => '尿', - '料' => '料', - '樂' => '樂', - '燎' => '燎', - '療' => '療', - '蓼' => '蓼', - '遼' => '遼', - '龍' => '龍', - '暈' => '暈', - '阮' => '阮', - '劉' => '劉', - '杻' => '杻', - '柳' => '柳', - '流' => '流', - '溜' => '溜', - '琉' => '琉', - '留' => '留', - '硫' => '硫', - '紐' => '紐', - '類' => '類', - '六' => '六', - '戮' => '戮', - '陸' => '陸', - '倫' => '倫', - '崙' => '崙', - '淪' => '淪', - '輪' => '輪', - '律' => '律', - '慄' => '慄', - '栗' => '栗', - '率' => '率', - '隆' => '隆', - '利' => '利', - '吏' => '吏', - '履' => '履', - '易' => '易', - '李' => '李', - '梨' => '梨', - '泥' => '泥', - '理' => '理', - '痢' => '痢', - '罹' => '罹', - '裏' => '裏', - '裡' => '裡', - '里' => '里', - '離' => '離', - '匿' => '匿', - '溺' => '溺', - '吝' => '吝', - '燐' => '燐', - '璘' => '璘', - '藺' => '藺', - '隣' => '隣', - '鱗' => '鱗', - '麟' => '麟', - '林' => '林', - '淋' => '淋', - '臨' => '臨', - '立' => '立', - '笠' => '笠', - '粒' => '粒', - '狀' => '狀', - '炙' => '炙', - '識' => '識', - '什' => '什', - '茶' => '茶', - '刺' => '刺', - '切' => '切', - '度' => '度', - '拓' => '拓', - '糖' => '糖', - '宅' => '宅', - '洞' => '洞', - '暴' => '暴', - '輻' => '輻', - '行' => '行', - '降' => '降', - '見' => '見', - '廓' => '廓', - '兀' => '兀', - '嗀' => '嗀', - '塚' => '塚', - '晴' => '晴', - '凞' => '凞', - '猪' => '猪', - '益' => '益', - '礼' => '礼', - '神' => '神', - '祥' => '祥', - '福' => '福', - '靖' => '靖', - '精' => '精', - '羽' => '羽', - '蘒' => '蘒', - '諸' => '諸', - '逸' => '逸', - '都' => '都', - '飯' => '飯', - '飼' => '飼', - '館' => '館', - '鶴' => '鶴', - '郞' => '郞', - '隷' => '隷', - '侮' => '侮', - '僧' => '僧', - '免' => '免', - '勉' => '勉', - '勤' => '勤', - '卑' => '卑', - '喝' => '喝', - '嘆' => '嘆', - '器' => '器', - '塀' => '塀', - '墨' => '墨', - '層' => '層', - '屮' => '屮', - '悔' => '悔', - '慨' => '慨', - '憎' => '憎', - '懲' => '懲', - '敏' => '敏', - '既' => '既', - '暑' => '暑', - '梅' => '梅', - '海' => '海', - '渚' => '渚', - '漢' => '漢', - '煮' => '煮', - '爫' => '爫', - '琢' => '琢', - '碑' => '碑', - '社' => '社', - '祉' => '祉', - '祈' => '祈', - '祐' => '祐', - '祖' => '祖', - '祝' => '祝', - '禍' => '禍', - '禎' => '禎', - '穀' => '穀', - '突' => '突', - '節' => '節', - '練' => '練', - '縉' => '縉', - '繁' => '繁', - '署' => '署', - '者' => '者', - '臭' => '臭', - '艹' => '艹', - '艹' => '艹', - '著' => '著', - '褐' => '褐', - '視' => '視', - '謁' => '謁', - '謹' => '謹', - '賓' => '賓', - '贈' => '贈', - '辶' => '辶', - '逸' => '逸', - '難' => '難', - '響' => '響', - '頻' => '頻', - '恵' => '恵', - '𤋮' => '𤋮', - '舘' => '舘', - '並' => '並', - '况' => '况', - '全' => '全', - '侀' => '侀', - '充' => '充', - '冀' => '冀', - '勇' => '勇', - '勺' => '勺', - '喝' => '喝', - '啕' => '啕', - '喙' => '喙', - '嗢' => '嗢', - '塚' => '塚', - '墳' => '墳', - '奄' => '奄', - '奔' => '奔', - '婢' => '婢', - '嬨' => '嬨', - '廒' => '廒', - '廙' => '廙', - '彩' => '彩', - '徭' => '徭', - '惘' => '惘', - '慎' => '慎', - '愈' => '愈', - '憎' => '憎', - '慠' => '慠', - '懲' => '懲', - '戴' => '戴', - '揄' => '揄', - '搜' => '搜', - '摒' => '摒', - '敖' => '敖', - '晴' => '晴', - '朗' => '朗', - '望' => '望', - '杖' => '杖', - '歹' => '歹', - '殺' => '殺', - '流' => '流', - '滛' => '滛', - '滋' => '滋', - '漢' => '漢', - '瀞' => '瀞', - '煮' => '煮', - '瞧' => '瞧', - '爵' => '爵', - '犯' => '犯', - '猪' => '猪', - '瑱' => '瑱', - '甆' => '甆', - '画' => '画', - '瘝' => '瘝', - '瘟' => '瘟', - '益' => '益', - '盛' => '盛', - '直' => '直', - '睊' => '睊', - '着' => '着', - '磌' => '磌', - '窱' => '窱', - '節' => '節', - '类' => '类', - '絛' => '絛', - '練' => '練', - '缾' => '缾', - '者' => '者', - '荒' => '荒', - '華' => '華', - '蝹' => '蝹', - '襁' => '襁', - '覆' => '覆', - '視' => '視', - '調' => '調', - '諸' => '諸', - '請' => '請', - '謁' => '謁', - '諾' => '諾', - '諭' => '諭', - '謹' => '謹', - '變' => '變', - '贈' => '贈', - '輸' => '輸', - '遲' => '遲', - '醙' => '醙', - '鉶' => '鉶', - '陼' => '陼', - '難' => '難', - '靖' => '靖', - '韛' => '韛', - '響' => '響', - '頋' => '頋', - '頻' => '頻', - '鬒' => '鬒', - '龜' => '龜', - '𢡊' => '𢡊', - '𢡄' => '𢡄', - '𣏕' => '𣏕', - '㮝' => '㮝', - '䀘' => '䀘', - '䀹' => '䀹', - '𥉉' => '𥉉', - '𥳐' => '𥳐', - '𧻓' => '𧻓', - '齃' => '齃', - '龎' => '龎', - 'יִ' => 'יִ', - 'ײַ' => 'ײַ', - 'שׁ' => 'שׁ', - 'שׂ' => 'שׂ', - 'שּׁ' => 'שּׁ', - 'שּׂ' => 'שּׂ', - 'אַ' => 'אַ', - 'אָ' => 'אָ', - 'אּ' => 'אּ', - 'בּ' => 'בּ', - 'גּ' => 'גּ', - 'דּ' => 'דּ', - 'הּ' => 'הּ', - 'וּ' => 'וּ', - 'זּ' => 'זּ', - 'טּ' => 'טּ', - 'יּ' => 'יּ', - 'ךּ' => 'ךּ', - 'כּ' => 'כּ', - 'לּ' => 'לּ', - 'מּ' => 'מּ', - 'נּ' => 'נּ', - 'סּ' => 'סּ', - 'ףּ' => 'ףּ', - 'פּ' => 'פּ', - 'צּ' => 'צּ', - 'קּ' => 'קּ', - 'רּ' => 'רּ', - 'שּ' => 'שּ', - 'תּ' => 'תּ', - 'וֹ' => 'וֹ', - 'בֿ' => 'בֿ', - 'כֿ' => 'כֿ', - 'פֿ' => 'פֿ', - '𑂚' => '𑂚', - '𑂜' => '𑂜', - '𑂫' => '𑂫', - '𑄮' => '𑄮', - '𑄯' => '𑄯', - '𑍋' => '𑍋', - '𑍌' => '𑍌', - '𑒻' => '𑒻', - '𑒼' => '𑒼', - '𑒾' => '𑒾', - '𑖺' => '𑖺', - '𑖻' => '𑖻', - '𑤸' => '𑤸', - '𝅗𝅥' => '𝅗𝅥', - '𝅘𝅥' => '𝅘𝅥', - '𝅘𝅥𝅮' => '𝅘𝅥𝅮', - '𝅘𝅥𝅯' => '𝅘𝅥𝅯', - '𝅘𝅥𝅰' => '𝅘𝅥𝅰', - '𝅘𝅥𝅱' => '𝅘𝅥𝅱', - '𝅘𝅥𝅲' => '𝅘𝅥𝅲', - '𝆹𝅥' => '𝆹𝅥', - '𝆺𝅥' => '𝆺𝅥', - '𝆹𝅥𝅮' => '𝆹𝅥𝅮', - '𝆺𝅥𝅮' => '𝆺𝅥𝅮', - '𝆹𝅥𝅯' => '𝆹𝅥𝅯', - '𝆺𝅥𝅯' => '𝆺𝅥𝅯', - '丽' => '丽', - '丸' => '丸', - '乁' => '乁', - '𠄢' => '𠄢', - '你' => '你', - '侮' => '侮', - '侻' => '侻', - '倂' => '倂', - '偺' => '偺', - '備' => '備', - '僧' => '僧', - '像' => '像', - '㒞' => '㒞', - '𠘺' => '𠘺', - '免' => '免', - '兔' => '兔', - '兤' => '兤', - '具' => '具', - '𠔜' => '𠔜', - '㒹' => '㒹', - '內' => '內', - '再' => '再', - '𠕋' => '𠕋', - '冗' => '冗', - '冤' => '冤', - '仌' => '仌', - '冬' => '冬', - '况' => '况', - '𩇟' => '𩇟', - '凵' => '凵', - '刃' => '刃', - '㓟' => '㓟', - '刻' => '刻', - '剆' => '剆', - '割' => '割', - '剷' => '剷', - '㔕' => '㔕', - '勇' => '勇', - '勉' => '勉', - '勤' => '勤', - '勺' => '勺', - '包' => '包', - '匆' => '匆', - '北' => '北', - '卉' => '卉', - '卑' => '卑', - '博' => '博', - '即' => '即', - '卽' => '卽', - '卿' => '卿', - '卿' => '卿', - '卿' => '卿', - '𠨬' => '𠨬', - '灰' => '灰', - '及' => '及', - '叟' => '叟', - '𠭣' => '𠭣', - '叫' => '叫', - '叱' => '叱', - '吆' => '吆', - '咞' => '咞', - '吸' => '吸', - '呈' => '呈', - '周' => '周', - '咢' => '咢', - '哶' => '哶', - '唐' => '唐', - '啓' => '啓', - '啣' => '啣', - '善' => '善', - '善' => '善', - '喙' => '喙', - '喫' => '喫', - '喳' => '喳', - '嗂' => '嗂', - '圖' => '圖', - '嘆' => '嘆', - '圗' => '圗', - '噑' => '噑', - '噴' => '噴', - '切' => '切', - '壮' => '壮', - '城' => '城', - '埴' => '埴', - '堍' => '堍', - '型' => '型', - '堲' => '堲', - '報' => '報', - '墬' => '墬', - '𡓤' => '𡓤', - '売' => '売', - '壷' => '壷', - '夆' => '夆', - '多' => '多', - '夢' => '夢', - '奢' => '奢', - '𡚨' => '𡚨', - '𡛪' => '𡛪', - '姬' => '姬', - '娛' => '娛', - '娧' => '娧', - '姘' => '姘', - '婦' => '婦', - '㛮' => '㛮', - '㛼' => '㛼', - '嬈' => '嬈', - '嬾' => '嬾', - '嬾' => '嬾', - '𡧈' => '𡧈', - '寃' => '寃', - '寘' => '寘', - '寧' => '寧', - '寳' => '寳', - '𡬘' => '𡬘', - '寿' => '寿', - '将' => '将', - '当' => '当', - '尢' => '尢', - '㞁' => '㞁', - '屠' => '屠', - '屮' => '屮', - '峀' => '峀', - '岍' => '岍', - '𡷤' => '𡷤', - '嵃' => '嵃', - '𡷦' => '𡷦', - '嵮' => '嵮', - '嵫' => '嵫', - '嵼' => '嵼', - '巡' => '巡', - '巢' => '巢', - '㠯' => '㠯', - '巽' => '巽', - '帨' => '帨', - '帽' => '帽', - '幩' => '幩', - '㡢' => '㡢', - '𢆃' => '𢆃', - '㡼' => '㡼', - '庰' => '庰', - '庳' => '庳', - '庶' => '庶', - '廊' => '廊', - '𪎒' => '𪎒', - '廾' => '廾', - '𢌱' => '𢌱', - '𢌱' => '𢌱', - '舁' => '舁', - '弢' => '弢', - '弢' => '弢', - '㣇' => '㣇', - '𣊸' => '𣊸', - '𦇚' => '𦇚', - '形' => '形', - '彫' => '彫', - '㣣' => '㣣', - '徚' => '徚', - '忍' => '忍', - '志' => '志', - '忹' => '忹', - '悁' => '悁', - '㤺' => '㤺', - '㤜' => '㤜', - '悔' => '悔', - '𢛔' => '𢛔', - '惇' => '惇', - '慈' => '慈', - '慌' => '慌', - '慎' => '慎', - '慌' => '慌', - '慺' => '慺', - '憎' => '憎', - '憲' => '憲', - '憤' => '憤', - '憯' => '憯', - '懞' => '懞', - '懲' => '懲', - '懶' => '懶', - '成' => '成', - '戛' => '戛', - '扝' => '扝', - '抱' => '抱', - '拔' => '拔', - '捐' => '捐', - '𢬌' => '𢬌', - '挽' => '挽', - '拼' => '拼', - '捨' => '捨', - '掃' => '掃', - '揤' => '揤', - '𢯱' => '𢯱', - '搢' => '搢', - '揅' => '揅', - '掩' => '掩', - '㨮' => '㨮', - '摩' => '摩', - '摾' => '摾', - '撝' => '撝', - '摷' => '摷', - '㩬' => '㩬', - '敏' => '敏', - '敬' => '敬', - '𣀊' => '𣀊', - '旣' => '旣', - '書' => '書', - '晉' => '晉', - '㬙' => '㬙', - '暑' => '暑', - '㬈' => '㬈', - '㫤' => '㫤', - '冒' => '冒', - '冕' => '冕', - '最' => '最', - '暜' => '暜', - '肭' => '肭', - '䏙' => '䏙', - '朗' => '朗', - '望' => '望', - '朡' => '朡', - '杞' => '杞', - '杓' => '杓', - '𣏃' => '𣏃', - '㭉' => '㭉', - '柺' => '柺', - '枅' => '枅', - '桒' => '桒', - '梅' => '梅', - '𣑭' => '𣑭', - '梎' => '梎', - '栟' => '栟', - '椔' => '椔', - '㮝' => '㮝', - '楂' => '楂', - '榣' => '榣', - '槪' => '槪', - '檨' => '檨', - '𣚣' => '𣚣', - '櫛' => '櫛', - '㰘' => '㰘', - '次' => '次', - '𣢧' => '𣢧', - '歔' => '歔', - '㱎' => '㱎', - '歲' => '歲', - '殟' => '殟', - '殺' => '殺', - '殻' => '殻', - '𣪍' => '𣪍', - '𡴋' => '𡴋', - '𣫺' => '𣫺', - '汎' => '汎', - '𣲼' => '𣲼', - '沿' => '沿', - '泍' => '泍', - '汧' => '汧', - '洖' => '洖', - '派' => '派', - '海' => '海', - '流' => '流', - '浩' => '浩', - '浸' => '浸', - '涅' => '涅', - '𣴞' => '𣴞', - '洴' => '洴', - '港' => '港', - '湮' => '湮', - '㴳' => '㴳', - '滋' => '滋', - '滇' => '滇', - '𣻑' => '𣻑', - '淹' => '淹', - '潮' => '潮', - '𣽞' => '𣽞', - '𣾎' => '𣾎', - '濆' => '濆', - '瀹' => '瀹', - '瀞' => '瀞', - '瀛' => '瀛', - '㶖' => '㶖', - '灊' => '灊', - '災' => '災', - '灷' => '灷', - '炭' => '炭', - '𠔥' => '𠔥', - '煅' => '煅', - '𤉣' => '𤉣', - '熜' => '熜', - '𤎫' => '𤎫', - '爨' => '爨', - '爵' => '爵', - '牐' => '牐', - '𤘈' => '𤘈', - '犀' => '犀', - '犕' => '犕', - '𤜵' => '𤜵', - '𤠔' => '𤠔', - '獺' => '獺', - '王' => '王', - '㺬' => '㺬', - '玥' => '玥', - '㺸' => '㺸', - '㺸' => '㺸', - '瑇' => '瑇', - '瑜' => '瑜', - '瑱' => '瑱', - '璅' => '璅', - '瓊' => '瓊', - '㼛' => '㼛', - '甤' => '甤', - '𤰶' => '𤰶', - '甾' => '甾', - '𤲒' => '𤲒', - '異' => '異', - '𢆟' => '𢆟', - '瘐' => '瘐', - '𤾡' => '𤾡', - '𤾸' => '𤾸', - '𥁄' => '𥁄', - '㿼' => '㿼', - '䀈' => '䀈', - '直' => '直', - '𥃳' => '𥃳', - '𥃲' => '𥃲', - '𥄙' => '𥄙', - '𥄳' => '𥄳', - '眞' => '眞', - '真' => '真', - '真' => '真', - '睊' => '睊', - '䀹' => '䀹', - '瞋' => '瞋', - '䁆' => '䁆', - '䂖' => '䂖', - '𥐝' => '𥐝', - '硎' => '硎', - '碌' => '碌', - '磌' => '磌', - '䃣' => '䃣', - '𥘦' => '𥘦', - '祖' => '祖', - '𥚚' => '𥚚', - '𥛅' => '𥛅', - '福' => '福', - '秫' => '秫', - '䄯' => '䄯', - '穀' => '穀', - '穊' => '穊', - '穏' => '穏', - '𥥼' => '𥥼', - '𥪧' => '𥪧', - '𥪧' => '𥪧', - '竮' => '竮', - '䈂' => '䈂', - '𥮫' => '𥮫', - '篆' => '篆', - '築' => '築', - '䈧' => '䈧', - '𥲀' => '𥲀', - '糒' => '糒', - '䊠' => '䊠', - '糨' => '糨', - '糣' => '糣', - '紀' => '紀', - '𥾆' => '𥾆', - '絣' => '絣', - '䌁' => '䌁', - '緇' => '緇', - '縂' => '縂', - '繅' => '繅', - '䌴' => '䌴', - '𦈨' => '𦈨', - '𦉇' => '𦉇', - '䍙' => '䍙', - '𦋙' => '𦋙', - '罺' => '罺', - '𦌾' => '𦌾', - '羕' => '羕', - '翺' => '翺', - '者' => '者', - '𦓚' => '𦓚', - '𦔣' => '𦔣', - '聠' => '聠', - '𦖨' => '𦖨', - '聰' => '聰', - '𣍟' => '𣍟', - '䏕' => '䏕', - '育' => '育', - '脃' => '脃', - '䐋' => '䐋', - '脾' => '脾', - '媵' => '媵', - '𦞧' => '𦞧', - '𦞵' => '𦞵', - '𣎓' => '𣎓', - '𣎜' => '𣎜', - '舁' => '舁', - '舄' => '舄', - '辞' => '辞', - '䑫' => '䑫', - '芑' => '芑', - '芋' => '芋', - '芝' => '芝', - '劳' => '劳', - '花' => '花', - '芳' => '芳', - '芽' => '芽', - '苦' => '苦', - '𦬼' => '𦬼', - '若' => '若', - '茝' => '茝', - '荣' => '荣', - '莭' => '莭', - '茣' => '茣', - '莽' => '莽', - '菧' => '菧', - '著' => '著', - '荓' => '荓', - '菊' => '菊', - '菌' => '菌', - '菜' => '菜', - '𦰶' => '𦰶', - '𦵫' => '𦵫', - '𦳕' => '𦳕', - '䔫' => '䔫', - '蓱' => '蓱', - '蓳' => '蓳', - '蔖' => '蔖', - '𧏊' => '𧏊', - '蕤' => '蕤', - '𦼬' => '𦼬', - '䕝' => '䕝', - '䕡' => '䕡', - '𦾱' => '𦾱', - '𧃒' => '𧃒', - '䕫' => '䕫', - '虐' => '虐', - '虜' => '虜', - '虧' => '虧', - '虩' => '虩', - '蚩' => '蚩', - '蚈' => '蚈', - '蜎' => '蜎', - '蛢' => '蛢', - '蝹' => '蝹', - '蜨' => '蜨', - '蝫' => '蝫', - '螆' => '螆', - '䗗' => '䗗', - '蟡' => '蟡', - '蠁' => '蠁', - '䗹' => '䗹', - '衠' => '衠', - '衣' => '衣', - '𧙧' => '𧙧', - '裗' => '裗', - '裞' => '裞', - '䘵' => '䘵', - '裺' => '裺', - '㒻' => '㒻', - '𧢮' => '𧢮', - '𧥦' => '𧥦', - '䚾' => '䚾', - '䛇' => '䛇', - '誠' => '誠', - '諭' => '諭', - '變' => '變', - '豕' => '豕', - '𧲨' => '𧲨', - '貫' => '貫', - '賁' => '賁', - '贛' => '贛', - '起' => '起', - '𧼯' => '𧼯', - '𠠄' => '𠠄', - '跋' => '跋', - '趼' => '趼', - '跰' => '跰', - '𠣞' => '𠣞', - '軔' => '軔', - '輸' => '輸', - '𨗒' => '𨗒', - '𨗭' => '𨗭', - '邔' => '邔', - '郱' => '郱', - '鄑' => '鄑', - '𨜮' => '𨜮', - '鄛' => '鄛', - '鈸' => '鈸', - '鋗' => '鋗', - '鋘' => '鋘', - '鉼' => '鉼', - '鏹' => '鏹', - '鐕' => '鐕', - '𨯺' => '𨯺', - '開' => '開', - '䦕' => '䦕', - '閷' => '閷', - '𨵷' => '𨵷', - '䧦' => '䧦', - '雃' => '雃', - '嶲' => '嶲', - '霣' => '霣', - '𩅅' => '𩅅', - '𩈚' => '𩈚', - '䩮' => '䩮', - '䩶' => '䩶', - '韠' => '韠', - '𩐊' => '𩐊', - '䪲' => '䪲', - '𩒖' => '𩒖', - '頋' => '頋', - '頋' => '頋', - '頩' => '頩', - '𩖶' => '𩖶', - '飢' => '飢', - '䬳' => '䬳', - '餩' => '餩', - '馧' => '馧', - '駂' => '駂', - '駾' => '駾', - '䯎' => '䯎', - '𩬰' => '𩬰', - '鬒' => '鬒', - '鱀' => '鱀', - '鳽' => '鳽', - '䳎' => '䳎', - '䳭' => '䳭', - '鵧' => '鵧', - '𪃎' => '𪃎', - '䳸' => '䳸', - '𪄅' => '𪄅', - '𪈎' => '𪈎', - '𪊑' => '𪊑', - '麻' => '麻', - '䵖' => '䵖', - '黹' => '黹', - '黾' => '黾', - '鼅' => '鼅', - '鼏' => '鼏', - '鼖' => '鼖', - '鼻' => '鼻', - '𪘀' => '𪘀', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php deleted file mode 100644 index ec90f36eb..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/combiningClass.php +++ /dev/null @@ -1,876 +0,0 @@ - 230, - '́' => 230, - '̂' => 230, - '̃' => 230, - '̄' => 230, - '̅' => 230, - '̆' => 230, - '̇' => 230, - '̈' => 230, - '̉' => 230, - '̊' => 230, - '̋' => 230, - '̌' => 230, - '̍' => 230, - '̎' => 230, - '̏' => 230, - '̐' => 230, - '̑' => 230, - '̒' => 230, - '̓' => 230, - '̔' => 230, - '̕' => 232, - '̖' => 220, - '̗' => 220, - '̘' => 220, - '̙' => 220, - '̚' => 232, - '̛' => 216, - '̜' => 220, - '̝' => 220, - '̞' => 220, - '̟' => 220, - '̠' => 220, - '̡' => 202, - '̢' => 202, - '̣' => 220, - '̤' => 220, - '̥' => 220, - '̦' => 220, - '̧' => 202, - '̨' => 202, - '̩' => 220, - '̪' => 220, - '̫' => 220, - '̬' => 220, - '̭' => 220, - '̮' => 220, - '̯' => 220, - '̰' => 220, - '̱' => 220, - '̲' => 220, - '̳' => 220, - '̴' => 1, - '̵' => 1, - '̶' => 1, - '̷' => 1, - '̸' => 1, - '̹' => 220, - '̺' => 220, - '̻' => 220, - '̼' => 220, - '̽' => 230, - '̾' => 230, - '̿' => 230, - '̀' => 230, - '́' => 230, - '͂' => 230, - '̓' => 230, - '̈́' => 230, - 'ͅ' => 240, - '͆' => 230, - '͇' => 220, - '͈' => 220, - '͉' => 220, - '͊' => 230, - '͋' => 230, - '͌' => 230, - '͍' => 220, - '͎' => 220, - '͐' => 230, - '͑' => 230, - '͒' => 230, - '͓' => 220, - '͔' => 220, - '͕' => 220, - '͖' => 220, - '͗' => 230, - '͘' => 232, - '͙' => 220, - '͚' => 220, - '͛' => 230, - '͜' => 233, - '͝' => 234, - '͞' => 234, - '͟' => 233, - '͠' => 234, - '͡' => 234, - '͢' => 233, - 'ͣ' => 230, - 'ͤ' => 230, - 'ͥ' => 230, - 'ͦ' => 230, - 'ͧ' => 230, - 'ͨ' => 230, - 'ͩ' => 230, - 'ͪ' => 230, - 'ͫ' => 230, - 'ͬ' => 230, - 'ͭ' => 230, - 'ͮ' => 230, - 'ͯ' => 230, - '҃' => 230, - '҄' => 230, - '҅' => 230, - '҆' => 230, - '҇' => 230, - '֑' => 220, - '֒' => 230, - '֓' => 230, - '֔' => 230, - '֕' => 230, - '֖' => 220, - '֗' => 230, - '֘' => 230, - '֙' => 230, - '֚' => 222, - '֛' => 220, - '֜' => 230, - '֝' => 230, - '֞' => 230, - '֟' => 230, - '֠' => 230, - '֡' => 230, - '֢' => 220, - '֣' => 220, - '֤' => 220, - '֥' => 220, - '֦' => 220, - '֧' => 220, - '֨' => 230, - '֩' => 230, - '֪' => 220, - '֫' => 230, - '֬' => 230, - '֭' => 222, - '֮' => 228, - '֯' => 230, - 'ְ' => 10, - 'ֱ' => 11, - 'ֲ' => 12, - 'ֳ' => 13, - 'ִ' => 14, - 'ֵ' => 15, - 'ֶ' => 16, - 'ַ' => 17, - 'ָ' => 18, - 'ֹ' => 19, - 'ֺ' => 19, - 'ֻ' => 20, - 'ּ' => 21, - 'ֽ' => 22, - 'ֿ' => 23, - 'ׁ' => 24, - 'ׂ' => 25, - 'ׄ' => 230, - 'ׅ' => 220, - 'ׇ' => 18, - 'ؐ' => 230, - 'ؑ' => 230, - 'ؒ' => 230, - 'ؓ' => 230, - 'ؔ' => 230, - 'ؕ' => 230, - 'ؖ' => 230, - 'ؗ' => 230, - 'ؘ' => 30, - 'ؙ' => 31, - 'ؚ' => 32, - 'ً' => 27, - 'ٌ' => 28, - 'ٍ' => 29, - 'َ' => 30, - 'ُ' => 31, - 'ِ' => 32, - 'ّ' => 33, - 'ْ' => 34, - 'ٓ' => 230, - 'ٔ' => 230, - 'ٕ' => 220, - 'ٖ' => 220, - 'ٗ' => 230, - '٘' => 230, - 'ٙ' => 230, - 'ٚ' => 230, - 'ٛ' => 230, - 'ٜ' => 220, - 'ٝ' => 230, - 'ٞ' => 230, - 'ٟ' => 220, - 'ٰ' => 35, - 'ۖ' => 230, - 'ۗ' => 230, - 'ۘ' => 230, - 'ۙ' => 230, - 'ۚ' => 230, - 'ۛ' => 230, - 'ۜ' => 230, - '۟' => 230, - '۠' => 230, - 'ۡ' => 230, - 'ۢ' => 230, - 'ۣ' => 220, - 'ۤ' => 230, - 'ۧ' => 230, - 'ۨ' => 230, - '۪' => 220, - '۫' => 230, - '۬' => 230, - 'ۭ' => 220, - 'ܑ' => 36, - 'ܰ' => 230, - 'ܱ' => 220, - 'ܲ' => 230, - 'ܳ' => 230, - 'ܴ' => 220, - 'ܵ' => 230, - 'ܶ' => 230, - 'ܷ' => 220, - 'ܸ' => 220, - 'ܹ' => 220, - 'ܺ' => 230, - 'ܻ' => 220, - 'ܼ' => 220, - 'ܽ' => 230, - 'ܾ' => 220, - 'ܿ' => 230, - '݀' => 230, - '݁' => 230, - '݂' => 220, - '݃' => 230, - '݄' => 220, - '݅' => 230, - '݆' => 220, - '݇' => 230, - '݈' => 220, - '݉' => 230, - '݊' => 230, - '߫' => 230, - '߬' => 230, - '߭' => 230, - '߮' => 230, - '߯' => 230, - '߰' => 230, - '߱' => 230, - '߲' => 220, - '߳' => 230, - '߽' => 220, - 'ࠖ' => 230, - 'ࠗ' => 230, - '࠘' => 230, - '࠙' => 230, - 'ࠛ' => 230, - 'ࠜ' => 230, - 'ࠝ' => 230, - 'ࠞ' => 230, - 'ࠟ' => 230, - 'ࠠ' => 230, - 'ࠡ' => 230, - 'ࠢ' => 230, - 'ࠣ' => 230, - 'ࠥ' => 230, - 'ࠦ' => 230, - 'ࠧ' => 230, - 'ࠩ' => 230, - 'ࠪ' => 230, - 'ࠫ' => 230, - 'ࠬ' => 230, - '࠭' => 230, - '࡙' => 220, - '࡚' => 220, - '࡛' => 220, - '࣓' => 220, - 'ࣔ' => 230, - 'ࣕ' => 230, - 'ࣖ' => 230, - 'ࣗ' => 230, - 'ࣘ' => 230, - 'ࣙ' => 230, - 'ࣚ' => 230, - 'ࣛ' => 230, - 'ࣜ' => 230, - 'ࣝ' => 230, - 'ࣞ' => 230, - 'ࣟ' => 230, - '࣠' => 230, - '࣡' => 230, - 'ࣣ' => 220, - 'ࣤ' => 230, - 'ࣥ' => 230, - 'ࣦ' => 220, - 'ࣧ' => 230, - 'ࣨ' => 230, - 'ࣩ' => 220, - '࣪' => 230, - '࣫' => 230, - '࣬' => 230, - '࣭' => 220, - '࣮' => 220, - '࣯' => 220, - 'ࣰ' => 27, - 'ࣱ' => 28, - 'ࣲ' => 29, - 'ࣳ' => 230, - 'ࣴ' => 230, - 'ࣵ' => 230, - 'ࣶ' => 220, - 'ࣷ' => 230, - 'ࣸ' => 230, - 'ࣹ' => 220, - 'ࣺ' => 220, - 'ࣻ' => 230, - 'ࣼ' => 230, - 'ࣽ' => 230, - 'ࣾ' => 230, - 'ࣿ' => 230, - '़' => 7, - '्' => 9, - '॑' => 230, - '॒' => 220, - '॓' => 230, - '॔' => 230, - '়' => 7, - '্' => 9, - '৾' => 230, - '਼' => 7, - '੍' => 9, - '઼' => 7, - '્' => 9, - '଼' => 7, - '୍' => 9, - '்' => 9, - '్' => 9, - 'ౕ' => 84, - 'ౖ' => 91, - '಼' => 7, - '್' => 9, - '഻' => 9, - '഼' => 9, - '്' => 9, - '්' => 9, - 'ุ' => 103, - 'ู' => 103, - 'ฺ' => 9, - '่' => 107, - '้' => 107, - '๊' => 107, - '๋' => 107, - 'ຸ' => 118, - 'ູ' => 118, - '຺' => 9, - '່' => 122, - '້' => 122, - '໊' => 122, - '໋' => 122, - '༘' => 220, - '༙' => 220, - '༵' => 220, - '༷' => 220, - '༹' => 216, - 'ཱ' => 129, - 'ི' => 130, - 'ུ' => 132, - 'ེ' => 130, - 'ཻ' => 130, - 'ོ' => 130, - 'ཽ' => 130, - 'ྀ' => 130, - 'ྂ' => 230, - 'ྃ' => 230, - '྄' => 9, - '྆' => 230, - '྇' => 230, - '࿆' => 220, - '့' => 7, - '္' => 9, - '်' => 9, - 'ႍ' => 220, - '፝' => 230, - '፞' => 230, - '፟' => 230, - '᜔' => 9, - '᜴' => 9, - '្' => 9, - '៝' => 230, - 'ᢩ' => 228, - '᤹' => 222, - '᤺' => 230, - '᤻' => 220, - 'ᨗ' => 230, - 'ᨘ' => 220, - '᩠' => 9, - '᩵' => 230, - '᩶' => 230, - '᩷' => 230, - '᩸' => 230, - '᩹' => 230, - '᩺' => 230, - '᩻' => 230, - '᩼' => 230, - '᩿' => 220, - '᪰' => 230, - '᪱' => 230, - '᪲' => 230, - '᪳' => 230, - '᪴' => 230, - '᪵' => 220, - '᪶' => 220, - '᪷' => 220, - '᪸' => 220, - '᪹' => 220, - '᪺' => 220, - '᪻' => 230, - '᪼' => 230, - '᪽' => 220, - 'ᪿ' => 220, - 'ᫀ' => 220, - '᬴' => 7, - '᭄' => 9, - '᭫' => 230, - '᭬' => 220, - '᭭' => 230, - '᭮' => 230, - '᭯' => 230, - '᭰' => 230, - '᭱' => 230, - '᭲' => 230, - '᭳' => 230, - '᮪' => 9, - '᮫' => 9, - '᯦' => 7, - '᯲' => 9, - '᯳' => 9, - '᰷' => 7, - '᳐' => 230, - '᳑' => 230, - '᳒' => 230, - '᳔' => 1, - '᳕' => 220, - '᳖' => 220, - '᳗' => 220, - '᳘' => 220, - '᳙' => 220, - '᳚' => 230, - '᳛' => 230, - '᳜' => 220, - '᳝' => 220, - '᳞' => 220, - '᳟' => 220, - '᳠' => 230, - '᳢' => 1, - '᳣' => 1, - '᳤' => 1, - '᳥' => 1, - '᳦' => 1, - '᳧' => 1, - '᳨' => 1, - '᳭' => 220, - '᳴' => 230, - '᳸' => 230, - '᳹' => 230, - '᷀' => 230, - '᷁' => 230, - '᷂' => 220, - '᷃' => 230, - '᷄' => 230, - '᷅' => 230, - '᷆' => 230, - '᷇' => 230, - '᷈' => 230, - '᷉' => 230, - '᷊' => 220, - '᷋' => 230, - '᷌' => 230, - '᷍' => 234, - '᷎' => 214, - '᷏' => 220, - '᷐' => 202, - '᷑' => 230, - '᷒' => 230, - 'ᷓ' => 230, - 'ᷔ' => 230, - 'ᷕ' => 230, - 'ᷖ' => 230, - 'ᷗ' => 230, - 'ᷘ' => 230, - 'ᷙ' => 230, - 'ᷚ' => 230, - 'ᷛ' => 230, - 'ᷜ' => 230, - 'ᷝ' => 230, - 'ᷞ' => 230, - 'ᷟ' => 230, - 'ᷠ' => 230, - 'ᷡ' => 230, - 'ᷢ' => 230, - 'ᷣ' => 230, - 'ᷤ' => 230, - 'ᷥ' => 230, - 'ᷦ' => 230, - 'ᷧ' => 230, - 'ᷨ' => 230, - 'ᷩ' => 230, - 'ᷪ' => 230, - 'ᷫ' => 230, - 'ᷬ' => 230, - 'ᷭ' => 230, - 'ᷮ' => 230, - 'ᷯ' => 230, - 'ᷰ' => 230, - 'ᷱ' => 230, - 'ᷲ' => 230, - 'ᷳ' => 230, - 'ᷴ' => 230, - '᷵' => 230, - '᷶' => 232, - '᷷' => 228, - '᷸' => 228, - '᷹' => 220, - '᷻' => 230, - '᷼' => 233, - '᷽' => 220, - '᷾' => 230, - '᷿' => 220, - '⃐' => 230, - '⃑' => 230, - '⃒' => 1, - '⃓' => 1, - '⃔' => 230, - '⃕' => 230, - '⃖' => 230, - '⃗' => 230, - '⃘' => 1, - '⃙' => 1, - '⃚' => 1, - '⃛' => 230, - '⃜' => 230, - '⃡' => 230, - '⃥' => 1, - '⃦' => 1, - '⃧' => 230, - '⃨' => 220, - '⃩' => 230, - '⃪' => 1, - '⃫' => 1, - '⃬' => 220, - '⃭' => 220, - '⃮' => 220, - '⃯' => 220, - '⃰' => 230, - '⳯' => 230, - '⳰' => 230, - '⳱' => 230, - '⵿' => 9, - 'ⷠ' => 230, - 'ⷡ' => 230, - 'ⷢ' => 230, - 'ⷣ' => 230, - 'ⷤ' => 230, - 'ⷥ' => 230, - 'ⷦ' => 230, - 'ⷧ' => 230, - 'ⷨ' => 230, - 'ⷩ' => 230, - 'ⷪ' => 230, - 'ⷫ' => 230, - 'ⷬ' => 230, - 'ⷭ' => 230, - 'ⷮ' => 230, - 'ⷯ' => 230, - 'ⷰ' => 230, - 'ⷱ' => 230, - 'ⷲ' => 230, - 'ⷳ' => 230, - 'ⷴ' => 230, - 'ⷵ' => 230, - 'ⷶ' => 230, - 'ⷷ' => 230, - 'ⷸ' => 230, - 'ⷹ' => 230, - 'ⷺ' => 230, - 'ⷻ' => 230, - 'ⷼ' => 230, - 'ⷽ' => 230, - 'ⷾ' => 230, - 'ⷿ' => 230, - '〪' => 218, - '〫' => 228, - '〬' => 232, - '〭' => 222, - '〮' => 224, - '〯' => 224, - '゙' => 8, - '゚' => 8, - '꙯' => 230, - 'ꙴ' => 230, - 'ꙵ' => 230, - 'ꙶ' => 230, - 'ꙷ' => 230, - 'ꙸ' => 230, - 'ꙹ' => 230, - 'ꙺ' => 230, - 'ꙻ' => 230, - '꙼' => 230, - '꙽' => 230, - 'ꚞ' => 230, - 'ꚟ' => 230, - '꛰' => 230, - '꛱' => 230, - '꠆' => 9, - '꠬' => 9, - '꣄' => 9, - '꣠' => 230, - '꣡' => 230, - '꣢' => 230, - '꣣' => 230, - '꣤' => 230, - '꣥' => 230, - '꣦' => 230, - '꣧' => 230, - '꣨' => 230, - '꣩' => 230, - '꣪' => 230, - '꣫' => 230, - '꣬' => 230, - '꣭' => 230, - '꣮' => 230, - '꣯' => 230, - '꣰' => 230, - '꣱' => 230, - '꤫' => 220, - '꤬' => 220, - '꤭' => 220, - '꥓' => 9, - '꦳' => 7, - '꧀' => 9, - 'ꪰ' => 230, - 'ꪲ' => 230, - 'ꪳ' => 230, - 'ꪴ' => 220, - 'ꪷ' => 230, - 'ꪸ' => 230, - 'ꪾ' => 230, - '꪿' => 230, - '꫁' => 230, - '꫶' => 9, - '꯭' => 9, - 'ﬞ' => 26, - '︠' => 230, - '︡' => 230, - '︢' => 230, - '︣' => 230, - '︤' => 230, - '︥' => 230, - '︦' => 230, - '︧' => 220, - '︨' => 220, - '︩' => 220, - '︪' => 220, - '︫' => 220, - '︬' => 220, - '︭' => 220, - '︮' => 230, - '︯' => 230, - '𐇽' => 220, - '𐋠' => 220, - '𐍶' => 230, - '𐍷' => 230, - '𐍸' => 230, - '𐍹' => 230, - '𐍺' => 230, - '𐨍' => 220, - '𐨏' => 230, - '𐨸' => 230, - '𐨹' => 1, - '𐨺' => 220, - '𐨿' => 9, - '𐫥' => 230, - '𐫦' => 220, - '𐴤' => 230, - '𐴥' => 230, - '𐴦' => 230, - '𐴧' => 230, - '𐺫' => 230, - '𐺬' => 230, - '𐽆' => 220, - '𐽇' => 220, - '𐽈' => 230, - '𐽉' => 230, - '𐽊' => 230, - '𐽋' => 220, - '𐽌' => 230, - '𐽍' => 220, - '𐽎' => 220, - '𐽏' => 220, - '𐽐' => 220, - '𑁆' => 9, - '𑁿' => 9, - '𑂹' => 9, - '𑂺' => 7, - '𑄀' => 230, - '𑄁' => 230, - '𑄂' => 230, - '𑄳' => 9, - '𑄴' => 9, - '𑅳' => 7, - '𑇀' => 9, - '𑇊' => 7, - '𑈵' => 9, - '𑈶' => 7, - '𑋩' => 7, - '𑋪' => 9, - '𑌻' => 7, - '𑌼' => 7, - '𑍍' => 9, - '𑍦' => 230, - '𑍧' => 230, - '𑍨' => 230, - '𑍩' => 230, - '𑍪' => 230, - '𑍫' => 230, - '𑍬' => 230, - '𑍰' => 230, - '𑍱' => 230, - '𑍲' => 230, - '𑍳' => 230, - '𑍴' => 230, - '𑑂' => 9, - '𑑆' => 7, - '𑑞' => 230, - '𑓂' => 9, - '𑓃' => 7, - '𑖿' => 9, - '𑗀' => 7, - '𑘿' => 9, - '𑚶' => 9, - '𑚷' => 7, - '𑜫' => 9, - '𑠹' => 9, - '𑠺' => 7, - '𑤽' => 9, - '𑤾' => 9, - '𑥃' => 7, - '𑧠' => 9, - '𑨴' => 9, - '𑩇' => 9, - '𑪙' => 9, - '𑰿' => 9, - '𑵂' => 7, - '𑵄' => 9, - '𑵅' => 9, - '𑶗' => 9, - '𖫰' => 1, - '𖫱' => 1, - '𖫲' => 1, - '𖫳' => 1, - '𖫴' => 1, - '𖬰' => 230, - '𖬱' => 230, - '𖬲' => 230, - '𖬳' => 230, - '𖬴' => 230, - '𖬵' => 230, - '𖬶' => 230, - '𖿰' => 6, - '𖿱' => 6, - '𛲞' => 1, - '𝅥' => 216, - '𝅦' => 216, - '𝅧' => 1, - '𝅨' => 1, - '𝅩' => 1, - '𝅭' => 226, - '𝅮' => 216, - '𝅯' => 216, - '𝅰' => 216, - '𝅱' => 216, - '𝅲' => 216, - '𝅻' => 220, - '𝅼' => 220, - '𝅽' => 220, - '𝅾' => 220, - '𝅿' => 220, - '𝆀' => 220, - '𝆁' => 220, - '𝆂' => 220, - '𝆅' => 230, - '𝆆' => 230, - '𝆇' => 230, - '𝆈' => 230, - '𝆉' => 230, - '𝆊' => 220, - '𝆋' => 220, - '𝆪' => 230, - '𝆫' => 230, - '𝆬' => 230, - '𝆭' => 230, - '𝉂' => 230, - '𝉃' => 230, - '𝉄' => 230, - '𞀀' => 230, - '𞀁' => 230, - '𞀂' => 230, - '𞀃' => 230, - '𞀄' => 230, - '𞀅' => 230, - '𞀆' => 230, - '𞀈' => 230, - '𞀉' => 230, - '𞀊' => 230, - '𞀋' => 230, - '𞀌' => 230, - '𞀍' => 230, - '𞀎' => 230, - '𞀏' => 230, - '𞀐' => 230, - '𞀑' => 230, - '𞀒' => 230, - '𞀓' => 230, - '𞀔' => 230, - '𞀕' => 230, - '𞀖' => 230, - '𞀗' => 230, - '𞀘' => 230, - '𞀛' => 230, - '𞀜' => 230, - '𞀝' => 230, - '𞀞' => 230, - '𞀟' => 230, - '𞀠' => 230, - '𞀡' => 230, - '𞀣' => 230, - '𞀤' => 230, - '𞀦' => 230, - '𞀧' => 230, - '𞀨' => 230, - '𞀩' => 230, - '𞀪' => 230, - '𞄰' => 230, - '𞄱' => 230, - '𞄲' => 230, - '𞄳' => 230, - '𞄴' => 230, - '𞄵' => 230, - '𞄶' => 230, - '𞋬' => 230, - '𞋭' => 230, - '𞋮' => 230, - '𞋯' => 230, - '𞣐' => 220, - '𞣑' => 220, - '𞣒' => 220, - '𞣓' => 220, - '𞣔' => 220, - '𞣕' => 220, - '𞣖' => 220, - '𞥄' => 230, - '𞥅' => 230, - '𞥆' => 230, - '𞥇' => 230, - '𞥈' => 230, - '𞥉' => 230, - '𞥊' => 7, -); diff --git a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php b/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php deleted file mode 100644 index 157490289..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/Resources/unidata/compatibilityDecomposition.php +++ /dev/null @@ -1,3695 +0,0 @@ - ' ', - '¨' => ' ̈', - 'ª' => 'a', - '¯' => ' ̄', - '²' => '2', - '³' => '3', - '´' => ' ́', - 'µ' => 'μ', - '¸' => ' ̧', - '¹' => '1', - 'º' => 'o', - '¼' => '1⁄4', - '½' => '1⁄2', - '¾' => '3⁄4', - 'IJ' => 'IJ', - 'ij' => 'ij', - 'Ŀ' => 'L·', - 'ŀ' => 'l·', - 'ʼn' => 'ʼn', - 'ſ' => 's', - 'DŽ' => 'DŽ', - 'Dž' => 'Dž', - 'dž' => 'dž', - 'LJ' => 'LJ', - 'Lj' => 'Lj', - 'lj' => 'lj', - 'NJ' => 'NJ', - 'Nj' => 'Nj', - 'nj' => 'nj', - 'DZ' => 'DZ', - 'Dz' => 'Dz', - 'dz' => 'dz', - 'ʰ' => 'h', - 'ʱ' => 'ɦ', - 'ʲ' => 'j', - 'ʳ' => 'r', - 'ʴ' => 'ɹ', - 'ʵ' => 'ɻ', - 'ʶ' => 'ʁ', - 'ʷ' => 'w', - 'ʸ' => 'y', - '˘' => ' ̆', - '˙' => ' ̇', - '˚' => ' ̊', - '˛' => ' ̨', - '˜' => ' ̃', - '˝' => ' ̋', - 'ˠ' => 'ɣ', - 'ˡ' => 'l', - 'ˢ' => 's', - 'ˣ' => 'x', - 'ˤ' => 'ʕ', - 'ͺ' => ' ͅ', - '΄' => ' ́', - '΅' => ' ̈́', - 'ϐ' => 'β', - 'ϑ' => 'θ', - 'ϒ' => 'Υ', - 'ϓ' => 'Ύ', - 'ϔ' => 'Ϋ', - 'ϕ' => 'φ', - 'ϖ' => 'π', - 'ϰ' => 'κ', - 'ϱ' => 'ρ', - 'ϲ' => 'ς', - 'ϴ' => 'Θ', - 'ϵ' => 'ε', - 'Ϲ' => 'Σ', - 'և' => 'եւ', - 'ٵ' => 'اٴ', - 'ٶ' => 'وٴ', - 'ٷ' => 'ۇٴ', - 'ٸ' => 'يٴ', - 'ำ' => 'ํา', - 'ຳ' => 'ໍາ', - 'ໜ' => 'ຫນ', - 'ໝ' => 'ຫມ', - '༌' => '་', - 'ཷ' => 'ྲཱྀ', - 'ཹ' => 'ླཱྀ', - 'ჼ' => 'ნ', - 'ᴬ' => 'A', - 'ᴭ' => 'Æ', - 'ᴮ' => 'B', - 'ᴰ' => 'D', - 'ᴱ' => 'E', - 'ᴲ' => 'Ǝ', - 'ᴳ' => 'G', - 'ᴴ' => 'H', - 'ᴵ' => 'I', - 'ᴶ' => 'J', - 'ᴷ' => 'K', - 'ᴸ' => 'L', - 'ᴹ' => 'M', - 'ᴺ' => 'N', - 'ᴼ' => 'O', - 'ᴽ' => 'Ȣ', - 'ᴾ' => 'P', - 'ᴿ' => 'R', - 'ᵀ' => 'T', - 'ᵁ' => 'U', - 'ᵂ' => 'W', - 'ᵃ' => 'a', - 'ᵄ' => 'ɐ', - 'ᵅ' => 'ɑ', - 'ᵆ' => 'ᴂ', - 'ᵇ' => 'b', - 'ᵈ' => 'd', - 'ᵉ' => 'e', - 'ᵊ' => 'ə', - 'ᵋ' => 'ɛ', - 'ᵌ' => 'ɜ', - 'ᵍ' => 'g', - 'ᵏ' => 'k', - 'ᵐ' => 'm', - 'ᵑ' => 'ŋ', - 'ᵒ' => 'o', - 'ᵓ' => 'ɔ', - 'ᵔ' => 'ᴖ', - 'ᵕ' => 'ᴗ', - 'ᵖ' => 'p', - 'ᵗ' => 't', - 'ᵘ' => 'u', - 'ᵙ' => 'ᴝ', - 'ᵚ' => 'ɯ', - 'ᵛ' => 'v', - 'ᵜ' => 'ᴥ', - 'ᵝ' => 'β', - 'ᵞ' => 'γ', - 'ᵟ' => 'δ', - 'ᵠ' => 'φ', - 'ᵡ' => 'χ', - 'ᵢ' => 'i', - 'ᵣ' => 'r', - 'ᵤ' => 'u', - 'ᵥ' => 'v', - 'ᵦ' => 'β', - 'ᵧ' => 'γ', - 'ᵨ' => 'ρ', - 'ᵩ' => 'φ', - 'ᵪ' => 'χ', - 'ᵸ' => 'н', - 'ᶛ' => 'ɒ', - 'ᶜ' => 'c', - 'ᶝ' => 'ɕ', - 'ᶞ' => 'ð', - 'ᶟ' => 'ɜ', - 'ᶠ' => 'f', - 'ᶡ' => 'ɟ', - 'ᶢ' => 'ɡ', - 'ᶣ' => 'ɥ', - 'ᶤ' => 'ɨ', - 'ᶥ' => 'ɩ', - 'ᶦ' => 'ɪ', - 'ᶧ' => 'ᵻ', - 'ᶨ' => 'ʝ', - 'ᶩ' => 'ɭ', - 'ᶪ' => 'ᶅ', - 'ᶫ' => 'ʟ', - 'ᶬ' => 'ɱ', - 'ᶭ' => 'ɰ', - 'ᶮ' => 'ɲ', - 'ᶯ' => 'ɳ', - 'ᶰ' => 'ɴ', - 'ᶱ' => 'ɵ', - 'ᶲ' => 'ɸ', - 'ᶳ' => 'ʂ', - 'ᶴ' => 'ʃ', - 'ᶵ' => 'ƫ', - 'ᶶ' => 'ʉ', - 'ᶷ' => 'ʊ', - 'ᶸ' => 'ᴜ', - 'ᶹ' => 'ʋ', - 'ᶺ' => 'ʌ', - 'ᶻ' => 'z', - 'ᶼ' => 'ʐ', - 'ᶽ' => 'ʑ', - 'ᶾ' => 'ʒ', - 'ᶿ' => 'θ', - 'ẚ' => 'aʾ', - 'ẛ' => 'ṡ', - '᾽' => ' ̓', - '᾿' => ' ̓', - '῀' => ' ͂', - '῁' => ' ̈͂', - '῍' => ' ̓̀', - '῎' => ' ̓́', - '῏' => ' ̓͂', - '῝' => ' ̔̀', - '῞' => ' ̔́', - '῟' => ' ̔͂', - '῭' => ' ̈̀', - '΅' => ' ̈́', - '´' => ' ́', - '῾' => ' ̔', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - ' ' => ' ', - '‑' => '‐', - '‗' => ' ̳', - '․' => '.', - '‥' => '..', - '…' => '...', - ' ' => ' ', - '″' => '′′', - '‴' => '′′′', - '‶' => '‵‵', - '‷' => '‵‵‵', - '‼' => '!!', - '‾' => ' ̅', - '⁇' => '??', - '⁈' => '?!', - '⁉' => '!?', - '⁗' => '′′′′', - ' ' => ' ', - '⁰' => '0', - 'ⁱ' => 'i', - '⁴' => '4', - '⁵' => '5', - '⁶' => '6', - '⁷' => '7', - '⁸' => '8', - '⁹' => '9', - '⁺' => '+', - '⁻' => '−', - '⁼' => '=', - '⁽' => '(', - '⁾' => ')', - 'ⁿ' => 'n', - '₀' => '0', - '₁' => '1', - '₂' => '2', - '₃' => '3', - '₄' => '4', - '₅' => '5', - '₆' => '6', - '₇' => '7', - '₈' => '8', - '₉' => '9', - '₊' => '+', - '₋' => '−', - '₌' => '=', - '₍' => '(', - '₎' => ')', - 'ₐ' => 'a', - 'ₑ' => 'e', - 'ₒ' => 'o', - 'ₓ' => 'x', - 'ₔ' => 'ə', - 'ₕ' => 'h', - 'ₖ' => 'k', - 'ₗ' => 'l', - 'ₘ' => 'm', - 'ₙ' => 'n', - 'ₚ' => 'p', - 'ₛ' => 's', - 'ₜ' => 't', - '₨' => 'Rs', - '℀' => 'a/c', - '℁' => 'a/s', - 'ℂ' => 'C', - '℃' => '°C', - '℅' => 'c/o', - '℆' => 'c/u', - 'ℇ' => 'Ɛ', - '℉' => '°F', - 'ℊ' => 'g', - 'ℋ' => 'H', - 'ℌ' => 'H', - 'ℍ' => 'H', - 'ℎ' => 'h', - 'ℏ' => 'ħ', - 'ℐ' => 'I', - 'ℑ' => 'I', - 'ℒ' => 'L', - 'ℓ' => 'l', - 'ℕ' => 'N', - '№' => 'No', - 'ℙ' => 'P', - 'ℚ' => 'Q', - 'ℛ' => 'R', - 'ℜ' => 'R', - 'ℝ' => 'R', - '℠' => 'SM', - '℡' => 'TEL', - '™' => 'TM', - 'ℤ' => 'Z', - 'ℨ' => 'Z', - 'ℬ' => 'B', - 'ℭ' => 'C', - 'ℯ' => 'e', - 'ℰ' => 'E', - 'ℱ' => 'F', - 'ℳ' => 'M', - 'ℴ' => 'o', - 'ℵ' => 'א', - 'ℶ' => 'ב', - 'ℷ' => 'ג', - 'ℸ' => 'ד', - 'ℹ' => 'i', - '℻' => 'FAX', - 'ℼ' => 'π', - 'ℽ' => 'γ', - 'ℾ' => 'Γ', - 'ℿ' => 'Π', - '⅀' => '∑', - 'ⅅ' => 'D', - 'ⅆ' => 'd', - 'ⅇ' => 'e', - 'ⅈ' => 'i', - 'ⅉ' => 'j', - '⅐' => '1⁄7', - '⅑' => '1⁄9', - '⅒' => '1⁄10', - '⅓' => '1⁄3', - '⅔' => '2⁄3', - '⅕' => '1⁄5', - '⅖' => '2⁄5', - '⅗' => '3⁄5', - '⅘' => '4⁄5', - '⅙' => '1⁄6', - '⅚' => '5⁄6', - '⅛' => '1⁄8', - '⅜' => '3⁄8', - '⅝' => '5⁄8', - '⅞' => '7⁄8', - '⅟' => '1⁄', - 'Ⅰ' => 'I', - 'Ⅱ' => 'II', - 'Ⅲ' => 'III', - 'Ⅳ' => 'IV', - 'Ⅴ' => 'V', - 'Ⅵ' => 'VI', - 'Ⅶ' => 'VII', - 'Ⅷ' => 'VIII', - 'Ⅸ' => 'IX', - 'Ⅹ' => 'X', - 'Ⅺ' => 'XI', - 'Ⅻ' => 'XII', - 'Ⅼ' => 'L', - 'Ⅽ' => 'C', - 'Ⅾ' => 'D', - 'Ⅿ' => 'M', - 'ⅰ' => 'i', - 'ⅱ' => 'ii', - 'ⅲ' => 'iii', - 'ⅳ' => 'iv', - 'ⅴ' => 'v', - 'ⅵ' => 'vi', - 'ⅶ' => 'vii', - 'ⅷ' => 'viii', - 'ⅸ' => 'ix', - 'ⅹ' => 'x', - 'ⅺ' => 'xi', - 'ⅻ' => 'xii', - 'ⅼ' => 'l', - 'ⅽ' => 'c', - 'ⅾ' => 'd', - 'ⅿ' => 'm', - '↉' => '0⁄3', - '∬' => '∫∫', - '∭' => '∫∫∫', - '∯' => '∮∮', - '∰' => '∮∮∮', - '①' => '1', - '②' => '2', - '③' => '3', - '④' => '4', - '⑤' => '5', - '⑥' => '6', - '⑦' => '7', - '⑧' => '8', - '⑨' => '9', - '⑩' => '10', - '⑪' => '11', - '⑫' => '12', - '⑬' => '13', - '⑭' => '14', - '⑮' => '15', - '⑯' => '16', - '⑰' => '17', - '⑱' => '18', - '⑲' => '19', - '⑳' => '20', - '⑴' => '(1)', - '⑵' => '(2)', - '⑶' => '(3)', - '⑷' => '(4)', - '⑸' => '(5)', - '⑹' => '(6)', - '⑺' => '(7)', - '⑻' => '(8)', - '⑼' => '(9)', - '⑽' => '(10)', - '⑾' => '(11)', - '⑿' => '(12)', - '⒀' => '(13)', - '⒁' => '(14)', - '⒂' => '(15)', - '⒃' => '(16)', - '⒄' => '(17)', - '⒅' => '(18)', - '⒆' => '(19)', - '⒇' => '(20)', - '⒈' => '1.', - '⒉' => '2.', - '⒊' => '3.', - '⒋' => '4.', - '⒌' => '5.', - '⒍' => '6.', - '⒎' => '7.', - '⒏' => '8.', - '⒐' => '9.', - '⒑' => '10.', - '⒒' => '11.', - '⒓' => '12.', - '⒔' => '13.', - '⒕' => '14.', - '⒖' => '15.', - '⒗' => '16.', - '⒘' => '17.', - '⒙' => '18.', - '⒚' => '19.', - '⒛' => '20.', - '⒜' => '(a)', - '⒝' => '(b)', - '⒞' => '(c)', - '⒟' => '(d)', - '⒠' => '(e)', - '⒡' => '(f)', - '⒢' => '(g)', - '⒣' => '(h)', - '⒤' => '(i)', - '⒥' => '(j)', - '⒦' => '(k)', - '⒧' => '(l)', - '⒨' => '(m)', - '⒩' => '(n)', - '⒪' => '(o)', - '⒫' => '(p)', - '⒬' => '(q)', - '⒭' => '(r)', - '⒮' => '(s)', - '⒯' => '(t)', - '⒰' => '(u)', - '⒱' => '(v)', - '⒲' => '(w)', - '⒳' => '(x)', - '⒴' => '(y)', - '⒵' => '(z)', - 'Ⓐ' => 'A', - 'Ⓑ' => 'B', - 'Ⓒ' => 'C', - 'Ⓓ' => 'D', - 'Ⓔ' => 'E', - 'Ⓕ' => 'F', - 'Ⓖ' => 'G', - 'Ⓗ' => 'H', - 'Ⓘ' => 'I', - 'Ⓙ' => 'J', - 'Ⓚ' => 'K', - 'Ⓛ' => 'L', - 'Ⓜ' => 'M', - 'Ⓝ' => 'N', - 'Ⓞ' => 'O', - 'Ⓟ' => 'P', - 'Ⓠ' => 'Q', - 'Ⓡ' => 'R', - 'Ⓢ' => 'S', - 'Ⓣ' => 'T', - 'Ⓤ' => 'U', - 'Ⓥ' => 'V', - 'Ⓦ' => 'W', - 'Ⓧ' => 'X', - 'Ⓨ' => 'Y', - 'Ⓩ' => 'Z', - 'ⓐ' => 'a', - 'ⓑ' => 'b', - 'ⓒ' => 'c', - 'ⓓ' => 'd', - 'ⓔ' => 'e', - 'ⓕ' => 'f', - 'ⓖ' => 'g', - 'ⓗ' => 'h', - 'ⓘ' => 'i', - 'ⓙ' => 'j', - 'ⓚ' => 'k', - 'ⓛ' => 'l', - 'ⓜ' => 'm', - 'ⓝ' => 'n', - 'ⓞ' => 'o', - 'ⓟ' => 'p', - 'ⓠ' => 'q', - 'ⓡ' => 'r', - 'ⓢ' => 's', - 'ⓣ' => 't', - 'ⓤ' => 'u', - 'ⓥ' => 'v', - 'ⓦ' => 'w', - 'ⓧ' => 'x', - 'ⓨ' => 'y', - 'ⓩ' => 'z', - '⓪' => '0', - '⨌' => '∫∫∫∫', - '⩴' => '::=', - '⩵' => '==', - '⩶' => '===', - 'ⱼ' => 'j', - 'ⱽ' => 'V', - 'ⵯ' => 'ⵡ', - '⺟' => '母', - '⻳' => '龟', - '⼀' => '一', - '⼁' => '丨', - '⼂' => '丶', - '⼃' => '丿', - '⼄' => '乙', - '⼅' => '亅', - '⼆' => '二', - '⼇' => '亠', - '⼈' => '人', - '⼉' => '儿', - '⼊' => '入', - '⼋' => '八', - '⼌' => '冂', - '⼍' => '冖', - '⼎' => '冫', - '⼏' => '几', - '⼐' => '凵', - '⼑' => '刀', - '⼒' => '力', - '⼓' => '勹', - '⼔' => '匕', - '⼕' => '匚', - '⼖' => '匸', - '⼗' => '十', - '⼘' => '卜', - '⼙' => '卩', - '⼚' => '厂', - '⼛' => '厶', - '⼜' => '又', - '⼝' => '口', - '⼞' => '囗', - '⼟' => '土', - '⼠' => '士', - '⼡' => '夂', - '⼢' => '夊', - '⼣' => '夕', - '⼤' => '大', - '⼥' => '女', - '⼦' => '子', - '⼧' => '宀', - '⼨' => '寸', - '⼩' => '小', - '⼪' => '尢', - '⼫' => '尸', - '⼬' => '屮', - '⼭' => '山', - '⼮' => '巛', - '⼯' => '工', - '⼰' => '己', - '⼱' => '巾', - '⼲' => '干', - '⼳' => '幺', - '⼴' => '广', - '⼵' => '廴', - '⼶' => '廾', - '⼷' => '弋', - '⼸' => '弓', - '⼹' => '彐', - '⼺' => '彡', - '⼻' => '彳', - '⼼' => '心', - '⼽' => '戈', - '⼾' => '戶', - '⼿' => '手', - '⽀' => '支', - '⽁' => '攴', - '⽂' => '文', - '⽃' => '斗', - '⽄' => '斤', - '⽅' => '方', - '⽆' => '无', - '⽇' => '日', - '⽈' => '曰', - '⽉' => '月', - '⽊' => '木', - '⽋' => '欠', - '⽌' => '止', - '⽍' => '歹', - '⽎' => '殳', - '⽏' => '毋', - '⽐' => '比', - '⽑' => '毛', - '⽒' => '氏', - '⽓' => '气', - '⽔' => '水', - '⽕' => '火', - '⽖' => '爪', - '⽗' => '父', - '⽘' => '爻', - '⽙' => '爿', - '⽚' => '片', - '⽛' => '牙', - '⽜' => '牛', - '⽝' => '犬', - '⽞' => '玄', - '⽟' => '玉', - '⽠' => '瓜', - '⽡' => '瓦', - '⽢' => '甘', - '⽣' => '生', - '⽤' => '用', - '⽥' => '田', - '⽦' => '疋', - '⽧' => '疒', - '⽨' => '癶', - '⽩' => '白', - '⽪' => '皮', - '⽫' => '皿', - '⽬' => '目', - '⽭' => '矛', - '⽮' => '矢', - '⽯' => '石', - '⽰' => '示', - '⽱' => '禸', - '⽲' => '禾', - '⽳' => '穴', - '⽴' => '立', - '⽵' => '竹', - '⽶' => '米', - '⽷' => '糸', - '⽸' => '缶', - '⽹' => '网', - '⽺' => '羊', - '⽻' => '羽', - '⽼' => '老', - '⽽' => '而', - '⽾' => '耒', - '⽿' => '耳', - '⾀' => '聿', - '⾁' => '肉', - '⾂' => '臣', - '⾃' => '自', - '⾄' => '至', - '⾅' => '臼', - '⾆' => '舌', - '⾇' => '舛', - '⾈' => '舟', - '⾉' => '艮', - '⾊' => '色', - '⾋' => '艸', - '⾌' => '虍', - '⾍' => '虫', - '⾎' => '血', - '⾏' => '行', - '⾐' => '衣', - '⾑' => '襾', - '⾒' => '見', - '⾓' => '角', - '⾔' => '言', - '⾕' => '谷', - '⾖' => '豆', - '⾗' => '豕', - '⾘' => '豸', - '⾙' => '貝', - '⾚' => '赤', - '⾛' => '走', - '⾜' => '足', - '⾝' => '身', - '⾞' => '車', - '⾟' => '辛', - '⾠' => '辰', - '⾡' => '辵', - '⾢' => '邑', - '⾣' => '酉', - '⾤' => '釆', - '⾥' => '里', - '⾦' => '金', - '⾧' => '長', - '⾨' => '門', - '⾩' => '阜', - '⾪' => '隶', - '⾫' => '隹', - '⾬' => '雨', - '⾭' => '靑', - '⾮' => '非', - '⾯' => '面', - '⾰' => '革', - '⾱' => '韋', - '⾲' => '韭', - '⾳' => '音', - '⾴' => '頁', - '⾵' => '風', - '⾶' => '飛', - '⾷' => '食', - '⾸' => '首', - '⾹' => '香', - '⾺' => '馬', - '⾻' => '骨', - '⾼' => '高', - '⾽' => '髟', - '⾾' => '鬥', - '⾿' => '鬯', - '⿀' => '鬲', - '⿁' => '鬼', - '⿂' => '魚', - '⿃' => '鳥', - '⿄' => '鹵', - '⿅' => '鹿', - '⿆' => '麥', - '⿇' => '麻', - '⿈' => '黃', - '⿉' => '黍', - '⿊' => '黑', - '⿋' => '黹', - '⿌' => '黽', - '⿍' => '鼎', - '⿎' => '鼓', - '⿏' => '鼠', - '⿐' => '鼻', - '⿑' => '齊', - '⿒' => '齒', - '⿓' => '龍', - '⿔' => '龜', - '⿕' => '龠', - ' ' => ' ', - '〶' => '〒', - '〸' => '十', - '〹' => '卄', - '〺' => '卅', - '゛' => ' ゙', - '゜' => ' ゚', - 'ゟ' => 'より', - 'ヿ' => 'コト', - 'ㄱ' => 'ᄀ', - 'ㄲ' => 'ᄁ', - 'ㄳ' => 'ᆪ', - 'ㄴ' => 'ᄂ', - 'ㄵ' => 'ᆬ', - 'ㄶ' => 'ᆭ', - 'ㄷ' => 'ᄃ', - 'ㄸ' => 'ᄄ', - 'ㄹ' => 'ᄅ', - 'ㄺ' => 'ᆰ', - 'ㄻ' => 'ᆱ', - 'ㄼ' => 'ᆲ', - 'ㄽ' => 'ᆳ', - 'ㄾ' => 'ᆴ', - 'ㄿ' => 'ᆵ', - 'ㅀ' => 'ᄚ', - 'ㅁ' => 'ᄆ', - 'ㅂ' => 'ᄇ', - 'ㅃ' => 'ᄈ', - 'ㅄ' => 'ᄡ', - 'ㅅ' => 'ᄉ', - 'ㅆ' => 'ᄊ', - 'ㅇ' => 'ᄋ', - 'ㅈ' => 'ᄌ', - 'ㅉ' => 'ᄍ', - 'ㅊ' => 'ᄎ', - 'ㅋ' => 'ᄏ', - 'ㅌ' => 'ᄐ', - 'ㅍ' => 'ᄑ', - 'ㅎ' => 'ᄒ', - 'ㅏ' => 'ᅡ', - 'ㅐ' => 'ᅢ', - 'ㅑ' => 'ᅣ', - 'ㅒ' => 'ᅤ', - 'ㅓ' => 'ᅥ', - 'ㅔ' => 'ᅦ', - 'ㅕ' => 'ᅧ', - 'ㅖ' => 'ᅨ', - 'ㅗ' => 'ᅩ', - 'ㅘ' => 'ᅪ', - 'ㅙ' => 'ᅫ', - 'ㅚ' => 'ᅬ', - 'ㅛ' => 'ᅭ', - 'ㅜ' => 'ᅮ', - 'ㅝ' => 'ᅯ', - 'ㅞ' => 'ᅰ', - 'ㅟ' => 'ᅱ', - 'ㅠ' => 'ᅲ', - 'ㅡ' => 'ᅳ', - 'ㅢ' => 'ᅴ', - 'ㅣ' => 'ᅵ', - 'ㅤ' => 'ᅠ', - 'ㅥ' => 'ᄔ', - 'ㅦ' => 'ᄕ', - 'ㅧ' => 'ᇇ', - 'ㅨ' => 'ᇈ', - 'ㅩ' => 'ᇌ', - 'ㅪ' => 'ᇎ', - 'ㅫ' => 'ᇓ', - 'ㅬ' => 'ᇗ', - 'ㅭ' => 'ᇙ', - 'ㅮ' => 'ᄜ', - 'ㅯ' => 'ᇝ', - 'ㅰ' => 'ᇟ', - 'ㅱ' => 'ᄝ', - 'ㅲ' => 'ᄞ', - 'ㅳ' => 'ᄠ', - 'ㅴ' => 'ᄢ', - 'ㅵ' => 'ᄣ', - 'ㅶ' => 'ᄧ', - 'ㅷ' => 'ᄩ', - 'ㅸ' => 'ᄫ', - 'ㅹ' => 'ᄬ', - 'ㅺ' => 'ᄭ', - 'ㅻ' => 'ᄮ', - 'ㅼ' => 'ᄯ', - 'ㅽ' => 'ᄲ', - 'ㅾ' => 'ᄶ', - 'ㅿ' => 'ᅀ', - 'ㆀ' => 'ᅇ', - 'ㆁ' => 'ᅌ', - 'ㆂ' => 'ᇱ', - 'ㆃ' => 'ᇲ', - 'ㆄ' => 'ᅗ', - 'ㆅ' => 'ᅘ', - 'ㆆ' => 'ᅙ', - 'ㆇ' => 'ᆄ', - 'ㆈ' => 'ᆅ', - 'ㆉ' => 'ᆈ', - 'ㆊ' => 'ᆑ', - 'ㆋ' => 'ᆒ', - 'ㆌ' => 'ᆔ', - 'ㆍ' => 'ᆞ', - 'ㆎ' => 'ᆡ', - '㆒' => '一', - '㆓' => '二', - '㆔' => '三', - '㆕' => '四', - '㆖' => '上', - '㆗' => '中', - '㆘' => '下', - '㆙' => '甲', - '㆚' => '乙', - '㆛' => '丙', - '㆜' => '丁', - '㆝' => '天', - '㆞' => '地', - '㆟' => '人', - '㈀' => '(ᄀ)', - '㈁' => '(ᄂ)', - '㈂' => '(ᄃ)', - '㈃' => '(ᄅ)', - '㈄' => '(ᄆ)', - '㈅' => '(ᄇ)', - '㈆' => '(ᄉ)', - '㈇' => '(ᄋ)', - '㈈' => '(ᄌ)', - '㈉' => '(ᄎ)', - '㈊' => '(ᄏ)', - '㈋' => '(ᄐ)', - '㈌' => '(ᄑ)', - '㈍' => '(ᄒ)', - '㈎' => '(가)', - '㈏' => '(나)', - '㈐' => '(다)', - '㈑' => '(라)', - '㈒' => '(마)', - '㈓' => '(바)', - '㈔' => '(사)', - '㈕' => '(아)', - '㈖' => '(자)', - '㈗' => '(차)', - '㈘' => '(카)', - '㈙' => '(타)', - '㈚' => '(파)', - '㈛' => '(하)', - '㈜' => '(주)', - '㈝' => '(오전)', - '㈞' => '(오후)', - '㈠' => '(一)', - '㈡' => '(二)', - '㈢' => '(三)', - '㈣' => '(四)', - '㈤' => '(五)', - '㈥' => '(六)', - '㈦' => '(七)', - '㈧' => '(八)', - '㈨' => '(九)', - '㈩' => '(十)', - '㈪' => '(月)', - '㈫' => '(火)', - '㈬' => '(水)', - '㈭' => '(木)', - '㈮' => '(金)', - '㈯' => '(土)', - '㈰' => '(日)', - '㈱' => '(株)', - '㈲' => '(有)', - '㈳' => '(社)', - '㈴' => '(名)', - '㈵' => '(特)', - '㈶' => '(財)', - '㈷' => '(祝)', - '㈸' => '(労)', - '㈹' => '(代)', - '㈺' => '(呼)', - '㈻' => '(学)', - '㈼' => '(監)', - '㈽' => '(企)', - '㈾' => '(資)', - '㈿' => '(協)', - '㉀' => '(祭)', - '㉁' => '(休)', - '㉂' => '(自)', - '㉃' => '(至)', - '㉄' => '問', - '㉅' => '幼', - '㉆' => '文', - '㉇' => '箏', - '㉐' => 'PTE', - '㉑' => '21', - '㉒' => '22', - '㉓' => '23', - '㉔' => '24', - '㉕' => '25', - '㉖' => '26', - '㉗' => '27', - '㉘' => '28', - '㉙' => '29', - '㉚' => '30', - '㉛' => '31', - '㉜' => '32', - '㉝' => '33', - '㉞' => '34', - '㉟' => '35', - '㉠' => 'ᄀ', - '㉡' => 'ᄂ', - '㉢' => 'ᄃ', - '㉣' => 'ᄅ', - '㉤' => 'ᄆ', - '㉥' => 'ᄇ', - '㉦' => 'ᄉ', - '㉧' => 'ᄋ', - '㉨' => 'ᄌ', - '㉩' => 'ᄎ', - '㉪' => 'ᄏ', - '㉫' => 'ᄐ', - '㉬' => 'ᄑ', - '㉭' => 'ᄒ', - '㉮' => '가', - '㉯' => '나', - '㉰' => '다', - '㉱' => '라', - '㉲' => '마', - '㉳' => '바', - '㉴' => '사', - '㉵' => '아', - '㉶' => '자', - '㉷' => '차', - '㉸' => '카', - '㉹' => '타', - '㉺' => '파', - '㉻' => '하', - '㉼' => '참고', - '㉽' => '주의', - '㉾' => '우', - '㊀' => '一', - '㊁' => '二', - '㊂' => '三', - '㊃' => '四', - '㊄' => '五', - '㊅' => '六', - '㊆' => '七', - '㊇' => '八', - '㊈' => '九', - '㊉' => '十', - '㊊' => '月', - '㊋' => '火', - '㊌' => '水', - '㊍' => '木', - '㊎' => '金', - '㊏' => '土', - '㊐' => '日', - '㊑' => '株', - '㊒' => '有', - '㊓' => '社', - '㊔' => '名', - '㊕' => '特', - '㊖' => '財', - '㊗' => '祝', - '㊘' => '労', - '㊙' => '秘', - '㊚' => '男', - '㊛' => '女', - '㊜' => '適', - '㊝' => '優', - '㊞' => '印', - '㊟' => '注', - '㊠' => '項', - '㊡' => '休', - '㊢' => '写', - '㊣' => '正', - '㊤' => '上', - '㊥' => '中', - '㊦' => '下', - '㊧' => '左', - '㊨' => '右', - '㊩' => '医', - '㊪' => '宗', - '㊫' => '学', - '㊬' => '監', - '㊭' => '企', - '㊮' => '資', - '㊯' => '協', - '㊰' => '夜', - '㊱' => '36', - '㊲' => '37', - '㊳' => '38', - '㊴' => '39', - '㊵' => '40', - '㊶' => '41', - '㊷' => '42', - '㊸' => '43', - '㊹' => '44', - '㊺' => '45', - '㊻' => '46', - '㊼' => '47', - '㊽' => '48', - '㊾' => '49', - '㊿' => '50', - '㋀' => '1月', - '㋁' => '2月', - '㋂' => '3月', - '㋃' => '4月', - '㋄' => '5月', - '㋅' => '6月', - '㋆' => '7月', - '㋇' => '8月', - '㋈' => '9月', - '㋉' => '10月', - '㋊' => '11月', - '㋋' => '12月', - '㋌' => 'Hg', - '㋍' => 'erg', - '㋎' => 'eV', - '㋏' => 'LTD', - '㋐' => 'ア', - '㋑' => 'イ', - '㋒' => 'ウ', - '㋓' => 'エ', - '㋔' => 'オ', - '㋕' => 'カ', - '㋖' => 'キ', - '㋗' => 'ク', - '㋘' => 'ケ', - '㋙' => 'コ', - '㋚' => 'サ', - '㋛' => 'シ', - '㋜' => 'ス', - '㋝' => 'セ', - '㋞' => 'ソ', - '㋟' => 'タ', - '㋠' => 'チ', - '㋡' => 'ツ', - '㋢' => 'テ', - '㋣' => 'ト', - '㋤' => 'ナ', - '㋥' => 'ニ', - '㋦' => 'ヌ', - '㋧' => 'ネ', - '㋨' => 'ノ', - '㋩' => 'ハ', - '㋪' => 'ヒ', - '㋫' => 'フ', - '㋬' => 'ヘ', - '㋭' => 'ホ', - '㋮' => 'マ', - '㋯' => 'ミ', - '㋰' => 'ム', - '㋱' => 'メ', - '㋲' => 'モ', - '㋳' => 'ヤ', - '㋴' => 'ユ', - '㋵' => 'ヨ', - '㋶' => 'ラ', - '㋷' => 'リ', - '㋸' => 'ル', - '㋹' => 'レ', - '㋺' => 'ロ', - '㋻' => 'ワ', - '㋼' => 'ヰ', - '㋽' => 'ヱ', - '㋾' => 'ヲ', - '㋿' => '令和', - '㌀' => 'アパート', - '㌁' => 'アルファ', - '㌂' => 'アンペア', - '㌃' => 'アール', - '㌄' => 'イニング', - '㌅' => 'インチ', - '㌆' => 'ウォン', - '㌇' => 'エスクード', - '㌈' => 'エーカー', - '㌉' => 'オンス', - '㌊' => 'オーム', - '㌋' => 'カイリ', - '㌌' => 'カラット', - '㌍' => 'カロリー', - '㌎' => 'ガロン', - '㌏' => 'ガンマ', - '㌐' => 'ギガ', - '㌑' => 'ギニー', - '㌒' => 'キュリー', - '㌓' => 'ギルダー', - '㌔' => 'キロ', - '㌕' => 'キログラム', - '㌖' => 'キロメートル', - '㌗' => 'キロワット', - '㌘' => 'グラム', - '㌙' => 'グラムトン', - '㌚' => 'クルゼイロ', - '㌛' => 'クローネ', - '㌜' => 'ケース', - '㌝' => 'コルナ', - '㌞' => 'コーポ', - '㌟' => 'サイクル', - '㌠' => 'サンチーム', - '㌡' => 'シリング', - '㌢' => 'センチ', - '㌣' => 'セント', - '㌤' => 'ダース', - '㌥' => 'デシ', - '㌦' => 'ドル', - '㌧' => 'トン', - '㌨' => 'ナノ', - '㌩' => 'ノット', - '㌪' => 'ハイツ', - '㌫' => 'パーセント', - '㌬' => 'パーツ', - '㌭' => 'バーレル', - '㌮' => 'ピアストル', - '㌯' => 'ピクル', - '㌰' => 'ピコ', - '㌱' => 'ビル', - '㌲' => 'ファラッド', - '㌳' => 'フィート', - '㌴' => 'ブッシェル', - '㌵' => 'フラン', - '㌶' => 'ヘクタール', - '㌷' => 'ペソ', - '㌸' => 'ペニヒ', - '㌹' => 'ヘルツ', - '㌺' => 'ペンス', - '㌻' => 'ページ', - '㌼' => 'ベータ', - '㌽' => 'ポイント', - '㌾' => 'ボルト', - '㌿' => 'ホン', - '㍀' => 'ポンド', - '㍁' => 'ホール', - '㍂' => 'ホーン', - '㍃' => 'マイクロ', - '㍄' => 'マイル', - '㍅' => 'マッハ', - '㍆' => 'マルク', - '㍇' => 'マンション', - '㍈' => 'ミクロン', - '㍉' => 'ミリ', - '㍊' => 'ミリバール', - '㍋' => 'メガ', - '㍌' => 'メガトン', - '㍍' => 'メートル', - '㍎' => 'ヤード', - '㍏' => 'ヤール', - '㍐' => 'ユアン', - '㍑' => 'リットル', - '㍒' => 'リラ', - '㍓' => 'ルピー', - '㍔' => 'ルーブル', - '㍕' => 'レム', - '㍖' => 'レントゲン', - '㍗' => 'ワット', - '㍘' => '0点', - '㍙' => '1点', - '㍚' => '2点', - '㍛' => '3点', - '㍜' => '4点', - '㍝' => '5点', - '㍞' => '6点', - '㍟' => '7点', - '㍠' => '8点', - '㍡' => '9点', - '㍢' => '10点', - '㍣' => '11点', - '㍤' => '12点', - '㍥' => '13点', - '㍦' => '14点', - '㍧' => '15点', - '㍨' => '16点', - '㍩' => '17点', - '㍪' => '18点', - '㍫' => '19点', - '㍬' => '20点', - '㍭' => '21点', - '㍮' => '22点', - '㍯' => '23点', - '㍰' => '24点', - '㍱' => 'hPa', - '㍲' => 'da', - '㍳' => 'AU', - '㍴' => 'bar', - '㍵' => 'oV', - '㍶' => 'pc', - '㍷' => 'dm', - '㍸' => 'dm2', - '㍹' => 'dm3', - '㍺' => 'IU', - '㍻' => '平成', - '㍼' => '昭和', - '㍽' => '大正', - '㍾' => '明治', - '㍿' => '株式会社', - '㎀' => 'pA', - '㎁' => 'nA', - '㎂' => 'μA', - '㎃' => 'mA', - '㎄' => 'kA', - '㎅' => 'KB', - '㎆' => 'MB', - '㎇' => 'GB', - '㎈' => 'cal', - '㎉' => 'kcal', - '㎊' => 'pF', - '㎋' => 'nF', - '㎌' => 'μF', - '㎍' => 'μg', - '㎎' => 'mg', - '㎏' => 'kg', - '㎐' => 'Hz', - '㎑' => 'kHz', - '㎒' => 'MHz', - '㎓' => 'GHz', - '㎔' => 'THz', - '㎕' => 'μl', - '㎖' => 'ml', - '㎗' => 'dl', - '㎘' => 'kl', - '㎙' => 'fm', - '㎚' => 'nm', - '㎛' => 'μm', - '㎜' => 'mm', - '㎝' => 'cm', - '㎞' => 'km', - '㎟' => 'mm2', - '㎠' => 'cm2', - '㎡' => 'm2', - '㎢' => 'km2', - '㎣' => 'mm3', - '㎤' => 'cm3', - '㎥' => 'm3', - '㎦' => 'km3', - '㎧' => 'm∕s', - '㎨' => 'm∕s2', - '㎩' => 'Pa', - '㎪' => 'kPa', - '㎫' => 'MPa', - '㎬' => 'GPa', - '㎭' => 'rad', - '㎮' => 'rad∕s', - '㎯' => 'rad∕s2', - '㎰' => 'ps', - '㎱' => 'ns', - '㎲' => 'μs', - '㎳' => 'ms', - '㎴' => 'pV', - '㎵' => 'nV', - '㎶' => 'μV', - '㎷' => 'mV', - '㎸' => 'kV', - '㎹' => 'MV', - '㎺' => 'pW', - '㎻' => 'nW', - '㎼' => 'μW', - '㎽' => 'mW', - '㎾' => 'kW', - '㎿' => 'MW', - '㏀' => 'kΩ', - '㏁' => 'MΩ', - '㏂' => 'a.m.', - '㏃' => 'Bq', - '㏄' => 'cc', - '㏅' => 'cd', - '㏆' => 'C∕kg', - '㏇' => 'Co.', - '㏈' => 'dB', - '㏉' => 'Gy', - '㏊' => 'ha', - '㏋' => 'HP', - '㏌' => 'in', - '㏍' => 'KK', - '㏎' => 'KM', - '㏏' => 'kt', - '㏐' => 'lm', - '㏑' => 'ln', - '㏒' => 'log', - '㏓' => 'lx', - '㏔' => 'mb', - '㏕' => 'mil', - '㏖' => 'mol', - '㏗' => 'PH', - '㏘' => 'p.m.', - '㏙' => 'PPM', - '㏚' => 'PR', - '㏛' => 'sr', - '㏜' => 'Sv', - '㏝' => 'Wb', - '㏞' => 'V∕m', - '㏟' => 'A∕m', - '㏠' => '1日', - '㏡' => '2日', - '㏢' => '3日', - '㏣' => '4日', - '㏤' => '5日', - '㏥' => '6日', - '㏦' => '7日', - '㏧' => '8日', - '㏨' => '9日', - '㏩' => '10日', - '㏪' => '11日', - '㏫' => '12日', - '㏬' => '13日', - '㏭' => '14日', - '㏮' => '15日', - '㏯' => '16日', - '㏰' => '17日', - '㏱' => '18日', - '㏲' => '19日', - '㏳' => '20日', - '㏴' => '21日', - '㏵' => '22日', - '㏶' => '23日', - '㏷' => '24日', - '㏸' => '25日', - '㏹' => '26日', - '㏺' => '27日', - '㏻' => '28日', - '㏼' => '29日', - '㏽' => '30日', - '㏾' => '31日', - '㏿' => 'gal', - 'ꚜ' => 'ъ', - 'ꚝ' => 'ь', - 'ꝰ' => 'ꝯ', - 'ꟸ' => 'Ħ', - 'ꟹ' => 'œ', - 'ꭜ' => 'ꜧ', - 'ꭝ' => 'ꬷ', - 'ꭞ' => 'ɫ', - 'ꭟ' => 'ꭒ', - 'ꭩ' => 'ʍ', - 'ff' => 'ff', - 'fi' => 'fi', - 'fl' => 'fl', - 'ffi' => 'ffi', - 'ffl' => 'ffl', - 'ſt' => 'st', - 'st' => 'st', - 'ﬓ' => 'մն', - 'ﬔ' => 'մե', - 'ﬕ' => 'մի', - 'ﬖ' => 'վն', - 'ﬗ' => 'մխ', - 'ﬠ' => 'ע', - 'ﬡ' => 'א', - 'ﬢ' => 'ד', - 'ﬣ' => 'ה', - 'ﬤ' => 'כ', - 'ﬥ' => 'ל', - 'ﬦ' => 'ם', - 'ﬧ' => 'ר', - 'ﬨ' => 'ת', - '﬩' => '+', - 'ﭏ' => 'אל', - 'ﭐ' => 'ٱ', - 'ﭑ' => 'ٱ', - 'ﭒ' => 'ٻ', - 'ﭓ' => 'ٻ', - 'ﭔ' => 'ٻ', - 'ﭕ' => 'ٻ', - 'ﭖ' => 'پ', - 'ﭗ' => 'پ', - 'ﭘ' => 'پ', - 'ﭙ' => 'پ', - 'ﭚ' => 'ڀ', - 'ﭛ' => 'ڀ', - 'ﭜ' => 'ڀ', - 'ﭝ' => 'ڀ', - 'ﭞ' => 'ٺ', - 'ﭟ' => 'ٺ', - 'ﭠ' => 'ٺ', - 'ﭡ' => 'ٺ', - 'ﭢ' => 'ٿ', - 'ﭣ' => 'ٿ', - 'ﭤ' => 'ٿ', - 'ﭥ' => 'ٿ', - 'ﭦ' => 'ٹ', - 'ﭧ' => 'ٹ', - 'ﭨ' => 'ٹ', - 'ﭩ' => 'ٹ', - 'ﭪ' => 'ڤ', - 'ﭫ' => 'ڤ', - 'ﭬ' => 'ڤ', - 'ﭭ' => 'ڤ', - 'ﭮ' => 'ڦ', - 'ﭯ' => 'ڦ', - 'ﭰ' => 'ڦ', - 'ﭱ' => 'ڦ', - 'ﭲ' => 'ڄ', - 'ﭳ' => 'ڄ', - 'ﭴ' => 'ڄ', - 'ﭵ' => 'ڄ', - 'ﭶ' => 'ڃ', - 'ﭷ' => 'ڃ', - 'ﭸ' => 'ڃ', - 'ﭹ' => 'ڃ', - 'ﭺ' => 'چ', - 'ﭻ' => 'چ', - 'ﭼ' => 'چ', - 'ﭽ' => 'چ', - 'ﭾ' => 'ڇ', - 'ﭿ' => 'ڇ', - 'ﮀ' => 'ڇ', - 'ﮁ' => 'ڇ', - 'ﮂ' => 'ڍ', - 'ﮃ' => 'ڍ', - 'ﮄ' => 'ڌ', - 'ﮅ' => 'ڌ', - 'ﮆ' => 'ڎ', - 'ﮇ' => 'ڎ', - 'ﮈ' => 'ڈ', - 'ﮉ' => 'ڈ', - 'ﮊ' => 'ژ', - 'ﮋ' => 'ژ', - 'ﮌ' => 'ڑ', - 'ﮍ' => 'ڑ', - 'ﮎ' => 'ک', - 'ﮏ' => 'ک', - 'ﮐ' => 'ک', - 'ﮑ' => 'ک', - 'ﮒ' => 'گ', - 'ﮓ' => 'گ', - 'ﮔ' => 'گ', - 'ﮕ' => 'گ', - 'ﮖ' => 'ڳ', - 'ﮗ' => 'ڳ', - 'ﮘ' => 'ڳ', - 'ﮙ' => 'ڳ', - 'ﮚ' => 'ڱ', - 'ﮛ' => 'ڱ', - 'ﮜ' => 'ڱ', - 'ﮝ' => 'ڱ', - 'ﮞ' => 'ں', - 'ﮟ' => 'ں', - 'ﮠ' => 'ڻ', - 'ﮡ' => 'ڻ', - 'ﮢ' => 'ڻ', - 'ﮣ' => 'ڻ', - 'ﮤ' => 'ۀ', - 'ﮥ' => 'ۀ', - 'ﮦ' => 'ہ', - 'ﮧ' => 'ہ', - 'ﮨ' => 'ہ', - 'ﮩ' => 'ہ', - 'ﮪ' => 'ھ', - 'ﮫ' => 'ھ', - 'ﮬ' => 'ھ', - 'ﮭ' => 'ھ', - 'ﮮ' => 'ے', - 'ﮯ' => 'ے', - 'ﮰ' => 'ۓ', - 'ﮱ' => 'ۓ', - 'ﯓ' => 'ڭ', - 'ﯔ' => 'ڭ', - 'ﯕ' => 'ڭ', - 'ﯖ' => 'ڭ', - 'ﯗ' => 'ۇ', - 'ﯘ' => 'ۇ', - 'ﯙ' => 'ۆ', - 'ﯚ' => 'ۆ', - 'ﯛ' => 'ۈ', - 'ﯜ' => 'ۈ', - 'ﯝ' => 'ۇٴ', - 'ﯞ' => 'ۋ', - 'ﯟ' => 'ۋ', - 'ﯠ' => 'ۅ', - 'ﯡ' => 'ۅ', - 'ﯢ' => 'ۉ', - 'ﯣ' => 'ۉ', - 'ﯤ' => 'ې', - 'ﯥ' => 'ې', - 'ﯦ' => 'ې', - 'ﯧ' => 'ې', - 'ﯨ' => 'ى', - 'ﯩ' => 'ى', - 'ﯪ' => 'ئا', - 'ﯫ' => 'ئا', - 'ﯬ' => 'ئە', - 'ﯭ' => 'ئە', - 'ﯮ' => 'ئو', - 'ﯯ' => 'ئو', - 'ﯰ' => 'ئۇ', - 'ﯱ' => 'ئۇ', - 'ﯲ' => 'ئۆ', - 'ﯳ' => 'ئۆ', - 'ﯴ' => 'ئۈ', - 'ﯵ' => 'ئۈ', - 'ﯶ' => 'ئې', - 'ﯷ' => 'ئې', - 'ﯸ' => 'ئې', - 'ﯹ' => 'ئى', - 'ﯺ' => 'ئى', - 'ﯻ' => 'ئى', - 'ﯼ' => 'ی', - 'ﯽ' => 'ی', - 'ﯾ' => 'ی', - 'ﯿ' => 'ی', - 'ﰀ' => 'ئج', - 'ﰁ' => 'ئح', - 'ﰂ' => 'ئم', - 'ﰃ' => 'ئى', - 'ﰄ' => 'ئي', - 'ﰅ' => 'بج', - 'ﰆ' => 'بح', - 'ﰇ' => 'بخ', - 'ﰈ' => 'بم', - 'ﰉ' => 'بى', - 'ﰊ' => 'بي', - 'ﰋ' => 'تج', - 'ﰌ' => 'تح', - 'ﰍ' => 'تخ', - 'ﰎ' => 'تم', - 'ﰏ' => 'تى', - 'ﰐ' => 'تي', - 'ﰑ' => 'ثج', - 'ﰒ' => 'ثم', - 'ﰓ' => 'ثى', - 'ﰔ' => 'ثي', - 'ﰕ' => 'جح', - 'ﰖ' => 'جم', - 'ﰗ' => 'حج', - 'ﰘ' => 'حم', - 'ﰙ' => 'خج', - 'ﰚ' => 'خح', - 'ﰛ' => 'خم', - 'ﰜ' => 'سج', - 'ﰝ' => 'سح', - 'ﰞ' => 'سخ', - 'ﰟ' => 'سم', - 'ﰠ' => 'صح', - 'ﰡ' => 'صم', - 'ﰢ' => 'ضج', - 'ﰣ' => 'ضح', - 'ﰤ' => 'ضخ', - 'ﰥ' => 'ضم', - 'ﰦ' => 'طح', - 'ﰧ' => 'طم', - 'ﰨ' => 'ظم', - 'ﰩ' => 'عج', - 'ﰪ' => 'عم', - 'ﰫ' => 'غج', - 'ﰬ' => 'غم', - 'ﰭ' => 'فج', - 'ﰮ' => 'فح', - 'ﰯ' => 'فخ', - 'ﰰ' => 'فم', - 'ﰱ' => 'فى', - 'ﰲ' => 'في', - 'ﰳ' => 'قح', - 'ﰴ' => 'قم', - 'ﰵ' => 'قى', - 'ﰶ' => 'قي', - 'ﰷ' => 'كا', - 'ﰸ' => 'كج', - 'ﰹ' => 'كح', - 'ﰺ' => 'كخ', - 'ﰻ' => 'كل', - 'ﰼ' => 'كم', - 'ﰽ' => 'كى', - 'ﰾ' => 'كي', - 'ﰿ' => 'لج', - 'ﱀ' => 'لح', - 'ﱁ' => 'لخ', - 'ﱂ' => 'لم', - 'ﱃ' => 'لى', - 'ﱄ' => 'لي', - 'ﱅ' => 'مج', - 'ﱆ' => 'مح', - 'ﱇ' => 'مخ', - 'ﱈ' => 'مم', - 'ﱉ' => 'مى', - 'ﱊ' => 'مي', - 'ﱋ' => 'نج', - 'ﱌ' => 'نح', - 'ﱍ' => 'نخ', - 'ﱎ' => 'نم', - 'ﱏ' => 'نى', - 'ﱐ' => 'ني', - 'ﱑ' => 'هج', - 'ﱒ' => 'هم', - 'ﱓ' => 'هى', - 'ﱔ' => 'هي', - 'ﱕ' => 'يج', - 'ﱖ' => 'يح', - 'ﱗ' => 'يخ', - 'ﱘ' => 'يم', - 'ﱙ' => 'يى', - 'ﱚ' => 'يي', - 'ﱛ' => 'ذٰ', - 'ﱜ' => 'رٰ', - 'ﱝ' => 'ىٰ', - 'ﱞ' => ' ٌّ', - 'ﱟ' => ' ٍّ', - 'ﱠ' => ' َّ', - 'ﱡ' => ' ُّ', - 'ﱢ' => ' ِّ', - 'ﱣ' => ' ّٰ', - 'ﱤ' => 'ئر', - 'ﱥ' => 'ئز', - 'ﱦ' => 'ئم', - 'ﱧ' => 'ئن', - 'ﱨ' => 'ئى', - 'ﱩ' => 'ئي', - 'ﱪ' => 'بر', - 'ﱫ' => 'بز', - 'ﱬ' => 'بم', - 'ﱭ' => 'بن', - 'ﱮ' => 'بى', - 'ﱯ' => 'بي', - 'ﱰ' => 'تر', - 'ﱱ' => 'تز', - 'ﱲ' => 'تم', - 'ﱳ' => 'تن', - 'ﱴ' => 'تى', - 'ﱵ' => 'تي', - 'ﱶ' => 'ثر', - 'ﱷ' => 'ثز', - 'ﱸ' => 'ثم', - 'ﱹ' => 'ثن', - 'ﱺ' => 'ثى', - 'ﱻ' => 'ثي', - 'ﱼ' => 'فى', - 'ﱽ' => 'في', - 'ﱾ' => 'قى', - 'ﱿ' => 'قي', - 'ﲀ' => 'كا', - 'ﲁ' => 'كل', - 'ﲂ' => 'كم', - 'ﲃ' => 'كى', - 'ﲄ' => 'كي', - 'ﲅ' => 'لم', - 'ﲆ' => 'لى', - 'ﲇ' => 'لي', - 'ﲈ' => 'ما', - 'ﲉ' => 'مم', - 'ﲊ' => 'نر', - 'ﲋ' => 'نز', - 'ﲌ' => 'نم', - 'ﲍ' => 'نن', - 'ﲎ' => 'نى', - 'ﲏ' => 'ني', - 'ﲐ' => 'ىٰ', - 'ﲑ' => 'ير', - 'ﲒ' => 'يز', - 'ﲓ' => 'يم', - 'ﲔ' => 'ين', - 'ﲕ' => 'يى', - 'ﲖ' => 'يي', - 'ﲗ' => 'ئج', - 'ﲘ' => 'ئح', - 'ﲙ' => 'ئخ', - 'ﲚ' => 'ئم', - 'ﲛ' => 'ئه', - 'ﲜ' => 'بج', - 'ﲝ' => 'بح', - 'ﲞ' => 'بخ', - 'ﲟ' => 'بم', - 'ﲠ' => 'به', - 'ﲡ' => 'تج', - 'ﲢ' => 'تح', - 'ﲣ' => 'تخ', - 'ﲤ' => 'تم', - 'ﲥ' => 'ته', - 'ﲦ' => 'ثم', - 'ﲧ' => 'جح', - 'ﲨ' => 'جم', - 'ﲩ' => 'حج', - 'ﲪ' => 'حم', - 'ﲫ' => 'خج', - 'ﲬ' => 'خم', - 'ﲭ' => 'سج', - 'ﲮ' => 'سح', - 'ﲯ' => 'سخ', - 'ﲰ' => 'سم', - 'ﲱ' => 'صح', - 'ﲲ' => 'صخ', - 'ﲳ' => 'صم', - 'ﲴ' => 'ضج', - 'ﲵ' => 'ضح', - 'ﲶ' => 'ضخ', - 'ﲷ' => 'ضم', - 'ﲸ' => 'طح', - 'ﲹ' => 'ظم', - 'ﲺ' => 'عج', - 'ﲻ' => 'عم', - 'ﲼ' => 'غج', - 'ﲽ' => 'غم', - 'ﲾ' => 'فج', - 'ﲿ' => 'فح', - 'ﳀ' => 'فخ', - 'ﳁ' => 'فم', - 'ﳂ' => 'قح', - 'ﳃ' => 'قم', - 'ﳄ' => 'كج', - 'ﳅ' => 'كح', - 'ﳆ' => 'كخ', - 'ﳇ' => 'كل', - 'ﳈ' => 'كم', - 'ﳉ' => 'لج', - 'ﳊ' => 'لح', - 'ﳋ' => 'لخ', - 'ﳌ' => 'لم', - 'ﳍ' => 'له', - 'ﳎ' => 'مج', - 'ﳏ' => 'مح', - 'ﳐ' => 'مخ', - 'ﳑ' => 'مم', - 'ﳒ' => 'نج', - 'ﳓ' => 'نح', - 'ﳔ' => 'نخ', - 'ﳕ' => 'نم', - 'ﳖ' => 'نه', - 'ﳗ' => 'هج', - 'ﳘ' => 'هم', - 'ﳙ' => 'هٰ', - 'ﳚ' => 'يج', - 'ﳛ' => 'يح', - 'ﳜ' => 'يخ', - 'ﳝ' => 'يم', - 'ﳞ' => 'يه', - 'ﳟ' => 'ئم', - 'ﳠ' => 'ئه', - 'ﳡ' => 'بم', - 'ﳢ' => 'به', - 'ﳣ' => 'تم', - 'ﳤ' => 'ته', - 'ﳥ' => 'ثم', - 'ﳦ' => 'ثه', - 'ﳧ' => 'سم', - 'ﳨ' => 'سه', - 'ﳩ' => 'شم', - 'ﳪ' => 'شه', - 'ﳫ' => 'كل', - 'ﳬ' => 'كم', - 'ﳭ' => 'لم', - 'ﳮ' => 'نم', - 'ﳯ' => 'نه', - 'ﳰ' => 'يم', - 'ﳱ' => 'يه', - 'ﳲ' => 'ـَّ', - 'ﳳ' => 'ـُّ', - 'ﳴ' => 'ـِّ', - 'ﳵ' => 'طى', - 'ﳶ' => 'طي', - 'ﳷ' => 'عى', - 'ﳸ' => 'عي', - 'ﳹ' => 'غى', - 'ﳺ' => 'غي', - 'ﳻ' => 'سى', - 'ﳼ' => 'سي', - 'ﳽ' => 'شى', - 'ﳾ' => 'شي', - 'ﳿ' => 'حى', - 'ﴀ' => 'حي', - 'ﴁ' => 'جى', - 'ﴂ' => 'جي', - 'ﴃ' => 'خى', - 'ﴄ' => 'خي', - 'ﴅ' => 'صى', - 'ﴆ' => 'صي', - 'ﴇ' => 'ضى', - 'ﴈ' => 'ضي', - 'ﴉ' => 'شج', - 'ﴊ' => 'شح', - 'ﴋ' => 'شخ', - 'ﴌ' => 'شم', - 'ﴍ' => 'شر', - 'ﴎ' => 'سر', - 'ﴏ' => 'صر', - 'ﴐ' => 'ضر', - 'ﴑ' => 'طى', - 'ﴒ' => 'طي', - 'ﴓ' => 'عى', - 'ﴔ' => 'عي', - 'ﴕ' => 'غى', - 'ﴖ' => 'غي', - 'ﴗ' => 'سى', - 'ﴘ' => 'سي', - 'ﴙ' => 'شى', - 'ﴚ' => 'شي', - 'ﴛ' => 'حى', - 'ﴜ' => 'حي', - 'ﴝ' => 'جى', - 'ﴞ' => 'جي', - 'ﴟ' => 'خى', - 'ﴠ' => 'خي', - 'ﴡ' => 'صى', - 'ﴢ' => 'صي', - 'ﴣ' => 'ضى', - 'ﴤ' => 'ضي', - 'ﴥ' => 'شج', - 'ﴦ' => 'شح', - 'ﴧ' => 'شخ', - 'ﴨ' => 'شم', - 'ﴩ' => 'شر', - 'ﴪ' => 'سر', - 'ﴫ' => 'صر', - 'ﴬ' => 'ضر', - 'ﴭ' => 'شج', - 'ﴮ' => 'شح', - 'ﴯ' => 'شخ', - 'ﴰ' => 'شم', - 'ﴱ' => 'سه', - 'ﴲ' => 'شه', - 'ﴳ' => 'طم', - 'ﴴ' => 'سج', - 'ﴵ' => 'سح', - 'ﴶ' => 'سخ', - 'ﴷ' => 'شج', - 'ﴸ' => 'شح', - 'ﴹ' => 'شخ', - 'ﴺ' => 'طم', - 'ﴻ' => 'ظم', - 'ﴼ' => 'اً', - 'ﴽ' => 'اً', - 'ﵐ' => 'تجم', - 'ﵑ' => 'تحج', - 'ﵒ' => 'تحج', - 'ﵓ' => 'تحم', - 'ﵔ' => 'تخم', - 'ﵕ' => 'تمج', - 'ﵖ' => 'تمح', - 'ﵗ' => 'تمخ', - 'ﵘ' => 'جمح', - 'ﵙ' => 'جمح', - 'ﵚ' => 'حمي', - 'ﵛ' => 'حمى', - 'ﵜ' => 'سحج', - 'ﵝ' => 'سجح', - 'ﵞ' => 'سجى', - 'ﵟ' => 'سمح', - 'ﵠ' => 'سمح', - 'ﵡ' => 'سمج', - 'ﵢ' => 'سمم', - 'ﵣ' => 'سمم', - 'ﵤ' => 'صحح', - 'ﵥ' => 'صحح', - 'ﵦ' => 'صمم', - 'ﵧ' => 'شحم', - 'ﵨ' => 'شحم', - 'ﵩ' => 'شجي', - 'ﵪ' => 'شمخ', - 'ﵫ' => 'شمخ', - 'ﵬ' => 'شمم', - 'ﵭ' => 'شمم', - 'ﵮ' => 'ضحى', - 'ﵯ' => 'ضخم', - 'ﵰ' => 'ضخم', - 'ﵱ' => 'طمح', - 'ﵲ' => 'طمح', - 'ﵳ' => 'طمم', - 'ﵴ' => 'طمي', - 'ﵵ' => 'عجم', - 'ﵶ' => 'عمم', - 'ﵷ' => 'عمم', - 'ﵸ' => 'عمى', - 'ﵹ' => 'غمم', - 'ﵺ' => 'غمي', - 'ﵻ' => 'غمى', - 'ﵼ' => 'فخم', - 'ﵽ' => 'فخم', - 'ﵾ' => 'قمح', - 'ﵿ' => 'قمم', - 'ﶀ' => 'لحم', - 'ﶁ' => 'لحي', - 'ﶂ' => 'لحى', - 'ﶃ' => 'لجج', - 'ﶄ' => 'لجج', - 'ﶅ' => 'لخم', - 'ﶆ' => 'لخم', - 'ﶇ' => 'لمح', - 'ﶈ' => 'لمح', - 'ﶉ' => 'محج', - 'ﶊ' => 'محم', - 'ﶋ' => 'محي', - 'ﶌ' => 'مجح', - 'ﶍ' => 'مجم', - 'ﶎ' => 'مخج', - 'ﶏ' => 'مخم', - 'ﶒ' => 'مجخ', - 'ﶓ' => 'همج', - 'ﶔ' => 'همم', - 'ﶕ' => 'نحم', - 'ﶖ' => 'نحى', - 'ﶗ' => 'نجم', - 'ﶘ' => 'نجم', - 'ﶙ' => 'نجى', - 'ﶚ' => 'نمي', - 'ﶛ' => 'نمى', - 'ﶜ' => 'يمم', - 'ﶝ' => 'يمم', - 'ﶞ' => 'بخي', - 'ﶟ' => 'تجي', - 'ﶠ' => 'تجى', - 'ﶡ' => 'تخي', - 'ﶢ' => 'تخى', - 'ﶣ' => 'تمي', - 'ﶤ' => 'تمى', - 'ﶥ' => 'جمي', - 'ﶦ' => 'جحى', - 'ﶧ' => 'جمى', - 'ﶨ' => 'سخى', - 'ﶩ' => 'صحي', - 'ﶪ' => 'شحي', - 'ﶫ' => 'ضحي', - 'ﶬ' => 'لجي', - 'ﶭ' => 'لمي', - 'ﶮ' => 'يحي', - 'ﶯ' => 'يجي', - 'ﶰ' => 'يمي', - 'ﶱ' => 'ممي', - 'ﶲ' => 'قمي', - 'ﶳ' => 'نحي', - 'ﶴ' => 'قمح', - 'ﶵ' => 'لحم', - 'ﶶ' => 'عمي', - 'ﶷ' => 'كمي', - 'ﶸ' => 'نجح', - 'ﶹ' => 'مخي', - 'ﶺ' => 'لجم', - 'ﶻ' => 'كمم', - 'ﶼ' => 'لجم', - 'ﶽ' => 'نجح', - 'ﶾ' => 'جحي', - 'ﶿ' => 'حجي', - 'ﷀ' => 'مجي', - 'ﷁ' => 'فمي', - 'ﷂ' => 'بحي', - 'ﷃ' => 'كمم', - 'ﷄ' => 'عجم', - 'ﷅ' => 'صمم', - 'ﷆ' => 'سخي', - 'ﷇ' => 'نجي', - 'ﷰ' => 'صلے', - 'ﷱ' => 'قلے', - 'ﷲ' => 'الله', - 'ﷳ' => 'اكبر', - 'ﷴ' => 'محمد', - 'ﷵ' => 'صلعم', - 'ﷶ' => 'رسول', - 'ﷷ' => 'عليه', - 'ﷸ' => 'وسلم', - 'ﷹ' => 'صلى', - 'ﷺ' => 'صلى الله عليه وسلم', - 'ﷻ' => 'جل جلاله', - '﷼' => 'ریال', - '︐' => ',', - '︑' => '、', - '︒' => '。', - '︓' => ':', - '︔' => ';', - '︕' => '!', - '︖' => '?', - '︗' => '〖', - '︘' => '〗', - '︙' => '...', - '︰' => '..', - '︱' => '—', - '︲' => '–', - '︳' => '_', - '︴' => '_', - '︵' => '(', - '︶' => ')', - '︷' => '{', - '︸' => '}', - '︹' => '〔', - '︺' => '〕', - '︻' => '【', - '︼' => '】', - '︽' => '《', - '︾' => '》', - '︿' => '〈', - '﹀' => '〉', - '﹁' => '「', - '﹂' => '」', - '﹃' => '『', - '﹄' => '』', - '﹇' => '[', - '﹈' => ']', - '﹉' => ' ̅', - '﹊' => ' ̅', - '﹋' => ' ̅', - '﹌' => ' ̅', - '﹍' => '_', - '﹎' => '_', - '﹏' => '_', - '﹐' => ',', - '﹑' => '、', - '﹒' => '.', - '﹔' => ';', - '﹕' => ':', - '﹖' => '?', - '﹗' => '!', - '﹘' => '—', - '﹙' => '(', - '﹚' => ')', - '﹛' => '{', - '﹜' => '}', - '﹝' => '〔', - '﹞' => '〕', - '﹟' => '#', - '﹠' => '&', - '﹡' => '*', - '﹢' => '+', - '﹣' => '-', - '﹤' => '<', - '﹥' => '>', - '﹦' => '=', - '﹨' => '\\', - '﹩' => '$', - '﹪' => '%', - '﹫' => '@', - 'ﹰ' => ' ً', - 'ﹱ' => 'ـً', - 'ﹲ' => ' ٌ', - 'ﹴ' => ' ٍ', - 'ﹶ' => ' َ', - 'ﹷ' => 'ـَ', - 'ﹸ' => ' ُ', - 'ﹹ' => 'ـُ', - 'ﹺ' => ' ِ', - 'ﹻ' => 'ـِ', - 'ﹼ' => ' ّ', - 'ﹽ' => 'ـّ', - 'ﹾ' => ' ْ', - 'ﹿ' => 'ـْ', - 'ﺀ' => 'ء', - 'ﺁ' => 'آ', - 'ﺂ' => 'آ', - 'ﺃ' => 'أ', - 'ﺄ' => 'أ', - 'ﺅ' => 'ؤ', - 'ﺆ' => 'ؤ', - 'ﺇ' => 'إ', - 'ﺈ' => 'إ', - 'ﺉ' => 'ئ', - 'ﺊ' => 'ئ', - 'ﺋ' => 'ئ', - 'ﺌ' => 'ئ', - 'ﺍ' => 'ا', - 'ﺎ' => 'ا', - 'ﺏ' => 'ب', - 'ﺐ' => 'ب', - 'ﺑ' => 'ب', - 'ﺒ' => 'ب', - 'ﺓ' => 'ة', - 'ﺔ' => 'ة', - 'ﺕ' => 'ت', - 'ﺖ' => 'ت', - 'ﺗ' => 'ت', - 'ﺘ' => 'ت', - 'ﺙ' => 'ث', - 'ﺚ' => 'ث', - 'ﺛ' => 'ث', - 'ﺜ' => 'ث', - 'ﺝ' => 'ج', - 'ﺞ' => 'ج', - 'ﺟ' => 'ج', - 'ﺠ' => 'ج', - 'ﺡ' => 'ح', - 'ﺢ' => 'ح', - 'ﺣ' => 'ح', - 'ﺤ' => 'ح', - 'ﺥ' => 'خ', - 'ﺦ' => 'خ', - 'ﺧ' => 'خ', - 'ﺨ' => 'خ', - 'ﺩ' => 'د', - 'ﺪ' => 'د', - 'ﺫ' => 'ذ', - 'ﺬ' => 'ذ', - 'ﺭ' => 'ر', - 'ﺮ' => 'ر', - 'ﺯ' => 'ز', - 'ﺰ' => 'ز', - 'ﺱ' => 'س', - 'ﺲ' => 'س', - 'ﺳ' => 'س', - 'ﺴ' => 'س', - 'ﺵ' => 'ش', - 'ﺶ' => 'ش', - 'ﺷ' => 'ش', - 'ﺸ' => 'ش', - 'ﺹ' => 'ص', - 'ﺺ' => 'ص', - 'ﺻ' => 'ص', - 'ﺼ' => 'ص', - 'ﺽ' => 'ض', - 'ﺾ' => 'ض', - 'ﺿ' => 'ض', - 'ﻀ' => 'ض', - 'ﻁ' => 'ط', - 'ﻂ' => 'ط', - 'ﻃ' => 'ط', - 'ﻄ' => 'ط', - 'ﻅ' => 'ظ', - 'ﻆ' => 'ظ', - 'ﻇ' => 'ظ', - 'ﻈ' => 'ظ', - 'ﻉ' => 'ع', - 'ﻊ' => 'ع', - 'ﻋ' => 'ع', - 'ﻌ' => 'ع', - 'ﻍ' => 'غ', - 'ﻎ' => 'غ', - 'ﻏ' => 'غ', - 'ﻐ' => 'غ', - 'ﻑ' => 'ف', - 'ﻒ' => 'ف', - 'ﻓ' => 'ف', - 'ﻔ' => 'ف', - 'ﻕ' => 'ق', - 'ﻖ' => 'ق', - 'ﻗ' => 'ق', - 'ﻘ' => 'ق', - 'ﻙ' => 'ك', - 'ﻚ' => 'ك', - 'ﻛ' => 'ك', - 'ﻜ' => 'ك', - 'ﻝ' => 'ل', - 'ﻞ' => 'ل', - 'ﻟ' => 'ل', - 'ﻠ' => 'ل', - 'ﻡ' => 'م', - 'ﻢ' => 'م', - 'ﻣ' => 'م', - 'ﻤ' => 'م', - 'ﻥ' => 'ن', - 'ﻦ' => 'ن', - 'ﻧ' => 'ن', - 'ﻨ' => 'ن', - 'ﻩ' => 'ه', - 'ﻪ' => 'ه', - 'ﻫ' => 'ه', - 'ﻬ' => 'ه', - 'ﻭ' => 'و', - 'ﻮ' => 'و', - 'ﻯ' => 'ى', - 'ﻰ' => 'ى', - 'ﻱ' => 'ي', - 'ﻲ' => 'ي', - 'ﻳ' => 'ي', - 'ﻴ' => 'ي', - 'ﻵ' => 'لآ', - 'ﻶ' => 'لآ', - 'ﻷ' => 'لأ', - 'ﻸ' => 'لأ', - 'ﻹ' => 'لإ', - 'ﻺ' => 'لإ', - 'ﻻ' => 'لا', - 'ﻼ' => 'لا', - '!' => '!', - '"' => '"', - '#' => '#', - '$' => '$', - '%' => '%', - '&' => '&', - ''' => '\'', - '(' => '(', - ')' => ')', - '*' => '*', - '+' => '+', - ',' => ',', - '-' => '-', - '.' => '.', - '/' => '/', - '0' => '0', - '1' => '1', - '2' => '2', - '3' => '3', - '4' => '4', - '5' => '5', - '6' => '6', - '7' => '7', - '8' => '8', - '9' => '9', - ':' => ':', - ';' => ';', - '<' => '<', - '=' => '=', - '>' => '>', - '?' => '?', - '@' => '@', - 'A' => 'A', - 'B' => 'B', - 'C' => 'C', - 'D' => 'D', - 'E' => 'E', - 'F' => 'F', - 'G' => 'G', - 'H' => 'H', - 'I' => 'I', - 'J' => 'J', - 'K' => 'K', - 'L' => 'L', - 'M' => 'M', - 'N' => 'N', - 'O' => 'O', - 'P' => 'P', - 'Q' => 'Q', - 'R' => 'R', - 'S' => 'S', - 'T' => 'T', - 'U' => 'U', - 'V' => 'V', - 'W' => 'W', - 'X' => 'X', - 'Y' => 'Y', - 'Z' => 'Z', - '[' => '[', - '\' => '\\', - ']' => ']', - '^' => '^', - '_' => '_', - '`' => '`', - 'a' => 'a', - 'b' => 'b', - 'c' => 'c', - 'd' => 'd', - 'e' => 'e', - 'f' => 'f', - 'g' => 'g', - 'h' => 'h', - 'i' => 'i', - 'j' => 'j', - 'k' => 'k', - 'l' => 'l', - 'm' => 'm', - 'n' => 'n', - 'o' => 'o', - 'p' => 'p', - 'q' => 'q', - 'r' => 'r', - 's' => 's', - 't' => 't', - 'u' => 'u', - 'v' => 'v', - 'w' => 'w', - 'x' => 'x', - 'y' => 'y', - 'z' => 'z', - '{' => '{', - '|' => '|', - '}' => '}', - '~' => '~', - '⦅' => '⦅', - '⦆' => '⦆', - '。' => '。', - '「' => '「', - '」' => '」', - '、' => '、', - '・' => '・', - 'ヲ' => 'ヲ', - 'ァ' => 'ァ', - 'ィ' => 'ィ', - 'ゥ' => 'ゥ', - 'ェ' => 'ェ', - 'ォ' => 'ォ', - 'ャ' => 'ャ', - 'ュ' => 'ュ', - 'ョ' => 'ョ', - 'ッ' => 'ッ', - 'ー' => 'ー', - 'ア' => 'ア', - 'イ' => 'イ', - 'ウ' => 'ウ', - 'エ' => 'エ', - 'オ' => 'オ', - 'カ' => 'カ', - 'キ' => 'キ', - 'ク' => 'ク', - 'ケ' => 'ケ', - 'コ' => 'コ', - 'サ' => 'サ', - 'シ' => 'シ', - 'ス' => 'ス', - 'セ' => 'セ', - 'ソ' => 'ソ', - 'タ' => 'タ', - 'チ' => 'チ', - 'ツ' => 'ツ', - 'テ' => 'テ', - 'ト' => 'ト', - 'ナ' => 'ナ', - 'ニ' => 'ニ', - 'ヌ' => 'ヌ', - 'ネ' => 'ネ', - 'ノ' => 'ノ', - 'ハ' => 'ハ', - 'ヒ' => 'ヒ', - 'フ' => 'フ', - 'ヘ' => 'ヘ', - 'ホ' => 'ホ', - 'マ' => 'マ', - 'ミ' => 'ミ', - 'ム' => 'ム', - 'メ' => 'メ', - 'モ' => 'モ', - 'ヤ' => 'ヤ', - 'ユ' => 'ユ', - 'ヨ' => 'ヨ', - 'ラ' => 'ラ', - 'リ' => 'リ', - 'ル' => 'ル', - 'レ' => 'レ', - 'ロ' => 'ロ', - 'ワ' => 'ワ', - 'ン' => 'ン', - '゙' => '゙', - '゚' => '゚', - 'ᅠ' => 'ᅠ', - 'ᄀ' => 'ᄀ', - 'ᄁ' => 'ᄁ', - 'ᆪ' => 'ᆪ', - 'ᄂ' => 'ᄂ', - 'ᆬ' => 'ᆬ', - 'ᆭ' => 'ᆭ', - 'ᄃ' => 'ᄃ', - 'ᄄ' => 'ᄄ', - 'ᄅ' => 'ᄅ', - 'ᆰ' => 'ᆰ', - 'ᆱ' => 'ᆱ', - 'ᆲ' => 'ᆲ', - 'ᆳ' => 'ᆳ', - 'ᆴ' => 'ᆴ', - 'ᆵ' => 'ᆵ', - 'ᄚ' => 'ᄚ', - 'ᄆ' => 'ᄆ', - 'ᄇ' => 'ᄇ', - 'ᄈ' => 'ᄈ', - 'ᄡ' => 'ᄡ', - 'ᄉ' => 'ᄉ', - 'ᄊ' => 'ᄊ', - 'ᄋ' => 'ᄋ', - 'ᄌ' => 'ᄌ', - 'ᄍ' => 'ᄍ', - 'ᄎ' => 'ᄎ', - 'ᄏ' => 'ᄏ', - 'ᄐ' => 'ᄐ', - 'ᄑ' => 'ᄑ', - 'ᄒ' => 'ᄒ', - 'ᅡ' => 'ᅡ', - 'ᅢ' => 'ᅢ', - 'ᅣ' => 'ᅣ', - 'ᅤ' => 'ᅤ', - 'ᅥ' => 'ᅥ', - 'ᅦ' => 'ᅦ', - 'ᅧ' => 'ᅧ', - 'ᅨ' => 'ᅨ', - 'ᅩ' => 'ᅩ', - 'ᅪ' => 'ᅪ', - 'ᅫ' => 'ᅫ', - 'ᅬ' => 'ᅬ', - 'ᅭ' => 'ᅭ', - 'ᅮ' => 'ᅮ', - 'ᅯ' => 'ᅯ', - 'ᅰ' => 'ᅰ', - 'ᅱ' => 'ᅱ', - 'ᅲ' => 'ᅲ', - 'ᅳ' => 'ᅳ', - 'ᅴ' => 'ᅴ', - 'ᅵ' => 'ᅵ', - '¢' => '¢', - '£' => '£', - '¬' => '¬', - ' ̄' => ' ̄', - '¦' => '¦', - '¥' => '¥', - '₩' => '₩', - '│' => '│', - '←' => '←', - '↑' => '↑', - '→' => '→', - '↓' => '↓', - '■' => '■', - '○' => '○', - '𝐀' => 'A', - '𝐁' => 'B', - '𝐂' => 'C', - '𝐃' => 'D', - '𝐄' => 'E', - '𝐅' => 'F', - '𝐆' => 'G', - '𝐇' => 'H', - '𝐈' => 'I', - '𝐉' => 'J', - '𝐊' => 'K', - '𝐋' => 'L', - '𝐌' => 'M', - '𝐍' => 'N', - '𝐎' => 'O', - '𝐏' => 'P', - '𝐐' => 'Q', - '𝐑' => 'R', - '𝐒' => 'S', - '𝐓' => 'T', - '𝐔' => 'U', - '𝐕' => 'V', - '𝐖' => 'W', - '𝐗' => 'X', - '𝐘' => 'Y', - '𝐙' => 'Z', - '𝐚' => 'a', - '𝐛' => 'b', - '𝐜' => 'c', - '𝐝' => 'd', - '𝐞' => 'e', - '𝐟' => 'f', - '𝐠' => 'g', - '𝐡' => 'h', - '𝐢' => 'i', - '𝐣' => 'j', - '𝐤' => 'k', - '𝐥' => 'l', - '𝐦' => 'm', - '𝐧' => 'n', - '𝐨' => 'o', - '𝐩' => 'p', - '𝐪' => 'q', - '𝐫' => 'r', - '𝐬' => 's', - '𝐭' => 't', - '𝐮' => 'u', - '𝐯' => 'v', - '𝐰' => 'w', - '𝐱' => 'x', - '𝐲' => 'y', - '𝐳' => 'z', - '𝐴' => 'A', - '𝐵' => 'B', - '𝐶' => 'C', - '𝐷' => 'D', - '𝐸' => 'E', - '𝐹' => 'F', - '𝐺' => 'G', - '𝐻' => 'H', - '𝐼' => 'I', - '𝐽' => 'J', - '𝐾' => 'K', - '𝐿' => 'L', - '𝑀' => 'M', - '𝑁' => 'N', - '𝑂' => 'O', - '𝑃' => 'P', - '𝑄' => 'Q', - '𝑅' => 'R', - '𝑆' => 'S', - '𝑇' => 'T', - '𝑈' => 'U', - '𝑉' => 'V', - '𝑊' => 'W', - '𝑋' => 'X', - '𝑌' => 'Y', - '𝑍' => 'Z', - '𝑎' => 'a', - '𝑏' => 'b', - '𝑐' => 'c', - '𝑑' => 'd', - '𝑒' => 'e', - '𝑓' => 'f', - '𝑔' => 'g', - '𝑖' => 'i', - '𝑗' => 'j', - '𝑘' => 'k', - '𝑙' => 'l', - '𝑚' => 'm', - '𝑛' => 'n', - '𝑜' => 'o', - '𝑝' => 'p', - '𝑞' => 'q', - '𝑟' => 'r', - '𝑠' => 's', - '𝑡' => 't', - '𝑢' => 'u', - '𝑣' => 'v', - '𝑤' => 'w', - '𝑥' => 'x', - '𝑦' => 'y', - '𝑧' => 'z', - '𝑨' => 'A', - '𝑩' => 'B', - '𝑪' => 'C', - '𝑫' => 'D', - '𝑬' => 'E', - '𝑭' => 'F', - '𝑮' => 'G', - '𝑯' => 'H', - '𝑰' => 'I', - '𝑱' => 'J', - '𝑲' => 'K', - '𝑳' => 'L', - '𝑴' => 'M', - '𝑵' => 'N', - '𝑶' => 'O', - '𝑷' => 'P', - '𝑸' => 'Q', - '𝑹' => 'R', - '𝑺' => 'S', - '𝑻' => 'T', - '𝑼' => 'U', - '𝑽' => 'V', - '𝑾' => 'W', - '𝑿' => 'X', - '𝒀' => 'Y', - '𝒁' => 'Z', - '𝒂' => 'a', - '𝒃' => 'b', - '𝒄' => 'c', - '𝒅' => 'd', - '𝒆' => 'e', - '𝒇' => 'f', - '𝒈' => 'g', - '𝒉' => 'h', - '𝒊' => 'i', - '𝒋' => 'j', - '𝒌' => 'k', - '𝒍' => 'l', - '𝒎' => 'm', - '𝒏' => 'n', - '𝒐' => 'o', - '𝒑' => 'p', - '𝒒' => 'q', - '𝒓' => 'r', - '𝒔' => 's', - '𝒕' => 't', - '𝒖' => 'u', - '𝒗' => 'v', - '𝒘' => 'w', - '𝒙' => 'x', - '𝒚' => 'y', - '𝒛' => 'z', - '𝒜' => 'A', - '𝒞' => 'C', - '𝒟' => 'D', - '𝒢' => 'G', - '𝒥' => 'J', - '𝒦' => 'K', - '𝒩' => 'N', - '𝒪' => 'O', - '𝒫' => 'P', - '𝒬' => 'Q', - '𝒮' => 'S', - '𝒯' => 'T', - '𝒰' => 'U', - '𝒱' => 'V', - '𝒲' => 'W', - '𝒳' => 'X', - '𝒴' => 'Y', - '𝒵' => 'Z', - '𝒶' => 'a', - '𝒷' => 'b', - '𝒸' => 'c', - '𝒹' => 'd', - '𝒻' => 'f', - '𝒽' => 'h', - '𝒾' => 'i', - '𝒿' => 'j', - '𝓀' => 'k', - '𝓁' => 'l', - '𝓂' => 'm', - '𝓃' => 'n', - '𝓅' => 'p', - '𝓆' => 'q', - '𝓇' => 'r', - '𝓈' => 's', - '𝓉' => 't', - '𝓊' => 'u', - '𝓋' => 'v', - '𝓌' => 'w', - '𝓍' => 'x', - '𝓎' => 'y', - '𝓏' => 'z', - '𝓐' => 'A', - '𝓑' => 'B', - '𝓒' => 'C', - '𝓓' => 'D', - '𝓔' => 'E', - '𝓕' => 'F', - '𝓖' => 'G', - '𝓗' => 'H', - '𝓘' => 'I', - '𝓙' => 'J', - '𝓚' => 'K', - '𝓛' => 'L', - '𝓜' => 'M', - '𝓝' => 'N', - '𝓞' => 'O', - '𝓟' => 'P', - '𝓠' => 'Q', - '𝓡' => 'R', - '𝓢' => 'S', - '𝓣' => 'T', - '𝓤' => 'U', - '𝓥' => 'V', - '𝓦' => 'W', - '𝓧' => 'X', - '𝓨' => 'Y', - '𝓩' => 'Z', - '𝓪' => 'a', - '𝓫' => 'b', - '𝓬' => 'c', - '𝓭' => 'd', - '𝓮' => 'e', - '𝓯' => 'f', - '𝓰' => 'g', - '𝓱' => 'h', - '𝓲' => 'i', - '𝓳' => 'j', - '𝓴' => 'k', - '𝓵' => 'l', - '𝓶' => 'm', - '𝓷' => 'n', - '𝓸' => 'o', - '𝓹' => 'p', - '𝓺' => 'q', - '𝓻' => 'r', - '𝓼' => 's', - '𝓽' => 't', - '𝓾' => 'u', - '𝓿' => 'v', - '𝔀' => 'w', - '𝔁' => 'x', - '𝔂' => 'y', - '𝔃' => 'z', - '𝔄' => 'A', - '𝔅' => 'B', - '𝔇' => 'D', - '𝔈' => 'E', - '𝔉' => 'F', - '𝔊' => 'G', - '𝔍' => 'J', - '𝔎' => 'K', - '𝔏' => 'L', - '𝔐' => 'M', - '𝔑' => 'N', - '𝔒' => 'O', - '𝔓' => 'P', - '𝔔' => 'Q', - '𝔖' => 'S', - '𝔗' => 'T', - '𝔘' => 'U', - '𝔙' => 'V', - '𝔚' => 'W', - '𝔛' => 'X', - '𝔜' => 'Y', - '𝔞' => 'a', - '𝔟' => 'b', - '𝔠' => 'c', - '𝔡' => 'd', - '𝔢' => 'e', - '𝔣' => 'f', - '𝔤' => 'g', - '𝔥' => 'h', - '𝔦' => 'i', - '𝔧' => 'j', - '𝔨' => 'k', - '𝔩' => 'l', - '𝔪' => 'm', - '𝔫' => 'n', - '𝔬' => 'o', - '𝔭' => 'p', - '𝔮' => 'q', - '𝔯' => 'r', - '𝔰' => 's', - '𝔱' => 't', - '𝔲' => 'u', - '𝔳' => 'v', - '𝔴' => 'w', - '𝔵' => 'x', - '𝔶' => 'y', - '𝔷' => 'z', - '𝔸' => 'A', - '𝔹' => 'B', - '𝔻' => 'D', - '𝔼' => 'E', - '𝔽' => 'F', - '𝔾' => 'G', - '𝕀' => 'I', - '𝕁' => 'J', - '𝕂' => 'K', - '𝕃' => 'L', - '𝕄' => 'M', - '𝕆' => 'O', - '𝕊' => 'S', - '𝕋' => 'T', - '𝕌' => 'U', - '𝕍' => 'V', - '𝕎' => 'W', - '𝕏' => 'X', - '𝕐' => 'Y', - '𝕒' => 'a', - '𝕓' => 'b', - '𝕔' => 'c', - '𝕕' => 'd', - '𝕖' => 'e', - '𝕗' => 'f', - '𝕘' => 'g', - '𝕙' => 'h', - '𝕚' => 'i', - '𝕛' => 'j', - '𝕜' => 'k', - '𝕝' => 'l', - '𝕞' => 'm', - '𝕟' => 'n', - '𝕠' => 'o', - '𝕡' => 'p', - '𝕢' => 'q', - '𝕣' => 'r', - '𝕤' => 's', - '𝕥' => 't', - '𝕦' => 'u', - '𝕧' => 'v', - '𝕨' => 'w', - '𝕩' => 'x', - '𝕪' => 'y', - '𝕫' => 'z', - '𝕬' => 'A', - '𝕭' => 'B', - '𝕮' => 'C', - '𝕯' => 'D', - '𝕰' => 'E', - '𝕱' => 'F', - '𝕲' => 'G', - '𝕳' => 'H', - '𝕴' => 'I', - '𝕵' => 'J', - '𝕶' => 'K', - '𝕷' => 'L', - '𝕸' => 'M', - '𝕹' => 'N', - '𝕺' => 'O', - '𝕻' => 'P', - '𝕼' => 'Q', - '𝕽' => 'R', - '𝕾' => 'S', - '𝕿' => 'T', - '𝖀' => 'U', - '𝖁' => 'V', - '𝖂' => 'W', - '𝖃' => 'X', - '𝖄' => 'Y', - '𝖅' => 'Z', - '𝖆' => 'a', - '𝖇' => 'b', - '𝖈' => 'c', - '𝖉' => 'd', - '𝖊' => 'e', - '𝖋' => 'f', - '𝖌' => 'g', - '𝖍' => 'h', - '𝖎' => 'i', - '𝖏' => 'j', - '𝖐' => 'k', - '𝖑' => 'l', - '𝖒' => 'm', - '𝖓' => 'n', - '𝖔' => 'o', - '𝖕' => 'p', - '𝖖' => 'q', - '𝖗' => 'r', - '𝖘' => 's', - '𝖙' => 't', - '𝖚' => 'u', - '𝖛' => 'v', - '𝖜' => 'w', - '𝖝' => 'x', - '𝖞' => 'y', - '𝖟' => 'z', - '𝖠' => 'A', - '𝖡' => 'B', - '𝖢' => 'C', - '𝖣' => 'D', - '𝖤' => 'E', - '𝖥' => 'F', - '𝖦' => 'G', - '𝖧' => 'H', - '𝖨' => 'I', - '𝖩' => 'J', - '𝖪' => 'K', - '𝖫' => 'L', - '𝖬' => 'M', - '𝖭' => 'N', - '𝖮' => 'O', - '𝖯' => 'P', - '𝖰' => 'Q', - '𝖱' => 'R', - '𝖲' => 'S', - '𝖳' => 'T', - '𝖴' => 'U', - '𝖵' => 'V', - '𝖶' => 'W', - '𝖷' => 'X', - '𝖸' => 'Y', - '𝖹' => 'Z', - '𝖺' => 'a', - '𝖻' => 'b', - '𝖼' => 'c', - '𝖽' => 'd', - '𝖾' => 'e', - '𝖿' => 'f', - '𝗀' => 'g', - '𝗁' => 'h', - '𝗂' => 'i', - '𝗃' => 'j', - '𝗄' => 'k', - '𝗅' => 'l', - '𝗆' => 'm', - '𝗇' => 'n', - '𝗈' => 'o', - '𝗉' => 'p', - '𝗊' => 'q', - '𝗋' => 'r', - '𝗌' => 's', - '𝗍' => 't', - '𝗎' => 'u', - '𝗏' => 'v', - '𝗐' => 'w', - '𝗑' => 'x', - '𝗒' => 'y', - '𝗓' => 'z', - '𝗔' => 'A', - '𝗕' => 'B', - '𝗖' => 'C', - '𝗗' => 'D', - '𝗘' => 'E', - '𝗙' => 'F', - '𝗚' => 'G', - '𝗛' => 'H', - '𝗜' => 'I', - '𝗝' => 'J', - '𝗞' => 'K', - '𝗟' => 'L', - '𝗠' => 'M', - '𝗡' => 'N', - '𝗢' => 'O', - '𝗣' => 'P', - '𝗤' => 'Q', - '𝗥' => 'R', - '𝗦' => 'S', - '𝗧' => 'T', - '𝗨' => 'U', - '𝗩' => 'V', - '𝗪' => 'W', - '𝗫' => 'X', - '𝗬' => 'Y', - '𝗭' => 'Z', - '𝗮' => 'a', - '𝗯' => 'b', - '𝗰' => 'c', - '𝗱' => 'd', - '𝗲' => 'e', - '𝗳' => 'f', - '𝗴' => 'g', - '𝗵' => 'h', - '𝗶' => 'i', - '𝗷' => 'j', - '𝗸' => 'k', - '𝗹' => 'l', - '𝗺' => 'm', - '𝗻' => 'n', - '𝗼' => 'o', - '𝗽' => 'p', - '𝗾' => 'q', - '𝗿' => 'r', - '𝘀' => 's', - '𝘁' => 't', - '𝘂' => 'u', - '𝘃' => 'v', - '𝘄' => 'w', - '𝘅' => 'x', - '𝘆' => 'y', - '𝘇' => 'z', - '𝘈' => 'A', - '𝘉' => 'B', - '𝘊' => 'C', - '𝘋' => 'D', - '𝘌' => 'E', - '𝘍' => 'F', - '𝘎' => 'G', - '𝘏' => 'H', - '𝘐' => 'I', - '𝘑' => 'J', - '𝘒' => 'K', - '𝘓' => 'L', - '𝘔' => 'M', - '𝘕' => 'N', - '𝘖' => 'O', - '𝘗' => 'P', - '𝘘' => 'Q', - '𝘙' => 'R', - '𝘚' => 'S', - '𝘛' => 'T', - '𝘜' => 'U', - '𝘝' => 'V', - '𝘞' => 'W', - '𝘟' => 'X', - '𝘠' => 'Y', - '𝘡' => 'Z', - '𝘢' => 'a', - '𝘣' => 'b', - '𝘤' => 'c', - '𝘥' => 'd', - '𝘦' => 'e', - '𝘧' => 'f', - '𝘨' => 'g', - '𝘩' => 'h', - '𝘪' => 'i', - '𝘫' => 'j', - '𝘬' => 'k', - '𝘭' => 'l', - '𝘮' => 'm', - '𝘯' => 'n', - '𝘰' => 'o', - '𝘱' => 'p', - '𝘲' => 'q', - '𝘳' => 'r', - '𝘴' => 's', - '𝘵' => 't', - '𝘶' => 'u', - '𝘷' => 'v', - '𝘸' => 'w', - '𝘹' => 'x', - '𝘺' => 'y', - '𝘻' => 'z', - '𝘼' => 'A', - '𝘽' => 'B', - '𝘾' => 'C', - '𝘿' => 'D', - '𝙀' => 'E', - '𝙁' => 'F', - '𝙂' => 'G', - '𝙃' => 'H', - '𝙄' => 'I', - '𝙅' => 'J', - '𝙆' => 'K', - '𝙇' => 'L', - '𝙈' => 'M', - '𝙉' => 'N', - '𝙊' => 'O', - '𝙋' => 'P', - '𝙌' => 'Q', - '𝙍' => 'R', - '𝙎' => 'S', - '𝙏' => 'T', - '𝙐' => 'U', - '𝙑' => 'V', - '𝙒' => 'W', - '𝙓' => 'X', - '𝙔' => 'Y', - '𝙕' => 'Z', - '𝙖' => 'a', - '𝙗' => 'b', - '𝙘' => 'c', - '𝙙' => 'd', - '𝙚' => 'e', - '𝙛' => 'f', - '𝙜' => 'g', - '𝙝' => 'h', - '𝙞' => 'i', - '𝙟' => 'j', - '𝙠' => 'k', - '𝙡' => 'l', - '𝙢' => 'm', - '𝙣' => 'n', - '𝙤' => 'o', - '𝙥' => 'p', - '𝙦' => 'q', - '𝙧' => 'r', - '𝙨' => 's', - '𝙩' => 't', - '𝙪' => 'u', - '𝙫' => 'v', - '𝙬' => 'w', - '𝙭' => 'x', - '𝙮' => 'y', - '𝙯' => 'z', - '𝙰' => 'A', - '𝙱' => 'B', - '𝙲' => 'C', - '𝙳' => 'D', - '𝙴' => 'E', - '𝙵' => 'F', - '𝙶' => 'G', - '𝙷' => 'H', - '𝙸' => 'I', - '𝙹' => 'J', - '𝙺' => 'K', - '𝙻' => 'L', - '𝙼' => 'M', - '𝙽' => 'N', - '𝙾' => 'O', - '𝙿' => 'P', - '𝚀' => 'Q', - '𝚁' => 'R', - '𝚂' => 'S', - '𝚃' => 'T', - '𝚄' => 'U', - '𝚅' => 'V', - '𝚆' => 'W', - '𝚇' => 'X', - '𝚈' => 'Y', - '𝚉' => 'Z', - '𝚊' => 'a', - '𝚋' => 'b', - '𝚌' => 'c', - '𝚍' => 'd', - '𝚎' => 'e', - '𝚏' => 'f', - '𝚐' => 'g', - '𝚑' => 'h', - '𝚒' => 'i', - '𝚓' => 'j', - '𝚔' => 'k', - '𝚕' => 'l', - '𝚖' => 'm', - '𝚗' => 'n', - '𝚘' => 'o', - '𝚙' => 'p', - '𝚚' => 'q', - '𝚛' => 'r', - '𝚜' => 's', - '𝚝' => 't', - '𝚞' => 'u', - '𝚟' => 'v', - '𝚠' => 'w', - '𝚡' => 'x', - '𝚢' => 'y', - '𝚣' => 'z', - '𝚤' => 'ı', - '𝚥' => 'ȷ', - '𝚨' => 'Α', - '𝚩' => 'Β', - '𝚪' => 'Γ', - '𝚫' => 'Δ', - '𝚬' => 'Ε', - '𝚭' => 'Ζ', - '𝚮' => 'Η', - '𝚯' => 'Θ', - '𝚰' => 'Ι', - '𝚱' => 'Κ', - '𝚲' => 'Λ', - '𝚳' => 'Μ', - '𝚴' => 'Ν', - '𝚵' => 'Ξ', - '𝚶' => 'Ο', - '𝚷' => 'Π', - '𝚸' => 'Ρ', - '𝚹' => 'Θ', - '𝚺' => 'Σ', - '𝚻' => 'Τ', - '𝚼' => 'Υ', - '𝚽' => 'Φ', - '𝚾' => 'Χ', - '𝚿' => 'Ψ', - '𝛀' => 'Ω', - '𝛁' => '∇', - '𝛂' => 'α', - '𝛃' => 'β', - '𝛄' => 'γ', - '𝛅' => 'δ', - '𝛆' => 'ε', - '𝛇' => 'ζ', - '𝛈' => 'η', - '𝛉' => 'θ', - '𝛊' => 'ι', - '𝛋' => 'κ', - '𝛌' => 'λ', - '𝛍' => 'μ', - '𝛎' => 'ν', - '𝛏' => 'ξ', - '𝛐' => 'ο', - '𝛑' => 'π', - '𝛒' => 'ρ', - '𝛓' => 'ς', - '𝛔' => 'σ', - '𝛕' => 'τ', - '𝛖' => 'υ', - '𝛗' => 'φ', - '𝛘' => 'χ', - '𝛙' => 'ψ', - '𝛚' => 'ω', - '𝛛' => '∂', - '𝛜' => 'ε', - '𝛝' => 'θ', - '𝛞' => 'κ', - '𝛟' => 'φ', - '𝛠' => 'ρ', - '𝛡' => 'π', - '𝛢' => 'Α', - '𝛣' => 'Β', - '𝛤' => 'Γ', - '𝛥' => 'Δ', - '𝛦' => 'Ε', - '𝛧' => 'Ζ', - '𝛨' => 'Η', - '𝛩' => 'Θ', - '𝛪' => 'Ι', - '𝛫' => 'Κ', - '𝛬' => 'Λ', - '𝛭' => 'Μ', - '𝛮' => 'Ν', - '𝛯' => 'Ξ', - '𝛰' => 'Ο', - '𝛱' => 'Π', - '𝛲' => 'Ρ', - '𝛳' => 'Θ', - '𝛴' => 'Σ', - '𝛵' => 'Τ', - '𝛶' => 'Υ', - '𝛷' => 'Φ', - '𝛸' => 'Χ', - '𝛹' => 'Ψ', - '𝛺' => 'Ω', - '𝛻' => '∇', - '𝛼' => 'α', - '𝛽' => 'β', - '𝛾' => 'γ', - '𝛿' => 'δ', - '𝜀' => 'ε', - '𝜁' => 'ζ', - '𝜂' => 'η', - '𝜃' => 'θ', - '𝜄' => 'ι', - '𝜅' => 'κ', - '𝜆' => 'λ', - '𝜇' => 'μ', - '𝜈' => 'ν', - '𝜉' => 'ξ', - '𝜊' => 'ο', - '𝜋' => 'π', - '𝜌' => 'ρ', - '𝜍' => 'ς', - '𝜎' => 'σ', - '𝜏' => 'τ', - '𝜐' => 'υ', - '𝜑' => 'φ', - '𝜒' => 'χ', - '𝜓' => 'ψ', - '𝜔' => 'ω', - '𝜕' => '∂', - '𝜖' => 'ε', - '𝜗' => 'θ', - '𝜘' => 'κ', - '𝜙' => 'φ', - '𝜚' => 'ρ', - '𝜛' => 'π', - '𝜜' => 'Α', - '𝜝' => 'Β', - '𝜞' => 'Γ', - '𝜟' => 'Δ', - '𝜠' => 'Ε', - '𝜡' => 'Ζ', - '𝜢' => 'Η', - '𝜣' => 'Θ', - '𝜤' => 'Ι', - '𝜥' => 'Κ', - '𝜦' => 'Λ', - '𝜧' => 'Μ', - '𝜨' => 'Ν', - '𝜩' => 'Ξ', - '𝜪' => 'Ο', - '𝜫' => 'Π', - '𝜬' => 'Ρ', - '𝜭' => 'Θ', - '𝜮' => 'Σ', - '𝜯' => 'Τ', - '𝜰' => 'Υ', - '𝜱' => 'Φ', - '𝜲' => 'Χ', - '𝜳' => 'Ψ', - '𝜴' => 'Ω', - '𝜵' => '∇', - '𝜶' => 'α', - '𝜷' => 'β', - '𝜸' => 'γ', - '𝜹' => 'δ', - '𝜺' => 'ε', - '𝜻' => 'ζ', - '𝜼' => 'η', - '𝜽' => 'θ', - '𝜾' => 'ι', - '𝜿' => 'κ', - '𝝀' => 'λ', - '𝝁' => 'μ', - '𝝂' => 'ν', - '𝝃' => 'ξ', - '𝝄' => 'ο', - '𝝅' => 'π', - '𝝆' => 'ρ', - '𝝇' => 'ς', - '𝝈' => 'σ', - '𝝉' => 'τ', - '𝝊' => 'υ', - '𝝋' => 'φ', - '𝝌' => 'χ', - '𝝍' => 'ψ', - '𝝎' => 'ω', - '𝝏' => '∂', - '𝝐' => 'ε', - '𝝑' => 'θ', - '𝝒' => 'κ', - '𝝓' => 'φ', - '𝝔' => 'ρ', - '𝝕' => 'π', - '𝝖' => 'Α', - '𝝗' => 'Β', - '𝝘' => 'Γ', - '𝝙' => 'Δ', - '𝝚' => 'Ε', - '𝝛' => 'Ζ', - '𝝜' => 'Η', - '𝝝' => 'Θ', - '𝝞' => 'Ι', - '𝝟' => 'Κ', - '𝝠' => 'Λ', - '𝝡' => 'Μ', - '𝝢' => 'Ν', - '𝝣' => 'Ξ', - '𝝤' => 'Ο', - '𝝥' => 'Π', - '𝝦' => 'Ρ', - '𝝧' => 'Θ', - '𝝨' => 'Σ', - '𝝩' => 'Τ', - '𝝪' => 'Υ', - '𝝫' => 'Φ', - '𝝬' => 'Χ', - '𝝭' => 'Ψ', - '𝝮' => 'Ω', - '𝝯' => '∇', - '𝝰' => 'α', - '𝝱' => 'β', - '𝝲' => 'γ', - '𝝳' => 'δ', - '𝝴' => 'ε', - '𝝵' => 'ζ', - '𝝶' => 'η', - '𝝷' => 'θ', - '𝝸' => 'ι', - '𝝹' => 'κ', - '𝝺' => 'λ', - '𝝻' => 'μ', - '𝝼' => 'ν', - '𝝽' => 'ξ', - '𝝾' => 'ο', - '𝝿' => 'π', - '𝞀' => 'ρ', - '𝞁' => 'ς', - '𝞂' => 'σ', - '𝞃' => 'τ', - '𝞄' => 'υ', - '𝞅' => 'φ', - '𝞆' => 'χ', - '𝞇' => 'ψ', - '𝞈' => 'ω', - '𝞉' => '∂', - '𝞊' => 'ε', - '𝞋' => 'θ', - '𝞌' => 'κ', - '𝞍' => 'φ', - '𝞎' => 'ρ', - '𝞏' => 'π', - '𝞐' => 'Α', - '𝞑' => 'Β', - '𝞒' => 'Γ', - '𝞓' => 'Δ', - '𝞔' => 'Ε', - '𝞕' => 'Ζ', - '𝞖' => 'Η', - '𝞗' => 'Θ', - '𝞘' => 'Ι', - '𝞙' => 'Κ', - '𝞚' => 'Λ', - '𝞛' => 'Μ', - '𝞜' => 'Ν', - '𝞝' => 'Ξ', - '𝞞' => 'Ο', - '𝞟' => 'Π', - '𝞠' => 'Ρ', - '𝞡' => 'Θ', - '𝞢' => 'Σ', - '𝞣' => 'Τ', - '𝞤' => 'Υ', - '𝞥' => 'Φ', - '𝞦' => 'Χ', - '𝞧' => 'Ψ', - '𝞨' => 'Ω', - '𝞩' => '∇', - '𝞪' => 'α', - '𝞫' => 'β', - '𝞬' => 'γ', - '𝞭' => 'δ', - '𝞮' => 'ε', - '𝞯' => 'ζ', - '𝞰' => 'η', - '𝞱' => 'θ', - '𝞲' => 'ι', - '𝞳' => 'κ', - '𝞴' => 'λ', - '𝞵' => 'μ', - '𝞶' => 'ν', - '𝞷' => 'ξ', - '𝞸' => 'ο', - '𝞹' => 'π', - '𝞺' => 'ρ', - '𝞻' => 'ς', - '𝞼' => 'σ', - '𝞽' => 'τ', - '𝞾' => 'υ', - '𝞿' => 'φ', - '𝟀' => 'χ', - '𝟁' => 'ψ', - '𝟂' => 'ω', - '𝟃' => '∂', - '𝟄' => 'ε', - '𝟅' => 'θ', - '𝟆' => 'κ', - '𝟇' => 'φ', - '𝟈' => 'ρ', - '𝟉' => 'π', - '𝟊' => 'Ϝ', - '𝟋' => 'ϝ', - '𝟎' => '0', - '𝟏' => '1', - '𝟐' => '2', - '𝟑' => '3', - '𝟒' => '4', - '𝟓' => '5', - '𝟔' => '6', - '𝟕' => '7', - '𝟖' => '8', - '𝟗' => '9', - '𝟘' => '0', - '𝟙' => '1', - '𝟚' => '2', - '𝟛' => '3', - '𝟜' => '4', - '𝟝' => '5', - '𝟞' => '6', - '𝟟' => '7', - '𝟠' => '8', - '𝟡' => '9', - '𝟢' => '0', - '𝟣' => '1', - '𝟤' => '2', - '𝟥' => '3', - '𝟦' => '4', - '𝟧' => '5', - '𝟨' => '6', - '𝟩' => '7', - '𝟪' => '8', - '𝟫' => '9', - '𝟬' => '0', - '𝟭' => '1', - '𝟮' => '2', - '𝟯' => '3', - '𝟰' => '4', - '𝟱' => '5', - '𝟲' => '6', - '𝟳' => '7', - '𝟴' => '8', - '𝟵' => '9', - '𝟶' => '0', - '𝟷' => '1', - '𝟸' => '2', - '𝟹' => '3', - '𝟺' => '4', - '𝟻' => '5', - '𝟼' => '6', - '𝟽' => '7', - '𝟾' => '8', - '𝟿' => '9', - '𞸀' => 'ا', - '𞸁' => 'ب', - '𞸂' => 'ج', - '𞸃' => 'د', - '𞸅' => 'و', - '𞸆' => 'ز', - '𞸇' => 'ح', - '𞸈' => 'ط', - '𞸉' => 'ي', - '𞸊' => 'ك', - '𞸋' => 'ل', - '𞸌' => 'م', - '𞸍' => 'ن', - '𞸎' => 'س', - '𞸏' => 'ع', - '𞸐' => 'ف', - '𞸑' => 'ص', - '𞸒' => 'ق', - '𞸓' => 'ر', - '𞸔' => 'ش', - '𞸕' => 'ت', - '𞸖' => 'ث', - '𞸗' => 'خ', - '𞸘' => 'ذ', - '𞸙' => 'ض', - '𞸚' => 'ظ', - '𞸛' => 'غ', - '𞸜' => 'ٮ', - '𞸝' => 'ں', - '𞸞' => 'ڡ', - '𞸟' => 'ٯ', - '𞸡' => 'ب', - '𞸢' => 'ج', - '𞸤' => 'ه', - '𞸧' => 'ح', - '𞸩' => 'ي', - '𞸪' => 'ك', - '𞸫' => 'ل', - '𞸬' => 'م', - '𞸭' => 'ن', - '𞸮' => 'س', - '𞸯' => 'ع', - '𞸰' => 'ف', - '𞸱' => 'ص', - '𞸲' => 'ق', - '𞸴' => 'ش', - '𞸵' => 'ت', - '𞸶' => 'ث', - '𞸷' => 'خ', - '𞸹' => 'ض', - '𞸻' => 'غ', - '𞹂' => 'ج', - '𞹇' => 'ح', - '𞹉' => 'ي', - '𞹋' => 'ل', - '𞹍' => 'ن', - '𞹎' => 'س', - '𞹏' => 'ع', - '𞹑' => 'ص', - '𞹒' => 'ق', - '𞹔' => 'ش', - '𞹗' => 'خ', - '𞹙' => 'ض', - '𞹛' => 'غ', - '𞹝' => 'ں', - '𞹟' => 'ٯ', - '𞹡' => 'ب', - '𞹢' => 'ج', - '𞹤' => 'ه', - '𞹧' => 'ح', - '𞹨' => 'ط', - '𞹩' => 'ي', - '𞹪' => 'ك', - '𞹬' => 'م', - '𞹭' => 'ن', - '𞹮' => 'س', - '𞹯' => 'ع', - '𞹰' => 'ف', - '𞹱' => 'ص', - '𞹲' => 'ق', - '𞹴' => 'ش', - '𞹵' => 'ت', - '𞹶' => 'ث', - '𞹷' => 'خ', - '𞹹' => 'ض', - '𞹺' => 'ظ', - '𞹻' => 'غ', - '𞹼' => 'ٮ', - '𞹾' => 'ڡ', - '𞺀' => 'ا', - '𞺁' => 'ب', - '𞺂' => 'ج', - '𞺃' => 'د', - '𞺄' => 'ه', - '𞺅' => 'و', - '𞺆' => 'ز', - '𞺇' => 'ح', - '𞺈' => 'ط', - '𞺉' => 'ي', - '𞺋' => 'ل', - '𞺌' => 'م', - '𞺍' => 'ن', - '𞺎' => 'س', - '𞺏' => 'ع', - '𞺐' => 'ف', - '𞺑' => 'ص', - '𞺒' => 'ق', - '𞺓' => 'ر', - '𞺔' => 'ش', - '𞺕' => 'ت', - '𞺖' => 'ث', - '𞺗' => 'خ', - '𞺘' => 'ذ', - '𞺙' => 'ض', - '𞺚' => 'ظ', - '𞺛' => 'غ', - '𞺡' => 'ب', - '𞺢' => 'ج', - '𞺣' => 'د', - '𞺥' => 'و', - '𞺦' => 'ز', - '𞺧' => 'ح', - '𞺨' => 'ط', - '𞺩' => 'ي', - '𞺫' => 'ل', - '𞺬' => 'م', - '𞺭' => 'ن', - '𞺮' => 'س', - '𞺯' => 'ع', - '𞺰' => 'ف', - '𞺱' => 'ص', - '𞺲' => 'ق', - '𞺳' => 'ر', - '𞺴' => 'ش', - '𞺵' => 'ت', - '𞺶' => 'ث', - '𞺷' => 'خ', - '𞺸' => 'ذ', - '𞺹' => 'ض', - '𞺺' => 'ظ', - '𞺻' => 'غ', - '🄀' => '0.', - '🄁' => '0,', - '🄂' => '1,', - '🄃' => '2,', - '🄄' => '3,', - '🄅' => '4,', - '🄆' => '5,', - '🄇' => '6,', - '🄈' => '7,', - '🄉' => '8,', - '🄊' => '9,', - '🄐' => '(A)', - '🄑' => '(B)', - '🄒' => '(C)', - '🄓' => '(D)', - '🄔' => '(E)', - '🄕' => '(F)', - '🄖' => '(G)', - '🄗' => '(H)', - '🄘' => '(I)', - '🄙' => '(J)', - '🄚' => '(K)', - '🄛' => '(L)', - '🄜' => '(M)', - '🄝' => '(N)', - '🄞' => '(O)', - '🄟' => '(P)', - '🄠' => '(Q)', - '🄡' => '(R)', - '🄢' => '(S)', - '🄣' => '(T)', - '🄤' => '(U)', - '🄥' => '(V)', - '🄦' => '(W)', - '🄧' => '(X)', - '🄨' => '(Y)', - '🄩' => '(Z)', - '🄪' => '〔S〕', - '🄫' => 'C', - '🄬' => 'R', - '🄭' => 'CD', - '🄮' => 'WZ', - '🄰' => 'A', - '🄱' => 'B', - '🄲' => 'C', - '🄳' => 'D', - '🄴' => 'E', - '🄵' => 'F', - '🄶' => 'G', - '🄷' => 'H', - '🄸' => 'I', - '🄹' => 'J', - '🄺' => 'K', - '🄻' => 'L', - '🄼' => 'M', - '🄽' => 'N', - '🄾' => 'O', - '🄿' => 'P', - '🅀' => 'Q', - '🅁' => 'R', - '🅂' => 'S', - '🅃' => 'T', - '🅄' => 'U', - '🅅' => 'V', - '🅆' => 'W', - '🅇' => 'X', - '🅈' => 'Y', - '🅉' => 'Z', - '🅊' => 'HV', - '🅋' => 'MV', - '🅌' => 'SD', - '🅍' => 'SS', - '🅎' => 'PPV', - '🅏' => 'WC', - '🅪' => 'MC', - '🅫' => 'MD', - '🅬' => 'MR', - '🆐' => 'DJ', - '🈀' => 'ほか', - '🈁' => 'ココ', - '🈂' => 'サ', - '🈐' => '手', - '🈑' => '字', - '🈒' => '双', - '🈓' => 'デ', - '🈔' => '二', - '🈕' => '多', - '🈖' => '解', - '🈗' => '天', - '🈘' => '交', - '🈙' => '映', - '🈚' => '無', - '🈛' => '料', - '🈜' => '前', - '🈝' => '後', - '🈞' => '再', - '🈟' => '新', - '🈠' => '初', - '🈡' => '終', - '🈢' => '生', - '🈣' => '販', - '🈤' => '声', - '🈥' => '吹', - '🈦' => '演', - '🈧' => '投', - '🈨' => '捕', - '🈩' => '一', - '🈪' => '三', - '🈫' => '遊', - '🈬' => '左', - '🈭' => '中', - '🈮' => '右', - '🈯' => '指', - '🈰' => '走', - '🈱' => '打', - '🈲' => '禁', - '🈳' => '空', - '🈴' => '合', - '🈵' => '満', - '🈶' => '有', - '🈷' => '月', - '🈸' => '申', - '🈹' => '割', - '🈺' => '営', - '🈻' => '配', - '🉀' => '〔本〕', - '🉁' => '〔三〕', - '🉂' => '〔二〕', - '🉃' => '〔安〕', - '🉄' => '〔点〕', - '🉅' => '〔打〕', - '🉆' => '〔盗〕', - '🉇' => '〔勝〕', - '🉈' => '〔敗〕', - '🉐' => '得', - '🉑' => '可', - '🯰' => '0', - '🯱' => '1', - '🯲' => '2', - '🯳' => '3', - '🯴' => '4', - '🯵' => '5', - '🯶' => '6', - '🯷' => '7', - '🯸' => '8', - '🯹' => '9', -); diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap.php deleted file mode 100644 index 3608e5c05..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -if (!function_exists('normalizer_is_normalized')) { - function normalizer_is_normalized($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::isNormalized($string, $form); } -} -if (!function_exists('normalizer_normalize')) { - function normalizer_normalize($string, $form = p\Normalizer::FORM_C) { return p\Normalizer::normalize($string, $form); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php b/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php deleted file mode 100644 index e36d1a947..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/bootstrap80.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Intl\Normalizer as p; - -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); } -} -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); } -} diff --git a/vendor/symfony/polyfill-intl-normalizer/composer.json b/vendor/symfony/polyfill-intl-normalizer/composer.json deleted file mode 100644 index 65f72d645..000000000 --- a/vendor/symfony/polyfill-intl-normalizer/composer.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "symfony/polyfill-intl-normalizer", - "type": "library", - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "keywords": ["polyfill", "shim", "compatibility", "portable", "intl", "normalizer"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Intl\\Normalizer\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "suggest": { - "ext-intl": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-mbstring/LICENSE b/vendor/symfony/polyfill-mbstring/LICENSE deleted file mode 100644 index 4cd8bdd30..000000000 --- a/vendor/symfony/polyfill-mbstring/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2015-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-mbstring/Mbstring.php b/vendor/symfony/polyfill-mbstring/Mbstring.php deleted file mode 100644 index bce5c4a84..000000000 --- a/vendor/symfony/polyfill-mbstring/Mbstring.php +++ /dev/null @@ -1,874 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Mbstring; - -/** - * Partial mbstring implementation in PHP, iconv based, UTF-8 centric. - * - * Implemented: - * - mb_chr - Returns a specific character from its Unicode code point - * - mb_convert_encoding - Convert character encoding - * - mb_convert_variables - Convert character code in variable(s) - * - mb_decode_mimeheader - Decode string in MIME header field - * - mb_encode_mimeheader - Encode string for MIME header XXX NATIVE IMPLEMENTATION IS REALLY BUGGED - * - mb_decode_numericentity - Decode HTML numeric string reference to character - * - mb_encode_numericentity - Encode character to HTML numeric string reference - * - mb_convert_case - Perform case folding on a string - * - mb_detect_encoding - Detect character encoding - * - mb_get_info - Get internal settings of mbstring - * - mb_http_input - Detect HTTP input character encoding - * - mb_http_output - Set/Get HTTP output character encoding - * - mb_internal_encoding - Set/Get internal character encoding - * - mb_list_encodings - Returns an array of all supported encodings - * - mb_ord - Returns the Unicode code point of a character - * - mb_output_handler - Callback function converts character encoding in output buffer - * - mb_scrub - Replaces ill-formed byte sequences with substitute characters - * - mb_strlen - Get string length - * - mb_strpos - Find position of first occurrence of string in a string - * - mb_strrpos - Find position of last occurrence of a string in a string - * - mb_str_split - Convert a string to an array - * - mb_strtolower - Make a string lowercase - * - mb_strtoupper - Make a string uppercase - * - mb_substitute_character - Set/Get substitution character - * - mb_substr - Get part of string - * - mb_stripos - Finds position of first occurrence of a string within another, case insensitive - * - mb_stristr - Finds first occurrence of a string within another, case insensitive - * - mb_strrchr - Finds the last occurrence of a character in a string within another - * - mb_strrichr - Finds the last occurrence of a character in a string within another, case insensitive - * - mb_strripos - Finds position of last occurrence of a string within another, case insensitive - * - mb_strstr - Finds first occurrence of a string within another - * - mb_strwidth - Return width of string - * - mb_substr_count - Count the number of substring occurrences - * - * Not implemented: - * - mb_convert_kana - Convert "kana" one from another ("zen-kaku", "han-kaku" and more) - * - mb_ereg_* - Regular expression with multibyte support - * - mb_parse_str - Parse GET/POST/COOKIE data and set global variable - * - mb_preferred_mime_name - Get MIME charset string - * - mb_regex_encoding - Returns current encoding for multibyte regex as string - * - mb_regex_set_options - Set/Get the default options for mbregex functions - * - mb_send_mail - Send encoded mail - * - mb_split - Split multibyte string using regular expression - * - mb_strcut - Get part of string - * - mb_strimwidth - Get truncated string with specified width - * - * @author Nicolas Grekas - * - * @internal - */ -final class Mbstring -{ - public const MB_CASE_FOLD = \PHP_INT_MAX; - - private const CASE_FOLD = [ - ['µ', 'ſ', "\xCD\x85", 'ς', "\xCF\x90", "\xCF\x91", "\xCF\x95", "\xCF\x96", "\xCF\xB0", "\xCF\xB1", "\xCF\xB5", "\xE1\xBA\x9B", "\xE1\xBE\xBE"], - ['μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', "\xE1\xB9\xA1", 'ι'], - ]; - - private static $encodingList = ['ASCII', 'UTF-8']; - private static $language = 'neutral'; - private static $internalEncoding = 'UTF-8'; - - public static function mb_convert_encoding($s, $toEncoding, $fromEncoding = null) - { - if (\is_array($fromEncoding) || (null !== $fromEncoding && false !== strpos($fromEncoding, ','))) { - $fromEncoding = self::mb_detect_encoding($s, $fromEncoding); - } else { - $fromEncoding = self::getEncoding($fromEncoding); - } - - $toEncoding = self::getEncoding($toEncoding); - - if ('BASE64' === $fromEncoding) { - $s = base64_decode($s); - $fromEncoding = $toEncoding; - } - - if ('BASE64' === $toEncoding) { - return base64_encode($s); - } - - if ('HTML-ENTITIES' === $toEncoding || 'HTML' === $toEncoding) { - if ('HTML-ENTITIES' === $fromEncoding || 'HTML' === $fromEncoding) { - $fromEncoding = 'Windows-1252'; - } - if ('UTF-8' !== $fromEncoding) { - $s = iconv($fromEncoding, 'UTF-8//IGNORE', $s); - } - - return preg_replace_callback('/[\x80-\xFF]+/', [__CLASS__, 'html_encoding_callback'], $s); - } - - if ('HTML-ENTITIES' === $fromEncoding) { - $s = html_entity_decode($s, \ENT_COMPAT, 'UTF-8'); - $fromEncoding = 'UTF-8'; - } - - return iconv($fromEncoding, $toEncoding.'//IGNORE', $s); - } - - public static function mb_convert_variables($toEncoding, $fromEncoding, &...$vars) - { - $ok = true; - array_walk_recursive($vars, function (&$v) use (&$ok, $toEncoding, $fromEncoding) { - if (false === $v = self::mb_convert_encoding($v, $toEncoding, $fromEncoding)) { - $ok = false; - } - }); - - return $ok ? $fromEncoding : false; - } - - public static function mb_decode_mimeheader($s) - { - return iconv_mime_decode($s, 2, self::$internalEncoding); - } - - public static function mb_encode_mimeheader($s, $charset = null, $transferEncoding = null, $linefeed = null, $indent = null) - { - trigger_error('mb_encode_mimeheader() is bugged. Please use iconv_mime_encode() instead', \E_USER_WARNING); - } - - public static function mb_decode_numericentity($s, $convmap, $encoding = null) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_decode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_decode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return ''; // Instead of null (cf. mb_encode_numericentity). - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $cnt = floor(\count($convmap) / 4) * 4; - - for ($i = 0; $i < $cnt; $i += 4) { - // collector_decode_htmlnumericentity ignores $convmap[$i + 3] - $convmap[$i] += $convmap[$i + 2]; - $convmap[$i + 1] += $convmap[$i + 2]; - } - - $s = preg_replace_callback('/&#(?:0*([0-9]+)|x0*([0-9a-fA-F]+))(?!&);?/', function (array $m) use ($cnt, $convmap) { - $c = isset($m[2]) ? (int) hexdec($m[2]) : $m[1]; - for ($i = 0; $i < $cnt; $i += 4) { - if ($c >= $convmap[$i] && $c <= $convmap[$i + 1]) { - return self::mb_chr($c - $convmap[$i + 2]); - } - } - - return $m[0]; - }, $s); - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_encode_numericentity($s, $convmap, $encoding = null, $is_hex = false) - { - if (null !== $s && !\is_scalar($s) && !(\is_object($s) && method_exists($s, '__toString'))) { - trigger_error('mb_encode_numericentity() expects parameter 1 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - if (!\is_array($convmap) || (80000 > \PHP_VERSION_ID && !$convmap)) { - return false; - } - - if (null !== $encoding && !\is_scalar($encoding)) { - trigger_error('mb_encode_numericentity() expects parameter 3 to be string, '.\gettype($s).' given', \E_USER_WARNING); - - return null; // Instead of '' (cf. mb_decode_numericentity). - } - - if (null !== $is_hex && !\is_scalar($is_hex)) { - trigger_error('mb_encode_numericentity() expects parameter 4 to be boolean, '.\gettype($s).' given', \E_USER_WARNING); - - return null; - } - - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $cnt = floor(\count($convmap) / 4) * 4; - $i = 0; - $len = \strlen($s); - $result = ''; - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - $c = self::mb_ord($uchr); - - for ($j = 0; $j < $cnt; $j += 4) { - if ($c >= $convmap[$j] && $c <= $convmap[$j + 1]) { - $cOffset = ($c + $convmap[$j + 2]) & $convmap[$j + 3]; - $result .= $is_hex ? sprintf('&#x%X;', $cOffset) : '&#'.$cOffset.';'; - continue 2; - } - } - $result .= $uchr; - } - - if (null === $encoding) { - return $result; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $result); - } - - public static function mb_convert_case($s, $mode, $encoding = null) - { - $s = (string) $s; - if ('' === $s) { - return ''; - } - - $encoding = self::getEncoding($encoding); - - if ('UTF-8' === $encoding) { - $encoding = null; - if (!preg_match('//u', $s)) { - $s = @iconv('UTF-8', 'UTF-8//IGNORE', $s); - } - } else { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - if (\MB_CASE_TITLE == $mode) { - static $titleRegexp = null; - if (null === $titleRegexp) { - $titleRegexp = self::getData('titleCaseRegexp'); - } - $s = preg_replace_callback($titleRegexp, [__CLASS__, 'title_case'], $s); - } else { - if (\MB_CASE_UPPER == $mode) { - static $upper = null; - if (null === $upper) { - $upper = self::getData('upperCase'); - } - $map = $upper; - } else { - if (self::MB_CASE_FOLD === $mode) { - $s = str_replace(self::CASE_FOLD[0], self::CASE_FOLD[1], $s); - } - - static $lower = null; - if (null === $lower) { - $lower = self::getData('lowerCase'); - } - $map = $lower; - } - - static $ulenMask = ["\xC0" => 2, "\xD0" => 2, "\xE0" => 3, "\xF0" => 4]; - - $i = 0; - $len = \strlen($s); - - while ($i < $len) { - $ulen = $s[$i] < "\x80" ? 1 : $ulenMask[$s[$i] & "\xF0"]; - $uchr = substr($s, $i, $ulen); - $i += $ulen; - - if (isset($map[$uchr])) { - $uchr = $map[$uchr]; - $nlen = \strlen($uchr); - - if ($nlen == $ulen) { - $nlen = $i; - do { - $s[--$nlen] = $uchr[--$ulen]; - } while ($ulen); - } else { - $s = substr_replace($s, $uchr, $i - $ulen, $ulen); - $len += $nlen - $ulen; - $i += $nlen - $ulen; - } - } - } - } - - if (null === $encoding) { - return $s; - } - - return iconv('UTF-8', $encoding.'//IGNORE', $s); - } - - public static function mb_internal_encoding($encoding = null) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - $normalizedEncoding = self::getEncoding($encoding); - - if ('UTF-8' === $normalizedEncoding || false !== @iconv($normalizedEncoding, $normalizedEncoding, ' ')) { - self::$internalEncoding = $normalizedEncoding; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($encoding) must be a valid encoding, "%s" given', $encoding)); - } - - public static function mb_language($lang = null) - { - if (null === $lang) { - return self::$language; - } - - switch ($normalizedLang = strtolower($lang)) { - case 'uni': - case 'neutral': - self::$language = $normalizedLang; - - return true; - } - - if (80000 > \PHP_VERSION_ID) { - return false; - } - - throw new \ValueError(sprintf('Argument #1 ($language) must be a valid language, "%s" given', $lang)); - } - - public static function mb_list_encodings() - { - return ['UTF-8']; - } - - public static function mb_encoding_aliases($encoding) - { - switch (strtoupper($encoding)) { - case 'UTF8': - case 'UTF-8': - return ['utf8']; - } - - return false; - } - - public static function mb_check_encoding($var = null, $encoding = null) - { - if (null === $encoding) { - if (null === $var) { - return false; - } - $encoding = self::$internalEncoding; - } - - return self::mb_detect_encoding($var, [$encoding]) || false !== @iconv($encoding, $encoding, $var); - } - - public static function mb_detect_encoding($str, $encodingList = null, $strict = false) - { - if (null === $encodingList) { - $encodingList = self::$encodingList; - } else { - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - } - - foreach ($encodingList as $enc) { - switch ($enc) { - case 'ASCII': - if (!preg_match('/[\x80-\xFF]/', $str)) { - return $enc; - } - break; - - case 'UTF8': - case 'UTF-8': - if (preg_match('//u', $str)) { - return 'UTF-8'; - } - break; - - default: - if (0 === strncmp($enc, 'ISO-8859-', 9)) { - return $enc; - } - } - } - - return false; - } - - public static function mb_detect_order($encodingList = null) - { - if (null === $encodingList) { - return self::$encodingList; - } - - if (!\is_array($encodingList)) { - $encodingList = array_map('trim', explode(',', $encodingList)); - } - $encodingList = array_map('strtoupper', $encodingList); - - foreach ($encodingList as $enc) { - switch ($enc) { - default: - if (strncmp($enc, 'ISO-8859-', 9)) { - return false; - } - // no break - case 'ASCII': - case 'UTF8': - case 'UTF-8': - } - } - - self::$encodingList = $encodingList; - - return true; - } - - public static function mb_strlen($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return \strlen($s); - } - - return @iconv_strlen($s, $encoding); - } - - public static function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strpos($haystack, $needle, $offset); - } - - $needle = (string) $needle; - if ('' === $needle) { - if (80000 > \PHP_VERSION_ID) { - trigger_error(__METHOD__.': Empty delimiter', \E_USER_WARNING); - - return false; - } - - return 0; - } - - return iconv_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return strrpos($haystack, $needle, $offset); - } - - if ($offset != (int) $offset) { - $offset = 0; - } elseif ($offset = (int) $offset) { - if ($offset < 0) { - if (0 > $offset += self::mb_strlen($needle)) { - $haystack = self::mb_substr($haystack, 0, $offset, $encoding); - } - $offset = 0; - } else { - $haystack = self::mb_substr($haystack, $offset, 2147483647, $encoding); - } - } - - $pos = '' !== $needle || 80000 > \PHP_VERSION_ID - ? iconv_strrpos($haystack, $needle, $encoding) - : self::mb_strlen($haystack, $encoding); - - return false !== $pos ? $offset + $pos : false; - } - - public static function mb_str_split($string, $split_length = 1, $encoding = null) - { - if (null !== $string && !\is_scalar($string) && !(\is_object($string) && method_exists($string, '__toString'))) { - trigger_error('mb_str_split() expects parameter 1 to be string, '.\gettype($string).' given', \E_USER_WARNING); - - return null; - } - - if (1 > $split_length = (int) $split_length) { - if (80000 > \PHP_VERSION_ID) { - trigger_error('The length of each segment must be greater than zero', \E_USER_WARNING); - - return false; - } - - throw new \ValueError('Argument #2 ($length) must be greater than 0'); - } - - if (null === $encoding) { - $encoding = mb_internal_encoding(); - } - - if ('UTF-8' === $encoding = self::getEncoding($encoding)) { - $rx = '/('; - while (65535 < $split_length) { - $rx .= '.{65535}'; - $split_length -= 65535; - } - $rx .= '.{'.$split_length.'})/us'; - - return preg_split($rx, $string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY); - } - - $result = []; - $length = mb_strlen($string, $encoding); - - for ($i = 0; $i < $length; $i += $split_length) { - $result[] = mb_substr($string, $i, $split_length, $encoding); - } - - return $result; - } - - public static function mb_strtolower($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_LOWER, $encoding); - } - - public static function mb_strtoupper($s, $encoding = null) - { - return self::mb_convert_case($s, \MB_CASE_UPPER, $encoding); - } - - public static function mb_substitute_character($c = null) - { - if (null === $c) { - return 'none'; - } - if (0 === strcasecmp($c, 'none')) { - return true; - } - if (80000 > \PHP_VERSION_ID) { - return false; - } - if (\is_int($c) || 'long' === $c || 'entity' === $c) { - return false; - } - - throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint'); - } - - public static function mb_substr($s, $start, $length = null, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - return (string) substr($s, $start, null === $length ? 2147483647 : $length); - } - - if ($start < 0) { - $start = iconv_strlen($s, $encoding) + $start; - if ($start < 0) { - $start = 0; - } - } - - if (null === $length) { - $length = 2147483647; - } elseif ($length < 0) { - $length = iconv_strlen($s, $encoding) + $length - $start; - if ($length < 0) { - return ''; - } - } - - return (string) iconv_substr($s, $start, $length, $encoding); - } - - public static function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_stristr($haystack, $needle, $part = false, $encoding = null) - { - $pos = self::mb_stripos($haystack, $needle, 0, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrchr($haystack, $needle, $part = false, $encoding = null) - { - $encoding = self::getEncoding($encoding); - if ('CP850' === $encoding || 'ASCII' === $encoding) { - $pos = strrpos($haystack, $needle); - } else { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = iconv_strrpos($haystack, $needle, $encoding); - } - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strrichr($haystack, $needle, $part = false, $encoding = null) - { - $needle = self::mb_substr($needle, 0, 1, $encoding); - $pos = self::mb_strripos($haystack, $needle, $encoding); - - return self::getSubpart($pos, $part, $haystack, $encoding); - } - - public static function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) - { - $haystack = self::mb_convert_case($haystack, self::MB_CASE_FOLD, $encoding); - $needle = self::mb_convert_case($needle, self::MB_CASE_FOLD, $encoding); - - return self::mb_strrpos($haystack, $needle, $offset, $encoding); - } - - public static function mb_strstr($haystack, $needle, $part = false, $encoding = null) - { - $pos = strpos($haystack, $needle); - if (false === $pos) { - return false; - } - if ($part) { - return substr($haystack, 0, $pos); - } - - return substr($haystack, $pos); - } - - public static function mb_get_info($type = 'all') - { - $info = [ - 'internal_encoding' => self::$internalEncoding, - 'http_output' => 'pass', - 'http_output_conv_mimetypes' => '^(text/|application/xhtml\+xml)', - 'func_overload' => 0, - 'func_overload_list' => 'no overload', - 'mail_charset' => 'UTF-8', - 'mail_header_encoding' => 'BASE64', - 'mail_body_encoding' => 'BASE64', - 'illegal_chars' => 0, - 'encoding_translation' => 'Off', - 'language' => self::$language, - 'detect_order' => self::$encodingList, - 'substitute_character' => 'none', - 'strict_detection' => 'Off', - ]; - - if ('all' === $type) { - return $info; - } - if (isset($info[$type])) { - return $info[$type]; - } - - return false; - } - - public static function mb_http_input($type = '') - { - return false; - } - - public static function mb_http_output($encoding = null) - { - return null !== $encoding ? 'pass' === $encoding : 'pass'; - } - - public static function mb_strwidth($s, $encoding = null) - { - $encoding = self::getEncoding($encoding); - - if ('UTF-8' !== $encoding) { - $s = iconv($encoding, 'UTF-8//IGNORE', $s); - } - - $s = preg_replace('/[\x{1100}-\x{115F}\x{2329}\x{232A}\x{2E80}-\x{303E}\x{3040}-\x{A4CF}\x{AC00}-\x{D7A3}\x{F900}-\x{FAFF}\x{FE10}-\x{FE19}\x{FE30}-\x{FE6F}\x{FF00}-\x{FF60}\x{FFE0}-\x{FFE6}\x{20000}-\x{2FFFD}\x{30000}-\x{3FFFD}]/u', '', $s, -1, $wide); - - return ($wide << 1) + iconv_strlen($s, 'UTF-8'); - } - - public static function mb_substr_count($haystack, $needle, $encoding = null) - { - return substr_count($haystack, $needle); - } - - public static function mb_output_handler($contents, $status) - { - return $contents; - } - - public static function mb_chr($code, $encoding = null) - { - if (0x80 > $code %= 0x200000) { - $s = \chr($code); - } elseif (0x800 > $code) { - $s = \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $s = \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $s = \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, $encoding, 'UTF-8'); - } - - return $s; - } - - public static function mb_ord($s, $encoding = null) - { - if ('UTF-8' !== $encoding = self::getEncoding($encoding)) { - $s = mb_convert_encoding($s, 'UTF-8', $encoding); - } - - if (1 === \strlen($s)) { - return \ord($s); - } - - $code = ($s = unpack('C*', substr($s, 0, 4))) ? $s[1] : 0; - if (0xF0 <= $code) { - return (($code - 0xF0) << 18) + (($s[2] - 0x80) << 12) + (($s[3] - 0x80) << 6) + $s[4] - 0x80; - } - if (0xE0 <= $code) { - return (($code - 0xE0) << 12) + (($s[2] - 0x80) << 6) + $s[3] - 0x80; - } - if (0xC0 <= $code) { - return (($code - 0xC0) << 6) + $s[2] - 0x80; - } - - return $code; - } - - private static function getSubpart($pos, $part, $haystack, $encoding) - { - if (false === $pos) { - return false; - } - if ($part) { - return self::mb_substr($haystack, 0, $pos, $encoding); - } - - return self::mb_substr($haystack, $pos, null, $encoding); - } - - private static function html_encoding_callback(array $m) - { - $i = 1; - $entities = ''; - $m = unpack('C*', htmlentities($m[0], \ENT_COMPAT, 'UTF-8')); - - while (isset($m[$i])) { - if (0x80 > $m[$i]) { - $entities .= \chr($m[$i++]); - continue; - } - if (0xF0 <= $m[$i]) { - $c = (($m[$i++] - 0xF0) << 18) + (($m[$i++] - 0x80) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } elseif (0xE0 <= $m[$i]) { - $c = (($m[$i++] - 0xE0) << 12) + (($m[$i++] - 0x80) << 6) + $m[$i++] - 0x80; - } else { - $c = (($m[$i++] - 0xC0) << 6) + $m[$i++] - 0x80; - } - - $entities .= '&#'.$c.';'; - } - - return $entities; - } - - private static function title_case(array $s) - { - return self::mb_convert_case($s[1], \MB_CASE_UPPER, 'UTF-8').self::mb_convert_case($s[2], \MB_CASE_LOWER, 'UTF-8'); - } - - private static function getData($file) - { - if (file_exists($file = __DIR__.'/Resources/unidata/'.$file.'.php')) { - return require $file; - } - - return false; - } - - private static function getEncoding($encoding) - { - if (null === $encoding) { - return self::$internalEncoding; - } - - if ('UTF-8' === $encoding) { - return 'UTF-8'; - } - - $encoding = strtoupper($encoding); - - if ('8BIT' === $encoding || 'BINARY' === $encoding) { - return 'CP850'; - } - - if ('UTF8' === $encoding) { - return 'UTF-8'; - } - - return $encoding; - } -} diff --git a/vendor/symfony/polyfill-mbstring/README.md b/vendor/symfony/polyfill-mbstring/README.md deleted file mode 100644 index 478b40da2..000000000 --- a/vendor/symfony/polyfill-mbstring/README.md +++ /dev/null @@ -1,13 +0,0 @@ -Symfony Polyfill / Mbstring -=========================== - -This component provides a partial, native PHP implementation for the -[Mbstring](https://php.net/mbstring) extension. - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php deleted file mode 100644 index fac60b081..000000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/lowerCase.php +++ /dev/null @@ -1,1397 +0,0 @@ - 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - 'À' => 'à', - 'Á' => 'á', - 'Â' => 'â', - 'Ã' => 'ã', - 'Ä' => 'ä', - 'Å' => 'å', - 'Æ' => 'æ', - 'Ç' => 'ç', - 'È' => 'è', - 'É' => 'é', - 'Ê' => 'ê', - 'Ë' => 'ë', - 'Ì' => 'ì', - 'Í' => 'í', - 'Î' => 'î', - 'Ï' => 'ï', - 'Ð' => 'ð', - 'Ñ' => 'ñ', - 'Ò' => 'ò', - 'Ó' => 'ó', - 'Ô' => 'ô', - 'Õ' => 'õ', - 'Ö' => 'ö', - 'Ø' => 'ø', - 'Ù' => 'ù', - 'Ú' => 'ú', - 'Û' => 'û', - 'Ü' => 'ü', - 'Ý' => 'ý', - 'Þ' => 'þ', - 'Ā' => 'ā', - 'Ă' => 'ă', - 'Ą' => 'ą', - 'Ć' => 'ć', - 'Ĉ' => 'ĉ', - 'Ċ' => 'ċ', - 'Č' => 'č', - 'Ď' => 'ď', - 'Đ' => 'đ', - 'Ē' => 'ē', - 'Ĕ' => 'ĕ', - 'Ė' => 'ė', - 'Ę' => 'ę', - 'Ě' => 'ě', - 'Ĝ' => 'ĝ', - 'Ğ' => 'ğ', - 'Ġ' => 'ġ', - 'Ģ' => 'ģ', - 'Ĥ' => 'ĥ', - 'Ħ' => 'ħ', - 'Ĩ' => 'ĩ', - 'Ī' => 'ī', - 'Ĭ' => 'ĭ', - 'Į' => 'į', - 'İ' => 'i̇', - 'IJ' => 'ij', - 'Ĵ' => 'ĵ', - 'Ķ' => 'ķ', - 'Ĺ' => 'ĺ', - 'Ļ' => 'ļ', - 'Ľ' => 'ľ', - 'Ŀ' => 'ŀ', - 'Ł' => 'ł', - 'Ń' => 'ń', - 'Ņ' => 'ņ', - 'Ň' => 'ň', - 'Ŋ' => 'ŋ', - 'Ō' => 'ō', - 'Ŏ' => 'ŏ', - 'Ő' => 'ő', - 'Œ' => 'œ', - 'Ŕ' => 'ŕ', - 'Ŗ' => 'ŗ', - 'Ř' => 'ř', - 'Ś' => 'ś', - 'Ŝ' => 'ŝ', - 'Ş' => 'ş', - 'Š' => 'š', - 'Ţ' => 'ţ', - 'Ť' => 'ť', - 'Ŧ' => 'ŧ', - 'Ũ' => 'ũ', - 'Ū' => 'ū', - 'Ŭ' => 'ŭ', - 'Ů' => 'ů', - 'Ű' => 'ű', - 'Ų' => 'ų', - 'Ŵ' => 'ŵ', - 'Ŷ' => 'ŷ', - 'Ÿ' => 'ÿ', - 'Ź' => 'ź', - 'Ż' => 'ż', - 'Ž' => 'ž', - 'Ɓ' => 'ɓ', - 'Ƃ' => 'ƃ', - 'Ƅ' => 'ƅ', - 'Ɔ' => 'ɔ', - 'Ƈ' => 'ƈ', - 'Ɖ' => 'ɖ', - 'Ɗ' => 'ɗ', - 'Ƌ' => 'ƌ', - 'Ǝ' => 'ǝ', - 'Ə' => 'ə', - 'Ɛ' => 'ɛ', - 'Ƒ' => 'ƒ', - 'Ɠ' => 'ɠ', - 'Ɣ' => 'ɣ', - 'Ɩ' => 'ɩ', - 'Ɨ' => 'ɨ', - 'Ƙ' => 'ƙ', - 'Ɯ' => 'ɯ', - 'Ɲ' => 'ɲ', - 'Ɵ' => 'ɵ', - 'Ơ' => 'ơ', - 'Ƣ' => 'ƣ', - 'Ƥ' => 'ƥ', - 'Ʀ' => 'ʀ', - 'Ƨ' => 'ƨ', - 'Ʃ' => 'ʃ', - 'Ƭ' => 'ƭ', - 'Ʈ' => 'ʈ', - 'Ư' => 'ư', - 'Ʊ' => 'ʊ', - 'Ʋ' => 'ʋ', - 'Ƴ' => 'ƴ', - 'Ƶ' => 'ƶ', - 'Ʒ' => 'ʒ', - 'Ƹ' => 'ƹ', - 'Ƽ' => 'ƽ', - 'DŽ' => 'dž', - 'Dž' => 'dž', - 'LJ' => 'lj', - 'Lj' => 'lj', - 'NJ' => 'nj', - 'Nj' => 'nj', - 'Ǎ' => 'ǎ', - 'Ǐ' => 'ǐ', - 'Ǒ' => 'ǒ', - 'Ǔ' => 'ǔ', - 'Ǖ' => 'ǖ', - 'Ǘ' => 'ǘ', - 'Ǚ' => 'ǚ', - 'Ǜ' => 'ǜ', - 'Ǟ' => 'ǟ', - 'Ǡ' => 'ǡ', - 'Ǣ' => 'ǣ', - 'Ǥ' => 'ǥ', - 'Ǧ' => 'ǧ', - 'Ǩ' => 'ǩ', - 'Ǫ' => 'ǫ', - 'Ǭ' => 'ǭ', - 'Ǯ' => 'ǯ', - 'DZ' => 'dz', - 'Dz' => 'dz', - 'Ǵ' => 'ǵ', - 'Ƕ' => 'ƕ', - 'Ƿ' => 'ƿ', - 'Ǹ' => 'ǹ', - 'Ǻ' => 'ǻ', - 'Ǽ' => 'ǽ', - 'Ǿ' => 'ǿ', - 'Ȁ' => 'ȁ', - 'Ȃ' => 'ȃ', - 'Ȅ' => 'ȅ', - 'Ȇ' => 'ȇ', - 'Ȉ' => 'ȉ', - 'Ȋ' => 'ȋ', - 'Ȍ' => 'ȍ', - 'Ȏ' => 'ȏ', - 'Ȑ' => 'ȑ', - 'Ȓ' => 'ȓ', - 'Ȕ' => 'ȕ', - 'Ȗ' => 'ȗ', - 'Ș' => 'ș', - 'Ț' => 'ț', - 'Ȝ' => 'ȝ', - 'Ȟ' => 'ȟ', - 'Ƞ' => 'ƞ', - 'Ȣ' => 'ȣ', - 'Ȥ' => 'ȥ', - 'Ȧ' => 'ȧ', - 'Ȩ' => 'ȩ', - 'Ȫ' => 'ȫ', - 'Ȭ' => 'ȭ', - 'Ȯ' => 'ȯ', - 'Ȱ' => 'ȱ', - 'Ȳ' => 'ȳ', - 'Ⱥ' => 'ⱥ', - 'Ȼ' => 'ȼ', - 'Ƚ' => 'ƚ', - 'Ⱦ' => 'ⱦ', - 'Ɂ' => 'ɂ', - 'Ƀ' => 'ƀ', - 'Ʉ' => 'ʉ', - 'Ʌ' => 'ʌ', - 'Ɇ' => 'ɇ', - 'Ɉ' => 'ɉ', - 'Ɋ' => 'ɋ', - 'Ɍ' => 'ɍ', - 'Ɏ' => 'ɏ', - 'Ͱ' => 'ͱ', - 'Ͳ' => 'ͳ', - 'Ͷ' => 'ͷ', - 'Ϳ' => 'ϳ', - 'Ά' => 'ά', - 'Έ' => 'έ', - 'Ή' => 'ή', - 'Ί' => 'ί', - 'Ό' => 'ό', - 'Ύ' => 'ύ', - 'Ώ' => 'ώ', - 'Α' => 'α', - 'Β' => 'β', - 'Γ' => 'γ', - 'Δ' => 'δ', - 'Ε' => 'ε', - 'Ζ' => 'ζ', - 'Η' => 'η', - 'Θ' => 'θ', - 'Ι' => 'ι', - 'Κ' => 'κ', - 'Λ' => 'λ', - 'Μ' => 'μ', - 'Ν' => 'ν', - 'Ξ' => 'ξ', - 'Ο' => 'ο', - 'Π' => 'π', - 'Ρ' => 'ρ', - 'Σ' => 'σ', - 'Τ' => 'τ', - 'Υ' => 'υ', - 'Φ' => 'φ', - 'Χ' => 'χ', - 'Ψ' => 'ψ', - 'Ω' => 'ω', - 'Ϊ' => 'ϊ', - 'Ϋ' => 'ϋ', - 'Ϗ' => 'ϗ', - 'Ϙ' => 'ϙ', - 'Ϛ' => 'ϛ', - 'Ϝ' => 'ϝ', - 'Ϟ' => 'ϟ', - 'Ϡ' => 'ϡ', - 'Ϣ' => 'ϣ', - 'Ϥ' => 'ϥ', - 'Ϧ' => 'ϧ', - 'Ϩ' => 'ϩ', - 'Ϫ' => 'ϫ', - 'Ϭ' => 'ϭ', - 'Ϯ' => 'ϯ', - 'ϴ' => 'θ', - 'Ϸ' => 'ϸ', - 'Ϲ' => 'ϲ', - 'Ϻ' => 'ϻ', - 'Ͻ' => 'ͻ', - 'Ͼ' => 'ͼ', - 'Ͽ' => 'ͽ', - 'Ѐ' => 'ѐ', - 'Ё' => 'ё', - 'Ђ' => 'ђ', - 'Ѓ' => 'ѓ', - 'Є' => 'є', - 'Ѕ' => 'ѕ', - 'І' => 'і', - 'Ї' => 'ї', - 'Ј' => 'ј', - 'Љ' => 'љ', - 'Њ' => 'њ', - 'Ћ' => 'ћ', - 'Ќ' => 'ќ', - 'Ѝ' => 'ѝ', - 'Ў' => 'ў', - 'Џ' => 'џ', - 'А' => 'а', - 'Б' => 'б', - 'В' => 'в', - 'Г' => 'г', - 'Д' => 'д', - 'Е' => 'е', - 'Ж' => 'ж', - 'З' => 'з', - 'И' => 'и', - 'Й' => 'й', - 'К' => 'к', - 'Л' => 'л', - 'М' => 'м', - 'Н' => 'н', - 'О' => 'о', - 'П' => 'п', - 'Р' => 'р', - 'С' => 'с', - 'Т' => 'т', - 'У' => 'у', - 'Ф' => 'ф', - 'Х' => 'х', - 'Ц' => 'ц', - 'Ч' => 'ч', - 'Ш' => 'ш', - 'Щ' => 'щ', - 'Ъ' => 'ъ', - 'Ы' => 'ы', - 'Ь' => 'ь', - 'Э' => 'э', - 'Ю' => 'ю', - 'Я' => 'я', - 'Ѡ' => 'ѡ', - 'Ѣ' => 'ѣ', - 'Ѥ' => 'ѥ', - 'Ѧ' => 'ѧ', - 'Ѩ' => 'ѩ', - 'Ѫ' => 'ѫ', - 'Ѭ' => 'ѭ', - 'Ѯ' => 'ѯ', - 'Ѱ' => 'ѱ', - 'Ѳ' => 'ѳ', - 'Ѵ' => 'ѵ', - 'Ѷ' => 'ѷ', - 'Ѹ' => 'ѹ', - 'Ѻ' => 'ѻ', - 'Ѽ' => 'ѽ', - 'Ѿ' => 'ѿ', - 'Ҁ' => 'ҁ', - 'Ҋ' => 'ҋ', - 'Ҍ' => 'ҍ', - 'Ҏ' => 'ҏ', - 'Ґ' => 'ґ', - 'Ғ' => 'ғ', - 'Ҕ' => 'ҕ', - 'Җ' => 'җ', - 'Ҙ' => 'ҙ', - 'Қ' => 'қ', - 'Ҝ' => 'ҝ', - 'Ҟ' => 'ҟ', - 'Ҡ' => 'ҡ', - 'Ң' => 'ң', - 'Ҥ' => 'ҥ', - 'Ҧ' => 'ҧ', - 'Ҩ' => 'ҩ', - 'Ҫ' => 'ҫ', - 'Ҭ' => 'ҭ', - 'Ү' => 'ү', - 'Ұ' => 'ұ', - 'Ҳ' => 'ҳ', - 'Ҵ' => 'ҵ', - 'Ҷ' => 'ҷ', - 'Ҹ' => 'ҹ', - 'Һ' => 'һ', - 'Ҽ' => 'ҽ', - 'Ҿ' => 'ҿ', - 'Ӏ' => 'ӏ', - 'Ӂ' => 'ӂ', - 'Ӄ' => 'ӄ', - 'Ӆ' => 'ӆ', - 'Ӈ' => 'ӈ', - 'Ӊ' => 'ӊ', - 'Ӌ' => 'ӌ', - 'Ӎ' => 'ӎ', - 'Ӑ' => 'ӑ', - 'Ӓ' => 'ӓ', - 'Ӕ' => 'ӕ', - 'Ӗ' => 'ӗ', - 'Ә' => 'ә', - 'Ӛ' => 'ӛ', - 'Ӝ' => 'ӝ', - 'Ӟ' => 'ӟ', - 'Ӡ' => 'ӡ', - 'Ӣ' => 'ӣ', - 'Ӥ' => 'ӥ', - 'Ӧ' => 'ӧ', - 'Ө' => 'ө', - 'Ӫ' => 'ӫ', - 'Ӭ' => 'ӭ', - 'Ӯ' => 'ӯ', - 'Ӱ' => 'ӱ', - 'Ӳ' => 'ӳ', - 'Ӵ' => 'ӵ', - 'Ӷ' => 'ӷ', - 'Ӹ' => 'ӹ', - 'Ӻ' => 'ӻ', - 'Ӽ' => 'ӽ', - 'Ӿ' => 'ӿ', - 'Ԁ' => 'ԁ', - 'Ԃ' => 'ԃ', - 'Ԅ' => 'ԅ', - 'Ԇ' => 'ԇ', - 'Ԉ' => 'ԉ', - 'Ԋ' => 'ԋ', - 'Ԍ' => 'ԍ', - 'Ԏ' => 'ԏ', - 'Ԑ' => 'ԑ', - 'Ԓ' => 'ԓ', - 'Ԕ' => 'ԕ', - 'Ԗ' => 'ԗ', - 'Ԙ' => 'ԙ', - 'Ԛ' => 'ԛ', - 'Ԝ' => 'ԝ', - 'Ԟ' => 'ԟ', - 'Ԡ' => 'ԡ', - 'Ԣ' => 'ԣ', - 'Ԥ' => 'ԥ', - 'Ԧ' => 'ԧ', - 'Ԩ' => 'ԩ', - 'Ԫ' => 'ԫ', - 'Ԭ' => 'ԭ', - 'Ԯ' => 'ԯ', - 'Ա' => 'ա', - 'Բ' => 'բ', - 'Գ' => 'գ', - 'Դ' => 'դ', - 'Ե' => 'ե', - 'Զ' => 'զ', - 'Է' => 'է', - 'Ը' => 'ը', - 'Թ' => 'թ', - 'Ժ' => 'ժ', - 'Ի' => 'ի', - 'Լ' => 'լ', - 'Խ' => 'խ', - 'Ծ' => 'ծ', - 'Կ' => 'կ', - 'Հ' => 'հ', - 'Ձ' => 'ձ', - 'Ղ' => 'ղ', - 'Ճ' => 'ճ', - 'Մ' => 'մ', - 'Յ' => 'յ', - 'Ն' => 'ն', - 'Շ' => 'շ', - 'Ո' => 'ո', - 'Չ' => 'չ', - 'Պ' => 'պ', - 'Ջ' => 'ջ', - 'Ռ' => 'ռ', - 'Ս' => 'ս', - 'Վ' => 'վ', - 'Տ' => 'տ', - 'Ր' => 'ր', - 'Ց' => 'ց', - 'Ւ' => 'ւ', - 'Փ' => 'փ', - 'Ք' => 'ք', - 'Օ' => 'օ', - 'Ֆ' => 'ֆ', - 'Ⴀ' => 'ⴀ', - 'Ⴁ' => 'ⴁ', - 'Ⴂ' => 'ⴂ', - 'Ⴃ' => 'ⴃ', - 'Ⴄ' => 'ⴄ', - 'Ⴅ' => 'ⴅ', - 'Ⴆ' => 'ⴆ', - 'Ⴇ' => 'ⴇ', - 'Ⴈ' => 'ⴈ', - 'Ⴉ' => 'ⴉ', - 'Ⴊ' => 'ⴊ', - 'Ⴋ' => 'ⴋ', - 'Ⴌ' => 'ⴌ', - 'Ⴍ' => 'ⴍ', - 'Ⴎ' => 'ⴎ', - 'Ⴏ' => 'ⴏ', - 'Ⴐ' => 'ⴐ', - 'Ⴑ' => 'ⴑ', - 'Ⴒ' => 'ⴒ', - 'Ⴓ' => 'ⴓ', - 'Ⴔ' => 'ⴔ', - 'Ⴕ' => 'ⴕ', - 'Ⴖ' => 'ⴖ', - 'Ⴗ' => 'ⴗ', - 'Ⴘ' => 'ⴘ', - 'Ⴙ' => 'ⴙ', - 'Ⴚ' => 'ⴚ', - 'Ⴛ' => 'ⴛ', - 'Ⴜ' => 'ⴜ', - 'Ⴝ' => 'ⴝ', - 'Ⴞ' => 'ⴞ', - 'Ⴟ' => 'ⴟ', - 'Ⴠ' => 'ⴠ', - 'Ⴡ' => 'ⴡ', - 'Ⴢ' => 'ⴢ', - 'Ⴣ' => 'ⴣ', - 'Ⴤ' => 'ⴤ', - 'Ⴥ' => 'ⴥ', - 'Ⴧ' => 'ⴧ', - 'Ⴭ' => 'ⴭ', - 'Ꭰ' => 'ꭰ', - 'Ꭱ' => 'ꭱ', - 'Ꭲ' => 'ꭲ', - 'Ꭳ' => 'ꭳ', - 'Ꭴ' => 'ꭴ', - 'Ꭵ' => 'ꭵ', - 'Ꭶ' => 'ꭶ', - 'Ꭷ' => 'ꭷ', - 'Ꭸ' => 'ꭸ', - 'Ꭹ' => 'ꭹ', - 'Ꭺ' => 'ꭺ', - 'Ꭻ' => 'ꭻ', - 'Ꭼ' => 'ꭼ', - 'Ꭽ' => 'ꭽ', - 'Ꭾ' => 'ꭾ', - 'Ꭿ' => 'ꭿ', - 'Ꮀ' => 'ꮀ', - 'Ꮁ' => 'ꮁ', - 'Ꮂ' => 'ꮂ', - 'Ꮃ' => 'ꮃ', - 'Ꮄ' => 'ꮄ', - 'Ꮅ' => 'ꮅ', - 'Ꮆ' => 'ꮆ', - 'Ꮇ' => 'ꮇ', - 'Ꮈ' => 'ꮈ', - 'Ꮉ' => 'ꮉ', - 'Ꮊ' => 'ꮊ', - 'Ꮋ' => 'ꮋ', - 'Ꮌ' => 'ꮌ', - 'Ꮍ' => 'ꮍ', - 'Ꮎ' => 'ꮎ', - 'Ꮏ' => 'ꮏ', - 'Ꮐ' => 'ꮐ', - 'Ꮑ' => 'ꮑ', - 'Ꮒ' => 'ꮒ', - 'Ꮓ' => 'ꮓ', - 'Ꮔ' => 'ꮔ', - 'Ꮕ' => 'ꮕ', - 'Ꮖ' => 'ꮖ', - 'Ꮗ' => 'ꮗ', - 'Ꮘ' => 'ꮘ', - 'Ꮙ' => 'ꮙ', - 'Ꮚ' => 'ꮚ', - 'Ꮛ' => 'ꮛ', - 'Ꮜ' => 'ꮜ', - 'Ꮝ' => 'ꮝ', - 'Ꮞ' => 'ꮞ', - 'Ꮟ' => 'ꮟ', - 'Ꮠ' => 'ꮠ', - 'Ꮡ' => 'ꮡ', - 'Ꮢ' => 'ꮢ', - 'Ꮣ' => 'ꮣ', - 'Ꮤ' => 'ꮤ', - 'Ꮥ' => 'ꮥ', - 'Ꮦ' => 'ꮦ', - 'Ꮧ' => 'ꮧ', - 'Ꮨ' => 'ꮨ', - 'Ꮩ' => 'ꮩ', - 'Ꮪ' => 'ꮪ', - 'Ꮫ' => 'ꮫ', - 'Ꮬ' => 'ꮬ', - 'Ꮭ' => 'ꮭ', - 'Ꮮ' => 'ꮮ', - 'Ꮯ' => 'ꮯ', - 'Ꮰ' => 'ꮰ', - 'Ꮱ' => 'ꮱ', - 'Ꮲ' => 'ꮲ', - 'Ꮳ' => 'ꮳ', - 'Ꮴ' => 'ꮴ', - 'Ꮵ' => 'ꮵ', - 'Ꮶ' => 'ꮶ', - 'Ꮷ' => 'ꮷ', - 'Ꮸ' => 'ꮸ', - 'Ꮹ' => 'ꮹ', - 'Ꮺ' => 'ꮺ', - 'Ꮻ' => 'ꮻ', - 'Ꮼ' => 'ꮼ', - 'Ꮽ' => 'ꮽ', - 'Ꮾ' => 'ꮾ', - 'Ꮿ' => 'ꮿ', - 'Ᏸ' => 'ᏸ', - 'Ᏹ' => 'ᏹ', - 'Ᏺ' => 'ᏺ', - 'Ᏻ' => 'ᏻ', - 'Ᏼ' => 'ᏼ', - 'Ᏽ' => 'ᏽ', - 'Ა' => 'ა', - 'Ბ' => 'ბ', - 'Გ' => 'გ', - 'Დ' => 'დ', - 'Ე' => 'ე', - 'Ვ' => 'ვ', - 'Ზ' => 'ზ', - 'Თ' => 'თ', - 'Ი' => 'ი', - 'Კ' => 'კ', - 'Ლ' => 'ლ', - 'Მ' => 'მ', - 'Ნ' => 'ნ', - 'Ო' => 'ო', - 'Პ' => 'პ', - 'Ჟ' => 'ჟ', - 'Რ' => 'რ', - 'Ს' => 'ს', - 'Ტ' => 'ტ', - 'Უ' => 'უ', - 'Ფ' => 'ფ', - 'Ქ' => 'ქ', - 'Ღ' => 'ღ', - 'Ყ' => 'ყ', - 'Შ' => 'შ', - 'Ჩ' => 'ჩ', - 'Ც' => 'ც', - 'Ძ' => 'ძ', - 'Წ' => 'წ', - 'Ჭ' => 'ჭ', - 'Ხ' => 'ხ', - 'Ჯ' => 'ჯ', - 'Ჰ' => 'ჰ', - 'Ჱ' => 'ჱ', - 'Ჲ' => 'ჲ', - 'Ჳ' => 'ჳ', - 'Ჴ' => 'ჴ', - 'Ჵ' => 'ჵ', - 'Ჶ' => 'ჶ', - 'Ჷ' => 'ჷ', - 'Ჸ' => 'ჸ', - 'Ჹ' => 'ჹ', - 'Ჺ' => 'ჺ', - 'Ჽ' => 'ჽ', - 'Ჾ' => 'ჾ', - 'Ჿ' => 'ჿ', - 'Ḁ' => 'ḁ', - 'Ḃ' => 'ḃ', - 'Ḅ' => 'ḅ', - 'Ḇ' => 'ḇ', - 'Ḉ' => 'ḉ', - 'Ḋ' => 'ḋ', - 'Ḍ' => 'ḍ', - 'Ḏ' => 'ḏ', - 'Ḑ' => 'ḑ', - 'Ḓ' => 'ḓ', - 'Ḕ' => 'ḕ', - 'Ḗ' => 'ḗ', - 'Ḙ' => 'ḙ', - 'Ḛ' => 'ḛ', - 'Ḝ' => 'ḝ', - 'Ḟ' => 'ḟ', - 'Ḡ' => 'ḡ', - 'Ḣ' => 'ḣ', - 'Ḥ' => 'ḥ', - 'Ḧ' => 'ḧ', - 'Ḩ' => 'ḩ', - 'Ḫ' => 'ḫ', - 'Ḭ' => 'ḭ', - 'Ḯ' => 'ḯ', - 'Ḱ' => 'ḱ', - 'Ḳ' => 'ḳ', - 'Ḵ' => 'ḵ', - 'Ḷ' => 'ḷ', - 'Ḹ' => 'ḹ', - 'Ḻ' => 'ḻ', - 'Ḽ' => 'ḽ', - 'Ḿ' => 'ḿ', - 'Ṁ' => 'ṁ', - 'Ṃ' => 'ṃ', - 'Ṅ' => 'ṅ', - 'Ṇ' => 'ṇ', - 'Ṉ' => 'ṉ', - 'Ṋ' => 'ṋ', - 'Ṍ' => 'ṍ', - 'Ṏ' => 'ṏ', - 'Ṑ' => 'ṑ', - 'Ṓ' => 'ṓ', - 'Ṕ' => 'ṕ', - 'Ṗ' => 'ṗ', - 'Ṙ' => 'ṙ', - 'Ṛ' => 'ṛ', - 'Ṝ' => 'ṝ', - 'Ṟ' => 'ṟ', - 'Ṡ' => 'ṡ', - 'Ṣ' => 'ṣ', - 'Ṥ' => 'ṥ', - 'Ṧ' => 'ṧ', - 'Ṩ' => 'ṩ', - 'Ṫ' => 'ṫ', - 'Ṭ' => 'ṭ', - 'Ṯ' => 'ṯ', - 'Ṱ' => 'ṱ', - 'Ṳ' => 'ṳ', - 'Ṵ' => 'ṵ', - 'Ṷ' => 'ṷ', - 'Ṹ' => 'ṹ', - 'Ṻ' => 'ṻ', - 'Ṽ' => 'ṽ', - 'Ṿ' => 'ṿ', - 'Ẁ' => 'ẁ', - 'Ẃ' => 'ẃ', - 'Ẅ' => 'ẅ', - 'Ẇ' => 'ẇ', - 'Ẉ' => 'ẉ', - 'Ẋ' => 'ẋ', - 'Ẍ' => 'ẍ', - 'Ẏ' => 'ẏ', - 'Ẑ' => 'ẑ', - 'Ẓ' => 'ẓ', - 'Ẕ' => 'ẕ', - 'ẞ' => 'ß', - 'Ạ' => 'ạ', - 'Ả' => 'ả', - 'Ấ' => 'ấ', - 'Ầ' => 'ầ', - 'Ẩ' => 'ẩ', - 'Ẫ' => 'ẫ', - 'Ậ' => 'ậ', - 'Ắ' => 'ắ', - 'Ằ' => 'ằ', - 'Ẳ' => 'ẳ', - 'Ẵ' => 'ẵ', - 'Ặ' => 'ặ', - 'Ẹ' => 'ẹ', - 'Ẻ' => 'ẻ', - 'Ẽ' => 'ẽ', - 'Ế' => 'ế', - 'Ề' => 'ề', - 'Ể' => 'ể', - 'Ễ' => 'ễ', - 'Ệ' => 'ệ', - 'Ỉ' => 'ỉ', - 'Ị' => 'ị', - 'Ọ' => 'ọ', - 'Ỏ' => 'ỏ', - 'Ố' => 'ố', - 'Ồ' => 'ồ', - 'Ổ' => 'ổ', - 'Ỗ' => 'ỗ', - 'Ộ' => 'ộ', - 'Ớ' => 'ớ', - 'Ờ' => 'ờ', - 'Ở' => 'ở', - 'Ỡ' => 'ỡ', - 'Ợ' => 'ợ', - 'Ụ' => 'ụ', - 'Ủ' => 'ủ', - 'Ứ' => 'ứ', - 'Ừ' => 'ừ', - 'Ử' => 'ử', - 'Ữ' => 'ữ', - 'Ự' => 'ự', - 'Ỳ' => 'ỳ', - 'Ỵ' => 'ỵ', - 'Ỷ' => 'ỷ', - 'Ỹ' => 'ỹ', - 'Ỻ' => 'ỻ', - 'Ỽ' => 'ỽ', - 'Ỿ' => 'ỿ', - 'Ἀ' => 'ἀ', - 'Ἁ' => 'ἁ', - 'Ἂ' => 'ἂ', - 'Ἃ' => 'ἃ', - 'Ἄ' => 'ἄ', - 'Ἅ' => 'ἅ', - 'Ἆ' => 'ἆ', - 'Ἇ' => 'ἇ', - 'Ἐ' => 'ἐ', - 'Ἑ' => 'ἑ', - 'Ἒ' => 'ἒ', - 'Ἓ' => 'ἓ', - 'Ἔ' => 'ἔ', - 'Ἕ' => 'ἕ', - 'Ἠ' => 'ἠ', - 'Ἡ' => 'ἡ', - 'Ἢ' => 'ἢ', - 'Ἣ' => 'ἣ', - 'Ἤ' => 'ἤ', - 'Ἥ' => 'ἥ', - 'Ἦ' => 'ἦ', - 'Ἧ' => 'ἧ', - 'Ἰ' => 'ἰ', - 'Ἱ' => 'ἱ', - 'Ἲ' => 'ἲ', - 'Ἳ' => 'ἳ', - 'Ἴ' => 'ἴ', - 'Ἵ' => 'ἵ', - 'Ἶ' => 'ἶ', - 'Ἷ' => 'ἷ', - 'Ὀ' => 'ὀ', - 'Ὁ' => 'ὁ', - 'Ὂ' => 'ὂ', - 'Ὃ' => 'ὃ', - 'Ὄ' => 'ὄ', - 'Ὅ' => 'ὅ', - 'Ὑ' => 'ὑ', - 'Ὓ' => 'ὓ', - 'Ὕ' => 'ὕ', - 'Ὗ' => 'ὗ', - 'Ὠ' => 'ὠ', - 'Ὡ' => 'ὡ', - 'Ὢ' => 'ὢ', - 'Ὣ' => 'ὣ', - 'Ὤ' => 'ὤ', - 'Ὥ' => 'ὥ', - 'Ὦ' => 'ὦ', - 'Ὧ' => 'ὧ', - 'ᾈ' => 'ᾀ', - 'ᾉ' => 'ᾁ', - 'ᾊ' => 'ᾂ', - 'ᾋ' => 'ᾃ', - 'ᾌ' => 'ᾄ', - 'ᾍ' => 'ᾅ', - 'ᾎ' => 'ᾆ', - 'ᾏ' => 'ᾇ', - 'ᾘ' => 'ᾐ', - 'ᾙ' => 'ᾑ', - 'ᾚ' => 'ᾒ', - 'ᾛ' => 'ᾓ', - 'ᾜ' => 'ᾔ', - 'ᾝ' => 'ᾕ', - 'ᾞ' => 'ᾖ', - 'ᾟ' => 'ᾗ', - 'ᾨ' => 'ᾠ', - 'ᾩ' => 'ᾡ', - 'ᾪ' => 'ᾢ', - 'ᾫ' => 'ᾣ', - 'ᾬ' => 'ᾤ', - 'ᾭ' => 'ᾥ', - 'ᾮ' => 'ᾦ', - 'ᾯ' => 'ᾧ', - 'Ᾰ' => 'ᾰ', - 'Ᾱ' => 'ᾱ', - 'Ὰ' => 'ὰ', - 'Ά' => 'ά', - 'ᾼ' => 'ᾳ', - 'Ὲ' => 'ὲ', - 'Έ' => 'έ', - 'Ὴ' => 'ὴ', - 'Ή' => 'ή', - 'ῌ' => 'ῃ', - 'Ῐ' => 'ῐ', - 'Ῑ' => 'ῑ', - 'Ὶ' => 'ὶ', - 'Ί' => 'ί', - 'Ῠ' => 'ῠ', - 'Ῡ' => 'ῡ', - 'Ὺ' => 'ὺ', - 'Ύ' => 'ύ', - 'Ῥ' => 'ῥ', - 'Ὸ' => 'ὸ', - 'Ό' => 'ό', - 'Ὼ' => 'ὼ', - 'Ώ' => 'ώ', - 'ῼ' => 'ῳ', - 'Ω' => 'ω', - 'K' => 'k', - 'Å' => 'å', - 'Ⅎ' => 'ⅎ', - 'Ⅰ' => 'ⅰ', - 'Ⅱ' => 'ⅱ', - 'Ⅲ' => 'ⅲ', - 'Ⅳ' => 'ⅳ', - 'Ⅴ' => 'ⅴ', - 'Ⅵ' => 'ⅵ', - 'Ⅶ' => 'ⅶ', - 'Ⅷ' => 'ⅷ', - 'Ⅸ' => 'ⅸ', - 'Ⅹ' => 'ⅹ', - 'Ⅺ' => 'ⅺ', - 'Ⅻ' => 'ⅻ', - 'Ⅼ' => 'ⅼ', - 'Ⅽ' => 'ⅽ', - 'Ⅾ' => 'ⅾ', - 'Ⅿ' => 'ⅿ', - 'Ↄ' => 'ↄ', - 'Ⓐ' => 'ⓐ', - 'Ⓑ' => 'ⓑ', - 'Ⓒ' => 'ⓒ', - 'Ⓓ' => 'ⓓ', - 'Ⓔ' => 'ⓔ', - 'Ⓕ' => 'ⓕ', - 'Ⓖ' => 'ⓖ', - 'Ⓗ' => 'ⓗ', - 'Ⓘ' => 'ⓘ', - 'Ⓙ' => 'ⓙ', - 'Ⓚ' => 'ⓚ', - 'Ⓛ' => 'ⓛ', - 'Ⓜ' => 'ⓜ', - 'Ⓝ' => 'ⓝ', - 'Ⓞ' => 'ⓞ', - 'Ⓟ' => 'ⓟ', - 'Ⓠ' => 'ⓠ', - 'Ⓡ' => 'ⓡ', - 'Ⓢ' => 'ⓢ', - 'Ⓣ' => 'ⓣ', - 'Ⓤ' => 'ⓤ', - 'Ⓥ' => 'ⓥ', - 'Ⓦ' => 'ⓦ', - 'Ⓧ' => 'ⓧ', - 'Ⓨ' => 'ⓨ', - 'Ⓩ' => 'ⓩ', - 'Ⰰ' => 'ⰰ', - 'Ⰱ' => 'ⰱ', - 'Ⰲ' => 'ⰲ', - 'Ⰳ' => 'ⰳ', - 'Ⰴ' => 'ⰴ', - 'Ⰵ' => 'ⰵ', - 'Ⰶ' => 'ⰶ', - 'Ⰷ' => 'ⰷ', - 'Ⰸ' => 'ⰸ', - 'Ⰹ' => 'ⰹ', - 'Ⰺ' => 'ⰺ', - 'Ⰻ' => 'ⰻ', - 'Ⰼ' => 'ⰼ', - 'Ⰽ' => 'ⰽ', - 'Ⰾ' => 'ⰾ', - 'Ⰿ' => 'ⰿ', - 'Ⱀ' => 'ⱀ', - 'Ⱁ' => 'ⱁ', - 'Ⱂ' => 'ⱂ', - 'Ⱃ' => 'ⱃ', - 'Ⱄ' => 'ⱄ', - 'Ⱅ' => 'ⱅ', - 'Ⱆ' => 'ⱆ', - 'Ⱇ' => 'ⱇ', - 'Ⱈ' => 'ⱈ', - 'Ⱉ' => 'ⱉ', - 'Ⱊ' => 'ⱊ', - 'Ⱋ' => 'ⱋ', - 'Ⱌ' => 'ⱌ', - 'Ⱍ' => 'ⱍ', - 'Ⱎ' => 'ⱎ', - 'Ⱏ' => 'ⱏ', - 'Ⱐ' => 'ⱐ', - 'Ⱑ' => 'ⱑ', - 'Ⱒ' => 'ⱒ', - 'Ⱓ' => 'ⱓ', - 'Ⱔ' => 'ⱔ', - 'Ⱕ' => 'ⱕ', - 'Ⱖ' => 'ⱖ', - 'Ⱗ' => 'ⱗ', - 'Ⱘ' => 'ⱘ', - 'Ⱙ' => 'ⱙ', - 'Ⱚ' => 'ⱚ', - 'Ⱛ' => 'ⱛ', - 'Ⱜ' => 'ⱜ', - 'Ⱝ' => 'ⱝ', - 'Ⱞ' => 'ⱞ', - 'Ⱡ' => 'ⱡ', - 'Ɫ' => 'ɫ', - 'Ᵽ' => 'ᵽ', - 'Ɽ' => 'ɽ', - 'Ⱨ' => 'ⱨ', - 'Ⱪ' => 'ⱪ', - 'Ⱬ' => 'ⱬ', - 'Ɑ' => 'ɑ', - 'Ɱ' => 'ɱ', - 'Ɐ' => 'ɐ', - 'Ɒ' => 'ɒ', - 'Ⱳ' => 'ⱳ', - 'Ⱶ' => 'ⱶ', - 'Ȿ' => 'ȿ', - 'Ɀ' => 'ɀ', - 'Ⲁ' => 'ⲁ', - 'Ⲃ' => 'ⲃ', - 'Ⲅ' => 'ⲅ', - 'Ⲇ' => 'ⲇ', - 'Ⲉ' => 'ⲉ', - 'Ⲋ' => 'ⲋ', - 'Ⲍ' => 'ⲍ', - 'Ⲏ' => 'ⲏ', - 'Ⲑ' => 'ⲑ', - 'Ⲓ' => 'ⲓ', - 'Ⲕ' => 'ⲕ', - 'Ⲗ' => 'ⲗ', - 'Ⲙ' => 'ⲙ', - 'Ⲛ' => 'ⲛ', - 'Ⲝ' => 'ⲝ', - 'Ⲟ' => 'ⲟ', - 'Ⲡ' => 'ⲡ', - 'Ⲣ' => 'ⲣ', - 'Ⲥ' => 'ⲥ', - 'Ⲧ' => 'ⲧ', - 'Ⲩ' => 'ⲩ', - 'Ⲫ' => 'ⲫ', - 'Ⲭ' => 'ⲭ', - 'Ⲯ' => 'ⲯ', - 'Ⲱ' => 'ⲱ', - 'Ⲳ' => 'ⲳ', - 'Ⲵ' => 'ⲵ', - 'Ⲷ' => 'ⲷ', - 'Ⲹ' => 'ⲹ', - 'Ⲻ' => 'ⲻ', - 'Ⲽ' => 'ⲽ', - 'Ⲿ' => 'ⲿ', - 'Ⳁ' => 'ⳁ', - 'Ⳃ' => 'ⳃ', - 'Ⳅ' => 'ⳅ', - 'Ⳇ' => 'ⳇ', - 'Ⳉ' => 'ⳉ', - 'Ⳋ' => 'ⳋ', - 'Ⳍ' => 'ⳍ', - 'Ⳏ' => 'ⳏ', - 'Ⳑ' => 'ⳑ', - 'Ⳓ' => 'ⳓ', - 'Ⳕ' => 'ⳕ', - 'Ⳗ' => 'ⳗ', - 'Ⳙ' => 'ⳙ', - 'Ⳛ' => 'ⳛ', - 'Ⳝ' => 'ⳝ', - 'Ⳟ' => 'ⳟ', - 'Ⳡ' => 'ⳡ', - 'Ⳣ' => 'ⳣ', - 'Ⳬ' => 'ⳬ', - 'Ⳮ' => 'ⳮ', - 'Ⳳ' => 'ⳳ', - 'Ꙁ' => 'ꙁ', - 'Ꙃ' => 'ꙃ', - 'Ꙅ' => 'ꙅ', - 'Ꙇ' => 'ꙇ', - 'Ꙉ' => 'ꙉ', - 'Ꙋ' => 'ꙋ', - 'Ꙍ' => 'ꙍ', - 'Ꙏ' => 'ꙏ', - 'Ꙑ' => 'ꙑ', - 'Ꙓ' => 'ꙓ', - 'Ꙕ' => 'ꙕ', - 'Ꙗ' => 'ꙗ', - 'Ꙙ' => 'ꙙ', - 'Ꙛ' => 'ꙛ', - 'Ꙝ' => 'ꙝ', - 'Ꙟ' => 'ꙟ', - 'Ꙡ' => 'ꙡ', - 'Ꙣ' => 'ꙣ', - 'Ꙥ' => 'ꙥ', - 'Ꙧ' => 'ꙧ', - 'Ꙩ' => 'ꙩ', - 'Ꙫ' => 'ꙫ', - 'Ꙭ' => 'ꙭ', - 'Ꚁ' => 'ꚁ', - 'Ꚃ' => 'ꚃ', - 'Ꚅ' => 'ꚅ', - 'Ꚇ' => 'ꚇ', - 'Ꚉ' => 'ꚉ', - 'Ꚋ' => 'ꚋ', - 'Ꚍ' => 'ꚍ', - 'Ꚏ' => 'ꚏ', - 'Ꚑ' => 'ꚑ', - 'Ꚓ' => 'ꚓ', - 'Ꚕ' => 'ꚕ', - 'Ꚗ' => 'ꚗ', - 'Ꚙ' => 'ꚙ', - 'Ꚛ' => 'ꚛ', - 'Ꜣ' => 'ꜣ', - 'Ꜥ' => 'ꜥ', - 'Ꜧ' => 'ꜧ', - 'Ꜩ' => 'ꜩ', - 'Ꜫ' => 'ꜫ', - 'Ꜭ' => 'ꜭ', - 'Ꜯ' => 'ꜯ', - 'Ꜳ' => 'ꜳ', - 'Ꜵ' => 'ꜵ', - 'Ꜷ' => 'ꜷ', - 'Ꜹ' => 'ꜹ', - 'Ꜻ' => 'ꜻ', - 'Ꜽ' => 'ꜽ', - 'Ꜿ' => 'ꜿ', - 'Ꝁ' => 'ꝁ', - 'Ꝃ' => 'ꝃ', - 'Ꝅ' => 'ꝅ', - 'Ꝇ' => 'ꝇ', - 'Ꝉ' => 'ꝉ', - 'Ꝋ' => 'ꝋ', - 'Ꝍ' => 'ꝍ', - 'Ꝏ' => 'ꝏ', - 'Ꝑ' => 'ꝑ', - 'Ꝓ' => 'ꝓ', - 'Ꝕ' => 'ꝕ', - 'Ꝗ' => 'ꝗ', - 'Ꝙ' => 'ꝙ', - 'Ꝛ' => 'ꝛ', - 'Ꝝ' => 'ꝝ', - 'Ꝟ' => 'ꝟ', - 'Ꝡ' => 'ꝡ', - 'Ꝣ' => 'ꝣ', - 'Ꝥ' => 'ꝥ', - 'Ꝧ' => 'ꝧ', - 'Ꝩ' => 'ꝩ', - 'Ꝫ' => 'ꝫ', - 'Ꝭ' => 'ꝭ', - 'Ꝯ' => 'ꝯ', - 'Ꝺ' => 'ꝺ', - 'Ꝼ' => 'ꝼ', - 'Ᵹ' => 'ᵹ', - 'Ꝿ' => 'ꝿ', - 'Ꞁ' => 'ꞁ', - 'Ꞃ' => 'ꞃ', - 'Ꞅ' => 'ꞅ', - 'Ꞇ' => 'ꞇ', - 'Ꞌ' => 'ꞌ', - 'Ɥ' => 'ɥ', - 'Ꞑ' => 'ꞑ', - 'Ꞓ' => 'ꞓ', - 'Ꞗ' => 'ꞗ', - 'Ꞙ' => 'ꞙ', - 'Ꞛ' => 'ꞛ', - 'Ꞝ' => 'ꞝ', - 'Ꞟ' => 'ꞟ', - 'Ꞡ' => 'ꞡ', - 'Ꞣ' => 'ꞣ', - 'Ꞥ' => 'ꞥ', - 'Ꞧ' => 'ꞧ', - 'Ꞩ' => 'ꞩ', - 'Ɦ' => 'ɦ', - 'Ɜ' => 'ɜ', - 'Ɡ' => 'ɡ', - 'Ɬ' => 'ɬ', - 'Ɪ' => 'ɪ', - 'Ʞ' => 'ʞ', - 'Ʇ' => 'ʇ', - 'Ʝ' => 'ʝ', - 'Ꭓ' => 'ꭓ', - 'Ꞵ' => 'ꞵ', - 'Ꞷ' => 'ꞷ', - 'Ꞹ' => 'ꞹ', - 'Ꞻ' => 'ꞻ', - 'Ꞽ' => 'ꞽ', - 'Ꞿ' => 'ꞿ', - 'Ꟃ' => 'ꟃ', - 'Ꞔ' => 'ꞔ', - 'Ʂ' => 'ʂ', - 'Ᶎ' => 'ᶎ', - 'Ꟈ' => 'ꟈ', - 'Ꟊ' => 'ꟊ', - 'Ꟶ' => 'ꟶ', - 'A' => 'a', - 'B' => 'b', - 'C' => 'c', - 'D' => 'd', - 'E' => 'e', - 'F' => 'f', - 'G' => 'g', - 'H' => 'h', - 'I' => 'i', - 'J' => 'j', - 'K' => 'k', - 'L' => 'l', - 'M' => 'm', - 'N' => 'n', - 'O' => 'o', - 'P' => 'p', - 'Q' => 'q', - 'R' => 'r', - 'S' => 's', - 'T' => 't', - 'U' => 'u', - 'V' => 'v', - 'W' => 'w', - 'X' => 'x', - 'Y' => 'y', - 'Z' => 'z', - '𐐀' => '𐐨', - '𐐁' => '𐐩', - '𐐂' => '𐐪', - '𐐃' => '𐐫', - '𐐄' => '𐐬', - '𐐅' => '𐐭', - '𐐆' => '𐐮', - '𐐇' => '𐐯', - '𐐈' => '𐐰', - '𐐉' => '𐐱', - '𐐊' => '𐐲', - '𐐋' => '𐐳', - '𐐌' => '𐐴', - '𐐍' => '𐐵', - '𐐎' => '𐐶', - '𐐏' => '𐐷', - '𐐐' => '𐐸', - '𐐑' => '𐐹', - '𐐒' => '𐐺', - '𐐓' => '𐐻', - '𐐔' => '𐐼', - '𐐕' => '𐐽', - '𐐖' => '𐐾', - '𐐗' => '𐐿', - '𐐘' => '𐑀', - '𐐙' => '𐑁', - '𐐚' => '𐑂', - '𐐛' => '𐑃', - '𐐜' => '𐑄', - '𐐝' => '𐑅', - '𐐞' => '𐑆', - '𐐟' => '𐑇', - '𐐠' => '𐑈', - '𐐡' => '𐑉', - '𐐢' => '𐑊', - '𐐣' => '𐑋', - '𐐤' => '𐑌', - '𐐥' => '𐑍', - '𐐦' => '𐑎', - '𐐧' => '𐑏', - '𐒰' => '𐓘', - '𐒱' => '𐓙', - '𐒲' => '𐓚', - '𐒳' => '𐓛', - '𐒴' => '𐓜', - '𐒵' => '𐓝', - '𐒶' => '𐓞', - '𐒷' => '𐓟', - '𐒸' => '𐓠', - '𐒹' => '𐓡', - '𐒺' => '𐓢', - '𐒻' => '𐓣', - '𐒼' => '𐓤', - '𐒽' => '𐓥', - '𐒾' => '𐓦', - '𐒿' => '𐓧', - '𐓀' => '𐓨', - '𐓁' => '𐓩', - '𐓂' => '𐓪', - '𐓃' => '𐓫', - '𐓄' => '𐓬', - '𐓅' => '𐓭', - '𐓆' => '𐓮', - '𐓇' => '𐓯', - '𐓈' => '𐓰', - '𐓉' => '𐓱', - '𐓊' => '𐓲', - '𐓋' => '𐓳', - '𐓌' => '𐓴', - '𐓍' => '𐓵', - '𐓎' => '𐓶', - '𐓏' => '𐓷', - '𐓐' => '𐓸', - '𐓑' => '𐓹', - '𐓒' => '𐓺', - '𐓓' => '𐓻', - '𐲀' => '𐳀', - '𐲁' => '𐳁', - '𐲂' => '𐳂', - '𐲃' => '𐳃', - '𐲄' => '𐳄', - '𐲅' => '𐳅', - '𐲆' => '𐳆', - '𐲇' => '𐳇', - '𐲈' => '𐳈', - '𐲉' => '𐳉', - '𐲊' => '𐳊', - '𐲋' => '𐳋', - '𐲌' => '𐳌', - '𐲍' => '𐳍', - '𐲎' => '𐳎', - '𐲏' => '𐳏', - '𐲐' => '𐳐', - '𐲑' => '𐳑', - '𐲒' => '𐳒', - '𐲓' => '𐳓', - '𐲔' => '𐳔', - '𐲕' => '𐳕', - '𐲖' => '𐳖', - '𐲗' => '𐳗', - '𐲘' => '𐳘', - '𐲙' => '𐳙', - '𐲚' => '𐳚', - '𐲛' => '𐳛', - '𐲜' => '𐳜', - '𐲝' => '𐳝', - '𐲞' => '𐳞', - '𐲟' => '𐳟', - '𐲠' => '𐳠', - '𐲡' => '𐳡', - '𐲢' => '𐳢', - '𐲣' => '𐳣', - '𐲤' => '𐳤', - '𐲥' => '𐳥', - '𐲦' => '𐳦', - '𐲧' => '𐳧', - '𐲨' => '𐳨', - '𐲩' => '𐳩', - '𐲪' => '𐳪', - '𐲫' => '𐳫', - '𐲬' => '𐳬', - '𐲭' => '𐳭', - '𐲮' => '𐳮', - '𐲯' => '𐳯', - '𐲰' => '𐳰', - '𐲱' => '𐳱', - '𐲲' => '𐳲', - '𑢠' => '𑣀', - '𑢡' => '𑣁', - '𑢢' => '𑣂', - '𑢣' => '𑣃', - '𑢤' => '𑣄', - '𑢥' => '𑣅', - '𑢦' => '𑣆', - '𑢧' => '𑣇', - '𑢨' => '𑣈', - '𑢩' => '𑣉', - '𑢪' => '𑣊', - '𑢫' => '𑣋', - '𑢬' => '𑣌', - '𑢭' => '𑣍', - '𑢮' => '𑣎', - '𑢯' => '𑣏', - '𑢰' => '𑣐', - '𑢱' => '𑣑', - '𑢲' => '𑣒', - '𑢳' => '𑣓', - '𑢴' => '𑣔', - '𑢵' => '𑣕', - '𑢶' => '𑣖', - '𑢷' => '𑣗', - '𑢸' => '𑣘', - '𑢹' => '𑣙', - '𑢺' => '𑣚', - '𑢻' => '𑣛', - '𑢼' => '𑣜', - '𑢽' => '𑣝', - '𑢾' => '𑣞', - '𑢿' => '𑣟', - '𖹀' => '𖹠', - '𖹁' => '𖹡', - '𖹂' => '𖹢', - '𖹃' => '𖹣', - '𖹄' => '𖹤', - '𖹅' => '𖹥', - '𖹆' => '𖹦', - '𖹇' => '𖹧', - '𖹈' => '𖹨', - '𖹉' => '𖹩', - '𖹊' => '𖹪', - '𖹋' => '𖹫', - '𖹌' => '𖹬', - '𖹍' => '𖹭', - '𖹎' => '𖹮', - '𖹏' => '𖹯', - '𖹐' => '𖹰', - '𖹑' => '𖹱', - '𖹒' => '𖹲', - '𖹓' => '𖹳', - '𖹔' => '𖹴', - '𖹕' => '𖹵', - '𖹖' => '𖹶', - '𖹗' => '𖹷', - '𖹘' => '𖹸', - '𖹙' => '𖹹', - '𖹚' => '𖹺', - '𖹛' => '𖹻', - '𖹜' => '𖹼', - '𖹝' => '𖹽', - '𖹞' => '𖹾', - '𖹟' => '𖹿', - '𞤀' => '𞤢', - '𞤁' => '𞤣', - '𞤂' => '𞤤', - '𞤃' => '𞤥', - '𞤄' => '𞤦', - '𞤅' => '𞤧', - '𞤆' => '𞤨', - '𞤇' => '𞤩', - '𞤈' => '𞤪', - '𞤉' => '𞤫', - '𞤊' => '𞤬', - '𞤋' => '𞤭', - '𞤌' => '𞤮', - '𞤍' => '𞤯', - '𞤎' => '𞤰', - '𞤏' => '𞤱', - '𞤐' => '𞤲', - '𞤑' => '𞤳', - '𞤒' => '𞤴', - '𞤓' => '𞤵', - '𞤔' => '𞤶', - '𞤕' => '𞤷', - '𞤖' => '𞤸', - '𞤗' => '𞤹', - '𞤘' => '𞤺', - '𞤙' => '𞤻', - '𞤚' => '𞤼', - '𞤛' => '𞤽', - '𞤜' => '𞤾', - '𞤝' => '𞤿', - '𞤞' => '𞥀', - '𞤟' => '𞥁', - '𞤠' => '𞥂', - '𞤡' => '𞥃', -); diff --git a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php b/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php deleted file mode 100644 index 2a8f6e73b..000000000 --- a/vendor/symfony/polyfill-mbstring/Resources/unidata/titleCaseRegexp.php +++ /dev/null @@ -1,5 +0,0 @@ - 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - 'µ' => 'Μ', - 'à' => 'À', - 'á' => 'Á', - 'â' => 'Â', - 'ã' => 'Ã', - 'ä' => 'Ä', - 'å' => 'Å', - 'æ' => 'Æ', - 'ç' => 'Ç', - 'è' => 'È', - 'é' => 'É', - 'ê' => 'Ê', - 'ë' => 'Ë', - 'ì' => 'Ì', - 'í' => 'Í', - 'î' => 'Î', - 'ï' => 'Ï', - 'ð' => 'Ð', - 'ñ' => 'Ñ', - 'ò' => 'Ò', - 'ó' => 'Ó', - 'ô' => 'Ô', - 'õ' => 'Õ', - 'ö' => 'Ö', - 'ø' => 'Ø', - 'ù' => 'Ù', - 'ú' => 'Ú', - 'û' => 'Û', - 'ü' => 'Ü', - 'ý' => 'Ý', - 'þ' => 'Þ', - 'ÿ' => 'Ÿ', - 'ā' => 'Ā', - 'ă' => 'Ă', - 'ą' => 'Ą', - 'ć' => 'Ć', - 'ĉ' => 'Ĉ', - 'ċ' => 'Ċ', - 'č' => 'Č', - 'ď' => 'Ď', - 'đ' => 'Đ', - 'ē' => 'Ē', - 'ĕ' => 'Ĕ', - 'ė' => 'Ė', - 'ę' => 'Ę', - 'ě' => 'Ě', - 'ĝ' => 'Ĝ', - 'ğ' => 'Ğ', - 'ġ' => 'Ġ', - 'ģ' => 'Ģ', - 'ĥ' => 'Ĥ', - 'ħ' => 'Ħ', - 'ĩ' => 'Ĩ', - 'ī' => 'Ī', - 'ĭ' => 'Ĭ', - 'į' => 'Į', - 'ı' => 'I', - 'ij' => 'IJ', - 'ĵ' => 'Ĵ', - 'ķ' => 'Ķ', - 'ĺ' => 'Ĺ', - 'ļ' => 'Ļ', - 'ľ' => 'Ľ', - 'ŀ' => 'Ŀ', - 'ł' => 'Ł', - 'ń' => 'Ń', - 'ņ' => 'Ņ', - 'ň' => 'Ň', - 'ŋ' => 'Ŋ', - 'ō' => 'Ō', - 'ŏ' => 'Ŏ', - 'ő' => 'Ő', - 'œ' => 'Œ', - 'ŕ' => 'Ŕ', - 'ŗ' => 'Ŗ', - 'ř' => 'Ř', - 'ś' => 'Ś', - 'ŝ' => 'Ŝ', - 'ş' => 'Ş', - 'š' => 'Š', - 'ţ' => 'Ţ', - 'ť' => 'Ť', - 'ŧ' => 'Ŧ', - 'ũ' => 'Ũ', - 'ū' => 'Ū', - 'ŭ' => 'Ŭ', - 'ů' => 'Ů', - 'ű' => 'Ű', - 'ų' => 'Ų', - 'ŵ' => 'Ŵ', - 'ŷ' => 'Ŷ', - 'ź' => 'Ź', - 'ż' => 'Ż', - 'ž' => 'Ž', - 'ſ' => 'S', - 'ƀ' => 'Ƀ', - 'ƃ' => 'Ƃ', - 'ƅ' => 'Ƅ', - 'ƈ' => 'Ƈ', - 'ƌ' => 'Ƌ', - 'ƒ' => 'Ƒ', - 'ƕ' => 'Ƕ', - 'ƙ' => 'Ƙ', - 'ƚ' => 'Ƚ', - 'ƞ' => 'Ƞ', - 'ơ' => 'Ơ', - 'ƣ' => 'Ƣ', - 'ƥ' => 'Ƥ', - 'ƨ' => 'Ƨ', - 'ƭ' => 'Ƭ', - 'ư' => 'Ư', - 'ƴ' => 'Ƴ', - 'ƶ' => 'Ƶ', - 'ƹ' => 'Ƹ', - 'ƽ' => 'Ƽ', - 'ƿ' => 'Ƿ', - 'Dž' => 'DŽ', - 'dž' => 'DŽ', - 'Lj' => 'LJ', - 'lj' => 'LJ', - 'Nj' => 'NJ', - 'nj' => 'NJ', - 'ǎ' => 'Ǎ', - 'ǐ' => 'Ǐ', - 'ǒ' => 'Ǒ', - 'ǔ' => 'Ǔ', - 'ǖ' => 'Ǖ', - 'ǘ' => 'Ǘ', - 'ǚ' => 'Ǚ', - 'ǜ' => 'Ǜ', - 'ǝ' => 'Ǝ', - 'ǟ' => 'Ǟ', - 'ǡ' => 'Ǡ', - 'ǣ' => 'Ǣ', - 'ǥ' => 'Ǥ', - 'ǧ' => 'Ǧ', - 'ǩ' => 'Ǩ', - 'ǫ' => 'Ǫ', - 'ǭ' => 'Ǭ', - 'ǯ' => 'Ǯ', - 'Dz' => 'DZ', - 'dz' => 'DZ', - 'ǵ' => 'Ǵ', - 'ǹ' => 'Ǹ', - 'ǻ' => 'Ǻ', - 'ǽ' => 'Ǽ', - 'ǿ' => 'Ǿ', - 'ȁ' => 'Ȁ', - 'ȃ' => 'Ȃ', - 'ȅ' => 'Ȅ', - 'ȇ' => 'Ȇ', - 'ȉ' => 'Ȉ', - 'ȋ' => 'Ȋ', - 'ȍ' => 'Ȍ', - 'ȏ' => 'Ȏ', - 'ȑ' => 'Ȑ', - 'ȓ' => 'Ȓ', - 'ȕ' => 'Ȕ', - 'ȗ' => 'Ȗ', - 'ș' => 'Ș', - 'ț' => 'Ț', - 'ȝ' => 'Ȝ', - 'ȟ' => 'Ȟ', - 'ȣ' => 'Ȣ', - 'ȥ' => 'Ȥ', - 'ȧ' => 'Ȧ', - 'ȩ' => 'Ȩ', - 'ȫ' => 'Ȫ', - 'ȭ' => 'Ȭ', - 'ȯ' => 'Ȯ', - 'ȱ' => 'Ȱ', - 'ȳ' => 'Ȳ', - 'ȼ' => 'Ȼ', - 'ȿ' => 'Ȿ', - 'ɀ' => 'Ɀ', - 'ɂ' => 'Ɂ', - 'ɇ' => 'Ɇ', - 'ɉ' => 'Ɉ', - 'ɋ' => 'Ɋ', - 'ɍ' => 'Ɍ', - 'ɏ' => 'Ɏ', - 'ɐ' => 'Ɐ', - 'ɑ' => 'Ɑ', - 'ɒ' => 'Ɒ', - 'ɓ' => 'Ɓ', - 'ɔ' => 'Ɔ', - 'ɖ' => 'Ɖ', - 'ɗ' => 'Ɗ', - 'ə' => 'Ə', - 'ɛ' => 'Ɛ', - 'ɜ' => 'Ɜ', - 'ɠ' => 'Ɠ', - 'ɡ' => 'Ɡ', - 'ɣ' => 'Ɣ', - 'ɥ' => 'Ɥ', - 'ɦ' => 'Ɦ', - 'ɨ' => 'Ɨ', - 'ɩ' => 'Ɩ', - 'ɪ' => 'Ɪ', - 'ɫ' => 'Ɫ', - 'ɬ' => 'Ɬ', - 'ɯ' => 'Ɯ', - 'ɱ' => 'Ɱ', - 'ɲ' => 'Ɲ', - 'ɵ' => 'Ɵ', - 'ɽ' => 'Ɽ', - 'ʀ' => 'Ʀ', - 'ʂ' => 'Ʂ', - 'ʃ' => 'Ʃ', - 'ʇ' => 'Ʇ', - 'ʈ' => 'Ʈ', - 'ʉ' => 'Ʉ', - 'ʊ' => 'Ʊ', - 'ʋ' => 'Ʋ', - 'ʌ' => 'Ʌ', - 'ʒ' => 'Ʒ', - 'ʝ' => 'Ʝ', - 'ʞ' => 'Ʞ', - 'ͅ' => 'Ι', - 'ͱ' => 'Ͱ', - 'ͳ' => 'Ͳ', - 'ͷ' => 'Ͷ', - 'ͻ' => 'Ͻ', - 'ͼ' => 'Ͼ', - 'ͽ' => 'Ͽ', - 'ά' => 'Ά', - 'έ' => 'Έ', - 'ή' => 'Ή', - 'ί' => 'Ί', - 'α' => 'Α', - 'β' => 'Β', - 'γ' => 'Γ', - 'δ' => 'Δ', - 'ε' => 'Ε', - 'ζ' => 'Ζ', - 'η' => 'Η', - 'θ' => 'Θ', - 'ι' => 'Ι', - 'κ' => 'Κ', - 'λ' => 'Λ', - 'μ' => 'Μ', - 'ν' => 'Ν', - 'ξ' => 'Ξ', - 'ο' => 'Ο', - 'π' => 'Π', - 'ρ' => 'Ρ', - 'ς' => 'Σ', - 'σ' => 'Σ', - 'τ' => 'Τ', - 'υ' => 'Υ', - 'φ' => 'Φ', - 'χ' => 'Χ', - 'ψ' => 'Ψ', - 'ω' => 'Ω', - 'ϊ' => 'Ϊ', - 'ϋ' => 'Ϋ', - 'ό' => 'Ό', - 'ύ' => 'Ύ', - 'ώ' => 'Ώ', - 'ϐ' => 'Β', - 'ϑ' => 'Θ', - 'ϕ' => 'Φ', - 'ϖ' => 'Π', - 'ϗ' => 'Ϗ', - 'ϙ' => 'Ϙ', - 'ϛ' => 'Ϛ', - 'ϝ' => 'Ϝ', - 'ϟ' => 'Ϟ', - 'ϡ' => 'Ϡ', - 'ϣ' => 'Ϣ', - 'ϥ' => 'Ϥ', - 'ϧ' => 'Ϧ', - 'ϩ' => 'Ϩ', - 'ϫ' => 'Ϫ', - 'ϭ' => 'Ϭ', - 'ϯ' => 'Ϯ', - 'ϰ' => 'Κ', - 'ϱ' => 'Ρ', - 'ϲ' => 'Ϲ', - 'ϳ' => 'Ϳ', - 'ϵ' => 'Ε', - 'ϸ' => 'Ϸ', - 'ϻ' => 'Ϻ', - 'а' => 'А', - 'б' => 'Б', - 'в' => 'В', - 'г' => 'Г', - 'д' => 'Д', - 'е' => 'Е', - 'ж' => 'Ж', - 'з' => 'З', - 'и' => 'И', - 'й' => 'Й', - 'к' => 'К', - 'л' => 'Л', - 'м' => 'М', - 'н' => 'Н', - 'о' => 'О', - 'п' => 'П', - 'р' => 'Р', - 'с' => 'С', - 'т' => 'Т', - 'у' => 'У', - 'ф' => 'Ф', - 'х' => 'Х', - 'ц' => 'Ц', - 'ч' => 'Ч', - 'ш' => 'Ш', - 'щ' => 'Щ', - 'ъ' => 'Ъ', - 'ы' => 'Ы', - 'ь' => 'Ь', - 'э' => 'Э', - 'ю' => 'Ю', - 'я' => 'Я', - 'ѐ' => 'Ѐ', - 'ё' => 'Ё', - 'ђ' => 'Ђ', - 'ѓ' => 'Ѓ', - 'є' => 'Є', - 'ѕ' => 'Ѕ', - 'і' => 'І', - 'ї' => 'Ї', - 'ј' => 'Ј', - 'љ' => 'Љ', - 'њ' => 'Њ', - 'ћ' => 'Ћ', - 'ќ' => 'Ќ', - 'ѝ' => 'Ѝ', - 'ў' => 'Ў', - 'џ' => 'Џ', - 'ѡ' => 'Ѡ', - 'ѣ' => 'Ѣ', - 'ѥ' => 'Ѥ', - 'ѧ' => 'Ѧ', - 'ѩ' => 'Ѩ', - 'ѫ' => 'Ѫ', - 'ѭ' => 'Ѭ', - 'ѯ' => 'Ѯ', - 'ѱ' => 'Ѱ', - 'ѳ' => 'Ѳ', - 'ѵ' => 'Ѵ', - 'ѷ' => 'Ѷ', - 'ѹ' => 'Ѹ', - 'ѻ' => 'Ѻ', - 'ѽ' => 'Ѽ', - 'ѿ' => 'Ѿ', - 'ҁ' => 'Ҁ', - 'ҋ' => 'Ҋ', - 'ҍ' => 'Ҍ', - 'ҏ' => 'Ҏ', - 'ґ' => 'Ґ', - 'ғ' => 'Ғ', - 'ҕ' => 'Ҕ', - 'җ' => 'Җ', - 'ҙ' => 'Ҙ', - 'қ' => 'Қ', - 'ҝ' => 'Ҝ', - 'ҟ' => 'Ҟ', - 'ҡ' => 'Ҡ', - 'ң' => 'Ң', - 'ҥ' => 'Ҥ', - 'ҧ' => 'Ҧ', - 'ҩ' => 'Ҩ', - 'ҫ' => 'Ҫ', - 'ҭ' => 'Ҭ', - 'ү' => 'Ү', - 'ұ' => 'Ұ', - 'ҳ' => 'Ҳ', - 'ҵ' => 'Ҵ', - 'ҷ' => 'Ҷ', - 'ҹ' => 'Ҹ', - 'һ' => 'Һ', - 'ҽ' => 'Ҽ', - 'ҿ' => 'Ҿ', - 'ӂ' => 'Ӂ', - 'ӄ' => 'Ӄ', - 'ӆ' => 'Ӆ', - 'ӈ' => 'Ӈ', - 'ӊ' => 'Ӊ', - 'ӌ' => 'Ӌ', - 'ӎ' => 'Ӎ', - 'ӏ' => 'Ӏ', - 'ӑ' => 'Ӑ', - 'ӓ' => 'Ӓ', - 'ӕ' => 'Ӕ', - 'ӗ' => 'Ӗ', - 'ә' => 'Ә', - 'ӛ' => 'Ӛ', - 'ӝ' => 'Ӝ', - 'ӟ' => 'Ӟ', - 'ӡ' => 'Ӡ', - 'ӣ' => 'Ӣ', - 'ӥ' => 'Ӥ', - 'ӧ' => 'Ӧ', - 'ө' => 'Ө', - 'ӫ' => 'Ӫ', - 'ӭ' => 'Ӭ', - 'ӯ' => 'Ӯ', - 'ӱ' => 'Ӱ', - 'ӳ' => 'Ӳ', - 'ӵ' => 'Ӵ', - 'ӷ' => 'Ӷ', - 'ӹ' => 'Ӹ', - 'ӻ' => 'Ӻ', - 'ӽ' => 'Ӽ', - 'ӿ' => 'Ӿ', - 'ԁ' => 'Ԁ', - 'ԃ' => 'Ԃ', - 'ԅ' => 'Ԅ', - 'ԇ' => 'Ԇ', - 'ԉ' => 'Ԉ', - 'ԋ' => 'Ԋ', - 'ԍ' => 'Ԍ', - 'ԏ' => 'Ԏ', - 'ԑ' => 'Ԑ', - 'ԓ' => 'Ԓ', - 'ԕ' => 'Ԕ', - 'ԗ' => 'Ԗ', - 'ԙ' => 'Ԙ', - 'ԛ' => 'Ԛ', - 'ԝ' => 'Ԝ', - 'ԟ' => 'Ԟ', - 'ԡ' => 'Ԡ', - 'ԣ' => 'Ԣ', - 'ԥ' => 'Ԥ', - 'ԧ' => 'Ԧ', - 'ԩ' => 'Ԩ', - 'ԫ' => 'Ԫ', - 'ԭ' => 'Ԭ', - 'ԯ' => 'Ԯ', - 'ա' => 'Ա', - 'բ' => 'Բ', - 'գ' => 'Գ', - 'դ' => 'Դ', - 'ե' => 'Ե', - 'զ' => 'Զ', - 'է' => 'Է', - 'ը' => 'Ը', - 'թ' => 'Թ', - 'ժ' => 'Ժ', - 'ի' => 'Ի', - 'լ' => 'Լ', - 'խ' => 'Խ', - 'ծ' => 'Ծ', - 'կ' => 'Կ', - 'հ' => 'Հ', - 'ձ' => 'Ձ', - 'ղ' => 'Ղ', - 'ճ' => 'Ճ', - 'մ' => 'Մ', - 'յ' => 'Յ', - 'ն' => 'Ն', - 'շ' => 'Շ', - 'ո' => 'Ո', - 'չ' => 'Չ', - 'պ' => 'Պ', - 'ջ' => 'Ջ', - 'ռ' => 'Ռ', - 'ս' => 'Ս', - 'վ' => 'Վ', - 'տ' => 'Տ', - 'ր' => 'Ր', - 'ց' => 'Ց', - 'ւ' => 'Ւ', - 'փ' => 'Փ', - 'ք' => 'Ք', - 'օ' => 'Օ', - 'ֆ' => 'Ֆ', - 'ა' => 'Ა', - 'ბ' => 'Ბ', - 'გ' => 'Გ', - 'დ' => 'Დ', - 'ე' => 'Ე', - 'ვ' => 'Ვ', - 'ზ' => 'Ზ', - 'თ' => 'Თ', - 'ი' => 'Ი', - 'კ' => 'Კ', - 'ლ' => 'Ლ', - 'მ' => 'Მ', - 'ნ' => 'Ნ', - 'ო' => 'Ო', - 'პ' => 'Პ', - 'ჟ' => 'Ჟ', - 'რ' => 'Რ', - 'ს' => 'Ს', - 'ტ' => 'Ტ', - 'უ' => 'Უ', - 'ფ' => 'Ფ', - 'ქ' => 'Ქ', - 'ღ' => 'Ღ', - 'ყ' => 'Ყ', - 'შ' => 'Შ', - 'ჩ' => 'Ჩ', - 'ც' => 'Ც', - 'ძ' => 'Ძ', - 'წ' => 'Წ', - 'ჭ' => 'Ჭ', - 'ხ' => 'Ხ', - 'ჯ' => 'Ჯ', - 'ჰ' => 'Ჰ', - 'ჱ' => 'Ჱ', - 'ჲ' => 'Ჲ', - 'ჳ' => 'Ჳ', - 'ჴ' => 'Ჴ', - 'ჵ' => 'Ჵ', - 'ჶ' => 'Ჶ', - 'ჷ' => 'Ჷ', - 'ჸ' => 'Ჸ', - 'ჹ' => 'Ჹ', - 'ჺ' => 'Ჺ', - 'ჽ' => 'Ჽ', - 'ჾ' => 'Ჾ', - 'ჿ' => 'Ჿ', - 'ᏸ' => 'Ᏸ', - 'ᏹ' => 'Ᏹ', - 'ᏺ' => 'Ᏺ', - 'ᏻ' => 'Ᏻ', - 'ᏼ' => 'Ᏼ', - 'ᏽ' => 'Ᏽ', - 'ᲀ' => 'В', - 'ᲁ' => 'Д', - 'ᲂ' => 'О', - 'ᲃ' => 'С', - 'ᲄ' => 'Т', - 'ᲅ' => 'Т', - 'ᲆ' => 'Ъ', - 'ᲇ' => 'Ѣ', - 'ᲈ' => 'Ꙋ', - 'ᵹ' => 'Ᵹ', - 'ᵽ' => 'Ᵽ', - 'ᶎ' => 'Ᶎ', - 'ḁ' => 'Ḁ', - 'ḃ' => 'Ḃ', - 'ḅ' => 'Ḅ', - 'ḇ' => 'Ḇ', - 'ḉ' => 'Ḉ', - 'ḋ' => 'Ḋ', - 'ḍ' => 'Ḍ', - 'ḏ' => 'Ḏ', - 'ḑ' => 'Ḑ', - 'ḓ' => 'Ḓ', - 'ḕ' => 'Ḕ', - 'ḗ' => 'Ḗ', - 'ḙ' => 'Ḙ', - 'ḛ' => 'Ḛ', - 'ḝ' => 'Ḝ', - 'ḟ' => 'Ḟ', - 'ḡ' => 'Ḡ', - 'ḣ' => 'Ḣ', - 'ḥ' => 'Ḥ', - 'ḧ' => 'Ḧ', - 'ḩ' => 'Ḩ', - 'ḫ' => 'Ḫ', - 'ḭ' => 'Ḭ', - 'ḯ' => 'Ḯ', - 'ḱ' => 'Ḱ', - 'ḳ' => 'Ḳ', - 'ḵ' => 'Ḵ', - 'ḷ' => 'Ḷ', - 'ḹ' => 'Ḹ', - 'ḻ' => 'Ḻ', - 'ḽ' => 'Ḽ', - 'ḿ' => 'Ḿ', - 'ṁ' => 'Ṁ', - 'ṃ' => 'Ṃ', - 'ṅ' => 'Ṅ', - 'ṇ' => 'Ṇ', - 'ṉ' => 'Ṉ', - 'ṋ' => 'Ṋ', - 'ṍ' => 'Ṍ', - 'ṏ' => 'Ṏ', - 'ṑ' => 'Ṑ', - 'ṓ' => 'Ṓ', - 'ṕ' => 'Ṕ', - 'ṗ' => 'Ṗ', - 'ṙ' => 'Ṙ', - 'ṛ' => 'Ṛ', - 'ṝ' => 'Ṝ', - 'ṟ' => 'Ṟ', - 'ṡ' => 'Ṡ', - 'ṣ' => 'Ṣ', - 'ṥ' => 'Ṥ', - 'ṧ' => 'Ṧ', - 'ṩ' => 'Ṩ', - 'ṫ' => 'Ṫ', - 'ṭ' => 'Ṭ', - 'ṯ' => 'Ṯ', - 'ṱ' => 'Ṱ', - 'ṳ' => 'Ṳ', - 'ṵ' => 'Ṵ', - 'ṷ' => 'Ṷ', - 'ṹ' => 'Ṹ', - 'ṻ' => 'Ṻ', - 'ṽ' => 'Ṽ', - 'ṿ' => 'Ṿ', - 'ẁ' => 'Ẁ', - 'ẃ' => 'Ẃ', - 'ẅ' => 'Ẅ', - 'ẇ' => 'Ẇ', - 'ẉ' => 'Ẉ', - 'ẋ' => 'Ẋ', - 'ẍ' => 'Ẍ', - 'ẏ' => 'Ẏ', - 'ẑ' => 'Ẑ', - 'ẓ' => 'Ẓ', - 'ẕ' => 'Ẕ', - 'ẛ' => 'Ṡ', - 'ạ' => 'Ạ', - 'ả' => 'Ả', - 'ấ' => 'Ấ', - 'ầ' => 'Ầ', - 'ẩ' => 'Ẩ', - 'ẫ' => 'Ẫ', - 'ậ' => 'Ậ', - 'ắ' => 'Ắ', - 'ằ' => 'Ằ', - 'ẳ' => 'Ẳ', - 'ẵ' => 'Ẵ', - 'ặ' => 'Ặ', - 'ẹ' => 'Ẹ', - 'ẻ' => 'Ẻ', - 'ẽ' => 'Ẽ', - 'ế' => 'Ế', - 'ề' => 'Ề', - 'ể' => 'Ể', - 'ễ' => 'Ễ', - 'ệ' => 'Ệ', - 'ỉ' => 'Ỉ', - 'ị' => 'Ị', - 'ọ' => 'Ọ', - 'ỏ' => 'Ỏ', - 'ố' => 'Ố', - 'ồ' => 'Ồ', - 'ổ' => 'Ổ', - 'ỗ' => 'Ỗ', - 'ộ' => 'Ộ', - 'ớ' => 'Ớ', - 'ờ' => 'Ờ', - 'ở' => 'Ở', - 'ỡ' => 'Ỡ', - 'ợ' => 'Ợ', - 'ụ' => 'Ụ', - 'ủ' => 'Ủ', - 'ứ' => 'Ứ', - 'ừ' => 'Ừ', - 'ử' => 'Ử', - 'ữ' => 'Ữ', - 'ự' => 'Ự', - 'ỳ' => 'Ỳ', - 'ỵ' => 'Ỵ', - 'ỷ' => 'Ỷ', - 'ỹ' => 'Ỹ', - 'ỻ' => 'Ỻ', - 'ỽ' => 'Ỽ', - 'ỿ' => 'Ỿ', - 'ἀ' => 'Ἀ', - 'ἁ' => 'Ἁ', - 'ἂ' => 'Ἂ', - 'ἃ' => 'Ἃ', - 'ἄ' => 'Ἄ', - 'ἅ' => 'Ἅ', - 'ἆ' => 'Ἆ', - 'ἇ' => 'Ἇ', - 'ἐ' => 'Ἐ', - 'ἑ' => 'Ἑ', - 'ἒ' => 'Ἒ', - 'ἓ' => 'Ἓ', - 'ἔ' => 'Ἔ', - 'ἕ' => 'Ἕ', - 'ἠ' => 'Ἠ', - 'ἡ' => 'Ἡ', - 'ἢ' => 'Ἢ', - 'ἣ' => 'Ἣ', - 'ἤ' => 'Ἤ', - 'ἥ' => 'Ἥ', - 'ἦ' => 'Ἦ', - 'ἧ' => 'Ἧ', - 'ἰ' => 'Ἰ', - 'ἱ' => 'Ἱ', - 'ἲ' => 'Ἲ', - 'ἳ' => 'Ἳ', - 'ἴ' => 'Ἴ', - 'ἵ' => 'Ἵ', - 'ἶ' => 'Ἶ', - 'ἷ' => 'Ἷ', - 'ὀ' => 'Ὀ', - 'ὁ' => 'Ὁ', - 'ὂ' => 'Ὂ', - 'ὃ' => 'Ὃ', - 'ὄ' => 'Ὄ', - 'ὅ' => 'Ὅ', - 'ὑ' => 'Ὑ', - 'ὓ' => 'Ὓ', - 'ὕ' => 'Ὕ', - 'ὗ' => 'Ὗ', - 'ὠ' => 'Ὠ', - 'ὡ' => 'Ὡ', - 'ὢ' => 'Ὢ', - 'ὣ' => 'Ὣ', - 'ὤ' => 'Ὤ', - 'ὥ' => 'Ὥ', - 'ὦ' => 'Ὦ', - 'ὧ' => 'Ὧ', - 'ὰ' => 'Ὰ', - 'ά' => 'Ά', - 'ὲ' => 'Ὲ', - 'έ' => 'Έ', - 'ὴ' => 'Ὴ', - 'ή' => 'Ή', - 'ὶ' => 'Ὶ', - 'ί' => 'Ί', - 'ὸ' => 'Ὸ', - 'ό' => 'Ό', - 'ὺ' => 'Ὺ', - 'ύ' => 'Ύ', - 'ὼ' => 'Ὼ', - 'ώ' => 'Ώ', - 'ᾀ' => 'ἈΙ', - 'ᾁ' => 'ἉΙ', - 'ᾂ' => 'ἊΙ', - 'ᾃ' => 'ἋΙ', - 'ᾄ' => 'ἌΙ', - 'ᾅ' => 'ἍΙ', - 'ᾆ' => 'ἎΙ', - 'ᾇ' => 'ἏΙ', - 'ᾐ' => 'ἨΙ', - 'ᾑ' => 'ἩΙ', - 'ᾒ' => 'ἪΙ', - 'ᾓ' => 'ἫΙ', - 'ᾔ' => 'ἬΙ', - 'ᾕ' => 'ἭΙ', - 'ᾖ' => 'ἮΙ', - 'ᾗ' => 'ἯΙ', - 'ᾠ' => 'ὨΙ', - 'ᾡ' => 'ὩΙ', - 'ᾢ' => 'ὪΙ', - 'ᾣ' => 'ὫΙ', - 'ᾤ' => 'ὬΙ', - 'ᾥ' => 'ὭΙ', - 'ᾦ' => 'ὮΙ', - 'ᾧ' => 'ὯΙ', - 'ᾰ' => 'Ᾰ', - 'ᾱ' => 'Ᾱ', - 'ᾳ' => 'ΑΙ', - 'ι' => 'Ι', - 'ῃ' => 'ΗΙ', - 'ῐ' => 'Ῐ', - 'ῑ' => 'Ῑ', - 'ῠ' => 'Ῠ', - 'ῡ' => 'Ῡ', - 'ῥ' => 'Ῥ', - 'ῳ' => 'ΩΙ', - 'ⅎ' => 'Ⅎ', - 'ⅰ' => 'Ⅰ', - 'ⅱ' => 'Ⅱ', - 'ⅲ' => 'Ⅲ', - 'ⅳ' => 'Ⅳ', - 'ⅴ' => 'Ⅴ', - 'ⅵ' => 'Ⅵ', - 'ⅶ' => 'Ⅶ', - 'ⅷ' => 'Ⅷ', - 'ⅸ' => 'Ⅸ', - 'ⅹ' => 'Ⅹ', - 'ⅺ' => 'Ⅺ', - 'ⅻ' => 'Ⅻ', - 'ⅼ' => 'Ⅼ', - 'ⅽ' => 'Ⅽ', - 'ⅾ' => 'Ⅾ', - 'ⅿ' => 'Ⅿ', - 'ↄ' => 'Ↄ', - 'ⓐ' => 'Ⓐ', - 'ⓑ' => 'Ⓑ', - 'ⓒ' => 'Ⓒ', - 'ⓓ' => 'Ⓓ', - 'ⓔ' => 'Ⓔ', - 'ⓕ' => 'Ⓕ', - 'ⓖ' => 'Ⓖ', - 'ⓗ' => 'Ⓗ', - 'ⓘ' => 'Ⓘ', - 'ⓙ' => 'Ⓙ', - 'ⓚ' => 'Ⓚ', - 'ⓛ' => 'Ⓛ', - 'ⓜ' => 'Ⓜ', - 'ⓝ' => 'Ⓝ', - 'ⓞ' => 'Ⓞ', - 'ⓟ' => 'Ⓟ', - 'ⓠ' => 'Ⓠ', - 'ⓡ' => 'Ⓡ', - 'ⓢ' => 'Ⓢ', - 'ⓣ' => 'Ⓣ', - 'ⓤ' => 'Ⓤ', - 'ⓥ' => 'Ⓥ', - 'ⓦ' => 'Ⓦ', - 'ⓧ' => 'Ⓧ', - 'ⓨ' => 'Ⓨ', - 'ⓩ' => 'Ⓩ', - 'ⰰ' => 'Ⰰ', - 'ⰱ' => 'Ⰱ', - 'ⰲ' => 'Ⰲ', - 'ⰳ' => 'Ⰳ', - 'ⰴ' => 'Ⰴ', - 'ⰵ' => 'Ⰵ', - 'ⰶ' => 'Ⰶ', - 'ⰷ' => 'Ⰷ', - 'ⰸ' => 'Ⰸ', - 'ⰹ' => 'Ⰹ', - 'ⰺ' => 'Ⰺ', - 'ⰻ' => 'Ⰻ', - 'ⰼ' => 'Ⰼ', - 'ⰽ' => 'Ⰽ', - 'ⰾ' => 'Ⰾ', - 'ⰿ' => 'Ⰿ', - 'ⱀ' => 'Ⱀ', - 'ⱁ' => 'Ⱁ', - 'ⱂ' => 'Ⱂ', - 'ⱃ' => 'Ⱃ', - 'ⱄ' => 'Ⱄ', - 'ⱅ' => 'Ⱅ', - 'ⱆ' => 'Ⱆ', - 'ⱇ' => 'Ⱇ', - 'ⱈ' => 'Ⱈ', - 'ⱉ' => 'Ⱉ', - 'ⱊ' => 'Ⱊ', - 'ⱋ' => 'Ⱋ', - 'ⱌ' => 'Ⱌ', - 'ⱍ' => 'Ⱍ', - 'ⱎ' => 'Ⱎ', - 'ⱏ' => 'Ⱏ', - 'ⱐ' => 'Ⱐ', - 'ⱑ' => 'Ⱑ', - 'ⱒ' => 'Ⱒ', - 'ⱓ' => 'Ⱓ', - 'ⱔ' => 'Ⱔ', - 'ⱕ' => 'Ⱕ', - 'ⱖ' => 'Ⱖ', - 'ⱗ' => 'Ⱗ', - 'ⱘ' => 'Ⱘ', - 'ⱙ' => 'Ⱙ', - 'ⱚ' => 'Ⱚ', - 'ⱛ' => 'Ⱛ', - 'ⱜ' => 'Ⱜ', - 'ⱝ' => 'Ⱝ', - 'ⱞ' => 'Ⱞ', - 'ⱡ' => 'Ⱡ', - 'ⱥ' => 'Ⱥ', - 'ⱦ' => 'Ⱦ', - 'ⱨ' => 'Ⱨ', - 'ⱪ' => 'Ⱪ', - 'ⱬ' => 'Ⱬ', - 'ⱳ' => 'Ⱳ', - 'ⱶ' => 'Ⱶ', - 'ⲁ' => 'Ⲁ', - 'ⲃ' => 'Ⲃ', - 'ⲅ' => 'Ⲅ', - 'ⲇ' => 'Ⲇ', - 'ⲉ' => 'Ⲉ', - 'ⲋ' => 'Ⲋ', - 'ⲍ' => 'Ⲍ', - 'ⲏ' => 'Ⲏ', - 'ⲑ' => 'Ⲑ', - 'ⲓ' => 'Ⲓ', - 'ⲕ' => 'Ⲕ', - 'ⲗ' => 'Ⲗ', - 'ⲙ' => 'Ⲙ', - 'ⲛ' => 'Ⲛ', - 'ⲝ' => 'Ⲝ', - 'ⲟ' => 'Ⲟ', - 'ⲡ' => 'Ⲡ', - 'ⲣ' => 'Ⲣ', - 'ⲥ' => 'Ⲥ', - 'ⲧ' => 'Ⲧ', - 'ⲩ' => 'Ⲩ', - 'ⲫ' => 'Ⲫ', - 'ⲭ' => 'Ⲭ', - 'ⲯ' => 'Ⲯ', - 'ⲱ' => 'Ⲱ', - 'ⲳ' => 'Ⲳ', - 'ⲵ' => 'Ⲵ', - 'ⲷ' => 'Ⲷ', - 'ⲹ' => 'Ⲹ', - 'ⲻ' => 'Ⲻ', - 'ⲽ' => 'Ⲽ', - 'ⲿ' => 'Ⲿ', - 'ⳁ' => 'Ⳁ', - 'ⳃ' => 'Ⳃ', - 'ⳅ' => 'Ⳅ', - 'ⳇ' => 'Ⳇ', - 'ⳉ' => 'Ⳉ', - 'ⳋ' => 'Ⳋ', - 'ⳍ' => 'Ⳍ', - 'ⳏ' => 'Ⳏ', - 'ⳑ' => 'Ⳑ', - 'ⳓ' => 'Ⳓ', - 'ⳕ' => 'Ⳕ', - 'ⳗ' => 'Ⳗ', - 'ⳙ' => 'Ⳙ', - 'ⳛ' => 'Ⳛ', - 'ⳝ' => 'Ⳝ', - 'ⳟ' => 'Ⳟ', - 'ⳡ' => 'Ⳡ', - 'ⳣ' => 'Ⳣ', - 'ⳬ' => 'Ⳬ', - 'ⳮ' => 'Ⳮ', - 'ⳳ' => 'Ⳳ', - 'ⴀ' => 'Ⴀ', - 'ⴁ' => 'Ⴁ', - 'ⴂ' => 'Ⴂ', - 'ⴃ' => 'Ⴃ', - 'ⴄ' => 'Ⴄ', - 'ⴅ' => 'Ⴅ', - 'ⴆ' => 'Ⴆ', - 'ⴇ' => 'Ⴇ', - 'ⴈ' => 'Ⴈ', - 'ⴉ' => 'Ⴉ', - 'ⴊ' => 'Ⴊ', - 'ⴋ' => 'Ⴋ', - 'ⴌ' => 'Ⴌ', - 'ⴍ' => 'Ⴍ', - 'ⴎ' => 'Ⴎ', - 'ⴏ' => 'Ⴏ', - 'ⴐ' => 'Ⴐ', - 'ⴑ' => 'Ⴑ', - 'ⴒ' => 'Ⴒ', - 'ⴓ' => 'Ⴓ', - 'ⴔ' => 'Ⴔ', - 'ⴕ' => 'Ⴕ', - 'ⴖ' => 'Ⴖ', - 'ⴗ' => 'Ⴗ', - 'ⴘ' => 'Ⴘ', - 'ⴙ' => 'Ⴙ', - 'ⴚ' => 'Ⴚ', - 'ⴛ' => 'Ⴛ', - 'ⴜ' => 'Ⴜ', - 'ⴝ' => 'Ⴝ', - 'ⴞ' => 'Ⴞ', - 'ⴟ' => 'Ⴟ', - 'ⴠ' => 'Ⴠ', - 'ⴡ' => 'Ⴡ', - 'ⴢ' => 'Ⴢ', - 'ⴣ' => 'Ⴣ', - 'ⴤ' => 'Ⴤ', - 'ⴥ' => 'Ⴥ', - 'ⴧ' => 'Ⴧ', - 'ⴭ' => 'Ⴭ', - 'ꙁ' => 'Ꙁ', - 'ꙃ' => 'Ꙃ', - 'ꙅ' => 'Ꙅ', - 'ꙇ' => 'Ꙇ', - 'ꙉ' => 'Ꙉ', - 'ꙋ' => 'Ꙋ', - 'ꙍ' => 'Ꙍ', - 'ꙏ' => 'Ꙏ', - 'ꙑ' => 'Ꙑ', - 'ꙓ' => 'Ꙓ', - 'ꙕ' => 'Ꙕ', - 'ꙗ' => 'Ꙗ', - 'ꙙ' => 'Ꙙ', - 'ꙛ' => 'Ꙛ', - 'ꙝ' => 'Ꙝ', - 'ꙟ' => 'Ꙟ', - 'ꙡ' => 'Ꙡ', - 'ꙣ' => 'Ꙣ', - 'ꙥ' => 'Ꙥ', - 'ꙧ' => 'Ꙧ', - 'ꙩ' => 'Ꙩ', - 'ꙫ' => 'Ꙫ', - 'ꙭ' => 'Ꙭ', - 'ꚁ' => 'Ꚁ', - 'ꚃ' => 'Ꚃ', - 'ꚅ' => 'Ꚅ', - 'ꚇ' => 'Ꚇ', - 'ꚉ' => 'Ꚉ', - 'ꚋ' => 'Ꚋ', - 'ꚍ' => 'Ꚍ', - 'ꚏ' => 'Ꚏ', - 'ꚑ' => 'Ꚑ', - 'ꚓ' => 'Ꚓ', - 'ꚕ' => 'Ꚕ', - 'ꚗ' => 'Ꚗ', - 'ꚙ' => 'Ꚙ', - 'ꚛ' => 'Ꚛ', - 'ꜣ' => 'Ꜣ', - 'ꜥ' => 'Ꜥ', - 'ꜧ' => 'Ꜧ', - 'ꜩ' => 'Ꜩ', - 'ꜫ' => 'Ꜫ', - 'ꜭ' => 'Ꜭ', - 'ꜯ' => 'Ꜯ', - 'ꜳ' => 'Ꜳ', - 'ꜵ' => 'Ꜵ', - 'ꜷ' => 'Ꜷ', - 'ꜹ' => 'Ꜹ', - 'ꜻ' => 'Ꜻ', - 'ꜽ' => 'Ꜽ', - 'ꜿ' => 'Ꜿ', - 'ꝁ' => 'Ꝁ', - 'ꝃ' => 'Ꝃ', - 'ꝅ' => 'Ꝅ', - 'ꝇ' => 'Ꝇ', - 'ꝉ' => 'Ꝉ', - 'ꝋ' => 'Ꝋ', - 'ꝍ' => 'Ꝍ', - 'ꝏ' => 'Ꝏ', - 'ꝑ' => 'Ꝑ', - 'ꝓ' => 'Ꝓ', - 'ꝕ' => 'Ꝕ', - 'ꝗ' => 'Ꝗ', - 'ꝙ' => 'Ꝙ', - 'ꝛ' => 'Ꝛ', - 'ꝝ' => 'Ꝝ', - 'ꝟ' => 'Ꝟ', - 'ꝡ' => 'Ꝡ', - 'ꝣ' => 'Ꝣ', - 'ꝥ' => 'Ꝥ', - 'ꝧ' => 'Ꝧ', - 'ꝩ' => 'Ꝩ', - 'ꝫ' => 'Ꝫ', - 'ꝭ' => 'Ꝭ', - 'ꝯ' => 'Ꝯ', - 'ꝺ' => 'Ꝺ', - 'ꝼ' => 'Ꝼ', - 'ꝿ' => 'Ꝿ', - 'ꞁ' => 'Ꞁ', - 'ꞃ' => 'Ꞃ', - 'ꞅ' => 'Ꞅ', - 'ꞇ' => 'Ꞇ', - 'ꞌ' => 'Ꞌ', - 'ꞑ' => 'Ꞑ', - 'ꞓ' => 'Ꞓ', - 'ꞔ' => 'Ꞔ', - 'ꞗ' => 'Ꞗ', - 'ꞙ' => 'Ꞙ', - 'ꞛ' => 'Ꞛ', - 'ꞝ' => 'Ꞝ', - 'ꞟ' => 'Ꞟ', - 'ꞡ' => 'Ꞡ', - 'ꞣ' => 'Ꞣ', - 'ꞥ' => 'Ꞥ', - 'ꞧ' => 'Ꞧ', - 'ꞩ' => 'Ꞩ', - 'ꞵ' => 'Ꞵ', - 'ꞷ' => 'Ꞷ', - 'ꞹ' => 'Ꞹ', - 'ꞻ' => 'Ꞻ', - 'ꞽ' => 'Ꞽ', - 'ꞿ' => 'Ꞿ', - 'ꟃ' => 'Ꟃ', - 'ꟈ' => 'Ꟈ', - 'ꟊ' => 'Ꟊ', - 'ꟶ' => 'Ꟶ', - 'ꭓ' => 'Ꭓ', - 'ꭰ' => 'Ꭰ', - 'ꭱ' => 'Ꭱ', - 'ꭲ' => 'Ꭲ', - 'ꭳ' => 'Ꭳ', - 'ꭴ' => 'Ꭴ', - 'ꭵ' => 'Ꭵ', - 'ꭶ' => 'Ꭶ', - 'ꭷ' => 'Ꭷ', - 'ꭸ' => 'Ꭸ', - 'ꭹ' => 'Ꭹ', - 'ꭺ' => 'Ꭺ', - 'ꭻ' => 'Ꭻ', - 'ꭼ' => 'Ꭼ', - 'ꭽ' => 'Ꭽ', - 'ꭾ' => 'Ꭾ', - 'ꭿ' => 'Ꭿ', - 'ꮀ' => 'Ꮀ', - 'ꮁ' => 'Ꮁ', - 'ꮂ' => 'Ꮂ', - 'ꮃ' => 'Ꮃ', - 'ꮄ' => 'Ꮄ', - 'ꮅ' => 'Ꮅ', - 'ꮆ' => 'Ꮆ', - 'ꮇ' => 'Ꮇ', - 'ꮈ' => 'Ꮈ', - 'ꮉ' => 'Ꮉ', - 'ꮊ' => 'Ꮊ', - 'ꮋ' => 'Ꮋ', - 'ꮌ' => 'Ꮌ', - 'ꮍ' => 'Ꮍ', - 'ꮎ' => 'Ꮎ', - 'ꮏ' => 'Ꮏ', - 'ꮐ' => 'Ꮐ', - 'ꮑ' => 'Ꮑ', - 'ꮒ' => 'Ꮒ', - 'ꮓ' => 'Ꮓ', - 'ꮔ' => 'Ꮔ', - 'ꮕ' => 'Ꮕ', - 'ꮖ' => 'Ꮖ', - 'ꮗ' => 'Ꮗ', - 'ꮘ' => 'Ꮘ', - 'ꮙ' => 'Ꮙ', - 'ꮚ' => 'Ꮚ', - 'ꮛ' => 'Ꮛ', - 'ꮜ' => 'Ꮜ', - 'ꮝ' => 'Ꮝ', - 'ꮞ' => 'Ꮞ', - 'ꮟ' => 'Ꮟ', - 'ꮠ' => 'Ꮠ', - 'ꮡ' => 'Ꮡ', - 'ꮢ' => 'Ꮢ', - 'ꮣ' => 'Ꮣ', - 'ꮤ' => 'Ꮤ', - 'ꮥ' => 'Ꮥ', - 'ꮦ' => 'Ꮦ', - 'ꮧ' => 'Ꮧ', - 'ꮨ' => 'Ꮨ', - 'ꮩ' => 'Ꮩ', - 'ꮪ' => 'Ꮪ', - 'ꮫ' => 'Ꮫ', - 'ꮬ' => 'Ꮬ', - 'ꮭ' => 'Ꮭ', - 'ꮮ' => 'Ꮮ', - 'ꮯ' => 'Ꮯ', - 'ꮰ' => 'Ꮰ', - 'ꮱ' => 'Ꮱ', - 'ꮲ' => 'Ꮲ', - 'ꮳ' => 'Ꮳ', - 'ꮴ' => 'Ꮴ', - 'ꮵ' => 'Ꮵ', - 'ꮶ' => 'Ꮶ', - 'ꮷ' => 'Ꮷ', - 'ꮸ' => 'Ꮸ', - 'ꮹ' => 'Ꮹ', - 'ꮺ' => 'Ꮺ', - 'ꮻ' => 'Ꮻ', - 'ꮼ' => 'Ꮼ', - 'ꮽ' => 'Ꮽ', - 'ꮾ' => 'Ꮾ', - 'ꮿ' => 'Ꮿ', - 'a' => 'A', - 'b' => 'B', - 'c' => 'C', - 'd' => 'D', - 'e' => 'E', - 'f' => 'F', - 'g' => 'G', - 'h' => 'H', - 'i' => 'I', - 'j' => 'J', - 'k' => 'K', - 'l' => 'L', - 'm' => 'M', - 'n' => 'N', - 'o' => 'O', - 'p' => 'P', - 'q' => 'Q', - 'r' => 'R', - 's' => 'S', - 't' => 'T', - 'u' => 'U', - 'v' => 'V', - 'w' => 'W', - 'x' => 'X', - 'y' => 'Y', - 'z' => 'Z', - '𐐨' => '𐐀', - '𐐩' => '𐐁', - '𐐪' => '𐐂', - '𐐫' => '𐐃', - '𐐬' => '𐐄', - '𐐭' => '𐐅', - '𐐮' => '𐐆', - '𐐯' => '𐐇', - '𐐰' => '𐐈', - '𐐱' => '𐐉', - '𐐲' => '𐐊', - '𐐳' => '𐐋', - '𐐴' => '𐐌', - '𐐵' => '𐐍', - '𐐶' => '𐐎', - '𐐷' => '𐐏', - '𐐸' => '𐐐', - '𐐹' => '𐐑', - '𐐺' => '𐐒', - '𐐻' => '𐐓', - '𐐼' => '𐐔', - '𐐽' => '𐐕', - '𐐾' => '𐐖', - '𐐿' => '𐐗', - '𐑀' => '𐐘', - '𐑁' => '𐐙', - '𐑂' => '𐐚', - '𐑃' => '𐐛', - '𐑄' => '𐐜', - '𐑅' => '𐐝', - '𐑆' => '𐐞', - '𐑇' => '𐐟', - '𐑈' => '𐐠', - '𐑉' => '𐐡', - '𐑊' => '𐐢', - '𐑋' => '𐐣', - '𐑌' => '𐐤', - '𐑍' => '𐐥', - '𐑎' => '𐐦', - '𐑏' => '𐐧', - '𐓘' => '𐒰', - '𐓙' => '𐒱', - '𐓚' => '𐒲', - '𐓛' => '𐒳', - '𐓜' => '𐒴', - '𐓝' => '𐒵', - '𐓞' => '𐒶', - '𐓟' => '𐒷', - '𐓠' => '𐒸', - '𐓡' => '𐒹', - '𐓢' => '𐒺', - '𐓣' => '𐒻', - '𐓤' => '𐒼', - '𐓥' => '𐒽', - '𐓦' => '𐒾', - '𐓧' => '𐒿', - '𐓨' => '𐓀', - '𐓩' => '𐓁', - '𐓪' => '𐓂', - '𐓫' => '𐓃', - '𐓬' => '𐓄', - '𐓭' => '𐓅', - '𐓮' => '𐓆', - '𐓯' => '𐓇', - '𐓰' => '𐓈', - '𐓱' => '𐓉', - '𐓲' => '𐓊', - '𐓳' => '𐓋', - '𐓴' => '𐓌', - '𐓵' => '𐓍', - '𐓶' => '𐓎', - '𐓷' => '𐓏', - '𐓸' => '𐓐', - '𐓹' => '𐓑', - '𐓺' => '𐓒', - '𐓻' => '𐓓', - '𐳀' => '𐲀', - '𐳁' => '𐲁', - '𐳂' => '𐲂', - '𐳃' => '𐲃', - '𐳄' => '𐲄', - '𐳅' => '𐲅', - '𐳆' => '𐲆', - '𐳇' => '𐲇', - '𐳈' => '𐲈', - '𐳉' => '𐲉', - '𐳊' => '𐲊', - '𐳋' => '𐲋', - '𐳌' => '𐲌', - '𐳍' => '𐲍', - '𐳎' => '𐲎', - '𐳏' => '𐲏', - '𐳐' => '𐲐', - '𐳑' => '𐲑', - '𐳒' => '𐲒', - '𐳓' => '𐲓', - '𐳔' => '𐲔', - '𐳕' => '𐲕', - '𐳖' => '𐲖', - '𐳗' => '𐲗', - '𐳘' => '𐲘', - '𐳙' => '𐲙', - '𐳚' => '𐲚', - '𐳛' => '𐲛', - '𐳜' => '𐲜', - '𐳝' => '𐲝', - '𐳞' => '𐲞', - '𐳟' => '𐲟', - '𐳠' => '𐲠', - '𐳡' => '𐲡', - '𐳢' => '𐲢', - '𐳣' => '𐲣', - '𐳤' => '𐲤', - '𐳥' => '𐲥', - '𐳦' => '𐲦', - '𐳧' => '𐲧', - '𐳨' => '𐲨', - '𐳩' => '𐲩', - '𐳪' => '𐲪', - '𐳫' => '𐲫', - '𐳬' => '𐲬', - '𐳭' => '𐲭', - '𐳮' => '𐲮', - '𐳯' => '𐲯', - '𐳰' => '𐲰', - '𐳱' => '𐲱', - '𐳲' => '𐲲', - '𑣀' => '𑢠', - '𑣁' => '𑢡', - '𑣂' => '𑢢', - '𑣃' => '𑢣', - '𑣄' => '𑢤', - '𑣅' => '𑢥', - '𑣆' => '𑢦', - '𑣇' => '𑢧', - '𑣈' => '𑢨', - '𑣉' => '𑢩', - '𑣊' => '𑢪', - '𑣋' => '𑢫', - '𑣌' => '𑢬', - '𑣍' => '𑢭', - '𑣎' => '𑢮', - '𑣏' => '𑢯', - '𑣐' => '𑢰', - '𑣑' => '𑢱', - '𑣒' => '𑢲', - '𑣓' => '𑢳', - '𑣔' => '𑢴', - '𑣕' => '𑢵', - '𑣖' => '𑢶', - '𑣗' => '𑢷', - '𑣘' => '𑢸', - '𑣙' => '𑢹', - '𑣚' => '𑢺', - '𑣛' => '𑢻', - '𑣜' => '𑢼', - '𑣝' => '𑢽', - '𑣞' => '𑢾', - '𑣟' => '𑢿', - '𖹠' => '𖹀', - '𖹡' => '𖹁', - '𖹢' => '𖹂', - '𖹣' => '𖹃', - '𖹤' => '𖹄', - '𖹥' => '𖹅', - '𖹦' => '𖹆', - '𖹧' => '𖹇', - '𖹨' => '𖹈', - '𖹩' => '𖹉', - '𖹪' => '𖹊', - '𖹫' => '𖹋', - '𖹬' => '𖹌', - '𖹭' => '𖹍', - '𖹮' => '𖹎', - '𖹯' => '𖹏', - '𖹰' => '𖹐', - '𖹱' => '𖹑', - '𖹲' => '𖹒', - '𖹳' => '𖹓', - '𖹴' => '𖹔', - '𖹵' => '𖹕', - '𖹶' => '𖹖', - '𖹷' => '𖹗', - '𖹸' => '𖹘', - '𖹹' => '𖹙', - '𖹺' => '𖹚', - '𖹻' => '𖹛', - '𖹼' => '𖹜', - '𖹽' => '𖹝', - '𖹾' => '𖹞', - '𖹿' => '𖹟', - '𞤢' => '𞤀', - '𞤣' => '𞤁', - '𞤤' => '𞤂', - '𞤥' => '𞤃', - '𞤦' => '𞤄', - '𞤧' => '𞤅', - '𞤨' => '𞤆', - '𞤩' => '𞤇', - '𞤪' => '𞤈', - '𞤫' => '𞤉', - '𞤬' => '𞤊', - '𞤭' => '𞤋', - '𞤮' => '𞤌', - '𞤯' => '𞤍', - '𞤰' => '𞤎', - '𞤱' => '𞤏', - '𞤲' => '𞤐', - '𞤳' => '𞤑', - '𞤴' => '𞤒', - '𞤵' => '𞤓', - '𞤶' => '𞤔', - '𞤷' => '𞤕', - '𞤸' => '𞤖', - '𞤹' => '𞤗', - '𞤺' => '𞤘', - '𞤻' => '𞤙', - '𞤼' => '𞤚', - '𞤽' => '𞤛', - '𞤾' => '𞤜', - '𞤿' => '𞤝', - '𞥀' => '𞤞', - '𞥁' => '𞤟', - '𞥂' => '𞤠', - '𞥃' => '𞤡', - 'ß' => 'SS', - 'ff' => 'FF', - 'fi' => 'FI', - 'fl' => 'FL', - 'ffi' => 'FFI', - 'ffl' => 'FFL', - 'ſt' => 'ST', - 'st' => 'ST', - 'և' => 'ԵՒ', - 'ﬓ' => 'ՄՆ', - 'ﬔ' => 'ՄԵ', - 'ﬕ' => 'ՄԻ', - 'ﬖ' => 'ՎՆ', - 'ﬗ' => 'ՄԽ', - 'ʼn' => 'ʼN', - 'ΐ' => 'Ϊ́', - 'ΰ' => 'Ϋ́', - 'ǰ' => 'J̌', - 'ẖ' => 'H̱', - 'ẗ' => 'T̈', - 'ẘ' => 'W̊', - 'ẙ' => 'Y̊', - 'ẚ' => 'Aʾ', - 'ὐ' => 'Υ̓', - 'ὒ' => 'Υ̓̀', - 'ὔ' => 'Υ̓́', - 'ὖ' => 'Υ̓͂', - 'ᾶ' => 'Α͂', - 'ῆ' => 'Η͂', - 'ῒ' => 'Ϊ̀', - 'ΐ' => 'Ϊ́', - 'ῖ' => 'Ι͂', - 'ῗ' => 'Ϊ͂', - 'ῢ' => 'Ϋ̀', - 'ΰ' => 'Ϋ́', - 'ῤ' => 'Ρ̓', - 'ῦ' => 'Υ͂', - 'ῧ' => 'Ϋ͂', - 'ῶ' => 'Ω͂', - 'ᾈ' => 'ἈΙ', - 'ᾉ' => 'ἉΙ', - 'ᾊ' => 'ἊΙ', - 'ᾋ' => 'ἋΙ', - 'ᾌ' => 'ἌΙ', - 'ᾍ' => 'ἍΙ', - 'ᾎ' => 'ἎΙ', - 'ᾏ' => 'ἏΙ', - 'ᾘ' => 'ἨΙ', - 'ᾙ' => 'ἩΙ', - 'ᾚ' => 'ἪΙ', - 'ᾛ' => 'ἫΙ', - 'ᾜ' => 'ἬΙ', - 'ᾝ' => 'ἭΙ', - 'ᾞ' => 'ἮΙ', - 'ᾟ' => 'ἯΙ', - 'ᾨ' => 'ὨΙ', - 'ᾩ' => 'ὩΙ', - 'ᾪ' => 'ὪΙ', - 'ᾫ' => 'ὫΙ', - 'ᾬ' => 'ὬΙ', - 'ᾭ' => 'ὭΙ', - 'ᾮ' => 'ὮΙ', - 'ᾯ' => 'ὯΙ', - 'ᾼ' => 'ΑΙ', - 'ῌ' => 'ΗΙ', - 'ῼ' => 'ΩΙ', - 'ᾲ' => 'ᾺΙ', - 'ᾴ' => 'ΆΙ', - 'ῂ' => 'ῊΙ', - 'ῄ' => 'ΉΙ', - 'ῲ' => 'ῺΙ', - 'ῴ' => 'ΏΙ', - 'ᾷ' => 'Α͂Ι', - 'ῇ' => 'Η͂Ι', - 'ῷ' => 'Ω͂Ι', -); diff --git a/vendor/symfony/polyfill-mbstring/bootstrap.php b/vendor/symfony/polyfill-mbstring/bootstrap.php deleted file mode 100644 index 1fedd1f7c..000000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap.php +++ /dev/null @@ -1,147 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -if (\PHP_VERSION_ID >= 80000) { - return require __DIR__.'/bootstrap80.php'; -} - -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); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader($string) { return p\Mbstring::mb_decode_mimeheader($string); } -} -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); } -} -if (!function_exists('mb_decode_numericentity')) { - function mb_decode_numericentity($string, $map, $encoding = null) { return p\Mbstring::mb_decode_numericentity($string, $map, $encoding); } -} -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); } -} -if (!function_exists('mb_convert_case')) { - function mb_convert_case($string, $mode, $encoding = null) { return p\Mbstring::mb_convert_case($string, $mode, $encoding); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding($encoding = null) { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language($language = null) { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings() { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases($encoding) { return p\Mbstring::mb_encoding_aliases($encoding); } -} -if (!function_exists('mb_check_encoding')) { - function mb_check_encoding($value = null, $encoding = null) { return p\Mbstring::mb_check_encoding($value, $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); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order($encoding = null) { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str($string, &$result = []) { parse_str($string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen($string, $encoding = null) { return p\Mbstring::mb_strlen($string, $encoding); } -} -if (!function_exists('mb_strpos')) { - function mb_strpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strpos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower($string, $encoding = null) { return p\Mbstring::mb_strtolower($string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper($string, $encoding = null) { return p\Mbstring::mb_strtoupper($string, $encoding); } -} -if (!function_exists('mb_substitute_character')) { - function mb_substitute_character($substitute_character = null) { return p\Mbstring::mb_substitute_character($substitute_character); } -} -if (!function_exists('mb_substr')) { - function mb_substr($string, $start, $length = 2147483647, $encoding = null) { return p\Mbstring::mb_substr($string, $start, $length, $encoding); } -} -if (!function_exists('mb_stripos')) { - function mb_stripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_stripos($haystack, $needle, $offset, $encoding); } -} -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); } -} -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); } -} -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); } -} -if (!function_exists('mb_strripos')) { - function mb_strripos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strripos($haystack, $needle, $offset, $encoding); } -} -if (!function_exists('mb_strrpos')) { - function mb_strrpos($haystack, $needle, $offset = 0, $encoding = null) { return p\Mbstring::mb_strrpos($haystack, $needle, $offset, $encoding); } -} -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); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info($type = 'all') { return p\Mbstring::mb_get_info($type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output($encoding = null) { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth($string, $encoding = null) { return p\Mbstring::mb_strwidth($string, $encoding); } -} -if (!function_exists('mb_substr_count')) { - function mb_substr_count($haystack, $needle, $encoding = null) { return p\Mbstring::mb_substr_count($haystack, $needle, $encoding); } -} -if (!function_exists('mb_output_handler')) { - function mb_output_handler($string, $status) { return p\Mbstring::mb_output_handler($string, $status); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input($type = null) { return p\Mbstring::mb_http_input($type); } -} - -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); } -} - -if (!function_exists('mb_ord')) { - function mb_ord($string, $encoding = null) { return p\Mbstring::mb_ord($string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr($codepoint, $encoding = null) { return p\Mbstring::mb_chr($codepoint, $encoding); } -} -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); } -} -if (!function_exists('mb_str_split')) { - function mb_str_split($string, $length = 1, $encoding = null) { return p\Mbstring::mb_str_split($string, $length, $encoding); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/bootstrap80.php b/vendor/symfony/polyfill-mbstring/bootstrap80.php deleted file mode 100644 index 82f5ac4d0..000000000 --- a/vendor/symfony/polyfill-mbstring/bootstrap80.php +++ /dev/null @@ -1,143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Mbstring as p; - -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); } -} -if (!function_exists('mb_decode_mimeheader')) { - function mb_decode_mimeheader(?string $string): string { return p\Mbstring::mb_decode_mimeheader((string) $string); } -} -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); } -} -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); } -} -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); } -} -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); } -} -if (!function_exists('mb_internal_encoding')) { - function mb_internal_encoding(?string $encoding = null): string|bool { return p\Mbstring::mb_internal_encoding($encoding); } -} -if (!function_exists('mb_language')) { - function mb_language(?string $language = null): string|bool { return p\Mbstring::mb_language($language); } -} -if (!function_exists('mb_list_encodings')) { - function mb_list_encodings(): array { return p\Mbstring::mb_list_encodings(); } -} -if (!function_exists('mb_encoding_aliases')) { - function mb_encoding_aliases(?string $encoding): array { return p\Mbstring::mb_encoding_aliases((string) $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); } -} -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); } -} -if (!function_exists('mb_detect_order')) { - function mb_detect_order(array|string|null $encoding = null): array|bool { return p\Mbstring::mb_detect_order($encoding); } -} -if (!function_exists('mb_parse_str')) { - function mb_parse_str(?string $string, &$result = []): bool { parse_str((string) $string, $result); return (bool) $result; } -} -if (!function_exists('mb_strlen')) { - function mb_strlen(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strlen((string) $string, $encoding); } -} -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); } -} -if (!function_exists('mb_strtolower')) { - function mb_strtolower(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtolower((string) $string, $encoding); } -} -if (!function_exists('mb_strtoupper')) { - function mb_strtoupper(?string $string, ?string $encoding = null): string { return p\Mbstring::mb_strtoupper((string) $string, $encoding); } -} -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); } -} -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); } -} -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); } -} -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); } -} -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); } -} -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); } -} -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); } -} -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); } -} -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); } -} -if (!function_exists('mb_get_info')) { - function mb_get_info(?string $type = 'all'): array|string|int|false { return p\Mbstring::mb_get_info((string) $type); } -} -if (!function_exists('mb_http_output')) { - function mb_http_output(?string $encoding = null): string|bool { return p\Mbstring::mb_http_output($encoding); } -} -if (!function_exists('mb_strwidth')) { - function mb_strwidth(?string $string, ?string $encoding = null): int { return p\Mbstring::mb_strwidth((string) $string, $encoding); } -} -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); } -} -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); } -} -if (!function_exists('mb_http_input')) { - function mb_http_input(?string $type = null): array|string|false { return p\Mbstring::mb_http_input($type); } -} - -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); } -} - -if (!function_exists('mb_ord')) { - function mb_ord(?string $string, ?string $encoding = null): int|false { return p\Mbstring::mb_ord((string) $string, $encoding); } -} -if (!function_exists('mb_chr')) { - function mb_chr(?int $codepoint, ?string $encoding = null): string|false { return p\Mbstring::mb_chr((int) $codepoint, $encoding); } -} -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); } -} -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); } -} - -if (extension_loaded('mbstring')) { - return; -} - -if (!defined('MB_CASE_UPPER')) { - define('MB_CASE_UPPER', 0); -} -if (!defined('MB_CASE_LOWER')) { - define('MB_CASE_LOWER', 1); -} -if (!defined('MB_CASE_TITLE')) { - define('MB_CASE_TITLE', 2); -} diff --git a/vendor/symfony/polyfill-mbstring/composer.json b/vendor/symfony/polyfill-mbstring/composer.json deleted file mode 100644 index 44895536b..000000000 --- a/vendor/symfony/polyfill-mbstring/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/polyfill-mbstring", - "type": "library", - "description": "Symfony polyfill for the Mbstring extension", - "keywords": ["polyfill", "shim", "compatibility", "portable", "mbstring"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "provide": { - "ext-mbstring": "*" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Mbstring\\": "" }, - "files": [ "bootstrap.php" ] - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/polyfill-php73/LICENSE b/vendor/symfony/polyfill-php73/LICENSE deleted file mode 100644 index 3f853aaf3..000000000 --- a/vendor/symfony/polyfill-php73/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-2019 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php73/Php73.php b/vendor/symfony/polyfill-php73/Php73.php deleted file mode 100644 index 65c35a6a1..000000000 --- a/vendor/symfony/polyfill-php73/Php73.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php73; - -/** - * @author Gabriel Caruso - * @author Ion Bazan - * - * @internal - */ -final class Php73 -{ - public static $startAt = 1533462603; - - /** - * @param bool $asNum - * - * @return array|float|int - */ - public static function hrtime($asNum = false) - { - $ns = microtime(false); - $s = substr($ns, 11) - self::$startAt; - $ns = 1E9 * (float) $ns; - - if ($asNum) { - $ns += $s * 1E9; - - return \PHP_INT_SIZE === 4 ? $ns : (int) $ns; - } - - return [$s, (int) $ns]; - } -} diff --git a/vendor/symfony/polyfill-php73/README.md b/vendor/symfony/polyfill-php73/README.md deleted file mode 100644 index 032fafbda..000000000 --- a/vendor/symfony/polyfill-php73/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Symfony Polyfill / Php73 -======================== - -This component provides functions added to PHP 7.3 core: - -- [`array_key_first`](https://php.net/array_key_first) -- [`array_key_last`](https://php.net/array_key_last) -- [`hrtime`](https://php.net/function.hrtime) -- [`is_countable`](https://php.net/is_countable) -- [`JsonException`](https://php.net/JsonException) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php b/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php deleted file mode 100644 index f06d6c269..000000000 --- a/vendor/symfony/polyfill-php73/Resources/stubs/JsonException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 70300) { - class JsonException extends Exception - { - } -} diff --git a/vendor/symfony/polyfill-php73/bootstrap.php b/vendor/symfony/polyfill-php73/bootstrap.php deleted file mode 100644 index d6b215382..000000000 --- a/vendor/symfony/polyfill-php73/bootstrap.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php73 as p; - -if (\PHP_VERSION_ID >= 70300) { - return; -} - -if (!function_exists('is_countable')) { - function is_countable($value) { return is_array($value) || $value instanceof Countable || $value instanceof ResourceBundle || $value instanceof SimpleXmlElement; } -} -if (!function_exists('hrtime')) { - require_once __DIR__.'/Php73.php'; - p\Php73::$startAt = (int) microtime(true); - function hrtime($as_number = false) { return p\Php73::hrtime($as_number); } -} -if (!function_exists('array_key_first')) { - function array_key_first(array $array) { foreach ($array as $key => $value) { return $key; } } -} -if (!function_exists('array_key_last')) { - function array_key_last(array $array) { return key(array_slice($array, -1, 1, true)); } -} diff --git a/vendor/symfony/polyfill-php80/LICENSE b/vendor/symfony/polyfill-php80/LICENSE deleted file mode 100644 index 5593b1d84..000000000 --- a/vendor/symfony/polyfill-php80/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2020 Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/polyfill-php80/Php80.php b/vendor/symfony/polyfill-php80/Php80.php deleted file mode 100644 index 362dd1a95..000000000 --- a/vendor/symfony/polyfill-php80/Php80.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Ion Bazan - * @author Nico Oelgart - * @author Nicolas Grekas - * - * @internal - */ -final class Php80 -{ - public static function fdiv(float $dividend, float $divisor): float - { - return @($dividend / $divisor); - } - - public static function get_debug_type($value): string - { - switch (true) { - case null === $value: return 'null'; - case \is_bool($value): return 'bool'; - case \is_string($value): return 'string'; - case \is_array($value): return 'array'; - case \is_int($value): return 'int'; - case \is_float($value): return 'float'; - case \is_object($value): break; - case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class'; - default: - if (null === $type = @get_resource_type($value)) { - return 'unknown'; - } - - if ('Unknown' === $type) { - $type = 'closed'; - } - - return "resource ($type)"; - } - - $class = \get_class($value); - - if (false === strpos($class, '@')) { - return $class; - } - - return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous'; - } - - public static function get_resource_id($res): int - { - if (!\is_resource($res) && null === @get_resource_type($res)) { - throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res))); - } - - return (int) $res; - } - - public static function preg_last_error_msg(): string - { - switch (preg_last_error()) { - case \PREG_INTERNAL_ERROR: - return 'Internal error'; - case \PREG_BAD_UTF8_ERROR: - return 'Malformed UTF-8 characters, possibly incorrectly encoded'; - case \PREG_BAD_UTF8_OFFSET_ERROR: - return 'The offset did not correspond to the beginning of a valid UTF-8 code point'; - case \PREG_BACKTRACK_LIMIT_ERROR: - return 'Backtrack limit exhausted'; - case \PREG_RECURSION_LIMIT_ERROR: - return 'Recursion limit exhausted'; - case \PREG_JIT_STACKLIMIT_ERROR: - return 'JIT stack limit exhausted'; - case \PREG_NO_ERROR: - return 'No error'; - default: - return 'Unknown error'; - } - } - - public static function str_contains(string $haystack, string $needle): bool - { - return '' === $needle || false !== strpos($haystack, $needle); - } - - public static function str_starts_with(string $haystack, string $needle): bool - { - return 0 === strncmp($haystack, $needle, \strlen($needle)); - } - - public static function str_ends_with(string $haystack, string $needle): bool - { - if ('' === $needle || $needle === $haystack) { - return true; - } - - if ('' === $haystack) { - return false; - } - - $needleLength = \strlen($needle); - - return $needleLength <= \strlen($haystack) && 0 === substr_compare($haystack, $needle, -$needleLength); - } -} diff --git a/vendor/symfony/polyfill-php80/PhpToken.php b/vendor/symfony/polyfill-php80/PhpToken.php deleted file mode 100644 index fe6e69105..000000000 --- a/vendor/symfony/polyfill-php80/PhpToken.php +++ /dev/null @@ -1,103 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Polyfill\Php80; - -/** - * @author Fedonyuk Anton - * - * @internal - */ -class PhpToken implements \Stringable -{ - /** - * @var int - */ - public $id; - - /** - * @var string - */ - public $text; - - /** - * @var int - */ - public $line; - - /** - * @var int - */ - public $pos; - - public function __construct(int $id, string $text, int $line = -1, int $position = -1) - { - $this->id = $id; - $this->text = $text; - $this->line = $line; - $this->pos = $position; - } - - public function getTokenName(): ?string - { - if ('UNKNOWN' === $name = token_name($this->id)) { - $name = \strlen($this->text) > 1 || \ord($this->text) < 32 ? null : $this->text; - } - - return $name; - } - - /** - * @param int|string|array $kind - */ - public function is($kind): bool - { - foreach ((array) $kind as $value) { - if (\in_array($value, [$this->id, $this->text], true)) { - return true; - } - } - - return false; - } - - public function isIgnorable(): bool - { - return \in_array($this->id, [\T_WHITESPACE, \T_COMMENT, \T_DOC_COMMENT, \T_OPEN_TAG], true); - } - - public function __toString(): string - { - return (string) $this->text; - } - - /** - * @return static[] - */ - public static function tokenize(string $code, int $flags = 0): array - { - $line = 1; - $position = 0; - $tokens = token_get_all($code, $flags); - foreach ($tokens as $index => $token) { - if (\is_string($token)) { - $id = \ord($token); - $text = $token; - } else { - [$id, $text, $line] = $token; - } - $tokens[$index] = new static($id, $text, $line, $position); - $position += \strlen($text); - } - - return $tokens; - } -} diff --git a/vendor/symfony/polyfill-php80/README.md b/vendor/symfony/polyfill-php80/README.md deleted file mode 100644 index 3816c559d..000000000 --- a/vendor/symfony/polyfill-php80/README.md +++ /dev/null @@ -1,25 +0,0 @@ -Symfony Polyfill / Php80 -======================== - -This component provides features added to PHP 8.0 core: - -- [`Stringable`](https://php.net/stringable) interface -- [`fdiv`](https://php.net/fdiv) -- [`ValueError`](https://php.net/valueerror) class -- [`UnhandledMatchError`](https://php.net/unhandledmatcherror) class -- `FILTER_VALIDATE_BOOL` constant -- [`get_debug_type`](https://php.net/get_debug_type) -- [`PhpToken`](https://php.net/phptoken) class -- [`preg_last_error_msg`](https://php.net/preg_last_error_msg) -- [`str_contains`](https://php.net/str_contains) -- [`str_starts_with`](https://php.net/str_starts_with) -- [`str_ends_with`](https://php.net/str_ends_with) -- [`get_resource_id`](https://php.net/get_resource_id) - -More information can be found in the -[main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md). - -License -======= - -This library is released under the [MIT license](LICENSE). diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php b/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php deleted file mode 100644 index 2b955423f..000000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Attribute.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -#[Attribute(Attribute::TARGET_CLASS)] -final class Attribute -{ - public const TARGET_CLASS = 1; - public const TARGET_FUNCTION = 2; - public const TARGET_METHOD = 4; - public const TARGET_PROPERTY = 8; - public const TARGET_CLASS_CONSTANT = 16; - public const TARGET_PARAMETER = 32; - public const TARGET_ALL = 63; - public const IS_REPEATABLE = 64; - - /** @var int */ - public $flags; - - public function __construct(int $flags = self::TARGET_ALL) - { - $this->flags = $flags; - } -} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php b/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php deleted file mode 100644 index 7c62d7508..000000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php +++ /dev/null @@ -1,20 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - interface Stringable - { - /** - * @return string - */ - public function __toString(); - } -} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php b/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php deleted file mode 100644 index 01c6c6c8a..000000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/UnhandledMatchError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class UnhandledMatchError extends Error - { - } -} diff --git a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php b/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php deleted file mode 100644 index 783dbc28c..000000000 --- a/vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -if (\PHP_VERSION_ID < 80000) { - class ValueError extends Error - { - } -} diff --git a/vendor/symfony/polyfill-php80/bootstrap.php b/vendor/symfony/polyfill-php80/bootstrap.php deleted file mode 100644 index e5f7dbc1a..000000000 --- a/vendor/symfony/polyfill-php80/bootstrap.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -use Symfony\Polyfill\Php80 as p; - -if (\PHP_VERSION_ID >= 80000) { - return; -} - -if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) { - define('FILTER_VALIDATE_BOOL', \FILTER_VALIDATE_BOOLEAN); -} - -if (!function_exists('fdiv')) { - function fdiv(float $num1, float $num2): float { return p\Php80::fdiv($num1, $num2); } -} -if (!function_exists('preg_last_error_msg')) { - function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); } -} -if (!function_exists('str_contains')) { - function str_contains(?string $haystack, ?string $needle): bool { return p\Php80::str_contains($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_starts_with')) { - function str_starts_with(?string $haystack, ?string $needle): bool { return p\Php80::str_starts_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('str_ends_with')) { - function str_ends_with(?string $haystack, ?string $needle): bool { return p\Php80::str_ends_with($haystack ?? '', $needle ?? ''); } -} -if (!function_exists('get_debug_type')) { - function get_debug_type($value): string { return p\Php80::get_debug_type($value); } -} -if (!function_exists('get_resource_id')) { - function get_resource_id($resource): int { return p\Php80::get_resource_id($resource); } -} diff --git a/vendor/symfony/polyfill-php80/composer.json b/vendor/symfony/polyfill-php80/composer.json deleted file mode 100644 index bd9a3262a..000000000 --- a/vendor/symfony/polyfill-php80/composer.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "symfony/polyfill-php80", - "type": "library", - "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", - "keywords": ["polyfill", "shim", "compatibility", "portable"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Ion Bazan", - "email": "ion.bazan@gmail.com" - }, - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=7.1" - }, - "autoload": { - "psr-4": { "Symfony\\Polyfill\\Php80\\": "" }, - "files": [ "bootstrap.php" ], - "classmap": [ "Resources/stubs" ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "1.27-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - } -} diff --git a/vendor/symfony/service-contracts/Attribute/Required.php b/vendor/symfony/service-contracts/Attribute/Required.php deleted file mode 100644 index 9df851189..000000000 --- a/vendor/symfony/service-contracts/Attribute/Required.php +++ /dev/null @@ -1,25 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -/** - * A required dependency. - * - * This attribute indicates that a property holds a required dependency. The annotated property or method should be - * considered during the instantiation process of the containing class. - * - * @author Alexander M. Turek - */ -#[\Attribute(\Attribute::TARGET_METHOD | \Attribute::TARGET_PROPERTY)] -final class Required -{ -} diff --git a/vendor/symfony/service-contracts/Attribute/SubscribedService.php b/vendor/symfony/service-contracts/Attribute/SubscribedService.php deleted file mode 100644 index d98e1dfdb..000000000 --- a/vendor/symfony/service-contracts/Attribute/SubscribedService.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Attribute; - -use Symfony\Contracts\Service\ServiceSubscriberInterface; -use Symfony\Contracts\Service\ServiceSubscriberTrait; - -/** - * For use as the return value for {@see ServiceSubscriberInterface}. - * - * @example new SubscribedService('http_client', HttpClientInterface::class, false, new Target('githubApi')) - * - * Use with {@see ServiceSubscriberTrait} to mark a method's return type - * as a subscribed service. - * - * @author Kevin Bond - */ -#[\Attribute(\Attribute::TARGET_METHOD)] -final class SubscribedService -{ - /** @var object[] */ - public array $attributes; - - /** - * @param string|null $key The key to use for the service - * @param class-string|null $type The service class - * @param bool $nullable Whether the service is optional - * @param object|object[] $attributes One or more dependency injection attributes to use - */ - public function __construct( - public ?string $key = null, - public ?string $type = null, - public bool $nullable = false, - array|object $attributes = [], - ) { - $this->attributes = \is_array($attributes) ? $attributes : [$attributes]; - } -} diff --git a/vendor/symfony/service-contracts/CHANGELOG.md b/vendor/symfony/service-contracts/CHANGELOG.md deleted file mode 100644 index 7932e2613..000000000 --- a/vendor/symfony/service-contracts/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -CHANGELOG -========= - -The changelog is maintained for all Symfony contracts at the following URL: -https://github.com/symfony/contracts/blob/main/CHANGELOG.md diff --git a/vendor/symfony/service-contracts/LICENSE b/vendor/symfony/service-contracts/LICENSE deleted file mode 100644 index 7536caeae..000000000 --- a/vendor/symfony/service-contracts/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2018-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/service-contracts/README.md b/vendor/symfony/service-contracts/README.md deleted file mode 100644 index 42841a57d..000000000 --- a/vendor/symfony/service-contracts/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Symfony Service Contracts -========================= - -A set of abstractions extracted out of the Symfony components. - -Can be used to build on semantics that the Symfony components proved useful and -that already have battle tested implementations. - -See https://github.com/symfony/contracts/blob/main/README.md for more information. diff --git a/vendor/symfony/service-contracts/ResetInterface.php b/vendor/symfony/service-contracts/ResetInterface.php deleted file mode 100644 index a4f389b01..000000000 --- a/vendor/symfony/service-contracts/ResetInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -/** - * Provides a way to reset an object to its initial state. - * - * When calling the "reset()" method on an object, it should be put back to its - * initial state. This usually means clearing any internal buffers and forwarding - * the call to internal dependencies. All properties of the object should be put - * back to the same state it had when it was first ready to use. - * - * This method could be called, for example, to recycle objects that are used as - * services, so that they can be used to handle several requests in the same - * process loop (note that we advise making your services stateless instead of - * implementing this interface when possible.) - */ -interface ResetInterface -{ - /** - * @return void - */ - public function reset(); -} diff --git a/vendor/symfony/service-contracts/ServiceLocatorTrait.php b/vendor/symfony/service-contracts/ServiceLocatorTrait.php deleted file mode 100644 index 45c8d910d..000000000 --- a/vendor/symfony/service-contracts/ServiceLocatorTrait.php +++ /dev/null @@ -1,115 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerExceptionInterface; -use Psr\Container\NotFoundExceptionInterface; - -// Help opcache.preload discover always-needed symbols -class_exists(ContainerExceptionInterface::class); -class_exists(NotFoundExceptionInterface::class); - -/** - * A trait to help implement ServiceProviderInterface. - * - * @author Robin Chalas - * @author Nicolas Grekas - */ -trait ServiceLocatorTrait -{ - private array $factories; - private array $loading = []; - private array $providedTypes; - - /** - * @param callable[] $factories - */ - public function __construct(array $factories) - { - $this->factories = $factories; - } - - public function has(string $id): bool - { - return isset($this->factories[$id]); - } - - public function get(string $id): mixed - { - if (!isset($this->factories[$id])) { - throw $this->createNotFoundException($id); - } - - if (isset($this->loading[$id])) { - $ids = array_values($this->loading); - $ids = \array_slice($this->loading, array_search($id, $ids)); - $ids[] = $id; - - throw $this->createCircularReferenceException($id, $ids); - } - - $this->loading[$id] = $id; - try { - return $this->factories[$id]($this); - } finally { - unset($this->loading[$id]); - } - } - - public function getProvidedServices(): array - { - if (!isset($this->providedTypes)) { - $this->providedTypes = []; - - foreach ($this->factories as $name => $factory) { - if (!\is_callable($factory)) { - $this->providedTypes[$name] = '?'; - } else { - $type = (new \ReflectionFunction($factory))->getReturnType(); - - $this->providedTypes[$name] = $type ? ($type->allowsNull() ? '?' : '').($type instanceof \ReflectionNamedType ? $type->getName() : $type) : '?'; - } - } - } - - return $this->providedTypes; - } - - private function createNotFoundException(string $id): NotFoundExceptionInterface - { - if (!$alternatives = array_keys($this->factories)) { - $message = 'is empty...'; - } else { - $last = array_pop($alternatives); - if ($alternatives) { - $message = sprintf('only knows about the "%s" and "%s" services.', implode('", "', $alternatives), $last); - } else { - $message = sprintf('only knows about the "%s" service.', $last); - } - } - - if ($this->loading) { - $message = sprintf('The service "%s" has a dependency on a non-existent service "%s". This locator %s', end($this->loading), $id, $message); - } else { - $message = sprintf('Service "%s" not found: the current service locator %s', $id, $message); - } - - return new class($message) extends \InvalidArgumentException implements NotFoundExceptionInterface { - }; - } - - private function createCircularReferenceException(string $id, array $path): ContainerExceptionInterface - { - return new class(sprintf('Circular reference detected for service "%s", path: "%s".', $id, implode(' -> ', $path))) extends \RuntimeException implements ContainerExceptionInterface { - }; - } -} diff --git a/vendor/symfony/service-contracts/ServiceProviderInterface.php b/vendor/symfony/service-contracts/ServiceProviderInterface.php deleted file mode 100644 index c05e4bfe7..000000000 --- a/vendor/symfony/service-contracts/ServiceProviderInterface.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; - -/** - * A ServiceProviderInterface exposes the identifiers and the types of services provided by a container. - * - * @author Nicolas Grekas - * @author Mateusz Sip - * - * @template-covariant T of mixed - */ -interface ServiceProviderInterface extends ContainerInterface -{ - /** - * @return T - */ - public function get(string $id): mixed; - - public function has(string $id): bool; - - /** - * Returns an associative array of service types keyed by the identifiers provided by the current container. - * - * Examples: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the object provides a service named "logger" that implements Psr\Log\LoggerInterface - * * ['foo' => '?'] means the container provides service name "foo" of unspecified type - * * ['bar' => '?Bar\Baz'] means the container provides a service "bar" of type Bar\Baz|null - * - * @return string[] The provided service types, keyed by service names - */ - public function getProvidedServices(): array; -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php b/vendor/symfony/service-contracts/ServiceSubscriberInterface.php deleted file mode 100644 index 3da19169b..000000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberInterface.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method. - * - * The getSubscribedServices method returns an array of service types required by such instances, - * optionally keyed by the service names used internally. Service types that start with an interrogation - * mark "?" are optional, while the other ones are mandatory service dependencies. - * - * The injected service locators SHOULD NOT allow access to any other services not specified by the method. - * - * It is expected that ServiceSubscriber instances consume PSR-11-based service locators internally. - * This interface does not dictate any injection method for these service locators, although constructor - * injection is recommended. - * - * @author Nicolas Grekas - */ -interface ServiceSubscriberInterface -{ - /** - * Returns an array of service types (or {@see SubscribedService} objects) required - * by such instances, optionally keyed by the service names used internally. - * - * For mandatory dependencies: - * - * * ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name - * internally to fetch a service which must implement Psr\Log\LoggerInterface. - * * ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name - * internally to fetch an iterable of Psr\Log\LoggerInterface instances. - * * ['Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface'] - * - * otherwise: - * - * * ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency - * * ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency - * * ['?Psr\Log\LoggerInterface'] is a shortcut for - * * ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface'] - * - * additionally, an array of {@see SubscribedService}'s can be returned: - * - * * [new SubscribedService('logger', Psr\Log\LoggerInterface::class)] - * * [new SubscribedService(type: Psr\Log\LoggerInterface::class, nullable: true)] - * * [new SubscribedService('http_client', HttpClientInterface::class, attributes: new Target('githubApi'))] - * - * @return string[]|SubscribedService[] The required service types, optionally keyed by service names - */ - public static function getSubscribedServices(): array; -} diff --git a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php b/vendor/symfony/service-contracts/ServiceSubscriberTrait.php deleted file mode 100644 index f3b450cd6..000000000 --- a/vendor/symfony/service-contracts/ServiceSubscriberTrait.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service; - -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\Attribute\Required; -use Symfony\Contracts\Service\Attribute\SubscribedService; - -/** - * Implementation of ServiceSubscriberInterface that determines subscribed services from - * method return types. Service ids are available as "ClassName::methodName". - * - * @author Kevin Bond - */ -trait ServiceSubscriberTrait -{ - /** @var ContainerInterface */ - protected $container; - - public static function getSubscribedServices(): array - { - $services = method_exists(get_parent_class(self::class) ?: '', __FUNCTION__) ? parent::getSubscribedServices() : []; - - foreach ((new \ReflectionClass(self::class))->getMethods() as $method) { - if (self::class !== $method->getDeclaringClass()->name) { - continue; - } - - if (!$attribute = $method->getAttributes(SubscribedService::class)[0] ?? null) { - continue; - } - - if ($method->isStatic() || $method->isAbstract() || $method->isGenerator() || $method->isInternal() || $method->getNumberOfRequiredParameters()) { - throw new \LogicException(sprintf('Cannot use "%s" on method "%s::%s()" (can only be used on non-static, non-abstract methods with no parameters).', SubscribedService::class, self::class, $method->name)); - } - - if (!$returnType = $method->getReturnType()) { - throw new \LogicException(sprintf('Cannot use "%s" on methods without a return type in "%s::%s()".', SubscribedService::class, $method->name, self::class)); - } - - /* @var SubscribedService $attribute */ - $attribute = $attribute->newInstance(); - $attribute->key ??= self::class.'::'.$method->name; - $attribute->type ??= $returnType instanceof \ReflectionNamedType ? $returnType->getName() : (string) $returnType; - $attribute->nullable = $returnType->allowsNull(); - - if ($attribute->attributes) { - $services[] = $attribute; - } else { - $services[$attribute->key] = ($attribute->nullable ? '?' : '').$attribute->type; - } - } - - return $services; - } - - #[Required] - public function setContainer(ContainerInterface $container): ?ContainerInterface - { - $ret = null; - if (method_exists(get_parent_class(self::class) ?: '', __FUNCTION__)) { - $ret = parent::setContainer($container); - } - - $this->container = $container; - - return $ret; - } -} diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php deleted file mode 100644 index 07d12b4a5..000000000 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTest.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -class_alias(ServiceLocatorTestCase::class, ServiceLocatorTest::class); - -if (false) { - /** - * @deprecated since PHPUnit 9.6 - */ - class ServiceLocatorTest - { - } -} diff --git a/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php b/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php deleted file mode 100644 index a0f20a6a7..000000000 --- a/vendor/symfony/service-contracts/Test/ServiceLocatorTestCase.php +++ /dev/null @@ -1,92 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Contracts\Service\Test; - -use PHPUnit\Framework\TestCase; -use Psr\Container\ContainerInterface; -use Symfony\Contracts\Service\ServiceLocatorTrait; - -abstract class ServiceLocatorTestCase extends TestCase -{ - protected function getServiceLocator(array $factories): ContainerInterface - { - return new class($factories) implements ContainerInterface { - use ServiceLocatorTrait; - }; - } - - public function testHas() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - function () { return 'dummy'; }, - ]); - - $this->assertTrue($locator->has('foo')); - $this->assertTrue($locator->has('bar')); - $this->assertFalse($locator->has('dummy')); - } - - public function testGet() - { - $locator = $this->getServiceLocator([ - 'foo' => function () { return 'bar'; }, - 'bar' => function () { return 'baz'; }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('baz', $locator->get('bar')); - } - - public function testGetDoesNotMemoize() - { - $i = 0; - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$i) { - ++$i; - - return 'bar'; - }, - ]); - - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame('bar', $locator->get('foo')); - $this->assertSame(2, $i); - } - - public function testThrowsOnUndefinedInternalService() - { - if (!$this->getExpectedException()) { - $this->expectException(\Psr\Container\NotFoundExceptionInterface::class); - $this->expectExceptionMessage('The service "foo" has a dependency on a non-existent service "bar". This locator only knows about the "foo" service.'); - } - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } - - public function testThrowsOnCircularReference() - { - $this->expectException(\Psr\Container\ContainerExceptionInterface::class); - $this->expectExceptionMessage('Circular reference detected for service "bar", path: "bar -> baz -> bar".'); - $locator = $this->getServiceLocator([ - 'foo' => function () use (&$locator) { return $locator->get('bar'); }, - 'bar' => function () use (&$locator) { return $locator->get('baz'); }, - 'baz' => function () use (&$locator) { return $locator->get('bar'); }, - ]); - - $locator->get('foo'); - } -} diff --git a/vendor/symfony/service-contracts/composer.json b/vendor/symfony/service-contracts/composer.json deleted file mode 100644 index a64188b51..000000000 --- a/vendor/symfony/service-contracts/composer.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "symfony/service-contracts", - "type": "library", - "description": "Generic abstractions related to writing services", - "keywords": ["abstractions", "contracts", "decoupling", "interfaces", "interoperability", "standards"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "psr/container": "^2.0" - }, - "conflict": { - "ext-psr": "<1.1|>=2" - }, - "autoload": { - "psr-4": { "Symfony\\Contracts\\Service\\": "" }, - "exclude-from-classmap": [ - "/Test/" - ] - }, - "minimum-stability": "dev", - "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, - "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" - } - } -} diff --git a/vendor/symfony/string/AbstractString.php b/vendor/symfony/string/AbstractString.php deleted file mode 100644 index bf491f88d..000000000 --- a/vendor/symfony/string/AbstractString.php +++ /dev/null @@ -1,708 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement doesn't care about the exact variant it deals with. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -abstract class AbstractString implements \Stringable, \JsonSerializable -{ - public const PREG_PATTERN_ORDER = \PREG_PATTERN_ORDER; - public const PREG_SET_ORDER = \PREG_SET_ORDER; - public const PREG_OFFSET_CAPTURE = \PREG_OFFSET_CAPTURE; - public const PREG_UNMATCHED_AS_NULL = \PREG_UNMATCHED_AS_NULL; - - public const PREG_SPLIT = 0; - public const PREG_SPLIT_NO_EMPTY = \PREG_SPLIT_NO_EMPTY; - public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE; - public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE; - - protected $string = ''; - protected $ignoreCase = false; - - abstract public function __construct(string $string = ''); - - /** - * Unwraps instances of AbstractString back to strings. - * - * @return string[]|array - */ - public static function unwrap(array $values): array - { - foreach ($values as $k => $v) { - if ($v instanceof self) { - $values[$k] = $v->__toString(); - } elseif (\is_array($v) && $values[$k] !== $v = static::unwrap($v)) { - $values[$k] = $v; - } - } - - return $values; - } - - /** - * Wraps (and normalizes) strings in instances of AbstractString. - * - * @return static[]|array - */ - public static function wrap(array $values): array - { - $i = 0; - $keys = null; - - foreach ($values as $k => $v) { - if (\is_string($k) && '' !== $k && $k !== $j = (string) new static($k)) { - $keys ??= array_keys($values); - $keys[$i] = $j; - } - - if (\is_string($v)) { - $values[$k] = new static($v); - } elseif (\is_array($v) && $values[$k] !== $v = static::wrap($v)) { - $values[$k] = $v; - } - - ++$i; - } - - return null !== $keys ? array_combine($keys, $values) : $values; - } - - /** - * @param string|string[] $needle - */ - public function after(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - /** - * @param string|string[] $needle - */ - public function afterLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if (!$includeNeedle) { - $i += $str->length(); - } - - return $this->slice($i); - } - - abstract public function append(string ...$suffix): static; - - /** - * @param string|string[] $needle - */ - public function before(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = \PHP_INT_MAX; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOf($n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - $str->string = $n; - } - } - - if (\PHP_INT_MAX === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @param string|string[] $needle - */ - public function beforeLast(string|iterable $needle, bool $includeNeedle = false, int $offset = 0): static - { - $str = clone $this; - $i = null; - - if (\is_string($needle)) { - $needle = [$needle]; - } - - foreach ($needle as $n) { - $n = (string) $n; - $j = $this->indexOfLast($n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - $str->string = $n; - } - } - - if (null === $i) { - return $str; - } - - if ($includeNeedle) { - $i += $str->length(); - } - - return $this->slice(0, $i); - } - - /** - * @return int[] - */ - public function bytesAt(int $offset): array - { - $str = $this->slice($offset, 1); - - return '' === $str->string ? [] : array_values(unpack('C*', $str->string)); - } - - abstract public function camel(): static; - - /** - * @return static[] - */ - abstract public function chunk(int $length = 1): array; - - public function collapseWhitespace(): static - { - $str = clone $this; - $str->string = trim(preg_replace("/(?:[ \n\r\t\x0C]{2,}+|[\n\r\t\x0C])/", ' ', $str->string), " \n\r\t\x0C"); - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function containsAny(string|iterable $needle): bool - { - return null !== $this->indexOf($needle); - } - - /** - * @param string|string[] $suffix - */ - public function endsWith(string|iterable $suffix): bool - { - if (\is_string($suffix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($suffix as $s) { - if ($this->endsWith((string) $s)) { - return true; - } - } - - return false; - } - - public function ensureEnd(string $suffix): static - { - if (!$this->endsWith($suffix)) { - return $this->append($suffix); - } - - $suffix = preg_quote($suffix); - $regex = '{('.$suffix.')(?:'.$suffix.')++$}D'; - - return $this->replaceMatches($regex.($this->ignoreCase ? 'i' : ''), '$1'); - } - - public function ensureStart(string $prefix): static - { - $prefix = new static($prefix); - - if (!$this->startsWith($prefix)) { - return $this->prepend($prefix); - } - - $str = clone $this; - $i = $prefixLen = $prefix->length(); - - while ($this->indexOf($prefix, $i) === $i) { - $str = $str->slice($prefixLen); - $i += $prefixLen; - } - - return $str; - } - - /** - * @param string|string[] $string - */ - public function equalsTo(string|iterable $string): bool - { - if (\is_string($string)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($string as $s) { - if ($this->equalsTo((string) $s)) { - return true; - } - } - - return false; - } - - abstract public function folded(): static; - - public function ignoreCase(): static - { - $str = clone $this; - $str->ignoreCase = true; - - return $str; - } - - /** - * @param string|string[] $needle - */ - public function indexOf(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = \PHP_INT_MAX; - - foreach ($needle as $n) { - $j = $this->indexOf((string) $n, $offset); - - if (null !== $j && $j < $i) { - $i = $j; - } - } - - return \PHP_INT_MAX === $i ? null : $i; - } - - /** - * @param string|string[] $needle - */ - public function indexOfLast(string|iterable $needle, int $offset = 0): ?int - { - if (\is_string($needle)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - $i = null; - - foreach ($needle as $n) { - $j = $this->indexOfLast((string) $n, $offset); - - if (null !== $j && $j >= $i) { - $i = $offset = $j; - } - } - - return $i; - } - - public function isEmpty(): bool - { - return '' === $this->string; - } - - abstract public function join(array $strings, string $lastGlue = null): static; - - public function jsonSerialize(): string - { - return $this->string; - } - - abstract public function length(): int; - - abstract public function lower(): static; - - /** - * Matches the string using a regular expression. - * - * Pass PREG_PATTERN_ORDER or PREG_SET_ORDER as $flags to get all occurrences matching the regular expression. - * - * @return array All matches in a multi-dimensional array ordered according to flags - */ - abstract public function match(string $regexp, int $flags = 0, int $offset = 0): array; - - abstract public function padBoth(int $length, string $padStr = ' '): static; - - abstract public function padEnd(int $length, string $padStr = ' '): static; - - abstract public function padStart(int $length, string $padStr = ' '): static; - - abstract public function prepend(string ...$prefix): static; - - public function repeat(int $multiplier): static - { - if (0 > $multiplier) { - throw new InvalidArgumentException(sprintf('Multiplier must be positive, %d given.', $multiplier)); - } - - $str = clone $this; - $str->string = str_repeat($str->string, $multiplier); - - return $str; - } - - abstract public function replace(string $from, string $to): static; - - abstract public function replaceMatches(string $fromRegexp, string|callable $to): static; - - abstract public function reverse(): static; - - abstract public function slice(int $start = 0, int $length = null): static; - - abstract public function snake(): static; - - abstract public function splice(string $replacement, int $start = 0, int $length = null): static; - - /** - * @return static[] - */ - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (null === $flags) { - throw new \TypeError('Split behavior when $flags is null must be implemented by child classes.'); - } - - if ($this->ignoreCase) { - $delimiter .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $chunks = preg_split($delimiter, $this->string, $limit, $flags)) { - throw new RuntimeException('Splitting failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - - if (self::PREG_SPLIT_OFFSET_CAPTURE & $flags) { - foreach ($chunks as &$chunk) { - $str->string = $chunk[0]; - $chunk[0] = clone $str; - } - } else { - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - } - - return $chunks; - } - - /** - * @param string|string[] $prefix - */ - public function startsWith(string|iterable $prefix): bool - { - if (\is_string($prefix)) { - throw new \TypeError(sprintf('Method "%s()" must be overridden by class "%s" to deal with non-iterable values.', __FUNCTION__, static::class)); - } - - foreach ($prefix as $prefix) { - if ($this->startsWith((string) $prefix)) { - return true; - } - } - - return false; - } - - abstract public function title(bool $allWords = false): static; - - public function toByteString(string $toEncoding = null): ByteString - { - $b = new ByteString(); - - $toEncoding = \in_array($toEncoding, ['utf8', 'utf-8', 'UTF8'], true) ? 'UTF-8' : $toEncoding; - - if (null === $toEncoding || $toEncoding === $fromEncoding = $this instanceof AbstractUnicodeString || preg_match('//u', $b->string) ? 'UTF-8' : 'Windows-1252') { - $b->string = $this->string; - - return $b; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $b->string = mb_convert_encoding($this->string, $toEncoding, 'UTF-8'); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $b->string = iconv('UTF-8', $toEncoding, $this->string); - } - } finally { - restore_error_handler(); - } - - return $b; - } - - public function toCodePointString(): CodePointString - { - return new CodePointString($this->string); - } - - public function toString(): string - { - return $this->string; - } - - public function toUnicodeString(): UnicodeString - { - return new UnicodeString($this->string); - } - - abstract public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - abstract public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $prefix - */ - public function trimPrefix($prefix): static - { - if (\is_array($prefix) || $prefix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($prefix as $s) { - $t = $this->trimPrefix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($prefix instanceof self) { - $prefix = $prefix->string; - } else { - $prefix = (string) $prefix; - } - - if ('' !== $prefix && \strlen($this->string) >= \strlen($prefix) && 0 === substr_compare($this->string, $prefix, 0, \strlen($prefix), $this->ignoreCase)) { - $str->string = substr($this->string, \strlen($prefix)); - } - - return $str; - } - - abstract public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static; - - /** - * @param string|string[] $suffix - */ - public function trimSuffix($suffix): static - { - if (\is_array($suffix) || $suffix instanceof \Traversable) { // don't use is_iterable(), it's slow - foreach ($suffix as $s) { - $t = $this->trimSuffix($s); - - if ($t->string !== $this->string) { - return $t; - } - } - - return clone $this; - } - - $str = clone $this; - - if ($suffix instanceof self) { - $suffix = $suffix->string; - } else { - $suffix = (string) $suffix; - } - - if ('' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase)) { - $str->string = substr($this->string, 0, -\strlen($suffix)); - } - - return $str; - } - - public function truncate(int $length, string $ellipsis = '', bool $cut = true): static - { - $stringLength = $this->length(); - - if ($stringLength <= $length) { - return clone $this; - } - - $ellipsisLength = '' !== $ellipsis ? (new static($ellipsis))->length() : 0; - - if ($length < $ellipsisLength) { - $ellipsisLength = 0; - } - - if (!$cut) { - if (null === $length = $this->indexOf([' ', "\r", "\n", "\t"], ($length ?: 1) - 1)) { - return clone $this; - } - - $length += $ellipsisLength; - } - - $str = $this->slice(0, $length - $ellipsisLength); - - return $ellipsisLength ? $str->trimEnd()->append($ellipsis) : $str; - } - - abstract public function upper(): static; - - /** - * Returns the printable length on a terminal. - */ - abstract public function width(bool $ignoreAnsiDecoration = true): int; - - public function wordwrap(int $width = 75, string $break = "\n", bool $cut = false): static - { - $lines = '' !== $break ? $this->split($break) : [clone $this]; - $chars = []; - $mask = ''; - - if (1 === \count($lines) && '' === $lines[0]->string) { - return $lines[0]; - } - - foreach ($lines as $i => $line) { - if ($i) { - $chars[] = $break; - $mask .= '#'; - } - - foreach ($line->chunk() as $char) { - $chars[] = $char->string; - $mask .= ' ' === $char->string ? ' ' : '?'; - } - } - - $string = ''; - $j = 0; - $b = $i = -1; - $mask = wordwrap($mask, $width, '#', $cut); - - while (false !== $b = strpos($mask, '#', $b + 1)) { - for (++$i; $i < $b; ++$i) { - $string .= $chars[$j]; - unset($chars[$j++]); - } - - if ($break === $chars[$j] || ' ' === $chars[$j]) { - unset($chars[$j++]); - } - - $string .= $break; - } - - $str = clone $this; - $str->string = $string.implode('', $chars); - - return $str; - } - - public function __sleep(): array - { - return ['string']; - } - - public function __clone() - { - $this->ignoreCase = false; - } - - public function __toString(): string - { - return $this->string; - } -} diff --git a/vendor/symfony/string/AbstractUnicodeString.php b/vendor/symfony/string/AbstractUnicodeString.php deleted file mode 100644 index d19a61a9c..000000000 --- a/vendor/symfony/string/AbstractUnicodeString.php +++ /dev/null @@ -1,590 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a string of abstract Unicode characters. - * - * Unicode defines 3 types of "characters" (bytes, code points and grapheme clusters). - * This class is the abstract type to use as a type-hint when the logic you want to - * implement is Unicode-aware but doesn't care about code points vs grapheme clusters. - * - * @author Nicolas Grekas - * - * @throws ExceptionInterface - */ -abstract class AbstractUnicodeString extends AbstractString -{ - public const NFC = \Normalizer::NFC; - public const NFD = \Normalizer::NFD; - public const NFKC = \Normalizer::NFKC; - public const NFKD = \Normalizer::NFKD; - - // all ASCII letters sorted by typical frequency of occurrence - private const 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"; - - // the subset of folded case mappings that is not in lower case mappings - private const FOLD_FROM = ['İ', 'µ', 'ſ', "\xCD\x85", 'ς', 'ϐ', 'ϑ', 'ϕ', 'ϖ', 'ϰ', 'ϱ', 'ϵ', 'ẛ', "\xE1\xBE\xBE", 'ß', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'և', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'ẚ', 'ẞ', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ᾀ', 'ᾁ', 'ᾂ', 'ᾃ', 'ᾄ', 'ᾅ', 'ᾆ', 'ᾇ', 'ᾈ', 'ᾉ', 'ᾊ', 'ᾋ', 'ᾌ', 'ᾍ', 'ᾎ', 'ᾏ', 'ᾐ', 'ᾑ', 'ᾒ', 'ᾓ', 'ᾔ', 'ᾕ', 'ᾖ', 'ᾗ', 'ᾘ', 'ᾙ', 'ᾚ', 'ᾛ', 'ᾜ', 'ᾝ', 'ᾞ', 'ᾟ', 'ᾠ', 'ᾡ', 'ᾢ', 'ᾣ', 'ᾤ', 'ᾥ', 'ᾦ', 'ᾧ', 'ᾨ', 'ᾩ', 'ᾪ', 'ᾫ', 'ᾬ', 'ᾭ', 'ᾮ', 'ᾯ', 'ᾲ', 'ᾳ', 'ᾴ', 'ᾶ', 'ᾷ', 'ᾼ', 'ῂ', 'ῃ', 'ῄ', 'ῆ', 'ῇ', 'ῌ', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ῲ', 'ῳ', 'ῴ', 'ῶ', 'ῷ', 'ῼ', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'ſt', 'st', 'ﬓ', 'ﬔ', 'ﬕ', 'ﬖ', 'ﬗ']; - private const FOLD_TO = ['i̇', 'μ', 's', 'ι', 'σ', 'β', 'θ', 'φ', 'π', 'κ', 'ρ', 'ε', 'ṡ', 'ι', 'ss', 'ʼn', 'ǰ', 'ΐ', 'ΰ', 'եւ', 'ẖ', 'ẗ', 'ẘ', 'ẙ', 'aʾ', 'ss', 'ὐ', 'ὒ', 'ὔ', 'ὖ', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἀι', 'ἁι', 'ἂι', 'ἃι', 'ἄι', 'ἅι', 'ἆι', 'ἇι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ἠι', 'ἡι', 'ἢι', 'ἣι', 'ἤι', 'ἥι', 'ἦι', 'ἧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὠι', 'ὡι', 'ὢι', 'ὣι', 'ὤι', 'ὥι', 'ὦι', 'ὧι', 'ὰι', 'αι', 'άι', 'ᾶ', 'ᾶι', 'αι', 'ὴι', 'ηι', 'ήι', 'ῆ', 'ῆι', 'ηι', 'ῒ', 'ῖ', 'ῗ', 'ῢ', 'ῤ', 'ῦ', 'ῧ', 'ὼι', 'ωι', 'ώι', 'ῶ', 'ῶι', 'ωι', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'st', 'st', 'մն', 'մե', 'մի', 'վն', 'մխ']; - - // the subset of https://github.com/unicode-org/cldr/blob/master/common/transforms/Latin-ASCII.xml that is not in NFKD - private const TRANSLIT_FROM = ['Æ', 'Ð', 'Ø', 'Þ', 'ß', 'æ', 'ð', 'ø', 'þ', 'Đ', 'đ', 'Ħ', 'ħ', 'ı', 'ĸ', 'Ŀ', 'ŀ', 'Ł', 'ł', 'ʼn', 'Ŋ', 'ŋ', 'Œ', 'œ', 'Ŧ', 'ŧ', 'ƀ', 'Ɓ', 'Ƃ', 'ƃ', 'Ƈ', 'ƈ', 'Ɖ', 'Ɗ', 'Ƌ', 'ƌ', 'Ɛ', 'Ƒ', 'ƒ', 'Ɠ', 'ƕ', 'Ɩ', 'Ɨ', 'Ƙ', 'ƙ', 'ƚ', 'Ɲ', 'ƞ', 'Ƣ', 'ƣ', 'Ƥ', 'ƥ', 'ƫ', 'Ƭ', 'ƭ', 'Ʈ', 'Ʋ', 'Ƴ', 'ƴ', 'Ƶ', 'ƶ', 'DŽ', 'Dž', 'dž', 'Ǥ', 'ǥ', 'ȡ', 'Ȥ', 'ȥ', 'ȴ', 'ȵ', 'ȶ', 'ȷ', 'ȸ', 'ȹ', 'Ⱥ', 'Ȼ', 'ȼ', 'Ƚ', 'Ⱦ', 'ȿ', 'ɀ', 'Ƀ', 'Ʉ', 'Ɇ', 'ɇ', 'Ɉ', 'ɉ', 'Ɍ', 'ɍ', 'Ɏ', 'ɏ', 'ɓ', 'ɕ', 'ɖ', 'ɗ', 'ɛ', 'ɟ', 'ɠ', 'ɡ', 'ɢ', 'ɦ', 'ɧ', 'ɨ', 'ɪ', 'ɫ', 'ɬ', 'ɭ', 'ɱ', 'ɲ', 'ɳ', 'ɴ', 'ɶ', 'ɼ', 'ɽ', 'ɾ', 'ʀ', 'ʂ', 'ʈ', 'ʉ', 'ʋ', 'ʏ', 'ʐ', 'ʑ', 'ʙ', 'ʛ', 'ʜ', 'ʝ', 'ʟ', 'ʠ', 'ʣ', 'ʥ', 'ʦ', 'ʪ', 'ʫ', 'ᴀ', 'ᴁ', 'ᴃ', 'ᴄ', 'ᴅ', 'ᴆ', 'ᴇ', 'ᴊ', 'ᴋ', 'ᴌ', 'ᴍ', 'ᴏ', 'ᴘ', 'ᴛ', 'ᴜ', 'ᴠ', 'ᴡ', 'ᴢ', 'ᵫ', 'ᵬ', 'ᵭ', 'ᵮ', 'ᵯ', 'ᵰ', 'ᵱ', 'ᵲ', 'ᵳ', 'ᵴ', 'ᵵ', 'ᵶ', 'ᵺ', 'ᵻ', 'ᵽ', 'ᵾ', 'ᶀ', 'ᶁ', 'ᶂ', 'ᶃ', 'ᶄ', 'ᶅ', 'ᶆ', 'ᶇ', 'ᶈ', 'ᶉ', 'ᶊ', 'ᶌ', 'ᶍ', 'ᶎ', 'ᶏ', 'ᶑ', 'ᶒ', 'ᶓ', 'ᶖ', 'ᶙ', 'ẚ', 'ẜ', 'ẝ', 'ẞ', 'Ỻ', 'ỻ', 'Ỽ', 'ỽ', 'Ỿ', 'ỿ', '©', '®', '₠', '₢', '₣', '₤', '₧', '₺', '₹', 'ℌ', '℞', '㎧', '㎮', '㏆', '㏗', '㏞', '㏟', '¼', '½', '¾', '⅓', '⅔', '⅕', '⅖', '⅗', '⅘', '⅙', '⅚', '⅛', '⅜', '⅝', '⅞', '⅟', '〇', '‘', '’', '‚', '‛', '“', '”', '„', '‟', '′', '″', '〝', '〞', '«', '»', '‹', '›', '‐', '‑', '‒', '–', '—', '―', '︱', '︲', '﹘', '‖', '⁄', '⁅', '⁆', '⁎', '、', '。', '〈', '〉', '《', '》', '〔', '〕', '〘', '〙', '〚', '〛', '︑', '︒', '︹', '︺', '︽', '︾', '︿', '﹀', '﹑', '﹝', '﹞', '⦅', '⦆', '。', '、', '×', '÷', '−', '∕', '∖', '∣', '∥', '≪', '≫', '⦅', '⦆']; - private const TRANSLIT_TO = ['AE', 'D', 'O', 'TH', 'ss', 'ae', 'd', 'o', 'th', 'D', 'd', 'H', 'h', 'i', 'q', 'L', 'l', 'L', 'l', '\'n', 'N', 'n', 'OE', 'oe', 'T', 't', 'b', 'B', 'B', 'b', 'C', 'c', 'D', 'D', 'D', 'd', 'E', 'F', 'f', 'G', 'hv', 'I', 'I', 'K', 'k', 'l', 'N', 'n', 'OI', 'oi', 'P', 'p', 't', 'T', 't', 'T', 'V', 'Y', 'y', 'Z', 'z', 'DZ', 'Dz', 'dz', 'G', 'g', 'd', 'Z', 'z', 'l', 'n', 't', 'j', 'db', 'qp', 'A', 'C', 'c', 'L', 'T', 's', 'z', 'B', 'U', 'E', 'e', 'J', 'j', 'R', 'r', 'Y', 'y', 'b', 'c', 'd', 'd', 'e', 'j', 'g', 'g', 'G', 'h', 'h', 'i', 'I', 'l', 'l', 'l', 'm', 'n', 'n', 'N', 'OE', 'r', 'r', 'r', 'R', 's', 't', 'u', 'v', 'Y', 'z', 'z', 'B', 'G', 'H', 'j', 'L', 'q', 'dz', 'dz', 'ts', 'ls', 'lz', 'A', 'AE', 'B', 'C', 'D', 'D', 'E', 'J', 'K', 'L', 'M', 'O', 'P', 'T', 'U', 'V', 'W', 'Z', 'ue', 'b', 'd', 'f', 'm', 'n', 'p', 'r', 'r', 's', 't', 'z', 'th', 'I', 'p', 'U', 'b', 'd', 'f', 'g', 'k', 'l', 'm', 'n', 'p', 'r', 's', 'v', 'x', 'z', 'a', 'd', 'e', 'e', 'i', 'u', 'a', 's', 's', 'SS', 'LL', 'll', 'V', 'v', 'Y', 'y', '(C)', '(R)', 'CE', 'Cr', 'Fr.', 'L.', 'Pts', 'TL', 'Rs', 'x', 'Rx', 'm/s', 'rad/s', 'C/kg', 'pH', 'V/m', 'A/m', ' 1/4', ' 1/2', ' 3/4', ' 1/3', ' 2/3', ' 1/5', ' 2/5', ' 3/5', ' 4/5', ' 1/6', ' 5/6', ' 1/8', ' 3/8', ' 5/8', ' 7/8', ' 1/', '0', '\'', '\'', ',', '\'', '"', '"', ',,', '"', '\'', '"', '"', '"', '<<', '>>', '<', '>', '-', '-', '-', '-', '-', '-', '-', '-', '-', '||', '/', '[', ']', '*', ',', '.', '<', '>', '<<', '>>', '[', ']', '[', ']', '[', ']', ',', '.', '[', ']', '<<', '>>', '<', '>', ',', '[', ']', '((', '))', '.', ',', '*', '/', '-', '/', '\\', '|', '||', '<<', '>>', '((', '))']; - - private static $transliterators = []; - private static $tableZero; - private static $tableWide; - - public static function fromCodePoints(int ...$codes): static - { - $string = ''; - - foreach ($codes as $code) { - if (0x80 > $code %= 0x200000) { - $string .= \chr($code); - } elseif (0x800 > $code) { - $string .= \chr(0xC0 | $code >> 6).\chr(0x80 | $code & 0x3F); - } elseif (0x10000 > $code) { - $string .= \chr(0xE0 | $code >> 12).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } else { - $string .= \chr(0xF0 | $code >> 18).\chr(0x80 | $code >> 12 & 0x3F).\chr(0x80 | $code >> 6 & 0x3F).\chr(0x80 | $code & 0x3F); - } - } - - return new static($string); - } - - /** - * Generic UTF-8 to ASCII transliteration. - * - * Install the intl extension for best results. - * - * @param string[]|\Transliterator[]|\Closure[] $rules See "*-Latin" rules from Transliterator::listIDs() - */ - public function ascii(array $rules = []): self - { - $str = clone $this; - $s = $str->string; - $str->string = ''; - - array_unshift($rules, 'nfd'); - $rules[] = 'latin-ascii'; - - if (\function_exists('transliterator_transliterate')) { - $rules[] = 'any-latin/bgn'; - } - - $rules[] = 'nfkd'; - $rules[] = '[:nonspacing mark:] remove'; - - while (\strlen($s) - 1 > $i = strspn($s, self::ASCII)) { - if (0 < --$i) { - $str->string .= substr($s, 0, $i); - $s = substr($s, $i); - } - - if (!$rule = array_shift($rules)) { - $rules = []; // An empty rule interrupts the next ones - } - - if ($rule instanceof \Transliterator) { - $s = $rule->transliterate($s); - } elseif ($rule instanceof \Closure) { - $s = $rule($s); - } elseif ($rule) { - if ('nfd' === $rule = strtolower($rule)) { - normalizer_is_normalized($s, self::NFD) ?: $s = normalizer_normalize($s, self::NFD); - } elseif ('nfkd' === $rule) { - normalizer_is_normalized($s, self::NFKD) ?: $s = normalizer_normalize($s, self::NFKD); - } elseif ('[:nonspacing mark:] remove' === $rule) { - $s = preg_replace('/\p{Mn}++/u', '', $s); - } elseif ('latin-ascii' === $rule) { - $s = str_replace(self::TRANSLIT_FROM, self::TRANSLIT_TO, $s); - } elseif ('de-ascii' === $rule) { - $s = preg_replace("/([AUO])\u{0308}(?=\p{Ll})/u", '$1e', $s); - $s = str_replace(["a\u{0308}", "o\u{0308}", "u\u{0308}", "A\u{0308}", "O\u{0308}", "U\u{0308}"], ['ae', 'oe', 'ue', 'AE', 'OE', 'UE'], $s); - } elseif (\function_exists('transliterator_transliterate')) { - if (null === $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule)) { - if ('any-latin/bgn' === $rule) { - $rule = 'any-latin'; - $transliterator = self::$transliterators[$rule] ??= \Transliterator::create($rule); - } - - if (null === $transliterator) { - throw new InvalidArgumentException(sprintf('Unknown transliteration rule "%s".', $rule)); - } - - self::$transliterators['any-latin/bgn'] = $transliterator; - } - - $s = $transliterator->transliterate($s); - } - } elseif (!\function_exists('iconv')) { - $s = preg_replace('/[^\x00-\x7F]/u', '?', $s); - } else { - $s = @preg_replace_callback('/[^\x00-\x7F]/u', static function ($c) { - $c = (string) iconv('UTF-8', 'ASCII//TRANSLIT', $c[0]); - - if ('' === $c && '' === iconv('UTF-8', 'ASCII//TRANSLIT', '²')) { - throw new \LogicException(sprintf('"%s" requires a translit-able iconv implementation, try installing "gnu-libiconv" if you\'re using Alpine Linux.', static::class)); - } - - return 1 < \strlen($c) ? ltrim($c, '\'`"^~') : ('' !== $c ? $c : '?'); - }, $s); - } - } - - $str->string .= $s; - - return $str; - } - - public function camel(): static - { - $str = clone $this; - $str->string = str_replace(' ', '', preg_replace_callback('/\b.(?![A-Z]{2,})/u', static function ($m) { - static $i = 0; - - return 1 === ++$i ? ('İ' === $m[0] ? 'i̇' : mb_strtolower($m[0], 'UTF-8')) : mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'); - }, preg_replace('/[^\pL0-9]++/u', ' ', $this->string))); - - return $str; - } - - /** - * @return int[] - */ - public function codePointsAt(int $offset): array - { - $str = $this->slice($offset, 1); - - if ('' === $str->string) { - return []; - } - - $codePoints = []; - - foreach (preg_split('//u', $str->string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoints[] = mb_ord($c, 'UTF-8'); - } - - return $codePoints; - } - - public function folded(bool $compat = true): static - { - $str = clone $this; - - if (!$compat || !\defined('Normalizer::NFKC_CF')) { - $str->string = normalizer_normalize($str->string, $compat ? \Normalizer::NFKC : \Normalizer::NFC); - $str->string = mb_strtolower(str_replace(self::FOLD_FROM, self::FOLD_TO, $this->string), 'UTF-8'); - } else { - $str->string = normalizer_normalize($str->string, \Normalizer::NFKC_CF); - } - - return $str; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function lower(): static - { - $str = clone $this; - $str->string = mb_strtolower(str_replace('İ', 'i̇', $str->string), 'UTF-8'); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp.'u', $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function normalize(int $form = self::NFC): static - { - if (!\in_array($form, [self::NFC, self::NFD, self::NFKC, self::NFKD])) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } - - $str = clone $this; - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - - return $str; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_BOTH); - } - - public function padEnd(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_RIGHT); - } - - public function padStart(int $length, string $padStr = ' '): static - { - if ('' === $padStr || !preg_match('//u', $padStr)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $pad = clone $this; - $pad->string = $padStr; - - return $this->pad($length, $pad, \STR_PAD_LEFT); - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - if (\is_array($to) || $to instanceof \Closure) { - $replace = 'preg_replace_callback'; - $to = static function (array $m) use ($to): string { - $to = $to($m); - - if ('' !== $to && (!\is_string($to) || !preg_match('//u', $to))) { - throw new InvalidArgumentException('Replace callback must return a valid UTF-8 string.'); - } - - return $to; - }; - } elseif ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } else { - $replace = 'preg_replace'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp.'u', $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = implode('', array_reverse(preg_split('/(\X)/u', $str->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY))); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = mb_strtolower(preg_replace(['/(\p{Lu}+)(\p{Lu}\p{Ll})/u', '/([\p{Ll}0-9])(\p{Lu})/u'], '\1_\2', $str->string), 'UTF-8'); - - return $str; - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - - $limit = $allWords ? -1 : 1; - - $str->string = preg_replace_callback('/\b./u', static fn (array $m): string => mb_convert_case($m[0], \MB_CASE_TITLE, 'UTF-8'), $str->string, $limit); - - return $str; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++|[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{[$chars]++$}uD", '', $str->string); - - return $str; - } - - public function trimPrefix($prefix): static - { - if (!$this->ignoreCase) { - return parent::trimPrefix($prefix); - } - - $str = clone $this; - - if ($prefix instanceof \Traversable) { - $prefix = iterator_to_array($prefix, false); - } elseif ($prefix instanceof parent) { - $prefix = $prefix->string; - } - - $prefix = implode('|', array_map('preg_quote', (array) $prefix)); - $str->string = preg_replace("{^(?:$prefix)}iuD", '', $this->string); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}"): static - { - if (" \t\n\r\0\x0B\x0C\u{A0}\u{FEFF}" !== $chars && !preg_match('//u', $chars)) { - throw new InvalidArgumentException('Invalid UTF-8 chars.'); - } - $chars = preg_quote($chars); - - $str = clone $this; - $str->string = preg_replace("{^[$chars]++}uD", '', $str->string); - - return $str; - } - - public function trimSuffix($suffix): static - { - if (!$this->ignoreCase) { - return parent::trimSuffix($suffix); - } - - $str = clone $this; - - if ($suffix instanceof \Traversable) { - $suffix = iterator_to_array($suffix, false); - } elseif ($suffix instanceof parent) { - $suffix = $suffix->string; - } - - $suffix = implode('|', array_map('preg_quote', (array) $suffix)); - $str->string = preg_replace("{(?:$suffix)$}iuD", '', $this->string); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = mb_strtoupper($str->string, 'UTF-8'); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $width = 0; - $s = str_replace(["\x00", "\x05", "\x07"], '', $this->string); - - if (str_contains($s, "\r")) { - $s = str_replace(["\r\n", "\r"], "\n", $s); - } - - if (!$ignoreAnsiDecoration) { - $s = preg_replace('/[\p{Cc}\x7F]++/u', '', $s); - } - - foreach (explode("\n", $s) as $s) { - if ($ignoreAnsiDecoration) { - $s = preg_replace('/(?:\x1B(?: - \[ [\x30-\x3F]*+ [\x20-\x2F]*+ [\x40-\x7E] - | [P\]X^_] .*? \x1B\\\\ - | [\x41-\x7E] - )|[\p{Cc}\x7F]++)/xu', '', $s); - } - - $lineWidth = $this->wcswidth($s); - - if ($lineWidth > $width) { - $width = $lineWidth; - } - } - - return $width; - } - - private function pad(int $len, self $pad, int $type): static - { - $sLen = $this->length(); - - if ($len <= $sLen) { - return clone $this; - } - - $padLen = $pad->length(); - $freeLen = $len - $sLen; - $len = $freeLen % $padLen; - - switch ($type) { - case \STR_PAD_RIGHT: - return $this->append(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_LEFT: - return $this->prepend(str_repeat($pad->string, intdiv($freeLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - case \STR_PAD_BOTH: - $freeLen /= 2; - - $rightLen = ceil($freeLen); - $len = $rightLen % $padLen; - $str = $this->append(str_repeat($pad->string, intdiv($rightLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - $leftLen = floor($freeLen); - $len = $leftLen % $padLen; - - return $str->prepend(str_repeat($pad->string, intdiv($leftLen, $padLen)).($len ? $pad->slice(0, $len) : '')); - - default: - throw new InvalidArgumentException('Invalid padding type.'); - } - } - - /** - * Based on https://github.com/jquast/wcwidth, a Python implementation of https://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c. - */ - private function wcswidth(string $string): int - { - $width = 0; - - foreach (preg_split('//u', $string, -1, \PREG_SPLIT_NO_EMPTY) as $c) { - $codePoint = mb_ord($c, 'UTF-8'); - - if (0 === $codePoint // NULL - || 0x034F === $codePoint // COMBINING GRAPHEME JOINER - || (0x200B <= $codePoint && 0x200F >= $codePoint) // ZERO WIDTH SPACE to RIGHT-TO-LEFT MARK - || 0x2028 === $codePoint // LINE SEPARATOR - || 0x2029 === $codePoint // PARAGRAPH SEPARATOR - || (0x202A <= $codePoint && 0x202E >= $codePoint) // LEFT-TO-RIGHT EMBEDDING to RIGHT-TO-LEFT OVERRIDE - || (0x2060 <= $codePoint && 0x2063 >= $codePoint) // WORD JOINER to INVISIBLE SEPARATOR - ) { - continue; - } - - // Non printable characters - if (32 > $codePoint // C0 control characters - || (0x07F <= $codePoint && 0x0A0 > $codePoint) // C1 control characters and DEL - ) { - return -1; - } - - self::$tableZero ??= require __DIR__.'/Resources/data/wcswidth_table_zero.php'; - - if ($codePoint >= self::$tableZero[0][0] && $codePoint <= self::$tableZero[$ubound = \count(self::$tableZero) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableZero[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableZero[$mid][0]) { - $ubound = $mid - 1; - } else { - continue 2; - } - } - } - - self::$tableWide ??= require __DIR__.'/Resources/data/wcswidth_table_wide.php'; - - if ($codePoint >= self::$tableWide[0][0] && $codePoint <= self::$tableWide[$ubound = \count(self::$tableWide) - 1][1]) { - $lbound = 0; - while ($ubound >= $lbound) { - $mid = floor(($lbound + $ubound) / 2); - - if ($codePoint > self::$tableWide[$mid][1]) { - $lbound = $mid + 1; - } elseif ($codePoint < self::$tableWide[$mid][0]) { - $ubound = $mid - 1; - } else { - $width += 2; - - continue 2; - } - } - } - - ++$width; - } - - return $width; - } -} diff --git a/vendor/symfony/string/ByteString.php b/vendor/symfony/string/ByteString.php deleted file mode 100644 index 212290fed..000000000 --- a/vendor/symfony/string/ByteString.php +++ /dev/null @@ -1,485 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; -use Symfony\Component\String\Exception\RuntimeException; - -/** - * Represents a binary-safe string of bytes. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class ByteString extends AbstractString -{ - private const ALPHABET_ALPHANUMERIC = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'; - - public function __construct(string $string = '') - { - $this->string = $string; - } - - /* - * The following method was derived from code of the Hack Standard Library (v4.40 - 2020-05-03) - * - * https://github.com/hhvm/hsl/blob/80a42c02f036f72a42f0415e80d6b847f4bf62d5/src/random/private.php#L16 - * - * Code subject to the MIT license (https://github.com/hhvm/hsl/blob/master/LICENSE). - * - * Copyright (c) 2004-2020, Facebook, Inc. (https://www.facebook.com/) - */ - - public static function fromRandom(int $length = 16, string $alphabet = null): self - { - if ($length <= 0) { - throw new InvalidArgumentException(sprintf('A strictly positive length is expected, "%d" given.', $length)); - } - - $alphabet ??= self::ALPHABET_ALPHANUMERIC; - $alphabetSize = \strlen($alphabet); - $bits = (int) ceil(log($alphabetSize, 2.0)); - if ($bits <= 0 || $bits > 56) { - throw new InvalidArgumentException('The length of the alphabet must in the [2^1, 2^56] range.'); - } - - $ret = ''; - while ($length > 0) { - $urandomLength = (int) ceil(2 * $length * $bits / 8.0); - $data = random_bytes($urandomLength); - $unpackedData = 0; - $unpackedBits = 0; - for ($i = 0; $i < $urandomLength && $length > 0; ++$i) { - // Unpack 8 bits - $unpackedData = ($unpackedData << 8) | \ord($data[$i]); - $unpackedBits += 8; - - // While we have enough bits to select a character from the alphabet, keep - // consuming the random data - for (; $unpackedBits >= $bits && $length > 0; $unpackedBits -= $bits) { - $index = ($unpackedData & ((1 << $bits) - 1)); - $unpackedData >>= $bits; - // Unfortunately, the alphabet size is not necessarily a power of two. - // Worst case, it is 2^k + 1, which means we need (k+1) bits and we - // have around a 50% chance of missing as k gets larger - if ($index < $alphabetSize) { - $ret .= $alphabet[$index]; - --$length; - } - } - } - } - - return new static($ret); - } - - public function bytesAt(int $offset): array - { - $str = $this->string[$offset] ?? ''; - - return '' === $str ? [] : [\ord($str)]; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - return $str; - } - - public function camel(): static - { - $str = clone $this; - - $parts = explode(' ', trim(ucwords(preg_replace('/[^a-zA-Z0-9\x7f-\xff]++/', ' ', $this->string)))); - $parts[0] = 1 !== \strlen($parts[0]) && ctype_upper($parts[0]) ? $parts[0] : lcfirst($parts[0]); - $str->string = implode('', $parts); - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $str = clone $this; - $chunks = []; - - foreach (str_split($this->string, $length) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - return '' !== $suffix && \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix), null, $this->ignoreCase); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return 0 === strcasecmp($string, $this->string); - } - - return $string === $this->string; - } - - public function folded(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? stripos($this->string, $needle, $offset) : strpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? strripos($this->string, $needle, $offset) : strrpos($this->string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function isUtf8(): bool - { - return '' === $this->string || preg_match('//u', $this->string); - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = clone $this; - - $tail = null !== $lastGlue && 1 < \count($strings) ? $lastGlue.array_pop($strings) : ''; - $str->string = implode($this->string, $strings).$tail; - - return $str; - } - - public function length(): int - { - return \strlen($this->string); - } - - public function lower(): static - { - $str = clone $this; - $str->string = strtolower($str->string); - - return $str; - } - - public function match(string $regexp, int $flags = 0, int $offset = 0): array - { - $match = ((\PREG_PATTERN_ORDER | \PREG_SET_ORDER) & $flags) ? 'preg_match_all' : 'preg_match'; - - if ($this->ignoreCase) { - $regexp .= 'i'; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (false === $match($regexp, $this->string, $matches, $flags | \PREG_UNMATCHED_AS_NULL, $offset)) { - throw new RuntimeException('Matching failed with error: '.preg_last_error_msg()); - } - } finally { - restore_error_handler(); - } - - return $matches; - } - - public function padBoth(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_BOTH); - - return $str; - } - - public function padEnd(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_RIGHT); - - return $str; - } - - public function padStart(int $length, string $padStr = ' '): static - { - $str = clone $this; - $str->string = str_pad($this->string, $length, $padStr, \STR_PAD_LEFT); - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$str->string; - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' !== $from) { - $str->string = $this->ignoreCase ? str_ireplace($from, $to, $this->string) : str_replace($from, $to, $this->string); - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - if ($this->ignoreCase) { - $fromRegexp .= 'i'; - } - - $replace = \is_array($to) || $to instanceof \Closure ? 'preg_replace_callback' : 'preg_replace'; - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - if (null === $string = $replace($fromRegexp, $to, $this->string)) { - $lastError = preg_last_error(); - - foreach (get_defined_constants(true)['pcre'] as $k => $v) { - if ($lastError === $v && str_ends_with($k, '_ERROR')) { - throw new RuntimeException('Matching failed with '.$k.'.'); - } - } - - throw new RuntimeException('Matching failed with unknown error code.'); - } - } finally { - restore_error_handler(); - } - - $str = clone $this; - $str->string = $string; - - return $str; - } - - public function reverse(): static - { - $str = clone $this; - $str->string = strrev($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = (string) substr($this->string, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function snake(): static - { - $str = $this->camel(); - $str->string = strtolower(preg_replace(['/([A-Z]+)([A-Z][a-z])/', '/([a-z\d])([A-Z])/'], '\1_\2', $str->string)); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter, $limit, $flags); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - return '' !== $prefix && 0 === ($this->ignoreCase ? strncasecmp($this->string, $prefix, \strlen($prefix)) : strncmp($this->string, $prefix, \strlen($prefix))); - } - - public function title(bool $allWords = false): static - { - $str = clone $this; - $str->string = $allWords ? ucwords($str->string) : ucfirst($str->string); - - return $str; - } - - public function toUnicodeString(string $fromEncoding = null): UnicodeString - { - return new UnicodeString($this->toCodePointString($fromEncoding)->string); - } - - public function toCodePointString(string $fromEncoding = null): CodePointString - { - $u = new CodePointString(); - - if (\in_array($fromEncoding, [null, 'utf8', 'utf-8', 'UTF8', 'UTF-8'], true) && preg_match('//u', $this->string)) { - $u->string = $this->string; - - return $u; - } - - set_error_handler(static function ($t, $m) { throw new InvalidArgumentException($m); }); - - try { - try { - $validEncoding = false !== mb_detect_encoding($this->string, $fromEncoding ?? 'Windows-1252', true); - } catch (InvalidArgumentException $e) { - if (!\function_exists('iconv')) { - throw $e; - } - - $u->string = iconv($fromEncoding ?? 'Windows-1252', 'UTF-8', $this->string); - - return $u; - } - } finally { - restore_error_handler(); - } - - if (!$validEncoding) { - throw new InvalidArgumentException(sprintf('Invalid "%s" string.', $fromEncoding ?? 'Windows-1252')); - } - - $u->string = mb_convert_encoding($this->string, 'UTF-8', $fromEncoding ?? 'Windows-1252'); - - return $u; - } - - public function trim(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = trim($str->string, $chars); - - return $str; - } - - public function trimEnd(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = rtrim($str->string, $chars); - - return $str; - } - - public function trimStart(string $chars = " \t\n\r\0\x0B\x0C"): static - { - $str = clone $this; - $str->string = ltrim($str->string, $chars); - - return $str; - } - - public function upper(): static - { - $str = clone $this; - $str->string = strtoupper($str->string); - - return $str; - } - - public function width(bool $ignoreAnsiDecoration = true): int - { - $string = preg_match('//u', $this->string) ? $this->string : preg_replace('/[\x80-\xFF]/', '?', $this->string); - - return (new CodePointString($string))->width($ignoreAnsiDecoration); - } -} diff --git a/vendor/symfony/string/CHANGELOG.md b/vendor/symfony/string/CHANGELOG.md deleted file mode 100644 index 31a3b54db..000000000 --- a/vendor/symfony/string/CHANGELOG.md +++ /dev/null @@ -1,40 +0,0 @@ -CHANGELOG -========= - -6.2 ---- - - * Add support for emoji in `AsciiSlugger` - -5.4 ---- - - * Add `trimSuffix()` and `trimPrefix()` methods - -5.3 ---- - - * Made `AsciiSlugger` fallback to parent locale's symbolsMap - -5.2.0 ------ - - * added a `FrenchInflector` class - -5.1.0 ------ - - * added the `AbstractString::reverse()` method - * made `AbstractString::width()` follow POSIX.1-2001 - * added `LazyString` which provides memoizing stringable objects - * The component is not marked as `@experimental` anymore - * added the `s()` helper method to get either an `UnicodeString` or `ByteString` instance, - depending of the input string UTF-8 compliancy - * added `$cut` parameter to `Symfony\Component\String\AbstractString::truncate()` - * added `AbstractString::containsAny()` - * allow passing a string of custom characters to `ByteString::fromRandom()` - -5.0.0 ------ - - * added the component as experimental diff --git a/vendor/symfony/string/CodePointString.php b/vendor/symfony/string/CodePointString.php deleted file mode 100644 index f5c900fb2..000000000 --- a/vendor/symfony/string/CodePointString.php +++ /dev/null @@ -1,260 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode code points encoded as UTF-8. - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class CodePointString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - if ('' !== $string && !preg_match('//u', $string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $this->string = $string; - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string .= 1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix); - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '.{65535}'; - $length -= 65535; - } - $rx .= '.{'.$length.'})/us'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function codePointsAt(int $offset): array - { - $str = $offset ? $this->slice($offset, 1) : $this; - - return '' === $str->string ? [] : [mb_ord($str->string, 'UTF-8')]; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - if ('' === $suffix || !preg_match('//u', $suffix)) { - return false; - } - - if ($this->ignoreCase) { - return preg_match('{'.preg_quote($suffix).'$}iuD', $this->string); - } - - return \strlen($this->string) >= \strlen($suffix) && 0 === substr_compare($this->string, $suffix, -\strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - if ('' !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_stripos($this->string, $needle, $offset, 'UTF-8') : mb_strpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - if ('' === $needle) { - return null; - } - - $i = $this->ignoreCase ? mb_strripos($this->string, $needle, $offset, 'UTF-8') : mb_strrpos($this->string, $needle, $offset, 'UTF-8'); - - return false === $i ? null : $i; - } - - public function length(): int - { - return mb_strlen($this->string, 'UTF-8'); - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - - if (!preg_match('//u', $str->string)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - - if ('' === $from || !preg_match('//u', $from)) { - return $str; - } - - if ('' !== $to && !preg_match('//u', $to)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - if ($this->ignoreCase) { - $str->string = implode($to, preg_split('{'.preg_quote($from).'}iuD', $this->string)); - } else { - $str->string = str_replace($from, $to, $this->string); - } - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - $str->string = mb_substr($this->string, $start, $length, 'UTF-8'); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - if (!preg_match('//u', $replacement)) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - $str = clone $this; - $start = $start ? \strlen(mb_substr($this->string, 0, $start, 'UTF-8')) : 0; - $length = $length ? \strlen(mb_substr($this->string, $start, $length, 'UTF-8')) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? \PHP_INT_MAX); - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= \PHP_INT_MAX) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - if (!preg_match('//u', $delimiter)) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $chunks = $this->ignoreCase - ? preg_split('{'.preg_quote($delimiter).'}iuD', $this->string, $limit) - : explode($delimiter, $this->string, $limit); - - foreach ($chunks as &$chunk) { - $str->string = $chunk; - $chunk = clone $str; - } - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - if ('' === $prefix || !preg_match('//u', $prefix)) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos($this->string, $prefix, 0, 'UTF-8'); - } - - return 0 === strncmp($this->string, $prefix, \strlen($prefix)); - } -} diff --git a/vendor/symfony/string/Exception/ExceptionInterface.php b/vendor/symfony/string/Exception/ExceptionInterface.php deleted file mode 100644 index 361978656..000000000 --- a/vendor/symfony/string/Exception/ExceptionInterface.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -interface ExceptionInterface extends \Throwable -{ -} diff --git a/vendor/symfony/string/Exception/InvalidArgumentException.php b/vendor/symfony/string/Exception/InvalidArgumentException.php deleted file mode 100644 index 6aa586bcf..000000000 --- a/vendor/symfony/string/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/string/Exception/RuntimeException.php b/vendor/symfony/string/Exception/RuntimeException.php deleted file mode 100644 index 77cb091f9..000000000 --- a/vendor/symfony/string/Exception/RuntimeException.php +++ /dev/null @@ -1,16 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Exception; - -class RuntimeException extends \RuntimeException implements ExceptionInterface -{ -} diff --git a/vendor/symfony/string/Inflector/EnglishInflector.php b/vendor/symfony/string/Inflector/EnglishInflector.php deleted file mode 100644 index 2871e4e51..000000000 --- a/vendor/symfony/string/Inflector/EnglishInflector.php +++ /dev/null @@ -1,511 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -final class EnglishInflector implements InflectorInterface -{ - /** - * Map English plural to singular suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const PLURAL_MAP = [ - // First entry: plural suffix, reversed - // Second entry: length of plural suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: singular suffix, normal - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['a', 1, true, true, ['on', 'um']], - - // nebulae (nebula) - ['ea', 2, true, true, 'a'], - - // services (service) - ['secivres', 8, true, true, 'service'], - - // mice (mouse), lice (louse) - ['eci', 3, false, true, 'ouse'], - - // geese (goose) - ['esee', 4, false, true, 'oose'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['i', 1, true, true, 'us'], - - // men (man), women (woman) - ['nem', 3, true, true, 'man'], - - // children (child) - ['nerdlihc', 8, true, true, 'child'], - - // oxen (ox) - ['nexo', 4, false, false, 'ox'], - - // indices (index), appendices (appendix), prices (price) - ['seci', 4, false, true, ['ex', 'ix', 'ice']], - - // codes (code) - ['sedoc', 5, false, true, 'code'], - - // selfies (selfie) - ['seifles', 7, true, true, 'selfie'], - - // zombies (zombie) - ['seibmoz', 7, true, true, 'zombie'], - - // movies (movie) - ['seivom', 6, true, true, 'movie'], - - // names (name) - ['seman', 5, true, false, 'name'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sesutcep', 8, true, true, 'pectus'], - - // feet (foot) - ['teef', 4, true, true, 'foot'], - - // geese (goose) - ['eseeg', 5, true, true, 'goose'], - - // teeth (tooth) - ['hteet', 5, true, true, 'tooth'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // series (series) - ['seires', 6, true, true, 'series'], - - // babies (baby) - ['sei', 3, false, true, 'y'], - - // accesses (access), addresses (address), kisses (kiss) - ['sess', 4, true, false, 'ss'], - - // analyses (analysis), ellipses (ellipsis), fungi (fungus), - // neuroses (neurosis), theses (thesis), emphases (emphasis), - // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas) - ['ses', 3, true, true, ['s', 'se', 'sis']], - - // objectives (objective), alternative (alternatives) - ['sevit', 5, true, true, 'tive'], - - // drives (drive) - ['sevird', 6, false, true, 'drive'], - - // lives (life), wives (wife) - ['sevi', 4, false, true, 'ife'], - - // moves (move) - ['sevom', 5, true, true, 'move'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf), caves (cave), staves (staff) - ['sev', 3, true, true, ['f', 've', 'ff']], - - // axes (axis), axes (ax), axes (axe) - ['sexa', 4, false, false, ['ax', 'axe', 'axis']], - - // indexes (index), matrixes (matrix) - ['sex', 3, true, false, 'x'], - - // quizzes (quiz) - ['sezz', 4, true, false, 'z'], - - // bureaus (bureau) - ['suae', 4, false, true, 'eau'], - - // fees (fee), trees (tree), employees (employee) - ['see', 3, true, true, 'ee'], - - // edges (edge) - ['segd', 4, true, true, 'dge'], - - // roses (rose), garages (garage), cassettes (cassette), - // waltzes (waltz), heroes (hero), bushes (bush), arches (arch), - // shoes (shoe) - ['se', 2, true, true, ['', 'e']], - - // tags (tag) - ['s', 1, true, true, ''], - - // chateaux (chateau) - ['xuae', 4, false, true, 'eau'], - - // people (person) - ['elpoep', 6, true, true, 'person'], - ]; - - /** - * Map English singular to plural suffixes. - * - * @see http://english-zone.com/spelling/plurals.html - */ - private const SINGULAR_MAP = [ - // First entry: singular suffix, reversed - // Second entry: length of singular suffix - // Third entry: Whether the suffix may succeed a vocal - // Fourth entry: Whether the suffix may succeed a consonant - // Fifth entry: plural suffix, normal - - // criterion (criteria) - ['airetirc', 8, false, false, 'criterion'], - - // nebulae (nebula) - ['aluben', 6, false, false, 'nebulae'], - - // children (child) - ['dlihc', 5, true, true, 'children'], - - // prices (price) - ['eci', 3, false, true, 'ices'], - - // services (service) - ['ecivres', 7, true, true, 'services'], - - // lives (life), wives (wife) - ['efi', 3, false, true, 'ives'], - - // selfies (selfie) - ['eifles', 6, true, true, 'selfies'], - - // movies (movie) - ['eivom', 5, true, true, 'movies'], - - // lice (louse) - ['esuol', 5, false, true, 'lice'], - - // mice (mouse) - ['esuom', 5, false, true, 'mice'], - - // geese (goose) - ['esoo', 4, false, true, 'eese'], - - // houses (house), bases (base) - ['es', 2, true, true, 'ses'], - - // geese (goose) - ['esoog', 5, true, true, 'geese'], - - // caves (cave) - ['ev', 2, true, true, 'ves'], - - // drives (drive) - ['evird', 5, false, true, 'drives'], - - // objectives (objective), alternative (alternatives) - ['evit', 4, true, true, 'tives'], - - // moves (move) - ['evom', 4, true, true, 'moves'], - - // staves (staff) - ['ffats', 5, true, true, 'staves'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['ff', 2, true, true, 'ffs'], - - // hooves (hoof), dwarves (dwarf), elves (elf), leaves (leaf) - ['f', 1, true, true, ['fs', 'ves']], - - // arches (arch) - ['hc', 2, true, true, 'ches'], - - // bushes (bush) - ['hs', 2, true, true, 'shes'], - - // teeth (tooth) - ['htoot', 5, true, true, 'teeth'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['mu', 2, true, true, 'a'], - - // men (man), women (woman) - ['nam', 3, true, true, 'men'], - - // people (person) - ['nosrep', 6, true, true, ['persons', 'people']], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['noi', 3, true, true, 'ions'], - - // coupon (coupons) - ['nop', 3, true, true, 'pons'], - - // seasons (season), treasons (treason), poisons (poison), lessons (lesson) - ['nos', 3, true, true, 'sons'], - - // bacteria (bacterium), criteria (criterion), phenomena (phenomenon) - ['no', 2, true, true, 'a'], - - // echoes (echo) - ['ohce', 4, true, true, 'echoes'], - - // heroes (hero) - ['oreh', 4, true, true, 'heroes'], - - // atlases (atlas) - ['salta', 5, true, true, 'atlases'], - - // irises (iris) - ['siri', 4, true, true, 'irises'], - - // analyses (analysis), ellipses (ellipsis), neuroses (neurosis) - // theses (thesis), emphases (emphasis), oases (oasis), - // crises (crisis) - ['sis', 3, true, true, 'ses'], - - // accesses (access), addresses (address), kisses (kiss) - ['ss', 2, true, false, 'sses'], - - // syllabi (syllabus) - ['suballys', 8, true, true, 'syllabi'], - - // buses (bus) - ['sub', 3, true, true, 'buses'], - - // circuses (circus) - ['suc', 3, true, true, 'cuses'], - - // conspectuses (conspectus), prospectuses (prospectus) - ['sutcep', 6, true, true, 'pectuses'], - - // fungi (fungus), alumni (alumnus), syllabi (syllabus), radii (radius) - ['su', 2, true, true, 'i'], - - // news (news) - ['swen', 4, true, true, 'news'], - - // feet (foot) - ['toof', 4, true, true, 'feet'], - - // chateaux (chateau), bureaus (bureau) - ['uae', 3, false, true, ['eaus', 'eaux']], - - // oxen (ox) - ['xo', 2, false, false, 'oxen'], - - // hoaxes (hoax) - ['xaoh', 4, true, false, 'hoaxes'], - - // indices (index) - ['xedni', 5, false, true, ['indicies', 'indexes']], - - // boxes (box) - ['xo', 2, false, true, 'oxes'], - - // indexes (index), matrixes (matrix) - ['x', 1, true, false, ['cies', 'xes']], - - // appendices (appendix) - ['xi', 2, false, true, 'ices'], - - // babies (baby) - ['y', 1, false, true, 'ies'], - - // quizzes (quiz) - ['ziuq', 4, true, false, 'quizzes'], - - // waltzes (waltz) - ['z', 1, true, true, 'zes'], - ]; - - /** - * A list of words which should not be inflected, reversed. - */ - private const UNINFLECTED = [ - '', - - // data - 'atad', - - // deer - 'reed', - - // feedback - 'kcabdeef', - - // fish - 'hsif', - - // info - 'ofni', - - // moose - 'esoom', - - // series - 'seires', - - // sheep - 'peehs', - - // species - 'seiceps', - ]; - - public function singularize(string $plural): array - { - $pluralRev = strrev($plural); - $lowerPluralRev = strtolower($pluralRev); - $pluralLength = \strlen($lowerPluralRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerPluralRev, self::UNINFLECTED, true)) { - return [$plural]; - } - - // The outer loop iterates over the entries of the plural table - // The inner loop $j iterates over the characters of the plural suffix - // in the plural table to compare them with the characters of the actual - // given plural suffix - foreach (self::PLURAL_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the plural table and of the suffix of the - // given plural one by one - while ($suffix[$j] === $lowerPluralRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the singular suffix to the singular array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $pluralLength) { - $nextIsVocal = str_contains('aeiou', $lowerPluralRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($plural, 0, $pluralLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the plural suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($pluralRev[$j - 1]); - - if (\is_array($newSuffix)) { - $singulars = []; - - foreach ($newSuffix as $newSuffixEntry) { - $singulars[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $singulars; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $pluralLength) { - break; - } - } - } - - // Assume that plural and singular is identical - return [$plural]; - } - - public function pluralize(string $singular): array - { - $singularRev = strrev($singular); - $lowerSingularRev = strtolower($singularRev); - $singularLength = \strlen($lowerSingularRev); - - // Check if the word is one which is not inflected, return early if so - if (\in_array($lowerSingularRev, self::UNINFLECTED, true)) { - return [$singular]; - } - - // The outer loop iterates over the entries of the singular table - // The inner loop $j iterates over the characters of the singular suffix - // in the singular table to compare them with the characters of the actual - // given singular suffix - foreach (self::SINGULAR_MAP as $map) { - $suffix = $map[0]; - $suffixLength = $map[1]; - $j = 0; - - // Compare characters in the singular table and of the suffix of the - // given plural one by one - - while ($suffix[$j] === $lowerSingularRev[$j]) { - // Let $j point to the next character - ++$j; - - // Successfully compared the last character - // Add an entry with the plural suffix to the plural array - if ($j === $suffixLength) { - // Is there any character preceding the suffix in the plural string? - if ($j < $singularLength) { - $nextIsVocal = str_contains('aeiou', $lowerSingularRev[$j]); - - if (!$map[2] && $nextIsVocal) { - // suffix may not succeed a vocal but next char is one - break; - } - - if (!$map[3] && !$nextIsVocal) { - // suffix may not succeed a consonant but next char is one - break; - } - } - - $newBase = substr($singular, 0, $singularLength - $suffixLength); - $newSuffix = $map[4]; - - // Check whether the first character in the singular suffix - // is uppercased. If yes, uppercase the first character in - // the singular suffix too - $firstUpper = ctype_upper($singularRev[$j - 1]); - - if (\is_array($newSuffix)) { - $plurals = []; - - foreach ($newSuffix as $newSuffixEntry) { - $plurals[] = $newBase.($firstUpper ? ucfirst($newSuffixEntry) : $newSuffixEntry); - } - - return $plurals; - } - - return [$newBase.($firstUpper ? ucfirst($newSuffix) : $newSuffix)]; - } - - // Suffix is longer than word - if ($j === $singularLength) { - break; - } - } - } - - // Assume that plural is singular with a trailing `s` - return [$singular.'s']; - } -} diff --git a/vendor/symfony/string/Inflector/FrenchInflector.php b/vendor/symfony/string/Inflector/FrenchInflector.php deleted file mode 100644 index 955abbf46..000000000 --- a/vendor/symfony/string/Inflector/FrenchInflector.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -/** - * French inflector. - * - * This class does only inflect nouns; not adjectives nor composed words like "soixante-dix". - */ -final class FrenchInflector implements InflectorInterface -{ - /** - * A list of all rules for pluralise. - * - * @see https://la-conjugaison.nouvelobs.com/regles/grammaire/le-pluriel-des-noms-121.php - */ - private const PLURALIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Words finishing with "s", "x" or "z" are invariables - // Les mots finissant par "s", "x" ou "z" sont invariables - ['/(s|x|z)$/i', '\1'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)$/i', '\1x'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/^(landau)$/i', '\1s'], - ['/(au)$/i', '\1x'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/^(pneu|bleu|émeu)$/i', '\1s'], - ['/(eu)$/i', '\1x'], - - // Words finishing with "al" are pluralized with a "aux" excepted - // Les mots finissant en "al" se terminent en "aux" sauf - ['/^(bal|carnaval|caracal|chacal|choral|corral|étal|festival|récital|val)$/i', '\1s'], - ['/al$/i', '\1aux'], - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/^(aspir|b|cor|ém|ferm|soupir|trav|vant|vitr)ail$/i', '\1aux'], - - // Bijou, caillou, chou, genou, hibou, joujou et pou qui prennent un x au pluriel - ['/^(bij|caill|ch|gen|hib|jouj|p)ou$/i', '\1oux'], - - // Invariable words - ['/^(cinquante|soixante|mille)$/i', '\1'], - - // French titles - ['/^(mon|ma)(sieur|dame|demoiselle|seigneur)$/', 'mes\2s'], - ['/^(Mon|Ma)(sieur|dame|demoiselle|seigneur)$/', 'Mes\2s'], - ]; - - /** - * A list of all rules for singularize. - */ - private const SINGULARIZE_REGEXP = [ - // First entry: regexp - // Second entry: replacement - - // Aspirail, bail, corail, émail, fermail, soupirail, travail, vantail et vitrail font leur pluriel en -aux - ['/((aspir|b|cor|ém|ferm|soupir|trav|vant|vitr))aux$/i', '\1ail'], - - // Words finishing with "eau" are pluralized with a "x" - // Les mots finissant par "eau" prennent tous un "x" au pluriel - ['/(eau)x$/i', '\1'], - - // Words finishing with "al" are pluralized with a "aux" expected - // Les mots finissant en "al" se terminent en "aux" sauf - ['/(amir|anim|arsen|boc|can|capit|capor|chev|crist|génér|hopit|hôpit|idé|journ|littor|loc|m|mét|minér|princip|radic|termin)aux$/i', '\1al'], - - // Words finishing with "au" are pluralized with a "x" excepted "landau" - // Les mots finissant par "au" prennent un "x" au pluriel sauf "landau" - ['/(au)x$/i', '\1'], - - // Words finishing with "eu" are pluralized with a "x" excepted "pneu", "bleu", "émeu" - // Les mots finissant en "eu" prennent un "x" au pluriel sauf "pneu", "bleu", "émeu" - ['/(eu)x$/i', '\1'], - - // Words finishing with "ou" are pluralized with a "s" excepted bijou, caillou, chou, genou, hibou, joujou, pou - // Les mots finissant par "ou" prennent un "s" sauf bijou, caillou, chou, genou, hibou, joujou, pou - ['/(bij|caill|ch|gen|hib|jouj|p)oux$/i', '\1ou'], - - // French titles - ['/^mes(dame|demoiselle)s$/', 'ma\1'], - ['/^Mes(dame|demoiselle)s$/', 'Ma\1'], - ['/^mes(sieur|seigneur)s$/', 'mon\1'], - ['/^Mes(sieur|seigneur)s$/', 'Mon\1'], - - // Default rule - ['/s$/i', ''], - ]; - - /** - * A list of words which should not be inflected. - * This list is only used by singularize. - */ - private const UNINFLECTED = '/^(abcès|accès|abus|albatros|anchois|anglais|autobus|bois|brebis|carquois|cas|chas|colis|concours|corps|cours|cyprès|décès|devis|discours|dos|embarras|engrais|entrelacs|excès|fils|fois|gâchis|gars|glas|héros|intrus|jars|jus|kermès|lacis|legs|lilas|marais|mars|matelas|mépris|mets|mois|mors|obus|os|palais|paradis|parcours|pardessus|pays|plusieurs|poids|pois|pouls|printemps|processus|progrès|puits|pus|rabais|radis|recors|recours|refus|relais|remords|remous|rictus|rhinocéros|repas|rubis|sans|sas|secours|sens|souris|succès|talus|tapis|tas|taudis|temps|tiers|univers|velours|verglas|vernis|virus)$/i'; - - public function singularize(string $plural): array - { - if ($this->isInflectedWord($plural)) { - return [$plural]; - } - - foreach (self::SINGULARIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $plural)) { - return [preg_replace($regexp, $replace, $plural)]; - } - } - - return [$plural]; - } - - public function pluralize(string $singular): array - { - if ($this->isInflectedWord($singular)) { - return [$singular]; - } - - foreach (self::PLURALIZE_REGEXP as $rule) { - [$regexp, $replace] = $rule; - - if (1 === preg_match($regexp, $singular)) { - return [preg_replace($regexp, $replace, $singular)]; - } - } - - return [$singular.'s']; - } - - private function isInflectedWord(string $word): bool - { - return 1 === preg_match(self::UNINFLECTED, $word); - } -} diff --git a/vendor/symfony/string/Inflector/InflectorInterface.php b/vendor/symfony/string/Inflector/InflectorInterface.php deleted file mode 100644 index 67f283404..000000000 --- a/vendor/symfony/string/Inflector/InflectorInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Inflector; - -interface InflectorInterface -{ - /** - * Returns the singular forms of a string. - * - * If the method can't determine the form with certainty, several possible singulars are returned. - * - * @return string[] - */ - public function singularize(string $plural): array; - - /** - * Returns the plural forms of a string. - * - * If the method can't determine the form with certainty, several possible plurals are returned. - * - * @return string[] - */ - public function pluralize(string $singular): array; -} diff --git a/vendor/symfony/string/LICENSE b/vendor/symfony/string/LICENSE deleted file mode 100644 index f37c76b59..000000000 --- a/vendor/symfony/string/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2019-present Fabien Potencier - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/vendor/symfony/string/LazyString.php b/vendor/symfony/string/LazyString.php deleted file mode 100644 index 3128ebb36..000000000 --- a/vendor/symfony/string/LazyString.php +++ /dev/null @@ -1,145 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -/** - * A string whose value is computed lazily by a callback. - * - * @author Nicolas Grekas - */ -class LazyString implements \Stringable, \JsonSerializable -{ - private \Closure|string $value; - - /** - * @param callable|array $callback A callable or a [Closure, method] lazy-callable - */ - public static function fromCallable(callable|array $callback, mixed ...$arguments): static - { - if (\is_array($callback) && !\is_callable($callback) && !(($callback[0] ?? null) instanceof \Closure || 2 < \count($callback))) { - throw new \TypeError(sprintf('Argument 1 passed to "%s()" must be a callable or a [Closure, method] lazy-callable, "%s" given.', __METHOD__, '['.implode(', ', array_map('get_debug_type', $callback)).']')); - } - - $lazyString = new static(); - $lazyString->value = static function () use (&$callback, &$arguments): string { - static $value; - - if (null !== $arguments) { - if (!\is_callable($callback)) { - $callback[0] = $callback[0](); - $callback[1] ??= '__invoke'; - } - $value = $callback(...$arguments); - $callback = self::getPrettyName($callback); - $arguments = null; - } - - return $value ?? ''; - }; - - return $lazyString; - } - - public static function fromStringable(string|int|float|bool|\Stringable $value): static - { - if (\is_object($value)) { - return static::fromCallable($value->__toString(...)); - } - - $lazyString = new static(); - $lazyString->value = (string) $value; - - return $lazyString; - } - - /** - * Tells whether the provided value can be cast to string. - */ - final public static function isStringable(mixed $value): bool - { - return \is_string($value) || $value instanceof \Stringable || \is_scalar($value); - } - - /** - * Casts scalars and stringable objects to strings. - * - * @throws \TypeError When the provided value is not stringable - */ - final public static function resolve(\Stringable|string|int|float|bool $value): string - { - return $value; - } - - public function __toString(): string - { - if (\is_string($this->value)) { - return $this->value; - } - - try { - return $this->value = ($this->value)(); - } catch (\Throwable $e) { - if (\TypeError::class === $e::class && __FILE__ === $e->getFile()) { - $type = explode(', ', $e->getMessage()); - $type = substr(array_pop($type), 0, -\strlen(' returned')); - $r = new \ReflectionFunction($this->value); - $callback = $r->getStaticVariables()['callback']; - - $e = new \TypeError(sprintf('Return value of %s() passed to %s::fromCallable() must be of the type string, %s returned.', $callback, static::class, $type)); - } - - throw $e; - } - } - - public function __sleep(): array - { - $this->__toString(); - - return ['value']; - } - - public function jsonSerialize(): string - { - return $this->__toString(); - } - - private function __construct() - { - } - - private static function getPrettyName(callable $callback): string - { - if (\is_string($callback)) { - return $callback; - } - - if (\is_array($callback)) { - $class = \is_object($callback[0]) ? get_debug_type($callback[0]) : $callback[0]; - $method = $callback[1]; - } elseif ($callback instanceof \Closure) { - $r = new \ReflectionFunction($callback); - - if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) { - return $r->name; - } - - $class = $class->name; - $method = $r->name; - } else { - $class = get_debug_type($callback); - $method = '__invoke'; - } - - return $class.'::'.$method; - } -} diff --git a/vendor/symfony/string/README.md b/vendor/symfony/string/README.md deleted file mode 100644 index 9c7e1e190..000000000 --- a/vendor/symfony/string/README.md +++ /dev/null @@ -1,14 +0,0 @@ -String Component -================ - -The String component provides an object-oriented API to strings and deals -with bytes, UTF-8 code points and grapheme clusters in a unified way. - -Resources ---------- - - * [Documentation](https://symfony.com/doc/current/components/string.html) - * [Contributing](https://symfony.com/doc/current/contributing/index.html) - * [Report issues](https://github.com/symfony/symfony/issues) and - [send Pull Requests](https://github.com/symfony/symfony/pulls) - in the [main Symfony repository](https://github.com/symfony/symfony) diff --git a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php b/vendor/symfony/string/Resources/data/wcswidth_table_wide.php deleted file mode 100644 index 5a647e67b..000000000 --- a/vendor/symfony/string/Resources/data/wcswidth_table_wide.php +++ /dev/null @@ -1,1143 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -if (!\function_exists(u::class)) { - function u(?string $string = ''): UnicodeString - { - return new UnicodeString($string ?? ''); - } -} - -if (!\function_exists(b::class)) { - function b(?string $string = ''): ByteString - { - return new ByteString($string ?? ''); - } -} - -if (!\function_exists(s::class)) { - /** - * @return UnicodeString|ByteString - */ - function s(?string $string = ''): AbstractString - { - $string ??= ''; - - return preg_match('//u', $string) ? new UnicodeString($string) : new ByteString($string); - } -} diff --git a/vendor/symfony/string/Slugger/AsciiSlugger.php b/vendor/symfony/string/Slugger/AsciiSlugger.php deleted file mode 100644 index 6e550c61c..000000000 --- a/vendor/symfony/string/Slugger/AsciiSlugger.php +++ /dev/null @@ -1,210 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\Intl\Transliterator\EmojiTransliterator; -use Symfony\Component\String\AbstractUnicodeString; -use Symfony\Component\String\UnicodeString; -use Symfony\Contracts\Translation\LocaleAwareInterface; - -if (!interface_exists(LocaleAwareInterface::class)) { - throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".'); -} - -/** - * @author Titouan Galopin - */ -class AsciiSlugger implements SluggerInterface, LocaleAwareInterface -{ - private const LOCALE_TO_TRANSLITERATOR_ID = [ - 'am' => 'Amharic-Latin', - 'ar' => 'Arabic-Latin', - 'az' => 'Azerbaijani-Latin', - 'be' => 'Belarusian-Latin', - 'bg' => 'Bulgarian-Latin', - 'bn' => 'Bengali-Latin', - 'de' => 'de-ASCII', - 'el' => 'Greek-Latin', - 'fa' => 'Persian-Latin', - 'he' => 'Hebrew-Latin', - 'hy' => 'Armenian-Latin', - 'ka' => 'Georgian-Latin', - 'kk' => 'Kazakh-Latin', - 'ky' => 'Kirghiz-Latin', - 'ko' => 'Korean-Latin', - 'mk' => 'Macedonian-Latin', - 'mn' => 'Mongolian-Latin', - 'or' => 'Oriya-Latin', - 'ps' => 'Pashto-Latin', - 'ru' => 'Russian-Latin', - 'sr' => 'Serbian-Latin', - 'sr_Cyrl' => 'Serbian-Latin', - 'th' => 'Thai-Latin', - 'tk' => 'Turkmen-Latin', - 'uk' => 'Ukrainian-Latin', - 'uz' => 'Uzbek-Latin', - 'zh' => 'Han-Latin', - ]; - - private ?string $defaultLocale; - private \Closure|array $symbolsMap = [ - 'en' => ['@' => 'at', '&' => 'and'], - ]; - private bool|string $emoji = false; - - /** - * Cache of transliterators per locale. - * - * @var \Transliterator[] - */ - private array $transliterators = []; - - public function __construct(string $defaultLocale = null, array|\Closure $symbolsMap = null) - { - $this->defaultLocale = $defaultLocale; - $this->symbolsMap = $symbolsMap ?? $this->symbolsMap; - } - - /** - * @return void - */ - public function setLocale(string $locale) - { - $this->defaultLocale = $locale; - } - - public function getLocale(): string - { - return $this->defaultLocale; - } - - /** - * @param bool|string $emoji true will use the same locale, - * false will disable emoji, - * and a string to use a specific locale - */ - public function withEmoji(bool|string $emoji = true): static - { - if (false !== $emoji && !class_exists(EmojiTransliterator::class)) { - throw new \LogicException(sprintf('You cannot use the "%s()" method as the "symfony/intl" package is not installed. Try running "composer require symfony/intl".', __METHOD__)); - } - - $new = clone $this; - $new->emoji = $emoji; - - return $new; - } - - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString - { - $locale ??= $this->defaultLocale; - - $transliterator = []; - if ($locale && ('de' === $locale || str_starts_with($locale, 'de_'))) { - // Use the shortcut for German in UnicodeString::ascii() if possible (faster and no requirement on intl) - $transliterator = ['de-ASCII']; - } elseif (\function_exists('transliterator_transliterate') && $locale) { - $transliterator = (array) $this->createTransliterator($locale); - } - - if ($emojiTransliterator = $this->createEmojiTransliterator($locale)) { - $transliterator[] = $emojiTransliterator; - } - - if ($this->symbolsMap instanceof \Closure) { - // If the symbols map is passed as a closure, there is no need to fallback to the parent locale - // as the closure can just provide substitutions for all locales of interest. - $symbolsMap = $this->symbolsMap; - array_unshift($transliterator, static fn ($s) => $symbolsMap($s, $locale)); - } - - $unicodeString = (new UnicodeString($string))->ascii($transliterator); - - if (\is_array($this->symbolsMap)) { - $map = null; - if (isset($this->symbolsMap[$locale])) { - $map = $this->symbolsMap[$locale]; - } else { - $parent = self::getParentLocale($locale); - if ($parent && isset($this->symbolsMap[$parent])) { - $map = $this->symbolsMap[$parent]; - } - } - if ($map) { - foreach ($map as $char => $replace) { - $unicodeString = $unicodeString->replace($char, ' '.$replace.' '); - } - } - } - - return $unicodeString - ->replaceMatches('/[^A-Za-z0-9]++/', $separator) - ->trim($separator) - ; - } - - private function createTransliterator(string $locale): ?\Transliterator - { - if (\array_key_exists($locale, $this->transliterators)) { - return $this->transliterators[$locale]; - } - - // Exact locale supported, cache and return - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$locale] ?? null) { - return $this->transliterators[$locale] = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - // Locale not supported and no parent, fallback to any-latin - if (!$parent = self::getParentLocale($locale)) { - return $this->transliterators[$locale] = null; - } - - // Try to use the parent locale (ie. try "de" for "de_AT") and cache both locales - if ($id = self::LOCALE_TO_TRANSLITERATOR_ID[$parent] ?? null) { - $transliterator = \Transliterator::create($id.'/BGN') ?? \Transliterator::create($id); - } - - return $this->transliterators[$locale] = $this->transliterators[$parent] = $transliterator ?? null; - } - - private function createEmojiTransliterator(?string $locale): ?EmojiTransliterator - { - if (\is_string($this->emoji)) { - $locale = $this->emoji; - } elseif (!$this->emoji) { - return null; - } - - while (null !== $locale) { - try { - return EmojiTransliterator::create("emoji-$locale"); - } catch (\IntlException) { - $locale = self::getParentLocale($locale); - } - } - - return null; - } - - private static function getParentLocale(?string $locale): ?string - { - if (!$locale) { - return null; - } - if (false === $str = strrchr($locale, '_')) { - // no parent locale - return null; - } - - return substr($locale, 0, -\strlen($str)); - } -} diff --git a/vendor/symfony/string/Slugger/SluggerInterface.php b/vendor/symfony/string/Slugger/SluggerInterface.php deleted file mode 100644 index c679ed933..000000000 --- a/vendor/symfony/string/Slugger/SluggerInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String\Slugger; - -use Symfony\Component\String\AbstractUnicodeString; - -/** - * Creates a URL-friendly slug from a given string. - * - * @author Titouan Galopin - */ -interface SluggerInterface -{ - /** - * Creates a slug for the given string and locale, using appropriate transliteration when needed. - */ - public function slug(string $string, string $separator = '-', string $locale = null): AbstractUnicodeString; -} diff --git a/vendor/symfony/string/UnicodeString.php b/vendor/symfony/string/UnicodeString.php deleted file mode 100644 index a64c6a9df..000000000 --- a/vendor/symfony/string/UnicodeString.php +++ /dev/null @@ -1,358 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Symfony\Component\String; - -use Symfony\Component\String\Exception\ExceptionInterface; -use Symfony\Component\String\Exception\InvalidArgumentException; - -/** - * Represents a string of Unicode grapheme clusters encoded as UTF-8. - * - * A letter followed by combining characters (accents typically) form what Unicode defines - * as a grapheme cluster: a character as humans mean it in written texts. This class knows - * about the concept and won't split a letter apart from its combining accents. It also - * ensures all string comparisons happen on their canonically-composed representation, - * ignoring e.g. the order in which accents are listed when a letter has many of them. - * - * @see https://unicode.org/reports/tr15/ - * - * @author Nicolas Grekas - * @author Hugo Hamon - * - * @throws ExceptionInterface - */ -class UnicodeString extends AbstractUnicodeString -{ - public function __construct(string $string = '') - { - $this->string = normalizer_is_normalized($string) ? $string : normalizer_normalize($string); - - if (false === $this->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - public function append(string ...$suffix): static - { - $str = clone $this; - $str->string = $this->string.(1 >= \count($suffix) ? ($suffix[0] ?? '') : implode('', $suffix)); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function chunk(int $length = 1): array - { - if (1 > $length) { - throw new InvalidArgumentException('The chunk length must be greater than zero.'); - } - - if ('' === $this->string) { - return []; - } - - $rx = '/('; - while (65535 < $length) { - $rx .= '\X{65535}'; - $length -= 65535; - } - $rx .= '\X{'.$length.'})/u'; - - $str = clone $this; - $chunks = []; - - foreach (preg_split($rx, $this->string, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY) as $chunk) { - $str->string = $chunk; - $chunks[] = clone $str; - } - - return $chunks; - } - - public function endsWith(string|iterable|AbstractString $suffix): bool - { - if ($suffix instanceof AbstractString) { - $suffix = $suffix->string; - } elseif (!\is_string($suffix)) { - return parent::endsWith($suffix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($suffix, $form) ?: $suffix = normalizer_normalize($suffix, $form); - - if ('' === $suffix || false === $suffix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)), $suffix, 0, 'UTF-8'); - } - - return $suffix === grapheme_extract($this->string, \strlen($suffix), \GRAPHEME_EXTR_MAXBYTES, \strlen($this->string) - \strlen($suffix)); - } - - public function equalsTo(string|iterable|AbstractString $string): bool - { - if ($string instanceof AbstractString) { - $string = $string->string; - } elseif (!\is_string($string)) { - return parent::equalsTo($string); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($string, $form) ?: $string = normalizer_normalize($string, $form); - - if ('' !== $string && false !== $string && $this->ignoreCase) { - return \strlen($string) === \strlen($this->string) && 0 === mb_stripos($this->string, $string, 0, 'UTF-8'); - } - - return $string === $this->string; - } - - public function indexOf(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOf($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - try { - $i = $this->ignoreCase ? grapheme_stripos($this->string, $needle, $offset) : grapheme_strpos($this->string, $needle, $offset); - } catch (\ValueError) { - return null; - } - - return false === $i ? null : $i; - } - - public function indexOfLast(string|iterable|AbstractString $needle, int $offset = 0): ?int - { - if ($needle instanceof AbstractString) { - $needle = $needle->string; - } elseif (!\is_string($needle)) { - return parent::indexOfLast($needle, $offset); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($needle, $form) ?: $needle = normalizer_normalize($needle, $form); - - if ('' === $needle || false === $needle) { - return null; - } - - $string = $this->string; - - if (0 > $offset) { - // workaround https://bugs.php.net/74264 - if (0 > $offset += grapheme_strlen($needle)) { - $string = grapheme_substr($string, 0, $offset); - } - $offset = 0; - } - - $i = $this->ignoreCase ? grapheme_strripos($string, $needle, $offset) : grapheme_strrpos($string, $needle, $offset); - - return false === $i ? null : $i; - } - - public function join(array $strings, string $lastGlue = null): static - { - $str = parent::join($strings, $lastGlue); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function length(): int - { - return grapheme_strlen($this->string); - } - - public function normalize(int $form = self::NFC): static - { - $str = clone $this; - - if (\in_array($form, [self::NFC, self::NFKC], true)) { - normalizer_is_normalized($str->string, $form) ?: $str->string = normalizer_normalize($str->string, $form); - } elseif (!\in_array($form, [self::NFD, self::NFKD], true)) { - throw new InvalidArgumentException('Unsupported normalization form.'); - } elseif (!normalizer_is_normalized($str->string, $form)) { - $str->string = normalizer_normalize($str->string, $form); - $str->ignoreCase = null; - } - - return $str; - } - - public function prepend(string ...$prefix): static - { - $str = clone $this; - $str->string = (1 >= \count($prefix) ? ($prefix[0] ?? '') : implode('', $prefix)).$this->string; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function replace(string $from, string $to): static - { - $str = clone $this; - normalizer_is_normalized($from) ?: $from = normalizer_normalize($from); - - if ('' !== $from && false !== $from) { - $tail = $str->string; - $result = ''; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while ('' !== $tail && false !== $i = $indexOf($tail, $from)) { - $slice = grapheme_substr($tail, 0, $i); - $result .= $slice.$to; - $tail = substr($tail, \strlen($slice) + \strlen($from)); - } - - $str->string = $result.$tail; - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - } - - return $str; - } - - public function replaceMatches(string $fromRegexp, string|callable $to): static - { - $str = parent::replaceMatches($fromRegexp, $to); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - return $str; - } - - public function slice(int $start = 0, int $length = null): static - { - $str = clone $this; - - $str->string = (string) grapheme_substr($this->string, $start, $length ?? 2147483647); - - return $str; - } - - public function splice(string $replacement, int $start = 0, int $length = null): static - { - $str = clone $this; - - $start = $start ? \strlen(grapheme_substr($this->string, 0, $start)) : 0; - $length = $length ? \strlen(grapheme_substr($this->string, $start, $length ?? 2147483647)) : $length; - $str->string = substr_replace($this->string, $replacement, $start, $length ?? 2147483647); - normalizer_is_normalized($str->string) ?: $str->string = normalizer_normalize($str->string); - - if (false === $str->string) { - throw new InvalidArgumentException('Invalid UTF-8 string.'); - } - - return $str; - } - - public function split(string $delimiter, int $limit = null, int $flags = null): array - { - if (1 > $limit ??= 2147483647) { - throw new InvalidArgumentException('Split limit must be a positive integer.'); - } - - if ('' === $delimiter) { - throw new InvalidArgumentException('Split delimiter is empty.'); - } - - if (null !== $flags) { - return parent::split($delimiter.'u', $limit, $flags); - } - - normalizer_is_normalized($delimiter) ?: $delimiter = normalizer_normalize($delimiter); - - if (false === $delimiter) { - throw new InvalidArgumentException('Split delimiter is not a valid UTF-8 string.'); - } - - $str = clone $this; - $tail = $this->string; - $chunks = []; - $indexOf = $this->ignoreCase ? 'grapheme_stripos' : 'grapheme_strpos'; - - while (1 < $limit && false !== $i = $indexOf($tail, $delimiter)) { - $str->string = grapheme_substr($tail, 0, $i); - $chunks[] = clone $str; - $tail = substr($tail, \strlen($str->string) + \strlen($delimiter)); - --$limit; - } - - $str->string = $tail; - $chunks[] = clone $str; - - return $chunks; - } - - public function startsWith(string|iterable|AbstractString $prefix): bool - { - if ($prefix instanceof AbstractString) { - $prefix = $prefix->string; - } elseif (!\is_string($prefix)) { - return parent::startsWith($prefix); - } - - $form = null === $this->ignoreCase ? \Normalizer::NFD : \Normalizer::NFC; - normalizer_is_normalized($prefix, $form) ?: $prefix = normalizer_normalize($prefix, $form); - - if ('' === $prefix || false === $prefix) { - return false; - } - - if ($this->ignoreCase) { - return 0 === mb_stripos(grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES), $prefix, 0, 'UTF-8'); - } - - return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES); - } - - public function __wakeup() - { - if (!\is_string($this->string)) { - throw new \BadMethodCallException('Cannot unserialize '.__CLASS__); - } - - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - public function __clone() - { - if (null === $this->ignoreCase) { - normalizer_is_normalized($this->string) ?: $this->string = normalizer_normalize($this->string); - } - - $this->ignoreCase = false; - } -} diff --git a/vendor/symfony/string/composer.json b/vendor/symfony/string/composer.json deleted file mode 100644 index 3545c8531..000000000 --- a/vendor/symfony/string/composer.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "symfony/string", - "type": "library", - "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", - "keywords": ["string", "utf8", "utf-8", "grapheme", "i18n", "unicode"], - "homepage": "https://symfony.com", - "license": "MIT", - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "require": { - "php": ">=8.1", - "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-intl-grapheme": "~1.0", - "symfony/polyfill-intl-normalizer": "~1.0", - "symfony/polyfill-mbstring": "~1.0" - }, - "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/intl": "^6.2", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0" - }, - "conflict": { - "symfony/translation-contracts": "<2.5" - }, - "autoload": { - "psr-4": { "Symfony\\Component\\String\\": "" }, - "files": [ "Resources/functions.php" ], - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "minimum-stability": "dev" -} diff --git a/vendor/udx/lib-ud-api-client/lib/classes/class-admin.php b/vendor/udx/lib-ud-api-client/lib/classes/class-admin.php index e45a87a54..473f93883 100644 --- a/vendor/udx/lib-ud-api-client/lib/classes/class-admin.php +++ b/vendor/udx/lib-ud-api-client/lib/classes/class-admin.php @@ -472,7 +472,7 @@ public function load_updater_instances () { } //echo "
"; print_r( $v ); echo "
"; //die(); if( !empty( $api_key ) ) { - new License_Checker( array( + new Update_Checker( array( 'type' => $this->type, 'upgrade_url' => $this->api_url, 'name' => $v[ 'product_name' ], diff --git a/vendor/udx/lib-ud-api-client/lib/classes/class-license-checker.php b/vendor/udx/lib-ud-api-client/lib/classes/class-update-checker.php similarity index 92% rename from vendor/udx/lib-ud-api-client/lib/classes/class-license-checker.php rename to vendor/udx/lib-ud-api-client/lib/classes/class-update-checker.php index 491aa55c1..d095356db 100644 --- a/vendor/udx/lib-ud-api-client/lib/classes/class-license-checker.php +++ b/vendor/udx/lib-ud-api-client/lib/classes/class-update-checker.php @@ -1,23 +1,19 @@ type == 'plugin' ) { - //** Check For Plugin License Updates */ - add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'license_check' ) ); + //** Check For Plugin Updates */ + add_filter( 'pre_set_site_transient_update_plugins', array( $this, 'update_check' ) ); //** Check For Plugin/Theme Information to display on the update details page */ add_filter( 'plugins_api', array( $this, 'request' ), 10, 3 ); } /** - * Check For Theme License Updates + * Theme Updates */ elseif ( $this->type == 'theme' ) { - add_filter( 'pre_set_site_transient_update_themes', array( $this, 'license_check' ) ); + add_filter( 'pre_set_site_transient_update_themes', array( $this, 'update_check' ) ); } add_action( 'wp_ajax_ud_api_dismiss', array( $this, 'dismiss_notices' ) ); @@ -189,14 +185,14 @@ private function create_upgrade_api_url( $args ) { } /** - * Check for License updates against the remote server. + * Check for updates against the remote server. * * @access public * @since 1.0.0 * @param object $transient * @return object $transient */ - public function license_check( $transient ) { + public function update_check( $transient ) { //** Check if the transient contains the 'checked' information */ //** If no, just return its value without hacking it */ @@ -223,6 +219,38 @@ public function license_check( $transient ) { //** Displays an admin error message in the WordPress dashboard */ $this->check_response_for_errors( $response ); + //** Set version variables */ + if ( isset( $response ) && is_object( $response ) && $response !== false ) { + //** New plugin version from the API */ + $new_ver = (string)$response->new_version; + //** Current installed plugin version */ + $curr_ver = (string)$this->software_version; + //$curr_ver = (string)$transient->checked[$this->name]; + } + + //** If there is a new version, modify the transient to reflect an update is available */ + if ( isset( $new_ver ) && isset( $curr_ver ) ) { + if ( $response !== false && version_compare( $new_ver, $curr_ver, '>' ) ) { + if( $this->type == 'plugin' ) { + if( isset( $response->slug ) ) { + $response->slug = sanitize_title( $response->slug ); + } + $transient->response[$this->file] = $response; + } else { + $theme = basename( dirname( $this->file ) ); + $response = (array)$response; + if( empty( $response[ 'url' ] ) ) { + $response[ 'url' ] = !empty( $this->changelog ) ? $this->changelog : 'https://www.usabilitydynamics.com'; + } + $transient->response[$theme] = (array)$response; + } + + } + } + + //echo "
"; print_r( $this ); echo "
"; die(); + //echo "
"; print_r( $transient ); echo "
"; die(); + return $transient; } diff --git a/vendor/udx/lib-ud-api-client/readme.md b/vendor/udx/lib-ud-api-client/readme.md index c6f4aa314..b1bac3db4 100644 --- a/vendor/udx/lib-ud-api-client/readme.md +++ b/vendor/udx/lib-ud-api-client/readme.md @@ -80,9 +80,9 @@ $api->deactivate( array( ), $product ); ``` -#### License Checker +#### Update Checker -License Checker is being initialized only for installed and activated plugins / theme. +Update Checker is being initialized only for installed and activated plugins / theme. Responses are being cached via transient up to one hour. @@ -92,19 +92,19 @@ Attention, be sure, that temp download link expires more then in one hour ( UD g Adds the following filters ```php -$license_checker = new UsabilityDynamics\UD_API\License_Checker($args); +$update_checker = new UsabilityDynamics\UD_API\Update_Checker($args); -//** Check For Plugin License Updates */ -add_filter( 'pre_set_site_transient_update_plugins', array( $license_checker, 'license_check' ) ); +//** Check For Plugin Updates */ +add_filter( 'pre_set_site_transient_update_plugins', array( $update_checker, 'update_check' ) ); //** Check For Plugin Information to display on the update details page */ -add_filter( 'plugins_api', array( $license_checker, 'request' ), 10, 3 ); +add_filter( 'plugins_api', array( $update_checker, 'request' ), 10, 3 ); ``` ##### Theme Adds the following filters ```php -$license_checker = new UsabilityDynamics\UD_API\License_Checker($args); +$update_checker = new UsabilityDynamics\UD_API\Update_Checker($args); -//** Check For Theme License Updates */ -add_filter( 'pre_set_site_transient_update_themes', array( $license_checker, 'license_check' ) ); +//** Check For Plugin Updates */ +add_filter( 'pre_set_site_transient_update_themes', array( $update_checker, 'update_check' ) ); diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php index 19111339a..22c124dcf 100644 --- a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-plugin.php @@ -38,6 +38,8 @@ protected function __construct( $args ) { add_action( 'plugins_loaded', array( $this, 'define_license_manager' ), 1 ); //** Initialize plugin here. All plugin actions must be added on this step */ add_action( 'plugins_loaded', array( $this, 'pre_init' ), 100 ); + //** TGM Plugin activation. */ + add_action( 'plugins_loaded', array( $this, 'check_plugins_requirements' ), 10 ); $this->boot(); } diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-theme.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-theme.php index d6d0df96d..5594b0cba 100644 --- a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-theme.php +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap-theme.php @@ -50,6 +50,8 @@ protected function __construct( $args ) { parent::__construct( $args ); //** Load text domain */ add_action( 'after_setup_theme', array( $this, 'load_textdomain' ), 1 ); + //** TGM Plugin activation. */ + $this->check_plugins_requirements(); //** May be initialize Licenses Manager. */ $this->define_license_manager(); //** Maybe define license client */ diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php index bfabb6288..00f747540 100644 --- a/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-bootstrap.php @@ -440,6 +440,37 @@ public function render_upgrade_notice() { echo apply_filters( 'ud::bootstrap::upgrade_notice::template', $content, $this->slug, $vars ); } + /** + * Check plugins requirements + * + * @author peshkov@UD + */ + public function check_plugins_requirements() { + //** Determine if we have TGMA Plugin Activation initialized. */ + $is_tgma = $this->is_tgma; + if( $is_tgma ) { + $tgma = TGM_Plugin_Activation::get_instance(); + //** Maybe get TGMPA notices. */ + $notices = $tgma->notices( get_class( $this ) ); + if( !empty( $notices[ 'messages' ] ) && is_array( $notices[ 'messages' ] ) ) { + $error_links = false; + $message_links = false; + foreach( $notices[ 'messages' ] as $m ) { + if( $m[ 'type' ] == 'error' ) $error_links = true; + elseif( $m[ 'type' ] == 'message' ) $message_links = true; + $this->errors->add( $m[ 'value' ], $m[ 'type' ] ); + } + //** Maybe add footer action links to errors and|or notices block. */ + if( !empty( $notices[ 'links' ] ) && is_array( $notices[ 'links' ] ) ) { + foreach( $notices[ 'links' ] as $type => $links ) { + foreach( $links as $link ) { + $this->errors->add_action_link( $link, $type ); + } + } + } + } + } + } /** * Maybe determines if Composer autoloader is included and modules classes are up to date @@ -483,6 +514,15 @@ private function plugins_dependencies() { return; } $plugins = $this->get_schema( 'extra.schemas.dependencies.plugins' ); + if( !empty( $plugins ) && is_array( $plugins ) ) { + $tgma = TGM_Plugin_Activation::get_instance(); + foreach( $plugins as $plugin ) { + $plugin[ '_referrer' ] = get_class( $this ); + $plugin[ '_referrer_name' ] = $this->name; + $tgma->register( $plugin ); + } + $this->is_tgma = true; + } } diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-errors.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-errors.php index 441dba011..845620dab 100644 --- a/vendor/udx/lib-wp-bootstrap/lib/classes/class-errors.php +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-errors.php @@ -148,6 +148,10 @@ public function admin_notices() { if ( is_multisite() && ! is_super_admin() ) { return; } + //** Ignore messages on TGM Plugin Activation page */ + if( TGM_Plugin_Activation::get_instance()->is_tgmpa_page() ) { + return; + } $errors = apply_filters( 'ud:errors:admin_notices', $this->errors, $this->args ); $messages = apply_filters( 'ud:messages:admin_notices', $this->messages, $this->args ); diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php new file mode 100644 index 000000000..b53aa39fc --- /dev/null +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-bulk-installer.php @@ -0,0 +1,554 @@ + + * @author Gary Jones + * @copyright Copyright (c) 2012, Thomas Griffin + * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later + * @link https://github.com/thomasgriffin/TGM-Plugin-Activation + */ + +/* + Copyright 2014 Thomas Griffin (thomasgriffinmedia.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * The WP_Upgrader file isn't always available. If it isn't available, + * we load it here. + * + * We check to make sure no action or activation keys are set so that WordPress + * doesn't try to re-include the class when processing upgrades or installs outside + * of the class. + * + * @since 2.2.0 + */ + +namespace UsabilityDynamics\WP { + + if ( ! class_exists( 'WP_Upgrader' ) ) { + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; + } + + if ( ! class_exists( 'UsabilityDynamics\WP\TGM_Bulk_Installer' ) ) { + /** + * Installer class to handle bulk plugin installations. + * + * Extends WP_Upgrader and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGM_Bulk_Installer extends \WP_Upgrader { + + /** + * Holds result of bulk plugin installation. + * + * @since 2.2.0 + * + * @var string + */ + public $result; + + /** + * Flag to check if bulk installation is occurring or not. + * + * @since 2.2.0 + * + * @var boolean + */ + public $bulk = false; + + /** + * Processes the bulk installation of plugins. + * + * @since 2.2.0 + * + * @param array $packages The plugin sources needed for installation. + * @return string|boolean Install confirmation messages on success, false on failure. + */ + public function bulk_install( $packages ) { + + // Pass installer skin object and set bulk property to true. + $this->init(); + $this->bulk = true; + + // Set install strings and automatic activation strings (if config option is set to true). + $this->install_strings(); + if ( TGM_Plugin_Activation::$instance->is_automatic ) { + $this->activate_strings(); + } + + // Run the header string to notify user that the process has begun. + $this->skin->header(); + + // Connect to the Filesystem. + $res = $this->fs_connect( array( WP_CONTENT_DIR, WP_PLUGIN_DIR ) ); + if ( ! $res ) { + $this->skin->footer(); + return false; + } + + // Set the bulk header and prepare results array. + $this->skin->bulk_header(); + $results = array(); + + // Get the total number of packages being processed and iterate as each package is successfully installed. + $this->update_count = count( $packages ); + $this->update_current = 0; + + // Loop through each plugin and process the installation. + foreach ( $packages as $plugin ) { + $this->update_current++; // Increment counter. + + // Do the plugin install. + $result = $this->run( + array( + 'package' => $plugin, // The plugin source. + 'destination' => WP_PLUGIN_DIR, // The destination dir. + 'clear_destination' => false, // Do we want to clear the destination or not? + 'clear_working' => true, // Remove original install file. + 'is_multi' => true, // Are we processing multiple installs? + 'hook_extra' => array( 'plugin' => $plugin, ), // Pass plugin source as extra data. + ) + ); + + // Store installation results in result property. + $results[$plugin] = $this->result; + + // Prevent credentials auth screen from displaying multiple times. + if ( false === $result ) { + break; + } + } + + // Pass footer skin strings. + $this->skin->bulk_footer(); + $this->skin->footer(); + + // Return our results. + return $results; + + } + + /** + * Performs the actual installation of each plugin. + * + * This method also activates the plugin in the automatic flag has been + * set to true for the TGMPA class. + * + * @since 2.2.0 + * + * @param array $options The installation cofig options + * @return null/array Return early if error, array of installation data on success + */ + public function run( $options ) { + + // Default config options. + $defaults = array( + 'package' => '', + 'destination' => '', + 'clear_destination' => false, + 'clear_working' => true, + 'is_multi' => false, + 'hook_extra' => array(), + ); + + // Parse default options with config options from $this->bulk_upgrade and extract them. + $options = wp_parse_args( $options, $defaults ); + extract( $options ); + + // Connect to the Filesystem. + $res = $this->fs_connect( array( WP_CONTENT_DIR, $destination ) ); + if ( ! $res ) { + return false; + } + + // Return early if there is an error connecting to the Filesystem. + if ( is_wp_error( $res ) ) { + $this->skin->error( $res ); + return $res; + } + + // Call $this->header separately if running multiple times. + if ( ! $is_multi ) + $this->skin->header(); + + // Set strings before the package is installed. + $this->skin->before(); + + // Download the package (this just returns the filename of the file if the package is a local file). + $download = $this->download_package( $package ); + if ( is_wp_error( $download ) ) { + $this->skin->error( $download ); + $this->skin->after(); + return $download; + } + + // Don't accidentally delete a local file. + $delete_package = ( $download != $package ); + + // Unzip file into a temporary working directory. + $working_dir = $this->unpack_package( $download, $delete_package ); + if ( is_wp_error( $working_dir ) ) { + $this->skin->error( $working_dir ); + $this->skin->after(); + return $working_dir; + } + + // Install the package into the working directory with all passed config options. + $result = $this->install_package( + array( + 'source' => $working_dir, + 'destination' => $destination, + 'clear_destination' => $clear_destination, + 'clear_working' => $clear_working, + 'hook_extra' => $hook_extra, + ) + ); + + // Pass the result of the installation. + $this->skin->set_result( $result ); + + // Set correct strings based on results. + if ( is_wp_error( $result ) ) { + $this->skin->error( $result ); + $this->skin->feedback( 'process_failed' ); + } + // The plugin install is successful. + else { + $this->skin->feedback( 'process_success' ); + } + + // Only process the activation of installed plugins if the automatic flag is set to true. + if ( TGM_Plugin_Activation::$instance->is_automatic ) { + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_cache_flush(); + + // Get the installed plugin file and activate it. + $plugin_info = $this->plugin_info( $package ); + $activate = activate_plugin( $plugin_info ); + + // Re-populate the file path now that the plugin has been installed and activated. + TGM_Plugin_Activation::$instance->populate_file_path(); + + // Set correct strings based on results. + if ( is_wp_error( $activate ) ) { + $this->skin->error( $activate ); + $this->skin->feedback( 'activation_failed' ); + } + // The plugin activation is successful. + else { + $this->skin->feedback( 'activation_success' ); + } + } + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_cache_flush(); + + // Set install footer strings. + $this->skin->after(); + if ( ! $is_multi ) { + $this->skin->footer(); + } + + return $result; + + } + + /** + * Sets the correct install strings for the installer skin to use. + * + * @since 2.2.0 + */ + public function install_strings() { + + $this->strings['no_package'] = __( 'Install package not available.', 'tgmpa' ); + $this->strings['downloading_package'] = __( 'Downloading install package from %s…', 'tgmpa' ); + $this->strings['unpack_package'] = __( 'Unpacking the package…', 'tgmpa' ); + $this->strings['installing_package'] = __( 'Installing the plugin…', 'tgmpa' ); + $this->strings['process_failed'] = __( 'Plugin install failed.', 'tgmpa' ); + $this->strings['process_success'] = __( 'Plugin installed successfully.', 'tgmpa' ); + + } + + /** + * Sets the correct activation strings for the installer skin to use. + * + * @since 2.2.0 + */ + public function activate_strings() { + + $this->strings['activation_failed'] = __( 'Plugin activation failed.', 'tgmpa' ); + $this->strings['activation_success'] = __( 'Plugin activated successfully.', 'tgmpa' ); + + } + + /** + * Grabs the plugin file from an installed plugin. + * + * @since 2.2.0 + * + * @return string|boolean Return plugin file on success, false on failure + */ + public function plugin_info() { + + // Return false if installation result isn't an array or the destination name isn't set. + if ( ! is_array( $this->result ) ) { + return false; + } + + if ( empty( $this->result['destination_name'] ) ) { + return false; + } + + /// Get the installed plugin file or return false if it isn't set. + $plugin = get_plugins( '/' . $this->result['destination_name'] ); + if ( empty( $plugin ) ) { + return false; + } + + // Assume the requested plugin is the first in the list. + $pluginfiles = array_keys( $plugin ); + + return $this->result['destination_name'] . '/' . $pluginfiles[0]; + + } + + } + } + + if ( ! class_exists( 'UsabilityDynamics\WP\TGM_Bulk_Installer_Skin' ) ) { + /** + * Installer skin to set strings for the bulk plugin installations.. + * + * Extends Bulk_Upgrader_Skin and customizes to suit the installation of multiple + * plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGM_Bulk_Installer_Skin extends \Bulk_Upgrader_Skin { + + /** + * Holds plugin info for each individual plugin installation. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_info = array(); + + /** + * Holds names of plugins that are undergoing bulk installations. + * + * @since 2.2.0 + * + * @var array + */ + public $plugin_names = array(); + + /** + * Integer to use for iteration through each plugin installation. + * + * @since 2.2.0 + * + * @var integer + */ + public $i = 0; + + /** + * Constructor. Parses default args with new ones and extracts them for use. + * + * @since 2.2.0 + * + * @param array $args Arguments to pass for use within the class. + */ + public function __construct( $args = array() ) { + + // Parse default and new args. + $defaults = array( 'url' => '', 'nonce' => '', 'names' => array() ); + $args = wp_parse_args( $args, $defaults ); + + // Set plugin names to $this->plugin_names property. + $this->plugin_names = $args['names']; + + // Extract the new args. + parent::__construct( $args ); + + } + + /** + * Sets install skin strings for each individual plugin. + * + * Checks to see if the automatic activation flag is set and uses the + * the proper strings accordingly. + * + * @since 2.2.0 + */ + public function add_strings() { + + // Automatic activation strings. + if ( TGM_Plugin_Activation::$instance->is_automatic ) { + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation and activation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); + $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed and activated successfully.', 'tgmpa' ) . ' ' . __( 'Show Details', 'tgmpa' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations and activations have been completed.', 'tgmpa' ); + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing and Activating Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); + } + // Default installation strings. + else { + $this->upgrader->strings['skin_upgrade_start'] = __( 'The installation process is starting. This process may take a while on some hosts, so please be patient.', 'tgmpa' ); + $this->upgrader->strings['skin_update_failed_error'] = __( 'An error occurred while installing %1$s: %2$s.', 'tgmpa' ); + $this->upgrader->strings['skin_update_failed'] = __( 'The installation of %1$s failed.', 'tgmpa' ); + $this->upgrader->strings['skin_update_successful'] = __( '%1$s installed successfully.', 'tgmpa' ) . ' ' . __( 'Show Details', 'tgmpa' ) . '.'; + $this->upgrader->strings['skin_upgrade_end'] = __( 'All installations have been completed.', 'tgmpa' ); + $this->upgrader->strings['skin_before_update_header'] = __( 'Installing Plugin %1$s (%2$d/%3$d)', 'tgmpa' ); + } + + } + + /** + * Outputs the header strings and necessary JS before each plugin installation. + * + * @since 2.2.0 + */ + public function before( $title = '' ) { + + // We are currently in the plugin installation loop, so set to true. + $this->in_loop = true; + + printf( '

' . $this->upgrader->strings['skin_before_update_header'] . '

', $this->plugin_names[$this->i], $this->upgrader->update_current, $this->upgrader->update_count ); + echo ''; + echo '

'; + + // Flush header output buffer. + $this->before_flush_output(); + + } + + /** + * Outputs the footer strings and necessary JS after each plugin installation. + * + * Checks for any errors and outputs them if they exist, else output + * success strings. + * + * @since 2.2.0 + */ + public function after( $title = '' ) { + + // Close install strings. + echo '

'; + + // Output error strings if an error has occurred. + if ( $this->error || ! $this->result ) { + if ( $this->error ) { + echo '

' . sprintf( $this->upgrader->strings['skin_update_failed_error'], $this->plugin_names[$this->i], $this->error ) . '

'; + } else { + echo '

' . sprintf( $this->upgrader->strings['skin_update_failed'], $this->plugin_names[$this->i] ) . '

'; + } + + echo ''; + } + + // If the result is set and there are no errors, success! + if ( ! empty( $this->result ) && ! is_wp_error( $this->result ) ) { + echo '

' . sprintf( $this->upgrader->strings['skin_update_successful'], $this->plugin_names[$this->i], 'jQuery(\'#progress-' . esc_js( $this->upgrader->update_current ) . '\').toggle();jQuery(\'span\', this).toggle(); return false;' ) . '

'; + echo ''; + } + + // Set in_loop and error to false and flush footer output buffer. + $this->reset(); + $this->after_flush_output(); + + } + + /** + * Outputs links after bulk plugin installation is complete. + * + * @since 2.2.0 + */ + public function bulk_footer() { + + // Serve up the string to say installations (and possibly activations) are complete. + parent::bulk_footer(); + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_cache_flush(); + + // Display message based on if all plugins are now active or not. + $complete = array(); + foreach ( TGM_Plugin_Activation::$instance->plugins as $plugin ) { + if ( ! is_plugin_active( $plugin['file_path'] ) ) { + echo '

' . TGM_Plugin_Activation::$instance->strings['return'] . '

'; + $complete[] = $plugin; + break; + } + // Nothing to store. + else { + $complete[] = ''; + } + } + + // Filter out any empty entries. + $complete = array_filter( $complete ); + + // All plugins are active, so we display the complete string and hide the menu to protect users. + if ( empty( $complete ) ) { + echo '

' . sprintf( TGM_Plugin_Activation::$instance->strings['complete'], '' . __( 'Return to the Dashboard', 'tgmpa' ) . '' ) . '

'; + echo ''; + } + + } + + /** + * Flush header output buffer. + * + * @since 2.2.0 + */ + public function before_flush_output() { + + wp_ob_end_flush_all(); + flush(); + + } + + /** + * Flush footer output buffer and iterate $this->i to make sure the + * installation strings reference the correct plugin. + * + * @since 2.2.0 + */ + public function after_flush_output() { + + wp_ob_end_flush_all(); + flush(); + $this->i++; + + } + + } + } + +} \ No newline at end of file diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php new file mode 100644 index 000000000..8b7d9c436 --- /dev/null +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-list-table.php @@ -0,0 +1,681 @@ + + * @author Gary Jones + * @copyright Copyright (c) 2012, Thomas Griffin + * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later + * @link https://github.com/thomasgriffin/TGM-Plugin-Activation + */ + +/* + Copyright 2014 Thomas Griffin (thomasgriffinmedia.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +namespace UsabilityDynamics\WP { + + /** + * WP_List_Table isn't always available. If it isn't available, + * we load it here. + * + * @since 2.2.0 + */ + if ( ! class_exists( 'WP_List_Table' ) ) { + require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); + } + + if ( ! class_exists( 'UsabilityDynamics\WP\TGMPA_List_Table' ) ) { + + /** + * List table class for handling plugins. + * + * Extends the WP_List_Table class to provide a future-compatible + * way of listing out all required/recommended plugins. + * + * Gives users an interface similar to the Plugin Administration + * area with similar (albeit stripped down) capabilities. + * + * This class also allows for the bulk install of plugins. + * + * @since 2.2.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGMPA_List_Table extends \WP_List_Table { + + /** + * References parent constructor and sets defaults for class. + * + * The constructor also grabs a copy of $instance from the TGMPA class + * and stores it in the global object TGM_Plugin_Activation::$instance. + * + * @since 2.2.0 + * + * @global unknown $status + * @global string $page + */ + public function __construct() { + + global $status, $page; + + parent::__construct( + array( + 'singular' => 'plugin', + 'plural' => 'plugins', + 'ajax' => false, + ) + ); + + } + + /** + * Gathers and renames all of our plugin information to be used by + * WP_List_Table to create our table. + * + * @since 2.2.0 + * + * @return array $table_data Information for use in table. + */ + protected function _gather_plugin_data() { + + // Load thickbox for plugin links. + TGM_Plugin_Activation::$instance->admin_init(); + TGM_Plugin_Activation::$instance->thickbox(); + + // Prep variables for use and grab list of all installed plugins. + $table_data = array(); + $i = 0; + $installed_plugins = get_plugins(); + + foreach ( TGM_Plugin_Activation::$instance->plugins as $plugin ) { + if ( is_plugin_active( $plugin['file_path'] ) ) { + continue; // No need to display plugins if they are installed and activated. + } + + //echo "
"; print_r( $plugin ); echo "
"; //die(); + + $table_data[$i]['sanitized_plugin'] = $plugin['name']; + $table_data[$i]['slug'] = $this->_get_plugin_data_from_name( $plugin['name'] ); + + $external_url = $this->_get_plugin_data_from_name( $plugin['name'], 'external_url' ); + $source = $this->_get_plugin_data_from_name( $plugin['name'], 'source' ); + + if ( $external_url && preg_match( '|^http(s)?://|', $external_url ) ) { + $table_data[$i]['plugin'] = '' . $plugin['name'] . ''; + } + elseif ( ! $source || preg_match( '|^http://wordpress.org/extend/plugins/|', $source ) ) { + $url = esc_url( add_query_arg( + array( + 'tab' => 'plugin-information', + 'plugin' => $this->_get_plugin_data_from_name( $plugin['name'] ), + 'TB_iframe' => 'true', + 'width' => '640', + 'height' => '500', + ), + admin_url( 'plugin-install.php' ) + ) ); + + $table_data[$i]['plugin'] = '' . $plugin['name'] . ''; + } + else { + $table_data[$i]['plugin'] = '' . $plugin['name'] . ''; // No hyperlink. + } + + if ( isset( $table_data[$i]['plugin'] ) && (array) $table_data[$i]['plugin'] ) { + $plugin['name'] = $table_data[$i]['plugin']; + } + + if ( ! empty( $plugin['source'] ) || ( isset( $plugin['private'] ) && $plugin['private'] == true ) ) { + // The plugin must be from a private repository. + if ( !empty( $plugin['source'] ) && preg_match( '|^http(s)?://|', $plugin['source'] ) ) { + $table_data[$i]['source'] = __( 'Private Repository', 'tgmpa' ); + // The plugin is pre-packaged with the theme. + } elseif( isset( $plugin['private'] ) && $plugin['private'] == true ) { + $_source = !empty( $plugin[ 'author' ] ) ? $plugin[ 'author' ] : __( 'Private Repository', 'tgmpa' ); + $_url = !empty( $plugin[ 'author_url' ] ) ? $plugin[ 'author_url' ] : ( !empty( $plugin[ 'external_url' ] ) ? $plugin[ 'external_url' ] : false ); + $_source = !empty( $_url ) ? "{$_source}" : $_source; + $table_data[$i]['source'] = $_source; + } else { + $table_data[$i]['source'] = __( 'Pre-Packaged', 'tgmpa' ); + } + } + // The plugin is from the WordPress repository. + else { + $table_data[$i]['source'] = __( 'WordPress Repository', 'tgmpa' ); + } + + $table_data[$i]['source'] = "
{$table_data[$i]['source']}
"; + $table_data[$i]['type'] = isset( $plugin['required'] ) && $plugin['required'] ? __( 'Required', 'tgmpa' ) : __( 'Recommended', 'tgmpa' ); + + if ( ! isset( $installed_plugins[$plugin['file_path']] ) ) { + $table_data[$i]['status'] = sprintf( '%1$s', __( 'Not Installed', 'tgmpa' ) ); + } elseif ( is_plugin_inactive( $plugin['file_path'] ) ) { + $table_data[$i]['status'] = sprintf( '%1$s', __( 'Installed But Not Activated', 'tgmpa' ) ); + } + + $table_data[$i]['file_path'] = $plugin['file_path']; + $table_data[$i]['url'] = isset( $plugin['source'] ) ? $plugin['source'] : 'repo'; + + $i++; + } + + // Sort plugins by Required/Recommended type and by alphabetical listing within each type. + $resort = array(); + $req = array(); + $rec = array(); + + // Grab all the plugin types. + foreach ( $table_data as $plugin ) { + $resort[] = $plugin['type']; + } + + // Sort each plugin by type. + foreach ( $resort as $type ) { + if ( 'Required' == $type ) { + $req[] = $type; + } else { + $rec[] = $type; + } + } + + // Sort alphabetically each plugin type array, merge them and then sort in reverse (lists Required plugins first). + sort( $req ); + sort( $rec ); + array_merge( $resort, $req, $rec ); + array_multisort( $resort, SORT_DESC, $table_data ); + + return $table_data; + + } + + /** + * Retrieve plugin data, given the plugin name. Taken from the + * TGM_Plugin_Activation class. + * + * Loops through the registered plugins looking for $name. If it finds it, + * it returns the $data from that plugin. Otherwise, returns false. + * + * @since 2.2.0 + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { + + foreach ( TGM_Plugin_Activation::$instance->plugins as $plugin => $values ) { + if ( $name == $values['name'] && isset( $values[$data] ) ) { + return $values[$data]; + } + } + + return false; + + } + + /** + * Create default columns to display important plugin information + * like type, action and status. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @param string $column_name The name of the column. + */ + public function column_default( $item, $column_name ) { + + switch ( $column_name ) { + case 'source': + case 'type': + case 'status': + return $item[$column_name]; + } + + } + + /** + * Create default title column along with action links of 'Install' + * and 'Activate'. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The action hover links. + */ + public function column_plugin( $item ) { + + //echo "
"; print_r( $item ); echo "
"; + + $installed_plugins = get_plugins(); + $actions = array(); + + //** No need to display any hover links. */ + if ( is_plugin_active( $item['file_path'] ) || !isset( TGM_Plugin_Activation::$instance->plugins[ $item[ 'slug' ] ] ) ) { + return sprintf( '%1$s %2$s', $item['plugin'], $this->row_actions( $actions ) ); + } + + $plugin = TGM_Plugin_Activation::$instance->plugins[ $item[ 'slug' ] ]; + + //** We need to display the 'Install' hover link. */ + if ( ! isset( $installed_plugins[$item['file_path']] ) ) { + if( isset( $plugin[ 'private' ] ) && $plugin[ 'private' ] == true ) { + //** Ignore 'Install' action since plugin is not available for direct upload. */ + } else { + $actions = array( + 'install' => sprintf( + '' . __( 'Install', 'tgmpa' ) . '', + wp_nonce_url( + esc_url( add_query_arg( + array( + 'page' => TGM_Plugin_Activation::$instance->menu, + 'plugin' => $item['slug'], + 'plugin_name' => $item['sanitized_plugin'], + 'plugin_source' => $item['url'], + 'tgmpa-install' => 'install-plugin', + ), + admin_url( 'themes.php' ) + ) ), + 'tgmpa-install' + ), + $item['sanitized_plugin'] + ), + ); + } + } + //** We need to display the 'Activate' hover link. */ + elseif ( is_plugin_inactive( $item['file_path'] ) ) { + $actions = array( + 'activate' => sprintf( + '' . __( 'Activate', 'tgmpa' ) . '', + esc_url( add_query_arg( + array( + 'page' => TGM_Plugin_Activation::$instance->menu, + 'plugin' => $item['slug'], + 'plugin_name' => $item['sanitized_plugin'], + 'plugin_source' => $item['url'], + 'tgmpa-activate' => 'activate-plugin', + 'tgmpa-activate-nonce' => wp_create_nonce( 'tgmpa-activate' ), + ), + admin_url( 'themes.php' ) + ) ), + $item['sanitized_plugin'] + ), + ); + } + + return sprintf( '%1$s %2$s', $item['plugin'], $this->row_actions( $actions ) ); + + } + + /** + * Required for bulk installing. + * + * Adds a checkbox for each plugin. + * + * @since 2.2.0 + * + * @param array $item Array of item data. + * @return string The input checkbox with all necessary info. + */ + public function column_cb( $item ) { + //** Ignore Plugins if they are not in list */ + if ( is_plugin_active( $item['file_path'] ) || !isset( TGM_Plugin_Activation::$instance->plugins[ $item[ 'slug' ] ] ) ) { + return ''; + } + //** Ignore plugin's action if it's private and not installed. */ + $plugin = TGM_Plugin_Activation::$instance->plugins[ $item[ 'slug' ] ]; + $installed_plugins = get_plugins(); + if( isset( $plugin[ 'private' ] ) && $plugin[ 'private' ] == true && !isset( $installed_plugins[$item['file_path']] ) ) { + return ''; + } + $value = $item['file_path'] . ',' . $item['url'] . ',' . $item['sanitized_plugin']; + return sprintf( '', $this->_args['singular'], $value, $item['sanitized_plugin'] ); + } + + /** + * Sets default message within the plugins table if no plugins + * are left for interaction. + * + * Hides the menu item to prevent the user from clicking and + * getting a permissions error. + * + * @since 2.2.0 + */ + public function no_items() { + + printf( __( 'No plugins to install or activate. Return to the Dashboard', 'tgmpa' ), admin_url() ); + echo ''; + + } + + /** + * Output all the column information within the table. + * + * @since 2.2.0 + * + * @return array $columns The column names. + */ + public function get_columns() { + + $columns = array( + 'cb' => '', + 'plugin' => __( 'Plugin', 'tgmpa' ), + 'source' => __( 'Source', 'tgmpa' ), + 'type' => __( 'Type', 'tgmpa' ), + 'status' => __( 'Status', 'tgmpa' ) + ); + + return $columns; + + } + + /** + * Defines all types of bulk actions for handling + * registered plugins. + * + * @since 2.2.0 + * + * @return array $actions The bulk actions for the plugin install table. + */ + public function get_bulk_actions() { + + $actions = array( + 'tgmpa-bulk-install' => __( 'Install', 'tgmpa' ), + 'tgmpa-bulk-activate' => __( 'Activate', 'tgmpa' ), + ); + + return $actions; + + } + + /** + * Processes bulk installation and activation actions. + * + * The bulk installation process looks either for the $_POST + * information or for the plugin info within the $_GET variable if + * a user has to use WP_Filesystem to enter their credentials. + * + * @since 2.2.0 + */ + public function process_bulk_actions() { + + // Bulk installation process. + if ( 'tgmpa-bulk-install' === $this->current_action() ) { + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + // Prep variables to be populated. + $plugins_to_install = array(); + $plugin_installs = array(); + $plugin_path = array(); + $plugin_name = array(); + + // Look first to see if information has been passed via WP_Filesystem. + if ( isset( $_GET['plugins'] ) ) { + $plugins = explode( ',', stripslashes( $_GET['plugins'] ) ); + } + // Looks like the user can use the direct method, take from $_POST. + elseif ( isset( $_POST['plugin'] ) ) { + $plugins = (array) $_POST['plugin']; + } + // Nothing has been submitted. + else { + $plugins = array(); + } + + // Grab information from $_POST if available. + if ( isset( $_POST['plugin'] ) ) { + foreach ( $plugins as $plugin_data ) { + $plugins_to_install[] = explode( ',', $plugin_data ); + } + + foreach ( $plugins_to_install as $plugin_data ) { + $plugin_installs[] = $plugin_data[0]; + $plugin_path[] = $plugin_data[1]; + $plugin_name[] = $plugin_data[2]; + } + } + // Information has been passed via $_GET. + else { + foreach ( $plugins as $key => $value ) { + // Grab plugin slug for each plugin. + if ( 0 == $key % 3 || 0 == $key ) { + $plugins_to_install[] = $value; + $plugin_installs[] = $value; + } + } + } + + // Look first to see if information has been passed via WP_Filesystem. + if ( isset( $_GET['plugin_paths'] ) ) { + $plugin_paths = explode( ',', stripslashes( $_GET['plugin_paths'] ) ); + } + // Looks like the user doesn't need to enter his FTP creds. + elseif ( isset( $_POST['plugin'] ) ) { + $plugin_paths = (array) $plugin_path; + } + // Nothing has been submitted. + else { + $plugin_paths = array(); + } + + // Look first to see if information has been passed via WP_Filesystem. + if ( isset( $_GET['plugin_names'] ) ) { + $plugin_names = explode( ',', stripslashes( $_GET['plugin_names'] ) ); + } + // Looks like the user doesn't need to enter his FTP creds. + elseif ( isset( $_POST['plugin'] ) ) { + $plugin_names = (array) $plugin_name; + } + // Nothing has been submitted. + else { + $plugin_names = array(); + } + + // Loop through plugin slugs and remove already installed plugins from the list. + $i = 0; + foreach ( $plugin_installs as $key => $plugin ) { + if ( preg_match( '|.php$|', $plugin ) ) { + unset( $plugin_installs[$key] ); + + // If the plugin path isn't in the $_GET variable, we can unset the corresponding path. + if ( ! isset( $_GET['plugin_paths'] ) ) + unset( $plugin_paths[$i] ); + + // If the plugin name isn't in the $_GET variable, we can unset the corresponding name. + if ( ! isset( $_GET['plugin_names'] ) ) + unset( $plugin_names[$i] ); + } + $i++; + } + + // No need to proceed further if we have no plugins to install. + if ( empty( $plugin_installs ) ) { + return false; + } + + // Reset array indexes in case we removed already installed plugins. + $plugin_installs = array_values( $plugin_installs ); + $plugin_paths = array_values( $plugin_paths ); + $plugin_names = array_values( $plugin_names ); + + // If we grabbed our plugin info from $_GET, we need to decode it for use. + $plugin_installs = array_map( 'urldecode', $plugin_installs ); + $plugin_paths = array_map( 'urldecode', $plugin_paths ); + $plugin_names = array_map( 'urldecode', $plugin_names ); + + // Pass all necessary information via URL if WP_Filesystem is needed. + $url = wp_nonce_url( + esc_url( add_query_arg( + array( + 'page' => TGM_Plugin_Activation::$instance->menu, + 'tgmpa-action' => 'install-selected', + 'plugins' => urlencode( implode( ',', $plugins ) ), + 'plugin_paths' => urlencode( implode( ',', $plugin_paths ) ), + 'plugin_names' => urlencode( implode( ',', $plugin_names ) ), + ), + admin_url( 'themes.php' ) + ) ), + 'bulk-plugins' + ); + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + $fields = array( 'action', '_wp_http_referer', '_wpnonce' ); // Extra fields to pass to WP_Filesystem. + + if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, $fields ) ) ) { + return true; + } + + if ( ! WP_Filesystem( $creds ) ) { + request_filesystem_credentials( $url, $method, true, false, $fields ); // Setup WP_Filesystem. + return true; + } + + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes + + // Store all information in arrays since we are processing a bulk installation. + $api = array(); + $sources = array(); + $install_path = array(); + + // Loop through each plugin to install and try to grab information from WordPress API, if not create 'tgmpa-empty' scalar. + $i = 0; + foreach ( $plugin_installs as $plugin ) { + $api[$i] = plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'sections' => false ) ) ) ? plugins_api( 'plugin_information', array( 'slug' => $plugin, 'fields' => array( 'sections' => false ) ) ) : (object) $api[$i] = 'tgmpa-empty'; + $i++; + } + + if ( is_wp_error( $api ) ) { + wp_die( TGM_Plugin_Activation::$instance->strings['oops'] . var_dump( $api ) ); + } + + // Capture download links from $api or set install link to pre-packaged/private repo. + $i = 0; + foreach ( $api as $object ) { + $sources[$i] = isset( $object->download_link ) && 'repo' == $plugin_paths[$i] ? $object->download_link : $plugin_paths[$i]; + $i++; + } + + // Finally, all the data is prepared to be sent to the installer. + $url = esc_url( add_query_arg( array( 'page' => TGM_Plugin_Activation::$instance->menu ), admin_url( 'themes.php' ) ) ); + $nonce = 'bulk-plugins'; + $names = $plugin_names; + + // Create a new instance of TGM_Bulk_Installer. + $installer = new TGM_Bulk_Installer( $skin = new TGM_Bulk_Installer_Skin( compact( 'url', 'nonce', 'names' ) ) ); + + // Wrap the install process with the appropriate HTML. + echo '
'; + if ( version_compare( TGM_Plugin_Activation::$instance->wp_version, '3.8', '<' ) ) { + screen_icon( apply_filters( 'tgmpa_default_screen_icon', 'themes' ) ); + } + echo '

' . esc_html( get_admin_page_title() ) . '

'; + // Process the bulk installation submissions. + $installer->bulk_install( $sources ); + echo '
'; + + return true; + } + + // Bulk activation process. + if ( 'tgmpa-bulk-activate' === $this->current_action() ) { + check_admin_referer( 'bulk-' . $this->_args['plural'] ); + + // Grab plugin data from $_POST. + $plugins = isset( $_POST['plugin'] ) ? (array) $_POST['plugin'] : array(); + $plugins_to_activate = array(); + + // Split plugin value into array with plugin file path, plugin source and plugin name. + foreach ( $plugins as $i => $plugin ) { + $plugins_to_activate[] = explode( ',', $plugin ); + } + + foreach ( $plugins_to_activate as $i => $array ) { + if ( ! preg_match( '|.php$|', $array[0] ) ) { + unset( $plugins_to_activate[$i] ); + } + } + + // Return early if there are no plugins to activate. + if ( empty( $plugins_to_activate ) ) { + return; + } + + $plugins = array(); + $plugin_names = array(); + + foreach ( $plugins_to_activate as $plugin_string ) { + $plugins[] = $plugin_string[0]; + $plugin_names[] = $plugin_string[2]; + } + + $count = count( $plugin_names ); // Count so we can use _n function. + $last_plugin = array_pop( $plugin_names ); // Pop off last name to prep for readability. + $imploded = empty( $plugin_names ) ? '' . $last_plugin . '' : '' . ( implode( ', ', $plugin_names ) . ' and ' . $last_plugin . '.' ); + + // Now we are good to go - let's start activating plugins. + $activate = activate_plugins( $plugins ); + + if ( is_wp_error( $activate ) ) { + echo '

' . $activate->get_error_message() . '

'; + } else { + printf( '

%1$s %2$s

', _n( 'The following plugin was activated successfully:', 'The following plugins were activated successfully:', $count, 'tgmpa' ), $imploded ); + } + + // Update recently activated plugins option. + $recent = (array) get_option( 'recently_activated' ); + + foreach ( $plugins as $plugin => $time ) { + if ( isset( $recent[$plugin] ) ) { + unset( $recent[$plugin] ); + } + } + + update_option( 'recently_activated', $recent ); + + unset( $_POST ); // Reset the $_POST variable in case user wants to perform one action after another. + } + } + + /** + * Prepares all of our information to be outputted into a usable table. + * + * @since 2.2.0 + */ + public function prepare_items() { + + $per_page = 100; // Set it high so we shouldn't have to worry about pagination. + $columns = $this->get_columns(); // Get all necessary column information. + $hidden = array(); // No columns to hide, but we must set as an array. + $sortable = array(); // No reason to make sortable columns. + $this->_column_headers = array( $columns, $hidden, $sortable ); // Get all necessary column headers. + + // Process our bulk actions here. + $this->process_bulk_actions(); + + // Store all of our plugin data into $items array so WP_List_Table can use it. + $this->items = $this->_gather_plugin_data(); + + } + + } + } + +} diff --git a/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php new file mode 100644 index 000000000..8064f8819 --- /dev/null +++ b/vendor/udx/lib-wp-bootstrap/lib/classes/class-tgm-plugin-activation.php @@ -0,0 +1,1033 @@ + + * @author Gary Jones + * @copyright Copyright (c) 2012, Thomas Griffin + * @license http://opensource.org/licenses/gpl-2.0.php GPL v2 or later + * @link https://github.com/thomasgriffin/TGM-Plugin-Activation + */ + +/* + Copyright 2014 Thomas Griffin (thomasgriffinmedia.com) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License, version 2, as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +namespace UsabilityDynamics\WP { + + if ( ! class_exists( 'UsabilityDynamics\WP\TGM_Plugin_Activation' ) ) { + /** + * Automatic plugin installation and activation library. + * + * Creates a way to automatically install and activate plugins from within themes. + * The plugins can be either pre-packaged, downloaded from the WordPress + * Plugin Repository or downloaded from a private repository. + * + * @since 1.0.0 + * + * @package TGM-Plugin-Activation + * @author Thomas Griffin + * @author Gary Jones + */ + class TGM_Plugin_Activation { + + /** + * Holds a copy of itself, so it can be referenced by the class name. + * + * @since 1.0.0 + * + * @var TGM_Plugin_Activation + */ + public static $instance; + + /** + * Holds arrays of plugin details. + * + * @since 1.0.0 + * + * @var array + */ + public $plugins = array(); + + /** + * + */ + public $referrers = array(); + + /** + * Name of the querystring argument for the admin page. + * + * @since 1.0.0 + * + * @var string + */ + public $menu = 'ud-install-plugins'; + + /** + * Default absolute path to folder containing pre-packaged plugin zip files. + * + * @since 2.0.0 + * + * @var string Absolute path prefix to packaged zip file location. Default is empty string. + */ + public $default_path = ''; + + /** + * Flag to show admin notices or not. + * + * @since 2.1.0 + * + * @var boolean + */ + public $has_notices = true; + + /** + * Flag to determine if the user can dismiss the notice nag. + * + * @since 2.4.0 + * + * @var boolean + */ + public $dismissable = true; + + /** + * Message to be output above nag notice if dismissable is false. + * + * @since 2.4.0 + * + * @var string + */ + public $dismiss_msg = ''; + + /** + * Flag to set automatic activation of plugins. Off by default. + * + * @since 2.2.0 + * + * @var boolean + */ + public $is_automatic = false; + + /** + * Optional message to display before the plugins table. + * + * @since 2.2.0 + * + * @var string Message filtered by wp_kses_post(). Default is empty string. + */ + public $message = ''; + + /** + * Holds configurable array of strings. + * + * Default values are added in the constructor. + * + * @since 2.0.0 + * + * @var array + */ + public $strings = array(); + + /** + * Error Notice types. + * + * @var array + */ + public $error_types = array( + 'notice_can_install_required', + 'notice_can_activate_required', + 'notice_ask_to_update', + ); + + /** + * Holds the version of WordPress. + * + * @since 2.4.0 + * + * @var int + */ + public $wp_version; + + /** + * Adds a reference of this object to $instance, populates default strings, + * does the tgmpa_init action hook, and hooks in the interactions to init. + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + */ + private function __construct() { + + $this->strings = array( + 'page_title' => __( 'Install Required Plugins', 'tgmpa' ), + 'menu_title' => __( 'Install Plugins', 'tgmpa' ), + 'installing' => __( 'Installing Plugin: %s', 'tgmpa' ), + 'oops' => __( 'Something went wrong.', 'tgmpa' ), + 'notice_can_install_required' => _n_noop( '%2$s requires the following plugin: %1$s.', '%2$s requires the following plugins: %1$s.' ), + 'notice_can_install_recommended' => _n_noop( '%2$s recommends the following plugin: %1$s.', '%2$s recommends the following plugins: %1$s.' ), + 'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), + 'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), + 'notice_can_activate_recommended'=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), + 'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), + 'notice_ask_to_update' => _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with %2$s: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with %2$s: %1$s.' ), + 'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), + 'install_link' => _n_noop( 'Begin installing plugin', 'Begin installing plugins' ), + 'activate_link' => _n_noop( 'Begin activating plugin', 'Begin activating plugins' ), + 'return' => __( 'Return to Required Plugins Installer', 'tgmpa' ), + 'dashboard' => __( 'Return to the dashboard', 'tgmpa' ), + 'plugin_activated' => __( 'Plugin activated successfully.', 'tgmpa' ), + 'activated_successfully' => __( 'The following plugin was activated successfully:', 'tgmpa' ), + 'complete' => __( 'All plugins installed and activated successfully. %1$s', 'tgmpa' ), + 'dismiss' => __( 'Dismiss this notice', 'tgmpa' ), + ); + + // Set the current WordPress version. + global $wp_version; + $this->wp_version = $wp_version; + + // Announce that the class is ready, and pass the object (for advanced use). + do_action_ref_array( 'tgmpa_init', array( $this ) ); + + // When the rest of WP has loaded, kick-start the rest of the class. + //add_action( 'plugins_loaded', array( $this, 'init' ), 0 ); + add_action( 'init', array( $this, 'init' ) ); + + } + + /** + * Initialise the interactions between this class and WordPress. + * + * Hooks in three new methods for the class: admin_menu, notices and styles. + * + * @since 2.0.0 + * + * @see TGM_Plugin_Activation::admin_menu() + * @see TGM_Plugin_Activation::notices() + * @see TGM_Plugin_Activation::styles() + */ + public function init() { + + // After this point, the plugins should be registered and the configuration set. + + // Proceed only if we have plugins to handle. + if ( $this->plugins ) { + $sorted = array(); + + foreach ( $this->plugins as $plugin ) { + $sorted[] = $plugin['name']; + } + + array_multisort( $sorted, SORT_ASC, $this->plugins ); + + add_action( 'admin_menu', array( $this, 'admin_menu' ) ); + add_filter( 'install_plugin_complete_actions', array( $this, 'actions' ) ); + add_action( 'switch_theme', array( $this, 'flush_plugins_cache' ) ); + + // Load admin bar in the header to remove flash when installing plugins. + if ( $this->is_tgmpa_page() ) { + remove_action( 'wp_footer', 'wp_admin_bar_render', 1000 ); + remove_action( 'admin_footer', 'wp_admin_bar_render', 1000 ); + add_action( 'wp_head', 'wp_admin_bar_render', 1000 ); + add_action( 'admin_head', 'wp_admin_bar_render', 1000 ); + } + + if ( $this->has_notices ) { + add_action( 'admin_init', array( $this, 'admin_init' ), 1 ); + add_action( 'admin_enqueue_scripts', array( $this, 'thickbox' ) ); + } + + // Setup the force activation hook. + foreach ( $this->plugins as $plugin ) { + if ( isset( $plugin['force_activation'] ) && true === $plugin['force_activation'] ) { + add_action( 'admin_init', array( $this, 'force_activation' ) ); + break; + } + } + + // Setup the force deactivation hook. + foreach ( $this->plugins as $plugin ) { + if ( isset( $plugin['force_deactivation'] ) && true === $plugin['force_deactivation'] ) { + add_action( 'switch_theme', array( $this, 'force_deactivation' ) ); + break; + } + } + } + + } + + /** + * Handles calls to show plugin information via links in the notices. + * + * We get the links in the admin notices to point to the TGMPA page, rather + * than the typical plugin-install.php file, so we can prepare everything + * beforehand. + * + * WP doesn't make it easy to show the plugin information in the thickbox - + * here we have to require a file that includes a function that does the + * main work of displaying it, enqueue some styles, set up some globals and + * finally call that function before exiting. + * + * Down right easy once you know how... + * + * @since 2.1.0 + * + * @global string $tab Used as iframe div class names, helps with styling + * @global string $body_id Used as the iframe body ID, helps with styling + * @return null Returns early if not the TGMPA page. + */ + public function admin_init() { + + if ( ! $this->is_tgmpa_page() ) { + return; + } + + if ( isset( $_REQUEST['tab'] ) && 'plugin-information' == $_REQUEST['tab'] ) { + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for install_plugin_information(). + + wp_enqueue_style( 'plugin-install' ); + + global $tab, $body_id; + $body_id = $tab = 'plugin-information'; + + install_plugin_information(); + + exit; + } + + } + + /** + * Enqueues thickbox scripts/styles for plugin info. + * + * Thickbox is not automatically included on all admin pages, so we must + * manually enqueue it for those pages. + * + * Thickbox is only loaded if the user has not dismissed the admin + * notice or if there are any plugins left to install and activate. + * + * @since 2.1.0 + */ + public function thickbox() { + add_thickbox(); + } + + /** + * Adds submenu page under 'Appearance' tab. + * + * This method adds the submenu page letting users know that a required + * plugin needs to be installed. + * + * This page disappears once the plugin has been installed and activated. + * + * @since 1.0.0 + * + * @see TGM_Plugin_Activation::init() + * @see TGM_Plugin_Activation::install_plugins_page() + */ + public function admin_menu() { + + // Make sure privileges are correct to see the page + if ( ! current_user_can( 'install_plugins' ) ) { + return; + } + + $this->populate_file_path(); + + foreach ( $this->plugins as $plugin ) { + if ( ! is_plugin_active( $plugin['file_path'] ) ) { + add_theme_page( + $this->strings['page_title'], // Page title. + $this->strings['menu_title'], // Menu title. + 'edit_theme_options', // Capability. + $this->menu, // Menu slug. + array( $this, 'install_plugins_page' ) // Callback. + ); + break; + } + } + + } + + /** + * Echoes plugin installation form. + * + * This method is the callback for the admin_menu method function. + * This displays the admin page and form area where the user can select to install and activate the plugin. + * + * @since 1.0.0 + * + * @return null Aborts early if we're processing a plugin installation action + */ + public function install_plugins_page() { + + // Store new instance of plugin table in object. + $plugin_table = new TGMPA_List_Table; + + // Return early if processing a plugin installation action. + if ( isset( $_POST['action'] ) && 'tgmpa-bulk-install' == $_POST['action'] && $plugin_table->process_bulk_actions() || $this->do_plugin_install() ) { + return; + } + + ?> +
+ + wp_version, '3.8', '<' ) ) { + screen_icon( apply_filters( 'ud_default_screen_icon', 'themes' ) ); + } ?> +

+ prepare_items(); ?> + + message ) ) { + echo wp_kses_post( $this->message ); + } ?> + +
+ + display(); ?> +
+ +
+ $this->menu, + 'plugin' => $plugin['slug'], + 'plugin_name' => $plugin['name'], + 'plugin_source' => $plugin['source'], + 'tgmpa-install' => 'install-plugin', + ), + admin_url( 'themes.php' ) + ) ), + 'tgmpa-install' + ); + $method = ''; // Leave blank so WP_Filesystem can populate it as necessary. + $fields = array( 'tgmpa-install' ); // Extra fields to pass to WP_Filesystem. + + if ( false === ( $creds = request_filesystem_credentials( $url, $method, false, false, $fields ) ) ) { + return true; + } + + if ( ! WP_Filesystem( $creds ) ) { + request_filesystem_credentials( $url, $method, true, false, $fields ); // Setup WP_Filesystem. + return true; + } + + require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; // Need for plugins_api. + require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; // Need for upgrade classes. + + // Set plugin source to WordPress API link if available. + if ( isset( $plugin['source'] ) && 'repo' == $plugin['source'] ) { + $api = plugins_api( 'plugin_information', array( 'slug' => $plugin['slug'], 'fields' => array( 'sections' => false ) ) ); + + if ( is_wp_error( $api ) ) { + wp_die( $this->strings['oops'] . var_dump( $api ) ); + } + + if ( isset( $api->download_link ) ) { + $plugin['source'] = $api->download_link; + } + } + + // Set type, based on whether the source starts with http:// or https://. + $type = preg_match( '|^http(s)?://|', $plugin['source'] ) ? 'web' : 'upload'; + + // Prep variables for Plugin_Installer_Skin class. + $title = sprintf( $this->strings['installing'], $plugin['name'] ); + $url = esc_url( add_query_arg( array( 'action' => 'install-plugin', 'plugin' => $plugin['slug'] ), 'update.php' ) ); + if ( isset( $_GET['from'] ) ) { + $url .= esc_url( add_query_arg( 'from', urlencode( stripslashes( $_GET['from'] ) ), $url ) ); + } + + $nonce = 'install-plugin_' . $plugin['slug']; + + // Prefix a default path to pre-packaged plugins. + $source = ( 'upload' == $type ) ? $this->default_path . $plugin['source'] : $plugin['source']; + + // Create a new instance of Plugin_Upgrader. + $upgrader = new \Plugin_Upgrader( $skin = new \Plugin_Installer_Skin( compact( 'type', 'title', 'url', 'nonce', 'plugin', 'api' ) ) ); + + // Perform the action and install the plugin from the $source urldecode(). + $upgrader->install( $source ); + + // Flush plugins cache so we can make sure that the installed plugins list is always up to date. + wp_cache_flush(); + + // Only activate plugins if the config option is set to true. + if ( $this->is_automatic ) { + $plugin_activate = $upgrader->plugin_info(); // Grab the plugin info from the Plugin_Upgrader method. + $activate = activate_plugin( $plugin_activate ); // Activate the plugin. + $this->populate_file_path(); // Re-populate the file path now that the plugin has been installed and activated. + + if ( is_wp_error( $activate ) ) { + echo '

' . $activate->get_error_message() . '

'; + echo '

' . $this->strings['return'] . '

'; + return true; // End it here if there is an error with automatic activation + } + else { + echo '

' . $this->strings['plugin_activated'] . '

'; + } + } + + // Display message based on if all plugins are now active or not. + $complete = array(); + foreach ( $this->plugins as $plugin ) { + if ( ! is_plugin_active( $plugin['file_path'] ) ) { + echo '

' . $this->strings['return'] . '

'; + $complete[] = $plugin; + break; + } + // Nothing to store. + else { + $complete[] = ''; + } + } + + // Filter out any empty entries. + $complete = array_filter( $complete ); + + // All plugins are active, so we display the complete string and hide the plugin menu. + if ( empty( $complete ) ) { + echo '

' . sprintf( $this->strings['complete'], '' . __( 'Return to the Dashboard', 'tgmpa' ) . '' ) . '

'; + echo ''; + } + + return true; + } + // Checks for actions from hover links to process the activation. + elseif ( isset( $_GET['plugin'] ) && ( isset( $_GET['tgmpa-activate'] ) && 'activate-plugin' == $_GET['tgmpa-activate'] ) ) { + check_admin_referer( 'tgmpa-activate', 'tgmpa-activate-nonce' ); + + // Populate $plugin array with necessary information. + $plugin['name'] = $_GET['plugin_name']; + $plugin['slug'] = $_GET['plugin']; + $plugin['source'] = $_GET['plugin_source']; + + $plugin_path = $this->_get_plugin_basename_from_slug($plugin['slug']); // Retrieve all plugins. + $activate = activate_plugin( $plugin_path ); // Activate the plugin. + + if ( is_wp_error( $activate ) ) { + echo '

' . $activate->get_error_message() . '

'; + echo '

' . $this->strings['return'] . '

'; + return true; // End it here if there is an error with activation. + } + else { + // Make sure message doesn't display again if bulk activation is performed immediately after a single activation. + if ( ! isset( $_POST['action'] ) ) { + $msg = $this->strings['activated_successfully'] . ' ' . $plugin['name'] . ''; + echo '

' . $msg . '

'; + } + } + } + + return false; + + } + + /** + * Echoes required plugin notice. + * + * Outputs a message telling users that a specific plugin is required for + * their theme. If appropriate, it includes a link to the form page where + * users can install and activate the plugin. + * + * @since 1.0.0 + * + * @global object $current_screen + * @return null Returns early if we're on the Install page. + */ + public function notices( $referrer = false ) { + //** Check if get_plugins() function exists. This is required on the front end of the */ + //** site, since it is in a file that is normally only loaded in the admin. */ + if ( ! function_exists( 'get_plugins' ) ) { + require_once ABSPATH . 'wp-admin/includes/plugin.php'; + } + + $installed_plugins = \get_plugins(); // Retrieve a list of all the plugins + $this->populate_file_path(); + + $message = array(); // Store the messages in an array to be outputted after plugins have looped through. + + $e_install_link = false; // Set to false, change to true in loop if conditions exist, used for action link 'install'. + $e_install_link_count = 0; // Used to determine plurality of install action link text. + $e_activate_link = false; // Set to false, change to true in loop if conditions exist, used for action link 'activate'. + $e_activate_link_count = 0; // Used to determine plurality of activate action link text. + + $m_install_link = false; // Set to false, change to true in loop if conditions exist, used for action link 'install'. + $m_install_link_count = 0; // Used to determine plurality of install action link text. + $m_activate_link = false; // Set to false, change to true in loop if conditions exist, used for action link 'activate'. + $m_activate_link_count = 0; // Used to determine plurality of activate action link text. + + foreach ( $this->referrers as $plugin ) { + //** We must return only notices for referrer */ + if( empty( $referrer ) || $referrer != $plugin[ '_referrer' ] || !isset( $this->plugins[ $plugin[ 'slug' ] ] ) ) { + continue; + } + $plugin[ 'file_path' ] = $this->plugins[ $plugin[ 'slug' ] ][ 'file_path' ]; + // If the plugin is installed and active, check for minimum version argument before moving forward. + if ( is_plugin_active( $plugin['file_path'] ) ) { + // A minimum version has been specified. + if ( isset( $plugin['version'] ) ) { + if ( isset( $installed_plugins[$plugin['file_path']]['Version'] ) ) { + // If the current version is less than the minimum required version, we display a message. + if ( version_compare( $installed_plugins[$plugin['file_path']]['Version'], $plugin['version'], '<' ) ) { + if ( current_user_can( 'install_plugins' ) ) { + $message['notice_ask_to_update'][] = $plugin; + } else { + $message['notice_cannot_update'][] = $plugin; + } + } + } + // Can't find the plugin, so iterate to the next condition. + else { + continue; + } + } + // No minimum version specified, so iterate over the plugin. + else { + continue; + } + } + + // Not installed. + if ( ! isset( $installed_plugins[$plugin['file_path']] ) ) { + if ( current_user_can( 'install_plugins' ) ) { + if ( isset( $plugin['required'] ) && $plugin['required'] ) { + $e_install_link = true; // We need to display the 'install' action link. + $e_install_link_count++; // Increment the install link count. + $message['notice_can_install_required'][] = $plugin; + } + // This plugin is only recommended. + else { + $m_install_link = true; // We need to display the 'install' action link. + $m_install_link_count++; // Increment the install link count. + $message['notice_can_install_recommended'][] = $plugin; + } + } elseif( !is_user_logged_in() && isset( $plugin['required'] ) && $plugin['required'] ) { + $message['notice_can_install_required'][] = $plugin; + } + // Need higher privileges to install the plugin. + else { + if ( isset( $plugin['required'] ) && $plugin['required'] ) { + $message['notice_can_install_required'][] = $plugin; + $message['notice_cannot_activate'][] = $plugin; + } + else { + $message['notice_cannot_activate'][] = $plugin; + } + } + } + // Installed but not active. + elseif ( is_plugin_inactive( $plugin['file_path'] ) ) { + if ( current_user_can( 'activate_plugins' ) ) { + if ( isset( $plugin['required'] ) && $plugin['required'] ) { + $e_activate_link = true; // We need to display the 'activate' action link. + $e_activate_link_count++; // Increment the activate link count. + $message['notice_can_activate_required'][] = $plugin; + } + // This plugin is only recommended. + else { + $m_activate_link = true; // We need to display the 'activate' action link. + $m_activate_link_count++; // Increment the activate link count. + $message['notice_can_activate_recommended'][] = $plugin; + } + } elseif( !is_user_logged_in() && isset( $plugin['required'] ) && $plugin['required'] ) { + $message['notice_can_install_required'][] = $plugin; + } + // Need higher privileges to activate the plugin. + else { + if ( isset( $plugin['required'] ) && $plugin['required'] ) { + $message['notice_can_install_required'][] = $plugin; + $message['notice_cannot_activate'][] = $plugin; + } + else { + $message['notice_cannot_activate'][] = $plugin; + } + + } + } + } + + //return $message; + + $prepared = array(); + + // If we have notices to display, we move forward. + if ( ! empty( $message ) ) { + krsort( $message ); // Sort messages. + + // Grab all plugin names. + foreach ( $message as $type => $plugin_groups ) { + $linked_plugin_groups = array(); + + // Count number of plugins in each message group to calculate singular/plural message. + $count = count( $plugin_groups ); + + // Loop through the plugin names to make the ones pulled from the .org repo linked. + foreach ( $plugin_groups as $plugin ) { + $plugin_group_single_name = $plugin[ 'name' ]; + $external_url = $this->_get_plugin_data_from_name( $plugin_group_single_name, 'external_url' ); + $source = $this->_get_plugin_data_from_name( $plugin_group_single_name, 'source' ); + + if ( $external_url && preg_match( '|^http(s)?://|', $external_url ) ) { + $linked_plugin_groups[] = '' . $plugin_group_single_name . ''; + } + elseif ( ! $source || preg_match( '|^http://wordpress.org/extend/plugins/|', $source ) ) { + $url = esc_url( add_query_arg( + array( + 'tab' => 'plugin-information', + 'plugin' => $this->_get_plugin_data_from_name( $plugin_group_single_name ), + 'TB_iframe' => 'true', + 'width' => '640', + 'height' => '500', + ), + admin_url( 'plugin-install.php' ) + ) ); + + $linked_plugin_groups[] = '' . $plugin_group_single_name . ''; + } + else { + $linked_plugin_groups[] = $plugin_group_single_name; // No hyperlink. + } + + if ( isset( $linked_plugin_groups ) && (array) $linked_plugin_groups ) { + $plugin_groups = $linked_plugin_groups; + } + } + + $last_plugin = array_pop( $plugin_groups ); // Pop off last name to prep for readability. + $imploded = empty( $plugin_groups ) ? '' . $last_plugin . '' : '' . ( implode( ', ', $plugin_groups ) . ' and ' . $last_plugin . '' ); + + $prepared['messages'][] = array( + 'type' => ( in_array( $type, $this->error_types ) && $plugin[ 'required' ] ? 'error' : 'message' ), + 'value' => sprintf( translate_nooped_plural( $this->strings[$type], $count, 'tgmpa' ), $imploded, $plugin[ '_referrer_name' ], $count ), + ); + + } + + //** Setup variables to determine if action links are needed. */ + $e_show_install_link = $e_install_link ? '' . translate_nooped_plural( $this->strings['install_link'], $e_install_link_count, 'tgmpa' ) . '' : ''; + $e_show_activate_link = $e_activate_link ? '' . translate_nooped_plural( $this->strings['activate_link'], $e_activate_link_count, 'tgmpa' ) . '' : ''; + + $m_show_install_link = $m_install_link ? '' . translate_nooped_plural( $this->strings['install_link'], $m_install_link_count, 'tgmpa' ) . '' : ''; + $m_show_activate_link = $m_activate_link ? '' . translate_nooped_plural( $this->strings['activate_link'], $m_activate_link_count, 'tgmpa' ) . '' : ''; + + //** Define all of the action links. */ + $prepared[ 'links' ] = array( + 'error' => array_filter( array( + 'install' => ( current_user_can( 'install_plugins' ) ) ? $e_show_install_link : false, + 'activate' => ( current_user_can( 'activate_plugins' ) ) ? $e_show_activate_link : false, + ) ), + 'message' => array_filter( array( + 'install' => ( current_user_can( 'install_plugins' ) ) ? $m_show_install_link : false, + 'activate' => ( current_user_can( 'activate_plugins' ) ) ? $m_show_activate_link : false, + ) ), + ); + } + + return $prepared; + } + + /** + * Add individual plugin to our collection of plugins. + * + * If the required keys are not set or the plugin has already + * been registered, the plugin is not added. + * + * @since 2.0.0 + * + * @param array $plugin Array of plugin arguments. + */ + public function register( $plugin ) { + if ( ! isset( $plugin['slug'] ) || ! isset( $plugin['name'] ) ) { + return; + } + if( isset( $this->plugins[ $plugin[ 'slug' ] ] ) ) { + $_plugin = $this->plugins[ $plugin[ 'slug' ] ]; + //** Version must be set the highest to prevent issues. */ + if( !empty( $_plugin[ 'version' ] ) && !empty( $plugin[ 'version' ] ) ) { + $version = version_compare( $_plugin[ 'version' ], $plugin[ 'version' ], '<' ) ? $plugin[ 'version' ] : $_plugin[ 'version' ]; + } else { + $version = !empty( $plugin[ 'version' ] ) ? $plugin[ 'version' ] : ( !empty( $_plugin[ 'version' ] ) ? $_plugin[ 'version' ] : false ); + } + if( !empty( $version ) ) { + $this->plugins[ $plugin[ 'slug' ] ][ 'version' ] = $version; + } + //** Parent plugin must be set as required if any child plugin requires it. */ + $this->plugins[ $plugin[ 'slug' ] ][ 'required' ] = $_plugin[ 'required' ] == true ? $_plugin[ 'required' ] : $plugin[ 'required' ]; + } else { + $_plugin = $plugin; + unset( $_plugin[ '_referrer' ] ); + unset( $_plugin[ '_referrer_name' ] ); + $this->plugins[ $plugin[ 'slug' ] ] = $_plugin; + } + $this->referrers[] = $plugin; + } + + /** + * Amend default configuration settings. + * + * @since 2.0.0 + * + * @param array $config Array of config options to pass as class properties. + */ + public function config( $config ) { + + $keys = array( 'default_path', 'has_notices', 'dismissable', 'dismiss_msg', 'menu', 'is_automatic', 'message', 'strings' ); + + foreach ( $keys as $key ) { + if ( isset( $config[$key] ) ) { + if ( is_array( $config[$key] ) ) { + foreach ( $config[$key] as $subkey => $value ) { + $this->{$key}[$subkey] = $value; + } + } else { + $this->$key = $config[$key]; + } + } + } + + } + + /** + * Amend action link after plugin installation. + * + * @since 2.0.0 + * + * @param array $install_actions Existing array of actions. + * @return array Amended array of actions. + */ + public function actions( $install_actions ) { + + // Remove action links on the TGMPA install page. + if ( $this->is_tgmpa_page() ) { + return false; + } + + return $install_actions; + + } + + /** + * Flushes the plugins cache on theme switch to prevent stale entries + * from remaining in the plugin table. + * + * @since 2.4.0 + */ + public function flush_plugins_cache() { + + wp_cache_flush(); + + } + + /** + * Set file_path key for each installed plugin. + * + * @since 2.1.0 + */ + public function populate_file_path() { + + // Add file_path key for all plugins. + foreach ( $this->plugins as $plugin => $values ) { + $this->plugins[$plugin]['file_path'] = $this->_get_plugin_basename_from_slug( $values['slug'] ); + } + + } + + /** + * Helper function to extract the file path of the plugin file from the + * plugin slug, if the plugin is installed. + * + * @since 2.0.0 + * + * @param string $slug Plugin slug (typically folder name) as provided by the developer. + * @return string Either file path for plugin if installed, or just the plugin slug. + */ + protected function _get_plugin_basename_from_slug( $slug ) { + $keys = array_keys( get_plugins() ); + $_keys = array(); + /** Try to get slug of activated plugin at first */ + foreach ( $keys as $key ) { + if ( preg_match( '|^' . $slug .'(-v?[0-9\.]+)?/|', $key ) ) { + if( is_plugin_active( $key ) ) { + return $key; + } else { + array_push( $_keys, $key ); + } + } + } + /** Get key from any non activated but installed matched plugin */ + if( !empty( $_keys ) ) { + return $_keys[0]; + } + return $slug; + } + + /** + * Retrieve plugin data, given the plugin name. + * + * Loops through the registered plugins looking for $name. If it finds it, + * it returns the $data from that plugin. Otherwise, returns false. + * + * @since 2.1.0 + * + * @param string $name Name of the plugin, as it was registered. + * @param string $data Optional. Array key of plugin data to return. Default is slug. + * @return string|boolean Plugin slug if found, false otherwise. + */ + protected function _get_plugin_data_from_name( $name, $data = 'slug' ) { + + foreach ( $this->plugins as $plugin => $values ) { + if ( $name == $values['name'] && isset( $values[$data] ) ) { + return $values[$data]; + } + } + + return false; + + } + + /** + * Determine if we're on the TGMPA Install page. + * + * @since 2.1.0 + * + * @return boolean True when on the TGMPA page, false otherwise. + */ + public function is_tgmpa_page() { + + if ( isset( $_GET['page'] ) && $this->menu === $_GET['page'] ) { + return true; + } + + return false; + + } + + /** + * Forces plugin activation if the parameter 'force_activation' is + * set to true. + * + * This allows theme authors to specify certain plugins that must be + * active at all times while using the current theme. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. Setting this parameter + * to true will not allow the specified plugin to be deactivated unless + * the user switches themes. + * + * @since 2.2.0 + */ + public function force_activation() { + // Set file_path parameter for any installed plugins. + $this->populate_file_path(); + $installed_plugins = get_plugins(); + foreach ( $this->plugins as $plugin ) { + // Oops, plugin isn't there so iterate to next condition. + if ( isset( $plugin['force_activation'] ) && $plugin['force_activation'] && ! isset( $installed_plugins[$plugin['file_path']] ) ) { + continue; + } + // There we go, activate the plugin. + elseif ( isset( $plugin['force_activation'] ) && $plugin['force_activation'] && is_plugin_inactive( $plugin['file_path'] ) ) { + activate_plugin( $plugin['file_path'] ); + } + } + } + + /** + * Forces plugin deactivation if the parameter 'force_deactivation' + * is set to true. + * + * This allows theme authors to specify certain plugins that must be + * deactived upon switching from the current theme to another. + * + * Please take special care when using this parameter as it has the + * potential to be harmful if not used correctly. + * + * @since 2.2.0 + */ + public function force_deactivation() { + + // Set file_path parameter for any installed plugins. + $this->populate_file_path(); + + foreach ( $this->plugins as $plugin ) { + // Only proceed forward if the paramter is set to true and plugin is active. + if ( isset( $plugin['force_deactivation'] ) && $plugin['force_deactivation'] && is_plugin_active( $plugin['file_path'] ) ) { + deactivate_plugins( $plugin['file_path'] ); + } + } + + } + + /** + * Returns the singleton instance of the class. + * + * @since 2.4.0 + * + * @return object The TGM_Plugin_Activation object. + */ + public static function get_instance() { + if ( ! isset( self::$instance ) && !( self::$instance instanceof TGM_Plugin_Activation ) ) { + self::$instance = new TGM_Plugin_Activation(); + } + return self::$instance; + } + + } + + } + +} diff --git a/vendor/wpmetabox/meta-box/.distignore b/vendor/wpmetabox/meta-box/.distignore new file mode 100644 index 000000000..a844e715c --- /dev/null +++ b/vendor/wpmetabox/meta-box/.distignore @@ -0,0 +1,24 @@ +node_modules +.git +.github +.gitignore +.gitattributes + +.DS_Store +Thumbs.db + +.distignore + +composer.json +composer.lock +package-lock.json +package.json + +gulpfile.js +phpcs.xml +phpstan.neon +README.md + +tests +css/scss + diff --git a/vendor/wpmetabox/meta-box/README.md b/vendor/wpmetabox/meta-box/README.md deleted file mode 100644 index caa5d09ab..000000000 --- a/vendor/wpmetabox/meta-box/README.md +++ /dev/null @@ -1,167 +0,0 @@ -# Meta Box - WordPress Custom Fields Framework - -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/wpmetabox/meta-box/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/wpmetabox/meta-box/?branch=master) -![Total Downloads](https://img.shields.io/wordpress/plugin/dt/meta-box.svg) -![WordPress](https://img.shields.io/wordpress/v/meta-box.svg) -[![License](https://img.shields.io/packagist/l/wpmetabox/meta-box.svg)](https://metabox.io) - -## Description - -**Meta Box is a powerful, professional, and lightweight toolkit for developers to create unlimited custom meta boxes and WordPress custom fields.** - -Meta Box helps you add [custom fields](https://metabox.io) and details on your website such as pages, posts, forms and anywhere you want using over 40 different field types such as text, images, file upload, checkboxes, and more. - -On top of that, each WordPress custom field type has extensive internal options for unlimited content possibilities. Complete customization and control is just a few clicks away. - -Adding WordPress custom fields and custom meta boxes is quick and painless: Select the field types you want in the user-friendly [Online Generator](https://metabox.io/online-generator/), then copy and paste the code into your child theme's `functions.php` file. - -**Boom! All the power with none of the bloat.** - -There are also free and premium extensions available to add enhanced capabilities. You can manage the display and organization of your WordPress custom fields, the conditions upon which they appear, and become the ultimate WordPress data wizard. - -You can also check out the [full list of extensions](https://metabox.io/plugins/) and [MetaBox.io](https://metabox.io) for details. - -### Features - -#### Create any type of metadata or custom fields in WordPress - -That's right – any type. No matter where you need to insert custom data and features, Meta Box's WordPress custom fields have your back, and with infinite options to boot. - -**Here are just a few of the data types you can customize:** - -- Posts -- Pages -- Custom post types -- [Taxonomies](https://metabox.io/plugins/mb-term-meta/) -- [Settings pages](https://metabox.io/plugins/mb-settings-page/) -- [Theme option pages](https://metabox.io/plugins/mb-settings-page/) -- [User profile pages](https://metabox.io/plugins/mb-user-profile/) -- [Post comments](https://metabox.io/plugins/mb-comment-meta/) -- [And even more data types](https://docs.metabox.io/field-settings/) than Batman has tools on his utility belt. - -#### A wide-range of field types and options - -Take your standard WordPress custom field and imagine it infinitely expanded. That's how many options Meta Box gives you: - -- Meta Box supports [40+ built-in WordPress custom field types](https://docs.metabox.io/field-settings/) for all your needs including text, textarea, WYSIWYG editor, image, file, post, select, checkbox, radio buttons, date/time picker, taxonomy, user, oembed and more to come. -- Not enough? You can also [effortlessly create your own field type](https://docs.metabox.io/custom-field-type/). -- Meta Box supports cloning fields for most field types including the WYSIWYG editor field. It also supports [repeatable field groups](https://metabox.io/plugins/meta-box-group/). -- Utilize WordPress' powerful [action](https://docs.metabox.io/actions/) and [filter](https://docs.metabox.io/filters/) system so you can build or change a site's appearance and behavior in the plugin. - -#### It's developer-friendly - -As a developer, you have enough on your plate. You shouldn't have to create an entirely new system for each project. Use Meta Box to your full advantage. - -You can use Meta Box and its custom fields in WordPress on as many websites as you want so you can use it on client projects as well. - -- Has an ultra-lightweight, yet powerful API that won't overload your site. -- Add only what you need instead of getting stuck with a bundle of features you don't even want that bloat your site. -- Meta Box [easily integrates with any theme and plugin](https://docs.metabox.io/integration/), and also [works with the Composer package dependency manager](https://docs.metabox.io/composer/). -- We use the [native WordPress meta data storage](https://docs.metabox.io/database/) and functions for ease of use and lightning-fast processing. -- It's compatible with WPML multilingual plugin, and is officially supported by the WPML team. - -#### Don't love coding? You're in luck! - -Meta Box is built mostly for developers since you need to copy and paste some code, but if you prefer a more visual system to create custom fields in WordPress, you can choose one or all of the extensions below: - -- [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/) -- [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/) -- [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/) - -The [Meta Box Builder extension](https://metabox.io/plugins/meta-box-builder/) has a ton of features to make quick work of any project: - -- All the power of Meta Box without touching a single line of code. -- It's designer-friendly, lightweight and works at top-notch speeds. -- Create an unlimited amount of WordPress custom fields at lightning speeds and with a user-friendly drag-and-drop interface. -- Over 40 custom field types available that you can drag and drop to where you need ‘em. -- Export your custom fields and settings to PHP. Then, add it to a new site without needing to install this extension for an incredibly lightweight option. -- It has the goods with conditional logic, priority and context options ready and waiting. - -### Extensions - -Speaking of extensions, there are a ton of free and premium ones available to further extend the already powerful core Meta Box plugin so you can supercharge your custom fields in WordPress. - -You'll have ultimate control to add whatever meta box and custom fields in WordPress you could ever want. Then, you can tailor it all to fit your exact specifications. - -#### Free Extensions - -- [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/): Create and manage custom post types and taxonomies quickly with an easy-to-use interface. -- [MB Relationships](https://wordpress.org/plugins/mb-relationships/): Create as many connections as you want from post-to-post or page-to-page. -- [Meta Box Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/): Add WordPress custom fields to Yoast SEO Content Analysis to generate more accurate SEO scores. -- [MB Rest API](https://metabox.io/plugins/mb-rest-api/): Pull all meta values from posts and terms into the WP REST API responses. -- [MB Comment Meta](https://wordpress.org/plugins/mb-comment-meta/): Add WordPress custom fields to comments in WordPress. It supports all field types and options. -- [MB Custom Taxonomy](https://metabox.io/plugins/custom-taxonomy/): Create and manage custom taxonomies in WordPress with a user-friendly interface. -- [Meta Box Text Limiter](https://wordpress.org/plugins/meta-box-text-limiter/): Limit the number of characters or words entered for text and textarea fields. -- [Meta Box – FacetWP Integrator](https://metabox.io/plugins/meta-box-facetwp-integrator/): Integrates Meta Box, and FacetWP to make WordPress custom fields searchable and filterable in the frontend. -- [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/): Integrates Meta Box, and Beaver Themer to show WordPress custom fields easier in the frontend. - -#### Premium Extensions - -- [MB Blocks](https://metabox.io/plugins/mb-blocks/): Create custom Gutenberg blocks with PHP, using the same syntax in Meta Box. -- [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/): Create custom meta boxes and custom fields in WordPress using a user-friendly drag-and-drop interface. -- [Meta Box Group](https://metabox.io/plugins/meta-box-group/): Create repeatable groups of WordPress custom fields for better appearance and structure. -- [MB Settings Page](https://metabox.io/plugins/mb-settings-page/): Create settings pages for themes, plugins or websites with beautiful syntax. -- [MB Term Meta](https://metabox.io/plugins/mb-term-meta/): Add meta data to categories, tags or any custom taxonomy with simple syntax. -- [Meta Box Conditional Logic](https://metabox.io/plugins/meta-box-conditional-logic/): Add visibility dependency for custom meta boxes and custom fields in WordPress. -- [Meta Box Include Exclude](https://metabox.io/plugins/meta-box-include-exclude/): Show or hide meta boxes by ID, page template, taxonomy, or custom function. -- [MB Frontend Submission](https://metabox.io/plugins/mb-frontend-submission/): Create frontend forms for users to submit custom content and embed them anywhere with a shortcode. -- [Meta Box Columns](https://metabox.io/plugins/meta-box-columns/): Display eye-catching custom fields in WordPress by putting them into 12-column grids. -- [Meta Box Tabs](https://metabox.io/plugins/meta-box-tabs/): Painlessly create tabs for meta boxes. There are 3 supported WordPress-native tab styles and icons. -- [MB Admin Columns](https://metabox.io/plugins/mb-admin-columns/): Display WordPress custom fields in table columns on admin screens for all post types. -- [MB Custom Table](https://metabox.io/plugins/mb-custom-table/): Save custom field data to custom tables instead of the default meta tables to reduce your database's size and increase its performance. -- [MB Revision](https://metabox.io/plugins/mb-revision/): Track changes to custom fields in WordPress with revisions. You can save, compare and restore the changes smoothly. -- [MB User Meta](https://metabox.io/plugins/mb-user-meta/): Quickly add WordPress custom fields to user profiles in the wp_usermeta table with simple syntax. -- [Meta Box Geolocation](https://metabox.io/plugins/meta-box-geolocation/): Automatically and instantly populate location data with the power of the Google Maps Geolocation API. -- [Meta Box Template](https://metabox.io/plugins/meta-box-template/): Make defining custom meta boxes and WordPress custom fields way easier with templates. -- [Meta Box Tooltip](https://metabox.io/plugins/meta-box-tooltip/): Display help information for custom fields in WordPress using beautiful tooltips. -- [Meta Box Show Hide](https://metabox.io/plugins/meta-box-show-hide-javascript/): Toggle meta boxes by page template, post format, taxonomy and category via JavaScript. - -See all the available [extensions on the Meta Box website](https://metabox.io/plugins/). - -### Detailed Documentation - -We won't leave you high and dry. - -We provide regularly updated, and extensive documentation as well as tutorials on how to use MetaBox and custom fields in WordPress to your advantage as well as in the most efficient way possible. - -Here are a few guides to quickly get you started with Meta Box and creating your own WordPress custom fields: - -- [Quick Start Guide](https://docs.metabox.io/quick-start/) -- [Creating Meta Boxes](https://docs.metabox.io/creating-meta-boxes/) -- [Field Settings](https://docs.metabox.io/field-settings/) -- [Displaying Fields](https://docs.metabox.io/displaying-fields/) - -Check out more on the [Meta Box Documentation](https://docs.metabox.io/) page. - -## Installation - -From within WordPress - -1. Visit **Plugins > Add New** -1. Search for **Meta Box** -1. Click the **Install Now** button to install the plugin -1. Click the **Activate** button to activate the plugin - -Manually - -1. Unzip the download package -1. Upload `meta-box` to the `/wp-content/plugins/` directory -1. Activate the plugin through the 'Plugins' menu in WordPress - -To getting started with the plugin, please read the [Quick Start Guide](https://docs.metabox.io/quick-start/). - -## Contributors - -- [Tran Ngoc Tuan Anh a.k.a Rilwis](https://deluxeblogtips.com) - Initial & lead developer -- [Franz Josef Kaiser](http://profiles.wordpress.org/f-j-kaiser) -- Omnicia -- ruanmer -- PerWiklander -- funkedgeek -- [truongwp](https://github.com/truongwp) - -[See full list of angels!](https://github.com/wpmetabox/meta-box/contributors) - -## Changelog - -[See full changelog here](https://github.com/wpmetabox/meta-box/blob/master/CHANGELOG.md). diff --git a/vendor/wpmetabox/meta-box/composer.json b/vendor/wpmetabox/meta-box/composer.json deleted file mode 100644 index aeac9c5b7..000000000 --- a/vendor/wpmetabox/meta-box/composer.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "wpmetabox/meta-box", - "type": "wordpress-plugin", - "keywords": [ - "wordpress", - "ui", - "select2", - "wp-admin", - "meta-box", - "wordpress-plugin", - "custom-field" - ], - "description": "A powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress websites.", - "homepage": "https://metabox.io", - "license": "GPL-2.0", - "minimum-stability": "stable", - "authors": [ - { - "name": "Tran Ngoc Tuan Anh", - "email": "anhtnt@elightup.com", - "homepage": "https://metabox.io", - "role": "Developer" - } - ] -} diff --git a/vendor/wpmetabox/meta-box/css/button-group.css b/vendor/wpmetabox/meta-box/css/button-group.css index 15e3b4be9..4a3f0a5b4 100644 --- a/vendor/wpmetabox/meta-box/css/button-group.css +++ b/vendor/wpmetabox/meta-box/css/button-group.css @@ -1,72 +1,82 @@ .rwmb-button-input-list { - margin: 0; - display: inline-block; -} -.rwmb-button-input-list li { - margin-bottom: 0; - list-style: none; + --color: var(--wp-admin-theme-color, #2271b1); } + .rwmb-button-input-list .rwmb-button_group { display: none; } -.rwmb-button-input-list li label { +.rwmb-button-input-list label { display: block; - border: #ccc solid 1px; + border: 1px solid #8c8f94; position: relative; z-index: 1; padding: 5px 10px; background: #fff; } -.rwmb-button-input-list li label.selected { - border-color: #0073aa; - background: #0073aa; +.rwmb-button-input-list .selected { + border-color: var(--color); + background: var(--color); color: #fff; z-index: 2; } -/* Layout not inline --------------------------------------------------*/ -.rwmb-button-input-list:not(.rwmb-inline) li label { + +/* Layout not inline */ +.rwmb-button-input-list:not(.rwmb-inline) label:not(:first-child) { border-top-width: 0; } -.rwmb-button-input-list:not(.rwmb-inline) li:first-child label { - border-top-width: 1px; -} -.rwmb-button-input-list:not(.rwmb-inline) li label.selected { - border-bottom: 1px solid #fff; -} -.rwmb-button-input-list:not(.rwmb-inline) li:last-child label.selected { - border-bottom-color: #0073aa; +.rwmb-button-input-list:not(.rwmb-inline) .selected:not(:last-child) { + border-bottom-color: rgba(255, 255, 255, .25); } -.rwmb-button-input-list:not(.rwmb-inline) > li:first-child:not(:last-child) label { +.rwmb-button-input-list:not(.rwmb-inline) > label:first-child:not(:last-child) { border-top-left-radius: 3px; border-top-right-radius: 3px; } -.rwmb-button-input-list:not(.rwmb-inline) > li:last-child:not(:first-child) label { +.rwmb-button-input-list:not(.rwmb-inline) > label:last-child:not(:first-child) { border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; } -/* Layout inline ----------------------------------------------*/ -.rwmb-button-input-list.rwmb-inline li { - display: inline-block; + +/* Layout inline */ +.rwmb-button-input-list.rwmb-inline { + display: flex; } -.rwmb-button-input-list.rwmb-inline li label { +.rwmb-button-input-list.rwmb-inline label:not(:first-child) { border-left-width: 0; } -.rwmb-button-input-list.rwmb-inline li:first-child label { - border-left-width: 1px; +.rwmb-button-input-list.rwmb-inline .selected:not(:last-child) { + border-right-color: rgba(255, 255, 255, .25); } -.rwmb-button-input-list.rwmb-inline li label.selected { - border-right-color: rgb(255, 255, 255); -} -.rwmb-button-input-list.rwmb-inline li:last-child label.selected { - border-right-color: #0073aa; -} -.rwmb-button-input-list.rwmb-inline > li:first-child:not(:last-child) label { +.rwmb-button-input-list.rwmb-inline > label:first-child:not(:last-child) { border-top-left-radius: 3px; border-bottom-left-radius: 3px; } -.rwmb-button-input-list.rwmb-inline > li:last-child:not(:first-child) label { +.rwmb-button-input-list.rwmb-inline > label:last-child:not(:first-child) { border-top-right-radius: 3px; border-bottom-right-radius: 3px; } + +/* Admin color schemes */ +.admin-color-blue .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #e1a948); +} +.admin-color-coffee .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #c7a589); +} +.admin-color-ectoplasm .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #a3b745); +} +.admin-color-light .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #04a4cc); +} +.admin-color-midnight .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #e14d43); +} +.admin-color-modern .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #3858e9); +} +.admin-color-ocean .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #9ebaa0); +} +.admin-color-sunrise .rwmb-button-input-list { + --color: var(--wp-admin-theme-color, #dd823b); +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/date.css b/vendor/wpmetabox/meta-box/css/date.css index adeac46ad..24d283f27 100644 --- a/vendor/wpmetabox/meta-box/css/date.css +++ b/vendor/wpmetabox/meta-box/css/date.css @@ -1,3 +1,10 @@ +body { + --mb-color-datepicker-primary: #23282d; + --mb-color-datepicker-border: #23282d; + --mb-color-datepicker-active: var(--wp-admin-theme-color, #2271b1); + --mb-color-datepicker-heading: #fff; +} + /* Fix empty block below admin footer (issue #24) */ #ui-datepicker-div { display: none; @@ -17,15 +24,10 @@ .ui-datepicker { padding: 0; border: 1px solid #ddd; - -webkit-border-radius: 0; - -moz-border-radius: 0; - border-radius: 0; + border-radius: 4px; } .ui-datepicker * { padding: 0; - font-family: "Open Sans", sans-serif; - -webkit-border-radius: 0; - -moz-border-radius: 0; border-radius: 0; } .ui-datepicker table { @@ -33,28 +35,19 @@ margin: 0; } .ui-datepicker .ui-datepicker-header, -.ui-timepicker-div .ui-widget-header{ +.ui-timepicker-div .ui-widget-header { border: none; - background: #23282d; - color: #fff; font-weight: normal; } .ui-datepicker .ui-datepicker-header .ui-state-hover { - background: #23282d; border-color: transparent; cursor: pointer; - -webkit-border-radius: 0; - -moz-border-radius: 0; border-radius: 0; } -.ui-datepicker thead { - background: #23282d; - color: #fff; -} + .ui-datepicker .ui-datepicker-title { margin-top: .4em; margin-bottom: .3em; - color: #fff; font-size: 14px; } .ui-datepicker .ui-datepicker-prev-hover, @@ -87,7 +80,6 @@ color: #fff; font-weight: normal; border: none; - border-top: 1px solid #32373c; } .ui-datepicker td { background: #f1f1f1; @@ -105,7 +97,6 @@ } .ui-datepicker td .ui-state-active, .ui-datepicker td .ui-state-hover { - background: #0073aa; color: #fff; } .ui-datepicker td.ui-state-disabled, @@ -113,7 +104,27 @@ opacity: 1; color: #999; } -/* timepicker button */ + + +/* Month and year select dropdowns */ +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { + background: none; + color: inherit; + border: none; +} +.ui-datepicker select.ui-datepicker-month option, +.ui-datepicker select.ui-datepicker-year option { + color: #3c434a; + background: #fff; +} + +/* Button pane */ +.ui-datepicker .ui-datepicker-buttonpane button { + border-radius: 2px; +} + +/* Timepicker */ .ui-timepicker-div .ui-slider-access { display: inline-block; } @@ -122,111 +133,78 @@ margin: 0 2px; border-radius: 4px; } -.ui-timepicker-div .ui-slider-access button span.ui-button-icon{ +.ui-timepicker-div .ui-slider-access button span.ui-button-icon { display: inline; } -/* Other Datepicker Color Schemes */ -/* Blue */ -.admin-color-blue .ui-datepicker .ui-datepicker-header, -.admin-color-blue .ui-timepicker-div .ui-widget-header, -.admin-color-blue .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-blue .ui-datepicker thead { - background: #4796b3; -} -.admin-color-blue .ui-datepicker th { - border-color: #52accc; -} -.admin-color-blue .ui-datepicker td .ui-state-active, -.admin-color-blue .ui-datepicker td .ui-state-hover { - background: #096484; -} -/* Coffee */ -.admin-color-coffee .ui-datepicker .ui-datepicker-header, -.admin-color-cofee .ui-timepicker-div .ui-widget-header, -.admin-color-coffee .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-coffee .ui-datepicker thead { - background: #46403c; -} -.admin-color-coffee .ui-datepicker th { - border-color: #59524c; -} -.admin-color-coffee .ui-datepicker td .ui-state-active, -.admin-color-coffee .ui-datepicker td .ui-state-hover { - background: #c7a589; -} -/* Ectoplasm */ -.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header, -.admin-color-ectoplasm .ui-timepicker-div .ui-widget-header, -.admin-color-ectoplasm .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-ectoplasm .ui-datepicker thead { - background: #413256; -} -.admin-color-ectoplasm .ui-datepicker th { - border-color: #523f6d; -} -.admin-color-ectoplasm .ui-datepicker td .ui-state-active, -.admin-color-ectoplasm .ui-datepicker td .ui-state-hover { - background: #a3b745; -} -/* Midnight */ -.admin-color-midnight .ui-datepicker .ui-datepicker-header, -.admin-color-midnight .ui-timepicker-div .ui-widget-header, -.admin-color-midnight .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-midnight .ui-datepicker thead { - background: #26292c; -} -.admin-color-midnight .ui-datepicker th { - border-color: #363b3f; -} -.admin-color-midnight .ui-datepicker td .ui-state-active, -.admin-color-midnight .ui-datepicker td .ui-state-hover { - background: #e14d43; -} -/* Ocean */ -.admin-color-ocean .ui-datepicker .ui-datepicker-header, -.admin-color-ocean .ui-timepicker-div .ui-widget-header, -.admin-color-ocean .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-ocean .ui-datepicker thead { - background: #627c83; -} -.admin-color-ocean .ui-datepicker th { - border-color: #738e96; -} -.admin-color-ocean .ui-datepicker td .ui-state-active, -.admin-color-ocean .ui-datepicker td .ui-state-hover { - background: #9ebaa0; -} -/* Sunrise */ -.admin-color-sunrise .ui-datepicker .ui-datepicker-header, -.admin-color-sunrise .ui-timepicker-div .ui-widget-header, -.admin-color-sunrise .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-sunrise .ui-datepicker thead { - background: #be3631; -} -.admin-color-sunrise .ui-datepicker th { - border-color: #cf4944; -} -.admin-color-sunrise .ui-datepicker td .ui-state-active, -.admin-color-sunrise .ui-datepicker td .ui-state-hover { - background: #dd823b; +.ui-timepicker-oneLine .ui-widget-header { + margin-right: -2px; } -/* Light */ -.admin-color-light .ui-datepicker .ui-datepicker-header, -.admin-color-light .ui-timepicker-div .ui-widget-header, -.admin-color-light .ui-datepicker .ui-datepicker-header .ui-state-hover, -.admin-color-light .ui-datepicker thead { - background: #e5e5e5; + +/* Color schemes */ +.ui-datepicker .ui-datepicker-header, +.ui-timepicker-div .ui-widget-header, +.ui-datepicker .ui-datepicker-header .ui-state-hover, +.ui-datepicker thead { + background: var(--mb-color-datepicker-primary); + color: var(--mb-color-datepicker-heading); } -.admin-color-light .ui-datepicker td { - background: #fff; +.ui-datepicker th { + border-top: 1px solid var(--mb-color-datepicker-border); } +.ui-datepicker td .ui-state-active, +.ui-datepicker td .ui-state-hover { + background: var(--mb-color-datepicker-active); +} +.ui-datepicker .ui-datepicker-title { + color: var(--mb-color-datepicker-heading); +} + +.admin-color-blue { + --mb-color-datepicker-primary: #4796b3; + --mb-color-datepicker-border: #52accc; + --mb-color-datepicker-active: #096484; +} +.admin-color-coffee { + --mb-color-datepicker-primary: #46403c; + --mb-color-datepicker-border: #59524c; + --mb-color-datepicker-active: #c7a589; +} +.admin-color-ectoplasm { + --mb-color-datepicker-primary: #413256; + --mb-color-datepicker-border: #523f6d; + --mb-color-datepicker-active: #a3b745; +} +.admin-color-midnight { + --mb-color-datepicker-primary: #26292c; + --mb-color-datepicker-border: #363b3f; + --mb-color-datepicker-active: #e14d43; +} +.admin-color-modern { + --mb-color-datepicker-primary: #1e1e1e; + --mb-color-datepicker-border: #363b3f; + --mb-color-datepicker-active: #3858e9; +} +.admin-color-ocean { + --mb-color-datepicker-primary: #627c83; + --mb-color-datepicker-border: #738e96; + --mb-color-datepicker-active: #9ebaa0; +} +.admin-color-sunrise { + --mb-color-datepicker-primary: #be3631; + --mb-color-datepicker-border: #cf4944; + --mb-color-datepicker-active: #dd823b; +} +.admin-color-light { + --mb-color-datepicker-primary: #e5e5e5; + --mb-color-datepicker-border: #f0f0f0; + --mb-color-datepicker-active: #888; + --mb-color-datepicker-heading: inherit; +} +/* Light */ .admin-color-light .ui-datepicker .ui-datepicker-next span, .admin-color-light .ui-datepicker .ui-datepicker-prev span { background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAADwCAYAAADvl7rLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDoxMUIxRjI2RjhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDoxMUIxRjI3MDhCODYxMUUzQTEyNERCMDU1QzdBQ0EyMCI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjExQjFGMjZEOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOjExQjFGMjZFOEI4NjExRTNBMTI0REIwNTVDN0FDQTIwIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+kKfR4AAAHcRJREFUeNrsXWuMXsdZnuMu4CUN2S0t0a6o4sQqAaooTncrKGrUNbe2qSC2uQqpqtexbCqI0xaQEBclKUL8qts6stqNkuwWiYqbajtqS9oAuyEISrubrLmUFnBSfmRXFa12KT+cKk2GM9mZ7ng858w7l3PmnO88jzQ633e+8565vs+8M9+8MwXnnAEAMEzsQREAAAgAAIABYkx9OHXqFEoDMDFVho0yTJdhE8UxOjhz5gwsAICk/Exep1AkGAK0DY6G93L+eUblnw4gATPNqMceEsBURMVxSwhFbO8TEj838j4V8B6eQHF1RWyzDnTl3zRIIDTNsCJ6RABdMf+mM6XBjNfsDXP1wm2hkEGN+ze1eyFpngYJ9IcAYs0/vQEVkenz7X1SwRZv2xNhqeJNVRcxac5Vj0AAAcSYf13pBVMMPfS8xyhhaFpy9pqhQ6CqNOe0ZgBPAgg1/7rcC8aQQJEx7lzkGzoEqkpz7noEPOcAmhhPxjTGzcA42zR/m0jDZkSPGZPvmCFQVZqh/B3EWMfTV6CKvm2F5LJAQhYCmWlGPYIAAJAPMMQhAAAAIAAAAEAAAACAAAAAAAEAAAACAAAABAAAAAhAA/zI8+wHoMcL772BEkBsA0i1J0CsM0yIAvGa0CZ55doPIIU7uF7uIJKeEUCKBpDS6yumEW4kTPt0S+mOVf7YtG84voekHXsB9IQAUlXeZgMk0JYC2dIe6swS2vBTK79P2mMdmTZayBPQEAGkrLyUJDDdkvLb0h7ryRZCAtOZlD/F8G264TwBDRJAURNYJhLwbcSpepqU+wFs9KDcqhR1OkHa4Q7cQbTlDRjjVRa6H0BuFInKbTqQ0IpE8YYqrl7n8CgcOAHkVKK+I+d+ACj/AQ4BAAAAAQAAAAIAAAAEAAAACAAAABAAAAAgAAAAeg1sCw64IJYBFwPNt4li1Mp/DJUPBSAoQUwZ8AwKlCLOQdT5HmLlh1ZCikM6eUsyOXqUJvMRW/660hcRaUlBHDyjEqdsuzxTW+O+BJCi8lOdyRcSf5GoAaWqhJAelCcsvyKB8sQocmzeU7SBWAuorbabmjxqy3+spcrnERkPbUhFR8z3UAVIMQ7NVQbcEneRIO/UvBSW/PuWAw+U54naQJFgCFZVlgV1DiDH2LlI/K5UzNlmL55ScYtEaQ9VoFTpbbsNhHaCqdKdoh045fe0pPxFBiKJnXtIwcAx6SgSpD+VCR3bA8XmPdUkZB+sv9TzGLV135QFUHTgXTl7z5Tx5yzH0PynznvRkTJscx4lZvhHjnesw4XXFRTIP/I/qvFiJSAADBggAAAAAQAAAAIAAAAEAAAACAAAABAAAABDIwB1suvQT3WNXU3YZ6RqA6m8QtuML/Zk6N60P8rhoBs9bABdJZO2G05omadsA0Vg/DZvuKkW4lZyKY7GM9Ocwx14inm6A28Q7zVdCSGVzztKAr7pmkqYh5DyT9kGeIDy1x1QO9Vg3E1YQDmPRXceklt3OGjV91w9H6Ugiw5aAr6706Q42Ti2/FO1gZCdeTYqLBkfIoptBzEWUGia60z/UEvOVZaNTwKGNIC6sVdo5fNMSp9SAXwbQS4yrMt7G+vbiwTtILUV7Itp4r1G5gCaVP62HCtiG38KBs6xFx5FCbpo9VQ1dNv4e7qFdhBjAcWmWcA8Xj3FMe/WuYw9HWwAdZMvoZWfk4FTKUCKrb24R/2lMEFD0rtZU9Z9PCo+9nj1IlDeVZaNEkATPb5vQcb0eKkYOCQdmyy9uedbH6kIkEeUv82nfbPFNKQq981Ew+DQ4V/tMe9jDTJnFzazYJEkkGszkk2WvucqPOOf1sa9PgTYtf0D+riZSGvx4mAQoE0SAjoGLAUGABAAAAAgAAAAQAAAAIAAAAAAAQBAVnAUQfsEkMobLdSjKlWl6/GjIYUpX+6yCz0hCfUeSACpvNFCPapSnYmnxy/eN83SHFLat14s9njwgsUf8JpCgXlLaR88AVR5o/n6NKf2KQ+NX5GJz8KWlCfqhnok8kRxhypwEdgTV3kDxigwi6w7kECCOQDfjQ1iPKpsCt/WxgrcQn4pThj2aYS2k3lTmNJNPEvNrw+BxJ7KDEQQQJ0LYRs+0dNaXLEbK8QoSpHAjCwSKVauHoxnym/Kd6QYjgyKAKq80dpi4VhvuBSurLlNxqLCAuEtNvqu9cQ8sO5SHfM+qCGAbbzssyXSlFFpIRsihO4HkMqVNbbx8wQkEDoOjm30tmGQ7xCCB86rxMjWkQCD8l8NH2/AjcAKjPGlZwHviXFlTWmG6uWQwowtAuOPSXusK23oxjAxsk0ORwZNAG1MIqV6X1dcWYvM70mhwLn86aGwGYcAAAAlBAEAAAACAAAABAAAAAgAAAAQAAAAIIDRxwTD8lFgoASQ0g871LGGJ5T1fYdQ/i02On+HxZ50CwyIAGIP1kzpCDOZqXy2LEQyEamAOWR1bIAEAAoBxKyfjlnPbfbUqhee9FAUcxmpz9l6usk/aXnHlmf85r0YQk1lPW2g6QNVBMAjeyCbPzj3JBSlbLryb0dYH769vpLflnGHnCxr5t0n/3V7ErjSkmo7N2AAGCOY/TygF09hRTCL8ucYi2+zdA41VOWvKjdX+ZvbsBUV9TuNpg/YCMBstFWffUzQWK+0WMSOu32tj7q8u8qhqpenluFGTb4LTfk30fQBGwHUKV0R0fCLSDLIRSCFQQKcMBfBa4ZCrrzUlU8XdtcBBjAH4OqNQhXWd0+8mP34YuQnLbJbWh62CUpW1NwriKQTgqrt3KD4gDcBxI7fQ7elKioCi5APGfPrsqn+hiwSP2cidjs1AEOA6IZYJG7UOREzB5ALmww9PpCIAIYOKBIw2CEAAAAgAAAAQAAAAIAAAAAAAQDNYoZdvZZhpkfpF5PLe42ACeeOE8Aho8Ety3tt4/0szoc/FiKuBVa9l8BMC8q/arm/6hH3TEbyEIr+rTLcXIbLMtws740Fpj8kHzcZsjd55iNEPjZOgV9whJg8XKVLeoWcK8P7yvC0/D4h79lg+3vskOX5w2U475no32dXH8t1kvktB64jDNc75svwL2U4UfH7LWVY81ReHbMR8qsOef250KPNRKO5VPP7/jI84yCA15dhvQzj8p4ggQNl+LIkAuaZfp98VNX9JY82wCxlcIkgFyJj4s/l9aTsiFLWY1FHAExTfoEV5rcCjkog4r0HA5jRlwTGLfcuE+QWy/BgYO+3qhW0uSJPnXa8WpMHpeCrNeSxyppdn3Cpouz0MnTFr5T/Go3Y1h3vrStPlXcKmjiVqm+Hy1aROLextVlxOrY8C1kp/5dlQwldQrvX+L4Q8I7vCIzbZQG4cLiCqLj87ZxDfq2CBCg9P69ogL7nFIqy+4bl/vd4lMM18nkR33cHluUdEcO4GIIIdYcviGkpWlT+nyjD39SZa4yo9FQo5Xe9pyASwGRg2sYD0x9jAQh83kICSvk/T3yHSQIU5dcx4fhOKbvrI8pUmPtfK8Pb5fe/kveYR/6ZhYR8ymDWsKhmCcOzvsNU/l+UdVZJAqlnZqnK76O8oeaU3us826IFYJIA81R+G0n6TuLtd3ynWGD/bdy7waPnvygVfl0jBHHve8vwPLH3rduZqs0l2inM+dh3/EoZPu45b3FSG4J9Urt/xfC7ib8Btzwadp3yqjCuffbBd2nBpwdbjFR+gSmNBJTy+2zEKRReOPUckmGTtTuTL8rpB40wTig/kcfvl439G1LxD8h2xuVvoRuSznoq/r6Ka+xwNMc7/iSA+MWw+TvZ7qSiUv6VJi2AVJM04wni+VLgO2MtgCm2u+OO3utvEhv/TI08lQRe6/juakSXDHNenx+qsya+T3vO9k/BunxfyI5Eucz3y5nf4bMvxzNG/S3UKX8oAcxGmDkU5f8DqYBVv6UimSbmACjjzNkG5XVFrPvuakT63MWYTJPr7z+dJFzPuCbSeIK6/cuKK7UTWKy43+Y7QvCMhcStyv9yYXK+U9anTp1iwBXj7VsqfhfktDaQsuBar/9MT9OeqmPoG9SEoFX5z5w5k20I0HWsGdcho0Dae4tnKGUAXwAAGDBAAAAAAgAAAAQAAAAIAACATuAPZchCAOqU3NgjsUNg+i23vSeADcpHnbIYZ5bZ/bAp/+EfYtV7EXDm3qPhhEOeusCpypf8pp7IK/xRZPuZk6FtXFuG35Hh2sh3HdXCFRirUf4trcFST+gVm4gIBxB95dP9bMcD7kZ5pfhzi4U4a1qlndQUsKiRUygaUH61QMfljivK7AtGWlTaxP03svrFPue0PJtYIJShy3NygdEWOqmFJLoTzzqj+7jnllf4baNNCCVYIij9smzzy/LepNSDykU1hu6oOnxQku6C9h7KOROfNj7fHqH85oIkkf6vvFwoloVAuvLr3mirhMSLlwk/+Lrz50M3dPCRV0r3a2U4q13FfgWnPRvQjCQjteGJyzOv6mBPah4oPVVByP/nyvCjbMdF+7Yy/EMZfozRnWk423XiUTK3MvdKPpu8Qoi8+D/7BbbjonyTh7zZ+NUKvMWG26Ape9JCykWN9eYi8JOMvlJVtVmR9/NSr8XnpbqFQKbyq15vVv7WxgKLqn0EfLwM3ySJ6D/L8O9sx7tNrOJ71lP5Rd7Vzka+brm58Ndl+JEyPCaV6DFZHn8bOBzTFTJUXuCWAHmh/M8HyJk936Jn+9vybJuhFpmOGxI9o3CPluZDhpWybZsDWGDV69EVCSy00IC3ZdiSYZv5H8/1j2X4uTJ8VjaGT0r2PBeg/Oc0S6AP+Em2s/b9bdJ8FFfhTkrdYONmS2/lQ/ymvAqvCJAXPf9e5rfBy9EahXetxZ8zlN88X3KrwTmB3y3DB2p+/4B8xoV9Mqh0npblMS+HP9tVcwAnLeNZphHCWsXYtItQFsBXy/BP0pQU138LUP6Ynp+zMH/wSW3uxdcCEi6gP1+GP5VKL66/xGhuqcJj8UvamFu59CrzPUReKP6LEfL6HICv8psK/2QL1utWgHWr8Jtl+I2a30LIr5K8Xb4AIY1+SzOZ9xkm98EWFH+WoGwfb0n5Y0nAtIqo+C22sxmEmNi5Xl7Ffgq/V4YjNXJi/uY5456pdPs7LG9T/iXPcl4xlJhbFHjbUU9VJECZANT/cft7eX2zabo78q+P+VfqImvCGeh5trsT8Fci5wxC9hRci4xTWTuhyi9m+b9QMxZ+Y8PKr8qdSetHv/6MQ+45Y7z+r57x5pZf1Ig2RPkplhZlHsxGAtTZf9E+XirDu9nuZJ+YHPyI/O1xot6oMf9hXwKo2hBR78maxMmantJn+GGm1TftoT3/ag0JuP4CVD3cJa3xbHn0gLp83e8uiJ54M6IOc8nPJ1B+ZakuG0qs/w1IJW19GEclcTHp+ctl+Avt3oPyPS8Q33FaK4/aeFPvByDGiRcZAIwO5rShQR9wVPtcSYJN7QcA5QdGDSs9S6+X5QNfAAAYMEAAAAACAAAABAAAAAgAGCno7sVzRJk5drUb7s2J0uPzV2wX3MAHSQC3WhrArRnSxwfYCNQ+DI8Y9x9h/nsz3Meu9H1YJpDAj8vnjsjwOhnE8twfIsSpt533Vih/YQQdwnPxHVL+TTJwee82QvwzlrZLPVDFtReDaz8GinzsOw556g2v0yPbOgC15nulDB+W9xZlwzPdOykJ8WV9m3zMO3LgqCwzVV6qTCkLVPQ8i3cck8o/71kWKg0KYj+GZwnyIv5rLPe/VYZvMporrYj3UUk+qgz09NT51KdwBzdXkFK9WDmju5tT47Zhy/EOtZpR30BmVbtfEPJvi+Pb7thqHYDNAlDKLypJLOn9Wba7BnmdARQsamV5VCu3RQ9ZJpXeVH6qW+s+47uPG/TzUtkvy/BNSQBUPMp2l4NPsqv98ldaqIP9bNeblHlaA+buT75W6LbMp+7J6uPRyo20zBDJ0YQ4i3FaC/9DHQJ8WDM71RFH8y0pT5W50sZwgBODCwcqFJbiT3+MVXuzKYuAMoy4N7IcXtK+v8Toh2t+SPb8qpzuNZR/ifCO8Yrgg1XP+wp72ZW7P+3V4qce8inK/7Rm0jPmdzhpETF/UkjiEW3tNWzHGew1WrgCdSsBdeU/Rhx7VLFUm6Z8ivMJY3GRXX023LzH8OlYpPLbNnVhmvldhz+TCm/6DFySyu2CGPdfsMw5+KzPF77/L7A8uMby/Wvy86uJ73iP9lmQofIsvZFoBfAKsqJ0Pspa+LpG3nuk8j/Fdrboq50D4DKRE0ajU5XZxpZeLOIdvEFZah6qfOepcyh/XIZ3Wu4L99DbA5WfqoAi7fdU/PZ+tutp6Jt3KoHp4+gXtfsvyOEIdQ6gapztGsPfWPM8Z/UernrcVcO797UwB/AG+fmr2v3n9LZbNwdwQBvzPyp7fqX8B4jKYc7uVs34UuV93lE4QowsNQ/rFSb8eoDy61aE8At/0jG5pCv/QdkgC4/eVxDUAzLdeqAov8qjauhM63HUfAZ1DC3C/7GdM+5f4WF+zzK/reNMvFKGZ+X1WuNzDKjD6Ng5gBukbl+vBSaJgbuGABeloq+zK/9C8v0HYMhQ5r8qs6fZ7r8ALrzT6PFFr/k6trspxJuJY1/X7rV1eFqm/3Py+w8QlV8nsRU5Dl6RQ4ctLf/HPN71dc+0rzH75itiQ1HXCcfCVNePprd9PkwYgt3o+J3SCXKP+za8lmTKNnw8+FD/BoyBMuNNc/9Jqfx1vuVc6wXXEtWdb/nr/1psa+NefbvsPTUNWd2/qwxfZDubuW4GtCVlKt9kmcsoHJOAr2e7e2Ay7bPYTq5ug9JDjLbnpNoxK+QddbKUoewVQ4CmjwcvMsv3EdsV+b695fJ6tWa++/yjIHr3v5NEtaiRldog43/LcB1hMuzhyPRXbQ3nOpzleXb1rlLUcj2foA7Ot6k3YwwAqk3vXw+UXaohN+ZQ/lQktsaG2YF4Ab4AAAACAAAABAAAAAhAwyFGXwGocIccA5rLZ5cY/WQaAAAyE8A5I1Bwdxk+VYZ3WX57l/ztbhQ7AHSbAN5m9PyH5D1Xz3/GuGdbOXfGwxJYldbDakDenjUskLkE5TWHJuNVb2ZYRdH0gwDUARyTbHddtutQjiMe8VKfnTGuPthnfF9OoPzLRBI4ajT8owHxxb4jVl4p7IxFuV2Y9bwPdIgA9N5f92F2WQF3VTQiTnw2NZT1MZngXXMagbhIQCia6bO/6KmAse9Q8qK+xuV1MYAEZiy9+QzUZrQJQO/pJ9iVa5dPBiphKE4GxqunXy0/XQk08+cM68G1xn7R837ds/OSwOY936GU/zNsZ2XbZzQS8MUa1GQ4BDBnjP31HVWUFdDmOPg/jKsvVNqFI85hovLrPbyv8qfGeWmBnQ+QfcLxndVYbLGbrsxo5LGmkQish44TwDKhB19uMX0rMv5YpTvI3GvPbWZ+TuVXhDvB/P+KFXiL43udxRa7hHZBU3jdnXUBKtddApirMKEnCGaywFmPeKnPzrG4GXzVmCm7sKywK3fLCVX+ec/7dc8uSitm0fMd4rnHyvBWtuPd9lb5PWRbt5mEMrAAOkwAyxUmtG1zBduzF2pMSsqzrCaeUKvD15w1SSCk51+yKJrvcdWx71jSSOCypvxLnuUnTPdZwzKgzAmYlkQqywJokADWPBuGicfLcJwge1w+SzXdGaOfyZ5q2HEw0uxfMhr9UoZ3xMoXzL6vAP7KGyGMJa5Y4cP9X3LM+h7jN7ErjJjMesJTGWN6jSKCBNBbAYMigFR4Qob3ongBEGl/hgAAAIAAAAAAAQAAAAIAAAAEAAAACAAYIOZYuG9AjCyQkQBEpVF931nNO3jNd6B5LLC49fdzLHwVZows0AELQFVgLBH4koYZ30RAGlTaJyz3eEAaFE4Q5U/UpIl7lIXvseRmfCdkmOuI8nOGXZV6NwRomwjM+IQjz0FNeeYIJucy2/UADEl/yjznIFJmKKCPInOtDEOtvirZAlZBf+cAVEM+0eLYc1lrMIXWmHlNz20+G6N4ZhpClLBtxWc15ZMTGP71nABWZK/6YEtpU/EdNBrQQWZfXlpUPBvjx2+mwRex8Y8SsCS4pwSw0nJDNuOb0Ex61+YgKxoRqDmAkPSnzPNKBiIoKoKP7MGIeA/WWAEHoXYdYuWK48G5bKz3RzRa8zjn2KPCgXhz27fs5yzDqjZkgYbhOh48RYUVMAF7b26vaNZUm7JAB+cAgGFihWFfBRAAAAAgAAAAQAAAAIAAAAAAAQAAMJoEEHqyLQAAPSUAsXruHu37DTJMeLxX92C7z1MWAIBMBKBO0zXPortR3qcq8gG2swhEnAVwr5S9NUF6XQ4lJ5jdjVaFEyMuDwBeMFcCnpbXfzbur2i/HyO896ImJ5YTn2M7J/Qe0H5rAmLzi8JBIPpptaMmDwDBFoDo3eeloqohgDDf1Uk+6/J3ihWgeqxH5PPKEWY9cDjg40oqDsO8Vl71z+I6XoZVh/y1Mj79HSr4yvMI+b2WK0UeAIIsgP3yqh/ceb/2+YLswfcTeiDx3G1s51TbeTmEOCyHAuL7BxvM06sqCKQgEskrjWthvIMRFFi/vsqTxFS8k4b8JMOyWqBBC+CSvN5Z8eydxnOuIcCS1ogFEWzL6+mGen6F6yxhQl43mPsMRPHsD7Pdo9H1dzxHkL9OyutXJe8bv/4eavwAEGQBbEszfY7t/PW3pP12VPbqK/I5quIWsucXcwD7yvAoCzujnoqTZfii4/e1EZYHAC+Y+wHcKsfpasx/Qfb8BzTT/qInAajvaiOIZYIpq5vstisAABGo2g/golTy+9jOX4FK8c/Le9QZ/Lq9AAoP+aorAACJhwA6CRxG0QDA6AO+AAAAAgAAAAQAAAAIAACA4RLAHWxnDYDpiLIkf3Mht/xb2M5KQ1P+g/K3UZfve/0NXb5VmOsA7i7DGYeMePCBit9yy99Vhocc8sfL8PCIyve9/oYu3xrUOgCdAAQ7fYoo/44yfNrCfDnlf6oMnyXK/3QZHh8x+b7X39DlsxCAPgQ4YrMQmH3xzRHivSq45I+zqxcPHXfI31mRfkZ89k6P9PvIFy3Ff8Qjfmr9FQnkWab411j1sWi+8RcJ2n8RqCutDQF4TaI5oXJ9HXfq5AvNJGaaycs948+V/lTxp0h/1Tuajr8gposFps8n/iKg/Yjff1X7/tGA9mc+Kzxkn3KQY6sWAPVosMJTSaoyR5XnxliXMjZ2pYdHKHcIScRWcJE4/b7vSJl2lqD9hKSfW0jABx8xCMAHb5DKblP+zmCMdRcvVnxuAzyBhZBKgXIrcEgHkKL8U8Qb60D27kA5ofxPd1356wggtgJ4ogZ4VF6X2O5fKzENKpQEeCISaav8eKTyxhIgz0AaLgskxIL6aGD+n9JIoLPKL6BPAp71kDtLvBcqr8b+izLo96rkH/ZQpoeJ93gCeRYhzzzkz3oQCqX+eEL5ttuPWX88g/xTNcp/tosEcMFDAS4Q71XBJf+QpQE+5JD/hIcCfoJ4jyWQ5y3Ff8Ejfmr98QTyLEP83EFATcvrJMAidaU1AhD/Kx8nyBxnV/8H3QV58b/qKYL8KWb/D7bv8n2vv6HLZycAZVrOsZ39/E18SP72sMM0zSkvVliJRRYfs/z2MfnbAyMs3/f6G7p8+5MlxlJgAAAGANtKQAAABgYQAACAAAAAAAEAAAACAAAABAAAwIjD5QtgA2V9O+Tj5AEgKwEIjFvuXfZ4d255AAASDAFyKt3lBGnI2ePiSDOg1wQQq4CXtRCCcSk7nkkBq7aEokI/1BQAekcA4zXmOFWBxyPkL2skEKqAjMXtI8BZvg0pACD7EGA8Y/rGE6QhZ+/LO5AGAKjEWINj/9zyAAAEEkDKDS0hDwA9HgIAAAACAAAABAAAAAgAAAAQAAAAIAAAAEAAAAVTDAuDgB4QQBdWsYm4Z7TrKCj/Rhmm0fSArhPAtHFFzx1Hhrryb6I4ga4TwIZxHbryx/TcUH5gEBYA13rKumvTwwZXCFXejQTKjzkAoDMYc1gAhXaloCBem8RsQz1/iAVgU37MAQC9IIBQC2DaojTmtUkzeNWDqHyV34cM65QfwwAAFkCHLQAoPwALIMAC6ALWEryjSeWf8nwfAPTGAhgVhFouVOXHHAAACyBAEbsO08x3fQeAvD0d5/hHCgCGCvgCAMCA8f8CDABatG6NN+gY2wAAAABJRU5ErkJggg=='); } -.admin-color-light .ui-datepicker th { - border-color: #fff; -} .admin-color-light .ui-datepicker .ui-datepicker-title, .admin-color-light .ui-datepicker td .ui-state-default, .admin-color-light .ui-datepicker th { @@ -235,7 +213,6 @@ .admin-color-light .ui-datepicker td .ui-state-active, .admin-color-light .ui-datepicker td .ui-state-hover { color: #fff; - background: #888; } .admin-color-light .ui-datepicker td.ui-state-disabled, .admin-color-light .ui-datepicker td.ui-state-disabled .ui-state-default { diff --git a/vendor/wpmetabox/meta-box/css/file.css b/vendor/wpmetabox/meta-box/css/file.css index 14409fe4d..d68de1804 100644 --- a/vendor/wpmetabox/meta-box/css/file.css +++ b/vendor/wpmetabox/meta-box/css/file.css @@ -6,7 +6,6 @@ display: flex; align-items: flex-start; margin-bottom: 12px; - background: #fff; cursor: move; } .rwmb-file-icon { diff --git a/vendor/wpmetabox/meta-box/css/input-list.css b/vendor/wpmetabox/meta-box/css/input-list.css index 1a614e77f..73cf26d83 100644 --- a/vendor/wpmetabox/meta-box/css/input-list.css +++ b/vendor/wpmetabox/meta-box/css/input-list.css @@ -2,22 +2,25 @@ margin-top: 0; } .rwmb-input-list { - margin: 0; line-height: 1.8; } .rwmb-input-list .rwmb-input-list { margin-left: 20px; } -.rwmb-input-list li { - list-style: none; - margin-bottom: 0; +.rwmb-input-list > label { + display: block; } .rwmb-input-list.rwmb-inline { line-height: inherit; + display: flex; + flex-wrap: wrap; + gap: 6px 12px; } -.rwmb-input-list.rwmb-inline li { - display: inline-block; + +/* Media modal */ +.attachment-details .compat-attachment-fields .rwmb-input-list > label > input { + margin: 0 0.25rem 0 0; } -.rwmb-input-list.rwmb-inline li:not(:last-child) { - margin-right: 20px; +.compat-attachment-fields .rwmb-input-list.rwmb-inline { + gap: 10px; } diff --git a/vendor/wpmetabox/meta-box/css/jqueryui/core.css b/vendor/wpmetabox/meta-box/css/jqueryui/core.css index a4c1b2de8..9e76684c2 100644 --- a/vendor/wpmetabox/meta-box/css/jqueryui/core.css +++ b/vendor/wpmetabox/meta-box/css/jqueryui/core.css @@ -1,5 +1,5 @@ /*! - * jQuery UI CSS Framework 1.12.1 + * jQuery UI CSS Framework 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -50,7 +50,7 @@ left: 0; position: absolute; opacity: 0; - filter:Alpha(Opacity=0); /* support: IE8 */ + -ms-filter: "alpha(opacity=0)"; /* support: IE8 */ } .ui-front { @@ -94,4 +94,4 @@ left: 0; width: 100%; height: 100%; -} +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/jqueryui/datepicker.css b/vendor/wpmetabox/meta-box/css/jqueryui/datepicker.css index c82ae33fb..ada2e7007 100644 --- a/vendor/wpmetabox/meta-box/css/jqueryui/datepicker.css +++ b/vendor/wpmetabox/meta-box/css/jqueryui/datepicker.css @@ -1,5 +1,5 @@ /*! - * jQuery UI Datepicker 1.12.1 + * jQuery UI Datepicker 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -182,4 +182,4 @@ background-repeat: no-repeat; left: .5em; top: .3em; -} +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/jqueryui/slider.css b/vendor/wpmetabox/meta-box/css/jqueryui/slider.css index e1f5030ee..d8496baf6 100644 --- a/vendor/wpmetabox/meta-box/css/jqueryui/slider.css +++ b/vendor/wpmetabox/meta-box/css/jqueryui/slider.css @@ -1,5 +1,5 @@ /*! - * jQuery UI Slider 1.12.1 + * jQuery UI Slider 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -17,7 +17,7 @@ z-index: 2; width: 1.2em; height: 1.2em; - cursor: default; + cursor: pointer; -ms-touch-action: none; touch-action: none; } @@ -72,4 +72,4 @@ } .ui-slider-vertical .ui-slider-range-max { top: 0; -} +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/jqueryui/theme.css b/vendor/wpmetabox/meta-box/css/jqueryui/theme.css index 79937075d..6569bcbfc 100644 --- a/vendor/wpmetabox/meta-box/css/jqueryui/theme.css +++ b/vendor/wpmetabox/meta-box/css/jqueryui/theme.css @@ -1,5 +1,5 @@ /*! - * jQuery UI CSS Framework 1.12.1 + * jQuery UI CSS Framework 1.13.2 * http://jqueryui.com * * Copyright jQuery Foundation and other contributors @@ -172,18 +172,18 @@ a.ui-button:active, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; - filter:Alpha(Opacity=70); /* support: IE8 */ + -ms-filter: "alpha(opacity=70)"; /* support: IE8 */ font-weight: normal; } .ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; - filter:Alpha(Opacity=35); /* support: IE8 */ + -ms-filter: "alpha(opacity=35)"; /* support: IE8 */ background-image: none; } .ui-state-disabled .ui-icon { - filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ + -ms-filter: "alpha(opacity=35)"; /* support: IE8 - See #6059 */ } /* Icons @@ -194,37 +194,12 @@ a.ui-button:active, width: 16px; height: 16px; } -.ui-icon, -.ui-widget-content .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png")/*{iconsContent}*/; -} -.ui-widget-header .ui-icon { - background-image: url("images/ui-icons_444444_256x240.png")/*{iconsHeader}*/; -} -.ui-state-hover .ui-icon, -.ui-state-focus .ui-icon, -.ui-button:hover .ui-icon, -.ui-button:focus .ui-icon { - background-image: url("images/ui-icons_555555_256x240.png")/*{iconsHover}*/; -} -.ui-state-active .ui-icon, -.ui-button:active .ui-icon { - background-image: url("images/ui-icons_ffffff_256x240.png")/*{iconsActive}*/; -} -.ui-state-highlight .ui-icon, -.ui-button .ui-state-highlight.ui-icon { - background-image: url("images/ui-icons_777620_256x240.png")/*{iconsHighlight}*/; -} -.ui-state-error .ui-icon, -.ui-state-error-text .ui-icon { - background-image: url("images/ui-icons_cc0000_256x240.png")/*{iconsError}*/; -} -.ui-button .ui-icon { - background-image: url("images/ui-icons_777777_256x240.png")/*{iconsDefault}*/; -} /* positioning */ -.ui-icon-blank { background-position: 16px 16px; } +/* Three classes needed to override `.ui-button:hover .ui-icon` */ +.ui-icon-blank.ui-icon-blank.ui-icon-blank { + background-image: none; +} .ui-icon-caret-1-n { background-position: 0 0; } .ui-icon-caret-1-ne { background-position: -16px 0; } .ui-icon-caret-1-e { background-position: -32px 0; } @@ -435,9 +410,9 @@ a.ui-button:active, .ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ /*{bgImgUrlOverlay}*/ /*{bgOverlayXPos}*/ /*{bgOverlayYPos}*/ /*{bgOverlayRepeat}*/; opacity: .3/*{opacityOverlay}*/; - filter: Alpha(Opacity=30)/*{opacityFilterOverlay}*/; /* support: IE8 */ + -ms-filter: "alpha(opacity=30)"/*{opacityFilterOverlay}*/; /* support: IE8 */ } .ui-widget-shadow { -webkit-box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/; box-shadow: 0/*{offsetLeftShadow}*/ 0/*{offsetTopShadow}*/ 5px/*{thicknessShadow}*/ #666666/*{bgColorShadow}*/; -} +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/media-modal.css b/vendor/wpmetabox/meta-box/css/media-modal.css deleted file mode 100644 index c3e7080cb..000000000 --- a/vendor/wpmetabox/meta-box/css/media-modal.css +++ /dev/null @@ -1,18 +0,0 @@ -/* CSS fixes ---------------------------------------------------------------*/ -#post-body-content table.compat-attachment-fields, -#post-body-content table.compat-attachment-fields > tbody, -#post-body-content table.compat-attachment-fields tbody > tr, -#post-body-content table.compat-attachment-fields tbody > tr > th, -#post-body-content table.compat-attachment-fields tbody > tr > td, -#post-body-content table.compat-attachment-fields tbody > tr > td input, -#post-body-content table.compat-attachment-fields tbody > tr > td textarea { - display: block; - width: 100%; -} -#post-body-content table.compat-attachment-fields tbody > tr { - margin: 1em 0; -} -#post-body-content table.compat-attachment-fields tbody > tr > th.label span { - font-weight: 600; -} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/media.css b/vendor/wpmetabox/meta-box/css/media.css index ac3cccda1..f5f3afdeb 100644 --- a/vendor/wpmetabox/meta-box/css/media.css +++ b/vendor/wpmetabox/meta-box/css/media.css @@ -1,5 +1,6 @@ .rwmb-media-list { margin: 0; + padding: 0; overflow: hidden; } .rwmb-edit-media, diff --git a/vendor/wpmetabox/meta-box/css/modal.css b/vendor/wpmetabox/meta-box/css/modal.css new file mode 100644 index 000000000..b98cc6477 --- /dev/null +++ b/vendor/wpmetabox/meta-box/css/modal.css @@ -0,0 +1,70 @@ +.rwmb-modal-add-button { + display: inline-block; + margin-top: 6px; +} + +body.rwmb-modal-show, +body.rwmb-modal-show .interface-interface-skeleton__sidebar { + overflow: hidden; +} + +/* Mimic style of media modal */ +.rwmb-modal { + position: fixed; + top: 30px; + left: 30px; + right: 30px; + bottom: 30px; + z-index: 160000; + overflow: hidden; + display: none; +} + +.rwmb-modal-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + min-height: 360px; + background: #000; + opacity: 0.7; + z-index: 159900; + display: none; +} + +.rwmb-modal-title { + background: #f0f0f1; + border-bottom: 1px solid #c3c4c7; + position: relative; +} + +.rwmb-modal-title h2 { + font-size: 22px; + line-height: 50px; + padding: 0 20px; + margin: 0; +} + +.rwmb-modal-close { + position: absolute; + top: 0; + right: 0; + width: 50px; + height: 50px; + font-size: 22px; + line-height: 50px; + margin: 0; + padding: 0; + border: none; + background: none; + color: #646970; + z-index: 1000; + cursor: pointer; + outline: none; + transition: color .1s ease-in-out; +} +.rwmb-modal-close:hover, +.rwmb-modal-close:active { + color: #135e96; +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/osm-frontend.css b/vendor/wpmetabox/meta-box/css/osm-frontend.css new file mode 100644 index 000000000..91c1f866b --- /dev/null +++ b/vendor/wpmetabox/meta-box/css/osm-frontend.css @@ -0,0 +1,4 @@ +img.leaflet-marker-icon { + margin-left: -12px; + margin-top: -41px; +} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/css/select-tree.css b/vendor/wpmetabox/meta-box/css/select-tree.css index 1eecf565a..bee3a2987 100644 --- a/vendor/wpmetabox/meta-box/css/select-tree.css +++ b/vendor/wpmetabox/meta-box/css/select-tree.css @@ -1,5 +1,5 @@ -.rwmb-select-tree { - display: inline-block; +.rwmb-select-tree .rwmb-select-tree { + margin-top: 6px; } .rwmb-select-tree.hidden { diff --git a/vendor/wpmetabox/meta-box/css/style.css b/vendor/wpmetabox/meta-box/css/style.css index 097ccfffd..5ee16e670 100644 --- a/vendor/wpmetabox/meta-box/css/style.css +++ b/vendor/wpmetabox/meta-box/css/style.css @@ -33,6 +33,7 @@ .rwmb-input .select2-container, .rwmb-input textarea:not([cols]) { width: 100%; + box-sizing: border-box; } .rwmb-input input[type="checkbox"], .rwmb-input input[type="radio"] { @@ -41,10 +42,11 @@ .rwmb-input input[type="button"] { width: auto; } -.rwmb-input input, +.rwmb-input input:not([type="checkbox"]):not([type="radio"]), .rwmb-input textarea, .rwmb-input select { max-width: 100%; + margin-inline: 0; } .rwmb-textarea { resize: vertical; diff --git a/vendor/wpmetabox/meta-box/css/switch.css b/vendor/wpmetabox/meta-box/css/switch.css index ec244a949..5ea409bd6 100644 --- a/vendor/wpmetabox/meta-box/css/switch.css +++ b/vendor/wpmetabox/meta-box/css/switch.css @@ -1,5 +1,3 @@ -/* style switch ------------------------------*/ .rwmb-switch-label { position: relative; display: inline-block; @@ -9,6 +7,8 @@ min-width: 40px; height: 22px; box-sizing: border-box; + + --color: var(--wp-admin-theme-color, #2271b1); } .rwmb-switch.rwmb-switch { @@ -16,8 +16,8 @@ } .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #0073aa; - box-shadow: 0 0 1px #0073aa; + background-color: var(--color); + box-shadow: 0 0 1px var(--color); } .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider:before { @@ -42,7 +42,6 @@ right: 0; bottom: 0; z-index: 15; - -webkit-transition: .4s; transition: .4s; } @@ -55,7 +54,6 @@ bottom: 2px; z-index: 99; background-color: white; - -webkit-transition: .4s; transition: .4s; border-radius: 2px; } @@ -83,6 +81,7 @@ font-size: 11px; position: relative; z-index: 20; + line-height: 18px; } .rwmb-switch-on { @@ -94,27 +93,27 @@ } /* Admin color schemes */ -.admin-color-blue .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #e1a948; - box-shadow: 0 0 1px #e1a948; -} -.admin-color-coffee .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #c7a589; - box-shadow: 0 0 1px #c7a589; -} -.admin-color-ectoplasm .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #a3b745; - box-shadow: 0 0 1px #a3b745; -} -.admin-color-midnight .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #e14d43; - box-shadow: 0 0 1px #e14d43; -} -.admin-color-ocean .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #9ebaa0; - box-shadow: 0 0 1px #9ebaa0; -} -.admin-color-sunrise .rwmb-switch:checked + .rwmb-switch-status .rwmb-switch-slider { - background-color: #dd823b; - box-shadow: 0 0 1px #dd823b; -} \ No newline at end of file +.admin-color-blue .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #e1a948); +} +.admin-color-coffee .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #c7a589); +} +.admin-color-ectoplasm .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #a3b745); +} +.admin-color-light .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #04a4cc); +} +.admin-color-midnight .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #e14d43); +} +.admin-color-modern .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #3858e9); +} +.admin-color-ocean .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #9ebaa0); +} +.admin-color-sunrise .rwmb-switch-label { + --color: var(--wp-admin-theme-color, #dd823b); +} diff --git a/vendor/wpmetabox/meta-box/css/taxonomy.css b/vendor/wpmetabox/meta-box/css/taxonomy.css deleted file mode 100644 index 257967f4e..000000000 --- a/vendor/wpmetabox/meta-box/css/taxonomy.css +++ /dev/null @@ -1,18 +0,0 @@ -.rwmb-taxonomy-add, -.rwmb-taxonomy-add-form { - margin-top: 6px; -} -.rwmb-taxonomy-add-button { - padding: 0; - border: 0; - background: none; - color: #0073aa; - text-decoration: underline; - cursor: pointer; -} -.rwmb-taxonomy-add-button:hover { - color: #00a0d2; -} -.rwmb-taxonomy-add-form.rwmb-hidden { - display: none; -} \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/gulpfile.js b/vendor/wpmetabox/meta-box/gulpfile.js deleted file mode 100644 index 78e191b94..000000000 --- a/vendor/wpmetabox/meta-box/gulpfile.js +++ /dev/null @@ -1,27 +0,0 @@ -const { src, dest, series } = require('gulp'); -const babel = require('gulp-babel'); -const concat = require('gulp-concat'); -const terser = require('gulp-terser'); -const clean = require('gulp-clean'); - -const validationCompile = () => { - return src('js/validation/validation.js') - .pipe(babel({ - presets: ['@babel/env'] - })) - .pipe(dest('js/build/')); -} - -const validationConcat = () => { - return src(['js/validation/jquery.validate.js', 'js/validation/additional-methods.js', 'js/build/validation.js']) - .pipe(concat('validation.min.js')) - .pipe(terser()) - .pipe(dest('js')); -} - -const validationClean = () => { - return src('js/build', {read: false}) - .pipe(clean()); -} - -exports.default = series( validationCompile, validationConcat, validationClean ); \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/inc/about/about.php b/vendor/wpmetabox/meta-box/inc/about/about.php index a1cc32551..ebd2055df 100644 --- a/vendor/wpmetabox/meta-box/inc/about/about.php +++ b/vendor/wpmetabox/meta-box/inc/about/about.php @@ -1,12 +1,6 @@ update_checker = $update_checker; } - /** - * Init hooks. - */ public function init() { // Add links to about page in the plugin action links. - add_filter( 'plugin_action_links_meta-box/meta-box.php', array( $this, 'plugin_links' ), 20 ); + add_filter( 'plugin_action_links_meta-box/meta-box.php', [ $this, 'plugin_links' ], 20 ); // Add a shared top-level admin menu and Dashboard page. Use priority 5 to show Dashboard at the top. - add_action( 'admin_menu', array( $this, 'add_menu' ), 5 ); - add_action( 'admin_menu', array( $this, 'add_submenu' ), 5 ); + add_action( 'admin_menu', [ $this, 'add_menu' ], 5 ); + add_action( 'admin_menu', [ $this, 'add_submenu' ], 5 ); // If no admin menu, then hide the About page. - add_action( 'admin_head', array( $this, 'hide_page' ) ); + add_action( 'admin_head', [ $this, 'hide_page' ] ); // Redirect to about page after activation. - add_action( 'activated_plugin', array( $this, 'redirect' ), 10, 2 ); + add_action( 'activated_plugin', [ $this, 'redirect' ], 10, 2 ); } - /** - * Add links to About page. - * - * @param array $links Array of plugin links. - * - * @return array - */ - public function plugin_links( $links ) { + public function plugin_links( array $links ): array { $links[] = '' . esc_html__( 'About', 'meta-box' ) . ''; if ( ! $this->update_checker->has_extensions() ) { $links[] = '' . esc_html__( 'Go Pro', 'meta-box' ) . ''; @@ -58,9 +42,6 @@ public function plugin_links( $links ) { return $links; } - /** - * Register admin page. - */ public function add_menu() { if ( ! $this->has_menu() ) { return; @@ -75,9 +56,6 @@ public function add_menu() { ); } - /** - * Add submenu for the About page. - */ public function add_submenu() { $parent_menu = $this->has_menu() ? 'meta-box' : $this->get_parent_menu(); $about = add_submenu_page( @@ -86,29 +64,15 @@ public function add_submenu() { __( 'Dashboard', 'meta-box' ), 'activate_plugins', 'meta-box', - array( $this, 'render' ) + [ $this, 'render' ] ); - add_action( "load-$about", array( $this, 'load_about' ) ); - } - - /** - * Functions and hooks for about page. - */ - public function load_about() { - $this->enqueue(); - add_filter( 'admin_footer_text', array( $this, 'change_footer_text' ) ); + add_action( "load-$about", [ $this, 'enqueue' ] ); } - /** - * Hide about page from the admin menu. - */ public function hide_page() { remove_submenu_page( $this->get_parent_menu(), 'meta-box' ); } - /** - * Render admin page. - */ public function render() { ?>
@@ -133,6 +97,7 @@ public function render() {
update_checker->has_extensions() ) { include __DIR__ . '/sections/upgrade.php'; } @@ -144,20 +109,9 @@ public function render() { Meta Box ★★★★★ on WordPress.org to help us spread the word. Thank you from the Meta Box team!', 'meta-box' ), 'https://wordpress.org/support/view/plugin-reviews/meta-box?filter=5#new-post' ) ); + wp_enqueue_style( 'meta-box-about', RWMB_URL . 'inc/about/css/about.css', [], RWMB_VER ); + wp_enqueue_script( 'meta-box-about', RWMB_URL . 'inc/about/js/about.js', [ 'jquery' ], RWMB_VER, true ); } /** @@ -179,43 +133,23 @@ public function redirect( $plugin, $network_wide = false ) { die; } - /** - * Get link to the plugin admin menu. - * - * @return string - */ - protected function get_menu_link() { + private function get_menu_link(): string { $menu = $this->has_menu() ? 'admin.php?page=meta-box' : $this->get_parent_menu() . '?page=meta-box'; return admin_url( $menu ); } - /** - * Get default parent menu, which is Plugins. - * - * @return string - */ - protected function get_parent_menu() { + private function get_parent_menu(): string { return 'plugins.php'; } - /** - * Check if the plugin has a top-level admin menu. - * - * @return bool - */ - protected function has_menu() { + private function has_menu(): bool { return apply_filters( 'rwmb_admin_menu', false ); } - /** - * Check if Meta Box is bundled by TGM Activation Class. - * - * @return bool - */ - protected function is_bundled() { + private function is_bundled(): bool { // @codingStandardsIgnoreLine foreach ( $_REQUEST as $key => $value ) { - if ( false !== strpos( $key, 'tgmpa' ) || ( ! is_array( $value ) && false !== strpos( $value, 'tgmpa' ) ) ) { + if ( str_contains( $key, 'tgmpa' ) || ( is_string( $value ) && str_contains( $value, 'tgmpa' ) ) ) { return true; } } diff --git a/vendor/wpmetabox/meta-box/inc/about/css/about.css b/vendor/wpmetabox/meta-box/inc/about/css/about.css index 46a8afa81..dd0e34e30 100644 --- a/vendor/wpmetabox/meta-box/inc/about/css/about.css +++ b/vendor/wpmetabox/meta-box/inc/about/css/about.css @@ -193,4 +193,42 @@ left: 0; width: 100%; height: 100%; -} \ No newline at end of file +} +#getting-started .tutorial a { + font-size: 32px; + font-weight: 600; + color:#32373c; + text-decoration: unset; +} +#getting-started .tutorial a:hover { + color: #2271b1; +} +.tutorial-items{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px 30px; + margin-top: 30px; +} +@media (max-width: 767px) { + .tutorial-items{ + grid-template-columns: repeat(1, 1fr); + gap: 15px 0px; + } +} +.tutorial-items a{ + font-size: 20px; + font-weight: 500; + color:#32373c; + text-decoration: unset; +} +.tutorial-items a:hover{ + color:#2271b1; +} +.tutorial-items a span{ + margin-right: 5px; +} +.tutorial-items a p{ + font-size: 14px; + font-weight: 400; + color:#32373c; +} diff --git a/vendor/wpmetabox/meta-box/inc/about/dashboard.php b/vendor/wpmetabox/meta-box/inc/about/dashboard.php index 2c970d68c..a2c584a17 100644 --- a/vendor/wpmetabox/meta-box/inc/about/dashboard.php +++ b/vendor/wpmetabox/meta-box/inc/about/dashboard.php @@ -5,29 +5,23 @@ class RWMB_Dashboard { private $translations; private $slug; - public function __construct( $feed_url, $link, $translations ) { + public function __construct( string $feed_url, string $link, array $translations ) { $this->feed_url = $feed_url; $this->link = $link; $this->translations = $translations; $this->slug = sanitize_title( $translations['title'] ); $transient_name = $this->get_transient_name(); - add_filter( "transient_$transient_name", array( $this, 'add_news' ) ); - add_action( "wp_ajax_{$this->slug}-dismiss-news", array( $this, 'ajax_dismiss' ) ); + add_filter( "transient_$transient_name", [ $this, 'add_news' ] ); + add_action( "wp_ajax_{$this->slug}-dismiss-news", [ $this, 'ajax_dismiss' ] ); } - private function get_transient_name() { - include ABSPATH . WPINC . '/version.php'; - global $wp_version; - - $locale = function_exists( 'get_user_locale' ) ? get_user_locale() : get_locale(); - $prefix = version_compare( $wp_version, '4.8', '>=') ? 'dash_v2_' : 'dash_'; - $widget_id = 'dashboard_primary'; - - return version_compare( $wp_version, '4.3', '>=' ) ? $prefix . md5( "{$widget_id}_{$locale}" ) : 'dash_' . md5( $widget_id ); + private function get_transient_name() : string { + $locale = get_user_locale(); + return 'dash_v2_' . md5( "dashboard_primary_{$locale}" ); } - public function add_news( $value ) { + public function add_news( string $value ) : string { $is_dismissed = get_user_meta( get_current_user_id(), $this->slug . '_dismiss_news', true ); $is_dismissed = apply_filters( 'rwmb_dismiss_dashboard_widget', $is_dismissed ); if ( $is_dismissed ) { @@ -41,15 +35,15 @@ public function add_news( $value ) { return $value . $this->get_html() . $script; } - private function get_html() { + private function get_html() : string { $cache_key = $this->slug . '-news'; - $output = get_transient( $cache_key ); - if ( false !== $output) { + $output = get_transient( $cache_key ); + if ( false !== $output ) { return $output; } - $feeds = array( - $this->slug => array( + $feeds = [ + $this->slug => [ 'link' => $this->link, 'url' => $this->feed_url, 'title' => $this->translations['title'], @@ -57,13 +51,13 @@ private function get_html() { 'show_summary' => 0, 'show_author' => 0, 'show_date' => 0, - ) - ); + ], + ]; ob_start(); wp_dashboard_primary_output( 'dashboard_primary', $feeds ); - $output = ob_get_clean(); + $output = (string) ob_get_clean(); - $output = preg_replace( '/(.+?)<\/a>/i', '' . esc_html( $this->translations['title'] ) . ': $2', $output ); + $output = (string) preg_replace( '/(.+?)<\/a>/i', '' . esc_html( $this->translations['title'] ) . ': $2', $output ); $output = str_replace( '
  • ', '
  • ', $output ); set_transient( $cache_key, $output, DAY_IN_SECONDS ); @@ -93,4 +87,4 @@ public function ajax_dismiss() { update_user_meta( get_current_user_id(), $this->slug . '_dismiss_news', 1 ); wp_send_json_success(); } -} \ No newline at end of file +} diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php b/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php index 77cc540c3..be8330925 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/extensions.php @@ -1,11 +1,5 @@ - -?>


    diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php index e0bff9ea9..fcf2d66a3 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started-pro.php @@ -1,6 +1,18 @@ + +

    +

    +

    +
    +

    +

    +

    +

    +

    +

    +
    diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php index 85bf11238..a4445c098 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/getting-started.php @@ -1,11 +1,5 @@ - -?>
    diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/products.php b/vendor/wpmetabox/meta-box/inc/about/sections/products.php index feac1cb36..af9264c41 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/products.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/products.php @@ -1,19 +1,13 @@ - +

    - +

    -
    \ No newline at end of file +
    diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/review.php b/vendor/wpmetabox/meta-box/inc/about/sections/review.php new file mode 100644 index 000000000..11942bd60 --- /dev/null +++ b/vendor/wpmetabox/meta-box/inc/about/sections/review.php @@ -0,0 +1,11 @@ + + +
    +

    + +

    +
    +

    +

    +
    +
    diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/support.php b/vendor/wpmetabox/meta-box/inc/about/sections/support.php index d0c7263ed..7efedd944 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/support.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/support.php @@ -1,19 +1,13 @@ - -?>

    array( - 'href' => array(), - ), - ); + $allowed_html = [ + 'a' => [ + 'href' => [], + ], + ]; // Translators: %s - link to documentation. echo wp_kses( sprintf( __( 'Still need help with Meta Box? We offer excellent support for you. But don\'t forget to check our documentation first.', 'meta-box' ), 'https://docs.metabox.io?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ), $allowed_html ); ?> diff --git a/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php b/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php index 45175e24d..f5fb0a378 100644 --- a/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php +++ b/vendor/wpmetabox/meta-box/inc/about/sections/tabs.php @@ -1,11 +1,5 @@ - -?>

    '; + protected static function end_html( array $field ) : string { + return RWMB_Clone::add_clone_button( $field ) . static::input_description( $field ) . '
    '; } - /** - * Display field label description. - * - * @param array $field Field parameters. - * @return string - */ - protected static function label_description( $field ) { + protected static function label_description( array $field ) : string { $id = $field['id'] ? ' id="' . esc_attr( $field['id'] ) . '-label-description"' : ''; return $field['label_description'] ? "{$field['label_description']}

    " : ''; } - /** - * Display field description. - * - * @param array $field Field parameters. - * @return string - */ - protected static function input_description( $field ) { + protected static function input_description( array $field ) : string { $id = $field['id'] ? ' id="' . esc_attr( $field['id'] ) . '-description"' : ''; return $field['desc'] ? "{$field['desc']}

    " : ''; } @@ -161,7 +124,7 @@ protected static function input_description( $field ) { * * @return mixed */ - public static function raw_meta( $object_id, $field, $args = array() ) { + public static function raw_meta( $object_id, $field, $args = [] ) { if ( empty( $field['id'] ) ) { return ''; } @@ -212,11 +175,11 @@ public static function meta( $post_id, $saved, $field ) { $meta = ! $saved || ! $field['save_field'] ? $field['std'] : $meta; if ( $field['clone'] ) { - $meta = RWMB_Helpers_Array::ensure( $meta ); + $meta = Arr::ensure( $meta ); // Ensure $meta is an array with values so that the foreach loop in self::show() runs properly. if ( empty( $meta ) ) { - $meta = array( '' ); + $meta = [ '' ]; } if ( $field['multiple'] ) { @@ -224,10 +187,10 @@ public static function meta( $post_id, $saved, $field ) { // If users set std for a cloneable checkbox list field in the Builder, they can only set [value1, value2]. We need to transform it to [[value1, value2]]. // In other cases, make sure each value is an array. - $meta = is_array( $first ) ? array_map( 'RWMB_Helpers_Array::ensure', $meta ) : array( $meta ); + $meta = is_array( $first ) ? array_map( 'MetaBox\Support\Arr::ensure', $meta ) : [ $meta ]; } } elseif ( $field['multiple'] ) { - $meta = RWMB_Helpers_Array::ensure( $meta ); + $meta = Arr::ensure( $meta ); } return $meta; @@ -240,7 +203,7 @@ public static function meta( $post_id, $saved, $field ) { * @param int $object_id The object ID. * @param array $field The field settings. */ - public static function process_value( $value, $object_id, $field ) { + public static function process_value( $value, $object_id, array $field ) { $old_value = self::call( $field, 'raw_meta', $object_id ); // Allow field class change the value. @@ -319,45 +282,42 @@ public static function save( $new, $old, $post_id, $field ) { public static function normalize( $field ) { // Quick define text fields with "name" attribute only. if ( is_string( $field ) ) { - $field = array( + $field = [ 'name' => $field, 'id' => sanitize_key( $field ), - ); - } - $field = wp_parse_args( - $field, - array( - 'id' => '', - 'name' => '', - 'type' => 'text', - 'label_description' => '', - 'multiple' => false, - 'std' => '', - 'desc' => '', - 'format' => '', - 'before' => '', - 'after' => '', - 'field_name' => isset( $field['id'] ) ? $field['id'] : '', - 'placeholder' => '', - 'save_field' => true, - - 'clone' => false, - 'min_clone' => 0, - 'max_clone' => 0, - 'sort_clone' => false, - 'add_button' => __( '+ Add more', 'meta-box' ), - 'clone_default' => false, - 'clone_as_multiple' => false, - - 'class' => '', - 'disabled' => false, - 'required' => false, - 'autofocus' => false, - 'attributes' => array(), - - 'sanitize_callback' => null, - ) - ); + ]; + } + $field = wp_parse_args( $field, [ + 'id' => '', + 'name' => '', + 'type' => 'text', + 'label_description' => '', + 'multiple' => false, + 'std' => '', + 'desc' => '', + 'format' => '', + 'before' => '', + 'after' => '', + 'field_name' => $field['id'] ?? '', + 'placeholder' => '', + 'save_field' => true, + + 'clone' => false, + 'min_clone' => 0, + 'max_clone' => 0, + 'sort_clone' => false, + 'add_button' => __( '+ Add more', 'meta-box' ), + 'clone_default' => false, + 'clone_as_multiple' => false, + + 'class' => '', + 'disabled' => false, + 'required' => false, + 'autofocus' => false, + 'attributes' => [], + + 'sanitize_callback' => null, + ] ); // Store the original ID to run correct filters for the clonable field. if ( $field['clone'] ) { @@ -365,13 +325,10 @@ public static function normalize( $field ) { } if ( $field['clone_default'] ) { - $field['attributes'] = wp_parse_args( - $field['attributes'], - array( - 'data-default' => $field['std'], - 'data-clone-default' => 'true', - ) - ); + $field['attributes'] = wp_parse_args( $field['attributes'], [ + 'data-default' => $field['std'], + 'data-clone-default' => 'true', + ] ); } if ( 1 === $field['max_clone'] ) { @@ -390,31 +347,29 @@ public static function normalize( $field ) { * @return array */ public static function get_attributes( $field, $value = null ) { - $attributes = wp_parse_args( - $field['attributes'], - array( - 'disabled' => $field['disabled'], - 'autofocus' => $field['autofocus'], - 'required' => $field['required'], - 'id' => $field['id'], - 'class' => '', - 'name' => $field['field_name'], - ) - ); + $attributes = wp_parse_args( $field['attributes'], [ + 'disabled' => $field['disabled'], + 'autofocus' => $field['autofocus'], + 'required' => $field['required'], + 'id' => $field['id'], + 'class' => '', + 'name' => $field['field_name'], + ] ); + + $attributes['class'] = trim( implode( ' ', array_merge( [ "rwmb-{$field['type']}" ], (array) $attributes['class'] ) ) ); - $attributes['class'] = trim( implode( ' ', array_merge( array( "rwmb-{$field['type']}" ), (array) $attributes['class'] ) ) ); + $id = $attributes['id'] ?: $field['id']; + if ( $field['name'] || $field['label_description'] ) { + $attributes['aria-labelledby'] = "$id-label"; + } + if ( $field['desc'] ) { + $attributes['aria-describedby'] = "$id-description"; + } return $attributes; } - /** - * Renders an attribute array into an html attributes string. - * - * @param array $attributes HTML attributes. - * - * @return string - */ - public static function render_attributes( $attributes ) { + public static function render_attributes( array $attributes ) : string { $output = ''; $attributes = array_filter( $attributes, 'RWMB_Helpers_Value::is_valid_for_attribute' ); @@ -438,13 +393,13 @@ public static function render_attributes( $attributes ) { * Each field can extend this function and add more data to the returned value. * See specific field classes for details. * - * @param array $field Field parameters. - * @param array $args Additional arguments. Rarely used. See specific fields for details. - * @param int|null $post_id Post ID. null for current post. Optional. + * @param array $field Field parameters. + * @param array $args Additional arguments. Rarely used. See specific fields for details. + * @param ?int $post_id Post ID. * * @return mixed Field value */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { // Some fields does not have ID like heading, custom HTML, etc. if ( empty( $field['id'] ) ) { return ''; @@ -459,7 +414,7 @@ public static function get_value( $field, $args = array(), $post_id = null ) { // Make sure meta value is an array for cloneable and multiple fields. if ( $field['clone'] || $field['multiple'] ) { - $value = is_array( $value ) && $value ? $value : array(); + $value = is_array( $value ) && ! empty( $value ) ? $value : []; } return $value; @@ -482,7 +437,7 @@ public static function get_value( $field, $args = array(), $post_id = null ) { * * @return string HTML output of the field */ - public static function the_value( $field, $args = array(), $post_id = null ) { + public static function the_value( $field, $args = [], $post_id = null ) { $value = self::call( 'get_value', $field, $args, $post_id ); if ( false === $value ) { @@ -562,15 +517,14 @@ public static function call() { if ( is_string( $check ) ) { $method = array_shift( $args ); $field = reset( $args ); // Keep field as 1st param. - } - // Params: field, method name, other params. - else { + } else { + // Params: field, method name, other params. $field = array_shift( $args ); $method = array_shift( $args ); if ( 'raw_meta' === $method ) { // Add field param after object id. - array_splice( $args, 1, 0, array( $field ) ); + array_splice( $args, 1, 0, [ $field ] ); } else { $args[] = $field; // Add field as last param. } @@ -578,10 +532,10 @@ public static function call() { $class = RWMB_Helpers_Field::get_class( $field ); if ( method_exists( $class, $method ) ) { - return call_user_func_array( array( $class, $method ), $args ); - } else { - _deprecated_function( "$class::$method", '5.4.8' ); + return call_user_func_array( [ $class, $method ], $args ); } + + _deprecated_function( esc_html( "$class::$method" ), '5.4.8' ); } /** @@ -602,10 +556,10 @@ public static function filter() { $field = array_shift( $args ); // List of filters. - $filters = array( + $filters = [ 'rwmb_' . $name, 'rwmb_' . $field['type'] . '_' . $name, - ); + ]; if ( $field['id'] ) { $field_id = $field['clone'] ? $field['_original_id'] : $field['id']; $filters[] = 'rwmb_' . $field_id . '_' . $name; diff --git a/vendor/wpmetabox/meta-box/inc/fields/autocomplete.php b/vendor/wpmetabox/meta-box/inc/fields/autocomplete.php index 746ec59db..902d7c96c 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/autocomplete.php +++ b/vendor/wpmetabox/meta-box/inc/fields/autocomplete.php @@ -1,28 +1,17 @@ __( 'Delete', 'meta-box' ), - ) - ); + RWMB_Helpers_Field::localize_script_once( 'rwmb-autocomplete', 'RWMB_Autocomplete', [ + 'delete' => __( 'Delete', 'meta-box' ), + ] ); } /** @@ -34,19 +23,19 @@ public static function admin_enqueue_scripts() { */ public static function html( $meta, $field ) { if ( ! is_array( $meta ) ) { - $meta = array( $meta ); + $meta = [ $meta ]; } $field = apply_filters( 'rwmb_autocomplete_field', $field, $meta ); $options = $field['options']; if ( is_array( $field['options'] ) ) { - $options = array(); + $options = []; foreach ( $field['options'] as $value => $label ) { - $options[] = array( + $options[] = [ 'value' => $value, 'label' => $label, - ); + ]; } $options = wp_json_encode( $options ); } diff --git a/vendor/wpmetabox/meta-box/inc/fields/background.php b/vendor/wpmetabox/meta-box/inc/fields/background.php index d639f92e3..bb695499c 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/background.php +++ b/vendor/wpmetabox/meta-box/inc/fields/background.php @@ -1,30 +1,21 @@ 'color', - 'id' => "{$field['id']}_color", - 'field_name' => "{$field['field_name']}[color]", - 'alpha_channel' => true, - ) - ); + $color = RWMB_Color_Field::normalize( [ + 'type' => 'color', + 'id' => "{$field['id']}_color", + 'field_name' => "{$field['field_name']}[color]", + 'alpha_channel' => true, + ] ); RWMB_Color_Field::admin_enqueue_scripts( $color ); RWMB_File_Input_Field::admin_enqueue_scripts(); } @@ -38,118 +29,103 @@ public static function admin_enqueue_scripts() { * @return string */ public static function html( $meta, $field ) { - $meta = wp_parse_args( - $meta, - array( - 'color' => '', - 'image' => '', - 'repeat' => '', - 'attachment' => '', - 'position' => '', - 'size' => '', - ) - ); + $meta = wp_parse_args( $meta, [ + 'color' => '', + 'image' => '', + 'repeat' => '', + 'attachment' => '', + 'position' => '', + 'size' => '', + ] ); $output = '
    '; // Color. - $color = RWMB_Color_Field::normalize( - array( - 'type' => 'color', - 'id' => "{$field['id']}_color", - 'field_name' => "{$field['field_name']}[color]", - 'alpha_channel' => true, - ) - ); + $color = RWMB_Color_Field::normalize( [ + 'type' => 'color', + 'id' => "{$field['id']}_color", + 'field_name' => "{$field['field_name']}[color]", + 'alpha_channel' => true, + ] ); $output .= RWMB_Color_Field::html( $meta['color'], $color ); $output .= '
    '; $output .= '
    '; // Image. - $image = RWMB_File_Input_Field::normalize( - array( - 'type' => 'file_input', - 'id' => "{$field['id']}_image", - 'field_name' => "{$field['field_name']}[image]", - 'placeholder' => __( 'Background Image', 'meta-box' ), - ) - ); + $image = RWMB_File_Input_Field::normalize( [ + 'type' => 'file_input', + 'id' => "{$field['id']}_image", + 'field_name' => "{$field['field_name']}[image]", + 'placeholder' => __( 'Background Image', 'meta-box' ), + ] ); $output .= RWMB_File_Input_Field::html( $meta['image'], $image ); $output .= '
    '; $output .= '
    '; // Repeat. - $repeat = RWMB_Select_Field::normalize( - array( - 'type' => 'select', - 'id' => "{$field['id']}_repeat", - 'field_name' => "{$field['field_name']}[repeat]", - 'placeholder' => esc_html__( '-- Repeat --', 'meta-box' ), - 'options' => array( - 'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ), - 'repeat' => esc_html__( 'Repeat All', 'meta-box' ), - 'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ), - 'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ), - 'inherit' => esc_html__( 'Inherit', 'meta-box' ), - ), - ) - ); + $repeat = RWMB_Select_Field::normalize( [ + 'type' => 'select', + 'id' => "{$field['id']}_repeat", + 'field_name' => "{$field['field_name']}[repeat]", + 'placeholder' => esc_html__( '-- Repeat --', 'meta-box' ), + 'options' => [ + 'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ), + 'repeat' => esc_html__( 'Repeat All', 'meta-box' ), + 'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ), + 'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ), + 'inherit' => esc_html__( 'Inherit', 'meta-box' ), + ], + ] ); $output .= RWMB_Select_Field::html( $meta['repeat'], $repeat ); // Position. - $position = RWMB_Select_Field::normalize( - array( - 'type' => 'select', - 'id' => "{$field['id']}_position", - 'field_name' => "{$field['field_name']}[position]", - 'placeholder' => esc_html__( '-- Position --', 'meta-box' ), - 'options' => array( - 'top left' => esc_html__( 'Top Left', 'meta-box' ), - 'top center' => esc_html__( 'Top Center', 'meta-box' ), - 'top right' => esc_html__( 'Top Right', 'meta-box' ), - 'center left' => esc_html__( 'Center Left', 'meta-box' ), - 'center center' => esc_html__( 'Center Center', 'meta-box' ), - 'center right' => esc_html__( 'Center Right', 'meta-box' ), - 'bottom left' => esc_html__( 'Bottom Left', 'meta-box' ), - 'bottom center' => esc_html__( 'Bottom Center', 'meta-box' ), - 'bottom right' => esc_html__( 'Bottom Right', 'meta-box' ), - ), - ) - ); + $position = RWMB_Select_Field::normalize( [ + 'type' => 'select', + 'id' => "{$field['id']}_position", + 'field_name' => "{$field['field_name']}[position]", + 'placeholder' => esc_html__( '-- Position --', 'meta-box' ), + 'options' => [ + 'top left' => esc_html__( 'Top Left', 'meta-box' ), + 'top center' => esc_html__( 'Top Center', 'meta-box' ), + 'top right' => esc_html__( 'Top Right', 'meta-box' ), + 'center left' => esc_html__( 'Center Left', 'meta-box' ), + 'center center' => esc_html__( 'Center Center', 'meta-box' ), + 'center right' => esc_html__( 'Center Right', 'meta-box' ), + 'bottom left' => esc_html__( 'Bottom Left', 'meta-box' ), + 'bottom center' => esc_html__( 'Bottom Center', 'meta-box' ), + 'bottom right' => esc_html__( 'Bottom Right', 'meta-box' ), + ], + ] ); $output .= RWMB_Select_Field::html( $meta['position'], $position ); // Attachment. - $attachment = RWMB_Select_Field::normalize( - array( - 'type' => 'select', - 'id' => "{$field['id']}_attachment", - 'field_name' => "{$field['field_name']}[attachment]", - 'placeholder' => esc_html__( '-- Attachment --', 'meta-box' ), - 'options' => array( - 'fixed' => esc_html__( 'Fixed', 'meta-box' ), - 'scroll' => esc_html__( 'Scroll', 'meta-box' ), - 'inherit' => esc_html__( 'Inherit', 'meta-box' ), - ), - ) - ); + $attachment = RWMB_Select_Field::normalize( [ + 'type' => 'select', + 'id' => "{$field['id']}_attachment", + 'field_name' => "{$field['field_name']}[attachment]", + 'placeholder' => esc_html__( '-- Attachment --', 'meta-box' ), + 'options' => [ + 'fixed' => esc_html__( 'Fixed', 'meta-box' ), + 'scroll' => esc_html__( 'Scroll', 'meta-box' ), + 'inherit' => esc_html__( 'Inherit', 'meta-box' ), + ], + ] ); $output .= RWMB_Select_Field::html( $meta['attachment'], $attachment ); // Size. - $size = RWMB_Select_Field::normalize( - array( - 'type' => 'select', - 'id' => "{$field['id']}_size", - 'field_name' => "{$field['field_name']}[size]", - 'placeholder' => esc_html__( '-- Size --', 'meta-box' ), - 'options' => array( - 'inherit' => esc_html__( 'Inherit', 'meta-box' ), - 'cover' => esc_html__( 'Cover', 'meta-box' ), - 'contain' => esc_html__( 'Contain', 'meta-box' ), - ), - ) - ); + $size = RWMB_Select_Field::normalize( [ + 'type' => 'select', + 'id' => "{$field['id']}_size", + 'field_name' => "{$field['field_name']}[size]", + 'placeholder' => esc_html__( '-- Size --', 'meta-box' ), + 'options' => [ + 'inherit' => esc_html__( 'Inherit', 'meta-box' ), + 'cover' => esc_html__( 'Cover', 'meta-box' ), + 'contain' => esc_html__( 'Contain', 'meta-box' ), + ], + ] ); $output .= RWMB_Select_Field::html( $meta['size'], $size ); $output .= '
    '; diff --git a/vendor/wpmetabox/meta-box/inc/fields/button-group.php b/vendor/wpmetabox/meta-box/inc/fields/button-group.php index beb765b17..399caca79 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/button-group.php +++ b/vendor/wpmetabox/meta-box/inc/fields/button-group.php @@ -1,20 +1,13 @@ ', - $field['inline'] ? ' rwmb-inline' : '' + '
    ', + $field['inline'] ? 'rwmb-inline' : '' ); $output .= $walker->walk( $options, -1 ); - $output .= ''; + $output .= '
    '; return $output; } @@ -47,18 +40,14 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'inline' => null, - ) - ); + $field = wp_parse_args( $field, [ + 'inline' => true, + ] ); $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field; $field = RWMB_Input_Field::normalize( $field ); $field['flatten'] = true; - $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline']; return $field; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/button.php b/vendor/wpmetabox/meta-box/inc/fields/button.php index c98867a36..63d358548 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/button.php +++ b/vendor/wpmetabox/meta-box/inc/fields/button.php @@ -1,12 +1,8 @@ __( 'Click me', 'meta-box' ), - ) - ); + $field = wp_parse_args( $field, [ + 'std' => __( 'Click me', 'meta-box' ), + ] ); $field = parent::normalize( $field ); return $field; } @@ -47,12 +40,9 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'type' => $field['type'], - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'type' => $field['type'], + ] ); $attributes['class'] .= ' button hide-if-no-js'; return $attributes; diff --git a/vendor/wpmetabox/meta-box/inc/fields/checkbox-list.php b/vendor/wpmetabox/meta-box/inc/fields/checkbox-list.php index 81f99a0ae..60581b23e 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/checkbox-list.php +++ b/vendor/wpmetabox/meta-box/inc/fields/checkbox-list.php @@ -1,12 +1,8 @@ true, - 'options' => array(), - ) - ); + $field = wp_parse_args( $field, [ + 'flatten' => true, + 'options' => [], + ] ); // Use callback: function_name format from Meta Box Builder. if ( isset( $field['_callback'] ) && is_callable( $field['_callback'] ) ) { @@ -44,21 +37,14 @@ public static function normalize( $field ) { return $field; } - /** - * Transform field options into the verbose format. - * - * @param array $options Field options. - * - * @return array - */ - public static function transform_options( $options ) { - $transformed = array(); + public static function transform_options( $options ) : array { + $transformed = []; $options = (array) $options; foreach ( $options as $value => $label ) { - $option = is_array( $label ) ? $label : array( + $option = is_array( $label ) ? $label : [ 'label' => (string) $label, 'value' => (string) $value, - ); + ]; if ( isset( $option['label'] ) && isset( $option['value'] ) ) { $transformed[ $option['value'] ] = (object) $option; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/color.php b/vendor/wpmetabox/meta-box/inc/fields/color.php index db8ee4704..c3bf47a7f 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/color.php +++ b/vendor/wpmetabox/meta-box/inc/fields/color.php @@ -1,26 +1,19 @@ false, - 'js_options' => array(), - ) - ); + $field = wp_parse_args( $field, [ + 'alpha_channel' => false, + 'js_options' => [], + ] ); - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'defaultColor' => false, - 'hide' => true, - 'palettes' => true, - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'defaultColor' => false, + 'hide' => true, + 'palettes' => true, + ] ); $field = parent::normalize( $field ); @@ -65,12 +52,9 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'data-options' => wp_json_encode( $field['js_options'] ), - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'data-options' => wp_json_encode( $field['js_options'] ), + ] ); $attributes['type'] = 'text'; if ( $field['alpha_channel'] ) { diff --git a/vendor/wpmetabox/meta-box/inc/fields/custom-html.php b/vendor/wpmetabox/meta-box/inc/fields/custom-html.php index a0a798715..ad39844af 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/custom-html.php +++ b/vendor/wpmetabox/meta-box/inc/fields/custom-html.php @@ -1,12 +1,8 @@ 'j', 'dd' => 'd', 'oo' => 'z', @@ -29,7 +27,7 @@ class RWMB_Datetime_Field extends RWMB_Input_Field { 'y' => 'y', 'yy' => 'Y', 'o' => 'z', - ); + ]; /** * Translate time format from jQuery UI time picker to PHP date(). @@ -38,7 +36,7 @@ class RWMB_Datetime_Field extends RWMB_Input_Field { * * @var array */ - protected static $time_formats = array( + protected static $time_formats = [ 'H' => 'G', 'HH' => 'H', 'h' => 'g', @@ -48,38 +46,38 @@ class RWMB_Datetime_Field extends RWMB_Input_Field { 'l' => 'u', 'tt' => 'a', 'TT' => 'A', - ); + ]; public static function register_assets() { - // jQueryUI base theme: https://github.com/jquery/jquery-ui/tree/1.12.1/themes/base + // jQueryUI base theme: https://github.com/jquery/jquery-ui/tree/1.13.2/themes/base $url = RWMB_CSS_URL . 'jqueryui'; - wp_register_style( 'jquery-ui-core', "$url/core.css", [], '1.12.1' ); - wp_register_style( 'jquery-ui-theme', "$url/theme.css", [], '1.12.1' ); - wp_register_style( 'jquery-ui-datepicker', "$url/datepicker.css", ['jquery-ui-core', 'jquery-ui-theme'], '1.12.1' ); - wp_register_style( 'jquery-ui-slider', "$url/slider.css", ['jquery-ui-core', 'jquery-ui-theme'], '1.12.1' ); + wp_register_style( 'jquery-ui-core', "$url/core.css", [], '1.13.2' ); + wp_register_style( 'jquery-ui-theme', "$url/theme.css", [], '1.13.2' ); + wp_register_style( 'jquery-ui-datepicker', "$url/datepicker.css", [ 'jquery-ui-core', 'jquery-ui-theme' ], '1.13.2' ); + wp_register_style( 'jquery-ui-slider', "$url/slider.css", [ 'jquery-ui-core', 'jquery-ui-theme' ], '1.13.2' ); // jQueryUI timepicker addon: https://github.com/trentrichardson/jQuery-Timepicker-Addon - wp_register_style( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.css", ['rwmb-date', 'jquery-ui-slider'], '1.6.3' ); + wp_register_style( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.css", [ 'rwmb-date', 'jquery-ui-slider' ], '1.6.3' ); - wp_register_style( 'rwmb-date', RWMB_CSS_URL . 'date.css', ['jquery-ui-datepicker'], RWMB_VER ); + wp_register_style( 'rwmb-date', RWMB_CSS_URL . 'date.css', [ 'jquery-ui-datepicker' ], RWMB_VER ); // Scripts. $url = RWMB_JS_URL . 'jqueryui'; - wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '1.6.3', true ); - wp_register_script( 'jquery-ui-timepicker-slider', "$url/jquery-ui-sliderAccess.js", ['jquery-ui-datepicker', 'jquery-ui-slider'], '0.3', true ); - wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", ['jquery-ui-timepicker'], '1.6.3', true ); + wp_register_script( 'jquery-ui-timepicker', "$url/jquery-ui-timepicker-addon.min.js", [ 'jquery-ui-datepicker', 'jquery-ui-slider' ], '1.6.3', true ); + wp_register_script( 'jquery-ui-timepicker-slider', "$url/jquery-ui-sliderAccess.js", [ 'jquery-ui-datepicker', 'jquery-ui-slider' ], '0.3', true ); + wp_register_script( 'jquery-ui-timepicker-i18n', "$url/jquery-ui-timepicker-addon-i18n.min.js", [ 'jquery-ui-timepicker' ], '1.6.3', true ); - wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', ['jquery-ui-datepicker', 'jquery-ui-timepicker-i18n', 'underscore', 'jquery-ui-button', 'jquery-ui-timepicker-slider'], RWMB_VER, true ); - wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', ['jquery-ui-datepicker', 'underscore'], RWMB_VER, true ); - wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', ['jquery-ui-timepicker-i18n', 'jquery-ui-button', 'jquery-ui-timepicker-slider'], RWMB_VER, true ); + wp_register_script( 'rwmb-datetime', RWMB_JS_URL . 'datetime.js', [ 'jquery-ui-datepicker', 'jquery-ui-timepicker-i18n', 'underscore', 'jquery-ui-button', 'jquery-ui-timepicker-slider', 'rwmb' ], RWMB_VER, true ); + wp_register_script( 'rwmb-date', RWMB_JS_URL . 'date.js', [ 'jquery-ui-datepicker', 'underscore', 'rwmb' ], RWMB_VER, true ); + wp_register_script( 'rwmb-time', RWMB_JS_URL . 'time.js', [ 'jquery-ui-timepicker-i18n', 'jquery-ui-button', 'jquery-ui-timepicker-slider', 'rwmb' ], RWMB_VER, true ); - $handles = ['datetime', 'time']; + $handles = [ 'datetime', 'time' ]; $locale = str_replace( '_', '-', get_locale() ); $locale_short = substr( $locale, 0, 2 ); - $data = array( + $data = [ 'locale' => $locale, 'localeShort' => $locale_short, - ); + ]; foreach ( $handles as $handle ) { RWMB_Helpers_Field::localize_script_once( "rwmb-$handle", 'RWMB_' . ucfirst( $handle ), $data ); } @@ -106,19 +104,16 @@ public static function html( $meta, $field ) { $output = ''; if ( $field['timestamp'] ) { - $name = $field['field_name']; - $field = wp_parse_args( - array( - 'field_name' => $name . '[formatted]', - ), - $field - ); - $output .= sprintf( + $name = $field['field_name']; + $field = wp_parse_args( [ 'field_name' => $name . '[formatted]' ], $field ); + $timestamp = $meta['timestamp'] ?? 0; + $output .= sprintf( '', esc_attr( $name . '[timestamp]' ), - isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : '' + (int) $timestamp ); - $meta = isset( $meta['formatted'] ) ? $meta['formatted'] : ''; + + $meta = $meta['formatted'] ?? ''; } $output .= parent::html( $meta, $field ); @@ -144,15 +139,18 @@ public static function value( $new, $old, $post_id, $field ) { if ( $field['timestamp'] ) { if ( is_array( $new ) ) { return $new['timestamp']; - } elseif ( ! is_numeric( $new ) ) { + } + if ( ! is_numeric( $new ) ) { return strtotime( $new ); } return $new; } if ( $field['save_format'] ) { - $date = DateTime::createFromFormat( $field['php_format'], $new ); - $new = false === $date ? $new : $date->format( $field['save_format'] ); + // Fix 'c' and 'r' formats not containing WordPress timezone. + $timezone = in_array( $field['save_format'], [ 'c', 'r' ], true ) ? wp_timezone() : null; + $date = DateTimeImmutable::createFromFormat( $field['php_format'], $new, $timezone ); + return $date === false ? $new : $date->format( $field['save_format'] ); } return $new; @@ -171,11 +169,11 @@ public static function meta( $post_id, $saved, $field ) { $meta = parent::meta( $post_id, $saved, $field ); if ( $field['timestamp'] ) { - return RWMB_Helpers_Array::map( $meta, __CLASS__ . '::from_timestamp', $field ); + return Arr::map( $meta, __CLASS__ . '::from_timestamp', $field ); } if ( $field['save_format'] && $meta ) { - return RWMB_Helpers_Array::map( $meta, __CLASS__ . '::from_save_format', $field ); + return Arr::map( $meta, __CLASS__ . '::from_save_format', $field ); } return $meta; @@ -183,27 +181,29 @@ public static function meta( $post_id, $saved, $field ) { /** * Format meta value if set 'timestamp'. - * - * @param string $meta The meta value. - * @param array $field Field parameters. - * @return array */ - public static function from_timestamp( $meta, $field ) { - return array( - 'timestamp' => $meta ? $meta : null, + public static function from_timestamp( $meta, array $field ): array { + return [ + 'timestamp' => $meta ?: null, 'formatted' => $meta ? gmdate( $field['php_format'], intval( $meta ) ) : '', - ); + ]; } /** * Transform meta value from save format to the JS format. - * - * @param string $meta The meta value. - * @param array $field Field parameters. - * @return array */ - public static function from_save_format( $meta, $field ) { - $date = DateTime::createFromFormat( $field['save_format'], $meta ); + public static function from_save_format( $meta, array $field ): string { + $formats = array_merge( + [ + $field['save_format'] => $field['save_format'], + ], + [ + 'c' => DateTimeInterface::ATOM, + 'r' => DateTimeInterface::RFC2822, + ] + ); + $format = $formats[ $field['save_format'] ]; + $date = DateTimeImmutable::createFromFormat( $format, $meta ); return false === $date ? $meta : $date->format( $field['php_format'] ); } @@ -214,46 +214,34 @@ public static function from_save_format( $meta, $field ) { * @return array */ public static function normalize( $field ) { - $field = wp_parse_args( - $field, - array( - 'timestamp' => false, - 'inline' => false, - 'js_options' => array(), - 'save_format' => '', - 'autocomplete' => 'off', - ) - ); + $field = wp_parse_args( $field, [ + 'timestamp' => false, + 'inline' => false, + 'js_options' => [], + 'save_format' => '', + 'autocomplete' => 'off', + ] ); // Deprecate 'format', but keep it for backward compatible. // Use 'js_options' instead. - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'timeFormat' => 'HH:mm', - 'separator' => ' ', - 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'], - 'showButtonPanel' => true, - 'changeYear' => true, - 'yearRange' => '-100:+100', - 'changeMonth' => true, - 'showButtonPanel' => true, - 'oneLine' => true, - 'controlType' => 'select', // select or slider - 'addSliderAccess' => true, - 'sliderAccessArgs' => [ - 'touchonly' => true, // To show sliderAccess only on touch devices - ], - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'timeFormat' => 'HH:mm', + 'separator' => ' ', + 'dateFormat' => $field['format'] ?? 'yy-mm-dd', + 'showButtonPanel' => true, + 'changeYear' => true, + 'yearRange' => '-100:+100', + 'changeMonth' => true, + 'oneLine' => true, + 'controlType' => 'select', // select or slider + 'addSliderAccess' => true, + 'sliderAccessArgs' => [ + 'touchonly' => true, // To show sliderAccess only on touch devices + ], + ] ); if ( $field['inline'] ) { - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'altFieldTimeOnly' => false, - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ 'altFieldTimeOnly' => false ] ); } $field['php_format'] = static::get_php_format( $field['js_options'] ); @@ -273,12 +261,7 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'data-options' => wp_json_encode( $field['js_options'] ), - ) - ); + $attributes = wp_parse_args( $attributes, [ 'data-options' => wp_json_encode( $field['js_options'] ) ] ); $attributes['type'] = 'text'; return $attributes; @@ -286,13 +269,9 @@ public static function get_attributes( $field, $value = null ) { /** * Returns a date() compatible format string from the JavaScript format. - * * @link http://www.php.net/manual/en/function.date.php - * @param array $js_options JavaScript options. - * - * @return string */ - protected static function get_php_format( $js_options ) { + protected static function get_php_format( array $js_options ): string { return strtr( $js_options['dateFormat'], self::$date_formats ) . $js_options['separator'] . strtr( $js_options['timeFormat'], self::$time_formats ); @@ -312,10 +291,10 @@ public static function format_single_value( $field, $value, $args, $post_id ) { if ( $field['timestamp'] ) { $value = self::from_timestamp( $value, $field ); } else { - $value = array( + $value = [ 'timestamp' => strtotime( $value ), 'formatted' => $value, - ); + ]; } return empty( $args['format'] ) ? $value['formatted'] : gmdate( $args['format'], $value['timestamp'] ); } diff --git a/vendor/wpmetabox/meta-box/inc/fields/divider.php b/vendor/wpmetabox/meta-box/inc/fields/divider.php index 545b6ed53..c8b8a61ee 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/divider.php +++ b/vendor/wpmetabox/meta-box/inc/fields/divider.php @@ -1,43 +1,20 @@ "; } - /** - * Show end HTML markup for fields. - * - * @param mixed $meta Meta value. - * @param array $field Field parameters. - * - * @return string - */ - public static function end_html( $meta, $field ) { + public static function end_html( array $field ) : string { return ''; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php b/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php index 751f3889b..fe9b921e5 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php +++ b/vendor/wpmetabox/meta-box/inc/fields/fieldset-text.php @@ -1,19 +1,12 @@ %s

    '; foreach ( $field['options'] as $key => $label ) { @@ -39,25 +32,11 @@ public static function html( $meta, $field ) { return $out; } - /** - * Do not show field description. - * - * @param array $field Field parameters. - * - * @return string - */ - public static function input_description( $field ) { + protected static function input_description( array $field ) : string { return ''; } - /** - * Do not show field description. - * - * @param array $field Field parameters. - * - * @return string - */ - public static function label_description( $field ) { + protected static function label_description( array $field ) : string { return ''; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/file-input.php b/vendor/wpmetabox/meta-box/inc/fields/file-input.php index c2c055e61..2ce150512 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/file-input.php +++ b/vendor/wpmetabox/meta-box/inc/fields/file-input.php @@ -1,12 +1,8 @@ esc_html__( 'Select File', 'meta-box' ), - ) - ); + wp_enqueue_style( 'rwmb-file-input', RWMB_CSS_URL . 'file-input.css', [], RWMB_VER ); + wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', [ 'jquery' ], RWMB_VER, true ); + RWMB_Helpers_Field::localize_script_once( 'rwmb-file-input', 'rwmbFileInput', [ + 'frameTitle' => esc_html__( 'Select File', 'meta-box' ), + ] ); } /** @@ -47,7 +39,7 @@ public static function html( $meta, $field ) { %s %s
    ', - in_array( $file_ext, $extensions ) ? '' : 'rwmb-file-input-hidden', + in_array( $file_ext, $extensions, true ) ? '' : 'rwmb-file-input-hidden', $meta, self::render_attributes( $attributes ), esc_html__( 'Select', 'meta-box' ), diff --git a/vendor/wpmetabox/meta-box/inc/fields/file-upload.php b/vendor/wpmetabox/meta-box/inc/fields/file-upload.php index f86b53ce4..5c2099806 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/file-upload.php +++ b/vendor/wpmetabox/meta-box/inc/fields/file-upload.php @@ -1,21 +1,14 @@ 0, - ) - ); + $field = wp_parse_args( $field, [ + 'max_file_size' => 0, + ] ); - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'maxFileSize' => $field['max_file_size'], - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'maxFileSize' => $field['max_file_size'], + ] ); return $field; } @@ -49,6 +36,6 @@ public static function normalize( $field ) { */ public static function print_templates() { parent::print_templates(); - require_once RWMB_INC_DIR . 'templates/upload.php'; + require RWMB_INC_DIR . 'templates/upload.php'; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/file.php b/vendor/wpmetabox/meta-box/inc/fields/file.php index e79a8e353..e0f5307f3 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/file.php +++ b/vendor/wpmetabox/meta-box/inc/fields/file.php @@ -1,66 +1,46 @@ . - * - * @package Meta Box - */ +defined( 'ABSPATH' ) || die; /** - * File field class which uses HTML to upload file. + * The file upload file which allows users to upload files via the default HTML . */ class RWMB_File_Field extends RWMB_Field { - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { - wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER ); - wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery-ui-sortable' ), RWMB_VER, true ); - - RWMB_Helpers_Field::localize_script_once( - 'rwmb-file', - 'rwmbFile', - array( - // Translators: %d is the number of files in singular form. - 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ), - // Translators: %d is the number of files in plural form. - 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ), - ) - ); + wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', [], RWMB_VER ); + wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', [ 'jquery-ui-sortable' ], RWMB_VER, true ); + + RWMB_Helpers_Field::localize_script_once( 'rwmb-file', 'rwmbFile', [ + // Translators: %d is the number of files in singular form. + 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ), + // Translators: %d is the number of files in plural form. + 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ), + ] ); } - /** - * Add custom actions. - */ public static function add_actions() { - add_action( 'post_edit_form_tag', array( __CLASS__, 'post_edit_form_tag' ) ); - add_action( 'wp_ajax_rwmb_delete_file', array( __CLASS__, 'ajax_delete_file' ) ); + add_action( 'post_edit_form_tag', [ __CLASS__, 'post_edit_form_tag' ] ); + add_action( 'wp_ajax_rwmb_delete_file', [ __CLASS__, 'ajax_delete_file' ] ); } - /** - * Add data encoding type for file uploading - */ public static function post_edit_form_tag() { echo ' enctype="multipart/form-data"'; } - /** - * Ajax callback for deleting files. - */ public static function ajax_delete_file() { - $request = rwmb_request(); + $request = rwmb_request(); $field_id = (string) $request->filter_post( 'field_id' ); - $type = false !== strpos( $request->filter_post( 'field_name' ), '[' ) ? 'child' : 'top'; + $type = str_contains( $request->filter_post( 'field_name' ), '[' ) ? 'child' : 'top'; check_ajax_referer( "rwmb-delete-file_{$field_id}" ); if ( 'child' === $type ) { $field_group = explode( '[', $request->filter_post( 'field_name' ) ); - $field_id = $field_group[0]; //this is top parent field_id + $field_id = $field_group[0]; // This is top parent field_id. } // Make sure the file to delete is in the custom field. $attachment = $request->post( 'attachment_id' ); $object_id = $request->filter_post( 'object_id' ); $object_type = (string) $request->filter_post( 'object_type' ); - $field = rwmb_get_field_settings( $field_id, array( 'object_type' => $object_type ), $object_id ); + $field = rwmb_get_field_settings( $field_id, [ 'object_type' => $object_type ], $object_id ); $field_value = self::raw_meta( $object_id, $field ); if ( ! self::in_array_r( $attachment, $field_value ) ) { @@ -82,10 +62,8 @@ public static function ajax_delete_file() { /** * Recursively search needle in haystack - * - * @return boolean */ - protected static function in_array_r( $needle, $haystack, $strict = false ) { + protected static function in_array_r( $needle, $haystack, $strict = false ) : bool { foreach ( $haystack as $item ) { if ( ( $strict ? $item === $needle : $item == $needle ) || ( is_array( $item ) && self::in_array_r( $needle, $item, $strict ) ) ) { return true; @@ -153,13 +131,13 @@ public static function html( $meta, $field ) { * @return string */ protected static function get_uploaded_files( $files, $field ) { - $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" ); - $output = ''; + $delete_nonce = wp_create_nonce( "rwmb-delete-file_{$field['id']}" ); + $output = ''; foreach ( (array) $files as $k => $file ) { // Ignore deleted files (if users accidentally deleted files or uses `force_delete` without saving post). if ( get_attached_file( $file ) || $field['upload_dir'] ) { - $output .= self::call( $field, 'file_html', $file, $k ); + $output .= static::file_html( $file, $k, $field ); } } @@ -196,7 +174,7 @@ protected static function file_html( $file, $index, $field ) { $data = self::file_info_custom_dir( $file, $field ); } else { $data = [ - 'icon' => wp_get_attachment_image( $file, [48, 64], true ), + 'icon' => wp_get_attachment_image( $file, [ 48, 64 ], true ), 'name' => basename( get_attached_file( $file ) ), 'url' => wp_get_attachment_url( $file ), 'title' => get_the_title( $file ), @@ -234,25 +212,18 @@ protected static function file_html( $file, $index, $field ) { ); } - /** - * Get file data uploaded to custom directory. - * - * @param string $file URL to uploaded file. - * @param array $field Field settings. - * @return string - */ - protected static function file_info_custom_dir( $file, $field ) { + protected static function file_info_custom_dir( string $file, array $field ) : array { $path = wp_normalize_path( trailingslashit( $field['upload_dir'] ) . basename( $file ) ); $ext = pathinfo( $path, PATHINFO_EXTENSION ); $icon_url = wp_mime_type_icon( wp_ext2type( $ext ) ); - $data = array( + $data = [ 'icon' => '', 'name' => basename( $path ), 'path' => $path, 'url' => $file, 'title' => preg_replace( '/\.[^.]+$/', '', basename( $path ) ), 'edit_link' => '', - ); + ]; return $data; } @@ -267,7 +238,7 @@ protected static function file_info_custom_dir( $file, $field ) { * @return array|mixed */ public static function value( $new, $old, $post_id, $field ) { - $input = isset( $field['index'] ) ? $field['index'] : $field['input_name']; + $input = $field['index'] ?? $field['input_name']; // @codingStandardsIgnoreLine if ( empty( $input ) || empty( $_FILES[ $input ] ) ) { @@ -304,13 +275,12 @@ public static function clone_value( $new, $old, $object_id, $field, $data_source $data_source = $_POST; } - // @codingStandardsIgnoreLine - $indexes = isset( $data_source[ "_index_{$field['id']}" ] ) ? $data_source[ "_index_{$field['id']}" ] : array(); + $indexes = $data_source[ "_index_{$field['id']}" ] ?? []; foreach ( $indexes as $key => $index ) { $field['index'] = $index; - $old_value = isset( $old[ $key ] ) ? $old[ $key ] : array(); - $value = isset( $new[ $key ] ) ? $new[ $key ] : array(); + $old_value = $old[ $key ] ?? []; + $value = $new[ $key ] ?? []; $value = self::value( $value, $old_value, $object_id, $field ); $new[ $key ] = self::filter( 'sanitize', $value, $field, $old_value, $object_id ); } @@ -345,7 +315,7 @@ protected static function transform( $input_name ) { foreach ( $list as $index => $value ) { $file_key = "{$input_name}_{$index}"; if ( ! isset( $_FILES[ $file_key ] ) ) { - $_FILES[ $file_key ] = array(); + $_FILES[ $file_key ] = []; } $_FILES[ $file_key ][ $key ] = $value; } @@ -388,14 +358,14 @@ public static function normalize( $field ) { * * @return mixed Full info of uploaded files */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { $value = parent::get_value( $field, $args, $post_id ); if ( ! $field['clone'] ) { - $value = self::call( 'files_info', $field, $value, $args ); + $value = static::files_info( $field, $value, $args ); } else { - $return = array(); + $return = []; foreach ( $value as $subvalue ) { - $return[] = self::call( 'files_info', $field, $subvalue, $args ); + $return[] = static::files_info( $field, $subvalue, $args ); } $value = $return; } @@ -414,9 +384,9 @@ public static function get_value( $field, $args = array(), $post_id = null ) { * @return array */ public static function files_info( $field, $files, $args ) { - $return = array(); + $return = []; foreach ( (array) $files as $file ) { - $info = self::call( $field, 'file_info', $file, $args ); + $info = static::file_info( $file, $args, $field ); if ( $info ) { $return[ $file ] = $info; } @@ -433,8 +403,8 @@ public static function files_info( $field, $files, $args ) { * * @return array|bool False if file not found. Array of (id, name, path, url) on success. */ - public static function file_info( $file, $args = array(), $field = array() ) { - if ( $field['upload_dir'] ) { + public static function file_info( $file, $args = [], $field = [] ) { + if ( ! empty( $field['upload_dir'] ) ) { return self::file_info_custom_dir( $file, $field ); } @@ -444,13 +414,13 @@ public static function file_info( $file, $args = array(), $field = array() ) { } return wp_parse_args( - array( + [ 'ID' => $file, 'name' => basename( $path ), 'path' => $path, 'url' => wp_get_attachment_url( $file ), 'title' => get_the_title( $file ), - ), + ], wp_get_attachment_metadata( $file ) ); } @@ -498,7 +468,7 @@ public static function handle_upload_custom_dir( $file_id, $field ) { // Make sure upload dir is inside WordPress. $upload_dir = wp_normalize_path( untrailingslashit( $field['upload_dir'] ) ); $root = wp_normalize_path( untrailingslashit( ABSPATH ) ); - if ( 0 !== strpos( $upload_dir, $root ) ) { + if ( ! str_starts_with( $upload_dir, $root ) ) { return; } @@ -514,13 +484,7 @@ public static function handle_upload_custom_dir( $file_id, $field ) { return empty( $file_info['url'] ) ? null : $file_info['url']; } - /** - * Convert a path to an URL. - * - * @param string $path Full path to a file or a directory. - * @return string URL to the file or directory. - */ - public static function convert_path_to_url( $path ) { + public static function convert_path_to_url( string $path ) : string { $path = wp_normalize_path( untrailingslashit( $path ) ); $root = wp_normalize_path( untrailingslashit( ABSPATH ) ); $relative_path = str_replace( $root, '', $path ); diff --git a/vendor/wpmetabox/meta-box/inc/fields/heading.php b/vendor/wpmetabox/meta-box/inc/fields/heading.php index 2b3040246..64beb0862 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/heading.php +++ b/vendor/wpmetabox/meta-box/inc/fields/heading.php @@ -1,43 +1,20 @@ %s', $attributes, $field['name'] ); } - /** - * Show end HTML markup for fields. - * - * @param mixed $meta Meta value. - * @param array $field Field parameters. - * - * @return string - */ - public static function end_html( $meta, $field ) { + protected static function end_html( array $field ) : string { return self::input_description( $field ); } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/image-advanced.php b/vendor/wpmetabox/meta-box/inc/fields/image-advanced.php index 57a4c2b38..77140bd0d 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/image-advanced.php +++ b/vendor/wpmetabox/meta-box/inc/fields/image-advanced.php @@ -1,21 +1,14 @@ 'thumbnail', - ) - ); + $field = wp_parse_args( $field, [ + 'image_size' => 'thumbnail', + ] ); $field = parent::normalize( $field ); - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'imageSize' => $field['image_size'], - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'imageSize' => $field['image_size'], + ] ); return $field; } @@ -51,10 +38,10 @@ public static function normalize( $field ) { * * @param array $field Field parameters. * @param array $args Additional arguments. - * @param null $post_id Post ID. + * @param ?int $post_id Post ID. * @return mixed */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { return RWMB_Image_Field::get_value( $field, $args, $post_id ); } @@ -67,7 +54,7 @@ public static function get_value( $field, $args = array(), $post_id = null ) { * * @return array|bool False if file not found. Array of image info on success. */ - public static function file_info( $file, $args = array(), $field = array() ) { + public static function file_info( $file, $args = [], $field = [] ) { return RWMB_Image_Field::file_info( $file, $args, $field ); } @@ -75,7 +62,7 @@ public static function file_info( $file, $args = array(), $field = array() ) { * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. - * @param string $value The value. + * @param array $value The value. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * @@ -90,6 +77,6 @@ public static function format_single_value( $field, $value, $args, $post_id ) { */ public static function print_templates() { parent::print_templates(); - require_once RWMB_INC_DIR . 'templates/image-advanced.php'; + require RWMB_INC_DIR . 'templates/image-advanced.php'; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/image-select.php b/vendor/wpmetabox/meta-box/inc/fields/image-select.php index 0c942e7b4..12e0e839b 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/image-select.php +++ b/vendor/wpmetabox/meta-box/inc/fields/image-select.php @@ -1,20 +1,13 @@ $image ) { $attributes = self::get_attributes( $field, $value ); - $html[] = sprintf( + $html[] = sprintf( '', $image, self::render_attributes( $attributes ), @@ -48,6 +41,7 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); + $field['options'] = $field['options'] ?? []; $field['field_name'] .= $field['multiple'] ? '[]' : ''; return $field; @@ -61,13 +55,14 @@ public static function normalize( $field ) { * @return array */ public static function get_attributes( $field, $value = null ) { - $attributes = parent::get_attributes( $field, $value ); + $attributes = parent::get_attributes( $field, $value ); $attributes['id'] = false; $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio'; $attributes['value'] = $value; return $attributes; } + /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * diff --git a/vendor/wpmetabox/meta-box/inc/fields/image-upload.php b/vendor/wpmetabox/meta-box/inc/fields/image-upload.php index 7484f1a38..9ecd045e2 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/image-upload.php +++ b/vendor/wpmetabox/meta-box/inc/fields/image-upload.php @@ -1,21 +1,14 @@ . - * - * @package Meta Box - */ +defined( 'ABSPATH' ) || die; /** - * Image field class which uses to upload. + * The image field which uploads images via HTML . */ class RWMB_Image_Field extends RWMB_File_Field { - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { parent::admin_enqueue_scripts(); wp_enqueue_media(); - wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL . 'image.css', array(), RWMB_VER ); + wp_enqueue_style( 'rwmb-image', RWMB_CSS_URL . 'image.css', [], RWMB_VER ); } /** @@ -35,6 +28,8 @@ protected static function file_html( $file, $index, $field ) { $edit_link = sprintf( '', $edit_link ); } + $attachment_image = is_numeric( $file ) ? wp_get_attachment_image( $file, $field['image_size'] ) : ''; + return sprintf( '
  • %s
    @@ -45,7 +40,7 @@ protected static function file_html( $file, $index, $field ) {
  • ', - wp_get_attachment_image( $file, $field['image_size'] ), + $attachment_image, $edit_link, esc_attr( $file ), esc_attr( $attributes['name'] ), @@ -62,19 +57,9 @@ protected static function file_html( $file, $index, $field ) { * @return array */ public static function normalize( $field ) { - $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'image_size' => 'thumbnail', - ) - ); - $field['attributes'] = wp_parse_args( - $field['attributes'], - array( - 'accept' => 'image/*', - ) - ); + $field = parent::normalize( $field ); + $field = wp_parse_args( $field, [ 'image_size' => 'thumbnail' ] ); + $field['attributes'] = wp_parse_args( $field['attributes'], [ 'accept' => 'image/*' ] ); return $field; } @@ -108,21 +93,19 @@ public static function format_single_value( $field, $value, $args, $post_id ) { * * @return array|bool False if file not found. Array of image info on success. */ - public static function file_info( $file, $args = array(), $field = array() ) { + public static function file_info( $file, $args = [], $field = [] ) { $path = get_attached_file( $file ); if ( ! $path ) { return false; } - $args = wp_parse_args( - $args, - array( - 'size' => 'thumbnail', - ) - ); - $image = wp_get_attachment_image_src( $file, $args['size'] ); + $args = wp_parse_args( $args, [ 'size' => 'thumbnail' ] ); + $image = wp_get_attachment_image_src( $file, $args['size'] ); + if ( ! $image ) { + return false; + } $attachment = get_post( $file ); - $info = array( + $info = [ 'ID' => $file, 'name' => basename( $path ), 'path' => $path, @@ -132,7 +115,7 @@ public static function file_info( $file, $args = array(), $field = array() ) { 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, 'alt' => get_post_meta( $file, '_wp_attachment_image_alt', true ), - ); + ]; if ( function_exists( 'wp_get_attachment_image_srcset' ) ) { $info['srcset'] = wp_get_attachment_image_srcset( $file, $args['size'] ); } @@ -158,7 +141,7 @@ protected static function get_image_meta_data( $attachment_id ) { return $metadata; } - $dir_url = dirname( wp_get_attachment_url( $attachment_id ) ); + $dir_url = dirname( wp_get_attachment_url( $attachment_id ) ); foreach ( $metadata['sizes'] as &$size ) { $size['url'] = "{$dir_url}/{$size['file']}"; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/input-list.php b/vendor/wpmetabox/meta-box/inc/fields/input-list.php index 4531bc648..52f977380 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/input-list.php +++ b/vendor/wpmetabox/meta-box/inc/fields/input-list.php @@ -1,20 +1,13 @@ ', + '
    ', $field['collapse'] ? ' rwmb-collapse' : '', $field['inline'] ? ' rwmb-inline' : '' ); $output .= $walker->walk( $options, $field['flatten'] ? -1 : 0 ); - $output .= ''; + $output .= '
    '; return $output; } @@ -49,14 +42,11 @@ public static function normalize( $field ) { $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field; $field = RWMB_Input_Field::normalize( $field ); $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'collapse' => true, - 'inline' => null, - 'select_all_none' => false, - ) - ); + $field = wp_parse_args( $field, [ + 'collapse' => true, + 'inline' => null, + 'select_all_none' => false, + ] ); $field['flatten'] = $field['multiple'] ? $field['flatten'] : true; $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline']; diff --git a/vendor/wpmetabox/meta-box/inc/fields/input.php b/vendor/wpmetabox/meta-box/inc/fields/input.php index 03060f1e7..1d5440f52 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/input.php +++ b/vendor/wpmetabox/meta-box/inc/fields/input.php @@ -1,19 +1,12 @@ fields. - * - * @package Meta Box - */ +defined( 'ABSPATH' ) || die; /** - * Abstract input field class. + * The abstract input field which is used for all fields. */ abstract class RWMB_Input_Field extends RWMB_Field { - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { - wp_enqueue_style( 'rwmb-input', RWMB_CSS_URL . 'input.css', '', RWMB_VER ); + wp_enqueue_style( 'rwmb-input', RWMB_CSS_URL . 'input.css', [], RWMB_VER ); } /** @@ -34,11 +27,11 @@ public static function html( $meta, $field ) { $output .= '' . $field['prepend'] . ''; } - $attributes = self::call( 'get_attributes', $field, $meta ); + $attributes = static::get_attributes( $field, $meta ); $output .= sprintf( '%s', self::render_attributes( $attributes ), self::datalist( $field ) ); if ( $field['append'] ) { - $output .= '' . $field['append']. ''; + $output .= '' . $field['append'] . ''; } if ( $field['prepend'] || $field['append'] ) { @@ -56,27 +49,21 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'autocomplete' => false, - 'datalist' => false, - 'readonly' => false, - 'maxlength' => false, - 'minlength' => false, - 'pattern' => false, - 'prepend' => '', - 'append' => '', - ) - ); + $field = wp_parse_args( $field, [ + 'autocomplete' => false, + 'datalist' => false, + 'readonly' => false, + 'maxlength' => false, + 'minlength' => false, + 'pattern' => false, + 'prepend' => '', + 'append' => '', + ] ); if ( $field['datalist'] ) { - $field['datalist'] = wp_parse_args( - $field['datalist'], - array( - 'id' => $field['id'] . '_list', - 'options' => array(), - ) - ); + $field['datalist'] = wp_parse_args( $field['datalist'], [ + 'id' => $field['id'] . '_list', + 'options' => [], + ] ); } return $field; } @@ -90,20 +77,17 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'autocomplete' => $field['autocomplete'], - 'list' => $field['datalist'] ? $field['datalist']['id'] : false, - 'readonly' => $field['readonly'], - 'maxlength' => $field['maxlength'], - 'minlength' => $field['minlength'], - 'pattern' => $field['pattern'], - 'value' => $value, - 'placeholder' => $field['placeholder'], - 'type' => $field['type'], - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'autocomplete' => $field['autocomplete'], + 'list' => $field['datalist'] ? $field['datalist']['id'] : false, + 'readonly' => $field['readonly'], + 'maxlength' => $field['maxlength'], + 'minlength' => $field['minlength'], + 'pattern' => $field['pattern'], + 'value' => $value, + 'placeholder' => $field['placeholder'], + 'type' => $field['type'], + ] ); if ( isset( $field['size'] ) ) { $attributes['size'] = $field['size']; } @@ -111,13 +95,7 @@ public static function get_attributes( $field, $value = null ) { return $attributes; } - /** - * Create datalist, if any. - * - * @param array $field Field parameters. - * @return string - */ - protected static function datalist( $field ) { + protected static function datalist( array $field ) : string { if ( empty( $field['datalist'] ) ) { return ''; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/key-value.php b/vendor/wpmetabox/meta-box/inc/fields/key-value.php index 50dbf7c47..7fe4baaaa 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/key-value.php +++ b/vendor/wpmetabox/meta-box/inc/fields/key-value.php @@ -1,16 +1,12 @@ {$field['desc']}

    " : ''; if ( empty( $field['name'] ) ) { @@ -64,14 +52,7 @@ public static function begin_html( $meta, $field ) { ); } - /** - * Do not show field description. - * - * @param array $field Field parameters. - * - * @return string - */ - public static function input_description( $field ) { + protected static function input_description( array $field ) : string { return ''; } @@ -108,13 +89,10 @@ public static function normalize( $field ) { $field = parent::normalize( $field ); $field['attributes']['type'] = 'text'; - $field['placeholder'] = wp_parse_args( - (array) $field['placeholder'], - array( - 'key' => __( 'Key', 'meta-box' ), - 'value' => __( 'Value', 'meta-box' ), - ) - ); + $field['placeholder'] = wp_parse_args( (array) $field['placeholder'], [ + 'key' => __( 'Key', 'meta-box' ), + 'value' => __( 'Value', 'meta-box' ), + ] ); return $field; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/map.php b/vendor/wpmetabox/meta-box/inc/fields/map.php index 83b032632..8b33365cb 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/map.php +++ b/vendor/wpmetabox/meta-box/inc/fields/map.php @@ -1,61 +1,32 @@ $field['api_key'], - 'language' => $field['language'], - 'libraries' => 'places' - ), - 'https://maps.google.com/maps/api/js' - ); + $google_maps_url = add_query_arg( [ + 'key' => $field['api_key'], + 'language' => $field['language'], + 'libraries' => 'places', + ], 'https://maps.google.com/maps/api/js' ); /** * Allows developers load more libraries via a filter. - * * @link https://developers.google.com/maps/documentation/javascript/libraries */ $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url ); - wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true ); - wp_enqueue_script( - 'rwmb-map', - RWMB_JS_URL . 'map.js', - array( - 'jquery-ui-autocomplete', - 'google-maps', - ), - RWMB_VER, - true - ); - RWMB_Helpers_Field::localize_script_once( - 'rwmb-map', - 'RWMB_Map', - array( - 'no_results_string' => __( 'No results found', 'meta-box' ), - ) - ); + + wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), [], RWMB_VER, true ); + wp_enqueue_script( 'rwmb-map', RWMB_JS_URL . 'map.js', [ 'jquery-ui-autocomplete', 'google-maps' ], RWMB_VER, true ); + RWMB_Helpers_Field::localize_script_once( 'rwmb-map', 'RWMB_Map', [ + 'no_results_string' => __( 'No results found', 'meta-box' ), + ] ); } /** @@ -99,19 +70,16 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'std' => '', - 'address_field' => '', - 'language' => '', - 'region' => '', - - // Default API key, required by Google Maps since June 2016. - // Users should overwrite this key with their own key. - 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ', - ) - ); + $field = wp_parse_args( $field, [ + 'std' => '', + 'address_field' => '', + 'language' => '', + 'region' => '', + + // Default API key, required by Google Maps since June 2016. + // Users should overwrite this key with their own key. + 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ', + ] ); return $field; } @@ -127,7 +95,7 @@ public static function normalize( $field ) { * * @return mixed Array(latitude, longitude, zoom) */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { $value = parent::get_value( $field, $args, $post_id ); list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' ); return compact( 'latitude', 'longitude', 'zoom' ); @@ -143,49 +111,43 @@ public static function get_value( $field, $args = array(), $post_id = null ) { * * @return string HTML output of the field */ - public static function the_value( $field, $args = array(), $post_id = null ) { + public static function the_value( $field, $args = [], $post_id = null ) { $value = parent::get_value( $field, $args, $post_id ); - $args = wp_parse_args( - $args, - array( - 'api_key' => isset( $field['api_key'] ) ? $field['api_key'] : '', - ) - ); + $args = wp_parse_args( $args, [ + 'api_key' => $field['api_key'] ?? '', + ] ); return self::render_map( $value, $args ); } /** * Render a map in the frontend. * - * @param array $location The [latitude, longitude[, zoom]] location. - * @param array $args Additional arguments for the map. + * @param string $location The "latitude,longitude[,zoom]" location. + * @param array $args Additional arguments for the map. * * @return string */ - public static function render_map( $location, $args = array() ) { + public static function render_map( $location, $args = [] ) { list( $latitude, $longitude, $zoom ) = explode( ',', $location . ',,' ); if ( ! $latitude || ! $longitude ) { return ''; } - $args = wp_parse_args( - $args, - array( - 'latitude' => $latitude, - 'longitude' => $longitude, - 'width' => '100%', - 'height' => '480px', - 'marker' => true, // Display marker? - 'marker_title' => '', // Marker title, when hover. - 'info_window' => '', // Content of info window (when click on marker). HTML allowed. - 'js_options' => array(), - 'zoom' => $zoom, - - // Default API key, required by Google Maps since June 2016. - // Users should overwrite this key with their own key. - 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ', - ) - ); + $args = wp_parse_args( $args, [ + 'latitude' => $latitude, + 'longitude' => $longitude, + 'width' => '100%', + 'height' => '480px', + 'marker' => true, // Display marker? + 'marker_title' => '', // Marker title, when hover. + 'info_window' => '', // Content of info window (when click on marker). HTML allowed. + 'js_options' => [], + 'zoom' => $zoom, + + // Default API key, required by Google Maps since June 2016. + // Users should overwrite this key with their own key. + 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ', + ] ); $google_maps_url = add_query_arg( 'key', $args['api_key'], 'https://maps.google.com/maps/api/js' ); @@ -194,8 +156,8 @@ public static function render_map( $location, $args = array() ) { * @link https://developers.google.com/maps/documentation/javascript/libraries */ $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url ); - wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true ); - wp_enqueue_script( 'rwmb-map-frontend', RWMB_JS_URL . 'map-frontend.js', array( 'google-maps', 'jquery' ), RWMB_VER, true ); + wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), [], RWMB_VER, true ); + wp_enqueue_script( 'rwmb-map-frontend', RWMB_JS_URL . 'map-frontend.js', [ 'google-maps', 'jquery' ], RWMB_VER, true ); /* * Google Maps options. @@ -203,19 +165,16 @@ public static function render_map( $location, $args = array() ) { * This array will be convert to Javascript Object and pass as map options. * @link https://developers.google.com/maps/documentation/javascript/reference */ - $args['js_options'] = wp_parse_args( - $args['js_options'], - array( - // Default to 'zoom' level set in admin, but can be overwritten. - 'zoom' => $args['zoom'], - - // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId. - 'mapTypeId' => 'ROADMAP', - - // Open Info Window - 'openInfoWindow' => false, - ) - ); + $args['js_options'] = wp_parse_args( $args['js_options'], [ + // Default to 'zoom' level set in admin, but can be overwritten. + 'zoom' => $args['zoom'], + + // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId. + 'mapTypeId' => 'ROADMAP', + + // Open Info Window + 'openInfoWindow' => false, + ] ); $output = sprintf( '
    ', diff --git a/vendor/wpmetabox/meta-box/inc/fields/media.php b/vendor/wpmetabox/meta-box/inc/fields/media.php index 113fe0a9f..a0c3d22bb 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/media.php +++ b/vendor/wpmetabox/meta-box/inc/fields/media.php @@ -1,54 +1,38 @@ apply_filters( 'rwmb_media_add_string', _x( '+ Add Media', 'media', 'meta-box' ) ), - 'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ), - 'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ), - 'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ), - 'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ), - 'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ), - 'noTitle' => _x( 'No Title', 'media', 'meta-box' ), - 'loadingUrl' => admin_url( 'images/spinner.gif' ), - 'extensions' => self::get_mime_extensions(), - 'select' => apply_filters( 'rwmb_media_select_string', _x( 'Select Files', 'media', 'meta-box' ) ), - 'or' => apply_filters( 'rwmb_media_or_string', _x( 'or', 'media', 'meta-box' ) ), - 'uploadInstructions' => apply_filters( 'rwmb_media_upload_instructions_string', _x( 'Drop files here to upload', 'media', 'meta-box' ) ), - ) - ); + wp_enqueue_style( 'rwmb-media', RWMB_CSS_URL . 'media.css', [], RWMB_VER ); + wp_enqueue_script( 'rwmb-media', RWMB_JS_URL . 'media.js', [ 'jquery-ui-sortable', 'underscore', 'backbone', 'media-grid' ], RWMB_VER, true ); + + RWMB_Helpers_Field::localize_script_once( 'rwmb-media', 'i18nRwmbMedia', [ + 'add' => apply_filters( 'rwmb_media_add_string', _x( '+ Add Media', 'media', 'meta-box' ) ), + 'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ), + 'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ), + 'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ), + 'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ), + 'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ), + 'noTitle' => _x( 'No Title', 'media', 'meta-box' ), + 'loadingUrl' => admin_url( 'images/spinner.gif' ), + 'extensions' => static::get_mime_extensions(), + 'select' => apply_filters( 'rwmb_media_select_string', _x( 'Select Files', 'media', 'meta-box' ) ), + 'or' => apply_filters( 'rwmb_media_or_string', _x( 'or', 'media', 'meta-box' ) ), + 'uploadInstructions' => apply_filters( 'rwmb_media_upload_instructions_string', _x( 'Drop files here to upload', 'media', 'meta-box' ) ), + ] ); } - /** - * Add actions. - */ public static function add_actions() { - $args = func_get_args(); - $field = reset( $args ); - add_action( 'print_media_templates', array( RWMB_Helpers_Field::get_class( $field ), 'print_templates' ) ); + add_action( 'print_media_templates', [ get_called_class(), 'print_templates' ] ); } /** @@ -89,7 +73,7 @@ public static function meta( $post_id, $saved, $field ) { * @return string */ public static function html( $meta, $field ) { - $attributes = self::call( 'get_attributes', $field, $meta ); + $attributes = static::get_attributes( $field, $meta ); $html = sprintf( '', @@ -109,29 +93,23 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'std' => array(), - 'mime_type' => '', - 'max_file_uploads' => 0, - 'force_delete' => false, - 'max_status' => true, - 'js_options' => array(), - 'add_to' => 'end', - ) - ); - - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'mimeType' => $field['mime_type'], - 'maxFiles' => $field['max_file_uploads'], - 'forceDelete' => $field['force_delete'] ? true : false, - 'maxStatus' => $field['max_status'], - 'addTo' => $field['add_to'], - ) - ); + $field = wp_parse_args( $field, [ + 'std' => [], + 'mime_type' => '', + 'max_file_uploads' => 0, + 'force_delete' => false, + 'max_status' => true, + 'js_options' => [], + 'add_to' => 'end', + ] ); + + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'mimeType' => $field['mime_type'], + 'maxFiles' => $field['max_file_uploads'], + 'forceDelete' => $field['force_delete'], + 'maxStatus' => $field['max_status'], + 'addTo' => $field['add_to'], + ] ); $field['multiple'] = true; @@ -157,38 +135,26 @@ public static function get_attributes( $field, $value = null ) { $attributes['class'] .= ' rwmb-media'; // Add attachment details. - $attachments = array(); - foreach ( $value as $media ) { - $media = wp_prepare_attachment_for_js( $media ); - // Some themes/plugins add HTML, shortcodes to "compat" attrbute which break JSON validity. - if ( isset( $media['compat'] ) ) { - unset( $media['compat'] ); - } - if ( ! empty( $media ) ) { - $attachments[] = $media; - } + $attachments = array_values( array_filter( array_map( 'wp_prepare_attachment_for_js', $value ) ) ); + $attributes['data-attachments'] = wp_json_encode( $attachments ); + + if ( empty( $attachments ) ) { + unset( $attributes['value'] ); } - $attachments = array_values( $attachments ); - $attributes['data-attachments'] = json_encode( $attachments ); return $attributes; } - /** - * Get supported mime extensions. - * - * @return array - */ - protected static function get_mime_extensions() { + protected static function get_mime_extensions() : array { $mime_types = wp_get_mime_types(); - $extensions = array(); + $extensions = []; foreach ( $mime_types as $ext => $mime ) { $ext = explode( '|', $ext ); $extensions[ $mime ] = $ext; $mime_parts = explode( '/', $mime ); if ( empty( $extensions[ $mime_parts[0] ] ) ) { - $extensions[ $mime_parts[0] ] = array(); + $extensions[ $mime_parts[0] ] = []; } $extensions[ $mime_parts[0] ] = array_merge( $extensions[ $mime_parts[0] ], $ext ); $extensions[ $mime_parts[0] . '/*' ] = $extensions[ $mime_parts[0] ]; @@ -205,11 +171,21 @@ protected static function get_mime_extensions() { * @param int $post_id The post ID. * @param array $field The field parameters. * - * @return array|mixed + * @return array */ public static function value( $new, $old, $post_id, $field ) { - $new = RWMB_Helpers_Array::from_csv( $new ); - return array_filter( array_unique( array_map( 'absint', $new ) ) ); + $new = wp_parse_id_list( $new ); + + if ( empty( $new ) ) { + return []; + } + + // Attach the uploaded images to the post if needed. + global $wpdb; + $ids = implode( ',', $new ); + $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->posts SET post_parent=%d WHERE post_parent=0 AND ID IN ($ids)", $post_id ) ); + + return $new; } /** @@ -226,13 +202,13 @@ public static function save( $new, $old, $post_id, $field ) { } $storage = $field['storage']; $storage->delete( $post_id, $field['id'] ); - parent::save( $new, array(), $post_id, $field ); + parent::save( $new, [], $post_id, $field ); } /** * Template for media item. */ public static function print_templates() { - require_once RWMB_INC_DIR . 'templates/media.php'; + require RWMB_INC_DIR . 'templates/media.php'; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/multiple-values.php b/vendor/wpmetabox/meta-box/inc/fields/multiple-values.php index e69544cb1..4307ea7a5 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/multiple-values.php +++ b/vendor/wpmetabox/meta-box/inc/fields/multiple-values.php @@ -1,4 +1,6 @@ . - * - * @package Meta Box - */ +defined( 'ABSPATH' ) || die; /** - * Number field class. + * The number field which uses HTML . */ class RWMB_Number_Field extends RWMB_Input_Field { /** @@ -18,15 +14,11 @@ class RWMB_Number_Field extends RWMB_Input_Field { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - - $field = wp_parse_args( - $field, - array( - 'step' => 1, - 'min' => 0, - 'max' => false, - ) - ); + $field = wp_parse_args( $field, [ + 'step' => 1, + 'min' => 0, + 'max' => false, + ] ); return $field; } @@ -41,14 +33,11 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'step' => $field['step'], - 'max' => $field['max'], - 'min' => $field['min'], - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'step' => $field['step'], + 'max' => $field['max'], + 'min' => $field['min'], + ] ); return $attributes; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/object-choice.php b/vendor/wpmetabox/meta-box/inc/fields/object-choice.php index 14cb69960..c79effaac 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/object-choice.php +++ b/vendor/wpmetabox/meta-box/inc/fields/object-choice.php @@ -1,12 +1,10 @@ true, - 'query_args' => array(), - 'field_type' => 'select_advanced', - 'add_new' => false, - 'ajax' => true, - ) - ); + $field = wp_parse_args( $field, [ + 'flatten' => true, + 'query_args' => [], + 'field_type' => 'select_advanced', + 'add_new' => false, + 'ajax' => true, + ] ); if ( 'select_advanced' !== $field['field_type'] ) { $field['ajax'] = false; } @@ -86,7 +77,7 @@ public static function normalize( $field ) { if ( 'radio_list' === $field['field_type'] ) { $field['field_type'] = 'radio'; } - $field = call_user_func( array( self::get_type_class( $field ), 'normalize' ), $field ); + $field = call_user_func( [ self::get_type_class( $field ), 'normalize' ], $field ); return $field; } @@ -102,22 +93,22 @@ protected static function set_ajax_params( &$field ) { } if ( empty( $field['js_options']['ajax'] ) ) { - $field['js_options']['ajax'] = array(); + $field['js_options']['ajax'] = []; } $field['js_options']['ajax'] = wp_parse_args( - array( + [ 'url' => admin_url( 'admin-ajax.php' ), - ), + ], $field['js_options']['ajax'] ); - $field['js_options']['ajax_data'] = array( - 'field' => array( + $field['js_options']['ajax_data'] = [ + 'field' => [ 'id' => $field['id'], 'type' => $field['type'], 'query_args' => $field['query_args'], - ), + ], '_wpnonce' => wp_create_nonce( 'query' ), - ); + ]; } /** @@ -129,7 +120,7 @@ protected static function set_ajax_params( &$field ) { * @return array */ public static function get_attributes( $field, $value = null ) { - $attributes = call_user_func( array( self::get_type_class( $field ), 'get_attributes' ), $field, $value ); + $attributes = call_user_func( [ self::get_type_class( $field ), 'get_attributes' ], $field, $value ); if ( 'select_advanced' === $field['field_type'] ) { $attributes['class'] .= ' rwmb-select_advanced'; } elseif ( 'select' === $field['field_type'] ) { @@ -138,27 +129,29 @@ public static function get_attributes( $field, $value = null ) { return $attributes; } - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { RWMB_Input_List_Field::admin_enqueue_scripts(); RWMB_Select_Field::admin_enqueue_scripts(); RWMB_Select_Tree_Field::admin_enqueue_scripts(); RWMB_Select_Advanced_Field::admin_enqueue_scripts(); + + // Field is the 1st param. + $field = func_get_arg( 0 ); + if ( empty( $field['add_new'] ) ) { + return; + } + + wp_enqueue_style( 'rwmb-modal', RWMB_CSS_URL . 'modal.css', [], RWMB_VER ); + wp_enqueue_script( 'rwmb-modal', RWMB_JS_URL . 'modal.js', [ 'jquery' ], RWMB_VER, true ); + + $type = $field['type'] === 'taxonomy_advanced' ? 'taxonomy' : $field['type']; + wp_enqueue_script( "rwmb-$type", RWMB_JS_URL . "$type.js", [ 'jquery', 'rwmb-modal' ], RWMB_VER, true ); } /** * Get correct rendering class for the field. - * - * @param array $field Field parameters. - * @return string */ - protected static function get_type_class( $field ) { - return RWMB_Helpers_Field::get_class( - array( - 'type' => $field['field_type'], - ) - ); + protected static function get_type_class( array $field ) : string { + return RWMB_Helpers_Field::get_class( [ 'type' => $field['field_type'] ] ); } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/oembed.php b/vendor/wpmetabox/meta-box/inc/fields/oembed.php index e77bbf83d..192cf0c36 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/oembed.php +++ b/vendor/wpmetabox/meta-box/inc/fields/oembed.php @@ -1,12 +1,8 @@ __( 'Embed HTML not available.', 'meta-box' ), - ) - ); - $field['attributes'] = wp_parse_args( - $field['attributes'], - array( - 'data-not-available' => $field['not_available_string'], - ) - ); + $field = wp_parse_args( $field, [ + 'not_available_string' => __( 'Embed HTML not available.', 'meta-box' ), + ] ); + $field['attributes'] = wp_parse_args( $field['attributes'], [ + 'data-not-available' => $field['not_available_string'], + ] ); return $field; } - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { - wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css', '', RWMB_VER ); - wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', array( 'jquery', 'underscore' ), RWMB_VER, true ); + wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css', [], RWMB_VER ); + wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', [ 'jquery', 'underscore', 'rwmb' ], RWMB_VER, true ); + wp_localize_script( 'rwmb-oembed', 'rwmbOembed', [ + 'nonce' => wp_create_nonce( 'oembed_get' ), + ] ); } - /** - * Add actions. - */ public static function add_actions() { - add_action( 'wp_ajax_rwmb_get_embed', array( __CLASS__, 'wp_ajax_get_embed' ) ); + add_action( 'wp_ajax_rwmb_get_embed', [ __CLASS__, 'ajax_get_embed' ] ); } - /** - * Ajax callback for returning oEmbed HTML. - */ - public static function wp_ajax_get_embed() { + public static function ajax_get_embed() { + check_ajax_referer( 'oembed_get' ); + $request = rwmb_request(); $url = (string) $request->filter_post( 'url', FILTER_SANITIZE_URL ); $not_available = (string) $request->post( 'not_available' ); @@ -76,7 +62,7 @@ public static function get_embed( $url, $not_available = '' ) { * @see WP_Embed::shortcode() * @see wp_embed_defaults() */ - $args = array(); + $args = []; if ( is_admin() ) { $args['width'] = 360; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/osm.php b/vendor/wpmetabox/meta-box/inc/fields/osm.php index 2fd01f1ab..55e840b49 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/osm.php +++ b/vendor/wpmetabox/meta-box/inc/fields/osm.php @@ -1,33 +1,19 @@ __( 'No results found', 'meta-box' ), - ) - ); + self::enqueue_map_assets(); + + wp_enqueue_style( 'rwmb-osm', RWMB_CSS_URL . 'osm.css', [ 'leaflet' ], RWMB_VER ); + wp_enqueue_script( 'rwmb-osm', RWMB_JS_URL . 'osm.js', [ 'jquery', 'jquery-ui-autocomplete', 'leaflet' ], RWMB_VER, true ); + + RWMB_Helpers_Field::localize_script_once( 'rwmb-osm', 'RWMB_Osm', [ + 'no_results_string' => __( 'No results found', 'meta-box' ), + ] ); } /** @@ -72,15 +58,12 @@ public static function html( $meta, $field ) { */ public static function normalize( $field ) { $field = parent::normalize( $field ); - $field = wp_parse_args( - $field, - array( - 'std' => '', - 'address_field' => '', - 'language' => '', - 'region' => '', - ) - ); + $field = wp_parse_args( $field, [ + 'std' => '', + 'address_field' => '', + 'language' => '', + 'region' => '', + ] ); return $field; } @@ -96,7 +79,7 @@ public static function normalize( $field ) { * * @return mixed Array(latitude, longitude, zoom) */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { $value = parent::get_value( $field, $args, $post_id ); list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' ); return compact( 'latitude', 'longitude', 'zoom' ); @@ -112,7 +95,7 @@ public static function get_value( $field, $args = array(), $post_id = null ) { * * @return string HTML output of the field */ - public static function the_value( $field, $args = array(), $post_id = null ) { + public static function the_value( $field, $args = [], $post_id = null ) { $value = parent::get_value( $field, $args, $post_id ); return self::render_map( $value, $args ); } @@ -120,47 +103,41 @@ public static function the_value( $field, $args = array(), $post_id = null ) { /** * Render a map in the frontend. * - * @param array $location The [latitude, longitude[, zoom]] location. - * @param array $args Additional arguments for the map. + * @param string $location The "latitude,longitude[,zoom]" location. + * @param array $args Additional arguments for the map. * * @return string */ - public static function render_map( $location, $args = array() ) { + public static function render_map( $location, $args = [] ) { list( $latitude, $longitude, $zoom ) = explode( ',', $location . ',,' ); if ( ! $latitude || ! $longitude ) { return ''; } - $args = wp_parse_args( - $args, - array( - 'latitude' => $latitude, - 'longitude' => $longitude, - 'width' => '100%', - 'height' => '480px', - 'marker' => true, // Display marker? - 'marker_title' => '', // Marker title, when hover. - 'info_window' => '', // Content of info window (when click on marker). HTML allowed. - 'js_options' => array(), - 'zoom' => $zoom, - ) - ); - - wp_enqueue_style( 'leaflet', 'https://unpkg.com/leaflet@1.5.1/dist/leaflet.css', array(), '1.5.1' ); - wp_enqueue_script( 'leaflet', 'https://unpkg.com/leaflet@1.5.1/dist/leaflet.js', array(), '1.5.1', true ); - wp_enqueue_script( 'rwmb-osm-frontend', RWMB_JS_URL . 'osm-frontend.js', array( 'jquery', 'leaflet' ), RWMB_VER, true ); + $args = wp_parse_args( $args, [ + 'latitude' => $latitude, + 'longitude' => $longitude, + 'width' => '100%', + 'height' => '480px', + 'marker' => true, // Display marker? + 'marker_title' => '', // Marker title, when hover. + 'info_window' => '', // Content of info window (when click on marker). HTML allowed. + 'js_options' => [], + 'zoom' => $zoom, + ] ); + + self::enqueue_map_assets(); + wp_enqueue_script( 'rwmb-osm-frontend', RWMB_JS_URL . 'osm-frontend.js', [ 'jquery', 'leaflet' ], RWMB_VER, true ); + wp_enqueue_style( 'rwmb-osm-frontend', RWMB_CSS_URL . 'osm-frontend.css', [], RWMB_VER ); /* * More Open Street Map options * @link https://leafletjs.com/reference-1.5.0.html#map-option */ - $args['js_options'] = wp_parse_args( - $args['js_options'], - array( - // Default to 'zoom' level set in admin, but can be overwritten. - 'zoom' => $args['zoom'], - ) - ); + $args['js_options'] = wp_parse_args( $args['js_options'], [ + // Default to 'zoom' level set in admin, but can be overwritten. + 'zoom' => $args['zoom'], + ] ); $output = sprintf( '
    ', @@ -170,4 +147,9 @@ public static function render_map( $location, $args = array() ) { ); return $output; } + + private static function enqueue_map_assets() { + wp_enqueue_style( 'leaflet', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.css', [], '1.9.4' ); + wp_enqueue_script( 'leaflet', 'https://unpkg.com/leaflet@1.9.4/dist/leaflet.js', [], '1.9.4', true ); + } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/password.php b/vendor/wpmetabox/meta-box/inc/fields/password.php index 3dec35242..0cc729e1e 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/password.php +++ b/vendor/wpmetabox/meta-box/inc/fields/password.php @@ -1,12 +1,8 @@ $items ); + $items = apply_filters( 'rwmb_ajax_get_posts', $items, $field, $request ); + + $data = [ 'items' => $items ]; // More items for pagination. $limit = (int) $field['query_args']['posts_per_page']; @@ -61,14 +53,11 @@ public static function ajax_get_posts() { * @return array */ public static function normalize( $field ) { - $field = wp_parse_args( - $field, - array( - 'post_type' => 'post', - 'parent' => false, - 'query_args' => array(), - ) - ); + $field = wp_parse_args( $field, [ + 'post_type' => 'post', + 'parent' => false, + 'query_args' => [], + ] ); $field['post_type'] = (array) $field['post_type']; @@ -82,16 +71,13 @@ public static function normalize( $field ) { $post_type = reset( $field['post_type'] ); $post_type_object = get_post_type_object( $post_type ); if ( ! empty( $post_type_object ) ) { - // Translators: %s is the taxonomy singular label. + // Translators: %s is the post singular label. $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $post_type_object->labels->singular_name ) ); } } - $field = wp_parse_args( - $field, - array( - 'placeholder' => $placeholder, - ) - ); + $field = wp_parse_args( $field, [ + 'placeholder' => $placeholder, + ] ); // Set parent option, which will change field name to `parent_id` to save as post parent. if ( $field['parent'] ) { @@ -103,36 +89,26 @@ public static function normalize( $field ) { // Set default query args. $posts_per_page = $field['ajax'] ? 10 : -1; - $field['query_args'] = wp_parse_args( - $field['query_args'], - array( - 'post_type' => $field['post_type'], - 'post_status' => 'publish', - 'posts_per_page' => $posts_per_page, - ) - ); + $field['query_args'] = wp_parse_args( $field['query_args'], [ + 'post_type' => $field['post_type'], + 'post_status' => 'publish', + 'posts_per_page' => $posts_per_page, + ] ); parent::set_ajax_params( $field ); return $field; } - /** - * Query posts for field options. - * - * @param array $meta Saved meta value. - * @param array $field Field settings. - * @return array Field options array. - */ - public static function query( $meta, $field ) { - $args = wp_parse_args( - $field['query_args'], - array( - 'no_found_rows' => true, - 'update_post_meta_cache' => false, - 'update_post_term_cache' => false, - ) - ); + public static function query( $meta, array $field ): array { + $args = wp_parse_args( $field['query_args'], [ + 'no_found_rows' => true, + 'update_post_meta_cache' => false, + 'update_post_term_cache' => false, + 'mb_field_id' => $field['id'], + ] ); + + $meta = wp_parse_id_list( (array) $meta ); // Query only selected items. if ( ! empty( $field['ajax'] ) && ! empty( $meta ) ) { @@ -155,15 +131,15 @@ public static function query( $meta, $field ) { $query = new WP_Query( $args ); remove_filter( 'posts_search', [ __CLASS__, 'search_by_title' ] ); - $options = array(); + $options = []; foreach ( $query->posts as $post ) { $label = $post->post_title ? $post->post_title : __( '(No title)', 'meta-box' ); $label = self::filter( 'choice_label', $label, $field, $post ); - $options[ $post->ID ] = array( + $options[ $post->ID ] = [ 'value' => $post->ID, 'label' => $label, 'parent' => $post->post_parent, - ); + ]; } // Cache the query. @@ -185,7 +161,7 @@ public static function search_by_title( $search, $wp_query ) { } $q = $wp_query->query_vars; $n = ! empty( $q['exact'] ) ? '' : '%'; - $search = array(); + $search = []; foreach ( (array) $q['search_terms'] as $term ) { $term = esc_sql( $wpdb->esc_like( $term ) ); $search[] = "($wpdb->posts.post_title LIKE '{$n}{$term}{$n}')"; @@ -220,10 +196,10 @@ public static function meta( $post_id, $saved, $field ) { /** * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * - * @param array $field Field parameters. - * @param string $value The value. - * @param array $args Additional arguments. Rarely used. See specific fields for details. - * @param ?int $post_id Post ID. null for current post. Optional. + * @param array $field Field parameters. + * @param int $value The value. + * @param array $args Additional arguments. Rarely used. See specific fields for details. + * @param ?int $post_id Post ID. null for current post. Optional. * * @return string */ @@ -232,19 +208,40 @@ public static function format_single_value( $field, $value, $args, $post_id ) { return ''; } - $link = isset( $args['link'] ) ? $args['link'] : 'view'; + $link = $args['link'] ?? 'view'; $text = get_the_title( $value ); if ( false === $link ) { return $text; } - if ( 'view' === $link ) { - $url = get_permalink( $value ); - } + $url = get_permalink( $value ); if ( 'edit' === $link ) { $url = get_edit_post_link( $value ); } return sprintf( '%s', esc_url( $url ), wp_kses_post( $text ) ); } + + public static function add_new_form( array $field ): string { + if ( ! current_user_can( 'edit_posts' ) ) { + return ''; + } + + if ( 1 !== count( $field['post_type'] ) ) { + return ''; + } + + $post_type = reset( $field['post_type'] ); + if ( ! post_type_exists( $post_type ) ) { + return ''; + } + + $post_type_object = get_post_type_object( $post_type ); + + return sprintf( + '%s', + admin_url( $post_type === 'post' ? 'post-new.php' : 'post-new.php?post_type=' . $post_type ), + esc_html( $post_type_object->labels->add_new_item ) + ); + } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/radio.php b/vendor/wpmetabox/meta-box/inc/fields/radio.php index 0b56de1c4..0ec35bcba 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/radio.php +++ b/vendor/wpmetabox/meta-box/inc/fields/radio.php @@ -1,20 +1,10 @@ 10, - ) - ); + $field = wp_parse_args( $field, [ + 'max' => 10, + ] ); $field = parent::normalize( $field ); return $field; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php b/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php index ef09bedc4..83d728180 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php +++ b/vendor/wpmetabox/meta-box/inc/fields/select-advanced.php @@ -1,36 +1,32 @@ is_admin(), + ]); } /** @@ -40,25 +36,19 @@ public static function admin_enqueue_scripts() { * @return array */ public static function normalize( $field ) { - $field = wp_parse_args( - $field, - array( - 'js_options' => array(), - 'placeholder' => __( 'Select an item', 'meta-box' ), - ) - ); + $field = wp_parse_args( $field, [ + 'js_options' => [], + 'placeholder' => __( 'Select an item', 'meta-box' ), + ] ); $field = parent::normalize( $field ); - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'allowClear' => true, - 'dropdownAutoWidth' => true, - 'placeholder' => $field['placeholder'], - 'width' => 'style', - ) - ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'allowClear' => true, + 'dropdownAutoWidth' => true, + 'placeholder' => $field['placeholder'], + 'width' => 'style', + ] ); return $field; } @@ -72,12 +62,9 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'data-options' => wp_json_encode( $field['js_options'] ), - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'data-options' => wp_json_encode( $field['js_options'] ), + ] ); return $attributes; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/select-tree.php b/vendor/wpmetabox/meta-box/inc/fields/select-tree.php index ceb3ad343..9bcce29ad 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/select-tree.php +++ b/vendor/wpmetabox/meta-box/inc/fields/select-tree.php @@ -1,12 +1,8 @@ walk( $options ) : ''; } - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { parent::admin_enqueue_scripts(); - wp_enqueue_style( 'rwmb-select-tree', RWMB_CSS_URL . 'select-tree.css', array( 'rwmb-select' ), RWMB_VER ); - wp_enqueue_script( 'rwmb-select-tree', RWMB_JS_URL . 'select-tree.js', array( 'rwmb-select' ), RWMB_VER, true ); + wp_enqueue_style( 'rwmb-select-tree', RWMB_CSS_URL . 'select-tree.css', [ 'rwmb-select' ], RWMB_VER ); + wp_enqueue_script( 'rwmb-select-tree', RWMB_JS_URL . 'select-tree.js', [ 'rwmb-select' ], RWMB_VER, true ); } /** diff --git a/vendor/wpmetabox/meta-box/inc/fields/select.php b/vendor/wpmetabox/meta-box/inc/fields/select.php index d72dea28d..05c88f167 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/select.php +++ b/vendor/wpmetabox/meta-box/inc/fields/select.php @@ -1,20 +1,13 @@ false, - ) - ); + $field = wp_parse_args( $field, [ + 'select_all_none' => false, + ] ); return $field; } @@ -71,12 +61,9 @@ public static function normalize( $field ) { */ public static function get_attributes( $field, $value = null ) { $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'multiple' => $field['multiple'], - ) - ); + $attributes = wp_parse_args( $attributes, [ + 'multiple' => $field['multiple'], + ] ); return $attributes; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/sidebar.php b/vendor/wpmetabox/meta-box/inc/fields/sidebar.php index 946d8dc6b..77a9672d7 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/sidebar.php +++ b/vendor/wpmetabox/meta-box/inc/fields/sidebar.php @@ -1,48 +1,28 @@ __( 'Select a sidebar', 'meta-box' ), - ) - ); + $field = wp_parse_args( $field, [ + 'placeholder' => __( 'Select a sidebar', 'meta-box' ), + ] ); $field = parent::normalize( $field ); return $field; } - /** - * Get sidebars for field options. - * - * @param array $field Field settings. - * @return array Field options array. - */ - public static function query( $field ) { + public static function query( $meta, array $field ) : array { global $wp_registered_sidebars; - $options = array(); + $options = []; foreach ( $wp_registered_sidebars as $sidebar ) { - $options[ $sidebar['id'] ] = array( + $options[ $sidebar['id'] ] = [ 'value' => $sidebar['id'], 'label' => $sidebar['name'], - ); + ]; } return $options; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/single-image.php b/vendor/wpmetabox/meta-box/inc/fields/single-image.php index 4ff05f1de..8aafe1b65 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/single-image.php +++ b/vendor/wpmetabox/meta-box/inc/fields/single-image.php @@ -1,12 +1,8 @@ '', - 'data-single-image' => 1, - ) - ); + $field['attributes'] = wp_parse_args( $field['attributes'], [ + 'class' => '', + 'data-single-image' => 1, + ] ); $field['attributes']['class'] .= ' rwmb-image_advanced'; $field['multiple'] = false; @@ -59,14 +52,14 @@ public static function value( $new, $old, $post_id, $field ) { * * @return mixed Full info of uploaded files */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { $value = RWMB_Field::get_value( $field, $args, $post_id ); if ( ! is_array( $value ) ) { return RWMB_Image_Field::file_info( $value, $args, $field ); } - $return = array(); + $return = []; foreach ( $value as $image_id ) { $return[] = RWMB_Image_Field::file_info( $image_id, $args, $field ); } diff --git a/vendor/wpmetabox/meta-box/inc/fields/slider.php b/vendor/wpmetabox/meta-box/inc/fields/slider.php index 41c850d71..2987078b7 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/slider.php +++ b/vendor/wpmetabox/meta-box/inc/fields/slider.php @@ -1,25 +1,18 @@ '', - 'suffix' => '', - 'std' => '', - 'js_options' => array(), - ) - ); - $field['js_options'] = wp_parse_args( - $field['js_options'], - array( - 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI. - 'value' => $field['std'], - ) - ); + $field = wp_parse_args( $field, [ + 'prefix' => '', + 'suffix' => '', + 'std' => '', + 'js_options' => [], + ] ); + $field['js_options'] = wp_parse_args( $field['js_options'], [ + 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI. + 'value' => $field['std'], + ] ); return $field; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/switch.php b/vendor/wpmetabox/meta-box/inc/fields/switch.php index 83c7cdf3e..18bb79dbf 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/switch.php +++ b/vendor/wpmetabox/meta-box/inc/fields/switch.php @@ -1,19 +1,12 @@ 'rounded', - 'on_label' => '', - 'off_label' => '', - ) - ); + $field = wp_parse_args( $field, [ + 'style' => 'rounded', + 'on_label' => '', + 'off_label' => '', + ] ); return $field; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/taxonomy-advanced.php b/vendor/wpmetabox/meta-box/inc/fields/taxonomy-advanced.php index 008582b74..8f6bb6d01 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/taxonomy-advanced.php +++ b/vendor/wpmetabox/meta-box/inc/fields/taxonomy-advanced.php @@ -1,12 +1,8 @@ $term_ids, - 'hide_empty' => false, - ), - $args - ); + $args = wp_parse_args( [ + 'include' => $term_ids, + 'hide_empty' => false, + ], $args ); $info = get_terms( $field['taxonomy'], $args ); - $info = is_array( $info ) ? $info : array(); + $info = is_array( $info ) ? $info : []; return $field['multiple'] ? $info : reset( $info ); } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php b/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php index b1304b64d..5cb654642 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php +++ b/vendor/wpmetabox/meta-box/inc/fields/taxonomy.php @@ -1,25 +1,15 @@ filter_post( 'term' ); // Pagination. - $limit = isset( $field['query_args']['number'] ) ? (int) $field['query_args']['number'] : 0; + $limit = $field['query_args']['number'] ?? 0; + $limit = (int) $limit; if ( 'query:append' === $request->filter_post( '_type' ) ) { $page = $request->filter_post( 'page', FILTER_SANITIZE_NUMBER_INT ); $field['query_args']['offset'] = $limit * ( $page - 1 ); @@ -45,7 +36,9 @@ public static function ajax_get_terms() { $items = self::query( null, $field ); $items = array_values( $items ); - $data = array( 'items' => $items ); + $items = apply_filters( 'rwmb_ajax_get_terms', $items, $field, $request ); + + $data = [ 'items' => $items ]; // More items for pagination. if ( $limit && count( $items ) === $limit ) { @@ -74,14 +67,11 @@ public static function normalize( $field ) { } // Set default field args. - $field = wp_parse_args( - $field, - array( - 'taxonomy' => 'category', - 'query_args' => array(), - 'remove_default' => false, - ) - ); + $field = wp_parse_args( $field, [ + 'taxonomy' => 'category', + 'query_args' => [], + 'remove_default' => false, + ] ); // Force taxonomy to be an array. $field['taxonomy'] = (array) $field['taxonomy']; @@ -97,24 +87,18 @@ public static function normalize( $field ) { // Translators: %s is the taxonomy singular label. $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $taxonomy_name ) ); } - $field = wp_parse_args( - $field, - array( - 'placeholder' => $placeholder, - ) - ); + $field = wp_parse_args( $field, [ + 'placeholder' => $placeholder, + ] ); $field = parent::normalize( $field ); // Set default query args. $limit = $field['ajax'] ? 10 : 0; - $field['query_args'] = wp_parse_args( - $field['query_args'], - array( - 'taxonomy' => $field['taxonomy'], - 'number' => $limit, - ) - ); + $field['query_args'] = wp_parse_args( $field['query_args'], [ + 'taxonomy' => $field['taxonomy'], + 'number' => $limit, + ] ); parent::set_ajax_params( $field ); @@ -126,22 +110,14 @@ public static function normalize( $field ) { return $field; } - /** - * Query terms for field options. - * - * @param array $meta Saved meta value. - * @param array $field Field settings. - * @return array Field options array. - */ - public static function query( $meta, $field ) { - $args = wp_parse_args( - $field['query_args'], - array( - 'hide_empty' => false, - 'count' => false, - 'update_term_meta_cache' => false, - ) - ); + public static function query( $meta, array $field ): array { + $args = wp_parse_args( $field['query_args'], [ + 'hide_empty' => false, + 'count' => false, + 'update_term_meta_cache' => false, + ] ); + + $meta = wp_parse_id_list( (array) $meta ); // Query only selected items. if ( ! empty( $field['ajax'] ) && ! empty( $meta ) ) { @@ -150,17 +126,18 @@ public static function query( $meta, $field ) { $terms = get_terms( $args ); if ( ! is_array( $terms ) ) { - return array(); + return []; } - $options = array(); + $options = []; foreach ( $terms as $term ) { $label = $term->name ? $term->name : __( '(No title)', 'meta-box' ); $label = self::filter( 'choice_label', $label, $field, $term ); - $options[ $term->term_id ] = array( + + $options[ $term->term_id ] = [ 'value' => $term->term_id, 'label' => $label, 'parent' => $term->parent, - ); + ]; } return $options; } @@ -178,7 +155,7 @@ public static function query( $meta, $field ) { public static function value( $new, $old, $post_id, $field ) { $new = (array) $new; $new[] = self::add_term( $field ); - $new = array_unique( array_map( 'intval', array_filter( $new ) ) ); + $new = array_filter( wp_parse_id_list( $new ) ); return $new; } @@ -218,7 +195,7 @@ protected static function add_term( $field ) { if ( is_wp_error( $term ) ) { return null; } - return isset( $term['term_id'] ) ? $term['term_id'] : null; + return $term['term_id'] ?? null; } /** @@ -230,21 +207,14 @@ protected static function add_term( $field ) { * * @return mixed */ - public static function raw_meta( $object_id, $field, $args = array() ) { + public static function raw_meta( $object_id, $field, $args = [] ) { if ( empty( $field['id'] ) ) { return ''; } - $meta = wp_get_object_terms( - $object_id, - $field['taxonomy'], - array( - 'orderby' => 'term_order', - ) - ); - if ( is_wp_error( $meta ) ) { - return ''; - } + $meta = wp_get_object_terms( $object_id, $field['taxonomy'], [ + 'orderby' => 'term_order', + ] ); $meta = wp_list_pluck( $meta, 'term_id' ); return $field['multiple'] ? $meta : reset( $meta ); @@ -254,38 +224,34 @@ public static function raw_meta( $object_id, $field, $args = array() ) { * Get the field value. * Return list of post term objects. * - * @param array $field Field parameters. - * @param array $args Additional arguments. - * @param int|null $post_id Post ID. null for current post. Optional. + * @param array $field Field parameters. + * @param array $args Additional arguments. + * @param ?int $post_id Post ID. * * @return array List of post term objects. */ - public static function get_value( $field, $args = array(), $post_id = null ) { + public static function get_value( $field, $args = [], $post_id = null ) { if ( ! $post_id ) { $post_id = get_the_ID(); } - $value = wp_get_object_terms( - $post_id, - $field['taxonomy'], - array( - 'orderby' => 'term_order', - ) - ); + $value = wp_get_object_terms( $post_id, $field['taxonomy'], [ + 'orderby' => 'term_order', + ] ); // Get single value if necessary. - if ( ! $field['clone'] && ! $field['multiple'] && is_array( $value ) ) { + if ( ! $field['clone'] && ! $field['multiple'] ) { $value = reset( $value ); } return $value; } /** - * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. + * Format a single value for the helper functions. * - * @param array $field Field parameters. - * @param object|array $value The value. - * @param array $args Additional arguments. Rarely used. See specific fields for details. - * @param ?int $post_id Post ID. null for current post. Optional. + * @param array $field Field parameters. + * @param WP_Term $value The term object. + * @param array $args Additional arguments. Rarely used. See specific fields for details. + * @param ?int $post_id Post ID. null for current post. Optional. * * @return string */ @@ -294,15 +260,13 @@ public static function format_single_value( $field, $value, $args, $post_id ) { return ''; } - $link = isset( $args['link'] ) ? $args['link'] : 'view'; + $link = $args['link'] ?? 'view'; $text = $value->name; if ( false === $link ) { return $text; } - if ( 'view' === $link ) { - $url = get_term_link( $value ); - } + $url = get_term_link( $value ); if ( 'edit' === $link ) { $url = get_edit_term_link( $value ); } @@ -310,13 +274,11 @@ public static function format_single_value( $field, $value, $args, $post_id ) { return sprintf( '%s', esc_url( $url ), esc_html( $text ) ); } - /** - * Render "Add New" form - * - * @param array $field Field settings. - * @return string - */ - public static function add_new_form( $field ) { + public static function add_new_form( array $field ): string { + if ( ! current_user_can( 'edit_posts' ) ) { + return ''; + } + // Only add new term if field has only one taxonomy. if ( 1 !== count( $field['taxonomy'] ) ) { return ''; @@ -328,45 +290,21 @@ public static function add_new_form( $field ) { return ''; } - $html = ' -
    - -
    - -
    -
    '; - - $html = sprintf( - $html, - esc_html( $taxonomy_object->labels->add_new_item ), - esc_attr( $field['id'] ), - esc_attr( $taxonomy_object->labels->new_item_name ) + return sprintf( + '%s', + admin_url( 'edit-tags.php?taxonomy=' . $taxonomy_object->name ), + esc_html( $taxonomy_object->labels->add_new_item ) ); - - return $html; } - /** - * Enqueue scripts and styles. - */ public static function admin_enqueue_scripts() { - parent::admin_enqueue_scripts(); - wp_enqueue_style( 'rwmb-taxonomy', RWMB_CSS_URL . 'taxonomy.css', array(), RWMB_VER ); - wp_enqueue_script( 'rwmb-taxonomy', RWMB_JS_URL . 'taxonomy.js', array( 'jquery' ), RWMB_VER, true ); - - // Field is the 1st param. - $args = func_get_args(); - $field = $args[0]; - self::remove_default_meta_box( $field ); + $field = func_get_arg( 0 ); + parent::admin_enqueue_scripts( $field ); + static::remove_default_meta_box( $field ); } - /** - * Remove default WordPress taxonomy meta box. - * - * @param array $field Field settings. - */ - protected static function remove_default_meta_box( $field ) { - if ( empty( $field['remove_default'] ) || ! is_admin() || ! function_exists( 'remove_meta_box' ) ) { + protected static function remove_default_meta_box( array $field ) { + if ( empty( $field['remove_default'] ) || ! function_exists( 'remove_meta_box' ) ) { return; } foreach ( $field['taxonomy'] as $taxonomy ) { @@ -375,13 +313,7 @@ protected static function remove_default_meta_box( $field ) { } } - /** - * Get taxonomy singular name. - * - * @param array $field Field settings. - * @return string - */ - protected static function get_taxonomy_singular_name( $field ) { + protected static function get_taxonomy_singular_name( array $field ): string { if ( 1 !== count( $field['taxonomy'] ) ) { return ''; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/text-list.php b/vendor/wpmetabox/meta-box/inc/fields/text-list.php index aff77557e..010bde480 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/text-list.php +++ b/vendor/wpmetabox/meta-box/inc/fields/text-list.php @@ -1,19 +1,12 @@ %s '; - $attributes = self::get_attributes( $field, $meta ); + $attributes = self::get_attributes( $field, $meta ); $attributes['type'] = 'text'; $count = 0; foreach ( $field['options'] as $placeholder => $label ) { - $attributes['value'] = isset( $meta[ $count ] ) ? esc_attr( $meta[ $count ] ) : ''; + $attributes['value'] = $meta[ $count ] ?? ''; $attributes['placeholder'] = $placeholder; $html[] = sprintf( @@ -78,7 +71,7 @@ public static function normalize( $field ) { */ public static function value( $new, $old, $post_id, $field ) { $filtered = array_filter( $new ); - return count( $filtered ) ? $new : array(); + return count( $filtered ) ? $new : []; } /** diff --git a/vendor/wpmetabox/meta-box/inc/fields/textarea.php b/vendor/wpmetabox/meta-box/inc/fields/textarea.php index e672cc3a2..b0c2ca44d 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/textarea.php +++ b/vendor/wpmetabox/meta-box/inc/fields/textarea.php @@ -1,12 +1,8 @@ false, - 'cols' => false, - 'rows' => 3, - 'maxlength' => false, - 'minlength' => false, - 'wrap' => false, - 'readonly' => false, - ) - ); + $field = wp_parse_args( $field, [ + 'autocomplete' => false, + 'cols' => false, + 'rows' => 3, + 'maxlength' => false, + 'minlength' => false, + 'wrap' => false, + 'readonly' => false, + ] ); return $field; } @@ -59,20 +52,17 @@ public static function normalize( $field ) { * @return array */ public static function get_attributes( $field, $value = null ) { - $attributes = parent::get_attributes( $field, $value ); - $attributes = wp_parse_args( - $attributes, - array( - 'autocomplete' => $field['autocomplete'], - 'cols' => $field['cols'], - 'rows' => $field['rows'], - 'maxlength' => $field['maxlength'], - 'minlength' => $field['minlength'], - 'wrap' => $field['wrap'], - 'readonly' => $field['readonly'], - 'placeholder' => $field['placeholder'], - ) - ); + $attributes = parent::get_attributes( $field, $value ); + $attributes = wp_parse_args( $attributes, [ + 'autocomplete' => $field['autocomplete'], + 'cols' => $field['cols'], + 'rows' => $field['rows'], + 'maxlength' => $field['maxlength'], + 'minlength' => $field['minlength'], + 'wrap' => $field['wrap'], + 'readonly' => $field['readonly'], + 'placeholder' => $field['placeholder'], + ] ); return $attributes; } diff --git a/vendor/wpmetabox/meta-box/inc/fields/time.php b/vendor/wpmetabox/meta-box/inc/fields/time.php index c4877f6d7..2654a9cc4 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/time.php +++ b/vendor/wpmetabox/meta-box/inc/fields/time.php @@ -1,17 +1,10 @@ filter_post( '_type' ) ) { $field['query_args']['paged'] = $request->filter_post( 'page', FILTER_SANITIZE_NUMBER_INT ); } @@ -48,7 +39,9 @@ public static function ajax_get_users() { $items = self::query( null, $field ); $items = array_values( $items ); - $data = array( 'items' => $items ); + $items = apply_filters( 'rwmb_ajax_get_users', $items, $field, $request ); + + $data = [ 'items' => $items ]; // More items for pagination. if ( $limit && count( $items ) === $limit ) { @@ -78,25 +71,19 @@ public static function update_cache() { */ public static function normalize( $field ) { // Set default field args. - $field = wp_parse_args( - $field, - array( - 'placeholder' => __( 'Select a user', 'meta-box' ), - 'query_args' => array(), - 'display_field' => 'display_name', - ) - ); + $field = wp_parse_args( $field, [ + 'placeholder' => __( 'Select a user', 'meta-box' ), + 'query_args' => [], + 'display_field' => 'display_name', + ] ); $field = parent::normalize( $field ); // Set default query args. $limit = $field['ajax'] ? 10 : 0; - $field['query_args'] = wp_parse_args( - $field['query_args'], - array( - 'number' => $limit, - ) - ); + $field['query_args'] = wp_parse_args( $field['query_args'], [ + 'number' => $limit, + ] ); parent::set_ajax_params( $field ); @@ -107,22 +94,25 @@ public static function normalize( $field ) { return $field; } - /** - * Query users for field options. - * - * @param array $meta Saved meta value. - * @param array $field Field settings. - * @return array Field options array. - */ - public static function query( $meta, $field ) { + public static function query( $meta, array $field ): array { $display_field = $field['display_field']; - $args = wp_parse_args( - $field['query_args'], - array( - 'orderby' => $display_field, - 'order' => 'asc', - ) - ); + $args = wp_parse_args( $field['query_args'], [ + 'orderby' => $display_field, + 'order' => 'asc', + 'fields' => [ + 'ID', + 'user_login', + 'user_pass', + 'user_nicename', + 'user_email', + 'user_url', + 'user_registered', + 'user_status', + 'display_name', + ], + ] ); + + $meta = wp_parse_id_list( (array) $meta ); // Query only selected items. if ( ! empty( $field['ajax'] ) && ! empty( $meta ) ) { @@ -139,14 +129,15 @@ public static function query( $meta, $field ) { } $users = get_users( $args ); - $options = array(); + $options = []; foreach ( $users as $user ) { $label = $user->$display_field ? $user->$display_field : __( '(No title)', 'meta-box' ); $label = self::filter( 'choice_label', $label, $field, $user ); - $options[ $user->ID ] = array( + + $options[ $user->ID ] = [ 'value' => $user->ID, 'label' => $label, - ); + ]; } // Cache the query. @@ -159,7 +150,7 @@ public static function query( $meta, $field ) { * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary. * * @param array $field Field parameters. - * @param string $value The value. + * @param int $value User ID. * @param array $args Additional arguments. Rarely used. See specific fields for details. * @param int|null $post_id Post ID. null for current post. Optional. * @@ -170,7 +161,7 @@ public static function format_single_value( $field, $value, $args, $post_id ) { return ''; } - $link = isset( $args['link'] ) ? $args['link'] : 'view'; + $link = $args['link'] ?? 'view'; $user = get_userdata( $value ); $display_field = $field['display_field']; $text = $user->$display_field; @@ -178,13 +169,23 @@ public static function format_single_value( $field, $value, $args, $post_id ) { if ( false === $link ) { return $text; } - if ( 'view' === $link ) { - $url = get_author_posts_url( $value ); - } + $url = get_author_posts_url( $value ); if ( 'edit' === $link ) { $url = get_edit_user_link( $value ); } return sprintf( '%s', esc_url( $url ), esc_html( $text ) ); } + + public static function add_new_form( array $field ): string { + if ( ! current_user_can( 'create_users' ) ) { + return ''; + } + + return sprintf( + '%s', + admin_url( 'user-new.php' ), + esc_html__( 'Add New User', 'meta-box' ) + ); + } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/video.php b/vendor/wpmetabox/meta-box/inc/fields/video.php index cc81c6831..48f708dcf 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/video.php +++ b/vendor/wpmetabox/meta-box/inc/fields/video.php @@ -1,29 +1,17 @@ wp_get_video_extensions(), - ) - ); + wp_enqueue_style( 'rwmb-video', RWMB_CSS_URL . 'video.css', [ 'rwmb-media' ], RWMB_VER ); + wp_enqueue_script( 'rwmb-video', RWMB_JS_URL . 'video.js', [ 'rwmb-media' ], RWMB_VER, true ); + RWMB_Helpers_Field::localize_script_once( 'rwmb-video', 'i18nRwmbVideo', [ + 'extensions' => wp_get_video_extensions(), + ] ); } /** @@ -49,23 +37,23 @@ public static function normalize( $field ) { * * @return array|bool False if file not found. Array of image info on success. */ - public static function file_info( $file_id, $args = array(), $field = array() ) { + public static function file_info( $file_id, $args = [], $field = [] ) { if ( ! get_attached_file( $file_id ) ) { return false; } $attachment = get_post( $file_id ); $url = wp_get_attachment_url( $attachment->ID ); $file_type = wp_check_filetype( $url, wp_get_mime_types() ); - $data = array( + $data = [ 'ID' => $file_id, 'src' => $url, 'type' => $file_type['type'], 'title' => $attachment->post_title, 'caption' => $attachment->post_excerpt, 'description' => $attachment->post_content, - ); + ]; - $data['meta'] = array(); + $data['meta'] = []; $meta = wp_get_attachment_metadata( $attachment->ID ); if ( ! empty( $meta ) ) { foreach ( wp_get_attachment_id3_keys( $attachment ) as $key => $label ) { @@ -75,15 +63,15 @@ public static function file_info( $file_id, $args = array(), $field = array() ) } if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { - $data['dimensions'] = array( + $data['dimensions'] = [ 'width' => $meta['width'], 'height' => $meta['height'], - ); + ]; } else { - $data['dimensions'] = array( + $data['dimensions'] = [ 'width' => 640, 'height' => 360, - ); + ]; } } @@ -120,22 +108,18 @@ public static function format_clone_value( $field, $value, $args, $post_id ) { // Display single video. if ( 1 === count( $value ) ) { $video = reset( $value ); - return wp_video_shortcode( - array( - 'src' => $video['src'], - 'width' => $video['dimensions']['width'], - 'height' => $video['dimensions']['height'], - ) - ); + return wp_video_shortcode( [ + 'src' => $video['src'], + 'width' => $video['dimensions']['width'], + 'height' => $video['dimensions']['height'], + ] ); } // Display multiple videos in a playlist. - return wp_playlist_shortcode( - array( - 'ids' => $ids, - 'type' => 'video', - ) - ); + return wp_playlist_shortcode( [ + 'ids' => $ids, + 'type' => 'video', + ] ); } /** @@ -143,6 +127,6 @@ public static function format_clone_value( $field, $value, $args, $post_id ) { */ public static function print_templates() { parent::print_templates(); - require_once RWMB_INC_DIR . 'templates/video.php'; + require RWMB_INC_DIR . 'templates/video.php'; } } diff --git a/vendor/wpmetabox/meta-box/inc/fields/wysiwyg.php b/vendor/wpmetabox/meta-box/inc/fields/wysiwyg.php index 642b8c28a..91ba57b9b 100644 --- a/vendor/wpmetabox/meta-box/inc/fields/wysiwyg.php +++ b/vendor/wpmetabox/meta-box/inc/fields/wysiwyg.php @@ -1,21 +1,14 @@ false, - 'options' => array(), - ) - ); + $field = wp_parse_args( $field, [ + 'raw' => false, + 'options' => [], + ] ); - $field['options'] = wp_parse_args( - $field['options'], - array( - 'editor_class' => 'rwmb-wysiwyg', - 'dfw' => true, // Use default WordPress full screen UI. - ) - ); + $field['options'] = wp_parse_args( $field['options'], [ + 'editor_class' => 'rwmb-wysiwyg', + 'dfw' => true, // Use default WordPress full screen UI. + ] ); // Keep the filter to be compatible with previous versions. $field['options'] = apply_filters( 'rwmb_wysiwyg_settings', $field['options'] ); diff --git a/vendor/wpmetabox/meta-box/inc/functions.php b/vendor/wpmetabox/meta-box/inc/functions.php index 2d6776d12..a4f855f61 100644 --- a/vendor/wpmetabox/meta-box/inc/functions.php +++ b/vendor/wpmetabox/meta-box/inc/functions.php @@ -1,8 +1,6 @@ 'post', - 'type' => '', - ) - ); + function rwmb_get_field_settings( $key, $args = [], $object_id = null ) { + $args = wp_parse_args( $args, [ + 'object_type' => 'post', + 'type' => '', + ] ); /** * Filter meta type from object type and object id. @@ -101,21 +100,18 @@ function rwmb_get_field_settings( $key, $args = array(), $object_id = null ) { * * @return mixed */ - function rwmb_meta_legacy( $key, $args = array(), $post_id = null ) { - $args = wp_parse_args( - $args, - array( - 'type' => 'text', - 'multiple' => false, - 'clone' => false, - ) - ); - $field = array( + function rwmb_meta_legacy( $key, $args = [], $post_id = null ) { + $args = wp_parse_args( $args, [ + 'type' => 'text', + 'multiple' => false, + 'clone' => false, + ] ); + $field = [ 'id' => $key, 'type' => $args['type'], 'clone' => $args['clone'], 'multiple' => $args['multiple'], - ); + ]; $method = 'get_value'; switch ( $args['type'] ) { @@ -146,7 +142,7 @@ function rwmb_meta_legacy( $key, $args = array(), $post_id = null ) { * * @return mixed false if field doesn't exist. Field value otherwise. */ - function rwmb_get_value( $field_id, $args = array(), $post_id = null ) { + function rwmb_get_value( $field_id, $args = [], $post_id = null ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $field_id, $args, $post_id ); @@ -179,7 +175,7 @@ function rwmb_get_value( $field_id, $args = array(), $post_id = null ) { * * @return string */ - function rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = true ) { + function rwmb_the_value( $field_id, $args = [], $post_id = null, $echo = true ) { $args = wp_parse_args( $args ); $field = rwmb_get_field_settings( $field_id, $args, $post_id ); @@ -201,7 +197,7 @@ function rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = tr $output = apply_filters( 'rwmb_the_value', $output, $field, $args, $post_id ); if ( $echo ) { - echo $output; // WPCS: XSS OK. + echo $output; // phpcs:ignore WordPress.Security.EscapeOutput } return $output; @@ -218,11 +214,11 @@ function rwmb_the_value( $field_id, $args = array(), $post_id = null, $echo = tr * @return array */ function rwmb_get_object_fields( $type_or_id, $object_type = 'post' ) { - $meta_boxes = rwmb_get_registry( 'meta_box' )->get_by( array( 'object_type' => $object_type ) ); - array_walk( $meta_boxes, 'rwmb_check_meta_box_supports', array( $object_type, $type_or_id ) ); + $meta_boxes = rwmb_get_registry( 'meta_box' )->get_by( [ 'object_type' => $object_type ] ); + array_walk( $meta_boxes, 'rwmb_check_meta_box_supports', [ $object_type, $type_or_id ] ); $meta_boxes = array_filter( $meta_boxes ); - $fields = array(); + $fields = []; foreach ( $meta_boxes as $meta_box ) { foreach ( $meta_box->fields as $field ) { $fields[ $field['id'] ] = $field; @@ -255,7 +251,7 @@ function rwmb_check_meta_box_supports( &$meta_box, $key, $object_data ) { $type = $type_or_id; if ( is_numeric( $type_or_id ) ) { $term = get_term( $type_or_id ); - $type = is_array( $term ) ? $term->taxonomy : null; + $type = is_wp_error( $term ) || ! $term ? null : $term->taxonomy; } $prop = 'taxonomies'; break; @@ -288,7 +284,7 @@ function rwmb_check_meta_box_supports( &$meta_box, $key, $object_data ) { * @return object */ function rwmb_get_registry( $type ) { - static $data = array(); + static $data = []; $class = 'RWMB_' . RWMB_Helpers_String::title_case( $type ) . '_Registry'; if ( ! isset( $data[ $type ] ) ) { diff --git a/vendor/wpmetabox/meta-box/inc/helpers/array.php b/vendor/wpmetabox/meta-box/inc/helpers/array.php index 6eda94e6a..93f1ee02c 100644 --- a/vendor/wpmetabox/meta-box/inc/helpers/array.php +++ b/vendor/wpmetabox/meta-box/inc/helpers/array.php @@ -1,90 +1,9 @@ get_data( $handle, 'data' ) ) { wp_localize_script( $handle, $name, $data ); } } - public static function add_inline_script_once( $handle, $text ) { + public static function add_inline_script_once( string $handle, string $text ) { if ( ! wp_scripts()->get_data( $handle, 'after' ) ) { wp_add_inline_script( $handle, $text ); } } - /** - * Get field class name. - * - * @param array $field Field settings. - * @return string - */ - public static function get_class( $field ) { + public static function get_class( $field ) : string { $type = self::get_type( $field ); $class = 'RWMB_' . RWMB_Helpers_String::title_case( $type ) . '_Field'; + $class = apply_filters( 'rwmb_field_class', $class, $type ); return class_exists( $class ) ? $class : 'RWMB_Input_Field'; } - /** - * Get field type. - * - * @param array $field Field settings. - * @return string - */ - private static function get_type( $field ) { - $type = isset( $field['type'] ) ? $field['type'] : 'text'; + private static function get_type( $field ) : string { + $type = $field['type'] ?? 'text'; $map = array_merge( - array( + [ $type => $type, - ), - array( + ], + [ 'file_advanced' => 'media', 'plupload_image' => 'image_upload', 'url' => 'text', - ) + ] ); return $map[ $type ]; diff --git a/vendor/wpmetabox/meta-box/inc/helpers/string.php b/vendor/wpmetabox/meta-box/inc/helpers/string.php index 2f88ad68b..fc90d50c5 100644 --- a/vendor/wpmetabox/meta-box/inc/helpers/string.php +++ b/vendor/wpmetabox/meta-box/inc/helpers/string.php @@ -1,24 +1,10 @@ constants(); + // PSR-4 autoload. + $psr4_autoload = dirname( __DIR__ ) . '/vendor/autoload.php'; + if ( file_exists( $psr4_autoload ) ) { + require $psr4_autoload; + } + // Register autoload for classes. require_once RWMB_INC_DIR . 'autoloader.php'; $autoloader = new RWMB_Autoloader(); @@ -105,23 +100,29 @@ public function init() { $wpml->init(); // Update. - $update_option = new RWMB_Update_Option(); - $update_checker = new RWMB_Update_Checker( $update_option ); + $update_option = new \MetaBox\Updater\Option(); + $update_checker = new \MetaBox\Updater\Checker( $update_option ); $update_checker->init(); - $update_settings = new RWMB_Update_Settings( $update_checker, $update_option ); + $update_settings = new \MetaBox\Updater\Settings( $update_checker, $update_option ); $update_settings->init(); - $update_notification = new RWMB_Update_Notification( $update_checker, $update_option ); + $update_notification = new \MetaBox\Updater\Notification( $update_checker, $update_option ); $update_notification->init(); + // Register categories for page builders. + new \MetaBox\Block\Register(); + new \MetaBox\Oxygen\Register(); + new \MetaBox\Elementor\Register(); + new \MetaBox\Bricks\Register(); + if ( is_admin() ) { $about = new RWMB_About( $update_checker ); $about->init(); - new RWMB_Dashboard( 'http://feeds.feedburner.com/metaboxio', 'https://metabox.io/blog/', array( + new RWMB_Dashboard( 'http://feeds.feedburner.com/metaboxio', 'https://metabox.io/blog/', [ 'title' => 'Meta Box', 'dismiss_tooltip' => esc_html__( 'Dismiss all Meta Box news', 'meta-box' ), 'dismiss_confirm' => esc_html__( 'Are you sure to dismiss all Meta Box news?', 'meta-box' ), - ) ); + ] ); } // Public functions. diff --git a/vendor/wpmetabox/meta-box/inc/media-modal.php b/vendor/wpmetabox/meta-box/inc/media-modal.php index 98b175a0e..a1a8d6b5a 100644 --- a/vendor/wpmetabox/meta-box/inc/media-modal.php +++ b/vendor/wpmetabox/meta-box/inc/media-modal.php @@ -1,13 +1,6 @@ post_type === 'attachment' ) { - wp_enqueue_style( 'rwmb', RWMB_CSS_URL . 'media-modal.css', array(), RWMB_VER ); - } - } - - /** - * Get list of custom fields and store in the current object for future use. - */ public function get_fields() { $meta_boxes = rwmb_get_registry( 'meta_box' )->all(); foreach ( $meta_boxes as $meta_box ) { @@ -62,6 +36,10 @@ public function get_fields() { * @return mixed */ public function add_fields( $form_fields, WP_Post $post ) { + if ( $this->is_attachment_edit_screen() ) { + return $form_fields; + } + foreach ( $this->fields as $field ) { $form_field = $field; $form_field['label'] = $field['name']; @@ -75,8 +53,12 @@ public function add_fields( $form_fields, WP_Post $post ) { ob_start(); $field['name'] = ''; // Don't show field label as it's already handled by WordPress. - + RWMB_Field::call( 'show', $field, true, $post->ID ); + + // For MB Custom Table to flush data from the cache to the database. + do_action( 'rwmb_flush_data', $post->ID, $field, [] ); + $form_field['html'] = ob_get_clean(); $form_fields[ $field['id'] ] = $form_field; @@ -104,42 +86,25 @@ public function save_fields( $post, $attachment ) { // Call defined method to save meta value, if there's no methods, call common one. RWMB_Field::call( $field, 'save', $new, $old, $post['ID'] ); + + // For MB Custom Table to flush data from the cache to the database. + do_action( 'rwmb_flush_data', $post['ID'], $field, [] ); } return $post; } - /** - * Whether or not show the meta box when editing custom fields in the normal mode. - * - * @param bool $show Whether to show the meta box in normal editing mode. - * @param array $meta_box Meta Box parameters. - * - * @return bool - */ - public function is_in_normal_mode( $show, $meta_box ) { - if ( ! $show ) { - return $show; - } + private function is_in_modal( array $meta_box ): bool { + return in_array( 'attachment', $meta_box['post_types'], true ) && ! empty( $meta_box['media_modal'] ); + } - // Show the meta box in the modal on Media screen. - global $pagenow; - if ( $pagenow === 'upload.php' ) { - return $this->is_in_modal( $meta_box ); + private function is_attachment_edit_screen(): bool { + if ( ! function_exists( 'get_current_screen' ) ) { + return false; } - // Show the meta box only if not in the modal on the post edit screen. - return ! $this->is_in_modal( $meta_box ); - } + $screen = get_current_screen(); - /** - * Check if the meta box is for editing custom fields in the media modal. - * - * @param array $meta_box Meta Box parameters. - * - * @return bool - */ - protected function is_in_modal( $meta_box ) { - return in_array( 'attachment', $meta_box['post_types'], true ) && ! empty( $meta_box['media_modal'] ); + return $screen && $screen->id === 'attachment'; } } diff --git a/vendor/wpmetabox/meta-box/inc/meta-box-registry.php b/vendor/wpmetabox/meta-box/inc/meta-box-registry.php index 1557bc66d..92ee5ee38 100644 --- a/vendor/wpmetabox/meta-box/inc/meta-box-registry.php +++ b/vendor/wpmetabox/meta-box/inc/meta-box-registry.php @@ -2,20 +2,10 @@ /** * A registry for storing all meta boxes. * - * @link https://designpatternsphp.readthedocs.io/en/latest/Structural/Registry/README.html - * @package Meta Box - */ - -/** - * Meta box registry class. + * @link https://designpatternsphp.readthedocs.io/en/latest/Structural/Registry/README.html */ class RWMB_Meta_Box_Registry { - /** - * Internal data storage. - * - * @var array - */ - private $data = array(); + private $data = []; /** * Create a meta box object. @@ -23,7 +13,7 @@ class RWMB_Meta_Box_Registry { * @param array $settings Meta box settings. * @return \RW_Meta_Box */ - public function make( $settings ) { + public function make( array $settings ) { $class_name = apply_filters( 'rwmb_meta_box_class_name', 'RW_Meta_Box', $settings ); $meta_box = new $class_name( $settings ); @@ -31,34 +21,20 @@ public function make( $settings ) { return $meta_box; } - /** - * Add a meta box to the registry. - * - * @param RW_Meta_Box $meta_box Meta box instance. - */ public function add( RW_Meta_Box $meta_box ) { $this->data[ $meta_box->id ] = $meta_box; } - /** - * Retrieve a meta box by id. - * - * @param string $id Meta box id. - * - * @return RW_Meta_Box|bool False or meta box object. - */ public function get( $id ) { - return isset( $this->data[ $id ] ) ? $this->data[ $id ] : false; + return $this->data[ $id ] ?? false; } /** * Get meta boxes under some conditions. * * @param array $args Custom argument to get meta boxes by. - * - * @return array */ - public function get_by( $args ) { + public function get_by( array $args ) : array { $meta_boxes = $this->data; foreach ( $meta_boxes as $index => $meta_box ) { foreach ( $args as $key => $value ) { @@ -73,11 +49,6 @@ public function get_by( $args ) { return $meta_boxes; } - /** - * Retrieve all meta boxes. - * - * @return array - */ public function all() { return $this->data; } diff --git a/vendor/wpmetabox/meta-box/inc/meta-box.php b/vendor/wpmetabox/meta-box/inc/meta-box.php index 222c7bb7d..12a9c4828 100644 --- a/vendor/wpmetabox/meta-box/inc/meta-box.php +++ b/vendor/wpmetabox/meta-box/inc/meta-box.php @@ -1,15 +1,8 @@ - * @license GNU GPL2+ - * @package Meta Box - */ +use MetaBox\Support\Arr; /** - * The main meta box class. + * A class to rapid develop meta boxes for custom & built in content types * * @property string $id Meta Box ID. * @property string $title Meta Box title. @@ -22,8 +15,6 @@ * @property bool $default_hidden Whether the meta box is hidden by default. * @property bool $autosave Whether the meta box auto saves. * @property bool $media_modal Add custom fields to media modal when viewing/editing an attachment. - * - * @package Meta Box */ class RW_Meta_Box { /** @@ -55,12 +46,7 @@ class RW_Meta_Box { */ protected $object_type = 'post'; - /** - * Create meta box based on given data. - * - * @param array $meta_box Meta box definition. - */ - public function __construct( $meta_box ) { + public function __construct( array $meta_box ) { $meta_box = static::normalize( $meta_box ); $this->meta_box = $meta_box; @@ -74,9 +60,6 @@ public function __construct( $meta_box ) { } } - /** - * Add fields to field registry. - */ public function register_fields() { $field_registry = rwmb_get_registry( 'field' ); @@ -87,26 +70,14 @@ public function register_fields() { } } - /** - * Conditional check for whether initializing meta box. - * - * - 1st filter applies to all meta boxes. - * - 2nd filter applies to only current meta box. - * - * @return bool - */ - public function is_shown() { + public function is_shown() : bool { $show = apply_filters( 'rwmb_show', true, $this->meta_box ); - return apply_filters( "rwmb_show_{$this->id}", $show, $this->meta_box ); } - /** - * Add global hooks. - */ protected function global_hooks() { // Enqueue common styles and scripts. - add_action( 'admin_enqueue_scripts', array( $this, 'enqueue' ) ); + add_action( 'admin_enqueue_scripts', [ $this, 'enqueue' ] ); // Add additional actions for fields. foreach ( $this->fields as $field ) { @@ -116,47 +87,44 @@ protected function global_hooks() { /** * Specific hooks for meta box object. Default is 'post'. - * This should be extended in sub-classes to support meta fields for terms, user, settings pages, etc. + * This should be extended in subclasses to support meta fields for terms, user, settings pages, etc. */ protected function object_hooks() { // Add meta box. - add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) ); + add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] ); // Hide meta box if it's set 'default_hidden'. - add_filter( 'default_hidden_meta_boxes', array( $this, 'hide' ), 10, 2 ); + add_filter( 'default_hidden_meta_boxes', [ $this, 'hide' ], 10, 2 ); // Save post meta. foreach ( $this->post_types as $post_type ) { if ( 'attachment' === $post_type ) { // Attachment uses other hooks. // @see wp_update_post(), wp_insert_attachment(). - add_action( 'edit_attachment', array( $this, 'save_post' ) ); - add_action( 'add_attachment', array( $this, 'save_post' ) ); + add_action( 'edit_attachment', [ $this, 'save_post' ] ); + add_action( 'add_attachment', [ $this, 'save_post' ] ); } else { - add_action( "save_post_{$post_type}", array( $this, 'save_post' ) ); + add_action( "save_post_{$post_type}", [ $this, 'save_post' ] ); } } } - /** - * Enqueue common scripts and styles. - */ public function enqueue() { if ( is_admin() && ! $this->is_edit_screen() ) { return; } - wp_enqueue_style( 'rwmb', RWMB_CSS_URL . 'style.css', array(), RWMB_VER ); + wp_enqueue_style( 'rwmb', RWMB_CSS_URL . 'style.css', [], RWMB_VER ); if ( is_rtl() ) { - wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER ); + wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', [], RWMB_VER ); } - wp_enqueue_script( 'rwmb', RWMB_JS_URL . 'script.js', array( 'jquery' ), RWMB_VER, true ); + wp_enqueue_script( 'rwmb', RWMB_JS_URL . 'script.js', [ 'jquery' ], RWMB_VER, true ); // Load clone script conditionally. foreach ( $this->fields as $field ) { if ( $field['clone'] ) { - wp_enqueue_script( 'rwmb-clone', RWMB_JS_URL . 'clone.js', array( 'jquery-ui-sortable' ), RWMB_VER, true ); + wp_enqueue_script( 'rwmb-clone', RWMB_JS_URL . 'clone.js', [ 'jquery-ui-sortable' ], RWMB_VER, true ); break; } } @@ -168,7 +136,7 @@ public function enqueue() { // Auto save. if ( $this->autosave ) { - wp_enqueue_script( 'rwmb-autosave', RWMB_JS_URL . 'autosave.js', array( 'jquery' ), RWMB_VER, true ); + wp_enqueue_script( 'rwmb-autosave', RWMB_JS_URL . 'autosave.js', [ 'jquery' ], RWMB_VER, true ); } /** @@ -184,13 +152,13 @@ public function enqueue() { */ public function add_meta_boxes() { $screen = get_current_screen(); - add_filter( "postbox_classes_{$screen->id}_{$this->id}", array( $this, 'postbox_classes' ) ); + add_filter( "postbox_classes_{$screen->id}_{$this->id}", [ $this, 'postbox_classes' ] ); foreach ( $this->post_types as $post_type ) { add_meta_box( $this->id, $this->title, - array( $this, 'show' ), + [ $this, 'show' ], $post_type, $this->context, $this->priority @@ -198,13 +166,7 @@ public function add_meta_boxes() { } } - /** - * Modify meta box postbox classes. - * - * @param array $classes Array of classes. - * @return array - */ - public function postbox_classes( $classes ) { + public function postbox_classes( array $classes ) : array { if ( $this->closed ) { $classes[] = 'closed'; } @@ -213,15 +175,7 @@ public function postbox_classes( $classes ) { return $classes; } - /** - * Hide meta box if it's set 'default_hidden' - * - * @param array $hidden Array of default hidden meta boxes. - * @param object $screen Current screen information. - * - * @return array - */ - public function hide( $hidden, $screen ) { + public function hide( array $hidden, $screen ) : array { if ( $this->is_edit_screen( $screen ) && $this->default_hidden ) { $hidden[] = $this->id; } @@ -229,9 +183,6 @@ public function hide( $hidden, $screen ) { return $hidden; } - /** - * Callback function to show fields in meta box - */ public function show() { if ( null === $this->object_id ) { $this->object_id = $this->get_current_object_id(); @@ -287,21 +238,16 @@ public function save_post( $object_id ) { do_action( 'rwmb_before_save_post', $object_id ); do_action( "rwmb_{$this->id}_before_save_post", $object_id ); - array_map( array( $this, 'save_field' ), $this->fields ); + array_map( [ $this, 'save_field' ], $this->fields ); // After save action. do_action( 'rwmb_after_save_post', $object_id ); do_action( "rwmb_{$this->id}_after_save_post", $object_id ); } - /** - * Save field. - * - * @param array $field Field settings. - */ - public function save_field( $field ) { + public function save_field( array $field ) { $single = $field['clone'] || ! $field['multiple']; - $default = $single ? '' : array(); + $default = $single ? '' : []; $old = RWMB_Field::call( $field, 'raw_meta', $this->object_id ); $new = rwmb_request()->post( $field['id'], $default ); $new = RWMB_Field::process_value( $new, $this->object_id, $field ); @@ -315,15 +261,7 @@ public function save_field( $field ) { RWMB_Field::filter( 'after_save_field', null, $field, $new, $old, $this->object_id ); } - /** - * Validate form when submit. Check: - * - If this function is called to prevent duplicated calls like revisions, manual hook to wp_insert_post, etc. - * - Autosave - * - If form is submitted properly - * - * @return bool - */ - public function validate() { + public function validate() : bool { $nonce = rwmb_request()->filter_post( "nonce_{$this->id}" ); return ! $this->saved @@ -331,54 +269,34 @@ public function validate() { && wp_verify_nonce( $nonce, "rwmb-save-{$this->id}" ); } - /** - * Normalize parameters for meta box - * - * @param array $meta_box Meta box definition. - * - * @return array $meta_box Normalized meta box. - */ public static function normalize( $meta_box ) { $default_title = __( 'Meta Box Title', 'meta-box' ); - // Set default values for meta box. - $meta_box = wp_parse_args( - $meta_box, - array( - 'title' => $default_title, - 'id' => ! empty( $meta_box['title'] ) ? sanitize_title( $meta_box['title'] ) : sanitize_title( $default_title ), - 'context' => 'normal', - 'priority' => 'high', - 'post_types' => 'post', - 'autosave' => false, - 'default_hidden' => false, - 'style' => 'default', - 'class' => '', - 'fields' => array(), - ) - ); + $meta_box = wp_parse_args( $meta_box, [ + 'title' => $default_title, + 'id' => ! empty( $meta_box['title'] ) ? sanitize_title( $meta_box['title'] ) : sanitize_title( $default_title ), + 'context' => 'normal', + 'priority' => 'high', + 'post_types' => 'post', + 'autosave' => false, + 'default_hidden' => false, + 'style' => 'default', + 'class' => '', + 'fields' => [], + ] ); /** * Use 'post_types' for better understanding and fallback to 'pages' for previous versions. - * * @since 4.4.1 */ - RWMB_Helpers_Array::change_key( $meta_box, 'pages', 'post_types' ); + Arr::change_key( $meta_box, 'pages', 'post_types' ); // Make sure the post type is an array and is sanitized. - $meta_box['post_types'] = array_map( 'sanitize_key', RWMB_Helpers_Array::from_csv( $meta_box['post_types'] ) ); + $meta_box['post_types'] = array_filter( array_map( 'sanitize_key', Arr::from_csv( $meta_box['post_types'] ) ) ); return $meta_box; } - /** - * Normalize an array of fields - * - * @param array $fields Array of fields. - * @param RWMB_Storage_Interface $storage Storage object. Optional. - * - * @return array $fields Normalized fields. - */ - public static function normalize_fields( $fields, $storage = null ) { + public static function normalize_fields( array $fields, $storage = null ) : array { foreach ( $fields as $k => $field ) { $field = RWMB_Field::call( 'normalize', $field ); @@ -397,9 +315,7 @@ public static function normalize_fields( $fields, $storage = null ) { /** * Check if meta box is saved before. - * This helps saving empty value in meta fields (text, check box, etc.) and set the correct default values. - * - * @return bool + * This helps to save empty value in meta fields (text, check box, etc.) and set the correct default values. */ public function is_saved() { foreach ( $this->fields as $field ) { @@ -419,7 +335,7 @@ public function is_saved() { if ( ( $single && '' !== $value ) - || ( ! $single && is_array( $value ) && array() !== $value ) + || ( ! $single && is_array( $value ) && [] !== $value ) ) { return true; } @@ -431,27 +347,18 @@ public function is_saved() { /** * Check if we're on the right edit screen. * - * @param WP_Screen $screen Screen object. Optional. Use current screen object by default. - * - * @return bool + * @param ?WP_Screen $screen Screen object. */ public function is_edit_screen( $screen = null ) { if ( ! ( $screen instanceof WP_Screen ) ) { $screen = get_current_screen(); } - return in_array( $screen->base, array( 'post', 'upload' ), true ) && in_array( $screen->post_type, $this->post_types, true ); + return in_array( $screen->base, [ 'post', 'upload' ], true ) && in_array( $screen->post_type, $this->post_types, true ); } - /** - * Magic function to get meta box property. - * - * @param string $key Meta box property name. - * - * @return mixed - */ - public function __get( $key ) { - return isset( $this->meta_box[ $key ] ) ? $this->meta_box[ $key ] : false; + public function __get( string $key ) { + return $this->meta_box[ $key ] ?? false; } /** @@ -463,12 +370,7 @@ public function set_object_id( $id = null ) { $this->object_id = $id; } - /** - * Get object type. - * - * @return string - */ - public function get_object_type() { + public function get_object_type() : string { return $this->object_type; } @@ -503,6 +405,6 @@ protected function get_real_object_id( $object_id ) { } $parent = wp_is_post_revision( $object_id ); - return $parent ? $parent : $object_id; + return $parent ?: $object_id; } } diff --git a/vendor/wpmetabox/meta-box/inc/request.php b/vendor/wpmetabox/meta-box/inc/request.php index 88e1bcd0c..37b19ed18 100644 --- a/vendor/wpmetabox/meta-box/inc/request.php +++ b/vendor/wpmetabox/meta-box/inc/request.php @@ -5,33 +5,11 @@ * * @link https://github.com/laravel/framework/blob/6.x/src/Illuminate/Http/Request.php * @link https://github.com/symfony/symfony/blob/4.4/src/Symfony/Component/HttpFoundation/ParameterBag.php - * - * @package Meta Box - */ - -/** - * A very simple request class that handles form inputs. - * - * @package Meta Box */ class RWMB_Request { - /** - * GET data. - * - * @var array - */ - private $get_data = array(); + private $get_data = []; + private $post_data = []; - /** - * POST data. - * - * @var array - */ - private $post_data = array(); - - /** - * Constructor. - */ public function __construct() { // @codingStandardsIgnoreLine $this->get_data = $_GET; @@ -39,44 +17,20 @@ public function __construct() { $this->post_data = $_POST; } - /** - * Set GET data. - * - * @param array $get_data Data. - */ - public function set_get_data( $get_data ) { - $this->get_data = array_merge( $this->get_data, $get_data ); + public function set_get_data( array $data ) { + $this->get_data = array_merge( $this->get_data, $data ); } - /** - * Set POST data. - * - * @param array $post_data Data. - */ - public function set_post_data( $post_data ) { - $this->post_data = array_merge( $this->post_data, $post_data ); + public function set_post_data( array $data ) { + $this->post_data = array_merge( $this->post_data, $data ); } - /** - * Return a GET parameter by name. - * - * @param string $name Parameter name. - * @param mixed $default Default value. - * @return mixed - */ - public function get( $name, $default = null ) { - return isset( $this->get_data[ $name ] ) ? $this->get_data[ $name ] : $default; + public function get( string $name, $default = null ) { + return $this->get_data[ $name ] ?? $default; } - /** - * Return a POST parameter by name. - * - * @param string $name Parameter name. - * @param mixed $default Default value. - * @return mixed - */ - public function post( $name, $default = null ) { - return isset( $this->post_data[ $name ] ) ? $this->post_data[ $name ] : $default; + public function post( string $name, $default = null ) { + return $this->post_data[ $name ] ?? $default; } /** @@ -88,7 +42,7 @@ public function post( $name, $default = null ) { * * @return mixed */ - public function filter_get( $name, $filter = FILTER_DEFAULT, $options = array() ) { + public function filter_get( string $name, $filter = FILTER_DEFAULT, $options = [] ) { $value = $this->get( $name ); return filter_var( $value, $filter, $options ); } @@ -102,7 +56,7 @@ public function filter_get( $name, $filter = FILTER_DEFAULT, $options = array() * * @return mixed */ - public function filter_post( $name, $filter = FILTER_DEFAULT, $options = array() ) { + public function filter_post( string $name, $filter = FILTER_DEFAULT, $options = [] ) { $value = $this->post( $name ); return filter_var( $value, $filter, $options ); } diff --git a/vendor/wpmetabox/meta-box/inc/sanitizer.php b/vendor/wpmetabox/meta-box/inc/sanitizer.php index 4b781e999..33ddb0f16 100644 --- a/vendor/wpmetabox/meta-box/inc/sanitizer.php +++ b/vendor/wpmetabox/meta-box/inc/sanitizer.php @@ -1,19 +1,10 @@ array( $this, 'sanitize_choice' ), - 'background' => array( $this, 'sanitize_background' ), - 'button_group' => array( $this, 'sanitize_choice' ), - 'checkbox' => array( $this, 'sanitize_checkbox' ), - 'checkbox_list' => array( $this, 'sanitize_choice' ), - 'color' => array( $this, 'sanitize_color' ), - 'date' => array( $this, 'sanitize_datetime' ), - 'datetime' => array( $this, 'sanitize_datetime' ), + $callbacks = [ + 'autocomplete' => [ $this, 'sanitize_choice' ], + 'background' => [ $this, 'sanitize_background' ], + 'button_group' => [ $this, 'sanitize_choice' ], + 'checkbox' => [ $this, 'sanitize_checkbox' ], + 'checkbox_list' => [ $this, 'sanitize_choice' ], + 'color' => [ $this, 'sanitize_color' ], + 'date' => [ $this, 'sanitize_datetime' ], + 'datetime' => [ $this, 'sanitize_datetime' ], 'email' => 'sanitize_email', - 'fieldset_text' => array( $this, 'sanitize_text' ), - 'file' => array( $this, 'sanitize_file' ), - 'file_advanced' => array( $this, 'sanitize_object' ), - 'file_input' => array( $this, 'sanitize_url' ), - 'file_upload' => array( $this, 'sanitize_object' ), + 'fieldset_text' => [ $this, 'sanitize_text' ], + 'file' => [ $this, 'sanitize_file' ], + 'file_advanced' => [ $this, 'sanitize_object' ], + 'file_input' => [ $this, 'sanitize_url' ], + 'file_upload' => [ $this, 'sanitize_object' ], 'hidden' => 'sanitize_text_field', - 'image' => array( $this, 'sanitize_file' ), - 'image_advanced' => array( $this, 'sanitize_object' ), - 'image_select' => array( $this, 'sanitize_choice' ), - 'image_upload' => array( $this, 'sanitize_object' ), - 'key_value' => array( $this, 'sanitize_text' ), - 'map' => array( $this, 'sanitize_map' ), - 'number' => array( $this, 'sanitize_number' ), - 'oembed' => array( $this, 'sanitize_url' ), - 'osm' => array( $this, 'sanitize_map' ), + 'image' => [ $this, 'sanitize_file' ], + 'image_advanced' => [ $this, 'sanitize_object' ], + 'image_select' => [ $this, 'sanitize_choice' ], + 'image_upload' => [ $this, 'sanitize_object' ], + 'key_value' => [ $this, 'sanitize_text' ], + 'map' => [ $this, 'sanitize_map' ], + 'number' => [ $this, 'sanitize_number' ], + 'oembed' => [ $this, 'sanitize_url' ], + 'osm' => [ $this, 'sanitize_map' ], 'password' => 'sanitize_text_field', - 'post' => array( $this, 'sanitize_object' ), - 'radio' => array( $this, 'sanitize_choice' ), - 'range' => array( $this, 'sanitize_number' ), - 'select' => array( $this, 'sanitize_choice' ), - 'select_advanced' => array( $this, 'sanitize_choice' ), - 'sidebar' => array( $this, 'sanitize_text' ), + 'post' => [ $this, 'sanitize_object' ], + 'radio' => [ $this, 'sanitize_choice' ], + 'range' => [ $this, 'sanitize_number' ], + 'select' => [ $this, 'sanitize_choice' ], + 'select_advanced' => [ $this, 'sanitize_choice' ], + 'sidebar' => [ $this, 'sanitize_text' ], 'single_image' => 'absint', - 'slider' => array( $this, 'sanitize_slider' ), - 'switch' => array( $this, 'sanitize_checkbox' ), - 'taxonomy' => array( $this, 'sanitize_object' ), - 'taxonomy_advanced' => array( $this, 'sanitize_taxonomy_advanced' ), + 'slider' => [ $this, 'sanitize_slider' ], + 'switch' => [ $this, 'sanitize_checkbox' ], + 'taxonomy' => [ $this, 'sanitize_object' ], + 'taxonomy_advanced' => [ $this, 'sanitize_taxonomy_advanced' ], 'text' => 'sanitize_text_field', - 'text_list' => array( $this, 'sanitize_text' ), + 'text_list' => [ $this, 'sanitize_text' ], 'textarea' => 'wp_kses_post', 'time' => 'sanitize_text_field', - 'url' => array( $this, 'sanitize_url' ), - 'user' => array( $this, 'sanitize_object' ), - 'video' => array( $this, 'sanitize_object' ), + 'url' => [ $this, 'sanitize_url' ], + 'user' => [ $this, 'sanitize_object' ], + 'video' => [ $this, 'sanitize_object' ], 'wysiwyg' => 'wp_kses_post', - ); + ]; $type = $field['type']; - return isset( $callbacks[ $type ] ) ? $callbacks[ $type ] : null; + return $callbacks[ $type ] ?? null; } /** @@ -105,9 +96,8 @@ private function get_callback( $field ) { * * @link https://github.com/rilwis/meta-box/issues/6 * @param string $value Checkbox value. - * @return int */ - private function sanitize_checkbox( $value ) { + private function sanitize_checkbox( $value ): int { return (int) ! empty( $value ); } @@ -121,14 +111,12 @@ private function sanitize_number( $value ) { return is_numeric( $value ) ? $value : ''; } - /** - * Sanitize color value. - * - * @param string $value The color value. - * @return string - */ - private function sanitize_color( $value ) { - if ( false === strpos( $value, 'rgba' ) ) { + private function sanitize_color( string $value ): string { + if ( str_contains( $value, 'hsl' ) ) { + return wp_unslash( $value ); + } + + if ( ! str_contains( $value, 'rgb' ) ) { return sanitize_hex_color( $value ); } @@ -136,8 +124,13 @@ private function sanitize_color( $value ) { $red = ''; $green = ''; $blue = ''; - $alpha = ''; - sscanf( $value, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + $alpha = 1; + + if ( str_contains( $value, 'rgba' ) ) { + sscanf( $value, 'rgba(%d,%d,%d,%f)', $red, $green, $blue, $alpha ); + } else { + sscanf( $value, 'rgb(%d,%d,%d)', $red, $green, $blue ); + } return 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $alpha . ')'; } @@ -152,7 +145,7 @@ private function sanitize_color( $value ) { private function sanitize_choice( $value, $field ) { $options = RWMB_Choice_Field::transform_options( $field['options'] ); $options = wp_list_pluck( $options, 'value' ); - $value = wp_unslash( $value ); + $value = wp_unslash( $value ); return is_array( $value ) ? array_intersect( $value, $options ) : ( in_array( $value, $options ) ? $value : '' ); } @@ -173,24 +166,21 @@ private function sanitize_object( $value ) { * @return array */ private function sanitize_background( $value ) { - $value = wp_parse_args( - $value, - array( - 'color' => '', - 'image' => '', - 'repeat' => '', - 'attachment' => '', - 'position' => '', - 'size' => '', - ) - ); + $value = wp_parse_args( $value, [ + 'color' => '', + 'image' => '', + 'repeat' => '', + 'attachment' => '', + 'position' => '', + 'size' => '', + ] ); $value['color'] = $this->sanitize_color( $value['color'] ); $value['image'] = esc_url_raw( $value['image'] ); - $value['repeat'] = in_array( $value['repeat'], array( 'no-repeat', 'repeat', 'repeat-x', 'repeat-y', 'inherit' ), true ) ? $value['repeat'] : ''; - $value['position'] = in_array( $value['position'], array( 'top left', 'top center', 'top right', 'center left', 'center center', 'center right', 'bottom left', 'bottom center', 'bottom right' ), true ) ? $value['position'] : ''; - $value['attachment'] = in_array( $value['attachment'], array( 'fixed', 'scroll', 'inherit' ), true ) ? $value['attachment'] : ''; - $value['size'] = in_array( $value['size'], array( 'inherit', 'cover', 'contain' ), true ) ? $value['size'] : ''; + $value['repeat'] = in_array( $value['repeat'], [ 'no-repeat', 'repeat', 'repeat-x', 'repeat-y', 'inherit' ], true ) ? $value['repeat'] : ''; + $value['position'] = in_array( $value['position'], [ 'top left', 'top center', 'top right', 'center left', 'center center', 'center right', 'bottom left', 'bottom center', 'bottom right' ], true ) ? $value['position'] : ''; + $value['attachment'] = in_array( $value['attachment'], [ 'fixed', 'scroll', 'inherit' ], true ) ? $value['attachment'] : ''; + $value['size'] = in_array( $value['size'], [ 'inherit', 'cover', 'contain' ], true ) ? $value['size'] : ''; return $value; } @@ -235,16 +225,10 @@ private function sanitize_slider( $value, $field ) { * @return float|string */ private function sanitize_datetime( $value, $field ) { - return $field['timestamp'] ? floor( abs( (float) $value ) ) : sanitize_text_field( $value ); + return $field['timestamp'] ? (float) $value : sanitize_text_field( $value ); } - /** - * Sanitize map field. - * - * @param mixed $value The submitted value. - * @return string - */ - private function sanitize_map( $value ) { + private function sanitize_map( $value ): string { $value = sanitize_text_field( $value ); list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' ); @@ -255,26 +239,11 @@ private function sanitize_map( $value ) { return "$latitude,$longitude,$zoom"; } - /** - * Sanitize taxonomy advanced field. - * - * @param mixed $value The submitted value. - * @return string - */ - private function sanitize_taxonomy_advanced( $value ) { - $value = RWMB_Helpers_Array::from_csv( $value ); - $value = array_filter( array_map( 'absint', $value ) ); - - return implode( ',', $value ); + private function sanitize_taxonomy_advanced( $value ): string { + return implode( ',', wp_parse_id_list( $value ) ); } - /** - * Sanitize URL field. - * - * @param string $value The submitted value. - * @return string - */ - private function sanitize_url( $value ) { + private function sanitize_url( string $value ): string { return esc_url_raw( $value ); } } diff --git a/vendor/wpmetabox/meta-box/inc/shortcode.php b/vendor/wpmetabox/meta-box/inc/shortcode.php index 278b2fdff..c29b3bbea 100644 --- a/vendor/wpmetabox/meta-box/inc/shortcode.php +++ b/vendor/wpmetabox/meta-box/inc/shortcode.php @@ -1,4 +1,6 @@ '', 'render_shortcodes' => 'true', ] ); - RWMB_Helpers_Array::change_key( $atts, 'post_id', 'object_id' ); - RWMB_Helpers_Array::change_key( $atts, 'meta_key', 'id' ); + Arr::change_key( $atts, 'post_id', 'object_id' ); + Arr::change_key( $atts, 'meta_key', 'id' ); if ( empty( $atts['id'] ) ) { return ''; @@ -53,4 +55,4 @@ private function get_value( $field_id, $object_id, $atts ) { return $value; } -} \ No newline at end of file +} diff --git a/vendor/wpmetabox/meta-box/inc/storage-registry.php b/vendor/wpmetabox/meta-box/inc/storage-registry.php index 785dc7452..46648560d 100644 --- a/vendor/wpmetabox/meta-box/inc/storage-registry.php +++ b/vendor/wpmetabox/meta-box/inc/storage-registry.php @@ -1,21 +1,9 @@ + '; + public function rules( RW_Meta_Box $meta_box_object ) { + if ( empty( $meta_box_object->meta_box['validation'] ) ) { + return; } + + // Get field ID prefix from the builder. + $prefix = $meta_box_object->meta_box['prefix'] ?? ''; + + // Add prefix for validation rules. + $fields = $meta_box_object->meta_box['fields']; + foreach ( $meta_box_object->meta_box['validation'] as &$rules ) { + $rules = array_combine( + array_map( function ( $key ) use ( $fields, $prefix ) { + $id = $prefix . $key; + $index = array_search( $id, array_column( $fields, 'id' ), true ); + + if ( $index === false ) { + return $id; + } + + if ( in_array( $fields[ $index ]['type'], [ 'file', 'image' ], true ) ) { + return $fields[ $index ]['clone'] ? $fields[ $index ]['index_name'] : $fields[ $index ]['input_name']; + } + + return $id; + }, array_keys( $rules ) ), + $rules + ); + } + + echo ''; } - /** - * Enqueue scripts for validation. - */ public function enqueue() { - wp_enqueue_script( 'rwmb-validation', RWMB_JS_URL . 'validation.min.js', array( 'jquery', 'rwmb' ), RWMB_VER, true ); - - RWMB_Helpers_Field::localize_script_once( - 'rwmb-validation', - 'rwmbValidation', - array( - 'message' => esc_html__( 'Please correct the errors highlighted below and try again.', 'meta-box' ), - ) - ); + wp_enqueue_script( 'jquery-validation', RWMB_JS_URL . 'validation/jquery.validate.js', [ 'jquery' ], '1.19.5', true ); + wp_enqueue_script( 'jquery-validation-additional-methods', RWMB_JS_URL . 'validation/additional-methods.js', [ 'jquery-validation' ], '1.19.5', true ); + wp_enqueue_script( 'rwmb-validation', RWMB_JS_URL . 'validation/validation.js', [ 'jquery-validation-additional-methods', 'rwmb' ], RWMB_VER, true ); + + $locale = determine_locale(); + $locale_short = substr( $locale, 0, 2 ); + $locale = file_exists( RWMB_DIR . "js/validation/i18n/messages_$locale.js" ) ? $locale : $locale_short; + + if ( file_exists( RWMB_DIR . "js/validation/i18n/messages_$locale.js" ) ) { + wp_enqueue_script( 'jquery-validation-i18n', RWMB_JS_URL . "validation/i18n/messages_$locale.js", [ 'jquery-validation-additional-methods' ], '1.19.5', true ); + } + + RWMB_Helpers_Field::localize_script_once( 'rwmb-validation', 'rwmbValidation', [ + 'message' => esc_html( apply_filters( 'rwmb_validation_message_string', __( 'Please correct the errors highlighted below and try again.', 'meta-box' ) ) ), + ] ); } } diff --git a/vendor/wpmetabox/meta-box/inc/walkers/base.php b/vendor/wpmetabox/meta-box/inc/walkers/base.php index bda410bd2..32dc735a6 100644 --- a/vendor/wpmetabox/meta-box/inc/walkers/base.php +++ b/vendor/wpmetabox/meta-box/inc/walkers/base.php @@ -1,13 +1,9 @@ db_fields = array( + $this->db_fields = [ 'id' => 'value', 'parent' => 'parent', - ); + ]; $this->field = $field; $this->meta = (array) $meta; diff --git a/vendor/wpmetabox/meta-box/inc/walkers/input-list.php b/vendor/wpmetabox/meta-box/inc/walkers/input-list.php index 4c700e4f5..6e7991c5a 100644 --- a/vendor/wpmetabox/meta-box/inc/walkers/input-list.php +++ b/vendor/wpmetabox/meta-box/inc/walkers/input-list.php @@ -1,12 +1,8 @@ '; + public function start_lvl( &$output, $depth = 0, $args = [] ) { + $output .= '
    '; } /** @@ -27,8 +23,8 @@ public function start_lvl( &$output, $depth = 0, $args = array() ) { * @param int $depth Depth of the item. * @param array $args An array of additional arguments. */ - public function end_lvl( &$output, $depth = 0, $args = array() ) { - $output .= ''; + public function end_lvl( &$output, $depth = 0, $args = [] ) { + $output .= '
    '; } /** @@ -40,26 +36,14 @@ public function end_lvl( &$output, $depth = 0, $args = array() ) { * @param array $args An array of additional arguments. * @param int $current_object_id ID of the current item. */ - public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) { + public function start_el( &$output, $object, $depth = 0, $args = [], $current_object_id = 0 ) { $attributes = RWMB_Field::call( 'get_attributes', $this->field, $object->value ); $output .= sprintf( - '
  • ', + '', RWMB_Field::render_attributes( $attributes ), checked( in_array( $object->value, $this->meta ), true, false ), $object->label ); } - - /** - * Ends the element output, if needed. - * - * @param string $output Passed by reference. Used to append additional content. - * @param object $object The data object. - * @param int $depth Depth of the item. - * @param array $args An array of additional arguments. - */ - public function end_el( &$output, $object, $depth = 0, $args = array() ) { - $output .= '
  • '; - } } diff --git a/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php b/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php index 1fd775ff9..c12c690db 100644 --- a/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php +++ b/vendor/wpmetabox/meta-box/inc/walkers/select-tree.php @@ -1,18 +1,14 @@ parent ) ? $option->parent : 0; + $parent = $option->parent ?? 0; $children[ $parent ][] = $option; } diff --git a/vendor/wpmetabox/meta-box/inc/walkers/select.php b/vendor/wpmetabox/meta-box/inc/walkers/select.php index a0468d26d..727877840 100644 --- a/vendor/wpmetabox/meta-box/inc/walkers/select.php +++ b/vendor/wpmetabox/meta-box/inc/walkers/select.php @@ -1,12 +1,8 @@ { + $( e.target ).find( '.rwmb-date' ).each( transform ); + }, 0 ); } rwmb.$document diff --git a/vendor/wpmetabox/meta-box/js/datetime.js b/vendor/wpmetabox/meta-box/js/datetime.js index e4e94140c..a97a39427 100644 --- a/vendor/wpmetabox/meta-box/js/datetime.js +++ b/vendor/wpmetabox/meta-box/js/datetime.js @@ -79,7 +79,14 @@ } function init( e ) { - $( e.target ).find( '.rwmb-datetime' ).each( transform ); + /** + * WordPress sets localized data for jQuery UI datepicker at document ready. + * Using setTimeout to ensure the code runs after the localized data is set. + * @link https://wordpress.org/support/topic/inline-date-field-not-localization/ + */ + setTimeout( () => { + $( e.target ).find( '.rwmb-datetime' ).each( transform ); + }, 0 ); } setTimeI18n(); diff --git a/vendor/wpmetabox/meta-box/js/file.js b/vendor/wpmetabox/meta-box/js/file.js index 03b62df32..743240142 100644 --- a/vendor/wpmetabox/meta-box/js/file.js +++ b/vendor/wpmetabox/meta-box/js/file.js @@ -54,7 +54,7 @@ object_id: $metaBox.data( 'object-id' ), attachment_id: $this.data( 'attachment_id' ) }, function ( response ) { - if ( ! response.success ) { + if ( !response.success ) { alert( response.data ); } }, 'json' ); @@ -71,7 +71,7 @@ ui.placeholder.height( ui.helper.outerHeight() ); ui.placeholder.width( ui.helper.outerWidth() ); }, - update: function( event, ui ) { + update: function ( event, ui ) { ui.item.find( rwmb.inputSelectors ).first().trigger( 'mb_change' ); } } ); @@ -98,23 +98,25 @@ }; // Reset field when cloning. - file.resetClone = function() { + file.resetClone = function () { var $this = $( this ), $clone = $this.closest( '.rwmb-clone' ), - $list = $clone.find( '.rwmb-files' ), - $key = $clone.find( '.rwmb-file-index' ), - inputName = '_file_' + rwmb.uniqid(); + $list = $clone.find( '.rwmb-files' ); $list.empty(); - $clone.find( '.rwmb-file-input' ).attr( 'name', inputName + '[]' ).not( ':first' ).remove(); - $key.val( inputName ); + $clone.find( '.rwmb-file-new' ).each( function () { + var inputName = '_file_' + rwmb.uniqid(), + $key = $( this ).siblings( '.rwmb-file-index' ); + $( this ).find( '.rwmb-file-input' ).attr( 'name', inputName + '[]' ).not( ':first' ).remove(); + $key.val( inputName ); + } ); file.updateVisibility.call( $list ); }; // Set 'required' attribute. 'this' is the wrapper field input. - file.setRequired = function() { + file.setRequired = function () { var $this = $( this ), $uploaded = $this.find( '.rwmb-files' ), $inputs = $this.find( '.rwmb-file-new input' ); diff --git a/vendor/wpmetabox/meta-box/js/input-list.js b/vendor/wpmetabox/meta-box/js/input-list.js index d13fdd78b..ad9545c8c 100644 --- a/vendor/wpmetabox/meta-box/js/input-list.js +++ b/vendor/wpmetabox/meta-box/js/input-list.js @@ -24,7 +24,7 @@ $this.parent().siblings( '.rwmb-input-list' ).find( 'input' ).prop( 'checked', checked ).trigger( 'change' ); - checked = ! checked; + checked = !checked; $this.data( 'checked', checked ); } diff --git a/vendor/wpmetabox/meta-box/js/map.js b/vendor/wpmetabox/meta-box/js/map.js index ed54eed29..62002664c 100644 --- a/vendor/wpmetabox/meta-box/js/map.js +++ b/vendor/wpmetabox/meta-box/js/map.js @@ -25,41 +25,65 @@ // Initialize DOM elements initDomElements: function () { this.$canvas = this.$container.find( '.rwmb-map-canvas' ); - this.canvas = this.$canvas[0]; + this.canvas = this.$canvas[ 0 ]; this.$coordinate = this.$container.find( '.rwmb-map' ); this.addressField = this.$container.data( 'address-field' ); }, - // Initialize map elements - initMapElements: function () { - var defaultLoc = this.$canvas.data( 'default-loc' ), - latLng; + setCenter: function ( location ) { + if ( !( location instanceof google.maps.LatLng ) ) { + location = new google.maps.LatLng( parseFloat( location.lat ), parseFloat( location.lng ) ); + } + this.map.setCenter( location ); + if ( this.marker ) { + this.marker.setPosition( location ); + return; + } - defaultLoc = defaultLoc ? defaultLoc.split( ',' ) : [53.346881, - 6.258860]; - latLng = new google.maps.LatLng( defaultLoc[0], defaultLoc[1] ); // Initial position for map + this.marker = new google.maps.Marker( { + position: location, + map: this.map, + draggable: true, + } ); + }, + initMapElements: function () { this.map = new google.maps.Map( this.canvas, { - center: latLng, zoom: 14, streetViewControl: 0, mapTypeId: google.maps.MapTypeId.ROADMAP } ); - this.marker = new google.maps.Marker( {position: latLng, map: this.map, draggable: true} ); + + // If there is a saved location, don't set the default location. + if ( this.$coordinate.val() ) { + return; + } + + // Load default location if it's set. + let defaultLoc = this.$canvas.data( 'default-loc' ); + if ( defaultLoc ) { + const [ lat, lng ] = defaultLoc.split( ',' ); + return this.setCenter( { lat, lng } ); + } + + // Set default location to Dublin as a start. + const dublin = { lat: 53.346881, lng: -6.258860 }; + this.setCenter( dublin ); + + // Try to load current user location. Note that Geolocation API works only on HTTPS. + if ( location.protocol.includes( 'https' ) && navigator.geolocation ) { + navigator.geolocation.getCurrentPosition( position => this.setCenter( { lat: position.coords.latitude, lng: position.coords.longitude } ) ); + } }, - // Initialize marker position initMarkerPosition: function () { - var coordinate = this.$coordinate.val(), - location, - zoom; + const coordinate = this.$coordinate.val(); if ( coordinate ) { - location = coordinate.split( ',' ); - this.marker.setPosition( new google.maps.LatLng( location[0], location[1] ) ); - - zoom = location.length > 2 ? parseInt( location[2], 10 ) : 14; + const location = coordinate.split( ',' ); + this.setCenter( { lat: location[ 0 ], lng: location[ 1 ] } ); - this.map.setCenter( this.marker.position ); + const zoom = location.length > 2 ? parseInt( location[ 2 ], 10 ) : 14; this.map.setZoom( zoom ); } else if ( this.addressField ) { this.geocodeAddress( false ); @@ -76,7 +100,7 @@ */ if ( this.addressField.split( ',' ).length > 1 ) { var geocodeAddress = that.geocodeAddress.bind( that ); - var addressFields = this.addressField.split( ',' ).forEach( function( part ) { + var addressFields = this.addressField.split( ',' ).forEach( function ( part ) { var $field = that.findAddressField( part ); if ( null !== $field ) { $field.on( 'change', geocodeAddress ); @@ -111,7 +135,7 @@ }, refresh: function () { - if ( ! this.map ) { + if ( !this.map ) { return; } var zoom = this.map.getZoom(), @@ -142,12 +166,12 @@ source: function ( request, response ) { // if add region only search in that region var options = { - 'input': request.term, + 'input': request.term, 'componentRestrictions': { country: that.$canvas.data( 'region' ) } }; // Change Geocode to getPlacePredictions . autocomplete.getPlacePredictions( options, function ( results ) { - if ( results == null || ! results.length ) { + if ( results == null || !results.length ) { response( [ { value: '', label: i18n.no_results_string @@ -164,17 +188,16 @@ } ); }, select: function ( event, ui ) { - geocoder.geocode( { - 'placeId': ui.item.placeid - }, - function( responses, status ) { - if ( status == 'OK' ) { - var latLng = new google.maps.LatLng( responses[0].geometry.location.lat(), responses[0].geometry.location.lng() ); - that.map.setCenter( latLng ); - that.marker.setPosition( latLng ); - that.updateCoordinate( latLng ); - } - } ); + geocoder.geocode( { + 'placeId': ui.item.placeid + }, + function ( responses, status ) { + if ( status == 'OK' ) { + const latLng = new google.maps.LatLng( responses[ 0 ].geometry.location.lat(), responses[ 0 ].geometry.location.lng() ); + that.setCenter( latLng ); + that.updateCoordinate( latLng ); + } + } ); } } ); }, @@ -189,41 +212,40 @@ geocodeAddress: function ( notify ) { var address = this.getAddress(), that = this; - if ( ! address ) { + if ( !address ) { return; } if ( false !== notify ) { notify = true; } - geocoder.geocode( {'address': address}, function ( results, status ) { + geocoder.geocode( { 'address': address }, function ( results, status ) { if ( status !== google.maps.GeocoderStatus.OK ) { if ( notify ) { alert( i18n.no_results_string ); } return; } - that.map.setCenter( results[0].geometry.location ); - that.marker.setPosition( results[0].geometry.location ); - that.updateCoordinate( results[0].geometry.location ); + that.setCenter( results[ 0 ].geometry.location ); + that.updateCoordinate( results[ 0 ].geometry.location ); } ); }, // Get the address field. - getAddressField: function() { + getAddressField: function () { // No address field or more than 1 address fields, ignore - if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) { + if ( !this.addressField || this.addressField.split( ',' ).length > 1 ) { return null; } return this.findAddressField( this.addressField ); }, // Get the address value for geocoding. - getAddress: function() { + getAddress: function () { var that = this; return this.addressField.split( ',' ) - .map( function( part ) { + .map( function ( part ) { part = that.findAddressField( part ); return null === part ? '' : part.val(); } ) @@ -231,9 +253,9 @@ }, // Find address field based on its name attribute. Auto search inside groups when needed. - findAddressField: function( fieldName ) { + findAddressField: function ( fieldName ) { // Not in a group. - var $address = $( 'input[name="' + fieldName + '"]'); + var $address = $( 'input[name="' + fieldName + '"]' ); if ( $address.length ) { return $address; } diff --git a/vendor/wpmetabox/meta-box/js/media.js b/vendor/wpmetabox/meta-box/js/media.js index e983d08ed..60a961c1c 100644 --- a/vendor/wpmetabox/meta-box/js/media.js +++ b/vendor/wpmetabox/meta-box/js/media.js @@ -135,7 +135,7 @@ collection.reset(); } ); - collection.on( 'add remove reset', _.debounce( function () { + collection.on( 'all', _.debounce( function() { var ids = collection.pluck( 'id' ).join( ',' ); that.$input.val( ids ).trigger( 'change', [that.$( '.rwmb-media-input' )] ); }, 500 ) ); diff --git a/vendor/wpmetabox/meta-box/js/modal.js b/vendor/wpmetabox/meta-box/js/modal.js new file mode 100644 index 000000000..aff158833 --- /dev/null +++ b/vendor/wpmetabox/meta-box/js/modal.js @@ -0,0 +1,132 @@ +( function ( $, rwmb ) { + 'use strict'; + + const $body = $( 'body' ); + + const defaultOptions = { + wrapper: `
    +
    +

    + +
    +
    +
    `, + markupIframe: '', + markupOverlay: '
    ', + removeElement: '', + removeElementDefault: '#adminmenumain, #wpadminbar, #wpfooter, .row-actions, .form-wrap.edit-term-notes, #screen-meta-links, .wp-heading-inline, .wp-header-end', + callback: null, + closeModalCallback: null, + isBlockEditor: false, + $objectId: null, + $objectDisplay: null + }; + + $.fn.rwmbModal = function ( options = {} ) { + options = { + ...defaultOptions, + ...options + }; + + if ( $( '.rwmb-modal' ).length === 0 ) { + return; + } + + const $this = $( this ), + $modal = $( '.rwmb-modal' ); + + let $input = $this.closest( '.rwmb-input' ); + if ( $input.find( '.rwmb-clone' ).length > 0 && $this.closest( '.rwmb-clone' ).length > 0 ) { + $input = $this.closest( '.rwmb-clone' ); + } + + $this.click( function ( e ) { + e.preventDefault(); + + $modal.find( '.rwmb-modal-title h2' ).html( $this.html() ); + $modal.find( '.rwmb-modal-content' ).html( options.markupIframe.replace( '{URL}', $this.data( 'url' ) ) ); + $( '#rwmb-modal-iframe' ).on( 'load', function () { + const $contents = $( this ).contents(); + options.isBlockEditor = $contents.find( 'body' ).hasClass( 'block-editor-page' ); + + if ( options.removeElement !== '' ) { + $contents.find( options.removeElement ).remove(); + } + + $modal.find( '.rwmb-modal-title' ).css( 'background-color', '' ); + if ( options.isBlockEditor ) { + $modal.find( '.rwmb-modal-title' ).css( 'background-color', '#fff' ); + } + + $contents + .find( options.removeElementDefault ).remove().end() + .find( '.rwmb-modal-add-button' ).parent().remove(); + $contents.find( 'html' ).css( 'padding-top', 0 ).end() + .find( '#wpcontent' ).css( 'margin-left', 0 ).end() + .find( 'a' ).on( 'click', e => e.preventDefault() ); + + if ( options.callback !== null && typeof options.callback === 'function' ) { + options.callback( $modal, $contents ); + } + + $body.addClass( 'rwmb-modal-show' ); + $( '.rwmb-modal-overlay' ).fadeIn( 'medium' ); + $modal.fadeIn( 'medium' ); + + return false; + } ); + + $( '.rwmb-modal-close' ).on( 'click', function ( event ) { + if ( options.closeModalCallback !== null && typeof options.closeModalCallback === 'function' ) { + options.closeModalCallback( $( '#rwmb-modal-iframe' ).contents(), $input ); + } + + $modal.fadeOut( 'medium' ); + $( '.rwmb-modal-overlay' ).fadeOut( 'medium' ); + $body.removeClass( 'rwmb-modal-show' ); + + // If not add new + if ( !options.$objectId || !options.$objectDisplay ) { + $( this ).off( event ); + return; + } + + // Select, select advanced, select tree. + const $select = $input.find( 'select' ); + if ( $select.length > 0 ) { + $select.prepend( $( '
    ")}}]),e}(),r=function(t){_inherits(a,t);var e=_createSuper(a);function a(){return _classCallCheck(this,a),e.apply(this,arguments)}return _createClass(a,[{key:"init",value:function(){var t=this,e=wp.data.dispatch("core/editor"),i=e.savePost;e.savePost=function(e){"object"===_typeof(e)&&e.isPreview?i(e):(t.$form.validate(t.settings),t.$form.valid()&&i(e))}}},{key:"showMessage",value:function(){wp.data.dispatch("core/notices").createErrorNotice(i.message,{id:"meta-box-validation",isDismissible:!0})}}]),a}(a);t((function(){if(e.isGutenberg){var i=new r(".metabox-location-advanced"),n=new r(".metabox-location-normal");return new r(".metabox-location-side").init(),n.init(),void i.init()}t("#post, #edittag, #your-profile, .rwmb-form").each((function(){new a(this).init()}))}))}(jQuery,rwmb,rwmbValidation); \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/js/validation/additional-methods.js b/vendor/wpmetabox/meta-box/js/validation/additional-methods.js deleted file mode 100644 index 168cc6df8..000000000 --- a/vendor/wpmetabox/meta-box/js/validation/additional-methods.js +++ /dev/null @@ -1,1512 +0,0 @@ -/*! - * jQuery Validation Plugin v1.19.1 - * - * https://jqueryvalidation.org/ - * - * Copyright (c) 2019 Jörn Zaefferer - * Released under the MIT license - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery", "./jquery.validate"], factory ); - } else if (typeof module === "object" && module.exports) { - module.exports = factory( require( "jquery" ) ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -( function() { - - function stripHtml( value ) { - - // Remove html tags and space chars - return value.replace( /<.[^<>]*?>/g, " " ).replace( / | /gi, " " ) - - // Remove punctuation - .replace( /[.(),;:!?%#$'\"_+=\/\-“”’]*/g, "" ); - } - - $.validator.addMethod( "maxWords", function( value, element, params ) { - return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length <= params; - }, $.validator.format( "Please enter {0} words or less." ) ); - - $.validator.addMethod( "minWords", function( value, element, params ) { - return this.optional( element ) || stripHtml( value ).match( /\b\w+\b/g ).length >= params; - }, $.validator.format( "Please enter at least {0} words." ) ); - - $.validator.addMethod( "rangeWords", function( value, element, params ) { - var valueStripped = stripHtml( value ), - regex = /\b\w+\b/g; - return this.optional( element ) || valueStripped.match( regex ).length >= params[ 0 ] && valueStripped.match( regex ).length <= params[ 1 ]; - }, $.validator.format( "Please enter between {0} and {1} words." ) ); - -}() ); - -/** - * This is used in the United States to process payments, deposits, - * or transfers using the Automated Clearing House (ACH) or Fedwire - * systems. A very common use case would be to validate a form for - * an ACH bill payment. - */ -$.validator.addMethod( "abaRoutingNumber", function( value ) { - var checksum = 0; - var tokens = value.split( "" ); - var length = tokens.length; - - // Length Check - if ( length !== 9 ) { - return false; - } - - // Calc the checksum - // https://en.wikipedia.org/wiki/ABA_routing_transit_number - for ( var i = 0; i < length; i += 3 ) { - checksum += parseInt( tokens[ i ], 10 ) * 3 + - parseInt( tokens[ i + 1 ], 10 ) * 7 + - parseInt( tokens[ i + 2 ], 10 ); - } - - // If not zero and divisible by 10 then valid - if ( checksum !== 0 && checksum % 10 === 0 ) { - return true; - } - - return false; -}, "Please enter a valid routing number." ); - -// Accept a value from a file input based on a required mimetype -$.validator.addMethod( "accept", function( value, element, param ) { - - // Split mime on commas in case we have multiple types we can accept - var typeParam = typeof param === "string" ? param.replace( /\s/g, "" ) : "image/*", - optionalValue = this.optional( element ), - i, file, regex; - - // Element is optional - if ( optionalValue ) { - return optionalValue; - } - - if ( $( element ).attr( "type" ) === "file" ) { - - // Escape string to be used in the regex - // see: https://stackoverflow.com/questions/3446170/escape-string-for-use-in-javascript-regex - // Escape also "/*" as "/.*" as a wildcard - typeParam = typeParam - .replace( /[\-\[\]\/\{\}\(\)\+\?\.\\\^\$\|]/g, "\\$&" ) - .replace( /,/g, "|" ) - .replace( /\/\*/g, "/.*" ); - - // Check if the element has a FileList before checking each file - if ( element.files && element.files.length ) { - regex = new RegExp( ".?(" + typeParam + ")$", "i" ); - for ( i = 0; i < element.files.length; i++ ) { - file = element.files[ i ]; - - // Grab the mimetype from the loaded file, verify it matches - if ( !file.type.match( regex ) ) { - return false; - } - } - } - } - - // Either return true because we've validated each file, or because the - // browser does not support element.files and the FileList feature - return true; -}, $.validator.format( "Please enter a value with a valid mimetype." ) ); - -$.validator.addMethod( "alphanumeric", function( value, element ) { - return this.optional( element ) || /^\w+$/i.test( value ); -}, "Letters, numbers, and underscores only please" ); - -/* - * Dutch bank account numbers (not 'giro' numbers) have 9 digits - * and pass the '11 check'. - * We accept the notation with spaces, as that is common. - * acceptable: 123456789 or 12 34 56 789 - */ -$.validator.addMethod( "bankaccountNL", function( value, element ) { - if ( this.optional( element ) ) { - return true; - } - if ( !( /^[0-9]{9}|([0-9]{2} ){3}[0-9]{3}$/.test( value ) ) ) { - return false; - } - - // Now '11 check' - var account = value.replace( / /g, "" ), // Remove spaces - sum = 0, - len = account.length, - pos, factor, digit; - for ( pos = 0; pos < len; pos++ ) { - factor = len - pos; - digit = account.substring( pos, pos + 1 ); - sum = sum + factor * digit; - } - return sum % 11 === 0; -}, "Please specify a valid bank account number" ); - -$.validator.addMethod( "bankorgiroaccountNL", function( value, element ) { - return this.optional( element ) || - ( $.validator.methods.bankaccountNL.call( this, value, element ) ) || - ( $.validator.methods.giroaccountNL.call( this, value, element ) ); -}, "Please specify a valid bank or giro account number" ); - -/** - * BIC is the business identifier code (ISO 9362). This BIC check is not a guarantee for authenticity. - * - * BIC pattern: BBBBCCLLbbb (8 or 11 characters long; bbb is optional) - * - * Validation is case-insensitive. Please make sure to normalize input yourself. - * - * BIC definition in detail: - * - First 4 characters - bank code (only letters) - * - Next 2 characters - ISO 3166-1 alpha-2 country code (only letters) - * - Next 2 characters - location code (letters and digits) - * a. shall not start with '0' or '1' - * b. second character must be a letter ('O' is not allowed) or digit ('0' for test (therefore not allowed), '1' denoting passive participant, '2' typically reverse-billing) - * - Last 3 characters - branch code, optional (shall not start with 'X' except in case of 'XXX' for primary office) (letters and digits) - */ -$.validator.addMethod( "bic", function( value, element ) { - return this.optional( element ) || /^([A-Z]{6}[A-Z2-9][A-NP-Z1-9])(X{3}|[A-WY-Z0-9][A-Z0-9]{2})?$/.test( value.toUpperCase() ); -}, "Please specify a valid BIC code" ); - -/* - * Código de identificación fiscal ( CIF ) is the tax identification code for Spanish legal entities - * Further rules can be found in Spanish on http://es.wikipedia.org/wiki/C%C3%B3digo_de_identificaci%C3%B3n_fiscal - * - * Spanish CIF structure: - * - * [ T ][ P ][ P ][ N ][ N ][ N ][ N ][ N ][ C ] - * - * Where: - * - * T: 1 character. Kind of Organization Letter: [ABCDEFGHJKLMNPQRSUVW] - * P: 2 characters. Province. - * N: 5 characters. Secuencial Number within the province. - * C: 1 character. Control Digit: [0-9A-J]. - * - * [ T ]: Kind of Organizations. Possible values: - * - * A. Corporations - * B. LLCs - * C. General partnerships - * D. Companies limited partnerships - * E. Communities of goods - * F. Cooperative Societies - * G. Associations - * H. Communities of homeowners in horizontal property regime - * J. Civil Societies - * K. Old format - * L. Old format - * M. Old format - * N. Nonresident entities - * P. Local authorities - * Q. Autonomous bodies, state or not, and the like, and congregations and religious institutions - * R. Congregations and religious institutions (since 2008 ORDER EHA/451/2008) - * S. Organs of State Administration and regions - * V. Agrarian Transformation - * W. Permanent establishments of non-resident in Spain - * - * [ C ]: Control Digit. It can be a number or a letter depending on T value: - * [ T ] --> [ C ] - * ------ ---------- - * A Number - * B Number - * E Number - * H Number - * K Letter - * P Letter - * Q Letter - * S Letter - * - */ -$.validator.addMethod( "cifES", function( value, element ) { - "use strict"; - - if ( this.optional( element ) ) { - return true; - } - - var cifRegEx = new RegExp( /^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/gi ); - var letter = value.substring( 0, 1 ), // [ T ] - number = value.substring( 1, 8 ), // [ P ][ P ][ N ][ N ][ N ][ N ][ N ] - control = value.substring( 8, 9 ), // [ C ] - all_sum = 0, - even_sum = 0, - odd_sum = 0, - i, n, - control_digit, - control_letter; - - function isOdd( n ) { - return n % 2 === 0; - } - - // Quick format test - if ( value.length !== 9 || !cifRegEx.test( value ) ) { - return false; - } - - for ( i = 0; i < number.length; i++ ) { - n = parseInt( number[ i ], 10 ); - - // Odd positions - if ( isOdd( i ) ) { - - // Odd positions are multiplied first. - n *= 2; - - // If the multiplication is bigger than 10 we need to adjust - odd_sum += n < 10 ? n : n - 9; - - // Even positions - // Just sum them - } else { - even_sum += n; - } - } - - all_sum = even_sum + odd_sum; - control_digit = ( 10 - ( all_sum ).toString().substr( -1 ) ).toString(); - control_digit = parseInt( control_digit, 10 ) > 9 ? "0" : control_digit; - control_letter = "JABCDEFGHI".substr( control_digit, 1 ).toString(); - - // Control must be a digit - if ( letter.match( /[ABEH]/ ) ) { - return control === control_digit; - - // Control must be a letter - } else if ( letter.match( /[KPQS]/ ) ) { - return control === control_letter; - } - - // Can be either - return control === control_digit || control === control_letter; - -}, "Please specify a valid CIF number." ); - -/* - * Brazillian CNH number (Carteira Nacional de Habilitacao) is the License Driver number. - * CNH numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. - */ -$.validator.addMethod( "cnhBR", function( value ) { - - // Removing special characters from value - value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); - - // Checking value to have 11 digits only - if ( value.length !== 11 ) { - return false; - } - - var sum = 0, dsc = 0, firstChar, - firstCN, secondCN, i, j, v; - - firstChar = value.charAt( 0 ); - - if ( new Array( 12 ).join( firstChar ) === value ) { - return false; - } - - // Step 1 - using first Check Number: - for ( i = 0, j = 9, v = 0; i < 9; ++i, --j ) { - sum += +( value.charAt( i ) * j ); - } - - firstCN = sum % 11; - if ( firstCN >= 10 ) { - firstCN = 0; - dsc = 2; - } - - sum = 0; - for ( i = 0, j = 1, v = 0; i < 9; ++i, ++j ) { - sum += +( value.charAt( i ) * j ); - } - - secondCN = sum % 11; - if ( secondCN >= 10 ) { - secondCN = 0; - } else { - secondCN = secondCN - dsc; - } - - return ( String( firstCN ).concat( secondCN ) === value.substr( -2 ) ); - -}, "Please specify a valid CNH number" ); - -/* - * Brazillian value number (Cadastrado de Pessoas Juridica). - * value numbers have 14 digits in total: 12 numbers followed by 2 check numbers that are being used for validation. - */ -$.validator.addMethod( "cnpjBR", function( value, element ) { - "use strict"; - - if ( this.optional( element ) ) { - return true; - } - - // Removing no number - value = value.replace( /[^\d]+/g, "" ); - - // Checking value to have 14 digits only - if ( value.length !== 14 ) { - return false; - } - - // Elimina values invalidos conhecidos - if ( value === "00000000000000" || - value === "11111111111111" || - value === "22222222222222" || - value === "33333333333333" || - value === "44444444444444" || - value === "55555555555555" || - value === "66666666666666" || - value === "77777777777777" || - value === "88888888888888" || - value === "99999999999999" ) { - return false; - } - - // Valida DVs - var tamanho = ( value.length - 2 ); - var numeros = value.substring( 0, tamanho ); - var digitos = value.substring( tamanho ); - var soma = 0; - var pos = tamanho - 7; - - for ( var i = tamanho; i >= 1; i-- ) { - soma += numeros.charAt( tamanho - i ) * pos--; - if ( pos < 2 ) { - pos = 9; - } - } - - var resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; - - if ( resultado !== parseInt( digitos.charAt( 0 ), 10 ) ) { - return false; - } - - tamanho = tamanho + 1; - numeros = value.substring( 0, tamanho ); - soma = 0; - pos = tamanho - 7; - - for ( var il = tamanho; il >= 1; il-- ) { - soma += numeros.charAt( tamanho - il ) * pos--; - if ( pos < 2 ) { - pos = 9; - } - } - - resultado = soma % 11 < 2 ? 0 : 11 - soma % 11; - - if ( resultado !== parseInt( digitos.charAt( 1 ), 10 ) ) { - return false; - } - - return true; - -}, "Please specify a CNPJ value number" ); - -/* - * Brazillian CPF number (Cadastrado de Pessoas Físicas) is the equivalent of a Brazilian tax registration number. - * CPF numbers have 11 digits in total: 9 numbers followed by 2 check numbers that are being used for validation. - */ -$.validator.addMethod( "cpfBR", function( value, element ) { - "use strict"; - - if ( this.optional( element ) ) { - return true; - } - - // Removing special characters from value - value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); - - // Checking value to have 11 digits only - if ( value.length !== 11 ) { - return false; - } - - var sum = 0, - firstCN, secondCN, checkResult, i; - - firstCN = parseInt( value.substring( 9, 10 ), 10 ); - secondCN = parseInt( value.substring( 10, 11 ), 10 ); - - checkResult = function( sum, cn ) { - var result = ( sum * 10 ) % 11; - if ( ( result === 10 ) || ( result === 11 ) ) { - result = 0; - } - return ( result === cn ); - }; - - // Checking for dump data - if ( value === "" || - value === "00000000000" || - value === "11111111111" || - value === "22222222222" || - value === "33333333333" || - value === "44444444444" || - value === "55555555555" || - value === "66666666666" || - value === "77777777777" || - value === "88888888888" || - value === "99999999999" - ) { - return false; - } - - // Step 1 - using first Check Number: - for ( i = 1; i <= 9; i++ ) { - sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 11 - i ); - } - - // If first Check Number (CN) is valid, move to Step 2 - using second Check Number: - if ( checkResult( sum, firstCN ) ) { - sum = 0; - for ( i = 1; i <= 10; i++ ) { - sum = sum + parseInt( value.substring( i - 1, i ), 10 ) * ( 12 - i ); - } - return checkResult( sum, secondCN ); - } - return false; - -}, "Please specify a valid CPF number" ); - -// https://jqueryvalidation.org/creditcard-method/ -// based on https://en.wikipedia.org/wiki/Luhn_algorithm -$.validator.addMethod( "creditcard", function( value, element ) { - if ( this.optional( element ) ) { - return "dependency-mismatch"; - } - - // Accept only spaces, digits and dashes - if ( /[^0-9 \-]+/.test( value ) ) { - return false; - } - - var nCheck = 0, - nDigit = 0, - bEven = false, - n, cDigit; - - value = value.replace( /\D/g, "" ); - - // Basing min and max length on - // https://dev.ean.com/general-info/valid-card-types/ - if ( value.length < 13 || value.length > 19 ) { - return false; - } - - for ( n = value.length - 1; n >= 0; n-- ) { - cDigit = value.charAt( n ); - nDigit = parseInt( cDigit, 10 ); - if ( bEven ) { - if ( ( nDigit *= 2 ) > 9 ) { - nDigit -= 9; - } - } - - nCheck += nDigit; - bEven = !bEven; - } - - return ( nCheck % 10 ) === 0; -}, "Please enter a valid credit card number." ); - -/* NOTICE: Modified version of Castle.Components.Validator.CreditCardValidator - * Redistributed under the Apache License 2.0 at http://www.apache.org/licenses/LICENSE-2.0 - * Valid Types: mastercard, visa, amex, dinersclub, enroute, discover, jcb, unknown, all (overrides all other settings) - */ -$.validator.addMethod( "creditcardtypes", function( value, element, param ) { - if ( /[^0-9\-]+/.test( value ) ) { - return false; - } - - value = value.replace( /\D/g, "" ); - - var validTypes = 0x0000; - - if ( param.mastercard ) { - validTypes |= 0x0001; - } - if ( param.visa ) { - validTypes |= 0x0002; - } - if ( param.amex ) { - validTypes |= 0x0004; - } - if ( param.dinersclub ) { - validTypes |= 0x0008; - } - if ( param.enroute ) { - validTypes |= 0x0010; - } - if ( param.discover ) { - validTypes |= 0x0020; - } - if ( param.jcb ) { - validTypes |= 0x0040; - } - if ( param.unknown ) { - validTypes |= 0x0080; - } - if ( param.all ) { - validTypes = 0x0001 | 0x0002 | 0x0004 | 0x0008 | 0x0010 | 0x0020 | 0x0040 | 0x0080; - } - if ( validTypes & 0x0001 && ( /^(5[12345])/.test( value ) || /^(2[234567])/.test( value ) ) ) { // Mastercard - return value.length === 16; - } - if ( validTypes & 0x0002 && /^(4)/.test( value ) ) { // Visa - return value.length === 16; - } - if ( validTypes & 0x0004 && /^(3[47])/.test( value ) ) { // Amex - return value.length === 15; - } - if ( validTypes & 0x0008 && /^(3(0[012345]|[68]))/.test( value ) ) { // Dinersclub - return value.length === 14; - } - if ( validTypes & 0x0010 && /^(2(014|149))/.test( value ) ) { // Enroute - return value.length === 15; - } - if ( validTypes & 0x0020 && /^(6011)/.test( value ) ) { // Discover - return value.length === 16; - } - if ( validTypes & 0x0040 && /^(3)/.test( value ) ) { // Jcb - return value.length === 16; - } - if ( validTypes & 0x0040 && /^(2131|1800)/.test( value ) ) { // Jcb - return value.length === 15; - } - if ( validTypes & 0x0080 ) { // Unknown - return true; - } - return false; -}, "Please enter a valid credit card number." ); - -/** - * Validates currencies with any given symbols by @jameslouiz - * Symbols can be optional or required. Symbols required by default - * - * Usage examples: - * currency: ["£", false] - Use false for soft currency validation - * currency: ["$", false] - * currency: ["RM", false] - also works with text based symbols such as "RM" - Malaysia Ringgit etc - * - * - * - * Soft symbol checking - * currencyInput: { - * currency: ["$", false] - * } - * - * Strict symbol checking (default) - * currencyInput: { - * currency: "$" - * //OR - * currency: ["$", true] - * } - * - * Multiple Symbols - * currencyInput: { - * currency: "$,£,¢" - * } - */ -$.validator.addMethod( "currency", function( value, element, param ) { - var isParamString = typeof param === "string", - symbol = isParamString ? param : param[ 0 ], - soft = isParamString ? true : param[ 1 ], - regex; - - symbol = symbol.replace( /,/g, "" ); - symbol = soft ? symbol + "]" : symbol + "]?"; - regex = "^[" + symbol + "([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,2})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,2})?|0(\\.[0-9]{0,2})?|(\\.[0-9]{1,2})?)$"; - regex = new RegExp( regex ); - return this.optional( element ) || regex.test( value ); - -}, "Please specify a valid currency" ); - -$.validator.addMethod( "dateFA", function( value, element ) { - return this.optional( element ) || /^[1-4]\d{3}\/((0?[1-6]\/((3[0-1])|([1-2][0-9])|(0?[1-9])))|((1[0-2]|(0?[7-9]))\/(30|([1-2][0-9])|(0?[1-9]))))$/.test( value ); -}, $.validator.messages.date ); - -/** - * Return true, if the value is a valid date, also making this formal check dd/mm/yyyy. - * - * @example $.validator.methods.date("01/01/1900") - * @result true - * - * @example $.validator.methods.date("01/13/1990") - * @result false - * - * @example $.validator.methods.date("01.01.1900") - * @result false - * - * @example - * @desc Declares an optional input element whose value must be a valid date. - * - * @name $.validator.methods.dateITA - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod( "dateITA", function( value, element ) { - var check = false, - re = /^\d{1,2}\/\d{1,2}\/\d{4}$/, - adata, gg, mm, aaaa, xdata; - if ( re.test( value ) ) { - adata = value.split( "/" ); - gg = parseInt( adata[ 0 ], 10 ); - mm = parseInt( adata[ 1 ], 10 ); - aaaa = parseInt( adata[ 2 ], 10 ); - xdata = new Date( Date.UTC( aaaa, mm - 1, gg, 12, 0, 0, 0 ) ); - if ( ( xdata.getUTCFullYear() === aaaa ) && ( xdata.getUTCMonth() === mm - 1 ) && ( xdata.getUTCDate() === gg ) ) { - check = true; - } else { - check = false; - } - } else { - check = false; - } - return this.optional( element ) || check; -}, $.validator.messages.date ); - -$.validator.addMethod( "dateNL", function( value, element ) { - return this.optional( element ) || /^(0?[1-9]|[12]\d|3[01])[\.\/\-](0?[1-9]|1[012])[\.\/\-]([12]\d)?(\d\d)$/.test( value ); -}, $.validator.messages.date ); - -// Older "accept" file extension method. Old docs: http://docs.jquery.com/Plugins/Validation/Methods/accept -$.validator.addMethod( "extension", function( value, element, param ) { - param = typeof param === "string" ? param.replace( /,/g, "|" ) : "png|jpe?g|gif"; - return this.optional( element ) || value.match( new RegExp( "\\.(" + param + ")$", "i" ) ); -}, $.validator.format( "Please enter a value with a valid extension." ) ); - -/** - * Dutch giro account numbers (not bank numbers) have max 7 digits - */ -$.validator.addMethod( "giroaccountNL", function( value, element ) { - return this.optional( element ) || /^[0-9]{1,7}$/.test( value ); -}, "Please specify a valid giro account number" ); - -$.validator.addMethod( "greaterThan", function( value, element, param ) { - var target = $( param ); - - if ( this.settings.onfocusout && target.not( ".validate-greaterThan-blur" ).length ) { - target.addClass( "validate-greaterThan-blur" ).on( "blur.validate-greaterThan", function() { - $( element ).valid(); - } ); - } - - return value > target.val(); -}, "Please enter a greater value." ); - -$.validator.addMethod( "greaterThanEqual", function( value, element, param ) { - var target = $( param ); - - if ( this.settings.onfocusout && target.not( ".validate-greaterThanEqual-blur" ).length ) { - target.addClass( "validate-greaterThanEqual-blur" ).on( "blur.validate-greaterThanEqual", function() { - $( element ).valid(); - } ); - } - - return value >= target.val(); -}, "Please enter a greater value." ); - -/** - * IBAN is the international bank account number. - * It has a country - specific format, that is checked here too - * - * Validation is case-insensitive. Please make sure to normalize input yourself. - */ -$.validator.addMethod( "iban", function( value, element ) { - - // Some quick simple tests to prevent needless work - if ( this.optional( element ) ) { - return true; - } - - // Remove spaces and to upper case - var iban = value.replace( / /g, "" ).toUpperCase(), - ibancheckdigits = "", - leadingZeroes = true, - cRest = "", - cOperator = "", - countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p; - - // Check for IBAN code length. - // It contains: - // country code ISO 3166-1 - two letters, - // two check digits, - // Basic Bank Account Number (BBAN) - up to 30 chars - var minimalIBANlength = 5; - if ( iban.length < minimalIBANlength ) { - return false; - } - - // Check the country code and find the country specific format - countrycode = iban.substring( 0, 2 ); - bbancountrypatterns = { - "AL": "\\d{8}[\\dA-Z]{16}", - "AD": "\\d{8}[\\dA-Z]{12}", - "AT": "\\d{16}", - "AZ": "[\\dA-Z]{4}\\d{20}", - "BE": "\\d{12}", - "BH": "[A-Z]{4}[\\dA-Z]{14}", - "BA": "\\d{16}", - "BR": "\\d{23}[A-Z][\\dA-Z]", - "BG": "[A-Z]{4}\\d{6}[\\dA-Z]{8}", - "CR": "\\d{17}", - "HR": "\\d{17}", - "CY": "\\d{8}[\\dA-Z]{16}", - "CZ": "\\d{20}", - "DK": "\\d{14}", - "DO": "[A-Z]{4}\\d{20}", - "EE": "\\d{16}", - "FO": "\\d{14}", - "FI": "\\d{14}", - "FR": "\\d{10}[\\dA-Z]{11}\\d{2}", - "GE": "[\\dA-Z]{2}\\d{16}", - "DE": "\\d{18}", - "GI": "[A-Z]{4}[\\dA-Z]{15}", - "GR": "\\d{7}[\\dA-Z]{16}", - "GL": "\\d{14}", - "GT": "[\\dA-Z]{4}[\\dA-Z]{20}", - "HU": "\\d{24}", - "IS": "\\d{22}", - "IE": "[\\dA-Z]{4}\\d{14}", - "IL": "\\d{19}", - "IT": "[A-Z]\\d{10}[\\dA-Z]{12}", - "KZ": "\\d{3}[\\dA-Z]{13}", - "KW": "[A-Z]{4}[\\dA-Z]{22}", - "LV": "[A-Z]{4}[\\dA-Z]{13}", - "LB": "\\d{4}[\\dA-Z]{20}", - "LI": "\\d{5}[\\dA-Z]{12}", - "LT": "\\d{16}", - "LU": "\\d{3}[\\dA-Z]{13}", - "MK": "\\d{3}[\\dA-Z]{10}\\d{2}", - "MT": "[A-Z]{4}\\d{5}[\\dA-Z]{18}", - "MR": "\\d{23}", - "MU": "[A-Z]{4}\\d{19}[A-Z]{3}", - "MC": "\\d{10}[\\dA-Z]{11}\\d{2}", - "MD": "[\\dA-Z]{2}\\d{18}", - "ME": "\\d{18}", - "NL": "[A-Z]{4}\\d{10}", - "NO": "\\d{11}", - "PK": "[\\dA-Z]{4}\\d{16}", - "PS": "[\\dA-Z]{4}\\d{21}", - "PL": "\\d{24}", - "PT": "\\d{21}", - "RO": "[A-Z]{4}[\\dA-Z]{16}", - "SM": "[A-Z]\\d{10}[\\dA-Z]{12}", - "SA": "\\d{2}[\\dA-Z]{18}", - "RS": "\\d{18}", - "SK": "\\d{20}", - "SI": "\\d{15}", - "ES": "\\d{20}", - "SE": "\\d{20}", - "CH": "\\d{5}[\\dA-Z]{12}", - "TN": "\\d{20}", - "TR": "\\d{5}[\\dA-Z]{17}", - "AE": "\\d{3}\\d{16}", - "GB": "[A-Z]{4}\\d{14}", - "VG": "[\\dA-Z]{4}\\d{16}" - }; - - bbanpattern = bbancountrypatterns[ countrycode ]; - - // As new countries will start using IBAN in the - // future, we only check if the countrycode is known. - // This prevents false negatives, while almost all - // false positives introduced by this, will be caught - // by the checksum validation below anyway. - // Strict checking should return FALSE for unknown - // countries. - if ( typeof bbanpattern !== "undefined" ) { - ibanregexp = new RegExp( "^[A-Z]{2}\\d{2}" + bbanpattern + "$", "" ); - if ( !( ibanregexp.test( iban ) ) ) { - return false; // Invalid country specific format - } - } - - // Now check the checksum, first convert to digits - ibancheck = iban.substring( 4, iban.length ) + iban.substring( 0, 4 ); - for ( i = 0; i < ibancheck.length; i++ ) { - charAt = ibancheck.charAt( i ); - if ( charAt !== "0" ) { - leadingZeroes = false; - } - if ( !leadingZeroes ) { - ibancheckdigits += "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf( charAt ); - } - } - - // Calculate the result of: ibancheckdigits % 97 - for ( p = 0; p < ibancheckdigits.length; p++ ) { - cChar = ibancheckdigits.charAt( p ); - cOperator = "" + cRest + "" + cChar; - cRest = cOperator % 97; - } - return cRest === 1; -}, "Please specify a valid IBAN" ); - -$.validator.addMethod( "integer", function( value, element ) { - return this.optional( element ) || /^-?\d+$/.test( value ); -}, "A positive or negative non-decimal number please" ); - -$.validator.addMethod( "ipv4", function( value, element ) { - return this.optional( element ) || /^(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)\.(25[0-5]|2[0-4]\d|[01]?\d\d?)$/i.test( value ); -}, "Please enter a valid IP v4 address." ); - -$.validator.addMethod( "ipv6", function( value, element ) { - return this.optional( element ) || /^((([0-9A-Fa-f]{1,4}:){7}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}:[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){5}:([0-9A-Fa-f]{1,4}:)?[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){4}:([0-9A-Fa-f]{1,4}:){0,2}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){3}:([0-9A-Fa-f]{1,4}:){0,3}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){2}:([0-9A-Fa-f]{1,4}:){0,4}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){6}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(([0-9A-Fa-f]{1,4}:){0,5}:((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|(::([0-9A-Fa-f]{1,4}:){0,5}((\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b)\.){3}(\b((25[0-5])|(1\d{2})|(2[0-4]\d)|(\d{1,2}))\b))|([0-9A-Fa-f]{1,4}::([0-9A-Fa-f]{1,4}:){0,5}[0-9A-Fa-f]{1,4})|(::([0-9A-Fa-f]{1,4}:){0,6}[0-9A-Fa-f]{1,4})|(([0-9A-Fa-f]{1,4}:){1,7}:))$/i.test( value ); -}, "Please enter a valid IP v6 address." ); - -$.validator.addMethod( "lessThan", function( value, element, param ) { - var target = $( param ); - - if ( this.settings.onfocusout && target.not( ".validate-lessThan-blur" ).length ) { - target.addClass( "validate-lessThan-blur" ).on( "blur.validate-lessThan", function() { - $( element ).valid(); - } ); - } - - return value < target.val(); -}, "Please enter a lesser value." ); - -$.validator.addMethod( "lessThanEqual", function( value, element, param ) { - var target = $( param ); - - if ( this.settings.onfocusout && target.not( ".validate-lessThanEqual-blur" ).length ) { - target.addClass( "validate-lessThanEqual-blur" ).on( "blur.validate-lessThanEqual", function() { - $( element ).valid(); - } ); - } - - return value <= target.val(); -}, "Please enter a lesser value." ); - -$.validator.addMethod( "lettersonly", function( value, element ) { - return this.optional( element ) || /^[a-z]+$/i.test( value ); -}, "Letters only please" ); - -$.validator.addMethod( "letterswithbasicpunc", function( value, element ) { - return this.optional( element ) || /^[a-z\-.,()'"\s]+$/i.test( value ); -}, "Letters or punctuation only please" ); - -// Limit the number of files in a FileList. -$.validator.addMethod( "maxfiles", function( value, element, param ) { - if ( this.optional( element ) ) { - return true; - } - - if ( $( element ).attr( "type" ) === "file" ) { - if ( element.files && element.files.length > param ) { - return false; - } - } - - return true; -}, $.validator.format( "Please select no more than {0} files." ) ); - -// Limit the size of each individual file in a FileList. -$.validator.addMethod( "maxsize", function( value, element, param ) { - if ( this.optional( element ) ) { - return true; - } - - if ( $( element ).attr( "type" ) === "file" ) { - if ( element.files && element.files.length ) { - for ( var i = 0; i < element.files.length; i++ ) { - if ( element.files[ i ].size > param ) { - return false; - } - } - } - } - - return true; -}, $.validator.format( "File size must not exceed {0} bytes each." ) ); - -// Limit the size of all files in a FileList. -$.validator.addMethod( "maxsizetotal", function( value, element, param ) { - if ( this.optional( element ) ) { - return true; - } - - if ( $( element ).attr( "type" ) === "file" ) { - if ( element.files && element.files.length ) { - var totalSize = 0; - - for ( var i = 0; i < element.files.length; i++ ) { - totalSize += element.files[ i ].size; - if ( totalSize > param ) { - return false; - } - } - } - } - - return true; -}, $.validator.format( "Total size of all files must not exceed {0} bytes." ) ); - - -$.validator.addMethod( "mobileNL", function( value, element ) { - return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)6((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); -}, "Please specify a valid mobile number" ); - -$.validator.addMethod( "mobileRU", function( phone_number, element ) { - var ruPhone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); - return this.optional( element ) || ruPhone_number.length > 9 && /^((\+7|7|8)+([0-9]){10})$/.test( ruPhone_number ); -}, "Please specify a valid mobile number" ); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ -$.validator.addMethod( "mobileUK", function( phone_number, element ) { - phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); - return this.optional( element ) || phone_number.length > 9 && - phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)7(?:[1345789]\d{2}|624)\s?\d{3}\s?\d{3})$/ ); -}, "Please specify a valid mobile number" ); - -$.validator.addMethod( "netmask", function( value, element ) { - return this.optional( element ) || /^(254|252|248|240|224|192|128)\.0\.0\.0|255\.(254|252|248|240|224|192|128|0)\.0\.0|255\.255\.(254|252|248|240|224|192|128|0)\.0|255\.255\.255\.(254|252|248|240|224|192|128|0)/i.test( value ); -}, "Please enter a valid netmask." ); - -/* - * The NIE (Número de Identificación de Extranjero) is a Spanish tax identification number assigned by the Spanish - * authorities to any foreigner. - * - * The NIE is the equivalent of a Spaniards Número de Identificación Fiscal (NIF) which serves as a fiscal - * identification number. The CIF number (Certificado de Identificación Fiscal) is equivalent to the NIF, but applies to - * companies rather than individuals. The NIE consists of an 'X' or 'Y' followed by 7 or 8 digits then another letter. - */ -$.validator.addMethod( "nieES", function( value, element ) { - "use strict"; - - if ( this.optional( element ) ) { - return true; - } - - var nieRegEx = new RegExp( /^[MXYZ]{1}[0-9]{7,8}[TRWAGMYFPDXBNJZSQVHLCKET]{1}$/gi ); - var validChars = "TRWAGMYFPDXBNJZSQVHLCKET", - letter = value.substr( value.length - 1 ).toUpperCase(), - number; - - value = value.toString().toUpperCase(); - - // Quick format test - if ( value.length > 10 || value.length < 9 || !nieRegEx.test( value ) ) { - return false; - } - - // X means same number - // Y means number + 10000000 - // Z means number + 20000000 - value = value.replace( /^[X]/, "0" ) - .replace( /^[Y]/, "1" ) - .replace( /^[Z]/, "2" ); - - number = value.length === 9 ? value.substr( 0, 8 ) : value.substr( 0, 9 ); - - return validChars.charAt( parseInt( number, 10 ) % 23 ) === letter; - -}, "Please specify a valid NIE number." ); - -/* - * The Número de Identificación Fiscal ( NIF ) is the way tax identification used in Spain for individuals - */ -$.validator.addMethod( "nifES", function( value, element ) { - "use strict"; - - if ( this.optional( element ) ) { - return true; - } - - value = value.toUpperCase(); - - // Basic format test - if ( !value.match( "((^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$|^[T]{1}[A-Z0-9]{8}$)|^[0-9]{8}[A-Z]{1}$)" ) ) { - return false; - } - - // Test NIF - if ( /^[0-9]{8}[A-Z]{1}$/.test( value ) ) { - return ( "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 0 ) % 23 ) === value.charAt( 8 ) ); - } - - // Test specials NIF (starts with K, L or M) - if ( /^[KLM]{1}/.test( value ) ) { - return ( value[ 8 ] === "TRWAGMYFPDXBNJZSQVHLCKE".charAt( value.substring( 8, 1 ) % 23 ) ); - } - - return false; - -}, "Please specify a valid NIF number." ); - -/* - * Numer identyfikacji podatkowej ( NIP ) is the way tax identification used in Poland for companies - */ -$.validator.addMethod( "nipPL", function( value ) { - "use strict"; - - value = value.replace( /[^0-9]/g, "" ); - - if ( value.length !== 10 ) { - return false; - } - - var arrSteps = [ 6, 5, 7, 2, 3, 4, 5, 6, 7 ]; - var intSum = 0; - for ( var i = 0; i < 9; i++ ) { - intSum += arrSteps[ i ] * value[ i ]; - } - var int2 = intSum % 11; - var intControlNr = ( int2 === 10 ) ? 0 : int2; - - return ( intControlNr === parseInt( value[ 9 ], 10 ) ); -}, "Please specify a valid NIP number." ); - -/** - * Created for project jquery-validation. - * @Description Brazillian PIS or NIS number (Número de Identificação Social Pis ou Pasep) is the equivalent of a - * Brazilian tax registration number NIS of PIS numbers have 11 digits in total: 10 numbers followed by 1 check numbers - * that are being used for validation. - * @copyright (c) 21/08/2018 13:14, Cleiton da Silva Mendonça - * @author Cleiton da Silva Mendonça - * @link http://gitlab.com/csmendonca Gitlab of Cleiton da Silva Mendonça - * @link http://github.com/csmendonca Github of Cleiton da Silva Mendonça - */ -$.validator.addMethod( "nisBR", function( value ) { - var number; - var cn; - var sum = 0; - var dv; - var count; - var multiplier; - - // Removing special characters from value - value = value.replace( /([~!@#$%^&*()_+=`{}\[\]\-|\\:;'<>,.\/? ])+/g, "" ); - - // Checking value to have 11 digits only - if ( value.length !== 11 ) { - return false; - } - - //Get check number of value - cn = parseInt( value.substring( 10, 11 ), 10 ); - - //Get number with 10 digits of the value - number = parseInt( value.substring( 0, 10 ), 10 ); - - for ( count = 2; count < 12; count++ ) { - multiplier = count; - if ( count === 10 ) { - multiplier = 2; - } - if ( count === 11 ) { - multiplier = 3; - } - sum += ( ( number % 10 ) * multiplier ); - number = parseInt( number / 10, 10 ); - } - dv = ( sum % 11 ); - - if ( dv > 1 ) { - dv = ( 11 - dv ); - } else { - dv = 0; - } - - if ( cn === dv ) { - return true; - } else { - return false; - } -}, "Please specify a valid NIS/PIS number" ); - -$.validator.addMethod( "notEqualTo", function( value, element, param ) { - return this.optional( element ) || !$.validator.methods.equalTo.call( this, value, element, param ); -}, "Please enter a different value, values must not be the same." ); - -$.validator.addMethod( "nowhitespace", function( value, element ) { - return this.optional( element ) || /^\S+$/i.test( value ); -}, "No white space please" ); - -/** -* Return true if the field value matches the given format RegExp -* -* @example $.validator.methods.pattern("AR1004",element,/^AR\d{4}$/) -* @result true -* -* @example $.validator.methods.pattern("BR1004",element,/^AR\d{4}$/) -* @result false -* -* @name $.validator.methods.pattern -* @type Boolean -* @cat Plugins/Validate/Methods -*/ -$.validator.addMethod( "pattern", function( value, element, param ) { - if ( this.optional( element ) ) { - return true; - } - if ( typeof param === "string" ) { - param = new RegExp( "^(?:" + param + ")$" ); - } - return param.test( value ); -}, "Invalid format." ); - -/** - * Dutch phone numbers have 10 digits (or 11 and start with +31). - */ -$.validator.addMethod( "phoneNL", function( value, element ) { - return this.optional( element ) || /^((\+|00(\s|\s?\-\s?)?)31(\s|\s?\-\s?)?(\(0\)[\-\s]?)?|0)[1-9]((\s|\s?\-\s?)?[0-9]){8}$/.test( value ); -}, "Please specify a valid phone number." ); - -/** - * Polish telephone numbers have 9 digits. - * - * Mobile phone numbers starts with following digits: - * 45, 50, 51, 53, 57, 60, 66, 69, 72, 73, 78, 79, 88. - * - * Fixed-line numbers starts with area codes: - * 12, 13, 14, 15, 16, 17, 18, 22, 23, 24, 25, 29, 32, 33, - * 34, 41, 42, 43, 44, 46, 48, 52, 54, 55, 56, 58, 59, 61, - * 62, 63, 65, 67, 68, 71, 74, 75, 76, 77, 81, 82, 83, 84, - * 85, 86, 87, 89, 91, 94, 95. - * - * Ministry of National Defence numbers and VoIP numbers starts with 26 and 39. - * - * Excludes intelligent networks (premium rate, shared cost, free phone numbers). - * - * Poland National Numbering Plan http://www.itu.int/oth/T02020000A8/en - */ -$.validator.addMethod( "phonePL", function( phone_number, element ) { - phone_number = phone_number.replace( /\s+/g, "" ); - var regexp = /^(?:(?:(?:\+|00)?48)|(?:\(\+?48\)))?(?:1[2-8]|2[2-69]|3[2-49]|4[1-68]|5[0-9]|6[0-35-9]|[7-8][1-9]|9[145])\d{7}$/; - return this.optional( element ) || regexp.test( phone_number ); -}, "Please specify a valid phone number" ); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ - -// Matches UK landline + mobile, accepting only 01-3 for landline or 07 for mobile to exclude many premium numbers -$.validator.addMethod( "phonesUK", function( phone_number, element ) { - phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); - return this.optional( element ) || phone_number.length > 9 && - phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?|0)(?:1\d{8,9}|[23]\d{9}|7(?:[1345789]\d{8}|624\d{6})))$/ ); -}, "Please specify a valid uk phone number" ); - -/* For UK phone functions, do the following server side processing: - * Compare original input with this RegEx pattern: - * ^\(?(?:(?:00\)?[\s\-]?\(?|\+)(44)\)?[\s\-]?\(?(?:0\)?[\s\-]?\(?)?|0)([1-9]\d{1,4}\)?[\s\d\-]+)$ - * Extract $1 and set $prefix to '+44' if $1 is '44', otherwise set $prefix to '0' - * Extract $2 and remove hyphens, spaces and parentheses. Phone number is combined $prefix and $2. - * A number of very detailed GB telephone number RegEx patterns can also be found at: - * http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_GB_Telephone_Numbers - */ -$.validator.addMethod( "phoneUK", function( phone_number, element ) { - phone_number = phone_number.replace( /\(|\)|\s+|-/g, "" ); - return this.optional( element ) || phone_number.length > 9 && - phone_number.match( /^(?:(?:(?:00\s?|\+)44\s?)|(?:\(?0))(?:\d{2}\)?\s?\d{4}\s?\d{4}|\d{3}\)?\s?\d{3}\s?\d{3,4}|\d{4}\)?\s?(?:\d{5}|\d{3}\s?\d{3})|\d{5}\)?\s?\d{4,5})$/ ); -}, "Please specify a valid phone number" ); - -/** - * Matches US phone number format - * - * where the area code may not start with 1 and the prefix may not start with 1 - * allows '-' or ' ' as a separator and allows parens around area code - * some people may want to put a '1' in front of their number - * - * 1(212)-999-2345 or - * 212 999 2344 or - * 212-999-0983 - * - * but not - * 111-123-5434 - * and not - * 212 123 4567 - */ -$.validator.addMethod( "phoneUS", function( phone_number, element ) { - phone_number = phone_number.replace( /\s+/g, "" ); - return this.optional( element ) || phone_number.length > 9 && - phone_number.match( /^(\+?1-?)?(\([2-9]([02-9]\d|1[02-9])\)|[2-9]([02-9]\d|1[02-9]))-?[2-9]\d{2}-?\d{4}$/ ); -}, "Please specify a valid phone number" ); - -/* -* Valida CEPs do brasileiros: -* -* Formatos aceitos: -* 99999-999 -* 99.999-999 -* 99999999 -*/ -$.validator.addMethod( "postalcodeBR", function( cep_value, element ) { - return this.optional( element ) || /^\d{2}.\d{3}-\d{3}?$|^\d{5}-?\d{3}?$/.test( cep_value ); -}, "Informe um CEP válido." ); - -/** - * Matches a valid Canadian Postal Code - * - * @example jQuery.validator.methods.postalCodeCA( "H0H 0H0", element ) - * @result true - * - * @example jQuery.validator.methods.postalCodeCA( "H0H0H0", element ) - * @result false - * - * @name jQuery.validator.methods.postalCodeCA - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod( "postalCodeCA", function( value, element ) { - return this.optional( element ) || /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ] *\d[ABCEGHJKLMNPRSTVWXYZ]\d$/i.test( value ); -}, "Please specify a valid postal code" ); - -/* Matches Italian postcode (CAP) */ -$.validator.addMethod( "postalcodeIT", function( value, element ) { - return this.optional( element ) || /^\d{5}$/.test( value ); -}, "Please specify a valid postal code" ); - -$.validator.addMethod( "postalcodeNL", function( value, element ) { - return this.optional( element ) || /^[1-9][0-9]{3}\s?[a-zA-Z]{2}$/.test( value ); -}, "Please specify a valid postal code" ); - -// Matches UK postcode. Does not match to UK Channel Islands that have their own postcodes (non standard UK) -$.validator.addMethod( "postcodeUK", function( value, element ) { - return this.optional( element ) || /^((([A-PR-UWYZ][0-9])|([A-PR-UWYZ][0-9][0-9])|([A-PR-UWYZ][A-HK-Y][0-9])|([A-PR-UWYZ][A-HK-Y][0-9][0-9])|([A-PR-UWYZ][0-9][A-HJKSTUW])|([A-PR-UWYZ][A-HK-Y][0-9][ABEHMNPRVWXY]))\s?([0-9][ABD-HJLNP-UW-Z]{2})|(GIR)\s?(0AA))$/i.test( value ); -}, "Please specify a valid UK postcode" ); - -/* - * Lets you say "at least X inputs that match selector Y must be filled." - * - * The end result is that neither of these inputs: - * - * - * - * - * ...will validate unless at least one of them is filled. - * - * partnumber: {require_from_group: [1,".productinfo"]}, - * description: {require_from_group: [1,".productinfo"]} - * - * options[0]: number of fields that must be filled in the group - * options[1]: CSS selector that defines the group of conditionally required fields - */ -$.validator.addMethod( "require_from_group", function( value, element, options ) { - var $fields = $( options[ 1 ], element.form ), - $fieldsFirst = $fields.eq( 0 ), - validator = $fieldsFirst.data( "valid_req_grp" ) ? $fieldsFirst.data( "valid_req_grp" ) : $.extend( {}, this ), - isValid = $fields.filter( function() { - return validator.elementValue( this ); - } ).length >= options[ 0 ]; - - // Store the cloned validator for future validation - $fieldsFirst.data( "valid_req_grp", validator ); - - // If element isn't being validated, run each require_from_group field's validation rules - if ( !$( element ).data( "being_validated" ) ) { - $fields.data( "being_validated", true ); - $fields.each( function() { - validator.element( this ); - } ); - $fields.data( "being_validated", false ); - } - return isValid; -}, $.validator.format( "Please fill at least {0} of these fields." ) ); - -/* - * Lets you say "either at least X inputs that match selector Y must be filled, - * OR they must all be skipped (left blank)." - * - * The end result, is that none of these inputs: - * - * - * - * - * - * ...will validate unless either at least two of them are filled, - * OR none of them are. - * - * partnumber: {skip_or_fill_minimum: [2,".productinfo"]}, - * description: {skip_or_fill_minimum: [2,".productinfo"]}, - * color: {skip_or_fill_minimum: [2,".productinfo"]} - * - * options[0]: number of fields that must be filled in the group - * options[1]: CSS selector that defines the group of conditionally required fields - * - */ -$.validator.addMethod( "skip_or_fill_minimum", function( value, element, options ) { - var $fields = $( options[ 1 ], element.form ), - $fieldsFirst = $fields.eq( 0 ), - validator = $fieldsFirst.data( "valid_skip" ) ? $fieldsFirst.data( "valid_skip" ) : $.extend( {}, this ), - numberFilled = $fields.filter( function() { - return validator.elementValue( this ); - } ).length, - isValid = numberFilled === 0 || numberFilled >= options[ 0 ]; - - // Store the cloned validator for future validation - $fieldsFirst.data( "valid_skip", validator ); - - // If element isn't being validated, run each skip_or_fill_minimum field's validation rules - if ( !$( element ).data( "being_validated" ) ) { - $fields.data( "being_validated", true ); - $fields.each( function() { - validator.element( this ); - } ); - $fields.data( "being_validated", false ); - } - return isValid; -}, $.validator.format( "Please either skip these fields or fill at least {0} of them." ) ); - -/* Validates US States and/or Territories by @jdforsythe - * Can be case insensitive or require capitalization - default is case insensitive - * Can include US Territories or not - default does not - * Can include US Military postal abbreviations (AA, AE, AP) - default does not - * - * Note: "States" always includes DC (District of Colombia) - * - * Usage examples: - * - * This is the default - case insensitive, no territories, no military zones - * stateInput: { - * caseSensitive: false, - * includeTerritories: false, - * includeMilitary: false - * } - * - * Only allow capital letters, no territories, no military zones - * stateInput: { - * caseSensitive: false - * } - * - * Case insensitive, include territories but not military zones - * stateInput: { - * includeTerritories: true - * } - * - * Only allow capital letters, include territories and military zones - * stateInput: { - * caseSensitive: true, - * includeTerritories: true, - * includeMilitary: true - * } - * - */ -$.validator.addMethod( "stateUS", function( value, element, options ) { - var isDefault = typeof options === "undefined", - caseSensitive = ( isDefault || typeof options.caseSensitive === "undefined" ) ? false : options.caseSensitive, - includeTerritories = ( isDefault || typeof options.includeTerritories === "undefined" ) ? false : options.includeTerritories, - includeMilitary = ( isDefault || typeof options.includeMilitary === "undefined" ) ? false : options.includeMilitary, - regex; - - if ( !includeTerritories && !includeMilitary ) { - regex = "^(A[KLRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; - } else if ( includeTerritories && includeMilitary ) { - regex = "^(A[AEKLPRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; - } else if ( includeTerritories ) { - regex = "^(A[KLRSZ]|C[AOT]|D[CE]|FL|G[AU]|HI|I[ADLN]|K[SY]|LA|M[ADEINOPST]|N[CDEHJMVY]|O[HKR]|P[AR]|RI|S[CD]|T[NX]|UT|V[AIT]|W[AIVY])$"; - } else { - regex = "^(A[AEKLPRZ]|C[AOT]|D[CE]|FL|GA|HI|I[ADLN]|K[SY]|LA|M[ADEINOST]|N[CDEHJMVY]|O[HKR]|PA|RI|S[CD]|T[NX]|UT|V[AT]|W[AIVY])$"; - } - - regex = caseSensitive ? new RegExp( regex ) : new RegExp( regex, "i" ); - return this.optional( element ) || regex.test( value ); -}, "Please specify a valid state" ); - -// TODO check if value starts with <, otherwise don't try stripping anything -$.validator.addMethod( "strippedminlength", function( value, element, param ) { - return $( value ).text().length >= param; -}, $.validator.format( "Please enter at least {0} characters" ) ); - -$.validator.addMethod( "time", function( value, element ) { - return this.optional( element ) || /^([01]\d|2[0-3]|[0-9])(:[0-5]\d){1,2}$/.test( value ); -}, "Please enter a valid time, between 00:00 and 23:59" ); - -$.validator.addMethod( "time12h", function( value, element ) { - return this.optional( element ) || /^((0?[1-9]|1[012])(:[0-5]\d){1,2}(\ ?[AP]M))$/i.test( value ); -}, "Please enter a valid time in 12-hour am/pm format" ); - -// Same as url, but TLD is optional -$.validator.addMethod( "url2", function( value, element ) { - return this.optional( element ) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)*(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test( value ); -}, $.validator.messages.url ); - -/** - * Return true, if the value is a valid vehicle identification number (VIN). - * - * Works with all kind of text inputs. - * - * @example - * @desc Declares a required input element whose value must be a valid vehicle identification number. - * - * @name $.validator.methods.vinUS - * @type Boolean - * @cat Plugins/Validate/Methods - */ -$.validator.addMethod( "vinUS", function( v ) { - if ( v.length !== 17 ) { - return false; - } - - var LL = [ "A", "B", "C", "D", "E", "F", "G", "H", "J", "K", "L", "M", "N", "P", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" ], - VL = [ 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 7, 9, 2, 3, 4, 5, 6, 7, 8, 9 ], - FL = [ 8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2 ], - rs = 0, - i, n, d, f, cd, cdv; - - for ( i = 0; i < 17; i++ ) { - f = FL[ i ]; - d = v.slice( i, i + 1 ); - if ( i === 8 ) { - cdv = d; - } - if ( !isNaN( d ) ) { - d *= f; - } else { - for ( n = 0; n < LL.length; n++ ) { - if ( d.toUpperCase() === LL[ n ] ) { - d = VL[ n ]; - d *= f; - if ( isNaN( cdv ) && n === 8 ) { - cdv = LL[ n ]; - } - break; - } - } - } - rs += d; - } - cd = rs % 11; - if ( cd === 10 ) { - cd = "X"; - } - if ( cd === cdv ) { - return true; - } - return false; -}, "The specified vehicle identification number (VIN) is invalid." ); - -$.validator.addMethod( "zipcodeUS", function( value, element ) { - return this.optional( element ) || /^\d{5}(-\d{4})?$/.test( value ); -}, "The specified US ZIP Code is invalid" ); - -$.validator.addMethod( "ziprange", function( value, element ) { - return this.optional( element ) || /^90[2-5]\d\{2\}-\d{4}$/.test( value ); -}, "Your ZIP-code must be in the range 902xx-xxxx to 905xx-xxxx" ); -return $; -})); \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/js/validation/jquery.validate.js b/vendor/wpmetabox/meta-box/js/validation/jquery.validate.js deleted file mode 100644 index d025319db..000000000 --- a/vendor/wpmetabox/meta-box/js/validation/jquery.validate.js +++ /dev/null @@ -1,1650 +0,0 @@ -/*! - * jQuery Validation Plugin v1.19.1 - * - * https://jqueryvalidation.org/ - * - * Copyright (c) 2019 Jörn Zaefferer - * Released under the MIT license - */ -(function( factory ) { - if ( typeof define === "function" && define.amd ) { - define( ["jquery"], factory ); - } else if (typeof module === "object" && module.exports) { - module.exports = factory( require( "jquery" ) ); - } else { - factory( jQuery ); - } -}(function( $ ) { - -$.extend( $.fn, { - - // https://jqueryvalidation.org/validate/ - validate: function( options ) { - - // If nothing is selected, return nothing; can't chain anyway - if ( !this.length ) { - if ( options && options.debug && window.console ) { - console.warn( "Nothing selected, can't validate, returning nothing." ); - } - return; - } - - // Check if a validator for this form was already created - var validator = $.data( this[ 0 ], "validator" ); - if ( validator ) { - return validator; - } - - // Add novalidate tag if HTML5. - this.attr( "novalidate", "novalidate" ); - - validator = new $.validator( options, this[ 0 ] ); - $.data( this[ 0 ], "validator", validator ); - - if ( validator.settings.onsubmit ) { - - this.on( "click.validate", ":submit", function( event ) { - - // Track the used submit button to properly handle scripted - // submits later. - validator.submitButton = event.currentTarget; - - // Allow suppressing validation by adding a cancel class to the submit button - if ( $( this ).hasClass( "cancel" ) ) { - validator.cancelSubmit = true; - } - - // Allow suppressing validation by adding the html5 formnovalidate attribute to the submit button - if ( $( this ).attr( "formnovalidate" ) !== undefined ) { - validator.cancelSubmit = true; - } - } ); - - // Validate the form on submit - this.on( "submit.validate", function( event ) { - if ( validator.settings.debug ) { - - // Prevent form submit to be able to see console output - event.preventDefault(); - } - - function handle() { - var hidden, result; - - // Insert a hidden input as a replacement for the missing submit button - // The hidden input is inserted in two cases: - // - A user defined a `submitHandler` - // - There was a pending request due to `remote` method and `stopRequest()` - // was called to submit the form in case it's valid - if ( validator.submitButton && ( validator.settings.submitHandler || validator.formSubmitted ) ) { - hidden = $( "" ) - .attr( "name", validator.submitButton.name ) - .val( $( validator.submitButton ).val() ) - .appendTo( validator.currentForm ); - } - - if ( validator.settings.submitHandler && !validator.settings.debug ) { - result = validator.settings.submitHandler.call( validator, validator.currentForm, event ); - if ( hidden ) { - - // And clean up afterwards; thanks to no-block-scope, hidden can be referenced - hidden.remove(); - } - if ( result !== undefined ) { - return result; - } - return false; - } - return true; - } - - // Prevent submit for invalid forms or custom submit handlers - if ( validator.cancelSubmit ) { - validator.cancelSubmit = false; - return handle(); - } - if ( validator.form() ) { - if ( validator.pendingRequest ) { - validator.formSubmitted = true; - return false; - } - return handle(); - } else { - validator.focusInvalid(); - return false; - } - } ); - } - - return validator; - }, - - // https://jqueryvalidation.org/valid/ - valid: function() { - var valid, validator, errorList; - - if ( $( this[ 0 ] ).is( "form" ) ) { - valid = this.validate().form(); - } else { - errorList = []; - valid = true; - validator = $( this[ 0 ].form ).validate(); - this.each( function() { - valid = validator.element( this ) && valid; - if ( !valid ) { - errorList = errorList.concat( validator.errorList ); - } - } ); - validator.errorList = errorList; - } - return valid; - }, - - // https://jqueryvalidation.org/rules/ - rules: function( command, argument ) { - var element = this[ 0 ], - isContentEditable = typeof this.attr( "contenteditable" ) !== "undefined" && this.attr( "contenteditable" ) !== "false", - settings, staticRules, existingRules, data, param, filtered; - - // If nothing is selected, return empty object; can't chain anyway - if ( element == null ) { - return; - } - - if ( !element.form && isContentEditable ) { - element.form = this.closest( "form" )[ 0 ]; - element.name = this.attr( "name" ); - } - - if ( element.form == null ) { - return; - } - - if ( command ) { - settings = $.data( element.form, "validator" ).settings; - staticRules = settings.rules; - existingRules = $.validator.staticRules( element ); - switch ( command ) { - case "add": - $.extend( existingRules, $.validator.normalizeRule( argument ) ); - - // Remove messages from rules, but allow them to be set separately - delete existingRules.messages; - staticRules[ element.name ] = existingRules; - if ( argument.messages ) { - settings.messages[ element.name ] = $.extend( settings.messages[ element.name ], argument.messages ); - } - break; - case "remove": - if ( !argument ) { - delete staticRules[ element.name ]; - return existingRules; - } - filtered = {}; - $.each( argument.split( /\s/ ), function( index, method ) { - filtered[ method ] = existingRules[ method ]; - delete existingRules[ method ]; - } ); - return filtered; - } - } - - data = $.validator.normalizeRules( - $.extend( - {}, - $.validator.classRules( element ), - $.validator.attributeRules( element ), - $.validator.dataRules( element ), - $.validator.staticRules( element ) - ), element ); - - // Make sure required is at front - if ( data.required ) { - param = data.required; - delete data.required; - data = $.extend( { required: param }, data ); - } - - // Make sure remote is at back - if ( data.remote ) { - param = data.remote; - delete data.remote; - data = $.extend( data, { remote: param } ); - } - - return data; - } -} ); - -// Custom selectors -$.extend( $.expr.pseudos || $.expr[ ":" ], { // '|| $.expr[ ":" ]' here enables backwards compatibility to jQuery 1.7. Can be removed when dropping jQ 1.7.x support - - // https://jqueryvalidation.org/blank-selector/ - blank: function( a ) { - return !$.trim( "" + $( a ).val() ); - }, - - // https://jqueryvalidation.org/filled-selector/ - filled: function( a ) { - var val = $( a ).val(); - return val !== null && !!$.trim( "" + val ); - }, - - // https://jqueryvalidation.org/unchecked-selector/ - unchecked: function( a ) { - return !$( a ).prop( "checked" ); - } -} ); - -// Constructor for validator -$.validator = function( options, form ) { - this.settings = $.extend( true, {}, $.validator.defaults, options ); - this.currentForm = form; - this.init(); -}; - -// https://jqueryvalidation.org/jQuery.validator.format/ -$.validator.format = function( source, params ) { - if ( arguments.length === 1 ) { - return function() { - var args = $.makeArray( arguments ); - args.unshift( source ); - return $.validator.format.apply( this, args ); - }; - } - if ( params === undefined ) { - return source; - } - if ( arguments.length > 2 && params.constructor !== Array ) { - params = $.makeArray( arguments ).slice( 1 ); - } - if ( params.constructor !== Array ) { - params = [ params ]; - } - $.each( params, function( i, n ) { - source = source.replace( new RegExp( "\\{" + i + "\\}", "g" ), function() { - return n; - } ); - } ); - return source; -}; - -$.extend( $.validator, { - - defaults: { - messages: {}, - groups: {}, - rules: {}, - errorClass: "error", - pendingClass: "pending", - validClass: "valid", - errorElement: "label", - focusCleanup: false, - focusInvalid: true, - errorContainer: $( [] ), - errorLabelContainer: $( [] ), - onsubmit: true, - ignore: ":hidden", - ignoreTitle: false, - onfocusin: function( element ) { - this.lastActive = element; - - // Hide error label and remove error class on focus if enabled - if ( this.settings.focusCleanup ) { - if ( this.settings.unhighlight ) { - this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass ); - } - this.hideThese( this.errorsFor( element ) ); - } - }, - onfocusout: function( element ) { - if ( !this.checkable( element ) && ( element.name in this.submitted || !this.optional( element ) ) ) { - this.element( element ); - } - }, - onkeyup: function( element, event ) { - - // Avoid revalidate the field when pressing one of the following keys - // Shift => 16 - // Ctrl => 17 - // Alt => 18 - // Caps lock => 20 - // End => 35 - // Home => 36 - // Left arrow => 37 - // Up arrow => 38 - // Right arrow => 39 - // Down arrow => 40 - // Insert => 45 - // Num lock => 144 - // AltGr key => 225 - var excludedKeys = [ - 16, 17, 18, 20, 35, 36, 37, - 38, 39, 40, 45, 144, 225 - ]; - - if ( event.which === 9 && this.elementValue( element ) === "" || $.inArray( event.keyCode, excludedKeys ) !== -1 ) { - return; - } else if ( element.name in this.submitted || element.name in this.invalid ) { - this.element( element ); - } - }, - onclick: function( element ) { - - // Click on selects, radiobuttons and checkboxes - if ( element.name in this.submitted ) { - this.element( element ); - - // Or option elements, check parent select in that case - } else if ( element.parentNode.name in this.submitted ) { - this.element( element.parentNode ); - } - }, - highlight: function( element, errorClass, validClass ) { - if ( element.type === "radio" ) { - this.findByName( element.name ).addClass( errorClass ).removeClass( validClass ); - } else { - $( element ).addClass( errorClass ).removeClass( validClass ); - } - }, - unhighlight: function( element, errorClass, validClass ) { - if ( element.type === "radio" ) { - this.findByName( element.name ).removeClass( errorClass ).addClass( validClass ); - } else { - $( element ).removeClass( errorClass ).addClass( validClass ); - } - } - }, - - // https://jqueryvalidation.org/jQuery.validator.setDefaults/ - setDefaults: function( settings ) { - $.extend( $.validator.defaults, settings ); - }, - - messages: { - required: "This field is required.", - remote: "Please fix this field.", - email: "Please enter a valid email address.", - url: "Please enter a valid URL.", - date: "Please enter a valid date.", - dateISO: "Please enter a valid date (ISO).", - number: "Please enter a valid number.", - digits: "Please enter only digits.", - equalTo: "Please enter the same value again.", - maxlength: $.validator.format( "Please enter no more than {0} characters." ), - minlength: $.validator.format( "Please enter at least {0} characters." ), - rangelength: $.validator.format( "Please enter a value between {0} and {1} characters long." ), - range: $.validator.format( "Please enter a value between {0} and {1}." ), - max: $.validator.format( "Please enter a value less than or equal to {0}." ), - min: $.validator.format( "Please enter a value greater than or equal to {0}." ), - step: $.validator.format( "Please enter a multiple of {0}." ) - }, - - autoCreateRanges: false, - - prototype: { - - init: function() { - this.labelContainer = $( this.settings.errorLabelContainer ); - this.errorContext = this.labelContainer.length && this.labelContainer || $( this.currentForm ); - this.containers = $( this.settings.errorContainer ).add( this.settings.errorLabelContainer ); - this.submitted = {}; - this.valueCache = {}; - this.pendingRequest = 0; - this.pending = {}; - this.invalid = {}; - this.reset(); - - var currentForm = this.currentForm, - groups = ( this.groups = {} ), - rules; - $.each( this.settings.groups, function( key, value ) { - if ( typeof value === "string" ) { - value = value.split( /\s/ ); - } - $.each( value, function( index, name ) { - groups[ name ] = key; - } ); - } ); - rules = this.settings.rules; - $.each( rules, function( key, value ) { - rules[ key ] = $.validator.normalizeRule( value ); - } ); - - function delegate( event ) { - var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; - - // Set form expando on contenteditable - if ( !this.form && isContentEditable ) { - this.form = $( this ).closest( "form" )[ 0 ]; - this.name = $( this ).attr( "name" ); - } - - // Ignore the element if it belongs to another form. This will happen mainly - // when setting the `form` attribute of an input to the id of another form. - if ( currentForm !== this.form ) { - return; - } - - var validator = $.data( this.form, "validator" ), - eventType = "on" + event.type.replace( /^validate/, "" ), - settings = validator.settings; - if ( settings[ eventType ] && !$( this ).is( settings.ignore ) ) { - settings[ eventType ].call( validator, this, event ); - } - } - - $( this.currentForm ) - .on( "focusin.validate focusout.validate keyup.validate", - ":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " + - "[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " + - "[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " + - "[type='radio'], [type='checkbox'], [contenteditable], [type='button']", delegate ) - - // Support: Chrome, oldIE - // "select" is provided as event.target when clicking a option - .on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate ); - - if ( this.settings.invalidHandler ) { - $( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler ); - } - }, - - // https://jqueryvalidation.org/Validator.form/ - form: function() { - this.checkForm(); - $.extend( this.submitted, this.errorMap ); - this.invalid = $.extend( {}, this.errorMap ); - if ( !this.valid() ) { - $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); - } - this.showErrors(); - return this.valid(); - }, - - checkForm: function() { - this.prepareForm(); - for ( var i = 0, elements = ( this.currentElements = this.elements() ); elements[ i ]; i++ ) { - this.check( elements[ i ] ); - } - return this.valid(); - }, - - // https://jqueryvalidation.org/Validator.element/ - element: function( element ) { - var cleanElement = this.clean( element ), - checkElement = this.validationTargetFor( cleanElement ), - v = this, - result = true, - rs, group; - - if ( checkElement === undefined ) { - delete this.invalid[ cleanElement.name ]; - } else { - this.prepareElement( checkElement ); - this.currentElements = $( checkElement ); - - // If this element is grouped, then validate all group elements already - // containing a value - group = this.groups[ checkElement.name ]; - if ( group ) { - $.each( this.groups, function( name, testgroup ) { - if ( testgroup === group && name !== checkElement.name ) { - cleanElement = v.validationTargetFor( v.clean( v.findByName( name ) ) ); - if ( cleanElement && cleanElement.name in v.invalid ) { - v.currentElements.push( cleanElement ); - result = v.check( cleanElement ) && result; - } - } - } ); - } - - rs = this.check( checkElement ) !== false; - result = result && rs; - if ( rs ) { - this.invalid[ checkElement.name ] = false; - } else { - this.invalid[ checkElement.name ] = true; - } - - if ( !this.numberOfInvalids() ) { - - // Hide error containers on last error - this.toHide = this.toHide.add( this.containers ); - } - this.showErrors(); - - // Add aria-invalid status for screen readers - $( element ).attr( "aria-invalid", !rs ); - } - - return result; - }, - - // https://jqueryvalidation.org/Validator.showErrors/ - showErrors: function( errors ) { - if ( errors ) { - var validator = this; - - // Add items to error list and map - $.extend( this.errorMap, errors ); - this.errorList = $.map( this.errorMap, function( message, name ) { - return { - message: message, - element: validator.findByName( name )[ 0 ] - }; - } ); - - // Remove items from success list - this.successList = $.grep( this.successList, function( element ) { - return !( element.name in errors ); - } ); - } - if ( this.settings.showErrors ) { - this.settings.showErrors.call( this, this.errorMap, this.errorList ); - } else { - this.defaultShowErrors(); - } - }, - - // https://jqueryvalidation.org/Validator.resetForm/ - resetForm: function() { - if ( $.fn.resetForm ) { - $( this.currentForm ).resetForm(); - } - this.invalid = {}; - this.submitted = {}; - this.prepareForm(); - this.hideErrors(); - var elements = this.elements() - .removeData( "previousValue" ) - .removeAttr( "aria-invalid" ); - - this.resetElements( elements ); - }, - - resetElements: function( elements ) { - var i; - - if ( this.settings.unhighlight ) { - for ( i = 0; elements[ i ]; i++ ) { - this.settings.unhighlight.call( this, elements[ i ], - this.settings.errorClass, "" ); - this.findByName( elements[ i ].name ).removeClass( this.settings.validClass ); - } - } else { - elements - .removeClass( this.settings.errorClass ) - .removeClass( this.settings.validClass ); - } - }, - - numberOfInvalids: function() { - return this.objectLength( this.invalid ); - }, - - objectLength: function( obj ) { - /* jshint unused: false */ - var count = 0, - i; - for ( i in obj ) { - - // This check allows counting elements with empty error - // message as invalid elements - if ( obj[ i ] !== undefined && obj[ i ] !== null && obj[ i ] !== false ) { - count++; - } - } - return count; - }, - - hideErrors: function() { - this.hideThese( this.toHide ); - }, - - hideThese: function( errors ) { - errors.not( this.containers ).text( "" ); - this.addWrapper( errors ).hide(); - }, - - valid: function() { - return this.size() === 0; - }, - - size: function() { - return this.errorList.length; - }, - - focusInvalid: function() { - if ( this.settings.focusInvalid ) { - try { - $( this.findLastActive() || this.errorList.length && this.errorList[ 0 ].element || [] ) - .filter( ":visible" ) - .trigger( "focus" ) - - // Manually trigger focusin event; without it, focusin handler isn't called, findLastActive won't have anything to find - .trigger( "focusin" ); - } catch ( e ) { - - // Ignore IE throwing errors when focusing hidden elements - } - } - }, - - findLastActive: function() { - var lastActive = this.lastActive; - return lastActive && $.grep( this.errorList, function( n ) { - return n.element.name === lastActive.name; - } ).length === 1 && lastActive; - }, - - elements: function() { - var validator = this, - rulesCache = {}; - - // Select all valid inputs inside the form (no submit or reset buttons) - return $( this.currentForm ) - .find( "input, select, textarea, [contenteditable]" ) - .not( ":submit, :reset, :image, :disabled" ) - .not( this.settings.ignore ) - .filter( function() { - var name = this.name || $( this ).attr( "name" ); // For contenteditable - var isContentEditable = typeof $( this ).attr( "contenteditable" ) !== "undefined" && $( this ).attr( "contenteditable" ) !== "false"; - - if ( !name && validator.settings.debug && window.console ) { - console.error( "%o has no name assigned", this ); - } - - // Set form expando on contenteditable - if ( isContentEditable ) { - this.form = $( this ).closest( "form" )[ 0 ]; - this.name = name; - } - - // Ignore elements that belong to other/nested forms - if ( this.form !== validator.currentForm ) { - return false; - } - - // Select only the first element for each name, and only those with rules specified - if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) { - return false; - } - - rulesCache[ name ] = true; - return true; - } ); - }, - - clean: function( selector ) { - return $( selector )[ 0 ]; - }, - - errors: function() { - var errorClass = this.settings.errorClass.split( " " ).join( "." ); - return $( this.settings.errorElement + "." + errorClass, this.errorContext ); - }, - - resetInternals: function() { - this.successList = []; - this.errorList = []; - this.errorMap = {}; - this.toShow = $( [] ); - this.toHide = $( [] ); - }, - - reset: function() { - this.resetInternals(); - this.currentElements = $( [] ); - }, - - prepareForm: function() { - this.reset(); - this.toHide = this.errors().add( this.containers ); - }, - - prepareElement: function( element ) { - this.reset(); - this.toHide = this.errorsFor( element ); - }, - - elementValue: function( element ) { - var $element = $( element ), - type = element.type, - isContentEditable = typeof $element.attr( "contenteditable" ) !== "undefined" && $element.attr( "contenteditable" ) !== "false", - val, idx; - - if ( type === "radio" || type === "checkbox" ) { - return this.findByName( element.name ).filter( ":checked" ).val(); - } else if ( type === "number" && typeof element.validity !== "undefined" ) { - return element.validity.badInput ? "NaN" : $element.val(); - } - - if ( isContentEditable ) { - val = $element.text(); - } else { - val = $element.val(); - } - - if ( type === "file" ) { - - // Modern browser (chrome & safari) - if ( val.substr( 0, 12 ) === "C:\\fakepath\\" ) { - return val.substr( 12 ); - } - - // Legacy browsers - // Unix-based path - idx = val.lastIndexOf( "/" ); - if ( idx >= 0 ) { - return val.substr( idx + 1 ); - } - - // Windows-based path - idx = val.lastIndexOf( "\\" ); - if ( idx >= 0 ) { - return val.substr( idx + 1 ); - } - - // Just the file name - return val; - } - - if ( typeof val === "string" ) { - return val.replace( /\r/g, "" ); - } - return val; - }, - - check: function( element ) { - element = this.validationTargetFor( this.clean( element ) ); - - var rules = $( element ).rules(), - rulesCount = $.map( rules, function( n, i ) { - return i; - } ).length, - dependencyMismatch = false, - val = this.elementValue( element ), - result, method, rule, normalizer; - - // Prioritize the local normalizer defined for this element over the global one - // if the former exists, otherwise user the global one in case it exists. - if ( typeof rules.normalizer === "function" ) { - normalizer = rules.normalizer; - } else if ( typeof this.settings.normalizer === "function" ) { - normalizer = this.settings.normalizer; - } - - // If normalizer is defined, then call it to retreive the changed value instead - // of using the real one. - // Note that `this` in the normalizer is `element`. - if ( normalizer ) { - val = normalizer.call( element, val ); - - // Delete the normalizer from rules to avoid treating it as a pre-defined method. - delete rules.normalizer; - } - - for ( method in rules ) { - rule = { method: method, parameters: rules[ method ] }; - try { - result = $.validator.methods[ method ].call( this, val, element, rule.parameters ); - - // If a method indicates that the field is optional and therefore valid, - // don't mark it as valid when there are no other rules - if ( result === "dependency-mismatch" && rulesCount === 1 ) { - dependencyMismatch = true; - continue; - } - dependencyMismatch = false; - - if ( result === "pending" ) { - this.toHide = this.toHide.not( this.errorsFor( element ) ); - return; - } - - if ( !result ) { - this.formatAndAdd( element, rule ); - return false; - } - } catch ( e ) { - if ( this.settings.debug && window.console ) { - console.log( "Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method.", e ); - } - if ( e instanceof TypeError ) { - e.message += ". Exception occurred when checking element " + element.id + ", check the '" + rule.method + "' method."; - } - - throw e; - } - } - if ( dependencyMismatch ) { - return; - } - if ( this.objectLength( rules ) ) { - this.successList.push( element ); - } - return true; - }, - - // Return the custom message for the given element and validation method - // specified in the element's HTML5 data attribute - // return the generic message if present and no method specific message is present - customDataMessage: function( element, method ) { - return $( element ).data( "msg" + method.charAt( 0 ).toUpperCase() + - method.substring( 1 ).toLowerCase() ) || $( element ).data( "msg" ); - }, - - // Return the custom message for the given element name and validation method - customMessage: function( name, method ) { - var m = this.settings.messages[ name ]; - return m && ( m.constructor === String ? m : m[ method ] ); - }, - - // Return the first defined argument, allowing empty strings - findDefined: function() { - for ( var i = 0; i < arguments.length; i++ ) { - if ( arguments[ i ] !== undefined ) { - return arguments[ i ]; - } - } - return undefined; - }, - - // The second parameter 'rule' used to be a string, and extended to an object literal - // of the following form: - // rule = { - // method: "method name", - // parameters: "the given method parameters" - // } - // - // The old behavior still supported, kept to maintain backward compatibility with - // old code, and will be removed in the next major release. - defaultMessage: function( element, rule ) { - if ( typeof rule === "string" ) { - rule = { method: rule }; - } - - var message = this.findDefined( - this.customMessage( element.name, rule.method ), - this.customDataMessage( element, rule.method ), - - // 'title' is never undefined, so handle empty string as undefined - !this.settings.ignoreTitle && element.title || undefined, - $.validator.messages[ rule.method ], - "Warning: No message defined for " + element.name + "" - ), - theregex = /\$?\{(\d+)\}/g; - if ( typeof message === "function" ) { - message = message.call( this, rule.parameters, element ); - } else if ( theregex.test( message ) ) { - message = $.validator.format( message.replace( theregex, "{$1}" ), rule.parameters ); - } - - return message; - }, - - formatAndAdd: function( element, rule ) { - var message = this.defaultMessage( element, rule ); - - this.errorList.push( { - message: message, - element: element, - method: rule.method - } ); - - this.errorMap[ element.name ] = message; - this.submitted[ element.name ] = message; - }, - - addWrapper: function( toToggle ) { - if ( this.settings.wrapper ) { - toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) ); - } - return toToggle; - }, - - defaultShowErrors: function() { - var i, elements, error; - for ( i = 0; this.errorList[ i ]; i++ ) { - error = this.errorList[ i ]; - if ( this.settings.highlight ) { - this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass ); - } - this.showLabel( error.element, error.message ); - } - if ( this.errorList.length ) { - this.toShow = this.toShow.add( this.containers ); - } - if ( this.settings.success ) { - for ( i = 0; this.successList[ i ]; i++ ) { - this.showLabel( this.successList[ i ] ); - } - } - if ( this.settings.unhighlight ) { - for ( i = 0, elements = this.validElements(); elements[ i ]; i++ ) { - this.settings.unhighlight.call( this, elements[ i ], this.settings.errorClass, this.settings.validClass ); - } - } - this.toHide = this.toHide.not( this.toShow ); - this.hideErrors(); - this.addWrapper( this.toShow ).show(); - }, - - validElements: function() { - return this.currentElements.not( this.invalidElements() ); - }, - - invalidElements: function() { - return $( this.errorList ).map( function() { - return this.element; - } ); - }, - - showLabel: function( element, message ) { - var place, group, errorID, v, - error = this.errorsFor( element ), - elementID = this.idOrName( element ), - describedBy = $( element ).attr( "aria-describedby" ); - - if ( error.length ) { - - // Refresh error/success class - error.removeClass( this.settings.validClass ).addClass( this.settings.errorClass ); - - // Replace message on existing label - error.html( message ); - } else { - - // Create error element - error = $( "<" + this.settings.errorElement + ">" ) - .attr( "id", elementID + "-error" ) - .addClass( this.settings.errorClass ) - .html( message || "" ); - - // Maintain reference to the element to be placed into the DOM - place = error; - if ( this.settings.wrapper ) { - - // Make sure the element is visible, even in IE - // actually showing the wrapped element is handled elsewhere - place = error.hide().show().wrap( "<" + this.settings.wrapper + "/>" ).parent(); - } - if ( this.labelContainer.length ) { - this.labelContainer.append( place ); - } else if ( this.settings.errorPlacement ) { - this.settings.errorPlacement.call( this, place, $( element ) ); - } else { - place.insertAfter( element ); - } - - // Link error back to the element - if ( error.is( "label" ) ) { - - // If the error is a label, then associate using 'for' - error.attr( "for", elementID ); - - // If the element is not a child of an associated label, then it's necessary - // to explicitly apply aria-describedby - } else if ( error.parents( "label[for='" + this.escapeCssMeta( elementID ) + "']" ).length === 0 ) { - errorID = error.attr( "id" ); - - // Respect existing non-error aria-describedby - if ( !describedBy ) { - describedBy = errorID; - } else if ( !describedBy.match( new RegExp( "\\b" + this.escapeCssMeta( errorID ) + "\\b" ) ) ) { - - // Add to end of list if not already present - describedBy += " " + errorID; - } - $( element ).attr( "aria-describedby", describedBy ); - - // If this element is grouped, then assign to all elements in the same group - group = this.groups[ element.name ]; - if ( group ) { - v = this; - $.each( v.groups, function( name, testgroup ) { - if ( testgroup === group ) { - $( "[name='" + v.escapeCssMeta( name ) + "']", v.currentForm ) - .attr( "aria-describedby", error.attr( "id" ) ); - } - } ); - } - } - } - if ( !message && this.settings.success ) { - error.text( "" ); - if ( typeof this.settings.success === "string" ) { - error.addClass( this.settings.success ); - } else { - this.settings.success( error, element ); - } - } - this.toShow = this.toShow.add( error ); - }, - - errorsFor: function( element ) { - var name = this.escapeCssMeta( this.idOrName( element ) ), - describer = $( element ).attr( "aria-describedby" ), - selector = "label[for='" + name + "'], label[for='" + name + "'] *"; - - // 'aria-describedby' should directly reference the error element - if ( describer ) { - selector = selector + ", #" + this.escapeCssMeta( describer ) - .replace( /\s+/g, ", #" ); - } - - return this - .errors() - .filter( selector ); - }, - - // See https://api.jquery.com/category/selectors/, for CSS - // meta-characters that should be escaped in order to be used with JQuery - // as a literal part of a name/id or any selector. - escapeCssMeta: function( string ) { - return string.replace( /([\\!"#$%&'()*+,./:;<=>?@\[\]^`{|}~])/g, "\\$1" ); - }, - - idOrName: function( element ) { - return this.groups[ element.name ] || ( this.checkable( element ) ? element.name : element.id || element.name ); - }, - - validationTargetFor: function( element ) { - - // If radio/checkbox, validate first element in group instead - if ( this.checkable( element ) ) { - element = this.findByName( element.name ); - } - - // Always apply ignore filter - return $( element ).not( this.settings.ignore )[ 0 ]; - }, - - checkable: function( element ) { - return ( /radio|checkbox/i ).test( element.type ); - }, - - findByName: function( name ) { - return $( this.currentForm ).find( "[name='" + this.escapeCssMeta( name ) + "']" ); - }, - - getLength: function( value, element ) { - switch ( element.nodeName.toLowerCase() ) { - case "select": - return $( "option:selected", element ).length; - case "input": - if ( this.checkable( element ) ) { - return this.findByName( element.name ).filter( ":checked" ).length; - } - } - return value.length; - }, - - depend: function( param, element ) { - return this.dependTypes[ typeof param ] ? this.dependTypes[ typeof param ]( param, element ) : true; - }, - - dependTypes: { - "boolean": function( param ) { - return param; - }, - "string": function( param, element ) { - return !!$( param, element.form ).length; - }, - "function": function( param, element ) { - return param( element ); - } - }, - - optional: function( element ) { - var val = this.elementValue( element ); - return !$.validator.methods.required.call( this, val, element ) && "dependency-mismatch"; - }, - - startRequest: function( element ) { - if ( !this.pending[ element.name ] ) { - this.pendingRequest++; - $( element ).addClass( this.settings.pendingClass ); - this.pending[ element.name ] = true; - } - }, - - stopRequest: function( element, valid ) { - this.pendingRequest--; - - // Sometimes synchronization fails, make sure pendingRequest is never < 0 - if ( this.pendingRequest < 0 ) { - this.pendingRequest = 0; - } - delete this.pending[ element.name ]; - $( element ).removeClass( this.settings.pendingClass ); - if ( valid && this.pendingRequest === 0 && this.formSubmitted && this.form() ) { - $( this.currentForm ).submit(); - - // Remove the hidden input that was used as a replacement for the - // missing submit button. The hidden input is added by `handle()` - // to ensure that the value of the used submit button is passed on - // for scripted submits triggered by this method - if ( this.submitButton ) { - $( "input:hidden[name='" + this.submitButton.name + "']", this.currentForm ).remove(); - } - - this.formSubmitted = false; - } else if ( !valid && this.pendingRequest === 0 && this.formSubmitted ) { - $( this.currentForm ).triggerHandler( "invalid-form", [ this ] ); - this.formSubmitted = false; - } - }, - - previousValue: function( element, method ) { - method = typeof method === "string" && method || "remote"; - - return $.data( element, "previousValue" ) || $.data( element, "previousValue", { - old: null, - valid: true, - message: this.defaultMessage( element, { method: method } ) - } ); - }, - - // Cleans up all forms and elements, removes validator-specific events - destroy: function() { - this.resetForm(); - - $( this.currentForm ) - .off( ".validate" ) - .removeData( "validator" ) - .find( ".validate-equalTo-blur" ) - .off( ".validate-equalTo" ) - .removeClass( "validate-equalTo-blur" ) - .find( ".validate-lessThan-blur" ) - .off( ".validate-lessThan" ) - .removeClass( "validate-lessThan-blur" ) - .find( ".validate-lessThanEqual-blur" ) - .off( ".validate-lessThanEqual" ) - .removeClass( "validate-lessThanEqual-blur" ) - .find( ".validate-greaterThanEqual-blur" ) - .off( ".validate-greaterThanEqual" ) - .removeClass( "validate-greaterThanEqual-blur" ) - .find( ".validate-greaterThan-blur" ) - .off( ".validate-greaterThan" ) - .removeClass( "validate-greaterThan-blur" ); - } - - }, - - classRuleSettings: { - required: { required: true }, - email: { email: true }, - url: { url: true }, - date: { date: true }, - dateISO: { dateISO: true }, - number: { number: true }, - digits: { digits: true }, - creditcard: { creditcard: true } - }, - - addClassRules: function( className, rules ) { - if ( className.constructor === String ) { - this.classRuleSettings[ className ] = rules; - } else { - $.extend( this.classRuleSettings, className ); - } - }, - - classRules: function( element ) { - var rules = {}, - classes = $( element ).attr( "class" ); - - if ( classes ) { - $.each( classes.split( " " ), function() { - if ( this in $.validator.classRuleSettings ) { - $.extend( rules, $.validator.classRuleSettings[ this ] ); - } - } ); - } - return rules; - }, - - normalizeAttributeRule: function( rules, type, method, value ) { - - // Convert the value to a number for number inputs, and for text for backwards compability - // allows type="date" and others to be compared as strings - if ( /min|max|step/.test( method ) && ( type === null || /number|range|text/.test( type ) ) ) { - value = Number( value ); - - // Support Opera Mini, which returns NaN for undefined minlength - if ( isNaN( value ) ) { - value = undefined; - } - } - - if ( value || value === 0 ) { - rules[ method ] = value; - } else if ( type === method && type !== "range" ) { - - // Exception: the jquery validate 'range' method - // does not test for the html5 'range' type - rules[ method ] = true; - } - }, - - attributeRules: function( element ) { - var rules = {}, - $element = $( element ), - type = element.getAttribute( "type" ), - method, value; - - for ( method in $.validator.methods ) { - - // Support for in both html5 and older browsers - if ( method === "required" ) { - value = element.getAttribute( method ); - - // Some browsers return an empty string for the required attribute - // and non-HTML5 browsers might have required="" markup - if ( value === "" ) { - value = true; - } - - // Force non-HTML5 browsers to return bool - value = !!value; - } else { - value = $element.attr( method ); - } - - this.normalizeAttributeRule( rules, type, method, value ); - } - - // 'maxlength' may be returned as -1, 2147483647 ( IE ) and 524288 ( safari ) for text inputs - if ( rules.maxlength && /-1|2147483647|524288/.test( rules.maxlength ) ) { - delete rules.maxlength; - } - - return rules; - }, - - dataRules: function( element ) { - var rules = {}, - $element = $( element ), - type = element.getAttribute( "type" ), - method, value; - - for ( method in $.validator.methods ) { - value = $element.data( "rule" + method.charAt( 0 ).toUpperCase() + method.substring( 1 ).toLowerCase() ); - - // Cast empty attributes like `data-rule-required` to `true` - if ( value === "" ) { - value = true; - } - - this.normalizeAttributeRule( rules, type, method, value ); - } - return rules; - }, - - staticRules: function( element ) { - var rules = {}, - validator = $.data( element.form, "validator" ); - - if ( validator.settings.rules ) { - rules = $.validator.normalizeRule( validator.settings.rules[ element.name ] ) || {}; - } - return rules; - }, - - normalizeRules: function( rules, element ) { - - // Handle dependency check - $.each( rules, function( prop, val ) { - - // Ignore rule when param is explicitly false, eg. required:false - if ( val === false ) { - delete rules[ prop ]; - return; - } - if ( val.param || val.depends ) { - var keepRule = true; - switch ( typeof val.depends ) { - case "string": - keepRule = !!$( val.depends, element.form ).length; - break; - case "function": - keepRule = val.depends.call( element, element ); - break; - } - if ( keepRule ) { - rules[ prop ] = val.param !== undefined ? val.param : true; - } else { - $.data( element.form, "validator" ).resetElements( $( element ) ); - delete rules[ prop ]; - } - } - } ); - - // Evaluate parameters - $.each( rules, function( rule, parameter ) { - rules[ rule ] = $.isFunction( parameter ) && rule !== "normalizer" ? parameter( element ) : parameter; - } ); - - // Clean number parameters - $.each( [ "minlength", "maxlength" ], function() { - if ( rules[ this ] ) { - rules[ this ] = Number( rules[ this ] ); - } - } ); - $.each( [ "rangelength", "range" ], function() { - var parts; - if ( rules[ this ] ) { - if ( $.isArray( rules[ this ] ) ) { - rules[ this ] = [ Number( rules[ this ][ 0 ] ), Number( rules[ this ][ 1 ] ) ]; - } else if ( typeof rules[ this ] === "string" ) { - parts = rules[ this ].replace( /[\[\]]/g, "" ).split( /[\s,]+/ ); - rules[ this ] = [ Number( parts[ 0 ] ), Number( parts[ 1 ] ) ]; - } - } - } ); - - if ( $.validator.autoCreateRanges ) { - - // Auto-create ranges - if ( rules.min != null && rules.max != null ) { - rules.range = [ rules.min, rules.max ]; - delete rules.min; - delete rules.max; - } - if ( rules.minlength != null && rules.maxlength != null ) { - rules.rangelength = [ rules.minlength, rules.maxlength ]; - delete rules.minlength; - delete rules.maxlength; - } - } - - return rules; - }, - - // Converts a simple string to a {string: true} rule, e.g., "required" to {required:true} - normalizeRule: function( data ) { - if ( typeof data === "string" ) { - var transformed = {}; - $.each( data.split( /\s/ ), function() { - transformed[ this ] = true; - } ); - data = transformed; - } - return data; - }, - - // https://jqueryvalidation.org/jQuery.validator.addMethod/ - addMethod: function( name, method, message ) { - $.validator.methods[ name ] = method; - $.validator.messages[ name ] = message !== undefined ? message : $.validator.messages[ name ]; - if ( method.length < 3 ) { - $.validator.addClassRules( name, $.validator.normalizeRule( name ) ); - } - }, - - // https://jqueryvalidation.org/jQuery.validator.methods/ - methods: { - - // https://jqueryvalidation.org/required-method/ - required: function( value, element, param ) { - - // Check if dependency is met - if ( !this.depend( param, element ) ) { - return "dependency-mismatch"; - } - if ( element.nodeName.toLowerCase() === "select" ) { - - // Could be an array for select-multiple or a string, both are fine this way - var val = $( element ).val(); - return val && val.length > 0; - } - if ( this.checkable( element ) ) { - return this.getLength( value, element ) > 0; - } - return value !== undefined && value !== null && value.length > 0; - }, - - // https://jqueryvalidation.org/email-method/ - email: function( value, element ) { - - // From https://html.spec.whatwg.org/multipage/forms.html#valid-e-mail-address - // Retrieved 2014-01-14 - // If you have a problem with this implementation, report a bug against the above spec - // Or use custom methods to implement your own email validation - return this.optional( element ) || /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/.test( value ); - }, - - // https://jqueryvalidation.org/url-method/ - url: function( value, element ) { - - // Copyright (c) 2010-2013 Diego Perini, MIT licensed - // https://gist.github.com/dperini/729294 - // see also https://mathiasbynens.be/demo/url-regex - // modified to allow protocol-relative URLs - return this.optional( element ) || /^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})).?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test( value ); - }, - - // https://jqueryvalidation.org/date-method/ - date: ( function() { - var called = false; - - return function( value, element ) { - if ( !called ) { - called = true; - if ( this.settings.debug && window.console ) { - console.warn( - "The `date` method is deprecated and will be removed in version '2.0.0'.\n" + - "Please don't use it, since it relies on the Date constructor, which\n" + - "behaves very differently across browsers and locales. Use `dateISO`\n" + - "instead or one of the locale specific methods in `localizations/`\n" + - "and `additional-methods.js`." - ); - } - } - - return this.optional( element ) || !/Invalid|NaN/.test( new Date( value ).toString() ); - }; - }() ), - - // https://jqueryvalidation.org/dateISO-method/ - dateISO: function( value, element ) { - return this.optional( element ) || /^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$/.test( value ); - }, - - // https://jqueryvalidation.org/number-method/ - number: function( value, element ) { - return this.optional( element ) || /^(?:-?\d+|-?\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test( value ); - }, - - // https://jqueryvalidation.org/digits-method/ - digits: function( value, element ) { - return this.optional( element ) || /^\d+$/.test( value ); - }, - - // https://jqueryvalidation.org/minlength-method/ - minlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || length >= param; - }, - - // https://jqueryvalidation.org/maxlength-method/ - maxlength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || length <= param; - }, - - // https://jqueryvalidation.org/rangelength-method/ - rangelength: function( value, element, param ) { - var length = $.isArray( value ) ? value.length : this.getLength( value, element ); - return this.optional( element ) || ( length >= param[ 0 ] && length <= param[ 1 ] ); - }, - - // https://jqueryvalidation.org/min-method/ - min: function( value, element, param ) { - return this.optional( element ) || value >= param; - }, - - // https://jqueryvalidation.org/max-method/ - max: function( value, element, param ) { - return this.optional( element ) || value <= param; - }, - - // https://jqueryvalidation.org/range-method/ - range: function( value, element, param ) { - return this.optional( element ) || ( value >= param[ 0 ] && value <= param[ 1 ] ); - }, - - // https://jqueryvalidation.org/step-method/ - step: function( value, element, param ) { - var type = $( element ).attr( "type" ), - errorMessage = "Step attribute on input type " + type + " is not supported.", - supportedTypes = [ "text", "number", "range" ], - re = new RegExp( "\\b" + type + "\\b" ), - notSupported = type && !re.test( supportedTypes.join() ), - decimalPlaces = function( num ) { - var match = ( "" + num ).match( /(?:\.(\d+))?$/ ); - if ( !match ) { - return 0; - } - - // Number of digits right of decimal point. - return match[ 1 ] ? match[ 1 ].length : 0; - }, - toInt = function( num ) { - return Math.round( num * Math.pow( 10, decimals ) ); - }, - valid = true, - decimals; - - // Works only for text, number and range input types - // TODO find a way to support input types date, datetime, datetime-local, month, time and week - if ( notSupported ) { - throw new Error( errorMessage ); - } - - decimals = decimalPlaces( param ); - - // Value can't have too many decimals - if ( decimalPlaces( value ) > decimals || toInt( value ) % toInt( param ) !== 0 ) { - valid = false; - } - - return this.optional( element ) || valid; - }, - - // https://jqueryvalidation.org/equalTo-method/ - equalTo: function( value, element, param ) { - - // Bind to the blur event of the target in order to revalidate whenever the target field is updated - var target = $( param ); - if ( this.settings.onfocusout && target.not( ".validate-equalTo-blur" ).length ) { - target.addClass( "validate-equalTo-blur" ).on( "blur.validate-equalTo", function() { - $( element ).valid(); - } ); - } - return value === target.val(); - }, - - // https://jqueryvalidation.org/remote-method/ - remote: function( value, element, param, method ) { - if ( this.optional( element ) ) { - return "dependency-mismatch"; - } - - method = typeof method === "string" && method || "remote"; - - var previous = this.previousValue( element, method ), - validator, data, optionDataString; - - if ( !this.settings.messages[ element.name ] ) { - this.settings.messages[ element.name ] = {}; - } - previous.originalMessage = previous.originalMessage || this.settings.messages[ element.name ][ method ]; - this.settings.messages[ element.name ][ method ] = previous.message; - - param = typeof param === "string" && { url: param } || param; - optionDataString = $.param( $.extend( { data: value }, param.data ) ); - if ( previous.old === optionDataString ) { - return previous.valid; - } - - previous.old = optionDataString; - validator = this; - this.startRequest( element ); - data = {}; - data[ element.name ] = value; - $.ajax( $.extend( true, { - mode: "abort", - port: "validate" + element.name, - dataType: "json", - data: data, - context: validator.currentForm, - success: function( response ) { - var valid = response === true || response === "true", - errors, message, submitted; - - validator.settings.messages[ element.name ][ method ] = previous.originalMessage; - if ( valid ) { - submitted = validator.formSubmitted; - validator.resetInternals(); - validator.toHide = validator.errorsFor( element ); - validator.formSubmitted = submitted; - validator.successList.push( element ); - validator.invalid[ element.name ] = false; - validator.showErrors(); - } else { - errors = {}; - message = response || validator.defaultMessage( element, { method: method, parameters: value } ); - errors[ element.name ] = previous.message = message; - validator.invalid[ element.name ] = true; - validator.showErrors( errors ); - } - previous.valid = valid; - validator.stopRequest( element, valid ); - } - }, param ) ); - return "pending"; - } - } - -} ); - -// Ajax mode: abort -// usage: $.ajax({ mode: "abort"[, port: "uniqueport"]}); -// if mode:"abort" is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() - -var pendingRequests = {}, - ajax; - -// Use a prefilter if available (1.5+) -if ( $.ajaxPrefilter ) { - $.ajaxPrefilter( function( settings, _, xhr ) { - var port = settings.port; - if ( settings.mode === "abort" ) { - if ( pendingRequests[ port ] ) { - pendingRequests[ port ].abort(); - } - pendingRequests[ port ] = xhr; - } - } ); -} else { - - // Proxy ajax - ajax = $.ajax; - $.ajax = function( settings ) { - var mode = ( "mode" in settings ? settings : $.ajaxSettings ).mode, - port = ( "port" in settings ? settings : $.ajaxSettings ).port; - if ( mode === "abort" ) { - if ( pendingRequests[ port ] ) { - pendingRequests[ port ].abort(); - } - pendingRequests[ port ] = ajax.apply( this, arguments ); - return pendingRequests[ port ]; - } - return ajax.apply( this, arguments ); - }; -} -return $; -})); \ No newline at end of file diff --git a/vendor/wpmetabox/meta-box/js/validation/validation.js b/vendor/wpmetabox/meta-box/js/validation/validation.js deleted file mode 100644 index d6f1e139e..000000000 --- a/vendor/wpmetabox/meta-box/js/validation/validation.js +++ /dev/null @@ -1,131 +0,0 @@ -( function( $, rwmb, i18n ) { - 'use strict'; - - class Validation { - constructor( formSelector ) { - this.$form = $( formSelector ); - this.validationElements = this.$form.find( '.rwmb-validation' ); - this.showAsterisks(); - this.getSettings(); - } - - init() { - this.$form - // Update underlying textarea before submit. - // Don't use submitHandler() because form can be submitted via Ajax on the front end. - .on( 'submit', function() { - if ( typeof tinyMCE !== 'undefined' ) { - tinyMCE.triggerSave(); - } - } ) - .validate( this.settings ); - } - - showAsterisks() { - this.validationElements.each( function() { - var data = $( this ).data( 'validation' ); - - $.each( data.rules, function( k, v ) { - if ( !v[ 'required' ] ) { - return; - } - var $el = $( '[name="' + k + '"]' ); - if ( !$el.length ) { - return; - } - $el.closest( '.rwmb-input' ).siblings( '.rwmb-label' ).find( 'label' ).append( '*' ); - } ); - } ); - } - - getSettings() { - this.settings = { - ignore: ':not(.rwmb-media,.rwmb-image_select,.rwmb-wysiwyg,.rwmb-color,.rwmb-map,.rwmb-osm,.rwmb-switch,[class|="rwmb"])', - errorPlacement: function( error, element ) { - error.appendTo( element.closest( '.rwmb-input' ) ); - }, - errorClass: 'rwmb-error', - errorElement: 'p', - invalidHandler: this.invalidHandler.bind( this ) - }; - - // Gather all validation rules. - var that = this; - this.validationElements.each( function() { - $.extend( true, that.settings, $( this ).data( 'validation' ) ); - } ); - } - - invalidHandler() { - this.showMessage(); - // Group field will automatically expand and show an error warning when collapsing - for ( var i = 0; i