-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfastendpoints-depends.php
32 lines (28 loc) · 1.03 KB
/
fastendpoints-depends.php
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
32
<?php
/**
* Plugin Name: FastEndpoints Depends
* Plugin URI: https://github.com/matapatos/wp-fastendponts-depends
* Description: Speed up your REST endpoints by treating plugins as dependencies
* Version: 1.0.0
* Author: André Gil
* Author URI: https://github.com/matapatos
*
* @version 1.0.0
*
* @license MIT
*/
$composer = __DIR__.'/vendor/autoload.php';
if (! file_exists($composer)) {
wp_die(
esc_html__(
'Error locating autoloader in plugins/wp-fastendpoints-depends. Please run <code>composer install</code>.',
'fastendpoints-depends',
),
);
}
require_once $composer;
$autoloader = $autoloader ?? new \Wp\FastEndpoints\Depends\DependsAutoloader;
$autoloader->register();
$isToUpdateOnPluginActivation = defined('FASTENDPOINTS_DEPENDS_REFRESH_ON_PLUGIN_ACTIVATION') ? \FASTENDPOINTS_DEPENDS_REFRESH_ON_PLUGIN_ACTIVATION : true;
$dependencies = $generator ?? new \Wp\FastEndpoints\Depends\DependenciesGenerator(null, $isToUpdateOnPluginActivation);
$dependencies->register();