forked from codeling/com_bfstop
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallscript.php
More file actions
35 lines (32 loc) · 1.04 KB
/
Copy pathinstallscript.php
File metadata and controls
35 lines (32 loc) · 1.04 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
<?php
// No direct access to this file
defined('_JEXEC') or die('Restricted access');
use Joomla\CMS\Installer\InstallerAdapter;
if (JVersion::MAJOR_VERSION < 4)
{
// Joomla 3.x doesn't autoload JFile and JFolder, according to https://joomla.stackexchange.com/a/10461
JLoader::register('JFile', JPATH_LIBRARIES . '/joomla/filesystem/file.php');
JLoader::register('JFolder', JPATH_LIBRARIES . '/joomla/filesystem/folder.php');
jimport('joomla.filesystem.file');
}
class com_bfstopInstallerScript
{
/**
* @param InstallerAdapter $adapter The object responsible for running this script
*/
public function __construct(InstallerAdapter $adapter)
{
}
public function update(InstallerAdapter $adapter)
{
$bfstopPath = JPATH_ADMINISTRATOR."/components/com_bfstop/";
if (JFolder::exists($bfstopPath."views/whitelist"))
{
JFolder::delete($bfstopPath."views/whitelist");
JFolder::delete($bfstopPath."views/whiteip");
JFile::delete($bfstopPath."models/whitelist.php");
JFile::delete($bfstopPath."models/whiteip.php");
}
return true;
}
}