src/Liuggio/RackspaceCloudFilesStreamWrapper/StreamWrapper/RackspaceCloudFilesStreamWrapper.php
public function stream_flush()
    {
        if (!$this->getResource()) {
            return false;
        }

        $buffer = $this->getDataBuffer();
        $bufferWritten = $buffer;
        $retVal = true;
        if (!empty($buffer)) {

            $object = $this->getResource()->getObject();
            $mimetype = $this->getService()->guessFileType($this->getResource()->getResourceName());
            $object->content_type = $mimetype;
            $object->setData($buffer);
            $object->Create();
        }

       if (strlen($bufferWritten) ==  strlen($buffer)) {
            $this->setDataBuffer(null);
        } else {
            $this->setDataBuffer($buffer);
        }
        $this->setDataBuffer(null);

        return $retVal;
    }
public function stream_flush()
    {
        if (!$this->getResource()) {
            return false;
        }

        $buffer = $this->getDataBuffer();
        $bufferWritten = $buffer;
        $retVal = true;
        if (!empty($buffer)) {

            $object = $this->getResource()->getObject();
            $mimetype = $this->getService()->guessFileType($this->getResource()->getResourceName());
            $object->content_type = $mimetype;
            $object->setData($buffer);
            $object->Create();
        }

       if (strlen($bufferWritten) ==  strlen($buffer)) {
            $this->setDataBuffer(null);
        } else {
            $this->setDataBuffer($buffer);
        }
        $this->setDataBuffer(null);

        return $retVal;
    }
public function stream_flush ( ) { if ( ! $ this -> getResource ( ) ) { return false ; } $ buffer = $ this -> getDataBuffer ( ) ; $ bufferWritten = $ buffer ; $ retVal = true ; if ( ! empty ( $ buffer ) ) { $ object = $ this -> getResource ( ) -> getObject ( ) ; $ mimetype = $ this -> getService ( ) -> guessFileType ( $ this -> getResource ( ) -> getResourceName ( ) ) ; $ object -> content_type = $ mimetype ; $ object -> setData ( $ buffer ) ; $ object -> Create ( ) ; } if ( strlen ( $ bufferWritten ) == strlen ( $ buffer ) ) { $ this -> setDataBuffer ( null ) ; } else { $ this -> setDataBuffer ( $ buffer ) ; } $ this -> setDataBuffer ( null ) ; return $ retVal ; }
Flush the data buffer to the CDN.

@return bool
Flush the data buffer to the CDN .