Skip to content

Flysystem V3: v3.0.0

Latest

Choose a tag to compare

@masbug masbug released this 10 Nov 13:06

Version 3.0.0 contains all changes of v2.6.0. The requirements are the same: PHP 8.1 or later, Flysystem 3, Guzzle 7.15.2+ or 8.0.1+.

Changes that can break existing code

  • delete() follows the Flysystem contract:
    • A path that does not exist is a success. Before, the adapter without display paths threw UnableToDeleteFile.
    • An error from Google Drive throws UnableToDeleteFile. Before, the adapter with display paths reported success.
  • move() throws UnableToMoveFile when Google Drive does not return the moved file. Before, the method returned without an error.
  • Public methods have native parameter and return types. A subclass that overrides one of these methods must declare a compatible signature:
    __construct(), getService(), clearCache(), refreshToken(), getMetadata(), getUrl(), hasDir(), getFileObject(), uncacheFolder(), emptyTrash(), enableTeamDriveSupport(), setTeamDriveId(), dirname(), normalizeDirname(), guessMimeType(), escapeQueryValue() and the protected normaliseObject().
  • StreamableUpload: setFileSize(), getProgress(), getResumeUri(), setChunkSize() and getRequest() have return types.
  • The global constant DEBUG_ME and the debug output are removed.

Fixes

  • getUrl() returns an empty string when the file does not exist. Before, it caused a fatal error.
  • A file without a modification time gets lastModified = null. Before, it caused a TypeError.
  • visibility() keeps the original error as the cause of UnableToRetrieveMetadata.

Development

  • GitHub Actions run the unit tests on PHP 8.1 to 8.5 with the lowest and the newest dependencies, composer audit, and PHPStan (level 5). The Travis CI, Scrutinizer and StyleCI configurations are removed.
  • New Unit test suite that needs no Google credentials.
  • The Integration suite runs against a real Google Drive account. Each test class works in its own folder and deletes it after the last test.
  • New integration tests: upload of a 150 MB file (resumable upload), readStream() of a Google Docs file, shortcuts, and the complete Flysystem suite with the option useSinglePathTransaction. To skip the large upload: phpunit --exclude-group slow.

Parts of this release are based on #142 by tarikmanoar.

Full Changelog: v2.6.0...v3.0.0