Nodelist import update
This commit is contained in:
@@ -42,19 +42,19 @@ trait Import
|
||||
|
||||
if ($z->open($file,\ZipArchive::RDONLY) === TRUE) {
|
||||
if ($z->count() !== 1)
|
||||
throw new \Exception(sprintf('%s:File [%s] has more than 1 file (%d)', self::LOGKEY, $file, $z->count()));
|
||||
throw new \Exception(sprintf('%s:! File [%s] has more than 1 file (%d)', self::LOGKEY, $file, $z->count()));
|
||||
|
||||
$zipfile = $z->statIndex(0, \ZipArchive::FL_UNCHANGED);
|
||||
Log::debug(sprintf('%s:Looking at [%s] in archive [%s]', self::LOGKEY,$zipfile['name'],$file));
|
||||
Log::debug(sprintf('%s:- Looking at [%s] in archive [%s]', self::LOGKEY,$zipfile['name'],$file));
|
||||
|
||||
$f = $z->getStream($zipfile['name']);
|
||||
if (! $f)
|
||||
throw new \Exception(sprintf('%s:Failed getting ZipArchive::stream (%s)',self::LOGKEY,$z->getStatusString()));
|
||||
throw new \Exception(sprintf('%s:! Failed getting ZipArchive::stream (%s)',self::LOGKEY,$z->getStatusString()));
|
||||
else
|
||||
return $z;
|
||||
|
||||
} else {
|
||||
throw new \Exception(sprintf('%s:Failed opening ZipArchive [%s] (%s)',self::LOGKEY,$file,$z->getStatusString()));
|
||||
throw new \Exception(sprintf('%s:! Failed opening ZipArchive [%s] (%s)',self::LOGKEY,$file,$z->getStatusString()));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user