PushError example

if(!$this->_exec("RNFR ".$from, "rename")) return FALSE;
        if(!$this->_checkCode()) return FALSE;
        if($this->_code==350) {
            if(!$this->_exec("RNTO ".$to, "rename")) return FALSE;
            if(!$this->_checkCode()) return FALSE;
        } else return FALSE;
        return TRUE;
    }

    function filesize($pathname) {
        if(!isset($this->_features["SIZE"])) {
            $this->PushError("filesize", "not supported by server");
            return FALSE;
        }
        if(!$this->_exec("SIZE ".$pathname, "filesize")) return FALSE;
        if(!$this->_checkCode()) return FALSE;
        return preg_replace("/^[0-9]{3} ([0-9]+).*$/s", "\\1", $this->_message);
    }

    function abort() {
        if(!$this->_exec("ABOR", "abort")) return FALSE;
        if(!$this->_checkCode()) {
            if($this->_code!=426) return FALSE;
            
function __construct($verb=FALSE, $le=FALSE) {
        parent::__construct(false, $verb$le);
    }

// <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- -->
    function _settimeout($sock) {
        if(!@stream_set_timeout($sock$this->_timeout)) {
            $this->PushError('_settimeout','socket set send timeout');
            $this->_quit();
            return FALSE;
        }
        return TRUE;
    }

    function _connect($host$port) {
        $this->SendMSG("Creating socket");
        $sock = @fsockopen($host$port$errno$errstr$this->_timeout);
        if (!$sock) {
            $this->PushError('_connect','socket connect failed', $errstr." (".$errno.")");
            
function __construct($verb=FALSE, $le=FALSE) {
        parent::__construct(true, $verb$le);
    }

// <!-- --------------------------------------------------------------------------------------- --> // <!-- Private functions --> // <!-- --------------------------------------------------------------------------------------- -->
    function _settimeout($sock) {
        if(!@socket_set_option($sock, SOL_SOCKET, SO_RCVTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
            $this->PushError('_connect','socket set receive timeout',socket_strerror(socket_last_error($sock)));
            @socket_close($sock);
            return FALSE;
        }
        if(!@socket_set_option($sock, SOL_SOCKET , SO_SNDTIMEO, array("sec"=>$this->_timeout, "usec"=>0))) {
            $this->PushError('_connect','socket set send timeout',socket_strerror(socket_last_error($sock)));
            @socket_close($sock);
            return FALSE;
        }
        return true;
    }

    
Home | Imprint | This part of the site doesn't use cookies.