// 直接记录在以日期开头的文件里,如16_08_24.log
Log_Log::info('this is a log', true, true);
// 加上前缀,prefix_16_08_24.log
Log_Log::info('this is a log', true, true, 'prefix');
Curl 操作
$curl = new \Http\Curl();
// get
$curl->get('https://www.example.com/search', array(
'q' => 'keyword',
));
// post
$curl->post('https://www.example.com/login/', array(
'username' => 'myusername',
'password' => 'mypassword',
));
// more https://github.com/php-curl-class/php-curl-class
全局异常捕获
try {
if ($_POST['test']) {
}
} catch (Exception $e) {
echo $e->getMessage(); // Undefined index: test
}