add fixed export
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Marko 2023-11-14 16:28:55 +01:00
parent 98a9545bb9
commit 231e9390b8
No known key found for this signature in database
2 changed files with 4 additions and 8 deletions

View File

@ -35,7 +35,7 @@ class HiltesImport
$this->stockRepository = $stockRepository; $this->stockRepository = $stockRepository;
$this->logger = $logger; $this->logger = $logger;
$this->currentDirPath = getcwd(); $this->currentDirPath = getcwd() . '/www';
} }
@ -75,7 +75,7 @@ class HiltesImport
{ {
$finder = Finder::create(); $finder = Finder::create();
$finder $finder
->in($this->currentDirPath . '/www/hiltes/h2c/') ->in($this->currentDirPath . '/hiltes/h2c/')
->depth(0); ->depth(0);
if ($delta) { if ($delta) {

View File

@ -73,8 +73,6 @@ class Jtl
$this->logger->info('No stock for product ' . $product->getId()); $this->logger->info('No stock for product ' . $product->getId());
} }
// dump($data);
} }
return $data; return $data;
@ -88,20 +86,18 @@ class Jtl
public function createExportFile($data): void public function createExportFile($data): void
{ {
try { try {
$writer = Writer::createFromPath(getcwd() . '/jtl/cds-export.csv', 'w+'); $writer = Writer::createFromPath(getcwd() . '/www/jtl/cds-export.csv', 'w+');
$bytes = $writer->insertAll(new ArrayIterator($data)); $bytes = $writer->insertAll(new ArrayIterator($data));
if ($bytes) { if ($bytes) {
$this->logger->info('Exported ' . $bytes . ' bytes'); $this->logger->info('Exported ' . $bytes . ' bytes');
$FTP = new Ftp(); $FTP = new Ftp();
$FTP->uploadFile(getcwd() . '/jtl/cds-export.csv'); $FTP->uploadFile(getcwd() . '/www/jtl/cds-export.csv');
} }
} catch (Exception $e) { } catch (Exception $e) {
$this->logger->error($e->getMessage()); $this->logger->error($e->getMessage());
} }
} }
} }