close() public method

Close the connection
public close ( ) : boolean
return boolean
Example #1
0
    for ($i = 0; $i < count($filelist); $i++) {
        echo str_pad('', 4096);
        ob_flush();
        flush();
        if (!$example->upload('../example/' . $filelist[$i], $filelist[$i])) {
            $logmessage = "FAILD  : 文件 " . $filelist[$i] . "  上传失败!\n<br/>";
            //失败文件记录
            $faildlist[] = $filelist[$i];
            echo $logmessage;
            $example->add_log($logmessage);
            unset($filelist[$i]);
        } else {
            $temp = $i + 1;
            $logmessage = "<font color='red'>SUCCESS: 文件  " . $filelist[$i] . "  上传成功![ " . $temp . " ]</font>\n<br/>";
            echo $logmessage;
            $example->add_log($logmessage);
        }
    }
    $example->add_log("<br/>\n");
    //删除远程备份的文件
    //处理失败的文件,在列表$faildlist[]
    for ($i = 0; $i < count($faildlist); $i++) {
        $example->add_log($faildlist[$i], 'faildlist.log');
    }
    echo "报告: \n<br/>成功个数: " . count($filelist) . "\n<br/>";
    echo "失败个数: ";
    echo $filecount - count($filelist);
    echo "<br/>" . '<a href="remotesync.log.html"> remotesync.log</a><br/>';
    echo '<a href="example.log"> example.log</a><br/><br/>';
    $example->close();
}