Skip to content

Instantly share code, notes, and snippets.

@spekkionu
Created February 3, 2014 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spekkionu/8792201 to your computer and use it in GitHub Desktop.
Save spekkionu/8792201 to your computer and use it in GitHub Desktop.
Build swiftmailer as phar
<?php
$srcRoot = realpath(__DIR__."/vendor/swiftmailer/swiftmailer/lib");
$buildRoot = realpath(__DIR__);
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($srcRoot, FilesystemIterator::SKIP_DOTS), RecursiveIteratorIterator::LEAVES_ONLY);
echo "Build SwiftMailer phar\n";
$phar = new Phar($buildRoot.'/swiftmailer.phar', 0, 'swiftmailer.phar');
$phar->buildFromIterator($iterator, $srcRoot);
$phar->setStub($phar->createDefaultStub("swift_required.php"));
exit("Build complete\n");
{
"require": {
"swiftmailer/swiftmailer": "@stable"
},
"config": {
"preferred-install": "dist"
},
"prefer-stable": true,
"scripts": {
"post-update-cmd": "php build.php",
"post-install-cmd": "php build.php"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment