-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.php
56 lines (55 loc) · 1.24 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Script file of Platon plugin
*/
class plgVmpaymentPlatonInstallerScript
{
/**
* method to run after an install/update/uninstall method
*
* @param $type
* @param $parent
*
* @return void
*/
public function postflight($type, $parent)
{
$db =& JFactory::getDBO();
$q = "SELECT count(*) FROM `#__extensions` WHERE element = 'platon'";
$db->setQuery($q);
$count = $db->loadResult();
if ($count == 0){
$q = "INSERT INTO `#__extensions` (type,
name,
element,
folder,
access,
ordering,
enabled,
protected,
client_id,
checked_out,
checked_out_time,
params)
VALUES ('plugin',
'Platon',
'platon',
'vmpayment',
1,
0,
1,
0,
0,
0,
'0000-00-00 00:00:00',
'')";
$db->setQuery($q);
$result = $db->query();
echo "The Platon Plugin was Installed <br />";
}else{
echo "The Platon Plugin was Updated $count<br />";
}
}
}