allow creating directories with new file names
authorChristian Weiske <cweiske@cweiske.de>
Wed, 13 Nov 2013 20:18:28 +0000 (21:18 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Wed, 13 Nov 2013 20:18:28 +0000 (21:18 +0100)
src/phorkie/Repository/Post.php

index 226c2d8..39798b5 100644 (file)
@@ -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())