Remove unused argument on databox::dispatch method

This commit is contained in:
Benoît Burnichon
2016-01-21 15:20:52 +01:00
parent f2942dac89
commit 985b603cf3

View File

@@ -230,24 +230,21 @@ class databox extends base implements ThumbnailedElement
return $databox; return $databox;
} }
public static function dispatch(Filesystem $filesystem, $repository_path, $date = false) public static function dispatch(Filesystem $filesystem, $repository_path)
{ {
if (! $date) {
$date = date('Y-m-d H:i:s');
}
$repository_path = p4string::addEndSlash($repository_path); $repository_path = p4string::addEndSlash($repository_path);
$year = date('Y', strtotime($date)); $timestamp = strtotime(date('Y-m-d'));
$month = date('m', strtotime($date)); $year = date('Y', $timestamp);
$day = date('d', strtotime($date)); $month = date('m', $timestamp);
$day = date('d', $timestamp);
$n = 0;
$comp = $year . DIRECTORY_SEPARATOR . $month . DIRECTORY_SEPARATOR . $day . DIRECTORY_SEPARATOR; $comp = $year . DIRECTORY_SEPARATOR . $month . DIRECTORY_SEPARATOR . $day . DIRECTORY_SEPARATOR;
while (($pathout = $repository_path . $comp . self::addZeros($n)) && is_dir($pathout) && iterator_count(new \DirectoryIterator($pathout)) > 100) { $n = 0;
$n ++; do {
} $pathout = sprintf('%s%s%05d', $repository_path, $comp, $n++);
} while (is_dir($pathout) && iterator_count(new DirectoryIterator($pathout)) > 100);
$filesystem->mkdir($pathout, 0750); $filesystem->mkdir($pathout, 0750);
@@ -337,10 +334,6 @@ class databox extends base implements ThumbnailedElement
self::$_xpath_thesaurus = self::$_dom_thesaurus = self::$_thesaurus = self::$_sxml_thesaurus = []; self::$_xpath_thesaurus = self::$_dom_thesaurus = self::$_thesaurus = self::$_sxml_thesaurus = [];
} }
private static function addZeros($n, $length = 5)
{
return str_pad($n, $length, '0');
}
/** @var int */ /** @var int */
protected $id; protected $id;
/** @var string */ /** @var string */