An Eptalights PHP CLI tool for exporting PHP (Zend) bytecode instructions in JSON format.
# Clone the extractor repo
git clone https://github.com/eptalights/eptalights-code-extractor-php
cd eptalights-code-extractor-php
# Build Docker image
make docker-build
# Extract all PHP files from your project
make extract-all-using-docker \
src-rootpath="/home/user/projects/myapp" \
dst-rootpath="/home/user/projects/myapp_bytecode"After running this, you’ll find the extracted bytecode JSON files inside:
/home/user/projects/myapp_bytecode
v8.3.6(supported)
Requirements:
# Clone the repository
git clone https://github.com/eptalights/eptalights-code-extractor-php
cd eptalights-code-extractor-php
# Build the Docker image
make docker-build
# Open an interactive shell in the container
make docker-shell
cd /extractor
# Download PHP source
make download-php-src
# Build PHP from source
make build-php-src
# Build the Eptalights PHP CLI
make build-eptalights-code-extractor-php-cliOr, build directly via Docker without entering the container:
make build-eptalights-code-extractor-php-cli-with-dockerRequirements:
# Clone the repository
git clone https://github.com/eptalights/eptalights-code-extractor-php
cd eptalights-code-extractor-php
# Download PHP source
make download-php-src
# Build PHP from source
make build-php-src
# Build the Eptalights PHP CLI
make build-eptalights-code-extractor-php-clicd eptalights-code-extractor-php
make extract-file \
filepath="/home/user/projects/myapp/index.php" \
src-rootpath="/home/user/projects/myapp" \
dst-rootpath="/home/user/projects/myapp_bytecode"cd eptalights-code-extractor-php
make extract-all \
src-rootpath="/home/user/projects/myapp" \
dst-rootpath="/home/user/projects/myapp_bytecode"cd eptalights-code-extractor-php
make extract-all-using-docker \
src-rootpath="/home/user/projects/myapp" \
dst-rootpath="/home/user/projects/myapp_bytecode"If your PHP project is at /home/user/projects/myapp but the extractor repo is at /home/user/tools/eptalights-code-extractor-php, you can run:
make -C /home/user/tools/eptalights-code-extractor-php extract-all-using-docker \
src-rootpath="/home/user/projects/myapp" \
dst-rootpath="/home/user/projects/myapp_bytecode"The extractor scans and processes the following file types:
.php.phtml.inc.php3,.php4,.php5,.php7,.php8