Skip to content

Commit

Permalink
Merge pull request #32 from kiwilan/develop
Browse files Browse the repository at this point in the history
2.0.02
  • Loading branch information
ewilan-riviere committed Aug 28, 2023
2 parents b16de80 + e2603cb commit e7e001d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kiwilan/php-archive",
"version": "2.0.01",
"version": "2.0.02",
"description": "PHP package to handle archives (.zip, .rar, .tar, .7z) or .pdf with hybrid solution (native/p7zip), designed to works with eBooks (.epub, .cbz, .cbr, .cb7, .cbt).",
"keywords": [
"php",
Expand Down
17 changes: 13 additions & 4 deletions src/Archive.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ protected function __construct(
) {
}

/**
* Read an archive from the path.
*/
public static function read(string $path): BaseArchive
{
if (! file_exists($path)) {
Expand All @@ -42,11 +45,17 @@ public static function read(string $path): BaseArchive
return $archive::read($self->path);
}

public static function make(string $path): ArchiveZipCreate
/**
* Create an archive from path, allowing extensions are `zip`, `epub`, `cbz`.
*
* @param string $path Path to the archive
* @param bool $skipAllowed Skip allowed extensions check
*
* @throws \Exception
*/
public static function make(string $path, bool $skipAllowed = false): ArchiveZipCreate
{
$archive = ArchiveZipCreate::make($path);

return $archive;
return ArchiveZipCreate::make($path, $skipAllowed);
}

/**
Expand Down

0 comments on commit e7e001d

Please sign in to comment.