forked from afragen/git-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit-updater.php
60 lines (51 loc) · 1.53 KB
/
git-updater.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
<?php
/**
* Git Updater
*
* @author Andy Fragen
* @license MIT
* @link https://github.com/afragen/git-updater
* @package git-updater
*/
/**
* Plugin Name: Git Updater
* Plugin URI: https://git-updater.com
* Description: A plugin to automatically update GitHub hosted plugins, themes, and language packs. Additional API plugins available for Bitbucket, GitLab, Gitea, and Gist.
* Version: 10.9.0.1
* Author: Andy Fragen
* License: MIT
* Domain Path: /languages
* Text Domain: git-updater
* Network: true
* GitHub Plugin URI: https://github.com/afragen/git-updater
* GitHub Languages: https://github.com/afragen/git-updater-translations
* Requires at least: 5.2
* Requires PHP: 5.6
*/
namespace Fragen\Git_Updater;
use Fragen\Git_Updater\API\Zipfile_API;
/*
* Exit if called directly.
* PHP version check and exit.
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
// Load the Composer autoloader.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require __DIR__ . '/vendor/autoload.php';
}
// Check for composer autoloader.
if ( ! class_exists( 'Fragen\Git_Updater\Bootstrap' ) ) {
require_once __DIR__ . '/src/Git_Updater/Bootstrap.php';
( new Bootstrap( __FILE__ ) )->deactivate_die();
}
register_activation_hook( __FILE__, [ new Bootstrap( __FILE__ ), 'rename_on_activation' ] );
( new Zipfile_API() )->load_hooks();
add_action(
'plugins_loaded',
function() {
( new GU_Freemius() )->init();
( new Bootstrap( __FILE__ ) )->run();
}
);