errNo() 공개 메소드

Returns the error number of the last command executed on the current connection.
public errNo ( ) : integer
리턴 integer
예제 #1
0
파일: Guard.php 프로젝트: adldap2/adldap2
 /**
  * {@inheritdoc}
  */
 public function bind($username, $password, $prefix = null, $suffix = null)
 {
     // We'll allow binding with a null username and password
     // if their empty. This will allow us to anonymously
     // bind to our servers if needed.
     $username = $username ?: null;
     $password = $password ?: null;
     if ($username) {
         // If the username isn't empty, we'll append the configured
         // account prefix and suffix to bind to the LDAP server.
         $prefix = $prefix ?: $this->configuration->get('account_prefix');
         $suffix = $suffix ?: $this->configuration->get('account_suffix');
         $username = $prefix . $username . $suffix;
     }
     // We'll mute any exceptions / warnings here. All we need to know
     // is if binding failed and we'll throw our own exception.
     if (!@$this->connection->bind($username, $password)) {
         throw new BindException($this->connection->getLastError(), $this->connection->errNo());
     }
 }