| @@ 624-638 (lines=15) @@ | ||
| 621 | * |
|
| 622 | * @return RootPackageFileManager The package file manager. |
|
| 623 | */ |
|
| 624 | public function getRootPackageFileManager() |
|
| 625 | { |
|
| 626 | if (!$this->started) { |
|
| 627 | throw new LogicException('Puli was not started'); |
|
| 628 | } |
|
| 629 | ||
| 630 | if (!$this->rootPackageFileManager && $this->context instanceof ProjectContext) { |
|
| 631 | $this->rootPackageFileManager = new RootPackageFileManagerImpl( |
|
| 632 | $this->context, |
|
| 633 | $this->getPackageFileStorage() |
|
| 634 | ); |
|
| 635 | } |
|
| 636 | ||
| 637 | return $this->rootPackageFileManager; |
|
| 638 | } |
|
| 639 | ||
| 640 | /** |
|
| 641 | * Returns the package manager. |
|
| @@ 645-659 (lines=15) @@ | ||
| 642 | * |
|
| 643 | * @return PackageManager The package manager. |
|
| 644 | */ |
|
| 645 | public function getPackageManager() |
|
| 646 | { |
|
| 647 | if (!$this->started) { |
|
| 648 | throw new LogicException('Puli was not started'); |
|
| 649 | } |
|
| 650 | ||
| 651 | if (!$this->packageManager && $this->context instanceof ProjectContext) { |
|
| 652 | $this->packageManager = new PackageManagerImpl( |
|
| 653 | $this->context, |
|
| 654 | $this->getPackageFileStorage() |
|
| 655 | ); |
|
| 656 | } |
|
| 657 | ||
| 658 | return $this->packageManager; |
|
| 659 | } |
|
| 660 | ||
| 661 | /** |
|
| 662 | * Returns the resource repository manager. |
|