Skip to content

Instantly share code, notes, and snippets.

Avatar

Joel Wurtz joelwurtz

View GitHub Profile
View serializer-refacto.md

Hello,

AbstractObjectNormalizer has a long list of ongoing issues and pull request, we got a talk at Paris Symfony Live with @dunglas @fbourigault and @soyuka on how we want to move forward, here is a resume of our talk and what we would like to achieve for the future:

Current State and Context

At the origin this normalizer was done for API Platform and many other third party libraries / project, in order to have a normalizer that is able to normalize and denormalize any data object (specifically doctrine entities). ObjectNormalizer, PropertyNormalizer and GetSetMethodNormalizer were already existing, but were having slightly different beahvior, that's why two abstract class were created AbstractNormalizer and AbstractObjectNormalizer

Over time, lots of missing features in the ObjectNormalizer were added on both the AbstractObjectNormalizer and the AbstractNormalizer as these features were also needed there.

View gist:92525e6a37b670b05b3489b19c2548c7
FROM alpine:3.4
RUN apk --update add python py-pip && \
rm -rf /var/cache/apk
RUN pip install Sphinx --no-cache-dir && \
pip install sphinx_rtd_theme --no-cache-dir && \
pip install alabaster --no-cache-dir && \
pip install sphinx_bootstrap_theme --no-cache-dir
@joelwurtz
joelwurtz / gist:c06bcfbb6766cb2b1d53
Last active Mar 27, 2018
Zlib Stream PHP WTF :/
View gist:c06bcfbb6766cb2b1d53
<?php
// Filter for zlib compress (RFC 1950)
stream_filter_append($resource, 'zlib.deflate', ['window' => 15]);
// Filter for deflate (RFC 1951)
stream_filter_append($resource, 'zlib.deflate', ['window' => -15]);
// Filter for gzip (RFC 1952)
stream_filter_append($resource, 'zlib.deflate', ['window' => 31);
@joelwurtz
joelwurtz / cmd
Created Apr 7, 2015
Environments with fabric
View cmd
$ fab -l
Available commands:
production.cleannn
production.deploy
staging.deploy
@joelwurtz
joelwurtz / run.sh
Created Dec 9, 2014
Rabbitmq as a service under docker (altmost right) :/
View run.sh
#!/bin/bash
chown -R rabbitmq:rabbitmq /data/log
chown -R rabbitmq:rabbitmq /data/mnesia
HOSTNAME=$(hostname)
PID_FILE="/data/mnesia/rabbit\@$HOSTNAME.pid"
function start()
{
View gist:8007427292d558dad061
<?php
header('Content-type: application/octet-stream');
header('Content-Disposition: attachment; filename="backup.sql"');
passthru('mysqldump --all-databases');
@joelwurtz
joelwurtz / gist:5188891
Created Mar 18, 2013
php.ini.erb file example for chef cookbook
View gist:5188891
[PHP]
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
engine = On
short_open_tag = Off
asp_tags = Off
precision = 14
y2k_compliance = On