aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_extensions.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-11 13:04:00 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-28 22:16:48 +0200
commit5e29ea77d813fb6f10583fa440ed4e55e78bd28d (patch)
treeabfca48dc000aba18c55d53d2b43f596fa5856d3 /phpBB/includes/acp/acp_extensions.php
parenta80a9efa8de086e0100b1a6d33ac349e955e9d18 (diff)
downloadforums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.gz
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.bz2
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.tar.xz
forums-5e29ea77d813fb6f10583fa440ed4e55e78bd28d.zip
[ticket/11366] Coding style
PHPBB3-11366
Diffstat (limited to 'phpBB/includes/acp/acp_extensions.php')
-rw-r--r--phpBB/includes/acp/acp_extensions.php66
1 files changed, 33 insertions, 33 deletions
diff --git a/phpBB/includes/acp/acp_extensions.php b/phpBB/includes/acp/acp_extensions.php
index 4db4d38f3a..b74e020edd 100644
--- a/phpBB/includes/acp/acp_extensions.php
+++ b/phpBB/includes/acp/acp_extensions.php
@@ -267,8 +267,8 @@ class acp_extensions
catch (\RuntimeException $e)
{
$template->assign_vars(array(
- 'S_VERSIONCHECK_FAIL' => true,
- 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
+ 'S_VERSIONCHECK_STATUS' => $e->getCode(),
+ 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '',
));
}
@@ -283,11 +283,11 @@ class acp_extensions
}
/**
- * Lists all the enabled extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the enabled extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_enabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$enabled_extension_meta_data = array();
@@ -323,7 +323,7 @@ class acp_extensions
}
}
- uasort($enabled_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($enabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($enabled_extension_meta_data as $name => $infos)
{
@@ -339,11 +339,11 @@ class acp_extensions
}
/**
- * Lists all the disabled extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the disabled extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_disabled_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$disabled_extension_meta_data = array();
@@ -379,7 +379,7 @@ class acp_extensions
}
}
- uasort($disabled_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($disabled_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($disabled_extension_meta_data as $name => $infos)
{
@@ -396,11 +396,11 @@ class acp_extensions
}
/**
- * Lists all the available extensions and dumps to the template
- *
- * @param $phpbb_extension_manager An instance of the extension manager
- * @return null
- */
+ * Lists all the available extensions and dumps to the template
+ *
+ * @param $phpbb_extension_manager An instance of the extension manager
+ * @return null
+ */
public function list_available_exts(\phpbb\extension\manager $phpbb_extension_manager)
{
$uninstalled = array_diff_key($phpbb_extension_manager->all_available(), $phpbb_extension_manager->all_configured());
@@ -438,7 +438,7 @@ class acp_extensions
}
}
- uasort($available_extension_meta_data, array('self', 'sort_extension_meta_data_table'));
+ uasort($available_extension_meta_data, array($this, 'sort_extension_meta_data_table'));
foreach ($available_extension_meta_data as $name => $infos)
{
@@ -472,33 +472,33 @@ class acp_extensions
}
/**
- * Check the version and return the availables updates.
- *
- * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.
- * @param bool $force Ignores cached data. Default to false.
- */
- private function version_check(\phpbb\extension\metadata_manager $md_manager, $force = false)
+ * Check the version and return the availables updates.
+ *
+ * @param \phpbb\extension\metadata_manager $md_manager The metadata manager for the version to check.
+ * @param bool $force Ignores cached data. Default to false.
+ */
+ protected function version_check(\phpbb\extension\metadata_manager $md_manager, $force = false)
{
$meta = $md_manager->get_metadata('all');
- if (! isset($meta['extra']['version-check']))
+ if (!isset($meta['extra']['version-check']))
{
- throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'));
+ throw new \RuntimeException($this->user->lang('NO_VERSIONCHECK'), 1);
}
- $meta_vc = $meta['extra']['version-check'];
+ $version_check = $meta['extra']['version-check'];
$version_helper = new \phpbb\version_helper($this->cache, $this->config, $this->user);
$version_helper->set_current_version($meta['version']);
- $version_helper->set_file_location($meta_vc['host'], $meta_vc['directory'], $meta_vc['filename']);
+ $version_helper->set_file_location($version_check ['host'], $version_check ['directory'], $version_check ['filename']);
return $updates = $version_helper->get_suggested_updates(true);
}
/**
- * Sort helper for the table containing the metadata about the extensions.
- */
- static private function sort_extension_meta_data_table($val1, $val2)
+ * Sort helper for the table containing the metadata about the extensions.
+ */
+ protected function sort_extension_meta_data_table($val1, $val2)
{
return strnatcasecmp($val1['META_DISPLAY_NAME'], $val2['META_DISPLAY_NAME']);
}