I tried to create a file on a FTP server using the FileSystem/Flysystem component of Spryker while executing a console command in my devvm.
The local file creation via “LocalFilesystemBuilderPlugin” adapter works without a flaw. But using “FtpFilesystemBuilderPlugin” adapter fails with the exception:
Spryker\Service\FileSystem\Dependency\Exception\FileSystemWriteException - Exception: ftp_chdir(): Can't change directory to test.txt: No such file or directory
The error occurs in composer package “league/flysystem” in “flysystem/src/Adapter/Ftp.php” on Line 389
Strangely, there is the error control operator “@” in front of the “ftp_chdir()” function which should surpress such error message, I thought. I also checked the error level by “error_reporting()” which returns “8191” (“E_ALL | E_STRICT”) for running in console command context.
More strangely is, that the manual change of the error level in my console command to value “0” is also bringing the same exception above (checked error level before “ftp_chdir()”).
The most strangely is: If I connect my component for creating a file on the FTP server to a state machine (target is to create some order-related file externally) it works like a charm to create the file on the FTP server while Spryker handles the order states processing (info: also with error level “8191”).
So, finally I have no problem if it is working in state machine context, but maybe you can investigate this issue why the “@” operator is ignored in console command context.