| @@ 706-722 (lines=17) @@ | ||
| 703 | * |
|
| 704 | * @return RepositoryManager The repository manager |
|
| 705 | */ |
|
| 706 | public function getRepositoryManager() |
|
| 707 | { |
|
| 708 | if (!$this->started) { |
|
| 709 | throw new LogicException('Puli was not started'); |
|
| 710 | } |
|
| 711 | ||
| 712 | if (!$this->repositoryManager && $this->context instanceof ProjectContext) { |
|
| 713 | $this->repositoryManager = new RepositoryManagerImpl( |
|
| 714 | $this->context, |
|
| 715 | $this->getRepository(), |
|
| 716 | $this->getModuleManager()->findModules(Expr::method('isEnabled', Expr::same(true))), |
|
| 717 | $this->getJsonStorage() |
|
| 718 | ); |
|
| 719 | } |
|
| 720 | ||
| 721 | return $this->repositoryManager; |
|
| 722 | } |
|
| 723 | ||
| 724 | /** |
|
| 725 | * Returns the resource discovery manager. |
|
| @@ 729-746 (lines=18) @@ | ||
| 726 | * |
|
| 727 | * @return DiscoveryManager The discovery manager |
|
| 728 | */ |
|
| 729 | public function getDiscoveryManager() |
|
| 730 | { |
|
| 731 | if (!$this->started) { |
|
| 732 | throw new LogicException('Puli was not started'); |
|
| 733 | } |
|
| 734 | ||
| 735 | if (!$this->discoveryManager && $this->context instanceof ProjectContext) { |
|
| 736 | $this->discoveryManager = new DiscoveryManagerImpl( |
|
| 737 | $this->context, |
|
| 738 | $this->getDiscovery(), |
|
| 739 | $this->getModuleManager()->findModules(Expr::method('isEnabled', Expr::same(true))), |
|
| 740 | $this->getJsonStorage(), |
|
| 741 | $this->logger |
|
| 742 | ); |
|
| 743 | } |
|
| 744 | ||
| 745 | return $this->discoveryManager; |
|
| 746 | } |
|
| 747 | ||
| 748 | /** |
|
| 749 | * Returns the asset manager. |
|