PclZip::merge PHP Method

merge() public method

--------------------------------------------------------------------------------
public merge ( $p_archive_to_add )
    public function merge($p_archive_to_add)
    {
        $v_result = 1;
        // ----- Reset the error handler
        $this->privErrorReset();
        // ----- Check archive
        if (!$this->privCheckFormat()) {
            return 0;
        }
        // ----- Look if the $p_archive_to_add is a PclZip object
        if (is_object($p_archive_to_add) && get_class($p_archive_to_add) == 'pclzip') {
            // ----- Merge the archive
            $v_result = $this->privMerge($p_archive_to_add);
        } elseif (is_string($p_archive_to_add)) {
            // ----- Create a temporary archive
            $v_object_archive = new PclZip($p_archive_to_add);
            // ----- Merge the archive
            $v_result = $this->privMerge($v_object_archive);
        } else {
            // ----- Error log
            PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, 'Invalid variable type p_archive_to_add');
            $v_result = PCLZIP_ERR_INVALID_PARAMETER;
        }
        // ----- Return
        return $v_result;
    }