-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwristler.php
79 lines (55 loc) · 1.61 KB
/
wristler.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/*
Plugin Name: Wristler
Plugin URI: https://wristler.eu
Description: This plug-ins allows your WooCommerce shop to sync with Wristler for automated stock updates.
Version: 1.3.1
Requires PHP: 7.4
Author: Wristler
Author URI: https://wristler.eu
Text Domain: wristler
Domain Path: /lang
Developer: Jeffrey Ponsen <[email protected]>
*/
namespace Wristler;
use Wristler\Rest\Rest;
if (!defined('WRISTLER_PLUGIN_PATH')) {
define('WRISTLER_PLUGIN_PATH', dirname(__FILE__));
}
if (!defined('WRISTLER_RESOURCE_PATH')) {
define('WRISTLER_RESOURCE_PATH', dirname(__FILE__) . '/resources');
}
if (file_exists(dirname(__FILE__) . '/vendor/autoload.php')) {
require_once(dirname(__FILE__) . '/vendor/autoload.php');
}
class Wristler
{
const VERSION = '1.3.1';
protected static $instance;
protected $updater;
protected $assets;
protected $woocommerce;
protected $rest;
public static function get(): self
{
if (null === self::$instance) {
self::$instance = new self();
}
return self::$instance;
}
public function __construct()
{
load_plugin_textdomain('wristler', false, basename(dirname(__FILE__)) . '/resources/lang');
$this->updater = new Updater();
$this->assets = new Assets();
$this->woocommerce = new WooCommerce();
$this->rest = new Rest();
}
public static function install() {}
}
function Wristler()
{
return Wristler::get();
}
add_action('plugins_loaded', __NAMESPACE__ . '\\Wristler');
register_activation_hook(__FILE__, [Wristler::class, 'install']);