Commit 8889e3f6 authored by Tomas Norre Mikkelsen's avatar Tomas Norre Mikkelsen

Merge branch...

Merge branch '366-oops-an-error-occurred-on-https-extensions-typo3-org-extension-event' into 'develop'

Replace old class names

Closes #366

See merge request !374
parents 8d86011a 2e802772
Pipeline #5321 passed with stages
in 7 minutes and 39 seconds
...@@ -40,6 +40,19 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface ...@@ -40,6 +40,19 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface
*/ */
protected $mirrorUrl; 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 * Setter for maxAttempts
* *
...@@ -138,10 +151,12 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface ...@@ -138,10 +151,12 @@ class MirrorService implements \TYPO3\CMS\Core\SingletonInterface
} }
// Get mirrors from repository object // 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()) { if ($repository->getMirrorListUrl()) {
$repositoryUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_em_Repository_Utility', $repository); $repositoryUtility = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(
$mirrors = $repositoryUtility->getMirrors(true)->getMirrors(); \TYPO3\CMS\Extensionmanager\Utility\Importer\MirrorListUtility::class
);
$mirrors = $repositoryUtility->getMirrors($repository->getMirrorListUrl())->getMirrors();
unset($repositoryUtility); unset($repositoryUtility);
if (!is_array($mirrors)) { if (!is_array($mirrors)) {
throw new \Exception('No mirrors found'); 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