Changeset 13652 for extensions/GThumb/maintain.inc.php
- Timestamp:
- Mar 20, 2012, 11:32:30 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/GThumb/maintain.inc.php
r12758 r13652 15 15 function plugin_uninstall() 16 16 { 17 include_once(dirname(__FILE__).'/functions.inc.php'); 18 gtdeltree(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb'); 17 if (is_dir(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb')) 18 { 19 gtdeltree(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb'); 20 } 19 21 20 22 $query = 'DELETE FROM ' . CONFIG_TABLE . ' WHERE param="GThumb" LIMIT 1;'; … … 24 26 function plugin_activate($plugin_id, $version) 25 27 { 26 if (i n_array($version, array('2.3.a', '2.3.b')))28 if (is_dir(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb')) 27 29 { 28 include_once(PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/functions.inc.php');29 30 gtdeltree(PHPWG_ROOT_PATH.PWG_LOCAL_DIR.'GThumb'); 30 31 } 31 32 } 32 33 34 function gtdeltree($path) 35 { 36 if (is_dir($path)) 37 { 38 $fh = opendir($path); 39 while ($file = readdir($fh)) 40 { 41 if ($file != '.' and $file != '..') 42 { 43 $pathfile = $path . '/' . $file; 44 if (is_dir($pathfile)) 45 { 46 gtdeltree($pathfile); 47 } 48 else 49 { 50 @unlink($pathfile); 51 } 52 } 53 } 54 closedir($fh); 55 return @rmdir($path); 56 } 57 } 58 33 59 ?>
Note: See TracChangeset
for help on using the changeset viewer.