Skip to content

Instantly share code, notes, and snippets.

@akerouanton
akerouanton / .bash_aliases
Last active February 1, 2016 09:21
Bash macro preventing composer execution with xdebug enabled
COMPOSER_PATH=`which composer`
composer() {
if ! php5query -s cli -m xdebug >/dev/null; then
$COMPOSER_PATH $@
return
fi
# Re-enable xdebug even after a ctrl-c (SIGINT)
# and clear the signal handler
trap 'sudo php5enmod xdebug; trap - INT' INT
@damienalexandre
damienalexandre / ProfilerController.php
Created July 5, 2015 15:10
Adding a checkbox on the translation panel + custom save controller
<?php
namespace AppBundle\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
class ProfilerController extends Controller
@cursedcoder
cursedcoder / config.yml
Last active March 20, 2019 22:00
HWIOAuth with FOSUserBundle intergration + phpspec coverage
fos_user:
db_driver: orm
firewall_name: main
user_class: App\Entity\User
service:
user_manager: app.user_manager
hwi_oauth:
firewall_name: main
fosub:
@callado4
callado4 / behat-phantomjs-webdriver.md
Last active January 24, 2021 17:10
Instructions on how to make behat (with mink) use the phantomjs webdriver to run headless browser tests

Making behat use phantomjs for the tests

If you want to run it on phantomjs (a headless browser) you can add this profile to your behat.yml and you need phantomjs >= 1.8.0

phantomjs:
    extensions:
        Behat\MinkExtension\Extension:
            base_url: http://dev.local
            goutte: ~
            selenium2:
 wd_host: "http://localhost:8643/wd/hub" 
@danvbe
danvbe / 1-Explanations.md
Last active April 21, 2023 15:39
A way to integrate FosUserBundle and HWIOAuthBundle

I have managed to install this… and make it work. I implemented it for Facebook and Google, but you can extend it. My solution it is mostly as described in #116, with a bit of more code presented. The key aspects that lack in the #116 presentation (IMO) are:

  • the registration as service of your custom FOSUBUserProvider (with the necessary parameters)
  • set the service for oauth_user_provider in the security.yml with your custom created service

Here are the steps:

  1. Routing. In routing.yml I have added all the routes for both bundles.
  2. Configuration. I have set the config.yml mostly as it is presented in the HWIOAuthBundle.
  3. Security. I have set the security.yml mostly as it is presented in the HWIOAuthBundle (though my routes are using /login pattern, not /connect). Also, the oauth_user_provider is set for my custom service.