Currently browsing php


PHP Advent 2009

Fri, 18 Dec 2009 5:34 UTC

Six years ago, I became aware of the PHP community. I joined it three years prior to that.

I’m privileged to be a part of the 2009 edition of PHP Advent. This year, my post is about the PHP community. If you have any comments, feel free to leave them here.

Comments No Comments  Permalink Permalink  Tags Tags: , , , ,


Microsoft Web Dev Summit 2009

Tue, 1 Dec 2009 6:30 UTC

For the past three years, Microsoft has hosted the Microsoft Web Development Technology Summit, inviting a small group of community leaders, project developers, and prominent members of the PHP community, primarily for the purpose of eliciting feedback on how to better support PHP on Windows. I’m privileged and honored to be invited back for a third year to the fourth annual edition of this summit.

This is the first time I’ve ever blogged about the event, though I’ve taken “live” notes during the 2007 and 2008 summits. I’ll be taking notes again this year, if you’d like to follow along, but I’ll also be devoting several blog posts this week to the event because I think it’s important.

As I said, this is the Microsoft Web Development Technology Summit, but perhaps it’s not very aptly named, since it could best be termed as the Microsoft PHP Summit. Then again, one could argue that PHP really is the server-side technology of the Web, so calling this a web development summit is appropriate, and I think Microsoft understands that. This is the first reason I think this summit is important: Microsoft recognizes the importance of PHP to web development.

The second reason it’s important follows closely on the heels of the first. Because PHP is important, Microsoft wants PHP to work as best as it possibly can in a Windows Server environment, eliminating all performance arguments in comparisons between Windows/IIS and Linux/Apache. This reduces the platform choice argument to one of subjective preference with no basis in objective analysis. This is good for Microsoft because many PHP developers continue to use Windows as their local development platform, while deploying to *NIX systems. All performance arguments out of the way, if developers can deploy to the same platform they use for development, would they?

Other barriers for developers include cost and even open source philosophy (but mostly cost). Microsoft is eliminating this obstacle with their WebSite Spark and BizSpark programs. The philosophy argument is addressed by licensing some Microsoft tools and libraries under Microsoft open source licenses (which include BSD-like and GPL-like licenses).

There are many other reasons why this summit is good for Microsoft, but I’ll end with a third one for this post. In the spirit of openness and transparency, open source communities tend to be very vocal and honest, often brutally honest. So, why would Microsoft invite a room full of PHP developers, where the common laptop present will be running Mac OS X, with a few Linux laptops sprinkled in the room, and even fewer Windows laptops? Our community doesn’t hold back with our opinions. That’s why. Each person in the room has ideas of how Microsoft can be better community citizens, provide better and easier to use products for developers, and improve support for PHP on Windows. We may not use that platform, but we all have ideas for how it can be better. I don’t think Microsoft is kidding itself that it will convert us to its platform, but I do think they value our opinions and presence because our feedback will make their products better and we’ll communicate the experience back to the greater PHP community (i.e. through blog posts such as this), improving their image.

Do I think Microsoft has done anything positive with our feedback? You bet. In the years since the Web Dev Summit was first held in 2006, we’ve seen improvements to FastCGI in IIS and the introduction of the open source SQL Server native driver for PHP. I believe these improvements are direct results of the Web Dev Summit. And there are others. This year, the focus appears to be on developer tools, so we’ll be having in-depth discussions on typical workflow and processes for developing a PHP project from start to finish. If you have suggestions for how Microsoft can improve their tools for PHP developers, let me know, and I’ll pass them along.

Finally, I’ll leave you with this thought. Microsoft has seen many changes over the years. They are a behemoth of a company, and my perspective now is that there are two types of people in the company: the big company corporate types who are still convinced that closed and proprietary is the way to protect their products, brand, and customers and, on the other hand, the newer generation of product managers and developer evangelists who are making genuine attempts to be more open and transparent and finding ways to interact with the open source community to promote Microsoft as a good community citizen. Both are real faces of Microsoft. Don’t discount one for the other.

Comments 4 Comments »  Permalink Permalink  Tags Tags: , ,


CodeWorks Wrap-up

Tue, 1 Dec 2009 0:36 UTC

