P'unk Avenue Window

Archive for ‘Apostrophe’

Faster, PHP! Kill! Kill!

March 8th, 2010 by Tom 4 Comments


PHP is easy… as programming languages go, that is. You can build sites in a real hurry.

With frameworks like Symfony, you can build them faster still, and follow modern programming practices at the same time.

And Apostrophe strips away yet another layer of effort if your site calls for a content management system.

Yes, Java has more raw speed, all else being equal (which it never is). But as the LISP programmers used to say, “a moment of regret, a lifetime of convenience.”

Still, sooner or later success catches up with you and you want your site to cope with Serious Traffic… or cope with moderate traffic on a cheap virtual machine… or at the very least, not be dog-slow with just a handful of users on the system.

There’s a lot of advice out there about optimizing PHP code, some of it well worth your while. And there’s excitement about HipHop, Facebook’s new native code compiler for PHP. But these are drastic steps that require you to rewrite your code or adopt less proven and more awkward ways of delivering your code.

Justified? Sure, sometimes, on the biggest projects in the world (like Facebook) (*). But as Donald Knuth says, “premature optimization is the root of all evil.” That’s because tweaking your code for speed’s sake usually makes it harder to maintain and less adaptable to new requirements.

What most developers don’t realize is that there are three major factors that typically slow down PHP projects based on frameworks (like Symfony or, sigh, Drupal) so much that code profiling and database query redesign don’t even have a chance to become relevant factors. Fix these things first before you worry about other issues:

1. Compiling code over and over and over. Would you wait for your Mac to recompile MacOS X from source code every time you boot it up? Of course not. How about every time you fill out a dialog box? That’s pretty much what you’re doing every time you access a PHP-driven website that doesn’t use a bytecode cache.

2. Waiting and waiting and waiting for web browsers to make another request, pinning down web server processes that your other users need. By default Apache usually lets browsers hold on to a connection for up to 15 seconds just in case they ask for more. This is a good thing in many ways, but 15 seconds is far too long. Which leads us to #3:

3. Tying up a “fat” web server process with PHP on board for every request, even requests for the zillions of little static PNGs that probably make up your page design. (**) A typical Apache web server configuration with mod_php suffers from this flaw, fatally limiting the number of simultaneous users you can handle.

So what can we do about these problems? Quite a bit as it turns out. I’ll start with the low-hanging fruit and move on to the tougher stuff. The fascinating common thread with all of these suggestions: no changes at all to your PHP code.

(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.

Apostrophe 1.0 Release… Wednesday!

February 8th, 2010 by Geoff 4 Comments

If you follow us carefully, you have probably already seen this screencast of Apostrophe, our open source content management system built in the Symfony PHP Web Framework. You also probably know that we have built many sites with it at Duke University (Trinity College, Theater Studies, Economics, Evolutionary Anthropology, etc) and others like the Kimberton Waldorf School, the Environmental Management Assistance Program, and Diversified Community Services. Since it is an open source project, other teams have used Apostrophe to power their sites to provide easy content management, as well.

You may be wondering why we haven’t made an official 1.0 release to date?

The answer is simply that every time we were going to do that, we decided that it could use one more cool feature or could be re-factored in this way or that. No regrets, though. For this first official 1.0 release, we have done so many under-the-hood changes and updates that we are glad we waited.

I wanted to post to let you know that we will be sharing screencasts and screenshots of features over the next few days leading up to the release (and beyond). Hold on to your hat and get ready for the ride.

Coincidently, we are timing this release so that it was ready for Symfony Live. Tom will be in attendance spreading the good word. If you are planning on being there, drop us a line so Tom can buy you a drink.