Archive pour la catégorie ‘symfony’

More with symfony: a whole chapter devoted to the sfFacebookConnect Plugin

Mercredi 2 décembre 2009

December just started, and with it its usual christmas spirit, Santa Claus, happy children and.... the symfony advent calendar!

This year the symfony advent calendar is a collection of articles written by different symfony experts:

http://www.symfony-project.org/blog/2009/12/01/one-more-thing

and is already available as a book on Amazon!

http://www.amazon.com/exec/obidos/ASIN/2918390178

I had the chance to contribute and write an article on developing for Facebook with symfony. This was the perfect occasion to finally sit down and write 15 pages on the experience I gathered on this specific subject. I had already collected it in the sfFacebookConnect plugin but it was lacking documentation. Well here it is finally! At least on Amazon and in a few days as part of the new symfony advent calendar.

Enjoy and do not hesitate to make a critical feedback, the article will be included with the plugin and can still evolve a lot!

A Facebook Connect plugin for symfony

Lundi 24 août 2009

As promised during the last symfony live conference, I finally release my current work on a Facebook Connect Plugin for symfony. It is inspired by the good sfFacebookPlugin by Jonathan Todd, which has however been unmaintained for quite some time. Since Facebook's platform is evolving every week and my focus was not on the Facebook platform but on the Facebook Connect functionality, I decided to create this new plugin.

It is for the moment VERY beta. It is used in two projects, http://www.allomatch.com which is a symfony 1.0/propel project and another project on symfony 1.2/doctrine. It is therefore compatible with both Doctrine and Propel. However some issues remain concerning 1.0 and 1.2 versions regarding some options, the tasks for example.

For the installation, the README is a good start but FAR from complete. I invite you to browse through the code to understand the logic and comment on this post if you have any question regarding installation. This will force me to improve the README.

I intend to improve the documentation in the very near future, so if you are not in a hurry, please wait. However I have already received dozens of mails concerning the current status, so I release it for those who need to start a project using Facebook Connect right now.

Here is the link to the plugin:

http://www.symfony-project.org/plugins/sfFacebookConnectPlugin

And here the presentation made at the sflive conference:

http://www.symfony-live.com/pdf/sflive09fr/theodo-symfony-facebook.pdf

sfEasyGMapPlugin 1.0.4 out

Mercredi 3 juin 2009

sfEasyGMapPlugin 1.0.4 is out and the good news is : the plugin is the 24th most used symfony plugin among the 457 available on http://www.symfony-project.org/plugins/ ! We are now 5 official developers, not counting all the developers I work with who contribute indirectly.

It all started because I was amazed by the success of the Phoogle library on the Internet despite its limited number of functionalities. And since almost all my projects involved a Google Map I wanted to create a plugin containing all the core functionalities I always reuse. Now I am happy to see the popularity of the plugin and am looking forward further possible developments that will continue in the spirit of including as many core functionalities of Google Maps-based application in the plugin.

New functionalities for the moment include :

  • More precise Mercator projections to convert GPS coordinates into Google Pixel coordinates and back GMapCoord::fromPixToLat, GMapCoord::fromLatToPix, etc.
  • Added the GMapBounds::getBoundsContainingMarkers(...) function
  • Added the GMap::centerAndZoomOnMarkers() function which enables to guess zoom and center of the map to fit the markers. Center is easy to guess. Zoom uses width and height of smallest bound, pixel width and height of the map and Mercator projection
  • Added tomr's contribution: it is now possible to add multiple controls to the map
  • Added the GMapCoord::distance($coord1, $coord2) function which gives an estimation of the distance between two coordinates
  • Added the very useful function $gMap-> getBoundsFromCenterAndZoom(...) which enables one to calculate server-side the bounds corresponding to specific center coordinates, zoom, and map size. This is the equivalent of the client-side map.setCenter(...,...);map.setZoom(...);map.getBounds(); It uses the Mercator projection formulas as used by the Google Maps
  • A new function $gMapMarker->isInsideBounds($bounds)
  • A lot of unit tests
  • And two new samples

Please, feel free to suggest what you consider typical core functionalities of your Google Maps-based applications.

Symfony Google Maps API plugin : sfEasyGMapPlugin v1.0 is out !

Vendredi 13 mars 2009

sfEasyGmapPlugin is a very easy to use Google Maps API plugin for symfony, inspired by the Phoogle class... but better :-)

A very simple version has been available for a few months but I have now finally released the 1.0 version,  with the following new features :

- it is now sf1.2 compatible straight out of the box
- it has some unit tests
- the GMap constructor now takes an array of parameters, which is much more flexible and also more in the symfony coding spirit (Warning : the modification of the GMap constructor should break your application if you used the prior version of sfEasyGMapPlugin)
- there are interesting functions concerning Bounds :
- smallest enclosing bound
- propel criteria "in bounds"
- homothety transformation
- zoomOut transformation
- there are interesting functions concerning conversion from/to lat/lng to/from Google's pixel coordinates system. These can be very useful if you want to guess the bounds knowing only the center lat/lng, the zoom level and the map's width/height in pixels. They involve a few mathematical formulas that were not so straightforward, (since you need to understand how Google's projection works) so trust me, these functions are valuable, even if they only concern power users.

I have also developed a few doctrine-specific functions which are unfortunately not available yet because not generic enough. I will try to release them in the next version.

The official symfony page is here : http://www.symfony-project.org/plugins/sfEasyGMapPlugin

Please feel free to comment on this work in progress !

Integrate Wordpress into symfony

Vendredi 6 mars 2009

What better topic to start this technical blog about symfony than to talk about my experience of integrating Wordpress into symfony !

I was looking for a nice blogging solution for symfony, and all I found was a very simple plugin and a lot of people encouraging me to build my own blog. Even though it is a nice exercise, my philosophy is to not reinvent the wheel. Wordpress is surely the best free blogging tool available, so I preferred to spend time integrating it into my symfony application than to create yet another sfVeryEasyBlogPlugin.

Integrating Wordpress into symfony can be done in three steps : Lire le reste de cet article »