P'unk Avenue Window

Archive for ‘Development’

#slive2010 Liveblogging: Fabien Potencier: Symfony 2.0

February 17th, 2010 by Tom 7 Comments

I am liveblogging Fabien Potencier’s Symfony 2.0 presentation. Bear with me and my editorial errors, simplifications and bare-faced libels.

My own opinions are in parentheses.

They are setting up now.

“Symfony 2.0 Reloaded” Preview Release

“I’ve decided to do the session in French” heh

In 10 minutes you will discover the shiny new version of Symfony, Symfony 2.0. Symfony 2 is just awesome. But first a bit of history.

Symfony 1.0 released in January 2007. Started as glue between existing libraries: Mojavi, Propel, Pardo i18n, …

“How many of you are still using 1.0?” [Some hands go up] “Ohhhhh!” [Hey, I raised my hand too, I have to support existing projects after all, heh. Our new stuff is all 1.4]

With Symfony 1.2 in November 2008, decoupled but cohesive components wre rolled out: forms, routing cache, YAML, ORMs… but still the same core.

Symfony 1.4 – November 2009. Added polish on existing features. Removed the support for deprecated features. Current LTS released, maintained until late 2012.

What is Symfony 2.0? The next version of course… except Symfony now takes an ‘S’ instead of an ’s’. That’s the big difference!

Talk about Symfony 2 with a capital S please! Symfony 1 (uppercase) does not make any sense, symfony 2 does not make sense! It’s all about Symfony 2. “I’m quite picky.”

“Same philosophy, just better.” We’ve learned a lot from our mistakes. We’ve learned a lot… we have problems with Symfony 1, but not all are fixable. It requires breaking backwards compatibility. So we need to go forward.

Symfony 2 is still an MVC framework.

