Skip to content

Generate Phar file for Analyzer tool, for easier distribution. #130

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions analyzer/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/.build/
/vendor/
/composer.lock
14 changes: 14 additions & 0 deletions analyzer/box.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"chmod": "0755",
"main": "bin/analyzer",
"output": ".build/meminfo.phar",
"directories": ["."],
"finder": [
{
"name": "*.php",
"exclude": ["test", "tests"],
"in": "vendor"
}
],
"stub": true
}
21 changes: 21 additions & 0 deletions bin/build-phar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e

cd analyzer

# Prepare buld dir
rm -rf .build
mkdir .build

# Install app deps
rm -rf vendor
composer install --no-dev

# Install Box
curl -L -o .build/box.phar https://github.com/box-project/box/releases/download/3.9.0/box.phar

# Compile Phar
php --define phar.read_only=0 .build/box.phar build

# Create signature
sha256sum .build/meminfo.phar > .build/meminfo.phar.sha256