Skip to content

Instantly share code, notes, and snippets.

View elnur's full-sized avatar
🤓

Elnur Abdurrakhimov elnur

🤓
  • Earth
View GitHub Profile
@elnur
elnur / config.yml
Created April 23, 2012 16:41
Doctrine ORM configuration to keep models out of a bundle
doctrine:
dbal:
driver: %database_driver%
host: %database_host%
port: %database_port%
dbname: %database_name%
user: %database_user%
password: %database_password%
charset: UTF8
<?php
namespace Elnur\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use JMS\DiExtraBundle\Annotation\Service;
/**
* @Service("main_controller")
* @Route(service="main_controller")
<?php
namespace Elnur\Manager;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\InjectParams;
/**
* @Service
*/
<?php
namespace Elnur\Listener;
use DateTime;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\InjectParams;
use JMS\DiExtraBundle\Annotation\Observe;
@elnur
elnur / like.feature
Last active December 14, 2015 19:39
Feature: Like tips
In order to make good tips more visible
As a tips reader
I need to be able to like tips
Background:
Given I am logged in
Scenario: Vote for a tip of another user
Given a tip from another user
<?php
namespace Elnur\Listener;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\InjectParams;
use JMS\DiExtraBundle\Annotation\Observe;
use Elnur\Manager\VisitManager;
<?php
namespace Experium\Controller\Api;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\InjectParams;
use Elnur\AbstractControllerBundle\AbstractController;
use Experium\Manager\RequestManager;
use Symfony\Component\HttpFoundation\Request;
/**
* @Given /^I am logged in$/
*/
public function iAmLoggedIn()
{
$user = $this->aUser();
$this->userManager->save($user);
$this->currentUser = $user;
}
<?php
namespace Elnur\Listener;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use JMS\DiExtraBundle\Annotation\Service;
use JMS\DiExtraBundle\Annotation\Observe;
/**
* @Service
*/
doctrine:
dbal:
driver: "%database_driver%"
host: "%database_host%"
port: "%database_port%"
dbname: "%database_name%"
user: "%database_user%"
password: "%database_password%"
charset: UTF8