PHP code example of devuri / zipit

1. Go to this page and download the library: Download devuri/zipit library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

devuri / zipit example snippets



return [
    'baseDir'    => __DIR__,
    'files'      => [
        'file1.txt',
        'directory1',
        'subdirectory/file2.txt',
    ],
    'exclude'    => [
        'directory1/exclude-this.txt',
    ],
    'outputDir'  => __DIR__ . '/build',
    'outputFile' => 'project-archive.zip',
];

'files' => [
    'index.php',
    'src',
    'assets/dist/styles.css' => 'styles.css',
    'config/defaults.php'    => 'config.php',
],


return [
    'baseDir'    => __DIR__,
    'files'      => [
        'index.php',
        'readme.txt',
        'src',
        'directory1',
        'assets/dist/styles.css' => 'styles.css',
    ],
    'exclude'    => [
        'directory1/exclude-this.txt',
    ],
    'outputDir'  => __DIR__ . '/build',
    'outputFile' => 'my-project.zip',
];

/my-project
  |-- index.php
  |-- readme.txt
  |-- src/
  |-- assets/
  |   |-- dist/
  |       |-- styles.css
  |-- directory1/
  |   |-- file3.txt
  |   |-- exclude-this.txt
  |-- .zipit-conf.php