I never wrote about days 13 & 14 of CodeWorks, nor did I post the slides on October 7, like I promised to attendees of my talks. After CodeWorks, my website underwent weird spikes in traffic, causing it to be extremely slow. I thought the problem was DreamHost, so I moved everything to a slice at Slicehost. Long story short, my slice kept crashing, so I moved everything back to DreamHost after several weeks of intermittent uptime to let them deal with the problems. That’s what delayed my posting, and I apologize to those who have been looking for the slides.

To sum up CodeWorks New York, I would have to say that the energy and enthusiasm at the New York conference was, by far, the best of all seven cities. The turn out was great, and the hallway track was the best yet, with myriad discussions extending from the talks. I’m not sure what made the difference, but it was definitely the best stop.

Seven cities in fourteen days. CodeWorks was a whirlwind tour, and I was privileged to be a part of it. It was a pleasure to meet PHP developers in each city and to talk with those who lead user groups, are starting a group, or are thinking of starting one. And the talks were excellent, presented by some of the best and brightest in the PHP community. It was an awesome experience, and I’m glad we were able to take the conference to developers rather than expecting the developers to come to the conference. Though some cities had low attendance, the quality of each event was never lessened. If the conference continues next year, I think we’ll see more attendees in each city.

Yes, I would do it all again. So, I hope Marco sees fit to organize it next year, or at least, every other year.

I blogged every city we visited. If you’re interested, here are those posts:

As promised, here are the slides for my presentations (finally):

I hope to see you next year!

Comments No Comments  Permalink Permalink  Tags Tags: , , ,


POST vs. PUT

Mon, 9 Nov 2009 16:07 UTC

This morning, Matthew writes about building RESTful services with the Zend Framework. I have a lot of thoughts on his post, and I might blog more about it later, but right now, I want to focus on David’s comment:

I think the next thing you should cover is how to retrieve put parameters and maybe even attempt to start a discussion on the different school of thoughts about POST vs PUT (Especially in the PHP world).

I know I’m even guilty of mentioning different schools of thought on POST vs. PUT in my talks, but the truth is that REST doesn’t specify what to use for what actions. These are defined by HTTP and not by REST.

Roy Fielding has this to say about the use of HTTP verbs in RESTful applications:

Some people think that REST suggests not to use POST for updates. Search my dissertation and you won’t find any mention of CRUD or POST. The only mention of PUT is in regard to HTTP’s lack of write-back caching. The main reason for my lack of specificity is because the methods defined by HTTP are part of the Web’s architecture definition, not the REST architectural style. Specific method definitions (aside from the retrieval:resource duality of GET) simply don’t matter to the REST architectural style, so it is difficult to have a style discussion about them. The only thing REST requires of methods is that they be uniformly defined for all resources (i.e., so that intermediaries don’t have to know the resource type in order to understand the meaning of the request). As long as the method is being used according to its own definition, REST doesn’t have much to say about it.

The POST vs. PUT debate, however, does rage on in different communities, and some protocols have defined their usage. For example, the Atom Publishing Protocol (RFC 5023) explicitly states in section 4.3 that “POST is used to create” and “PUT is used to edit.”

The important thing to note is that REST doesn’t care how the HTTP verbs are used, as long as they are used properly according to how they are defined in the protocol you are using.

For those interested, HTTP (RFC 2616) defines POST by saying:

The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line. […] The actual function performed by the POST method is determined by the server and is usually dependent on the Request-URI. The posted entity is subordinate to that URI in the same way that a file is subordinate to a directory containing it, a news article is subordinate to a newsgroup to which it is posted, or a record is subordinate to a database.

PUT is defined as:

The PUT method requests that the enclosed entity be stored under the supplied Request-URI. If the Request-URI refers to an already existing resource, the enclosed entity SHOULD be considered as a modified version of the one residing on the origin server. If the Request-URI does not point to an existing resource, and that URI is capable of being defined as a new resource by the requesting user agent, the origin server can create the resource with that URI.

With this line of thinking, you might come to the conclusion that POST is used for creation of a subordinate resource, while PUT could be used for both creation or modification of a resource. The important distinction is that POST identifies the resource for which the entity should be considered a subordinate; PUT does not.

Comments 10 Comments »  Permalink Permalink  Tags Tags: , , ,


Building Titanium with PHP

Mon, 5 Oct 2009 19:48 UTC

