From 7d7c7d8199d1d074977fc19ea782989eed67f8c8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Date: Sun, 5 Dec 2021 21:11:19 +0100 Subject: [PATCH] [ticket/16936] Add bootstrap file for psalm PHPBB3-16936 --- build/psalm_bootstrap.php | 43 +++++++++++++++++++++++++++++++++++++++ psalm.xml | 2 +- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 build/psalm_bootstrap.php diff --git a/build/psalm_bootstrap.php b/build/psalm_bootstrap.php new file mode 100644 index 0000000000..419a332b68 --- /dev/null +++ b/build/psalm_bootstrap.php @@ -0,0 +1,43 @@ + +* @license GNU General Public License, version 2 (GPL-2.0) +* +* For full copyright and license information, please see +* the docs/CREDITS.txt file. +* +*/ + +define('IN_PHPBB', true); +define('PHPBB_ENVIRONMENT', 'test'); + +$phpbb_root_path = 'phpBB/'; +$phpEx = 'php'; + +global $table_prefix; +require_once $phpbb_root_path . 'includes/startup.php'; + +$table_prefix = 'phpbb_'; +require_once $phpbb_root_path . 'includes/constants.php'; +require_once $phpbb_root_path . 'phpbb/class_loader.' . $phpEx; +require_once $phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_acp.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_admin.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_compatibility.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_compress.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_content.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_display.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_mcp.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_messenger.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_module.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_posting.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_privmsgs.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_transfer.' . $phpEx; +require_once $phpbb_root_path . 'includes/functions_user.' . $phpEx; + +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', $phpbb_root_path . 'phpbb/', "php"); +$phpbb_class_loader->register(); diff --git a/psalm.xml b/psalm.xml index 50f8ba772d..8bd4cf18f8 100644 --- a/psalm.xml +++ b/psalm.xml @@ -3,7 +3,7 @@ errorLevel="5" phpVersion="7.3" resolveFromConfigFile="true" - autoloader="tests/bootstrap.php" + autoloader="build/psalm_bootstrap.php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://getpsalm.org/schema/config" xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"