preparations for dynamic data directories

This commit is contained in:
Chris
2023-11-02 23:20:05 +01:00
parent 3fe84a63a4
commit 2388f68d5d
17 changed files with 93 additions and 55 deletions

View File

@@ -9,7 +9,7 @@ class TextController implements ContentController
public function handleHash($hash,$url)
{
$path = ROOT.DS.'data'.DS.$hash.DS.$hash;
$path = getDataDir().DS.$hash.DS.$hash;
if(in_array('raw',$url))
{
@@ -50,11 +50,11 @@ class TextController implements ContentController
storeFile($tmpfile,$hash,true);
return array('status'=>'ok','hash'=>$hash,'url'=>URL.$hash);
return array('status'=>'ok','hash'=>$hash,'url'=>getURL().$hash);
}
function getTypeOfText($hash)
{
return file_get_contents(ROOT.DS.'data'.DS.$hash.DS.'type');
return file_get_contents(getDataDir().DS.$hash.DS.'type');
}
}