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

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

        // Get hash (previously calculated)
        $uid = $this->getCurrentResourceInformation('uid');

        // get getMetaComponents and write data
        $result = $this->_fwrite(
            $this->_getFileHandle($file, ($append ? self::FILE_MODE_WRITE_APPEND : self::FILE_MODE_WRITE)),
            $data
        );

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

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

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

        // Get hash (previously calculated)
        $uid = $this->getCurrentResourceInformation('uid');

        // get getMetaComponents and write data
        $result = $this->_fwrite(
            $this->_getFileHandle($file, ($append ? self::FILE_MODE_WRITE_APPEND : self::FILE_MODE_WRITE)),
            $data
        );

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

        // return the result of operation
        return $result;
    }
public function pwrite ( $ file , $ data , $ append = false , $ create = true , $ modeBoolean = true ) { // Preprocessing $ file = $ this -> _preProcess ( $ file ) ; // exception for the case that the file|folder isn't writable if ( ! $ this -> _is_resource_writable ( $ file ) ) { throw new Doozr_Exception ( 'Could not persistent write to file "' . $ file . '". Current operation failed. Check permissions.' ) ; } // Get hash (previously calculated) $ uid = $ this -> getCurrentResourceInformation ( 'uid' ) ; // get getMetaComponents and write data $ result = $ this -> _fwrite ( $ this -> _getFileHandle ( $ file , ( $ append ? self :: FILE_MODE_WRITE_APPEND : self :: FILE_MODE_WRITE ) ) , $ data ) ; // transform result? if ( $ modeBoolean ) { $ result = ( $ result !== false ) ? true : false ; } // return the result of operation return $ result ; }
Write content to a file in persistent runtimeEnvironment

This method is intend to write content to a file in persistent runtimeEnvironment.

@param string $file        The file to write the content to
@param string $data        The content to write to the file
@param bool   $append      TRUE to append to, FALSE to rewrite the file
@param bool   $create      TRUE to create file if it not exist, 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 TRUE/FALSE if runtimeEnvironment = bool, otherwise number of bytes written on success + false on failure
@access public
@throws Doozr_Exception
Write content to a file in persistent runtimeEnvironment