public function append($file, $data, $create = true, $modeBoolean = true)
    {
        // Preprocessing
        $file = $this->_preProcess($file);

        if (!$create && !$this->_resource_exists($file)) {
            throw new Doozr_Exception(
                'Could not append to file. The file: "'.$file.'" does not exist.'.
                'Current operation failed. Create file first or set parameter $create to TRUE'
            );
        }

        // exception for the case that the file|folder isn't writable
        if (!$this->_is_writable($file)) {
            throw new Doozr_Exception(
                'Could not append to file. Could not write given content to file: "'.$file.'" '.
                'Current operation failed. Check permissions.'
            );
        }

        // put the content to file
        $result = $this->_append($file, $data, $create);

        // transform result?
        if ($modeBoolean) {
            $result = ($result >= 0) ? true : false;
        }

        // return result of write operation
        return $result;
    }
public function append($file, $data, $create = true, $modeBoolean = true)
    {
        // Preprocessing
        $file = $this->_preProcess($file);

        if (!$create && !$this->_resource_exists($file)) {
            throw new Doozr_Exception(
                'Could not append to file. The file: "'.$file.'" does not exist.'.
                'Current operation failed. Create file first or set parameter $create to TRUE'
            );
        }

        // exception for the case that the file|folder isn't writable
        if (!$this->_is_writable($file)) {
            throw new Doozr_Exception(
                'Could not append to file. Could not write given content to file: "'.$file.'" '.
                'Current operation failed. Check permissions.'
            );
        }

        // put the content to file
        $result = $this->_append($file, $data, $create);

        // transform result?
        if ($modeBoolean) {
            $result = ($result >= 0) ? true : false;
        }

        // return result of write operation
        return $result;
    }
public function append ( $ file , $ data , $ create = true , $ modeBoolean = true ) { // Preprocessing $ file = $ this -> _preProcess ( $ file ) ; if ( ! $ create && ! $ this -> _resource_exists ( $ file ) ) { throw new Doozr_Exception ( 'Could not append to file. The file: "' . $ file . '" does not exist.' . 'Current operation failed. Create file first or set parameter $create to TRUE' ) ; } // exception for the case that the file|folder isn't writable if ( ! $ this -> _is_writable ( $ file ) ) { throw new Doozr_Exception ( 'Could not append to file. Could not write given content to file: "' . $ file . '" ' . 'Current operation failed. Check permissions.' ) ; } // put the content to file $ result = $ this -> _append ( $ file , $ data , $ create ) ; // transform result? if ( $ modeBoolean ) { $ result = ( $ result >= 0 ) ? true : false ; } // return result of write operation return $ result ; }
appends a string to a file

This method is intend to append a string (or binary-data) to a file.

@param string $file        The file to write the content to
@param string $data        The content to write to the file
@param bool   $create      TRUE to create file if it not exists, FALSE to do not
@param bool   $modeBoolean TRUE to return result as bool, otherwise FALSE to return number of bytes written

@author Benjamin Carl <opensource@clickalicious.de>
@return mixed Number of bytes written if everything wents fine, otherwise false
@access public
@throws Doozr_Exception
appends a string to a file