move warehouse directory creation into a single place
This commit is contained in:
@ -485,9 +485,11 @@ function format_text($string) {
|
||||
return $tfe->formatted;
|
||||
}
|
||||
|
||||
function warehouse_path($base, $hash) {
|
||||
function warehouse_path($base, $hash, $create=true) {
|
||||
$ab = substr($hash, 0, 2);
|
||||
return "$base/$ab/$hash";
|
||||
$pa = "$base/$ab/$hash";
|
||||
if($create && !file_exists(dirname($pa))) mkdir(dirname($pa), 0755, true);
|
||||
return $pa;
|
||||
}
|
||||
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\
|
||||
|
Reference in New Issue
Block a user