Dotclear

source: plugins/maintenance/inc/tasks/class.dc.maintenance.vacuum.php @ 3731:3770620079d4

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

RevLine 
[1925]1<?php
[3731]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
[3730]12if (!defined('DC_RC_PATH')) {return;}
[1925]13
14class dcMaintenanceVacuum extends dcMaintenanceTask
15{
[3730]16    protected $group = 'optimize';
[1925]17
[3730]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.');
[2044]24
[3730]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    }
[1925]27
[3730]28    public function execute()
29    {
30        $schema = dbSchema::init($this->core->con);
[1925]31
[3730]32        foreach ($schema->getTables() as $table) {
33            if (strpos($table, $this->core->prefix) === 0) {
34                $this->core->con->vacuum($table);
35            }
36        }
[1925]37
[3730]38        return true;
39    }
[1925]40}
Note: See TracBrowser for help on using the repository browser.

Sites map