1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-23 16:52:54 +02:00

[ticket/14492] Allow specifying extensions to update & install

PHPBB3-14492
This commit is contained in:
Marc Alexander
2016-02-24 15:05:01 +01:00
parent eb1ade6768
commit 65d6e338a9
4 changed files with 34 additions and 1 deletions

View File

@@ -13,6 +13,8 @@
namespace phpbb\install\module\install_finish\task;
use Symfony\Component\Console\Input\ArgvInput;
/**
* Installs extensions that exist in ext folder upon install
*/
@@ -100,12 +102,19 @@ class install_extensions extends \phpbb\install\task_base
$this->user->session_begin();
$this->user->setup(array('common', 'acp/common', 'cli'));
$install_extensions = $this->iohandler->get_input('install-extensions', array());
// Find available extensions
foreach ($this->finder as $file)
{
/** @var \SplFileInfo $file */
$ext_name = preg_replace('#(.+[\\/\\\]ext[\\/\\\])(\w+)[\\/\\\](\w+)#', '$2/$3', dirname($file->getRealPath()));
if (!empty($install_extensions) && !in_array($ext_name, $install_extensions))
{
continue;
}
if ($this->extension_manager->is_available($ext_name))
{
$this->extension_manager->enable($ext_name);