private function getUserPasswordMigrations($queries)
    {
        $db        = Db::get();
        $userTable = Common::prefixTable($this->userTable);

        $users = $db->fetchAll(
            'SELECT `login`, `password` FROM `' . $userTable . '` WHERE LENGTH(`password`) = 32'
        );

        foreach ($users as $user) {
            $queries[] = $this->migration->db->boundSql(
                'UPDATE `' . $userTable . '`'
                . ' SET `password` = ?'
                . ' WHERE `login` = ?',
                [
                    password_hash($user['password'], PASSWORD_BCRYPT),
                    $user['login'],
                ]
            );
        }

        return $queries;
    }
private function getUserPasswordMigrations($queries)
    {
        $db        = Db::get();
        $userTable = Common::prefixTable($this->userTable);

        $users = $db->fetchAll(
            'SELECT `login`, `password` FROM `' . $userTable . '` WHERE LENGTH(`password`) = 32'
        );

        foreach ($users as $user) {
            $queries[] = $this->migration->db->boundSql(
                'UPDATE `' . $userTable . '`'
                . ' SET `password` = ?'
                . ' WHERE `login` = ?',
                [
                    password_hash($user['password'], PASSWORD_BCRYPT),
                    $user['login'],
                ]
            );
        }

        return $queries;
    }
private function getUserPasswordMigrations ( $ queries ) { $ db = Db :: get ( ) ; $ userTable = Common :: prefixTable ( $ this -> userTable ) ; $ users = $ db -> fetchAll ( 'SELECT `login`, `password` FROM `' . $ userTable . '` WHERE LENGTH(`password`) = 32' ) ; foreach ( $ users as $ user ) { $ queries [ ] = $ this -> migration -> db -> boundSql ( 'UPDATE `' . $ userTable . '`' . ' SET `password` = ?' . ' WHERE `login` = ?' , [ password_hash ( $ user [ 'password' ] , PASSWORD_BCRYPT ) , $ user [ 'login' ] , ] ) ; } return $ queries ; }
Returns migrations to hash existing password with bcrypt.
@param Migration[] $queries
@return Migration[]
Returns migrations to hash existing password with bcrypt .