Test: /ext/ftp/tests/bug39583.phpt - Version 7.0.0-dev        

Bug #39583 FTP function always transfers in binary mode
Submitted: 2006-11-22 10:29:31 Modified: 2006-11-24 12:40:44
From: ts.serveroperations Assigned:
Status: Closed Package: FTP related
PHP Version: 4.4.4 OS: Redhat Enterprise ES version 4

There are 4 different diffs reported by users for this test.

Count Diff
85 (91%)
001+
001- bool(true)
002- Uploaded %sbug39583.php as bug39583.php
5 (5%)
2 (2%)
002+
002- Uploaded %sbug39583.php as bug39583.php
003+ Notice: Array to string conversion in /home/travis/build/smalyshev/php-src/ext/ftp/tests/server.inc on line 240
004+ string(554) "<?php
005+ $bug39583=1;
006+ require 'server.inc';
007+
008+ $ftp = ftp_connect('127.0.0.1', $port);
009+ if (!$ftp) die("Couldn't connect to the server");
010+
011+ var_dump(ftp_login($ftp, 'user', 'pass'));
012+
013+ $source_file = __FILE__;
014+ $destination_file = basename(__FILE__);
015+
016+ // upload the file
017+ $upload = ftp_put($ftp, $destination_file, $source_file, FTP_ASCII);
018+
019+ // check upload status
020+ if (!$upload) {
021+ echo "FTP upload has failed!";
022+ } else {
023+ echo "Uploaded $source_file as $destination_file";
024+ }
025+
026+ // close the FTP stream
027+ ftp_close($ftp);
028+ ?>
029+ "
030+ string(529) "<?php
031+ $bug39583=1;
032+ require 'server.inc';
033+
034+ $ftp = ftp_connect('127.0.0.1', $port);
035+ if (!$ftp) die("Couldn't connect to the server");
036+
037+ var_dump(ftp_login($ftp, 'user', 'pass'));
038+
039+ $source_file = __FILE__;
040+ $destination_file = basename(__FILE__);
041+
042+ // upload the file
043+ $upload = ftp_put($ftp, $destination_file, $source_file, FTP_ASCII);
044+
045+ // check upload status
046+ if (!$upload) {
047+ echo "FTP upload has failed!";
048+ } else {
049+ echo "Uploaded $source_file as $destination_file";
050+ }
051+
052+ // close the FTP stream
053+ ftp_close($ftp);
054+ ?>
055+ "
056+
057+ Warning: ftp_put(): Requested file action aborted. in %s/bug39583.php on line 14
058+ FTP upload has failed!
1 (1%)
001+ Warning: stream_socket_server(): unable to connect to tcp://127.0.0.1:54319 (Address already in use) in /home/travis/build/php/php-src/ext/ftp/tests/server.inc on line 10