35 lines
802 B
PHP
35 lines
802 B
PHP
|
<?php
|
||
|
|
||
|
namespace Piwik\Plugins\ExportImportTool\Commands;
|
||
|
|
||
|
use Piwik\Plugin\ConsoleCommand;
|
||
|
use Piwik\Plugins\ExportImportTool\API as ExportImportApi;
|
||
|
|
||
|
class ExportSite extends ConsoleCommand
|
||
|
{
|
||
|
protected function configure()
|
||
|
{
|
||
|
$this->setName('exportimporttool:export-site');
|
||
|
$this->setDescription('Exports a site from Matomo.');
|
||
|
$this->addRequiredArgument('idSite', 'The ID of the site you want to export.');
|
||
|
}
|
||
|
|
||
|
|
||
|
protected function doExecute(): int
|
||
|
{
|
||
|
$input = $this->getInput();
|
||
|
|
||
|
$idSite = $input->getArgument('idSite');
|
||
|
|
||
|
// Call your Export API method here
|
||
|
$api = new ExportImportApi;
|
||
|
$result = $api->exportSite($idSite);
|
||
|
|
||
|
$output = $this->getOutput();
|
||
|
$output->writeln($result);
|
||
|
|
||
|
return self::SUCCESS;
|
||
|
}
|
||
|
}
|
||
|
|