News Feed
Jobs Feed
Sections




News Archive
feed this:

Lukas Smith:
What is needed to REST in Symfony2
May 06, 2013 @ 10:24:05

Lukas Smith has a new post to his site that asks the question "what's needed to REST in Symfony 2?" In it he talks about some of the current issues surrounding REST support in Symfony (bundles) and a "call to arms" to create something better.

I think we already have quite a nice toolchain for REST in Symfony2 with Bundles like FOSRestBundle, JMSSerializerBundle, NelmioApiDocBundle, FSCHateoasBundle and HautelookTemplatedUriBundle. What is great about these Bundles is that they are all nicely integrated with each other. But there are still some limitations which should be addressed.

Some of the still outstanding issues he points out include issues with content-type and routing, dynamic content in the NelmioApi bundle, Behat context testing, JSONP support and more. He suggests gathering together a product backlog of these items and possibly making a kickstarter to fund its development.

0 comments voice your opinion now!
rest api symfony2 webservice bundle missing features

Link: http://pooteeweet.org/blog/2221

William Durand:
REST APIs with Symfony2 The Right Way
August 02, 2012 @ 12:03:24

In this new post to his site William Durand looks at creating a RESTful API with the help of the Symfony2 framework.

Designing a REST API is not easy. No, really! If you want to design an API the right way, you have to think a lot about everything, and either to be pragmatic or to be an API terrorist. It's not just about GET, POST, PUT, and DELETE. In real life, you have relations between resources, the need to move a resource somewhere else (think about a tree), or you may want to set a specific value to a resource. This article will sum up everything I learnt by building different APIs, and how I used Symfony2, the FOSRestBundle, the NelmioApiDocBundle, and Propel.

It's a long post and covers things very completely with plenty of code samples and descriptions showing you how to use these pieces to make the API. He covers the major HTTP verbs (GET, POST, PUT & DELETE) as well as one of the lesser used ones - PATCH. He also looks at the HATEOAS documentation method and a brief look at using a simple client to do some testing.

0 comments voice your opinion now!
symfony2 api rest tutorial bundle patch


NetTuts.com:
The Essentials of Creating Laravel Bundles
July 18, 2012 @ 10:03:34

Continuing in their series looking at using the Laravel PHP framework, NetTuts.com has posted this latest article focusing on the creation of "bundles" for use in Laravel-based applications.

The Laravel PHP framework offers its bundles system to allow developers to redistribute useful packages of code, or to organize applications into several "bundles" of smaller applications. In this tutorial, we will learn the ins and outs of creating and distributing bundles from scratch. A Laravel bundle has access to all of the features that the framework offers to its host application, including routing, migrations, tests, views and numerous other useful features.

They start with the "when to create a bundle?" question, a combination of the answers to four other questions (like "could others use it?" or "should this just be a library?"). From there they get into the actual code, showing you how to create a basic bundle that works with the Gravatar service to pull an image for a given email address. Also included is a sample unit test, how to implement it in the controller and a sample view that interacts with it to make it all work.

0 comments voice your opinion now!
laravel framework bundle tutorial gravatar


Lineke Kerckhoffs-Willems' Blog:
How to use the Symfony2 SonataAdminBundle
May 23, 2012 @ 10:33:05

In this recent post to her blog Lineke Kerckhoffs-Willems talks about some recent Symfony2 development she's been doing and some of the trials she's come across when trying to implement the SonataAdminBundle to build on their pre-existing Doctrine2 entities.

I have been doing a lot of Symfony2 development lately for our project ProTalk and one of the things we needed was a backend for our database. This should be a fairly simple backend to start with, just an easy way to get data into the database. So I thought I would use the SonataAdminBundle to easy generate this backend based on the doctrine2 entities that we already have. Eventually, I got it working, but it took me some time to find out exactly how, so I thought I'd share my experiences.

Based on some information she found in this other post, she was able to configure and connect it to a "tag" entity. To make it work, however, she needed an empty controller to move forward.

0 comments voice your opinion now!
symfony2 sonata bundle sonataadminbundle tutorial install configure


Stefan Koopmanschap's Blog:
Using git-svn with Symfony2's deps installer
April 03, 2012 @ 10:52:52

In this latest post to his blog Stefan Koopmanschap shares a quick tip about using the git-svn tool with the dependency installer in a Symfony2-based application.

I work a lot with Symfony2's deps file for installing 3rd party bundles into my project (yeah I know, I should be using Composer, right?). This works really well when working with pure Git. However, when you're not using Git on it's own but instead use git-svn, you may run into some issues when issuing git svn dcommit,

One issue relates to a "Failed to read object" error that could come up during the push. His solution involves a few steps (manual ones) to prepare those bundle directories and make it easier to push the rest of your changes. He also includes a few links to other resources that he found around the same topic.

