Burgomaster::createZip PHP Méthode

createZip() public méthode

Call this only after your staging directory is built.
public createZip ( string $dest )
$dest string Where to save the zip file
    public function createZip($dest)
    {
        $this->startSection('zip');
        $this->debug("Creating a zip file at {$dest}");
        $this->createDirIfNeeded(dirname($dest));
        chdir($this->stageDir);
        $this->exec("zip -r {$dest} ./");
        $this->debug("  > Created at {$dest}");
        chdir(__DIR__);
        $this->endSection();
    }

Usage Example

Exemple #1
0
<?php

require __DIR__ . '/../vendor/autoload.php';
$packager = new \Burgomaster(__DIR__ . '/artifacts/staging', __DIR__ . '/../');
$packager->exec('rm -rf ' . __DIR__ . '/artifacts/xsolla.*');
$packager->recursiveCopy('src', 'Xsolla/SDK');
$packager->recursiveCopy('vendor/guzzle/guzzle/src/Guzzle', 'Guzzle', array('php', 'pem'));
$packager->recursiveCopy('vendor/symfony/event-dispatcher', 'Symfony/Component/EventDispatcher');
$packager->recursiveCopy('vendor/symfony/http-foundation', 'Symfony/Component/HttpFoundation');
$packager->createAutoloader(array(), 'xsolla-autoloader.php');
$packager->createPhar(__DIR__ . '/artifacts/xsolla.phar', null, 'xsolla-autoloader.php');
$packager->createZip(__DIR__ . '/artifacts/xsolla.zip');
$packager->startSection('test-phar');
$packager->exec('php ' . __DIR__ . '/test-phar.php');
$packager->endSection();
$packager->exec('rm -rf ' . __DIR__ . '/artifacts/staging');
All Usage Examples Of Burgomaster::createZip