73 'serialized_dependencies',
82 protected static $tableName =
'tx_extensionmanager_domain_model_extension';
146 $this->objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\
TYPO3\CMS\
Extbase\Object\ObjectManager::class);
147 $this->repositoryRepository = $this->objectManager->get(\
TYPO3\CMS\Extensionmanager\Domain\Repository\RepositoryRepository::class);
148 $this->extensionRepository = $this->objectManager->get(\
TYPO3\CMS\Extensionmanager\Domain\Repository\ExtensionRepository::class);
149 $this->extensionModel = $this->objectManager->get(\
TYPO3\CMS\Extensionmanager\Domain\Model\Extension::class);
152 if (is_object($this->parser)) {
153 $this->parser->attach($this);
155 throw new \TYPO3\CMS\Extensionmanager\Exception\ExtensionManagerException(
156 static::class .
': No XML parser available.',
161 $connection = GeneralUtility::makeInstance(ConnectionPool::class)
162 ->getConnectionForTable(self::$tableName);
164 $connection->getDatabasePlatform()
166 $countOfBindParamsPerRow = count(self::$fieldNames);
169 $this->maxRowsPerChunk = min(
170 $this->maxRowsPerChunk,
171 floor($maxBindParameters / $countOfBindParamsPerRow)
181 $this->minimumDateToImport = strtotime(
'2015-11-10T00:00:00+00:00');
191 public function import($localExtensionListFile,
$repositoryUid =
null)
196 $zlibStream =
'compress.zlib://';
197 $this->sumRecords = 0;
198 $this->parser->parseXml($zlibStream . $localExtensionListFile);
200 if (!empty($this->arrRows)) {
201 GeneralUtility::makeInstance(ConnectionPool::class)
202 ->getConnectionForTable(
'tx_extensionmanager_domain_model_extension')
204 'tx_extensionmanager_domain_model_extension',
209 $extensions = $this->extensionRepository->insertLastVersion($this->repositoryUid);
210 $this->repositoryRepository->updateRepositoryCount($extensions, $this->repositoryUid);
221 if ($this->sumRecords !== 0 && $this->sumRecords % $this->maxRowsPerChunk === 0) {
222 GeneralUtility::makeInstance(ConnectionPool::class)
223 ->getConnectionForTable(self::$tableName)
234 $subject->getExtkey(),
235 $subject->getVersion(),
236 $versionRepresentations[
'version_int'],
239 (int)$subject->getAlldownloadcounter(),
240 (int)$subject->getDownloadcounter(),
241 $subject->getTitle() !==
null ? $subject->getTitle() :
'',
242 $subject->getOwnerusername(),
243 $subject->getAuthorname() !==
null ? $subject->getAuthorname() :
'',
244 $subject->getAuthoremail() !==
null ? $subject->getAuthoremail() :
'',
245 $subject->getAuthorcompany() !==
null ? $subject->getAuthorcompany() :
'',
246 (int)$subject->getLastuploaddate(),
247 $subject->getT3xfilemd5(),
249 $this->extensionModel->getDefaultState($subject->getState() ?:
''),
250 (
int)$subject->getReviewstate(),
251 $this->extensionModel->getCategoryIndexFromStringOrNumber($subject->getCategory() ?:
''),
252 $subject->getDescription() ?:
'',
253 $subject->getDependencies() ?:
'',
254 $subject->getUploadcomment() ?:
''
264 public function update(\SplSubject $subject)
266 if (is_subclass_of($subject, AbstractExtensionXmlParser::class)) {
267 if ((
int)$subject->getLastuploaddate() > $this->minimumDateToImport) {