X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/d2dbd0d543a8915ab8553a6565a2227894aa3d7e..0e362c3a8a13e7e2ae7d5c1a5d2e5eaa163d153f:/src/phorkie/Repository/Post.php diff --git a/src/phorkie/Repository/Post.php b/src/phorkie/Repository/Post.php index 226c2d8..c9f6a53 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()) @@ -224,7 +228,7 @@ class Repository_Post return $prefix . $num; } - protected function getType($content) + public function getType($content) { $tmp = tempnam(sys_get_temp_dir(), 'phorkie-autodetect-'); file_put_contents($tmp, $content);