News Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Benjamin Eberlei:
Symfony All The Things (Web)
October 27, 2014 @ 09:18:52

In his latest post Benjamin Eberlei talks about some of his reasoning to want to Symfony all the things when it comes to building web applications. Actually, it's the results of a discussion he had with a coworker about when is the right point to move from a micro-services infrastructure to a full-stack framework like Symfony.

We use microservice architectures for the bepado and PHP Profiler projects that Qafoo is working on at the monent. For the different components a mix of Symfony Framework, Silex, Symfony Components and our own Rest-Microframework (RMF) are used. This zoo of different solutions sparked a recent discussion with my colleague Manuel about when we would want to use Symfony for a web application.

He talks about some of his own reasons for making the choice including things like the HttpKernel and having a well documented and standardized solution. He notes that most of his reasons are more because of his previous exposure to the framework and could be very similar for others and other frameworks, though. He then extends on the "Hello World" code from the previous post and makes an improved minimal Symfony app with just seven basic parts (including configuration files).

0 comments voice your opinion now!
symfony framework minimal reasons preference webapp

Link: http://www.whitewashing.de/2014/10/26/symfony_all_the_things_web.html

Web Mozarts:
Defining PHP Annotations in XML
October 24, 2014 @ 11:10:53

The Web Mozarts blog has an interesting new post today that talks about using annotations in your PHP code to define the attributes in resulting XML that could be generated dynamically from your objects.

Annotations have become a popular mechanism in PHP to add metadata to your source code in a simple fashion. Their benefits are clear: They are easy to write and simple to understand. Editors offer increasing support for auto-completing and auto-importing annotations. But there are also various counter-arguments: Annotations are written in documentation blocks, which may be removed from packaged code. Also, they are coupled to the source code. Whenever an annotation is changed, the project needs to be rebuilt. This is desirable in some, but not in other cases.

