Giter Club home page Giter Club logo

jphp-zip-ext's Introduction

Zip Extension

For JPHP and DevelNext (http://develnext.org).

An extension for using zip archive in jphp and develnext. It contains two classes - ZipFile and the ZipFileScript component for DevelNext IDE.


Расширение для использования zip архивов в jphp и develnext. Оно содержит 2 класса - ZipFile и ZipFileScript компонент для среды DevelNext.

Последняя версия (скачать) / Демо Проект

image

Example

Примеры

use php\compress\ZipFile;
// or
use compress;

// create zip archive from directory...
$zipFile = ZipFile::create('my.zip');
$zipFile->addDirectory('path/to/dir');

// unpack zip archive
$zipFile = new ZipFile('my.zip');
$zipFile->unpack('path/to/dir');

API

/**
 * Class ZipFile
 * @package php\compress
 */
class ZipFile
{
    /**
     * Create ZIP Archive.
     *
     * @param string $file
     * @param bool $rewrite
     * @return ZipFile
     */
    public static function create($file, $rewrite = true)
    {
    }

    /**
     * ZipFile constructor.
     * @param $file
     * @param bool $create
     */
    public function __construct($file, $create = false)
    {
    }

    /**
     * Extract zip archive content to directory.
     *
     * @param string $toDirectory
     * @param string $charset
     * @param callable $callback ($name)
     */
    public function unpack($toDirectory, $charset = null, callable $callback = null)
    {
    }

    /**
     * Read one zip entry from archive.
     * @param string $path
     * @param callable $reader (array $stat, Stream $stream)
     */
    public function read($path, callable $reader)
    {
    }

    /**
     * Read all zip entries from archive.
     * @param callable $reader (array $stat, Stream $stream)
     */
    public function readAll(callable $reader)
    {
    }

    /**
     * Returns stat of one zip entry by path.
     * [name, size, compressedSize, time, crc, comment, method]
     *
     * @param string $path
     * @return array
     */
    public function stat($path)
    {
    }

    /**
     * Returns all stats of zip archive.
     * @return array[]
     */
    public function statAll()
    {
    }

    /**
     * Checks zip entry exist by path.
     * @param $path
     * @return bool
     */
    public function has($path)
    {
    }

    /**
     * Add stream or file to archive.
     *
     * @param string $path
     * @param Stream|File|string $source
     * @param int $compressLevel
     */
    public function add($path, $source, $compressLevel = -1)
    {
    }

    /**
     * Add all files of directory to archive.
     *
     * @param string $dir
     * @param int $compressLevel
     * @param callable $callback
     */
    public function addDirectory($dir, $compressLevel = -1, callable $callback = null)
    {
    }

    /**
     * Add zip entry from string.
     * @param string $path
     * @param string $string
     * @param int $compressLevel
     */
    public function addFromString($path, $string, $compressLevel = -1)
    {
    }

    /**
     * Remove zip entry by its path.
     * @param string|array $path
     */
    public function remove($path)
    {
    }

    /**
     * @return string
     */
    public function getPath()
    {
    }
}

To Build

Как собрать?

  1. Open your shell (bash or cmd):
  2. Use gradlew command:
// On Windows
gradlew bundle -Drelease=true

// On Linux
chmodx +x gradlew
./gradlew bundle -Drelease=true
  1. See the dn-zip-bundle/build directory to find the build DevelNext bundle.

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.