Skip to content

Instantly share code, notes, and snippets.

View rufinus's full-sized avatar

Ludwig Ruderstaller rufinus

View GitHub Profile
<?php
namespace Application\Form;
use DoctrineORMModule\Stdlib\Hydrator\DoctrineEntity as DoctrineHydrator;
use Zend\Form\Form;
use Zend\ServiceManager\ServiceManager;
class Event extends Form
{
public function __construct($fields, $calendar, ServiceManager $sm)
$hydra = new DoctrineHydrator($sm->get('Doctrine\ORM\EntityManager', false));
$hydra->addStrategy('date_start', new \cwdCommon\Doctrine\Strategy\DateTime());
$hydra->addStrategy('date_end', new \cwdCommon\Doctrine\Strategy\DateTime());
$this->setHydrator($hydra);
$this->setObject(new \Application\Entity\Event());
$this->add(
array(
'name' => 'date_start',
$this->add(
array(
'type' => 'DoctrineModule\Form\Element\ObjectSelect',
'name' => 'field_id',
'options' => array(
'object_manager' => $em,
'target_class' => 'Application\Entity\Field',
'label_generator' => function($targetEntity) {
return $targetEntity->getName();
},
START TRANSACTION
DELETE FROM `milestone` WHERE `milestone_id` = ?
array(1) { [0]=> int(13) } array(1) { [0]=> string(7) "integer" }
DELETE FROM `milestone` WHERE `milestone_id` = ?
array(1) { [0]=> int(14) } array(1) { [0]=> string(7) "integer" }
DELETE FROM `event` WHERE `event_id` = ?
array(1) { [0]=> int(14) } array(1) { [0]=> string(7) "integer" }
<?php
namespace Application\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* Application\Entity\Mandator
*
1. In twig, what do you use if you want to optimize the size of the generated HTML content?
a. spaceless
b. gzip
c. operators
the spaceless tag
answer is b
really ?
twig supports gzip ?
don't look up
cilex/cilex 1.1.0 The PHP micro-framework for Command line tools based on the Symfony2 Components
cilex/console-service-provider 1.0.0 Console Service Provider
doctrine/annotations v1.2.0 Docblock Annotations Parser
doctrine/lexer v1.0 Base library for a lexer that can be used in Top-Down, Recursive Descent Parsers.
dompdf/dompdf v0.6.1 DOMPDF is a CSS 2.1 compliant HTML to PDF converter
erusev/parsedown 1.0.1 Parser for Markdown.
jms/metadata 1.5.1 Class/method/property metadata management in PHP
jms/parser-lib 1.0.0 A library for easily creating recursive-descent parsers.
jms/serializer 0.16.0 Library for (de-)serializing data of any complexity; supports XML, JSON, and YAML.
knpla
<?php
namespace Cwd\GenericBundle\Repository;
use Doctrine\Common\Persistence\Mapping\ClassMetadata;
use Doctrine\Common\Persistence\ObjectManager;
use Gedmo\Exception\InvalidArgumentException;
use Gedmo\Tree\RepositoryUtils as GedmoRepositoryUtils;
class RepositoryUtils extends GedmoRepositoryUtils
@rufinus
rufinus / MandatorType <2.6
Last active August 29, 2015 14:12
Symfony FormType <2.6 what is the >=2.6 way? Without needing OptionsResolverInterface?
<?php
namespace Dpanel\Bundle\AdminBundle\Forms;
use Cwd\GenericBundle\Doctrine\EntityRepository;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use JMS\DiExtraBundle\Annotation as DI;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
@rufinus
rufinus / .gitlab-ci.yml
Created May 31, 2017 05:33
gitlab ci selenium.yml
'E2E tests':
before_script:
- yarn install --force >/dev/null
- /bin/bash -c '/usr/bin/killall -q lite-server; exit 0'
- export DOCKERHOST=$(ifconfig | grep -E "([0-9]{1,3}\\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d ':' | head -n1)
- export E2E_BASE_URL="http://$DOCKERHOST:8000/#."
- lite-server -c bs-config.js >/dev/null &
script:
- node_modules/.bin/protractor ./protractor.conf.js --seleniumAddress="http://localhost:4444/wd/hub" --baseUrl="http://$DOCKERHOST:8000" --browser chrome
- killall lite-server >/dev/null