original_string: public function createAdmin($login, $password, $roles = array())
  	{
  		$login = urlencode($login);
  		$data = (string) $password;
  		if (strlen($login) < 1) {
  			throw new InvalidArgumentException("Login can't be empty");
  		}
  		if (strlen($data) < 1) {
  			throw new InvalidArgumentException("Password can't be empty");
  		}
  		$url = '/_node/' . urlencode($this->node) . '/_config/admins/' . urlencode($login);
  		try {
  			$raw = $this->client->query(
  					"PUT", $url, array(), json_encode($data)
  			);
  		} catch (Exception $e) {
  			throw $e;
  		}
  		$resp = Couch::parseRawResponse($raw);
  		if ($resp['status_code'] != 200) {
  			throw new CouchException($raw);
  		}
  
  		$dsn = $this->client->dsn_part();
  		$dsn["user"] = $login;
  		$dsn["pass"] = $password;
  		$client = new CouchClient($this->build_url($dsn), $this->usersdb, $this->client->options());
  		$user = new stdClass();
  		$user->name = $login;
  		$user->type = "user";
  		$user->roles = $roles;
  		$user->_id = "org.couchdb.user:" . $login;
  		return $client->storeDoc($user);
  	}
code: public function createAdmin($login, $password, $roles = array())
  	{
  		$login = urlencode($login);
  		$data = (string) $password;
  		if (strlen($login) < 1) {
  			throw new InvalidArgumentException("Login can't be empty");
  		}
  		if (strlen($data) < 1) {
  			throw new InvalidArgumentException("Password can't be empty");
  		}
  		$url = '/_node/' . urlencode($this->node) . '/_config/admins/' . urlencode($login);
  		try {
  			$raw = $this->client->query(
  					"PUT", $url, array(), json_encode($data)
  			);
  		} catch (Exception $e) {
  			throw $e;
  		}
  		$resp = Couch::parseRawResponse($raw);
  		if ($resp['status_code'] != 200) {
  			throw new CouchException($raw);
  		}
  
  		$dsn = $this->client->dsn_part();
  		$dsn["user"] = $login;
  		$dsn["pass"] = $password;
  		$client = new CouchClient($this->build_url($dsn), $this->usersdb, $this->client->options());
  		$user = new stdClass();
  		$user->name = $login;
  		$user->type = "user";
  		$user->roles = $roles;
  		$user->_id = "org.couchdb.user:" . $login;
  		return $client->storeDoc($user);
  	}
code_tokens: public function createAdmin ( $ login , $ password , $ roles = array ( ) ) { $ login = urlencode ( $ login ) ; $ data = ( string ) $ password ; if ( strlen ( $ login ) < 1 ) { throw new InvalidArgumentException ( "Login can't be empty" ) ; } if ( strlen ( $ data ) < 1 ) { throw new InvalidArgumentException ( "Password can't be empty" ) ; } $ url = '/_node/' . urlencode ( $ this -> node ) . '/_config/admins/' . urlencode ( $ login ) ; try { $ raw = $ this -> client -> query ( "PUT" , $ url , array ( ) , json_encode ( $ data ) ) ; } catch ( Exception $ e ) { throw $ e ; } $ resp = Couch :: parseRawResponse ( $ raw ) ; if ( $ resp [ 'status_code' ] != 200 ) { throw new CouchException ( $ raw ) ; } $ dsn = $ this -> client -> dsn_part ( ) ; $ dsn [ "user" ] = $ login ; $ dsn [ "pass" ] = $ password ; $ client = new CouchClient ( $ this -> build_url ( $ dsn ) , $ this -> usersdb , $ this -> client -> options ( ) ) ; $ user = new stdClass ( ) ; $ user -> name = $ login ; $ user -> type = "user" ; $ user -> roles = $ roles ; $ user -> _id = "org.couchdb.user:" . $ login ; return $ client -> storeDoc ( $ user ) ; }
docstring: Creates a new CouchDB server administrator
  
  @param string $login administrator login
  @param string $password administrator password
  @param array $roles add additionnal roles to the new admin
  @return stdClass CouchDB server response
  @throws InvalidArgumentException|Exception|CouchException
docstring_tokens: Creates a new CouchDB server administrator