오류 수정

오류 수정
This commit is contained in:
hakasenyang
2017-01-07 08:35:49 +09:00
parent e1bc69e587
commit 686b7e65b6
2 changed files with 7 additions and 4 deletions
+2 -2
View File
@@ -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)
+5 -2
View File
@@ -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;