Author: ccornutt

Working towards a better deployment (Part 1)

Since we’re in the “slow time” for the business I work for (no one cares about their natural gas bill when it’s warm and the price is right) I’ve taken some of the flexible time I’ve found to work on a pet project of mine – the overall well-being of our development process.

Let me start off by mentioning what our current setup is:

  • We use CVS as our version control repository not so much by our choice now but by the choice of someone many years back. It’s worked well for what we’ve needed it for, but we’re going to be upgrading to Subversion here pretty quickly.
  • We have separate development, QA/testing and production environments so that each developer can work in their own space and have a QA to push it to so there’s no testing on the devs.
  • Code pushes are done with rsync directly from the QA environments out to production.

That’s pretty much it – a simple process that has worked pretty well for the six years I’ve been with my current employer. Unfortunately, times change and so do development standards. When I first started there were only two of us that worked on the code for both the internal and external websites. Now that team has grown to include at least six others. Needless to say, keeping things straight has become a bit more difficult.

So, back to my “free” time – I stepped back and took a look at our process. I tried to find out what could be improved in it and what was completely missing. What we have is a good base to start from, but there were a lot of other things to consider like quality of the code being pushed, checking to be sure there’s no syntax issues, creating a standardized way for the code to flow and what tools might be best for the job.

I’ve told you what we currently have, so let me tell you where my goal is – I want a system that allows the developers to work on both the main trunk and any branches (for projects and the like) of code quickly and easily and one that, once it’s been committed and tested, is out of their hands (right now, we have a system in place that lets developers push bits of code to production – a definite bad idea). Developers would have the option to change database connection information as they see fit but still have defaults for all to use. We have multiple customer databases and the location of the test databases isn’t always the same.

Once the developer is satisfied with the code and feels it bug free (enough), they can commit it and send it on its way for testing. That’s where their job ends – from here the administrator’s role kicks in. They’re the one that has the cvs-foo (or svn-foo) to pull the code out of the branch and push it into the currently checked out code in the QA environment. This code can then be reviewed and tested by whatever group needs to without interfering with any updates the developer might be working on. Once testing is complete and everything’s good to go, that code can be commited back to the trunk, pushed to a staging area and synced out to the production site. I don’t believe that QA and the base for deployment (staging) should be the same – it’s just too confusing when you could have a merging of codesets from branches all over the place. If you’re going to sync, sync from an up-to-date version of the code.

Which leads me to my next point….the build process. (the next part of this series will cover it)

A Shinier New Joind.in

In one of my previous posts I mentioned a little pet project I’ve been working on. I had an initial version out the door and things were working pretty well. It needed a little something else, though. The layout was functional, but not so easy on the eyes. I put out the call to see if there was anyone out there that might want to lend some time to giving the site a bit of a touch-up and, thankfully Jan Sorgalla answered the call.

He’s been working over the past few weeks on a new look and feel for the site to bring it up to that next level. Personally, I think he did an excellent job in both integrating some of the flow of the previous version of the site with a better styling to make the site more usable.

Development on the site is still continuing and more new features are in the works. The system is open to any events, not just PHP-related, out there that might want to have make their lives easier by letting attendees give the speakers their feedback directly.

Check out the new site!

Speaking at php|tek 2009 – “No Really, It’s All About You”

Now that the schedule is official and all, I suppose I can post about it – I’m going to be presenting at this year’s php|tek conference (in Chicago) on a developer-centric approach to frameworks – No Really, It’s All About You. Here’s the summary:

You’ve heard it all before – this framework can do this, this other one can do it faster. The lists of features and comparisons go on and on, but there’s one thing those lists forget – the human element.

Frameworks are only as good as the developers using them and in this talk I’ll focus on these developers and how they interact with the tools. How easy is it to create an application in CodeIgniter? What kinds of things does Solar make simpler than others? Is the Zend Framework the best choice for some of the more ‘business applications’?

I’ll take a developer-centric approach to four popular PHP frameworks: CodeIgniter, CakePHP, Solar and the Zend Framework. Topics include speed of application development, how simple they make the simple things and maybe a few benchmarks thrown in for fun.

This will be my first time presenting at a conference and, really, my first time up in front talking about a technology topic. I haven’t had much experience in public speaking so a lot of it will be new to me. Oh well – what’s life for if not for taking those big jumps into the unknown.

So sign up already and come out to Chicago to see myself and lots of other qualified speakers talk about Subversion, streams, the SPL, security and much more…

My Seven Things (because Matt tagged me)

