* Returns info from a tgz pear package
* (experimental)
*/
- function infoFromTgzFile($file)
+ function infoFromTgzFile($file, $pedantic = true)
{
- $file = basename($file); // XXX Fixme: Only allows file in the current dir
+ if ($pedantic) {
+ // XXX Fixme: Only allows file in the current dir
+ $file = basename($file);
+ }
if (!@is_file($file)) {
return $this->raiseError('no tar file supplied');
}
// Assume the decompressed dir name
- if (($pos = strrpos($file, '.')) === false) {
+ if ($pedantic && ($pos = strrpos($file, '.')) === false) {
return $this->raiseError('file doesn\'t follow the package name convention');
}
$pkgdir = substr($file, 0, $pos);