mirror of
https://github.com/wallabag/wallabag.git
synced 2025-08-26 18:21:02 +00:00
Make all commands lazy
This commit is contained in:
parent
5aeb116d83
commit
7c4ca62eae
14 changed files with 59 additions and 82 deletions
|
@ -13,6 +13,9 @@ use Wallabag\CoreBundle\Repository\EntryRepository;
|
|||
|
||||
class CleanDownloadedImagesCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:clean-downloaded-images';
|
||||
protected static $defaultDescription = 'Cleans downloaded images which are no more associated to an entry';
|
||||
|
||||
private EntryRepository $entryRepository;
|
||||
private DownloadImages $downloadImages;
|
||||
|
||||
|
@ -27,8 +30,6 @@ class CleanDownloadedImagesCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:clean-downloaded-images')
|
||||
->setDescription('Cleans downloaded images which are no more associated to an entry')
|
||||
->addOption(
|
||||
'dry-run',
|
||||
null,
|
||||
|
|
|
@ -16,6 +16,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class CleanDuplicatesCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:clean-duplicates';
|
||||
protected static $defaultDescription = 'Cleans the database for duplicates';
|
||||
|
||||
protected SymfonyStyle $io;
|
||||
protected int $duplicates = 0;
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
@ -34,8 +37,6 @@ class CleanDuplicatesCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:clean-duplicates')
|
||||
->setDescription('Cleans the database for duplicates')
|
||||
->setHelp('This command helps you to clean your articles list in case of duplicates')
|
||||
->addArgument(
|
||||
'username',
|
||||
|
|
|
@ -14,6 +14,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class ExportCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:export';
|
||||
protected static $defaultDescription = 'Export all entries for an user';
|
||||
|
||||
private EntryRepository $entryRepository;
|
||||
private UserRepository $userRepository;
|
||||
private EntriesExport $entriesExport;
|
||||
|
@ -32,8 +35,6 @@ class ExportCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:export')
|
||||
->setDescription('Export all entries for an user')
|
||||
->setHelp('This command helps you to export all entries for an user')
|
||||
->addArgument(
|
||||
'username',
|
||||
|
|
|
@ -15,6 +15,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class GenerateUrlHashesCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:generate-hashed-urls';
|
||||
protected static $defaultDescription = 'Generates hashed urls for each entry';
|
||||
|
||||
protected OutputInterface $output;
|
||||
private EntityManagerInterface $entityManager;
|
||||
private EntryRepository $entryRepository;
|
||||
|
@ -32,8 +35,6 @@ class GenerateUrlHashesCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:generate-hashed-urls')
|
||||
->setDescription('Generates hashed urls for each entry')
|
||||
->setHelp('This command helps you to generates hashes of the url of each entry, to check through API if an URL is already saved')
|
||||
->addArgument('username', InputArgument::OPTIONAL, 'User to process entries');
|
||||
}
|
||||
|
|
|
@ -29,6 +29,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class ImportCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:import';
|
||||
protected static $defaultDescription = 'Import entries from a JSON export';
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
private TokenStorageInterface $tokenStorage;
|
||||
private UserRepository $userRepository;
|
||||
|
@ -81,8 +84,6 @@ class ImportCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:import')
|
||||
->setDescription('Import entries from a JSON export')
|
||||
->addArgument('username', InputArgument::REQUIRED, 'User to populate')
|
||||
->addArgument('filepath', InputArgument::REQUIRED, 'Path to the JSON file')
|
||||
->addOption('importer', null, InputOption::VALUE_OPTIONAL, 'The importer to use: v1, v2, instapaper, pinboard, delicious, readability, firefox, chrome, elcurator, shaarli or pocket', 'v1')
|
||||
|
|
|
@ -13,6 +13,9 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
|
|||
|
||||
class RedisWorkerCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:import:redis-worker';
|
||||
protected static $defaultDescription = 'Launch Redis worker';
|
||||
|
||||
private $container;
|
||||
|
||||
public function __construct(ContainerInterface $container)
|
||||
|
@ -25,8 +28,6 @@ class RedisWorkerCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:import:redis-worker')
|
||||
->setDescription('Launch Redis worker')
|
||||
->addArgument('serviceName', InputArgument::REQUIRED, 'Service to use: wallabag_v1, wallabag_v2, pocket, readability, pinboard, delicious, firefox, chrome or instapaper')
|
||||
->addOption('maxIterations', '', InputOption::VALUE_OPTIONAL, 'Number of iterations before stopping', false)
|
||||
;
|
||||
|
|
|
@ -26,6 +26,9 @@ use Wallabag\CoreBundle\Entity\User;
|
|||
|
||||
class InstallCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:install';
|
||||
protected static $defaultDescription = 'wallabag installer.';
|
||||
|
||||
private InputInterface $defaultInput;
|
||||
private SymfonyStyle $io;
|
||||
private array $functionExists = [
|
||||
|
@ -63,8 +66,6 @@ class InstallCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:install')
|
||||
->setDescription('wallabag installer.')
|
||||
->addOption(
|
||||
'reset',
|
||||
null,
|
||||
|
|
|
@ -12,6 +12,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class ListUserCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:user:list';
|
||||
protected static $defaultDescription = 'List all users';
|
||||
|
||||
private UserRepository $userRepository;
|
||||
|
||||
public function __construct(UserRepository $userRepository)
|
||||
|
@ -24,8 +27,6 @@ class ListUserCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:user:list')
|
||||
->setDescription('List all users')
|
||||
->setHelp('This command list all existing users')
|
||||
->addArgument('search', InputArgument::OPTIONAL, 'Filter list by given search term')
|
||||
->addOption('limit', 'l', InputOption::VALUE_REQUIRED, 'Max number of displayed users', 100)
|
||||
|
|
|
@ -18,6 +18,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class ReloadEntryCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:entry:reload';
|
||||
protected static $defaultDescription = 'Reload entries';
|
||||
|
||||
private EntryRepository $entryRepository;
|
||||
private UserRepository $userRepository;
|
||||
private EntityManagerInterface $entityManager;
|
||||
|
@ -38,8 +41,6 @@ class ReloadEntryCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:entry:reload')
|
||||
->setDescription('Reload entries')
|
||||
->setHelp('This command reload entries')
|
||||
->addArgument('username', InputArgument::OPTIONAL, 'Reload entries only for the given user')
|
||||
->addOption(
|
||||
|
|
|
@ -13,6 +13,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class ShowUserCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:user:show';
|
||||
protected static $defaultDescription = 'Show user details';
|
||||
|
||||
protected SymfonyStyle $io;
|
||||
private UserRepository $userRepository;
|
||||
|
||||
|
@ -26,8 +29,6 @@ class ShowUserCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:user:show')
|
||||
->setDescription('Show user details')
|
||||
->setHelp('This command shows the details for an user')
|
||||
->addArgument(
|
||||
'username',
|
||||
|
|
|
@ -15,6 +15,9 @@ use Wallabag\CoreBundle\Repository\UserRepository;
|
|||
|
||||
class TagAllCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:tag:all';
|
||||
protected static $defaultDescription = 'Tag all entries using the tagging rules.';
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
private RuleBasedTagger $ruleBasedTagger;
|
||||
private UserRepository $userRepository;
|
||||
|
@ -31,8 +34,6 @@ class TagAllCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:tag:all')
|
||||
->setDescription('Tag all entries using the tagging rules.')
|
||||
->addArgument(
|
||||
'username',
|
||||
InputArgument::REQUIRED,
|
||||
|
|
|
@ -12,6 +12,9 @@ use Wallabag\CoreBundle\Repository\EntryRepository;
|
|||
|
||||
class UpdatePicturesPathCommand extends Command
|
||||
{
|
||||
protected static $defaultName = 'wallabag:update-pictures-path';
|
||||
protected static $defaultDescription = 'Update the path of the pictures for each entry when you changed your wallabag instance URL.';
|
||||
|
||||
private EntityManagerInterface $entityManager;
|
||||
private EntryRepository $entryRepository;
|
||||
private string $wallabagUrl;
|
||||
|
@ -27,8 +30,6 @@ class UpdatePicturesPathCommand extends Command
|
|||
protected function configure()
|
||||
{
|
||||
$this
|
||||
->setName('wallabag:update-pictures-path')
|
||||
->setDescription('Update the path of the pictures for each entry when you changed your wallabag instance URL.')
|
||||
->addArgument(
|
||||
'old-url',
|
||||
InputArgument::REQUIRED,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue