2 namespace TYPO3\CMS\Extensionmanager\Utility\Importer;
71 'serialized_dependencies',
113 public function __construct()
116 $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager::class);
117 $this->repositoryRepository = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class);
118 $this->extensionRepository = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository::class);
119 $this->extensionModel = $this->objectManager->get(\TYPO3\CMS\Extensionmanager\Domain\Model\Extension::class);
121 $this->parser = \TYPO3\CMS\Extensionmanager\Utility\Parser\XmlParserFactory::getParserInstance(
'extension');
122 if (is_object($this->parser)) {
123 $this->parser->attach($this);
125 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(get_class($this) .
': No XML parser available.');
141 $zlibStream =
'compress.zlib://';
142 $this->sumRecords = 0;
143 $this->parser->parseXML($zlibStream . $localExtensionListFile);
145 if (!empty($this->arrRows)) {
146 $GLOBALS[
'TYPO3_DB']->exec_INSERTmultipleRows(
'tx_extensionmanager_domain_model_extension', self::$fieldNames, $this->arrRows, self::$fieldIndicesNoQuote);
148 $extensions = $this->extensionRepository->insertLastVersion($this->repositoryUid);
149 $this->repositoryRepository->updateRepositoryCount($extensions, $this->repositoryUid);
162 if ($this->sumRecords !== 0 && $this->sumRecords % 50 === 0) {
163 $GLOBALS[
'TYPO3_DB']->exec_INSERTmultipleRows(
'tx_extensionmanager_domain_model_extension', self::$fieldNames, $this->arrRows, self::$fieldIndicesNoQuote);
164 $this->arrRows = array();
166 $versionRepresentations = \TYPO3\CMS\Core\Utility\VersionNumberUtility::convertVersionStringToArray($subject->getVersion());
168 $this->arrRows[] = array(
169 $subject->getExtkey(),
170 $subject->getVersion(),
171 $versionRepresentations[
'version_int'],
174 (int)$subject->getAlldownloadcounter(),
175 (int)$subject->getDownloadcounter(),
176 !is_null($subject->getTitle()) ? $subject->getTitle() :
'',
177 $subject->getOwnerusername(),
178 !is_null($subject->getAuthorname()) ? $subject->getAuthorname() :
'',
179 !is_null($subject->getAuthoremail()) ? $subject->getAuthoremail() :
'',
180 !is_null($subject->getAuthorcompany()) ? $subject->getAuthorcompany() :
'',
181 (int)$subject->getLastuploaddate(),
182 $subject->getT3xfilemd5(),
184 $this->extensionModel->getDefaultState($subject->getState() ?:
''),
185 (
int)$subject->getReviewstate(),
186 $this->extensionModel->getCategoryIndexFromStringOrNumber($subject->getCategory() ?:
''),
187 $subject->getDescription() ?:
'',
188 $subject->getDependencies() ?:
'',
189 $subject->getUploadcomment() ?:
''
200 public function update(\SplSubject $subject)
202 if (is_subclass_of($subject, \TYPO3\CMS\Extensionmanager\Utility\Parser\AbstractExtensionXmlParser::class)) {