Legend:
- Unmodified
- Added
- Removed
-
plugins/maintenance/inc/tasks/class.dc.maintenance.vacuum.php
r2044 r3730 10 10 # 11 11 # -- END LICENSE BLOCK ----------------------------------------- 12 if (!defined('DC_RC_PATH')) { return;}12 if (!defined('DC_RC_PATH')) {return;} 13 13 14 14 class dcMaintenanceVacuum extends dcMaintenanceTask 15 15 { 16 16 protected $group = 'optimize'; 17 17 18 19 20 $this->name= __('Optimise database');21 $this->task= __('optimize tables');22 $this->success= __('Optimization successful.');23 $this->error= __('Failed to optimize tables.');18 protected function init() 19 { 20 $this->name = __('Optimise database'); 21 $this->task = __('optimize tables'); 22 $this->success = __('Optimization successful.'); 23 $this->error = __('Failed to optimize tables.'); 24 24 25 26 25 $this->description = __("After numerous delete or update operations on Dotclear's database, it gets fragmented. Optimizing will allow to defragment it. It has no incidence on your data's integrity. It is recommended to optimize before any blog export."); 26 } 27 27 28 29 30 28 public function execute() 29 { 30 $schema = dbSchema::init($this->core->con); 31 31 32 foreach ($schema->getTables() as $table) 33 { 34 if (strpos($table, $this->core->prefix) === 0) { 35 $this->core->con->vacuum($table); 36 } 37 } 32 foreach ($schema->getTables() as $table) { 33 if (strpos($table, $this->core->prefix) === 0) { 34 $this->core->con->vacuum($table); 35 } 36 } 38 37 39 40 38 return true; 39 } 41 40 }
Note: See TracChangeset
for help on using the changeset viewer.