-
Notifications
You must be signed in to change notification settings - Fork 3
/
nginx-fastcgi-cache-purger.php
82 lines (75 loc) · 2.07 KB
/
nginx-fastcgi-cache-purger.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
78
79
80
81
82
<?php
/**
* Nginx FastCGI Cache Purger or The Nginx Helper Helper
*
* @package LearningCurve\NginxFastCGICachePurger
* @since 1.0.0
* @author Jeff Cleverley
* @license GNU-2.0+
*
* @wordpress-plugin
* Plugin Name: Nginx FastCGI Cache Purger
* Description: Plugin to initiate the FastCGI Cache Purge on a multiuser Nginx LEMP stack
* Version: 1.0.0
* Author: Jeff Cleverley
* Author URI: https://github.com/JeffCleverley/NginxFastCGICachePurger
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: nginx-fastcgi-cache-purger
*
* Plugin was developed as a collabporation between GridPane and RunCloud
* to solve one of Nginx's biggest problems. Great thanks to Patrick and Jebat!
*/
if ( ! defined( 'ABSPATH' ) ) {
exit( 'Hello, Hello, Hello, what\'s going on here then?' );
}
/**
* Set Constants
*
*/
define( 'NFCP_VERSION', '1.0.0' );
define( 'NFCP_TEXT_DOMAIN', 'nginx-fastcgi-cache-purger' );
define( 'NFCP_DIR_URL', plugin_dir_url( __FILE__ ) );
define( 'NFCP_DIR_PATH', plugin_dir_path( __FILE__ ) );
/**
* The code that runs during plugin activation.
*/
function activate_nginx_fastcgi_cache_purger() {
require_once NFCP_DIR_PATH . 'src/class-nfcp-activator.php';
Nginx_FastCGI_Cache_Purger_Plugin_Activator::activate();
}
/**
* The code that runs during plugin deactivation.
*/
function deactivate_nginx_fastcgi_cache_purger() {
require_once NFCP_DIR_PATH . 'src/class-nfcp-deactivator.php';
Nginx_FastCGI_Cache_Purger_Plugin_Deactivator::deactivate();
}
register_activation_hook( __FILE__, 'activate_nginx_fastcgi_cache_purger' );
register_deactivation_hook( __FILE__, 'deactivate_nginx_fastcgi_cache_purger' );
/**
* Autoload the plugin's files.
*
* @since 1.0
*
* @return void
*/
function autoload_files() {
$files = array(
'class-nfcp.php',
);
foreach ( $files as $file ) {
require NFCP_DIR_PATH . '/src/' . $file;
}
}
/**
* Launch the plugin.
*
* @since 1.0
*
* @return void
*/
function launch() {
autoload_files();
}
launch();