diff --git a/phpBB/cache/index.htm b/phpBB/cache/index.htm deleted file mode 100644 index ee1f723a7d..0000000000 --- a/phpBB/cache/index.htm +++ /dev/null @@ -1,10 +0,0 @@ - -
-
-* $buffer = new phpbb_db_sql_insert_buffer($db, 'test_table', 1234);
+* $buffer = new \phpbb\db\sql_insert_buffer($db, 'test_table', 1234);
*
* while (do_stuff())
* {
@@ -53,9 +55,9 @@ if (!defined('IN_PHPBB'))
*
* @package dbal
*/
-class phpbb_db_sql_insert_buffer
+class sql_insert_buffer
{
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
/** @var string */
@@ -68,11 +70,11 @@ class phpbb_db_sql_insert_buffer
protected $buffer = array();
/**
- * @param phpbb_db_driver $db
+ * @param \phpbb\db\driver\driver $db
* @param string $table_name
* @param int $max_buffered_rows
*/
- public function __construct(phpbb_db_driver $db, $table_name, $max_buffered_rows = 500)
+ public function __construct(\phpbb\db\driver\driver $db, $table_name, $max_buffered_rows = 500)
{
$this->db = $db;
$this->table_name = $table_name;
diff --git a/phpBB/phpbb/db/tools.php b/phpBB/phpbb/db/tools.php
index 492284ffcd..35b89e8166 100644
--- a/phpBB/phpbb/db/tools.php
+++ b/phpBB/phpbb/db/tools.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\db;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package dbal
*/
-class phpbb_db_tools
+class tools
{
/**
* Current sql layer
@@ -300,10 +302,10 @@ class phpbb_db_tools
/**
* Constructor. Set DB Object and set {@link $return_statements return_statements}.
*
- * @param phpbb_db_driver $db Database connection
+ * @param \phpbb\db\driver\driver $db Database connection
* @param bool $return_statements True if only statements should be returned and no SQL being executed
*/
- public function __construct(phpbb_db_driver $db, $return_statements = false)
+ public function __construct(\phpbb\db\driver\driver $db, $return_statements = false)
{
$this->db = $db;
$this->return_statements = $return_statements;
@@ -491,7 +493,7 @@ class phpbb_db_tools
trigger_error("Index name '${column_name}_gen' on table '$table_name' is too long. The maximum auto increment column length is 26 characters.", E_USER_ERROR);
}
- // here we add the definition of the new column to the list of columns
+ // here we add the definition of the new \column to the list of columns
switch ($this->sql_layer)
{
case 'mssql':
@@ -978,7 +980,7 @@ class phpbb_db_tools
$column_list[] = $entities[0];
}
- // note down the primary key notation because sqlite only supports adding it to the end for the new table
+ // note down the primary key notation because sqlite only supports adding it to the end for the new \table
$primary_key = false;
$_new_cols = array();
@@ -1058,7 +1060,7 @@ class phpbb_db_tools
{
$new_table_cols[] = 'PRIMARY KEY (' . implode(', ', $sql_schema_changes['primary_key']) . ')';
}
- // Add a new one or the old primary key
+ // Add a new \one or the old primary key
else if ($primary_key !== false)
{
$new_table_cols[] = $primary_key;
@@ -1066,7 +1068,7 @@ class phpbb_db_tools
$columns = implode(',', $column_list);
- // create a new table and fill it up. destroy the temp one
+ // create a new \table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $new_table_cols) . ');';
$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
$statements[] = 'DROP TABLE ' . $table_name . '_temp';
@@ -1689,7 +1691,7 @@ class phpbb_db_tools
}
/**
- * Add new column
+ * Add new \column
*/
function sql_column_add($table_name, $column_name, $column_data, $inline = false)
{
@@ -1798,7 +1800,7 @@ class phpbb_db_tools
$new_table_cols = $column_name . ' ' . $column_data['column_type_sql'] . ',' . $new_table_cols;
- // create a new table and fill it up. destroy the temp one
+ // create a new \table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
$statements[] = 'DROP TABLE ' . $table_name . '_temp';
@@ -1913,7 +1915,7 @@ class phpbb_db_tools
$new_table_cols = preg_replace('/' . $column_name . '[^,]+(?:,|$)/m', '', $new_table_cols);
- // create a new table and fill it up. destroy the temp one
+ // create a new \table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ');';
$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
$statements[] = 'DROP TABLE ' . $table_name . '_temp';
@@ -2105,7 +2107,7 @@ class phpbb_db_tools
$columns = implode(',', $column_list);
- // create a new table and fill it up. destroy the temp one
+ // create a new \table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . $new_table_cols . ', PRIMARY KEY (' . implode(', ', $column) . '));';
$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
$statements[] = 'DROP TABLE ' . $table_name . '_temp';
@@ -2471,7 +2473,7 @@ class phpbb_db_tools
$columns = implode(',', $column_list);
- // create a new table and fill it up. destroy the temp one
+ // create a new \table and fill it up. destroy the temp one
$statements[] = 'CREATE TABLE ' . $table_name . ' (' . implode(',', $old_table_cols) . ');';
$statements[] = 'INSERT INTO ' . $table_name . ' (' . $columns . ') SELECT ' . $columns . ' FROM ' . $table_name . '_temp;';
$statements[] = 'DROP TABLE ' . $table_name . '_temp';
diff --git a/phpBB/phpbb/di/extension/config.php b/phpBB/phpbb/di/extension/config.php
index 6c272a6588..62757c5b7d 100644
--- a/phpBB/phpbb/di/extension/config.php
+++ b/phpBB/phpbb/di/extension/config.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di\extension;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ use Symfony\Component\Config\FileLocator;
/**
* Container config extension
*/
-class phpbb_di_extension_config extends Extension
+class config extends Extension
{
public function __construct($config_file)
{
diff --git a/phpBB/phpbb/di/extension/core.php b/phpBB/phpbb/di/extension/core.php
index 9c36ba2fc4..901addc694 100644
--- a/phpBB/phpbb/di/extension/core.php
+++ b/phpBB/phpbb/di/extension/core.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di\extension;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ use Symfony\Component\Config\FileLocator;
/**
* Container core extension
*/
-class phpbb_di_extension_core extends Extension
+class core extends Extension
{
/**
* phpBB Root path
diff --git a/phpBB/phpbb/di/extension/ext.php b/phpBB/phpbb/di/extension/ext.php
index 7d9b433751..cf623a7c87 100644
--- a/phpBB/phpbb/di/extension/ext.php
+++ b/phpBB/phpbb/di/extension/ext.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di\extension;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ use Symfony\Component\Config\FileLocator;
/**
* Container ext extension
*/
-class phpbb_di_extension_ext extends Extension
+class ext extends Extension
{
protected $paths = array();
diff --git a/phpBB/phpbb/di/pass/collection_pass.php b/phpBB/phpbb/di/pass/collection_pass.php
index 63a5c7dfc4..ffc5a41f6d 100644
--- a/phpBB/phpbb/di/pass/collection_pass.php
+++ b/phpBB/phpbb/di/pass/collection_pass.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di\pass;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
* the services tagged with the appropriate name defined in the collection's
* service_collection tag.
*/
-class phpbb_di_pass_collection_pass implements CompilerPassInterface
+class collection_pass implements CompilerPassInterface
{
/**
* Modify the container before it is passed to the rest of the code
diff --git a/phpBB/phpbb/di/pass/kernel_pass.php b/phpBB/phpbb/di/pass/kernel_pass.php
index a701ebcfa6..6a9124ad78 100644
--- a/phpBB/phpbb/di/pass/kernel_pass.php
+++ b/phpBB/phpbb/di/pass/kernel_pass.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di\pass;
+
/**
* @ignore
*/
@@ -18,7 +20,7 @@ if (!defined('IN_PHPBB'))
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
-class phpbb_di_pass_kernel_pass implements CompilerPassInterface
+class kernel_pass implements CompilerPassInterface
{
/**
* Modify the container before it is passed to the rest of the code
@@ -38,12 +40,12 @@ class phpbb_di_pass_kernel_pass implements CompilerPassInterface
if (!isset($event['event']))
{
- throw new InvalidArgumentException(sprintf('Service "%1$s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
+ throw new \InvalidArgumentException(sprintf('Service "%1$s" must define the "event" attribute on "kernel.event_listener" tags.', $id));
}
if (!isset($event['method']))
{
- throw new InvalidArgumentException(sprintf('Service "%1$s" must define the "method" attribute on "kernel.event_listener" tags.', $id));
+ throw new \InvalidArgumentException(sprintf('Service "%1$s" must define the "method" attribute on "kernel.event_listener" tags.', $id));
}
$definition->addMethodCall('addListenerService', array($event['event'], array($id, $event['method']), $priority));
@@ -55,11 +57,11 @@ class phpbb_di_pass_kernel_pass implements CompilerPassInterface
// We must assume that the class value has been correctly filled, even if the service is created by a factory
$class = $container->getDefinition($id)->getClass();
- $refClass = new ReflectionClass($class);
+ $refClass = new \ReflectionClass($class);
$interface = 'Symfony\Component\EventDispatcher\EventSubscriberInterface';
if (!$refClass->implementsInterface($interface))
{
- throw new InvalidArgumentException(sprintf('Service "%1$s" must implement interface "%2$s".', $id, $interface));
+ throw new \InvalidArgumentException(sprintf('Service "%1$s" must implement interface "%2$s".', $id, $interface));
}
$definition->addMethodCall('addSubscriberService', array($id, $class));
diff --git a/phpBB/phpbb/di/service_collection.php b/phpBB/phpbb/di/service_collection.php
index 880cb46d4d..fccdd77071 100644
--- a/phpBB/phpbb/di/service_collection.php
+++ b/phpBB/phpbb/di/service_collection.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\di;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*
* @package phpBB3
*/
-class phpbb_di_service_collection extends ArrayObject
+class service_collection extends \ArrayObject
{
/**
* Constructor
diff --git a/phpBB/phpbb/error_collector.php b/phpBB/phpbb/error_collector.php
index 0a6462d046..9b3216e32f 100644
--- a/phpBB/phpbb/error_collector.php
+++ b/phpBB/phpbb/error_collector.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_error_collector
+class error_collector
{
var $errors;
diff --git a/phpBB/phpbb/event/data.php b/phpBB/phpbb/event/data.php
index 70718ff0ae..3481023b74 100644
--- a/phpBB/phpbb/event/data.php
+++ b/phpBB/phpbb/event/data.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -17,7 +19,7 @@ if (!defined('IN_PHPBB'))
use Symfony\Component\EventDispatcher\Event;
-class phpbb_event_data extends Event implements ArrayAccess
+class data extends Event implements \ArrayAccess
{
private $data;
diff --git a/phpBB/phpbb/event/dispatcher.php b/phpBB/phpbb/event/dispatcher.php
index 4f637ce3bb..cc3733692e 100644
--- a/phpBB/phpbb/event/dispatcher.php
+++ b/phpBB/phpbb/event/dispatcher.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -31,11 +33,11 @@ use Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher;
* extract($phpbb_dispatcher->trigger_event('core.index', compact($vars)));
*
*/
-class phpbb_event_dispatcher extends ContainerAwareEventDispatcher
+class dispatcher extends ContainerAwareEventDispatcher
{
public function trigger_event($eventName, $data = array())
{
- $event = new phpbb_event_data($data);
+ $event = new \phpbb\event\data($data);
$this->dispatch($eventName, $event);
return $event->get_data_filtered(array_keys($data));
}
diff --git a/phpBB/phpbb/event/extension_subscriber_loader.php b/phpBB/phpbb/event/extension_subscriber_loader.php
index d933b943d7..6bc23be176 100644
--- a/phpBB/phpbb/event/extension_subscriber_loader.php
+++ b/phpBB/phpbb/event/extension_subscriber_loader.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -17,12 +19,12 @@ if (!defined('IN_PHPBB'))
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
-class phpbb_event_extension_subscriber_loader
+class extension_subscriber_loader
{
private $dispatcher;
private $extension_manager;
- public function __construct(EventDispatcherInterface $dispatcher, phpbb_extension_manager $extension_manager)
+ public function __construct(EventDispatcherInterface $dispatcher, \phpbb\extension\manager $extension_manager)
{
$this->dispatcher = $dispatcher;
$this->extension_manager = $extension_manager;
diff --git a/phpBB/phpbb/event/kernel_exception_subscriber.php b/phpBB/phpbb/event/kernel_exception_subscriber.php
index f90989a74c..7199f47ae8 100644
--- a/phpBB/phpbb/event/kernel_exception_subscriber.php
+++ b/phpBB/phpbb/event/kernel_exception_subscriber.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -21,27 +23,27 @@ use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Response;
-class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterface
+class kernel_exception_subscriber implements EventSubscriberInterface
{
/**
* Template object
- * @var phpbb_template
+ * @var \phpbb\template\template
*/
protected $template;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
/**
* Construct method
*
- * @param phpbb_template $template Template object
- * @param phpbb_user $user User object
+ * @param \phpbb\template\template $template Template object
+ * @param \phpbb\user $user User object
*/
- public function __construct(phpbb_template $template, phpbb_user $user)
+ public function __construct(\phpbb\template\template $template, \phpbb\user $user)
{
$this->template = $template;
$this->user = $user;
@@ -53,7 +55,7 @@ class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterfac
* @param GetResponseForExceptionEvent $event
* @return null
*/
- public function on_kernel_exception(GetResponseForExceptionEvent $event)
+ public function on_kernel_exception(\GetResponseForExceptionEvent $event)
{
page_header($this->user->lang('INFORMATION'));
@@ -72,7 +74,7 @@ class phpbb_event_kernel_exception_subscriber implements EventSubscriberInterfac
$status_code = $exception instanceof HttpException ? $exception->getStatusCode() : 500;
- $response = new Response($this->template->assign_display('body'), $status_code);
+ $response = new \Response($this->template->assign_display('body'), $status_code);
$event->setResponse($response);
}
diff --git a/phpBB/phpbb/event/kernel_request_subscriber.php b/phpBB/phpbb/event/kernel_request_subscriber.php
index afb8464f80..9691be7ca5 100644
--- a/phpBB/phpbb/event/kernel_request_subscriber.php
+++ b/phpBB/phpbb/event/kernel_request_subscriber.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -21,11 +23,11 @@ use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\EventListener\RouterListener;
use Symfony\Component\Routing\RequestContext;
-class phpbb_event_kernel_request_subscriber implements EventSubscriberInterface
+class kernel_request_subscriber implements EventSubscriberInterface
{
/**
* Extension finder object
- * @var phpbb_extension_finder
+ * @var \phpbb\extension\finder
*/
protected $finder;
@@ -44,11 +46,11 @@ class phpbb_event_kernel_request_subscriber implements EventSubscriberInterface
/**
* Construct method
*
- * @param phpbb_extension_finder $finder Extension finder object
+ * @param \phpbb\extension\finder $finder Extension finder object
* @param string $root_path Root path
* @param string $php_ext PHP extension
*/
- public function __construct(phpbb_extension_finder $finder, $root_path, $php_ext)
+ public function __construct(\phpbb\extension\finder $finder, $root_path, $php_ext)
{
$this->finder = $finder;
$this->root_path = $root_path;
@@ -63,14 +65,14 @@ class phpbb_event_kernel_request_subscriber implements EventSubscriberInterface
* @param GetResponseEvent $event
* @return null
*/
- public function on_kernel_request(GetResponseEvent $event)
+ public function on_kernel_request(\GetResponseEvent $event)
{
$request = $event->getRequest();
- $context = new RequestContext();
+ $context = new \RequestContext();
$context->fromRequest($request);
$matcher = phpbb_get_url_matcher($this->finder, $context, $this->root_path, $this->php_ext);
- $router_listener = new RouterListener($matcher, $context);
+ $router_listener = new \RouterListener($matcher, $context);
$router_listener->onKernelRequest($event);
}
diff --git a/phpBB/phpbb/event/kernel_terminate_subscriber.php b/phpBB/phpbb/event/kernel_terminate_subscriber.php
index 1eaf890e42..aea9d7cc44 100644
--- a/phpBB/phpbb/event/kernel_terminate_subscriber.php
+++ b/phpBB/phpbb/event/kernel_terminate_subscriber.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\event;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
-class phpbb_event_kernel_terminate_subscriber implements EventSubscriberInterface
+class kernel_terminate_subscriber implements EventSubscriberInterface
{
/**
* This listener is run when the KernelEvents::TERMINATE event is triggered
@@ -29,7 +31,7 @@ class phpbb_event_kernel_terminate_subscriber implements EventSubscriberInterfac
* @param PostResponseEvent $event
* @return null
*/
- public function on_kernel_terminate(PostResponseEvent $event)
+ public function on_kernel_terminate(\PostResponseEvent $event)
{
exit_handler();
}
diff --git a/phpBB/phpbb/extension/base.php b/phpBB/phpbb/extension/base.php
index de18998106..a529cc7961 100644
--- a/phpBB/phpbb/extension/base.php
+++ b/phpBB/phpbb/extension/base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -22,15 +24,15 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*
* @package extension
*/
-class phpbb_extension_base implements phpbb_extension_extension_interface
+class base implements \phpbb\extension\extension_interface
{
/** @var ContainerInterface */
protected $container;
- /** @var phpbb_extension_finder */
+ /** @var \phpbb\extension\finder */
protected $finder;
- /** @var phpbb_db_migrator */
+ /** @var \phpbb\db\migrator */
protected $migrator;
/** @var string */
@@ -43,11 +45,11 @@ class phpbb_extension_base implements phpbb_extension_extension_interface
* Constructor
*
* @param ContainerInterface $container Container object
- * @param phpbb_extension_finder $extension_finder
+ * @param \phpbb\extension\finder $extension_finder
* @param string $extension_name Name of this extension (from ext.manager)
* @param string $extension_path Relative path to this extension
*/
- public function __construct(ContainerInterface $container, phpbb_extension_finder $extension_finder, phpbb_db_migrator $migrator, $extension_name, $extension_path)
+ public function __construct(ContainerInterface $container, \phpbb\extension\finder $extension_finder, \phpbb\db\migrator $migrator, $extension_name, $extension_path)
{
$this->container = $container;
$this->extension_finder = $extension_finder;
diff --git a/phpBB/phpbb/extension/exception.php b/phpBB/phpbb/extension/exception.php
index e08a8912ea..e2ba647878 100644
--- a/phpBB/phpbb/extension/exception.php
+++ b/phpBB/phpbb/extension/exception.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -18,7 +20,7 @@ if (!defined('IN_PHPBB'))
/**
* Exception class for metadata
*/
-class phpbb_extension_exception extends UnexpectedValueException
+class exception extends \UnexpectedValueException
{
public function __toString()
{
diff --git a/phpBB/phpbb/extension/extension_interface.php b/phpBB/phpbb/extension/extension_interface.php
index b922499738..1e5f546dc5 100644
--- a/phpBB/phpbb/extension/extension_interface.php
+++ b/phpBB/phpbb/extension/extension_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package extension
*/
-interface phpbb_extension_extension_interface
+interface extension_interface
{
/**
* enable_step is executed on enabling an extension until it returns false.
diff --git a/phpBB/phpbb/extension/finder.php b/phpBB/phpbb/extension/finder.php
index 1569c90eb8..0ecae7a13f 100644
--- a/phpBB/phpbb/extension/finder.php
+++ b/phpBB/phpbb/extension/finder.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package extension
*/
-class phpbb_extension_finder
+class finder
{
protected $extension_manager;
protected $filesystem;
@@ -50,19 +52,19 @@ class phpbb_extension_finder
protected $cached_queries;
/**
- * Creates a new finder instance with its dependencies
+ * Creates a new \finder instance with its dependencies
*
- * @param phpbb_extension_manager $extension_manager An extension manager
+ * @param \phpbb\extension\manager $extension_manager An extension manager
* instance that provides the finder with a list of active
* extensions and their locations
- * @param phpbb_filesystem $filesystem Filesystem instance
+ * @param \phpbb\filesystem $filesystem Filesystem instance
* @param string $phpbb_root_path Path to the phpbb root directory
- * @param phpbb_cache_driver_driver_interface $cache A cache instance or null
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
* @param string $php_ext php file extension
* @param string $cache_name The name of the cache variable, defaults to
* _ext_finder
*/
- public function __construct(phpbb_extension_manager $extension_manager, phpbb_filesystem $filesystem, $phpbb_root_path = '', phpbb_cache_driver_driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
+ public function __construct(\phpbb\extension\manager $extension_manager, \phpbb\filesystem $filesystem, $phpbb_root_path = '', \phpbb\cache\driver\driver_interface $cache = null, $php_ext = 'php', $cache_name = '_ext_finder')
{
$this->extension_manager = $extension_manager;
$this->filesystem = $filesystem;
@@ -88,7 +90,7 @@ class phpbb_extension_finder
* Sets a core path to be searched in addition to extensions
*
* @param string $core_path The path relative to phpbb_root_path
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function core_path($core_path)
{
@@ -104,7 +106,7 @@ class phpbb_extension_finder
* file extension is automatically added to suffixes.
*
* @param string $suffix A filename suffix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function suffix($suffix)
{
@@ -121,7 +123,7 @@ class phpbb_extension_finder
* file extension is automatically added to suffixes.
*
* @param string $extension_suffix A filename suffix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function extension_suffix($extension_suffix)
{
@@ -137,7 +139,7 @@ class phpbb_extension_finder
* file extension is automatically added to suffixes.
*
* @param string $core_suffix A filename suffix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function core_suffix($core_suffix)
{
@@ -149,7 +151,7 @@ class phpbb_extension_finder
* Sets the prefix all files found in extensions and core must match
*
* @param string $prefix A filename prefix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function prefix($prefix)
{
@@ -162,7 +164,7 @@ class phpbb_extension_finder
* Sets a prefix all files found in extensions must match
*
* @param string $extension_prefix A filename prefix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function extension_prefix($extension_prefix)
{
@@ -174,7 +176,7 @@ class phpbb_extension_finder
* Sets a prefix all files found in the core path must match
*
* @param string $core_prefix A filename prefix
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function core_prefix($core_prefix)
{
@@ -189,7 +191,7 @@ class phpbb_extension_finder
* the current directory.
*
* @param string $directory
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function directory($directory)
{
@@ -202,7 +204,7 @@ class phpbb_extension_finder
* Sets a directory all files found in extensions must be contained in
*
* @param string $extension_directory
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function extension_directory($extension_directory)
{
@@ -214,7 +216,7 @@ class phpbb_extension_finder
* Sets a directory all files found in the core path must be contained in
*
* @param string $core_directory
- * @return phpbb_extension_finder This object for chaining calls
+ * @return \phpbb\extension\finder This object for chaining calls
*/
public function core_directory($core_directory)
{
@@ -473,7 +475,7 @@ class phpbb_extension_finder
}
$directory_pattern = '#' . $directory_pattern . '#';
- $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path), RecursiveIteratorIterator::SELF_FIRST);
+ $iterator = new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($path), \RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
$filename = $file_info->getFilename();
diff --git a/phpBB/phpbb/extension/manager.php b/phpBB/phpbb/extension/manager.php
index f9f722f773..d174146f52 100644
--- a/phpBB/phpbb/extension/manager.php
+++ b/phpBB/phpbb/extension/manager.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
*
* @package extension
*/
-class phpbb_extension_manager
+class manager
{
/** @var ContainerInterface */
protected $container;
@@ -40,16 +42,16 @@ class phpbb_extension_manager
* Creates a manager and loads information from database
*
* @param ContainerInterface $container A container
- * @param phpbb_db_driver $db A database connection
- * @param phpbb_config $config phpbb_config
- * @param phpbb_filesystem $filesystem
+ * @param \phpbb\db\driver\driver $db A database connection
+ * @param \phpbb\config\config $config \phpbb\config\config
+ * @param \phpbb\filesystem $filesystem
* @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_driver_interface $cache A cache instance or null
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
* @param string $cache_name The name of the cache variable, defaults to _ext
*/
- public function __construct(ContainerInterface $container, phpbb_db_driver $db, phpbb_config $config, phpbb_filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', phpbb_cache_driver_driver_interface $cache = null, $cache_name = '_ext')
+ public function __construct(ContainerInterface $container, \phpbb\db\driver\driver $db, \phpbb\config\config $config, \phpbb\filesystem $filesystem, $extension_table, $phpbb_root_path, $php_ext = 'php', \phpbb\cache\driver\driver_interface $cache = null, $cache_name = '_ext')
{
$this->container = $container;
$this->phpbb_root_path = $phpbb_root_path;
@@ -126,8 +128,8 @@ class phpbb_extension_manager
* Instantiates the extension meta class for the extension with the given name
*
* @param string $name The extension name
- * @return phpbb_extension_extension_interface Instance of the extension meta class or
- * phpbb_extension_base if the class does not exist
+ * @return \phpbb\extension\extension_interface Instance of the extension meta class or
+ * \phpbb\extension\base if the class does not exist
*/
public function get_extension($name)
{
@@ -141,7 +143,7 @@ class phpbb_extension_manager
}
else
{
- return new phpbb_extension_base($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
+ return new \phpbb\extension\base($this->container, $this->get_finder(), $migrator, $name, $this->get_extension_path($name, true));
}
}
@@ -150,11 +152,11 @@ class phpbb_extension_manager
*
* @param string $name The extension name
* @param string $template The template manager
- * @return phpbb_extension_metadata_manager Instance of the metadata manager
+ * @return \phpbb\extension\metadata_manager Instance of the metadata manager
*/
- public function create_extension_metadata_manager($name, phpbb_template $template)
+ public function create_extension_metadata_manager($name, \phpbb\template\template $template)
{
- return new phpbb_extension_metadata_manager($name, $this->config, $this, $template, $this->phpbb_root_path);
+ return new \phpbb\extension\metadata_manager($name, $this->config, $this, $template, $this->phpbb_root_path);
}
/**
@@ -403,9 +405,9 @@ class phpbb_extension_manager
return $available;
}
- $iterator = new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', FilesystemIterator::NEW_CURRENT_AND_KEY | FilesystemIterator::FOLLOW_SYMLINKS),
- RecursiveIteratorIterator::SELF_FIRST);
+ $iterator = new \RecursiveIteratorIterator(
+ new \RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/', \FilesystemIterator::NEW_CURRENT_AND_KEY | \FilesystemIterator::FOLLOW_SYMLINKS),
+ \RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
if ($file_info->isFile() && $file_info->getFilename() == 'ext.' . $this->php_ext)
@@ -502,12 +504,12 @@ class phpbb_extension_manager
}
/**
- * Instantiates a phpbb_extension_finder.
+ * Instantiates a \phpbb\extension\finder.
*
- * @return phpbb_extension_finder An extension finder instance
+ * @return \phpbb\extension\finder An extension finder instance
*/
public function get_finder()
{
- return new phpbb_extension_finder($this, $this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
+ return new \phpbb\extension\finder($this, $this->filesystem, $this->phpbb_root_path, $this->cache, $this->php_ext, $this->cache_name . '_finder');
}
}
diff --git a/phpBB/phpbb/extension/metadata_manager.php b/phpBB/phpbb/extension/metadata_manager.php
index 14b77c085b..a77f3a2c6e 100644
--- a/phpBB/phpbb/extension/metadata_manager.php
+++ b/phpBB/phpbb/extension/metadata_manager.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -20,23 +22,23 @@ if (!defined('IN_PHPBB'))
*
* @package extension
*/
-class phpbb_extension_metadata_manager
+class metadata_manager
{
/**
* phpBB Config instance
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* phpBB Extension Manager
- * @var phpbb_extension_manager
+ * @var \phpbb\extension\manager
*/
protected $extension_manager;
/**
* phpBB Template instance
- * @var phpbb_template
+ * @var \phpbb\template\template
*/
protected $template;
@@ -68,12 +70,12 @@ class phpbb_extension_metadata_manager
* Creates the metadata manager
*
* @param string $ext_name Name (including vendor) of the extension
- * @param phpbb_config $config phpBB Config instance
- * @param phpbb_extension_manager $extension_manager An instance of the phpBBb extension manager
- * @param phpbb_template $template phpBB Template instance
+ * @param \phpbb\config\config $config phpBB Config instance
+ * @param \phpbb\extension\manager $extension_manager An instance of the phpBBb extension manager
+ * @param \phpbb\template\template $template phpBB Template instance
* @param string $phpbb_root_path Path to the phpbb includes directory.
*/
- public function __construct($ext_name, phpbb_config $config, phpbb_extension_manager $extension_manager, phpbb_template $template, $phpbb_root_path)
+ public function __construct($ext_name, \phpbb\config\config $config, \phpbb\extension\manager $extension_manager, \phpbb\template\template $template, $phpbb_root_path)
{
$this->config = $config;
$this->extension_manager = $extension_manager;
@@ -145,7 +147,7 @@ class phpbb_extension_metadata_manager
if (!file_exists($this->metadata_file))
{
- throw new phpbb_extension_exception('The required file does not exist: ' . $this->metadata_file);
+ throw new \phpbb\extension\exception('The required file does not exist: ' . $this->metadata_file);
}
}
@@ -158,18 +160,18 @@ class phpbb_extension_metadata_manager
{
if (!file_exists($this->metadata_file))
{
- throw new phpbb_extension_exception('The required file does not exist: ' . $this->metadata_file);
+ throw new \phpbb\extension\exception('The required file does not exist: ' . $this->metadata_file);
}
else
{
if (!($file_contents = file_get_contents($this->metadata_file)))
{
- throw new phpbb_extension_exception('file_get_contents failed on ' . $this->metadata_file);
+ throw new \phpbb\extension\exception('file_get_contents failed on ' . $this->metadata_file);
}
if (($metadata = json_decode($file_contents, true)) === NULL)
{
- throw new phpbb_extension_exception('json_decode failed on ' . $this->metadata_file);
+ throw new \phpbb\extension\exception('json_decode failed on ' . $this->metadata_file);
}
$this->metadata = $metadata;
@@ -228,12 +230,12 @@ class phpbb_extension_metadata_manager
{
if (!isset($this->metadata[$name]))
{
- throw new phpbb_extension_exception("Required meta field '$name' has not been set.");
+ throw new \phpbb\extension\exception("Required meta field '$name' has not been set.");
}
if (!preg_match($fields[$name], $this->metadata[$name]))
{
- throw new phpbb_extension_exception("Meta field '$name' is invalid.");
+ throw new \phpbb\extension\exception("Meta field '$name' is invalid.");
}
}
break;
@@ -251,14 +253,14 @@ class phpbb_extension_metadata_manager
{
if (empty($this->metadata['authors']))
{
- throw new phpbb_extension_exception("Required meta field 'authors' has not been set.");
+ throw new \phpbb\extension\exception("Required meta field 'authors' has not been set.");
}
foreach ($this->metadata['authors'] as $author)
{
if (!isset($author['name']))
{
- throw new phpbb_extension_exception("Required meta field 'author name' has not been set.");
+ throw new \phpbb\extension\exception("Required meta field 'author name' has not been set.");
}
}
diff --git a/phpBB/phpbb/extension/provider.php b/phpBB/phpbb/extension/provider.php
index 45b55e5cab..c2a264d311 100644
--- a/phpBB/phpbb/extension/provider.php
+++ b/phpBB/phpbb/extension/provider.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\extension;
+
/**
* @ignore
*/
@@ -28,7 +30,7 @@ if (!defined('IN_PHPBB'))
*
* @package extension
*/
-abstract class phpbb_extension_provider implements IteratorAggregate
+abstract class provider implements \IteratorAggregate
{
/**
* Array holding all found items
@@ -38,16 +40,16 @@ abstract class phpbb_extension_provider implements IteratorAggregate
/**
* An extension manager to search for items in extensions
- * @var phpbb_extension_manager
+ * @var \phpbb\extension\manager
*/
protected $extension_manager;
/**
* Constructor. Loads all available items.
*
- * @param phpbb_extension_manager $extension_manager phpBB extension manager
+ * @param \phpbb\extension\manager $extension_manager phpBB extension manager
*/
- public function __construct(phpbb_extension_manager $extension_manager)
+ public function __construct(\phpbb\extension\manager $extension_manager)
{
$this->extension_manager = $extension_manager;
}
@@ -71,6 +73,6 @@ abstract class phpbb_extension_provider implements IteratorAggregate
$this->items = $this->find();
}
- return new ArrayIterator($this->items);
+ return new \ArrayIterator($this->items);
}
}
diff --git a/phpBB/phpbb/feed/base.php b/phpBB/phpbb/feed/base.php
index 9a38e604a3..de7dd41df4 100644
--- a/phpBB/phpbb/feed/base.php
+++ b/phpBB/phpbb/feed/base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -20,27 +22,27 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-abstract class phpbb_feed_base
+abstract class base
{
/**
* Feed helper object
- * @var phpbb_feed_helper
+ * @var \phpbb\feed\helper
*/
protected $helper;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $config;
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
- /** @var phpbb_cache_driver_driver_interface */
+ /** @var \phpbb\cache\driver\driver_interface */
protected $cache;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
- /** @var phpbb_auth */
+ /** @var \phpbb\auth\auth */
protected $auth;
/** @var string */
@@ -74,17 +76,17 @@ abstract class phpbb_feed_base
/**
* Constructor
*
- * @param phpbb_feed_helper $helper Feed helper
- * @param phpbb_config $config Config object
- * @param phpbb_db_driver $db Database connection
- * @param phpbb_cache_driver_driver_interface $cache Cache object
- * @param phpbb_user $user User object
- * @param phpbb_auth $auth Auth object
- * @param phpbb_content_visibility $content_visibility Auth object
+ * @param \phpbb\feed\helper $helper Feed helper
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver $db Database connection
+ * @param \phpbb\cache\driver\driver_interface $cache Cache object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\auth\auth $auth Auth object
+ * @param \phpbb\content_visibility $content_visibility Auth object
* @param string $phpEx php file extension
* @return null
*/
- function __construct(phpbb_feed_helper $helper, phpbb_config $config, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, phpbb_user $user, phpbb_auth $auth, phpbb_content_visibility $content_visibility, $phpEx)
+ function __construct(\phpbb\feed\helper $helper, \phpbb\config\config $config, \phpbb\db\driver\driver $db, \phpbb\cache\driver\driver_interface $cache, \phpbb\user $user, \phpbb\auth\auth $auth, \phpbb\content_visibility $content_visibility, $phpEx)
{
$this->config = $config;
$this->helper = $helper;
diff --git a/phpBB/phpbb/feed/factory.php b/phpBB/phpbb/feed/factory.php
index 63a1eb8ef0..e011b0e3a9 100644
--- a/phpBB/phpbb/feed/factory.php
+++ b/phpBB/phpbb/feed/factory.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Factory class to return correct object
* @package phpBB3
*/
-class phpbb_feed_factory
+class factory
{
/**
* Service container object
@@ -27,21 +29,21 @@ class phpbb_feed_factory
*/
protected $container;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $config;
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
/**
* Constructor
*
* @param objec $container Container object
- * @param phpbb_config $config Config object
- * @param phpbb_db_driver $db Database connection
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\db\driver\driver $db Database connection
* @return null
*/
- public function __construct($container, phpbb_config $config, phpbb_db_driver $db)
+ public function __construct($container, \phpbb\config\config $config, \phpbb\db\driver\driver $db)
{
$this->container = $container;
$this->config = $config;
diff --git a/phpBB/phpbb/feed/forum.php b/phpBB/phpbb/feed/forum.php
index b5f0dd0f8f..5f64d85625 100644
--- a/phpBB/phpbb/feed/forum.php
+++ b/phpBB/phpbb/feed/forum.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_forum extends phpbb_feed_post_base
+class forum extends \phpbb\feed\post_base
{
var $forum_id = 0;
var $forum_data = array();
@@ -32,7 +34,7 @@ class phpbb_feed_forum extends phpbb_feed_post_base
* Set the Forum ID
*
* @param int $forum_id Forum ID
- * @return phpbb_feed_forum
+ * @return \phpbb\feed\forum
*/
public function set_forum_id($topic_id)
{
diff --git a/phpBB/phpbb/feed/forums.php b/phpBB/phpbb/feed/forums.php
index 409097a9f3..6be1c68da8 100644
--- a/phpBB/phpbb/feed/forums.php
+++ b/phpBB/phpbb/feed/forums.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_forums extends phpbb_feed_base
+class forums extends \phpbb\feed\base
{
var $num_items = 0;
diff --git a/phpBB/phpbb/feed/helper.php b/phpBB/phpbb/feed/helper.php
index 93330aa2ad..cf8328bd5e 100644
--- a/phpBB/phpbb/feed/helper.php
+++ b/phpBB/phpbb/feed/helper.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -19,12 +21,12 @@ if (!defined('IN_PHPBB'))
* Class with some helpful functions used in feeds
* @package phpBB3
*/
-class phpbb_feed_helper
+class helper
{
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $config;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
/** @var string */
@@ -33,12 +35,12 @@ class phpbb_feed_helper
/**
* Constructor
*
- * @param phpbb_config $config Config object
- * @param phpbb_user $user User object
+ * @param \phpbb\config\config $config Config object
+ * @param \phpbb\user $user User object
* @param string $phpbb_root_path Root path
* @return null
*/
- public function __construct(phpbb_config $config, phpbb_user $user, $phpbb_root_path)
+ public function __construct(\phpbb\config\config $config, \phpbb\user $user, $phpbb_root_path)
{
$this->config = $config;
$this->user = $user;
diff --git a/phpBB/phpbb/feed/news.php b/phpBB/phpbb/feed/news.php
index f2d45b5165..20017a3248 100644
--- a/phpBB/phpbb/feed/news.php
+++ b/phpBB/phpbb/feed/news.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_news extends phpbb_feed_topic_base
+class news extends \phpbb\feed\topic_base
{
function get_news_forums()
{
diff --git a/phpBB/phpbb/feed/overall.php b/phpBB/phpbb/feed/overall.php
index 869df7cde0..7a0973a027 100644
--- a/phpBB/phpbb/feed/overall.php
+++ b/phpBB/phpbb/feed/overall.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_overall extends phpbb_feed_post_base
+class overall extends \phpbb\feed\post_base
{
function get_sql()
{
diff --git a/phpBB/phpbb/feed/post_base.php b/phpBB/phpbb/feed/post_base.php
index 1f4cb4b5ef..5588ecadb0 100644
--- a/phpBB/phpbb/feed/post_base.php
+++ b/phpBB/phpbb/feed/post_base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-abstract class phpbb_feed_post_base extends phpbb_feed_base
+abstract class post_base extends \phpbb\feed\base
{
var $num_items = 'feed_limit_post';
diff --git a/phpBB/phpbb/feed/topic.php b/phpBB/phpbb/feed/topic.php
index 36f958ac60..b5714e434b 100644
--- a/phpBB/phpbb/feed/topic.php
+++ b/phpBB/phpbb/feed/topic.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_topic extends phpbb_feed_post_base
+class topic extends \phpbb\feed\post_base
{
var $topic_id = 0;
var $forum_id = 0;
@@ -32,7 +34,7 @@ class phpbb_feed_topic extends phpbb_feed_post_base
* Set the Topic ID
*
* @param int $topic_id Topic ID
- * @return phpbb_feed_topic
+ * @return \phpbb\feed\topic
*/
public function set_topic_id($topic_id)
{
diff --git a/phpBB/phpbb/feed/topic_base.php b/phpBB/phpbb/feed/topic_base.php
index b104a46631..f05be9223e 100644
--- a/phpBB/phpbb/feed/topic_base.php
+++ b/phpBB/phpbb/feed/topic_base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-abstract class phpbb_feed_topic_base extends phpbb_feed_base
+abstract class topic_base extends \phpbb\feed\base
{
var $num_items = 'feed_limit_topic';
diff --git a/phpBB/phpbb/feed/topics.php b/phpBB/phpbb/feed/topics.php
index 31f5177773..d70195c87b 100644
--- a/phpBB/phpbb/feed/topics.php
+++ b/phpBB/phpbb/feed/topics.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_topics extends phpbb_feed_topic_base
+class topics extends \phpbb\feed\topic_base
{
function get_sql()
{
diff --git a/phpBB/phpbb/feed/topics_active.php b/phpBB/phpbb/feed/topics_active.php
index 249dd1d66a..c6f46d67e6 100644
--- a/phpBB/phpbb/feed/topics_active.php
+++ b/phpBB/phpbb/feed/topics_active.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\feed;
+
/**
* @ignore
*/
@@ -24,7 +26,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_feed_topics_active extends phpbb_feed_topic_base
+class topics_active extends \phpbb\feed\topic_base
{
var $sort_days = 7;
diff --git a/phpBB/phpbb/filesystem.php b/phpBB/phpbb/filesystem.php
index 27cab48fb0..827e9fb139 100644
--- a/phpBB/phpbb/filesystem.php
+++ b/phpBB/phpbb/filesystem.php
@@ -6,6 +6,8 @@
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/
+
+namespace phpbb;
/**
* @ignore
*/
@@ -18,7 +20,7 @@ if (!defined('IN_PHPBB'))
* A class with various functions that are related to paths, files and the filesystem
* @package phpBB3
*/
-class phpbb_filesystem
+class filesystem
{
/**
* Eliminates useless . and .. components from specified path.
diff --git a/phpBB/phpbb/groupposition/exception.php b/phpBB/phpbb/groupposition/exception.php
index e4ff09c703..3a8d92dbc7 100644
--- a/phpBB/phpbb/groupposition/exception.php
+++ b/phpBB/phpbb/groupposition/exception.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\groupposition;
+
/**
* @ignore
*/
@@ -18,6 +20,6 @@ if (!defined('IN_PHPBB'))
/**
* @package groupposition
*/
-class phpbb_groupposition_exception extends \Exception
+class exception extends \Exception
{
}
diff --git a/phpBB/phpbb/groupposition/groupposition_interface.php b/phpBB/phpbb/groupposition/groupposition_interface.php
index 0f29984588..a568785185 100644
--- a/phpBB/phpbb/groupposition/groupposition_interface.php
+++ b/phpBB/phpbb/groupposition/groupposition_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\groupposition;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-interface phpbb_groupposition_groupposition_interface
+interface groupposition_interface
{
/**
* Returns the value for a given group, if the group exists.
diff --git a/phpBB/phpbb/groupposition/legend.php b/phpBB/phpbb/groupposition/legend.php
index 5cbc26f528..9a1ef3d1d0 100644
--- a/phpBB/phpbb/groupposition/legend.php
+++ b/phpBB/phpbb/groupposition/legend.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\groupposition;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_groupposition_legend implements phpbb_groupposition_groupposition_interface
+class legend implements \phpbb\groupposition\groupposition_interface
{
/**
* Group is not displayed
@@ -32,23 +34,23 @@ class phpbb_groupposition_legend implements phpbb_groupposition_groupposition_in
/**
* Database object
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
/**
* Constructor
*
- * @param phpbb_db_driver $db Database object
- * @param phpbb_user $user User object
+ * @param \phpbb\db\driver\driver $db Database object
+ * @param \phpbb\user $user User object
*/
- public function __construct(phpbb_db_driver $db, phpbb_user $user)
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\user $user)
{
$this->db = $db;
$this->user = $user;
@@ -71,7 +73,7 @@ class phpbb_groupposition_legend implements phpbb_groupposition_groupposition_in
if ($current_value === false)
{
// Group not found.
- throw new phpbb_groupposition_exception('NO_GROUP');
+ throw new \phpbb\groupposition\exception('NO_GROUP');
}
return (int) $current_value;
diff --git a/phpBB/phpbb/groupposition/teampage.php b/phpBB/phpbb/groupposition/teampage.php
index 6a0601da63..4cd2ae7fa8 100644
--- a/phpBB/phpbb/groupposition/teampage.php
+++ b/phpBB/phpbb/groupposition/teampage.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\groupposition;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_interface
+class teampage implements \phpbb\groupposition\groupposition_interface
{
/**
* Group is not displayed
@@ -36,30 +38,30 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
/**
* Database object
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
/**
* Cache object
- * @var phpbb_cache_driver_driver_interface
+ * @var \phpbb\cache\driver\driver_interface
*/
protected $cache;
/**
* Constructor
*
- * @param phpbb_db_driver $db Database object
- * @param phpbb_user $user User object
- * @param phpbb_cache_driver_driver_interface $cache Cache object
+ * @param \phpbb\db\driver\driver $db Database object
+ * @param \phpbb\user $user User object
+ * @param \phpbb\cache\driver\driver_interface $cache Cache object
*/
- public function __construct(phpbb_db_driver $db, phpbb_user $user, phpbb_cache_driver_driver_interface $cache)
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\user $user, \phpbb\cache\driver\driver_interface $cache)
{
$this->db = $db;
$this->user = $user;
@@ -86,7 +88,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
if ($row === false)
{
// Group not found.
- throw new phpbb_groupposition_exception('NO_GROUP');
+ throw new \phpbb\groupposition\exception('NO_GROUP');
}
return (int) $row['teampage_position'];
@@ -113,7 +115,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
if ($row === false)
{
// Group not found.
- throw new phpbb_groupposition_exception('NO_GROUP');
+ throw new \phpbb\groupposition\exception('NO_GROUP');
}
return $row;
@@ -137,7 +139,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
if ($current_value === false)
{
// Group not found.
- throw new phpbb_groupposition_exception('NO_GROUP');
+ throw new \phpbb\groupposition\exception('NO_GROUP');
}
return (int) $current_value;
@@ -161,7 +163,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
if ($row === false)
{
// Group not found.
- throw new phpbb_groupposition_exception('NO_GROUP');
+ throw new \phpbb\groupposition\exception('NO_GROUP');
}
return $row;
@@ -261,7 +263,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
}
/**
- * Adds a new category
+ * Adds a new \category
*
* @param string $category_name Name of the category to be added
* @return bool True if the category was added successfully
@@ -431,7 +433,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
$sibling_count = 0;
$sibling_limit = $delta;
- // Reset the delta, as we recalculate the new real delta
+ // Reset the delta, as we recalculate the new \real delta
$delta = 0;
while ($row = $this->db->sql_fetchrow($result))
{
@@ -519,7 +521,7 @@ class phpbb_groupposition_teampage implements phpbb_groupposition_groupposition_
$sibling_count = 0;
$sibling_limit = $delta;
- // Reset the delta, as we recalculate the new real delta
+ // Reset the delta, as we recalculate the new \real delta
$delta = 0;
while ($row = $this->db->sql_fetchrow($result))
{
diff --git a/phpBB/phpbb/hook/finder.php b/phpBB/phpbb/hook/finder.php
index 3f9758211d..7783efd0c7 100644
--- a/phpBB/phpbb/hook/finder.php
+++ b/phpBB/phpbb/hook/finder.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\hook;
+
/**
* @ignore
*/
@@ -20,20 +22,20 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_hook_finder
+class finder
{
protected $phpbb_root_path;
protected $cache;
protected $php_ext;
/**
- * Creates a new finder instance.
+ * Creates a new \finder instance.
*
* @param string $phpbb_root_path Path to the phpbb root directory
* @param string $php_ext php file extension
- * @param phpbb_cache_driver_driver_interface $cache A cache instance or null
+ * @param \phpbb\cache\driver\driver_interface $cache A cache instance or null
*/
- public function __construct($phpbb_root_path, $php_ext, phpbb_cache_driver_driver_interface $cache = null)
+ public function __construct($phpbb_root_path, $php_ext, \phpbb\cache\driver\driver_interface $cache = null)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->cache = $cache;
diff --git a/phpBB/phpbb/json_response.php b/phpBB/phpbb/json_response.php
index 5dd904da09..fe532fc9d4 100644
--- a/phpBB/phpbb/json_response.php
+++ b/phpBB/phpbb/json_response.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* JSON class
* @package phpBB3
*/
-class phpbb_json_response
+class json_response
{
/**
* Send the data to the client and exit the script.
diff --git a/phpBB/phpbb/lock/db.php b/phpBB/phpbb/lock/db.php
index 5cc0821aa0..3e15727c12 100644
--- a/phpBB/phpbb/lock/db.php
+++ b/phpBB/phpbb/lock/db.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\lock;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Database locking class
* @package phpBB3
*/
-class phpbb_lock_db
+class db
{
/**
* Name of the config variable this lock uses
@@ -42,13 +44,13 @@ class phpbb_lock_db
/**
* The phpBB configuration
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
private $config;
/**
* A database connection
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
private $db;
@@ -59,9 +61,9 @@ class phpbb_lock_db
*
* @param string $config_name A config variable to be used for locking
* @param array $config The phpBB configuration
- * @param phpbb_db_driver $db A database connection
+ * @param \phpbb\db\driver\driver $db A database connection
*/
- public function __construct($config_name, phpbb_config $config, phpbb_db_driver $db)
+ public function __construct($config_name, \phpbb\config\config $config, \phpbb\db\driver\driver $db)
{
$this->config_name = $config_name;
$this->config = $config;
diff --git a/phpBB/phpbb/lock/flock.php b/phpBB/phpbb/lock/flock.php
index 17de0847c0..2a36a853ee 100644
--- a/phpBB/phpbb/lock/flock.php
+++ b/phpBB/phpbb/lock/flock.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\lock;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* File locking class
* @package phpBB3
*/
-class phpbb_lock_flock
+class flock
{
/**
* Path to the file to which access is controlled
diff --git a/phpBB/phpbb/log/log.php b/phpBB/phpbb/log/log.php
index 0a755b5c78..7f4e52ed39 100644
--- a/phpBB/phpbb/log/log.php
+++ b/phpBB/phpbb/log/log.php
@@ -1,12 +1,14 @@
set_is_admin((defined('ADMIN_START') && ADMIN_START) || (defined('IN_ADMIN') && IN_ADMIN));
$this->enable();
diff --git a/phpBB/phpbb/log/log_interface.php b/phpBB/phpbb/log/log_interface.php
index 2d41c9994f..427d30015d 100644
--- a/phpBB/phpbb/log/log_interface.php
+++ b/phpBB/phpbb/log/log_interface.php
@@ -1,12 +1,14 @@
notification_types = $notification_types;
$this->notification_methods = $notification_methods;
@@ -377,8 +379,8 @@ class phpbb_notification_manager
// Never send notifications to the anonymous user!
unset($notify_users[ANONYMOUS]);
- // Make sure not to send new notifications to users who've already been notified about this item
- // This may happen when an item was added, but now new users are able to see the item
+ // Make sure not to send new \notifications to users who've already been notified about this item
+ // This may happen when an item was added, but now new \users are able to see the item
$sql = 'SELECT n.user_id
FROM ' . $this->notifications_table . ' n, ' . $this->notification_types_table . ' nt
WHERE n.notification_type_id = ' . (int) $notification_type_id . '
@@ -402,7 +404,7 @@ class phpbb_notification_manager
$pre_create_data = $notification->pre_create_insert_array($data, $notify_users);
unset($notification);
- $insert_buffer = new phpbb_db_sql_insert_buffer($this->db, $this->notifications_table);
+ $insert_buffer = new \phpbb\db\sql_insert_buffer($this->db, $this->notifications_table);
// Go through each user so we can insert a row in the DB and then notify them by their desired means
foreach ($notify_users as $user => $methods)
@@ -525,7 +527,7 @@ class phpbb_notification_manager
{
$type = $this->get_item_type_class($type_name);
- if ($type instanceof phpbb_notification_type_type_interface && $type->is_available())
+ if ($type instanceof \phpbb\notification\type\type_interface && $type->is_available())
{
$options = array_merge(array(
'id' => $type->get_type(),
@@ -561,7 +563,7 @@ class phpbb_notification_manager
{
$method = $this->get_method_class($method_name);
- if ($method instanceof phpbb_notification_method_method_interface && $method->is_available())
+ if ($method instanceof \phpbb\notification\method\method_interface && $method->is_available())
{
$subscription_methods[$method_name] = array(
'id' => $method->get_type(),
@@ -873,7 +875,7 @@ class phpbb_notification_manager
{
if (!isset($this->notification_types[$notification_type_name]) && !isset($this->notification_types['notification.type.' . $notification_type_name]))
{
- throw new phpbb_notification_exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
+ throw new \phpbb\notification\exception($this->user->lang('NOTIFICATION_TYPE_NOT_EXIST', $notification_type_name));
}
$sql = 'INSERT INTO ' . $this->notification_types_table . ' ' . $this->db->sql_build_array('INSERT', array(
diff --git a/phpBB/phpbb/notification/method/base.php b/phpBB/phpbb/notification/method/base.php
index fbff75b59f..327f964424 100644
--- a/phpBB/phpbb/notification/method/base.php
+++ b/phpBB/phpbb/notification/method/base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\method;
+
/**
* @ignore
*/
@@ -19,33 +21,33 @@ if (!defined('IN_PHPBB'))
* Base notifications method class
* @package notifications
*/
-abstract class phpbb_notification_method_base implements phpbb_notification_method_method_interface
+abstract class base implements \phpbb\notification\method\method_interface
{
- /** @var phpbb_notification_manager */
+ /** @var \phpbb\notification\manager */
protected $notification_manager;
- /** @var phpbb_user_loader */
+ /** @var \phpbb\user_loader */
protected $user_loader;
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
- /** @var phpbb_cache_driver_driver_interface */
+ /** @var \phpbb\cache\driver\driver_interface */
protected $cache;
- /** @var phpbb_template */
+ /** @var \phpbb\template\template */
protected $template;
- /** @var phpbb_extension_manager */
+ /** @var \phpbb\extension\manager */
protected $extension_manager;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
- /** @var phpbb_auth */
+ /** @var \phpbb\auth\auth */
protected $auth;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $config;
/** @var string */
@@ -64,17 +66,17 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
/**
* Notification Method Base Constructor
*
- * @param phpbb_user_loader $user_loader
- * @param phpbb_db_driver $db
- * @param phpbb_cache_driver_driver_interface $cache
- * @param phpbb_user $user
- * @param phpbb_auth $auth
- * @param phpbb_config $config
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\db\driver\driver $db
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\user $user
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
* @param string $phpbb_root_path
* @param string $php_ext
- * @return phpbb_notification_method_base
+ * @return \phpbb\notification\method\base
*/
- public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext)
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext)
{
$this->user_loader = $user_loader;
$this->db = $db;
@@ -89,9 +91,9 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
/**
* Set notification manager (required)
*
- * @param phpbb_notification_manager $notification_manager
+ * @param \phpbb\notification\manager $notification_manager
*/
- public function set_notification_manager(phpbb_notification_manager $notification_manager)
+ public function set_notification_manager(\phpbb\notification\manager $notification_manager)
{
$this->notification_manager = $notification_manager;
}
@@ -99,9 +101,9 @@ abstract class phpbb_notification_method_base implements phpbb_notification_meth
/**
* Add a notification to the queue
*
- * @param phpbb_notification_type_type_interface $notification
+ * @param \phpbb\notification\type\type_interface $notification
*/
- public function add_to_queue(phpbb_notification_type_type_interface $notification)
+ public function add_to_queue(\phpbb\notification\type\type_interface $notification)
{
$this->queue[] = $notification;
}
diff --git a/phpBB/phpbb/notification/method/email.php b/phpBB/phpbb/notification/method/email.php
index 571b0ec656..b761eb5a28 100644
--- a/phpBB/phpbb/notification/method/email.php
+++ b/phpBB/phpbb/notification/method/email.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\method;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_method_email extends phpbb_notification_method_messenger_base
+class email extends \phpbb\notification\method\messenger_base
{
/**
* Get notification method name
diff --git a/phpBB/phpbb/notification/method/jabber.php b/phpBB/phpbb/notification/method/jabber.php
index d3b756d020..6ec21bb735 100644
--- a/phpBB/phpbb/notification/method/jabber.php
+++ b/phpBB/phpbb/notification/method/jabber.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\method;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_method_jabber extends phpbb_notification_method_messenger_base
+class jabber extends \phpbb\notification\method\messenger_base
{
/**
* Get notification method name
diff --git a/phpBB/phpbb/notification/method/messenger_base.php b/phpBB/phpbb/notification/method/messenger_base.php
index 4966aa94bc..b1b30f29b7 100644
--- a/phpBB/phpbb/notification/method/messenger_base.php
+++ b/phpBB/phpbb/notification/method/messenger_base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\method;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-abstract class phpbb_notification_method_messenger_base extends phpbb_notification_method_base
+abstract class messenger_base extends \phpbb\notification\method\base
{
/**
* Notify using phpBB messenger
@@ -60,7 +62,7 @@ abstract class phpbb_notification_method_messenger_base extends phpbb_notificati
{
include($this->phpbb_root_path . 'includes/functions_messenger.' . $this->php_ext);
}
- $messenger = new messenger();
+ $messenger = new \messenger();
$board_url = generate_board_url();
// Time to go through the queue and send emails
diff --git a/phpBB/phpbb/notification/method/method_interface.php b/phpBB/phpbb/notification/method/method_interface.php
index bd21d924e4..0131a8bde0 100644
--- a/phpBB/phpbb/notification/method/method_interface.php
+++ b/phpBB/phpbb/notification/method/method_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\method;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Base notifications method interface
* @package notifications
*/
-interface phpbb_notification_method_method_interface
+interface method_interface
{
/**
* Get notification method name
@@ -37,9 +39,9 @@ interface phpbb_notification_method_method_interface
/**
* Add a notification to the queue
*
- * @param phpbb_notification_type_type_interface $notification
+ * @param \phpbb\notification\type\type_interface $notification
*/
- public function add_to_queue(phpbb_notification_type_type_interface $notification);
+ public function add_to_queue(\phpbb\notification\type\type_interface $notification);
/**
* Parse the queue and notify the users
diff --git a/phpBB/phpbb/notification/type/approve_post.php b/phpBB/phpbb/notification/type/approve_post.php
index 1a30781c35..cf4ec57989 100644
--- a/phpBB/phpbb/notification/type/approve_post.php
+++ b/phpBB/phpbb/notification/type/approve_post.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_approve_post extends phpbb_notification_type_post
+class approve_post extends \phpbb\notification\type\post
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/approve_topic.php b/phpBB/phpbb/notification/type/approve_topic.php
index e728e9ac30..ca5bb67754 100644
--- a/phpBB/phpbb/notification/type/approve_topic.php
+++ b/phpBB/phpbb/notification/type/approve_topic.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_approve_topic extends phpbb_notification_type_topic
+class approve_topic extends \phpbb\notification\type\topic
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/base.php b/phpBB/phpbb/notification/type/base.php
index a7434fc9a7..1605f59c55 100644
--- a/phpBB/phpbb/notification/type/base.php
+++ b/phpBB/phpbb/notification/type/base.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -19,30 +21,30 @@ if (!defined('IN_PHPBB'))
* Base notifications class
* @package notifications
*/
-abstract class phpbb_notification_type_base implements phpbb_notification_type_type_interface
+abstract class base implements \phpbb\notification\type\type_interface
{
- /** @var phpbb_notification_manager */
+ /** @var \phpbb\notification\manager */
protected $notification_manager;
- /** @var phpbb_user_loader */
+ /** @var \phpbb\user_loader */
protected $user_loader;
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
- /** @var phpbb_cache_driver_driver_interface */
+ /** @var \phpbb\cache\driver\driver_interface */
protected $cache;
- /** @var phpbb_template */
+ /** @var \phpbb\template\template */
protected $template;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
- /** @var phpbb_auth */
+ /** @var \phpbb\auth\auth */
protected $auth;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $config;
/** @var string */
@@ -94,20 +96,20 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_t
/**
* Notification Type Base Constructor
*
- * @param phpbb_user_loader $user_loader
- * @param phpbb_db_driver $db
- * @param phpbb_cache_driver_driver_interface $cache
- * @param phpbb_user $user
- * @param phpbb_auth $auth
- * @param phpbb_config $config
+ * @param \phpbb\user_loader $user_loader
+ * @param \phpbb\db\driver\driver $db
+ * @param \phpbb\cache\driver\driver_interface $cache
+ * @param \phpbb\user $user
+ * @param \phpbb\auth\auth $auth
+ * @param \phpbb\config\config $config
* @param string $phpbb_root_path
* @param string $php_ext
* @param string $notification_types_table
* @param string $notifications_table
* @param string $user_notifications_table
- * @return phpbb_notification_type_base
+ * @return \phpbb\notification\type\base
*/
- public function __construct(phpbb_user_loader $user_loader, phpbb_db_driver $db, phpbb_cache_driver_driver_interface $cache, $user, phpbb_auth $auth, phpbb_config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
+ public function __construct(\phpbb\user_loader $user_loader, \phpbb\db\driver\driver $db, \phpbb\cache\driver\driver_interface $cache, $user, \phpbb\auth\auth $auth, \phpbb\config\config $config, $phpbb_root_path, $php_ext, $notification_types_table, $notifications_table, $user_notifications_table)
{
$this->user_loader = $user_loader;
$this->db = $db;
@@ -127,9 +129,9 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_t
/**
* Set notification manager (required)
*
- * @param phpbb_notification_manager $notification_manager
+ * @param \phpbb\notification\manager $notification_manager
*/
- public function set_notification_manager(phpbb_notification_manager $notification_manager)
+ public function set_notification_manager(\phpbb\notification\manager $notification_manager)
{
$this->notification_manager = $notification_manager;
@@ -143,7 +145,7 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_t
*/
public function set_initial_data($data = array())
{
- // The row from the database (unless this is a new notification we're going to add)
+ // The row from the database (unless this is a new \notification we're going to add)
$this->data = $data;
$this->data['notification_data'] = (isset($this->data['notification_data'])) ? unserialize($this->data['notification_data']) : array();
}
@@ -220,9 +222,9 @@ abstract class phpbb_notification_type_base implements phpbb_notification_type_t
{
// Defaults
$this->data = array_merge(array(
- 'item_id' => static::get_item_id($type_data),
+ 'item_id' => \static::get_item_id($type_data),
'notification_type_id' => $this->notification_type_id,
- 'item_parent_id' => static::get_item_parent_id($type_data),
+ 'item_parent_id' => \static::get_item_parent_id($type_data),
'notification_time' => time(),
'notification_read' => false,
diff --git a/phpBB/phpbb/notification/type/bookmark.php b/phpBB/phpbb/notification/type/bookmark.php
index ae2e75d3eb..5b021eb71a 100644
--- a/phpBB/phpbb/notification/type/bookmark.php
+++ b/phpBB/phpbb/notification/type/bookmark.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_bookmark extends phpbb_notification_type_post
+class bookmark extends \phpbb\notification\type\post
{
/**
* Get notification type name
@@ -112,7 +114,7 @@ class phpbb_notification_type_bookmark extends phpbb_notification_type_post
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
{
- // Do not create a new notification
+ // Do not create a new \notification
unset($notify_users[$row['user_id']]);
$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
diff --git a/phpBB/phpbb/notification/type/disapprove_post.php b/phpBB/phpbb/notification/type/disapprove_post.php
index 951c7e0254..0c9162ec5c 100644
--- a/phpBB/phpbb/notification/type/disapprove_post.php
+++ b/phpBB/phpbb/notification/type/disapprove_post.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_disapprove_post extends phpbb_notification_type_approve_post
+class disapprove_post extends \phpbb\notification\type\approve_post
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/disapprove_topic.php b/phpBB/phpbb/notification/type/disapprove_topic.php
index 038e528797..dde6f83ec4 100644
--- a/phpBB/phpbb/notification/type/disapprove_topic.php
+++ b/phpBB/phpbb/notification/type/disapprove_topic.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_disapprove_topic extends phpbb_notification_type_approve_topic
+class disapprove_topic extends \phpbb\notification\type\approve_topic
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/pm.php b/phpBB/phpbb/notification/type/pm.php
index b3db7ad5ad..bed0807b0f 100644
--- a/phpBB/phpbb/notification/type/pm.php
+++ b/phpBB/phpbb/notification/type/pm.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_pm extends phpbb_notification_type_base
+class pm extends \phpbb\notification\type\base
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/post.php b/phpBB/phpbb/notification/type/post.php
index 9207fd866e..24ce0cc145 100644
--- a/phpBB/phpbb/notification/type/post.php
+++ b/phpBB/phpbb/notification/type/post.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_post extends phpbb_notification_type_base
+class post extends \phpbb\notification\type\base
{
/**
* Get notification type name
@@ -147,7 +149,7 @@ class phpbb_notification_type_post extends phpbb_notification_type_base
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
{
- // Do not create a new notification
+ // Do not create a new \notification
unset($notify_users[$row['user_id']]);
$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
diff --git a/phpBB/phpbb/notification/type/post_in_queue.php b/phpBB/phpbb/notification/type/post_in_queue.php
index bc4b15cdc3..f05ed1ce9a 100644
--- a/phpBB/phpbb/notification/type/post_in_queue.php
+++ b/phpBB/phpbb/notification/type/post_in_queue.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_post_in_queue extends phpbb_notification_type_post
+class post_in_queue extends \phpbb\notification\type\post
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/quote.php b/phpBB/phpbb/notification/type/quote.php
index 0ed13f36fb..d59f7caf8e 100644
--- a/phpBB/phpbb/notification/type/quote.php
+++ b/phpBB/phpbb/notification/type/quote.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_quote extends phpbb_notification_type_post
+class quote extends \phpbb\notification\type\post
{
/**
* Get notification type name
@@ -131,7 +133,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post
$result = $this->db->sql_query($sql);
while ($row = $this->db->sql_fetchrow($result))
{
- // Do not create a new notification
+ // Do not create a new \notification
unset($notify_users[$row['user_id']]);
$notification = $this->notification_manager->get_item_type_class($this->get_type(), $row);
@@ -166,7 +168,7 @@ class phpbb_notification_type_quote extends phpbb_notification_type_post
}
$this->db->sql_freeresult($result);
- // Find the new users to notify
+ // Find the new \users to notify
$notifications = $this->find_users_for_notification($post);
// Find the notifications we must delete
diff --git a/phpBB/phpbb/notification/type/report_pm.php b/phpBB/phpbb/notification/type/report_pm.php
index 3fa73bab41..fd3f754f8a 100644
--- a/phpBB/phpbb/notification/type/report_pm.php
+++ b/phpBB/phpbb/notification/type/report_pm.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_report_pm extends phpbb_notification_type_pm
+class report_pm extends \phpbb\notification\type\pm
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/report_pm_closed.php b/phpBB/phpbb/notification/type/report_pm_closed.php
index 63dfa92064..2e4a1ceb30 100644
--- a/phpBB/phpbb/notification/type/report_pm_closed.php
+++ b/phpBB/phpbb/notification/type/report_pm_closed.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_report_pm_closed extends phpbb_notification_type_pm
+class report_pm_closed extends \phpbb\notification\type\pm
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/report_post.php b/phpBB/phpbb/notification/type/report_post.php
index de5c54a291..c2dad6f1bb 100644
--- a/phpBB/phpbb/notification/type/report_post.php
+++ b/phpBB/phpbb/notification/type/report_post.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_report_post extends phpbb_notification_type_post_in_queue
+class report_post extends \phpbb\notification\type\post_in_queue
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/report_post_closed.php b/phpBB/phpbb/notification/type/report_post_closed.php
index 3916cd8db7..270ccf0a1a 100644
--- a/phpBB/phpbb/notification/type/report_post_closed.php
+++ b/phpBB/phpbb/notification/type/report_post_closed.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_report_post_closed extends phpbb_notification_type_post
+class report_post_closed extends \phpbb\notification\type\post
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/topic.php b/phpBB/phpbb/notification/type/topic.php
index 22436d3fb1..9042a21017 100644
--- a/phpBB/phpbb/notification/type/topic.php
+++ b/phpBB/phpbb/notification/type/topic.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -17,11 +19,11 @@ if (!defined('IN_PHPBB'))
/**
* Topic notifications class
-* This class handles notifications for new topics
+* This class handles notifications for new \topics
*
* @package notifications
*/
-class phpbb_notification_type_topic extends phpbb_notification_type_base
+class topic extends \phpbb\notification\type\base
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/topic_in_queue.php b/phpBB/phpbb/notification/type/topic_in_queue.php
index f735e10c00..056651bc53 100644
--- a/phpBB/phpbb/notification/type/topic_in_queue.php
+++ b/phpBB/phpbb/notification/type/topic_in_queue.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -21,7 +23,7 @@ if (!defined('IN_PHPBB'))
*
* @package notifications
*/
-class phpbb_notification_type_topic_in_queue extends phpbb_notification_type_topic
+class topic_in_queue extends \phpbb\notification\type\topic
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/notification/type/type_interface.php b/phpBB/phpbb/notification/type/type_interface.php
index f9c65f7286..cfc6cd461e 100644
--- a/phpBB/phpbb/notification/type/type_interface.php
+++ b/phpBB/phpbb/notification/type/type_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\notification\type;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Base notifications interface
* @package notifications
*/
-interface phpbb_notification_type_type_interface
+interface type_interface
{
/**
* Get notification type name
diff --git a/phpBB/phpbb/php/ini.php b/phpBB/phpbb/php/ini.php
index 17e8c54a57..8767091aba 100644
--- a/phpBB/phpbb/php/ini.php
+++ b/phpBB/phpbb/php/ini.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\php;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB
*/
-class phpbb_php_ini
+class ini
{
/**
* Simple wrapper for ini_get()
diff --git a/phpBB/phpbb/request/deactivated_super_global.php b/phpBB/phpbb/request/deactivated_super_global.php
index 9ca0f462b4..4d4417229e 100644
--- a/phpBB/phpbb/request/deactivated_super_global.php
+++ b/phpBB/phpbb/request/deactivated_super_global.php
@@ -1,12 +1,14 @@
request = $request;
$this->name = $name;
@@ -84,7 +86,7 @@ class phpbb_request_deactivated_super_global implements ArrayAccess, Countable,
}
/**#@+
- * Part of the ArrayAccess implementation, will always result in a FATAL error.
+ * Part of the \ArrayAccess implementation, will always result in a FATAL error.
*/
public function offsetGet($offset)
{
@@ -103,7 +105,7 @@ class phpbb_request_deactivated_super_global implements ArrayAccess, Countable,
/**#@-*/
/**
- * Part of the Countable implementation, will always result in a FATAL error
+ * Part of the \Countable implementation, will always result in a FATAL error
*/
public function count()
{
diff --git a/phpBB/phpbb/request/request.php b/phpBB/phpbb/request/request.php
index 8c5bc12d96..b36ac3711a 100644
--- a/phpBB/phpbb/request/request.php
+++ b/phpBB/phpbb/request/request.php
@@ -1,12 +1,14 @@
'_POST',
- phpbb_request_request_interface::GET => '_GET',
- phpbb_request_request_interface::REQUEST => '_REQUEST',
- phpbb_request_request_interface::COOKIE => '_COOKIE',
- phpbb_request_request_interface::SERVER => '_SERVER',
- phpbb_request_request_interface::FILES => '_FILES',
+ \phpbb\request\request_interface::POST => '_POST',
+ \phpbb\request\request_interface::GET => '_GET',
+ \phpbb\request\request_interface::REQUEST => '_REQUEST',
+ \phpbb\request\request_interface::COOKIE => '_COOKIE',
+ \phpbb\request\request_interface::SERVER => '_SERVER',
+ \phpbb\request\request_interface::FILES => '_FILES',
);
/**
@@ -53,15 +55,15 @@ class phpbb_request implements phpbb_request_request_interface
protected $input;
/**
- * @var phpbb_request_type_cast_helper_interface An instance of a type cast helper providing convenience methods for type conversions.
+ * @var \phpbb\request\type_cast_helper_interface An instance of a type cast helper providing convenience methods for type conversions.
*/
protected $type_cast_helper;
/**
* Initialises the request class, that means it stores all input data in {@link $input input}
- * and then calls {@link phpbb_request_deactivated_super_global phpbb_request_deactivated_super_global}
+ * and then calls {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}
*/
- public function __construct(phpbb_request_type_cast_helper_interface $type_cast_helper = null, $disable_super_globals = true)
+ public function __construct(\phpbb\request\type_cast_helper_interface $type_cast_helper = null, $disable_super_globals = true)
{
if ($type_cast_helper)
{
@@ -69,7 +71,7 @@ class phpbb_request implements phpbb_request_request_interface
}
else
{
- $this->type_cast_helper = new phpbb_request_type_cast_helper();
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
}
foreach ($this->super_globals as $const => $super_global)
@@ -78,8 +80,8 @@ class phpbb_request implements phpbb_request_request_interface
}
// simulate request_order = GP
- $this->original_request = $this->input[phpbb_request_request_interface::REQUEST];
- $this->input[phpbb_request_request_interface::REQUEST] = $this->input[phpbb_request_request_interface::POST] + $this->input[phpbb_request_request_interface::GET];
+ $this->original_request = $this->input[\phpbb\request\request_interface::REQUEST];
+ $this->input[\phpbb\request\request_interface::REQUEST] = $this->input[\phpbb\request\request_interface::POST] + $this->input[\phpbb\request\request_interface::GET];
if ($disable_super_globals)
{
@@ -99,7 +101,7 @@ class phpbb_request implements phpbb_request_request_interface
/**
* Disables access of super globals specified in $super_globals.
- * This is achieved by overwriting the super globals with instances of {@link phpbb_request_deactivated_super_global phpbb_request_deactivated_super_global}
+ * This is achieved by overwriting the super globals with instances of {@link \phpbb\request\deactivated_super_global \phpbb\request\deactivated_super_global}
*/
public function disable_super_globals()
{
@@ -108,7 +110,7 @@ class phpbb_request implements phpbb_request_request_interface
foreach ($this->super_globals as $const => $super_global)
{
unset($GLOBALS[$super_global]);
- $GLOBALS[$super_global] = new phpbb_request_deactivated_super_global($this, $super_global, $const);
+ $GLOBALS[$super_global] = new \phpbb\request\deactivated_super_global($this, $super_global, $const);
}
$this->super_globals_disabled = true;
@@ -144,10 +146,10 @@ class phpbb_request implements phpbb_request_request_interface
* @param string $var_name The name of the variable that shall be overwritten
* @param mixed $value The value which the variable shall contain.
* If this is null the variable will be unset.
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global shall be changed
*/
- public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST)
+ public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{
if (!isset($this->super_globals[$super_global]))
{
@@ -193,13 +195,13 @@ class phpbb_request implements phpbb_request_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
- public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST)
+ public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
{
return $this->_variable($var_name, $default, $multibyte, $super_global, true);
}
@@ -217,13 +219,13 @@ class phpbb_request implements phpbb_request_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
- public function untrimmed_variable($var_name, $default, $multibyte, $super_global = phpbb_request_request_interface::REQUEST)
+ public function untrimmed_variable($var_name, $default, $multibyte, $super_global = \phpbb\request\request_interface::REQUEST)
{
return $this->_variable($var_name, $default, $multibyte, $super_global, false);
}
@@ -234,8 +236,8 @@ class phpbb_request implements phpbb_request_request_interface
* Also fall back to getenv(), some CGI setups may need it (probably not, but
* whatever).
*
- * @param string|array $var_name See phpbb_request_request_interface::variable
- * @param mixed $Default See phpbb_request_request_interface::variable
+ * @param string|array $var_name See \phpbb\request\request_interface::variable
+ * @param mixed $Default See \phpbb\request\request_interface::variable
*
* @return mixed The server variable value.
*/
@@ -243,9 +245,9 @@ class phpbb_request implements phpbb_request_request_interface
{
$multibyte = true;
- if ($this->is_set($var_name, phpbb_request_request_interface::SERVER))
+ if ($this->is_set($var_name, \phpbb\request\request_interface::SERVER))
{
- return $this->variable($var_name, $default, $multibyte, phpbb_request_request_interface::SERVER);
+ return $this->variable($var_name, $default, $multibyte, \phpbb\request\request_interface::SERVER);
}
else
{
@@ -259,7 +261,7 @@ class phpbb_request implements phpbb_request_request_interface
* Shortcut method to retrieve the value of client HTTP headers.
*
* @param string|array $header_name The name of the header to retrieve.
- * @param mixed $default See phpbb_request_request_interface::variable
+ * @param mixed $default See \phpbb\request\request_interface::variable
*
* @return mixed The header value.
*/
@@ -279,7 +281,7 @@ class phpbb_request implements phpbb_request_request_interface
*/
public function file($form_name)
{
- return $this->variable($form_name, array('name' => 'none'), false, phpbb_request_request_interface::FILES);
+ return $this->variable($form_name, array('name' => 'none'), false, \phpbb\request\request_interface::FILES);
}
/**
@@ -294,7 +296,7 @@ class phpbb_request implements phpbb_request_request_interface
*/
public function is_set_post($name)
{
- return $this->is_set($name, phpbb_request_request_interface::POST);
+ return $this->is_set($name, \phpbb\request\request_interface::POST);
}
/**
@@ -302,12 +304,12 @@ class phpbb_request implements phpbb_request_request_interface
* arrays.
*
* @param string $var Name of the variable
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies the super global which shall be checked
*
* @return bool True if the variable was sent as input
*/
- public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST)
+ public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->input[$super_global][$var]);
}
@@ -335,13 +337,13 @@ class phpbb_request implements phpbb_request_request_interface
/**
* Returns all variable names for a given super global
*
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* The super global from which names shall be taken
*
* @return array All variable names that are set for the super global.
* Pay attention when using these, they are unsanitised!
*/
- public function variable_names($super_global = phpbb_request_request_interface::REQUEST)
+ public function variable_names($super_global = \phpbb\request\request_interface::REQUEST)
{
if (!isset($this->input[$super_global]))
{
@@ -362,14 +364,14 @@ class phpbb_request implements phpbb_request_request_interface
* This function will always return a value of the same type as the default.
* @param bool $multibyte If $default is a string this paramater has to be true if the variable may contain any UTF-8 characters
* Default is false, causing all bytes outside the ASCII range (0-127) to be replaced with question marks
- * @param phpbb_request_request_interface::POST|GET|REQUEST|COOKIE $super_global
+ * @param \phpbb\request\request_interface::POST|GET|REQUEST|COOKIE $super_global
* Specifies which super global should be used
* @param bool $trim Indicates whether trim() should be applied to string values.
*
* @return mixed The value of $_REQUEST[$var_name] run through {@link set_var set_var} to ensure that the type is the
* the same as that of $default. If the variable is not set $default is returned.
*/
- protected function _variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST, $trim = true)
+ protected function _variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST, $trim = true)
{
$path = false;
diff --git a/phpBB/phpbb/request/request_interface.php b/phpBB/phpbb/request/request_interface.php
index 2c804cd7fd..3281e1ca03 100644
--- a/phpBB/phpbb/request/request_interface.php
+++ b/phpBB/phpbb/request/request_interface.php
@@ -1,12 +1,14 @@
get('_search_results_' . $search_key)))
{
diff --git a/phpBB/phpbb/search/fulltext_mysql.php b/phpBB/phpbb/search/fulltext_mysql.php
index 7dc4da8ffe..8663af5969 100644
--- a/phpBB/phpbb/search/fulltext_mysql.php
+++ b/phpBB/phpbb/search/fulltext_mysql.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
* Fulltext search for MySQL
* @package search
*/
-class phpbb_search_fulltext_mysql extends phpbb_search_base
+class fulltext_mysql extends \phpbb\search\base
{
/**
* Associative array holding index stats
@@ -36,19 +38,19 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
/**
* Config object
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Database connection
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -74,7 +76,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
/**
* Constructor
- * Creates a new phpbb_search_fulltext_mysql, which is used as a search backend
+ * Creates a new \phpbb\search\fulltext_mysql, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -701,7 +703,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
}
/**
- * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
+ * Destroys cached search results, that contained one of the new \words in a post so the results won't be outdated
*
* @param string $mode contains the post mode: edit, post, reply, quote ...
* @param int $post_id contains the post id of the post to index
@@ -712,7 +714,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
*/
public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
{
- // Split old and new post/subject to obtain array of words
+ // Split old and new \post/subject to obtain array of words
$split_text = $this->split_message($message);
$split_title = ($subject) ? $this->split_message($subject) : array();
diff --git a/phpBB/phpbb/search/fulltext_native.php b/phpBB/phpbb/search/fulltext_native.php
index 730c3a6c2d..006b88e07a 100644
--- a/phpBB/phpbb/search/fulltext_native.php
+++ b/phpBB/phpbb/search/fulltext_native.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
* phpBB's own db driven fulltext search, version 2
* @package search
*/
-class phpbb_search_fulltext_native extends phpbb_search_base
+class fulltext_native extends \phpbb\search\base
{
/**
* Associative array holding index stats
@@ -80,19 +82,19 @@ class phpbb_search_fulltext_native extends phpbb_search_base
/**
* Config object
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Database connection
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -1222,7 +1224,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
return;
}
- // Split old and new post/subject to obtain array of 'words'
+ // Split old and new \post/subject to obtain array of 'words'
$split_text = $this->split_message($message);
$split_title = $this->split_message($subject);
@@ -1269,7 +1271,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
// We now have unique arrays of all words to be added and removed and
// individual arrays of added and removed words for text and title. What
- // we need to do now is add the new words (if they don't already exist)
+ // we need to do now is add the new \words (if they don't already exist)
// and then add (or remove) matches between the words and this post
if (sizeof($unique_add_words))
{
@@ -1306,7 +1308,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$this->db->sql_transaction('begin');
}
- // now update the search match table, remove links to removed words and add links to new words
+ // now update the search match table, remove links to removed words and add links to new \words
foreach ($words['del'] as $word_in => $word_ary)
{
$title_match = ($word_in == 'title') ? 1 : 0;
@@ -1466,7 +1468,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
WHERE ' . $this->db->sql_in_set('word_id', $sql_in);
$this->db->sql_query($sql);
- // by setting search_last_gc to the new time here we make sure that if a user reloads because the
+ // by setting search_last_gc to the new \time here we make sure that if a user reloads because the
// following query takes too long, he won't run into it again
set_config('search_last_gc', time(), true);
@@ -1556,7 +1558,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $encoding Text encoding
* @return string Cleaned up text, only alphanumeric chars are left
*
- * @todo normalizer::cleanup being able to be used?
+ * @todo \normalizer::cleanup being able to be used?
*/
protected function cleanup($text, $allowed_chars = null, $encoding = 'utf-8')
{
@@ -1588,7 +1590,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* If we use it more widely, an instance of that class should be held in a
* a global variable instead
*/
- utf_normalizer::nfc($text);
+ \utf_normalizer::nfc($text);
/**
* The first thing we do is:
diff --git a/phpBB/phpbb/search/fulltext_postgres.php b/phpBB/phpbb/search/fulltext_postgres.php
index 6b4b310f2e..ba9215fcfd 100644
--- a/phpBB/phpbb/search/fulltext_postgres.php
+++ b/phpBB/phpbb/search/fulltext_postgres.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
* Fulltext search for PostgreSQL
* @package search
*/
-class phpbb_search_fulltext_postgres extends phpbb_search_base
+class fulltext_postgres extends \phpbb\search\base
{
/**
* Associative array holding index stats
@@ -61,19 +63,19 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
/**
* Config object
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Database connection
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -99,7 +101,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
/**
* Constructor
- * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend
+ * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -731,7 +733,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
/**
- * Destroys cached search results, that contained one of the new words in a post so the results won't be outdated
+ * Destroys cached search results, that contained one of the new \words in a post so the results won't be outdated
*
* @param string $mode contains the post mode: edit, post, reply, quote ...
* @param int $post_id contains the post id of the post to index
@@ -742,7 +744,7 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
*/
public function index($mode, $post_id, &$message, &$subject, $poster_id, $forum_id)
{
- // Split old and new post/subject to obtain array of words
+ // Split old and new \post/subject to obtain array of words
$split_text = $this->split_message($message);
$split_title = ($subject) ? $this->split_message($subject) : array();
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 4f3f852664..81cb31e6e2 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search;
+
/**
*/
if (!defined('IN_PHPBB'))
@@ -26,7 +28,7 @@ define('SPHINX_CONNECT_WAIT_TIME', 300);
* Fulltext search based on the sphinx search deamon
* @package search
*/
-class phpbb_search_fulltext_sphinx
+class fulltext_sphinx
{
/**
* Associative array holding index stats
@@ -73,25 +75,25 @@ class phpbb_search_fulltext_sphinx
/**
* Auth object
- * @var phpbb_auth
+ * @var \phpbb\auth\auth
*/
protected $auth;
/**
* Config object
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Database connection
- * @var phpbb_db_driver
+ * @var \phpbb\db\driver\driver
*/
protected $db;
/**
* Database Tools object
- * @var phpbb_db_tools
+ * @var \phpbb\db\tools
*/
protected $db_tools;
@@ -103,7 +105,7 @@ class phpbb_search_fulltext_sphinx
/**
* User object
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
@@ -122,7 +124,7 @@ class phpbb_search_fulltext_sphinx
/**
* Constructor
- * Creates a new phpbb_search_fulltext_postgres, which is used as a search backend
+ * Creates a new \phpbb\search\fulltext_postgres, which is used as a search backend
*
* @param string|bool $error Any error that occurs is passed on through this reference variable otherwise false
*/
@@ -135,8 +137,8 @@ class phpbb_search_fulltext_sphinx
$this->db = $db;
$this->auth = $auth;
- // Initialize phpbb_db_tools object
- $this->db_tools = new phpbb_db_tools($this->db);
+ // Initialize \phpbb\db\tools object
+ $this->db_tools = new \phpbb\db\tools($this->db);
if(!$this->config['fulltext_sphinx_id'])
{
@@ -151,7 +153,7 @@ class phpbb_search_fulltext_sphinx
}
// Initialize sphinx client
- $this->sphinx = new SphinxClient();
+ $this->sphinx = new \SphinxClient();
$this->sphinx->SetServer(($this->config['fulltext_sphinx_host'] ? $this->config['fulltext_sphinx_host'] : 'localhost'), ($this->config['fulltext_sphinx_port'] ? (int) $this->config['fulltext_sphinx_port'] : 9312));
@@ -250,7 +252,7 @@ class phpbb_search_fulltext_sphinx
/* Now that we're sure everything was entered correctly,
generate a config for the index. We use a config value
fulltext_sphinx_id for this, as it should be unique. */
- $config_object = new phpbb_search_sphinx_config($this->config_file_data);
+ $config_object = new \phpbb\search\sphinx\config($this->config_file_data);
$config_data = array(
'source source_phpbb_' . $this->id . '_main' => array(
array('type', $this->dbtype . ' # mysql or pgsql'),
@@ -420,7 +422,7 @@ class phpbb_search_fulltext_sphinx
$this->sphinx->SetMatchMode(SPH_MATCH_ANY);
}
- // Keep quotes and new lines
+ // Keep quotes and new \lines
$keywords = str_replace(array('"', "\n"), array('"', ' '), trim($keywords));
if (strlen($keywords) > 0)
diff --git a/phpBB/phpbb/search/sphinx/config.php b/phpBB/phpbb/search/sphinx/config.php
index f1864f0c8c..2468022428 100644
--- a/phpBB/phpbb/search/sphinx/config.php
+++ b/phpBB/phpbb/search/sphinx/config.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config
+* \phpbb\search\sphinx\config
* An object representing the sphinx configuration
* Can read it from file and write it back out after modification
* @package search
*/
-class phpbb_search_sphinx_config
+class config
{
private $sections = array();
@@ -44,7 +46,7 @@ class phpbb_search_sphinx_config
* Get a section object by its name
*
* @param string $name The name of the section that shall be returned
- * @return phpbb_search_sphinx_config_section The section object or null if none was found
+ * @return \phpbb\search\sphinx\config_section The section object or null if none was found
*
* @access public
*/
@@ -53,7 +55,7 @@ class phpbb_search_sphinx_config
for ($i = 0, $size = sizeof($this->sections); $i < $size; $i++)
{
// Make sure this is really a section object and not a comment
- if (($this->sections[$i] instanceof phpbb_search_sphinx_config_section) && $this->sections[$i]->get_name() == $name)
+ if (($this->sections[$i] instanceof \phpbb\search\sphinx\config_section) && $this->sections[$i]->get_name() == $name)
{
return $this->sections[$i];
}
@@ -61,16 +63,16 @@ class phpbb_search_sphinx_config
}
/**
- * Appends a new empty section to the end of the config
+ * Appends a new \empty section to the end of the config
*
- * @param string $name The name for the new section
- * @return phpbb_search_sphinx_config_section The newly created section object
+ * @param string $name The name for the new \section
+ * @return \phpbb\search\sphinx\config_section The newly created section object
*
* @access public
*/
function add_section($name)
{
- $this->sections[] = new phpbb_search_sphinx_config_section($name, '');
+ $this->sections[] = new \phpbb\search\sphinx\config_section($name, '');
return $this->sections[sizeof($this->sections) - 1];
}
@@ -109,7 +111,7 @@ class phpbb_search_sphinx_config
// that way they're not deleted when reassembling the file from the sections
if (!$line || $line[0] == '#')
{
- $this->sections[] = new phpbb_search_sphinx_config_comment($config_file[$i]);
+ $this->sections[] = new \phpbb\search\sphinx\config_comment($config_file[$i]);
continue;
}
else
@@ -141,9 +143,9 @@ class phpbb_search_sphinx_config
$section_name .= $line[$j];
}
- // And then we create the new section object
+ // And then we create the new \section object
$section_name = trim($section_name);
- $section = new phpbb_search_sphinx_config_section($section_name, $section_name_comment);
+ $section = new \phpbb\search\sphinx\config_section($section_name, $section_name_comment);
}
}
else
@@ -158,7 +160,7 @@ class phpbb_search_sphinx_config
// of this section so they're not deleted on reassembly
if (!$line || $line[0] == '#')
{
- $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i]));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
continue;
}
@@ -174,7 +176,7 @@ class phpbb_search_sphinx_config
}
else
{
- $section->add_variable(new phpbb_search_sphinx_config_comment($config_file[$i]));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($config_file[$i]));
continue;
}
}
@@ -240,10 +242,10 @@ class phpbb_search_sphinx_config
}
// If a name and an equal sign were found then we have append a
- // new variable object to the section
+ // new \variable object to the section
if ($name && $found_assignment)
{
- $section->add_variable(new phpbb_search_sphinx_config_variable(trim($name), trim($value), ($end_section) ? '' : $comment));
+ $section->add_variable(new \phpbb\search\sphinx\config_variable(trim($name), trim($value), ($end_section) ? '' : $comment));
continue;
}
@@ -262,7 +264,7 @@ class phpbb_search_sphinx_config
// If we did not find anything meaningful up to here, then just treat it
// as a comment
$comment = ($skip_first) ? "\t" . substr(ltrim($config_file[$i]), 1) : $config_file[$i];
- $section->add_variable(new phpbb_search_sphinx_config_comment($comment));
+ $section->add_variable(new \phpbb\search\sphinx\config_comment($comment));
}
}
diff --git a/phpBB/phpbb/search/sphinx/config_comment.php b/phpBB/phpbb/search/sphinx/config_comment.php
index 7f695dbf0c..66000e4031 100644
--- a/phpBB/phpbb/search/sphinx/config_comment.php
+++ b/phpBB/phpbb/search/sphinx/config_comment.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,15 +18,15 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_comment
+* \phpbb\search\sphinx\config_comment
* Represents a comment inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_comment
+class config_comment
{
private $exact_string;
/**
- * Create a new comment
+ * Create a new \comment
*
* @param string $exact_string The content of the comment including newlines, leading whitespace, etc.
*
diff --git a/phpBB/phpbb/search/sphinx/config_section.php b/phpBB/phpbb/search/sphinx/config_section.php
index 79c9c8563d..3a5631ca21 100644
--- a/phpBB/phpbb/search/sphinx/config_section.php
+++ b/phpBB/phpbb/search/sphinx/config_section.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,10 +18,10 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_section
+* \phpbb\search\sphinx\config_section
* Represents a single section inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_section
+class config_section
{
private $name;
private $comment;
@@ -27,7 +29,7 @@ class phpbb_search_sphinx_config_section
private $variables = array();
/**
- * Construct a new section
+ * Construct a new \section
*
* @param string $name Name of the section
* @param string $comment Comment that should be appended after the name in the
@@ -45,7 +47,7 @@ class phpbb_search_sphinx_config_section
/**
* Add a variable object to the list of variables in this section
*
- * @param phpbb_search_sphinx_config_variable $variable The variable object
+ * @param \phpbb\search\sphinx\config_variable $variable The variable object
*
* @access public
*/
@@ -82,7 +84,7 @@ class phpbb_search_sphinx_config_section
* Get a variable object by its name
*
* @param string $name The name of the variable that shall be returned
- * @return phpbb_search_sphinx_config_section The first variable object from this section with the
+ * @return \phpbb\search\sphinx\config_section The first variable object from this section with the
* given name or null if none was found
*
* @access public
@@ -92,7 +94,7 @@ class phpbb_search_sphinx_config_section
for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
{
// Make sure this is a variable object and not a comment
- if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name)
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
{
return $this->variables[$i];
}
@@ -111,7 +113,7 @@ class phpbb_search_sphinx_config_section
for ($i = 0, $size = sizeof($this->variables); $i < $size; $i++)
{
// Make sure this is a variable object and not a comment
- if (($this->variables[$i] instanceof phpbb_search_sphinx_config_variable) && $this->variables[$i]->get_name() == $name)
+ if (($this->variables[$i] instanceof \phpbb\search\sphinx\config_variable) && $this->variables[$i]->get_name() == $name)
{
array_splice($this->variables, $i, 1);
$i--;
@@ -120,17 +122,17 @@ class phpbb_search_sphinx_config_section
}
/**
- * Create a new variable object and append it to the variable list of this section
+ * Create a new \variable object and append it to the variable list of this section
*
- * @param string $name The name for the new variable
- * @param string $value The value for the new variable
- * @return phpbb_search_sphinx_config_variable Variable object that was created
+ * @param string $name The name for the new \variable
+ * @param string $value The value for the new \variable
+ * @return \phpbb\search\sphinx\config_variable Variable object that was created
*
* @access public
*/
function create_variable($name, $value)
{
- $this->variables[] = new phpbb_search_sphinx_config_variable($name, $value, '');
+ $this->variables[] = new \phpbb\search\sphinx\config_variable($name, $value, '');
return $this->variables[sizeof($this->variables) - 1];
}
diff --git a/phpBB/phpbb/search/sphinx/config_variable.php b/phpBB/phpbb/search/sphinx/config_variable.php
index 2c1d35a49c..afe4190068 100644
--- a/phpBB/phpbb/search/sphinx/config_variable.php
+++ b/phpBB/phpbb/search/sphinx/config_variable.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\search\sphinx;
+
/**
* @ignore
*/
@@ -16,17 +18,17 @@ if (!defined('IN_PHPBB'))
}
/**
-* phpbb_search_sphinx_config_variable
+* \phpbb\search\sphinx\config_variable
* Represents a single variable inside the sphinx configuration
*/
-class phpbb_search_sphinx_config_variable
+class config_variable
{
private $name;
private $value;
private $comment;
/**
- * Constructs a new variable object
+ * Constructs a new \variable object
*
* @param string $name Name of the variable
* @param string $value Value of the variable
diff --git a/phpBB/phpbb/session.php b/phpBB/phpbb/session.php
index 3bff91e275..782ef60c52 100644
--- a/phpBB/phpbb/session.php
+++ b/phpBB/phpbb/session.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb;
+
/**
* @ignore
*/
@@ -19,7 +21,7 @@ if (!defined('IN_PHPBB'))
* Session class
* @package phpBB3
*/
-class phpbb_session
+class session
{
var $cookie_data = array();
var $page = array();
@@ -197,7 +199,7 @@ class phpbb_session
* This is where all session activity begins. We gather various pieces of
* information from the client and server. We test to see if a session already
* exists. If it does, fine and dandy. If it doesn't we'll go on to create a
- * new one ... pretty logical heh? We also examine the system load (if we're
+ * new \one ... pretty logical heh? We also examine the system load (if we're
* running on a system which makes such information readily available) and
* halt if it's above an admin definable limit.
*
@@ -243,7 +245,7 @@ class phpbb_session
$this->forwarded_for = '';
}
- if ($request->is_set($config['cookie_name'] . '_sid', phpbb_request_request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', phpbb_request_request_interface::COOKIE))
+ if ($request->is_set($config['cookie_name'] . '_sid', \phpbb\request\request_interface::COOKIE) || $request->is_set($config['cookie_name'] . '_u', \phpbb\request\request_interface::COOKIE))
{
$this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
$this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
@@ -401,13 +403,13 @@ class phpbb_session
$session_expired = false;
// Check whether the session is still valid if we have one
- $method = basename(trim($config['auth_method']));
+ $method = basename(trim($config['auth_method']));
$provider = $phpbb_container->get('auth.provider.' . $method);
- if (!($provider instanceof phpbb_auth_provider_provider_interface))
+ if (!($provider instanceof \phpbb\auth\provider\provider_interface))
{
- throw new \RuntimeException($provider . ' must implement phpbb_auth_provider_provider_interface');
+ throw new \RuntimeException($provider . ' must implement \phpbb\auth\provider\provider_interface');
}
$ret = $provider->validate_session($this->data);
@@ -492,18 +494,18 @@ class phpbb_session
}
}
- // If we reach here then no (valid) session exists. So we'll create a new one
+ // If we reach here then no (valid) session exists. So we'll create a new \one
return $this->session_create();
}
/**
- * Create a new session
+ * Create a new \session
*
* If upon trying to start a session we discover there is nothing existing we
* jump here. Additionally this method is called directly during login to regenerate
* the session for the specific user. In this method we carry out a number of tasks;
* garbage collection, (search)bot checking, banned user comparison. Basically
- * though this method will result in a new session for a specific user.
+ * though this method will result in a new \session for a specific user.
*/
function session_create($user_id = false, $set_admin = false, $persist_login = false, $viewonline = true)
{
@@ -773,7 +775,7 @@ class phpbb_session
if (!defined('IN_ERROR_HANDLER') && (!$this->session_id || !$db->sql_query($sql) || !$db->sql_affectedrows()))
{
- // Limit new sessions in 1 minute period (if required)
+ // Limit new \sessions in 1 minute period (if required)
if (empty($this->data['session_time']) && $config['active_sessions'])
{
// $db->sql_return_on_error(false);
@@ -799,7 +801,7 @@ class phpbb_session
// Something quite important: session_page always holds the *last* page visited, except for the *first* visit.
// We are not able to simply have an empty session_page btw, therefore we need to tell phpBB how to detect this special case.
- // If the session id is empty, we have a completely new one and will set an "identifier" here. This identifier is able to be checked later.
+ // If the session id is empty, we have a completely new \one and will set an "identifier" here. This identifier is able to be checked later.
if (empty($this->data['session_id']))
{
// This is a temporary variable, only set for the very first visit
@@ -1022,7 +1024,7 @@ class phpbb_session
{
include($phpbb_root_path . "includes/captcha/captcha_factory." . $phpEx);
}
- phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
+ \phpbb_captcha_factory::garbage_collect($config['captcha_plugin']);
$sql = 'DELETE FROM ' . LOGIN_ATTEMPT_TABLE . '
WHERE attempt_time < ' . (time() - (int) $config['ip_login_limit_time']);
diff --git a/phpBB/phpbb/style/extension_path_provider.php b/phpBB/phpbb/style/extension_path_provider.php
index ec1d85f821..104cda757b 100644
--- a/phpBB/phpbb/style/extension_path_provider.php
+++ b/phpBB/phpbb/style/extension_path_provider.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\style;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_style_extension_path_provider extends phpbb_extension_provider implements phpbb_style_path_provider_interface
+class extension_path_provider extends \phpbb\extension\provider implements \phpbb\style\path_provider_interface
{
/**
* Optional prefix for style paths searched within extensions.
@@ -36,7 +38,7 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple
/**
* A provider of paths to be searched for styles
- * @var phpbb_style_path_provider
+ * @var \phpbb\style\path_provider
*/
protected $base_path_provider;
@@ -46,12 +48,12 @@ class phpbb_style_extension_path_provider extends phpbb_extension_provider imple
/**
* Constructor stores extension manager
*
- * @param phpbb_extension_manager $extension_manager phpBB extension manager
- * @param phpbb_style_path_provider $base_path_provider A simple path provider
+ * @param \phpbb\extension\manager $extension_manager phpBB extension manager
+ * @param \phpbb\style\path_provider $base_path_provider A simple path provider
* to provide paths to be located in extensions
* @param string $phpbb_root_path phpBB root path
*/
- public function __construct(phpbb_extension_manager $extension_manager, phpbb_style_path_provider $base_path_provider, $phpbb_root_path)
+ public function __construct(\phpbb\extension\manager $extension_manager, \phpbb\style\path_provider $base_path_provider, $phpbb_root_path)
{
parent::__construct($extension_manager);
$this->base_path_provider = $base_path_provider;
diff --git a/phpBB/phpbb/style/path_provider.php b/phpBB/phpbb/style/path_provider.php
index 731d682e88..0a5906d0a8 100644
--- a/phpBB/phpbb/style/path_provider.php
+++ b/phpBB/phpbb/style/path_provider.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\style;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_style_path_provider implements IteratorAggregate, phpbb_style_path_provider_interface
+class path_provider implements \IteratorAggregate, \phpbb\style\path_provider_interface
{
protected $paths = array();
@@ -57,6 +59,6 @@ class phpbb_style_path_provider implements IteratorAggregate, phpbb_style_path_p
*/
public function getIterator()
{
- return new ArrayIterator($this->paths);
+ return new \ArrayIterator($this->paths);
}
}
diff --git a/phpBB/phpbb/style/path_provider_interface.php b/phpBB/phpbb/style/path_provider_interface.php
index 1a6153a4d3..beb0da29df 100644
--- a/phpBB/phpbb/style/path_provider_interface.php
+++ b/phpBB/phpbb/style/path_provider_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\style;
+
/**
* @ignore
*/
@@ -22,7 +24,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-interface phpbb_style_path_provider_interface extends Traversable
+interface path_provider_interface extends \Traversable
{
/**
* Defines a prefix to use for style paths in extensions
diff --git a/phpBB/phpbb/style/resource_locator.php b/phpBB/phpbb/style/resource_locator.php
index 4cf767c062..848624ee69 100644
--- a/phpBB/phpbb/style/resource_locator.php
+++ b/phpBB/phpbb/style/resource_locator.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\style;
+
/**
* @ignore
*/
@@ -30,7 +32,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_style_resource_locator implements phpbb_template_locator
+class resource_locator implements \phpbb\template\locator
{
/**
* Paths to style directories.
diff --git a/phpBB/phpbb/style/style.php b/phpBB/phpbb/style/style.php
index 034f518091..d3bacdb1ec 100644
--- a/phpBB/phpbb/style/style.php
+++ b/phpBB/phpbb/style/style.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\style;
+
/**
* @ignore
*/
@@ -19,12 +21,12 @@ if (!defined('IN_PHPBB'))
* Base Style class.
* @package phpBB3
*/
-class phpbb_style
+class style
{
/**
* Template class.
* Handles everything related to templates.
- * @var phpbb_template
+ * @var \phpbb\template\template
*/
private $template;
@@ -42,25 +44,25 @@ class phpbb_style
/**
* phpBB config instance
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
private $config;
/**
* Current user
- * @var phpbb_user
+ * @var \phpbb\user
*/
private $user;
/**
* Style resource locator
- * @var phpbb_style_resource_locator
+ * @var \phpbb\style\resource_locator
*/
private $locator;
/**
* Style path provider
- * @var phpbb_style_path_provider
+ * @var \phpbb\style\path_provider
*/
private $provider;
@@ -69,11 +71,11 @@ class phpbb_style
*
* @param string $phpbb_root_path phpBB root path
* @param user $user current user
- * @param phpbb_style_resource_locator $locator style resource locator
- * @param phpbb_style_path_provider $provider style path provider
- * @param phpbb_template $template template
+ * @param \phpbb\style\resource_locator $locator style resource locator
+ * @param \phpbb\style\path_provider $provider style path provider
+ * @param \phpbb\template\template $template template
*/
- public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_style_resource_locator $locator, phpbb_style_path_provider_interface $provider, phpbb_template $template)
+ public function __construct($phpbb_root_path, $php_ext, $config, $user, \phpbb\style\resource_locator $locator, \phpbb\style\path_provider_interface $provider, \phpbb\template\template $template)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = $php_ext;
diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php
index 7c322cd971..aa4b25aa7f 100644
--- a/phpBB/phpbb/template/asset.php
+++ b/phpBB/phpbb/template/asset.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_asset
+class asset
{
protected $components = array();
diff --git a/phpBB/phpbb/template/context.php b/phpBB/phpbb/template/context.php
index c5ce7422b9..263f77a1b8 100644
--- a/phpBB/phpbb/template/context.php
+++ b/phpBB/phpbb/template/context.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template;
+
/**
* @ignore
*/
@@ -20,7 +22,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_template_context
+class context
{
/**
* variable that holds all the data we'll be substituting into
@@ -86,7 +88,7 @@ class phpbb_template_context
* Returns a reference to template data array.
*
* This function is public so that template renderer may invoke it.
- * Users should alter template variables via functions in phpbb_template.
+ * Users should alter template variables via functions in \phpbb\template\template.
*
* Note: modifying returned array will affect data stored in the context.
*
@@ -158,7 +160,7 @@ class phpbb_template_context
}
// Now we add the block that we're actually assigning to.
- // We're adding a new iteration to this block with the given
+ // We're adding a new \iteration to this block with the given
// variable assignments.
$str[$blocks[$blockcount]][] = $vararray;
@@ -190,7 +192,7 @@ class phpbb_template_context
unset($this->tpldata[$blockname][($s_row_count - 1)]['S_LAST_ROW']);
}
- // Add a new iteration to this block with the variable assignments we were given.
+ // Add a new \iteration to this block with the variable assignments we were given.
$this->tpldata[$blockname][] = $vararray;
// Set S_NUM_ROWS
@@ -223,7 +225,7 @@ class phpbb_template_context
* @param string $mode Mode to execute (valid modes are 'insert' and 'change')
*
* If insert, the vararray is inserted at the given position (position counting from zero).
- * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
+ * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
*
* Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
diff --git a/phpBB/phpbb/template/locator.php b/phpBB/phpbb/template/locator.php
index f6fd20bcc2..c930609b80 100644
--- a/phpBB/phpbb/template/locator.php
+++ b/phpBB/phpbb/template/locator.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template;
+
/**
* @ignore
*/
@@ -33,7 +35,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-interface phpbb_template_locator
+interface locator
{
/**
* Sets the template filenames for handles. $filename_array
diff --git a/phpBB/phpbb/template/template.php b/phpBB/phpbb/template/template.php
index 89a01e924d..4b337f9980 100644
--- a/phpBB/phpbb/template/template.php
+++ b/phpBB/phpbb/template/template.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template;
+
/**
* @ignore
*/
@@ -15,13 +17,13 @@ if (!defined('IN_PHPBB'))
exit;
}
-interface phpbb_template
+interface template
{
/**
* Clear the cache
*
- * @return phpbb_template
+ * @return \phpbb\template\template
*/
public function clear_cache();
@@ -29,7 +31,7 @@ interface phpbb_template
* Sets the template filenames for handles.
*
* @param array $filename_array Should be a hash of handle => filename pairs.
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function set_filenames(array $filename_array);
@@ -39,14 +41,14 @@ interface phpbb_template
*
* @param array $style_names List of style names in inheritance tree order
* @param array $style_paths List of style paths in inheritance tree order
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function set_style_names(array $style_names, array $style_paths);
/**
* Clears all variables and blocks assigned to this template.
*
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function destroy();
@@ -54,7 +56,7 @@ interface phpbb_template
* Reset/empty complete block
*
* @param string $blockname Name of block to destroy
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function destroy_block_vars($blockname);
@@ -66,7 +68,7 @@ interface phpbb_template
* This function calls hooks.
*
* @param string $handle Handle to display
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function display($handle);
@@ -77,7 +79,7 @@ interface phpbb_template
* @param string $handle Handle to operate on
* @param string $template_var Template variable to assign compiled handle to
* @param bool $return_content If true return compiled handle, otherwise assign to $template_var
- * @return phpbb_template|string if $return_content is true return string of the compiled handle, otherwise return $this
+ * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
*/
public function assign_display($handle, $template_var = '', $return_content = true);
@@ -85,7 +87,7 @@ interface phpbb_template
* Assign key variable pairs from an array
*
* @param array $vararray A hash of variable name => value pairs
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_vars(array $vararray);
@@ -96,7 +98,7 @@ interface phpbb_template
*
* @param string $varname Variable name
* @param string $varval Value to assign to variable
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_var($varname, $varval);
@@ -107,7 +109,7 @@ interface phpbb_template
*
* @param string $varname Variable name
* @param string $varval Value to append to variable
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function append_var($varname, $varval);
@@ -115,7 +117,7 @@ interface phpbb_template
* Assign key variable pairs from an array to a specified block
* @param string $blockname Name of block to assign $vararray to
* @param array $vararray A hash of variable name => value pairs
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_block_vars($blockname, array $vararray);
@@ -139,7 +141,7 @@ interface phpbb_template
* @param string $mode Mode to execute (valid modes are 'insert' and 'change')
*
* If insert, the vararray is inserted at the given position (position counting from zero).
- * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
+ * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
*
* Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
diff --git a/phpBB/phpbb/template/twig/definition.php b/phpBB/phpbb/template/twig/definition.php
index 6557b209eb..2490a43f81 100644
--- a/phpBB/phpbb/template/twig/definition.php
+++ b/phpBB/phpbb/template/twig/definition.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -18,7 +20,7 @@ if (!defined('IN_PHPBB'))
/**
* This class holds all DEFINE variables from the current page load
*/
-class phpbb_template_twig_definition
+class definition
{
/** @var array **/
protected $definitions = array();
@@ -39,7 +41,7 @@ class phpbb_template_twig_definition
*
* @param string $name
* @param mixed $value
- * @return phpbb_template_twig_definition
+ * @return \phpbb\template\twig\definition
*/
public function set($name, $value)
{
@@ -53,7 +55,7 @@ class phpbb_template_twig_definition
*
* @param string $name
* @param string $value
- * @return phpbb_template_twig_definition
+ * @return \phpbb\template\twig\definition
*/
public function append($name, $value)
{
diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php
index b60cd72325..64f3ace52d 100644
--- a/phpBB/phpbb/template/twig/environment.php
+++ b/phpBB/phpbb/template/twig/environment.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,12 +17,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_environment extends Twig_Environment
+class environment extends \Twig_Environment
{
/** @var array */
protected $phpbb_extensions;
- /** @var phpbb_config */
+ /** @var \phpbb\config\config */
protected $phpbb_config;
/** @var string */
@@ -32,13 +34,13 @@ class phpbb_template_twig_environment extends Twig_Environment
/**
* Constructor
*
- * @param phpbb_config $phpbb_config
+ * @param \phpbb\config\config $phpbb_config
* @param array $phpbb_extensions Array of enabled extensions (name => path)
* @param string $phpbb_root_path
* @param Twig_LoaderInterface $loader
* @param array $options Array of options to pass to Twig
*/
- public function __construct($phpbb_config, $phpbb_extensions, $phpbb_root_path, Twig_LoaderInterface $loader = null, $options = array())
+ public function __construct($phpbb_config, $phpbb_extensions, $phpbb_root_path, \Twig_LoaderInterface $loader = null, $options = array())
{
$this->phpbb_config = $phpbb_config;
$this->phpbb_extensions = $phpbb_extensions;
@@ -62,7 +64,7 @@ class phpbb_template_twig_environment extends Twig_Environment
/**
* Get phpBB config
*
- * @return phpbb_config
+ * @return \phpbb\config\config
*/
public function get_phpbb_config()
{
@@ -124,7 +126,7 @@ class phpbb_template_twig_environment extends Twig_Environment
return parent::loadTemplate('@' . $namespace . '/' . $name, $index);
}
- catch (Twig_Error_Loader $e)
+ catch (\Twig_Error_Loader $e)
{
}
}
diff --git a/phpBB/phpbb/template/twig/extension.php b/phpBB/phpbb/template/twig/extension.php
index 2adee07c8c..1ddb97369e 100644
--- a/phpBB/phpbb/template/twig/extension.php
+++ b/phpBB/phpbb/template/twig/extension.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,22 +17,22 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_extension extends Twig_Extension
+class extension extends \Twig_Extension
{
- /** @var phpbb_template_context */
+ /** @var \phpbb\template\context */
protected $context;
- /** @var phpbb_user */
+ /** @var \phpbb\user */
protected $user;
/**
* Constructor
*
- * @param phpbb_template_context $context
- * @param phpbb_user $user
- * @return phpbb_template_twig_extension
+ * @param \phpbb\template\context $context
+ * @param \phpbb\user $user
+ * @return \phpbb\template\twig\extension
*/
- public function __construct(phpbb_template_context $context, $user)
+ public function __construct(\phpbb\template\context $context, $user)
{
$this->context = $context;
$this->user = $user;
@@ -54,13 +56,13 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getTokenParsers()
{
return array(
- new phpbb_template_twig_tokenparser_defineparser,
- new phpbb_template_twig_tokenparser_includeparser,
- new phpbb_template_twig_tokenparser_includejs,
- new phpbb_template_twig_tokenparser_includecss,
- new phpbb_template_twig_tokenparser_event,
- new phpbb_template_twig_tokenparser_includephp,
- new phpbb_template_twig_tokenparser_php,
+ new \phpbb\template\twig\tokenparser\defineparser,
+ new \phpbb\template\twig\tokenparser\includeparser,
+ new \phpbb\template\twig\tokenparser\includejs,
+ new \phpbb\template\twig\tokenparser\includecss,
+ new \phpbb\template\twig\tokenparser\event,
+ new \phpbb\template\twig\tokenparser\includephp,
+ new \phpbb\template\twig\tokenparser\php,
);
}
@@ -72,8 +74,8 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getFilters()
{
return array(
- new Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
- new Twig_SimpleFilter('addslashes', 'addslashes'),
+ new \Twig_SimpleFilter('subset', array($this, 'loop_subset'), array('needs_environment' => true)),
+ new \Twig_SimpleFilter('addslashes', 'addslashes'),
);
}
@@ -85,7 +87,7 @@ class phpbb_template_twig_extension extends Twig_Extension
public function getFunctions()
{
return array(
- new Twig_SimpleFunction('lang', array($this, 'lang')),
+ new \Twig_SimpleFunction('lang', array($this, 'lang')),
);
}
@@ -102,26 +104,26 @@ class phpbb_template_twig_extension extends Twig_Extension
),
array(
// precedence settings are copied from similar operators in Twig core extension
- '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ '||' => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '&&' => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'eq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'ne' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'neq' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '<>' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- '===' => array('precedence' => 20, 'class' => 'phpbb_template_twig_node_expression_binary_equalequal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- '!==' => array('precedence' => 20, 'class' => 'phpbb_template_twig_node_expression_binary_notequalequal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ '===' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\equalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ '!==' => array('precedence' => 20, 'class' => '\phpbb\template\twig\node\expression\binary\notequalequal', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
- 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'gt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'gte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'ge' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lt' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'lte' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
+ 'le' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
- 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
+ 'mod' => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => \Twig_ExpressionParser::OPERATOR_LEFT),
),
);
}
@@ -137,7 +139,7 @@ class phpbb_template_twig_extension extends Twig_Extension
*
* @return mixed The sliced variable
*/
- function loop_subset(Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false)
+ function loop_subset(\Twig_Environment $env, $item, $start, $end = null, $preserveKeys = false)
{
// We do almost the same thing as Twig's slice (array_slice), except when $end is positive
if ($end >= 1)
diff --git a/phpBB/phpbb/template/twig/lexer.php b/phpBB/phpbb/template/twig/lexer.php
index 46412ad048..4f10e9594f 100644
--- a/phpBB/phpbb/template/twig/lexer.php
+++ b/phpBB/phpbb/template/twig/lexer.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_template_twig_lexer extends Twig_Lexer
+class lexer extends \Twig_Lexer
{
public function tokenize($code, $filename = null)
{
diff --git a/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php
index 247b908337..ec084d0f7d 100644
--- a/phpBB/phpbb/template/twig/node/definenode.php
+++ b/phpBB/phpbb/template/twig/node/definenode.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_definenode extends Twig_Node
+class definenode extends \Twig_Node
{
- public function __construct($capture, Twig_NodeInterface $name, Twig_NodeInterface $value, $lineno, $tag = null)
+ public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null)
{
parent::__construct(array('name' => $name, 'value' => $value), array('capture' => $capture, 'safe' => false), $lineno, $tag);
}
@@ -28,7 +30,7 @@ class phpbb_template_twig_node_definenode extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -38,7 +40,7 @@ class phpbb_template_twig_node_definenode extends Twig_Node
->subcompile($this->getNode('value'))
;
- $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new Twig_Markup(\$value, \$this->env->getCharset());\n");
+ $compiler->write("\$value = ('' === \$value = ob_get_clean()) ? '' : new \Twig_Markup(\$value, \$this->env->getCharset());\n");
}
else
{
diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php
index 971dea14fa..a55e68fb04 100644
--- a/phpBB/phpbb/template/twig/node/event.php
+++ b/phpBB/phpbb/template/twig/node/event.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_event extends Twig_Node
+class event extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_event extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -48,7 +50,7 @@ class phpbb_template_twig_node_event extends Twig_Node
// If debug mode is enabled, lets check for new/removed EVENT
// templates on page load rather than at compile. This is
// slower, but makes developing extensions easier (no need to
- // purge the cache when a new event template file is added)
+ // purge the cache when a new \event template file is added)
$compiler
->write("if (\$this->env->getLoader()->exists('@{$ext_namespace}/{$location}.html')) {\n")
->indent()
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
index 8ec2069114..48d8b814b8 100644
--- a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
+++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node\expression\binary;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_expression_binary_equalequal extends Twig_Node_Expression_Binary
+class equalequal extends \Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
+ public function operator(\Twig_Compiler $compiler)
{
return $compiler->raw('===');
}
diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
index 96f32c502e..87585dfb4c 100644
--- a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
+++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node\expression\binary;
+
/**
* @ignore
*/
@@ -16,9 +18,9 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_expression_binary_notequalequal extends Twig_Node_Expression_Binary
+class notequalequal extends \Twig_Node_Expression_Binary
{
- public function operator(Twig_Compiler $compiler)
+ public function operator(\Twig_Compiler $compiler)
{
return $compiler->raw('!==');
}
diff --git a/phpBB/phpbb/template/twig/node/includeasset.php b/phpBB/phpbb/template/twig/node/includeasset.php
index 990b1c984f..f5c6413617 100644
--- a/phpBB/phpbb/template/twig/node/includeasset.php
+++ b/phpBB/phpbb/template/twig/node/includeasset.php
@@ -7,12 +7,14 @@
*
*/
-class phpbb_template_twig_node_includeasset extends Twig_Node
+namespace phpbb\template\twig\node;
+
+class includeasset extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -23,7 +25,7 @@ class phpbb_template_twig_node_includeasset extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_includeasset extends Twig_Node
->write("\$asset_file = ")
->subcompile($this->getNode('expr'))
->raw(";\n")
- ->write("\$asset = new phpbb_template_asset(\$asset_file);\n")
+ ->write("\$asset = new \phpbb\template\asset(\$asset_file);\n")
->write("if (substr(\$asset_file, 0, 2) !== './' && \$asset->is_relative()) {\n")
->indent()
->write("\$asset_path = \$asset->get_path();")
diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php
index 01fda44aad..45ff9107a0 100644
--- a/phpBB/phpbb/template/twig/node/includecss.php
+++ b/phpBB/phpbb/template/twig/node/includecss.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_includeasset
+namespace phpbb\template\twig\node;
+
+class includecss extends \phpbb\template\twig\node\includeasset
{
public function get_definition_name()
{
@@ -19,7 +21,7 @@ class phpbb_template_twig_node_includecss extends phpbb_template_twig_node_inclu
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function append_asset(Twig_Compiler $compiler)
+ public function append_asset(\Twig_Compiler $compiler)
{
$compiler
->raw("environment->get_phpbb_config();
diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php
index c5d1c6be51..77fe7f3acb 100644
--- a/phpBB/phpbb/template/twig/node/includenode.php
+++ b/phpBB/phpbb/template/twig/node/includenode.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,14 +18,14 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_includenode extends Twig_Node_Include
+class includenode extends \Twig_Node_Include
{
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php
index dbe54f0e1a..4024cf0cc8 100644
--- a/phpBB/phpbb/template/twig/node/includephp.php
+++ b/phpBB/phpbb/template/twig/node/includephp.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_includephp extends Twig_Node
+class includephp extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Expression $expr, phpbb_template_twig_environment $environment, $ignoreMissing = false, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Expression $expr, \phpbb\template\twig\environment $environment, $ignoreMissing = false, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
@@ -80,7 +82,7 @@ class phpbb_template_twig_node_includephp extends Twig_Node
if ($this->getAttribute('ignore_missing')) {
$compiler
->outdent()
- ->write("} catch (Twig_Error_Loader \$e) {\n")
+ ->write("} catch (\Twig_Error_Loader \$e) {\n")
->indent()
->write("// ignore missing template\n")
->outdent()
diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php
index c11539ea7f..b37759303d 100644
--- a/phpBB/phpbb/template/twig/node/php.php
+++ b/phpBB/phpbb/template/twig/node/php.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\node;
+
/**
* @ignore
*/
@@ -16,12 +18,12 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_node_php extends Twig_Node
+class php extends \Twig_Node
{
/** @var Twig_Environment */
protected $environment;
- public function __construct(Twig_Node_Text $text, phpbb_template_twig_environment $environment, $lineno, $tag = null)
+ public function __construct(\Twig_Node_Text $text, \phpbb\template\twig\environment $environment, $lineno, $tag = null)
{
$this->environment = $environment;
@@ -33,7 +35,7 @@ class phpbb_template_twig_node_php extends Twig_Node
*
* @param Twig_Compiler A Twig_Compiler instance
*/
- public function compile(Twig_Compiler $compiler)
+ public function compile(\Twig_Compiler $compiler)
{
$compiler->addDebugInfo($this);
diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
index db023c67bf..688afec191 100644
--- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php
+++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser
+class defineparser extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,31 +27,31 @@ class phpbb_template_twig_tokenparser_defineparser extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$lineno = $token->getLine();
$stream = $this->parser->getStream();
$name = $this->parser->getExpressionParser()->parseExpression();
$capture = false;
- if ($stream->test(Twig_Token::OPERATOR_TYPE, '=')) {
+ if ($stream->test(\Twig_Token::OPERATOR_TYPE, '=')) {
$stream->next();
$value = $this->parser->getExpressionParser()->parseExpression();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
} else {
$capture = true;
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
$value = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
}
- return new phpbb_template_twig_node_definenode($capture, $name, $value, $lineno, $this->getTag());
+ return new \phpbb\template\twig\node\definenode($capture, $name, $value, $lineno, $this->getTag());
}
- public function decideBlockEnd(Twig_Token $token)
+ public function decideBlockEnd(\Twig_Token $token)
{
return $token->test('ENDDEFINE');
}
diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php
index e4dddd6dcc..7cf4000909 100644
--- a/phpBB/phpbb/template/twig/tokenparser/event.php
+++ b/phpBB/phpbb/template/twig/tokenparser/event.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
+class event extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_event extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\event($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includecss.php b/phpBB/phpbb/template/twig/tokenparser/includecss.php
index 6c24dda647..7bf4c610b1 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includecss.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includecss.php
@@ -7,7 +7,9 @@
*
*/
-class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
+namespace phpbb\template\twig\tokenparser;
+
+class includecss extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -16,14 +18,14 @@ class phpbb_template_twig_tokenparser_includecss extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includecss($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php
index b02b2f89ba..30a99f3279 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includejs.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
+class includejs extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,14 +27,14 @@ class phpbb_template_twig_tokenparser_includejs extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includejs($expr, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
index 79c53630d0..715c0ec84d 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_includeparser extends Twig_TokenParser_Include
+class includeparser extends \Twig_TokenParser_Include
{
/**
* Parses a token and returns a node.
@@ -25,13 +27,13 @@ class phpbb_template_twig_tokenparser_includeparser extends Twig_TokenParser_Inc
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
list($variables, $only, $ignoreMissing) = $this->parseArguments();
- return new phpbb_template_twig_node_includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includenode($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php
index 13fe6de8a6..d906837590 100644
--- a/phpBB/phpbb/template/twig/tokenparser/includephp.php
+++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
+class includephp extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,23 +27,23 @@ class phpbb_template_twig_tokenparser_includephp extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$expr = $this->parser->getExpressionParser()->parseExpression();
$stream = $this->parser->getStream();
$ignoreMissing = false;
- if ($stream->test(Twig_Token::NAME_TYPE, 'ignore')) {
+ if ($stream->test(\Twig_Token::NAME_TYPE, 'ignore')) {
$stream->next();
- $stream->expect(Twig_Token::NAME_TYPE, 'missing');
+ $stream->expect(\Twig_Token::NAME_TYPE, 'missing');
$ignoreMissing = true;
}
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\includephp($expr, $this->parser->getEnvironment(), $ignoreMissing, $token->getLine(), $this->getTag());
}
/**
diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php
index 197980a59a..e4f70fb9b1 100644
--- a/phpBB/phpbb/template/twig/tokenparser/php.php
+++ b/phpBB/phpbb/template/twig/tokenparser/php.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig\tokenparser;
+
/**
* @ignore
*/
@@ -16,7 +18,7 @@ if (!defined('IN_PHPBB'))
}
-class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
+class php extends \Twig_TokenParser
{
/**
* Parses a token and returns a node.
@@ -25,20 +27,20 @@ class phpbb_template_twig_tokenparser_php extends Twig_TokenParser
*
* @return Twig_NodeInterface A Twig_NodeInterface instance
*/
- public function parse(Twig_Token $token)
+ public function parse(\Twig_Token $token)
{
$stream = $this->parser->getStream();
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
$body = $this->parser->subparse(array($this, 'decideEnd'), true);
- $stream->expect(Twig_Token::BLOCK_END_TYPE);
+ $stream->expect(\Twig_Token::BLOCK_END_TYPE);
- return new phpbb_template_twig_node_php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
+ return new \phpbb\template\twig\node\php($body, $this->parser->getEnvironment(), $token->getLine(), $this->getTag());
}
- public function decideEnd(Twig_Token $token)
+ public function decideEnd(\Twig_Token $token)
{
return $token->test('ENDPHP');
}
diff --git a/phpBB/phpbb/template/twig/twig.php b/phpBB/phpbb/template/twig/twig.php
index 92a37d1634..2ba6f66a35 100644
--- a/phpBB/phpbb/template/twig/twig.php
+++ b/phpBB/phpbb/template/twig/twig.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\template\twig;
+
/**
* @ignore
*/
@@ -19,12 +21,12 @@ if (!defined('IN_PHPBB'))
* Twig Template class.
* @package phpBB3
*/
-class phpbb_template_twig implements phpbb_template
+class twig implements \phpbb\template\template
{
/**
* Template context.
* Stores template data used during template rendering.
- * @var phpbb_template_context
+ * @var \phpbb\template\context
*/
protected $context;
@@ -57,20 +59,20 @@ class phpbb_template_twig implements phpbb_template
/**
* phpBB config instance
- * @var phpbb_config
+ * @var \phpbb\config\config
*/
protected $config;
/**
* Current user
- * @var phpbb_user
+ * @var \phpbb\user
*/
protected $user;
/**
* Extension manager.
*
- * @var phpbb_extension_manager
+ * @var \phpbb\extension\manager
*/
protected $extension_manager;
@@ -103,13 +105,13 @@ class phpbb_template_twig implements phpbb_template
*
* @param string $phpbb_root_path phpBB root path
* @param string $php_ext php extension (typically 'php')
- * @param phpbb_config $config
- * @param phpbb_user $user
- * @param phpbb_template_context $context template context
- * @param phpbb_extension_manager $extension_manager extension manager, if null then template events will not be invoked
+ * @param \phpbb\config\config $config
+ * @param \phpbb\user $user
+ * @param \phpbb\template\context $context template context
+ * @param \phpbb\extension\manager $extension_manager extension manager, if null then template events will not be invoked
* @param string $adm_relative_path relative path to adm directory
*/
- public function __construct($phpbb_root_path, $php_ext, $config, $user, phpbb_template_context $context, phpbb_extension_manager $extension_manager = null, $adm_relative_path = null)
+ public function __construct($phpbb_root_path, $php_ext, $config, $user, \phpbb\template\context $context, \phpbb\extension\manager $extension_manager = null, $adm_relative_path = null)
{
$this->phpbb_root_path = $phpbb_root_path;
$this->adm_relative_path = $adm_relative_path;
@@ -122,9 +124,9 @@ class phpbb_template_twig implements phpbb_template
$this->cachepath = $phpbb_root_path . 'cache/twig/';
// Initiate the loader, __main__ namespace paths will be setup later in set_style_names()
- $loader = new Twig_Loader_Filesystem('');
+ $loader = new \Twig_Loader_Filesystem('');
- $this->twig = new phpbb_template_twig_environment(
+ $this->twig = new \phpbb\template\twig\environment(
$this->config,
($this->extension_manager) ? $this->extension_manager->all_enabled() : array(),
$this->phpbb_root_path,
@@ -138,13 +140,13 @@ class phpbb_template_twig implements phpbb_template
);
$this->twig->addExtension(
- new phpbb_template_twig_extension(
+ new \phpbb\template\twig\extension(
$this->context,
$this->user
)
);
- $lexer = new phpbb_template_twig_lexer($this->twig);
+ $lexer = new \phpbb\template\twig\lexer($this->twig);
$this->twig->setLexer($lexer);
}
@@ -152,7 +154,7 @@ class phpbb_template_twig implements phpbb_template
/**
* Clear the cache
*
- * @return phpbb_template
+ * @return \phpbb\template\template
*/
public function clear_cache()
{
@@ -168,7 +170,7 @@ class phpbb_template_twig implements phpbb_template
* Sets the template filenames for handles.
*
* @param array $filename_array Should be a hash of handle => filename pairs.
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function set_filenames(array $filename_array)
{
@@ -185,7 +187,7 @@ class phpbb_template_twig implements phpbb_template
* @param array $style_paths List of style paths in inheritance tree order
* @param bool $is_core True if the style names are the "core" styles for this page load
* Core means the main phpBB template files
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function set_style_names(array $style_names, array $style_paths, $is_core = false)
{
@@ -194,7 +196,7 @@ class phpbb_template_twig implements phpbb_template
// Set as __main__ namespace
$this->twig->getLoader()->setPaths($style_paths);
- // Core style namespace from phpbb_style::set_style()
+ // Core style namespace from \phpbb\style\style::set_style()
if ($is_core)
{
$this->twig->getLoader()->setPaths($style_paths, 'core');
@@ -207,7 +209,7 @@ class phpbb_template_twig implements phpbb_template
}
// Add all namespaces for all extensions
- if ($this->extension_manager instanceof phpbb_extension_manager)
+ if ($this->extension_manager instanceof \phpbb\extension\manager)
{
$style_names[] = 'all';
@@ -237,7 +239,7 @@ class phpbb_template_twig implements phpbb_template
/**
* Clears all variables and blocks assigned to this template.
*
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function destroy()
{
@@ -250,7 +252,7 @@ class phpbb_template_twig implements phpbb_template
* Reset/empty complete block
*
* @param string $blockname Name of block to destroy
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function destroy_block_vars($blockname)
{
@@ -267,7 +269,7 @@ class phpbb_template_twig implements phpbb_template
* This function calls hooks.
*
* @param string $handle Handle to display
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function display($handle)
{
@@ -311,7 +313,7 @@ class phpbb_template_twig implements phpbb_template
* @param string $handle Handle to operate on
* @param string $template_var Template variable to assign compiled handle to
* @param bool $return_content If true return compiled handle, otherwise assign to $template_var
- * @return phpbb_template|string if $return_content is true return string of the compiled handle, otherwise return $this
+ * @return \phpbb\template\template|string if $return_content is true return string of the compiled handle, otherwise return $this
*/
public function assign_display($handle, $template_var = '', $return_content = true)
{
@@ -329,7 +331,7 @@ class phpbb_template_twig implements phpbb_template
* Assign key variable pairs from an array
*
* @param array $vararray A hash of variable name => value pairs
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_vars(array $vararray)
{
@@ -348,7 +350,7 @@ class phpbb_template_twig implements phpbb_template
*
* @param string $varname Variable name
* @param string $varval Value to assign to variable
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_var($varname, $varval)
{
@@ -364,7 +366,7 @@ class phpbb_template_twig implements phpbb_template
*
* @param string $varname Variable name
* @param string $varval Value to append to variable
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function append_var($varname, $varval)
{
@@ -377,7 +379,7 @@ class phpbb_template_twig implements phpbb_template
* Assign key variable pairs from an array to a specified block
* @param string $blockname Name of block to assign $vararray to
* @param array $vararray A hash of variable name => value pairs
- * @return phpbb_template $this
+ * @return \phpbb\template\template $this
*/
public function assign_block_vars($blockname, array $vararray)
{
@@ -406,7 +408,7 @@ class phpbb_template_twig implements phpbb_template
* @param string $mode Mode to execute (valid modes are 'insert' and 'change')
*
* If insert, the vararray is inserted at the given position (position counting from zero).
- * If change, the current block gets merged with the vararray (resulting in new key/value pairs be added and existing keys be replaced by the new value).
+ * If change, the current block gets merged with the vararray (resulting in new \key/value pairs be added and existing keys be replaced by the new \value).
*
* Since counting begins by zero, inserting at the last position will result in this array: array(vararray, last positioned array)
* and inserting at position 1 will result in this array: array(first positioned array, vararray, following vars)
@@ -431,7 +433,7 @@ class phpbb_template_twig implements phpbb_template
$context_vars['.'][0], // To get normal vars
$context_vars, // To get loops
array(
- 'definition' => new phpbb_template_twig_definition(),
+ 'definition' => new \phpbb\template\twig\definition(),
'user' => $this->user,
)
);
diff --git a/phpBB/phpbb/tree/nestedset.php b/phpBB/phpbb/tree/nestedset.php
index 79853eeaa1..171dae4d14 100644
--- a/phpBB/phpbb/tree/nestedset.php
+++ b/phpBB/phpbb/tree/nestedset.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\tree;
+
/**
* @ignore
*/
@@ -15,12 +17,12 @@ if (!defined('IN_PHPBB'))
exit;
}
-abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
+abstract class nestedset implements \phpbb\tree\tree_interface
{
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db;
- /** @var phpbb_lock_db */
+ /** @var \phpbb\lock\db */
protected $lock;
/** @var string */
@@ -58,15 +60,15 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
/**
* Construct
*
- * @param phpbb_db_driver $db Database connection
- * @param phpbb_lock_db $lock Lock class used to lock the table when moving forums around
+ * @param \phpbb\db\driver\driver $db Database connection
+ * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around
* @param string $table_name Table name
* @param string $message_prefix Prefix for the messages thrown by exceptions
* @param string $sql_where Additional SQL restrictions for the queries
* @param array $item_basic_data Array with basic item data that is stored in item_parents
* @param array $columns Array with column names to overwrite
*/
- public function __construct(phpbb_db_driver $db, phpbb_lock_db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array())
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\lock\db $lock, $table_name, $message_prefix = '', $sql_where = '', $item_basic_data = array(), $columns = array())
{
$this->db = $db;
$this->lock = $lock;
@@ -116,7 +118,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$this->lock->acquire())
{
- throw new RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
+ throw new \RuntimeException($this->message_prefix . 'LOCK_FAILED_ACQUIRE');
}
return true;
@@ -184,7 +186,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
$item_id = (int) $item_id;
if (!$item_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$items = $this->get_subtree_data($item_id);
@@ -192,7 +194,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (empty($items) || !isset($items[$item_id]))
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->remove_subset($item_ids, $items[$item_id]);
@@ -242,7 +244,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$item)
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
/**
@@ -364,7 +366,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$current_parent_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->acquire_lock();
@@ -373,7 +375,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!isset($item_data[$current_parent_id]))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$current_parent = $item_data[$current_parent_id];
@@ -389,7 +391,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (in_array($new_parent_id, $move_items))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$diff = sizeof($move_items) * 2;
@@ -413,7 +415,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
{
$this->db->sql_transaction('rollback');
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);
@@ -470,7 +472,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!$item_id)
{
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$this->acquire_lock();
@@ -479,7 +481,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (!isset($item_data[$item_id]))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_ITEM');
}
$item = $item_data[$item_id];
@@ -488,7 +490,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
if (in_array($new_parent_id, $move_items))
{
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$diff = sizeof($move_items) * 2;
@@ -512,7 +514,7 @@ abstract class phpbb_tree_nestedset implements phpbb_tree_tree_interface
{
$this->db->sql_transaction('rollback');
$this->lock->release();
- throw new OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
+ throw new \OutOfBoundsException($this->message_prefix . 'INVALID_PARENT');
}
$new_right_id = $this->prepare_adding_subset($move_items, $new_parent, true);
diff --git a/phpBB/phpbb/tree/nestedset_forum.php b/phpBB/phpbb/tree/nestedset_forum.php
index ff09ef55d0..2fee5b097e 100644
--- a/phpBB/phpbb/tree/nestedset_forum.php
+++ b/phpBB/phpbb/tree/nestedset_forum.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\tree;
+
/**
* @ignore
*/
@@ -15,16 +17,16 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_tree_nestedset_forum extends phpbb_tree_nestedset
+class nestedset_forum extends \phpbb\tree\nestedset
{
/**
* Construct
*
- * @param phpbb_db_driver $db Database connection
- * @param phpbb_lock_db $lock Lock class used to lock the table when moving forums around
+ * @param \phpbb\db\driver\driver $db Database connection
+ * @param \phpbb\lock\db $lock Lock class used to lock the table when moving forums around
* @param string $table_name Table name
*/
- public function __construct(phpbb_db_driver $db, phpbb_lock_db $lock, $table_name)
+ public function __construct(\phpbb\db\driver\driver $db, \phpbb\lock\db $lock, $table_name)
{
parent::__construct(
$db,
diff --git a/phpBB/phpbb/tree/tree_interface.php b/phpBB/phpbb/tree/tree_interface.php
index 80d3c4377c..b0a1e08ec6 100644
--- a/phpBB/phpbb/tree/tree_interface.php
+++ b/phpBB/phpbb/tree/tree_interface.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb\tree;
+
/**
* @ignore
*/
@@ -15,7 +17,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-interface phpbb_tree_tree_interface
+interface tree_interface
{
/**
* Inserts an item into the database table and into the tree.
@@ -67,7 +69,7 @@ interface phpbb_tree_tree_interface
/**
* Moves all children of one item to another item
*
- * If the new parent already has children, the new children are appended
+ * If the new parent already has children, the new \children are appended
* to the list.
*
* @param int $current_parent_id The current parent item
@@ -79,7 +81,7 @@ interface phpbb_tree_tree_interface
/**
* Change parent item
*
- * Moves the item to the bottom of the new parent's list of children
+ * Moves the item to the bottom of the new \parent's list of children
*
* @param int $item_id The item to be moved
* @param int $new_parent_id The new parent item
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php
index 5530fe3f03..5a9aa21e8a 100644
--- a/phpBB/phpbb/user.php
+++ b/phpBB/phpbb/user.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb;
+
/**
* @ignore
*/
@@ -23,7 +25,7 @@ if (!defined('IN_PHPBB'))
*
* @package phpBB3
*/
-class phpbb_user extends phpbb_session
+class user extends \phpbb\session
{
var $lang = array();
var $help = array();
@@ -41,7 +43,7 @@ class phpbb_user extends phpbb_session
var $img_lang;
var $img_array = array();
- // Able to add new options (up to id 31)
+ // Able to add new \options (up to id 31)
var $keyoptions = array('viewimg' => 0, 'viewflash' => 1, 'viewsmilies' => 2, 'viewsigs' => 3, 'viewavatars' => 4, 'viewcensors' => 5, 'attachsig' => 6, 'bbcode' => 8, 'smilies' => 9, 'popuppm' => 10, 'sig_bbcode' => 15, 'sig_smilies' => 16, 'sig_links' => 17);
/**
@@ -151,12 +153,12 @@ class phpbb_user extends phpbb_session
try
{
- $this->timezone = new DateTimeZone($user_timezone);
+ $this->timezone = new \DateTimeZone($user_timezone);
}
- catch (Exception $e)
+ catch (\Exception $e)
{
// If the timezone the user has selected is invalid, we fall back to UTC.
- $this->timezone = new DateTimeZone('UTC');
+ $this->timezone = new \DateTimeZone('UTC');
}
// We include common language file here to not load it every time a custom language file is included
@@ -649,27 +651,27 @@ class phpbb_user extends phpbb_session
if (!isset($utc))
{
- $utc = new DateTimeZone('UTC');
+ $utc = new \DateTimeZone('UTC');
}
- $time = new phpbb_datetime($this, "@$gmepoch", $utc);
+ $time = new \phpbb\datetime($this, "@$gmepoch", $utc);
$time->setTimezone($this->timezone);
return $time->format($format, $forcedate);
}
/**
- * Create a phpbb_datetime object in the context of the current user
+ * Create a \phpbb\datetime object in the context of the current user
*
* @since 3.1
* @param string $time String in a format accepted by strtotime().
* @param DateTimeZone $timezone Time zone of the time.
- * @return phpbb_datetime Date time object linked to the current users locale
+ * @return \phpbb\datetime Date time object linked to the current users locale
*/
- public function create_datetime($time = 'now', DateTimeZone $timezone = null)
+ public function create_datetime($time = 'now', \DateTimeZone $timezone = null)
{
$timezone = $timezone ?: $this->timezone;
- return new phpbb_datetime($this, $time, $timezone);
+ return new \phpbb\datetime($this, $time, $timezone);
}
/**
@@ -680,10 +682,10 @@ class phpbb_user extends phpbb_session
* @param DateTimeZone $timezone Timezone of the date/time, falls back to timezone of current user
* @return int Returns the unix timestamp
*/
- public function get_timestamp_from_format($format, $time, DateTimeZone $timezone = null)
+ public function get_timestamp_from_format($format, $time, \DateTimeZone $timezone = null)
{
$timezone = $timezone ?: $this->timezone;
- $date = DateTime::createFromFormat($format, $time, $timezone);
+ $date = \DateTime::createFromFormat($format, $time, $timezone);
return ($date !== false) ? $date->format('U') : false;
}
diff --git a/phpBB/phpbb/user_loader.php b/phpBB/phpbb/user_loader.php
index 37bf9648c1..78620ab1b9 100644
--- a/phpBB/phpbb/user_loader.php
+++ b/phpBB/phpbb/user_loader.php
@@ -7,6 +7,8 @@
*
*/
+namespace phpbb;
+
/**
*/
if (!defined('IN_PHPBB'))
@@ -22,9 +24,9 @@ if (!defined('IN_PHPBB'))
* have to query the same user multiple times in
* different services.
*/
-class phpbb_user_loader
+class user_loader
{
- /** @var phpbb_db_driver */
+ /** @var \phpbb\db\driver\driver */
protected $db = null;
/** @var string */
@@ -46,12 +48,12 @@ class phpbb_user_loader
/**
* User loader constructor
*
- * @param phpbb_db_driver $db A database connection
+ * @param \phpbb\db\driver\driver $db A database connection
* @param string $phpbb_root_path Path to the phpbb includes directory.
* @param string $php_ext php file extension
* @param string $users_table The name of the database table (phpbb_users)
*/
- public function __construct(phpbb_db_driver $db, $phpbb_root_path, $php_ext, $users_table)
+ public function __construct(\phpbb\db\driver\driver $db, $phpbb_root_path, $php_ext, $users_table)
{
$this->db = $db;
diff --git a/phpBB/posting.php b/phpBB/posting.php
index f9d5295320..942821a233 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -697,7 +697,7 @@ if ($submit || $preview || $refresh)
$message_parser->message = utf8_normalize_nfc(request_var('message', '', true));
$post_data['username'] = utf8_normalize_nfc(request_var('username', $post_data['username'], true));
- $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, phpbb_request_request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
+ $post_data['post_edit_reason'] = ($request->variable('edit_reason', false, false, \phpbb\request\request_interface::POST) && $mode == 'edit' && $auth->acl_get('m_edit', $forum_id)) ? utf8_normalize_nfc(request_var('edit_reason', '', true)) : '';
$post_data['orig_topic_type'] = $post_data['topic_type'];
$post_data['topic_type'] = request_var('topic_type', (($mode != 'post') ? (int) $post_data['topic_type'] : POST_NORMAL));
diff --git a/phpBB/search.php b/phpBB/search.php
index 6da74b954f..fe6535c3d1 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -683,7 +683,7 @@ if ($keywords || $author || $author_id || $search_id || $submit)
if ($config['load_anon_lastread'] || ($user->data['is_registered'] && !$config['load_db_lastread']))
{
- $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, phpbb_request_request_interface::COOKIE);
+ $tracking_topics = $request->variable($config['cookie_name'] . '_track', '', true, \phpbb\request\request_interface::COOKIE);
$tracking_topics = ($tracking_topics) ? tracking_unserialize($tracking_topics) : array();
}
diff --git a/phpBB/ucp.php b/phpBB/ucp.php
index b1e576fee8..ee0584c081 100644
--- a/phpBB/ucp.php
+++ b/phpBB/ucp.php
@@ -139,9 +139,9 @@ switch ($mode)
{
$set_time = time() - 31536000;
- foreach ($request->variable_names(phpbb_request_request_interface::COOKIE) as $cookie_name)
+ foreach ($request->variable_names(\phpbb\request\request_interface::COOKIE) as $cookie_name)
{
- $cookie_data = $request->variable($cookie_name, '', true, phpbb_request_request_interface::COOKIE);
+ $cookie_data = $request->variable($cookie_name, '', true, \phpbb\request\request_interface::COOKIE);
// Only delete board cookies, no other ones...
if (strpos($cookie_name, $config['cookie_name'] . '_') !== 0)
diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php
index 5a59e021b3..e991f9dba8 100644
--- a/phpBB/viewforum.php
+++ b/phpBB/viewforum.php
@@ -191,7 +191,7 @@ if ($mark_read == 'topics')
'MESSAGE_TITLE' => $user->lang['INFORMATION'],
'MESSAGE_TEXT' => $user->lang['TOPICS_MARKED']
);
- $json_response = new phpbb_json_response();
+ $json_response = new \phpbb\json_response();
$json_response->send($data);
}
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php
index fb4fcf42bf..d3581b5fa2 100644
--- a/phpBB/viewtopic.php
+++ b/phpBB/viewtopic.php
@@ -716,9 +716,9 @@ if (!empty($topic_data['poll_start']))
// Cookie based guest tracking ... I don't like this but hum ho
// it's oft requested. This relies on "nice" users who don't feel
// the need to delete cookies to mess with results.
- if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, phpbb_request_request_interface::COOKIE))
+ if ($request->is_set($config['cookie_name'] . '_poll_' . $topic_id, \phpbb\request\request_interface::COOKIE))
{
- $cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, phpbb_request_request_interface::COOKIE));
+ $cur_voted_id = explode(',', $request->variable($config['cookie_name'] . '_poll_' . $topic_id, '', true, \phpbb\request\request_interface::COOKIE));
$cur_voted_id = array_map('intval', $cur_voted_id);
}
}
diff --git a/tests/acp_board/auth_provider/valid.php b/tests/acp_board/auth_provider/valid.php
index 42b14cb0af..cfc3c24833 100644
--- a/tests/acp_board/auth_provider/valid.php
+++ b/tests/acp_board/auth_provider/valid.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_auth_provider_acp_board_valid extends phpbb_auth_provider_base
+class phpbb_auth_provider_acp_board_valid extends \phpbb\auth\provider\base
{
public function login($username, $password)
{
diff --git a/tests/auth/provider_apache_test.php b/tests/auth/provider_apache_test.php
index 9aa5f676d1..e135a1f002 100644
--- a/tests/auth/provider_apache_test.php
+++ b/tests/auth/provider_apache_test.php
@@ -22,11 +22,11 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
global $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
- $config = new phpbb_config(array());
- $this->request = $this->getMock('phpbb_request');
- $this->user = $this->getMock('phpbb_user');
+ $config = new \phpbb\config\config(array());
+ $this->request = $this->getMock('\phpbb\request\request');
+ $this->user = $this->getMock('\phpbb\user');
- $this->provider = new phpbb_auth_provider_apache($db, $config, $this->request, $this->user, $phpbb_root_path, $phpEx);
+ $this->provider = new \phpbb\auth\provider\apache($db, $config, $this->request, $this->user, $phpbb_root_path, $phpEx);
}
public function getDataSet()
@@ -43,7 +43,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
- phpbb_request_request_interface::SERVER)
+ \phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')
@@ -61,7 +61,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
- phpbb_request_request_interface::SERVER)
+ \phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@@ -93,7 +93,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
- phpbb_request_request_interface::SERVER)
+ \phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->at(1))
->method('server')
@@ -194,7 +194,7 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
$this->request->expects($this->once())
->method('is_set')
->with('PHP_AUTH_USER',
- phpbb_request_request_interface::SERVER)
+ \phpbb\request\request_interface::SERVER)
->will($this->returnValue(true));
$this->request->expects($this->once())
->method('server')
diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php
index d876683f84..140a28cd3d 100644
--- a/tests/auth/provider_db_test.php
+++ b/tests/auth/provider_db_test.php
@@ -21,14 +21,14 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
global $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
- $config = new phpbb_config(array(
+ $config = new \phpbb\config\config(array(
'ip_login_limit_max' => 0,
'ip_login_limit_use_forwarded' => 0,
'max_login_attempts' => 0,
));
- $request = $this->getMock('phpbb_request');
- $user = $this->getMock('phpbb_user');
- $provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
+ $request = $this->getMock('\phpbb\request\request');
+ $user = $this->getMock('\phpbb\user');
+ $provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$expected = array(
'status' => LOGIN_SUCCESS,
diff --git a/tests/avatar/driver/barfoo.php b/tests/avatar/driver/barfoo.php
index 0b701a4d70..12a3943d6c 100644
--- a/tests/avatar/driver/barfoo.php
+++ b/tests/avatar/driver/barfoo.php
@@ -1,6 +1,6 @@
will($this->returnArgument(0));
// Prepare dependencies for avatar manager and driver
- $config = new phpbb_config(array());
- $request = $this->getMock('phpbb_request');
- $cache = $this->getMock('phpbb_cache_driver_driver_interface');
+ $config = new \phpbb\config\config(array());
+ $request = $this->getMock('\phpbb\request\request');
+ $cache = $this->getMock('\phpbb\cache\driver\driver_interface');
// $this->avatar_foobar will be needed later on
$this->avatar_foobar = $this->getMock('phpbb_avatar_driver_foobar', array('get_name'), array($config, $phpbb_root_path, $phpEx, $cache));
@@ -52,7 +52,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
$config['allow_avatar_' . get_class($this->avatar_barfoo)] = false;
// Set up avatar manager
- $this->manager = new phpbb_avatar_manager($config, $avatar_drivers, $this->phpbb_container);
+ $this->manager = new \phpbb\avatar\manager($config, $avatar_drivers, $this->phpbb_container);
}
protected function avatar_drivers()
@@ -203,7 +203,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
{
$cleaned_row = array();
- $cleaned_row = phpbb_avatar_manager::clean_row($input);
+ $cleaned_row = \phpbb\avatar\manager::clean_row($input);
foreach ($output as $key => $null)
{
$this->assertArrayHasKey($key, $cleaned_row);
@@ -222,7 +222,7 @@ class phpbb_avatar_manager_test extends PHPUnit_Framework_TestCase
public function test_localize_errors()
{
- $user = $this->getMock('phpbb_user');
+ $user = $this->getMock('\phpbb\user');
$lang_array = array(
array('FOOBAR_OFF', 'foobar_off'),
array('FOOBAR_EXPLAIN', 'FOOBAR_EXPLAIN %s'),
diff --git a/tests/cache/apc_driver_test.php b/tests/cache/apc_driver_test.php
index 3380762878..51f3ac24b6 100644
--- a/tests/cache/apc_driver_test.php
+++ b/tests/cache/apc_driver_test.php
@@ -30,7 +30,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
self::markTestSkipped('APC extension is not loaded');
}
- $php_ini = new phpbb_php_ini;
+ $php_ini = new \phpbb\php\ini;
if (!$php_ini->get_bool('apc.enabled'))
{
@@ -47,7 +47,7 @@ class phpbb_cache_apc_driver_test extends phpbb_cache_common_test_case
{
parent::setUp();
- $this->driver = new phpbb_cache_driver_apc;
+ $this->driver = new \phpbb\cache\driver\apc;
$this->driver->purge();
}
}
diff --git a/tests/cache/common_test_case.php b/tests/cache/common_test_case.php
index a5bc2bfda9..09190abc95 100644
--- a/tests/cache/common_test_case.php
+++ b/tests/cache/common_test_case.php
@@ -65,11 +65,11 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
public function test_cache_sql()
{
global $db, $cache, $phpbb_root_path, $phpEx;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$db = $this->new_dbal();
- $cache = new phpbb_cache_service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
+ $cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
- $sql = "SELECT * FROM phpbb_config
+ $sql = "SELECT * FROM \phpbb\config\config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);
@@ -77,16 +77,16 @@ abstract class phpbb_cache_common_test_case extends phpbb_database_test_case
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
$this->assertEquals($expected, $first_result);
- $sql = 'DELETE FROM phpbb_config';
+ $sql = 'DELETE FROM \phpbb\config\config';
$result = $db->sql_query($sql);
- $sql = "SELECT * FROM phpbb_config
+ $sql = "SELECT * FROM \phpbb\config\config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);
$this->assertEquals($expected, $db->sql_fetchrow($result));
- $sql = "SELECT * FROM phpbb_config
+ $sql = "SELECT * FROM \phpbb\config\config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql);
diff --git a/tests/cache/file_driver_test.php b/tests/cache/file_driver_test.php
index 745c6bb081..c0843e8ed9 100644
--- a/tests/cache/file_driver_test.php
+++ b/tests/cache/file_driver_test.php
@@ -36,7 +36,7 @@ class phpbb_cache_file_driver_test extends phpbb_cache_common_test_case
}
$this->create_cache_dir();
- $this->driver = new phpbb_cache_driver_file($this->cache_dir);
+ $this->driver = new \phpbb\cache\driver\file($this->cache_dir);
}
protected function tearDown()
diff --git a/tests/cache/null_driver_test.php b/tests/cache/null_driver_test.php
index 43a0cc806c..ce78f333dd 100644
--- a/tests/cache/null_driver_test.php
+++ b/tests/cache/null_driver_test.php
@@ -20,7 +20,7 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
{
parent::setUp();
- $this->driver = new phpbb_cache_driver_null;
+ $this->driver = new \phpbb\cache\driver\null;
}
public function test_get_put()
@@ -48,23 +48,23 @@ class phpbb_cache_null_driver_test extends phpbb_database_test_case
public function test_cache_sql()
{
global $db, $cache, $phpbb_root_path, $phpEx;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$db = $this->new_dbal();
- $cache = new phpbb_cache_service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
+ $cache = new \phpbb\cache\service($this->driver, $config, $db, $phpbb_root_path, $phpEx);
- $sql = "SELECT * FROM phpbb_config
+ $sql = "SELECT * FROM \phpbb\config\config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);
$first_result = $db->sql_fetchrow($result);
$expected = array('config_name' => 'foo', 'config_value' => '23', 'is_dynamic' => 0);
$this->assertEquals($expected, $first_result);
- $sql = 'DELETE FROM phpbb_config';
+ $sql = 'DELETE FROM \phpbb\config\config';
$result = $db->sql_query($sql);
// As null cache driver does not actually cache,
// this should return no results
- $sql = "SELECT * FROM phpbb_config
+ $sql = "SELECT * FROM \phpbb\config\config
WHERE config_name = 'foo'";
$result = $db->sql_query($sql, 300);
diff --git a/tests/cache/redis_driver_test.php b/tests/cache/redis_driver_test.php
index 1308519a18..3d954dc0db 100644
--- a/tests/cache/redis_driver_test.php
+++ b/tests/cache/redis_driver_test.php
@@ -43,7 +43,7 @@ class phpbb_cache_redis_driver_test extends phpbb_cache_common_test_case
{
parent::setUp();
- $this->driver = new phpbb_cache_driver_redis(self::$config['host'], self::$config['port']);
+ $this->driver = new \phpbb\cache\driver\redis(self::$config['host'], self::$config['port']);
$this->driver->purge();
}
}
diff --git a/tests/class_loader/class_loader_test.php b/tests/class_loader/class_loader_test.php
index 2b55c1ff8d..19f9280ec1 100644
--- a/tests/class_loader/class_loader_test.php
+++ b/tests/class_loader/class_loader_test.php
@@ -30,7 +30,7 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
public function test_resolve_path()
{
$prefix = dirname(__FILE__) . '/';
- $class_loader = new phpbb_class_loader('phpbb_', $prefix . 'phpbb/');
+ $class_loader = new \phpbb\class_loader('phpbb_', $prefix . 'phpbb/');
$prefix .= 'phpbb/';
@@ -71,8 +71,8 @@ class phpbb_class_loader_test extends PHPUnit_Framework_TestCase
$cache = new phpbb_mock_cache($cache_map);
$prefix = dirname(__FILE__) . '/';
- $class_loader = new phpbb_class_loader('phpbb_', $prefix . 'phpbb/', 'php', $cache);
- $class_loader_ext = new phpbb_class_loader('phpbb_ext_', $prefix . 'phpbb/', 'php', $cache);
+ $class_loader = new \phpbb\class_loader('phpbb_', $prefix . 'phpbb/', 'php', $cache);
+ $class_loader_ext = new \phpbb\class_loader('phpbb_ext_', $prefix . 'phpbb/', 'php', $cache);
$prefix .= 'phpbb/';
diff --git a/tests/config/config_test.php b/tests/config/config_test.php
index 5845cc4590..5373fcef5f 100644
--- a/tests/config/config_test.php
+++ b/tests/config/config_test.php
@@ -11,7 +11,7 @@ class phpbb_config_test extends phpbb_test_case
{
public function test_offset_exists()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$this->assertTrue(isset($config['foo']));
$this->assertFalse(isset($config['foobar']));
@@ -19,19 +19,19 @@ class phpbb_config_test extends phpbb_test_case
public function test_offset_get()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$this->assertEquals('bar', $config['foo']);
}
public function test_offset_get_missing()
{
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$this->assertEquals('', $config['foo']);
}
public function test_offset_set()
{
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$config['foo'] = 'x';
$this->assertEquals('x', $config['foo']);
}
@@ -39,20 +39,20 @@ class phpbb_config_test extends phpbb_test_case
public function test_offset_unset_fails()
{
$this->setExpectedTriggerError(E_USER_ERROR);
- $config = new phpbb_config(array('foo' => 'x'));
+ $config = new \phpbb\config\config(array('foo' => 'x'));
unset($config['foo']);
}
public function test_count()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$this->assertEquals(1, count($config));
}
public function test_iterate()
{
$vars = array('foo' => '23', 'bar' => '42');
- $config = new phpbb_config($vars);
+ $config = new \phpbb\config\config($vars);
$count = 0;
foreach ($config as $key => $value)
@@ -68,42 +68,42 @@ class phpbb_config_test extends phpbb_test_case
public function test_set_overwrite()
{
- $config = new phpbb_config(array('foo' => 'x'));
+ $config = new \phpbb\config\config(array('foo' => 'x'));
$config->set('foo', 'bar');
$this->assertEquals('bar', $config['foo']);
}
public function test_set_new()
{
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$config->set('foo', 'bar');
$this->assertEquals('bar', $config['foo']);
}
public function test_set_atomic_overwrite()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$this->assertTrue($config->set_atomic('foo', 'bar', '23'));
$this->assertEquals('23', $config['foo']);
}
public function test_set_atomic_new()
{
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$this->assertTrue($config->set_atomic('foo', false, '23'));
$this->assertEquals('23', $config['foo']);
}
public function test_set_atomic_failure()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$this->assertFalse($config->set_atomic('foo', 'wrong', '23'));
$this->assertEquals('bar', $config['foo']);
}
public function test_increment()
{
- $config = new phpbb_config(array('foo' => '23'));
+ $config = new \phpbb\config\config(array('foo' => '23'));
$config->increment('foo', 3);
$this->assertEquals(26, $config['foo']);
$config->increment('foo', 1);
@@ -112,7 +112,7 @@ class phpbb_config_test extends phpbb_test_case
public function test_delete()
{
- $config = new phpbb_config(array('foo' => 'bar'));
+ $config = new \phpbb\config\config(array('foo' => 'bar'));
$config->delete('foo');
$this->assertFalse(isset($config['foo']));
diff --git a/tests/config/db_test.php b/tests/config/db_test.php
index 0b8f73d53a..a014c72c65 100644
--- a/tests/config/db_test.php
+++ b/tests/config/db_test.php
@@ -24,7 +24,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->cache = new phpbb_mock_cache;
$this->db = $this->new_dbal();
- $this->config = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $this->config = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
}
public function test_load_config()
@@ -36,7 +36,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
public function test_load_cached()
{
$cache = new phpbb_mock_cache(array('config' => array('x' => 'y')));
- $this->config = new phpbb_config_db($this->db, $cache, 'phpbb_config');
+ $this->config = new \phpbb\config\db($this->db, $cache, '\phpbb\config\config');
$this->assertTrue(!isset($this->config['foo']));
$this->assertEquals('42', $this->config['bar']);
@@ -49,7 +49,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->config['foo'] = 'x'; // temporary set
$this->assertEquals('x', $this->config['foo']);
- $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
$this->assertEquals('23', $config2['foo']);
}
@@ -59,7 +59,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->assertEquals('17', $this->config['foo']);
// re-read config and populate cache
- $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
$this->cache->checkVar($this, 'config', array('foo' => '17'));
}
@@ -68,7 +68,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->config->set('bar', '17', false);
// re-read config and populate cache
- $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
$this->cache->checkVar($this, 'config', array('foo' => '23'));
}
@@ -78,7 +78,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->assertEquals('5', $this->config['foobar']);
// re-read config and populate cache
- $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
$this->cache->checkVar($this, 'config', array('foo' => '23', 'foobar' => '5'));
}
@@ -88,7 +88,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
$this->assertEquals('5', $this->config['foobar']);
// re-read config and populate cache
- $config2 = new phpbb_config_db($this->db, $this->cache, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $this->cache, '\phpbb\config\config');
$this->cache->checkVar($this, 'config', array('foo' => '23'));
}
@@ -133,7 +133,7 @@ class phpbb_config_db_test extends phpbb_database_test_case
// re-read config and populate cache
$cache2 = new phpbb_mock_cache;
- $config2 = new phpbb_config_db($this->db, $cache2, 'phpbb_config');
+ $config2 = new \phpbb\config\db($this->db, $cache2, '\phpbb\config\config');
$cache2->checkVarUnset($this, 'foo');
$this->assertFalse(isset($config2['foo']));
}
diff --git a/tests/config/db_text_test.php b/tests/config/db_text_test.php
index 4818bba8c9..354c0efacf 100644
--- a/tests/config/db_text_test.php
+++ b/tests/config/db_text_test.php
@@ -22,7 +22,7 @@ class phpbb_config_db_text_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->config_text = new phpbb_config_db_text($this->db, 'phpbb_config_text');
+ $this->config_text = new \phpbb\config\db_text($this->db, 'phpbb_config_text');
}
public function test_get()
diff --git a/tests/content_visibility/delete_post_test.php b/tests/content_visibility/delete_post_test.php
index 6234aac9ad..b2bdcb3b49 100644
--- a/tests/content_visibility/delete_post_test.php
+++ b/tests/content_visibility/delete_post_test.php
@@ -267,21 +267,21 @@ class phpbb_content_visibility_delete_post_test extends phpbb_database_test_case
$config['search_type'] = 'phpbb_mock_search';
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- set_config_count(null, null, null, new phpbb_config(array('num_posts' => 3, 'num_topics' => 1)));
+ set_config_count(null, null, null, new \phpbb\config\config(array('num_posts' => 3, 'num_topics' => 1)));
// Create auth mock
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap(array(
array('m_approve', 1, true),
)));
- $user = $this->getMock('phpbb_user');
+ $user = $this->getMock('\phpbb\user');
$phpbb_container = new phpbb_mock_container_builder();
$phpbb_container->set('notification_manager', new phpbb_mock_notification_manager());
- $phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
delete_post($forum_id, $topic_id, $post_id, $data, $is_soft, $reason);
diff --git a/tests/content_visibility/get_forums_visibility_sql_test.php b/tests/content_visibility/get_forums_visibility_sql_test.php
index aa44fa4013..22f210c406 100644
--- a/tests/content_visibility/get_forums_visibility_sql_test.php
+++ b/tests/content_visibility/get_forums_visibility_sql_test.php
@@ -125,13 +125,13 @@ class phpbb_content_visibility_get_forums_visibility_sql_test extends phpbb_data
$db = $this->new_dbal();
// Create auth mock
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_getf')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
- $user = $this->getMock('phpbb_user');
- $content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $user = $this->getMock('\phpbb\user');
+ $content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/get_global_visibility_sql_test.php b/tests/content_visibility/get_global_visibility_sql_test.php
index 0f019ffa50..9488a8c0b3 100644
--- a/tests/content_visibility/get_global_visibility_sql_test.php
+++ b/tests/content_visibility/get_global_visibility_sql_test.php
@@ -125,13 +125,13 @@ class phpbb_content_visibility_get_global_visibility_sql_test extends phpbb_data
$db = $this->new_dbal();
// Create auth mock
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_getf')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
- $user = $this->getMock('phpbb_user');
- $content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $user = $this->getMock('\phpbb\user');
+ $content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/get_visibility_sql_test.php b/tests/content_visibility/get_visibility_sql_test.php
index cc6c10c649..111e735650 100644
--- a/tests/content_visibility/get_visibility_sql_test.php
+++ b/tests/content_visibility/get_visibility_sql_test.php
@@ -72,13 +72,13 @@ class phpbb_content_visibility_get_visibility_sql_test extends phpbb_database_te
$db = $this->new_dbal();
// Create auth mock
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'), $this->anything())
->will($this->returnValueMap($permissions));
- $user = $this->getMock('phpbb_user');
- $content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $user = $this->getMock('\phpbb\user');
+ $content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$result = $db->sql_query('SELECT ' . $mode . '_id
FROM ' . $table . '
diff --git a/tests/content_visibility/set_post_visibility_test.php b/tests/content_visibility/set_post_visibility_test.php
index 81abf56c75..f81b83ff86 100644
--- a/tests/content_visibility/set_post_visibility_test.php
+++ b/tests/content_visibility/set_post_visibility_test.php
@@ -119,9 +119,9 @@ class phpbb_content_visibility_set_post_visibility_test extends phpbb_database_t
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $auth = $this->getMock('phpbb_auth');
- $user = $this->getMock('phpbb_user');
- $content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $user = $this->getMock('\phpbb\user');
+ $content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_post_visibility($visibility, $post_id, $topic_id, $forum_id, $user_id, $time, $reason, $is_starter, $is_latest);
diff --git a/tests/content_visibility/set_topic_visibility_test.php b/tests/content_visibility/set_topic_visibility_test.php
index 6b5d884a2b..92b1253a15 100644
--- a/tests/content_visibility/set_topic_visibility_test.php
+++ b/tests/content_visibility/set_topic_visibility_test.php
@@ -83,9 +83,9 @@ class phpbb_content_visibility_set_topic_visibility_test extends phpbb_database_
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $auth = $this->getMock('phpbb_auth');
- $user = $this->getMock('phpbb_user');
- $content_visibility = new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $user = $this->getMock('\phpbb\user');
+ $content_visibility = new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE);
$content_visibility->set_topic_visibility($visibility, $topic_id, $forum_id, $user_id, $time, $reason, $force_update_all);
diff --git a/tests/controller/controller_test.php b/tests/controller/controller_test.php
index dfc4f80469..9445ea53d4 100644
--- a/tests/controller/controller_test.php
+++ b/tests/controller/controller_test.php
@@ -31,7 +31,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
public function test_provider()
{
- $provider = new phpbb_controller_provider;
+ $provider = new \phpbb\controller\provider;
$routes = $provider
->import_paths_from_finder($this->extension_manager->get_finder())
->find('./tests/controller/');
@@ -62,7 +62,7 @@ class phpbb_controller_controller_test extends phpbb_test_case
include(__DIR__.'/phpbb/controller/foo.php');
}
- $resolver = new phpbb_controller_resolver(new phpbb_user, $container);
+ $resolver = new \phpbb\controller\resolver(new \phpbb\user, $container);
$symfony_request = new Request();
$symfony_request->attributes->set('_controller', 'foo.controller:handle');
diff --git a/tests/controller/helper_url_test.php b/tests/controller/helper_url_test.php
index 6686b77e8f..d5d61d40d9 100644
--- a/tests/controller/helper_url_test.php
+++ b/tests/controller/helper_url_test.php
@@ -48,14 +48,14 @@ class phpbb_controller_helper_url_test extends phpbb_test_case
global $phpbb_dispatcher, $phpbb_root_path, $phpEx;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher;
- $this->style_resource_locator = new phpbb_style_resource_locator();
- $this->user = $this->getMock('phpbb_user');
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
- $this->style_resource_locator = new phpbb_style_resource_locator();
- $this->style_provider = new phpbb_style_path_provider();
- $this->style = new phpbb_style($phpbb_root_path, $phpEx, new phpbb_config(array()), $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->style_resource_locator = new \phpbb\style\resource_locator();
+ $this->user = $this->getMock('\phpbb\user');
+ $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
+ $this->style_resource_locator = new \phpbb\style\resource_locator();
+ $this->style_provider = new \phpbb\style\path_provider();
+ $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, new \phpbb\config\config(array()), $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
- $helper = new phpbb_controller_helper($this->template, $this->user, '', 'php');
+ $helper = new \phpbb\controller\helper($this->template, $this->user, '', 'php');
$this->assertEquals($helper->url($route, $params, $is_amp, $session_id), $expected);
}
}
diff --git a/tests/cron/ext/testext/cron/dummy_task.php b/tests/cron/ext/testext/cron/dummy_task.php
index 3e81db1895..8cdb6b09d5 100644
--- a/tests/cron/ext/testext/cron/dummy_task.php
+++ b/tests/cron/ext/testext/cron/dummy_task.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_ext_testext_cron_dummy_task extends phpbb_cron_task_base
+class phpbb_ext_testext_cron_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;
diff --git a/tests/cron/includes/cron/task/core/dummy_task.php b/tests/cron/includes/cron/task/core/dummy_task.php
index c94455603f..c34684701b 100644
--- a/tests/cron/includes/cron/task/core/dummy_task.php
+++ b/tests/cron/includes/cron/task/core/dummy_task.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_cron_task_core_dummy_task extends phpbb_cron_task_base
+class phpbb_cron_task_core_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;
diff --git a/tests/cron/includes/cron/task/core/second_dummy_task.php b/tests/cron/includes/cron/task/core/second_dummy_task.php
index 77ef6f70ed..1b212ab05d 100644
--- a/tests/cron/includes/cron/task/core/second_dummy_task.php
+++ b/tests/cron/includes/cron/task/core/second_dummy_task.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_cron_task_core_second_dummy_task extends phpbb_cron_task_base
+class phpbb_cron_task_core_second_dummy_task extends \phpbb\cron\task\base
{
static public $was_run = 0;
diff --git a/tests/cron/manager_test.php b/tests/cron/manager_test.php
index 3c541be2a6..713f44c1e2 100644
--- a/tests/cron/manager_test.php
+++ b/tests/cron/manager_test.php
@@ -29,7 +29,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_shipped_task_by_name()
{
$task = $this->manager->find_task($this->task_name);
- $this->assertInstanceOf('phpbb_cron_task_wrapper', $task);
+ $this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
$this->assertEquals($this->task_name, $task->get_name());
}
@@ -42,7 +42,7 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
public function test_manager_finds_one_ready_task()
{
$task = $this->manager->find_one_ready_task();
- $this->assertInstanceOf('phpbb_cron_task_wrapper', $task);
+ $this->assertInstanceOf('\phpbb\cron\task\wrapper', $task);
}
public function test_manager_finds_only_ready_tasks()
@@ -71,6 +71,6 @@ class phpbb_cron_manager_test extends PHPUnit_Framework_TestCase
{
global $phpbb_root_path, $phpEx;
- return new phpbb_cron_manager($tasks, $phpbb_root_path, $phpEx);
+ return new \phpbb\cron\manager($tasks, $phpbb_root_path, $phpEx);
}
}
diff --git a/tests/cron/tasks/simple_not_runnable.php b/tests/cron/tasks/simple_not_runnable.php
index 56d484eacd..4951b5b4b9 100644
--- a/tests/cron/tasks/simple_not_runnable.php
+++ b/tests/cron/tasks/simple_not_runnable.php
@@ -1,6 +1,6 @@
timezone = new DateTimeZone($timezone);
$user->lang['datetime'] = array(
'TODAY' => 'Today',
diff --git a/tests/dbal/auto_increment_test.php b/tests/dbal/auto_increment_test.php
index 077bfad933..2196292e83 100644
--- a/tests/dbal/auto_increment_test.php
+++ b/tests/dbal/auto_increment_test.php
@@ -26,7 +26,7 @@ class phpbb_dbal_auto_increment_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->tools = new phpbb_db_tools($this->db);
+ $this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(
diff --git a/tests/dbal/case_test.php b/tests/dbal/case_test.php
index 57a1729a39..edab3525a1 100644
--- a/tests/dbal/case_test.php
+++ b/tests/dbal/case_test.php
@@ -19,13 +19,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case('1 = 1', '1', '2') . ' AS test_num
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals(1, (int) $db->sql_fetchfield('test_num'));
$sql = 'SELECT ' . $db->sql_case('1 = 0', '1', '2') . ' AS test_num
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals(2, (int) $db->sql_fetchfield('test_num'));
@@ -36,13 +36,13 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case('1 = 1', "'foo'", "'bar'") . ' AS test_string
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('foo', $db->sql_fetchfield('test_string'));
$sql = 'SELECT ' . $db->sql_case('1 = 0', "'foo'", "'bar'") . ' AS test_string
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('bar', $db->sql_fetchfield('test_string'));
@@ -53,14 +53,14 @@ class phpbb_dbal_case_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
- FROM phpbb_config
+ FROM \phpbb\config\config
WHERE config_name = 'config1'";
$result = $db->sql_query_limit($sql, 1);
$this->assertEquals('config1', $db->sql_fetchfield('test_string'));
$sql = 'SELECT ' . $db->sql_case("config_name = 'config1'", 'config_name', 'config_value') . " AS test_string
- FROM phpbb_config
+ FROM \phpbb\config\config
WHERE config_value = 'bar'";
$result = $db->sql_query_limit($sql, 1);
diff --git a/tests/dbal/concatenate_test.php b/tests/dbal/concatenate_test.php
index 0891fa58a0..818bde7d23 100644
--- a/tests/dbal/concatenate_test.php
+++ b/tests/dbal/concatenate_test.php
@@ -19,7 +19,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', "'" . $db->sql_escape('append') . "'") . ' AS string
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);
@@ -43,7 +43,7 @@ class phpbb_dbal_concatenate_test extends phpbb_database_test_case
$db = $this->new_dbal();
$sql = 'SELECT config_name, ' . $db->sql_concatenate('config_name', 'config_value') . ' AS string
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$db->sql_return_on_error(false);
diff --git a/tests/dbal/db_tools_test.php b/tests/dbal/db_tools_test.php
index 7bdbc696e7..e25335165a 100644
--- a/tests/dbal/db_tools_test.php
+++ b/tests/dbal/db_tools_test.php
@@ -26,7 +26,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->tools = new phpbb_db_tools($this->db);
+ $this->tools = new \phpbb\db\tools($this->db);
$this->table_data = array(
'COLUMNS' => array(
@@ -254,7 +254,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_peform_schema_changes_drop_tables()
{
- $db_tools = $this->getMock('phpbb_db_tools', array(
+ $db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_table_exists',
'sql_table_drop',
), array(&$this->db));
@@ -280,7 +280,7 @@ class phpbb_dbal_db_tools_test extends phpbb_database_test_case
public function test_peform_schema_changes_drop_columns()
{
- $db_tools = $this->getMock('phpbb_db_tools', array(
+ $db_tools = $this->getMock('\phpbb\db\tools', array(
'sql_column_exists',
'sql_column_remove',
), array(&$this->db));
diff --git a/tests/dbal/migration/dummy.php b/tests/dbal/migration/dummy.php
index 0ac6e733a1..3f48f22252 100644
--- a/tests/dbal/migration/dummy.php
+++ b/tests/dbal/migration/dummy.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_dummy extends phpbb_db_migration
+class phpbb_dbal_migration_dummy extends \phpbb\db\migration\migration
{
static public function depends_on()
{
@@ -18,7 +18,7 @@ class phpbb_dbal_migration_dummy extends phpbb_db_migration
{
return array(
'add_columns' => array(
- 'phpbb_config' => array(
+ '\phpbb\config\config' => array(
'extra_column' => array('UINT', 1),
),
),
diff --git a/tests/dbal/migration/fail.php b/tests/dbal/migration/fail.php
index f88d8169f5..d90972720d 100644
--- a/tests/dbal/migration/fail.php
+++ b/tests/dbal/migration/fail.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_fail extends phpbb_db_migration
+class phpbb_dbal_migration_fail extends \phpbb\db\migration\migration
{
function update_schema()
{
diff --git a/tests/dbal/migration/if.php b/tests/dbal/migration/if.php
index 83fe21bd21..bbbda60ea3 100644
--- a/tests/dbal/migration/if.php
+++ b/tests/dbal/migration/if.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_if extends phpbb_db_migration
+class phpbb_dbal_migration_if extends \phpbb\db\migration\migration
{
function update_schema()
{
diff --git a/tests/dbal/migration/installed.php b/tests/dbal/migration/installed.php
index 01829f7a99..4b86896d9c 100644
--- a/tests/dbal/migration/installed.php
+++ b/tests/dbal/migration/installed.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_installed extends phpbb_db_migration
+class phpbb_dbal_migration_installed extends \phpbb\db\migration\migration
{
function effectively_installed()
{
diff --git a/tests/dbal/migration/recall.php b/tests/dbal/migration/recall.php
index 6c2f04bf08..041d12ad27 100644
--- a/tests/dbal/migration/recall.php
+++ b/tests/dbal/migration/recall.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_recall extends phpbb_db_migration
+class phpbb_dbal_migration_recall extends \phpbb\db\migration\migration
{
function update_schema()
{
diff --git a/tests/dbal/migration/revert.php b/tests/dbal/migration/revert.php
index ac01987cd4..c46dfca30d 100644
--- a/tests/dbal/migration/revert.php
+++ b/tests/dbal/migration/revert.php
@@ -7,13 +7,13 @@
*
*/
-class phpbb_dbal_migration_revert extends phpbb_db_migration
+class phpbb_dbal_migration_revert extends \phpbb\db\migration\migration
{
function update_schema()
{
return array(
'add_columns' => array(
- 'phpbb_config' => array(
+ '\phpbb\config\config' => array(
'bar_column' => array('UINT', 1),
),
),
@@ -24,7 +24,7 @@ class phpbb_dbal_migration_revert extends phpbb_db_migration
{
return array(
'drop_columns' => array(
- 'phpbb_config' => array(
+ '\phpbb\config\config' => array(
'bar_column',
),
),
diff --git a/tests/dbal/migration/revert_with_dependency.php b/tests/dbal/migration/revert_with_dependency.php
index ca2c070e8c..0b09fb784d 100644
--- a/tests/dbal/migration/revert_with_dependency.php
+++ b/tests/dbal/migration/revert_with_dependency.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_revert_with_dependency extends phpbb_db_migration
+class phpbb_dbal_migration_revert_with_dependency extends \phpbb\db\migration\migration
{
static public function depends_on()
{
diff --git a/tests/dbal/migration/unfulfillable.php b/tests/dbal/migration/unfulfillable.php
index 6d375e6880..a1cdef9a23 100644
--- a/tests/dbal/migration/unfulfillable.php
+++ b/tests/dbal/migration/unfulfillable.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_dbal_migration_unfulfillable extends phpbb_db_migration
+class phpbb_dbal_migration_unfulfillable extends \phpbb\db\migration\migration
{
static public function depends_on()
{
diff --git a/tests/dbal/migrator_test.php b/tests/dbal/migrator_test.php
index 9e55e4dd35..d336854a1c 100644
--- a/tests/dbal/migrator_test.php
+++ b/tests/dbal/migrator_test.php
@@ -33,15 +33,15 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->db_tools = new phpbb_db_tools($this->db);
+ $this->db_tools = new \phpbb\db\tools($this->db);
- $this->config = new phpbb_config_db($this->db, new phpbb_mock_cache, 'phpbb_config');
+ $this->config = new \phpbb\config\db($this->db, new phpbb_mock_cache, '\phpbb\config\config');
$tools = array(
- new phpbb_db_migration_tool_config($this->config),
+ new \phpbb\db\migration\tool\config($this->config),
);
- $this->migrator = new phpbb_db_migrator(
+ $this->migrator = new \phpbb\db\migrator(
$this->config,
$this->db,
$this->db_tools,
@@ -55,11 +55,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
- $this->extension_manager = new phpbb_extension_manager(
+ $this->extension_manager = new \phpbb\extension\manager(
$container,
$this->db,
$this->config,
- new phpbb_filesystem(),
+ new \phpbb\filesystem(),
'phpbb_ext',
dirname(__FILE__) . '/../../phpBB/',
'php',
@@ -91,7 +91,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('extra_column' => '1')),
- "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
+ "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Dummy migration created extra_column with value 1 in all rows.'
);
@@ -107,7 +107,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
);
// cleanup
- $this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
+ $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column');
}
public function test_unfulfillable()
@@ -123,11 +123,11 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('extra_column' => '1')),
- "SELECT extra_column FROM phpbb_config WHERE config_name = 'foo'",
+ "SELECT extra_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Dummy migration was run, even though an unfulfillable migration was found.'
);
- $this->db_tools->sql_column_remove('phpbb_config', 'extra_column');
+ $this->db_tools->sql_column_remove('\phpbb\config\config', 'extra_column');
}
public function test_if()
@@ -192,7 +192,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertSqlResultEquals(
array(array('bar_column' => '1')),
- "SELECT bar_column FROM phpbb_config WHERE config_name = 'foo'",
+ "SELECT bar_column FROM \phpbb\config\config WHERE config_name = 'foo'",
'Installing revert migration failed to create bar_column.'
);
@@ -208,7 +208,7 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->assertFalse(isset($this->config['foobartest']));
- $sql = 'SELECT * FROM phpbb_config';
+ $sql = 'SELECT * FROM \phpbb\config\config';
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
@@ -232,12 +232,12 @@ class phpbb_dbal_migrator_test extends phpbb_database_test_case
$this->migrator->update();
}
}
- catch (phpbb_db_migration_exception $e) {}
+ catch (\phpbb\db\migration\exception $e) {}
// Failure should have caused an automatic roll-back, so this should not exist.
$this->assertFalse(isset($this->config['foobar3']));
- $sql = 'SELECT * FROM phpbb_config';
+ $sql = 'SELECT * FROM \phpbb\config\config';
$result = $this->db->sql_query_limit($sql, 1);
$row = $this->db->sql_fetchrow($result);
$this->db->sql_freeresult($result);
diff --git a/tests/dbal/migrator_tool_config_test.php b/tests/dbal/migrator_tool_config_test.php
index b82d1ef48d..a8d8966839 100644
--- a/tests/dbal/migrator_tool_config_test.php
+++ b/tests/dbal/migrator_tool_config_test.php
@@ -11,9 +11,9 @@ class phpbb_dbal_migrator_tool_config_test extends phpbb_test_case
{
public function setup()
{
- $this->config = new phpbb_config(array());
+ $this->config = new \phpbb\config\config(array());
- $this->tool = new phpbb_db_migration_tool_config($this->config);
+ $this->tool = new \phpbb\db\migration\tool\config($this->config);
parent::setup();
}
diff --git a/tests/dbal/migrator_tool_module_test.php b/tests/dbal/migrator_tool_module_test.php
index 828fb76c65..3c23891348 100644
--- a/tests/dbal/migrator_tool_module_test.php
+++ b/tests/dbal/migrator_tool_module_test.php
@@ -27,15 +27,15 @@ class phpbb_dbal_migrator_tool_module_test extends phpbb_database_test_case
$skip_add_log = true;
$db = $this->db = $this->new_dbal();
- $this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx);
- $user = $this->user = new phpbb_user();
+ $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
+ $user = $this->user = new \phpbb\user();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $auth = $this->getMock('phpbb_auth');
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $auth = $this->getMock('\phpbb\auth\auth');
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
- $this->tool = new phpbb_db_migration_tool_module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules');
+ $this->tool = new \phpbb\db\migration\tool\module($this->db, $this->cache, $this->user, $phpbb_root_path, $phpEx, 'phpbb_modules');
}
public function exists_data()
diff --git a/tests/dbal/migrator_tool_permission_test.php b/tests/dbal/migrator_tool_permission_test.php
index 79d9db66da..1090b4726a 100644
--- a/tests/dbal/migrator_tool_permission_test.php
+++ b/tests/dbal/migrator_tool_permission_test.php
@@ -24,10 +24,10 @@ class phpbb_dbal_migrator_tool_permission_test extends phpbb_database_test_case
parent::setup();
$db = $this->db = $this->new_dbal();
- $cache = $this->cache = new phpbb_cache_service(new phpbb_cache_driver_null(), new phpbb_config(array()), $this->db, $phpbb_root_path, $phpEx);
- $this->auth = new phpbb_auth();
+ $cache = $this->cache = new \phpbb\cache\service(new \phpbb\cache\driver\null(), new \phpbb\config\config(array()), $this->db, $phpbb_root_path, $phpEx);
+ $this->auth = new \phpbb\auth\auth();
- $this->tool = new phpbb_db_migration_tool_permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
+ $this->tool = new \phpbb\db\migration\tool\permission($this->db, $this->cache, $this->auth, $phpbb_root_path, $phpEx);
}
public function exists_data()
diff --git a/tests/dbal/schema_test.php b/tests/dbal/schema_test.php
index 2a332fddba..a09daa0f76 100644
--- a/tests/dbal/schema_test.php
+++ b/tests/dbal/schema_test.php
@@ -21,13 +21,13 @@ class phpbb_dbal_schema_test extends phpbb_database_test_case
$db = $this->new_dbal();
$value = str_repeat("\xC3\x84", 255);
- $sql = "INSERT INTO phpbb_config
+ $sql = "INSERT INTO \phpbb\config\config
(config_name, config_value)
VALUES ('name', '$value')";
$result = $db->sql_query($sql);
$sql = "SELECT config_value
- FROM phpbb_config
+ FROM \phpbb\config\config
WHERE config_name = 'name'";
$result = $db->sql_query_limit($sql, 1);
$row = $db->sql_fetchrow($result);
diff --git a/tests/dbal/sql_insert_buffer_test.php b/tests/dbal/sql_insert_buffer_test.php
index 45339a6b50..976495d195 100644
--- a/tests/dbal/sql_insert_buffer_test.php
+++ b/tests/dbal/sql_insert_buffer_test.php
@@ -17,7 +17,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->buffer = new phpbb_db_sql_insert_buffer($this->db, 'phpbb_config', 2);
+ $this->buffer = new \phpbb\db\sql_insert_buffer($this->db, '\phpbb\config\config', 2);
$this->assert_config_count(2);
}
@@ -81,7 +81,7 @@ class phpbb_dbal_sql_insert_buffer_test extends phpbb_database_test_case
protected function assert_config_count($num_configs)
{
$sql = 'SELECT COUNT(*) AS num_configs
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $this->db->sql_query($sql);
$this->assertEquals($num_configs, $this->db->sql_fetchfield('num_configs'));
$this->db->sql_freeresult($result);
diff --git a/tests/dbal/write_test.php b/tests/dbal/write_test.php
index 987161a831..c0f0c271d2 100644
--- a/tests/dbal/write_test.php
+++ b/tests/dbal/write_test.php
@@ -39,11 +39,11 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $sql = 'INSERT INTO phpbb_config ' . $db->sql_build_array('INSERT', $sql_ary);
+ $sql = 'INSERT INTO \phpbb\config\config ' . $db->sql_build_array('INSERT', $sql_ary);
$result = $db->sql_query($sql);
$sql = "SELECT *
- FROM phpbb_config
+ FROM \phpbb\config\config
WHERE config_name = '" . $sql_ary['config_name'] . "'";
$result = $db->sql_query_limit($sql, 1);
@@ -56,12 +56,12 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $sql = "DELETE FROM phpbb_config
+ $sql = "DELETE FROM \phpbb\config\config
WHERE config_name = 'config1'";
$result = $db->sql_query($sql);
$sql = 'SELECT *
- FROM phpbb_config';
+ FROM \phpbb\config\config';
$result = $db->sql_query($sql);
$rows = $db->sql_fetchrowset($result);
@@ -76,7 +76,7 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
$db = $this->new_dbal();
// empty the table
- $sql = 'DELETE FROM phpbb_config';
+ $sql = 'DELETE FROM \phpbb\config\config';
$db->sql_query($sql);
$batch_ary = array(
@@ -92,10 +92,10 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
),
);
- $result = $db->sql_multi_insert('phpbb_config', $batch_ary);
+ $result = $db->sql_multi_insert('\phpbb\config\config', $batch_ary);
$sql = 'SELECT *
- FROM phpbb_config
+ FROM \phpbb\config\config
ORDER BY config_name ASC';
$result = $db->sql_query($sql);
@@ -155,12 +155,12 @@ class phpbb_dbal_write_test extends phpbb_database_test_case
{
$db = $this->new_dbal();
- $sql = 'UPDATE phpbb_config
+ $sql = 'UPDATE \phpbb\config\config
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . $where;
$result = $db->sql_query($sql);
$sql = 'SELECT *
- FROM phpbb_config
+ FROM \phpbb\config\config
ORDER BY config_name ASC';
$result = $db->sql_query($sql);
diff --git a/tests/di/create_container_test.php b/tests/di/create_container_test.php
index b3992dbd80..ffa37d3b3d 100644
--- a/tests/di/create_container_test.php
+++ b/tests/di/create_container_test.php
@@ -16,8 +16,8 @@ class phpbb_di_container_test extends phpbb_test_case
{
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
- new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
- new phpbb_di_extension_core($phpbb_root_path),
+ new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
+ new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_container($extensions, $phpbb_root_path, 'php');
@@ -28,8 +28,8 @@ class phpbb_di_container_test extends phpbb_test_case
{
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$extensions = array(
- new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
- new phpbb_di_extension_core($phpbb_root_path),
+ new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
+ new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_install_container($phpbb_root_path, 'php');
@@ -42,8 +42,8 @@ class phpbb_di_container_test extends phpbb_test_case
$phpbb_root_path = __DIR__ . '/../../phpBB/';
$config_file = __DIR__ . '/fixtures/config.php';
$extensions = array(
- new phpbb_di_extension_config(__DIR__ . '/fixtures/config.php'),
- new phpbb_di_extension_core($phpbb_root_path),
+ new \phpbb\di\extension\config(__DIR__ . '/fixtures/config.php'),
+ new \phpbb\di\extension\core($phpbb_root_path),
);
$container = phpbb_create_compiled_container($config_file, $extensions, array(), $phpbb_root_path, 'php');
@@ -52,7 +52,7 @@ class phpbb_di_container_test extends phpbb_test_case
}
}
-class phpbb_db_driver_container_mock extends phpbb_db_driver
+class phpbb_db_driver_container_mock extends \phpbb\db\driver\driver
{
public function sql_connect()
{
diff --git a/tests/di/fixtures/config.php b/tests/di/fixtures/config.php
index 5033d2dc9f..04e20f63d8 100644
--- a/tests/di/fixtures/config.php
+++ b/tests/di/fixtures/config.php
@@ -8,4 +8,4 @@ $dbname = 'phpbb';
$dbuser = 'root';
$dbpasswd = '';
$table_prefix = 'phpbb_';
-$acm_type = 'phpbb_cache_driver_null';
+$acm_type = '\phpbb\cache\driver\null';
diff --git a/tests/error_collector_test.php b/tests/error_collector_test.php
index fceb8aa3d8..0804c64f6f 100644
--- a/tests/error_collector_test.php
+++ b/tests/error_collector_test.php
@@ -13,7 +13,7 @@ class phpbb_error_collector_test extends phpbb_test_case
{
public function test_collection()
{
- $collector = new phpbb_error_collector;
+ $collector = new \phpbb\error_collector;
$collector->install();
// Cause a warning
diff --git a/tests/event/dispatcher_test.php b/tests/event/dispatcher_test.php
index 9b9203e06a..a76df90809 100644
--- a/tests/event/dispatcher_test.php
+++ b/tests/event/dispatcher_test.php
@@ -11,9 +11,9 @@ class phpbb_event_dispatcher_test extends phpbb_test_case
{
public function test_trigger_event()
{
- $dispatcher = new phpbb_event_dispatcher(new phpbb_mock_container_builder());
+ $dispatcher = new \phpbb\event\dispatcher(new phpbb_mock_container_builder());
- $dispatcher->addListener('core.test_event', function (phpbb_event_data $event) {
+ $dispatcher->addListener('core.test_event', function (\phpbb\event\data $event) {
$event['foo'] = $event['foo'] . '2';
$event['bar'] = $event['bar'] . '2';
});
diff --git a/tests/extension/ext/bar/ext.php b/tests/extension/ext/bar/ext.php
index 5585edf9ac..edae25663a 100644
--- a/tests/extension/ext/bar/ext.php
+++ b/tests/extension/ext/bar/ext.php
@@ -1,6 +1,6 @@
extension_manager, new phpbb_filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
+ $finder = new \phpbb\extension\finder($this->extension_manager, new \phpbb\filesystem(), dirname(__FILE__) . '/', $cache, 'php', '_custom_cache_name');
$files = $finder->suffix('_class.php')->get_files();
$expected_files = array(
@@ -219,9 +219,9 @@ class phpbb_extension_finder_test extends phpbb_test_case
'is_dir' => false,
);
- $finder = new phpbb_extension_finder(
+ $finder = new \phpbb\extension\finder(
$this->extension_manager,
- new phpbb_filesystem(),
+ new \phpbb\filesystem(),
dirname(__FILE__) . '/',
new phpbb_mock_cache(array(
'_ext_finder' => array(
diff --git a/tests/extension/manager_test.php b/tests/extension/manager_test.php
index a23e5a18d9..fd9e800c02 100644
--- a/tests/extension/manager_test.php
+++ b/tests/extension/manager_test.php
@@ -90,14 +90,14 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
protected function create_extension_manager($with_cache = true)
{
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$db = $this->new_dbal();
- $db_tools = new phpbb_db_tools($db);
+ $db_tools = new \phpbb\db\tools($db);
$phpbb_root_path = __DIR__ . './../../phpBB/';
$php_ext = 'php';
$table_prefix = 'phpbb_';
- $migrator = new phpbb_db_migrator(
+ $migrator = new \phpbb\db\migrator(
$config,
$db,
$db_tools,
@@ -110,11 +110,11 @@ class phpbb_extension_manager_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
- return new phpbb_extension_manager(
+ return new \phpbb\extension\manager(
$container,
$db,
$config,
- new phpbb_filesystem(),
+ new \phpbb\filesystem(),
'phpbb_ext',
dirname(__FILE__) . '/',
$php_ext,
diff --git a/tests/extension/metadata_manager_test.php b/tests/extension/metadata_manager_test.php
index e5bd29092e..984ae63fa2 100644
--- a/tests/extension/metadata_manager_test.php
+++ b/tests/extension/metadata_manager_test.php
@@ -30,25 +30,25 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
parent::setUp();
$this->cache = new phpbb_mock_cache();
- $this->config = new phpbb_config(array(
+ $this->config = new \phpbb\config\config(array(
'version' => '3.1.0',
));
$this->db = $this->new_dbal();
- $this->db_tools = new phpbb_db_tools($this->db);
+ $this->db_tools = new \phpbb\db\tools($this->db);
$this->phpbb_root_path = dirname(__FILE__) . '/';
$this->phpEx = 'php';
- $this->user = new phpbb_user();
+ $this->user = new \phpbb\user();
$this->table_prefix = 'phpbb_';
- $this->template = new phpbb_template_twig(
+ $this->template = new \phpbb\template\twig\twig(
$this->phpbb_root_path,
$this->phpEx,
$this->config,
$this->user,
- new phpbb_template_context()
+ new \phpbb\template\context()
);
- $this->migrator = new phpbb_db_migrator(
+ $this->migrator = new \phpbb\db\migrator(
$this->config,
$this->db,
$this->db_tools,
@@ -61,11 +61,11 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
- $this->extension_manager = new phpbb_extension_manager(
+ $this->extension_manager = new \phpbb\extension\manager(
$container,
$this->db,
$this->config,
- new phpbb_filesystem(),
+ new \phpbb\filesystem(),
'phpbb_ext',
$this->phpbb_root_path,
$this->phpEx,
@@ -84,7 +84,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$manager->get_metadata();
}
- catch(phpbb_extension_exception $e){}
+ catch(\phpbb\extension\exception $e){}
$this->assertEquals((string) $e, 'The required file does not exist: ' . $this->phpbb_root_path . $this->extension_manager->get_extension_path($ext_name) . 'composer.json');
}
@@ -100,7 +100,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$metadata = $manager->get_metadata();
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -123,7 +123,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'name\' has not been set.');
}
@@ -134,7 +134,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'type\' has not been set.');
}
@@ -145,7 +145,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'licence\' has not been set.');
}
@@ -156,7 +156,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'version\' has not been set.');
}
@@ -167,7 +167,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'authors\' has not been set.');
}
@@ -184,7 +184,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Required meta field \'author name\' has not been set.');
}
@@ -211,7 +211,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'name\' is invalid.');
}
@@ -222,7 +222,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'type\' is invalid.');
}
@@ -233,7 +233,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'licence\' is invalid.');
}
@@ -244,7 +244,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->fail('Exception not triggered');
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->assertEquals((string) $e, 'Meta field \'version\' is invalid.');
}
@@ -268,7 +268,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
{
$this->assertEquals(true, $manager->validate('enable'));
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -293,7 +293,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -312,7 +312,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -331,7 +331,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -350,7 +350,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(false, $manager->validate_require_php());
$this->assertEquals(false, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -369,7 +369,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -388,7 +388,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
@@ -407,7 +407,7 @@ class phpbb_extension_metadata_manager_test extends phpbb_database_test_case
$this->assertEquals(true, $manager->validate_require_php());
$this->assertEquals(true, $manager->validate_require_phpbb());
}
- catch(phpbb_extension_exception $e)
+ catch(\phpbb\extension\exception $e)
{
$this->fail($e);
}
diff --git a/tests/extension/style_path_provider_test.php b/tests/extension/style_path_provider_test.php
index e1021c20ac..f2ee957f4c 100644
--- a/tests/extension/style_path_provider_test.php
+++ b/tests/extension/style_path_provider_test.php
@@ -21,9 +21,9 @@ class phpbb_extension_style_path_provider_test extends phpbb_test_case
public function test_find()
{
- $phpbb_style_path_provider = new phpbb_style_path_provider();
+ $phpbb_style_path_provider = new \phpbb\style\path_provider();
$phpbb_style_path_provider->set_styles(array($this->relative_root_path . 'styles/prosilver'));
- $phpbb_style_extension_path_provider = new phpbb_style_extension_path_provider(new phpbb_mock_extension_manager(
+ $phpbb_style_extension_path_provider = new \phpbb\style\extension_path_provider(new phpbb_mock_extension_manager(
$this->root_path,
array(
'foo' => array(
diff --git a/tests/filesystem/clean_path_test.php b/tests/filesystem/clean_path_test.php
index 50951fc88c..fedadc103b 100644
--- a/tests/filesystem/clean_path_test.php
+++ b/tests/filesystem/clean_path_test.php
@@ -14,7 +14,7 @@ class phpbb_filesystem_clean_path_test extends phpbb_test_case
public function setUp()
{
parent::setUp();
- $this->filesystem = new phpbb_filesystem();
+ $this->filesystem = new \phpbb\filesystem();
}
public function clean_path_data()
diff --git a/tests/functional/acp_permissions_test.php b/tests/functional/acp_permissions_test.php
index a3d272906f..e17f33dc96 100644
--- a/tests/functional/acp_permissions_test.php
+++ b/tests/functional/acp_permissions_test.php
@@ -91,12 +91,12 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$crawler = self::request('GET', "adm/index.php?i=acp_permissions&icat=16&mode=$mode&${object_name}[0]=$object_id&type=$permission_type&sid=" . $this->sid);
$this->assertContains($this->lang('ACL_SET'), $crawler->filter('h1')->eq(1)->text());
- // XXX globals for phpbb_auth, refactor it later
+ // XXX globals for \phpbb\auth\auth, refactor it later
global $db, $cache;
$db = $this->get_db();
$cache = new phpbb_mock_null_cache;
- $auth = new phpbb_auth;
+ $auth = new \phpbb\auth\auth;
// XXX hardcoded id
$user_data = $auth->obtain_user_data(2);
$auth->acl($user_data);
@@ -114,7 +114,7 @@ class phpbb_functional_acp_permissions_test extends phpbb_functional_test_case
$this->assertContains($this->lang('AUTH_UPDATED'), $crawler->text());
// check acl again
- $auth = new phpbb_auth;
+ $auth = new \phpbb\auth\auth;
// XXX hardcoded id
$user_data = $auth->obtain_user_data(2);
$auth->acl($user_data);
diff --git a/tests/functional/fixtures/ext/foo/bar/controller/controller.php b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
index 5a91b5f681..41b2be350b 100644
--- a/tests/functional/fixtures/ext/foo/bar/controller/controller.php
+++ b/tests/functional/fixtures/ext/foo/bar/controller/controller.php
@@ -5,7 +5,7 @@ class phpbb_ext_foo_bar_controller
{
protected $template;
- public function __construct(phpbb_controller_helper $helper, phpbb_template $template)
+ public function __construct(\phpbb\controller\helper $helper, \phpbb\template\template $template)
{
$this->template = $template;
$this->helper = $helper;
@@ -30,6 +30,6 @@ class phpbb_ext_foo_bar_controller
public function exception()
{
- throw new phpbb_controller_exception('Exception thrown from foo/exception route');
+ throw new \phpbb\controller\exception('Exception thrown from foo/exception route');
}
}
diff --git a/tests/functional/fixtures/ext/foo/bar/ext.php b/tests/functional/fixtures/ext/foo/bar/ext.php
index 74359d51ab..b839cef36c 100644
--- a/tests/functional/fixtures/ext/foo/bar/ext.php
+++ b/tests/functional/fixtures/ext/foo/bar/ext.php
@@ -1,6 +1,6 @@
lang = $this->load_language();
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$acl_get_map = array(
array('u_viewonline', true),
array('u_viewprofile', true),
diff --git a/tests/functions_user/group_user_attributes_test.php b/tests/functions_user/group_user_attributes_test.php
index 4336fd894e..f8d52a9a6a 100644
--- a/tests/functions_user/group_user_attributes_test.php
+++ b/tests/functions_user/group_user_attributes_test.php
@@ -131,17 +131,17 @@ class phpbb_functions_user_group_user_attributes_test extends phpbb_database_tes
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_clear_prefetch');
- $cache_driver = new phpbb_cache_driver_null();
+ $cache_driver = new \phpbb\cache\driver\null();
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container
->expects($this->any())
->method('get')
->with('cache.driver')
->will($this->returnValue($cache_driver));
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
group_user_attributes('default', $group_id, array($user_id), false, 'group_name', $group_row);
diff --git a/tests/groupposition/legend_test.php b/tests/groupposition/legend_test.php
index 16e33b390c..ac54a86b8e 100644
--- a/tests/groupposition/legend_test.php
+++ b/tests/groupposition/legend_test.php
@@ -20,7 +20,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
return array(
array(1, 0, ''),
array(3, 2, ''),
- array(4, 0, 'phpbb_groupposition_exception'),
+ array(4, 0, '\phpbb\groupposition\exception'),
);
}
@@ -33,7 +33,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
if ($throws_exception)
@@ -41,7 +41,7 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$this->setExpectedException($throws_exception);
}
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected, $test_class->get_group_value($group_id));
}
@@ -51,10 +51,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals(2, $test_class->get_group_count());
}
@@ -91,10 +91,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected_added, $test_class->add_group($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -179,10 +179,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($expected_deleted, $test_class->delete_group($group_id, $skip_group));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -234,10 +234,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move_up($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -289,10 +289,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move_down($group_id));
$result = $db->sql_query('SELECT group_id, group_legend
@@ -387,10 +387,10 @@ class phpbb_groupposition_legend_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_legend($db, $user);
+ $test_class = new \phpbb\groupposition\legend($db, $user);
$this->assertEquals($excepted_moved, $test_class->move($group_id, $increment));
$result = $db->sql_query('SELECT group_id, group_legend
diff --git a/tests/groupposition/teampage_test.php b/tests/groupposition/teampage_test.php
index db26cd09d5..ec89f56775 100644
--- a/tests/groupposition/teampage_test.php
+++ b/tests/groupposition/teampage_test.php
@@ -22,7 +22,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
return array(
array(2, 3, ''),
array(6, 8, ''),
- array(10, 0, 'phpbb_groupposition_exception'),
+ array(10, 0, '\phpbb\groupposition\exception'),
);
}
@@ -35,7 +35,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
if ($throws_exception)
@@ -43,7 +43,7 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$this->setExpectedException($throws_exception);
}
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected, $test_class->get_group_value($group_id));
}
@@ -53,10 +53,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals(8, $test_class->get_group_count());
}
@@ -137,10 +137,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_added, $test_class->add_group_teampage($group_id, $parent_id));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -180,10 +180,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_added, $test_class->add_category_teampage($group_name));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -247,10 +247,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_deleted, $test_class->delete_group($group_id, false));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -299,10 +299,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($expected_deleted, $test_class->delete_teampage($teampage_id, false));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -462,10 +462,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($excepted_moved, $test_class->move($group_id, $move_delta));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
@@ -625,10 +625,10 @@ class phpbb_groupposition_teampage_test extends phpbb_database_test_case
$cache = new phpbb_mock_cache;
$db = $this->new_dbal();
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array();
- $test_class = new phpbb_groupposition_teampage($db, $user, $cache);
+ $test_class = new \phpbb\groupposition\teampage($db, $user, $cache);
$this->assertEquals($excepted_moved, $test_class->move_teampage($teampage_id, $move_delta));
$result = $db->sql_query('SELECT teampage_position, group_id, teampage_parent, teampage_name
diff --git a/tests/lock/db_test.php b/tests/lock/db_test.php
index de7a23fd05..da689b7fa3 100644
--- a/tests/lock/db_test.php
+++ b/tests/lock/db_test.php
@@ -25,9 +25,9 @@ class phpbb_lock_db_test extends phpbb_database_test_case
global $db, $config;
$db = $this->db = $this->new_dbal();
- $config = $this->config = new phpbb_config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
+ $config = $this->config = new \phpbb\config\config(array('rand_seed' => '', 'rand_seed_last_update' => '0'));
set_config(null, null, null, $this->config);
- $this->lock = new phpbb_lock_db('test_lock', $this->config, $this->db);
+ $this->lock = new \phpbb\lock\db('test_lock', $this->config, $this->db);
}
public function test_new_lock()
@@ -38,7 +38,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
$this->assertTrue($this->lock->owns_lock());
$this->assertTrue(isset($this->config['test_lock']), 'Lock was created');
- $lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
+ $lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
$this->assertFalse($lock2->acquire());
$this->assertFalse($lock2->owns_lock());
@@ -49,7 +49,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
public function test_expire_lock()
{
- $lock = new phpbb_lock_db('foo_lock', $this->config, $this->db);
+ $lock = new \phpbb\lock\db('foo_lock', $this->config, $this->db);
$this->assertTrue($lock->acquire());
}
@@ -82,7 +82,7 @@ class phpbb_lock_db_test extends phpbb_database_test_case
$this->assertFalse($this->lock->owns_lock());
$this->assertEquals('0', $this->config['test_lock'], 'First lock is released');
- $lock2 = new phpbb_lock_db('test_lock', $this->config, $this->db);
+ $lock2 = new \phpbb\lock\db('test_lock', $this->config, $this->db);
$this->assertTrue($lock2->acquire());
$this->assertTrue($lock2->owns_lock());
$this->assertFalse(empty($this->config['test_lock']), 'Second lock is acquired');
diff --git a/tests/lock/flock_test.php b/tests/lock/flock_test.php
index 8f0b866ab3..5e5ac5aa78 100644
--- a/tests/lock/flock_test.php
+++ b/tests/lock/flock_test.php
@@ -13,7 +13,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
- $lock = new phpbb_lock_flock($path);
+ $lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$lock->release();
@@ -23,7 +23,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
- $lock = new phpbb_lock_flock($path);
+ $lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());
@@ -48,11 +48,11 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
$path = __DIR__ . '/../tmp/precious';
- $lock1 = new phpbb_lock_flock($path);
+ $lock1 = new \phpbb\lock\flock($path);
$ok = $lock1->acquire();
$this->assertTrue($ok);
- $lock2 = new phpbb_lock_flock($path);
+ $lock2 = new \phpbb\lock\flock($path);
$ok = $lock2->acquire();
$this->assertFalse($ok);
@@ -78,7 +78,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
// wait 0.5 s, acquire the lock, note how long it took
sleep(1);
- $lock = new phpbb_lock_flock($path);
+ $lock = new \phpbb\lock\flock($path);
$start = time();
$ok = $lock->acquire();
$delta = time() - $start;
@@ -105,7 +105,7 @@ class phpbb_lock_flock_test extends phpbb_test_case
{
// child
// immediately acquire the lock and sleep for 2 s
- $lock = new phpbb_lock_flock($path);
+ $lock = new \phpbb\lock\flock($path);
$ok = $lock->acquire();
$this->assertTrue($ok);
$this->assertTrue($lock->owns_lock());
diff --git a/tests/log/add_test.php b/tests/log/add_test.php
index a5f93232f2..032546f002 100644
--- a/tests/log/add_test.php
+++ b/tests/log/add_test.php
@@ -23,10 +23,10 @@ class phpbb_log_add_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('phpbb_user');
- $auth = $this->getMock('phpbb_auth');
+ $user = $this->getMock('\phpbb\user');
+ $auth = $this->getMock('\phpbb\auth\auth');
- $log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$this->assertTrue($log->is_enabled(), 'Initialise failed');
@@ -52,10 +52,10 @@ class phpbb_log_add_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('phpbb_user');
- $auth = $this->getMock('phpbb_auth');
+ $user = $this->getMock('\phpbb\user');
+ $auth = $this->getMock('\phpbb\auth\auth');
- $log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$mode = 'critical';
$user_id = ANONYMOUS;
diff --git a/tests/log/function_add_log_test.php b/tests/log/function_add_log_test.php
index 7aa42be6df..e1bcd4acaf 100644
--- a/tests/log/function_add_log_test.php
+++ b/tests/log/function_add_log_test.php
@@ -157,10 +157,10 @@ class phpbb_log_function_add_log_test extends phpbb_database_test_case
$db = $this->new_dbal();
$cache = new phpbb_mock_cache;
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('phpbb_user');
- $auth = $this->getMock('phpbb_auth');
+ $user = $this->getMock('\phpbb\user');
+ $auth = $this->getMock('\phpbb\auth\auth');
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$user->ip = 'user_ip';
if ($user_id)
diff --git a/tests/log/function_view_log_test.php b/tests/log/function_view_log_test.php
index 6827aaa1b6..017484e8a7 100644
--- a/tests/log/function_view_log_test.php
+++ b/tests/log/function_view_log_test.php
@@ -306,7 +306,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
// Create auth mock
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$acl_get_map = array(
array('f_read', 23, true),
array('m_', 23, true),
@@ -333,7 +333,7 @@ class phpbb_log_function_view_log_test extends phpbb_database_test_case
'LOG_INSTALL_INSTALLED' => 'installed: %s',
);
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$log = array();
$this->assertEquals($expected_returned, view_log($mode, $log, $log_count, $limit, $offset, $forum_id, $topic_id, $user_id, $limit_days, $sort_by, $keywords));
diff --git a/tests/mock/cache.php b/tests/mock/cache.php
index 3e45a1730b..83bbb8ef30 100644
--- a/tests/mock/cache.php
+++ b/tests/mock/cache.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_mock_cache implements phpbb_cache_driver_driver_interface
+class phpbb_mock_cache implements \phpbb\cache\driver\driver_interface
{
protected $data;
@@ -140,7 +140,7 @@ class phpbb_mock_cache implements phpbb_cache_driver_driver_interface
/**
* {@inheritDoc}
*/
- public function sql_save(phpbb_db_driver $db, $query, $query_result, $ttl)
+ public function sql_save(\phpbb\db\driver\driver $db, $query, $query_result, $ttl)
{
return $query_result;
}
diff --git a/tests/mock/extension_manager.php b/tests/mock/extension_manager.php
index 10b3595206..7049cbdc50 100644
--- a/tests/mock/extension_manager.php
+++ b/tests/mock/extension_manager.php
@@ -7,13 +7,13 @@
*
*/
-class phpbb_mock_extension_manager extends phpbb_extension_manager
+class phpbb_mock_extension_manager extends \phpbb\extension\manager
{
public function __construct($phpbb_root_path, $extensions = array())
{
$this->phpbb_root_path = $phpbb_root_path;
$this->php_ext = 'php';
$this->extensions = $extensions;
- $this->filesystem = new phpbb_filesystem();
+ $this->filesystem = new \phpbb\filesystem();
}
}
diff --git a/tests/mock/metadata_manager.php b/tests/mock/metadata_manager.php
index a7fbf0681c..b6489acfa4 100644
--- a/tests/mock/metadata_manager.php
+++ b/tests/mock/metadata_manager.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_mock_metadata_manager extends phpbb_extension_metadata_manager
+class phpbb_mock_metadata_manager extends \phpbb\extension\metadata_manager
{
public function set_metadata($metadata)
{
diff --git a/tests/mock/notifications_auth.php b/tests/mock/notifications_auth.php
index d960acb81a..2d387d8c00 100644
--- a/tests/mock/notifications_auth.php
+++ b/tests/mock/notifications_auth.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_mock_notifications_auth extends phpbb_auth
+class phpbb_mock_notifications_auth extends \phpbb\auth\auth
{
function acl_get_list($user_id = false, $opts = false, $forum_id = false)
{
diff --git a/tests/mock/request.php b/tests/mock/request.php
index 04803594de..b71361e33e 100644
--- a/tests/mock/request.php
+++ b/tests/mock/request.php
@@ -7,33 +7,33 @@
*
*/
-class phpbb_mock_request implements phpbb_request_request_interface
+class phpbb_mock_request implements \phpbb\request\request_interface
{
protected $data;
public function __construct($get = array(), $post = array(), $cookie = array(), $server = array(), $request = false, $files = array())
{
- $this->data[phpbb_request_request_interface::GET] = $get;
- $this->data[phpbb_request_request_interface::POST] = $post;
- $this->data[phpbb_request_request_interface::COOKIE] = $cookie;
- $this->data[phpbb_request_request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
- $this->data[phpbb_request_request_interface::SERVER] = $server;
- $this->data[phpbb_request_request_interface::FILES] = $files;
+ $this->data[\phpbb\request\request_interface::GET] = $get;
+ $this->data[\phpbb\request\request_interface::POST] = $post;
+ $this->data[\phpbb\request\request_interface::COOKIE] = $cookie;
+ $this->data[\phpbb\request\request_interface::REQUEST] = ($request === false) ? $post + $get : $request;
+ $this->data[\phpbb\request\request_interface::SERVER] = $server;
+ $this->data[\phpbb\request\request_interface::FILES] = $files;
}
- public function overwrite($var_name, $value, $super_global = phpbb_request_request_interface::REQUEST)
+ public function overwrite($var_name, $value, $super_global = \phpbb\request\request_interface::REQUEST)
{
$this->data[$super_global][$var_name] = $value;
}
- public function variable($var_name, $default, $multibyte = false, $super_global = phpbb_request_request_interface::REQUEST)
+ public function variable($var_name, $default, $multibyte = false, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
public function server($var_name, $default = '')
{
- $super_global = phpbb_request_request_interface::SERVER;
+ $super_global = \phpbb\request\request_interface::SERVER;
return isset($this->data[$super_global][$var_name]) ? $this->data[$super_global][$var_name] : $default;
}
@@ -45,16 +45,16 @@ class phpbb_mock_request implements phpbb_request_request_interface
public function file($form_name)
{
- $super_global = phpbb_request_request_interface::FILES;
+ $super_global = \phpbb\request\request_interface::FILES;
return isset($this->data[$super_global][$form_name]) ? $this->data[$super_global][$form_name] : array();
}
public function is_set_post($name)
{
- return $this->is_set($name, phpbb_request_request_interface::POST);
+ return $this->is_set($name, \phpbb\request\request_interface::POST);
}
- public function is_set($var, $super_global = phpbb_request_request_interface::REQUEST)
+ public function is_set($var, $super_global = \phpbb\request\request_interface::REQUEST)
{
return isset($this->data[$super_global][$var]);
}
@@ -69,7 +69,7 @@ class phpbb_mock_request implements phpbb_request_request_interface
return false;
}
- public function variable_names($super_global = phpbb_request_request_interface::REQUEST)
+ public function variable_names($super_global = \phpbb\request\request_interface::REQUEST)
{
return array_keys($this->data[$super_global]);
}
@@ -79,10 +79,10 @@ class phpbb_mock_request implements phpbb_request_request_interface
public function set_header($header_name, $value)
{
$var_name = 'HTTP_' . str_replace('-', '_', strtoupper($header_name));
- $this->data[phpbb_request_request_interface::SERVER][$var_name] = $value;
+ $this->data[\phpbb\request\request_interface::SERVER][$var_name] = $value;
}
- public function merge($super_global = phpbb_request_request_interface::REQUEST, $values)
+ public function merge($super_global = \phpbb\request\request_interface::REQUEST, $values)
{
$this->data[$super_global] = array_merge($this->data[$super_global], $values);
}
diff --git a/tests/mock/session_testable.php b/tests/mock/session_testable.php
index 56ff8c8b32..38e66ec67a 100644
--- a/tests/mock/session_testable.php
+++ b/tests/mock/session_testable.php
@@ -16,7 +16,7 @@ require_once dirname(__FILE__) . '/../../phpBB/includes/functions.php';
* test it without warnings about sent headers. This class only stores cookie
* data for later verification.
*/
-class phpbb_mock_session_testable extends phpbb_session
+class phpbb_mock_session_testable extends \phpbb\session
{
private $_cookies = array();
diff --git a/tests/mock/sql_insert_buffer.php b/tests/mock/sql_insert_buffer.php
index ba09aa8d7f..aa7c54dddd 100644
--- a/tests/mock/sql_insert_buffer.php
+++ b/tests/mock/sql_insert_buffer.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_mock_sql_insert_buffer extends phpbb_db_sql_insert_buffer
+class phpbb_mock_sql_insert_buffer extends \phpbb\db\sql_insert_buffer
{
public function flush()
{
diff --git a/tests/notification/convert_test.php b/tests/notification/convert_test.php
index c038020385..e0449cef89 100644
--- a/tests/notification/convert_test.php
+++ b/tests/notification/convert_test.php
@@ -25,10 +25,10 @@ class phpbb_notification_convert_test extends phpbb_database_test_case
$this->db = $this->new_dbal();
- $this->migration = new phpbb_db_migration_data_310_notification_options_reconvert(
- new phpbb_config(array()),
+ $this->migration = new \phpbb\db\migration\data0\notification_options_reconvert(
+ new \phpbb\config\config(array()),
$this->db,
- new phpbb_db_tools($this->db),
+ new \phpbb\db\tools($this->db),
$phpbb_root_path,
$phpEx,
'phpbb_'
diff --git a/tests/notification/ext/test/notification/type/test.php b/tests/notification/ext/test/notification/type/test.php
index 0d0c584e0d..629954efce 100644
--- a/tests/notification/ext/test/notification/type/test.php
+++ b/tests/notification/ext/test/notification/type/test.php
@@ -15,7 +15,7 @@ if (!defined('IN_PHPBB'))
exit;
}
-class phpbb_notification_type_test extends phpbb_notification_type_base
+class phpbb_notification_type_test extends \phpbb\notification\type\base
{
public function get_type()
{
diff --git a/tests/notification/manager_helper.php b/tests/notification/manager_helper.php
index 7a794f922f..95caa7c0ba 100644
--- a/tests/notification/manager_helper.php
+++ b/tests/notification/manager_helper.php
@@ -19,7 +19,7 @@ if (!defined('IN_PHPBB'))
* Notifications service class
* @package notifications
*/
-class phpbb_notification_manager_helper extends phpbb_notification_manager
+class phpbb_notification_manager_helper extends \phpbb\notification\manager
{
public function set_var($name, $value)
{
diff --git a/tests/notification/notification_test.php b/tests/notification/notification_test.php
index 8f7eb3b8a8..1e2ce13956 100644
--- a/tests/notification/notification_test.php
+++ b/tests/notification/notification_test.php
@@ -27,17 +27,17 @@ class phpbb_notification_test extends phpbb_database_test_case
include_once(__DIR__ . '/ext/test/notification/type/test.' . $phpEx);
$this->db = $this->new_dbal();
- $this->config = new phpbb_config(array(
+ $this->config = new \phpbb\config\config(array(
'allow_privmsg' => true,
'allow_bookmarks' => true,
'allow_topic_notify' => true,
'allow_forum_notify' => true,
));
- $this->user = new phpbb_user();
- $this->user_loader = new phpbb_user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
+ $this->user = new \phpbb\user();
+ $this->user_loader = new \phpbb\user_loader($this->db, $phpbb_root_path, $phpEx, 'phpbb_users');
$this->auth = new phpbb_mock_notifications_auth();
- $this->cache = new phpbb_cache_service(
- new phpbb_cache_driver_null(),
+ $this->cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\null(),
$this->config,
$this->db,
$phpbb_root_path,
diff --git a/tests/notification/submit_post_base.php b/tests/notification/submit_post_base.php
index 4e564ce23c..09cd7b4213 100644
--- a/tests/notification/submit_post_base.php
+++ b/tests/notification/submit_post_base.php
@@ -53,7 +53,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
$db = $this->db;
// Auth
- $auth = $this->getMock('phpbb_auth');
+ $auth = $this->getMock('\phpbb\auth\auth');
$auth->expects($this->any())
->method('acl_get')
->with($this->stringContains('_'),
@@ -65,12 +65,12 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
)));
// Config
- $config = new phpbb_config(array('num_topics' => 1,'num_posts' => 1,));
+ $config = new \phpbb\config\config(array('num_topics' => 1,'num_posts' => 1,));
set_config(null, null, null, $config);
set_config_count(null, null, null, $config);
- $cache = new phpbb_cache_service(
- new phpbb_cache_driver_null(),
+ $cache = new \phpbb\cache\service(
+ new \phpbb\cache\driver\null(),
$config,
$db,
$phpbb_root_path,
@@ -81,7 +81,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
// User
- $user = $this->getMock('phpbb_user');
+ $user = $this->getMock('\phpbb\user');
$user->ip = '';
$user->data = array(
'user_id' => 2,
@@ -91,14 +91,14 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
);
// Request
- $type_cast_helper = $this->getMock('phpbb_request_type_cast_helper_interface');
- $request = $this->getMock('phpbb_request');
+ $type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
+ $request = $this->getMock('\phpbb\request\request');
// Container
$phpbb_container = new phpbb_mock_container_builder();
- $phpbb_container->set('content.visibility', new phpbb_content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
+ $phpbb_container->set('content.visibility', new \phpbb\content_visibility($auth, $db, $user, $phpbb_root_path, $phpEx, FORUMS_TABLE, POSTS_TABLE, TOPICS_TABLE, USERS_TABLE));
- $user_loader = new phpbb_user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
+ $user_loader = new \phpbb\user_loader($db, $phpbb_root_path, $phpEx, USERS_TABLE);
// Notification Types
$notification_types = array('quote', 'bookmark', 'post', 'post_in_queue', 'topic', 'approve_topic', 'approve_post');
@@ -117,7 +117,7 @@ class phpbb_notification_submit_post_base extends phpbb_database_test_case
}
// Notification Manager
- $phpbb_notifications = new phpbb_notification_manager($notification_types_array, array(),
+ $phpbb_notifications = new \phpbb\notification\manager($notification_types_array, array(),
$phpbb_container, $user_loader, $db, $cache, $user,
$phpbb_root_path, $phpEx,
NOTIFICATION_TYPES_TABLE, NOTIFICATIONS_TABLE, USER_NOTIFICATIONS_TABLE);
diff --git a/tests/request/deactivated_super_global_test.php b/tests/request/deactivated_super_global_test.php
index 28ba285468..d28bd87eec 100644
--- a/tests/request/deactivated_super_global_test.php
+++ b/tests/request/deactivated_super_global_test.php
@@ -16,7 +16,7 @@ class phpbb_deactivated_super_global_test extends phpbb_test_case
public function test_write_triggers_error()
{
$this->setExpectedTriggerError(E_USER_ERROR);
- $obj = new phpbb_request_deactivated_super_global($this->getMock('phpbb_request_request_interface'), 'obj', phpbb_request_request_interface::POST);
+ $obj = new \phpbb\request\deactivated_super_global($this->getMock('\phpbb\request\request_interface'), 'obj', \phpbb\request\request_interface::POST);
$obj->offsetSet(0, 0);
}
}
diff --git a/tests/request/request_test.php b/tests/request/request_test.php
index 52c21abd2a..a25792e051 100644
--- a/tests/request/request_test.php
+++ b/tests/request/request_test.php
@@ -33,8 +33,8 @@ class phpbb_request_test extends phpbb_test_case
$_SERVER['HTTP_ACCEPT'] = 'application/json';
$_SERVER['HTTP_SOMEVAR'] = '';
- $this->type_cast_helper = $this->getMock('phpbb_request_type_cast_helper_interface');
- $this->request = new phpbb_request($this->type_cast_helper);
+ $this->type_cast_helper = $this->getMock('\phpbb\request\type_cast_helper_interface');
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
}
public function test_toggle_super_globals()
@@ -135,7 +135,7 @@ class phpbb_request_test extends phpbb_test_case
{
$this->request->enable_super_globals();
$_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest';
- $this->request = new phpbb_request($this->type_cast_helper);
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
$this->assertTrue($this->request->is_ajax());
}
@@ -146,7 +146,7 @@ class phpbb_request_test extends phpbb_test_case
$this->request->enable_super_globals();
$_SERVER['HTTPS'] = 'on';
- $this->request = new phpbb_request($this->type_cast_helper);
+ $this->request = new \phpbb\request\request($this->type_cast_helper);
$this->assertTrue($this->request->is_secure());
}
diff --git a/tests/request/request_var_test.php b/tests/request/request_var_test.php
index 0e85d4694b..d126fe1e8b 100644
--- a/tests/request/request_var_test.php
+++ b/tests/request/request_var_test.php
@@ -90,7 +90,7 @@ class phpbb_request_var_test extends phpbb_test_case
{
$this->unset_variables('var');
- // cannot set $_REQUEST directly because in phpbb_request implementation
+ // cannot set $_REQUEST directly because in \phpbb\request\request implementation
// $_REQUEST = $_POST + $_GET
$_POST['var'] = array(
0 => array(
diff --git a/tests/request/type_cast_helper_test.php b/tests/request/type_cast_helper_test.php
index f41db005af..98f4538c08 100644
--- a/tests/request/type_cast_helper_test.php
+++ b/tests/request/type_cast_helper_test.php
@@ -16,7 +16,7 @@ class phpbb_type_cast_helper_test extends phpbb_test_case
protected function setUp()
{
- $this->type_cast_helper = new phpbb_request_type_cast_helper();
+ $this->type_cast_helper = new \phpbb\request\type_cast_helper();
}
public function test_addslashes_recursively()
diff --git a/tests/search/mysql_test.php b/tests/search/mysql_test.php
index 3ad15bd806..c08484c78d 100644
--- a/tests/search/mysql_test.php
+++ b/tests/search/mysql_test.php
@@ -34,7 +34,7 @@ class phpbb_search_mysql_test extends phpbb_search_common_test_case
$this->db = $this->new_dbal();
$error = null;
- $class = self::get_search_wrapper('phpbb_search_fulltext_mysql');
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_mysql');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
}
diff --git a/tests/search/native_test.php b/tests/search/native_test.php
index 4a2c210013..18c6df2445 100644
--- a/tests/search/native_test.php
+++ b/tests/search/native_test.php
@@ -30,7 +30,7 @@ class phpbb_search_native_test extends phpbb_search_test_case
$this->db = $this->new_dbal();
$error = null;
- $class = self::get_search_wrapper('phpbb_search_fulltext_native');
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_native');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
diff --git a/tests/search/postgres_test.php b/tests/search/postgres_test.php
index 923af6f854..a59f5abc7d 100644
--- a/tests/search/postgres_test.php
+++ b/tests/search/postgres_test.php
@@ -34,7 +34,7 @@ class phpbb_search_postgres_test extends phpbb_search_common_test_case
$this->db = $this->new_dbal();
$error = null;
- $class = self::get_search_wrapper('phpbb_search_fulltext_postgres');
+ $class = self::get_search_wrapper('\phpbb\search\fulltext_postgres');
$this->search = new $class($error, $phpbb_root_path, $phpEx, null, $config, $this->db, $user);
}
}
diff --git a/tests/security/base.php b/tests/security/base.php
index 08878ad60d..8cd24ff145 100644
--- a/tests/security/base.php
+++ b/tests/security/base.php
@@ -39,13 +39,13 @@ abstract class phpbb_security_test_base extends phpbb_test_case
$request = new phpbb_mock_request(array(), array(), array(), $server);
// Set no user and trick a bit to circumvent errors
- $user = new phpbb_user();
+ $user = new \phpbb\user();
$user->lang = true;
$user->browser = $server['HTTP_USER_AGENT'];
$user->referer = '';
$user->forwarded_for = '';
$user->host = $server['HTTP_HOST'];
- $user->page = phpbb_session::extract_current_page($phpbb_root_path);
+ $user->page = \phpbb\session::extract_current_page($phpbb_root_path);
}
protected function tearDown()
diff --git a/tests/security/extract_current_page_test.php b/tests/security/extract_current_page_test.php
index 1bf471d04f..e42f446b31 100644
--- a/tests/security/extract_current_page_test.php
+++ b/tests/security/extract_current_page_test.php
@@ -28,12 +28,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
- $request->merge(phpbb_request_request_interface::SERVER, array(
+ $request->merge(\phpbb\request\request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));
- $result = phpbb_session::extract_current_page('./');
+ $result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with PHP_SELF filled.';
$this->assertEquals($expected, $result['query_string'], $label);
@@ -46,12 +46,12 @@ class phpbb_security_extract_current_page_test extends phpbb_security_test_base
{
global $request;
- $request->merge(phpbb_request_request_interface::SERVER, array(
+ $request->merge(\phpbb\request\request_interface::SERVER, array(
'PHP_SELF' => $url,
'QUERY_STRING' => $query_string,
));
- $result = phpbb_session::extract_current_page('./');
+ $result = \phpbb\session::extract_current_page('./');
$label = 'Running extract_current_page on ' . $query_string . ' with REQUEST_URI filled.';
$this->assertEquals($expected, $result['query_string'], $label);
diff --git a/tests/session/continue_test.php b/tests/session/continue_test.php
index e5a7f7a4a1..28019b54b5 100644
--- a/tests/session/continue_test.php
+++ b/tests/session/continue_test.php
@@ -56,11 +56,11 @@ class phpbb_session_continue_test extends phpbb_database_test_case
global $phpbb_container, $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
- $config = new phpbb_config(array());
- $request = $this->getMock('phpbb_request');
- $user = $this->getMock('phpbb_user');
+ $config = new \phpbb\config\config(array());
+ $request = $this->getMock('\phpbb\request\request');
+ $user = $this->getMock('\phpbb\user');
- $auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
+ $auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container->expects($this->any())
->method('get')
diff --git a/tests/session/creation_test.php b/tests/session/creation_test.php
index fde76d6b06..6b1be61ade 100644
--- a/tests/session/creation_test.php
+++ b/tests/session/creation_test.php
@@ -23,11 +23,11 @@ class phpbb_session_creation_test extends phpbb_database_test_case
global $phpbb_container, $phpbb_root_path, $phpEx;
$db = $this->new_dbal();
- $config = new phpbb_config(array());
- $request = $this->getMock('phpbb_request');
- $user = $this->getMock('phpbb_user');
+ $config = new \phpbb\config\config(array());
+ $request = $this->getMock('\phpbb\request\request');
+ $user = $this->getMock('\phpbb\user');
- $auth_provider = new phpbb_auth_provider_db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
+ $auth_provider = new \phpbb\auth\provider\db($db, $config, $request, $user, $phpbb_root_path, $phpEx);
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container->expects($this->any())
->method('get')
diff --git a/tests/session/testable_factory.php b/tests/session/testable_factory.php
index 1e2b194ece..1a7d27b30f 100644
--- a/tests/session/testable_factory.php
+++ b/tests/session/testable_factory.php
@@ -59,10 +59,10 @@ class phpbb_session_testable_factory
/**
* Retrieve the configured session class instance
*
- * @param phpbb_db_driver $dbal The database connection to use for session data
+ * @param \phpbb\db\driver\driver $dbal The database connection to use for session data
* @return phpbb_mock_session_testable A session instance
*/
- public function get_session(phpbb_db_driver $dbal)
+ public function get_session(\phpbb\db\driver\driver $dbal)
{
// set up all the global variables used by session
global $SID, $_SID, $db, $config, $cache, $request;
@@ -75,7 +75,7 @@ class phpbb_session_testable_factory
);
request_var(null, null, null, null, $request);
- $config = $this->config = new phpbb_config($this->get_config_data());
+ $config = $this->config = new \phpbb\config\config($this->get_config_data());
set_config(null, null, null, $config);
$db = $dbal;
diff --git a/tests/template/template_events_test.php b/tests/template/template_events_test.php
index f7bcd2dcc6..857807bf89 100644
--- a/tests/template/template_events_test.php
+++ b/tests/template/template_events_test.php
@@ -100,16 +100,16 @@ Zeta test event in all',
global $phpbb_root_path, $phpEx, $user;
$defaults = $this->config_defaults();
- $config = new phpbb_config(array_merge($defaults, $new_config));
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
$this->template_path = dirname(__FILE__) . "/datasets/$dataset/styles/silver/template";
- $this->style_resource_locator = new phpbb_style_resource_locator();
+ $this->style_resource_locator = new \phpbb\style\resource_locator();
$this->extension_manager = new phpbb_mock_filesystem_extension_manager(
dirname(__FILE__) . "/datasets/$dataset/"
);
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context, $this->extension_manager);
- $this->style_provider = new phpbb_style_path_provider();
- $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context, $this->extension_manager);
+ $this->style_provider = new \phpbb\style\path_provider();
+ $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->style->set_custom_style('silver', array($this->template_path), $style_names, '');
}
}
diff --git a/tests/template/template_test_case.php b/tests/template/template_test_case.php
index 6d87e5ebc0..97c0728875 100644
--- a/tests/template/template_test_case.php
+++ b/tests/template/template_test_case.php
@@ -63,14 +63,14 @@ class phpbb_template_template_test_case extends phpbb_test_case
global $phpbb_root_path, $phpEx;
$defaults = $this->config_defaults();
- $config = new phpbb_config(array_merge($defaults, $new_config));
- $this->user = new phpbb_user;
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
+ $this->user = new \phpbb\user;
$this->template_path = $this->test_path . '/templates';
- $this->style_resource_locator = new phpbb_style_resource_locator();
- $this->style_provider = new phpbb_style_path_provider();
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $this->user, new phpbb_template_context());
- $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->style_resource_locator = new \phpbb\style\resource_locator();
+ $this->style_provider = new \phpbb\style\path_provider();
+ $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $this->user, new \phpbb\template\context());
+ $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $this->user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->style->set_custom_style('tests', $this->template_path, array(), '');
}
diff --git a/tests/template/template_test_case_with_tree.php b/tests/template/template_test_case_with_tree.php
index 4b8cbada45..9f97e92fd2 100644
--- a/tests/template/template_test_case_with_tree.php
+++ b/tests/template/template_test_case_with_tree.php
@@ -16,14 +16,14 @@ class phpbb_template_template_test_case_with_tree extends phpbb_template_templat
global $phpbb_root_path, $phpEx, $user;
$defaults = $this->config_defaults();
- $config = new phpbb_config(array_merge($defaults, $new_config));
+ $config = new \phpbb\config\config(array_merge($defaults, $new_config));
$this->template_path = $this->test_path . '/templates';
$this->parent_template_path = $this->test_path . '/parent_templates';
- $this->style_resource_locator = new phpbb_style_resource_locator();
- $this->style_provider = new phpbb_style_path_provider();
- $this->template = new phpbb_template_twig($phpbb_root_path, $phpEx, $config, $user, new phpbb_template_context());
- $this->style = new phpbb_style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
+ $this->style_resource_locator = new \phpbb\style\resource_locator();
+ $this->style_provider = new \phpbb\style\path_provider();
+ $this->template = new \phpbb\template\twig\twig($phpbb_root_path, $phpEx, $config, $user, new \phpbb\template\context());
+ $this->style = new \phpbb\style\style($phpbb_root_path, $phpEx, $config, $user, $this->style_resource_locator, $this->style_provider, $this->template);
$this->style->set_custom_style('tests', array($this->template_path, $this->parent_template_path), array(), '');
}
}
diff --git a/tests/test_framework/phpbb_database_test_case.php b/tests/test_framework/phpbb_database_test_case.php
index c72ea5f765..1a9edcb181 100644
--- a/tests/test_framework/phpbb_database_test_case.php
+++ b/tests/test_framework/phpbb_database_test_case.php
@@ -82,7 +82,7 @@ abstract class phpbb_database_test_case extends PHPUnit_Extensions_Database_Test
$db_config = $this->get_database_config();
// Firebird requires table and column names to be uppercase
- if ($db_config['dbms'] == 'phpbb_db_driver_firebird')
+ if ($db_config['dbms'] == '\phpbb\db\driver\firebird')
{
$xml_data = file_get_contents($path);
$xml_data = preg_replace_callback('/(?:())/', 'phpbb_database_test_case::to_upper', $xml_data);
diff --git a/tests/test_framework/phpbb_database_test_connection_manager.php b/tests/test_framework/phpbb_database_test_connection_manager.php
index c93a777701..1a31fb13d0 100644
--- a/tests/test_framework/phpbb_database_test_connection_manager.php
+++ b/tests/test_framework/phpbb_database_test_connection_manager.php
@@ -108,7 +108,7 @@ class phpbb_database_test_connection_manager
// These require different connection strings on the phpBB side than they do in PDO
// so you must provide a DSN string for ODBC separately
- if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == 'phpbb_db_driver_mssql' || $this->config['dbms'] == 'phpbb_db_driver_firebird'))
+ if (!empty($this->config['custom_dsn']) && ($this->config['dbms'] == '\phpbb\db\driver\mssql' || $this->config['dbms'] == '\phpbb\db\driver\firebird'))
{
$dsn = 'odbc:' . $this->config['custom_dsn'];
}
@@ -117,12 +117,12 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_mssql':
- case 'phpbb_db_driver_mssql_odbc':
+ case '\phpbb\db\driver\mssql':
+ case '\phpbb\db\driver\mssql_odbc':
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('mssql', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
break;
- case 'phpbb_db_driver_firebird':
+ case '\phpbb\db\driver\firebird':
if (!empty($this->config['custom_dsn']))
{
$this->pdo = new phpbb_database_connection_odbc_pdo_wrapper('firebird', 0, $dsn, $this->config['dbuser'], $this->config['dbpasswd']);
@@ -145,8 +145,8 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_mysql':
- case 'phpbb_db_driver_mysqli':
+ case '\phpbb\db\driver\mysql':
+ case '\phpbb\db\driver\mysqli':
$this->pdo->exec('SET NAMES utf8');
/*
@@ -187,8 +187,8 @@ class phpbb_database_test_connection_manager
{
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_sqlite':
- case 'phpbb_db_driver_firebird':
+ case '\phpbb\db\driver\sqlite':
+ case '\phpbb\db\driver\firebird':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -198,7 +198,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case 'phpbb_db_driver_oracle':
+ case '\phpbb\db\driver\oracle':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -208,7 +208,7 @@ class phpbb_database_test_connection_manager
$this->purge_extras();
break;
- case 'phpbb_db_driver_postgres':
+ case '\phpbb\db\driver\postgres':
$this->connect();
// Drop all of the tables
foreach ($this->get_tables() as $table)
@@ -258,38 +258,38 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_mysql':
- case 'phpbb_db_driver_mysqli':
+ case '\phpbb\db\driver\mysql':
+ case '\phpbb\db\driver\mysqli':
$sql = 'SHOW TABLES';
break;
- case 'phpbb_db_driver_sqlite':
+ case '\phpbb\db\driver\sqlite':
$sql = 'SELECT name
FROM sqlite_master
WHERE type = "table"';
break;
- case 'phpbb_db_driver_mssql':
- case 'phpbb_db_driver_mssql_odbc':
- case 'phpbb_db_driver_mssqlnative':
+ case '\phpbb\db\driver\mssql':
+ case '\phpbb\db\driver\mssql_odbc':
+ case '\phpbb\db\driver\mssqlnative':
$sql = "SELECT name
FROM sysobjects
WHERE type='U'";
break;
- case 'phpbb_db_driver_postgres':
+ case '\phpbb\db\driver\postgres':
$sql = 'SELECT relname
FROM pg_stat_user_tables';
break;
- case 'phpbb_db_driver_firebird':
+ case '\phpbb\db\driver\firebird':
$sql = 'SELECT rdb$relation_name
FROM rdb$relations
WHERE rdb$view_source is null
AND rdb$system_flag = 0';
break;
- case 'phpbb_db_driver_oracle':
+ case '\phpbb\db\driver\oracle':
$sql = 'SELECT table_name
FROM USER_TABLES';
break;
@@ -325,7 +325,7 @@ class phpbb_database_test_connection_manager
{
$schema = $this->dbms['SCHEMA'];
- if ($this->config['dbms'] == 'phpbb_db_driver_mysql')
+ if ($this->config['dbms'] == '\phpbb\db\driver\mysql')
{
$sth = $this->pdo->query('SELECT VERSION() AS version');
$row = $sth->fetch(PDO::FETCH_ASSOC);
@@ -359,47 +359,47 @@ class phpbb_database_test_connection_manager
protected function get_dbms_data($dbms)
{
$available_dbms = array(
- 'phpbb_db_driver_firebird' => array(
+ '\phpbb\db\driver\firebird' => array(
'SCHEMA' => 'firebird',
'DELIM' => ';;',
'PDO' => 'firebird',
),
- 'phpbb_db_driver_mysqli' => array(
+ '\phpbb\db\driver\mysqli' => array(
'SCHEMA' => 'mysql_41',
'DELIM' => ';',
'PDO' => 'mysql',
),
- 'phpbb_db_driver_mysql' => array(
+ '\phpbb\db\driver\mysql' => array(
'SCHEMA' => 'mysql',
'DELIM' => ';',
'PDO' => 'mysql',
),
- 'phpbb_db_driver_mssql' => array(
+ '\phpbb\db\driver\mssql' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- 'phpbb_db_driver_mssql_odbc'=> array(
+ '\phpbb\db\driver\mssql_odbc'=> array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'odbc',
),
- 'phpbb_db_driver_mssqlnative' => array(
+ '\phpbb\db\driver\mssqlnative' => array(
'SCHEMA' => 'mssql',
'DELIM' => 'GO',
'PDO' => 'sqlsrv',
),
- 'phpbb_db_driver_oracle' => array(
+ '\phpbb\db\driver\oracle' => array(
'SCHEMA' => 'oracle',
'DELIM' => '/',
'PDO' => 'oci',
),
- 'phpbb_db_driver_postgres' => array(
+ '\phpbb\db\driver\postgres' => array(
'SCHEMA' => 'postgres',
'DELIM' => ';',
'PDO' => 'pgsql',
),
- 'phpbb_db_driver_sqlite' => array(
+ '\phpbb\db\driver\sqlite' => array(
'SCHEMA' => 'sqlite',
'DELIM' => ';',
'PDO' => 'sqlite2',
@@ -428,7 +428,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_firebird':
+ case '\phpbb\db\driver\firebird':
$sql = 'SELECT RDB$GENERATOR_NAME
FROM RDB$GENERATORS
WHERE RDB$SYSTEM_FLAG = 0';
@@ -440,7 +440,7 @@ class phpbb_database_test_connection_manager
}
break;
- case 'phpbb_db_driver_oracle':
+ case '\phpbb\db\driver\oracle':
$sql = 'SELECT sequence_name
FROM USER_SEQUENCES';
$result = $this->pdo->query($sql);
@@ -451,7 +451,7 @@ class phpbb_database_test_connection_manager
}
break;
- case 'phpbb_db_driver_postgres':
+ case '\phpbb\db\driver\postgres':
$sql = 'SELECT sequence_name
FROM information_schema.sequences';
$result = $this->pdo->query($sql);
@@ -509,7 +509,7 @@ class phpbb_database_test_connection_manager
switch ($this->config['dbms'])
{
- case 'phpbb_db_driver_oracle':
+ case '\phpbb\db\driver\oracle':
// Get all of the information about the sequences
$sql = "SELECT t.table_name, tc.column_name, d.referenced_name as sequence_name, s.increment_by, s.min_value
FROM USER_TRIGGERS t
@@ -551,7 +551,7 @@ class phpbb_database_test_connection_manager
}
break;
- case 'phpbb_db_driver_postgres':
+ case '\phpbb\db\driver\postgres':
// Get the sequences attached to the tables
$sql = 'SELECT column_name, table_name FROM information_schema.columns
WHERE table_name IN (' . implode(', ', $table_names) . ")
diff --git a/tests/test_framework/phpbb_functional_test_case.php b/tests/test_framework/phpbb_functional_test_case.php
index ed307c3ce2..8929e93cfb 100644
--- a/tests/test_framework/phpbb_functional_test_case.php
+++ b/tests/test_framework/phpbb_functional_test_case.php
@@ -150,7 +150,7 @@ class phpbb_functional_test_case extends phpbb_test_case
{
global $phpbb_root_path, $phpEx;
// so we don't reopen an open connection
- if (!($this->db instanceof phpbb_db_driver))
+ if (!($this->db instanceof \phpbb\db\driver\driver))
{
$dbms = self::$config['dbms'];
$this->db = new $dbms();
@@ -163,7 +163,7 @@ class phpbb_functional_test_case extends phpbb_test_case
{
if (!$this->cache)
{
- $this->cache = new phpbb_cache_driver_file;
+ $this->cache = new \phpbb\cache\driver\file;
}
return $this->cache;
@@ -182,11 +182,11 @@ class phpbb_functional_test_case extends phpbb_test_case
{
global $phpbb_root_path, $phpEx;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$db = $this->get_db();
- $db_tools = new phpbb_db_tools($db);
+ $db_tools = new \phpbb\db\tools($db);
- $migrator = new phpbb_db_migrator(
+ $migrator = new \phpbb\db\migrator(
$config,
$db,
$db_tools,
@@ -199,11 +199,11 @@ class phpbb_functional_test_case extends phpbb_test_case
$container = new phpbb_mock_container_builder();
$container->set('migrator', $migrator);
- $extension_manager = new phpbb_extension_manager(
+ $extension_manager = new \phpbb\extension\manager(
$container,
$db,
$config,
- new phpbb_filesystem(),
+ new \phpbb\filesystem(),
self::$config['table_prefix'] . 'ext',
dirname(__FILE__) . '/',
$php_ext,
@@ -471,7 +471,7 @@ class phpbb_functional_test_case extends phpbb_test_case
// Required by unique_id
global $config;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$config['rand_seed'] = '';
$config['rand_seed_last_update'] = time() + 600;
@@ -484,7 +484,7 @@ class phpbb_functional_test_case extends phpbb_test_case
}
$cache = new phpbb_mock_null_cache;
- $cache_driver = new phpbb_cache_driver_null();
+ $cache_driver = new \phpbb\cache\driver\null();
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container
->expects($this->any())
@@ -521,18 +521,18 @@ class phpbb_functional_test_case extends phpbb_test_case
{
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$config['coppa_enable'] = 0;
$db = $this->get_db();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('phpbb_user');
- $auth = $this->getMock('phpbb_auth');
+ $user = $this->getMock('\phpbb\user');
+ $auth = $this->getMock('\phpbb\auth\auth');
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$cache = new phpbb_mock_null_cache;
- $cache_driver = new phpbb_cache_driver_null();
+ $cache_driver = new \phpbb\cache\driver\null();
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container
->expects($this->any())
@@ -563,18 +563,18 @@ class phpbb_functional_test_case extends phpbb_test_case
{
global $db, $cache, $auth, $config, $phpbb_dispatcher, $phpbb_log, $phpbb_container, $phpbb_root_path, $phpEx;
- $config = new phpbb_config(array());
+ $config = new \phpbb\config\config(array());
$config['coppa_enable'] = 0;
$db = $this->get_db();
$phpbb_dispatcher = new phpbb_mock_event_dispatcher();
- $user = $this->getMock('phpbb_user');
- $auth = $this->getMock('phpbb_auth');
+ $user = $this->getMock('\phpbb\user');
+ $auth = $this->getMock('\phpbb\auth\auth');
- $phpbb_log = new phpbb_log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
+ $phpbb_log = new \phpbb\log\log($db, $user, $auth, $phpbb_dispatcher, $phpbb_root_path, 'adm/', $phpEx, LOG_TABLE);
$cache = new phpbb_mock_null_cache;
- $cache_driver = new phpbb_cache_driver_null();
+ $cache_driver = new \phpbb\cache\driver\null();
$phpbb_container = $this->getMock('Symfony\Component\DependencyInjection\ContainerInterface');
$phpbb_container
->expects($this->any())
diff --git a/tests/test_framework/phpbb_test_case_helpers.php b/tests/test_framework/phpbb_test_case_helpers.php
index 3d9cd10f32..4463ce19de 100644
--- a/tests/test_framework/phpbb_test_case_helpers.php
+++ b/tests/test_framework/phpbb_test_case_helpers.php
@@ -107,7 +107,7 @@ class phpbb_test_case_helpers
if (extension_loaded('sqlite') && version_compare(PHPUnit_Runner_Version::id(), '3.4.15', '>='))
{
$config = array_merge($config, array(
- 'dbms' => 'phpbb_db_driver_sqlite',
+ 'dbms' => '\phpbb\db\driver\sqlite',
'dbhost' => dirname(__FILE__) . '/../phpbb_unit_tests.sqlite2', // filename
'dbport' => '',
'dbname' => '',
diff --git a/tests/tree/nestedset_forum_base.php b/tests/tree/nestedset_forum_base.php
index 43680609f8..ce03c1fc21 100644
--- a/tests/tree/nestedset_forum_base.php
+++ b/tests/tree/nestedset_forum_base.php
@@ -52,11 +52,11 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
global $config;
- $config = $this->config = new phpbb_config(array('nestedset_forum_lock' => 0));
+ $config = $this->config = new \phpbb\config\config(array('nestedset_forum_lock' => 0));
set_config(null, null, null, $this->config);
- $this->lock = new phpbb_lock_db('nestedset_forum_lock', $this->config, $this->db);
- $this->set = new phpbb_tree_nestedset_forum($this->db, $this->lock, 'phpbb_forums');
+ $this->lock = new \phpbb\lock\db('nestedset_forum_lock', $this->config, $this->db);
+ $this->set = new \phpbb\tree\nestedset_forum($this->db, $this->lock, 'phpbb_forums');
$this->set_up_forums();
}
@@ -97,7 +97,7 @@ class phpbb_tests_tree_nestedset_forum_base extends phpbb_database_test_case
}
else
{
- $buffer = new phpbb_db_sql_insert_buffer($this->db, 'phpbb_forums');
+ $buffer = new \phpbb\db\sql_insert_buffer($this->db, 'phpbb_forums');
$buffer->insert_all($forums);
$buffer->flush();
diff --git a/tests/user/lang_test.php b/tests/user/lang_test.php
index d7ff451a70..c7c858c59d 100644
--- a/tests/user/lang_test.php
+++ b/tests/user/lang_test.php
@@ -11,7 +11,7 @@ class phpbb_user_lang_test extends phpbb_test_case
{
public function test_user_lang_sprintf()
{
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array(
'FOO' => 'BAR',
'BARZ' => 'PENG',
@@ -93,7 +93,7 @@ class phpbb_user_lang_test extends phpbb_test_case
$this->assertEquals($user->lang('ARRY', 1, 's', 2), '1 post');
// ticket PHPBB3-10345 - different plural rules, not just 0/1/2+
- $user = new phpbb_user;
+ $user = new \phpbb\user;
$user->lang = array(
'PLURAL_RULE' => 13,
'ARRY' => array(
diff --git a/tests/user/user_loader_test.php b/tests/user/user_loader_test.php
index 5cdb654b18..13c35030f9 100644
--- a/tests/user/user_loader_test.php
+++ b/tests/user/user_loader_test.php
@@ -24,7 +24,7 @@ class phpbb_user_loader_test extends phpbb_database_test_case
parent::setUp();
$this->db = $this->new_dbal();
- $this->user_loader = new phpbb_user_loader($this->db, __DIR__ . '/../../phpBB/', 'php', 'phpbb_users');
+ $this->user_loader = new \phpbb\user_loader($this->db, __DIR__ . '/../../phpBB/', 'php', 'phpbb_users');
}
public function test_load_get()
diff --git a/tests/wrapper/phpbb_php_ini_fake.php b/tests/wrapper/phpbb_php_ini_fake.php
index 49bc5936e5..d9e96447e3 100644
--- a/tests/wrapper/phpbb_php_ini_fake.php
+++ b/tests/wrapper/phpbb_php_ini_fake.php
@@ -7,7 +7,7 @@
*
*/
-class phpbb_php_ini_fake extends phpbb_php_ini
+class phpbb_php_ini_fake extends \phpbb\php\ini
{
function get($varname)
{