aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/extension/metadata_manager.php
diff options
context:
space:
mode:
authorNathan Guse <nathaniel.guse@gmail.com>2013-09-30 18:24:46 -0500
committerNathan Guse <nathaniel.guse@gmail.com>2013-09-30 18:24:46 -0500
commita6df011a107132390ecc35b80ab0e88bc31fd103 (patch)
treec91b2a90f4c3cef95c1f734aa0b6b0da4007e2ac /phpBB/phpbb/extension/metadata_manager.php
parent2ee22d4615a86a33d3c65f94d7a9c4b99dfb1b7e (diff)
parent179f41475b555d0a3314d779d0d7423f66f0fb95 (diff)
downloadforums-a6df011a107132390ecc35b80ab0e88bc31fd103.tar
forums-a6df011a107132390ecc35b80ab0e88bc31fd103.tar.gz
forums-a6df011a107132390ecc35b80ab0e88bc31fd103.tar.bz2
forums-a6df011a107132390ecc35b80ab0e88bc31fd103.tar.xz
forums-a6df011a107132390ecc35b80ab0e88bc31fd103.zip
Merge branch 'develop' of github.com:phpbb/phpbb3 into ticket/11850
# By Nils Adermann (68) and others # Via Andreas Fischer (12) and others * 'develop' of github.com:phpbb/phpbb3: (102 commits) [ticket/11876] Replace MD5 with SHA256. [ticket/11876] Move checksum generation from build PHP files to phing build.xml [develop-olympus] Build against 3.0.12 instead of 3.0.12-RC3. Tag exists now. [prep-release-3.0.12] Update changelog for 3.0.12 release. [ticket/11873] Add unit test for large password input. [ticket/11873] Do not hash very large passwords in order to safe resources. [ticket/11862] Correct var names in user_delete() events due to prune-users [develop-olympus] Use 3.0.13-dev as build version. Use latest 3.0.12 RC tag. [prep-release-3.0.12] Bumping version number for 3.0.12 final. [ticket/11852] Add class file [ticket/11852] Move tests to folder with new class name [ticket/11852] Split filesystem and path_helper into 2 classes [ticket/11868] Add @depends to test [ticket/11868] Add functional test for registration [ticket/11868] Replace phpbb_request_interface references [ticket/11866] Only single backslash in .md files [ticket/11866] Remove outdated and broken develop script [ticket/11866] More namespaces [ticket/11866] Update some occurances of phpbb_db_ to new Namespace [ticket/11865] Convert old class name to namespaced version ... Conflicts: tests/security/extract_current_page_test.php tests/session/testable_facade.php
Diffstat (limited to 'phpBB/phpbb/extension/metadata_manager.php')
-rw-r--r--phpBB/phpbb/extension/metadata_manager.php34
1 files changed, 18 insertions, 16 deletions
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.");
}
}