forked from YJSGframework/yjsg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.script.php
51 lines (41 loc) · 2.02 KB
/
install.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
<?php
/*======================================================================*\
|| #################################################################### ||
|| # Package - YJSG Framework ||
|| # Copyright (C) since 2007 Youjoomla.com. All Rights Reserved. ||
|| # license - PHP files are licensed under GNU/GPL V2 ||
|| # license - CSS - JS - IMAGE files are Copyrighted material ||
|| # bound by Proprietary License of Youjoomla.com ||
|| # for more information visit http://www.youjoomla.com/license.html ||
|| # Redistribution and modification of this software ||
|| # is bounded by its licenses ||
|| # websites - http://www.youjoomla.com | http://www.yjsimplegrid.com ||
|| #################################################################### ||
\*======================================================================*/
// no direct access
defined('_JEXEC') or die();
class plgSystemYJSGInstallerScript{
public function postflight( $type, $parent ) {
$db = JFactory::getDbo();
try
{
$q = $db->getQuery(true);
$q->update('#__extensions');
$q->set(array('enabled = 1','ordering = -5000'));
$q->where("element = 'yjsg'");
$q->where("type = 'plugin'", 'AND');
$q->where("folder = 'system'", 'AND');
$db->setQuery($q);
method_exists($db, 'execute') ? $db->execute() : $db->query();
}
catch (Exception $e)
{
throw $e;
}
if(!JFolder::exists(JPATH_SITE . '/plugins/system/yjsg/includes/yjsgcore/classes/extend/classes/')) return;
JFolder::delete(JPATH_SITE . '/plugins/system/yjsg/includes/yjsgcore/classes/extend/classes/');
JFolder::create(JPATH_SITE . '/plugins/system/yjsg/includes/yjsgcore/classes/extend/classes/');
$indexContent = '';
JFile::write(JPATH_SITE . '/plugins/system/yjsg/includes/yjsgcore/classes/extend/classes/index.html', $indexContent);
}
}