Slaven Rezić > WE_Framework-0.097_03 > WE::Export

Download:
WE_Framework-0.097_03.tar.gz

Dependencies

Annotate this POD

Module Version: 1.10   Source  

NAME ^

WE::Export - export a WE::DB database

SYNOPSIS ^

    use WE::Export;
    my $r = new WE::DB ...;
    my $ex = new WE::Export $r;
    $ex->export_all;

DESCRIPTION ^

This module provides export and import methods for the WE::DB database.

CONSTRUCTOR new

Called as new WE::Export $rootdb. Create a new WE::Export object for the given database $rootdb. Additional arguments (as dashed key-value pairs) will be passed to the object.

METHODS

export_db

Create data dumper files of the metadata databases and store them into the directory specified by the Tmpdir member. Data::Dumper files are created because most DBM file formats are incompatible between various systems.

export_content

Copy the content files to the content subdirectory of the directory specified by the Tmpdir member.

export_all

Create an archive file (.tar.gz format) of both database and content. Two member variables control paths for the export: Tmpdir specifies the temporary directory, where database and content files will be stored, and Archive specifies the path for the generated archive file. If not specified, then reasonable defaults are chosen (using the systems default temp directory). After the creation of the archive file, the temporary directory will be deleted completely.

import_archive($tarfile, $destdir, %args)

For the specified tar archive $tarfile (previously created by export_all), the content will be extracted to the directory $destdir. The destination directory must not exist and will be created by the method.

Further arguments %args:

-verbose => $boolean

Be verbose.

-force => $boolean

Extract even if destination directory exists.

-only => [DB1, ...]

Extract only specified databases. Note that content is always extracted.

-chmod => $boolean

Make chmod manipulations (set everything to 0777 resp. 0666) if set to true.

BUGS ^

This module will only work on Windows with installed Archive::Tar and Compress::Zlib (this is usually true with ActivePerl). On Unix, you need the programs tar and gzip.

AUTHOR ^

Slaven Rezic - slaven@rezic.de

SEE ALSO ^

syntax highlighting: