Flysystem adapter for Nextcloud WebDAV integration.
Compatible with PHP 8.2+ and Flysystem v3.29+.
- 📂 Nextcloud storage adapter for League\Flysystem
- 🏗️ Fully tested with Flysystem adapter utilities + additional tests
- PHP 8.2 or higher
- Flysystem v3.29+
- Nextcloud instance (with WebDAV access)
- Docker (for local testing)
composer require marktaborosi/flysystem-nextclouduse League\Flysystem\Filesystem;
use Marktaborosi\FlysystemNextcloud\NextCloudAdapter;
$adapter = new NextCloudAdapter([
'baseUri' => 'http://localhost:8080/remote.php/dav/files/admin/',
'userName' => 'admin',
'password' => 'admin',
]);
$filesystem = new Filesystem($adapter);
$filesystem->write('example.txt', 'Hello Nextcloud!');This adapter includes a full test suite using league/flysystem-adapter-test-utilities.
- Start the Docker containers:
docker-compose up -d- Run PHPUnit:
vendor/bin/phpunitImportant: Ensure the Nextcloud container is running and fully initialized before executing the tests.
Provided docker-compose.yml includes:
- MariaDB database
- Nextcloud app
Configuration expects:
- Admin user:
admin - Admin password:
admin - DB credentials: see
docker-compose.ymlor.env.
Note: You can override port mappings easily via the
.envfile.
Example.envvariables:NEXTCLOUD_HTTP_PORT=8080 NEXTCLOUD_DB_PORT=3306 MYSQL_ROOT_PASSWORD=root_password MYSQL_DATABASE=nextcloud MYSQL_USER=nextcloud MYSQL_PASSWORD=nextcloud_password NEXTCLOUD_ADMIN_USER=admin NEXTCLOUD_ADMIN_PASSWORD=admin
Once the Docker containers are up, you can access the Nextcloud web interface locally:
http://localhost:[NEXTCLOUD_HTTP_PORT]
Default credentials:
- Username:
${NEXTCLOUD_ADMIN_USER}(default:admin) - Password:
${NEXTCLOUD_ADMIN_PASSWORD}(default:admin)
You can login and interact directly with your running Nextcloud instance.
sabre/dav: Required for WebDAV communicationlarapack/dd: Optional, for debugging purposes
The MIT License (MIT). Please see License File for more information.
Big thanks to:
- The PHP League for creating and maintaining Flysystem.
- Nextcloud for providing an excellent WebDAV API.
This adapter would not be possible without these open-source projects. 🙏
Made with ❤️ by Mark Taborosi