background preloader

Symfony

Facebook Twitter

Configurer la rotation de log de Monolog dans Symfony2. Plus d'un an que je travaille sur un projet Symfony2 et un jour, le serveur m'a laché, à cause de Symfony2 ou plutôt de mon travail intensif sur le projet. Plus on affiche de page, plus on crée de logs, mais sur un SSD la taille devient vite un problème et un fichier de log qui se rempli depuis plus d'un an sans jamais être vidé ça prend de la place, un peu trop. Si vous ne voulez ou ne pouvez pas configurer la rotation de logs de votre Os, Monolog peut s'en charger pour vous. Il est fourni avec un Handler: "rotating_file" facile à mettre en place et efficace. Il remplace le Handler "stream" et ajoute l'option "max_files" qui permet de configurer le nombre de fichier à garder. La rotation de logs se fait tous les jours, il n'est pas possible de configurer la fréquence. Voici la configuration à mettre dans les fichiers config_*.yml: monolog: handlers: main: type: rotating_file max_files: 10 path: "%kernel.logs_dir%/%kernel.environment%.log" level: debug.

New in Symfony 2.6: Security component improvements (Symfony Blog) This is one of the major changes introduced by Symfony 2.6. Fortunately, it won't affect your applications because it maintains the backwards compatibility. In any case, to prepare for future Symfony versions, you should start learning the new way to deal with security. The reason for this change is that when you inject the SecurityContext in other services, specially those related to Doctrine, you may introduce a circular reference that ends up in an exception. After some community discussions, it was decided that SecurityContext gives too many dependencies to retrieve a simple Token/User object. That's why, starting with Symfony 2.6, the security.context service has been deprecated and split into two new services: security.authorization_checker and security.token_storage. Since this is a 100% backwards compatible change, you don't have to update the code of your applications.

However, in case you want to do it, the changes are subtle:

Symfony2

Saro0h : #SensioLabsTeam @sensiolabs... The Francis Fanclub club - SensioLabs Connect. FrancisBesset : Je le savais ! @fabpot a son... Francisbesset/sfcontextbundle - Packagist. How to generate URLs and send Emails from the Console. Unfortunately, the command line context does not know about your VirtualHost or domain name. This means that if you generate absolute URLs within a Console Command you'll probably end up with something like which is not very useful. To fix this, you need to configure the "request context", which is a fancy way of saying that you need to configure your environment so that it knows what URL it should use when generating URLs. There are two ways of configuring the request context: at the application level and per Command.

Configuring the Request Context globally To configure the Request Context - which is used by the URL Generator - you can redefine the parameters it uses as default values to change the default host (localhost) and scheme (http). Starting with Symfony 2.2 you can also configure the base path if Symfony is not running in the root directory. Note that this does not impact URLs generated via normal web requests, since those will override the defaults. Note. POMM - Pomm - Pomm 1.0.3 is out and development branch forked to 1.1. Francisbesset/sfContextBundle - GitHub.

Announcing the winner of the first Symfony Community Awards. Here we are. The long awaited results of the first Symfony Community Awards are here. Don't scroll down yet! Please get your tuxedo first. Nearly 300 members of the community voted for who they think deserve to be honored by their work. We would like to thank you for your commitment and the hard work you're doing to make the Symfony community strong and proud.

Enough writing, here are the results: 2011 Best Blogger: Javier Eguiluz2011 Best Mailing List Support: Christophe Coevoet2011 Best Forum Support: Jon Hinks2011 Best IRC Support: Dustin Dobervich2011 Best Evangelist: Lukas Kahwe Smith2011 Best Contributor: Ryan Weaver2011 Personality of the year: Fabien Potencier Keep up the good work and see you next year for another edition of the community awards. Connect - Join the Community. PleSoapBundle — BeSimpleSoapBundle v1.0.0-DEV documentation. BeSimple/BeSimpleSoapBundle - GitHub. BeSimple/BeSimpleSoapBundle - GitHub. Nginx configuration for Symfony projects. Recent release of Nginx 1.0.0 triggered me to refresh my knowledge about its configuration options.

There were quite some additions since I looked in the docs for the last time. New variables and directives let me to simplify my configuration for Symfony projects (both 1.x and 2). Configuration The convention says we should put virtual host configurations into /etc/nginx/sites-available/ directory and then link to them in /etc/nginx/sites-enabled/. Rules below define development virtual hosts. We’ll put them into /etc/nginx/sites-available/dev file. Don’t forget about the symbolic link (/etc/nginx/sites-enabled/dev). More about the configuration Nginx listens on the port 80 by default. Our dynamic virtual host will accept every .dev domain (kuba.dev, myproject.dev etc). Alternatively we could simply list one ore more domains (i.e. server_name zalas.eu). Root /var/www/$host/current/web; access_log /var/log/nginx/$host-access.log; error_log /var/log/nginx/dev-error.log error;

Monolog by stof for symfony's symfony-standard - Pull Request - GitHub. Pragmatism over Theory: Protected vs Private. I often favor pragmatism over theory; probably because programming is how I earn a living but also because I don't have any computer science degree and what I know I've learned from my experience. In the recent months, there have been a lot of discussions in the PHP community about the usage of private over protected visibility for methods and properties in Open-Source libraries. To summarize my point of view: "private" is for purists and "protected" is for pragmatic developers. Coming from Perl, I've been a strong advocate of never using private for anything (as far as I remember, there is not a single use of private in symfony1; and until recently, the usage of private was explicitly disallowed in Symfony2 -- it was even part of the Symfony2 coding standards!).

So, why Symfony2 changed its mind? Anyway, a couple of weeks ago, we have started to switch most protected properties and methods to private. First, someone complained about not being able to customize the Routing component. T.co / Twitter. Voilà qui est bien plus beau. #Symfony2. Events and the Event Dispatcher | Symfony Event Dispatcher - Facilitating communication between PHP classes.

Beside being a full-stack framework, Symfony is also a set of decoupled and standalone components. What is a Component? Symfony Components implement common features needed to develop websites. They are the foundation of the Symfony full-stack framework, but they can also be used standalone even if you don't use the framework as they don't have any mandatory dependencies. Installation You can install each component in many different ways: Recommended Install it via Composer (symfony/dashed-component-name on Packagist). For instance, to install the HttpFoundation component: With Composer With Git git clone --branch 2.4 vendor/ With PEAR pear channel-discover pear.symfony.com pear install symfony2/HttpFoundation The Components.

Symfony deployment Cheat Sheet. Fabpot/symfony - GitHub.