mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 13:35:13 +02:00
Merge branch 'develop' into ticket/10380
* develop: [ticket/10652] Fixing typo in template class [ticket/10645] Missing CSS for checkboxes [ticket/10614] Change not installed heading to available. [ticket/10614] Unbreak all_available on extension manager. [ticket/10614] Check if cache exists before destroying it [ticket/10614] Remove ext manager exceptions for now [ticket/10614] Refactor list command to use manager API [ticket/10614] Add purge command [ticket/10614] Tweak list output, show state, purge cache, handle missing exts [ticket/10614] Make script accessible from anywhere [ticket/10614] Better usage output [ticket/10614] Add a script to enable, disable and view status of extensions. [ticket/10500] Use correct class name in @uses. [ticket/10500] Fix phpbb_template_compile instantiation.
This commit is contained in:
@ -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);
|
||||
|
123
phpBB/develop/extensions.php
Normal file
123
phpBB/develop/extensions.php
Normal file
@ -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();
|
||||
}
|
Reference in New Issue
Block a user