Upgrade to rc5

This commit is contained in:
Bastian Allgeier
2020-12-10 11:24:42 +01:00
parent 3fec0d7c93
commit c378376bc9
257 changed files with 13009 additions and 1846 deletions

3050
kirby/vendor/getkirby/composer-installer/composer.lock generated vendored Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -2,23 +2,23 @@
namespace Kirby\ComposerInstaller;
use InvalidArgumentException;
use Composer\Config;
use Composer\Package\PackageInterface;
use InvalidArgumentException;
/**
* @package Kirby Composer Installer
* @author Lukas Bestle <lukas@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license MIT
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
class CmsInstaller extends Installer
{
/**
* Decides if the installer supports the given type
*
* @param string $packageType
* @param string $packageType
* @return bool
*/
public function supports($packageType): bool
@@ -29,8 +29,8 @@ class CmsInstaller extends Installer
/**
* Returns the installation path of a package
*
* @param PackageInterface $package
* @return string path
* @param PackageInterface $package
* @return string path
*/
public function getInstallPath(PackageInterface $package): string
{

View File

@@ -2,24 +2,25 @@
namespace Kirby\ComposerInstaller;
use RuntimeException;
use Composer\Installer\LibraryInstaller;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
use React\Promise\PromiseInterface;
use RuntimeException;
/**
* @package Kirby Composer Installer
* @author Lukas Bestle <lukas@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license MIT
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
class Installer extends LibraryInstaller
{
/**
* Decides if the installer supports the given type
*
* @param string $packageType
* @param string $packageType
* @return bool
*/
public function supports($packageType): bool
@@ -30,34 +31,54 @@ class Installer extends LibraryInstaller
/**
* Installs specific package.
*
* @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $package package instance
* @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $package package instance
*/
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
// first install the package normally...
parent::install($repo, $package);
$promise = parent::install($repo, $package);
// ...then run custom code
$this->postInstall($package);
$postInstall = function () use ($package) {
$this->postInstall($package);
};
// Composer 2 in async mode
if ($promise instanceof PromiseInterface) {
return $promise->then($postInstall);
}
// Composer 1 or Composer 2 without async
$postInstall();
}
/**
* Updates specific package.
*
* @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $initial already installed package version
* @param PackageInterface $target updated version
* @param InstalledRepositoryInterface $repo repository in which to check
* @param PackageInterface $initial already installed package version
* @param PackageInterface $target updated version
*
* @throws InvalidArgumentException if $initial package is not installed
*/
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
// first update the package normally...
parent::update($repo, $initial, $target);
$promise = parent::update($repo, $initial, $target);
// ...then run custom code
$this->postInstall($target);
$postInstall = function () use ($target) {
$this->postInstall($target);
};
// Composer 2 in async mode
if ($promise instanceof PromiseInterface) {
return $promise->then($postInstall);
}
// Composer 1 or Composer 2 without async
$postInstall();
}
/**

View File

@@ -10,15 +10,15 @@ use Composer\Plugin\PluginInterface;
* @package Kirby Composer Installer
* @author Lukas Bestle <lukas@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license MIT
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
class Plugin implements PluginInterface
{
/**
* Apply plugin modifications to Composer
*
* @param Composer $composer
* @param Composer $composer
* @param IOInterface $io
*/
public function activate(Composer $composer, IOInterface $io)
@@ -27,4 +27,28 @@ class Plugin implements PluginInterface
$installationManager->addInstaller(new CmsInstaller($io, $composer));
$installationManager->addInstaller(new PluginInstaller($io, $composer));
}
/**
* Remove any hooks from Composer
* @codeCoverageIgnore
*
* @param Composer $composer
* @param IOInterface $io
*/
public function deactivate(Composer $composer, IOInterface $io)
{
// nothing to do
}
/**
* Prepare the plugin to be uninstalled
* @codeCoverageIgnore
*
* @param Composer $composer
* @param IOInterface $io
*/
public function uninstall(Composer $composer, IOInterface $io)
{
// nothing to do
}
}

View File

@@ -8,15 +8,15 @@ use Composer\Package\PackageInterface;
* @package Kirby Composer Installer
* @author Lukas Bestle <lukas@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license MIT
* @copyright Bastian Allgeier GmbH
* @license https://opensource.org/licenses/MIT
*/
class PluginInstaller extends Installer
{
/**
* Decides if the installer supports the given type
*
* @param string $packageType
* @param string $packageType
* @return bool
*/
public function supports($packageType): bool
@@ -27,8 +27,8 @@ class PluginInstaller extends Installer
/**
* Returns the installation path of a package
*
* @param PackageInterface $package
* @return string path
* @param PackageInterface $package
* @return string path
*/
public function getInstallPath(PackageInterface $package): string
{
@@ -85,7 +85,7 @@ class PluginInstaller extends Installer
* otherwise (if the Pluginkit is not yet supported by the plugin)
* the installer will fall back to the behavior of the LibraryInstaller
*
* @param PackageInterface $package
* @param PackageInterface $package
* @return bool
*/
protected function supportsPluginkit(PackageInterface $package): bool