aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/adm/style/admin.css4
-rw-r--r--phpBB/develop/compile_template.php2
-rw-r--r--phpBB/develop/extensions.php123
-rw-r--r--phpBB/includes/extension/manager.php30
-rw-r--r--phpBB/includes/template/template.php4
5 files changed, 156 insertions, 7 deletions
diff --git a/phpBB/adm/style/admin.css b/phpBB/adm/style/admin.css
index 666f4921ba..ceda824e5a 100644
--- a/phpBB/adm/style/admin.css
+++ b/phpBB/adm/style/admin.css
@@ -1007,11 +1007,11 @@ fieldset.submit-buttons legend {
/* Input field styles
---------------------------------------- */
-input.radio, input.permissions-checkbox {
+input.radio, input.checkbox, input.permissions-checkbox {
width: auto !important;
background-color: transparent;
border: none;
- cursor: default;
+ cursor: pointer;
}
input.full,
diff --git a/phpBB/develop/compile_template.php b/phpBB/develop/compile_template.php
index e741e909d8..32d1d321f1 100644
--- a/phpBB/develop/compile_template.php
+++ b/phpBB/develop/compile_template.php
@@ -20,5 +20,5 @@ include($phpbb_root_path . 'includes/template_compile.'.$phpEx);
$file = $argv[1];
-$compile = new phpbb_template_compile();
+$compile = new phpbb_template_compile(false);
echo $compile->compile_file($file);
diff --git a/phpBB/develop/extensions.php b/phpBB/develop/extensions.php
new file mode 100644
index 0000000000..2f7c3d1167
--- /dev/null
+++ b/phpBB/develop/extensions.php
@@ -0,0 +1,123 @@
+<?php
+/**
+*
+* @copyright (c) 2012 phpBB Group
+* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
+*
+*/
+
+define('IN_PHPBB', 1);
+define('ANONYMOUS', 1);
+$phpEx = substr(strrchr(__FILE__, '.'), 1);
+$phpbb_root_path = __DIR__.'/../';
+
+include($phpbb_root_path . 'common.'.$phpEx);
+
+function usage()
+{
+ echo "Usage: extensions.php COMMAND [OPTION]...\n";
+ echo "Console extension manager.\n";
+ echo "\n";
+ echo "list:\n";
+ echo " Lists all extensions in the database and the filesystem.\n";
+ echo "\n";
+ echo "enable NAME:\n";
+ echo " Enables the specified extension.\n";
+ echo "\n";
+ echo "disable NAME:\n";
+ echo " Disables the specified extension.\n";
+ echo "\n";
+ echo "purge NAME:\n";
+ echo " Purges the specified extension.\n";
+ exit(2);
+}
+
+function list_extensions()
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->load_extensions();
+
+ echo "Enabled:\n";
+ $enabled = array_keys($phpbb_extension_manager->all_enabled());
+ print_extensions($enabled);
+ echo "\n";
+
+ echo "Disabled:\n";
+ $disabled = array_keys($phpbb_extension_manager->all_disabled());
+ print_extensions($disabled);
+ echo "\n";
+
+ echo "Available:\n";
+ $all = array_keys($phpbb_extension_manager->all_available());
+ $purged = array_diff($all, $enabled, $disabled);
+ print_extensions($purged);
+}
+
+function print_extensions($exts)
+{
+ foreach ($exts as $ext)
+ {
+ echo "- $ext\n";
+ }
+}
+
+function enable_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->enable($name);
+}
+
+function disable_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->disable($name);
+}
+
+function purge_extension($name)
+{
+ global $phpbb_extension_manager;
+
+ $phpbb_extension_manager->purge($name);
+}
+
+function validate_argument_count($count)
+{
+ global $argv;
+
+ if (count($argv) <= $count)
+ {
+ usage();
+ }
+}
+
+validate_argument_count(1);
+
+$action = $argv[1];
+
+switch ($action)
+{
+ case 'list':
+ list_extensions();
+ break;
+
+ case 'enable':
+ validate_argument_count(2);
+ enable_extension($argv[2]);
+ break;
+
+ case 'disable':
+ validate_argument_count(2);
+ disable_extension($argv[2]);
+ break;
+
+ case 'purge':
+ validate_argument_count(2);
+ purge_extension($argv[2]);
+ break;
+
+ default:
+ usage();
+}
diff --git a/phpBB/includes/extension/manager.php b/phpBB/includes/extension/manager.php
index 438578e7e7..c38f0df32e 100644
--- a/phpBB/includes/extension/manager.php
+++ b/phpBB/includes/extension/manager.php
@@ -61,7 +61,7 @@ class phpbb_extension_manager
*
* @return null
*/
- protected function load_extensions()
+ public function load_extensions()
{
$sql = 'SELECT *
FROM ' . $this->extension_table;
@@ -167,6 +167,11 @@ class phpbb_extension_manager
$this->db->sql_query($sql);
}
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return !$active;
}
@@ -219,6 +224,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return true;
}
@@ -234,6 +244,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return false;
}
@@ -292,6 +307,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return true;
}
@@ -301,6 +321,11 @@ class phpbb_extension_manager
WHERE ext_name = '" . $this->db->sql_escape($name) . "'";
$this->db->sql_query($sql);
+ if ($this->cache)
+ {
+ $this->cache->destroy($this->cache_name);
+ }
+
return false;
}
@@ -329,7 +354,8 @@ class phpbb_extension_manager
$available = array();
$iterator = new RecursiveIteratorIterator(
- new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'));
+ new RecursiveDirectoryIterator($this->phpbb_root_path . 'ext/'),
+ RecursiveIteratorIterator::SELF_FIRST);
foreach ($iterator as $file_info)
{
if ($file_info->isFile() && $file_info->getFilename() == 'ext' . $this->phpEx)
diff --git a/phpBB/includes/template/template.php b/phpBB/includes/template/template.php
index 989322320b..9297b759ac 100644
--- a/phpBB/includes/template/template.php
+++ b/phpBB/includes/template/template.php
@@ -128,7 +128,7 @@ class phpbb_template
{
$templates = array($template_name => $template_path);
- if ($fallback_template_path !== false)
+ if ($fallback_template_name !== false)
{
$templates[$fallback_template_name] = $fallback_template_path;
}
@@ -306,7 +306,7 @@ class phpbb_template
*
* @param string $handle Handle of the template to load
* @return phpbb_template_renderer Template renderer object, or null on failure
- * @uses template_compile is used to compile template source
+ * @uses phpbb_template_compile is used to compile template source
*/
private function _tpl_load($handle)
{