При вызове этого
$fileSystem = $this->filesystemMap->get(IMReporter::FILE_SYSTEM_SFTP_NAME);
$fileSystem->write($filename, file_get_contents($tempFile));
Я получаю, что каталог «/home/darius/Desktop/veracitytest» не существует и не может быть создан ().
Я создал каталог и установил права доступа 777 вручную. При отладке я вижу, что он вызывает
protected function ensureDirectoryExists($directory, $create)
{
$pwd = $this->sftp->pwd();
if ($this->sftp->chdir($directory)) {
$this->sftp->chdir($pwd);
} elseif ($create) {
if (!$this->sftp->mkdir($directory, 0777, true)) {
throw new \RuntimeException(sprintf('The directory \'%s\' does not exist and could not be created (%s).', $this->directory, $this->sftp->getLastSFTPError()));
}
} else {
throw new \RuntimeException(sprintf('The directory \'%s\' does not exist.', $this->directory));
}
}
и он вызывает !$this-›sftp-›mkdir($directory, 0777, true)
В mkdir есть такой код
if (!($this->bitmap & SSH2::MASK_LOGIN)) {
return false;
}
который возвращает false, и поэтому я получаю сообщение об ошибке.
$this-›bitmap равен 7. Я не понимаю, что он здесь пытается сделать. В либе есть такой комментарий:
/**
* Execution Bitmap
*
* The bits that are set represent functions that have been called already. This is used to determine
* if a requisite function has been successfully executed. If not, an error should be thrown.
*
* @var int
* @access private
*/
var $bitmap = 0;
Пока я не нашел, где он вообще устанавливает его на 7.
Использование https://github.com/phpseclib/phpseclib 2.0