Line | |
---|
1 | <?php |
---|
2 | if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!'); |
---|
3 | |
---|
4 | |
---|
5 | function plugin_install() |
---|
6 | { |
---|
7 | global $conf; |
---|
8 | |
---|
9 | mkdir($conf['data_location'].'picasa_wa_cache/', 0755); |
---|
10 | } |
---|
11 | |
---|
12 | function plugin_uninstall() |
---|
13 | { |
---|
14 | global $conf; |
---|
15 | |
---|
16 | rrmdir($conf['data_location'].'picasa_wa_cache/'); |
---|
17 | } |
---|
18 | |
---|
19 | function rrmdir($dir) |
---|
20 | { |
---|
21 | if (!is_dir($dir)) |
---|
22 | { |
---|
23 | return false; |
---|
24 | } |
---|
25 | $dir = rtrim($dir, '/'); |
---|
26 | $objects = scandir($dir); |
---|
27 | $return = true; |
---|
28 | |
---|
29 | foreach ($objects as $object) |
---|
30 | { |
---|
31 | if ($object !== '.' && $object !== '..') |
---|
32 | { |
---|
33 | $path = $dir.'/'.$object; |
---|
34 | if (filetype($path) == 'dir') |
---|
35 | { |
---|
36 | $return = $return && rrmdir($path); |
---|
37 | } |
---|
38 | else |
---|
39 | { |
---|
40 | $return = $return && @unlink($path); |
---|
41 | } |
---|
42 | } |
---|
43 | } |
---|
44 | |
---|
45 | return $return && @rmdir($dir); |
---|
46 | } |
---|
47 | |
---|
48 | ?> |
---|
Note: See
TracBrowser
for help on using the repository browser.