Transparent, protocol independent, local and remote file system operations.
Abstract virtual-file-system-like behavior across local file systems and remote protocols. With a syntax analogue to FTP-clients (put, get) depage-fs makes PHP stream wrappers easily accessible and provides a unified user interface.
Usage follows a local-remote paradigm where 'local' means the actual current working directory and 'remote' can be another local directory or a directory on a remote system.
depage-fs virtually tracks the remote working directory (cd, pwd). Once the remote path is set, it prevents any operations in parent directories.
PHP 8.3 or later. The ftp(s) protocol needs the curl extension, the ssh protocol the ssh2 extension.
pwd, ls, lsDir, lsFiles, exists, fileInfo, cd, mkdir, rm, mv, get, put, getString, putString
local, ftp(s), ssh (authentication by password or key)
File transfer, local to remote
First, get the SSH fingerprint...
then connect with SSH key
The test suite needs an ssh server and an ftp server as remote targets.
Locally this runs in docker: a phpunit runner container and a mock server container (vsftpd + sshd), connected through a docker network. Requires docker with the compose plugin.
On CI (GitHub Actions) the same services are provisioned directly on the runner by Tests/ci/setup-services.sh (no docker), which allows testing a matrix of php versions (8.3, 8.4, 8.5) in parallel.
Only Tests/FtpCurlErrorTest.php and the local tests run without those servers:
phpcs.xml.dist checks the code against the PHPCompatibility standard for the php range depage-fs supports (keep testVersion in sync with the php requirement in composer.json):
Tests/PHPUnit.xml sets failOnDeprecation, so a php deprecation (e.g. one introduced by a new php version in the matrix) fails the test run instead of only being counted in the summary.