Skip to content

Instantly share code, notes, and snippets.

@latysh
latysh / README.md
Created January 18, 2018 00:30 — forked from dbu/README.md
Convert NelmioApiDocBundle annotations to Swagger PHP

A Symfony command to convert from NelmioApiDocBundle annotations to Swagger-PHP annotations.

This code is provided as is. Make sure to have your code committed to version control before running the command. Check if things work out and if not, use version control to reset the automated changes and fix the command.

@latysh
latysh / behat-reference.feature
Last active September 15, 2015 23:23 — forked from mnapoli/behat-reference.feature
Behat Mink reference
# Given
Given I am on [the] homepage
Given I am on "url"
# When
When I go to [the] homepage
When I go to "url"
When I reload the page
# Extended ExpressionEngine Apache Configuration (.htaccess)
# httpd.apache.org/docs/2.2/mod/quickreference.html
# ------------------------------
# SECURITY: Secure "dot" files/directories
# ------------------------------
# Block access to "hidden" directories or files whose names begin with a
# period. This includes directories used by version control systems such as
# Subversion or Git.
# <IfModule mod_rewrite.c>
@latysh
latysh / 1-Explanations.md
Last active April 1, 2018 09:35 — forked from danvbe/1-Explanations.md
HWI oAuth bundle with FOSuserbundle

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.