Comments (20)
My current proposal would be something like
"before-script": [
"git describe --tags > build/version.txt"
],
"after-script": [
"rm build/version.txt",
"chmod +x build/acme-client.phar"
]
in the "extra"
section in the composer.json
.
from pharbuilder.
@kelunik, I made a first version of the hooks/event implementation (see e6ebea5).
I have to finish the documentation about it.
from pharbuilder.
I'm not sure to understand what you try to do
from pharbuilder.
I want to provide a command line command like acme-client version
that shows the current version. In case it's a nightly build (not one from a tag), version with git describe --tags
would be something like v0.2.4-3-ga05a4f8
. Since the packaged version doesn't have any .git
info available, I need to package it somehow.
I could use a script that gets that information and builds the phar afterwards, but it would be nice if there was support directly in here, which would avoid the need for an extra script.
from pharbuilder.
Something similar to Composer event script, why not.
Another idea is to create a new constant in the phar stub (bootstrap) code.
something like:
$this->phar->setStub(
'#!/usr/bin/env php' . PHP_EOL .
'<?php Phar::mapPhar(); ' .
(null === $constant?'':'define(\'PHAR_VERSION\', \''.addslashes($constant).'\');') .
'include "phar://' . $this->alias . '/' . $this->stubFile .
'"; __HALT_COMPILER(); ?>'
);
And in the console call:
$ phar-builder package --version=`git describe --tags`
But your proposal allow to have event based addition action/control which can be lot more flexible
from pharbuilder.
PHP Fatal error: Uncaught Error: Class 'League\Event\Emitter' not found in /home/kelunik/GitHub/kelunik/acme-client/vendor/macfja/phar-builder/app/Application.php:68
Somehow, league/event
doesn't get installed even if it's in the composer.json.
from pharbuilder.
And it doesn't respect the output-dir
configuration option anymore.
from pharbuilder.
Also PHP Warning: Declaration of MacFJA\PharBuilder\Event\ComposerAwareEvent::named($name, $composer) should be compatible with League\Event\Event::named($name) in /home/kelunik/GitHub/kelunik/acme-client/vendor/macfja/phar-builder/app/Event/ComposerAwareEvent.php on line 15
from pharbuilder.
Also
PHP Warning: Declaration of MacFJA\PharBuilder\Event\ComposerAwareEvent::named($name, $composer) should be compatible with League\Event\Event::named($name) in /home/kelunik/GitHub/kelunik/acme-client/vendor/macfja/phar-builder/app/Event/ComposerAwareEvent.php on line 15
It's the second times! I really need to found a way to detect this! (Correct in 97bfa5f by the way)
from pharbuilder.
I think the warning is only printed in PHP 7?
from pharbuilder.
Nope, it's my PHP(s) configuration: the E_STRICT
flag is missing in error_reporting
of my php.ini
from pharbuilder.
Did you have a look at the output dir?
from pharbuilder.
Yep, normally it's corrected with the commit e5bb1ec
from pharbuilder.
"league/event": "^2.1"
is missing as requirement.
from pharbuilder.
And another thing afterwards:
Uncaught Error: Class 'Neutron\SignalHandler\SignalHandler' not found
in /acme-client/vendor/macfja/phar-builder/app/Event/EventManager.php:76
https://packagist.org/packages/neutron/signal-handler
from pharbuilder.
After that, it fails with
Warning: require(phar:///acme-client/build/acme-client.phar/vendor/composer/../symfony/polyfill-mbstring/bootstrap.php): failed to open stream: phar error: "vendor/symfony/polyfill-mbstring/bootstrap.php" is not a file in phar "/acme-client/build/acme-client.phar" in phar:///acme-client/build/acme-client.phar/vendor/composer/autoload_real.php on line 65
from pharbuilder.
Are you sure to use the right branch for your test?
Those two dependencies are declared in the branch events+issue-17
but not on the master
from pharbuilder.
That might be the case because I used dev-master#hash
before, because the branch didn't work. I opened an issue: composer/composer#5397. I guess it's related to the +
in the branch name.
from pharbuilder.
Bug in Composer is gone now. Issue with polyfill-mbstring
persists. It's required, because it's listed in autoload.files
. I think we had that issue before? Do we need stubs for that?
from pharbuilder.
#21 fixes this.
from pharbuilder.
Related Issues (20)
- Default to current directory
- Update Similar project in READMe HOT 1
- Warning for invalid directories HOT 10
- how to exclude directory add in phar. such as logs and temp HOT 3
- Add the possibility to avoid the shebang at the start of the file HOT 4
- Upgrading to version 3 HOT 5
- No PHAR in release-section for latest release HOT 1
- Trouble running the app in a headless CI-Server HOT 3
- Where is the phar of this app HOT 2
- Change the method MacFJA\PharBuilder\Utils\Composer::removeFilesAutoloadFor
- "skip-shebang": false doesn't have default HOT 5
- Performance improvements? HOT 6
- Fatal on broken Symlink HOT 1
- Add possibility to add files at root level
- Provide gpg signature for phar in releases
- Double slash not handled properly HOT 5
- Not bundling the composer file fails on some dependencies HOT 7
- No support for Symfony 4 HOT 6
- Documentation issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pharbuilder.