-
Notifications
You must be signed in to change notification settings - Fork 22
/
init.php
51 lines (45 loc) · 1.31 KB
/
init.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
<?php
/**
* Plugin bootstrap.
*
* @package PressForward
*/
// Out-of-namespace dependencies.
require 'vendor/autoload.php';
require 'class-SplClassLoader.php';
require 'Libraries/AlertBox/The_Alert_Box.php';
require 'includes/opml/object.php';
require 'includes/opml/reader.php';
require 'includes/opml/maker.php';
require 'Libraries/PFOpenGraph.php';
// Files included to maintain back-compat.
require 'includes/functions.php';
require 'includes/relationships.php';
require 'includes/template-tags.php';
use Intraxia\Jaxion\Core\Config;
use Intraxia\Jaxion\Core\ConfigType;
use SplClassLoader as ClassLoader;
$class_loader = new ClassLoader( 'PressForward', __DIR__, false );
$class_loader->filterFinalPath( 'PressForward' . DIRECTORY_SEPARATOR, '' );
$class_loader->register();
/**
* PressForward instance.
*
* @param string|null $prop Optional. Use to fetch a property from the global instance.
* @return mixed
*/
function pressforward( $prop = null ) {
$instance = new stdClass();
try {
$instance = new PressForward\Application( new Config( ConfigType::PLUGIN, __FILE__ ) );
$instance->boot();
} catch ( Intraxia\Jaxion\Core\ApplicationAlreadyBootedException $e ) {
$instance = PressForward\Application::instance();
}
if ( ! $prop ) {
return $instance;
} else {
return $instance[ $prop ];
}
}
pressforward();