Apache-PAR

 view release on metacpan or  search on metacpan

PAR.pm  view on Meta::CPAN

		}
		return $tmppar if (stat($tmppar))[9] > (stat($par))[9];
		warn "[PAR] removing old unpack dir '$tmppar'" if DEBUG;
		File::Path::rmtree $tmppar;
	}
 
	# XXX Add signature check here

	# unpack the files
	foreach my $member ($zip->members) {
		# $member->fileName is always in Unix format
		# See also Archive::Zip::_asLocalName()
		my $file = File::Spec->catfile($tmppar, split('/', $member->fileName));
		warn "[PAR] extracting '$file'\n" if DEBUG;
		my $rv = $member->extractToFileNamed($file);
		unless($rv == AZ_OK) {
			 print STDERR "Error extracting '$file' from '$par': error code: $rv";
			 return undef;
		}
		if ($member->fileAttributeFormat == 3) { # unix permissions
			my $perms = $member->unixFileAttributes & 0xFFF;
			unless(chmod $perms, $file) {
				 print STDERR "chmod $perms, $file failed: $!";
				 return undef;
			}
		}
	}

	return $tmppar;
}

PAR.pm  view on Meta::CPAN

=item 4. /i386-freebsd/       # i.e. $Config{archname}

=item 5. /5.8.0/              # i.e. $Config{version}

=item 6. /5.8.0/i386-freebsd/ # both of the above

=back

By default, if a web.conf file contains a C<##UNPACKDIR##> directive, the archive will be 
unpacked to a subdirectory under PARTempDir during Apache startup.  The default for 
PARTempDir is the platform specific temp directory (e.g. c:\temp for win32, /tmp for *nix.)
Archive unpacking may be disabled by specifying C<PerlSetVar PARTempDir NONE> in the Apache 
configuration, however this will prevent the loading of any PAR files which require 
unpacking to operate.

Changed content in PAR files is not reloaded util the next restart of Apache unless the 
directive C<PerlInitHandler Apache::PAR> is used.  Currently, some functionality will not 
change or reload when a PAR file is removed, however.  This may change in a future release.

=head1 PLATFORM SPECIFIC



( run in 2.175 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )