forked from afragen/git-updater
-
Notifications
You must be signed in to change notification settings - Fork 0
/
github-updater.php
64 lines (55 loc) · 2.1 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
<?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. Plugin class based upon <a href="https://github.com/codepress/github-plugin-updater">codepress/github-plugin-updater</a>. Theme class based upon <a href="https://github.com/WordPress-Phoenix/whitelabel-framework">Whitelabel Framework</a> modifications.
Version: 4.6.0.1
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;
}
require_once ( plugin_dir_path( __FILE__ ) . '/vendor/WPUpdatePhp.php' );
$updatePhp = new WPUpdatePhp( '5.3.0' );
$updatePhp->set_plugin_name( 'GitHub Updater' );
if ( ! $updatePhp->does_it_meet_required_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.php',
'WPUpdatePHP' => __DIR__ . '/vendor/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;