Several months ago, I started the process of embedding PHP into the Titanium platform. After several sprints of work, the Appcelerator team was finally ready to merge my work into their master branch, and Martin Robinson worked to bring the implementation to maturity. The current release of Titanium Developer does not yet have the PHP support built in to the bundled SDK, and I’m not sure when it will be released, so I thought I’d share how to get a development version built with PHP support so you can start playing with it and even help the Appcelerator team by catching bugs in the implementation.

If you’re not familiar with Titanium, it’s a development platform that allows you to build native desktop applications for Windows, Mac OS X, and Linux using the Web technologies we use on a daily basis: HTML, JavaScript, CSS, Python, Ruby, and now PHP. Titanium is built on top of WebKit, and it includes a micro-kernel called Kroll that does all of the pre-processing and runtime processing of the code. Languages are modules in Kroll and are first-class citizens in the runtime environment. So, when using the runtime, you can pass objects back and forth between JavaScript, PHP, Python, and Ruby. This, however, can’t be done when using pre-processing mode, but in that case, your PHP scripts will work just like you’re used to them working on a web server.

Since it may still be a while before the next release of Titanium that includes PHP, I’ve decided to provide instructions here on how to build the SDK from the master branch and connect it to the Titanium Developer application. Sorry, but I don’t have instructions for Windows; these work on Mac or Linux.

  1. Download (and install) Titanium Developer from http://www.appcelerator.com/products/download/
  2. Launch Titanium Developer and let it do its thing (you’ll have to create an acct)
  3. Now you may close it
  4. You should now have a Titanium directory with the SDK in it at either:
    • /Library/Application\ Support/Titanium/ (Mac)
    • ~/.titanium/ or /opt/titanium/ (Linux)
  5. Now, build the development SDK to use with Titanium Developer. You’ll need Python, scons, a compiler, and possibly other prerequisites.
    $> git clone git://github.com/appcelerator/titanium_desktop.git
    $> cd titanium_desktop/
    $> git submodule update --init
    $> scons dist
    
  6. Unzip the built SDK to some location. I like to use ~/.titanium-dev/
    $> unzip build/osx/dist/sdk-0.7.0.zip -d ~/.titanium-dev/
    
  7. Move Titanium Developer SDK out of the way and point to your build SDK
    $> cd /Library/Application\ Support/Titanium/
    $> mv modules/ modules-old/
    $> mv runtime/ runtime-old/
    $> mv sdk/ sdk-old/
    $> ln -s ~/.titanium-dev/modules modules
    $> ln -s ~/.titanium-dev/runtime runtime
    $> ln -s ~/.titanium-dev/sdk sdk
    
  8. Now relaunch Titanium Developer.

You’re now ready to build a project with PHP!

Click Create to generate a stub project. I’ll cover more about development with PHP in Titanium in the future, but let’s get started by showing a phpinfo() page.

Open the index.html file in the Resources directory of your project and add the following anywhere in the page:

<p><a href="phpinfo.php" style="color:gray;">See the phpinfo()</a></p>

In the Resources folder, create the phpinfo.php script and add the following to that script:

<?php phpinfo(); ?>

Now, go back to Titanium Developer, click the Test & Package tab for your project, then click the Launch tab. To build and run your application for testing, click the Launch App button.

You should now see a dark gray test page with the “See the phpinfo()” link you created. Click that link, and it should take you to the phpinfo.php script you created with the proper phpinfo() output. Congratulations!

Visit the Appcelerator Codestrong developer center for more information on building Titanium applications. Visit #titanium_app on Freenode IRC to ask questions about application development. If you want to help develop the project and contribute PHP tests to it, join #titanium_dev.

Comments 12 Comments »  Permalink Permalink  Tags Tags: , , ,


CodeWorks Days 11 & 12 (Washington)

Sat, 3 Oct 2009 21:51 UTC

Departing Miami, I gazed upon the Atlantic Ocean as we cut through the clouds, making our way farther from the shore, and the thought occurred to me that this tour—these two weeks—has taken me from sea to shining sea across this great country. What a fitting thought to have as this next leg of the tour took us to Washington, DC.

I have traveled the country and have engaged the PHP community face-to-face all across it. It has been a great experience and an excellent opportunity to connect with the PHP community at all ends of the United States. Perhaps a tour to other parts of the world is in order, to connect with the community on a global scale. If I’m ever afforded that opportunity and privilege, then I will be certain to evangelize the PHP Community in each location, hoping to grow our community, bringing in new faces and new ideas.

