Changeset 2199 for plugins/dcAdvancedCleaner/inc/class.dc.uninstaller.php
- Timestamp:
- 04/16/10 16:51:19 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/dcAdvancedCleaner/inc/class.dc.uninstaller.php
r1567 r2199 3 3 # This file is part of dcAdvancedCleaner, a plugin for Dotclear 2. 4 4 # 5 # Copyright (c) 2009 JC Denis and contributors5 # Copyright (c) 2009-2010 JC Denis and contributors 6 6 # jcdenis@gdwd.com 7 7 # … … 41 41 */ 42 42 protected static $allowed_properties = array( 43 'versions' => array( 44 'delete' => 'delete version in dc' 45 ), 43 46 'settings' => array( 44 47 'delete_global' => 'delete global settings', … … 61 64 'empty' => 'empty cache folder', 62 65 'delete' => 'delete cache folder' 63 ),64 'versions' => array(65 'delete' => 'delete version in dc'66 66 ) 67 ); 68 69 protected static $priority_properties = array( 70 'versions','settings','tables','themes','plugins','caches' 67 71 ); 68 72 … … 96 100 $this->path = explode(PATH_SEPARATOR,$path); 97 101 98 foreach ($this->path as $root) { 99 $this->loadModule($root); 102 foreach ($this->path as $root) 103 { 104 if (!is_dir($root) || !is_readable($root)) continue; 105 106 if (substr($root,-1) != '/') $root .= '/'; 107 108 if (($d = @dir($root)) === false) continue; 109 110 while (($entry = $d->read()) !== false) 111 { 112 $full_entry = $root.'/'.$entry; 113 114 if ($entry != '.' && $entry != '..' && is_dir($full_entry)) 115 { 116 $this->loadModule($full_entry); 117 } 118 } 119 $d->close(); 100 120 } 101 121 … … 113 133 public function loadModule($root) 114 134 { 115 if (!is_dir($root) || !is_readable($root)) return;; 116 117 if (substr($root,-1) != '/') $root .= '/'; 118 119 if (($d = @dir($root)) === false) return; 120 121 while (($entry = $d->read()) !== false) 122 { 123 $full_entry = $root.'/'.$entry; 124 125 if ($entry != '.' && $entry != '..' && is_dir($full_entry) 126 && file_exists($full_entry.'/_define.php') 127 && file_exists($full_entry.'/_uninstall.php')) { 128 129 $this->id = $entry; 130 $this->mroot = $full_entry; 131 132 require $full_entry.'/_define.php'; 133 require $full_entry.'/_uninstall.php'; 134 135 $this->id = null; 136 $this->mroot = null; 137 } 138 } 139 $d->close(); 135 if (file_exists($root.'/_define.php') 136 && file_exists($root.'/_uninstall.php')) { 137 138 $this->id = basename($root); 139 $this->mroot = $root; 140 141 require $root.'/_define.php'; 142 require $root.'/_uninstall.php'; 143 144 $this->id = null; 145 $this->mroot = null; 146 } 140 147 } 141 148 … … 208 215 } 209 216 210 private function addAction($group,$type,$action,$ns,$desc ='')217 private function addAction($group,$type,$action,$ns,$desc) 211 218 { 212 219 $group = self::group($group); … … 229 236 /** 230 237 Returns modules <var>$id</var> predefined actions associative array 238 ordered by priority 231 239 232 240 @param id <b>string</b> Optionnal module ID … … 249 257 if (!isset($this->actions[$group][$id])) return array(); 250 258 251 return $this->actions[$group][$id]; 259 $res = array(); 260 foreach(self::$priority_properties as $k => $v) 261 { 262 if (!isset($this->actions[$group][$id][$v])) continue; 263 $res[$v] = $this->actions[$group][$id][$v]; 264 } 265 266 return $res; 252 267 } 253 268
Note: See TracChangeset
for help on using the changeset viewer.