We are working on a framework, is mandatory that you have read the framework doc:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
####################### | |
# | |
# THIS IS NOW A REAL GEM (and much improved...): | |
# https://github.com/jm/toml | |
# | |
####################### | |
require 'time' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace MyVendor\MyBundle\Cache; | |
/** | |
* Better than using | |
* $this->getDoctrine()->getManager()->getConfiguration()->getResultCacheImpl()->delete(...); | |
* in your controllers | |
*/ | |
use Doctrine\ORM\Event\OnFlushEventArgs; | |
use Symfony\Component\DependencyInjection\ContainerAware; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\DemoBundle; | |
use Symfony\Component\HttpFoundation\File\UploadedFile; | |
use Symfony\Component\Security\Core\SecurityContext; | |
use Oneup\UploaderBundle\Uploader\Naming\NamerInterface; | |
class UserNamer implements NamerInterface | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<project name="[PROJECT_NAME]" default="build" basedir="."> | |
<property environment="env"/> | |
<loadfile property="version" srcfile="${basedir}/VERSION"/> | |
<condition property="bat" value=".bat" else=""> | |
<os family="windows" /> | |
</condition> | |
<target name="test"> | |
<delete dir="${basedir}/build"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set jsonp = app.request.query.get('callback') %} | |
{% if jsonp %}{{ jsonp }}({% endif %} | |
{% block data %}{% if is_json|default(false) %}{{ data|raw }}{% else %}{{ data|json_encode|raw }}{% endif %}{% endblock %} | |
{% if jsonp %});{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wrap(orig, newDef) { | |
return function(...args) { | |
return newDef.apply(this, [orig].concat(args)); | |
}; | |
} | |
myLib.getTotal = wrap(myLib.getTotal, function(orig, ...args) { | |
let total = orig.apply(this, args) * 0.8; | |
return total + this.getTax(); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
gpg qa.txt.asc | |
gpg staging.txt.asc | |
gpg production.txt.asc |
A Symfony command to convert from NelmioApiDocBundle annotations to Swagger-PHP annotations.
This code is provided as is. Make sure to have your code committed to version control before running the command. Check if things work out and if not, use version control to reset the automated changes and fix the command.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\DemoBundle\Controller; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | |
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; | |
use Acme\DemoBundle\Entity\Book; |
OlderNewer