Merge branch 'release/2020.07-01'
This commit is contained in:
Generated
+46
-30
@@ -169,16 +169,16 @@
|
||||
},
|
||||
{
|
||||
"name": "doctrine/cache",
|
||||
"version": "1.10.1",
|
||||
"version": "1.10.2",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/doctrine/cache.git",
|
||||
"reference": "35a4a70cd94e09e2259dfae7488afc6b474ecbd3"
|
||||
"reference": "13e3381b25847283a91948d04640543941309727"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/35a4a70cd94e09e2259dfae7488afc6b474ecbd3",
|
||||
"reference": "35a4a70cd94e09e2259dfae7488afc6b474ecbd3",
|
||||
"url": "https://api.github.com/repos/doctrine/cache/zipball/13e3381b25847283a91948d04640543941309727",
|
||||
"reference": "13e3381b25847283a91948d04640543941309727",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -261,7 +261,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-27T16:24:54+00:00"
|
||||
"time": "2020-07-07T18:54:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/dbal",
|
||||
@@ -1516,16 +1516,16 @@
|
||||
},
|
||||
{
|
||||
"name": "nikic/php-parser",
|
||||
"version": "v4.5.0",
|
||||
"version": "v4.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nikic/PHP-Parser.git",
|
||||
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463"
|
||||
"reference": "c346bbfafe2ff60680258b631afb730d186ed864"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
||||
"reference": "53c2753d756f5adb586dca79c2ec0e2654dd9463",
|
||||
"url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/c346bbfafe2ff60680258b631afb730d186ed864",
|
||||
"reference": "c346bbfafe2ff60680258b631afb730d186ed864",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -1564,7 +1564,7 @@
|
||||
"parser",
|
||||
"php"
|
||||
],
|
||||
"time": "2020-06-03T07:24:19+00:00"
|
||||
"time": "2020-07-02T17:12:47+00:00"
|
||||
},
|
||||
{
|
||||
"name": "pixelant/pxa-social-feed",
|
||||
@@ -2294,16 +2294,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/cache-contracts",
|
||||
"version": "v2.1.2",
|
||||
"version": "v2.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/cache-contracts.git",
|
||||
"reference": "87c92f62c494626598e9148208aaa6d1716b8e3c"
|
||||
"reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/cache-contracts/zipball/87c92f62c494626598e9148208aaa6d1716b8e3c",
|
||||
"reference": "87c92f62c494626598e9148208aaa6d1716b8e3c",
|
||||
"url": "https://api.github.com/repos/symfony/cache-contracts/zipball/9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009",
|
||||
"reference": "9771a09d2e6b84ecb8c9f0a7dbc72ee92aeba009",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2317,6 +2317,10 @@
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2362,7 +2366,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-20T17:43:50+00:00"
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/console",
|
||||
@@ -2457,16 +2461,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/deprecation-contracts",
|
||||
"version": "v2.1.2",
|
||||
"version": "v2.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/deprecation-contracts.git",
|
||||
"reference": "dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337"
|
||||
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337",
|
||||
"reference": "dd99cb3a0aff6cadd2a8d7d7ed72c2161e218337",
|
||||
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/5e20b83385a77593259c9f8beb2c43cd03b2ac14",
|
||||
"reference": "5e20b83385a77593259c9f8beb2c43cd03b2ac14",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2476,6 +2480,10 @@
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2513,7 +2521,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-27T08:34:37+00:00"
|
||||
"time": "2020-06-06T08:49:21+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/expression-language",
|
||||
@@ -2727,16 +2735,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-client-contracts",
|
||||
"version": "v2.1.2",
|
||||
"version": "v2.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-client-contracts.git",
|
||||
"reference": "f8bed25edc964d015bcd87f1fec5734963931910"
|
||||
"reference": "cd88921e9add61f2064c9c6b30de4f589db42962"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/f8bed25edc964d015bcd87f1fec5734963931910",
|
||||
"reference": "f8bed25edc964d015bcd87f1fec5734963931910",
|
||||
"url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/cd88921e9add61f2064c9c6b30de4f589db42962",
|
||||
"reference": "cd88921e9add61f2064c9c6b30de4f589db42962",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -2749,6 +2757,10 @@
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -2794,7 +2806,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-25T17:37:45+00:00"
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
@@ -4127,16 +4139,16 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/service-contracts",
|
||||
"version": "v2.1.2",
|
||||
"version": "v2.1.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/service-contracts.git",
|
||||
"reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b"
|
||||
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/66a8f0957a3ca54e4f724e49028ab19d75a8918b",
|
||||
"reference": "66a8f0957a3ca54e4f724e49028ab19d75a8918b",
|
||||
"url": "https://api.github.com/repos/symfony/service-contracts/zipball/58c7475e5457c5492c26cc740cc0ad7464be9442",
|
||||
"reference": "58c7475e5457c5492c26cc740cc0ad7464be9442",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -4150,6 +4162,10 @@
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.1-dev"
|
||||
},
|
||||
"thanks": {
|
||||
"name": "symfony/contracts",
|
||||
"url": "https://github.com/symfony/contracts"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -4195,7 +4211,7 @@
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2020-05-20T17:43:50+00:00"
|
||||
"time": "2020-07-06T13:23:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/string",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#ddev-generated: Automatically generated ddev .gitignore.
|
||||
# You can remove the above line if you want to edit and maintain this file yourself.
|
||||
/.gitignore
|
||||
|
||||
/AdditionalConfiguration.php
|
||||
/drushrc.php
|
||||
|
||||
@@ -80,15 +80,11 @@ class DateCommandController extends Command
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
{
|
||||
$path = GeneralUtility::getFileAbsFileName('fileadmin/xmlexport');
|
||||
if ($this->dateImportService->checkActiveUpload($path)) {
|
||||
$output->writeln('Import cancelled due to active file upload.');
|
||||
} else {
|
||||
$count = $this->dateImportService->import($path);
|
||||
$output->writeln(sprintf('%d rows imported.', $count ));
|
||||
$settings = $this->getSettings();
|
||||
$resellerPageUid = $settings['resellerExportPageUid'];
|
||||
$this->cacheService->clearPageCache($resellerPageUid);
|
||||
}
|
||||
$count = $this->dateImportService->import($path);
|
||||
$output->writeln(sprintf('%d rows imported.', $count ));
|
||||
$settings = $this->getSettings();
|
||||
$resellerPageUid = $settings['resellerExportPageUid'];
|
||||
$this->cacheService->clearPageCache($resellerPageUid);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -125,7 +125,7 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
$this->importPickups();
|
||||
$this->createTempTables();
|
||||
$this->logger->info('starting product import');
|
||||
$dateCount = $this->parseXmlFilesInFolder($path);
|
||||
$dateCount = $this->parseXmlFilesForProducts($path);
|
||||
$this->clearTables();
|
||||
$this->copyTables();
|
||||
$this->clearTempTables();
|
||||
@@ -144,20 +144,30 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
return count(glob($tempFile)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $path
|
||||
* @return int
|
||||
*/
|
||||
public function parseXmlFilesInFolder($path)
|
||||
public function parseXmlFilesForProducts($path)
|
||||
{
|
||||
$dateCount = 0;
|
||||
$folder = opendir($path);
|
||||
while (($fileName = readdir($folder)) !== false) {
|
||||
if (strpos($fileName, 'Ziel') === 0) {
|
||||
$filePath = $path . '/' . $fileName;
|
||||
$dateCount += $this->parseProductXmlFile($filePath);
|
||||
}
|
||||
$xmlPath = sprintf('%s/Produkte.xml', $path);
|
||||
|
||||
if (!file_exists($xmlPath)) {
|
||||
$this->logger->error('product list xml not found');
|
||||
return 0;
|
||||
}
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
/** @var \SimpleXMLElement $xmlData */
|
||||
if (!$xmlData = simplexml_load_string(file_get_contents($xmlPath))) {
|
||||
libxml_clear_errors();
|
||||
return 0;
|
||||
}
|
||||
|
||||
$dateCount = 0;
|
||||
|
||||
foreach ($xmlData->produkte[0]->children() as $xmlProdukt) {
|
||||
$busProId = (int)$xmlProdukt->attributes()['id'];
|
||||
$xmlFile = sprintf('%s/Ziel_%d.xml', $path, $busProId);
|
||||
$dateCount += $this->parseProductXmlFile($xmlFile);
|
||||
}
|
||||
|
||||
return $dateCount;
|
||||
}
|
||||
|
||||
@@ -167,7 +177,12 @@ class DateImportService implements SingletonInterface, LoggerAwareInterface
|
||||
*/
|
||||
public function parseProductXmlFile($file)
|
||||
{
|
||||
libxml_use_internal_errors (true);
|
||||
if (!file_exists($file)) {
|
||||
$this->logger->error('product xml not found', ['file' => $file]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
libxml_use_internal_errors(true);
|
||||
/** @var \SimpleXMLElement $xmlData */
|
||||
if (!$xmlData = simplexml_load_string(file_get_contents($file))) {
|
||||
libxml_clear_errors();
|
||||
|
||||
@@ -28,7 +28,6 @@ namespace EP\EpProducts\Task;
|
||||
***************************************************************/
|
||||
|
||||
use EP\EpProducts\Service\DateImportService;
|
||||
use TYPO3\CMS\Core\Messaging\FlashMessage;
|
||||
use TYPO3\CMS\Core\Utility\GeneralUtility;
|
||||
use TYPO3\CMS\Extbase\Object\ObjectManager;
|
||||
use TYPO3\CMS\Scheduler\Task\AbstractTask;
|
||||
@@ -42,13 +41,6 @@ class ImportDatesTask extends AbstractTask
|
||||
/** @var \EP\EpProducts\Service\DateImportService $importService */
|
||||
$importService = $objectManager->get(DateImportService::class);
|
||||
$path = GeneralUtility::getFileAbsFileName('fileadmin/xmlexport');
|
||||
if ($importService->checkActiveUpload($path)) {
|
||||
$message = GeneralUtility::makeInstance(FlashMessage::class, 'Import aborted due to active file upload', '', FlashMessage::WARNING);
|
||||
$flashMessageService = $objectManager->get(\TYPO3\CMS\Core\Messaging\FlashMessageService::class);
|
||||
$messageQueue = $flashMessageService->getMessageQueueByIdentifier();
|
||||
$messageQueue->addMessage($message);
|
||||
return false;
|
||||
}
|
||||
$importService->import($path);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user