-
Notifications
You must be signed in to change notification settings - Fork 0
/
TasksCliPlugin.php
46 lines (37 loc) · 1006 Bytes
/
TasksCliPlugin.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
<?php
namespace Craft;
class TasksCliPlugin extends BasePlugin
{
function getName()
{
return Craft::t('Tasks thru CLI');
}
function getVersion()
{
return '1.0';
}
function getDeveloper()
{
return 'Globalia';
}
function getDeveloperUrl()
{
return 'http://www.globalia.ca';
}
public function init()
{
if (craft()->config->get('runTasksAutomatically')) {
// First disable plugin
// With this we force Craft to look up the plugin's ID, which isn't cached at this moment yet
// Without this we get a fatal error
// craft()->plugins->disablePlugin($this->getClassHandle());
// Uninstall plugin
// craft()->plugins->uninstallPlugin($this->getClassHandle());
// Show error message
//craft()->userSession->setError(Craft::t('The config setting "runTasksAutomatically" needs to be `false` for this plugin to work'));
}
}
public function onAfterInstall()
{
}
}