-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.php
44 lines (38 loc) · 979 Bytes
/
script.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
<?php
/**
* package: Joomill-Styling
* copyright: Copyright (c) 2023. Jeroen Moolenschot | Joomill
* license: GNU General Public License version 3 or later
* link: https://www.joomill.nl
*/
// No direct access to this file
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
class plgSystemJoomillInstallerScript
{
public function install($parent)
{
// Enable the extension
$this->enablePlugin();
return true;
}
private function enablePlugin()
{
try
{
$db = Factory::getDbo();
$query = $db->getQuery(true)
->update($db->qn('#__extensions'))
->set($db->qn('enabled') . ' = ' . $db->q(1))
->where('type = ' . $db->q('plugin'))
->where('folder = ' . $db->q('system'))
->where('element = ' . $db->q('joomill'));
$db->setQuery($query);
$db->execute();
}
catch (\Exception $e)
{
return;
}
}
}