Skip to content

Jasper-Wild/phar-extractor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PharExtractor

Command-line tool to convert PHP .phar archives to .zip.

Downloaded binaries

This repo can ship ready-to-use binaries in dist/:

  • pharextractor-linux-amd64
  • pharextractor-windows-amd64.exe

Build

go build -buildvcs=false -o pharextractor ./cmd/pharextractor

Windows:

go build -buildvcs=false -o pharextractor.exe ./cmd/pharextractor

Usage

pharextractor input.phar
pharextractor input.phar -o output.zip

If -o is omitted, the output file is created next to the input file with the .zip extension.

Use from anywhere

Linux:

chmod +x dist/pharextractor-linux-amd64
mkdir -p ~/.local/bin
cp dist/pharextractor-linux-amd64 ~/.local/bin/pharextractor
pharextractor input.phar

If ~/.local/bin is not in your PATH, add this line to ~/.bashrc or ~/.zshrc:

export PATH="$HOME/.local/bin:$PATH"

Windows PowerShell:

mkdir C:\Tools\pharextractor
copy dist\pharextractor-windows-amd64.exe C:\Tools\pharextractor\pharextractor.exe
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Tools\pharextractor", "User")

Open a new terminal, then run:

pharextractor input.phar
pharextractor input.phar -o output.zip

Cross-platform builds

From Linux/macOS:

GOOS=windows GOARCH=amd64 go build -buildvcs=false -o dist/pharextractor-windows-amd64.exe ./cmd/pharextractor
GOOS=linux GOARCH=amd64 go build -buildvcs=false -o dist/pharextractor-linux-amd64 ./cmd/pharextractor

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages