File tree 6 files changed +62
-22
lines changed
6 files changed +62
-22
lines changed Original file line number Diff line number Diff line change @@ -20,12 +20,6 @@ before_install:
20
20
- echo "memory_limit=-1" >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
21
21
- phpenv config-rm xdebug.ini || true
22
22
- export COMPOSER_ROOT_VERSION=0.10.99
23
- - |
24
- if [ 'false' == "$TRAVIS_PULL_REQUEST" ]; then
25
- cp box.json.dist box.json
26
- openssl aes-256-cbc -K $encrypted_22e6e244c213_key -iv $encrypted_22e6e244c213_iv -in .travis/secrets.tar.enc -out .travis/secrets.tar -d
27
- tar xvf .travis/secrets.tar -C .travis
28
- fi;
29
23
30
24
install :
31
25
- composer install --no-interaction --no-progress --no-suggest --prefer-dist $COMPOSER_FLAGS
@@ -45,7 +39,6 @@ deploy:
45
39
secure : 0ei0gMDsask+ro2LeUOPfsi99fbo8img/cUnAjg2RTcV03ANpQ5rZwG6PNBpaPLwGRNF+AGvHl+amrnL5b0ZLAMutif3v6oZLm9M5Kq4H2g3zqcvXkmxhRDvEsUJBqf2UvFEXxF03GZIsM29v3l6H09IfO0rL2itMibfwz9o3ialzanRQCxfBe8bHTsmKMZALA6Xk3/Vhj/cQdK0hVv+D6RGzAIv5AhLU5yLYNtu2UcvXZxdLt4RPwnVflx5Jiu/zsmEM/CuGryHGpHQTfbEh3OQCA1bcEyFWtAp3Ngl8IwA4S/7RLb3ukYhnoKefeYy6e10DUgQvKmekc4e9n53g8Wc8p2DRbA86rcABB0pI3rrIO7tAsvsr7H970Q/Jmn3QdoH0UcnO8JptnvZzSZ5MdbIMH5fsbri5kNIw748jJngAtPi8jFb4ekmkyOL8cpC/3C/S7c/oHE9yqn/WrSNEq181iIP2eYapOA/mWrk+Hysk/O1QH10vTejcJIDjE3tWR+XtuxQrxzfD5M1Vg+pr/G6BDNEom2h6/oKdi1sUwO0XKBpmIgiFTsp9EZA3O9fjoYmcFECc5HFrMtzYf79pNj6d6jggQgQa3LB4BViAsxqc9nYtj7zYsXqFxg3Y63MSsoyHkShzkTQjLKEkQ0EXVL5d8eWWplznQdAKiEDLxc=
46
40
file :
47
41
- bin/php-scoper.phar
48
- - bin/php-scoper.phar.pubkey
49
42
skip_cleanup : true
50
43
on :
51
44
tags : true
Original file line number Diff line number Diff line change @@ -416,13 +416,10 @@ fixtures/set025/composer.lock: fixtures/set025/composer.json
416
416
fixtures/set027-laravel/composer.lock : fixtures/set027-laravel/composer.json
417
417
@echo fixtures/set027-laravel/composer.lock is not up to date.
418
418
419
- bin/php-scoper.phar : bin/php-scoper src vendor scoper.inc.php box.json
419
+ bin/php-scoper.phar : bin/php-scoper src vendor scoper.inc.php box.json.dist
420
420
$(BOX ) compile
421
421
touch $@
422
422
423
- box.json : box.json.dist
424
- cat box.json.dist | sed -E ' s/\"key\": \".+\",//g' | sed -E ' s/\"algorithm\": \".+\",//g' > box.json
425
-
426
423
COVERS_VALIDATOR =$(PHPBIN ) vendor-bin/covers-validator/bin/covers-validator
427
424
clover.xml : src
428
425
$(COVERS_VALIDATOR )
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ potentially very difficult to debug due to dissimilar or unsupported package ver
31
31
32
32
- [ Installation] ( #installation )
33
33
- [ Usage] ( #usage )
34
+ - [ Phive] ( #phive )
34
35
- [ PHAR] ( #phar )
35
36
- [ Composer] ( #composer )
36
37
- [ Configuration] ( #configuration )
@@ -67,16 +68,27 @@ potentially very difficult to debug due to dissimilar or unsupported package ver
67
68
## Installation
68
69
69
70
71
+ ### Phive
72
+
73
+
74
+ You can install Box with [ Phive] [ phive ]
75
+
76
+ ``` bash
77
+ $ phive install humbug/php-scoper --force-accept-unsigned
78
+ ```
79
+
80
+ To upgrade ` php-scoper ` use the following command:
81
+
82
+ ``` bash
83
+ $ phive update humbug/php-scoper --force-accept-unsigned
84
+ ```
85
+
86
+
70
87
### PHAR
71
88
72
89
The preferred method of installation is to use the PHP-Scoper PHAR, which can
73
90
be downloaded from the most recent [ Github Release] [ releases ] .
74
91
75
- As the PHAR is signed, you should also download the matching
76
- ` php-scoper.phar.pubkey ` to the same location. If you rename ` php-scoper.phar `
77
- to ` php-scoper ` , you should also rename ` php-scoper.phar.pubkey ` to
78
- ` php-scoper.pubkey ` .
79
-
80
92
81
93
### Composer
82
94
@@ -764,3 +776,4 @@ now been moved under the
764
776
[ patchers ] : #patchers
765
777
[ php-scoper-integration ] : https://github.com/humbug/box#isolating-the-phar
766
778
[ phar-extract-to ] : https://secure.php.net/manual/en/phar.extractto.php
779
+ [ phive ] : https://github.com/phar-io/phive
Original file line number Diff line number Diff line change 1
1
{
2
- "algorithm": "OPENSSL",
3
- "key": ".travis/php-scoper-private.pem",
2
+ "banner": [
3
+ "This file is part of the humbug/php-scoper package.",
4
+ "",
5
+ "Copyright (c) 2017 Théo FIDRY <theo.fidry@gmail.com>,",
6
+ " Pádraic Brady <padraic.brady@gmail.com>",
7
+ " Bernhard Schussek <bschussek@gmail.com>",
8
+ "",
9
+ "This source file is subject to the MIT license that is bundled",
10
+ "with this source code in the file LICENSE."
11
+ ],
4
12
5
13
"files": [
6
14
"src/scoper.inc.php.tpl"
7
15
],
8
16
"git": "git_version_placeholder",
17
+ "datetime": "release-date",
9
18
10
19
"compression": "GZ",
11
20
Original file line number Diff line number Diff line change 14
14
15
15
namespace Humbug \PhpScoper \Console ;
16
16
17
+ use PackageVersions \Versions ;
17
18
use Symfony \Component \Console \Application as SymfonyApplication ;
19
+ use function trim ;
18
20
19
21
final class Application extends SymfonyApplication
20
22
{
@@ -30,15 +32,38 @@ final class Application extends SymfonyApplication
30
32
31
33
ASCII;
32
34
35
+ private $ releaseDate ;
36
+
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ public function __construct (string $ name = 'Box ' , string $ version = null , string $ releaseDate = '@release-date@ ' )
41
+ {
42
+ if (null === $ version ) {
43
+ $ rawVersion = Versions::getVersion ('humbug/php-scoper ' );
44
+
45
+ [$ prettyVersion , $ commitHash ] = explode ('@ ' , $ rawVersion );
46
+
47
+ $ version = $ prettyVersion .'@ ' .substr ($ commitHash , 0 , 7 );
48
+ }
49
+
50
+ $ this ->releaseDate = false === strpos ($ releaseDate , '@ ' ) ? $ releaseDate : '' ;
51
+
52
+ parent ::__construct ($ name , $ version );
53
+ }
54
+
33
55
/**
34
56
* @inheritdoc
35
57
*/
36
58
public function getLongVersion (): string
37
59
{
38
- return sprintf (
39
- '<info>%s</info> version <comment>%s</comment> ' ,
40
- $ this ->getName (),
41
- $ this ->getVersion ()
60
+ return trim (
61
+ sprintf (
62
+ '<info>%s</info> version <comment>%s</comment> %s ' ,
63
+ $ this ->getName (),
64
+ $ this ->getVersion (),
65
+ $ this ->releaseDate
66
+ )
42
67
);
43
68
}
44
69
Original file line number Diff line number Diff line change 26
26
use Symfony \Component \Filesystem \Filesystem ;
27
27
use function file_get_contents ;
28
28
use function Humbug \PhpScoper \escape_path ;
29
+ use function preg_replace ;
29
30
30
31
/**
31
32
* @covers \Humbug\PhpScoper\Console\Command\AddPrefixCommand
@@ -103,6 +104,7 @@ public function test_get_help_menu()
103
104
EOF;
104
105
105
106
$ actual = $ this ->appTester ->getDisplay (true );
107
+ $ actual = preg_replace ('/php-scoper-test version .*/ ' , 'php-scoper-test version UNKNOWN ' , $ actual );
106
108
107
109
$ this ->assertSame ($ expected , $ actual );
108
110
$ this ->assertSame (0 , $ this ->appTester ->getStatusCode ());
@@ -126,6 +128,7 @@ public function test_get_version_menu()
126
128
EOF;
127
129
128
130
$ actual = $ this ->appTester ->getDisplay (true );
131
+ $ actual = preg_replace ('/php-scoper-test version .*/ ' , 'php-scoper-test version UNKNOWN ' , $ actual );
129
132
130
133
$ this ->assertSame ($ expected , $ actual );
131
134
$ this ->assertSame (0 , $ this ->appTester ->getStatusCode ());
You can’t perform that action at this time.
0 commit comments