Tuesday, 7 July 2009

PHP_CodeSniffer 1.2.0RC3 released

I've just uploaded version 1.2.0RC3 of PHP_CodeSniffer. RC3 is a feature release rather than a bug fix release because there were a few nifty features (like error message suppression) that I wanted to get in before the next stable.

This is the last planned release candidate before 1.2.0 stable.

You can view the full changelog and download the release on the package download page.

Friday, 3 July 2009

Suppress error and warning messages in PHP_CodeSniffer

Just over 13 months ago, I had a feature request submitted for PHP_CodeSniffer to allow developers to annotate their code with comments that tell PHP_CodeSniffer to ignore some lines. At the time, I remember thinking "This is a hack!", but I've changed my mind. PHP_CodeSniffer version 1.2.0 will have error message suppression comment tags.

You use them like so:

$var = TRUE;
// @codingStandardsIgnoreStart
if ($var === true) {
echo "true that";
}
// @codingStandardsIgnoreEnd

If you use the Squiz coding standard that comes bundled with PHP_CodeSniffer, it will complain about pretty much everything and tell you you can't have "true" in lowercase and that echo'd string can't be in double quotes.

Without the new suppression tags in place, you get this:
FILE: /Users/gsherwood/PHP_CodeSniffer/temp.php
---------------------------------------------------------------
FOUND 3 ERROR(S) AND 0 WARNING(S) AFFECTING 3 LINE(S)
---------------------------------------------------------------
2 | ERROR | Missing file doc comment
4 | ERROR | TRUE, FALSE and NULL must be uppercase; expected
| | "TRUE" but found "true"
5 | ERROR | String "true that" does not require double quotes;
| | use single quotes instead
---------------------------------------------------------------

With them in place, you get this:
FILE: /Users/gsherwood/PHP_CodeSniffer/temp.php
---------------------------------------------------------------
FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S)
---------------------------------------------------------------
2 | ERROR | Missing file doc comment
---------------------------------------------------------------

Too easy. Sorry it took so long.

Please don't be tempted to wrap your entire file in these tags. The Squiz standard will still find ways to yell at you and you're not fooling anyone.

Grab the code from CVS now or wait for the next release, which will be whenever I get my act together.

Wednesday, 3 June 2009

Managing videos in MySource Mini

In the next couple of weeks, we'll be releasing a MySource Mini update that contains much more advanced video management functionality than the first release. In typical MySource Mini style, it's simple and sexy while still being very powerful. And I've got some screenshots of the feature in development as a bit of a teaser.

Our end goal for this development was to allow users to upload any common video format and be able to embed it in their websites in a way that made it available to the highest number of site visitors. Like most video sharing websites, we decided on a Flash-based player and we will be creating our own player so we can skin it in the way users want.

We also had to take editing, thumbnails and versioning into account so movies fit seamlessly into the MySource Mini graphical environment.

Uploading a movie is as easy as uploading an image.


Once you've uploaded your movie, it is converted to an FLV file automatically so we can play it using our flash player. The original file is retained so you can link to your high quality MOV/AVI/etc. if you'd like. We also extract thumbnails from the movie so you can select the one that fits the best without having to create your own.


In the future, we'll be adding an option that allows you to replace this thumbnail with one you have created yourself, but we want to keep things simple to start with.

Now that your movie is loaded into the system, you will be able to embed it into any page using the Viper WYSIWYG editor. It will be the same process as inserting an image, but we are still building this WYSIWYG plugin so I can't show you any screens of it yet.

Versioning is great feature of MySource Mini and movies fit nicely into the whole system. Just like with pages, you can flick through different versions of your movie by looking at quick-loading images. Even if you've uploaded a large movie, this montage-based preview allows you to quickly scan through versions without having to download each one. When you've found the one you like, you can download it as normal.


The movie shown above is an old preview of the MySource Mini caching system, so the whole movie looks similar. I've also got a more interesting image for an old versioning system preview movie.


For more information about MySource Mini, see the MySource Mini website, or follow @mysourcemini on Twitter.

Monday, 25 May 2009

PHP_CodeSniffer 1.2.0RC2 released

