Skip to content

Instantly share code, notes, and snippets.

@BrechtBonte
Created June 7, 2018 20:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BrechtBonte/d125fa7f8f5e9a4ba6e23433e8d249c1 to your computer and use it in GitHub Desktop.
Save BrechtBonte/d125fa7f8f5e9a4ba6e23433e8d249c1 to your computer and use it in GitHub Desktop.
Migrations
class Migration_000001_Bcrypt : MigrationInterface
{
private $migrationManager;
public function up() : void
{
if ($this->migrationManager->getSetting('passwordAlgorithm') !== null) {
return;
}
// fetch users and change password encoding
}
public function down() : void
{
// nada
}
}
interface MigrationInterface
{
public function up() : void;
public function down() : void;
}
interface MigrationManagerInterface
{
public function getSetting(string $name) : ?string;
public function setSetting(string $name, string $value) : void;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment