From fa91fc11e1620ad03590d3a0334593f5e5453453 Mon Sep 17 00:00:00 2001 From: hide_d Date: Fri, 15 Jun 2018 00:38:05 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EA=B2=BD=EB=A1=9C=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hook/hook.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/hook/hook.php b/hook/hook.php index fa8eca5..331f4df 100644 --- a/hook/hook.php +++ b/hook/hook.php @@ -23,7 +23,14 @@ foreach ($raw_img_list as $path) { continue; } $path = substr($path, $pos + 9); - $img_list[] = $path; + + $dpath = dirname($path); + $filename = basename($path); + + if(!\key_exists($dpath, $img_list)){ + $img_list[$dpath] = []; + } + $img_list[$dpath][] = $filename; } -file_put_contents('list.json', json_encode($img_list, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); \ No newline at end of file +file_put_contents('list.json', json_encode($img_list, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); \ No newline at end of file