avatar fcoulter
fcoulter
26 Oct 2017

Steps to reproduce the issue

$ftp = JClientFtp::getInstance($ftp_host, $ftp_port, array(), $ftp_user, $ftp_pass);

//$filename is the name of the file to write on the remote server
//$output is a string holding the contents that you want to write
$ftp->write($filename, $output);

Expected result

A file gets written to the remote server containing the contents of $output

Actual result

The file does not get written
There is a warning in site error log

PHP Warning: fopen(): Unable to find the wrapper "buffer" - did you forget to enable it when you configured PHP? in /path/to/joomla/libraries/src/Client/FtpClient.php on line 1159:

System information (as much as possible)

Web Server Apache/2.4.28 (Unix)
WebServer to PHP Interface cgi-fcgi
PHP Version 7.0.24
Joomla! Version Joomla! 3.8.1 Stable

Additional comments

the line throwing the error is this

$tmp = fopen('buffer://tmp', 'br+');

It looks like the issue is this: buffer:// is not a standard PHP wrapper so needs to be registered as a stream wrapper. It seems this should happen in the FtpClient class constructor:-

		\JLoader::load('JBuffer');

The Buffer class should register the stream wrapper, it seems that this is not happening.

avatar fcoulter fcoulter - open - 26 Oct 2017
avatar joomla-cms-bot joomla-cms-bot - unlabeled - 26 Oct 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 26 Oct 2017
Category Plugins
avatar mbabker mbabker - change - 26 Oct 2017
Status New Closed
Closed_Date 0000-00-00 00:00:00 2017-10-26 13:53:03
Closed_By mbabker
avatar mbabker mbabker - close - 26 Oct 2017
avatar mbabker
mbabker - comment - 26 Oct 2017

See #18075 for solution.

avatar fcoulter
fcoulter - comment - 26 Oct 2017

Thanks Michael Babker


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18419.

Add a Comment

Login with GitHub to post a comment