$actions = [];
foreach ($paths as $path) {
$spl = new \SplFileInfo($path);
- $actions[$spl->getFilename()] = backpack_url('/file/' . File::hash($path) . '/' . $spl->getFilename());
+ $actions[$spl->getFilename()] = backpack_url('/file/' . File::hash($path, $spl->getSize()) . '/' . $spl->getFilename());
}
Slack::send($destChannel, $subject, '', $actions);
Alert::success(__(':nb fichiers chargés', ['nb' => '<b>' . $j . '</b>']))->flash();
protected $_enableClone = false;
protected $_enableCreation = false;
+ protected $_enableRevisions = false;
+
protected $primaryKey = 'hash';
public $incrementing = false;
protected $keyType = 'string';
$date = new \DateTime();
$date->setTimestamp($mtime);
- $hash = self::hash($pathname);
+ $size = $file->getSize();
+ $hash = self::hash($pathname, $size);
$res[$hash] = [
'path' => $pathname,
'ext' => mb_strtolower($file->getExtension()),
'created_at' => $date,
'updated_at' => $date,
- 'size' => $file->getSize(),
+ 'size' => $size,
'from' => $from,
'to' => $to,
'owner' => $id,
return $dest;
}
- public static function hash($pathname)
+ public static function hash($pathname, $size)
{
- return sha1('!!//' . trim(str_replace(self::$basePath, '', $pathname), '/') . '||--');
+ return sha1('!!//' . trim(str_replace(self::$basePath, '', $pathname), '/') . '||--' . $size . '-**');
}
public function showPrimaryColumn()