forked from JoomlaEstateAgency/com_jea
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.php
More file actions
97 lines (82 loc) · 2.24 KB
/
Copy pathscript.php
File metadata and controls
97 lines (82 loc) · 2.24 KB
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
<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real estate agency
*
* @version $Id$
* @package Jea
* @copyright Copyright (C) 2008 PHILIP Sylvain. All rights reserved.
* @license GNU/GPL, see LICENSE.txt
* Joomla Estate Agency is free software. This version may have been modified pursuant to the
* GNU General Public License, and as distributed it includes or is derivative
* of works licensed under the GNU General Public License or other free or open
* source software licenses.
*
*/
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
/**
* Install Script file of JEA component
*/
class com_jeaInstallerScript
{
/**
* method to install the component
*
* @return void
*/
function install($parent)
{
}
/**
* method to uninstall the component
*
* @return void
*/
function uninstall($parent)
{
}
/**
* method to update the component
*
* @return void
*/
function update($parent)
{
}
/**
* method to run before an install/update/uninstall method
*
* @return void
*/
function preflight($type, $parent)
{
$manifest = $parent->getParent()->getManifest();
// Fix the missing schema upddate in the previous JEA 2.0 version
if ($type == 'update') {
$row = JTable::getInstance('extension');
$eid = $row->find(array('element' => 'com_jea', 'type' => 'component'));
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('version_id ');
$query->from('#__schemas');
$query->where($query->qn('extension_id') . ' = ' . (int) $eid);
$db->setQuery($query);
$result = $db->loadResult();
if (!$result) {
$query->insert('#__schemas');
$query->columns('extension_id, version_id');
$query->values("$eid, '2.0'");
$db->setQuery($query);
$db->query();
}
}
}
/**
* method to run after an install/update/uninstall method
*
* @return void
*/
function postflight($type, $parent)
{
}
}