Skip to content

Commit

Permalink
Fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
slackerzz committed Apr 19, 2018
1 parent c619a8e commit a4c728b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Api/ContentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
* @package MSP\CmsImportExport\Api
* @api
*/
interface ContentInterface {
interface ContentInterface
{
const CMS_MODE_UPDATE = 'update';
const CMS_MODE_SKIP = 'skip';

Expand Down
3 changes: 2 additions & 1 deletion Block/Adminhtml/Import.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@

use Magento\Backend\Block\Widget\Form\Container;

class Import extends Container {
class Import extends Container
{
protected $_mode = 'upload';

protected function _construct()
Expand Down
8 changes: 2 additions & 6 deletions Model/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
use MSP\CmsImportExport\Api\ContentInterface;
use Magento\Framework\Filesystem\Io\File;


class Content implements ContentInterface
{
const JSON_FILENAME = 'cms.json';
Expand Down Expand Up @@ -318,8 +317,7 @@ public function asZipFile(array $pageInterfaces, array $blockInterfaces)
$zipArchive->addFromString(self::JSON_FILENAME, $jsonPayload);

// Add media files
foreach ($contentArray['media'] as $mediaFile)
{
foreach ($contentArray['media'] as $mediaFile) {
$absMediaPath = $this->filesystem->getMediaPath($mediaFile);
if ($this->file->fileExists($absMediaPath, true)) {
$zipArchive->addFile($absMediaPath, self::MEDIA_ARCHIVE_PATH . '/' . $mediaFile);
Expand Down Expand Up @@ -481,9 +479,7 @@ public function importFromArray(array $payload, $archivePath = null)
$destFile = $this->filesystem->getMediaPath($mediaFile);

if ($this->file->fileExists($sourceFile, true)) {

if (
$this->file->fileExists($destFile, true) &&
if ($this->file->fileExists($destFile, true) &&
($this->mediaMode == ContentInterface::MEDIA_MODE_SKIP)
) {
continue;
Expand Down
3 changes: 2 additions & 1 deletion Model/Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
use Magento\Framework\Filesystem\Io\File;
use Magento\Framework\App\Filesystem\DirectoryList;

class Filesystem {
class Filesystem
{
const EXPORT_PATH = 'msp_cmsimportexport/export';
const EXTRACT_PATH = 'msp_cmsimportexport/extract';
const UPLOAD_PATH = 'msp_cmsimportexport/extract';
Expand Down

0 comments on commit a4c728b

Please sign in to comment.