Skip to content

Commit 6f9d3e7

Browse files
author
Rocket Web
authored
Merge pull request #8 from rocketweb/ICP-8-change_pipe
changed pipe[#8]
2 parents fcac5b8 + a34ca5e commit 6f9d3e7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Model/Service/DumpCmsDataService.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,16 @@ private function dumpPages(string $path, WriteInterface $varDirectory, ?array $i
136136
$pages = $pagesList->getItems();
137137

138138
foreach ($pages as $page) {
139-
$identifier = str_replace('/', '|', trim($page->getIdentifier()));
139+
$identifier = str_replace('/', '---', trim($page->getIdentifier()));
140140
if (strpos($identifier, '.html') !== false) {
141141
$identifier = str_replace('.html', '_html', $identifier);
142142
}
143143

144144
$storeCodes = $this->getStoreCodes($page->getStores());
145-
$htmlPath = $path . $identifier . '|' . implode('|', $storeCodes) . '.html';
145+
$htmlPath = $path . $identifier . '---' . implode('---', $storeCodes) . '.html';
146146
$pageContent = $this->replaceBlockIds($page->getContent());
147147
$this->write($varDirectory, $htmlPath, $pageContent);
148-
$jsonPath = $path . $identifier . '|' . implode('|', $storeCodes) . '.json';
148+
$jsonPath = $path . $identifier . '---' . implode('---', $storeCodes) . '.json';
149149
$jsonContent = [
150150
'title' => $page->getTitle(),
151151
'is_active' => $page->isActive(),
@@ -181,9 +181,9 @@ private function dumpBlocks(string $path, WriteInterface $varDirectory, ?array $
181181
}
182182
$this->blockIdentifiers[$block->getId()] = $block->getIdentifier();
183183
$storeCodes = $this->getStoreCodes($block->getStores());
184-
$htmlPath = $path . trim($block->getIdentifier()) . '|' . implode('|', $storeCodes) . '.html';
184+
$htmlPath = $path . trim($block->getIdentifier()) . '---' . implode('---', $storeCodes) . '.html';
185185
$this->write($varDirectory, $htmlPath, $block->getContent());
186-
$jsonPath = $path . trim($block->getIdentifier()) . '|' . implode('|', $storeCodes) . '.json';
186+
$jsonPath = $path . trim($block->getIdentifier()) . '---' . implode('---', $storeCodes) . '.json';
187187
$jsonContent = [
188188
'title' => $block->getTitle(),
189189
'identifier' => $block->getIdentifier(),

Model/Service/ImportCmsDataService.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ private function importBlocks(string $dirPath, ?array $identifiers): void
107107
}
108108
$identifier = str_replace($dirPath, '', $filePath);
109109
$identifier = str_replace('.html', '', $identifier);
110-
$identifier = substr_replace($identifier, '', strpos($identifier, '|'));
110+
$identifier = substr_replace($identifier, '', strpos($identifier, '---'));
111111
if ($identifiers !== null && !in_array($identifier, $identifiers)) {
112112
// If we have a list of items, we skip if its not in the list
113113
continue;
@@ -140,7 +140,7 @@ private function importBlocks(string $dirPath, ?array $identifiers): void
140140
try {
141141
$this->blockRepository->save($block);
142142
} catch (\Exception $exception) {
143-
echo $exception->getMessage() . ' | Block ID: ' . $identifier . "\n";
143+
echo $exception->getMessage() . ', Block ID: ' . $identifier . "\n";
144144
}
145145
}
146146
}
@@ -155,8 +155,8 @@ private function importPages(string $dirPath, ?array $identifiers): void
155155
}
156156
$identifier = str_replace($dirPath, '', $filePath);
157157
$identifier = str_replace('.html', '', $identifier);
158-
$identifier = substr_replace($identifier, '', strpos($identifier, '|'));
159-
$identifier = str_replace('|', '/', $identifier);
158+
$identifier = substr_replace($identifier, '', strpos($identifier, '---'));
159+
$identifier = str_replace('---', '/', $identifier);
160160
$identifier = str_replace('_html', '.html', $identifier);
161161
if ($identifiers !== null && !in_array($identifier, $identifiers)) {
162162
// If we have a list of items, we skip if its not in the list

0 commit comments

Comments
 (0)