From 04d8f7614e5e06b47917cc1149ee0fa5e5486a1c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 15 Jul 2021 15:31:19 -0700 Subject: [PATCH] Make sure things are working (#9) --- src/Controller/WordpressController.php | 4 +--- src/Resources/config/controller.yaml | 3 ++- src/Service/LocalImageUploader.php | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/Controller/WordpressController.php b/src/Controller/WordpressController.php index abe9864..e70f668 100644 --- a/src/Controller/WordpressController.php +++ b/src/Controller/WordpressController.php @@ -19,14 +19,12 @@ final class WordpressController extends AbstractController private $wordpress; private $indexTemplate; private $pageTemplate; - private $allowInvalidate; - public function __construct(Wordpress $wordpress, string $indexTemplate, string $pageTemplate, bool $allowInvalidate) + public function __construct(Wordpress $wordpress, string $indexTemplate, string $pageTemplate) { $this->wordpress = $wordpress; $this->indexTemplate = $indexTemplate; $this->pageTemplate = $pageTemplate; - $this->allowInvalidate = $allowInvalidate; } public function index() diff --git a/src/Resources/config/controller.yaml b/src/Resources/config/controller.yaml index 8651e2b..b52a2aa 100644 --- a/src/Resources/config/controller.yaml +++ b/src/Resources/config/controller.yaml @@ -1,4 +1,5 @@ services: Happyr\WordpressBundle\Controller\WordpressController: + autowire: true + autoconfigure: true arguments: ['@Happyr\WordpressBundle\Service\Wordpress', ~, ~, ~] - tags: ['controller.service_arguments'] diff --git a/src/Service/LocalImageUploader.php b/src/Service/LocalImageUploader.php index f26628b..6820b07 100644 --- a/src/Service/LocalImageUploader.php +++ b/src/Service/LocalImageUploader.php @@ -42,7 +42,7 @@ public function uploadImage(string $url): string // Check if file already exists if (!\file_exists($path)) { // Save the file - \mkdir(dirname($path)); + @\mkdir(\dirname($path)); \file_put_contents($path, $file); }