$this->io =
new ShopwareStyle($input,
$output);
$keys =
$this->redis->
keys(RedisCartPersister::PREFIX . '*'
);
\
assert(\
is_array($keys));
if (empty($keys)) { $this->io->
success('No carts found in Redis'
);
return 0;
} $this->progress =
$this->io->
createProgressBar(\
count($keys));
$this->progress->
setFormat("<info>[%message%]</info>\n%current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%"
);
$this->progress->
setMessage('Migrating carts from Redis to SQL'
);
$queue =
new MultiInsertQueryQueue($this->connection, 50, false, true
);
// @deprecated tag:v6.6.0 - payload always exists
$payloadExists = EntityDefinitionQueryHelper::
columnExists($this->connection, 'cart', 'payload'
);
foreach ($keys as $index =>
$key) { if (\
method_exists($this->redis, '_prefix'
)) { $key = \
substr((string) $key, \
strlen($this->redis->
_prefix(''
)));
}