use composer autoloader
This commit is contained in:
27
autoload.php
27
autoload.php
@ -1,27 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* Manages Composer autoload.
|
|
||||||
*
|
|
||||||
* @package WP_Ultimo
|
|
||||||
* @since 2.3.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
// phpcs:disable
|
|
||||||
|
|
||||||
if (isset($GLOBALS['__composer_autoload_files'])) {
|
|
||||||
$existingComposerAutoloadFiles = $GLOBALS['__composer_autoload_files'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$loader = require_once __DIR__ . '/dependencies/autoload.php';
|
|
||||||
// Ensure InstalledVersions is available
|
|
||||||
$installedVersionsPath = __DIR__.'/composer/InstalledVersions.php';
|
|
||||||
if (file_exists($installedVersionsPath)) require_once $installedVersionsPath;
|
|
||||||
|
|
||||||
// Restore the backup
|
|
||||||
if (isset($existingComposerAutoloadFiles)) {
|
|
||||||
$GLOBALS['__composer_autoload_files'] = $existingComposerAutoloadFiles;
|
|
||||||
} else {
|
|
||||||
unset($GLOBALS['__composer_autoload_files']);
|
|
||||||
}
|
|
||||||
|
|
||||||
// phpcs:enable
|
|
@ -17,13 +17,15 @@
|
|||||||
"license": [
|
"license": [
|
||||||
"GPL-3.0-or-later"
|
"GPL-3.0-or-later"
|
||||||
],
|
],
|
||||||
"type": "wordpress-plugin",
|
"autoload": {
|
||||||
|
"classmap": ["inc"]
|
||||||
|
},
|
||||||
|
"type": "wordpress-plugin",
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=7.4.1",
|
"php": ">=7.4.1",
|
||||||
"automattic/jetpack-autoloader": "^5.0.0",
|
"automattic/jetpack-autoloader": "^5.0.0",
|
||||||
"rpnzl/arrch": "dev-master#994258bbefb7722243211654c4f78813312cd5ed",
|
"rpnzl/arrch": "dev-master#994258bbefb7722243211654c4f78813312cd5ed",
|
||||||
"amphp/amp": "v2.6.2",
|
"amphp/amp": "v2.6.2",
|
||||||
"pablo-sg-pacheco/wp-namespace-autoloader": "dev-master#069163f215743c83381613749ace0c5a642720b4",
|
|
||||||
"psr/log": "2.0.0",
|
"psr/log": "2.0.0",
|
||||||
"delight-im/cookie": "v3.4.0",
|
"delight-im/cookie": "v3.4.0",
|
||||||
"berlindb/core": "2.0.1",
|
"berlindb/core": "2.0.1",
|
||||||
@ -41,7 +43,8 @@
|
|||||||
"nyholm/psr7": "1.8.0",
|
"nyholm/psr7": "1.8.0",
|
||||||
"symfony/cache": "v5.4.29",
|
"symfony/cache": "v5.4.29",
|
||||||
"scssphp/scssphp": "v1.11.1",
|
"scssphp/scssphp": "v1.11.1",
|
||||||
"cweagans/composer-patches": "^1.7"
|
"cweagans/composer-patches": "^1.7",
|
||||||
|
"woocommerce/action-scheduler": "^3.9.1"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"composer/installers": "1.9.0",
|
"composer/installers": "1.9.0",
|
||||||
@ -83,6 +86,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
"installer-paths": {
|
||||||
|
"vendor/woocommerce/{$name}/": ["type:wordpress-plugin"]
|
||||||
|
},
|
||||||
"patches": {
|
"patches": {
|
||||||
"jasny/sso": [
|
"jasny/sso": [
|
||||||
"patches/jasny-sso-src-broker-cookies-php.patch"
|
"patches/jasny-sso-src-broker-cookies-php.patch"
|
||||||
|
108
composer.lock
generated
108
composer.lock
generated
@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "56efb7815eb373b16f8a02e647175528",
|
"content-hash": "d08d354204b85123032d52ffd03ef616",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "amphp/amp",
|
"name": "amphp/amp",
|
||||||
@ -1393,68 +1393,6 @@
|
|||||||
],
|
],
|
||||||
"time": "2023-05-02T11:26:24+00:00"
|
"time": "2023-05-02T11:26:24+00:00"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "pablo-sg-pacheco/wp-namespace-autoloader",
|
|
||||||
"version": "dev-master",
|
|
||||||
"source": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/pablo-sg-pacheco/wp-namespace-autoloader.git",
|
|
||||||
"reference": "069163f215743c83381613749ace0c5a642720b4"
|
|
||||||
},
|
|
||||||
"dist": {
|
|
||||||
"type": "zip",
|
|
||||||
"url": "https://api.github.com/repos/pablo-sg-pacheco/wp-namespace-autoloader/zipball/069163f215743c83381613749ace0c5a642720b4",
|
|
||||||
"reference": "069163f215743c83381613749ace0c5a642720b4",
|
|
||||||
"shasum": ""
|
|
||||||
},
|
|
||||||
"require": {
|
|
||||||
"php": ">=5.4"
|
|
||||||
},
|
|
||||||
"require-dev": {
|
|
||||||
"cweagans/composer-patches": "^1.0",
|
|
||||||
"dealerdirect/phpcodesniffer-composer-installer": "0.7.0",
|
|
||||||
"phpunit/phpunit": "^7",
|
|
||||||
"squizlabs/php_codesniffer": "dev-master",
|
|
||||||
"wp-coding-standards/wpcs": "^2.3"
|
|
||||||
},
|
|
||||||
"default-branch": true,
|
|
||||||
"type": "library",
|
|
||||||
"extra": {
|
|
||||||
"patches": {
|
|
||||||
"squizlabs/php_codesniffer": {
|
|
||||||
"Add GitHub Actions Annotations report type": "https://github.com/squizlabs/PHP_CodeSniffer/pull/2918.patch"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"Pablo_Pacheco\\WP_Namespace_Autoloader\\": "src"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
|
||||||
"license": [
|
|
||||||
"GPLv2"
|
|
||||||
],
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Pablo dos S G Pacheco",
|
|
||||||
"email": "pablo.sg.pacheco@gmail.com"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"description": "A PHP autoloader class that follows the WordPress coding standards 2.0 and proposed 3.0 for class/interface/trait names and filenames",
|
|
||||||
"homepage": "https://github.com/pablo-pacheco/wp-namespace-autoloader",
|
|
||||||
"keywords": [
|
|
||||||
"autoload",
|
|
||||||
"namespace",
|
|
||||||
"wordpress",
|
|
||||||
"wp"
|
|
||||||
],
|
|
||||||
"support": {
|
|
||||||
"issues": "https://github.com/pablo-sg-pacheco/wp-namespace-autoloader/issues",
|
|
||||||
"source": "https://github.com/pablo-sg-pacheco/wp-namespace-autoloader/tree/master"
|
|
||||||
},
|
|
||||||
"time": "2022-12-02T14:49:51+00:00"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "paragonie/random_compat",
|
"name": "paragonie/random_compat",
|
||||||
"version": "v9.99.100",
|
"version": "v9.99.100",
|
||||||
@ -3858,6 +3796,49 @@
|
|||||||
"source": "https://github.com/webmozarts/assert/tree/1.11.0"
|
"source": "https://github.com/webmozarts/assert/tree/1.11.0"
|
||||||
},
|
},
|
||||||
"time": "2022-06-03T18:03:27+00:00"
|
"time": "2022-06-03T18:03:27+00:00"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "woocommerce/action-scheduler",
|
||||||
|
"version": "3.9.1",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/woocommerce/action-scheduler.git",
|
||||||
|
"reference": "d73b5f83cd42832fa137e03687bad3e312298d29"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/woocommerce/action-scheduler/zipball/d73b5f83cd42832fa137e03687bad3e312298d29",
|
||||||
|
"reference": "d73b5f83cd42832fa137e03687bad3e312298d29",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"php": ">=7.1"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^7.5",
|
||||||
|
"woocommerce/woocommerce-sniffs": "0.1.0",
|
||||||
|
"wp-cli/wp-cli": "~2.5.0",
|
||||||
|
"yoast/phpunit-polyfills": "^2.0"
|
||||||
|
},
|
||||||
|
"type": "wordpress-plugin",
|
||||||
|
"extra": {
|
||||||
|
"scripts-description": {
|
||||||
|
"test": "Run unit tests",
|
||||||
|
"phpcs": "Analyze code against the WordPress coding standards with PHP_CodeSniffer",
|
||||||
|
"phpcbf": "Fix coding standards warnings/errors automatically with PHP Code Beautifier"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"GPL-3.0-or-later"
|
||||||
|
],
|
||||||
|
"description": "Action Scheduler for WordPress and WooCommerce",
|
||||||
|
"homepage": "https://actionscheduler.org/",
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/woocommerce/action-scheduler/issues",
|
||||||
|
"source": "https://github.com/woocommerce/action-scheduler/tree/3.9.1"
|
||||||
|
},
|
||||||
|
"time": "2025-01-21T11:39:08+00:00"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"packages-dev": [
|
"packages-dev": [
|
||||||
@ -6430,7 +6411,6 @@
|
|||||||
"aliases": [],
|
"aliases": [],
|
||||||
"minimum-stability": "stable",
|
"minimum-stability": "stable",
|
||||||
"stability-flags": {
|
"stability-flags": {
|
||||||
"pablo-sg-pacheco/wp-namespace-autoloader": 20,
|
|
||||||
"rakit/validation": 20,
|
"rakit/validation": 20,
|
||||||
"rpnzl/arrch": 20
|
"rpnzl/arrch": 20
|
||||||
},
|
},
|
||||||
|
@ -37,25 +37,11 @@ class Autoloader {
|
|||||||
* Initializes our custom autoloader
|
* Initializes our custom autoloader
|
||||||
*
|
*
|
||||||
* @since 2.0.0
|
* @since 2.0.0
|
||||||
|
* @deprecated 2.3.5
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function init() {
|
public static function init() {
|
||||||
|
// do nothing now. Composer autoloader does the work.
|
||||||
if (!static::$instance instanceof static) {
|
|
||||||
|
|
||||||
static::$instance = new WP_Namespace_Autoloader(array(
|
|
||||||
'directory' => dirname(dirname(__FILE__)),
|
|
||||||
'namespace_prefix' => 'WP_Ultimo',
|
|
||||||
'classes_dir' => 'inc',
|
|
||||||
'lowercase' => array('file', 'folders'),
|
|
||||||
'underscore_to_hyphen' => array('file', 'folders'),
|
|
||||||
'debug' => Autoloader::is_debug(),
|
|
||||||
));
|
|
||||||
|
|
||||||
static::$instance->init();
|
|
||||||
|
|
||||||
} // end if;
|
|
||||||
|
|
||||||
} // end init;
|
} // end init;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -62,19 +62,10 @@ require_once __DIR__ . '/constants.php';
|
|||||||
|
|
||||||
require_once __DIR__ . '/vendor/autoload_packages.php';
|
require_once __DIR__ . '/vendor/autoload_packages.php';
|
||||||
|
|
||||||
require_once __DIR__ . '/autoload.php';
|
require_once __DIR__ . '/vendor/woocommerce/action-scheduler/action-scheduler.php';
|
||||||
|
|
||||||
require_once __DIR__ . '/inc/class-autoloader.php';
|
|
||||||
|
|
||||||
require_once __DIR__ . '/dependencies/woocommerce/action-scheduler/action-scheduler.php';
|
|
||||||
|
|
||||||
require_once __DIR__ . '/inc/traits/trait-singleton.php';
|
require_once __DIR__ . '/inc/traits/trait-singleton.php';
|
||||||
|
|
||||||
/**
|
|
||||||
* Setup autoloader
|
|
||||||
*/
|
|
||||||
WP_Ultimo\Autoloader::init();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup activation/deactivation hooks
|
* Setup activation/deactivation hooks
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user