I was trying to create phar archive for my web app (contains sub directories and xml, js, css, php files) without composer and stub ... but I didn't happen here are some try :
$dir = "/depot";
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator("C:/wamp/www/depot/")
);
$phar = new PharData('mytar.tar');
$phar->buildFromIterator(new RecursiveDirectoryIterator("C:/wamp/www/depot/"), "C:/wamp/www/depot/");
$phar->compress(Phar::GZ);
and that :
$phar = new Phar('depot_app.phar');
$dir = 'depot/';
$phar->buildFromIterator(
new RegexIterator(
new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dir)
),
'/^.+.tpl$/i'
),
$dir
);
$phar->startBuffering();
$phar->stopBuffering();
I have tried code sample from a lot of tutorials
