[ticket/11150] Disable packagist and add titania

PHPBB3-11150
This commit is contained in:
Tristan Darricau 2015-12-08 20:40:35 +01:00 committed by Tristan Darricau
parent 7958dca09d
commit 8ea2ecf835
No known key found for this signature in database
GPG key ID: 817043C2E29DB881
6 changed files with 47 additions and 43 deletions

View file

@ -10,7 +10,7 @@
<div class="errorbox"> <div class="errorbox">
{{ lang('EXTENSIONS_COMPOSER_NOT_WRITABLE') }} {{ lang('EXTENSIONS_COMPOSER_NOT_WRITABLE') }}
</div> </div>
{% endif %}I {% 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> &bull; <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> &bull; <a href="javascript:phpbb.toggleDisplay('catalog_settings');">{{ lang('SETTINGS') }}</a></span>

View file

@ -144,26 +144,27 @@ services:
console.command.extension.install: console.command.extension.install:
class: phpbb\console\command\extension\install class: phpbb\console\command\extension\install
arguments: arguments:
- @user - '@user'
- @ext.composer.manager - '@ext.composer.manager'
- '@language'
tags: tags:
- { name: console.command } - { name: console.command }
console.command.extension.list_available: console.command.extension.list_available:
class: phpbb\console\command\extension\list_available class: phpbb\console\command\extension\list_available
arguments: arguments:
- @user - '@user'
- @ext.composer.manager - '@ext.composer.manager'
- @language - '@language'
tags: tags:
- { name: console.command } - { name: console.command }
console.command.extension.manage: console.command.extension.manage:
class: phpbb\console\command\extension\manage class: phpbb\console\command\extension\manage
arguments: arguments:
- @user - '@user'
- @ext.composer.manager - '@ext.composer.manager'
- @language - '@language'
tags: tags:
- { name: console.command } - { name: console.command }
@ -179,9 +180,9 @@ services:
console.command.extension.remove: console.command.extension.remove:
class: phpbb\console\command\extension\remove class: phpbb\console\command\extension\remove
arguments: arguments:
- @user - '@user'
- @ext.composer.manager - '@ext.composer.manager'
- @language - '@language'
tags: tags:
- { name: console.command } - { name: console.command }
@ -197,8 +198,9 @@ services:
console.command.extension.update: console.command.extension.update:
class: phpbb\console\command\extension\update class: phpbb\console\command\extension\update
arguments: arguments:
- @user - '@user'
- @ext.composer.manager - '@ext.composer.manager'
- '@language'
tags: tags:
- { name: console.command } - { name: console.command }

View file

@ -2,45 +2,45 @@ services:
ext.manager: ext.manager:
class: phpbb\extension\manager class: phpbb\extension\manager
arguments: arguments:
- @service_container - '@service_container'
- @dbal.conn - '@dbal.conn'
- @config - '@config'
- @filesystem - '@filesystem'
- %tables.ext% - '%tables.ext%'
- %core.root_path% - '%core.root_path%'
- %core.php_ext% - '%core.php_ext%'
- @cache - '@cache'
ext.composer.installer: ext.composer.installer:
class: phpbb\composer\installer class: phpbb\composer\installer
arguments: arguments:
- %core.root_path% - '%core.root_path%'
- @config - '@config'
ext.composer.manager: ext.composer.manager:
class: phpbb\composer\extension_manager class: phpbb\composer\extension_manager
arguments: arguments:
- @ext.composer.installer - '@ext.composer.installer'
- @cache.driver - '@cache.driver'
- @ext.manager - '@ext.manager'
- @filesystem - '@filesystem'
- phpbb-extension - phpbb-extension
- EXTENSIONS_ - EXTENSIONS_
- %core.root_path% - '%core.root_path%'
- @config - '@config'
style.composer.manager: style.composer.manager:
class: phpbb\composer\manager class: phpbb\composer\manager
arguments: arguments:
- @ext.composer.installer - '@ext.composer.installer'
- @cache.driver - '@cache.driver'
- phpbb-style - phpbb-style
- STYLES_ - STYLES_
lang.composer.manager: lang.composer.manager:
class: phpbb\composer\manager class: phpbb\composer\manager
arguments: arguments:
- @ext.composer.installer - '@ext.composer.installer'
- @cache.driver - '@cache.driver'
- phpbb-language - phpbb-language
- LANGUAGES_ - LANGUAGES_

View file

@ -164,7 +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_COMPOSER_NOT_WRITABLE' => 'TODO: some required files / directory are not writable => disable ', '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.json.lock',
'STABILITY_STABLE' => 'stable', 'STABILITY_STABLE' => 'stable',
'STABILITY_RC' => 'RC', 'STABILITY_RC' => 'RC',

View file

@ -20,10 +20,10 @@ use Composer\IO\NullIO;
use Composer\Json\JsonFile; use Composer\Json\JsonFile;
use Composer\Package\BasePackage; use Composer\Package\BasePackage;
use Composer\Package\CompletePackage; use Composer\Package\CompletePackage;
use Composer\Package\LinkConstraint\LinkConstraintInterface;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Repository\ComposerRepository; use Composer\Repository\ComposerRepository;
use Composer\Repository\RepositoryInterface; use Composer\Repository\RepositoryInterface;
use Composer\Semver\Constraint\ConstraintInterface;
use Composer\Util\RemoteFilesystem; use Composer\Util\RemoteFilesystem;
use phpbb\config\config; use phpbb\config\config;
use phpbb\exception\runtime_exception; use phpbb\exception\runtime_exception;
@ -85,7 +85,7 @@ class installer
{ {
$repositories = json_decode($config['exts_composer_repositories'], true); $repositories = json_decode($config['exts_composer_repositories'], true);
if (!is_array($repositories) && !empty($repositories)) if (is_array($repositories) && !empty($repositories))
{ {
$this->repositories = (array) $repositories; $this->repositories = (array) $repositories;
} }
@ -296,7 +296,7 @@ class installer
$io = new NullIO(); $io = new NullIO();
$composer = Factory::create($io, $this->get_composer_ext_json_filename(), false); $composer = Factory::create($io, $this->get_composer_ext_json_filename(), false);
/** @var LinkConstraintInterface $core_constraint */ /** @var ConstraintInterface $core_constraint */
$core_constraint = $composer->getPackage()->getRequires()['phpbb/phpbb']->getConstraint(); $core_constraint = $composer->getPackage()->getRequires()['phpbb/phpbb']->getConstraint();
$core_stability = $composer->getPackage()->getMinimumStability(); $core_stability = $composer->getPackage()->getMinimumStability();
@ -430,14 +430,14 @@ class installer
* Updates $compatible_packages with the versions of $versions compatibles with the $core_constraint * Updates $compatible_packages with the versions of $versions compatibles with the $core_constraint
* *
* @param array $compatible_packages List of compatibles versions * @param array $compatible_packages List of compatibles versions
* @param LinkConstraintInterface $core_constraint Constraint against the phpBB version * @param ConstraintInterface $core_constraint Constraint against the phpBB version
* @param string $core_stability Core stability * @param string $core_stability Core stability
* @param string $package_name Considered package * @param string $package_name Considered package
* @param array $versions List of available versions * @param array $versions List of available versions
* *
* @return array * @return array
*/ */
private function get_compatible_versions(array $compatible_packages, LinkConstraintInterface $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']) //VersionParser::parseStability($version['version'])
@ -451,7 +451,7 @@ class installer
if (array_key_exists('phpbb/phpbb', $version->getRequires())) if (array_key_exists('phpbb/phpbb', $version->getRequires()))
{ {
/** @var LinkConstraintInterface $package_constraint */ /** @var ConstraintInterface $package_constraint */
$package_constraint = $version->getRequires()['phpbb/phpbb']->getConstraint(); $package_constraint = $version->getRequires()['phpbb/phpbb']->getConstraint();
if (!$package_constraint->matches($core_constraint)) if (!$package_constraint->matches($core_constraint))

View file

@ -18,8 +18,10 @@ class extensions_composer extends \phpbb\db\migration\migration
public function update_data() public function update_data()
{ {
return array( return array(
array('config.add', array('exts_composer_repositories', json_encode([], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))), array('config.add', array('exts_composer_repositories', json_encode([
array('config.add', array('exts_composer_packagist', true)), 'https://www.phpbb.com/customise/db/composer/',
], JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES))),
array('config.add', array('exts_composer_packagist', false)),
array('config.add', array('exts_composer_json_file', 'composer-ext.json')), array('config.add', array('exts_composer_json_file', 'composer-ext.json')),
array('config.add', array('exts_composer_vendor_dir', 'vendor-ext/')), array('config.add', array('exts_composer_vendor_dir', 'vendor-ext/')),
array('config.add', array('exts_composer_enable_on_install', false)), array('config.add', array('exts_composer_enable_on_install', false)),