public function run(string $buildVersion, bool $createZipFile = true) : void
    {
        $this->logger->info('Resource folder: ' . $this->resourceFolder . '');
        $this->logger->info('Build folder: ' . $this->buildFolder . '');

        Helper\BuildHelper::run(
            $buildVersion,
            $this->resourceFolder,
            $this->logger,
            $this->writerCollection,
            $this->dataCollectionFactory,
            $this->collectPatternIds
        );

        if (!$createZipFile) {
            return;
        }

        $this->logger->info('started creating the zip archive');

        $zip = new ZipArchive();
        $zip->open($this->buildFolder . '/browscap.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE);

        $files = [
            'full_asp_browscap.ini',
            'full_php_browscap.ini',
            'browscap.ini',
            'php_browscap.ini',
            'lite_asp_browscap.ini',
            'lite_php_browscap.ini',
            'browscap.xml',
            'browscap.csv',
            'browscap.json',
        ];

        foreach ($files as $file) {
            $filePath = $this->buildFolder . '/' . $file;

            if (!file_exists($filePath) || !is_readable($filePath)) {
                continue;
            }

            $zip->addFile($filePath, $file);
        }

        $zip->close();

        $this->logger->info('finished creating the zip archive');
    }
public function run(string $buildVersion, bool $createZipFile = true) : void
    {
        $this->logger->info('Resource folder: ' . $this->resourceFolder . '');
        $this->logger->info('Build folder: ' . $this->buildFolder . '');

        Helper\BuildHelper::run(
            $buildVersion,
            $this->resourceFolder,
            $this->logger,
            $this->writerCollection,
            $this->dataCollectionFactory,
            $this->collectPatternIds
        );

        if (!$createZipFile) {
            return;
        }

        $this->logger->info('started creating the zip archive');

        $zip = new ZipArchive();
        $zip->open($this->buildFolder . '/browscap.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE);

        $files = [
            'full_asp_browscap.ini',
            'full_php_browscap.ini',
            'browscap.ini',
            'php_browscap.ini',
            'lite_asp_browscap.ini',
            'lite_php_browscap.ini',
            'browscap.xml',
            'browscap.csv',
            'browscap.json',
        ];

        foreach ($files as $file) {
            $filePath = $this->buildFolder . '/' . $file;

            if (!file_exists($filePath) || !is_readable($filePath)) {
                continue;
            }

            $zip->addFile($filePath, $file);
        }

        $zip->close();

        $this->logger->info('finished creating the zip archive');
    }
public function run ( string $ buildVersion , bool $ createZipFile = true ) : void { $ this -> logger -> info ( 'Resource folder: ' . $ this -> resourceFolder . '' ) ; $ this -> logger -> info ( 'Build folder: ' . $ this -> buildFolder . '' ) ; Helper \ BuildHelper :: run ( $ buildVersion , $ this -> resourceFolder , $ this -> logger , $ this -> writerCollection , $ this -> dataCollectionFactory , $ this -> collectPatternIds ) ; if ( ! $ createZipFile ) { return ; } $ this -> logger -> info ( 'started creating the zip archive' ) ; $ zip = new ZipArchive ( ) ; $ zip -> open ( $ this -> buildFolder . '/browscap.zip' , ZipArchive :: CREATE | ZipArchive :: OVERWRITE ) ; $ files = [ 'full_asp_browscap.ini' , 'full_php_browscap.ini' , 'browscap.ini' , 'php_browscap.ini' , 'lite_asp_browscap.ini' , 'lite_php_browscap.ini' , 'browscap.xml' , 'browscap.csv' , 'browscap.json' , ] ; foreach ( $ files as $ file ) { $ filePath = $ this -> buildFolder . '/' . $ file ; if ( ! file_exists ( $ filePath ) || ! is_readable ( $ filePath ) ) { continue ; } $ zip -> addFile ( $ filePath , $ file ) ; } $ zip -> close ( ) ; $ this -> logger -> info ( 'finished creating the zip archive' ) ; }
Entry point for generating builds for a specified version

@param string $buildVersion
@param bool   $createZipFile

@throws \Exception
@throws \Assert\AssertionFailedException
Entry point for generating builds for a specified version