forked from wallabag/wallabag
Move to Symfony Flex
The structure changed completely. Bundles are gone. Everything is flatten in the folder `src`. I separated import & api controllers to avoid _pollution_ in the main controller folder.
This commit is contained in:
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Helper\DownloadImages;
|
||||
use App\Repository\EntryRepository;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\Finder\Finder;
|
||||
use Wallabag\CoreBundle\Helper\DownloadImages;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
|
||||
class CleanDownloadedImagesCommand extends Command
|
||||
{
|
||||
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\User;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
@ -9,10 +13,6 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class CleanDuplicatesCommand extends Command
|
||||
{
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Helper\EntriesExport;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Wallabag\CoreBundle\Helper\EntriesExport;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ExportCommand extends Command
|
||||
{
|
||||
@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Helper\UrlHasher;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Wallabag\CoreBundle\Helper\UrlHasher;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class GenerateUrlHashesCommand extends Command
|
||||
{
|
||||
@ -1,7 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Import\ChromeImport;
|
||||
use App\Import\DeliciousImport;
|
||||
use App\Import\FirefoxImport;
|
||||
use App\Import\InstapaperImport;
|
||||
use App\Import\PinboardImport;
|
||||
use App\Import\ReadabilityImport;
|
||||
use App\Import\WallabagV1Import;
|
||||
use App\Import\WallabagV2Import;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
@ -11,16 +21,6 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
|
||||
use Wallabag\ImportBundle\Import\ChromeImport;
|
||||
use Wallabag\ImportBundle\Import\DeliciousImport;
|
||||
use Wallabag\ImportBundle\Import\FirefoxImport;
|
||||
use Wallabag\ImportBundle\Import\InstapaperImport;
|
||||
use Wallabag\ImportBundle\Import\PinboardImport;
|
||||
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
||||
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ImportCommand extends Command
|
||||
{
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\IgnoreOriginInstanceRule;
|
||||
use App\Entity\InternalSetting;
|
||||
use App\Entity\User;
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Exception\DriverException;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@ -17,9 +20,6 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Question\Question;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||
use Wallabag\CoreBundle\Entity\InternalSetting;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class InstallCommand extends Command
|
||||
{
|
||||
@ -34,21 +34,19 @@ class InstallCommand extends Command
|
||||
private EntityManagerInterface $entityManager;
|
||||
private EventDispatcherInterface $dispatcher;
|
||||
private UserManagerInterface $userManager;
|
||||
private string $databaseDriver;
|
||||
private string $databaseName;
|
||||
private array $defaultSettings;
|
||||
private array $defaultIgnoreOriginInstanceRules;
|
||||
|
||||
public function __construct(EntityManagerInterface $entityManager, EventDispatcherInterface $dispatcher, UserManagerInterface $userManager, string $databaseDriver, string $databaseName, array $defaultSettings, array $defaultIgnoreOriginInstanceRules)
|
||||
public function __construct(EntityManagerInterface $entityManager, EventDispatcherInterface $dispatcher, UserManagerInterface $userManager, array $defaultSettings, array $defaultIgnoreOriginInstanceRules)
|
||||
{
|
||||
$this->entityManager = $entityManager;
|
||||
$this->dispatcher = $dispatcher;
|
||||
$this->userManager = $userManager;
|
||||
$this->databaseDriver = $databaseDriver;
|
||||
$this->databaseName = $databaseName;
|
||||
$this->defaultSettings = $defaultSettings;
|
||||
$this->defaultIgnoreOriginInstanceRules = $defaultIgnoreOriginInstanceRules;
|
||||
|
||||
// var_dump($entityManager); die();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
@ -96,6 +94,10 @@ class InstallCommand extends Command
|
||||
{
|
||||
$this->io->section('Step 1 of 4: Checking system requirements.');
|
||||
|
||||
$conn = $this->entityManager->getConnection();
|
||||
$databaseDriver = $conn->getParams()['driver'];
|
||||
$databaseName = $conn->getParams()['dbname'] ?? $conn->getParams()['path'];
|
||||
|
||||
$rows = [];
|
||||
|
||||
// testing if database driver exists
|
||||
@ -104,26 +106,24 @@ class InstallCommand extends Command
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
if (!\extension_loaded($this->databaseDriver)) {
|
||||
if (!\extension_loaded($databaseDriver)) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'Database driver "' . $this->databaseDriver . '" is not installed.';
|
||||
$help = 'Database driver "' . $databaseDriver . '" is not installed.';
|
||||
}
|
||||
|
||||
$rows[] = [sprintf($label, $this->databaseDriver), $status, $help];
|
||||
$rows[] = [sprintf($label, $databaseDriver), $status, $help];
|
||||
|
||||
// testing if connection to the database can be etablished
|
||||
$label = '<comment>Database connection</comment>';
|
||||
$status = '<info>OK!</info>';
|
||||
$help = '';
|
||||
|
||||
$conn = $this->entityManager->getConnection();
|
||||
|
||||
try {
|
||||
$conn->connect();
|
||||
} catch (\Exception $e) {
|
||||
if (false === strpos($e->getMessage(), 'Unknown database')
|
||||
&& false === strpos($e->getMessage(), 'database "' . $this->databaseName . '" does not exist')) {
|
||||
&& false === strpos($e->getMessage(), 'database "' . $databaseName . '" does not exist')) {
|
||||
$fulfilled = false;
|
||||
$status = '<error>ERROR!</error>';
|
||||
$help = 'Can\'t connect to the database: ' . $e->getMessage();
|
||||
@ -295,8 +295,8 @@ class InstallCommand extends Command
|
||||
$this->io->section('Step 4 of 4: Config setup.');
|
||||
|
||||
// cleanup before insert new stuff
|
||||
$this->entityManager->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\InternalSetting')->execute();
|
||||
$this->entityManager->createQuery('DELETE FROM Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule')->execute();
|
||||
$this->entityManager->createQuery('DELETE FROM App\Entity\InternalSetting')->execute();
|
||||
$this->entityManager->createQuery('DELETE FROM App\Entity\IgnoreOriginInstanceRule')->execute();
|
||||
|
||||
foreach ($this->defaultSettings as $setting) {
|
||||
$newSetting = new InternalSetting();
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ListUserCommand extends Command
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use Simpleue\Worker\QueueWorker;
|
||||
use Symfony\Component\Config\Definition\Exception\Exception;
|
||||
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Event\EntrySavedEvent;
|
||||
use App\Helper\ContentProxy;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
@ -10,10 +14,6 @@ use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Wallabag\CoreBundle\Event\EntrySavedEvent;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ReloadEntryCommand extends Command
|
||||
{
|
||||
@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ShowUserCommand extends Command
|
||||
{
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Command;
|
||||
namespace App\Command;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Helper\RuleBasedTagger;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
@ -9,9 +12,6 @@ use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Symfony\Component\Console\Style\SymfonyStyle;
|
||||
use Wallabag\CoreBundle\Helper\RuleBasedTagger;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class TagAllCommand extends Command
|
||||
{
|
||||
0
src/Consumer/.gitignore
vendored
Normal file
0
src/Consumer/.gitignore
vendored
Normal file
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Consumer;
|
||||
namespace App\Consumer;
|
||||
|
||||
use OldSound\RabbitMqBundle\RabbitMq\ConsumerInterface;
|
||||
use PhpAmqpLib\Message\AMQPMessage;
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Consumer;
|
||||
namespace App\Consumer;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\Tag;
|
||||
use App\Event\EntrySavedEvent;
|
||||
use App\Import\AbstractImport;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Psr\Log\NullLogger;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Event\EntrySavedEvent;
|
||||
use Wallabag\ImportBundle\Import\AbstractImport;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
abstract class AbstractConsumer
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Consumer;
|
||||
namespace App\Consumer;
|
||||
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Consumer;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Consumer;
|
||||
namespace App\Consumer;
|
||||
|
||||
use Simpleue\Job\Job;
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Entity\Annotation;
|
||||
use App\Entity\Entry;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
class AnnotationRestController extends WallabagRestController
|
||||
{
|
||||
@ -42,7 +42,7 @@ class AnnotationRestController extends WallabagRestController
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::getAnnotationsAction', [
|
||||
return $this->forward('App\Controller\WallabagAnnotationController::getAnnotationsAction', [
|
||||
'entry' => $entry,
|
||||
]);
|
||||
}
|
||||
@ -108,7 +108,7 @@ class AnnotationRestController extends WallabagRestController
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::postAnnotationAction', [
|
||||
return $this->forward('App\Controller\WallabagAnnotationController::postAnnotationAction', [
|
||||
'request' => $request,
|
||||
'entry' => $entry,
|
||||
]);
|
||||
@ -144,7 +144,7 @@ class AnnotationRestController extends WallabagRestController
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::putAnnotationAction', [
|
||||
return $this->forward('App\Controller\WallabagAnnotationController::putAnnotationAction', [
|
||||
'annotation' => $annotation,
|
||||
'request' => $request,
|
||||
]);
|
||||
@ -180,7 +180,7 @@ class AnnotationRestController extends WallabagRestController
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
return $this->forward('Wallabag\AnnotationBundle\Controller\WallabagAnnotationController::deleteAnnotationAction', [
|
||||
return $this->forward('App\Controller\WallabagAnnotationController::deleteAnnotationAction', [
|
||||
'annotation' => $annotation,
|
||||
]);
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerInterface;
|
||||
@ -1,7 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\Tag;
|
||||
use App\Event\EntryDeletedEvent;
|
||||
use App\Event\EntrySavedEvent;
|
||||
use App\Helper\ContentProxy;
|
||||
use App\Helper\EntriesExport;
|
||||
use App\Helper\TagsAssigner;
|
||||
use App\Helper\UrlHasher;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use Hateoas\Configuration\Route as HateoasRoute;
|
||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
@ -15,16 +25,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
||||
use Wallabag\CoreBundle\Event\EntrySavedEvent;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Wallabag\CoreBundle\Helper\EntriesExport;
|
||||
use Wallabag\CoreBundle\Helper\TagsAssigner;
|
||||
use Wallabag\CoreBundle\Helper\UrlHasher;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
class EntryRestController extends WallabagRestController
|
||||
{
|
||||
@ -511,7 +511,7 @@ class EntryRestController extends WallabagRestController
|
||||
|
||||
$urls = json_decode($request->query->get('urls', []));
|
||||
|
||||
$limit = $this->getParameter('wallabag_core.api_limit_mass_actions');
|
||||
$limit = $this->getParameter('wallabag.api_limit_mass_actions');
|
||||
|
||||
if (\count($urls) > $limit) {
|
||||
throw new HttpException(400, 'API limit reached');
|
||||
@ -1030,7 +1030,7 @@ class EntryRestController extends WallabagRestController
|
||||
}
|
||||
|
||||
// if refreshing entry failed, don't save it
|
||||
if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) {
|
||||
if ($this->getParameter('wallabag.fetching_error_message') === $entry->getContent()) {
|
||||
return new JsonResponse([], 304);
|
||||
}
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Repository\EntryRepository;
|
||||
use Hateoas\Configuration\Route as HateoasRoute;
|
||||
use Hateoas\Representation\Factory\PagerfantaFactory;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
@ -11,7 +12,6 @@ use Pagerfanta\Pagerfanta;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
|
||||
class SearchRestController extends WallabagRestController
|
||||
{
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\Tag;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use Nelmio\ApiDocBundle\Annotation\Operation;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
class TagRestController extends WallabagRestController
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use JMS\Serializer\SerializationContext;
|
||||
use JMS\Serializer\SerializerBuilder;
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use App\Entity\Client;
|
||||
use App\Entity\User;
|
||||
use App\Form\Type\NewUserType;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Event\UserEvent;
|
||||
@ -15,9 +18,6 @@ use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Form\NewUserType;
|
||||
|
||||
class UserRestController extends WallabagRestController
|
||||
{
|
||||
@ -1,8 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller\Api;
|
||||
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use App\Entity\User;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\RestBundle\Controller\AbstractFOSRestController;
|
||||
use JMS\Serializer\SerializationContext;
|
||||
@ -16,8 +17,7 @@ use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInt
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ApiBundle\Entity\ApplicationInfo;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use App\Entity\ApplicationInfo;
|
||||
|
||||
class WallabagRestController extends AbstractFOSRestController
|
||||
{
|
||||
@ -61,7 +61,7 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
*/
|
||||
public function getVersionAction()
|
||||
{
|
||||
$version = $this->getParameter('wallabag_core.version');
|
||||
$version = $this->getParameter('wallabag.version');
|
||||
$json = $this->serializer->serialize($version, 'json');
|
||||
|
||||
return (new JsonResponse())->setJson($json);
|
||||
@ -85,7 +85,7 @@ class WallabagRestController extends AbstractFOSRestController
|
||||
public function getInfoAction(Config $craueConfig)
|
||||
{
|
||||
$info = new ApplicationInfo(
|
||||
$this->getParameter('wallabag_core.version'),
|
||||
$this->getParameter('wallabag.version'),
|
||||
$this->getParameter('fosuser_registration') && $craueConfig->get('api_user_registration'),
|
||||
);
|
||||
|
||||
@ -1,7 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Config as ConfigEntity;
|
||||
use App\Entity\IgnoreOriginUserRule;
|
||||
use App\Entity\RuleInterface;
|
||||
use App\Entity\TaggingRule;
|
||||
use App\Form\Type\ChangePasswordType;
|
||||
use App\Form\Type\ConfigType;
|
||||
use App\Form\Type\FeedType;
|
||||
use App\Form\Type\IgnoreOriginUserRuleType;
|
||||
use App\Form\Type\TaggingRuleImportType;
|
||||
use App\Form\Type\TaggingRuleType;
|
||||
use App\Form\Type\UserInformationType;
|
||||
use App\Repository\AnnotationRepository;
|
||||
use App\Repository\ConfigRepository;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\IgnoreOriginUserRuleRepository;
|
||||
use App\Repository\TaggingRuleRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use App\Repository\UserRepository;
|
||||
use App\Tools\Utils;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
@ -20,25 +39,6 @@ use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Validator\Constraints\Locale as LocaleConstraint;
|
||||
use Symfony\Component\Validator\Validator\ValidatorInterface;
|
||||
use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
|
||||
use Wallabag\CoreBundle\Entity\Config as ConfigEntity;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||
use Wallabag\CoreBundle\Entity\RuleInterface;
|
||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||
use Wallabag\CoreBundle\Form\Type\ChangePasswordType;
|
||||
use Wallabag\CoreBundle\Form\Type\ConfigType;
|
||||
use Wallabag\CoreBundle\Form\Type\FeedType;
|
||||
use Wallabag\CoreBundle\Form\Type\IgnoreOriginUserRuleType;
|
||||
use Wallabag\CoreBundle\Form\Type\TaggingRuleImportType;
|
||||
use Wallabag\CoreBundle\Form\Type\TaggingRuleType;
|
||||
use Wallabag\CoreBundle\Form\Type\UserInformationType;
|
||||
use Wallabag\CoreBundle\Repository\ConfigRepository;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository;
|
||||
use Wallabag\CoreBundle\Repository\TaggingRuleRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
use Wallabag\CoreBundle\Tools\Utils;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
class ConfigController extends AbstractController
|
||||
{
|
||||
@ -232,7 +232,7 @@ class ConfigController extends AbstractController
|
||||
return $this->redirect($this->generateUrl('config') . '#set6');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Config/index.html.twig', [
|
||||
return $this->render('Config/index.html.twig', [
|
||||
'form' => [
|
||||
'config' => $configForm->createView(),
|
||||
'feed' => $feedForm->createView(),
|
||||
@ -346,7 +346,7 @@ class ConfigController extends AbstractController
|
||||
'flashes.config.notice.otp_enabled'
|
||||
);
|
||||
|
||||
return $this->render('@WallabagCore/Config/otp_app.html.twig', [
|
||||
return $this->render('Config/otp_app.html.twig', [
|
||||
'backupCodes' => $backupCodes,
|
||||
'qr_code' => $googleAuthenticator->getQRContent($user),
|
||||
'secret' => $secret,
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Client;
|
||||
use App\Form\Type\ClientType;
|
||||
use App\Repository\ClientRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
@ -9,16 +12,16 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
use Wallabag\ApiBundle\Form\Type\ClientType;
|
||||
use Wallabag\ApiBundle\Repository\ClientRepository;
|
||||
|
||||
/**
|
||||
* @Route("/developer")
|
||||
*/
|
||||
class DeveloperController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* List all clients and link to create a new one.
|
||||
*
|
||||
* @Route("/developer", name="developer")
|
||||
* @Route("", name="developer")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
@ -26,7 +29,7 @@ class DeveloperController extends AbstractController
|
||||
{
|
||||
$clients = $repo->findByUser($this->getUser()->getId());
|
||||
|
||||
return $this->render('@WallabagCore/Developer/index.html.twig', [
|
||||
return $this->render('Developer/index.html.twig', [
|
||||
'clients' => $clients,
|
||||
]);
|
||||
}
|
||||
@ -34,7 +37,7 @@ class DeveloperController extends AbstractController
|
||||
/**
|
||||
* Create a client (an app).
|
||||
*
|
||||
* @Route("/developer/client/create", name="developer_create_client")
|
||||
* @Route("/client/create", name="developer_create_client")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
@ -54,14 +57,14 @@ class DeveloperController extends AbstractController
|
||||
$translator->trans('flashes.developer.notice.client_created', ['%name%' => $client->getName()])
|
||||
);
|
||||
|
||||
return $this->render('@WallabagCore/Developer/client_parameters.html.twig', [
|
||||
return $this->render('Developer/client_parameters.html.twig', [
|
||||
'client_id' => $client->getPublicId(),
|
||||
'client_secret' => $client->getSecret(),
|
||||
'client_name' => $client->getName(),
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Developer/client.html.twig', [
|
||||
return $this->render('Developer/client.html.twig', [
|
||||
'form' => $clientForm->createView(),
|
||||
]);
|
||||
}
|
||||
@ -69,7 +72,7 @@ class DeveloperController extends AbstractController
|
||||
/**
|
||||
* Remove a client.
|
||||
*
|
||||
* @Route("/developer/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||
* @Route("/client/delete/{id}", requirements={"id" = "\d+"}, name="developer_delete_client")
|
||||
*
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
@ -93,12 +96,12 @@ class DeveloperController extends AbstractController
|
||||
/**
|
||||
* Display developer how to use an existing app.
|
||||
*
|
||||
* @Route("/developer/howto/first-app", name="developer_howto_firstapp")
|
||||
* @Route("/howto/first-app", name="developer_howto_firstapp")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
public function howtoFirstAppAction()
|
||||
{
|
||||
return $this->render('@WallabagCore/Developer/howto_app.html.twig');
|
||||
return $this->render('Developer/howto_app.html.twig');
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\Tag;
|
||||
use App\Event\EntryDeletedEvent;
|
||||
use App\Event\EntrySavedEvent;
|
||||
use App\Form\Type\EditEntryType;
|
||||
use App\Form\Type\EntryFilterType;
|
||||
use App\Form\Type\NewEntryType;
|
||||
use App\Form\Type\SearchEntryType;
|
||||
use App\Helper\ContentProxy;
|
||||
use App\Helper\PreparePagerForEntries;
|
||||
use App\Helper\Redirect;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\NoResultException;
|
||||
@ -17,19 +30,6 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
||||
use Wallabag\CoreBundle\Event\EntrySavedEvent;
|
||||
use Wallabag\CoreBundle\Form\Type\EditEntryType;
|
||||
use Wallabag\CoreBundle\Form\Type\EntryFilterType;
|
||||
use Wallabag\CoreBundle\Form\Type\NewEntryType;
|
||||
use Wallabag\CoreBundle\Form\Type\SearchEntryType;
|
||||
use Wallabag\CoreBundle\Helper\ContentProxy;
|
||||
use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
|
||||
use Wallabag\CoreBundle\Helper\Redirect;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
class EntryController extends AbstractController
|
||||
{
|
||||
@ -158,7 +158,7 @@ class EntryController extends AbstractController
|
||||
return $this->showEntries('search', $request, $page);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Entry/search_form.html.twig', [
|
||||
return $this->render('Entry/search_form.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'currentRoute' => $currentRoute,
|
||||
]);
|
||||
@ -200,7 +200,7 @@ class EntryController extends AbstractController
|
||||
return $this->redirect($this->generateUrl('homepage'));
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Entry/new_form.html.twig', [
|
||||
return $this->render('Entry/new_form.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
@ -235,7 +235,7 @@ class EntryController extends AbstractController
|
||||
*/
|
||||
public function addEntryAction()
|
||||
{
|
||||
return $this->render('@WallabagCore/Entry/new.html.twig');
|
||||
return $this->render('Entry/new.html.twig');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -265,7 +265,7 @@ class EntryController extends AbstractController
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Entry/edit.html.twig', [
|
||||
return $this->render('Entry/edit.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
@ -392,7 +392,7 @@ class EntryController extends AbstractController
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Entry/entry.html.twig',
|
||||
'Entry/entry.html.twig',
|
||||
['entry' => $entry]
|
||||
);
|
||||
}
|
||||
@ -412,7 +412,7 @@ class EntryController extends AbstractController
|
||||
$this->updateEntry($entry, 'entry_reloaded');
|
||||
|
||||
// if refreshing entry failed, don't save it
|
||||
if ($this->getParameter('wallabag_core.fetching_error_message') === $entry->getContent()) {
|
||||
if ($this->getParameter('wallabag.fetching_error_message') === $entry->getContent()) {
|
||||
$this->addFlash('notice', 'flashes.entry.notice.entry_reloaded_failed');
|
||||
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
@ -584,7 +584,7 @@ class EntryController extends AbstractController
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Entry/share.html.twig',
|
||||
'Entry/share.html.twig',
|
||||
['entry' => $entry]
|
||||
);
|
||||
}
|
||||
@ -677,7 +677,7 @@ class EntryController extends AbstractController
|
||||
->countUntaggedEntriesByUser($this->getUser()->getId());
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Entry/entries.html.twig', [
|
||||
'Entry/entries.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\TwigBundle\Controller\ExceptionController as BaseExceptionController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@ -20,7 +20,7 @@ class ExceptionController extends BaseExceptionController
|
||||
|
||||
// For error pages, try to find a template for the specific HTTP status code and format
|
||||
if (!$showException) {
|
||||
$template = sprintf('@WallabagCore/Exception/%s.%s.twig', $name, $format);
|
||||
$template = sprintf('Exception/%s.%s.twig', $name, $format);
|
||||
if ($this->templateExists($template)) {
|
||||
return $template;
|
||||
}
|
||||
@ -1,26 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Helper\EntriesExport;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\CoreBundle\Helper\EntriesExport;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
/**
|
||||
* The try/catch can be removed once all formats will be implemented.
|
||||
* Still need implementation: txt.
|
||||
*
|
||||
* @Route("/export")
|
||||
*/
|
||||
class ExportController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* Gets one entry content.
|
||||
*
|
||||
* @Route("/export/{id}.{format}", name="export_entry", requirements={
|
||||
* @Route("/{id}.{format}", name="export_entry", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "id": "\d+"
|
||||
* })
|
||||
@ -54,7 +57,7 @@ class ExportController extends AbstractController
|
||||
/**
|
||||
* Export all entries for current user.
|
||||
*
|
||||
* @Route("/export/{category}.{format}", name="export_entries", requirements={
|
||||
* @Route("/{category}.{format}", name="export_entries", requirements={
|
||||
* "format": "epub|mobi|pdf|json|xml|txt|csv",
|
||||
* "category": "all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain"
|
||||
* })
|
||||
@ -1,7 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Tag;
|
||||
use App\Entity\User;
|
||||
use App\Helper\PreparePagerForEntries;
|
||||
use App\Repository\EntryRepository;
|
||||
use Pagerfanta\Adapter\ArrayAdapter;
|
||||
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
|
||||
use Pagerfanta\Exception\OutOfRangeCurrentPageException;
|
||||
@ -13,11 +17,10 @@ use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* @Route("/feed")
|
||||
*/
|
||||
class FeedController extends AbstractController
|
||||
{
|
||||
private EntryRepository $entryRepository;
|
||||
@ -30,9 +33,9 @@ class FeedController extends AbstractController
|
||||
/**
|
||||
* Shows unread entries for current user.
|
||||
*
|
||||
* @Route("/feed/{username}/{token}/unread/{page}", name="unread_feed", defaults={"page"=1, "_format"="xml"})
|
||||
* @Route("/{username}/{token}/unread/{page}", name="unread_feed", defaults={"page"=1, "_format"="xml"})
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("user", class="App\Entity\User", converter="username_feed_token_converter")
|
||||
*
|
||||
* @param $page
|
||||
*
|
||||
@ -46,9 +49,9 @@ class FeedController extends AbstractController
|
||||
/**
|
||||
* Shows read entries for current user.
|
||||
*
|
||||
* @Route("/feed/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page"=1, "_format"="xml"})
|
||||
* @Route("/{username}/{token}/archive/{page}", name="archive_feed", defaults={"page"=1, "_format"="xml"})
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("user", class="App\Entity\User", converter="username_feed_token_converter")
|
||||
*
|
||||
* @param $page
|
||||
*
|
||||
@ -62,9 +65,9 @@ class FeedController extends AbstractController
|
||||
/**
|
||||
* Shows starred entries for current user.
|
||||
*
|
||||
* @Route("/feed/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page"=1, "_format"="xml"})
|
||||
* @Route("/{username}/{token}/starred/{page}", name="starred_feed", defaults={"page"=1, "_format"="xml"})
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("user", class="App\Entity\User", converter="username_feed_token_converter")
|
||||
*
|
||||
* @param $page
|
||||
*
|
||||
@ -78,9 +81,9 @@ class FeedController extends AbstractController
|
||||
/**
|
||||
* Shows all entries for current user.
|
||||
*
|
||||
* @Route("/feed/{username}/{token}/all/{page}", name="all_feed", defaults={"page"=1, "_format"="xml"})
|
||||
* @Route("/{username}/{token}/all/{page}", name="all_feed", defaults={"page"=1, "_format"="xml"})
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("user", class="App\Entity\User", converter="username_feed_token_converter")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
@ -92,9 +95,9 @@ class FeedController extends AbstractController
|
||||
/**
|
||||
* Shows entries associated to a tag for current user.
|
||||
*
|
||||
* @Route("/feed/{username}/{token}/tags/{slug}/{page}", name="tag_feed", defaults={"page"=1, "_format"="xml"})
|
||||
* @Route("/{username}/{token}/tags/{slug}/{page}", name="tag_feed", defaults={"page"=1, "_format"="xml"})
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("user", class="App\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
*
|
||||
* @return Response
|
||||
@ -135,7 +138,7 @@ class FeedController extends AbstractController
|
||||
$user
|
||||
);
|
||||
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.feed_limit');
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag.feed_limit');
|
||||
$entries->setMaxPerPage($perPage);
|
||||
|
||||
if (null === $entries) {
|
||||
@ -151,14 +154,14 @@ class FeedController extends AbstractController
|
||||
}
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Entry/entries.xml.twig',
|
||||
'Entry/entries.xml.twig',
|
||||
[
|
||||
'type' => 'tag',
|
||||
'url' => $url,
|
||||
'entries' => $entries,
|
||||
'user' => $user->getUsername(),
|
||||
'domainName' => $this->getParameter('domain_name'),
|
||||
'version' => $this->getParameter('wallabag_core.version'),
|
||||
'version' => $this->getParameter('wallabag.version'),
|
||||
'tag' => $tag->getSlug(),
|
||||
'updated' => $this->prepareFeedUpdatedDate($entries, $sort),
|
||||
],
|
||||
@ -213,7 +216,7 @@ class FeedController extends AbstractController
|
||||
$pagerAdapter = new DoctrineORMAdapter($qb->getQuery(), true, false);
|
||||
$entries = new Pagerfanta($pagerAdapter);
|
||||
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag_core.feed_limit');
|
||||
$perPage = $user->getConfig()->getFeedLimit() ?: $this->getParameter('wallabag.feed_limit');
|
||||
$entries->setMaxPerPage($perPage);
|
||||
|
||||
$url = $this->generateUrl(
|
||||
@ -233,13 +236,13 @@ class FeedController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Entry/entries.xml.twig', [
|
||||
return $this->render('Entry/entries.xml.twig', [
|
||||
'type' => $type,
|
||||
'url' => $url,
|
||||
'entries' => $entries,
|
||||
'user' => $user->getUsername(),
|
||||
'domainName' => $this->getParameter('domain_name'),
|
||||
'version' => $this->getParameter('wallabag_core.version'),
|
||||
'version' => $this->getParameter('wallabag.version'),
|
||||
'updated' => $this->prepareFeedUpdatedDate($entries),
|
||||
],
|
||||
new Response('', 200, ['Content-Type' => 'application/atom+xml'])
|
||||
@ -1,7 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\IgnoreOriginInstanceRule;
|
||||
use App\Form\Type\IgnoreOriginInstanceRuleType;
|
||||
use App\Repository\IgnoreOriginInstanceRuleRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\Form;
|
||||
@ -10,13 +13,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||
use Wallabag\CoreBundle\Form\Type\IgnoreOriginInstanceRuleType;
|
||||
use Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository;
|
||||
|
||||
/**
|
||||
* IgnoreOriginInstanceRuleController controller.
|
||||
*
|
||||
* @Route("/ignore-origin-instance-rules")
|
||||
*/
|
||||
class IgnoreOriginInstanceRuleController extends AbstractController
|
||||
@ -39,7 +37,7 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
||||
{
|
||||
$rules = $repository->findAll();
|
||||
|
||||
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/index.html.twig', [
|
||||
return $this->render('IgnoreOriginInstanceRule/index.html.twig', [
|
||||
'rules' => $rules,
|
||||
]);
|
||||
}
|
||||
@ -70,7 +68,7 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
||||
return $this->redirectToRoute('ignore_origin_instance_rules_index');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/new.html.twig', [
|
||||
return $this->render('IgnoreOriginInstanceRule/new.html.twig', [
|
||||
'rule' => $ignoreOriginInstanceRule,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
@ -101,7 +99,7 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
||||
return $this->redirectToRoute('ignore_origin_instance_rules_index');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/IgnoreOriginInstanceRule/edit.html.twig', [
|
||||
return $this->render('IgnoreOriginInstanceRule/edit.html.twig', [
|
||||
'rule' => $ignoreOriginInstanceRule,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
@ -1,19 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\ImportInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\ImportInterface;
|
||||
|
||||
abstract class BrowserController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @Route("/browser", name="import_browser")
|
||||
* @Route("/import/browser", name="import_browser")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
@ -30,9 +30,9 @@ abstract class BrowserController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = $this->getUser()->getId() . '.json';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $wallabag
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -51,7 +51,7 @@ abstract class BrowserController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\ChromeImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\ChromeImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class ChromeController extends BrowserController
|
||||
{
|
||||
@ -26,7 +26,7 @@ class ChromeController extends BrowserController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/chrome", name="import_chrome")
|
||||
* @Route("/import/chrome", name="import_chrome")
|
||||
*/
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
@ -52,6 +52,6 @@ class ChromeController extends BrowserController
|
||||
*/
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return '@WallabagImport/Chrome/index.html.twig';
|
||||
return 'Import/chrome.html.twig';
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\DeliciousImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\DeliciousImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class DeliciousController extends AbstractController
|
||||
{
|
||||
@ -24,7 +24,7 @@ class DeliciousController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/delicious", name="import_delicious")
|
||||
* @Route("/import/delicious", name="import_delicious")
|
||||
*/
|
||||
public function indexAction(Request $request, DeliciousImport $delicious, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
@ -44,9 +44,9 @@ class DeliciousController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = 'delicious_' . $this->getUser()->getId() . '.json';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $delicious
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -65,7 +65,7 @@ class DeliciousController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -76,7 +76,7 @@ class DeliciousController extends AbstractController
|
||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagImport/Delicious/index.html.twig', [
|
||||
return $this->render('Import/delicious.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'import' => $delicious,
|
||||
]);
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\ElcuratorImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\ElcuratorImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class ElcuratorController extends WallabagController
|
||||
{
|
||||
@ -26,7 +26,7 @@ class ElcuratorController extends WallabagController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/elcurator", name="import_elcurator")
|
||||
* @Route("/import/elcurator", name="import_elcurator")
|
||||
*/
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
@ -52,6 +52,6 @@ class ElcuratorController extends WallabagController
|
||||
*/
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return '@WallabagImport/Elcurator/index.html.twig';
|
||||
return 'Import/elcurator.html.twig';
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\FirefoxImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\FirefoxImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class FirefoxController extends BrowserController
|
||||
{
|
||||
@ -26,7 +26,7 @@ class FirefoxController extends BrowserController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/firefox", name="import_firefox")
|
||||
* @Route("/import/firefox", name="import_firefox")
|
||||
*/
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
@ -52,6 +52,6 @@ class FirefoxController extends BrowserController
|
||||
*/
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return '@WallabagImport/Firefox/index.html.twig';
|
||||
return 'Import/firefox.html.twig';
|
||||
}
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Consumer\RabbitMQConsumerTotalProxy;
|
||||
use App\Import\ImportChain;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Predis\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
|
||||
use Wallabag\ImportBundle\Import\ImportChain;
|
||||
|
||||
class ImportController extends Controller
|
||||
class ImportController extends AbstractController
|
||||
{
|
||||
private RabbitMQConsumerTotalProxy $rabbitMQConsumerTotalProxy;
|
||||
|
||||
@ -20,11 +20,11 @@ class ImportController extends Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/", name="import")
|
||||
* @Route("/import", name="import")
|
||||
*/
|
||||
public function importAction(ImportChain $importChain)
|
||||
{
|
||||
return $this->render('@WallabagImport/Import/index.html.twig', [
|
||||
return $this->render('Import/index.html.twig', [
|
||||
'imports' => $importChain->getAll(),
|
||||
]);
|
||||
}
|
||||
@ -41,7 +41,7 @@ class ImportController extends Controller
|
||||
$rabbitNotInstalled = false;
|
||||
|
||||
if (!$authorizationChecker->isGranted('ROLE_SUPER_ADMIN')) {
|
||||
return $this->render('@WallabagImport/Import/check_queue.html.twig');
|
||||
return $this->render('Import/check_queue.html.twig');
|
||||
}
|
||||
|
||||
if ($craueConfig->get('import_with_rabbitmq')) {
|
||||
@ -81,7 +81,7 @@ class ImportController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('@WallabagImport/Import/check_queue.html.twig', [
|
||||
return $this->render('Import/check_queue.html.twig', [
|
||||
'nbRedisMessages' => $nbRedisMessages,
|
||||
'nbRabbitMessages' => $nbRabbitMessages,
|
||||
'redisNotInstalled' => $redisNotInstalled,
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\InstapaperImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\InstapaperImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class InstapaperController extends AbstractController
|
||||
{
|
||||
@ -24,7 +24,7 @@ class InstapaperController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/instapaper", name="import_instapaper")
|
||||
* @Route("/import/instapaper", name="import_instapaper")
|
||||
*/
|
||||
public function indexAction(Request $request, InstapaperImport $instapaper, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
@ -44,9 +44,9 @@ class InstapaperController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = 'instapaper_' . $this->getUser()->getId() . '.csv';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $instapaper
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -65,7 +65,7 @@ class InstapaperController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -76,7 +76,7 @@ class InstapaperController extends AbstractController
|
||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagImport/Instapaper/index.html.twig', [
|
||||
return $this->render('Import/instapaper.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'import' => $instapaper,
|
||||
]);
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\PinboardImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\PinboardImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class PinboardController extends AbstractController
|
||||
{
|
||||
@ -24,7 +24,7 @@ class PinboardController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/pinboard", name="import_pinboard")
|
||||
* @Route("/import/pinboard", name="import_pinboard")
|
||||
*/
|
||||
public function indexAction(Request $request, PinboardImport $pinboard, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
@ -44,9 +44,9 @@ class PinboardController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = 'pinboard_' . $this->getUser()->getId() . '.json';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $pinboard
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -65,7 +65,7 @@ class PinboardController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -76,7 +76,7 @@ class PinboardController extends AbstractController
|
||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagImport/Pinboard/index.html.twig', [
|
||||
return $this->render('Import/pinboard.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'import' => $pinboard,
|
||||
]);
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\PocketImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -11,8 +13,6 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\PocketImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class PocketController extends AbstractController
|
||||
{
|
||||
@ -30,7 +30,7 @@ class PocketController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/pocket", name="import_pocket")
|
||||
* @Route("/import/pocket", name="import_pocket")
|
||||
*/
|
||||
public function indexAction(PocketImport $pocketImport)
|
||||
{
|
||||
@ -43,7 +43,7 @@ class PocketController extends AbstractController
|
||||
])
|
||||
->getForm();
|
||||
|
||||
return $this->render('@WallabagImport/Pocket/index.html.twig', [
|
||||
return $this->render('Import/pocket.html.twig', [
|
||||
'import' => $pocket,
|
||||
'has_consumer_key' => '' === trim($this->getUser()->getConfig()->getPocketConsumerKey()) ? false : true,
|
||||
'form' => $form->createView(),
|
||||
@ -51,7 +51,7 @@ class PocketController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/pocket/auth", name="import_pocket_auth")
|
||||
* @Route("/import/pocket/auth", name="import_pocket_auth")
|
||||
*/
|
||||
public function authAction(Request $request, PocketImport $pocketImport)
|
||||
{
|
||||
@ -81,7 +81,7 @@ class PocketController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/pocket/callback", name="import_pocket_callback")
|
||||
* @Route("/import/pocket/callback", name="import_pocket_callback")
|
||||
*/
|
||||
public function callbackAction(PocketImport $pocketImport, TranslatorInterface $translator)
|
||||
{
|
||||
@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\ReadabilityImport;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class ReadabilityController extends AbstractController
|
||||
{
|
||||
@ -24,7 +24,7 @@ class ReadabilityController extends AbstractController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/readability", name="import_readability")
|
||||
* @Route("/import/readability", name="import_readability")
|
||||
*/
|
||||
public function indexAction(Request $request, ReadabilityImport $readability, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
@ -44,9 +44,9 @@ class ReadabilityController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = 'readability_' . $this->getUser()->getId() . '.json';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $readability
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -65,7 +65,7 @@ class ReadabilityController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -76,7 +76,7 @@ class ReadabilityController extends AbstractController
|
||||
$this->addFlash('notice', 'flashes.import.notice.failed_on_file');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagImport/Readability/index.html.twig', [
|
||||
return $this->render('Import/readability.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'import' => $readability,
|
||||
]);
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Form\Type\UploadImportType;
|
||||
use App\Import\ImportInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Form\Type\UploadImportType;
|
||||
use Wallabag\ImportBundle\Import\ImportInterface;
|
||||
|
||||
/**
|
||||
* Define Wallabag import for v1 and v2, since there are very similar.
|
||||
@ -33,9 +33,9 @@ abstract class WallabagController extends AbstractController
|
||||
$markAsRead = $form->get('mark_as_read')->getData();
|
||||
$name = $this->getUser()->getId() . '.json';
|
||||
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag_import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag_import.resource_dir'), $name)) {
|
||||
if (null !== $file && \in_array($file->getClientMimeType(), $this->getParameter('wallabag.import.allow_mimetypes'), true) && $file->move($this->getParameter('wallabag.import.resource_dir'), $name)) {
|
||||
$res = $wallabag
|
||||
->setFilepath($this->getParameter('wallabag_import.resource_dir') . '/' . $name)
|
||||
->setFilepath($this->getParameter('wallabag.import.resource_dir') . '/' . $name)
|
||||
->setMarkAsRead($markAsRead)
|
||||
->import();
|
||||
|
||||
@ -54,7 +54,7 @@ abstract class WallabagController extends AbstractController
|
||||
]);
|
||||
}
|
||||
|
||||
unlink($this->getParameter('wallabag_import.resource_dir') . '/' . $name);
|
||||
unlink($this->getParameter('wallabag.import.resource_dir') . '/' . $name);
|
||||
}
|
||||
|
||||
$this->addFlash('notice', $message);
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\WallabagV1Import;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class WallabagV1Controller extends WallabagController
|
||||
{
|
||||
@ -26,7 +26,7 @@ class WallabagV1Controller extends WallabagController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/wallabag-v1", name="import_wallabag_v1")
|
||||
* @Route("/import/wallabag-v1", name="import_wallabag_v1")
|
||||
*/
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
@ -52,6 +52,6 @@ class WallabagV1Controller extends WallabagController
|
||||
*/
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return '@WallabagImport/WallabagV1/index.html.twig';
|
||||
return 'Import/wallabagV1.html.twig';
|
||||
}
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ImportBundle\Controller;
|
||||
namespace App\Controller\Import;
|
||||
|
||||
use App\Import\WallabagV2Import;
|
||||
use App\Redis\Producer as RedisProducer;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||
use Wallabag\ImportBundle\Redis\Producer as RedisProducer;
|
||||
|
||||
class WallabagV2Controller extends WallabagController
|
||||
{
|
||||
@ -26,7 +26,7 @@ class WallabagV2Controller extends WallabagController
|
||||
}
|
||||
|
||||
/**
|
||||
* @Route("/wallabag-v2", name="import_wallabag_v2")
|
||||
* @Route("/import/wallabag-v2", name="import_wallabag_v2")
|
||||
*/
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
@ -52,6 +52,6 @@ class WallabagV2Controller extends WallabagController
|
||||
*/
|
||||
protected function getImportTemplate()
|
||||
{
|
||||
return '@WallabagImport/WallabagV2/index.html.twig';
|
||||
return 'Import/wallabagV2.html.twig';
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\SiteCredential;
|
||||
use App\Entity\User;
|
||||
use App\Form\Type\SiteCredentialType;
|
||||
use App\Helper\CryptoProxy;
|
||||
use App\Repository\SiteCredentialRepository;
|
||||
use Craue\ConfigBundle\Util\Config;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@ -11,15 +16,8 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||
use Wallabag\CoreBundle\Form\Type\SiteCredentialType;
|
||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||
use Wallabag\CoreBundle\Repository\SiteCredentialRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* SiteCredential controller.
|
||||
*
|
||||
* @Route("/site-credentials")
|
||||
*/
|
||||
class SiteCredentialController extends AbstractController
|
||||
@ -48,7 +46,7 @@ class SiteCredentialController extends AbstractController
|
||||
|
||||
$credentials = $repository->findByUser($this->getUser());
|
||||
|
||||
return $this->render('@WallabagCore/SiteCredential/index.html.twig', [
|
||||
return $this->render('SiteCredential/index.html.twig', [
|
||||
'credentials' => $credentials,
|
||||
]);
|
||||
}
|
||||
@ -84,7 +82,7 @@ class SiteCredentialController extends AbstractController
|
||||
return $this->redirectToRoute('site_credentials_index');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/SiteCredential/new.html.twig', [
|
||||
return $this->render('SiteCredential/new.html.twig', [
|
||||
'credential' => $credential,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
@ -122,7 +120,7 @@ class SiteCredentialController extends AbstractController
|
||||
return $this->redirectToRoute('site_credentials_index');
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/SiteCredential/edit.html.twig', [
|
||||
return $this->render('SiteCredential/edit.html.twig', [
|
||||
'credential' => $siteCredential,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
@ -15,7 +15,7 @@ class StaticController extends AbstractController
|
||||
$addonsUrl = $this->getParameter('addons_url');
|
||||
|
||||
return $this->render(
|
||||
'@WallabagCore/Static/howto.html.twig',
|
||||
'Static/howto.html.twig',
|
||||
[
|
||||
'addonsUrl' => $addonsUrl,
|
||||
]
|
||||
@ -28,10 +28,10 @@ class StaticController extends AbstractController
|
||||
public function aboutAction()
|
||||
{
|
||||
return $this->render(
|
||||
'@WallabagCore/Static/about.html.twig',
|
||||
'Static/about.html.twig',
|
||||
[
|
||||
'version' => $this->getParameter('wallabag_core.version'),
|
||||
'paypal_url' => $this->getParameter('wallabag_core.paypal_url'),
|
||||
'version' => $this->getParameter('wallabag.version'),
|
||||
'paypal_url' => $this->getParameter('wallabag.paypal_url'),
|
||||
]
|
||||
);
|
||||
}
|
||||
@ -42,7 +42,7 @@ class StaticController extends AbstractController
|
||||
public function quickstartAction()
|
||||
{
|
||||
return $this->render(
|
||||
'@WallabagCore/Static/quickstart.html.twig'
|
||||
'Static/quickstart.html.twig'
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Entity\Tag;
|
||||
use App\Form\Type\NewTagType;
|
||||
use App\Form\Type\RenameTagType;
|
||||
use App\Helper\PreparePagerForEntries;
|
||||
use App\Helper\Redirect;
|
||||
use App\Helper\TagsAssigner;
|
||||
use App\Repository\EntryRepository;
|
||||
use App\Repository\TagRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Pagerfanta\Adapter\ArrayAdapter;
|
||||
@ -12,15 +21,6 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Form\Type\NewTagType;
|
||||
use Wallabag\CoreBundle\Form\Type\RenameTagType;
|
||||
use Wallabag\CoreBundle\Helper\PreparePagerForEntries;
|
||||
use Wallabag\CoreBundle\Helper\Redirect;
|
||||
use Wallabag\CoreBundle\Helper\TagsAssigner;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
|
||||
class TagController extends AbstractController
|
||||
{
|
||||
@ -78,7 +78,7 @@ class TagController extends AbstractController
|
||||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Tag/new_form.html.twig', [
|
||||
return $this->render('Tag/new_form.html.twig', [
|
||||
'form' => $form->createView(),
|
||||
'entry' => $entry,
|
||||
]);
|
||||
@ -126,7 +126,7 @@ class TagController extends AbstractController
|
||||
$renameForms[$tag['id']] = $this->createForm(RenameTagType::class, new Tag())->createView();
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Tag/tags.html.twig', [
|
||||
return $this->render('Tag/tags.html.twig', [
|
||||
'tags' => $tags,
|
||||
'renameForms' => $renameForms,
|
||||
'nbEntriesUntagged' => $nbEntriesUntagged,
|
||||
@ -163,7 +163,7 @@ class TagController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('@WallabagCore/Entry/entries.html.twig', [
|
||||
return $this->render('Entry/entries.html.twig', [
|
||||
'form' => null,
|
||||
'entries' => $entries,
|
||||
'currentPage' => $page,
|
||||
@ -1,7 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\User;
|
||||
use App\Form\Type\NewUserType;
|
||||
use App\Form\Type\SearchUserType;
|
||||
use App\Form\Type\UserType;
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Event\UserEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
@ -17,16 +22,11 @@ use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Form\NewUserType;
|
||||
use Wallabag\UserBundle\Form\SearchUserType;
|
||||
use Wallabag\UserBundle\Form\UserType;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
/**
|
||||
* User controller.
|
||||
* @Route("/users")
|
||||
*/
|
||||
class ManageController extends AbstractController
|
||||
class UserController extends AbstractController
|
||||
{
|
||||
private EntityManagerInterface $entityManager;
|
||||
private TranslatorInterface $translator;
|
||||
@ -67,7 +67,7 @@ class ManageController extends AbstractController
|
||||
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/Manage/new.html.twig', [
|
||||
return $this->render('User/new.html.twig', [
|
||||
'user' => $user,
|
||||
'form' => $form->createView(),
|
||||
]);
|
||||
@ -108,7 +108,7 @@ class ManageController extends AbstractController
|
||||
return $this->redirectToRoute('user_edit', ['id' => $user->getId()]);
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/Manage/edit.html.twig', [
|
||||
return $this->render('User/edit.html.twig', [
|
||||
'user' => $user,
|
||||
'edit_form' => $form->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
@ -173,7 +173,7 @@ class ManageController extends AbstractController
|
||||
}
|
||||
}
|
||||
|
||||
return $this->render('@WallabagUser/Manage/index.html.twig', [
|
||||
return $this->render('User/index.html.twig', [
|
||||
'searchForm' => $form->createView(),
|
||||
'users' => $pagerFanta,
|
||||
]);
|
||||
@ -1,7 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\AnnotationBundle\Controller;
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Annotation;
|
||||
use App\Entity\Entry;
|
||||
use App\Form\Type\EditAnnotationType;
|
||||
use App\Form\Type\NewAnnotationType;
|
||||
use App\Repository\AnnotationRepository;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\RestBundle\Controller\AbstractFOSRestController;
|
||||
use JMS\Serializer\SerializerInterface;
|
||||
@ -10,11 +15,6 @@ use Symfony\Component\HttpFoundation\JsonResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
use Wallabag\AnnotationBundle\Form\EditAnnotationType;
|
||||
use Wallabag\AnnotationBundle\Form\NewAnnotationType;
|
||||
use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
class WallabagAnnotationController extends AbstractFOSRestController
|
||||
{
|
||||
@ -32,7 +32,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||
/**
|
||||
* Retrieve annotations for an entry.
|
||||
*
|
||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||
* @see App\Controller\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{entry}.{_format}", methods={"GET"}, name="annotations_get_annotations", defaults={"_format": "json"})
|
||||
*
|
||||
@ -53,7 +53,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||
/**
|
||||
* Creates a new annotation.
|
||||
*
|
||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||
* @see App\Controller\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{entry}.{_format}", methods={"POST"}, name="annotations_post_annotation", defaults={"_format": "json"})
|
||||
*
|
||||
@ -87,7 +87,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||
/**
|
||||
* Updates an annotation.
|
||||
*
|
||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||
* @see App\Controller\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{annotation}.{_format}", methods={"PUT"}, name="annotations_put_annotation", defaults={"_format": "json"})
|
||||
*
|
||||
@ -124,7 +124,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
||||
/**
|
||||
* Removes an annotation.
|
||||
*
|
||||
* @see Wallabag\ApiBundle\Controller\WallabagRestController
|
||||
* @see App\Controller\WallabagRestController
|
||||
*
|
||||
* @Route("/annotations/{annotation}.{_format}", methods={"DELETE"}, name="annotations_delete_annotation", defaults={"_format": "json"})
|
||||
*
|
||||
@ -1,13 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\AnnotationBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Annotation;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
use Wallabag\CoreBundle\DataFixtures\EntryFixtures;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
|
||||
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
17
src/DataFixtures/AppFixtures.php
Normal file
17
src/DataFixtures/AppFixtures.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class AppFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
// $product = new Product();
|
||||
// $manager->persist($product);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Config;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
|
||||
class ConfigFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
|
||||
class EntryFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\IgnoreOriginInstanceRule;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||
|
||||
class IgnoreOriginInstanceRuleFixtures extends Fixture implements ContainerAwareInterface
|
||||
{
|
||||
@ -25,7 +25,7 @@ class IgnoreOriginInstanceRuleFixtures extends Fixture implements ContainerAware
|
||||
*/
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
foreach ($this->container->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) {
|
||||
foreach ($this->container->getParameter('wallabag.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) {
|
||||
$newIgnoreOriginInstanceRule = new IgnoreOriginInstanceRule();
|
||||
$newIgnoreOriginInstanceRule->setRule($ignore_origin_instance_rule['rule']);
|
||||
$manager->persist($newIgnoreOriginInstanceRule);
|
||||
@ -1,12 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\IgnoreOriginUserRule;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginUserRule;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
|
||||
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\InternalSetting;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Entity\InternalSetting;
|
||||
|
||||
class InternalSettingFixtures extends Fixture implements ContainerAwareInterface
|
||||
{
|
||||
@ -25,7 +25,7 @@ class InternalSettingFixtures extends Fixture implements ContainerAwareInterface
|
||||
*/
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) {
|
||||
foreach ($this->container->getParameter('wallabag.default_internal_settings') as $setting) {
|
||||
$newSetting = new InternalSetting();
|
||||
$newSetting->setName($setting['name']);
|
||||
$newSetting->setValue($setting['value']);
|
||||
@ -1,15 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\SiteCredential;
|
||||
use App\Helper\CryptoProxy;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
|
||||
use Symfony\Component\DependencyInjection\ContainerInterface;
|
||||
use Wallabag\CoreBundle\Entity\SiteCredential;
|
||||
use Wallabag\CoreBundle\Helper\CryptoProxy;
|
||||
use Wallabag\UserBundle\DataFixtures\UserFixtures;
|
||||
|
||||
class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
|
||||
{
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Tag;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
|
||||
class TagFixtures extends Fixture
|
||||
{
|
||||
@ -1,11 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\TaggingRule;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\CoreBundle\Entity\TaggingRule;
|
||||
|
||||
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\DataFixtures;
|
||||
namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\User;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class UserFixtures extends Fixture
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\DependencyInjection;
|
||||
namespace App\DependencyInjection;
|
||||
|
||||
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
|
||||
use Symfony\Component\Config\Definition\ConfigurationInterface;
|
||||
@ -9,7 +9,7 @@ class Configuration implements ConfigurationInterface
|
||||
{
|
||||
public function getConfigTreeBuilder()
|
||||
{
|
||||
$treeBuilder = new TreeBuilder('wallabag_core');
|
||||
$treeBuilder = new TreeBuilder('wallabag');
|
||||
$rootNode = $treeBuilder->getRootNode();
|
||||
|
||||
$rootNode
|
||||
@ -72,7 +72,15 @@ class Configuration implements ConfigurationInterface
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
->arrayNode('import')
|
||||
->children()
|
||||
->arrayNode('allow_mimetypes')
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->scalarNode('resource_dir')
|
||||
->end()
|
||||
->end()
|
||||
->end()
|
||||
;
|
||||
|
||||
return $treeBuilder;
|
||||
40
src/DependencyInjection/WallabagExtension.php
Normal file
40
src/DependencyInjection/WallabagExtension.php
Normal file
@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\DependencyInjection;
|
||||
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||
|
||||
class WallabagExtension extends Extension
|
||||
{
|
||||
public function load(array $configs, ContainerBuilder $container)
|
||||
{
|
||||
$configuration = new Configuration();
|
||||
$config = $this->processConfiguration($configuration, $configs);
|
||||
|
||||
$container->setParameter('wallabag.languages', $config['languages']);
|
||||
$container->setParameter('wallabag.items_on_page', $config['items_on_page']);
|
||||
$container->setParameter('wallabag.language', $config['language']);
|
||||
$container->setParameter('wallabag.feed_limit', $config['rss_limit']);
|
||||
$container->setParameter('wallabag.reading_speed', $config['reading_speed']);
|
||||
$container->setParameter('wallabag.version', $config['version']);
|
||||
$container->setParameter('wallabag.paypal_url', $config['paypal_url']);
|
||||
$container->setParameter('wallabag.cache_lifetime', $config['cache_lifetime']);
|
||||
$container->setParameter('wallabag.action_mark_as_read', $config['action_mark_as_read']);
|
||||
$container->setParameter('wallabag.list_mode', $config['list_mode']);
|
||||
$container->setParameter('wallabag.fetching_error_message', $config['fetching_error_message']);
|
||||
$container->setParameter('wallabag.fetching_error_message_title', $config['fetching_error_message_title']);
|
||||
$container->setParameter('wallabag.api_limit_mass_actions', $config['api_limit_mass_actions']);
|
||||
$container->setParameter('wallabag.default_internal_settings', $config['default_internal_settings']);
|
||||
$container->setParameter('wallabag.site_credentials.encryption_key_path', $config['encryption_key_path']);
|
||||
$container->setParameter('wallabag.default_ignore_origin_instance_rules', $config['default_ignore_origin_instance_rules']);
|
||||
|
||||
$container->setParameter('wallabag.import.allow_mimetypes', $config['import']['allow_mimetypes']);
|
||||
$container->setParameter('wallabag.import.resource_dir', $config['import']['resource_dir']);
|
||||
}
|
||||
|
||||
public function getAlias()
|
||||
{
|
||||
return 'wallabag';
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Doctrine;
|
||||
namespace App\Doctrine;
|
||||
|
||||
use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
0
src/Entity/.gitignore
vendored
Normal file
0
src/Entity/.gitignore
vendored
Normal file
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
|
||||
@ -45,7 +45,7 @@ class AccessToken extends BaseAccessToken
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\AnnotationBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Helper\EntityTimestampsTrait;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JMS\Serializer\Annotation\Exclude;
|
||||
use JMS\Serializer\Annotation\ExclusionPolicy;
|
||||
@ -9,15 +10,12 @@ use JMS\Serializer\Annotation\Groups;
|
||||
use JMS\Serializer\Annotation\SerializedName;
|
||||
use JMS\Serializer\Annotation\VirtualProperty;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Annotation.
|
||||
*
|
||||
* @ORM\Table(name="annotation")
|
||||
* @ORM\Entity(repositoryClass="Wallabag\AnnotationBundle\Repository\AnnotationRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\AnnotationRepository")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
* @ExclusionPolicy("none")
|
||||
*/
|
||||
@ -82,14 +80,14 @@ class Annotation
|
||||
/**
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Entry", inversedBy="annotations")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Entry", inversedBy="annotations")
|
||||
* @ORM\JoinColumn(name="entry_id", referencedColumnName="id", onDelete="cascade")
|
||||
*/
|
||||
private $entry;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode;
|
||||
@ -45,7 +45,7 @@ class AuthCode extends BaseAuthCode
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\Client as BaseClient;
|
||||
@ -8,11 +8,10 @@ use JMS\Serializer\Annotation\Groups;
|
||||
use JMS\Serializer\Annotation\SerializedName;
|
||||
use JMS\Serializer\Annotation\VirtualProperty;
|
||||
use OpenApi\Annotations as OA;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* @ORM\Table("oauth2_clients")
|
||||
* @ORM\Entity(repositoryClass="Wallabag\ApiBundle\Repository\ClientRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ClientRepository")
|
||||
*/
|
||||
class Client extends BaseClient
|
||||
{
|
||||
@ -63,7 +62,7 @@ class Client extends BaseClient
|
||||
protected $secret;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="clients")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="clients")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
@ -1,17 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JMS\Serializer\Annotation\Groups;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Config.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\ConfigRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\ConfigRepository")
|
||||
* @ORM\Table(
|
||||
* name="`config`",
|
||||
* indexes={
|
||||
@ -127,18 +126,18 @@ class Config
|
||||
private $displayThumbnails;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="config")
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\User", inversedBy="config")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\TaggingRule", mappedBy="config", cascade={"remove"})
|
||||
* @ORM\OrderBy({"id" = "ASC"})
|
||||
*/
|
||||
private $taggingRules;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
|
||||
* @ORM\OrderBy({"id" = "ASC"})
|
||||
*/
|
||||
private $ignoreOriginRules;
|
||||
@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Helper\EntityTimestampsTrait;
|
||||
use App\Helper\UrlHasher;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Hateoas\Configuration\Annotation as Hateoas;
|
||||
@ -11,16 +13,12 @@ use JMS\Serializer\Annotation\SerializedName;
|
||||
use JMS\Serializer\Annotation\VirtualProperty;
|
||||
use JMS\Serializer\Annotation\XmlRoot;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
|
||||
use Wallabag\CoreBundle\Helper\UrlHasher;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Entry.
|
||||
*
|
||||
* @XmlRoot("entry")
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\EntryRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\EntryRepository")
|
||||
* @ORM\Table(
|
||||
* name="`entry`",
|
||||
* options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"},
|
||||
@ -206,7 +204,7 @@ class Entry
|
||||
private $starredAt = null;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
|
||||
* @ORM\JoinTable
|
||||
*
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
@ -279,7 +277,7 @@ class Entry
|
||||
/**
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="entries")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="entries")
|
||||
*
|
||||
* @Groups({"export_all"})
|
||||
*/
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
|
||||
@ -9,7 +9,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
/**
|
||||
* Ignore Origin rule.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginInstanceRuleRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\IgnoreOriginInstanceRuleRepository")
|
||||
* @ORM\Table(name="`ignore_origin_instance_rule`")
|
||||
*/
|
||||
class IgnoreOriginInstanceRule implements IgnoreOriginRuleInterface, RuleInterface
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
interface IgnoreOriginRuleInterface
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\RulerZ\Validator\Constraints as RulerZAssert;
|
||||
@ -9,7 +9,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
/**
|
||||
* Ignore Origin rule.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\IgnoreOriginUserRuleRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\IgnoreOriginUserRuleRepository")
|
||||
* @ORM\Table(name="`ignore_origin_user_rule`")
|
||||
*/
|
||||
class IgnoreOriginUserRule implements IgnoreOriginRuleInterface, RuleInterface
|
||||
@ -37,7 +37,7 @@ class IgnoreOriginUserRule implements IgnoreOriginRuleInterface, RuleInterface
|
||||
private $rule;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="ignoreOriginRules")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Config", inversedBy="ignoreOriginRules")
|
||||
*/
|
||||
private $config;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Craue\ConfigBundle\Entity\BaseSetting;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken;
|
||||
@ -45,7 +45,7 @@ class RefreshToken extends BaseRefreshToken
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
7
src/Entity/RuleInterface.php
Normal file
7
src/Entity/RuleInterface.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
interface RuleInterface
|
||||
{
|
||||
}
|
||||
@ -1,16 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Helper\EntityTimestampsTrait;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Validator\Constraints as Assert;
|
||||
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* SiteCredential.
|
||||
*
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\SiteCredentialRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\SiteCredentialRepository")
|
||||
* @ORM\Table(name="`site_credential`")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
*/
|
||||
@ -67,7 +66,7 @@ class SiteCredential
|
||||
private $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User", inversedBy="siteCredentials")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="siteCredentials")
|
||||
*/
|
||||
private $user;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -20,7 +20,7 @@ use JMS\Serializer\Annotation\XmlRoot;
|
||||
* @ORM\Index(name="tag_label", columns={"label"}, options={"lengths"={255}}),
|
||||
* }
|
||||
* )
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TagRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TagRepository")
|
||||
* @ExclusionPolicy("all")
|
||||
*/
|
||||
class Tag
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use JMS\Serializer\Annotation\Exclude;
|
||||
@ -13,7 +13,7 @@ use Symfony\Component\Validator\Constraints as Assert;
|
||||
* Tagging rule.
|
||||
*
|
||||
* @XmlRoot("tagging_rule")
|
||||
* @ORM\Entity(repositoryClass="Wallabag\CoreBundle\Repository\TaggingRuleRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\TaggingRuleRepository")
|
||||
* @ORM\Table(name="`tagging_rule`")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
@ -56,7 +56,7 @@ class TaggingRule implements RuleInterface
|
||||
/**
|
||||
* @Exclude
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", inversedBy="taggingRules")
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\Config", inversedBy="taggingRules")
|
||||
*/
|
||||
private $config;
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\Entity;
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Helper\EntityTimestampsTrait;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\UserBundle\Model\User as BaseUser;
|
||||
@ -14,16 +15,12 @@ use Scheb\TwoFactorBundle\Model\BackupCodeInterface;
|
||||
use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface as EmailTwoFactorInterface;
|
||||
use Scheb\TwoFactorBundle\Model\Google\TwoFactorInterface as GoogleTwoFactorInterface;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Helper\EntityTimestampsTrait;
|
||||
|
||||
/**
|
||||
* User.
|
||||
*
|
||||
* @XmlRoot("user")
|
||||
* @ORM\Entity(repositoryClass="Wallabag\UserBundle\Repository\UserRepository")
|
||||
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
|
||||
* @ORM\Table(name="`user`")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
*
|
||||
@ -124,26 +121,26 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
|
||||
protected $updatedAt;
|
||||
|
||||
/**
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\Entry", mappedBy="user", cascade={"remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Entry", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $entries;
|
||||
|
||||
/**
|
||||
* @ORM\OneToOne(targetEntity="Wallabag\CoreBundle\Entity\Config", mappedBy="user", cascade={"remove"})
|
||||
* @ORM\OneToOne(targetEntity="App\Entity\Config", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\SiteCredential", mappedBy="user", cascade={"remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\SiteCredential", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $siteCredentials;
|
||||
|
||||
/**
|
||||
* @var ArrayCollection
|
||||
*
|
||||
* @ORM\OneToMany(targetEntity="Wallabag\ApiBundle\Entity\Client", mappedBy="user", cascade={"remove"})
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\Client", mappedBy="user", cascade={"remove"})
|
||||
*/
|
||||
protected $clients;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event;
|
||||
namespace App\Event;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
/**
|
||||
* This event is fired as soon as an entry is deleted.
|
||||
@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event;
|
||||
namespace App\Event;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use Symfony\Contracts\EventDispatcher\Event;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
/**
|
||||
* This event is fired as soon as an entry was saved.
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Listener;
|
||||
namespace App\Event\Listener;
|
||||
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||
@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Listener;
|
||||
namespace App\Event\Listener;
|
||||
|
||||
use App\Entity\User;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Stores the locale of the user in the session after the login.
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
||||
namespace App\Event\Subscriber;
|
||||
|
||||
use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
|
||||
use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
||||
namespace App\Event\Subscriber;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use App\Event\EntryDeletedEvent;
|
||||
use App\Event\EntrySavedEvent;
|
||||
use App\Helper\DownloadImages;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
use Wallabag\CoreBundle\Event\EntryDeletedEvent;
|
||||
use Wallabag\CoreBundle\Event\EntrySavedEvent;
|
||||
use Wallabag\CoreBundle\Helper\DownloadImages;
|
||||
|
||||
class DownloadImagesSubscriber implements EventSubscriberInterface
|
||||
{
|
||||
@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
||||
namespace App\Event\Subscriber;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
use Doctrine\DBAL\Platforms\SqlitePlatform;
|
||||
use Doctrine\ORM\Event\LifecycleEventArgs;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
/**
|
||||
* SQLite doesn't care about cascading remove, so we need to manually remove associated stuf for an Entry.
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Event\Subscriber;
|
||||
namespace App\Event\Subscriber;
|
||||
|
||||
use Doctrine\Common\EventSubscriber;
|
||||
use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\EventListener;
|
||||
namespace App\EventListener;
|
||||
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\EventListener;
|
||||
namespace App\EventListener;
|
||||
|
||||
use App\Entity\Config;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Event\UserEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
|
||||
/**
|
||||
* This listener will create the associated configuration when a user register.
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\EventListener;
|
||||
namespace App\EventListener;
|
||||
|
||||
use FOS\UserBundle\Event\FormEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\UserBundle\EventListener;
|
||||
namespace App\EventListener;
|
||||
|
||||
use FOS\UserBundle\Event\GetResponseUserEvent;
|
||||
use FOS\UserBundle\FOSUserEvents;
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\DataTransformer;
|
||||
namespace App\Form\DataTransformer;
|
||||
|
||||
use Symfony\Component\Form\DataTransformerInterface;
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
namespace App\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\ApiBundle\Form\Type;
|
||||
namespace App\Form\Type;
|
||||
|
||||
use App\Entity\Client;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\CallbackTransformer;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
@ -9,7 +10,6 @@ use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
|
||||
class ClientType extends AbstractType
|
||||
{
|
||||
@ -1,7 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
namespace App\Form\Type;
|
||||
|
||||
use App\Entity\Config;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
@ -9,7 +10,6 @@ use Symfony\Component\Form\Extension\Core\Type\IntegerType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
|
||||
class ConfigType extends AbstractType
|
||||
{
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\AnnotationBundle\Form;
|
||||
namespace App\Form\Type;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Wallabag\CoreBundle\Form\Type;
|
||||
namespace App\Form\Type;
|
||||
|
||||
use App\Entity\Entry;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\TextType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\UrlType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Wallabag\CoreBundle\Entity\Entry;
|
||||
|
||||
class EditEntryType extends AbstractType
|
||||
{
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user