<?php
namespace Spip\Loader;
use Phar;
final class Stub {
const VERSION = '6.2.1';
const FULL_VERSION = '6.2.1';
const DATE = '2025-10-01 14:20:10';
const DEBUG = false;
const NAME = 'spip_loader.phar';
const AUTOLOADER = 'phar://spip_loader.phar/vendor/autoload.php';
/** @return void */
public function init() {
Phar::mapPhar(self::NAME);
if ($this->is_opcache_enabled()) {
// some hosting failed re-opening inside phar files :/
// and some weird cache occurs sometimes into phar content files
@ini_set('opcache.enable', 0);
}
require self::AUTOLOADER;
Debug::add('FULL_VERSION', self::VERSION);
Debug::add('DATE', self::DATE);
}
/** @return void */
public function handle() {
if ($this->is_route('warmup') && function_exists('opcache_reset')) {
// Route `spip_loader.php?warmup` that could help on some hosting and some opcache configs.
// Please don’t use this abusively as it clears cache for all files in the fpm instance (not only this website)
@opcache_reset();
Debug::add('Reset Opcache', 'Script reset Opcache.');
}
if (!http_response_code()) {
$this->handle_cli();
} else {
$this->handle_web();
}
}
/** @return never */
public function handle_cli() {
require 'phar://spip_loader.phar/bin/console.php';
exit(0);
}
/** @return void */
public function handle_web() {
/** @phpstan-ignore-next-line */
if (self::DEBUG) {
Debug::enable();
}
Phar::webPhar('spip_loader.phar', null, null, ['svg' => 'image/svg+xml'], function ($incomming_path) {
$path = $incomming_path;
// Gestion des assets (spip_loader.php/?file=assets/...)
if (isset($_GET['file'])) {
$path = '/' . ltrim($_GET['file'], '/');
}
if (!$path) {
$path = isset($_SERVER['PATH_INFO']) ? $_SERVER['PATH_INFO'] : '';
}
if (!$path) {
$path = (string) substr(
parse_url(isset($_SERVER['REQUEST_URI']) ? $_SERVER['REQUEST_URI'] : '', PHP_URL_PATH),
strlen($_SERVER['PHP_SELF'])
);
}
Debug::add('incomming path', $incomming_path);
Debug::add('calculated path', $path);
$extension = pathinfo($path, \PATHINFO_EXTENSION);
if (in_array($extension, ['css', 'js', 'jpg', 'png', 'ico', 'svg'])) {
# Éviter Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR (http/2)
# https://serverfault.com/questions/844526/apache-2-4-7-ignores-response-header-content-encoding-identity-instead-respect
header('Content-Encoding: none');
header('Expires: ' . \date('r', time() + 86400 * 7));
}
if ($extension && $extension !== 'php') {
return '/public' . $path;
}
if ($path === '') {
return '/index.php';
}
return false;
});
}
/**
* @param \Throwable $e
* @return void
*/
public static function show_on_debug($e) {
/** @phpstan-ignore-next-line */
if (!self::DEBUG) {
throw $e;
}
/** @phpstan-ignore-next-line */
echo $e->getMessage() . ' on file ' . $e->getFile() . ' on line ' . $e->getLine();
}
/** @return bool */
private function is_opcache_enabled() {
return function_exists('opcache_get_status')
&& @opcache_get_status()
&& (@opcache_get_status()['opcache_enabled']);
}
/**
* Simple route `spip_loader.php?{route}`
* @param string $route
* @return bool
*/
private function is_route($route) {
return !empty($_SERVER['QUERY_STRING']) && ($_SERVER['QUERY_STRING'] === $route);
}
}
try {
$stub = new Stub();
$stub->init();
$stub->handle();
} catch (\Exception $e) {
// @note use \Throwable when PHP 7+
Stub::show_on_debug($e);
/** @phpstan-ignore-next-line */
} catch (\Error $e) {
Stub::show_on_debug($e);
}
__HALT_COMPILER(); ?>
�; � spip_loader.phar index.php, �8�h, -%[1� lang/tradloader_ca.phpY �8�ha @�Iޤ lang/tradloader_eu.php �8�h1 �+��� lang/tradloader_wa.php� �8�h q��N� lang/tradloader_eo.php� �8�h� `�}� lang/tradloader_fa.php� �8�h+ �UW� lang/tradloader_ru.phpe �8�h/ �R��� lang/tradloader_de.php( �8�h� 6E�&� lang/tradloader_sk.php# �8�h5 8�� lang/tradloader_br.php �8�h{ ���� lang/tradloader_en.php �8�h� �]�� lang/tradloader_ar.php� �8�h� lj�� lang/tradloader_oc_lnc.php; �8�h^ Rk� lang/tradloader_nl.php �8�h� �iv� lang/tradloader_ro.php� �8�h� +��� lang/tradloader_nap.phpf �8�h� �t��� lang/tradloader_cs.php� �8�h� ^�w� lang/tradloader_es.php �8�h� g(�m� lang/tradloader_tr.phpY �8�h� ��ٞ� lang/tradloader_hr.php� �8�ht So�s� lang/tradloader_km.phpd �8�h� �V� lang/tradloader_pt_br.php �8�h �Y� lang/tradloader_oc_ni.phpf �8�hl (��Ѥ lang/tradloader_it.phpG �8�h GJ_� lang/tradloader_gl.phpC �8�hz �a�Ф lang/tradloader_ast.php$ �8�hf �:@�� lang/tradloader_pt.php% �8�h ��%� lang/tradloader_zh_tw.phpJ �8�h �t� lang/tradloader_sv.phpZ �8�he ;��� lang/tradloader_lb.php1 �8�h� �k�ؤ lang/tradloader_fr.php� �8�hI �oOE� lang/tradloader_fr_tu.php� �8�hI l9\� lang/tradloader_id.php� �8�h5 �8�ߤ src/Debug.php� �8�h� �{� src/Route/Debug.php� �8�hI wl�� src/Route/AbstractRoute.php� �8�h� Gp� src/Route/ArchiveDownload.phpx �8�h� ��� src/Route/RouteInterface.php� �8�h� ��q� src/Route/ArchiveSelection.php" �8�h� 5�}� src/Route/ArchiveClean.php �8�h% �:� src/Route/SelfUpdate.php �8�h� ���(� src/Route/ArchiveDecompress.php� �8�h9 �:� src/Session.php( �8�h� ��m�� ( src/Iterator/SuperflusFilterIterator.php� �8�h J,ܤ src/Check/Authentication.php� �8�h ��� src/Check/Filesystem.php� �8�h% 2��K� src/Check/CheckInterface.php� �8�h� �t��� src/Spip.phpk �8�ha ��WB� src/Deprecations.php� �8�h �7}v� src/Template/Error.php. �8�hB (��� src/Template/Utils.php6 �8�h� g��E� src/Template/Page.php� �8�h/ E�0� src/Template/Template.php� �8�h ��~� src/Cleaner.php} �8�h� z{�� src/Api/Versions.php� �8�h� Q4�� src/Api/V2.php� �8�h� ǩ��� src/Application.phpy �8�h� EH%� src/Remote.phpo �8�h� ��oϤ src/Filesystem.php� �8�h� ���� src/Config/Config.php� �8�h� �;a�� src/Config/ConfigInterface.php� �8�hj �>5�� src/Config/Custom.php_ �8�h" 5 � src/Config/Internal.phpF �8�h; ^Z�C� src/Config/AbstractConfig.phpY �8�hc ���� src/I18n/Languages.php� �8�h; h暤 src/I18n/Translator.php� �8�h� s� src/Http/Response.phpb �8�hF ��Ĥ src/Http/RequestInterface.php� �8�hp � �|� src/Http/ResponseInterface.php_ �8�hV ]ͷ� src/Http/Request.php� �8�hY �I�Ҥ public/index.php. �8�h� H09Τ ) vendor/symfony/polyfill-intl-idn/Info.php� �8�h� �[�� ( vendor/symfony/polyfill-intl-idn/Idn.phpB �8�h� ԃ�I� . vendor/symfony/polyfill-intl-idn/bootstrap.phpP �8�h? �㐿� M vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_mapped.php� �8�h� ;qf� L vendor/symfony/polyfill-intl-idn/Resources/unidata/disallowed_STD3_valid.php> �8�h� NچG� >