Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| <?php | |
| namespace Acme\DemoBundle\Features\Context; | |
| use Behat\BehatBundle\Context\BehatContext, | |
| Behat\Behat\Exception\PendingException; | |
| use Behat\Gherkin\Node\PyStringNode, | |
| Behat\Gherkin\Node\TableNode; | |
| /** |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
This gist assumes:
##Given Apache 2 and MySQL are already installed.
#Update MacPorts sudo port selfupdate;sudo port -u upgrade outdated
#Install PHP 5.4.* sudo port install php54 php54-apache2handler ##Activate Apache Module cd /opt/local/apache2/modules
| <?php | |
| // ... | |
| class FeatureContext extends MinkContext | |
| { | |
| /** | |
| * Looks for a table, then looks for a row that contains the given text. | |
| * Once it finds the right row, it clicks a link in that row. | |
| * |
Locate the section for your github remote in the .git/config file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
| <?php | |
| namespace Acme\DemoBundle\Security; | |
| use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface; | |
| use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | |
| use Symfony\Component\Security\Core\Exception\AuthenticationException; | |
| use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
| use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken; | |
| use Symfony\Component\HttpFoundation\Request; |
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:
oauth_user_provider in the security.yml with your custom created serviceHere are the steps:
routing.yml I have added all the routes for both bundles.config.yml mostly as it is presented in the HWIOAuthBundle.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.| <?php | |
| function isRequired($object, $property, $validationGroups = ['Default']) | |
| { | |
| $classMetadata = $this->validator->getMetadataFor($object); | |
| $propertyMetadatas = $classMetadata->getPropertyMetadata($property); | |
| foreach ($propertyMetadatas as $propertyMetadata) { | |
| $constraintsByGroups = $propertyMetadata->constraintsByGroup; |