Skip to content

Instantly share code, notes, and snippets.

[RuntimeException]
Context class not found.
Maybe you have provided a wrong or no `bootstrap` path in your behat.yml:
http://docs.behat.org/guides/7.config.html#paths
@daum
daum / gist:5051173
Last active December 14, 2015 07:29
static public function listenToRoutingLoadConfigurationEvent(sfEvent $event)
{
$r = $event->getSubject();
$r->prependRoute('landing_page_noParam', new sfRoute('/some-route-there', array('module' => 'someModule', 'action' => 'showPage')));
}
<?php
namespace Knp\Bundle\MenuBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
/**
* This compiler pass adds the path for the KnpMenu template in the twig loader.
*
* @author Christophe Coevoet <stof@notk.org>
@daum
daum / gist:5090032
Created March 5, 2013 12:36
Quick Example
CREATE TABLE IF NOT EXISTS `post` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(32) NULL ,
PRIMARY KEY (`id`) )
ENGINE = InnoDB
CREATE TABLE IF NOT EXISTS `post_attachment` (
`id` INT NOT NULL AUTO_INCREMENT ,
`name` VARCHAR(32) NULL ,
<?php
$attachments = $post->getPostAttachments();
foreach($attachments as $attachment)
{
echo $attachment->getId().' '.$attachment->getName()."\n";
}
//Output
// 1 d name
// 2 c name
@daum
daum / gist:5090098
Last active December 14, 2015 12:59
<?php
//MyBundle/Entity/Post.php
...
class Post
{
...
/**
* @ORM\OneToMany(targetEntity=PostAttachment",mappedBy="post")
* @ORM\OrderBy({"name"="ASC"})
*/
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
daum@daum ~ $ ssh ubuntu@ec2-23-22-148-92.compute-1.amazonaws.com -i test.pem
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'test.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: test.pem
Permission denied (publickey).
daum@daum ~ $ chmod 0600 test.pem
// Become the super user.
ubuntu@ip-10-202-91-158:~$ sudo -s
// Update apt-get so that it has the most recent information
root@ip-10-202-91-158:~# apt-get update
Ign http://us-east-1.ec2.archive.ubuntu.com precise InRelease
...
// We now tell it to install the lamp server software BE SURE TO INCLUDE THE "^"
root@ip-10-202-91-158:~# apt-get install lamp-server^
$ php app/console cache:clear --env=prod
Clearing the cache for the prod environment with debug true
PHP Fatal error: Cannot redeclare class EnhancedProxy_19abbe87dfe07b1a52563cac33dd823f08c79506\__CG__\Setfive\XXBundle\Controller\AwesomeController in /home/sf/sf/app/cache/pro_/jms_diextra/proxies/Setfive-XXBundle-Controller-AwesomeController.php on line 46