protected function writeFile($filename, array $dataset)
    {
        // Assume fail
        $result = false;

        // Get getMetaComponents on file to write binary ...
        $fileHandle = @fopen($filename, 'wb');

        if (!$fileHandle) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Can\'t access "%s" to store cache data. Check access rights and path', $filename)
            );
        }

        // File locking (exclusive lock)
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_EX);
        }

        $result = (fwrite($fileHandle, implode(PHP_EOL, $dataset)) !== false);

        // Remove file-lock
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_UN);
        }

        // close getMetaComponents
        fclose($fileHandle);

        return $result;
    }
protected function writeFile($filename, array $dataset)
    {
        // Assume fail
        $result = false;

        // Get getMetaComponents on file to write binary ...
        $fileHandle = @fopen($filename, 'wb');

        if (!$fileHandle) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Can\'t access "%s" to store cache data. Check access rights and path', $filename)
            );
        }

        // File locking (exclusive lock)
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_EX);
        }

        $result = (fwrite($fileHandle, implode(PHP_EOL, $dataset)) !== false);

        // Remove file-lock
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_UN);
        }

        // close getMetaComponents
        fclose($fileHandle);

        return $result;
    }
protected function writeFile ( $ filename , array $ dataset ) { // Assume fail $ result = false ; // Get getMetaComponents on file to write binary ... $ fileHandle = @ fopen ( $ filename , 'wb' ) ; if ( ! $ fileHandle ) { throw new Doozr_Cache_Service_Exception ( sprintf ( 'Can\'t access "%s" to store cache data. Check access rights and path' , $ filename ) ) ; } // File locking (exclusive lock) if ( $ this -> getLocking ( ) === true ) { flock ( $ fileHandle , LOCK_EX ) ; } $ result = ( fwrite ( $ fileHandle , implode ( PHP_EOL , $ dataset ) ) !== false ) ; // Remove file-lock if ( $ this -> getLocking ( ) === true ) { flock ( $ fileHandle , LOCK_UN ) ; } // close getMetaComponents fclose ( $ fileHandle ) ; return $ result ; }
Writes the passed data to file.

@param string $filename The filename to write to
@param array  $dataset  The dataset to write

@author Benjamin Carl <opensource@clickalicious.de>

@return bool TRUE if file could be written successful, otherwise FALSE

@throws Doozr_Cache_Service_Exception
Writes the passed data to file .