0 comments voice your opinion now!
symfony2 bundle dependencies gitsvn versioncontrol dvcs


Henrik Bjørnskov' Blog:
Symfony2 Quick tip for your security configuration
December 27, 2011 @ 08:40:45

Henrik Bjørnskov has a quick new post with a security tip for those using the Symfony2 framework in its configuration.

Earlier when playing around with the Security component and SecurityBundle i found that for all paths you can specify a route name and the component will match it when check for the request paths.

Setting this up in your configuration gives you more control over the paths that are matched as well as more flexibility in defining them. He includes a note about a change you might have to make to the SecurityBundle's code to get the "check_path" part working correctly. You can find out more about the SecurityBundle's integration in this blog post from Pablo Bandin.

0 comments voice your opinion now!
symfony2 framework security bundle checkpath path


Leasewebs Labs:
Painless (well, less painful) migration to Symfony2
December 23, 2011 @ 11:02:12

Stefan Koopmanschap has written up an article on the Leaseweblabs.com blog about migrating a Symfony 1 application to Symfony2 in a (slightly) less painful way that making the move all at once.

It is much easier to do a gradual migration. Start with one part of your application, and bit by bit migrate your logic and application. The traditional way of doing such migrations is to create a new project and have parallel development on the old and the new version of the application. The problem with this, though, is that when you make a change to your old application, you have to make the same change in the new codebase, essentially doubling the amount of work for each feature you need to implement. [...] You could wrap your old application into your Symfony2 application, and have different parts of your application be handled by different versions of your codebase.

With the help of a bundle he created, IngewikkeldWrapperBundle that handles the rerouting of your requests based on where the requested resource exists (in the Symfony 1 or 2 codebase).

0 comments voice your opinion now!
symfony2 migrate codebase bundle painless


Dzone.com:
Two Symfony2 Bundle Repositories
December 22, 2011 @ 12:05:43

On DZone.com John Esposito has a new post sharing two Symfony2 bundle repositories you can look to to improve your development experience with the framework - KnpBundles and Symfohub.

If you're using Symfony2, you already know that the framework uses 'bundles', the equivalent of plugins, if the core counted as a plugin too. (The official documentation calls bundles 'first-class citizens' in Symfony2.) So far so great idea, but an ecosystem depends on a community, and a community needs some kind of organization. So how is the Symfony2 bundle community organized, and how do you find existing third-party bundles?

KnpBundles provides a larger resource than Symfohub, but both have handy features to help you find what you're looking for - filtering, search recommendations and rankings.

0 comments voice your opinion now!
symfony2 bundle repository knpbundles symfohub


Johannes Schmitt's Blog:
A New Killer Feature for Symfony2 Security
October 31, 2011 @ 14:26:08

Johannes Schmitt has a new post about his "killer feature" he's added to the security for Symfony2 framework (as a bundle) - a new customized expression-based query language that's compiled down to native PHP to make permissions checking simpler and faster.

If you have used the Symfony2 Security Component to any modest degree, you will know that we have a quite heavy voting system which uses attributes like "IS_AUTHENTICATED_FULLY" to make authorization decisions. [...] If you are concerned about performance, then you should not be all too generous with the isGranted() calls. The second option would work as well, but writing a new voter each time you need to make a new check does not really seem ideal either. Fortunately, we can do better.

He includes an example of this expression language in a direct isGranted() call, a string that checks to see if a user has three different roles, and a snippet showing the same thing in the docblock comment of a controller method. The second is a bit more complex, checking for an admin role or if the user is the one that should be deleted. You can find more doucmentation here.

0 comments voice your opinion now!
symfony2 framework security bundle expression language allow deny


Johannes Schlüter's Blog:
Symfony 2 and mysqlnd
October 03, 2011 @ 09:22:52

Johannes Schlüter has a new post to his blog today about a bundle he's created for the Symfony2 framework that integrates some of the advanced statistics mysqlnd provides back to the framework's profiler tool - JSMysqlndBundle.

Symfony provides a nice feature, which is the Symfony Profilier, an extensive logging and reporting system for Symfony developers to understand what's going on. A part of it is the Doctrine query logger which lists all database queries executed by Doctrine and their execution time. This is nice but when we're using mysqlnd in our PHP build we have more information available. "So why not use that information," I thought and built a new bundle for Symfony 2 doing exactly that.

His bundle takes the "150 or so" statistics and drops them into the profiler, giving you even more insight into how your script is running. The bundle is available on github, making it simpler to fork and extend to add other features (some he suggests include caching and replication decisions using information from other mysqlnd plugins).

1 comment voice your opinion now!
mysqlnd symfony2 profiler mysql bundle



Community Events











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


example object zendframework2 testing introduction unittest opinion community code functional language application interview release tool series phpunit development framework podcast

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