News Archive
PhpRiot Newsletter
Your Email Address:

More information

vfsStream 1.1.0 released

Note: This article was originally published at Planet PHP on 25 August 2012.
Planet PHP
With the release of vfsstream 1.1.0 a whole range of new features is introduced. First and foremost is support for new features which became possible with PHP 5.4, namely that 5.4 enables support for touch(), chown(), chgrp() and chmod() on stream wrappers. vfsStream 1.1.0 now supports these functions, which means they can be applied to vfsStream urls. This allows to test functions and methods which change file permissions or ownership.

Another new feature that came along with PHP 5.4 is support for truncating stream wrapper streams via ftruncate(). Of course, vfsStream now supports this as well.

Despite support for the new PHP 5.4 features vfsStream 1.1.0 can still be used with PHP 5.3, but of course without the features requiring PHP 5.4.

Last but not least vfsStream 1.1.0 introduces a new quota feature. This allows to limit the available space in the virtual file system and allows to simulate how your code behaves in case you run out of disk space. For more details check the documentation.

As there was no release announcement for 1.0.0, here is what changed with 1.0.0: vfsStream was changed to make use of namespaces, which means support for PHP 5.2 was dropped. All vfsStream classes now reside in org\bovigo\vfs. (Yeah, it is. Maybe I'm spoiled by Java here.) Besides that, the release contains some bug fixes. See changelog for a complete list of changes.

Additionally, since 1.0.0 vfsStream is no longer available via PEAR, but via Composer. You can get releases via Packagist.

As the old PEAR server on ceased to exist I made a 0.12.0 release available at This one is not supported, for bc purposes only and only if you still require a version running with PHP 5.2. Otherwise, it is recommended to upgrade to the 1.x series using Composer.