aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/install/index.php9
-rw-r--r--phpBB/phpbb/auth/provider/oauth/oauth.php54
-rw-r--r--phpBB/phpbb/auth/provider/oauth/service/bitly.php18
-rw-r--r--phpBB/phpbb/auth/provider/oauth/token_storage.php14
-rw-r--r--phpBB/phpbb/cache/driver/file.php6
-rw-r--r--phpBB/phpbb/log/null.php4
-rw-r--r--phpBB/phpbb/notification/type/group_request.php4
-rw-r--r--phpBB/phpbb/notification/type/group_request_approved.php4
-rw-r--r--phpBB/phpbb/template/base.php6
-rw-r--r--phpBB/phpbb/template/twig/loader.php4
-rw-r--r--phpBB/phpbb/template/twig/node/includeasset.php2
-rw-r--r--phpBB/phpbb/template/twig/node/includecss.php2
-rw-r--r--phpBB/phpbb/template/twig/node/includejs.php2
13 files changed, 68 insertions, 61 deletions
diff --git a/phpBB/install/index.php b/phpBB/install/index.php
index 90d840aa31..e94c393922 100644
--- a/phpBB/install/index.php
+++ b/phpBB/install/index.php
@@ -244,20 +244,11 @@ $config = new \phpbb\config\config(array(
'load_tplcompile' => '1'
));
-<<<<<<< HEAD
-$phpbb_style_resource_locator = new \phpbb\style\resource_locator();
-$phpbb_style_path_provider = new \phpbb\style\path_provider();
$template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
-$phpbb_style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $phpbb_style_resource_locator, $phpbb_style_path_provider, $template);
-$phpbb_style->set_ext_dir_prefix('adm/');
-$phpbb_style->set_custom_style('admin', $phpbb_admin_path . 'style', array(), '');
-=======
-$template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
$paths = array($phpbb_root_path . 'install/update/new/adm/style', $phpbb_admin_path . 'style');
$paths = array_filter($paths, 'is_dir');
$template->set_custom_style('adm', $paths);
->>>>>>> github-phpbb/develop
$template->assign_var('T_ASSETS_PATH', '../assets');
$template->assign_var('T_TEMPLATE_PATH', $phpbb_admin_path . 'style');
diff --git a/phpBB/phpbb/auth/provider/oauth/oauth.php b/phpBB/phpbb/auth/provider/oauth/oauth.php
index be0b8bb7d6..e92462b344 100644
--- a/phpBB/phpbb/auth/provider/oauth/oauth.php
+++ b/phpBB/phpbb/auth/provider/oauth/oauth.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\auth\provider\oauth;
+
/**
* @ignore
*/
@@ -23,33 +25,33 @@ use OAuth\Common\Http\Uri\Uri;
*
* @package auth
*/
-class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
+class oauth extends \phpbb\auth\provider\base
{
/**
* Database driver
*
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver
*/
protected $db;
/**
* phpBB config
*
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* phpBB request object
*
- * @var phpbb_request
+ * @var \phpbb\request\request_interface
*/
protected $request;
/**
* phpBB user
*
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -70,7 +72,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
/**
* All OAuth service providers
*
- * @var phpbb_di_service_collection Contains phpbb_auth_provider_oauth_service_interface
+ * @var \phpbb\di\service_collection Contains \phpbb\auth\provider\oauth\service_interface
*/
protected $service_providers;
@@ -105,18 +107,18 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
/**
* OAuth Authentication Constructor
*
- * @param phpbb_db_driver $db
- * @param phpbb_config $config
- * @param phpbb_request $request
- * @param phpbb_user $user
+ * @param \phpbb\db\driver $db
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
+ * @param \phpbb\user $user
* @param string $auth_provider_oauth_token_storage_table
* @param string $auth_provider_oauth_token_account_assoc
- * @param phpbb_di_service_collection $service_providers Contains phpbb_auth_provider_oauth_service_interface
+ * @param \phpbb\di\service_collection $service_providers Contains \phpbb\auth\provider\oauth\service_interface
* @param string $users_table
* @param string $phpbb_root_path
* @param string $php_ext
*/
- public function __construct(phpbb_db_driver $db, phpbb_config $config, phpbb_request $request, phpbb_user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, phpbb_di_service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\db\driver $db, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, $auth_provider_oauth_token_storage_table, $auth_provider_oauth_token_account_assoc, \phpbb\di\service_collection $service_providers, $users_table, $phpbb_root_path, $php_ext)
{
$this->db = $db;
$this->config = $config;
@@ -156,7 +158,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Temporary workaround for only having one authentication provider available
if (!$this->request->is_set('oauth_service'))
{
- $provider = new phpbb_auth_provider_db($this->db, $this->config, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext);
+ $provider = new \phpbb\auth\provider\db($this->db, $this->config, $this->request, $this->user, $this->phpbb_root_path, $this->php_ext);
return $provider->login($username, $password);
}
@@ -175,11 +177,11 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Get the service credentials for the given service
$service_credentials = $this->service_providers[$service_name]->get_service_credentials();
- $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
$query = 'mode=login&login=external&oauth_service=' . $service_name_original;
$service = $this->get_service($service_name_original, $storage, $service_credentials, $this->service_providers[$service_name]->get_auth_scope(), $query);
- if ($this->request->is_set('code', phpbb_request_interface::GET))
+ if ($this->request->is_set('code', \phpbb\request\request_interface::GET))
{
$this->service_providers[$service_name]->set_external_service_provider($service);
$unique_id = $this->service_providers[$service_name]->perform_auth_login();
@@ -258,7 +260,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
}
$uri_factory = new \OAuth\Common\Http\Uri\UriFactory();
- $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(phpbb_request_interface::SERVER));
+ $current_uri = $uri_factory->createFromSuperGlobalArray($this->request->get_super_global(\phpbb\request\request_interface::SERVER));
$current_uri->setQuery($query);
$this->current_uri = $current_uri;
@@ -269,15 +271,15 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
* Returns a new service object
*
* @param string $service_name The name of the service
- * @param phpbb_auth_oauth_token_storage $storage
- * @param array $service_credentials {@see phpbb_auth_provider_oauth::get_service_credentials}
+ * @param \phpbb\auth\provider\oauth\token_storage $storage
+ * @param array $service_credentials {@see \phpbb\auth\provider\oauth\oauth::get_service_credentials}
* @param array $scope The scope of the request against
* the api.
* @param string $query The query string of the
* current_uri used in redirection
* @return \OAuth\Common\Service\ServiceInterface
*/
- protected function get_service($service_name, phpbb_auth_provider_oauth_token_storage $storage, array $service_credentials, array $scopes = array(), $query)
+ protected function get_service($service_name, \phpbb\auth\provider\oauth\token_storage $storage, array $service_credentials, array $scopes = array(), $query)
{
$current_uri = $this->get_current_uri($service_name, $query);
@@ -434,7 +436,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
/**
* Performs the account linking for login_link
*
- * @param array $link_data The same variable given to {@see phpbb_auth_provider_interface::link_account}
+ * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account}
* @param string $service_name The name of the service being used in
* linking.
* @return string|null Returns a language constant (string) if an error is
@@ -442,7 +444,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/
protected function link_account_login_link(array $link_data, $service_name)
{
- $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
// Check for an access token, they should have one
if (!$storage->has_access_token_by_session($service_name))
@@ -477,7 +479,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
/**
* Performs the account linking for auth_link
*
- * @param array $link_data The same variable given to {@see phpbb_auth_provider_interface::link_account}
+ * @param array $link_data The same variable given to {@see \phpbb\auth\provider\provider_interface::link_account}
* @param string $service_name The name of the service being used in
* linking.
* @return string|null Returns a language constant (string) if an error is
@@ -485,13 +487,13 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
*/
protected function link_account_auth_link(array $link_data, $service_name)
{
- $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
$query = 'i=ucp_auth_link&mode=auth_link&link=1&oauth_service=' . strtolower($link_data['oauth_service']);
$service_credentials = $this->service_providers[$service_name]->get_service_credentials();
$scopes = $this->service_providers[$service_name]->get_auth_scope();
$service = $this->get_service(strtolower($link_data['oauth_service']), $storage, $service_credentials, $scopes, $query);
- if ($this->request->is_set('code', phpbb_request_interface::GET))
+ if ($this->request->is_set('code', \phpbb\request\request_interface::GET))
{
$this->service_providers[$service_name]->set_external_service_provider($service);
$unique_id = $this->service_providers[$service_name]->perform_auth_login();
@@ -530,7 +532,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
public function logout($data, $new_session)
{
// Clear all tokens belonging to the user
- $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
$storage->clearAllTokens();
return;
@@ -610,7 +612,7 @@ class phpbb_auth_provider_oauth extends phpbb_auth_provider_base
// Clear all tokens belonging to the user on this servce
$service_name = 'auth.provider.oauth.service.' . strtolower($link_data['oauth_service']);
- $storage = new phpbb_auth_provider_oauth_token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
+ $storage = new \phpbb\auth\provider\oauth\token_storage($this->db, $this->user, $this->auth_provider_oauth_token_storage_table);
$storage->clearToken($service_name);
return;
diff --git a/phpBB/phpbb/auth/provider/oauth/service/bitly.php b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
index 3bafdd59ce..47cf7ee380 100644
--- a/phpBB/phpbb/auth/provider/oauth/service/bitly.php
+++ b/phpBB/phpbb/auth/provider/oauth/service/bitly.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\auth\provider\oauth\service;
+
/**
* @ignore
*/
@@ -20,29 +22,29 @@ if (!defined('IN_PHPBB'))
*
* @package auth
*/
-class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_service_base
+class bitly extends \phpbb\auth\provider\oauth\service\base
{
/**
* phpBB config
*
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* phpBB request
*
- * @var phpbb_request
+ * @var \phpbb\request\request_interface
*/
protected $request;
/**
* Constructor
*
- * @param phpbb_config $config
- * @param phpbb_request $request
+ * @param \phpbb\config\config $config
+ * @param \phpbb\request\request_interface $request
*/
- public function __construct(phpbb_config $config, phpbb_request $request)
+ public function __construct(\phpbb\config\config $config, \phpbb\request\request_interface $request)
{
$this->config = $config;
$this->request = $request;
@@ -66,7 +68,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
{
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
{
- throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
}
// This was a callback request from bitly, get the token
@@ -86,7 +88,7 @@ class phpbb_auth_provider_oauth_service_bitly extends phpbb_auth_provider_oauth_
{
if (!($this->service_provider instanceof \OAuth\OAuth2\Service\Bitly))
{
- throw new phpbb_auth_provider_oauth_service_exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
+ throw new \phpbb\auth\provider\oauth\service\exception('AUTH_PROVIDER_OAUTH_ERROR_INVALID_SERVICE_TYPE');
}
// Send a request with it
diff --git a/phpBB/phpbb/auth/provider/oauth/token_storage.php b/phpBB/phpbb/auth/provider/oauth/token_storage.php
index d21deb8999..2ce0e32da3 100644
--- a/phpBB/phpbb/auth/provider/oauth/token_storage.php
+++ b/phpBB/phpbb/auth/provider/oauth/token_storage.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\auth\provider\oauth;
+
/**
* @ignore
*/
@@ -27,19 +29,19 @@ use OAuth\Common\Storage\Exception\TokenNotFoundException;
*
* @package auth
*/
-class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
+class token_storage implements TokenStorageInterface
{
/**
* Cache driver.
*
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* phpBB user
*
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -58,11 +60,11 @@ class phpbb_auth_provider_oauth_token_storage implements TokenStorageInterface
/**
* Creates token storage for phpBB.
*
- * @param phpbb_db_driver $db
- * @param phpbb_user $user
+ * @param \phpbb\db\driver\driver $db
+ * @param \phpbb\user $user
* @param string $auth_provider_oauth_table
*/
- public function __construct(phpbb_db_driver $db, phpbb_user $user, $auth_provider_oauth_table)
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\user $user, $auth_provider_oauth_table)
{
$this->db = $db;
$this->user = $user;
diff --git a/phpBB/phpbb/cache/driver/file.php b/phpBB/phpbb/cache/driver/file.php
index 36525e7f55..6e63b6a716 100644
--- a/phpBB/phpbb/cache/driver/file.php
+++ b/phpBB/phpbb/cache/driver/file.php
@@ -207,9 +207,9 @@ class file extends \phpbb\cache\driver\base
function purge()
{
// Purge all phpbb cache files
- try
+ try
{
- $iterator = new DirectoryIterator($this->cache_dir);
+ $iterator = new \DirectoryIterator($this->cache_dir);
}
catch (Exception $e)
{
@@ -258,7 +258,7 @@ class file extends \phpbb\cache\driver\base
*/
protected function remove_dir($dir)
{
- try
+ try
{
$iterator = new DirectoryIterator($dir);
}
diff --git a/phpBB/phpbb/log/null.php b/phpBB/phpbb/log/null.php
index 14b5f65eec..2ef69926ee 100644
--- a/phpBB/phpbb/log/null.php
+++ b/phpBB/phpbb/log/null.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\log;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpbb_log
*/
-class phpbb_log_null implements phpbb_log_interface
+class null implements log_interface
{
/**
* {@inheritdoc}
diff --git a/phpBB/phpbb/notification/type/group_request.php b/phpBB/phpbb/notification/type/group_request.php
index 1a3b5b6992..1768a8fffa 100644
--- a/phpBB/phpbb/notification/type/group_request.php
+++ b/phpBB/phpbb/notification/type/group_request.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_notification_type_group_request extends phpbb_notification_type_base
+class group_request extends \phpbb\notification\type\base
{
/**
* {@inheritdoc}
diff --git a/phpBB/phpbb/notification/type/group_request_approved.php b/phpBB/phpbb/notification/type/group_request_approved.php
index ce83329ff3..be4a902acd 100644
--- a/phpBB/phpbb/notification/type/group_request_approved.php
+++ b/phpBB/phpbb/notification/type/group_request_approved.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_notification_type_group_request_approved extends phpbb_notification_type_base
+class group_request_approved extends \phpbb\notification\type\base
{
/**
* {@inheritdoc}
diff --git a/phpBB/phpbb/template/base.php b/phpBB/phpbb/template/base.php
index 3778424a96..86868707f0 100644
--- a/phpBB/phpbb/template/base.php
+++ b/phpBB/phpbb/template/base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template;
+
/**
* @ignore
*/
@@ -15,13 +17,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-abstract class phpbb_template_base implements phpbb_template
+abstract class base implements template
{
/**
* Template context.
* Stores template data used during template rendering.
*
- * @var phpbb_template_context
+ * @var \phpbb\template\context
*/
protected $context;
diff --git a/phpBB/phpbb/template/twig/loader.php b/phpBB/phpbb/template/twig/loader.php
index 0829e519f7..910061dc0f 100644
--- a/phpBB/phpbb/template/twig/loader.php
+++ b/phpBB/phpbb/template/twig/loader.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Twig Template loader
* @package phpBB3
*/
-class phpbb_template_twig_loader extends Twig_Loader_Filesystem
+class loader extends \Twig_Loader_Filesystem
{
protected $safe_directories = array();
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index d632469c9e..eeedeb31f0 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -73,5 +73,5 @@ abstract class includeasset extends \Twig_Node
* @param Twig_Compiler A Twig_Compiler instance
* @return null
*/
- abstract protected function append_asset(Twig_Compiler $compiler);
+ abstract protected function append_asset(\Twig_Compiler $compiler);
}
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
index 9601cc5155..deb279fa4a 100644
--- a/phpBB/phpbb/template/twig/node/includecss.php
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -22,7 +22,7 @@ class includecss extends \phpbb\template\twig\node\includeasset
/**
* {@inheritdoc}
*/
- public function append_asset(Twig_Compiler $compiler)
+ public function append_asset(\Twig_Compiler $compiler)
{
$compiler
->raw("<link href=\"' . ")
diff --git a/phpBB/phpbb/template/twig/node/includejs.php b/phpBB/phpbb/template/twig/node/includejs.php
index 510e221e07..696b640eac 100644
--- a/phpBB/phpbb/template/twig/node/includejs.php
+++ b/phpBB/phpbb/template/twig/node/includejs.php
@@ -22,7 +22,7 @@ class includejs extends \phpbb\template\twig\node\includeasset
/**
* {@inheritdoc}
*/
- protected function append_asset(Twig_Compiler $compiler)
+ protected function append_asset(\Twig_Compiler $compiler)
{
$config = $this->environment->get_phpbb_config();