Inspired by an open-source tool, we used stream packaging and token_get_all to remove the blank php file. The package is only KB. Thank you for your attention. I added a simple file and a symfony process package to package MB, and composer...
Inspired by an open-source tool, we used stream packaging and token_get_all to remove the blank php file. The package is only KB. Thank you for your attention.
I added a simple file and a symfony process package, which had a huge size of 1.6 MB. the composer had packed so many files that it was only MB, so I was puzzled. Enclose the packaging code:
getMessage(), PHP_EOL;} catch (BadMethodCallException $e) { echo $e->getMessage(), PHP_EOL;}e('building...');$phar->buildFromDirectory(__DIR__);e('remove unused files...');array_walk($ignoreFiles, function ($file) use ($phar) { $phar->delete($file);});e('set stub...');$phar->setStub($phar->createDefaultStub('deploy.php', 'deploy.php'));e('compress...');$phar->compressFiles(Phar::BZ2);e('build done.');function e($string){ echo $string, PHP_EOL;}
Reply content:
Inspired by an open-source tool, we used stream packaging and token_get_all to remove the blank php file. The package is only KB. Thank you for your attention.
I added a simple file and a symfony process package, which had a huge size of 1.6 MB. the composer had packed so many files that it was only MB, so I was puzzled. Enclose the packaging code:
getMessage(), PHP_EOL;} catch (BadMethodCallException $e) { echo $e->getMessage(), PHP_EOL;}e('building...');$phar->buildFromDirectory(__DIR__);e('remove unused files...');array_walk($ignoreFiles, function ($file) use ($phar) { $phar->delete($file);});e('set stub...');$phar->setStub($phar->createDefaultStub('deploy.php', 'deploy.php'));e('compress...');$phar->compressFiles(Phar::BZ2);e('build done.');function e($string){ echo $string, PHP_EOL;}
I think you can convert the format to zip, and then view the archive content through the compression software, so that you can intuitively see the size of each component in the archive;
$phar->convertToExecutable(Phar::ZIP);
Hope to help you