This commit is contained in:
Jeremy Benoist 2016-11-03 18:01:25 +01:00
parent 864c1dd23a
commit 001cc7168a
No known key found for this signature in database
GPG key ID: BCA73962457ACC3C
7 changed files with 6 additions and 29 deletions

View file

@ -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.
* *

View file

@ -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
{ {

View file

@ -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()

View file

@ -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'])) {

View file

@ -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');
} }

View file

@ -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'));

View file

@ -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)