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.
*
namespace Wallabag\ApiBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
-use Symfony\Component\Security\Core\Exception\AccessDeniedException;
-use Wallabag\CoreBundle\Entity\Entry;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\JsonResponse;
+use Symfony\Component\Security\Core\Exception\AccessDeniedException;
class WallabagRestController extends FOSRestController
{
*/
public function resetAction($type)
{
- $em = $this->getDoctrine()->getManager();
-
switch ($type) {
case 'annotations':
$this->getDoctrine()
return;
}
- $classMetadata->setTableName($this->prefix.$classMetadata->getTableName());
+ $classMetadata->setPrimaryTable(['name' => $this->prefix.$classMetadata->getTableName()]);
foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) {
if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) {
switch ($ext) {
case 'gif':
- $result = imagegif($im, $localPath);
+ imagegif($im, $localPath);
$this->logger->debug('DownloadImages: Re-creating gif');
break;
case 'jpeg':
case 'jpg':
- $result = imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
+ imagejpeg($im, $localPath, self::REGENERATE_PICTURES_QUALITY);
$this->logger->debug('DownloadImages: Re-creating jpg');
break;
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');
}
case 'instapaper':
$import = $this->getContainer()->get('wallabag_import.instapaper.import');
break;
- case 'instapaper':
- $wallabag = $this->getContainer()->get('wallabag_import.instapaper.import');
- break;
- case 'v1':
default:
$import = $this->getContainer()->get('wallabag_import.wallabag_v1.import');
- break;
}
$import->setMarkAsRead($input->getOption('markAsRead'));
protected $em;
protected $userRepository;
protected $import;
+ protected $eventDispatcher;
protected $logger;
public function __construct(EntityManager $em, UserRepository $userRepository, AbstractImport $import, EventDispatcherInterface $eventDispatcher, LoggerInterface $logger = null)