-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.dewplayer.php
43 lines (40 loc) · 1.14 KB
/
script.dewplayer.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
<?php
/**
* @package AkeebaReleaseSystem
* @copyright Copyright (c)2010-2011 Nicholas K. Dionysopoulos
* @license GNU General Public License version 3, or later
* @version $Id: ars.php 123 2011-04-13 07:47:16Z nikosdion $
*/
class Com_DewplayerInstallerScript {
function update($parent) {
$db = JFactory::getDBO();
if(method_exists($parent, 'extension_root')) {
$sqlfile = $parent->getPath('extension_root').DS.'install.sql';
} else {
$sqlfile = $parent->getParent()->getPath('extension_root').DS.'install.sql';
}
if (file_exists($sql_file)) {
$buffer = file_get_contents($sqlfile);
}
if ($buffer !== false) {
jimport('joomla.installer.helper');
$queries = JInstallerHelper::splitSql($buffer);
if (count($queries) != 0) {
foreach ($queries as $query)
{
$query = trim($query);
if ($query != '' && $query{0} != '#') {
$db->setQuery($query);
if (!$db->query()) {
JError::raiseWarning(1, JText::sprintf('JLIB_INSTALLER_ERROR_SQL_ERROR', $db->stderr(true)));
return false;
}
}
}
}
}
}
function postflight($type, $parent) {
require_once('install.dewplayer.php');
}
}