Skip to content

Instantly share code, notes, and snippets.

View lenybernard's full-sized avatar
🇨🇵

Leny BERNARD lenybernard

🇨🇵
  • Nantes
View GitHub Profile
@lenybernard
lenybernard / XliffFixerCommand.php
Created April 30, 2018 13:19
Will parse every xliff files and will add missing id attributes to be compliant with strict Symfony xliff parsing
<?php
namespace AppBundle\Command;
use AppBundle\Entity\Event\Event;
use AppBundle\Entity\Event\Topic;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
[Tue Jul 11 17:20:22.290520 2017] [:error] [pid 16444] [client 92.88.237.125:56034]
PHP Fatal error: Uncaught Symfony\\Component\\Debug\\Exception\\FatalErrorException:
Error: Uncaught Symfony\\Component\\Debug\\Exception\\FatalThrowableError:
Call to a member function getId() on null in /var/www/quovadis.eu/releases/20170612153347/src/AppBundle/Controller/Admin/Quommunity/QuommunityParticipationsController.php:31
Stack trace:
#0 [internal function]: AppBundle\\Controller\\Admin\\Quommunity\\QuommunityParticipationsController->indexAction()
#1 /var/www/quovadis.eu/releases/20170612153347/var/bootstrap.php.cache(3242): call_user_func_array(Array, Array)
#2 /var/www/quovadis.eu/releases/20170612153347/var/bootstrap.php.cache(3201): Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw(Object(Symfony\\Component\\HttpFoundation\\Request), 1)
<?php
namespace AppBundle/Controller;
class PaymentController extends Controller
{
public function paymentAction($redurectUrl)
{
$form = $this->get('app.payment.form_handler')->generateForm($redirectUrl);
return $this->render('AppBundle:Payment:form.html.twig', [
@lenybernard
lenybernard / XliffFixerCommand.php
Created January 26, 2017 22:35
Symfony console command to parse xliff files to add or update missing id attribute
<?php
namespace AppBundle\Command;
use Doctrine\ORM\EntityManager;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
@lenybernard
lenybernard / app__config__hwi_oauth.yml
Created November 15, 2016 22:39
Gitlab OAuth configuration for "hwi/oauth-bundle"
hwi_oauth:
firewall_names:
- main
connect:
account_connector: app.security.provider.gitlab
fosub:
username_iterations: 30
properties:
gitlab: gitlabId
resource_owners:
diff --git a/src/Behat/MinkExtension/Context/MinkContext.php b/src/Behat/MinkExtension/Context/MinkContext.php
index 90ea038..8d6537b 100644
--- a/src/Behat/MinkExtension/Context/MinkContext.php
+++ b/src/Behat/MinkExtension/Context/MinkContext.php
@@ -238,22 +238,34 @@ class MinkContext extends RawMinkContext implements TranslatableContext
/**
* Checks, that page contains specified text.
+ * @param string $text the text to check
+ * @param integer $timeout in milliseconds
<Location />
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ /app.php [QSA,L]
####################################################
########### MAINTENANCE FILE HANDLE ################
ErrorDocument 503 /maintenance.html
### add here the granted ips ###
default:
context:
class: Victoire\Tests\Features\Context\FeatureContext
parameters:
wd_host: 'http://localhost:4444/wd/hub'
capabilities: { "browser": "firefox", "version": "33"}
extensions:
Behat\Symfony2Extension\Extension:
mink_driver: true
kernel:
language: php
php:
- 5.5
- 5.6
before_script:
- npm install less
- composer install --dev --prefer-dist
# Prepare database
<?php
use Symfony\Component\HttpFoundation\Request;
$loader = require_once __DIR__.'/../../bootstrap.php';
require_once __DIR__.'/../app/AppKernel.php';
$kernel = new AppKernel('test', true);
$kernel->loadClassCache();