|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/***************************************************************************\ |
|
4
|
|
|
* SPIP, Système de publication pour l'internet * |
|
5
|
|
|
* * |
|
6
|
|
|
* Copyright © avec tendresse depuis 2001 * |
|
7
|
|
|
* Arnaud Martin, Antoine Pitrou, Philippe Rivière, Emmanuel Saint-James * |
|
8
|
|
|
* * |
|
9
|
|
|
* Ce programme est un logiciel libre distribué sous licence GNU/GPL. * |
|
10
|
|
|
* Pour plus de détails voir le fichier COPYING.txt ou l'aide en ligne. * |
|
11
|
|
|
\***************************************************************************/ |
|
12
|
|
|
|
|
13
|
|
|
/** |
|
14
|
|
|
* Gestion des mises à jour de bdd de SPIP |
|
15
|
|
|
* |
|
16
|
|
|
* Mises à jour en 3.1 |
|
17
|
|
|
* |
|
18
|
|
|
* @package SPIP\Core\SQL\Upgrade |
|
19
|
|
|
**/ |
|
20
|
|
|
if (!defined('_ECRIRE_INC_VERSION')) { |
|
21
|
|
|
return; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
|
|
25
|
|
|
$GLOBALS['maj'][21676] = array( |
|
26
|
|
|
array('ranger_cache_gd2'), |
|
27
|
|
|
); |
|
28
|
|
|
|
|
29
|
|
|
/** |
|
30
|
|
|
* Ranger les images de local/cache-gd2 dans des sous-rep |
|
31
|
|
|
* |
|
32
|
|
|
* https://core.spip.net/issues/3277 |
|
33
|
|
|
*/ |
|
34
|
|
|
function ranger_cache_gd2() { |
|
35
|
|
|
spip_log("ranger_cache_gd2"); |
|
36
|
|
|
$base = _DIR_VAR . "cache-gd2/"; |
|
37
|
|
|
if (is_dir($base) and is_readable($base)) { |
|
38
|
|
|
if ($dir = opendir($base)) { |
|
39
|
|
|
while (($f = readdir($dir)) !== false) { |
|
40
|
|
|
if (!is_dir($base . $f) and strncmp($f, ".", 1) !== 0 |
|
41
|
|
|
and preg_match(",[0-9a-f]{32}\.\w+,", $f) |
|
42
|
|
|
) { |
|
43
|
|
|
$sub = substr($f, 0, 2); |
|
44
|
|
|
$sub = sous_repertoire($base, $sub); |
|
45
|
|
|
@rename($base . $f, $sub . substr($f, 2)); |
|
|
|
|
|
|
46
|
|
|
@unlink($base . $f); // au cas ou le rename a foire (collision) |
|
|
|
|
|
|
47
|
|
|
} |
|
48
|
|
|
if (time() >= _TIME_OUT) { |
|
49
|
|
|
return; |
|
50
|
|
|
} |
|
51
|
|
|
} |
|
52
|
|
|
} |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
|
|
57
|
|
|
$GLOBALS['maj'][21742] = array( |
|
58
|
|
|
array('sql_alter', "TABLE spip_articles CHANGE url_site url_site text DEFAULT '' NOT NULL"), |
|
59
|
|
|
array('sql_alter', "TABLE spip_articles CHANGE virtuel virtuel text DEFAULT '' NOT NULL"), |
|
60
|
|
|
); |
|
61
|
|
|
|
If you suppress an error, we recommend checking for the error condition explicitly: