1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

Merge remote-tracking branch 'upstream/develop' into ticket/11015

* upstream/develop: (666 commits)
  [ticket/11077] Remove code from old global announcements system
  [ticket/11189] Replace DEBUG_EXTRA with DEBUG
  [ticket/11189] Always log critical errors when in cron or in image output
  [ticket/11187] Added a blank array to fix errors in functional tests
  [ticket/10780] Make L_COLON available in the installer.
  [ticket/11183] Remove $load_extensions and weird dl() calls
  [ticket/10970] Added extra documentation to parse_dynamic_path.
  [ticket/10939] Added documentation for phpbb_request::file
  [ticket/10865] Use code tags for install/database_update.php.
  [ticket/10865] Should have been a slash.
  [ticket/10780] Use L_COLON on LDAP page.
  [ticket/10780] Use L_COLON on search backend ACP pages.
  [ticket/10780] Use L_COLON for "download all attachments".
  [ticket/10780] Use colon from language in ucp_pm_compose.php where possible.
  [ticket/10780] Replace colons in phpBB/adm/style/acp_ext_details.html.
  [ticket/10780] Replace colon usage in adm template output with {L_COLON}
  [ticket/10780] Replace colon usage in template output with {L_COLON}
  [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2) [develop-olympus]
  [ticket/11181] Bump PHP requirement to 5.3.3 (from 5.3.2)
  [ticket/10172] Show prosilver birthday list even if there are no birthdays.
  ...

Conflicts:
	phpBB/common.php
	phpBB/download/file.php
	phpBB/includes/db/dbal.php
	phpBB/includes/db/firebird.php
	phpBB/includes/db/mssql.php
	phpBB/includes/db/mssql_odbc.php
	phpBB/includes/db/mssqlnative.php
	phpBB/includes/db/mysql.php
	phpBB/includes/db/mysqli.php
	phpBB/includes/db/oracle.php
	phpBB/includes/db/postgres.php
	phpBB/includes/db/sqlite.php
	phpBB/includes/extension/manager.php
	phpBB/install/database_update.php
This commit is contained in:
Igor Wiedler
2012-11-12 10:33:40 +01:00
449 changed files with 12779 additions and 3043 deletions

View File

@@ -22,6 +22,8 @@ if (!defined('IN_PHPBB'))
*/
class phpbb_extension_manager
{
protected $db;
protected $config;
protected $cache;
protected $php_ext;
protected $extensions;
@@ -33,16 +35,18 @@ class phpbb_extension_manager
* Creates a manager and loads information from database
*
* @param dbal $db A database connection
* @param phpbb_config $config phpbb_config
* @param string $extension_table The name of the table holding extensions
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension
* @param phpbb_cache_driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
public function __construct(phpbb_db_driver $db, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
public function __construct(phpbb_db_driver $db, phpbb_config $config, $extension_table, $phpbb_root_path, $php_ext = '.php', phpbb_cache_driver_interface $cache = null, $cache_name = '_ext')
{
$this->phpbb_root_path = $phpbb_root_path;
$this->db = $db;
$this->config = $config;
$this->cache = $cache;
$this->php_ext = $php_ext;
$this->extension_table = $extension_table;
@@ -63,6 +67,17 @@ class phpbb_extension_manager
*/
public function load_extensions()
{
$this->extensions = array();
// Do not try to load any extensions when installing or updating
// Note: database updater invokes this code, and in 3.0
// there is no extension table therefore the rest of this function
// fails
if (defined('IN_INSTALL'))
{
return;
}
$sql = 'SELECT *
FROM ' . $this->extension_table;
@@ -70,7 +85,6 @@ class phpbb_extension_manager
$extensions = $this->db->sql_fetchrowset($result);
$this->db->sql_freeresult($result);
$this->extensions = array();
foreach ($extensions as $extension)
{
$extension['ext_path'] = $this->get_extension_path($extension['ext_name']);
@@ -120,6 +134,18 @@ class phpbb_extension_manager
}
}
/**
* Instantiates the metadata manager for the extension with the given name
*
* @param string $name The extension name
* @param string $template The template manager
* @return phpbb_extension_metadata_manager Instance of the metadata manager
*/
public function create_extension_metadata_manager($name, phpbb_template $template)
{
return new phpbb_extension_metadata_manager($name, $this->db, $this, $this->phpbb_root_path, $this->php_ext, $template, $this->config);
}
/**
* Runs a step of the extension enabling process.
*