mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-25 00:50:29 +00:00
Cleanup
This commit is contained in:
parent
864c1dd23a
commit
001cc7168a
7 changed files with 6 additions and 29 deletions
|
@ -131,22 +131,6 @@ class TagRestController extends WallabagRestController
|
||||||
return (new JsonResponse())->setJson($json);
|
return (new JsonResponse())->setJson($json);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve version number.
|
|
||||||
*
|
|
||||||
* @ApiDoc()
|
|
||||||
*
|
|
||||||
* @return JsonResponse
|
|
||||||
*/
|
|
||||||
public function getVersionAction()
|
|
||||||
{
|
|
||||||
$version = $this->container->getParameter('wallabag_core.version');
|
|
||||||
|
|
||||||
$json = $this->get('serializer')->serialize($version, 'json');
|
|
||||||
|
|
||||||
return (new JsonResponse())->setJson($json);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove orphan tag in case no entries are associated to it.
|
* Remove orphan tag in case no entries are associated to it.
|
||||||
*
|
*
|
||||||
|
|
|
@ -3,10 +3,9 @@
|
||||||
namespace Wallabag\ApiBundle\Controller;
|
namespace Wallabag\ApiBundle\Controller;
|
||||||
|
|
||||||
use FOS\RestBundle\Controller\FOSRestController;
|
use FOS\RestBundle\Controller\FOSRestController;
|
||||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
|
||||||
use Wallabag\CoreBundle\Entity\Entry;
|
|
||||||
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
|
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
|
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||||
|
|
||||||
class WallabagRestController extends FOSRestController
|
class WallabagRestController extends FOSRestController
|
||||||
{
|
{
|
||||||
|
|
|
@ -234,8 +234,6 @@ class ConfigController extends Controller
|
||||||
*/
|
*/
|
||||||
public function resetAction($type)
|
public function resetAction($type)
|
||||||
{
|
{
|
||||||
$em = $this->getDoctrine()->getManager();
|
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'annotations':
|
case 'annotations':
|
||||||
$this->getDoctrine()
|
$this->getDoctrine()
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TablePrefixSubscriber implements EventSubscriber
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$classMetadata->setTableName($this->prefix.$classMetadata->getTableName());
|
$classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);
|
||||||
|
|
||||||
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
|
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
|
||||||
if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
|
if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
|
||||||
|
|
|
@ -135,16 +135,16 @@ class DownloadImages
|
||||||
|
|
||||||
switch ($ext) {
|
switch ($ext) {
|
||||||
case 'gif':
|
case 'gif':
|
||||||
$result = imagegif($im, $localPath);
|
imagegif($im, $localPath);
|
||||||
$this->logger->debug('DownloadImages: Re-creating gif');
|
$this->logger->debug('DownloadImages: Re-creating gif');
|
||||||
break;
|
break;
|
||||||
case 'jpeg':
|
case 'jpeg':
|
||||||
case 'jpg':
|
case 'jpg':
|
||||||
$result = imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
|
imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
|
||||||
$this->logger->debug('DownloadImages: Re-creating jpg');
|
$this->logger->debug('DownloadImages: Re-creating jpg');
|
||||||
break;
|
break;
|
||||||
case 'png':
|
case 'png':
|
||||||
$result = imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
|
imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
|
||||||
$this->logger->debug('DownloadImages: Re-creating png');
|
$this->logger->debug('DownloadImages: Re-creating png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,13 +56,8 @@ class ImportCommand extends ContainerAwareCommand
|
||||||
case 'instapaper':
|
case 'instapaper':
|
||||||
$import = $this->getContainer()->get('wallabag_import.instapaper.import');
|
$import = $this->getContainer()->get('wallabag_import.instapaper.import');
|
||||||
break;
|
break;
|
||||||
case 'instapaper':
|
|
||||||
$wallabag = $this->getContainer()->get('wallabag_import.instapaper.import');
|
|
||||||
break;
|
|
||||||
case 'v1':
|
|
||||||
default:
|
default:
|
||||||
$import = $this->getContainer()->get('wallabag_import.wallabag_v1.import');
|
$import = $this->getContainer()->get('wallabag_import.wallabag_v1.import');
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$import->setMarkAsRead($input->getOption('markAsRead'));
|
$import->setMarkAsRead($input->getOption('markAsRead'));
|
||||||
|
|
|
@ -17,6 +17,7 @@ abstract class AbstractConsumer
|
||||||
protected $em;
|
protected $em;
|
||||||
protected $userRepository;
|
protected $userRepository;
|
||||||
protected $import;
|
protected $import;
|
||||||
|
protected $eventDispatcher;
|
||||||
protected $logger;
|
protected $logger;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)
|
public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)
|
||||||
|
|
Loading…
Reference in a new issue