It’s probably more of a Fabien-style framework than anything else (his words not mine (: ).

MTV: Model, Template and View?

Highly configurable and extensible. Same Symfony Components (DI, events, request, etc), same great developer tools, full featured.

Everything is upgraded to PHP 5.3. (Great, I hope they debug PHP 5.3 by the time Symfony 2.0 is complete!)

OK, but why a major version # change then?
(more…)

Doctrine 2: Jonathan Wage at #sflive2010

February 16th, 2010 by Tom 1 Comment

I’m attending Symfony Live. Below are my notes from Jon Wage’s presentation on the upcoming Doctrine 2.0. My more opinionated, less explanatory comments tend to be in parentheses. Everything paraphrased brutally to keep up.

“Not the same old PHP ORM”

100% re-written codebase for PHP 5.3

“Are you scared? You shouldn’t be! Change is a good thing!”

5,000 records hydrate in 1.4 seconds. Whee!

10,000 records in 3.5 seconds.

Twice the data and still faster than Doctrine 1.

% improvement over Doctrine 2 is big. PHP 5.3 is a big win with a heavily OO framework. Better optimized hydration algorithm. New query and result caching implementations. All around more explicit and less magical code. Killed the magical aspect of Doctrine 1.

“The only valid measurement of code quality: WTFs/minute”

Good code: “WTF….. WTF”

Bad code: “WTF WTF WTF WTF WTF WTF”

(more…)

#sflive2010 Geoffrey Bachelet, Symfony Internals

February 16th, 2010 by Tom 1 Comment

I’m attending the Symfony Live conference. Below are my notes from Geoffrey Bachelet’s presentation on Symfony Internals. Geoffrey Bachelet wrote the “Symfony Internals” chapter of the Symfony book.

He wrote the Symfony Internals chapter

Customizable, flexible, extensible

Extensible through plugins, events, and overriding entire framework classes

The bootstrap retrieves application configuration, then instantiates sfContext and calls the frontend controller

sfContext implements the Singleton design pattern. Has pros and cons: mostly cons. Testability issues. Responsible for loading factories.

Application configuration: frontendConfiguration extends ProjectConfiguration, shares methods and constructors. Most customization happens in ProjectConfiguration.

ProjectConfiguration crewates an event dispatcher, then loads plugins.

sfEventDispatcher is available as a separate component. Implements the Observer design pattern. An object can register interest in events.

autoload.filter_config event allows you to customize the autoloader configuration.

There are more than 900 plugins in the repository today.

settings.yml holds all framework leve settings, there are a lot of them. Actions, security strategies, I18N, debug bar, etc.

app.yml is for your use. config/app.yml is a project wide app.yml, we rarely use that.

Environments allow you to specify different behavior for different environments. Different database, mailer strategy, etc.

(more…)

Symfony live: John Cleveley on the admin generator

February 16th, 2010 by Tom 4 Comments

John Cleveley @jcleveley on the Symfony admin generator
@jcleveley gave an excellent talk on the Symfony admin generator at #sflive2010. Here are my notes.

View more presentations from jcleveley.

He’s using Zend Framework at the moment but has done a lot of good Symfony work in the past

“Backend development” photo of a zoopeeper holding up a trash can to an elephant’s rump very nice.

John worked with the NHS for a while, they were using Excel spreadsheets for complex workflows, web apps were a big change for the better

A big fan of the admin generator: “it’s super awesome”

Provides most common admin requirements out of the box (CRUD: Create, Retrieve, Update, Delete actions to manage more or less any type of information)

Can be extended to meet bespoke needs

What’s new since 1.0? “Completely re-written for the form framework”

(more…)

Thomas Rabaix: internationalization and Symfony

February 16th, 2010 by Tom No Comments

Hi folks, I’m attending Symfony Live 2010. These are my notes from Thomas Rabaix’s talk on internationalization in Symfony, with a few offhand remarks of my own.

Thomas Rabaix talk on internationalization

URL: routingModel: doctrine + propel
Form: sfForm

Most of the 18n is based on Prado framework
ICU data updated in sf1.3/sf1.4
You need

all:
  .settings:
    i18n: true
    default_culture: en

Culture detection

HTTP request -> culture in URL

If no culture in URL, culture in session

What about culture in the header?

Updates sfRouting, sf18n, executes controller

We’re not big on culture in URL in apostrophe since the session can do it but it’s nice to be able to bookmark.

sfContext::getInstance()->getUser()->setCulture('fr')

Notify the user.change_culture event (this doesn’t do the changing, it just notifies other things that care; why doesn’t setCulture do this for us?)

recipe_esarch:
  url: /:sf_culture/recipe/view

Example: /en/recipes/search => sf_culture = en

(more…)

Apostrophe 1.0!

February 11th, 2010 by Geoff 3 Comments

We have labored long and hard to prepare for the 1.0 release of Apostrophe. As we said before, it has been stable and in use for a long time now, but we wanted to mark a moment in time with an official release.

Probably the easiest way to get a feel for Apostrophe is to go to our demo site and login. The user name is “admin” and the password is “demo”. Keep in mind that the content resets itself every hour on the hour.

If you want to get your bearings before you you do that, head over to the newly revamped Apostrophe site. For the very interested, you should consider checking out our extensive README which includes an Installation section, an Editor’s guide, a Designer’s guide and a Developer’s guide.

Now for some of the highlights.

Slots!

Apostrophe Slot Buttons

There are rich text, image, slideshow, video, button, PDF, Raw HTML, and other slots built in. If you have used Apostrophe before, you know that you can add a slot on a page, choose what you want to place and then reorder it. New custom slots can also be made for any project.

Slot Options

Apostrophe Slideshow: Compact Option

For some time we have wanted to be able to give you more fine control of a specific slot. For instance, what if you wanted to make the background color of a some text slots yellow, and some white? In the past that would have required two slots. Now, it can just be an option of the same text slot. In this screenshot, you can see that we allow you to switch between different types of slideshows. Make sure you try that out in the demo. It is probably our favorite new feature. We really sweated the details on making sure the option control was contextual. We hope you appreciate the effort.

There are many other new features and highlights, but for the moment I will leave you to find them in the demo (remember: user is “admin” and password is “demo”) or in the documentation. (We promise to highlight these in future posts.)

So, what does this mean to you?

Well, it depends. If you are a PHP developer with Symfony skills you can get started today. From our README:

Right now Apostrophe is best suited to PHP developers who want to make an intuitive content management system available to their clients. Apostrophe is very easy for your clients to edit, administer and maintain once it is set up. Right now, though, Apostrophe installations does call for some command line skills and a willingness to learn about Symfony. We are working to reduce the learning curve.

If you are a front-end developer and want to get started using Apostrophe, talk to us. We are in the process of working out a package where we set up a staging server with Symfony and Apostrophe running on it. We would train you on templating in Apostrophe and you should be up in running in a day or two.

If you don’t want to go that route, here is what we suggest:

Front-end developers who do not yet have PHP and Symfony skills but wish to set up an Apostrophe site by themselves should consider tackling the Symfony tutorial to get up to speed. It’s not necessary to complete the entire tutorial, but it helps to have at least a passing familiarity with Symfony.

If you just think Apostrophe is rad and you want one… like now, just drop us a line. We would be happy to design and implement an Apostrophe site for you. You would be joining some good company if you do.

Surprise!

We (more accurately Tom) decided to build an extra slot last night as a gift for making you wait an extra day. Isn’t that nice of us (him)?

If you are observant you may have noticed an extra slot in the screenshot above. So without further ado, we present the Feed Slot (commonly referred to as the RSS Feed slot, but it will take Atom feeds as well). Use this to bring in your Twitter updates or maybe our Apostrophe SVN code commit feed.

Feel free to thank us anytime. (We like expensive beer.)

This is really just the beginning. We hope you have an opportunity to check out Apostrophe. We would love to hear from you if you do. Comments below would be much appreciated (and read), as well.
__________________

Don’t forget to follow us on Twitter for on-going updates: @apostrophenow

If you are a developer, the Apostrophe Trac is the home of the open source community. On that site you can open support tickets, browse and contribute to the Wiki, and access and potentially contribute to the source code via svn (you’ll need to contact us if you want write access).

Also, please join the Apostrophe Google Group if you want to tap into the community of people using Apostrophe to get support and help.

Oh So Close!

February 10th, 2010 by Geoff 2 Comments

We have decided to push back the release of Apostrophe 1.0 until tomorrow.

We are truly in the home stretch. Just hitting a few bugs, finishing up documentation and adding some instructional content to the demo site. To tide you over, we are publishing this screencast of how you add video to a project by searching YouTube from within Apostrophe. Note how we bring in associated metadata (url, title, etc). For the record, you can add video by pasting in embed codes from countless other services like Viddler and Vimeo.

Please tune back in tomorrow.

P.S. We are not blaming the snow for the delay, but did want to note that we are certainly under a deep white blanket here in Philadelphia.

punkave.com is way cooler now!

December 23rd, 2009 by Rick 1 Comment

Not to toot our horn or nothin, but we’ve just launched a new site for ourselves. At 6:05pm on the last business day of the year we’ve cobbled our children some new shoes. It was a lot of fun making Apostrophe flex a little to suit our own needs. We figured it was time to drink our own koolaid. And it’s almost fully debugged (degrades gracefully) in IE.

So go check out our shiny new site!

To Geoff, Alex, John, Tom, (and if you didn’t know we’ve recently expanded to include) Dan, and Jake:

cheers

Cheers bros! It’s been a wonderful year.

Give PNG a Chance

December 13th, 2009 by Tom No Comments

When I led the PNG working group and edited the first ten drafts of the PNG file format specification, I hoped that PNG image files would swiftly replace GIFs.

I was wrong about that. Netscape, which had offered nary a word of input during the specification process, came out with animated GIF support just as PNG was being finalized as a still image format. Doh!

All the same, PNGs are everywhere. They are all over the web (though still not as common as GIFs). And they are “under the hood” in many products, including Microsoft Office.

A lot of people don’t quite get what PNG is good for, and what it isn’t good for. 8-bit PNG (“png8″) is a great replacement for non-animated GIFs, and png24 is a great format for lossless storage of truecolor, high-resolution originals. But for web distribution of a truecolor, photorealistic image, you almost certainly want a lossy-but-tiny JPEG file.

Many people also don’t realize that PNGs are supported in Internet Explorer 6, with certain caveats, and fully and beautifully supported in later versions of Internet Explorer… and of course the rest of the “good” browsers. Apart from the specialized niche of really cheesy animation, it really is possible to “burn all GIFs” and move on.

PNG hasn’t quite reached the finish line yet. But true believers like Stoyan have kept the home fires burning with great how-to articles like Give PNG a Chance… which features a browser-generated music video. Excuse me, something in my eye…

You can read about the history of the PNG format here.

Slides from MAMPCamp: testing websites on your own Mac

November 14th, 2009 by Tom No Comments

I led a barcamp philly session today titled MAMPCamp: testing websites on your own Mac. You can find considerably expanded slides, notes and links here.

I’ve also promised to deliver a complete writeup on how to use dnsmasq to let coworkers easily view each others’ test sites. More importantly, I’ve promised to deliver Z-CAMP (Zero-Configuration Apache MySQL PHP), a really really easy way to set up and test sites on your Mac. That should be along in a few weeks.