Differences From Artifact [dbfe19e493]:

To Artifact [bd1441a7c4]:


202
203
204
205
206
207
208
























209
210
211
212
213
214
215

if (version_compare($v, '0.7.0', '<'))
{
    $db->exec('PRAGMA foreign_keys = OFF; BEGIN;');

    // Mise à jour base de données
    $db->exec(file_get_contents(ROOT . '/include/data/0.7.0.sql'));

























    $db->exec('END;');
}

Utils::clearCaches();

$config->setVersion(garradin_version());







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239

if (version_compare($v, '0.7.0', '<'))
{
    $db->exec('PRAGMA foreign_keys = OFF; BEGIN;');

    // Mise à jour base de données
    $db->exec(file_get_contents(ROOT . '/include/data/0.7.0.sql'));

    // Changement de syntaxe du Wiki vers SkrivML
    $wiki = new Wiki;
    $st = $db->prepare('SELECT id_page, contenu, revision, chiffrement FROM wiki_revisions GROUP BY id_page ORDER BY revision DESC;');

    while ($row = $st->fetchArray(\SQLITE3_ASSOC))
    {
        // Ne pas convertir le contenu chiffré, de toute évidence
        if ($row['chiffrement'])
            continue;

        $content = $row['contenu'];
        $content = Utils::HTMLToSkriv($content);
        $content = Utils::SpipToSkriv($content);

        if ($content != $row['contenu'])
        {
            $wiki->editRevision($row['id_page'], $row['revision'], [
                'id_auteur'     =>  null,
                'contenu'       =>  $content,
                'modification'  =>  'Mise à jour 0.7.0 (transformation SPIP vers SkrivML)',
            ]);
        }
    }

    $db->exec('END;');
}

Utils::clearCaches();

$config->setVersion(garradin_version());