-
Notifications
You must be signed in to change notification settings - Fork 22
/
Application.php
92 lines (81 loc) · 2.5 KB
/
Application.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
83
84
85
86
87
88
89
90
91
92
<?php
/**
* Application bootstrap.
*
* @package PressForward
*/
namespace PressForward;
$obj = new Loader();
use Intraxia\Jaxion\Core\Application as JaxionCore;
/**
* Application bootstrap.
*/
class Application extends JaxionCore {
/**
* PressForward version.
*
* @var string
*/
public $ver = PF_VERSION;
/**
* ServiceProviders to register with the Application
*
* @var string[]
*/
protected $providers = array(
'PressForward\Core\Providers\LibrariesProvider',
'PressForward\Core\Providers\SchemaProvider',
'PressForward\Core\Providers\ControllerServiceProvider',
'PressForward\Core\Providers\ModelsProvider',
'PressForward\Core\Providers\AssetsProvider',
'PressForward\Core\Providers\UtilityProvider',
'PressForward\Core\Providers\AdminAreaServiceProvider',
'PressForward\Core\Providers\PreferencesServiceProvider',
'PressForward\Core\Providers\ModulesProvider',
'PressForward\Core\Providers\AJAXServiceProvider',
'PressForward\Core\Providers\APIProvider',
'PressForward\Core\Providers\BookmarkletProvider',
'PressForward\Core\Providers\BlocksProvider',
// phpcs:disable
// 'PressForward\Core\Providers\CoreServiceProvider',
// 'PressForward\Core\Providers\EmbedServiceProvider',
// 'PressForward\Core\Providers\RouterServiceProvider',
// phpcs:enable
);
/**
* {@inheritdoc}
*/
public function activate() {
global $wp_rewrite;
define( 'VERSION', '5.1.0' );
$current_version = VERSION; // define this constant in the loader file.
$saved_version = get_option( 'pf_version' );
// This is a new installation.
if ( ! $saved_version ) {
// Do whatever you need to do during first installation.
$check = pressforward( 'schema.feeds' )->create(
'http://pressforward.org/feed/',
array(
'title' => 'PressForward',
'htmlUrl' => 'http://pressforward.org/',
'description' => 'The news feed for the PressForward project.',
'type' => 'rss',
'module_added' => 'rss-import',
)
);
$wp_rewrite->flush_rules( false );
// This is an upgrade.
} elseif ( version_compare( $saved_version, $current_version, '<' ) ) {
// Do whatever you need to do on an upgrade.
delete_option( 'pf_delete_queue_nonce' );
$wp_rewrite->flush_rules( false );
// Version is up to date - do nothing.
} else {
return;
}
// Update the version number stored in the db (so this does not run again).
update_option( 'pf_version', PF_VERSION );
}
}
// phpcs:ignore
// call_user_func(array(new Application(__FILE__), 'boot'));