Commit 2e802772 authored by Thomas Löffler's avatar Thomas Löffler Committed by Tomas Norre Mikkelsen

Replace old class names

parent 8d86011a
......@@ -40,6 +40,19 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface
*/
protected $mirrorUrl;
/**
* @var \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository
*/
protected $repositoryRepository;
/**
* @param \TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository
*/
public function injectRepositoryRepository(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository $repositoryRepository)
{
$this->repositoryRepository = $repositoryRepository;
}
/**
* Setter for maxAttempts
*
......@@ -138,10 +151,12 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface
}
// Get mirrors from repository object
$repository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_em_Repository', $emSettings['selectedRepository']);
$repository = $this->repositoryRepository->findByUid($emSettings['selectedRepository']);
if ($repository->getMirrorListUrl()) {
$repositoryUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_em_Repository_Utility', $repository);
$mirrors = $repositoryUtility->getMirrors(true)->getMirrors();
$repositoryUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
\TYPO3\CMS\Extensionmanager\Utility\Importer\MirrorListUtility::class
);
$mirrors = $repositoryUtility->getMirrors($repository->getMirrorListUrl())->getMirrors();
unset($repositoryUtility);
if (!is_array($mirrors)) {
throw new \Exception('No mirrors found');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment