[ Index ]

PHP Cross Reference of phpBB-3.3.7-deutsch

title

Body

[close]

/phpbb/install/helper/ -> database.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 421 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

database:: (6 methods):
  __construct()
  get_available_dbms()
  remove_comments()
  split_sql_file()
  validate_table_prefix()
  check_database_connection()


Class: database  - X-Ref

Database related general functionality for installer

__construct(\phpbb\filesystem\filesystem_interface $filesystem, $phpbb_root_path)   X-Ref
Constructor

param: \phpbb\filesystem\filesystem_interface    $filesystem            Filesystem interface
param: string                                    $phpbb_root_path    Path to phpBB's root

get_available_dbms($dbms = false, $return_unavailable = false, $only_20x_options = false)   X-Ref
Returns an array of available DBMS supported by phpBB

If a DBMS is specified it will only return data for that DBMS
and will load its extension if necessary.

param: mixed    $dbms                name of the DBMS that's info is required or false for all DBMS info
param: bool    $return_unavailable    set it to true if you expect unavailable but supported DBMS
param: bool    $only_20x_options    set it to true if you only want to recover 2.0.x options
return: array    Array of available and supported DBMS

remove_comments($sql_query)   X-Ref
Removes "/* style" as well as "# style" comments from $input.

param: string $sql_query    Input string
return: string Input string with comments removed

split_sql_file($sql, $delimiter)   X-Ref
split_sql_file() will split an uploaded sql file into single sql statements.

Note: expects trim() to have already been run on $sql.

param: string    $sql        SQL statements
param: string    $delimiter    Delimiter between sql statements
return: array Array of sql statements

validate_table_prefix($dbms, $table_prefix)   X-Ref
Validates table prefix

param: string    $dbms            The selected dbms
param: string    $table_prefix    The table prefix to validate
return: bool|array    true if table prefix is valid, array of errors otherwise

check_database_connection($dbms, $dbhost, $dbport, $dbuser, $dbpass, $dbname, $table_prefix)   X-Ref
Check if the user provided database parameters are correct

This function checks the database connection data and also checks for
any other problems that could cause an error during the installation
such as if there is any database table names conflicting.

Note: The function assumes that $table_prefix has been already validated
with validate_table_prefix().

param: string    $dbms            Selected database type
param: string    $dbhost            Database host address
param: int        $dbport            Database port number
param: string    $dbuser            Database username
param: string    $dbpass            Database password
param: string    $dbname            Database name
param: string    $table_prefix    Database table prefix
return: array|bool    Returns true if test is successful, array of errors otherwise



Generated: Thu Mar 24 21:31:15 2022 Cross-referenced by PHPXref 0.7.1