forked from cedaro/satispress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsatispress.php
68 lines (61 loc) · 1.48 KB
/
satispress.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
<?php
/**
* SatisPress
*
* @package SatisPress
* @author Brady Vercher <brady@blazersix.com>
* @license GPL-2.0+
*
* @wordpress-plugin
* Plugin Name: SatisPress
* Plugin URI: https://github.com/blazersix/satispress
* Description: Generate a Composer repository from installed WordPress plugins and themes.
* Version: 0.2.2
* Author: Blazer Six
* Author URI: http://www.blazersix.com/
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: satispress
* Domain Path: /languages
*/
if ( ! defined( 'SATISPRESS_DIR' ) ) {
/**
* Path directory path.
*
* @since 0.2.0
* @type string SATISPRESS_DIR
*/
define( 'SATISPRESS_DIR', plugin_dir_path( __FILE__ ) );
}
if ( ! defined( 'SATISPRESS_URL' ) ) {
/**
* URL to the plugin's root directory.
*
* Includes trailing slash.
*
* @since 0.2.0
* @type string SATISPRESS_URL
*/
define( 'SATISPRESS_URL', plugin_dir_url( __FILE__ ) );
}
include( SATISPRESS_DIR . 'includes/functions.php' );
/**
* Autoloader callback.
*
* Converts a class name to a file path and requires it if it exists.
*
* @since 0.2.0
*
* @param string $class Class name.
*/
function satispress_autoloader( $class ) {
if ( 0 !== strpos( $class, 'SatisPress' ) ) {
return;
}
$file = SATISPRESS_DIR . 'includes/class-' . strtolower( str_replace( '_', '-', $class ) ) . '.php';
if ( file_exists( $file ) ) {
require_once( $file );
}
}
spl_autoload_register( 'satispress_autoloader' );
SatisPress::instance();