-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpane-wordpress-plugin.php
executable file
·50 lines (38 loc) · 1.26 KB
/
webpane-wordpress-plugin.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
<?php
/*
Plugin Name: Webpane WordPress (official plugin)
Plugin URI: https://github.com/webpane/webpane-wordpress-plugin
Description: Get a new banana for your split.
Author: webpane
Version: 0.0.1
Author URI: https://github.com/webpane
*/
require_once __DIR__ . '/vendor/autoload.php';
use Pimple\Container;
use Pimple\Psr11\Container as PsrContainer;
use Webpane\WordpressPlugin\Plugin;
use Webpane\WordpressPlugin\Ping;
use Webpane\WordpressPlugin\ManagementPage;
use Webpane\WordpressPlugin\WebpaneClient;
$container = new Container();
$psrContainer = new PsrContainer($container);
$container['templates'] = function ($c) {
return League\Plates\Engine::create(__DIR__.'/templates');
};
$container[ManagementPage::class] = function ($c) {
return new ManagementPage($c['templates']);
};
$container[WebpaneClient::class] = function ($c) {
return new WebpaneClient([
'base_uri' => 'https://webpane.herokuapp.com/api/',
]);
};
$container[Ping::class] = function ($c) {
return new Ping($c[WebpaneClient::class]);
};
$plugin = new Plugin($psrContainer, __FILE__);
$plugin->run();
function cron_webpane_ping_e65a6649() {
file_put_contents(__DIR__.'/io.txt', "A", FILE_APPEND);
}
add_action( 'webpane_ping', 'cron_webpane_ping_e65a6649', 10, 0 );