Skip to content

Instantly share code, notes, and snippets.

View lolautruche's full-sized avatar

Jérôme Vieilledent lolautruche

View GitHub Profile
@lolautruche
lolautruche / .symfony.cloud.yaml
Created March 3, 2021 10:15
[SymfonyCloud] Install Blackfire up-to-date probe and agent manually
# A unique name for this application
name: 'my-app'
# The language and version to use
type: 'php:7.4'
runtime:
extensions:
- apcu
- redis
@lolautruche
lolautruche / autocomplete.php
Created July 16, 2017 09:31 — forked from pspanja/autocomplete.php
How to implement suggest/autocomplete for Solr Search Engine for eZ Platform
<?php
namespace Vendor\Bundle\ProjectBundle\Core\Search\Solr\Query\Content\FacetBuilder;
use eZ\Publish\API\Repository\Values\Content\Query\FacetBuilder;
class SuggestionFacetBuilder extends FacetBuilder
{
public $prefix;
}
https://gist.github.com/anonymous/05db9797771918c31635
<?php
$foo = function (&$arg) {
var_dump($arg);
};
$a = 'bar';
$b =& $a;
// Warning: Parameter 1 to {closure}() expected to be a reference, value given in /Users/lolautruche/Desktop/reference.php on line 8
call_user_func_array($foo, [$b]);
@lolautruche
lolautruche / 00 - parameters.yml
Last active August 29, 2015 14:07
Assetic and eZ dynamic settings
parameters:
acme.my_siteaccess.css.files:
- "foo.css"
- "some_dir/bar.css"
@lolautruche
lolautruche / 00 - services.yml
Last active August 29, 2015 14:07
Dynamic settings injection 4/4, as of eZ 5.4 / 2014.09 - 3rd party parameters
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
# "acme" is our parameter namespace.
# Null is the default value.
acme.default.some_parameter: ~
acme.ezdemo_site.some_parameter: foo
acme.ezdemo_site_admin.some_parameter: bar
services:
@lolautruche
lolautruche / 0 - services.yml
Last active August 29, 2015 14:07
Dynamic settings injection 3/4, as of eZ 5.4 / 2014.09 - Constructor injection
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
services:
acme_test.my_service:
class: %acme_test.my_service.class%
arguments: ["$languages$", "$content.tree_root.location_id$"]
@lolautruche
lolautruche / 00 - services.yml
Last active August 29, 2015 14:07
Dynamic settings injection 2/4, as eZ 5.4 / 2014.09 - Setter injection
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
services:
acme_test.my_service:
class: %acme_test.my_service.class%
calls:
# Will resolve ezsettings.<current_siteaccess>.languages
- [setLanguages, ["$languages$"]]
- [setRootLocationId, ["$content.tree_root.location_id$"]]
@lolautruche
lolautruche / 00 - services.yml
Last active August 29, 2015 14:07
Dynamic settings injection 1/4, before eZ 5.4 / 2014.09
parameters:
acme_test.my_service.class: Acme\TestBundle\MyServiceClass
services:
acme_test.my_service:
class: %acme_test.my_service.class%
arguments: [@ezpublish.config.resolver]
@lolautruche
lolautruche / pagelayout.html.twig
Created September 22, 2014 07:36
eZ language switcher and legacy routes
{# Pagelayout from SiteBundle #}
{% block menu %}
{# Assuming you may have your own menu markup here as well #}
{# Defaults to the current route, unless routeRef is already defined #}
{% set routeRef = routeRef|default( ez_route( params={"language": "esl-ES"} ) ) %}
{% endblock %}