PHPackages                             secondtruth/phar-compiler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. secondtruth/phar-compiler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

secondtruth/phar-compiler
=========================

Generic PHP PHAR compiler

v1.2.0(5y ago)263.3k↓50%34ISCPHPPHP &gt;=5.6CI failing

Since Jul 27Pushed 5y ago3 watchersCompare

[ Source](https://github.com/secondtruth/php-phar-compiler)[ Packagist](https://packagist.org/packages/secondtruth/phar-compiler)[ Docs](http://www.secondtruth.de)[ Fund](https://liberapay.com/secondtruth)[ Patreon](https://www.patreon.com/secondtruth)[ RSS](/packages/secondtruth-phar-compiler/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (7)Used By (4)

PHP PHAR Compiler
=================

[](#php-phar-compiler)

[![Latest Stable](https://camo.githubusercontent.com/bdd1d91e25c0629b80ee906dc1337e7cc3e77e7f282a31b1fa1f3e40b21577f3/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7365636f6e6474727574682f706861722d636f6d70696c65722e737667)](https://packagist.org/p/secondtruth/phar-compiler)[![Build Status](https://camo.githubusercontent.com/0eb892549ec2e49fc3c3f92a571cfa0e7f600af79c6e87c235287f7eb38cbd38/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f6d2f7365636f6e6474727574682f7068702d706861722d636f6d70696c65722e737667)](https://travis-ci.com/github/secondtruth/php-phar-compiler)[![Scrutinizer](https://camo.githubusercontent.com/cfa30799bcdef3eb84f19b58c0831e9b0e8412052cae1708037da1136fa0d2e8/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7365636f6e6474727574682f7068702d706861722d636f6d70696c65722e737667)](https://scrutinizer-ci.com/g/secondtruth/php-phar-compiler)[![Coverage](https://camo.githubusercontent.com/7cdb7b36a6ec60ac561dfe2f625e6a405412aa367a4e8aaece4cbf34c01a5739/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f7365636f6e6474727574682f7068702d706861722d636f6d70696c65722e737667)](https://scrutinizer-ci.com/g/secondtruth/php-phar-compiler)[![License](https://camo.githubusercontent.com/7dc4392c7c6494560b928430b1dfe9b217dc31c813d730de3819c251e0ac81ae/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7365636f6e6474727574682f706861722d636f6d70696c65722e737667)](https://packagist.org/p/secondtruth/phar-compiler)

This library provides a generic PHP PHAR compiler.

How to use?
-----------

[](#how-to-use)

```
$compiler = new Compiler(PROJECT_PATH);

$compiler->addIndexFile('bin/mycoolprogram.php');
$compiler->addDirectory('libraries');

$compiler->addFile('vendor/autoload.php');
$compiler->addDirectory('vendor/composer', '!*.php'); // Exclude non-PHP files
$compiler->addDirectory('vendor/.../Component/Console', ['Tests/*', '!*.php']);

$compiler->compile("$outputDir/mycoolprogram.phar");
```

Installation
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

[Install Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-macos) if you don't already have it present on your system.

To install the library, run the following command and you will get the latest version:

```
$ composer require secondtruth/phar-compiler

```

Requirements
------------

[](#requirements)

- You must have at least PHP version 5.6 installed on your system.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 95.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~369 days

Recently: every ~462 days

Total

6

Last Release

2101d ago

PHP version history (2 changes)1.0.x-devPHP &gt;=5.4

v1.2.0PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/82268b2432ab90f14c62445938bc3cd1340dc66e0463035df57891826b418016?d=identicon)[secondtruth](/maintainers/secondtruth)

---

Top Contributors

[![secondtruth](https://avatars.githubusercontent.com/u/416441?v=4)](https://github.com/secondtruth "secondtruth (39 commits)")[![igormukhingmailcom](https://avatars.githubusercontent.com/u/6544038?v=4)](https://github.com/igormukhingmailcom "igormukhingmailcom (2 commits)")

---

Tags

composer-packagepharphar-compilerphar-generatorphpphp-librarypharcompiler

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/secondtruth-phar-compiler/health.svg)

```
[![Health](https://phpackages.com/badges/secondtruth-phar-compiler/health.svg)](https://phpackages.com/packages/secondtruth-phar-compiler)
```

###  Alternatives

[seld/phar-utils

PHAR file format utilities, for when PHP phars you up

875180.0M32](/packages/seld-phar-utils)[clue/phar-composer

Simple phar creation for any project managed via Composer

862881.6k29](/packages/clue-phar-composer)[tm/tooly-composer-script

Simple composer script to manage phar files.

103280.1k32](/packages/tm-tooly-composer-script)[laravel-zero/phar-updater

A thing to make PHAR self-updating easy and secure.

162.1M92](/packages/laravel-zero-phar-updater)[phar-io/composer-distributor

Base Code for a composer plugin that installs PHAR-files

13581.1k6](/packages/phar-io-composer-distributor)[mmoreram/extractor

Extractor project for php

21132.0k8](/packages/mmoreram-extractor)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
