Skip to content

Commit

Permalink
use my fork of box-project/box to compile a PHAR version with manifes…
Browse files Browse the repository at this point in the history
…t option available and its contents without cache file .box.metadata.cache
  • Loading branch information
llaville committed Dec 11, 2021
1 parent aa1af74 commit 8982bfe
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG-6.x.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ using the [Keep a CHANGELOG](http://keepachangelog.com) principles.

### Added

- Phar manifest (`--manifest` option) is available with Phar version only (build with `box-project/box` [3.10](https://github.com/box-project/box/releases/tag/3.10.0) or greater)
- Phar manifest (`--manifest` option) is available with Phar version only
- [Mega-Linter](https://github.com/megalinter/megalinter) v5 support as QA tool to avoid technical debt
- [#308](https://github.com/llaville/php-compatinfo/issues/308) : Support to PHP 8.1

Expand Down
11 changes: 11 additions & 0 deletions box-bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php declare(strict_types=1);
/**
* If you want to use the `--manifest` option of this application phar version,
* you MUST use my fork (branch `show_metadata`) of Box project.
* All details are given in feature Box report #576
*
* @see https://github.com/llaville/box/tree/show_metadata
* @see https://github.com/box-project/box/issues/576
* @author Laurent Laville
*/
require_once __DIR__ . '/src/ComposerScripts.php';
2 changes: 1 addition & 1 deletion box.json.dist
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"alias": "phpcompatinfo.phar",
"directories": ["bin", "config", "src", "vendor"],
"compression": "GZ",
"stub": "phar-stub.php",
"metadata": "Bartlett\\CompatInfo\\ComposerScripts::getPharMetadata"
}
9 changes: 9 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,12 @@ If you change database connection, you have to run following commands:
At dependencies installation, Composer use the sqlite back-end. You need to set up in your environment the `DATABASE_URL` variable.

If you use sqlite default back-end, you MUST run `composer run post-install-cmd` command.

## Build PHAR distribution

Uses the [BOX](https://github.com/box-project/box/) to compile your phar version of application.
Configuration file (`box.json.dist`) is provided with each release of phpCompatInfo.

**CAUTION** If you want to use the `--manifest` option of phpCompatInfo phar version, you MUST use
[my fork](https://github.com/llaville/box/tree/show_metadata) (branch `show_metadata`) of Box project.
All details are given in feature report <https://github.com/box-project/box/issues/576>
4 changes: 0 additions & 4 deletions src/Presentation/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,6 @@ public function run(InputInterface $input = null, OutputInterface $output = null
if ($input->hasParameterOption('--manifest')) {
$phar = new Phar('phpcompatinfo.phar');
$manifest = $phar->getMetadata();
// BC if using box version less than 3.10
if (is_callable($manifest)) {
$manifest = $manifest();
}
$output->writeln($manifest);
return 0;
}
Expand Down

0 comments on commit 8982bfe

Please sign in to comment.