Skip to content

Commit

Permalink
Merge branch 'release/1.0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
ma4nn committed Nov 23, 2020
2 parents 7488d29 + 3543379 commit a3d2759
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
3 changes: 1 addition & 2 deletions Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,12 @@ private function initExport(\Magento\Store\Api\Data\StoreInterface $store)
}

/**
* Finish the feed generation, i.e. stop the store emulation and close the csv writer.
* Finish the feed generation, i.e. stop the store emulation.
*
* @return $this
*/
private function finishExport()
{
$this->writer->close();
$this->appEmulation->stopEnvironmentEmulation();

return $this;
Expand Down
30 changes: 13 additions & 17 deletions Model/Feed/Writer.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,44 +37,40 @@ class Writer extends Csv
*/
private $filename;

/**
* @var \Magento\Framework\App\Filesystem\DirectoryList
*/
private $directoryList;

/**
* @param \Magento\Framework\Filesystem $filesystem
* @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList
* @param $filename
* @param string $filename
* @param null $destination
*/
public function __construct(
\Magento\Framework\Filesystem $filesystem,
\Magento\Framework\App\Filesystem\DirectoryList $directoryList,
$filename,
$destination = null
) {
$this->directoryList = $directoryList;
$this->filename = $filename;

// @see \Magento\ImportExport\Model\Export\Adapter\Csv::__construct()
register_shutdown_function([$this, 'destruct']);

// We use a temporary filename for file generation and do the rename in $this::close().
// We use a temporary filename for file generation and do the rename in $this::destruct().
AbstractAdapter::__construct($filesystem, $this->filename . self::TMP_FILENAME_EXTENSION, DirectoryList::MEDIA);
}

/**
* This method only exists for compatibility with Magento 2.1 and 2.2.
*/
public function __destruct()
{
$this->destruct();
}

/**
* Run all actions that should be executed when the writer closes.
*
* Actually this is renaming the temporary filename to the real one.
*
* @return $this
* @return void
*/
public function close()
public function destruct()
{
$this->_directoryHandle->renameFile($this->filename . self::TMP_FILENAME_EXTENSION, $this->filename);

return $this;
parent::destruct();
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ We recommend to proceed with the following preparational steps before you start
#### Installation with Composer (recommended)
1. In the root directory of your Magento 2 installation install the Recolize Recommendation Engine Extension via the following composer command:
```
composer require --no-dev recolize/module-recommendation-engine-magento2
composer require --update-no-dev recolize/module-recommendation-engine-magento2
```

2. Afterwards activate the Magento 2 Extension with the following commands:
Expand Down Expand Up @@ -61,4 +61,4 @@ In case of an emergency you can easily disable the extension temporarily via the
As an alternative you can execute the following command in the Magento root directory:
```
bin/magento module:disable Recolize_RecommendationEngine
```
```
15 changes: 12 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "recolize/module-recommendation-engine-magento2",
"description": "The Recolize Recommendation Engine as extension for Magento 2",
"version": "1.0.8",
"version": "1.0.9",
"type": "magento2-module",
"keywords": [
"recolize",
Expand All @@ -22,7 +22,9 @@
"email": "[email protected]"
},
"require": {
"magento/framework": ">=100.1.3"
"php": "^5.6|^7",
"magento/framework": ">=100.1.3",
"magento/module-import-export": ">=100.1.3"
},
"autoload": {
"files": [
Expand All @@ -33,6 +35,7 @@
}
},
"require-dev": {
"roave/security-advisories": "dev-master",
"magento/magento-coding-standard": "^5.0"
},
"scripts": {
Expand All @@ -42,5 +45,11 @@
"post-update-cmd": [
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
]
}
},
"repositories": [
{
"type": "composer",
"url": "https://repo.magento.com/"
}
]
}
2 changes: 1 addition & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_file.xsd">
<system>
<tab id="recolize" translate="label" sortOrder="200" class="recolizeRecommendationEngineSection">
<label><![CDATA[<img src="data:image/png;base64,iVBORw0KGgo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wnBMYe4D6exG0r6K8OlEIMliOJM/sRCXd2piv0GCHvB2KKMEXJa+SKBwjFXT2IV4IbQTEBNPlyzMIOXYk68beygFhqoczgVvsOMR3OyAlPhqK84BX3hj/rysBWpsAVT9eS0t5BY3oOhNAkcFnFFUoBdIYUhlzebnAyEj57AYkg9gRfirI0W7sDHClukUlZRNCpSveWkyd2G4SldJA9BvatuA1XkpcQFXZDXN5ReQC11c3JpWCVgS4aRUCAtKGDLcQK7jkM5PyuHh49BtgCp7zDxS/H+yONQzXGmEileMr73rc9fTjWndnoDAzkQlP71YUrrmPLJBlweVxnbesTfuOorU2Q0dZXlDDmaZ+vJveokSdm+m8P+pe7PbDPUyx5wixxZgPN9PihWKDj+3w7HLMOP8lHbzGgtuHCv/uZY53CkaQejhs3dcVxYzkeMLvfbVh2j/fsT1LpMR1BFmGq9ce9wo44bLO87NW+eQuBULPFwI2xpODfhIuYyFAQr/LY139Peky61LhopvMuXCttjAgxnlVc4exWzzAm3zpWe1y+kuD/Xtva0gtu2iI/LmsqI98HqGotZi+k6g5XlRAJwOa/bCvz7cm2rxw3H64/TgohGqfzriUQyIb3sdWTdUm/z47/rmKvNraZhagRUlxHoKcDV1SVkNnvNtu0l2U0rL2i41ppizoTjeo2AcLHOC0+kkmmZyVy1SSwF3B/jSYhyOG7XGIOwIPZekXABN3zJsfL3Zp9aDTjsk+NIiIkDlNjnGnD1zOXO+4F/T+bJdR0ablvN2RoHx31jc/GFC+xYPhunyuvXunwvv5i2rO8Z71bCOquVsbm4s1NflwL6wZa0hLas61EJMcFuNWH/A6+/GGaLk3mYAAAAAElFTkSuQmCC" alt="Recolize" /> <div>Recolize</div>]]></label>
<label>Recolize</label>
</tab>
<section id="recolize_recommendation_engine" translate="label" type="text" sortOrder="20" showInDefault="1" showInWebsite="1" showInStore="1">
<tab>recolize</tab>
Expand Down
2 changes: 1 addition & 1 deletion etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Recolize_RecommendationEngine" setup_version="1.0.8">
<module name="Recolize_RecommendationEngine" setup_version="1.0.9">
<sequence>
<module name="Magento_Backend"/>
</sequence>
Expand Down

0 comments on commit a3d2759

Please sign in to comment.