1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-16 21:58:17 +01:00

[ticket/16955] Add stubs for oci8, pgsql, and sqlite3

PHPBB3-16955
This commit is contained in:
Marc Alexander 2022-12-27 14:08:46 +01:00
parent de9019d64e
commit 3bc100c9a0
No known key found for this signature in database
GPG Key ID: 50E0D2423696F995
5 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,19 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
/** @link https://php.net/manual/en/oci8.constants.php */
define('OCI_DEFAULT', 0);
define('OCI_ASSOC', 1);
define('OCI_RETURN_NULLS', 4);

View File

@ -0,0 +1,15 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
/** @link https://www.php.net/manual/en/pgsql.constants.php */
define('PGSQL_CONNECT_FORCE_NEW', 2);

View File

@ -0,0 +1,32 @@
<?php
/**
*
* This file is part of the phpBB Forum Software package.
*
* @copyright (c) phpBB Limited <https://www.phpbb.com>
* @license GNU General Public License, version 2 (GPL-2.0)
*
* For full copyright and license information, please see
* the docs/CREDITS.txt file.
*
*/
class SQLite3
{
public function query(string $query) {}
}
class SQLite3Result
{
public function fetchArray(int $mode = SQLITE3_BOTH) {}
}
/**
* @link https://www.php.net/manual/en/sqlite3.constants.php
*/
define('SQLITE3_ASSOC', 1);
define('SQLITE3_NUM', 2);
define('SQLITE3_BOTH', 3);
define('SQLITE3_OPEN_READONLY', 1);
define('SQLITE3_OPEN_READWRITE', 2);
define('SQLITE3_OPEN_CREATE', 4);

View File

@ -23,6 +23,7 @@ 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/acp/acp_database.' . $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;
@ -46,6 +47,9 @@ require_once $phpbb_root_path . 'includes/compatibility_globals.' . $phpEx;
$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', $phpbb_root_path . 'phpbb/', "php");
$phpbb_class_loader->register();
// Include files that require class loader to be initialized
require_once $phpbb_root_path . 'includes/acp/auth.' . $phpEx;
class phpbb_cache_container extends \Symfony\Component\DependencyInjection\Container
{
}

View File

@ -20,4 +20,10 @@
</errorLevel>
</UndefinedDocblockClass>
</issueHandlers>
<stubs>
<file name="build/psalm/stubs/oci8/oci8.php"/>
<file name="build/psalm/stubs/pgsql/pgsql.php"/>
<file name="build/psalm/stubs/sqlite3/sqlite3.php"/>
</stubs>
</psalm>