Known Issues

Frank Kleine edited this page May 26, 2017 · 15 revisions

Known issues

Issues that exist because no one implemented them:

  • missing support for stream_set_blocking(), stream_set_timeout() and stream_set_write_buffer()

Issues that can not be fixed:

  • Some PHP functions do not work with any other URLs than pure filenames, as they are just thin wrappers around the native C functions and therefore do not support userland stream wrappers like vfs. Currently these functions are known:
    • chdir()
    • realpath()
    • link(), symlink(), readlink(), linkinfo()
    • SplFileInfo::getRealPath()
    • tempnam()
    • There may be more - in case a function you use does not work correctly with vfsStream URLs check the PHP manual for this function if it mentions a similar native C function.
  • ext/zip seems not to support userland stream wrappers, so it can not be used in conjunction with vfsStream
  • is_executable() on a vfsStream directory always returns false - this is a problem with PHP itself, see comments on the is_executable() manual page
  • file_put_contents() together with LOCK_EX does not work with vfsStream URLs
  • glob() does not work, see issue #2. If you really need glob() and want to test it with vfsStream, check out webmozart/glob.
  • touch(), chown(), chgrp() and chmod() only work with PHP >= 5.4 because support of stream wrappers for those functions was first added with PHP 5.4, see issue #56. With PHP 5.3 an error with the message "Unable to create file vfs://... because No such file or directory" will be raised
  • If you set a modified time, you must call clearstatcache() in order for filemtime() to return the new value.
  • If you use an object with a destructor that opens a vfsStream URL, vfsStream can become unavailable before the open occurs, causing it to fail with a WARNING. E.g. in PHPUnit, make sure to manually destroy the object in the test or in tearDown().
  • stream_resolve_include_path() does not resolve absolute vfsStream URLs. See vfsStreamResolveIncludePathTestCase.php about what does work with vfsStream URLs, though.
  • Setting ini key 'error_log' to a vfsStream url doesn't work with error_log('some message');, as the underlying implementation in PHP doesn't respect stream wrappers. Using error_log('foo', 3, vfsStream::url('error/error.log')); works, though.