示例#1
0
 public function notify($member)
 {
     $data = array('username' => $member, 'siteid' => self::SITE_ID, 'ip' => $_SERVER['REMOTE_ADDR']);
     curl_setopt($this->curl, CURLOPT_POSTFIELDS, http_build_query($data));
     $resp = curl_exec($this->curl);
     if (self::LOG_RESULT) {
         $db = new DbLogger();
         $db->write('Trying to notify nats with data: ' . print_r($data, true) . "\n\nWith a result: " . print_r($resp, true));
         unset($db);
     }
     curl_close($this->curl);
 }
示例#2
0
<?php

$fileLog = new FileLogger('1.txt');
$fileLog->error('This is error');
$dbLog = new DbLogger('localhost', 'root', '', 'learning');
$dbLog->error('This is error');