As I mentioned, our next stop was Washington, DC. Some of us took advantage of free time we had on the afternoon and evening of the tutorial day to visit the city and walk the Mall of the United States capitol. We walked from the Washington Monument to the World War II Memorial, along the Reflection Pool to the Lincoln Memorial, along the Viet Nam Wall, around the Ellipse, and to the White House. Andrei remarked that he was using this opportunity to “consumate his citizenship.” Finally, we had dinner at the Old Ebbitt Grill, apparently the oldest saloon in Washington.

After dinner, our small group met up with some of the other speakers and conference attendees at The Brickskeller, where we enjoyed each other’s company and some great beer—they have other 1000 beers.

The session day went well. After some technical difficulties with my HTTP presentation, I managed to get started, and one of the attendees even remarked that he thinks my talk is perhaps the most important one at the conference. That’s the best compliment I’ve ever received. Everyone stayed for the end of my talk, which ran fifteen minutes late, eating into the lunch period. My AtomPub talk later in the day was much smoother in delivery.

As I wrap up in Washington, I’m left wishing that I had more time to explore the capitol, but now it’s time to move on to New York and the last leg of our tour. I’m one step closer to going home, and while I’ve had a great time on the tour meeting new people, giving presentations, and hanging out with old friends, I’m ready to go home to my family.

I hope to see you at New York CodeWorks!

Comments 3 Comments »  Permalink Permalink  Tags Tags: , , ,


CodeWorks Days 9 & 10 (Miami)

Sat, 3 Oct 2009 19:49 UTC

Miami CodeWorks, so far, was the smallest conference but I still think some important connections were made, especially with regard to user group contacts.

At the Microsoft happy hour on the second day of the conference in Miami, I was able to meet Brendon Van Heyzen, who is interested in starting up a PHP user group in Boca Raton. It seems that the Miami PHP user group has quietened down and gone silent, and he’s interested in starting up a group for the Boca Raton PHP community. We had a great discussion, and I offered him some points of advice on how to start a group, and this reminded me of the user group starter package I’ve discussed with Rafael and Michelangelo. I really need to push the PHP Groups initiative to get started on this.

The two main pieces of advice I offered were to start a mailing list and then to find adequate meeting space. The mailing list is important to get discussion going and to see what kind of group the people in your area want to have. It will inform your search for meeting space so you can find the kind of space that will work best for the type of meetings you want to have.

So, CodeWorks has been an excellent way to reach out to local leaders and people who want to start groups in their areas. If you’re interested in starting a group, join the PHP Groups mailing list and introduce yourself.

Rounding out our visit to Miami, I enjoyed some great Cuban food at Puerto Sagua, and we actually managed to find some good beer at The Room in Miami Beach. It was a beer oasis in the midst of a desert filled with mojito sand.

Comments No Comments  Permalink Permalink  Tags Tags: , , , , ,


CodeWorks Days 7 & 8 (Atlanta)

Thu, 1 Oct 2009 15:48 UTC

Atlanta was the mid-point stop on the CodeWorks tour, and since it’s my home, I decided to use it as an opportunity to spend time with my family before heading off on the second half of the tour. As such, there was very little hallway track activity for me, but I did get a chance to make it to a few events.

I’m told that Atlanta has had the largest CodeWorks crowd yet. I took a quick look around at each of the rooms, and I believe it. Each presentation was well-attended, and I’m proud to say that the Atlanta PHP user group was well-represented this year; I saw lots of familiar faces.

Speaking of Atlanta PHP, we had a good crowd at the Meet the Speakers dinner on Monday night. Many of the speakers attended, as well as attendees and Atlanta PHP members. I want to thank Glen Gordon and Microsoft for sponsoring the dinner. I think it was a great success, and we couldn’t have done it without Glen’s help. The only problem I have is that many people apparently treat meetup.com “yes” RSVPs as mere suggestions. If there’s a chance you’re not going to make it, please RSVP “maybe” or “no.”

I also want to thank Jeff Jones for hosting an after party as his place for many of the speakers. It was a lot of fun, and the beer was great.

Now we’re in Miami, and I’m a bit behind on blogging, but I’ll post about the Miami CodeWorks stop later today.

Comments 1 Comment »  Permalink Permalink  Tags Tags: , , ,


CodeWorks Days 5 & 6 (Dallas)

Sun, 27 Sep 2009 19:13 UTC

