This commit is contained in:
wangjinlei
2022-03-30 11:59:42 +08:00
parent 22aa65547b
commit 6313a35360
102 changed files with 3278 additions and 15906 deletions

View File

@@ -11,7 +11,6 @@
namespace think\composer;
use Composer\Installer\LibraryInstaller;
use Composer\Package\PackageInterface;
use Composer\Repository\InstalledRepositoryInterface;
@@ -20,15 +19,16 @@ class ThinkExtend extends LibraryInstaller
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
parent::install($repo, $package);
$this->copyExtraFiles($package);
return parent::install($repo, $package)->then(function () use ($package) {
$this->copyExtraFiles($package);
});
}
public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target)
{
parent::update($repo, $initial, $target);
$this->copyExtraFiles($target);
return parent::update($repo, $initial, $target)->then(function () use ($target) {
$this->copyExtraFiles($target);
});
}
protected function copyExtraFiles(PackageInterface $package)
@@ -74,4 +74,4 @@ class ThinkExtend extends LibraryInstaller
{
return 'think-extend' === $packageType;
}
}
}