src/PhpConsole/Connector.php
public function setPassword($password, $publicKeyByIp = true) {
		if($this->auth) {
			throw new \Exception('Password already defined');
		}
		$this->convertEncoding($password, self::CLIENT_ENCODING, $this->serverEncoding);
		$this->auth = new Auth($password, $publicKeyByIp);
		if($this->client) {
			$this->isAuthorized = $this->client->auth && $this->auth->isValidAuth($this->client->auth);
		}
	}
public function setPassword($password, $publicKeyByIp = true) {
		if($this->auth) {
			throw new \Exception('Password already defined');
		}
		$this->convertEncoding($password, self::CLIENT_ENCODING, $this->serverEncoding);
		$this->auth = new Auth($password, $publicKeyByIp);
		if($this->client) {
			$this->isAuthorized = $this->client->auth && $this->auth->isValidAuth($this->client->auth);
		}
	}
public function setPassword ( $ password , $ publicKeyByIp = true ) { if ( $ this -> auth ) { throw new \ Exception ( 'Password already defined' ) ; } $ this -> convertEncoding ( $ password , self :: CLIENT_ENCODING , $ this -> serverEncoding ) ; $ this -> auth = new Auth ( $ password , $ publicKeyByIp ) ; if ( $ this -> client ) { $ this -> isAuthorized = $ this -> client -> auth && $ this -> auth -> isValidAuth ( $ this -> client -> auth ) ; } }
Protect PHP Console connection by password

Use Connector::getInstance()->setAllowedIpMasks() for additional secure
@param string $password
@param bool $publicKeyByIp Set authorization token depending on client IP
@throws \Exception
Protect PHP Console connection by password