Skip to content

Instantly share code, notes, and snippets.

<?php
require_once __DIR__.'/vendor/symfony/src/Symfony/Framework/UniversalClassLoader.php';
// TODO This is crap - it should only be loaded when Murmur is necessary.
require_once __DIR__.'/vendor/ice/Murmur.php';
use Symfony\Framework\UniversalClassLoader;
$loader = new UniversalClassLoader();
<?php
$lib = '../lib/';
require $lib . 'doctrine-common/lib/Doctrine/Common/ClassLoader.php';
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\Common', $lib.'doctrine-common/lib');
$classLoader->register();
$classLoader = new \Doctrine\Common\ClassLoader('Doctrine\DBAL', $lib.'doctrine-dbal/lib');
$classLoader->register();
We couldn’t find that file to show.
Fatal error: Maximum function nesting level of '100' reached, aborting! in /Users/merk/Sites/o/vendor/symfony/src/Symfony/Component/DependencyInjection/Compiler/ServiceReferenceGraphEdge.php on line 50
Call Stack:
0.0047 645232 1. {main}() /Users/merk/Sites/o/web/index.php:0
0.0103 2094672 2. Symfony\Component\HttpKernel\Kernel->handle() /Users/merk/Sites/o/web/index.php:9
0.0103 2094768 3. Symfony\Component\HttpKernel\Kernel->boot() /Users/merk/Sites/o/app/bootstrap.php.cache:574
0.0131 2258024 4. Symfony\Component\HttpKernel\Kernel->initializeContainer() /Users/merk/Sites/o/app/bootstrap.php.cache:555
0.0153 2277944 5. Symfony\Component\HttpKernel\Kernel->buildContainer() /Users/merk/Sites/o/app/bootstrap.php.cache:721
0.0720 6479624 6. Symfony\Component\DependencyInjection\ContainerBuilder->compile() /Users/merk/Sites/o/app/bootstrap.php.cache:788
0.0730 6502616 7. Symfony\Component\DependencyInjection\Compiler\Compiler->compile() /Users/merk
<?php
$oid = new ObjectIdentity('class', $this->threadClass);
$sid = UserSecurityIdentity::fromAccount($this->securityContext->getToken()->getUser());
foreach ($this->aclProvider->findAcl($oid)->getClassAces() AS $entry) {
if ($entry->getSecurityIdentity()->equals($sid)) {
var_dump($entry->getMask()); // Doesnt dump, The user has role ROLE_SUPERADMIN
}
}
<?php
public function createAction($threadIdentifier)
{
$thread = $this->container->get('fos_comment.manager.thread')->findThreadByIdentifier($threadIdentifier);
if (!$thread) {
throw new NotFoundHttpException(sprintf('Thread with identifier of "%s" does not exist', $threadIdentifier));
}
if ($replyToId = $this->container->get('request')->request->get('reply_to')) {
<?php
namespace ozfortress\AppBundle\Entity;
use FOS\CommentBundle\Entity\Comment as BaseComment;
use FOS\CommentBundle\Model\SignedCommentInterface;
use FOS\CommentBundle\Model\VotableCommentInterface;
use FOS\Userbundle\Model\UserInterface;
/**
<?php
namespace Test\AppBundle\Entity;
use FOS\CommentBundle\Entity\Comment as BaseComment;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="test_comment")
@merk
merk / gist:1136130
Created August 10, 2011 04:38
Velociraptors!
<?php
// ... <inside a large payment processing function, where velociraptors can be heard> ...
$form = $this->getForm($formName);
foreach ((array) $errors as $errNo => $error)
{
switch ($errNo)
{
case "0" : // Transaction Successful
@merk
merk / blocks.html.twig
Created November 12, 2011 09:48
A way to deal with collections
{% block address_form %}
{% spaceless %}
<div class="address">
<a href="#" class="remove_item btn danger right">Remove</a>
{{ form_row(address.unitNumber, { "label": "Unit Number" }) }}
{{ form_row(address.streetNumber, { "label": "Street Number" }) }}
{{ form_row(address.street, { "label": "Street" }) }}
{{ form_row(address.city, { "label": "City" }) }}
{{ form_row(address.postcode, { "label": "Postcode" }) }}