| gitflow | git | 
|---|---|
git flow init | 
git init | 
git commit --allow-empty -m "Initial commit" | 
|
git checkout -b develop master | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| namespace AppBundle\Services; | |
| use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface; | |
| use HWI\Bundle\OAuthBundle\Security\Core\User\FOSUBUserProvider as BaseClass; | |
| use Symfony\Component\Security\Core\User\UserInterface; | |
| /** | |
| * https://gist.github.com/danvbe/4476697 | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | { | |
| "env": { | |
| "browser": true, | |
| "node": true, | |
| "es6": true | |
| }, | |
| "plugins": ["react"], | |
| "ecmaFeatures": { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php // file [project]/Library/View.php | |
| namespace YourNamespace\Library; | |
| class extendedView extends \Phalcon\Mvc\View | |
| { | |
| public function getPartial($path, $params = array()) | |
| { | |
| ob_start(); | |
| $this->partial($path, $params); | |
| return ob_get_clean(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php // file [project]/Library/View.php | |
| namespace YourNamespace\Library; | |
| class extendedView extends \Phalcon\Mvc\View | |
| { | |
| public function getPartial($path, $params = array()) | |
| { | |
| ob_start(); | |
| $this->partial($path, $params); | |
| return ob_get_clean(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| use Phalcon\Mvc\Controller; | |
| use Phalcon\Mvc\Dispatcher; | |
| use Phalcon\Mvc\DispatcherInterface; | |
| use Phalcon\Mvc\Model\CriteriaInterface; | |
| use Phalcon\Mvc\ModelInterface; | |
| use Phalcon\Mvc\View; | |
| abstract class RestController extends Controller | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | class FormErrorsSerializer { | |
| public function serializeFormErrors(\Symfony\Component\Form\Form $form, $flat_array = false, $add_form_name = false, $glue_keys = '_') | |
| { | |
| $errors = array(); | |
| $errors['global'] = array(); | |
| $errors['fields'] = array(); | |
| foreach ($form->getErrors() as $error) { | |
| $errors['global'][] = $error->getMessage(); | 
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_providerin thesecurity.ymlwith your custom created service 
Here are the steps:
- Routing. In 
routing.ymlI have added all the routes for both bundles. - Configuration. I have set the 
config.ymlmostly as it is presented in the HWIOAuthBundle. - Security. I have set the 
security.ymlmostly as it is presented in the HWIOAuthBundle (though my routes are using/loginpattern, not/connect). Also, theoauth_user_provideris set for my custom service.