-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcollectme.php
62 lines (49 loc) · 1.68 KB
/
collectme.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
declare(strict_types=1);
/**
* @wordpress-plugin
* Plugin Name: Collectme
* Plugin URI: https://github.com/grueneschweiz/collectme
* Description: Handle signature collections with ease.
* Version: 2.2.0
* Requires at least: 6.0
* Requires PHP: 8.1
* Author: Cyrill Bolliger
* Author URI: https://github.com/cyrillbolliger
* Text Domain: collectme
* Domain Path: /languages
* License: GPL v2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Update URI: https://github.com/grueneschweiz/collectme
*/
if (!defined('WPINC')) {
die;
}
const COLLECTME_VERSION = '2.2.0';
const COLLECTME_PLUGIN_NAME = __FILE__;
const COLLECTME_BASE_PATH = __DIR__;
require 'vendor/autoload.php';
// print hooks. enable for debugging
//add_action( 'all', function() {echo "<pre>\n" . current_action() . '</pre>';} );
function collectme_get_container(): \DI\Container
{
if (defined('COLLECTME_DEPENDENCY_CONFIG_PATH')) {
$configPath = COLLECTME_DEPENDENCY_CONFIG_PATH;
} else {
$configPath = COLLECTME_BASE_PATH . '/dependency-config.php';
}
$builder = new \DI\ContainerBuilder();
$builder->addDefinitions($configPath);
if (!(defined('WP_DEBUG') && WP_DEBUG)) {
$builder->enableCompilation(__DIR__ . '/tmp');
$builder->writeProxiesToFile(true, __DIR__ . '/tmp/proxies');
}
/** @noinspection PhpUnhandledExceptionInspection */
return $builder->build();
}
function collectme_run(): void
{
/** @noinspection PhpUnhandledExceptionInspection */
collectme_get_container()->get(Collectme\Collectme::class)->init();
}
collectme_run();