From 686b7e65b604a02575fd80ce9b3839d259e0d6cf Mon Sep 17 00:00:00 2001 From: hakasenyang Date: Sat, 7 Jan 2017 08:35:49 +0900 Subject: [PATCH] =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 오류 수정 --- _function.php | 4 ++-- mangalist.php | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/_function.php b/_function.php index 59e57ab..f668983 100644 --- a/_function.php +++ b/_function.php @@ -30,9 +30,9 @@ } $data = curl_exec($ch); - curl_close($ch); - if ($curl_errno > 0) + if (curl_errno($ch)) $this->ErrorEcho(14, 'Connect Error!!!'); + curl_close($ch); return ($data) ? $data : false; } public function FileRead($filename=NULL) diff --git a/mangalist.php b/mangalist.php index bd0a4fc..17629dc 100644 --- a/mangalist.php +++ b/mangalist.php @@ -2,7 +2,7 @@ include_once '_function.php'; $marumaru = new Marumaru(); $file = $marumaru->FileRead('mangalist.txt'); - if(!$file || explode(PHP_EOL, $file)[0] < time()) + if(!isset($file) || @explode(PHP_EOL, $file)[0] < time()) { $data = $marumaru->WEBParsing('http://marumaru.in/c/1'); $a = explode('" href="/b/manga/', $data); @@ -14,7 +14,10 @@ $c[] = ['href'=>'/b/manga/'.$id, 'title'=>$name, 'id'=>$id]; } $marumaru->FileWrite(json_encode(array('list'=>$c)), 'mangalist.txt'); - $file = $marumaru->FileRead('mangalist.txt'); + //$file = $marumaru->FileRead('mangalist.txt'); + $file = json_encode(array('list'=>$c)); + echo $file; + exit; } echo explode(PHP_EOL, $file)[1]; exit; \ No newline at end of file