Install and integrate Minubo
Edit on GitHubThe Minubo module provides functionality to export order and customer data that was updated since last run of export. Data exported to Amazon S3 bucket as file with list of JSON-objects.
Export process runs in two modes:
- Automatic mode - every 15 minutes (default)
- Manual mode - using console command:
vendor/bin/console minubo:export:data
As a result, the module puts two files Customer_TIMESTAMP.json and Order_TIMESTAMP.json
with updated data to Amazon S3 bucket. If there were no changes the module would put empty files.
Installing and configuring Minubo
To install and configure Minubo, do the following:
- To install Minubo run next command in the console:
composer require spryker-eco/minubo
- Copy over the content from
config/config.dist.php
toconfig_default.php
and add the values:
...
use Spryker\Service\FlysystemAws3v3FileSystem\Plugin\Flysystem\Aws3v3FilesystemBuilderPlugin;
use Spryker\Shared\FileSystem\FileSystemConstants;
use SprykerEco\Shared\Minubo\MinuboConstants;
...
$config[FileSystemConstants::FILESYSTEM_SERVICE] = [
'minubo' => [
'sprykerAdapterClass' => Aws3v3FilesystemBuilderPlugin::class,
'root' => '/minubo/',
'path' => 'data/',
'key' => '..',
'secret' => '..',
'bucket' => '..',
'version' => 'latest',
'region' => '..',
],
];
$config[MinuboConstants::MINUBO_FILE_SYSTEM_NAME] = 'minubo';
$config[MinuboConstants::MINUBO_BUCKET_DIRECTORY] = '/minubo/data/';
$config[MinuboConstants::MINUBO_CUSTOMER_SECURE_FIELDS] = [
'password',
'restore_password_date',
'restore_password_key',
'registration_key',
];
...
- Copy over the content from
config/jobs.dist.php
tojobs.php
:
...
$jobs[] = [
'name' => 'minubo-export',
'command' => '$PHP_BIN vendor/bin/console minubo:export:data',
'schedule' => '*/15 * * * *',
'enable' => true,
'run_on_non_production' => false,
'stores' => ['DE'],
];
...
- Add Minubo console to
ConsoleDependencyProder
:
...
use SprykerEco\Zed\Minubo\Communication\Console\MinuboConsole;
class ConsoleDependencyProvider extends SprykerConsoleDependencyProvider
{
protected function getConsoleCommands(Container $container)
{
$commands = [
...
new MinuboConsole(),
];
...
return $commands;
}
...
- Add or update
FlysystemDependencyProvider
to project Service Layer:
<?php
namespace Pyz\Service\Flysystem;
use Spryker\Service\Flysystem\FlysystemDependencyProvider as SprykerFlysystemDependencyProvider;
use Spryker\Service\FlysystemAws3v3FileSystem\Plugin\Flysystem\Aws3v3FilesystemBuilderPlugin;
use Spryker\Service\FlysystemFtpFileSystem\Plugin\Flysystem\FtpFilesystemBuilderPlugin;
use Spryker\Service\FlysystemLocalFileSystem\Plugin\Flysystem\LocalFilesystemBuilderPlugin;
use Spryker\Service\Kernel\Container;
class FlysystemDependencyProvider extends SprykerFlysystemDependencyProvider
{
/**
* @param \Spryker\Service\Kernel\Container $container
*
* @return \Spryker\Service\Kernel\Container
*/
protected function addFilesystemBuilderPluginCollection($container)
{
$container[self::PLUGIN_COLLECTION_FILESYSTEM_BUILDER] = function (Container $container)
{
return [new FtpFilesystemBuilderPlugin() , new LocalFilesystemBuilderPlugin() , new Aws3v3FilesystemBuilderPlugin() , ];
};
return $container;
}
}
Thank you!
For submitting the form