Oops
This commit is contained in:
parent
38ab509630
commit
e1f813ab60
2 changed files with 13 additions and 2 deletions
|
@ -285,8 +285,16 @@
|
||||||
*/
|
*/
|
||||||
private static function copyPackage(array $args): int
|
private static function copyPackage(array $args): int
|
||||||
{
|
{
|
||||||
|
$copy_path = $args['o'];
|
||||||
|
|
||||||
|
if($copy_path === null)
|
||||||
|
{
|
||||||
|
Console::outError('Missing required option "-o"', true, 1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
$package_reader = new PackageReader($args['path'] ?? $args['p']);
|
$package_reader = new PackageReader($args['path'] ?? $args['p']);
|
||||||
$package_reader->saveCopy($args['copy'] ?? $args['o']);
|
$package_reader->saveCopy($copy_path);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -668,7 +668,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy the package file to the destination
|
// Copy the package file to the destination
|
||||||
stream_copy_to_stream($this->package_file, $destination, $this->package_length, $this->package_offset);
|
if(stream_copy_to_stream($this->package_file, $destination, $this->package_length, $this->package_offset) === false)
|
||||||
|
{
|
||||||
|
throw new IOException(sprintf('Failed to copy package file to \'%s\'', $path));
|
||||||
|
}
|
||||||
|
|
||||||
// Done!
|
// Done!
|
||||||
fclose($destination);
|
fclose($destination);
|
||||||
|
|
Loading…
Add table
Reference in a new issue