use autoloader on geshi before including it manually
[phorkie.git] / src / phorkie / Repository / Post.php
index 226c2d8f65d7a1133fbfdf0df032822c8b9169a1..c9f6a537ae1016698770382f25cd038f03db445e 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())
@@ -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);