diff options
Diffstat (limited to 'phpBB/install')
| -rw-r--r-- | phpBB/install/convertors/convert_phpbb20.php | 7 | ||||
| -rw-r--r-- | phpBB/install/convertors/functions_phpbb20.php | 15 | ||||
| -rw-r--r-- | phpBB/install/database_update.php | 64 | ||||
| -rw-r--r-- | phpBB/install/index.php | 27 | ||||
| -rw-r--r-- | phpBB/install/install_convert.php | 51 | ||||
| -rw-r--r-- | phpBB/install/install_install.php | 61 | ||||
| -rw-r--r-- | phpBB/install/install_update.php | 60 | ||||
| -rw-r--r-- | phpBB/install/phpinfo.php | 11 | ||||
| -rw-r--r-- | phpBB/install/schemas/firebird_schema.sql | 5 | ||||
| -rw-r--r-- | phpBB/install/schemas/mssql_schema.sql | 8 | ||||
| -rw-r--r-- | phpBB/install/schemas/mysql_40_schema.sql | 5 | ||||
| -rw-r--r-- | phpBB/install/schemas/mysql_41_schema.sql | 5 | ||||
| -rw-r--r-- | phpBB/install/schemas/oracle_schema.sql | 8 | ||||
| -rw-r--r-- | phpBB/install/schemas/postgres_schema.sql | 7 | ||||
| -rw-r--r-- | phpBB/install/schemas/schema.json | 20 | ||||
| -rw-r--r-- | phpBB/install/schemas/schema_data.sql | 7 | ||||
| -rw-r--r-- | phpBB/install/schemas/sqlite_schema.sql | 5 | 
17 files changed, 196 insertions, 170 deletions
| diff --git a/phpBB/install/convertors/convert_phpbb20.php b/phpBB/install/convertors/convert_phpbb20.php index 7daacf92f4..696075b07c 100644 --- a/phpBB/install/convertors/convert_phpbb20.php +++ b/phpBB/install/convertors/convert_phpbb20.php @@ -25,10 +25,11 @@ if (!defined('IN_PHPBB'))  	exit;  } -include($phpbb_root_path . 'config.' . $phpEx); +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all());  unset($dbpasswd); -$dbms = phpbb_convert_30_dbms_to_31($dbms); +$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  /**  * $convertor_data provides some basic information about this convertor which is @@ -37,7 +38,7 @@ $dbms = phpbb_convert_30_dbms_to_31($dbms);  $convertor_data = array(  	'forum_name'	=> 'phpBB 2.0.x',  	'version'		=> '1.0.3', -	'phpbb_version'	=> '3.1.0-b4', +	'phpbb_version'	=> '3.1.0-RC2',  	'author'		=> '<a href="https://www.phpbb.com/">phpBB Limited</a>',  	'dbms'			=> $dbms,  	'dbhost'		=> $dbhost, diff --git a/phpBB/install/convertors/functions_phpbb20.php b/phpBB/install/convertors/functions_phpbb20.php index a2bfabd2fd..01447a6232 100644 --- a/phpBB/install/convertors/functions_phpbb20.php +++ b/phpBB/install/convertors/functions_phpbb20.php @@ -92,7 +92,7 @@ function phpbb_insert_forums()  		$src_db->sql_query("SET NAMES 'utf8'");  	} -	switch ($db->sql_layer) +	switch ($db->get_sql_layer())  	{  		case 'mssql':  		case 'mssql_odbc': @@ -289,7 +289,7 @@ function phpbb_insert_forums()  	}  	$src_db->sql_freeresult($result); -	switch ($db->sql_layer) +	switch ($db->get_sql_layer())  	{  		case 'postgres':  			$db->sql_query("SELECT SETVAL('" . FORUMS_TABLE . "_seq',(select case when max(forum_id)>0 then max(forum_id)+1 else 1 end from " . FORUMS_TABLE . '));'); @@ -1768,7 +1768,7 @@ function phpbb_create_userconv_table()  	global $db, $src_db, $convert, $table_prefix, $user, $lang;  	$map_dbms = ''; -	switch ($db->sql_layer) +	switch ($db->get_sql_layer())  	{  		case 'mysql':  			$map_dbms = 'mysql_40'; @@ -1796,7 +1796,7 @@ function phpbb_create_userconv_table()  		break;  		default: -			$map_dbms = $db->sql_layer; +			$map_dbms = $db->get_sql_layer();  		break;  	} @@ -1804,13 +1804,6 @@ function phpbb_create_userconv_table()  	$drop_sql = 'DROP TABLE ' . USERCONV_TABLE;  	switch ($map_dbms)  	{ -		case 'firebird': -			$create_sql = 'CREATE TABLE ' . USERCONV_TABLE . ' ( -				user_id INTEGER NOT NULL, -				username_clean VARCHAR(255) CHARACTER SET UTF8 DEFAULT \'\' NOT NULL COLLATE UNICODE -			)'; -		break; -  		case 'mssql':  			$create_sql = 'CREATE TABLE [' . USERCONV_TABLE . '] (  				[user_id] [int] NOT NULL , diff --git a/phpBB/install/database_update.php b/phpBB/install/database_update.php index 44dbe43cf8..517143792a 100644 --- a/phpBB/install/database_update.php +++ b/phpBB/install/database_update.php @@ -41,7 +41,9 @@ function phpbb_end_update($cache, $config)  		</div>  		<div id="page-footer"> -			Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited +			<div class="copyright"> +				Powered by <a href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited +			</div>  		</div>  	</div>  </body> @@ -54,8 +56,14 @@ function phpbb_end_update($cache, $config)  }  require($phpbb_root_path . 'includes/startup.' . $phpEx); +require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); + +$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); +$phpbb_class_loader->register(); + +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +extract($phpbb_config_php_file->get_all()); -include($phpbb_root_path . 'config.' . $phpEx);  if (!defined('PHPBB_INSTALLED') || empty($dbms) || empty($acm_type))  {  	die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update."); @@ -66,13 +74,9 @@ $phpbb_adm_relative_path = (isset($phpbb_adm_relative_path)) ? $phpbb_adm_relati  $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_root_path . $phpbb_adm_relative_path;  // Include files -require($phpbb_root_path . 'phpbb/class_loader.' . $phpEx); -  require($phpbb_root_path . 'includes/functions.' . $phpEx);  require($phpbb_root_path . 'includes/functions_content.' . $phpEx); -require($phpbb_root_path . 'includes/functions_container.' . $phpEx); -require($phpbb_root_path . 'config.' . $phpEx);  require($phpbb_root_path . 'includes/constants.' . $phpEx);  include($phpbb_root_path . 'includes/utf/utf_normalizer.' . $phpEx);  require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx); @@ -80,26 +84,12 @@ require($phpbb_root_path . 'includes/utf/utf_tools.' . $phpEx);  // Set PHP error handler to ours  set_error_handler(defined('PHPBB_MSG_HANDLER') ? PHPBB_MSG_HANDLER : 'msg_handler'); -// Setup class loader first -$phpbb_class_loader = new \phpbb\class_loader('phpbb\\', "{$phpbb_root_path}phpbb/", $phpEx); -$phpbb_class_loader->register(); -  // Set up container (must be done here because extensions table may not exist) -$container_extensions = array( -	new \phpbb\di\extension\config($phpbb_root_path . 'config.' . $phpEx), -	new \phpbb\di\extension\core($phpbb_root_path . 'config/'), -); -$container_passes = array( -	new \phpbb\di\pass\collection_pass(), -); -$phpbb_container = phpbb_create_container($container_extensions, $phpbb_root_path, $phpEx); - -// Compile the container -foreach ($container_passes as $pass) -{ -	$phpbb_container->addCompilerPass($pass); -} -$phpbb_container->compile(); +$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +$phpbb_container_builder->set_use_extensions(false); +$phpbb_container_builder->set_use_kernel_pass(false); +$phpbb_container_builder->set_dump_container(false); +$phpbb_container = $phpbb_container_builder->get_container();  // set up caching  $cache = $phpbb_container->get('cache'); @@ -174,7 +164,7 @@ header('Content-type: text/html; charset=UTF-8');  								<br /> -								<p><?php echo $user->lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->sql_layer; ?></strong><br /> +								<p><?php echo $user->lang['DATABASE_TYPE']; ?> :: <strong><?php echo $db->get_sql_layer(); ?></strong><br />  								<?php echo $user->lang['PREVIOUS_VERSION']; ?> :: <strong><?php echo $config['version']; ?></strong><br />  <?php @@ -182,30 +172,14 @@ header('Content-type: text/html; charset=UTF-8');  define('IN_DB_UPDATE', true);  /** -* @todo firebird/mysql update? +* @todo mysql update?  */  // End startup code -// Make sure migrations have been installed. -$db_tools = $phpbb_container->get('dbal.tools'); -if (!$db_tools->sql_table_exists($table_prefix . 'migrations')) -{ -	$db_tools->sql_create_table($table_prefix . 'migrations', array( -		'COLUMNS'		=> array( -			'migration_name'			=> array('VCHAR', ''), -			'migration_depends_on'		=> array('TEXT', ''), -			'migration_schema_done'		=> array('BOOL', 0), -			'migration_data_done'		=> array('BOOL', 0), -			'migration_data_state'		=> array('TEXT', ''), -			'migration_start_time'		=> array('TIMESTAMP', 0), -			'migration_end_time'		=> array('TIMESTAMP', 0), -		), -		'PRIMARY_KEY'	=> 'migration_name', -	)); -} -  $migrator = $phpbb_container->get('migrator'); +$migrator->create_migrations_table(); +  $phpbb_extension_manager = $phpbb_container->get('ext.manager');  $finder = $phpbb_extension_manager->get_finder(); diff --git a/phpBB/install/index.php b/phpBB/install/index.php index bff7b75b18..d443c537fa 100644 --- a/phpBB/install/index.php +++ b/phpBB/install/index.php @@ -102,7 +102,6 @@ $phpbb_admin_path = (defined('PHPBB_ADMIN_PATH')) ? PHPBB_ADMIN_PATH : $phpbb_ro  phpbb_require_updated('phpbb/class_loader.' . $phpEx);  phpbb_require_updated('includes/functions.' . $phpEx); -phpbb_require_updated('includes/functions_container.' . $phpEx);  phpbb_require_updated('includes/functions_content.' . $phpEx, true); @@ -120,7 +119,29 @@ $phpbb_class_loader_ext = new \phpbb\class_loader('\\', "{$phpbb_root_path}ext/"  $phpbb_class_loader_ext->register();  // Set up container -$phpbb_container = phpbb_create_install_container($phpbb_root_path, $phpEx); +$phpbb_config_php_file = new \phpbb\config_php_file($phpbb_root_path, $phpEx); +$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +$phpbb_container_builder->set_use_extensions(false); +$phpbb_container_builder->set_dump_container(false); +$phpbb_container_builder->set_use_custom_pass(false); +$phpbb_container_builder->set_inject_config(false); +$phpbb_container_builder->set_compile_container(false); + +$other_config_path = $phpbb_root_path . 'install/update/new/config/'; +$config_path = file_exists($other_config_path . 'services.yml') ? $other_config_path : $phpbb_root_path . 'config/'; +$phpbb_container_builder->set_config_path($config_path); + +$phpbb_container_builder->set_custom_parameters(array( +	'core.root_path'			=> $phpbb_root_path, +	'core.adm_relative_path'	=> $phpbb_adm_relative_path, +	'core.php_ext'				=> $phpEx, +	'core.table_prefix'			=> '', +	'cache.driver.class'		=> 'phpbb\cache\driver\file', +)); + +$phpbb_container = $phpbb_container_builder->get_container(); +$phpbb_container->register('dbal.conn.driver')->setSynthetic(true); +$phpbb_container->compile();  $phpbb_class_loader->set_cache($phpbb_container->get('cache.driver'));  $phpbb_class_loader_ext->set_cache($phpbb_container->get('cache.driver')); @@ -688,7 +709,7 @@ class module  		));  		// Rollback if in transaction -		if ($db->transaction) +		if ($db->get_transaction())  		{  			$db->sql_transaction('rollback');  		} diff --git a/phpBB/install/install_convert.php b/phpBB/install/install_convert.php index 4d6aff154c..17161b5eae 100644 --- a/phpBB/install/install_convert.php +++ b/phpBB/install/install_convert.php @@ -107,7 +107,7 @@ class install_convert extends module  	function main($mode, $sub)  	{  		global $lang, $template, $phpbb_root_path, $phpEx, $cache, $config, $language, $table_prefix; -		global $convert, $request, $phpbb_container; +		global $convert, $request, $phpbb_container, $phpbb_config_php_file;  		$this->tpl_name = 'install_convert';  		$this->mode = $mode; @@ -127,7 +127,8 @@ class install_convert extends module  		// Enable super globals to prevent issues with the new \phpbb\request\request object  		$request->enable_super_globals();  		// Create a normal container now -		$phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx); +		$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +		$phpbb_container = $phpbb_container_builder->get_container();  		// Create cache  		$cache = $phpbb_container->get('cache'); @@ -135,11 +136,12 @@ class install_convert extends module  		switch ($sub)  		{  			case 'intro': -				require($phpbb_root_path . 'config.' . $phpEx); +				extract($phpbb_config_php_file->get_all()); +  				require($phpbb_root_path . 'includes/constants.' . $phpEx);  				require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); -				$dbms = phpbb_convert_30_dbms_to_31($dbms); +				$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  				$db = new $dbms();  				$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); @@ -224,11 +226,12 @@ class install_convert extends module  				// This is for making sure the session get not screwed due to the 3.0.x users table being completely new.  				$cache->purge(); -				require($phpbb_root_path . 'config.' . $phpEx); +				extract($phpbb_config_php_file->get_all()); +  				require($phpbb_root_path . 'includes/constants.' . $phpEx);  				require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); -				$dbms = phpbb_convert_30_dbms_to_31($dbms); +				$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  				$db = new $dbms();  				$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); @@ -248,11 +251,10 @@ class install_convert extends module  					));  				} -				switch ($db->sql_layer) +				switch ($db->get_sql_layer())  				{  					case 'sqlite':  					case 'sqlite3': -					case 'firebird':  						$db->sql_query('DELETE FROM ' . SESSIONS_KEYS_TABLE);  						$db->sql_query('DELETE FROM ' . SESSIONS_TABLE);  					break; @@ -371,13 +373,14 @@ class install_convert extends module  	*/  	function get_convert_settings($sub)  	{ -		global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache; +		global $lang, $language, $template, $db, $phpbb_root_path, $phpEx, $config, $cache, $phpbb_config_php_file; + +		extract($phpbb_config_php_file->get_all()); -		require($phpbb_root_path . 'config.' . $phpEx);  		require($phpbb_root_path . 'includes/constants.' . $phpEx);  		require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); -		$dbms = phpbb_convert_30_dbms_to_31($dbms); +		$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  		$db = new $dbms();  		$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); @@ -459,7 +462,8 @@ class install_convert extends module  			{  				$error[] = sprintf($lang['TABLE_PREFIX_SAME'], $src_table_prefix);  			} -			$src_dbms  = phpbb_convert_30_dbms_to_31($src_dbms); + +			$src_dbms = $phpbb_config_php_file->convert_30_dbms_to_31($src_dbms);  			// Check table prefix  			if (!sizeof($error)) @@ -615,13 +619,14 @@ class install_convert extends module  	{  		global $template, $user, $phpbb_root_path, $phpEx, $db, $lang, $config, $cache, $auth;  		global $convert, $convert_row, $message_parser, $skip_rows, $language; -		global $request; +		global $request, $phpbb_config_php_file; + +		extract($phpbb_config_php_file->get_all()); -		require($phpbb_root_path . 'config.' . $phpEx);  		require($phpbb_root_path . 'includes/constants.' . $phpEx);  		require($phpbb_root_path . 'includes/functions_convert.' . $phpEx); -		$dbms = phpbb_convert_30_dbms_to_31($dbms); +		$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  		$db = new $dbms();  		$db->sql_connect($dbhost, $dbuser, $dbpasswd, $dbname, $dbport, false, true); @@ -700,7 +705,6 @@ class install_convert extends module  		{  			case 'sqlite':  			case 'sqlite3': -			case 'firebird':  				$convert->src_truncate_statement = 'DELETE FROM ';  			break; @@ -729,11 +733,10 @@ class install_convert extends module  			$src_db->sql_query("SET NAMES 'binary'");  		} -		switch ($db->sql_layer) +		switch ($db->get_sql_layer())  		{  			case 'sqlite':  			case 'sqlite3': -			case 'firebird':  				$convert->truncate_statement = 'DELETE FROM ';  			break; @@ -1132,7 +1135,7 @@ class install_convert extends module  				if (!empty($schema['autoincrement']))  				{ -					switch ($db->sql_layer) +					switch ($db->get_sql_layer())  					{  						case 'postgres':  							$db->sql_query("SELECT SETVAL('" . $schema['target'] . "_seq',(select case when max(" . $schema['autoincrement'] . ")>0 then max(" . $schema['autoincrement'] . ")+1 else 1 end from " . $schema['target'] . '));'); @@ -1271,7 +1274,7 @@ class install_convert extends module  				if (!empty($schema['autoincrement']))  				{ -					switch ($db->sql_layer) +					switch ($db->get_sql_layer())  					{  						case 'mssql':  						case 'mssql_odbc': @@ -1304,7 +1307,7 @@ class install_convert extends module  					if ($sql_flag === true)  					{ -						switch ($db->sql_layer) +						switch ($db->get_sql_layer())  						{  							// If MySQL, we'll wait to have num_wait_rows rows to submit at once  							case 'mysql': @@ -1399,7 +1402,7 @@ class install_convert extends module  				if (!empty($schema['autoincrement']))  				{ -					switch ($db->sql_layer) +					switch ($db->get_sql_layer())  					{  						case 'mssql':  						case 'mssql_odbc': @@ -1638,7 +1641,7 @@ class install_convert extends module  				'RESULT'	=> $user->lang['DONE'],  			)); -			if ($db->sql_error_triggered) +			if ($db->get_sql_error_triggered())  			{  				$template->assign_vars(array(  					'S_ERROR_BOX'	=> true, @@ -1811,7 +1814,7 @@ class install_convert extends module  		global $convert;  		// Can we use IGNORE with this DBMS? -		$sql_ignore = (strpos($db->sql_layer, 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : ''; +		$sql_ignore = (strpos($db->get_sql_layer(), 'mysql') === 0 && !defined('DEBUG')) ? 'IGNORE ' : '';  		$insert_query = 'INSERT ' . $sql_ignore . 'INTO ' . $schema['target'] . ' (';  		$aliases = array(); diff --git a/phpBB/install/install_install.php b/phpBB/install/install_install.php index 576cbba3ca..b82df84a00 100644 --- a/phpBB/install/install_install.php +++ b/phpBB/install/install_install.php @@ -51,7 +51,7 @@ class install_install extends module  	function main($mode, $sub)  	{  		global $lang, $template, $language, $phpbb_root_path, $phpEx; -		global $phpbb_container, $cache, $phpbb_log, $request; +		global $phpbb_container, $cache, $phpbb_log, $request, $phpbb_config_php_file;  		switch ($sub)  		{ @@ -104,7 +104,8 @@ class install_install extends module  				$request->enable_super_globals();  				// Create a normal container now -				$phpbb_container = phpbb_create_default_container($phpbb_root_path, $phpEx); +				$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +				$phpbb_container = $phpbb_container_builder->get_container();  				// Sets the global variables  				$cache = $phpbb_container->get('cache'); @@ -1153,21 +1154,25 @@ class install_install extends module  		// How should we treat this schema?  		$delimiter = $available_dbms[$data['dbms']]['DELIM']; -		$sql_query = @file_get_contents($dbms_schema); -		$sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); -		$sql_query = phpbb_remove_comments($sql_query); -		$sql_query = split_sql_file($sql_query, $delimiter); -		foreach ($sql_query as $sql) +		if (file_exists($dbms_schema))  		{ -			//$sql = trim(str_replace('|', ';', $sql)); -			if (!$db->sql_query($sql)) +			$sql_query = @file_get_contents($dbms_schema); +			$sql_query = preg_replace('#phpbb_#i', $data['table_prefix'], $sql_query); +			$sql_query = phpbb_remove_comments($sql_query); +			$sql_query = split_sql_file($sql_query, $delimiter); + +			foreach ($sql_query as $sql)  			{ -				$error = $db->sql_error(); -				$this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); +				//$sql = trim(str_replace('|', ';', $sql)); +				if (!$db->sql_query($sql)) +				{ +					$error = $db->sql_error(); +					$this->p_master->db_error($error['message'], $sql, __LINE__, __FILE__); +				}  			} +			unset($sql_query);  		} -		unset($sql_query);  		// Ok we have the db info go ahead and work on building the table  		$db_table_schema = @file_get_contents('schemas/schema.json'); @@ -1528,10 +1533,10 @@ class install_install extends module  				$_module->update_module_data($module_data, true);  				// Check for last sql error happened -				if ($db->sql_error_triggered) +				if ($db->get_sql_error_triggered())  				{ -					$error = $db->sql_error($db->sql_error_sql); -					$this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); +					$error = $db->sql_error($db->get_sql_error_sql()); +					$this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);  				}  				$categories[$cat_name]['id'] = (int) $module_data['module_id']; @@ -1562,10 +1567,10 @@ class install_install extends module  						$_module->update_module_data($module_data, true);  						// Check for last sql error happened -						if ($db->sql_error_triggered) +						if ($db->get_sql_error_triggered())  						{ -							$error = $db->sql_error($db->sql_error_sql); -							$this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); +							$error = $db->sql_error($db->get_sql_error_sql()); +							$this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);  						}  						$categories[$level2_name]['id'] = (int) $module_data['module_id']; @@ -1602,10 +1607,10 @@ class install_install extends module  						$_module->update_module_data($module_data, true);  						// Check for last sql error happened -						if ($db->sql_error_triggered) +						if ($db->get_sql_error_triggered())  						{ -							$error = $db->sql_error($db->sql_error_sql); -							$this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); +							$error = $db->sql_error($db->get_sql_error_sql()); +							$this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);  						}  					}  				} @@ -1768,10 +1773,10 @@ class install_install extends module  						$_module->update_module_data($module_data, true);  						// Check for last sql error happened -						if ($db->sql_error_triggered) +						if ($db->get_sql_error_triggered())  						{ -							$error = $db->sql_error($db->sql_error_sql); -							$this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); +							$error = $db->sql_error($db->get_sql_error_sql()); +							$this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);  						}  					}  				} @@ -1820,10 +1825,10 @@ class install_install extends module  				$db->sql_query('INSERT INTO ' . LANG_TABLE . ' ' . $db->sql_build_array('INSERT', $lang_pack));  				$installed_languages[] = (int) $db->sql_nextid(); -				if ($db->sql_error_triggered) +				if ($db->get_sql_error_triggered())  				{ -					$error = $db->sql_error($db->sql_error_sql); -					$this->p_master->db_error($error['message'], $db->sql_error_sql, __LINE__, __FILE__); +					$error = $db->sql_error($db->get_sql_error_sql()); +					$this->p_master->db_error($error['message'], $db->get_sql_error_sql(), __LINE__, __FILE__);  				}  			}  		} @@ -1909,7 +1914,7 @@ class install_install extends module  			if (!$user_id)  			{  				// If we can't insert this user then continue to the next one to avoid inconsistent data -				$this->p_master->db_error('Unable to insert bot into users table', $db->sql_error_sql, __LINE__, __FILE__, true); +				$this->p_master->db_error('Unable to insert bot into users table', $db->get_sql_error_sql(), __LINE__, __FILE__, true);  				continue;  			} diff --git a/phpBB/install/install_update.php b/phpBB/install/install_update.php index ab5fcc3f2b..28777a8d24 100644 --- a/phpBB/install/install_update.php +++ b/phpBB/install/install_update.php @@ -66,7 +66,7 @@ class install_update extends module  	function main($mode, $sub)  	{  		global $template, $phpEx, $phpbb_root_path, $user, $db, $config, $cache, $auth, $language; -		global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container; +		global $request, $phpbb_admin_path, $phpbb_adm_relative_path, $phpbb_container, $phpbb_config_php_file;  		// We must enable super globals, otherwise creating a new instance of the request class,  		// using the new container with a dbal connection will fail with the following PHP Notice: @@ -74,14 +74,14 @@ class install_update extends module  		$request->enable_super_globals();  		// Create a normal container now +		$phpbb_container_builder = new \phpbb\di\container_builder($phpbb_config_php_file, $phpbb_root_path, $phpEx); +		$phpbb_container_builder->set_dump_container(false); +		$phpbb_container_builder->set_use_extensions(false);  		if (file_exists($phpbb_root_path . 'install/update/new/config'))  		{ -			$phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, $phpbb_root_path . 'install/update/new/config'); -		} -		else -		{ -			$phpbb_container = phpbb_create_update_container($phpbb_root_path, $phpEx, $phpbb_root_path . 'config'); +			$phpbb_container_builder->set_config_path($phpbb_root_path . 'install/update/new/config');  		} +		$phpbb_container = $phpbb_container_builder->get_container();  		// Writes into global $cache  		$cache = $phpbb_container->get('cache'); @@ -93,7 +93,7 @@ class install_update extends module  		$this->new_location = $phpbb_root_path . 'install/update/new/';  		// Init DB -		require($phpbb_root_path . 'config.' . $phpEx); +		extract($phpbb_config_php_file->get_all());  		require($phpbb_root_path . 'includes/constants.' . $phpEx);  		// Special options for conflicts/modified files @@ -102,7 +102,7 @@ class install_update extends module  		define('MERGE_NEW_FILE', 3);  		define('MERGE_MOD_FILE', 4); -		$dbms = phpbb_convert_30_dbms_to_31($dbms); +		$dbms = $phpbb_config_php_file->convert_30_dbms_to_31($dbms);  		$db = new $dbms(); @@ -396,7 +396,7 @@ class install_update extends module  							'S_COLLECTED'		=> (int) $update_list['status'],  							'S_TO_COLLECT'		=> sizeof($this->update_info['files']),  							'L_IN_PROGRESS'				=> $user->lang['COLLECTING_FILE_DIFFS'], -							'L_IN_PROGRESS_EXPLAIN'		=> sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files'])), +							'L_IN_PROGRESS_EXPLAIN'		=> sprintf($user->lang['NUMBER_OF_FILES_COLLECTED'], (int) $update_list['status'], sizeof($this->update_info['files']) + sizeof($this->update_info['deleted'])),  						));  						return; @@ -422,7 +422,7 @@ class install_update extends module  				// Now assign the list to the template  				foreach ($update_list as $status => $filelist)  				{ -					if ($status == 'no_update' || !sizeof($filelist) || $status == 'status') +					if ($status == 'no_update' || !sizeof($filelist) || $status == 'status' || $status == 'status_deleted')  					{  						continue;  					} @@ -489,7 +489,7 @@ class install_update extends module  				$all_up_to_date = true;  				foreach ($update_list as $status => $filelist)  				{ -					if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && sizeof($filelist)) +					if ($status != 'up_to_date' && $status != 'custom' && $status != 'status' && $status != 'status_deleted' && sizeof($filelist))  					{  						$all_up_to_date = false;  						break; @@ -831,7 +831,7 @@ class install_update extends module  						foreach ($update_list as $status => $files)  						{ -							if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status') +							if ($status == 'up_to_date' || $status == 'no_update' || $status == 'status' || $status == 'status_deleted')  							{  								continue;  							} @@ -1221,6 +1221,16 @@ class install_update extends module  				$this->page_title = 'VIEWING_FILE_CONTENTS';  			break; + +			case 'deleted': + +				$diff = $this->return_diff(array(), $phpbb_root_path . $original_file); + +				$template->assign_var('S_DIFF_NEW_FILE', true); +				$diff_mode = 'inline'; +				$this->page_title = 'VIEWING_FILE_CONTENTS'; + +			break;  		}  		$diff_mode_options = ''; @@ -1266,7 +1276,9 @@ class install_update extends module  				'new_conflict'	=> array(),  				'conflict'		=> array(),  				'no_update'		=> array(), +				'deleted'		=> array(),  				'status'		=> 0, +				'status_deleted'=> 0,  			);  		} @@ -1345,7 +1357,31 @@ class install_update extends module  			$update_list['status']++;  		} +		foreach ($this->update_info['deleted'] as $index => $file) +		{ +			if (is_int($update_list['status_deleted']) && $index < $update_list['status_deleted']) +			{ +				continue; +			} + +			if ($num_bytes_processed >= 500 * 1024) +			{ +				return; +			} + +			if (file_exists($phpbb_root_path . $file)) +			{ +				$update_list['deleted'][] = array('filename' => $file, 'custom' => false, 'as_expected' => false); +				$num_bytes_processed += filesize($phpbb_root_path . $file); +			} + +			$update_list['status_deleted']++; +			$update_list['status']++; +		} + +		$update_list['status_deleted'] = -1;  		$update_list['status'] = -1; +  /*		if (!sizeof($this->update_info['files']))  		{  			return $update_list; diff --git a/phpBB/install/phpinfo.php b/phpBB/install/phpinfo.php index 83f154933a..1512b00563 100644 --- a/phpBB/install/phpinfo.php +++ b/phpBB/install/phpinfo.php @@ -1,3 +1,14 @@  <?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. +* +*/  phpinfo(); diff --git a/phpBB/install/schemas/firebird_schema.sql b/phpBB/install/schemas/firebird_schema.sql deleted file mode 100644 index 28649dc54c..0000000000 --- a/phpBB/install/schemas/firebird_schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT EDIT THIS FILE, IT IS GENERATED -# -# To change the contents of this file, edit -# phpBB/develop/create_schema_files.php and -# run it. diff --git a/phpBB/install/schemas/mssql_schema.sql b/phpBB/install/schemas/mssql_schema.sql deleted file mode 100644 index f88513cf0e..0000000000 --- a/phpBB/install/schemas/mssql_schema.sql +++ /dev/null @@ -1,8 +0,0 @@ -/* - * DO NOT EDIT THIS FILE, IT IS GENERATED - * - * To change the contents of this file, edit - * phpBB/develop/create_schema_files.php and - * run it. - */ - diff --git a/phpBB/install/schemas/mysql_40_schema.sql b/phpBB/install/schemas/mysql_40_schema.sql deleted file mode 100644 index 28649dc54c..0000000000 --- a/phpBB/install/schemas/mysql_40_schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT EDIT THIS FILE, IT IS GENERATED -# -# To change the contents of this file, edit -# phpBB/develop/create_schema_files.php and -# run it. diff --git a/phpBB/install/schemas/mysql_41_schema.sql b/phpBB/install/schemas/mysql_41_schema.sql deleted file mode 100644 index 28649dc54c..0000000000 --- a/phpBB/install/schemas/mysql_41_schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT EDIT THIS FILE, IT IS GENERATED -# -# To change the contents of this file, edit -# phpBB/develop/create_schema_files.php and -# run it. diff --git a/phpBB/install/schemas/oracle_schema.sql b/phpBB/install/schemas/oracle_schema.sql index 61f5d5f961..2473d31aab 100644 --- a/phpBB/install/schemas/oracle_schema.sql +++ b/phpBB/install/schemas/oracle_schema.sql @@ -1,12 +1,4 @@  /* - * DO NOT EDIT THIS FILE, IT IS GENERATED - * - * To change the contents of this file, edit - * phpBB/develop/create_schema_files.php and - * run it. - */ - -/*    This first section is optional, however its probably the best method    of running phpBB on Oracle. If you already have a tablespace and user created    for phpBB you can leave this section commented out! diff --git a/phpBB/install/schemas/postgres_schema.sql b/phpBB/install/schemas/postgres_schema.sql index 3fc8589844..65caba8d1c 100644 --- a/phpBB/install/schemas/postgres_schema.sql +++ b/phpBB/install/schemas/postgres_schema.sql @@ -1,10 +1,3 @@ -/* - * DO NOT EDIT THIS FILE, IT IS GENERATED - * - * To change the contents of this file, edit - * phpBB/develop/create_schema_files.php and - * run it. - */  BEGIN; diff --git a/phpBB/install/schemas/schema.json b/phpBB/install/schemas/schema.json index 79f06693a6..a3ffd923a1 100644 --- a/phpBB/install/schemas/schema.json +++ b/phpBB/install/schemas/schema.json @@ -2088,6 +2088,26 @@                  "UINT",                  0              ], +            "pf_phpbb_skype": [ +                "VCHAR", +                "" +            ], +            "pf_phpbb_twitter": [ +                "VCHAR", +                "" +            ], +            "pf_phpbb_youtube": [ +                "VCHAR", +                "" +            ], +            "pf_phpbb_facebook": [ +                "VCHAR", +                "" +            ], +            "pf_phpbb_googleplus": [ +                "VCHAR", +                "" +            ],              "pf_phpbb_interests": [                  "MTEXT",                  "" diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 15cd9595c6..9cc151f728 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -273,7 +273,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('tpl_allow_php', '0  INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_icons_path', 'images/upload_icons');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('upload_path', 'files');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('use_system_cron', '0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-b5-dev'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('version', '3.1.0-RC3-dev');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_expire_days', '90');  INSERT INTO phpbb_config (config_name, config_value) VALUES ('warnings_gc', '14400'); @@ -806,6 +806,11 @@ INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_len  INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_icq', 'profilefields.type.string', 'phpbb_icq', '20', '3', '15', '', '', '[0-9]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 6, 1, 'SEND_ICQ_MESSAGE', 'https://www.icq.com/people/%s/');  INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_wlm', 'profilefields.type.string', 'phpbb_wlm', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 7, 1, '', '');  INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_yahoo', 'profilefields.type.string', 'phpbb_yahoo', '40', '5', '255', '', '', '.*', 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 8, 1, 'SEND_YIM_MESSAGE', 'http://edit.yahoo.com/config/send_webmesg?.target=%s&.src=pg'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_facebook', 'profilefields.type.string', 'phpbb_facebook', '20', '5', '50', '', '', '[\w.]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 9, 1, 'VIEW_FACEBOOK_PROFILE', 'http://facebook.com/%s/'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_twitter', 'profilefields.type.string', 'phpbb_twitter', '20', '1', '15', '', '', '[\w_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 10, 1, 'VIEW_TWITTER_PROFILE', 'http://twitter.com/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_skype', 'profilefields.type.string', 'phpbb_skype', '20', '6', '32', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 11, 1, 'VIEW_SKYPE_PROFILE', 'skype:%s?userinfo'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_youtube', 'profilefields.type.string', 'phpbb_youtube', '20', '3', '60', '', '', '[a-zA-Z][\w\.,\-_]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 12, 1, 'VIEW_YOUTUBE_CHANNEL', 'http://youtube.com/user/%s'); +INSERT INTO phpbb_profile_fields (field_name, field_type, field_ident, field_length, field_minlen, field_maxlen, field_novalue, field_default_value, field_validation, field_required, field_show_novalue, field_show_on_reg, field_show_on_pm, field_show_on_vt, field_show_on_ml, field_show_profile, field_hide, field_no_view, field_active, field_order, field_is_contact, field_contact_desc, field_contact_url) VALUES ('phpbb_googleplus', 'profilefields.type.googleplus', 'phpbb_googleplus', '20', '3', '255', '', '', '[\w]+', 0, 0, 0, 1, 1, 1, 1, 0, 0, 1, 13, 1, 'VIEW_GOOGLEPLUS_PROFILE', 'http://plus.google.com/%s');  # User Notification Options (for first user)  INSERT INTO phpbb_user_notifications (item_type, item_id, user_id, method) VALUES('post', 0, 2, ''); diff --git a/phpBB/install/schemas/sqlite_schema.sql b/phpBB/install/schemas/sqlite_schema.sql deleted file mode 100644 index 28649dc54c..0000000000 --- a/phpBB/install/schemas/sqlite_schema.sql +++ /dev/null @@ -1,5 +0,0 @@ -# DO NOT EDIT THIS FILE, IT IS GENERATED -# -# To change the contents of this file, edit -# phpBB/develop/create_schema_files.php and -# run it. | 
