85 $this->objectManager = GeneralUtility::makeInstance(ObjectManager::class);
87 $this->extensionRepository = $this->objectManager->get(ExtensionRepository::class);
143 protected function fetchFile($remoteResource, $localResource)
145 $isOffline = (bool)GeneralUtility::makeInstance(ExtensionConfiguration::class)->get(
'extensionmanager',
'offlineMode');
147 throw new ExtensionManagerException(
'Extension Manager is in offline mode. No TER connection available.', 1437078780);
149 if (is_string($remoteResource) && is_string($localResource) && !empty($remoteResource) && !empty($localResource)) {
150 $fileContent = GeneralUtility::getUrl($remoteResource);
151 if ($fileContent !==
false) {
152 if (GeneralUtility::writeFileToTypo3tempDir($localResource, $fileContent) !==
null) {
153 throw new ExtensionManagerException(sprintf(
'Could not write to file %s.', $localResource), 1342635378);
156 throw new ExtensionManagerException(sprintf(
'Could not access remote resource %s.', $remoteResource), 1342635425);
181 $filePath =
'https://' . $mirror[
'host'] . $mirror[
'path'] .
'extensions.xml.gz';
194 $filePath =
'https://' . $mirror[
'host'] . $mirror[
'path'] .
'extensions.md5';
217 $filePath = $this->repository->getMirrorListUrl();
232 public function getMirrors($forcedUpdateFromRemote =
true)
234 $assignedMirror = $this->repository->getMirrors();
235 if ($forcedUpdateFromRemote || $assignedMirror ===
null || !is_object($assignedMirror)) {
239 $objMirrorListImporter = GeneralUtility::makeInstance(MirrorListUtility::class);
240 $this->repository->addMirrors($objMirrorListImporter->getMirrors($this->getLocalMirrorListFile()));
242 return $this->repository->getMirrors();
255 if ($this->repository ===
null) {
256 throw new ExtensionManagerException(
'No extension repository was found.', 1500060252);
258 $updateNecessity = 0;
259 if ($this->extensionRepository->countByRepository($this->repository->getUid()) <= 0) {
266 if ($remotemd5 !==
false) {
268 if ($remotemd5 !== $localmd5) {
272 throw new ExtensionManagerException(
'Could not retrieve extension hash file from remote server.', 1342635016);
275 return $updateNecessity;
290 if ($updateNecessity !== 0) {
293 if (($tmpBitmask & $updateNecessity) > 0) {
295 $updateNecessity &= ~$tmpBitmask;
298 if ($updateNecessity & self::PROBLEM_NO_VERSIONS_IN_DATABASE) {
304 GeneralUtility::makeInstance(ConnectionPool::class)
305 ->getConnectionForTable(
'tx_extensionmanager_domain_model_extension')
306 ->truncate(
'tx_extensionmanager_domain_model_extension');
309 if ($updateNecessity === 0) {
310 $uid = $this->repository->getUid();
311 $objExtListImporter = $this->objectManager->get(ExtensionListUtility::class);