From 7b549853080c5768d4da0b086d9b56b4b9d634c5 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Wed, 13 Nov 2013 21:18:28 +0100 Subject: [PATCH] allow creating directories with new file names --- src/phorkie/Repository/Post.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 226c2d8..39798b5 100644 --- a/src/phorkie/Repository/Post.php +++ b/src/phorkie/Repository/Post.php @@ -116,6 +116,10 @@ class Repository_Post && $file->getContent() != $arFile['content'] ) ) { + $dir = dirname($file->getFullPath()); + if (!is_dir($dir)) { + mkdir($dir, 0777, true); + } file_put_contents($file->getFullPath(), $arFile['content']); $command = $vc->getCommand('add') ->addArgument($file->getFilename()) -- 2.30.2