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