Yesterday, the CodeWorks B-Team (the session day team, a.k.a. Team Awesome) ran into a bit of a travel snafu that actually worked out better for us. On the way to the airport in Los Angeles, we got stuck in traffic caused by an overturned cement mixer truck. And by overturned, I literally mean the cement mixer was lying flat on its back across the barrier separating the north bound from the south bound lanes. I’m not sure how it was even possible, but there it was. Derick took some video of the accident that he may or may not post later.

The traffic caused our team to be late to the airport, missing our flight. However, we were able to quickly book standby tickets for the following flight, giving us extra time at the airport to eat, placing us on a plane that had WiFi access (our original flight did not), and giving many of us exit row seats. So, it all worked out in the end.

The evening was short, due to our late arrival, but we still made it out to La Hacienda Ranch, apparently the home of the original frozen margarita. A highlight of the evening was being able to meet some of the gang from Dallas PHP, including Tim Stiles, whom I’ve conversed with online but have never met. Afterwards, a few of us ventured into Fort Worth to have a few beers at The Flying Saucer. Special thanks to Josh Holmes of Microsoft for driving us around.

As an aside, we—“we” being the speakers and community leaders attending CodeWorks—have been making lots of new friends with the Microsoft developer evangelists who have been in attendance. It seems that Microsoft has a new breed or new generation of dev evangelists who are genuinely interested in the PHP community, listening to us, and hanging out and having fun with us. For me, it’s a welcome improvement, and I’m not saying this as a surprise change I’ve only observed this week; it’s something I’ve been seeing over the last few years.

There have been a lot of great talks in Dallas. In addition to the set of CodeWorks touring speakers, the local speakers from Dallas PHP have provided some excellent presentations. I was able to enjoy Chris Cornutt’s “B.S.T, Easy as 1-2-3” presentation, and now I’m sitting in Vance Lucas’s “Object Oriented Apologetics.”

The venue in Dallas is also excellent. We’re staying at the American Airlines Training & Conference Center, and while it’s not the fanciest of hotels, I think it has been the best hotel experience we’ve had, with some of the best food and best WiFi we have seen yet. But we’re not even half-way through the tour, so there is plenty of opportunity for this to change and for me to be wowed even more.

I’m heading home this evening. My home is Atlanta, and Atlanta is the next stop on our tour, so I’ve scheduled a little family time during the tour, but I’ll be joining the CodeWorks crew each day, tomorrow for the Atlanta PHP Meet the Speakers Happy Hour and on Tuesday for my presentation.

I hope to see you in Atlanta!

Comments No Comments  Permalink Permalink  Tags Tags: , , ,


CodeWorks Days 3 & 4 (Los Angeles)

Fri, 25 Sep 2009 23:23 UTC

I’m writing this from Los Angeles during the session (or conference) day of CodeWorks. The “A Team” (tutorial team) is en route to Dallas today, while the “B Team” (session team) gives their talks.

Our flight yesterday was short, but we didn’t arrive at the hotel until nearly 4pm, and then I had to leave soon after to make it to the combined OCPHP and LAPHP user group meeting. That’s definitely been a highlight of my trip, since I enjoy meeting other user group organizers and seeing how other user groups work. I was able to meet Oleg Baranovsky and Joe Devon of LAPHP and William Estrada of OCPHP. Special thanks to Rutger Hensel for letting us meet in his co-working space in Fullerton.

There was a great crowd at the OCPHP/LAPHP meeting, and I spoke on Grokking REST, while Jason Mauer, Developer Evangelist for Microsoft, spoke about Microsoft Silverlight (and touched a little bit on Windows Azure and WebsiteSpark). In all, they’ve got two great PHP user groups and if you’re in the Los Angeles or Orange County areas, you should definitely try them out.

Today was a whirlwind of a day for me, as I’ve given three talks already, and I’m writing this just just before heading back down to the conference for a Future of Web Development panel that I’ve agreed to sit on. Since there’s been no real preparation for it, it ought to be fantastic!

This is only the second stop on the tour—five more stops to go—but already it’s been a great and exciting show. Even some of the folks from the OCPHP/LAPHP meeting last night who were on the fence about attending CodeWorks decided today at the last minute to come see what it was all about, and all I have spoken with are glad they made the decision.

Tomorrow, we head to Dallas. I hope to see you there!

Comments 2 Comments »  Permalink Permalink  Tags Tags: , , ,