All Projects → Gemorroj → Archive7z

Gemorroj / Archive7z

Licence: LGPL-3.0 license
This library provides handling of 7z files in PHP

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to Archive7z

ZeeArchiver
Zee is an efficient and simple to use Android Archiver and decompressor. It can decompress and compress from-to all the formats supported by the well known 7zip utility. Copyright © 2018 Mahmoud Galal , for support contact me:[email protected]
Stars: ✭ 35 (-52.05%)
Mutual labels:  p7zip, archive, 7z, 7zip
7 Zip Zstd
7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
Stars: ✭ 2,150 (+2845.21%)
Mutual labels:  archiver, 7-zip, 7z, 7zip
go7z
A native Go 7z archive reader.
Stars: ✭ 46 (-36.99%)
Mutual labels:  archive, 7z, 7zip
archivebot
💾 A telegram bot for backing up and collecting all kinds of media.
Stars: ✭ 65 (-10.96%)
Mutual labels:  archive, archiver
Diskernet
💾 Diskernet - An internet on yer disk. Full text search archive from your browsing and bookmarks. Weclome! to the Diskernet: Your preferred backup solution. It's like you're still online! Disconnect with Diskernet, an internet for the post-online apocalypse. Or the airplane WiFi. Or the site goes down. Or ... You get the picture. Get Diskernet.…
Stars: ✭ 2,788 (+3719.18%)
Mutual labels:  archive, archiver
SevenZip
ObjC wrapper around the 7zip/LZMA SDK
Stars: ✭ 34 (-53.42%)
Mutual labels:  p7zip, 7-zip
SevenZipSharp
Fork of SevenZipSharp on CodePlex
Stars: ✭ 171 (+134.25%)
Mutual labels:  7z, 7zip
22120
This project literally makes your web browsing available COMPLETELY OFFLINE. Your browser does not even know the difference. It's literally that amazing. Yes.
Stars: ✭ 2,613 (+3479.45%)
Mutual labels:  archive, archiver
Ob3vil1on
Another archive cracker created in python | cracking [zip/7z/rar] by bruteforcing [ NOT MAINTAINED ]
Stars: ✭ 17 (-76.71%)
Mutual labels:  archive, 7z
fairytale
encode.ru community archiver
Stars: ✭ 29 (-60.27%)
Mutual labels:  archiver
heurist
Core development repository. gitHub: Vsn 6 (2020 - ), Vsn 5 (2018 - 2020), Vsn 4 (2014-2017). Sourceforge: Vsn 3 (2009-2013), Vsn 1 & 2 (2005-2009)
Stars: ✭ 39 (-46.58%)
Mutual labels:  archive
QArchive
Async C++ Cross-Platform library that modernizes libarchive using Qt5 🚀. Simply extracts 7z 🍔, Tarballs 🎱 and other supported formats by libarchive. ❤️
Stars: ✭ 66 (-9.59%)
Mutual labels:  7zip
ArchiverForGooglePhotos
A tool to maintain an archive/mirror of your Google Photos library for backup purposes.
Stars: ✭ 104 (+42.47%)
Mutual labels:  archiver
unarr
A decompression library for rar, tar, zip and 7z archives
Stars: ✭ 35 (-52.05%)
Mutual labels:  7z
pytest-html-reporter
Generates a static html report based on pytest framework
Stars: ✭ 69 (-5.48%)
Mutual labels:  archive
urbit-content-archiver
A CLI application which allows you to archive Urbit channels and all linked content in them.
Stars: ✭ 33 (-54.79%)
Mutual labels:  archiver
binary-security-check
Analyzer of security features in executable binaries
Stars: ✭ 36 (-50.68%)
Mutual labels:  archive
Collect
A server to collect & archive websites that also supports video downloads
Stars: ✭ 62 (-15.07%)
Mutual labels:  archive
zipit
Decentralized or self-hosted encryption archives that work on any internet device.
Stars: ✭ 14 (-80.82%)
Mutual labels:  archive
dmc unrar
A dependency-free, single-file FLOSS unrar library
Stars: ✭ 47 (-35.62%)
Mutual labels:  archive

Wrapper 7-zip (p7zip)

