mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/11150] Improves requirements check
PHPBB3-11150
This commit is contained in:
parent
16d3fa49a1
commit
4599799fba
5 changed files with 25 additions and 10 deletions
|
@ -6,12 +6,6 @@
|
||||||
|
|
||||||
<p>{{ lang( 'EXTENSIONS_CATALOG_EXPLAIN') }}</p>
|
<p>{{ lang( 'EXTENSIONS_CATALOG_EXPLAIN') }}</p>
|
||||||
|
|
||||||
{% if not enabled %}
|
|
||||||
<div class="errorbox">
|
|
||||||
{{ lang('EXTENSIONS_COMPOSER_NOT_WRITABLE') }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<fieldset class="quick quick-left">
|
<fieldset class="quick quick-left">
|
||||||
<span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.1" target="_blank">{{ lang('BROWSE_EXTENSIONS_DATABASE') }}</a> • <a href="javascript:phpbb.toggleDisplay('catalog_settings');">{{ lang('SETTINGS') }}</a></span>
|
<span class="small"><a href="https://www.phpbb.com/go/customise/extensions/3.1" target="_blank">{{ lang('BROWSE_EXTENSIONS_DATABASE') }}</a> • <a href="javascript:phpbb.toggleDisplay('catalog_settings');">{{ lang('SETTINGS') }}</a></span>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
|
@ -169,14 +169,21 @@ class acp_extensions
|
||||||
$this->list_disabled_exts();
|
$this->list_disabled_exts();
|
||||||
$this->list_available_exts();
|
$this->list_available_exts();
|
||||||
|
|
||||||
|
/** @var \phpbb\composer\manager $composer_manager */
|
||||||
$composer_manager = $phpbb_container->get('ext.composer.manager');
|
$composer_manager = $phpbb_container->get('ext.composer.manager');
|
||||||
|
|
||||||
|
$managed_packages = [];
|
||||||
|
if ($composer_manager->check_requirements())
|
||||||
|
{
|
||||||
|
$managed_packages = array_keys($composer_manager->get_managed_packages());
|
||||||
|
}
|
||||||
|
|
||||||
$this->request->enable_super_globals();
|
$this->request->enable_super_globals();
|
||||||
$this->template->assign_vars(array(
|
$this->template->assign_vars(array(
|
||||||
'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1',
|
'U_VERSIONCHECK_FORCE' => $this->u_action . '&action=list&versioncheck_force=1',
|
||||||
'FORCE_UNSTABLE' => $this->config['extension_force_unstable'],
|
'FORCE_UNSTABLE' => $this->config['extension_force_unstable'],
|
||||||
'U_ACTION' => $this->u_action,
|
'U_ACTION' => $this->u_action,
|
||||||
'MANAGED_EXTENSIONS' => array_keys($composer_manager->get_managed_packages()),
|
'MANAGED_EXTENSIONS' => $managed_packages,
|
||||||
'U_CATALOG_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=catalog"),
|
'U_CATALOG_ACTION' => append_sid("{$phpbb_admin_path}index.$phpEx", "i=$id&mode=catalog"),
|
||||||
));
|
));
|
||||||
$this->request->disable_super_globals();
|
$this->request->disable_super_globals();
|
||||||
|
@ -424,6 +431,19 @@ class acp_extensions
|
||||||
/** @var \phpbb\extension\manager $extensions_manager */
|
/** @var \phpbb\extension\manager $extensions_manager */
|
||||||
$extensions_manager = $phpbb_container->get('ext.manager');
|
$extensions_manager = $phpbb_container->get('ext.manager');
|
||||||
|
|
||||||
|
if (!$composer_manager->check_requirements())
|
||||||
|
{
|
||||||
|
$this->page_title = 'ACP_EXTENSIONS_CATALOG';
|
||||||
|
$this->tpl_name = 'message_body';
|
||||||
|
|
||||||
|
$this->template->assign_vars([
|
||||||
|
'MESSAGE_TITLE' => $language->lang('EXTENSIONS_CATALOG_NOT_AVAILABLE'),
|
||||||
|
'MESSAGE_TEXT' => $language->lang('EXTENSIONS_COMPOSER_NOT_WRITABLE'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch ($action)
|
switch ($action)
|
||||||
{
|
{
|
||||||
case 'install':
|
case 'install':
|
||||||
|
@ -659,7 +679,6 @@ class acp_extensions
|
||||||
$this->tpl_name = 'acp_ext_catalog';
|
$this->tpl_name = 'acp_ext_catalog';
|
||||||
|
|
||||||
$this->template->assign_vars([
|
$this->template->assign_vars([
|
||||||
'enabled' => $manager->check_requirements(),
|
|
||||||
'extensions' => $extensions,
|
'extensions' => $extensions,
|
||||||
'managed_extensions' => array_keys($managed_packages),
|
'managed_extensions' => array_keys($managed_packages),
|
||||||
'installed_extensions' => array_keys($extensions_manager->all_available()),
|
'installed_extensions' => array_keys($extensions_manager->all_available()),
|
||||||
|
|
|
@ -164,6 +164,7 @@ $lang = array_merge($lang, array(
|
||||||
'EXTENSIONS_REMOVED' => 'Extensions successfully removed.',
|
'EXTENSIONS_REMOVED' => 'Extensions successfully removed.',
|
||||||
'EXTENSIONS_UPDATED' => 'Extensions successfully updated.',
|
'EXTENSIONS_UPDATED' => 'Extensions successfully updated.',
|
||||||
|
|
||||||
|
'EXTENSIONS_CATALOG_NOT_AVAILABLE' => 'The extensions catalog is not available',
|
||||||
'EXTENSIONS_COMPOSER_NOT_WRITABLE' => 'In order to use the catalog, the following files and directories must be writable: ext/ vendor-ext/ composer-ext.json and composer-ext.lock',
|
'EXTENSIONS_COMPOSER_NOT_WRITABLE' => 'In order to use the catalog, the following files and directories must be writable: ext/ vendor-ext/ composer-ext.json and composer-ext.lock',
|
||||||
|
|
||||||
'STABILITY_STABLE' => 'stable',
|
'STABILITY_STABLE' => 'stable',
|
||||||
|
|
|
@ -92,7 +92,7 @@ class installer
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->packagist = (bool) $config['exts_composer_packagist'];
|
$this->packagist = (bool) $config['exts_composer_packagist'];
|
||||||
$this->composer_filenam = $config['exts_composer_json_file'];
|
$this->composer_filename = $config['exts_composer_json_file'];
|
||||||
$this->packages_vendor_dir = $config['exts_composer_vendor_dir'];
|
$this->packages_vendor_dir = $config['exts_composer_vendor_dir'];
|
||||||
$this->minimum_stability = $config['exts_composer_minimum_stability'];
|
$this->minimum_stability = $config['exts_composer_minimum_stability'];
|
||||||
}
|
}
|
||||||
|
@ -451,7 +451,7 @@ class installer
|
||||||
private function get_compatible_versions(array $compatible_packages, ConstraintInterface $core_constraint, $core_stability, $package_name, array $versions)
|
private function get_compatible_versions(array $compatible_packages, ConstraintInterface $core_constraint, $core_stability, $package_name, array $versions)
|
||||||
{
|
{
|
||||||
$core_stability_value = BasePackage::$stabilities[$core_stability];
|
$core_stability_value = BasePackage::$stabilities[$core_stability];
|
||||||
//VersionParser::parseStability($version['version'])
|
|
||||||
/** @var \Composer\Package\PackageInterface $version */
|
/** @var \Composer\Package\PackageInterface $version */
|
||||||
foreach ($versions as $version)
|
foreach ($versions as $version)
|
||||||
{
|
{
|
||||||
|
|
|
@ -253,6 +253,7 @@ class manager implements manager_interface
|
||||||
if ($this->available_packages === null)
|
if ($this->available_packages === null)
|
||||||
{
|
{
|
||||||
$this->available_packages = $this->cache->get('_composer_' . $this->package_type . '_available');
|
$this->available_packages = $this->cache->get('_composer_' . $this->package_type . '_available');
|
||||||
|
|
||||||
if (!$this->available_packages)
|
if (!$this->available_packages)
|
||||||
{
|
{
|
||||||
$this->available_packages = $this->installer->get_available_packages($this->package_type);
|
$this->available_packages = $this->installer->get_available_packages($this->package_type);
|
||||||
|
|
Loading…
Add table
Reference in a new issue