From:             [EMAIL PROTECTED]
Operating system: FreeBSD 4.7
PHP version:      4.3.0
PHP Bug Type:     Output Control
Bug description:  implicit_flush and flush() not working proplerly with CLI SAPI

Basically it just seems to not be working at all on my system...however
when initiating "php -i" I get:

implicit_flush => On => Off

my configure line was: ./configure --with-mysql --enable-ftp
--with-apxs=/usr/local/apache/bin/apxs


Here is the script, which doesn't output ANYTHING until the script
ends...it is then all flushed out at once...the warning messages come out
as the script executes, but not the echo's or print()'s


<?php
print("weee");
$ftp_server = 'host';
$ftp_user_name = 'user';
$ftp_user_pass = 'pass';
$localprefix = '/usr/home/blah/';
$remoteprefix = '/usr/home/blah/';

$subdirs = array('lib','HELP','ONJOINS','HELP/CHANSERV','HELP/NICKSERV');

foreach ($subdirs as $dir) {
mkdir($localprefix . $dir);
print("mkdir $localprefix . $dir\n");
}

// set up basic connection
$conn_id = ftp_connect($ftp_server);

// login with username and password
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);

// check connection
if ((!$conn_id) || (!$login_result)) {
        echo "FTP connection has failed!\n";
        echo "Attempted to connect to $ftp_server for user
$ftp_user_name\n";
        exit;
    } else {
        echo "Connected to $ftp_server, for user $ftp_user_name\n";
    }

// get the files

foreach ($subdirs as $dir) {
ftp_chdir($conn_id, "$remoteprefix$dir");
print("$remoteprefix$dir");
$curdir = ftp_pwd($conn_id);
foreach (ftp_nlist ($conn_id, $curdir) as $file) {
$download = ftp_get($conn_id, $localprefix . $dir . '/' . $file, $file,
FTP_ASCII);

// check upload status
if (!$download) {
        echo "FTP upload has failed for $dir/$file!\n";
    } else {
        echo "Downloaded $dir/$file successfully\n";
    }
}
}

// close the FTP stream
ftp_close($conn_id);
?>
-- 
Edit bug report at http://bugs.php.net/?id=21895&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=21895&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=21895&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=21895&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=21895&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=21895&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=21895&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=21895&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=21895&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=21895&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=21895&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21895&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=21895&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=21895&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=21895&r=gnused

Reply via email to