-
Notifications
You must be signed in to change notification settings - Fork 80
How to build phar? #135
Comments
Your |
The composer autoloader is not in the library, i also don't need lazy loading, it's okay if all classes get loaded with the phar. |
You will then need to manually require all of the classes you need in your |
Is it me not understanding phar? I assumed since all the classes are in the same file they all get loaded by just including the phar file. If that's not true i would have to rethink my approach on this one. Hold on .. what do you mean actually by "requiring a class" .. in php only files can be required or included. |
It sounds like you believe that a For Box, you have In this case, you are asking that PHP execute the class file which in of itself does nothing but define a class. However, since there is no class loader set, it can't lazy load other classes or interfaces that |
Let's say i want to manually load (include/require) this class https://github.com/symfony/var-dumper/blob/master/Dumper/HtmlDumper.php how would i refer to that file? Or rather how would i refer to that class now that it is inside the phar archive? Will the archive keep the same directory structure? Is there a box configuration option that generate an autoloader? Actually what would even be better is that if i don't have to include an autoloader in the phar, but i can keep the autoloader outside. Otherwise each phar will have it's own autoloader and it will get pretty messy |
Box does preserve directory structure. To manually load a file, you will want to do something like |
I'm trying to make a phar from this library https://github.com/symfony/var-dumper
My box.json
error
for file
Also if i use the default stub (by not setting stub to
true
) i can actually see the phar contents plain in my text editor and i see that theVarCloner
class is there. However that phar can not be run for the same reason as this issue #39I would also like to exclude the
test
andtests
folders.The text was updated successfully, but these errors were encountered: