-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.php
39 lines (34 loc) · 1.14 KB
/
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
<?php
/**
* @package Joomla.Plugin
* @subpackage System.joomplaceXautoloader
* @copyright Copyright (C) 2005 - 2017 JoomPlace. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* Joomla! joomplaceXautoloader Plugin.
* Loads the JoomPlaceX library.
* @author JoomPlace Team
*/
defined('_JEXEC') or die;
class PlgSystemJoomplacexautoloaderInstallerScript
{
public function postflight($type, $parent)
{
if (strtolower($type) === 'install')
{
$db = \JFactory::getDbo();
$query = $db->getQuery(true);
$fields = array(
$db->quoteName('enabled') . ' = ' . $db->quote(1),
$db->quoteName('ordering') . ' = ' . $db->quote(0)
);
$conditions = array(
$db->quoteName('element') . ' = ' . $db->quote('joomplaceXautoloader'),
$db->quoteName('type') . ' = ' . $db->quote('plugin')
);
$query->update($db->quoteName('#__extensions'))->set($fields)->where($conditions);
$db->setQuery($query);
$db->execute();
}
}
}