mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Merge pull request #56083 from nextcloud/fix/snowflakeids
This commit is contained in:
commit
d92b02a14a
1 changed files with 9 additions and 3 deletions
|
|
@ -8,25 +8,31 @@ declare(strict_types=1);
|
|||
*/
|
||||
namespace OC\Core\Command;
|
||||
|
||||
use OC\Snowflake\Decoder;
|
||||
use OCP\Snowflake\IDecoder;
|
||||
use Symfony\Component\Console\Helper\Table;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
class SnowflakeDecodeId extends Base {
|
||||
public function __construct(
|
||||
private readonly IDecoder $decoder,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
protected function configure(): void {
|
||||
parent::configure();
|
||||
|
||||
$this
|
||||
->setName('decode-snowflake')
|
||||
->setName('snowflake:decode')
|
||||
->setDescription('Decode Snowflake IDs used by Nextcloud')
|
||||
->addArgument('snowflake-id', InputArgument::REQUIRED, 'Nextcloud Snowflake ID to decode');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$snowflakeId = $input->getArgument('snowflake-id');
|
||||
$data = (new Decoder)->decode($snowflakeId);
|
||||
$data = $this->decoder->decode($snowflakeId);
|
||||
|
||||
$rows = [
|
||||
['Snowflake ID', $snowflakeId],
|
||||
|
|
|
|||
Loading…
Reference in a new issue