JPHP Package Manager
JPPM is a packager manager for jphp like npm (js) or composer (php).
JPPM will help you to build and run jphp applications.
IMPORTANT: JPPM and JPHP requires Java 8 or 9+. Download here: https://java.com/download/.
For Windows Users
jppm-setup-{version}.exe).For Linux Users
That's all! Try to check jppm in console.
jppm version
https://github.com/jphp-compiler/jphp.git.On Linux (it will create link of jppm to /usr/bin/jppm, use sudo if needed):
sudo ./gradlew packager:install --no-daemon
On Windows:
gradlew packager:install --no-daemon
[Only if Windows] Add the jppm bin path to your system properties, use %UserProfile%\.jppm\dist for bin path.
Restart your console!
After all of this the jppm command will available in your console. Try to get version of jppm:
jppm version
It should print a version information about jphp.
Run and select options:
jppm init
add AppPlugin (yes) so you can run the created package as jphp application, use app:run:jppm app:run
It will println Hello World in your console. The php source of the package see in src/index.php.
If you didn't choose the
add AppPluginoption asno, use this manual.
App to your package.php.yml (see plugins sections), e.g.:name: test
plugins:
- App # include app plugin
# ...
app:run, app:build, app:clean will be availble.package.php.yml:name: test
plugins:
- App # include app plugin
deps:
jphp-core: '*'
jphp-zend-ext: '*'
jphp-httpserver-ext: '*' # add http server extension
src/index.php:<? echo "Hello World";
name: test
plugins:
- AppPlugin # include app plugin
deps:
jphp-core: '*'
jphp-zend-ext: '*'
jphp-httpserver-ext: '*' # add http server extension
sources:
- 'src' # add 'src' dir as source directory (for class loader too).
app:
bootstrap: 'index.php'
jppm app:run to run you app.jppm app:build to build your app to one executable jar file!