GithubHelp home page GithubHelp logo

kiwilan / php-archive Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 5.0 3.16 MB

PHP package to handle archives (.zip, .rar, .tar, .7z, .pdf) with unified API and hybrid solution (native/p7zip), designed to works with EPUB and CBA (.cbz, .cbr, .cb7, .cbt).

License: MIT License

PHP 100.00%
7z 7zip archive cb7 cba cbr cbt cbz ebook epub

php-archive's People

Contributors

dependabot[bot] avatar ewilan-riviere avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

php-archive's Issues

Read Archive from string?

What happened?

Would it be possible to pass data to this package as a string? I am reading the first X amount of bytes from a partially downloaded file which is a string and not saved to disk. Currently I only see the read function but that only takes a disk path.

I am trying to list the files in the archive and read their CRC32 value.

Another thing that would be nice is the ability to set the path for 7zip. Since the p7zip is unmaintained there's the normal 7zip package now which comes with the 7zz binary.

Also, is there password support on the horizon some time? Like $archive->setPassword('password'); before trying to list/extract.

How to reproduce the bug

Package Version

Latest

PHP Version

8.3.2

Which operating systems does with happen with?

Linux

Notes

No response

[Bug]: Trying file_get_contents() on a folder

What happened?

I receive
PHP Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /.../vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155
when i tries to read content from array
$files = $zip->getFiles();

I'm try to read ZIP archive with subfolders. And i can't normaly get info if it's dir.
This is my code:
image

Output with dump filenames and extensions:

array:2 [
"$file->getFilename()" => "Бух.отч. от аудиторов полная 2017"
"$file->getExtension()" => " от аудиторов полная 2017"
] // app/Services/ExternalSources/EDisclosure.php:273
PHP Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /home/www/dev.eninvs.com/vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155

Notice: file_get_contents(): Read of 8192 bytes failed with errno=21 Is a directory in /home/www/dev.eninvs.com/vendor/kiwilan/php-archive/src/Processes/SevenZipProcess.php on line 155
"skipping folder or empty file: Бух.отч. от аудиторов полная 2017"
array:2 [
"$file->getFilename()" => "Аудиторское заключ. 2017.pdf"
"$file->getExtension()" => "pdf"
]
array:2 [
"$file->getFilename()" => "Баланс и ОФР 2017.pdf"
"$file->getExtension()" => "pdf"
]
array:2 [
"$file->getFilename()" => "Отчет о движении ден.средств 2017.pdf"
"$file->getExtension()" => "pdf"
]

How to reproduce the bug

If you want repeat it then read all files in loop in archive with subfolders. Subfolders should contain dots in it's name.

Package Version

2.1.02

PHP Version

8.1.27

Which operating systems does with happen with?

Linux

Notes

No response

[Suggestion]: upgrade version of package

What happened?

Hi!
Could you upgrade version of package?
I want to use new features of your package like binary path and etc, but I can't do it because current git version contains 54 new commits to main branch since last release

How to reproduce the bug

Install package via composer

Package Version

2.2.0

PHP Version

8.2.0

Which operating systems does with happen with?

No response

Notes

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.