-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontroller.php
167 lines (147 loc) · 3.83 KB
/
controller.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<?php
/**
* SEO Update Service Notifier Controller File.
*
* @author Oliver Green <[email protected]>
* @license See attached license file
*/
namespace Concrete\Package\SeoUpdateServiceNotifier;
use Core;
use Concrete\Core\Foundation\Service\ProviderList;
use Concrete\Core\Package\Package;
use Illuminate\Filesystem\Filesystem;
defined('C5_EXECUTE') or die('Access Denied.');
/**
* Package Controller Class.
*
* Start building standards complient concrete5 pacakges from me.
*
* @author Oliver Green <[email protected]>
* @license See attached license file
*/
class Controller extends Package
{
/**
* Minimum version of concrete5 required to use this package.
*
* @var string
*/
protected $appVersionRequired = '5.7.0';
/**
* Does the package provide a full content swap?
* This feature is often used in theme packages to install 'sample' content on the site.
*
* @see https://goo.gl/C4m6BG
* @var bool
*/
protected $pkgAllowsFullContentSwap = false;
/**
* Does the package provide thumbnails of the files
* imported via the full content swap above?
*
* @see https://goo.gl/C4m6BG
* @var bool
*/
protected $pkgContentProvidesFileThumbnails = false;
/**
* Should we remove 'Src' from classes that are contained
* ithin the packages 'src/Concrete' directory automatically?
*
* '\Concrete\Package\MyPackage\Src\MyNamespace' becomes '\Concrete\Package\MyPackage\MyNamespace'
*
* @see https://goo.gl/4wyRtH
* @var bool
*/
protected $pkgAutoloaderMapCoreExtensions = false;
/**
* The packages handle.
* Note that this must be unique in the
* entire concrete5 package ecosystem.
*
* @var string
*/
protected $pkgHandle = 'seo-update-service-notifier';
/**
* The packages version.
*
* @var string
*/
protected $pkgVersion = '0.9.0';
/**
* The packages name.
*
* @var string
*/
protected $pkgName = 'SEO Update Service Notifier';
/**
* The packages description.
*
* @var string
*/
protected $pkgDescription = 'Notify popular update services that you have updated your site.';
/**
* Package service providers to register.
*
* @var array
*/
protected $providers = [
'Concrete\Package\SeoUpdateServiceNotifier\Src\Providers\UpdateServiceNotifierServiceProvider',
];
/**
* Register the packages defined service providers.
*
* @return void
*/
protected function registerServiceProviders()
{
$list = new ProviderList(Core::getFacadeRoot());
foreach ($this->providers as $provider) {
$list->registerProvider($provider);
}
}
/**
* The packages on start hook that is fired as the CMS is booting up.
*
* @return void
*/
public function on_start()
{
// Register defined service providers
$this->registerServiceProviders();
// Listen for page approvals so we can ping the update services.
Core::make('seo.update.notifier')->listen();
}
/**
* The packages install routine.
*
* @return \Concrete\Core\Package\Package
*/
public function install()
{
$pkg = parent::install();
// Install the dashboard page.
$sp = \Concrete\Core\Page\Single::add('/dashboard/system/seo/notifications', $pkg);
$sp->update([
'cName' => 'Update Services',
]);
return $pkg;
}
/**
* The packages upgrade routine.
*
* @return void
*/
public function upgrade()
{
parent::upgrade();
}
/**
* The packages uninstall routine.
*
* @return void
*/
public function uninstall()
{
parent::uninstall();
}
}