1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

[ticket/12466] Move classes from acp_database.php to their own files

* Moving classes from acp_database.php to phpbb/db/extractor namespace,
   also into separate files
 * Adding DocBlocks and property visibility to classes
 * Removing globals from code
 * Passing former globals to base_extractor's constructor
 * Adding DB extractor as a service, also implementing the extractor interface
   as well as the extractor factory.

PHPBB3-12466
This commit is contained in:
MateBartus
2015-02-22 16:22:10 +01:00
parent 3657d7a85a
commit 193c5b86b4
13 changed files with 2350 additions and 1660 deletions

View File

@@ -0,0 +1,80 @@
<?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.
*
*/
namespace phpbb\db\extractor;
/**
* Database extractor interface
*/
interface extractor_interface
{
/**
* Start the extraction of the database
*
* This function initialize the database extraction. It is required to call this
* function before calling any other extractor functions.
*
* @param string $format
* @param string $filename
* @param int $time
* @param bool $download
* @param bool $store
* @return null
* @throws \phpbb\db\extractor\exception\invalid_format_exception when $format is invalid
*/
public function init_extractor($format, $filename, $time, $download = false, $store = false);
/**
* Writes header comments to the database backup
*
* @param string $table_prefix prefix of phpBB database tables
* @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
*/
public function write_start($table_prefix);
/**
* Closes file and/or dumps download data
*
* @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
*/
public function write_end();
/**
* Extracts database table structure
*
* @param string $table_name name of the database table
* @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
*/
public function write_table($table_name);
/**
* Extracts data from database table
*
* @param string $table_name name of the database table
* @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
*/
public function write_data($table_name);
/**
* Writes data to file/download content
*
* @param string $data
* @return null
* @throws \phpbb\db\extractor\exception\extractor_not_initialized_exception when calling this function before init_extractor()
*/
public function flush($data);
}