Showing posts with label svn. Show all posts
Showing posts with label svn. Show all posts

Friday, 30 October 2009

MySource Mini now free to download

The big news (for me) at the MySource Matrix International User Conference (MMIUC) this year was that MySource Mini can now be downloaded for free as a virtual machine image. You'll need VMWare player to run the image, but you are also free to convert it to another format if you want.

In addition, Squiz showed its commitment to open source by announcing that MySource Mini will be released under the GPL and will have a public SVN repository. We're in the process of getting this ready and we'll have it done in a couple of weeks.

Sticking with our goal of keeping everything about MySource Mini simple, the virtual machine is easy to install and you can subscribe to the automatic up-to-date system to have it upgrade itself. A personal subscription is only $250 a year and when you take a look what has been added in just 6 months, it's great value.

I showed a demonstration at the MMIUC of the new features added since the MySource Mini launch in April this year. The main features I showed were:
- multi-site support
- embedded videos and automatic conversion to FLV files
- embedded and lightbox-style image galleries
- track changes functionality built right into the inline WYSIWYG editor
- improvements to the help system for new users
- an integrated bug-tracker based on Bugzilla

I've been saying how good MySource Mini is for a while and how its powerful functionality is made simple through great user interfaces. But now you don't have to take my word for it. Grab the VM and have a play around yourself.

Product site: http://mini.squiz.net
Download page: http://mini.squiz.net/download

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, 17 July 2008

PHP_CodeSniffer 1.1.0 released

I uploaded the 1.1.0 stable release of PHP_CodeSniffer earlier this week. This version has been a long time coming, but does include a lot of changes. The most exciting (for me) is the ability to sniff JavaScript files and find coding standard errors within them.

We have been using this feature internally at Squiz for a few months to start cleaning up our JavaScript files and make them, as much as we can, conform to our PHP coding standards. This allows developers to move more freely between PHP and JavaScript code throughout the day.

The other great addition was contributed to me by Jake Bates and allows PHP_CodeSniffer to be used within an SVN pre-commit hook. This allows code that violates your coding standard to be blocked from your code repository; an extreme but sometimes necessary rule.

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

Monday, 10 March 2008

Using PHP_CodeSniffer in an SVN pre-commit hook

I've just commit a new script to PHP_CodeSniffer called phpcs-svn-pre-commit. It sits in the scripts dir with phpcs and phpcs.bat. This script was contributed by Jake Bates, who has also volunteered to maintain the Debian package, and will be available in the 1.1.0 release.

Using the script is pretty easy, but you'll need to modify it slightly.

Edit /path/to/PHP_CodeSniffer/scripts/phpcs-svn-pre-commit and replace @php_bin@ in the first line with the path to the PHP CLI. For example,

#!@php_bin@
becomes
#!/usr/bin/php

Then, ensure the path to svnlook is correct by modifying the line:
define('PHP_CODESNIFFER_SVNLOOK', '/usr/bin/svnlook');

Now, add the following line to your pre-commit file in the SVN hooks directory:
/.../phpcs-svn-pre-commit "$REPOS" -t "$TXN" >&2 || exit 1

This will cause the SVN commit to fail if PHP_CodeSniffer finds any errors. The error report will be displayed to the user so they can fix errors before attempting the commit again.

You can also use all the standard phpcs command line options to do things like set the standard to use, the tab width and the error report format:
/.../phpcs-svn-pre-commit --standard=Squiz --tab-width=4 ...

And some example output:
$ svn commit -m "Test" temp.php
Sending temp.php
Transmitting file data .svn: Commit failed (details follow):
svn: 'pre-commit' hook failed with error output:

FILE: temp.php
---------------------------------------------------------------
FOUND 1 ERROR(S) AND 0 WARNING(S) AFFECTING 1 LINE(S)
---------------------------------------------------------------
2 | ERROR | Missing file doc comment
---------------------------------------------------------------

Friday, 7 March 2008

Creating an SVN repostiory on OS X

I've been playing around with an SVN pre-commit hook for PHP_CodeSniffer that was submitted by Jack Bates. Part of that process required me to create a SVN repository for testing. While it was fairly easy overall, there were a few error messages that I got stuck on.

Firstly, creating the repository was dead simple:
$ create --fs-type fsfs /Users/Greg/TestSvnRepo

But then I couldn't checkout my repository. I'd get errors like:
$ svn co file:///Users/Greg/TestSvnRepo
Unable to open an ra_local session to URL
...
Expected version '3' of repository; found version '5'

Common suggestions on mailing lists point to svn not being compiled with ra_local support, which was not the problem in my case:
$ svn --version
svn, version 1.1.4 (r13838) compiled Jul 23 2006, 14:53:55
...
The following repository access (RA) modules are available:
* ra_dav : Module for accessing a repository via WebDAV (DeltaV) protocol.
- handles 'http' schema
- handles 'https' schema
* ra_local : Module for accessing a repository on local disk.
- handles 'file' schema
* ra_svn : Module for accessing a repository using the svn network protocol.
- handles 'svn' schema

I did find one useful article though. It mentions that different versions of svn software can cause problems. I believe this is more common when moving repositories between versions, or when connecting to a remote server, but in my case the problem was my version of svnadmin:
$ svnadmin --version
svnadmin, version 1.4.4 (r25188) compiled Sep 23 2007, 22:32:34

So my svnadmin utility is version 1.4.4 but the svn utility itself is 1.1.4. Adding the pre-1.4 command line argument suggested in the article worked a treat:
$ svnadmin create --fs-type fsfs --pre-1.4-compatible /Users/Greg/TestSvnRepo
$ svn co file:///Users/Greg/TestSvnRepo