Skip to content

Instantly share code, notes, and snippets.

View pierredup's full-sized avatar
🐢
squirreling

Pierre du Plessis pierredup

🐢
squirreling
View GitHub Profile
@pierredup
pierredup / MigrateController.php
Created March 15, 2014 18:11
Running doctrine migrations from a controller
<?php
namespace Acme\DemiBundle\Controller;
use Doctrine\DBAL\Migrations\Migration;
use Doctrine\DBAL\Migrations\Configuration\Configuration;
class MigrateController extends BaseController
{
public function indexAction()
@pierredup
pierredup / example.php
Last active December 18, 2015 19:49 — forked from ircmaxell/example.php
<?php
function runMigration() {
foreach (getUsers() as $user) {
$hash = $user->hash;
list ($oldhash, $oldsalt) = explode(':', $hash, 2);
$newHash = password_migrate_create($oldhash, $oldsalt, PASSWORD_BCRYPT);
$user->hash = $newHash;
saveUser($user);
}