forked from afragen/git-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub-updater.php
67 lines (59 loc) · 2 KB
/
github-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
61
62
63
64
65
66
67
<?php
/**
* GitHub Updater
*
* @package GitHub_Updater
* @author Andy Fragen
* @license GPL-2.0+
* @link https://github.com/afragen/github-updater
*/
/*
Plugin Name: GitHub Updater
Plugin URI: https://github.com/afragen/github-updater
Description: A plugin to automatically update GitHub, Bitbucket or GitLab hosted plugins and themes. It also allows for remote installation of plugins or themes into WordPress.
Version: 5.1.2
Author: Andy Fragen
License: GNU General Public License v2
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Domain Path: /languages
Text Domain: github-updater
Network: true
GitHub Plugin URI: https://github.com/afragen/github-updater
GitHub Branch: develop
Requires WP: 3.8
Requires PHP: 5.3
*/
/*
* Exit if called directly.
* PHP version check and exit.
*/
if ( ! defined( 'WPINC' ) ) {
die;
}
if ( ! class_exists( 'WPUpdatePhp' ) ) {
require_once ( plugin_dir_path( __FILE__ ) . '/vendor/wp-update-php/src/WPUpdatePhp.php' );
}
$updatePhp = new WPUpdatePhp( '5.3.0' );
if ( method_exists( $updatePhp, 'set_plugin_name' ) ) {
$updatePhp->set_plugin_name( 'GitHub Updater' );
}
if ( ! $updatePhp->does_it_meet_required_php_version( PHP_VERSION ) ) {
return false;
}
// Load textdomain
load_plugin_textdomain( 'github-updater', false, __DIR__ . '/languages' );
// Plugin namespace root
$root = array( 'Fragen\\GitHub_Updater' => __DIR__ . '/src/GitHub_Updater' );
// Add extra classes
$extra_classes = array(
'Parsedown' => __DIR__ . '/vendor/parsedown/Parsedown.php',
'WPUpdatePHP' => __DIR__ . '/vendor/wp-update-php/src/WPUpdatePhp.php',
'Automattic_Readme' => __DIR__ . '/vendor/parse-readme.php',
);
// Load Autoloader
require_once( __DIR__ . '/src/GitHub_Updater/Autoloader.php' );
$loader = 'Fragen\\GitHub_Updater\\Autoloader';
new $loader( $root, $extra_classes );
// Instantiate class GitHub_Updater
$instantiate = 'Fragen\\GitHub_Updater\\Base';
new $instantiate;