optional warehouse split levels

This commit is contained in:
Shish
2011-12-25 11:24:20 +00:00
parent 2f9979c790
commit cd609141f4
2 changed files with 7 additions and 1 deletions

View File

@@ -504,7 +504,12 @@ function format_text($string) {
function warehouse_path($base, $hash, $create=true) {
$ab = substr($hash, 0, 2);
$cd = substr($hash, 2, 2);
$pa = "$base/$ab/$hash";
if(WH_SPLITS == 2) {
$pa = "$base/$ab/$cd/$hash";
}
else {
$pa = "$base/$ab/$hash";
}
if($create && !file_exists(dirname($pa))) mkdir(dirname($pa), 0755, true);
return $pa;
}