Revision 3731:3770620079d4,
1.1 KB
checked in by franck <carnet.franck.paul@…>, 8 years ago
(diff) |
Simplify licence block at the beginning of each file
|
Line | |
---|
1 | <?php |
---|
2 | /** |
---|
3 | * @brief maintenance, a plugin for Dotclear 2 |
---|
4 | * |
---|
5 | * @package Dotclear |
---|
6 | * @subpackage Plugins |
---|
7 | * |
---|
8 | * @copyright Olivier Meunier & Association Dotclear |
---|
9 | * @copyright GPL-2.0-only |
---|
10 | */ |
---|
11 | |
---|
12 | if (!defined('DC_RC_PATH')) {return;} |
---|
13 | |
---|
14 | class dcMaintenanceVacuum extends dcMaintenanceTask |
---|
15 | { |
---|
16 | protected $group = 'optimize'; |
---|
17 | |
---|
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 | |
---|
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 | |
---|
28 | public function execute() |
---|
29 | { |
---|
30 | $schema = dbSchema::init($this->core->con); |
---|
31 | |
---|
32 | foreach ($schema->getTables() as $table) { |
---|
33 | if (strpos($table, $this->core->prefix) === 0) { |
---|
34 | $this->core->con->vacuum($table); |
---|
35 | } |
---|
36 | } |
---|
37 | |
---|
38 | return true; |
---|
39 | } |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.