aboutsummaryrefslogtreecommitdiff
path: root/src/phorkie/Repository/Post.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2013-11-13 21:18:28 +0100
committerChristian Weiske <cweiske@cweiske.de>2013-11-13 21:18:28 +0100
commit7b549853080c5768d4da0b086d9b56b4b9d634c5 (patch)
treeec536ea17605e0f0310ad83f48f75c4c62251ace /src/phorkie/Repository/Post.php
parent8386e21f6a85749e637e5ffc175616641de92291 (diff)
downloadphorkie-7b549853080c5768d4da0b086d9b56b4b9d634c5.tar.gz
phorkie-7b549853080c5768d4da0b086d9b56b4b9d634c5.zip
allow creating directories with new file names
Diffstat (limited to 'src/phorkie/Repository/Post.php')
-rw-r--r--src/phorkie/Repository/Post.php4
1 files changed, 4 insertions, 0 deletions
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())