forked from Automattic/s3-media-sync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paths3-media-sync.php
42 lines (36 loc) · 1.02 KB
/
s3-media-sync.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
<?php
/**
* Plugin Name: S3 Media Sync
* Description: Sync full media backups to S3.
* Author: Alexis Kulash, WordPress VIP
* Text Domain: s3-media-sync
* Domain Path: /languages/
* Version: 1.2.0
*/
/**
* Class that handles s3 stream wrapper
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/class-s3-media-sync-stream-wrapper.php';
/**
* Class that handles core plugin functionality
*/
require_once plugin_dir_path( __FILE__ ) . 'inc/class-s3-media-sync.php';
/**
* Class that adds WP-CLI commands
*/
if ( defined( 'WP_CLI' ) && WP_CLI && class_exists( 'WPCOM_VIP_CLI_Command' ) ) {
require_once dirname( __FILE__ ) . '/inc/class-s3-media-sync-wp-cli.php';
}
/**
* Set up the plugin
*/
function s3_media_sync_setup() {
// Ensure the AWS SDK can be loaded.
if ( ! class_exists( '\\Aws\\S3\\S3Client' ) ) {
// Require AWS Autoloader file.
require_once dirname( __FILE__ ) . '/vendor/autoload.php';
}
$instance = S3_Media_Sync::init();
$instance->setup();
}
add_action( 'plugins_loaded', 's3_media_sync_setup' );