source: extensions/Google2Piwigo/maintain.inc.php @ 17475

Last change on this file since 17475 was 17475, checked in by mistic100, 12 years ago

new extension: Google2Piwigo

File size: 771 bytes
Line 
1<?php
2if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
3
4
5function plugin_install() 
6{
7  global $conf;
8 
9  mkdir($conf['data_location'].'picasa_wa_cache/', 0755);
10}
11
12function plugin_uninstall() 
13{
14  global $conf;
15 
16  rrmdir($conf['data_location'].'picasa_wa_cache/');
17}
18
19function 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.