License Latest Stable Version Continuous Integration

Features:

  • Support all 7-zip formats: 7z, XZ, BZIP2, GZIP, TAR, ZIP, WIM, AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VMDK, WIM, XAR and Z
  • Unpacking archives
  • Extract any directory or file
  • List files and directories
  • Get contents of any file from archive
  • Delete files or directories (not RAR)
  • Add files or directories (not RAR)

Requirements:

Installation:

composer require gemorroj/archive7z

Notes:

Recommendations:

Archive7z focuses on wrapping up the original 7-zip features. But it is not always convenient to use in your application. Therefore, we recommend that you always create your own wrapper class over Archive7z with the addition of higher-level logic.

Example:

<?php
use Archive7z\Archive7z;

class MyArchive7z extends Archive7z
{
    protected $timeout = 120;
    protected $compressionLevel = 6;
    protected $overwriteMode = self::OVERWRITE_MODE_S;
    protected $outputDirectory = '/path/to/custom/output/directory';
}

$obj = new MyArchive7z('path_to_7z_file.7z');

if (!$obj->isValid()) {
    throw new \RuntimeException('Incorrect archive');
}

print_r($obj->getInfo());
/*
Archive7z\Info Object
(
    [path:Archive7z\Info:private] => /full_path_to/test.7z
    [type:Archive7z\Info:private] => 7z
    [physicalSize:Archive7z\Info:private] => 165343
    [headersSize:Archive7z\Info:private] => 241
    [method:Archive7z\Info:private] => LZMA2:192k
    [solid:Archive7z\Info:private] => +
    [blocks:Archive7z\Info:private] => 1
    [codePage:Archive7z\Info:private] => 
)
*/


// $obj->setPassword('123');

// $obj->getEntries('test', 100)
foreach ($obj->getEntries() as $entry) {
        print_r($entry);
/*
Archive7z\Entry Object
(
    [path:Archive7z\Entry:private] => 1.jpg
    [size:Archive7z\Entry:private] => 91216
    [packedSize:Archive7z\Entry:private] => 165344
    [modified:Archive7z\Entry:private] => 2013-06-10 09:56:07
    [created:Archive7z\Entry:private] => 
    [attributes:Archive7z\Entry:private] => A
    [crc:Archive7z\Entry:private] => 871345C2
    [encrypted:Archive7z\Entry:private] => +
    [method:Archive7z\Entry:private] => LZMA:192k 7zAES:19
    [block:Archive7z\Entry:private] => 0
    [comment:Archive7z\Entry:private] => 
    [hostOs:Archive7z\Entry:private] => 
    [characteristics:Archive7z\Entry:private] => 
    [folder:Archive7z\Entry:private] => 
    [archive:Archive7z\Entry:private] => MyArchive7z Object
        (
            [timeout:protected] => 60
            [compressionLevel:protected] => 6
            [overwriteMode:protected] => -aos
            [outputDirectory:protected] => /path/to/custom/output/directory
            [binary7z:Archive7z\Archive7z:private] => C:\Program Files\7-Zip\7z.exe
            [filename:Archive7z\Archive7z:private] => s:\VCS\Git\Archive7z\tests/fixtures/testPasswd.7z
            [password:Archive7z\Archive7z:private] => 123
            [encryptFilenames:protected] => 
        )
)
*/

    if ($entry->getPath() === 'test/test.txt') {
        $entry->extractTo('path_to_extract_folder/'); // extract the file
    }
}

echo $obj->getContent('test/test.txt'); // show content of the file
$obj->setOutputDirectory('path_to_extract_folder/')->extract(); // extract the archive
$obj->setOutputDirectory('path_to_extract_pass_folder/')->setPassword('pass')->extractEntry('test/test.txt'); // extract the password-protected entry

$solidMode = new SolidMode();
$solidMode->setMode(SolidMode::OFF);
$obj->setSolidMode($solidMode);
$obj->addEntry(__DIR__);  // add directory to the archive (include subfolders)
$obj->addEntry(__FILE__); // add file to the archive

$obj->renameEntry(__FILE__, __FILE__.'new'); // rename the file in the archive
$obj->delEntry(__FILE__.'new'); // remove the file from the archive
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].