diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2013-11-13 21:18:28 +0100 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2013-11-13 21:18:28 +0100 |
| commit | 7b549853080c5768d4da0b086d9b56b4b9d634c5 (patch) | |
| tree | ec536ea17605e0f0310ad83f48f75c4c62251ace /src/phorkie/Repository/Post.php | |
| parent | 8386e21f6a85749e637e5ffc175616641de92291 (diff) | |
| download | phorkie-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.php | 4 |
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()) |