They focus in on Symfony-based applications as a good base to work from (as they've pushed to have annotations work in the code for things like routing and data type definition). He starts with an example Doctrine class - a "best buddy" for Symfony as far as annotations go - and how the annotations define the different properties. He also includes an example of the XML output of the same definition generated through an "AnnotationReader" instance. He talks about having multiple XML documents representing one object with different annotations put in each, including the XML output. The post finishes with some advantages including the ease of validation by XML-friendly tools looking to interface with the application.

0 comments voice your opinion now!
annotations xml tutorial symfony doctrine example

Link: http://webmozarts.com/2014/10/24/defining-php-annotations-in-xml/

Symfony Blog:
SymfonyCon Madrid 2014 Entire speaker line up revealed!
October 23, 2014 @ 12:56:41

In this latest announcement on the Symfony blog they've announced the release of the full schedule for the upcoming SymfonyCon Madrid 2014 (happening near the end of November). The lineup includes:

  • "Growing and managing communities for large Open Source projects" by Jen Lampton
  • "Life After Assetic: State of the Art Symfony 2 Frontend Dev" by Michelle Sanver
  • "Feature Flags with Symfony" by Benjamin Eberlei
  • "The Twelve-Factor App: Best Practices for PHP on Platforms-as-a-Service" by David Zuelke
  • "Implementing data synchronization API for mobile apps with Silex" by Michele Orselli

The event will also include a keynote from Fabien Potencier and close with a look at profiling in PHP from the same. You can find out more about the conference and pick up your own tickets on the main conference site.

0 comments voice your opinion now!
symfonycon madrid speaker lineup released symfony conference

Link: http://symfony.com/blog/symfonycon-madrid-2014-entire-speaker-line-up-revealed

Symfony Blog:
The Symfony Project turns 9!
October 22, 2014 @ 11:50:14

There's some major news from the Symfony project (with matching post on their blog) worth celebrating - the framework and project are celebrating nine years since the first commits were made by Fabien Potencier himself.

Where does the time go? This milestone reminds us all of how Symfony has become an important part of our professional lives and been changing the way we work with code for almost a decade! (We won't even talk about the whole "we're all getting older" thing!) [...] Over the last several years, the Symfony project has completely and continually reinvented itself. Originally a pure MVC framework with some auto-magical features, now it's both a set of decoupled components and a full-stack Request-Response framework backed by a vast development community.

They also talk some about the Symfony community and include a special thanks to all of the developers that have contributed their talents, both in code and documentation, to the framework over the years.

0 comments voice your opinion now!
symfony framework anniversary celebrate nine years

Link: http://symfony.com/blog/the-symfony-project-turns-9

SitePoint PHP Blog:
Drupal 8 Hooks and the Symfony Event Dispatcher
October 21, 2014 @ 13:14:53

The SitePoint PHP blog has a new tutorial posted today showing the interaction between Drupal 8 hooks and the Symfony dispatcher in the last part of their series showing how to build a custom Drupal 8 module.

With the incorporation of many Symfony components into Drupal in its 8th version, we are seeing a shift away from many Drupalisms towards more modern PHP architectural decisions. For example, the both loved and hated hook system is getting slowly replaced. Plugins and annotations are taking away much of the need for info hooks and the Symfony Event Dispatcher component is replacing some of the invoked hooks. Although they remain strong in Drupal 8, it's very possible that with Drupal 9 (or maybe 10) hooks will be completely removed.

He starts off with a brief introduction to what the event dispatcher is and how it currently interacts with the Drupal 8 system. He uses a simple form example with two text fields and how to hook in the dispatcher to fire a "demo_form.save" event when the user submits the form. He ties this into a DemoEvent and sets up a simple subscriber. He ends the article with a look at using hooks to achieve the same kind of goal.

0 comments voice your opinion now!
drupal8 tutorial hooks event dispatcher symfony component

Link: http://www.sitepoint.com/drupal-8-hooks-symfony-event-dispatcher/

Qandidate.com Blog:
Using the Accept Header to version your API
October 20, 2014 @ 12:56:46

On the Qandidate.com blog today there's a new tutorial talking about the use of the Accept header in REST HTTP requests and, more specifically, working with it in a Symfony-based application.

I investigated different ways to version a REST API. Most of the sources I found, pretty much all said the same thing. To version any resource on the internet, you should not change the URL. The web isn't versioned, and changing the URL would tell a client there is more than 1 resource. [...] Another thing, and probably even more important, you should always try to make sure your changes are backwards compatible. That would mean there is a lot of thinking involved before the actual API is built, but it can also save you from a big, very big headache. [...] Of course there are always occasions where BC breaks are essential in order to move forward. In this case versioning becomes important. The method that I found, which appears to be the most logical, is by requesting a specific API version using the Accept header.

He shows how to create a "match request" method in his custom Router that makes use of the AcceptHeader handling to grab the header data and parse it down into the type and API version requested. He also includes an example of doing something similar in the Symfony configuration file but hard-coding the condition for the API version by endpoint.

0 comments voice your opinion now!
accept header rest api versioning symfony tutorial

Link: http://labs.qandidate.com/blog/2014/10/16/using-the-accept-header-to-version-your-api/

Joshua Thijssen:
Deepdive into the symfony2 security component part 1
October 20, 2014 @ 10:26:33

On the latest post on his site Joshua Thijssen has kicked off a series taking a deep dive into the Symfony security component, a key piece in the security of Symfony-based applications. In this first part of the series he introduces the component and starts in on some of the features it offers.

Once in a while I like diving into code and see how things work under the hood. And as the symfony2 framework consists of many different components, bundles and bridges, there is a lot to discover. But ultimately, the code itself mostly isn't really as complex as it might seem from the outside world: just like a good magic trick, once unraveled, it all seems very simple and makes sense.

However, this is not true for one of those components: the security component. This black box full of dark magic doesn't like to give up its secrets, and after some (miserably) failed attempts, I am trying to unravel it once more in a few blog posts. Either we achieve complete victory, or fail yet again.. At this point, I will give both fair odds.

He starts off with an overview of the component, pointing out the two main things is handles: authentication and authorization. He also pulls in a few other things to do with security in Symfony to give a more complete, well rounded picture - the component itself, the security bundle and security bridges. He gets into a bit more detail about this last one and describes their specific use.

0 comments voice your opinion now!
symfony security bundle component overview deepdive series part1

Link: https://www.adayinthelifeof.nl/2014/10/19/deepdive-into-the-symfony2-security-component-part-1/

Matthias Noback:
Unnecessary contrapositions in the new "Symfony Best Practices"
October 15, 2014 @ 12:29:31

Matthias Noback has a new post today with some of his thoughts about the recently released Symfony Best Practices book and some "unnecessary contrapositions" and things he sees that could help improve the perception of the book and the advice it provides.

Of course I'm going to write something about the new Symfony Best Practices book that was written by Fabien Potencier, Ryan Weaver and Javier Eguiluz. It got a lot of negative responses, at least in my Twitter feed, and I think it's a good idea to read Richard Miller's post for some suggestions on how to deal with an "early preview release" like this and how we can be a bit more positive about it.

He emphasizes the "staying positive" aspect of his message and points out that while some of the suggestions are good, they may not be the "best" in all circumstances. His main point, though, is that he thinks the way the book was introduced (the wording of the post) was unfortunate and cast a more negative light on the work done previously around Symfony best practices and advice. He recommends changing things around a bit in both the messaging and the book itself to take the focus away from the "you're doing it wrong" and encourage people to do it the way they recommend, casting a more positive spin on it all.

0 comments voice your opinion now!
symfony bestpractices guide reaction opinion positive

Link: http://php-and-symfony.matthiasnoback.nl/2014/10/unnecessary-contrapositions-in-the-new-symfony-best-practices/

Joshua Thijssen:
Symfony2 logging out
October 10, 2014 @ 10:51:03

In this new post to his site Joshua Thijssen talks about something that's usually considered a common task and might be overlooked when it comes to security: logging out (specifically in Symfony-based applications).

One of the "golden rules" of symfony2 is to never hardcode urls or paths inside your code or templates. And letting symfony deal with the generation of your urls and paths makes your life a lot easier as a developer. But one of the things I see regularly is that people are still hardcoding their logout urls like using "/logout". But logging out is actually a bit more complex than it might seem, and using a simple /logout might work for most cases, but there are better ways to deal with this.

To give some context, he starts with an overview of the Security component of the Symfony framework, mentioning how it can be configured with different "secure" areas and how they handle the user authentication. He includes an example configuration of one of these "firewalls" in a YAML document with three different sections: "dev", "superadminstuff" and "main". He explains what each of these sections are configuring and how they will react when the user visits them. He talks some about the "logout: true" handling and what kind of defaults are also included when it's called. He suggests that, instead of a hard-coded "logout" URL in your application, you make use of the "logout_url" and "logout_path" functions to create the link for you, making it consistent across the application and easier to configure.

0 comments voice your opinion now!
symfony logout security user login component link

Link: https://www.adayinthelifeof.nl/2014/10/06/symfony2-logging-out/

Symfony Blog:
Introducing the Official Symfony Best Practices
October 09, 2014 @ 11:53:51

On the Symfony blog today they've officially announced the Symfony Best Practices initiative that's being ramped up to help provide a solid resource for Symfony developers and guide them towards more correct development within the framework (and its components).

Since the publication of Symfony 2.0, the Symfony Community has created an unofficial set of recommendations for developing Symfony2 applications. Unfortunately, a lot of these recommendations are in fact wrong. They unnecessarily overcomplicate things and don't follow the original pragmatic philosophy of Symfony.

This guide, soon to be published at http://symfony.com/best-practices will share 31 of the best practices gathered by Fabien Potencier, Ryan Weaver and Javier Eguiluz from their own experience and the practices the community has found along the way. The things in this guide will be optional, not required, to make Symfony-based applications work, so don't worry if you're not following them exactly.

0 comments voice your opinion now!
symfony bestpractices guide official fabienpotencier ryanweaver javiereguiluz

Link: http://symfony.com/blog/introducing-the-official-symfony-best-practices


Community Events





Don't see your event here?
Let us know!


language library install list framework interview laravel opinion deployment tips symfony bugfix podcast package release community series voicesoftheelephpant introduction api

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework