-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.php
More file actions
35 lines (30 loc) · 732 Bytes
/
Copy pathscript.php
File metadata and controls
35 lines (30 loc) · 732 Bytes
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
use Joomla\CMS\Installer\InstallerScript;
class PlgSystemLiveStatusInstallerScript extends InstallerScript
{
public function install($parent)
{
$this->cleanCache();
}
public function update($parent)
{
$this->cleanCache();
}
public function uninstall($parent)
{
$this->cleanCache();
}
protected function cleanCache()
{
$cache_dir = JPATH_CACHE . '/plg_system_livestatus';
if (is_dir($cache_dir)) {
$files = glob($cache_dir . '/*');
foreach ($files as $file) {
if (is_file($file)) {
unlink($file);
}
}
rmdir($cache_dir);
}
}
}