PHP Classes
elePHPant
Icontem

File: test.php

Recommend this page to a friend!
  Classes of David Tamas  >  ZipFly PHP ZipArchive zip64 Creator  >  test.php  >  Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Example script
Class: ZipFly PHP ZipArchive zip64 Creator
Compress files and create archives in Zip format
Author: By
Last change: - Documented the source code
- Configurable duplicate entry filter
- New methods for add entries to the archive:
- addFile - Add entry from file
- addFromString - Add entry from string input
- addFromStream - Add entry from stream resource
- Compress small files in one step instead of streamed processing
- Ability to directly stream out the generated ZIP file to the browser or any stream resource without saving it to the local storage.
- Separated the debug functionality
- Improved Exception system
- Code cleanup
- Speed and memory optimizations
- Minimum required PHP version: 5.6.3
Date: 5 months ago
Size: 877 bytes
 

Contents

Class file image Download
<?php

function gAutoLoader($class) {
   
$class = str_replace('\\', DIRECTORY_SEPARATOR, $class);

    if (
is_readable($class . '.php')) {
        include_once
$class . '.php';
        return
true;
    }

    return
false;
}

spl_autoload_register('gAutoLoader');


define('GTEST_DIR', __DIR__.'/');

if (isset(
$argv[1])) {
   
$nr = $argv[1];
} else {
   
$nr = '';
}



//$zipFile = new \zipFly\zipFly64(GTEST_DIR.'onfly'.$nr.'.zip');
$zipFile = new \zipFly\zipFly64();
$zipFile->setDebugMode(false);
$zipFile->setZipFeature(true, false);

$zipFile->create(GTEST_DIR.'onfly'.$nr.'.zip');

$zipFile->addFile(GTEST_DIR."zipFly/zipFly64.php", "zipFly64.php", \zipFly\zipFly64::METHOD_BZIP2);
$zipFile->addFile(GTEST_DIR."zipFly/parts/headers.php", "parts/headers.php", \zipFly\zipFly64::METHOD_DEFLATE);
$zipFile->addFromString("Zip64\nTest\n", 'test.txt');

$zipFile->close();