Seems as though I got tagged by Matt Turland with this whole “Seven Things” viral blog entry stuff. Gotta keep it alive, so here’s my seven things:

  • My degree is in art – yes, that’s right…further proof that no matter that you get your degree in, you can find something out there that makes you truly happy to do. I loved my classes and I still love art (I consider a trip to a museum for the day time well spent) and I’m always on the lookout for great design, not just in web sites but in the art world as a whole. Oh, and I hated normal history back in school but for some reason art history was completely different – I couldn’t get enough.
  • Back in high school, at one point I could play six different instruments – while my main instrument was the trumpet, I could also play: trombone, tuba, french horn, clarinet and saxophone. I was in the band at my school and I managed a “free period” during a class time one year which I used to teach myself the other instruments. I also helped the drums come up with cadences for our marching band, though I only played the marching bass so I’m not sure that really counts 🙂
  • PHPDeveloper.org started out as a weekly thing – when I first started the site back in college, I didn’t know nearly as much about the PHP community (or the people in it) as I do now. I picked up on a few things and made a post about them when I could. If you want to see how far the site has come, ask archive.org to show you the past. Hmm, not exactly sure when I made the switch from blue to red… The original machine it was hosted on sat in my dorm room – an old 486DX/100 (a Compaq I think?) and I used the ods.org dynamic domain service to map it to the domain.
  • My wife and I met on Match.com – Yup, that’s right…we could be on one of those cheesy commercials. I had moved back to Dallas after finishing at school and she moved down from New York (she’s originally from Houston, though) and posted her profile out there. She’d gone on a few dates but hadn’t had much luck. Oddly enough, when we hooked up (she told me this later) I was her “last shot” on the site – if it didn’t work with us, she would close her account. I guess I fooled her enough and one thing led to another and we’re here, married with our little kiddo.
  • I have an unhealthy fascination with pens – I can’t help it, I’m a pen snob. Not quite sure where it came from (maybe all those art classes) but there’s very particular requirements that I have for the pens that I use. It’s not about the price, either. Some of those costly pens don’t write worth crap anyway. I’m a fan of the fine point – the finer the better, at the largest 0.5 – and I love nothing more than the scratch that they make on paper. If you’re going to use anything larger than a 0.5, you might as well just use a magic marker. They look about the same. One of my current favorites is the Parker Jotter though the Uni-Ball pens come in a close second.
  • Theres an art geek living inside of me – ever since I can remember, I’ve always been an art fan. I used to enjoy the field trips to the museums and liked learning about the different artists and styles. When I went to college and got to indulge in all of that, it was great. I’m still that way even though its a bit more limited these days. I still paint (though not as much as I’d like to) and like to sketch when I can. I’m also an architecture nut – my dad and I had an extra afternoon in Phoenix so I dragged him out to see Taliesin (one of Frank Lloyd Wright’s residences and art school) where we took the full tour. FLW is one of my favorite architects followed closely by I.M.Pei (what can I say, I’m a modernist). I enjoy architecture so much that, after I lost my first job out of college, I came *this* close to leaving the whole programming thing behind and going to architecture school. I was offered the job I’m currently in pretty quickly, though. I still try to make trips when I can down to the Dallas Museum of Art and the museums over in Ft. Worth (like the Kimball and the Modern).
  • I’m an early riser – Seems like this is more and more of a rarity these days (especially in the industry I’m in) but I have no problem getting up before the sun is up and doing things. I currently get up for work at 5:30am and am in the office by 6:15-6:30am working away. Partly I do it so I can leave the office a little earlier, but I also do it because that’s the only time that its easy to get things done. There’s less people up (slackers – hehe) so there’s more time to relax or write posts for PHPDeveloper.org or read or whatever. I just grab a cup of coffee and enjoy the time to myself for a bit. So, all of you late sleepers out there – keep on late sleeping! I’ll be the one enjoying the peaceful sunrise, warm coffee in hand.

So, here’s the hard part – I’m not sure who else has been tagged for this, but I’m supposed to choose a few other people and pass the virus, er theme on to them – here goes:

And, of course, the rules to pass on:

  • Link your original tagger(s), and list these rules on your blog.
  • Share seven facts about yourself in the post – some random, some wierd.
  • Tag seven people at the end of your post by leaving their names and the links to their blogs.
  • Let them know they’ve been tagged by leaving a comment on their blogs and/or Twitter.

Branching Yourself

If there’s one thing I don’t understand about programming communities (online and average joe coder on the street) it’s the competition that’s everywhere. Sure, I can see how there’ll always be the zealots that think their language can do everything. Well, I hate to break it to you guys but there’s just no such thing. Every language has their own feature set and their own strengths. There’s not one that’s going to work in all situations.

