From f84939dc0ef6d5f4e19d533b5037b39141dcaa06 Mon Sep 17 00:00:00 2001 From: Samuel kelemen Date: Mon, 18 Nov 2019 22:33:21 +0100 Subject: [PATCH] Create directory for touch file in case directory not exists --- src/Bridges/ApplicationDI/PresenterFactoryCallback.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Bridges/ApplicationDI/PresenterFactoryCallback.php b/src/Bridges/ApplicationDI/PresenterFactoryCallback.php index c02fa4574..abea2c5a9 100644 --- a/src/Bridges/ApplicationDI/PresenterFactoryCallback.php +++ b/src/Bridges/ApplicationDI/PresenterFactoryCallback.php @@ -44,6 +44,10 @@ public function __invoke(string $class): Nette\Application\IPresenter } elseif (!$services) { if ($this->touchToRefresh) { + $dir = pathinfo($this->touchToRefresh, PATHINFO_DIRNAME); + if (!file_exists($dir)) { + mkdir($dir, 0777, true); + } touch($this->touchToRefresh); }