Skip to content

Instantly share code, notes, and snippets.

@hghandri
hghandri / gist:0521aa71c5f18eef56f8
Created May 20, 2014 14:09
Login user on eZPublish 5 with Symfony2
$userProvider = new Provider( $this->getRepository() );
$user = $userProvider->loadUserByUsername( __LOGIN_USER__ );
$token = new UsernamePasswordToken($user, null, "ezpublish_front", $user->getRoles());
$this->get("security.context")->setToken($token);
//now dispatch the login event
$request = $this->get("request");
$event = new InteractiveLoginEvent($request, $token);
@hghandri
hghandri / release_tagging.bash
Last active March 29, 2017 15:00
Semantic Versioning : Create automatically a tag from specific naming Pull Request
#!/bin/bash
#get highest tag number
VERSION=` describe --abbrev=0 --tags`
#replace . with space so can split into an array
VERSION_BITS=(${VERSION//./ })
#get number parts and increase last one by 1