lib/bagit.php
function package($destination, $method='tgz')
    {
        $method = strtolower($method);
        if ($method != 'zip' && $method != 'tgz') {
            throw new BagItException("Invalid compression method: '$method'.");
        }

        if (substr_compare($destination, ".$method", -4, 4, true) != 0) {
            $destination = "$destination.$method";
        }

        BagIt_compressBag(
            $this->bagDirectory,
            $destination,
            $method
        );
    }
function package($destination, $method='tgz')
    {
        $method = strtolower($method);
        if ($method != 'zip' && $method != 'tgz') {
            throw new BagItException("Invalid compression method: '$method'.");
        }

        if (substr_compare($destination, ".$method", -4, 4, true) != 0) {
            $destination = "$destination.$method";
        }

        BagIt_compressBag(
            $this->bagDirectory,
            $destination,
            $method
        );
    }
function package ( $ destination , $ method = 'tgz' ) { $ method = strtolower ( $ method ) ; if ( $ method != 'zip' && $ method != 'tgz' ) { throw new BagItException ( "Invalid compression method: '$method'." ) ; } if ( substr_compare ( $ destination , ".$method" , - 4 , 4 , true ) != 0 ) { $ destination = "$destination.$method" ; } BagIt_compressBag ( $ this -> bagDirectory , $ destination , $ method ) ; }
Compresses the bag into a file.

@param string $destination The file to put the bag into.
@param string $method      Either 'tgz' or 'zip'. Default is 'tgz'.

@return void
Compresses the bag into a file .