-
Notifications
You must be signed in to change notification settings - Fork 0
/
wp-plugin-mold.php
42 lines (35 loc) · 1.19 KB
/
wp-plugin-mold.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
33
34
35
36
37
38
39
40
41
42
<?php
/**
* Plugin Name: WP Plugin Mold
* Plugin URI: https://example.com/wp-plugin-mold
* Description: A mold for creating WordPress plugins.
* Version: 1.0.1-alpha
* Requires at least: 6.4.3
* Requires PHP: 8.0
* Author: Your Name
* Author URI: https://example.com
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Update URI: https://example.com/wp-plugin-mold-update
* Text Domain: wp-plugin-mold
* Domain Path: /languages
*
* @package WpPluginMold
*/
defined( 'ABSPATH' ) || exit;
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
use WpPluginMold\ServiceContainer;
if ( file_exists( __DIR__ . '/services.php' ) ) {
$services = require __DIR__ . '/services.php';
$mold_container = new ServiceContainer();
foreach ( $services as $name => $service_callable ) {
$mold_container->register( $name, $service_callable );
}
foreach ( $mold_container->get_services() as $service_id => $service ) {
if ( is_object( $service ) && method_exists( $service, 'boot' ) ) {
$service->boot();
}
}
}