I've just uploaded the a new PHP_CodeSniffer release. RC2 is a bug-fix only release, although it does contain one tiny change to the test suite so it can be integrated more easily run by external testing scripts.

Please download and review. There are currently no bugs in the PHP_CodeSniffer bug tracker, so this will become the stable 1.2.0 unless any show-stoppers are found.

For those reporting problems with the SVN pre-commit hook on this blog, I've tested everything (including adding directories) and it is all working fine. If you have any problems, please report a bug using the PEAR bug tracker (no bug reports in comments please).

You can view the full changelog and download the release on the package download page.

Thursday, 7 May 2009

Missing/Back in action

It's been about 2 months since my last post. A lot has been happening and I've been really busy. If I had posted over the last couple of months, the posts would have covered:

MySource Mini, MySource Mini and more MySource Mini. I've been so busy getting this product ready for launch that I've been almost completely consumed by it. It's a terrific product though and I'm very proud of we we've achieved. We had the launch last week (a great review here), had a great team dinner at Sydney Tower on the weekend to celebrate and are now busily preparing units for delivery. Along with that, I'm also working hard on the MySource Mini product website (running on a Mini of course) and getting the news out via Twitter.

Sadly, I've neglected PHP_CodeSniffer over the last few months as a result. The bug reports started piling up but I'm happy to report I'm getting on top of them now. I think there is currently one outstanding at the moment, which isn't too bad. Downloads of PHP_CodeSniffer have been through the roof over the last two months so I'll be putting out an RC2 soon for people to try out before the next stable release.

I'll start posting again soon. In the meantime, follow me on Twitter.

Monday, 9 March 2009

PHP_CodeSniffer 1.2.0RC1 released

I was just looking at the download stats for PHP_CodeSniffer version 1.2.0alpha1. Normally, my alpha releases get a very small number of downloads due to most users not allowing alpha state packages to be installed via PEAR (fair enough). But the 1.2.0 alpha got over 300 downloads. That's a great figure and a few bugs were fixed from that testing, but there is a very good reason why there were so many downloads - I released it nearly 4 months ago.

To be honest, besides fixing the odd bug, I haven't been working on PHP_CodeSniffer lately. I'm very busy working on the MySource Mini and our coding standard seems to be nearing completion, so there is less work to be done there as well. But 1.2.0 is a good release with some great reporting improvements, so it's about time I released a beta version.

This release candidate is essentially a bug-fix only release, but please test it if you can so I can push it stable as soon as possible and start working on new features again.

You can view the full changelog and download the release on the package download page.

Sunday, 4 January 2009

Seven Things - Tagged by Sebastian and Manuel

I've been tagged for this meme by Sebastian Bergmann and Manuel Pichler, so I can hardly ignore it now!

Seven things you may not know about me:

  • I didn't even know how to code a table in HTML when I started as a web developer at Squiz.
  • I didn't pick the name PHP_CodeSniffer. It was suggested by Pierre-Alain Joye (http://blog.thepimp.net) when I submitted "Snoopy" to PEAR.
  • I'm slightly addicted to WoW, but I swear it's not my fault and my wife is addicted too, so it's not that bad.
  • I've never been to a PHP conference or user group. I just can't ever seem to find the time, especially now with a 1 year old.
  • I'm the main cook in the house, and I love it!
  • I love cats and dogs and have had 5 dogs and 4 cats as pets so far.
  • I don't have a Facebook account even though several people have tried to sign me up. One less thing to be addicted to.

And the seven lucky people I have picked to do this next are:
  • Till Klampaeckel for being a PHP_CodeSniffer early adopter
  • Pierre-Alain Joye for helping me get into the wonder that is PEAR
  • Laurent Laville for helping me get PHP_CodeSniffer working on Windows
  • Scott Kim because he codes PHP all day long and needs something to add to his blog
  • Richard Hulse for convincing me Git is a great VCS, even if I haven't done anything about it
  • Nathan de Vries because he's a smart guy with and without PHP
  • Nic Hubbard for making his first contribution to a PHP open source project just recently

And here are the rules of the game:
  • 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.