Skip to content

Instantly share code, notes, and snippets.

@AnrDaemon
Created May 24, 2020 11:56
Show Gist options
  • Save AnrDaemon/10ce8011e5558aa7cbe5c58914b611b4 to your computer and use it in GitHub Desktop.
Save AnrDaemon/10ce8011e5558aa7cbe5c58914b611b4 to your computer and use it in GitHub Desktop.
PHAR / stream_resolve_include_path test
<?php
print __DIR__ . "\n";
print __FILE__ . "\n";
print getcwd() . "\n";
var_dump(stream_resolve_include_path(basename(__FILE__)));
SHELL := /bin/sh
.SHELLFLAGS := -ec
.ONESHELL:
PHAR_FILES := index.php
clean:
-rm index.php example.phar
dist-clean: clean
-rm stub.php
release: release-phar
release-phar: example.phar
stub: stub.php
%.php: %.sample.php
cp "$<" "$@"
example.phar: stub.php $(PHAR_FILES)
phar pack -f "$@" -c bzip2 -s $^
.PHONY: clean dist-clean stub release ;
<?php
require_once 'phar://' . __FILE__ . '/index.php';
__HALT_COMPILER(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment