I have a Java application (.jar) and I use PHP as text report exporter language. Now I am trying to put all .php files inside .jar and use them like phar from PHP command line interpreter.
File 0.php
has content:
echo 0; require('phar://phar.zip/1.php');
File phar.zip/1.php
has content:
echo 1; require('2.php');
File phar.zip/2.php
has content:
echo 2;
Running from windows command line php -n 0.php
, it works with output 012
.
Running from windows command line php -n phar://phar.zip/1.php
, it doesn't work. It outputs
Could not open input file: phar://phar.zip/1.php
What could be the problem?
It seems php -r require('phar://phar.zip/1.php');
works as a workaround, but still I don't understand why command line cannot have phar://
.