Пример #1
0
 /**
  * @group ZF-8382
  */
 public function testWriteWithFormatter()
 {
     $event = array('message' => 'tottakai', 'priority' => Logger::ERR);
     $writer = new SyslogWriter();
     $formatter = new SimpleFormatter('%message% (this is a test)');
     $writer->setFormatter($formatter);
     $writer->write($event);
 }
Пример #2
0
 public function userExists(UserDao $user)
 {
     try {
         $sql = "SELECT u.id FROM " . USERTABLE . " AS u" . " JOIN " . USERCREDTABLE . " AS uc ON uc.user_id=u.id" . " WHERE uc.username=:username";
         $stmt = $this->dbh->prepare($sql);
         $stmt->setFetchMode(PDO::FETCH_ASSOC);
         $stmt->execute(array(':username' => $user->username));
         $rowCount = count($stmt->fetchAll());
         $stmt->closeCursor();
         return $rowCount > 0;
     } catch (PDOException $ex) {
         $syslog = new Syslog();
         $syslog->write($ex);
         $syslog->shutdown();
         return $this->error(ErrorCodes::USER_GENERIC_ERROR, "Failed to find user");
     }
 }
Пример #3
0
 /**
  * @group ZF-8953
  */
 public function testFluentInterface()
 {
     $writer = new SyslogWriter();
     $instance = $writer->setFacility(LOG_USER)->setApplicationName('my_app');
     $this->assertTrue($instance instanceof SyslogWriter);
 }