I have my index.php that uses a class inside a php library (including folders, classes, subclasses) etc..
my index.php uses that whole library
...
include("Classes/Crawler.php");
$crawl = new Crawler(); //
...
My goal is to distribute 2 files (index.php and Crawler.phar) without having to changing the source code
I use phing's pharpackage task to build my phar files, see https://github.com/cweiske/phorkie/blob/master/build.xml#L82 for an example.
But apart from that, you can write your own script (it's easy; see the examples in the PHP manual).
About using index.php as it was: You can do that as long as you enable file interception with Phar::interceptFileFuncs().
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With