I'm trying to make a Phar archive with one of my lib. The lib is just a bunch of classes organized into folders and subfolders. No index.php at all here, just a static Config class to call to initiate the autoloader.
Anyway, I built a archive like this :
$phar = new Phar(__DIR__ . '/lis.phar',0,'lib.phar');
$phar->buildFromDirectory(__DIR__ . '/class','/\.php$');
$phar->stopBuffering();
After that I'm trying to use the phar like this :
require('lib.phar');
Config::register(); // Config is in the phar
But I get the following error :
Warning: include(phar://D:\wamp\www_test\phar\lib.phar/index.php) [function.include]: failed to open stream: phar error: "index.php" is not a file in phar "D:/wamp/www/_test/phar/lib.phar" in D:\wamp\www_test\phar\lib.phar on line 9
How can I make a phar archive without any index.php file inside it ? In fact I just need the archive to be a container for my files, no need to auto execute anything.