WGOD!

The general member portfolio consists of software developers, company owners and investors. Our mission is to ensure that all shared content is clean and functional. For this reason, unfortunately, not every member is accepted. Please do not attempt to register for 1 software or 1 theme, membership is paid. You can join our telegram group below or send an e-mail to [email protected] to purchase the invite code for 10$.

Join Telegram

PHP Ziparchive class ( İsim değiştir, Açıklama düzelt )

Info

Konu Hakkında Merhaba, tarihinde PHP kategorisinde xNull  tarafından oluşturulan PHP Ziparchive class ( İsim değiştir, Açıklama düzelt ) başlıklı konuyu okuyorsunuz. Bu konu şimdiye dek 583 kez görüntülenmiş, 5 yorum ve 1 tepki puanı almıştır...
Kategori Adı PHP
Konu Başlığı PHP Ziparchive class ( İsim değiştir, Açıklama düzelt )
Thread starter xNull 
Start date
Replies
Views
First message reaction score
Son Mesaj Yazan real

xNull 

Namık Kemal
IRONSIDE
WarezM
this slowpoke moves Supporter
1,276
Resources
456
3,636
Warez Point
53,603ա
Turkish Liras
2,000₺
Offline
PHP:
<?php
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

class zipci
{
    CONST ARCHIVECOMMENT     = 'shared by forum.warezm.com';
    CONST DIR                = 'i-scripts/';
    public function message($code)
    {
       switch( (int) $code )
        {
            case ZipArchive::ER_OK           : return 'N No error';
            case ZipArchive::ER_MULTIDISK    : return 'N Multi-disk zip archives not supported';
            case ZipArchive::ER_RENAME       : return 'S Renaming temporary file failed';
            case ZipArchive::ER_CLOSE        : return 'S Closing zip archive failed';
            case ZipArchive::ER_SEEK         : return 'S Seek error';
            case ZipArchive::ER_READ         : return 'S Read error';
            case ZipArchive::ER_WRITE        : return 'S Write error';
            case ZipArchive::ER_CRC          : return 'N CRC error';
            case ZipArchive::ER_ZIPCLOSED    : return 'N Containing zip archive was closed';
            case ZipArchive::ER_NOENT        : return 'N No such file';
            case ZipArchive::ER_EXISTS       : return 'N File already exists';
            case ZipArchive::ER_OPEN         : return 'S Can\'t open file';
            case ZipArchive::ER_TMPOPEN      : return 'S Failure to create temporary file';
            case ZipArchive::ER_ZLIB         : return 'Z Zlib error';
            case ZipArchive::ER_MEMORY       : return 'N Malloc failure';
            case ZipArchive::ER_CHANGED      : return 'N Entry has been changed';
            case ZipArchive::ER_COMPNOTSUPP  : return 'N Compression method not supported';
            case ZipArchive::ER_EOF          : return 'N Premature EOF';
            case ZipArchive::ER_INVAL        : return 'N Invalid argument';
            case ZipArchive::ER_NOZIP        : return 'N Not a zip archive';
            case ZipArchive::ER_INTERNAL     : return 'N Internal error';
            case ZipArchive::ER_INCONS       : return 'N Zip archive inconsistent';
            case ZipArchive::ER_REMOVE       : return 'S Can\'t remove file';
            case ZipArchive::ER_DELETED      : return 'N Entry has been deleted';
            default                          : return sprintf('Unknown status %s', $code );
        }
    }
    public function filelist($dir)
    {
        if ($handle = opendir($dir)) {
            while (false !== ($entry = readdir($handle))) {
                if ($entry != ".zip" && $entry != ".." && $entry != ".") {
                    $files[] .= $entry;
                }
            }
            return(array($files));
            closedir($handle);
        }
    }
    public function setAllArchiveComment()
    {
     
        foreach ($this->filelist(zipci::DIR)[0] as $key => $value) {
            $zip = new ZipArchive;
            $sekk = $zip->open(zipci::DIR.$value);
            if ($sekk === TRUE) {
                //Read contents into memory
                $oldContents = $zip->getFromName($fileToModify);
                //Modify contents:
                $newContents = str_replace('key', $_GET['param'], $oldContents);
                //Delete the old...
                $zip->deleteName($fileToModify);
                //Write the new...
                $zip->setArchiveComment(zipci::ARCHIVECOMMENT);
                //And write back to the filesystem.
                $ans["$value"] = 'ok';
            } else {
                $ans["$value"] = $this->message($sekk);
                continue;
            }
             $zip->close();
        }
    return($ans);      
    }
    public function setAllRename($dir,$exps=null,$pos=null)
    {
       foreach ($this->filelist($dir)[0] as $key => $value) {
         
            $exp = explode($exps, $value);
            $newname = str_replace($exp[$pos].'-', '', $value);
            $bak =  rename($_SERVER['DOCUMENT_ROOT'].'/'.$dir.$value, $_SERVER['DOCUMENT_ROOT'].'/'.$dir.$newname);
            $last_error = error_get_last();
       }

    }
}




?>


Bu yazılım zip olarak çektiğiniz çoklu yazılımların zip halinin açıklamasını düzeltmeye ve isimlerini değiştirmeye yarıyor.


Tüm ziplerin adını değiştir ( Rename ALl zip files ) :
PHP:
$class = new zipci;



$class->setAllRename('DIRECTORY',0,0);



Tüm ziplerin AÇIKLAMASINI DEĞİŞTİRMEYE YARAR ( Set description ALl zip files ) :


$class = new zipci; $class->setAllArchiveComment();



Configs / konfigürasyon :

CONST ARCHIVECOMMENT = 'YOUR TEXT DESCRİPTİON '; CONST DIR = 'DIRECTORY';
 
Guest
Help Users
  • No one is chatting at the moment.
  • aLeech:
    Guest wariclis has joined the room.
  • (Guest) wariclis:
    hi
    Quote
    (Guest) wariclis: hi
    Back
    Top