aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/ApiBundle/Controller/TagRestController.php16
-rw-r--r--src/Wallabag/ApiBundle/Controller/WallabagRestController.php3
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php2
-rw-r--r--src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php2
-rw-r--r--src/Wallabag/CoreBundle/Helper/DownloadImages.php6
-rw-r--r--src/Wallabag/ImportBundle/Command/ImportCommand.php5
-rw-r--r--src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php1
7 files changed, 6 insertions, 29 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php
index 4e7ddc66..bc6d4e64 100644
--- a/src/Wallabag/ApiBundle/Controller/TagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php
@@ -132,22 +132,6 @@ class TagRestController extends WallabagRestController
132 } 132 }
133 133
134 /** 134 /**
135 * Retrieve version number.
136 *
137 * @ApiDoc()
138 *
139 * @return JsonResponse
140 */
141 public function getVersionAction()
142 {
143 $version = $this->container->getParameter('wallabag_core.version');
144
145 $json = $this->get('serializer')->serialize($version, 'json');
146
147 return (new JsonResponse())->setJson($json);
148 }
149
150 /**
151 * Remove orphan tag in case no entries are associated to it. 135 * Remove orphan tag in case no entries are associated to it.
152 * 136 *
153 * @param Tag|array $tags 137 * @param Tag|array $tags
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
index 1ff593f5..b1e08ca4 100644
--- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php
@@ -3,10 +3,9 @@
3namespace Wallabag\ApiBundle\Controller; 3namespace Wallabag\ApiBundle\Controller;
4 4
5use FOS\RestBundle\Controller\FOSRestController; 5use FOS\RestBundle\Controller\FOSRestController;
6use Symfony\Component\Security\Core\Exception\AccessDeniedException;
7use Wallabag\CoreBundle\Entity\Entry;
8use Nelmio\ApiDocBundle\Annotation\ApiDoc; 6use Nelmio\ApiDocBundle\Annotation\ApiDoc;
9use Symfony\Component\HttpFoundation\JsonResponse; 7use Symfony\Component\HttpFoundation\JsonResponse;
8use Symfony\Component\Security\Core\Exception\AccessDeniedException;
10 9
11class WallabagRestController extends FOSRestController 10class WallabagRestController extends FOSRestController
12{ 11{
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index d40efcd7..fe817711 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -234,8 +234,6 @@ class ConfigController extends Controller
234 */ 234 */
235 public function resetAction($type) 235 public function resetAction($type)
236 { 236 {
237 $em = $this->getDoctrine()->getManager();
238
239 switch ($type) { 237 switch ($type) {
240 case 'annotations': 238 case 'annotations':
241 $this->getDoctrine() 239 $this->getDoctrine()
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
index 9013328f..711c3bf8 100644
--- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
+++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php
@@ -39,7 +39,7 @@ class TablePrefixSubscriber implements EventSubscriber
39 return; 39 return;
40 } 40 }
41 41
42 $classMetadata->setTableName($this->prefix.$classMetadata->getTableName()); 42 $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);
43 43
44 foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { 44 foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
45 if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { 45 if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
index c5298236..264bc6a3 100644
--- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php
+++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php
@@ -135,16 +135,16 @@ class DownloadImages
135 135
136 switch ($ext) { 136 switch ($ext) {
137 case 'gif': 137 case 'gif':
138 $result = imagegif($im, $localPath); 138 imagegif($im, $localPath);
139 $this->logger->debug('DownloadImages: Re-creating gif'); 139 $this->logger->debug('DownloadImages: Re-creating gif');
140 break; 140 break;
141 case 'jpeg': 141 case 'jpeg':
142 case 'jpg': 142 case 'jpg':
143 $result = imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY); 143 imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
144 $this->logger->debug('DownloadImages: Re-creating jpg'); 144 $this->logger->debug('DownloadImages: Re-creating jpg');
145 break; 145 break;
146 case 'png': 146 case 'png':
147 $result = imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9)); 147 imagepng($im, $localPath, ceil(self::REGENERATE_PICTURES_QUALITY / 100 * 9));
148 $this->logger->debug('DownloadImages: Re-creating png'); 148 $this->logger->debug('DownloadImages: Re-creating png');
149 } 149 }
150 150
diff --git a/src/Wallabag/ImportBundle/Command/ImportCommand.php b/src/Wallabag/ImportBundle/Command/ImportCommand.php
index 13f3dcb9..e423ffae 100644
--- a/src/Wallabag/ImportBundle/Command/ImportCommand.php
+++ b/src/Wallabag/ImportBundle/Command/ImportCommand.php
@@ -56,13 +56,8 @@ class ImportCommand extends ContainerAwareCommand
56 case 'instapaper': 56 case 'instapaper':
57 $import = $this->getContainer()->get('wallabag_import.instapaper.import'); 57 $import = $this->getContainer()->get('wallabag_import.instapaper.import');
58 break; 58 break;
59 case 'instapaper':
60 $wallabag = $this->getContainer()->get('wallabag_import.instapaper.import');
61 break;
62 case 'v1':
63 default: 59 default:
64 $import = $this->getContainer()->get('wallabag_import.wallabag_v1.import'); 60 $import = $this->getContainer()->get('wallabag_import.wallabag_v1.import');
65 break;
66 } 61 }
67 62
68 $import->setMarkAsRead($input->getOption('markAsRead')); 63 $import->setMarkAsRead($input->getOption('markAsRead'));
diff --git a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php
index aa7ff914..fc175f67 100644
--- a/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php
+++ b/src/Wallabag/ImportBundle/Consumer/AbstractConsumer.php
@@ -17,6 +17,7 @@ abstract class AbstractConsumer
17 protected $em; 17 protected $em;
18 protected $userRepository; 18 protected $userRepository;
19 protected $import; 19 protected $import;
20 protected $eventDispatcher;
20 protected $logger; 21 protected $logger;
21 22
22 public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null) 23 public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)