Skip to content
This repository was archived by the owner on Aug 22, 2021. It is now read-only.

Commit 2a495f5

Browse files
committed
Cleanup.
1 parent f637eac commit 2a495f5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/StorageManager.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,9 @@ protected function error($message)
224224
*/
225225
protected function formatPath($path, $filename)
226226
{
227-
$time = time();
228-
$partials = explode('-', date('Y-y-m-d-H-i-s'));
229-
$replacement = ['{yyyy}', '{yy}', '{mm}', '{dd}', '{hh}', '{ii}', '{ss}', '{filename}', '{time}'];
230-
$path = str_replace($replacement, array_merge($partials, [$filename, $time]), $path);
227+
$replacement = array_merge(explode('-', date('Y-y-m-d-H-i-s')), [$filename, time()]);
228+
$placeholders = ['{yyyy}', '{yy}', '{mm}', '{dd}', '{hh}', '{ii}', '{ss}', '{filename}', '{time}'];
229+
$path = str_replace($placeholders, $replacement, $path);
231230

232231
//替换随机字符串
233232
if (preg_match('/\{rand\:([\d]*)\}/i', $path, $matches)) {

0 commit comments

Comments
 (0)