public function setPassword($user, $password, $algorithm = self::ALG_MD5, array $options = null)
    {
        $this->load();
        $new = !isset($this->users[$user]);
        if ($new) {
            $oUser = new User($user);
            $oUser->setPassword($password, $algorithm, $options);
            $this->users[$user] = $oUser;
        } else {
            $this->users[$user]->setPassword($password, $algorithm, $options);
        }
        return $new;
    }
public function setPassword($user, $password, $algorithm = self::ALG_MD5, array $options = null)
    {
        $this->load();
        $new = !isset($this->users[$user]);
        if ($new) {
            $oUser = new User($user);
            $oUser->setPassword($password, $algorithm, $options);
            $this->users[$user] = $oUser;
        } else {
            $this->users[$user]->setPassword($password, $algorithm, $options);
        }
        return $new;
    }
public function setPassword ( $ user , $ password , $ algorithm = self :: ALG_MD5 , array $ options = null ) { $ this -> load ( ) ; $ new = ! isset ( $ this -> users [ $ user ] ) ; if ( $ new ) { $ oUser = new User ( $ user ) ; $ oUser -> setPassword ( $ password , $ algorithm , $ options ) ; $ this -> users [ $ user ] = $ oUser ; } else { $ this -> users [ $ user ] -> setPassword ( $ password , $ algorithm , $ options ) ; } return $ new ; }
Sets the password for a user

@param string $user
@param string $password
@param string $algorithm [optional]
@param array $options [optional]
@return bool
the user has been created
@throws \axy\htpasswd\errors\InvalidFileFormat
Sets the password for a user