Repeat the mantra after me: “Use the right tool for the right job”.

Now, I’m a PHP developer so my views are a bit slanted that way, but I’ll be the first to admit that there’s things that the language just isn’t good for. I like to get feathers ruffled as much as the next guy, but there comes a point where you just have to concede. PHP is excellent for web development – it makes creating sites easy and there’s some great frameworks built on it but there are things it just doesn’t do well. Other languages like Python and Ruby are a bit more modular and, according to what I’ve read, and do a lot of the same things for the web that PHP does. There’s one thing to remember, though – it’s not really about what they do that’s the same, its the differences that matter.

You a Ruby developer can argue with the PHP developer all day long on how one handles objects versus the other or the “dumb syntax” that the other uses, but remember the mantra. There’s things that Ruby does that PHP just doesn’t do well and vice versa. Focus on these other things – that’s why you choose one language over another.

Don’t let your language choice get the better of you and put blinders on – expand your horizions! Don’t be afraid to check out other languages/technology/etc. You might actually learn something in the process that can make you an even better developer than you are.

Direct Feedback is a Good Thing: Joind.in

So, a few weeks back Keith Casey and I were talking about conferences and feedback. One thing we both (and various others that happened to be in the #zendcon IRC channel at the time) agreed on was that paper slips and verbal polls just aren’t the way to go when it comes to providing feedback to speakers on how they’re doing.

Automation is the way to go – bring the attendees directly back to the speakers and let their voices be heard. Obviously, a web site is the medium of choice and so I present to you Joind.in.

Joind.in provides the missing link between the people attending a conference and the ones that presented. The usual method of handing out paper forms is outdated and needs to be replaced. That’s where we come in – attendees can post their comments directly to each of the talks they attended, giving the speaker direct feedback on how they did and what they can do to improve. Joind.in also has something to offer the speakers – you can track your record across the conferences and see how changes in your talk might have made a difference in your ratings.

Things are still running in beta mode right now as I work out some of the kinks with both the code and with the interface (any designers that want to help out and contribute a few ideas, drop me a line), but I’m hoping that this can become a great asset for the speaking community – and not just the PHP one.

The idea is to make it as open as possible to allow for conference planners from any topic to come in, add their events and talks to get direct feedback from their attendees.

Here’s a list of a few of the stats for the site:

  • It runs on the CodeIgniter framework
  • It allows for “stubs” for conference names (ex. http://joind.in/event/phpapp08 for PHP Appalachia ’08
  • Speakers can “claim” their talks from each event and see how the same talk did at various events
  • The commenting system supports both public (viewed by all) and private (viewed by speakers and conference admins) comments

I am always open to suggestions about the service, so if you have comments either leave them on this post or submit our contact form.

Dallas PHP User Group on Twitter

My local user group (the Dallas PHP User Group) has added a twitter account to its list of contact methods. Meeting updates and other random group-related bits will be posted there.

If you’re a PHP developer in the Dallas, TX area, head over and follow us on Twitter to keep up with the latest.

We have a meeting tonight at the usual place with a presentation from Adobe. They’ll be talking about their technology for Rich Interfaces (like Flex and AIR) and combining them with the Zend Framework. Danny Dura will be presenting. The meeting starts at 7pm – hope you can all attend!

Building a nested array from a flat one

This post is largely because I want to remember hos to do this, but maybe it’ll be good for someone else out there.

To change an array like this:
[php]
Array (
[0] => Array (
[RECORD_PARENT] => 0
[RECORD_DESC] => Root #1
[RECORD_ID] => 1
[LEVEL] => 1
)
[1] => Array (
[RECORD_PARENT] => 0
[RECORD_DESC] => Root #2
[RECORD_ID] => 2
[LEVEL] => 1
)
[2] => Array (
[RECORD_PARENT] => 0
[RECORD_DESC] => Root #3
[RECORD_ID] => 7
[LEVEL] => 1
)
[3] => Array (
[RECORD_PARENT] => 7
[RECORD_DESC] => Under Root #3
[RECORD_ID] => 8
[LEVEL] => 2
)
)
[/php]

Into a nested parent/child array, use this:

[php]
$ret = array(‘root’=>array());
$ref[0] =& $ret[‘root’];

foreach($retv as $row) {
$p=$row[‘RECORD_PARENT’];
$i=$row[‘RECORD_ID’];

$ref[$p][$i] = array(‘data’=>$row,’ch’=>array());
$ref[$i]=&$ref[$p][$i][‘ch’];
}
echo ‘

'; print_r($ret); echo '

‘;
[/php]

voila!

ZendCon08 and the PHP Community

Day four of this year’s Zend/PHP Conference and Expo has finally come – we all wish it could have been just a bit longer. There was tons of stuff jammed into this year’s event, both in the sessions and activities outside the conference hours. These four days went too quickly for me as it was one of the very rare times that I can sit with the people I talk about and with every day online and just have a beer and shoot the breeze. I have the user group at home that’s fun to go to and I always learn a lot there, but there’s just something different about getting to meet up with developers you know, ones you don’t and people you might never get to see (or not for a long time) because of where they’re from.

See, that’s what these events are really about (or should be about). Yes, the sessions are good – it’s nice to listen to people go one about scalability and security techniques, but what’s really at the heart is the community that the conference inspires. You can walk down the halls and see it. People getting introduced to other (“oh, you should so meet…”) and groups just standing around and talking about things, PHP related and not. It’s was even there at breakfast when people would get their abnormally small coffees, a bagel and sit down with people they may not even know and start talking. During these past four days, we were all equals – it wasn’t about what you know so much as the fact that you were willing to sit down and share a part of you and your experiences with another person.

Unfortunately, there’s only so much time and so many resources to go around and we all have to head home sometime. For some it’s just up the road but others are quite a bit further away than that (and even some, further than that). The people we met and discussions we had start fading away a little bit and those business cards in our pocket become more of “that person”.

I wish there was a way that we could keep this kind of connectivity going even when we’re home in our familiar houses and offices. It’s just not that easy, unfortunately, but the effect can be lessened. Stay in touch with those people! Send them emails asking how that project they mentioned to you is going! Get them in contact with other people you know who could help them out.

It doesn’t matter if you came to the conference and really only met one or two people – stay in contact with them. These conferences (and really the same things applies to user group meeting too) are not just things to come to and sit in rooms all day, isolated in your thoughts. You can take online classes if that’s all you’re looking for. Conferences/meetups/coffee with other developers is about the networks – building those links between you and other people that love the language you love and that can be a huge help if you might need it.

Don’t feel left out if you didn’t get to ZendCon this year – it’s just one of the many many great conferences happening this year. Can’t make it to a conference? Look for a local user group! There’s bound to be one in your area (and if there’s not, look at starting one up). You don’t even have to make it out to events if you don’t want to. I recommend coming over to the irc.freenode.net IRC network and hopping in on the #phpc channel. There’s tons of great people in there and it’s just fun to talk with other developers about anything and everything.

It’s all about the community.

Why do you use PHP?

A little while back I asked this question on Twitter. I was interested in how other people’s first experiences with PHP compared with my own. I got some great responses – from funny to completely honest. Here’s the list:

  • Skoop: I didn’t choose PHP, PHP chose me (nice, very zen.)
  • Andriess: low entry barrier, and the AWESOME community
  • Felixdv: great community, open-source spirit and low barrier but powerful if needed (as of PHP5 😉 )
  • DragonBe: in PHP I found my likings, where as Perl left me hanging about..
  • Rmehner: Mainly because of deployment issues in the beginning. PHP was everywhere available. (In the beginning I had often web projects)
  • lvtrll: The options at the time were PHP or ASP… which would you choose? =P
  • ijansch: it was the logical choice (or, to be more precise: it gets the thing done, and quickly.)
  • njames: its “FREE” no need for mucking about with licences for VS or IIS or W2K or MSSQLSRVR etc etc #php
  • weierophinney: out of necessity.
  • padraicb: At the time (1999) PHP happened to coincide with the activities of friends online – seemed natural I’d help them cut and paste 😉
  • iephp: I used to do Java and Perl and a friend of mind told me PHP was easy and fun. I tried it out, turned out well 😉
  • akrabat: Wasn’t that much choice back in PHP3 days. Perl / CGI didn’t appeal and the only other choice on my host was PHP…
  • jlleblanc: someone suggested it in college and it was easy/inexpensive to get into.
  • sweatje: My Unix admin pointed me towards LAMP when I was looking for a free alternative to IIS/ASP for a home business accounting system
  • chartjes: My first job out of college needed a web site and had no money to pay for licenses for Windows server (this is 1998)
  • ramsey: Switched from ASP to PHP b/c I didn’t want to learn ASP.NET, Tomcat was a bitch, & PHP had everything we needed built in (& more)
  • calevans: because upgrading from NT to Server 2000 was going to cost me $15,000 + hardware.

I think I got them all, but if you didn’t get to contribute, definitely leave a comment with your first introductions to this great language of ours!