@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | * @param \Symfony\Component\Console\Input\InputInterface $input The Symfony console input instance |
177 | 177 | * @param string $entityTypeCode The entity type code to use |
178 | 178 | * |
179 | - * @return \TechDivision\Import\Cli\Configuration The configuration instance |
|
179 | + * @return \TechDivision\Import\ConfigurationInterface The configuration instance |
|
180 | 180 | * @throws \Exception Is thrown, if the specified configuration file doesn't exist or the mandatory arguments/options to run the requested operation are not available |
181 | 181 | */ |
182 | 182 | public function load(InputInterface $input, $entityTypeCode) |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | * @param string $dir The path to the Magento root directory |
434 | 434 | * @param string $connectionName The connection name to return the data for |
435 | 435 | * |
436 | - * @return array The connection data |
|
436 | + * @return Database The connection data |
|
437 | 437 | * @throws \Exception Is thrown, if the requested DB connection is not available |
438 | 438 | */ |
439 | 439 | public function getMagentoDbConnection($dir, $connectionName = 'default') |
@@ -22,7 +22,6 @@ |
||
22 | 22 | |
23 | 23 | use Psr\Log\LogLevel; |
24 | 24 | use Rhumsaa\Uuid\Uuid; |
25 | -use TechDivision\Import\App\Simple; |
|
26 | 25 | use Symfony\Component\Console\Input\InputInterface; |
27 | 26 | use TechDivision\Import\Utils\EntityTypeCodes; |
28 | 27 | use TechDivision\Import\Command\InputOptionKeys; |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | $vendorDir = $this->getVendorDir(); |
187 | 187 | |
188 | 188 | // the path of the JMS serializer directory, relative to the vendor directory |
189 | - $jmsDir = DIRECTORY_SEPARATOR . 'jms' . DIRECTORY_SEPARATOR . 'serializer' . DIRECTORY_SEPARATOR . 'src'; |
|
189 | + $jmsDir = DIRECTORY_SEPARATOR.'jms'.DIRECTORY_SEPARATOR.'serializer'.DIRECTORY_SEPARATOR.'src'; |
|
190 | 190 | |
191 | 191 | // try to find the path to the JMS Serializer annotations |
192 | - if (!file_exists($annotationDir = $vendorDir . DIRECTORY_SEPARATOR . $jmsDir)) { |
|
192 | + if (!file_exists($annotationDir = $vendorDir.DIRECTORY_SEPARATOR.$jmsDir)) { |
|
193 | 193 | // stop processing, if the JMS annotations can't be found |
194 | 194 | throw new \Exception( |
195 | 195 | sprintf( |
@@ -228,10 +228,10 @@ discard block |
||
228 | 228 | $composer = json_decode(file_get_contents($composerFile = sprintf('%s/composer.json', $installationDir)), true); |
229 | 229 | |
230 | 230 | // try to load and explode the Magento Edition identifier from the Composer name |
231 | - $explodedVersion = explode('/', $composer[MagentoConfigurationKeys::COMPOSER_EDITION_NAME_ATTRIBUTE]); |
|
231 | + $explodedVersion = explode('/', $composer[ MagentoConfigurationKeys::COMPOSER_EDITION_NAME_ATTRIBUTE ]); |
|
232 | 232 | |
233 | 233 | // try to locate Magento Edition |
234 | - if (!isset($this->editionMappings[$possibleEdition = end($explodedVersion)])) { |
|
234 | + if (!isset($this->editionMappings[ $possibleEdition = end($explodedVersion) ])) { |
|
235 | 235 | throw new \Exception( |
236 | 236 | sprintf( |
237 | 237 | '"%s" detected in "%s" is not a valid Magento Edition, please set Magento Edition with the "--magento-edition" option', |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | } |
243 | 243 | |
244 | 244 | // if Magento Edition/Version are available, load them |
245 | - $magentoEdition = $this->editionMappings[$possibleEdition]; |
|
245 | + $magentoEdition = $this->editionMappings[ $possibleEdition ]; |
|
246 | 246 | |
247 | 247 | // use the Magento Edition that has been detected by the installation directory |
248 | 248 | $instance = $configurationFactoryClass::factory($this->getDefaultConfiguration($magentoEdition, $entityTypeCode)); |
@@ -443,15 +443,15 @@ discard block |
||
443 | 443 | $env = require $this->getMagentoEnv($dir); |
444 | 444 | |
445 | 445 | // query whether or not, the requested connection is available |
446 | - if (isset($env[MagentoConfigurationKeys::DB][MagentoConfigurationKeys::CONNECTION][$connectionName])) { |
|
446 | + if (isset($env[ MagentoConfigurationKeys::DB ][ MagentoConfigurationKeys::CONNECTION ][ $connectionName ])) { |
|
447 | 447 | // load the connection data |
448 | - $connection = $env[MagentoConfigurationKeys::DB][MagentoConfigurationKeys::CONNECTION][$connectionName]; |
|
448 | + $connection = $env[ MagentoConfigurationKeys::DB ][ MagentoConfigurationKeys::CONNECTION ][ $connectionName ]; |
|
449 | 449 | |
450 | 450 | // create and return a new database configuration |
451 | 451 | return $this->newDatabaseConfiguration( |
452 | - $this->newDsn($connection[MagentoConfigurationKeys::HOST], $connection[MagentoConfigurationKeys::DBNAME]), |
|
453 | - $connection[MagentoConfigurationKeys::USERNAME], |
|
454 | - $connection[MagentoConfigurationKeys::PASSWORD], |
|
452 | + $this->newDsn($connection[ MagentoConfigurationKeys::HOST ], $connection[ MagentoConfigurationKeys::DBNAME ]), |
|
453 | + $connection[ MagentoConfigurationKeys::USERNAME ], |
|
454 | + $connection[ MagentoConfigurationKeys::PASSWORD ], |
|
455 | 455 | false |
456 | 456 | ); |
457 | 457 | } |
@@ -544,8 +544,8 @@ discard block |
||
544 | 544 | { |
545 | 545 | |
546 | 546 | // query whether or not, default libraries for the passed edition are available |
547 | - if (isset($this->defaultLibraries[$edition = strtolower($magentoEdition)])) { |
|
548 | - return $this->defaultLibraries[$edition]; |
|
547 | + if (isset($this->defaultLibraries[ $edition = strtolower($magentoEdition) ])) { |
|
548 | + return $this->defaultLibraries[ $edition ]; |
|
549 | 549 | } |
550 | 550 | |
551 | 551 | // throw an exception, if the passed edition is not supported |
@@ -571,9 +571,9 @@ discard block |
||
571 | 571 | { |
572 | 572 | |
573 | 573 | // query whether or not, a default configuration file for the passed entity type is available |
574 | - if (isset($this->defaultConfigurations[$edition = strtolower($magentoEdition)])) { |
|
575 | - if (isset($this->defaultConfigurations[$edition][$entityTypeCode])) { |
|
576 | - return $this->defaultConfigurations[$edition][$entityTypeCode]; |
|
574 | + if (isset($this->defaultConfigurations[ $edition = strtolower($magentoEdition) ])) { |
|
575 | + if (isset($this->defaultConfigurations[ $edition ][ $entityTypeCode ])) { |
|
576 | + return $this->defaultConfigurations[ $edition ][ $entityTypeCode ]; |
|
577 | 577 | } |
578 | 578 | |
579 | 579 | // throw an exception, if the passed entity type is not supported |
@@ -607,8 +607,8 @@ discard block |
||
607 | 607 | { |
608 | 608 | |
609 | 609 | // query whether or not, a default configuration file for the passed entity type is available |
610 | - if (isset($this->defaultDirectories[$entityTypeCode])) { |
|
611 | - return $this->defaultDirectories[$entityTypeCode]; |
|
610 | + if (isset($this->defaultDirectories[ $entityTypeCode ])) { |
|
611 | + return $this->defaultDirectories[ $entityTypeCode ]; |
|
612 | 612 | } |
613 | 613 | |
614 | 614 | // throw an exception, if the passed entity type is not supported |
@@ -275,14 +275,14 @@ |
||
275 | 275 | $loggers = array(); |
276 | 276 | |
277 | 277 | // add the system logger to the array with the configured loggers |
278 | - $loggers[LoggerKeys::SYSTEM] = $this->systemLogger; |
|
278 | + $loggers[ LoggerKeys::SYSTEM ] = $this->systemLogger; |
|
279 | 279 | |
280 | 280 | // append the configured loggers or override the default one |
281 | 281 | foreach ($configuration->getLoggers() as $loggerConfiguration) { |
282 | 282 | // load the factory class that creates the logger instance |
283 | 283 | $loggerFactory = $loggerConfiguration->getFactory(); |
284 | 284 | // create the logger instance and add it to the available loggers |
285 | - $loggers[$loggerConfiguration->getName()] = $loggerFactory::factory($configuration, $loggerConfiguration); |
|
285 | + $loggers[ $loggerConfiguration->getName() ] = $loggerFactory::factory($configuration, $loggerConfiguration); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | // add the system loggers to the DI container |
@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | // initialize the default loader and load the DI configuration for the this library |
32 | 32 | $defaultLoader = new XmlFileLoader($container, new FileLocator($vendorDir)); |
33 | -$defaultLoader->load(__DIR__ . '/symfony/Resources/config/services.xml'); |
|
33 | +$defaultLoader->load(__DIR__.'/symfony/Resources/config/services.xml'); |
|
34 | 34 | |
35 | 35 | // initialize and run the application |
36 | 36 | $statusCode = $container->get(DependencyInjectionKeys::APPLICATION)->run($container->get(DependencyInjectionKeys::INPUT)); |
@@ -56,11 +56,11 @@ |
||
56 | 56 | $connection = $setup->getConnection(); |
57 | 57 | |
58 | 58 | // add indices necessary to optimize the importer performance |
59 | - $connection->addIndex('url_rewrite', $setup->getIdxName('url_rewrite', ['entity_id']), ['entity_id']); |
|
60 | - $connection->addIndex('url_rewrite', $setup->getIdxName('url_rewrite', ['entity_id', 'entity_type']), ['entity_id', 'entity_type']); |
|
61 | - $connection->addIndex('catalog_product_entity_varchar', $setup->getIdxName('catalog_product_entity_varchar', ['value']), ['value']); |
|
62 | - $connection->addIndex('eav_attribute_option_value', $setup->getIdxName('eav_attribute_option_value', ['value']), ['value']); |
|
63 | - $connection->addIndex('catalog_product_entity_media_gallery', $setup->getIdxName('catalog_product_entity_media_gallery', ['value']), ['value']); |
|
59 | + $connection->addIndex('url_rewrite', $setup->getIdxName('url_rewrite', [ 'entity_id' ]), [ 'entity_id' ]); |
|
60 | + $connection->addIndex('url_rewrite', $setup->getIdxName('url_rewrite', [ 'entity_id', 'entity_type' ]), [ 'entity_id', 'entity_type' ]); |
|
61 | + $connection->addIndex('catalog_product_entity_varchar', $setup->getIdxName('catalog_product_entity_varchar', [ 'value' ]), [ 'value' ]); |
|
62 | + $connection->addIndex('eav_attribute_option_value', $setup->getIdxName('eav_attribute_option_value', [ 'value' ]), [ 'value' ]); |
|
63 | + $connection->addIndex('catalog_product_entity_media_gallery', $setup->getIdxName('catalog_product_entity_media_gallery', [ 'value' ]), [ 'value' ]); |
|
64 | 64 | |
65 | 65 | // finish setup |
66 | 66 | $setup->endSetup(); |