Browse Source

fix: ajout d'une règle apache pour voir la version, changement dans gestion des exceptions, changement dans le traitement d'opcache et d'apc

pull/7/head
JamesRezo 1 year ago
parent
commit
de642d4937
  1. 1
      .gitignore
  2. 1
      README.md
  3. 9
      index.php
  4. 6
      tests/sdk.php

1
.gitignore vendored

@ -1,4 +1,5 @@
/spip_loader_list.json
/spip_loader_config.php
/INSTALL/
/version.php
/vendor/

1
README.md

@ -50,4 +50,5 @@ dans la section `REGLAGES PERSONNALISES`, ajouter :
RewriteRule ^spip-dev/INSTALL/spip_loader.php /path/to/spip_loader/INSTALL/spip_loader.php [L]
RewriteRule ^spip-dev/INSTALL/index.html /path/to/spip_loader/INSTALL/index.html [L]
RewriteRule ^spip-dev/INSTALL/logo-spip.jpg /path/to/spip_loader/INSTALL/logo-spip.jpg [L]
RewriteRule ^spip-dev/INSTALL/version IMG/spip_loader/INSTALL/version [L]
```

9
index.php

@ -519,7 +519,7 @@ function SL_spip_clear_opcode_cache($filepath) {
// Zend OPcache
if (function_exists('opcache_invalidate')) {
$invalidate = @opcache_invalidate($filepath, true);
$invalidate = opcache_invalidate($filepath, true) && opcache_invalidate(__DIR__ . '/version.php');
// si l'invalidation a echoue lever un flag
if (!$invalidate and !defined('_spip_attend_invalidation_opcode_cache')) {
define('_spip_attend_invalidation_opcode_cache', true);
@ -534,6 +534,7 @@ function SL_spip_clear_opcode_cache($filepath) {
// not compiled yet.
// @see http://php.net/apc-delete-file
@apc_delete_file($filepath);
@apc_delete_file(__DIR__ . '/version.php');
}
}
@ -1509,11 +1510,11 @@ try {
//Update himself
if (!empty($_REQUEST['spip_loader_update'])) {
$spip_loader = SL_recuperer_page(_URL_SPIP_LOADER);
if (! @file_put_contents(_SPIP_LOADER_SCRIPT, $spip_loader)) {
if (!@file_put_contents(_DIR_BASE . basename(_URL_SPIP_LOADER), $spip_loader)) {
throw new Exception('Impossible d’écrire le nouveau fichier de SPIP Loader.');
}
SL_spip_clear_opcode_cache(_SPIP_LOADER_SCRIPT);
SL_spip_redirige_boucle(_DIR_BASE . _SPIP_LOADER_SCRIPT);
SL_spip_clear_opcode_cache(basename(_URL_SPIP_LOADER));
SL_spip_redirige_boucle('../' . basename(_URL_SPIP_LOADER));
}
// y a tout ce qu'il faut pour que cela marche

6
tests/sdk.php

@ -71,4 +71,8 @@ function parametre_url($url, $c, $v = null, $sep = '&') {
*/
function generer_url_public($script = '', $args = '', $no_entities = false, $rel = true, $action = '') {
return '';
}
}
function apc_delete_file($filename) {
}

Loading…
Cancel
Save