Skip to content

Instantly share code, notes, and snippets.

View jonathaningram's full-sized avatar

Jonathan Ingram jonathaningram

View GitHub Profile
{
"name": "jbi/project",
"description": "",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.1.*",
"doctrine/orm": "2.2.*",
default:
extensions:
Behat\Symfony2Extension\Extension: ~
Behat\MinkExtension\Extension:
base_url: 'http://localadmin.example.com'
selenium2: ~
sahi: ~
goutte: ~
default_session: goutte
javascript_session: sahi
<?php
use Behat\Behat\Context\ClosuredContextInterface;
use Behat\Behat\Context\TranslatedContextInterface;
use Behat\Behat\Context\BehatContext;
use Behat\Behat\Context\Step;
use Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode;
{
"name": "myproject",
"description": "",
"autoload": {
"psr-0": { "": "src/" }
},
"repositories": [
{
"type": "composer",
"url": "http://packages.zendframework.com/"
{
"autoload": {
"psr-0": {
"": [
"src/",
"vendor/knplabs/knp-paginator-bundle/"
]
}
},
"repositories": [
#!/bin/bash
# Configure logrotate
touch /etc/logrotate.d/example.com
read -r -d '' LOGROTATE_EXAMPLE <<EOF
; Nothing to see here (yet)
EOF
<?php
$userData = str_replace(array("\r\n", "\r"), "\n", $userData);
<?php
class OptionA
{
/**
* @var \DateTime $date
*/
private $date;
// the $date in the docblock seems redundant?
}
@jonathaningram
jonathaningram / gist:3485084
Created August 27, 2012 02:21
Symfony2 error when using Symfony's HTTP cache
Error 2: /var/www/beta.example.com/shared/vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpCache/Store.php line 92: unlink(/var/www/beta.example.com/releases/20120827020525/app/cache/beta/http_cache/md/c2/88/66a911b5266a57bdd55131a47895b8861dfd.lck): No such file or directory
@jonathaningram
jonathaningram / Service.php
Created August 31, 2012 01:52
Doctrine service method to create a user that inserts a user so should use master connection
<?php
class Service
{
public function createUser(UserInterface $user)
{
$em = $this->getEntityManager();
$conn = $em->getConnection();
$conn->beginTransaction();