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 | |
| require __DIR__ . '/../vendor/autoload.php'; | |
| use Doctrine\Common\Annotations\AnnotationReader; | |
| require __DIR__ . '/../src/Kotoblog/Annotation/Mapping.php'; | |
| $annotationReader = new AnnotationReader(); | |
| $reflectionClass = new ReflectionClass('\\Kotoblog\\Entity\\Blogpost'); | |
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 | |
| //.... | |
| public function indexAction() | |
| { | |
| $application = new Application($this->get('kernel')); | |
| $application->add(new CreateSchemaDoctrineCommand()); | |
| $command = $application->find('doctrine:schema:create'); |
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 | |
| $user = new User(); | |
| /** @var \Symfony\Component\Validator\Mapping\ClassMetadataFactory $metadataFactory */ | |
| $metadataFactory = $this->get('validator.mapping.class_metadata_factory'); | |
| $metadata = $metadataFactory->getMetadataFor($user); | |
| $constraints = []; | |
| echo "Constraints:"; | |
| foreach ($metadata->properties as $property) { |
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
| { | |
| "require": { | |
| "behat/behat": ">=2.4@stable", | |
| "behat/mink": "1.4@stable", | |
| "behat/mink-extension": "*", | |
| "behat/mink-goutte-driver": "*" | |
| }, | |
| "minimum-stability": "dev", |
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
| {# ... #} | |
| {{app.kernel.cachedir}} | |
| {{app.kernel.logdir}} | |
| {{app.kernel.rootdir}} | |
| {{app.request.basepath}} | |
| {{app.request.baseurl}} | |
| {{app.request.uri}} | |
| {{app.security.token.user}} | |
| {{app.session.locale}} | |
| {# ... #} |
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
| { | |
| "require-dev": { | |
| "behat/behat": "@dev", | |
| "behat/mink": "@dev", | |
| "behat/symfony2-extension": "dev-master", | |
| "behat/mink-extension": "*", | |
| "behat/mink-selenium2-driver": "dev-master", | |
| "behat/mink-browserkit-driver": "dev-master", | |
| "behat/mink-sahi-driver": "@dev" | |
| } |
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
| default: | |
| extensions: | |
| Behat\Symfony2Extension\Extension: | |
| mink_driver: true | |
| Behat\MinkExtension\Extension: | |
| default_session: 'symfony2' |
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
| sudo apt-get remove phpunit | |
| sudo pear channel-discover pear.phpunit.de | |
| sudo pear channel-discover pear.symfony-project.com | |
| sudo pear channel-discover components.ez.no | |
| sudo pear update-channels | |
| sudo pear upgrade-all | |
| sudo pear install --alldeps phpunit/PHPUnit sudo pear install --force --alldeps pear.phpunit.de/PHPUnit |
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 | |
| function show_run($text, $command, $canFail = false) | |
| { | |
| echo "\n* $text\n$command\n"; | |
| passthru($command, $return); | |
| if (0 !== $return && !$canFail) { | |
| echo "\n/!\\ The command returned $return\n"; | |
| exit(1); |
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
| #!/usr/bin/env php | |
| <?php | |
| require_once __DIR__.'/base_script.php'; | |
| $options = getopt("", array('db:', 'dir:')); | |
| $options['dir'] = !empty($options['dir']) ? $options['dir'] : "/"; | |
| $options['db'] = !empty($options['db']) ? $options['db']: "exercise"; | |
| $optionsLine = sprintf(" --dir=%s --db=%s", $options['dir'], $options['db']); |