From 10c292b0df432ff20d3844d33724d0bd7f655099 Mon Sep 17 00:00:00 2001 From: David Stone Date: Fri, 7 Feb 2025 11:35:59 -0700 Subject: [PATCH] Fix sunrise errors --- autoload.php | 11 + composer.json | 13 +- composer.lock | 622 +++++--------------------------------- inc/class-sunrise.php | 43 ++- inc/functions/sunrise.php | 31 -- 5 files changed, 116 insertions(+), 604 deletions(-) create mode 100644 autoload.php diff --git a/autoload.php b/autoload.php new file mode 100644 index 0000000..15c49fa --- /dev/null +++ b/autoload.php @@ -0,0 +1,11 @@ +=7.2" - }, - "provide": { - "ext-mbstring": "*" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "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" - ], - "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.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": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/polyfill-php73", "version": "v1.31.0", @@ -3491,181 +3139,6 @@ ], "time": "2024-09-25T14:11:13+00:00" }, - { - "name": "symfony/translation", - "version": "v5.4.45", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/98f26acc99341ca4bab345fb14d7b1d7cb825bed", - "reference": "98f26acc99341ca4bab345fb14d7b1d7cb825bed", - "shasum": "" - }, - "require": { - "php": ">=7.2.5", - "symfony/deprecation-contracts": "^2.1|^3", - "symfony/polyfill-mbstring": "~1.0", - "symfony/polyfill-php80": "^1.16", - "symfony/translation-contracts": "^2.3" - }, - "conflict": { - "symfony/config": "<4.4", - "symfony/console": "<5.3", - "symfony/dependency-injection": "<5.0", - "symfony/http-kernel": "<5.0", - "symfony/twig-bundle": "<5.0", - "symfony/yaml": "<4.4" - }, - "provide": { - "symfony/translation-implementation": "2.3" - }, - "require-dev": { - "psr/log": "^1|^2|^3", - "symfony/config": "^4.4|^5.0|^6.0", - "symfony/console": "^5.4|^6.0", - "symfony/dependency-injection": "^5.0|^6.0", - "symfony/finder": "^4.4|^5.0|^6.0", - "symfony/http-client-contracts": "^1.1|^2.0|^3.0", - "symfony/http-kernel": "^5.0|^6.0", - "symfony/intl": "^4.4|^5.0|^6.0", - "symfony/polyfill-intl-icu": "^1.21", - "symfony/service-contracts": "^1.1.2|^2|^3", - "symfony/yaml": "^4.4|^5.0|^6.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "autoload": { - "files": [ - "Resources/functions.php" - ], - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "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": "Provides tools to internationalize your application", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/translation/tree/v5.4.45" - }, - "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": "2024-09-25T14:11:13+00:00" - }, - { - "name": "symfony/translation-contracts", - "version": "v2.5.4", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation-contracts.git", - "reference": "450d4172653f38818657022252f9d81be89ee9a8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation-contracts/zipball/450d4172653f38818657022252f9d81be89ee9a8", - "reference": "450d4172653f38818657022252f9d81be89ee9a8", - "shasum": "" - }, - "require": { - "php": ">=7.2.5" - }, - "suggest": { - "symfony/translation-implementation": "" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/contracts", - "name": "symfony/contracts" - }, - "branch-alias": { - "dev-main": "2.5-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Contracts\\Translation\\": "" - } - }, - "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 translation", - "homepage": "https://symfony.com", - "keywords": [ - "abstractions", - "contracts", - "decoupling", - "interfaces", - "interoperability", - "standards" - ], - "support": { - "source": "https://github.com/symfony/translation-contracts/tree/v2.5.4" - }, - "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": "2024-09-25T14:11:13+00:00" - }, { "name": "symfony/var-exporter", "version": "v5.4.45", @@ -3799,16 +3272,16 @@ }, { "name": "woocommerce/action-scheduler", - "version": "3.9.1", + "version": "3.9.2", "source": { "type": "git", "url": "https://github.com/woocommerce/action-scheduler.git", - "reference": "d73b5f83cd42832fa137e03687bad3e312298d29" + "reference": "efbb7953f72a433086335b249292f280dd43ddfe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/d73b5f83cd42832fa137e03687bad3e312298d29", - "reference": "d73b5f83cd42832fa137e03687bad3e312298d29", + "url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/efbb7953f72a433086335b249292f280dd43ddfe", + "reference": "efbb7953f72a433086335b249292f280dd43ddfe", "shasum": "" }, "require": { @@ -3836,9 +3309,9 @@ "homepage": "https://actionscheduler.org/", "support": { "issues": "https://github.com/woocommerce/action-scheduler/issues", - "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.1" + "source": "https://github.com/woocommerce/action-scheduler/tree/3.9.2" }, - "time": "2025-01-21T11:39:08+00:00" + "time": "2025-02-03T09:09:30+00:00" } ], "packages-dev": [ @@ -4131,6 +3604,69 @@ ], "time": "2022-12-30T00:15:36+00:00" }, + { + "name": "fakerphp/faker", + "version": "v1.24.1", + "source": { + "type": "git", + "url": "https://github.com/FakerPHP/Faker.git", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/FakerPHP/Faker/zipball/e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "reference": "e0ee18eb1e6dc3cda3ce9fd97e5a0689a88a64b5", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "psr/container": "^1.0 || ^2.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "conflict": { + "fzaninotto/faker": "*" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.4.1", + "doctrine/persistence": "^1.3 || ^2.0", + "ext-intl": "*", + "phpunit/phpunit": "^9.5.26", + "symfony/phpunit-bridge": "^5.4.16" + }, + "suggest": { + "doctrine/orm": "Required to use Faker\\ORM\\Doctrine", + "ext-curl": "Required by Faker\\Provider\\Image to download images.", + "ext-dom": "Required by Faker\\Provider\\HtmlLorem for generating random HTML.", + "ext-iconv": "Required by Faker\\Provider\\ru_RU\\Text::realText() for generating real Russian text.", + "ext-mbstring": "Required for multibyte Unicode string functionality." + }, + "type": "library", + "autoload": { + "psr-4": { + "Faker\\": "src/Faker/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "François Zaninotto" + } + ], + "description": "Faker is a PHP library that generates fake data for you.", + "keywords": [ + "data", + "faker", + "fixtures" + ], + "support": { + "issues": "https://github.com/FakerPHP/Faker/issues", + "source": "https://github.com/FakerPHP/Faker/tree/v1.24.1" + }, + "time": "2024-11-21T13:46:39+00:00" + }, { "name": "nikic/php-parser", "version": "v5.4.0", diff --git a/inc/class-sunrise.php b/inc/class-sunrise.php index c4c0c26..6e51048 100644 --- a/inc/class-sunrise.php +++ b/inc/class-sunrise.php @@ -45,11 +45,6 @@ class Sunrise { require_once __DIR__ . '/functions/sunrise.php'; - /** - * Load development tools as soon as possible. - */ - \WP_Ultimo\Sunrise::load_development_mode(); - /** * Load the core apis we need from the start. */ @@ -111,8 +106,6 @@ class Sunrise { */ public static function load_dependencies() { - require_once dirname(__DIR__) . '/autoload.php'; - require_once __DIR__ . '/deprecated/early-deprecated.php'; require_once __DIR__ . '/deprecated/mercator.php'; @@ -129,10 +122,24 @@ class Sunrise { require_once __DIR__ . '/functions/array-helpers.php'; - /* - * Setup autoloader - */ - \WP_Ultimo\Autoloader::init(); + require_once __DIR__ . '/traits/trait-singleton.php'; + require_once __DIR__ . '/objects/class-limitations.php'; + require_once __DIR__ . '/models/traits/trait-limitable.php'; + require_once __DIR__ . '/models/traits/trait-notable.php'; + require_once __DIR__ . '/traits/trait-wp-ultimo-site-deprecated.php'; + require_once __DIR__ . '/database/engine/class-enum.php'; + require_once __DIR__ . '/database/sites/class-site-type.php'; + require_once __DIR__ . '/models/class-base-model.php'; + require_once __DIR__ . '/models/class-domain.php'; + require_once __DIR__ . '/models/class-site.php'; + require_once __DIR__ . '/domain-mapping/class-primary-domain.php'; + require_once __DIR__ . '/compat/class-domain-mapping-compat.php'; + require_once __DIR__ . '/class-domain-mapping.php'; + require_once __DIR__ . '/traits/trait-wp-ultimo-settings-deprecated.php'; + require_once __DIR__ . '/class-settings.php'; + require_once __DIR__ . '/limits/class-plugin-limits.php'; + require_once __DIR__ . '/limits/class-theme-limits.php'; + } // end load_dependencies; @@ -175,7 +182,7 @@ class Sunrise { /** * Load dependencies and get autoload running */ - \WP_Ultimo\Sunrise::load_dependencies(); + self::load_dependencies(); /* * Adds backwards compatibility code for the domain mapping. @@ -510,18 +517,6 @@ class Sunrise { } // end tap; - /** - * Load development modes, if we need too. - * - * @since 2.0.11 - * @return void - */ - protected static function load_development_mode() { - - $should_load_tools = wu_load_dev_tools(); - - } // end load_development_mode; - // phpcs:ignore private function __construct() {} // end __construct; diff --git a/inc/functions/sunrise.php b/inc/functions/sunrise.php index 650026f..a9efe73 100644 --- a/inc/functions/sunrise.php +++ b/inc/functions/sunrise.php @@ -91,37 +91,6 @@ function wu_get_security_mode_key(): string { } // end wu_get_security_mode_key; -/** - * Load te dev tools, if they exist. - * - * @since 2.0.11 - * - * @param boolean $load If we should load it or not. - * @return string The path to the dev tools folder. - */ -function wu_load_dev_tools($load = true) { - - if (defined('WP_ULTIMO_SUNRISE_FILE')) { - /* - * If the vendor folder exists, we are - * for sure, inside a dev environment. - */ - $autoload_file = dirname((string) WP_ULTIMO_SUNRISE_FILE, 2) . '/vendor/autoload.php'; - - if (file_exists($autoload_file)) { - - $load && require_once $autoload_file; - - return $autoload_file; - - } // end if; - - } // end if; - - return ''; - -} // end wu_load_dev_tools; - /** * Early substitute for wp_kses_data before it exists. *