@@ -128,7 +128,7 @@ When the parameter is not given or set to `null`, Box tries to guess the binary
128
128
` composer.json ` file. If the [ Composer ` bin ` ] [ composer-bin ] is set, Box will pick the first value provided. Otherwise it
129
129
will fallback on the [ PHAR] [ phar class ] default file used which is ` index.php ` .
130
130
131
- The main file contents is processed by the [ compactors] [ compactors ] as the other files.
131
+ The main file contents is processed by the [ compactors] [ compactors ] as the other files.
132
132
133
133
If the main file starts with a shebang line (` #! ` ), it will be automatically removed (the shebang line goes in the
134
134
[ stub] [ stub ] for a PHAR and is configured by the [ shebang] [ shebang ] setting).
@@ -158,9 +158,9 @@ constraint before running. See more information about it [here][requirement-chec
158
158
the requirement checker will be added. Note that this is true only if either the ` composer.json ` or ` composer.lock `
159
159
could have been found.
160
160
161
- !!! Warning
161
+ !!! Warning
162
162
this check is still done within the PHAR. As a result, if [ the required extension to open the PHAR] [ compression ]
163
- due to the compression algorithm is not loaded, a hard failure will still appear: the requirement
163
+ due to the compression algorithm is not loaded, a hard failure will still appear: the requirement
164
164
checker _ cannot_ be executed before that.
165
165
166
166
@@ -196,7 +196,7 @@ The `force-autodiscovery` (`bool` default `false`) setting forces Box to attempt
196
196
though you are using the [ ` directories ` ] [ directories ] or [ ` finder ` ] [ finder ] setting.
197
197
198
198
When Box tries to find which files to include, it may remove some files such as readmes or test files. If however you
199
- are using the [ ` directories ` ] [ directories ] or [ ` finder ` ] [ finder ] , Box will _ append_ the found files to the ones you
199
+ are using the [ ` directories ` ] [ directories ] or [ ` finder ` ] [ finder ] , Box will _ append_ the found files to the ones you
200
200
listed.
201
201
202
202
@@ -228,7 +228,7 @@ Files listed in the [`blacklist`][blacklist] will not be added to the PHAR.
228
228
the files such as images, those that contain binary data or simply a file you do not want to alter at all despite using
229
229
compactors.
230
230
231
- !!! Warning
231
+ !!! Warning
232
232
Setting the key ` directories ` (regardless of its value), will disable the file auto-discovery. If you want
233
233
to keep it, check the [ force the auto-discovery] [ force-autodiscovery ] setting.
234
234
@@ -243,7 +243,7 @@ compactors.
243
243
included in ` directories ` (respectively ` directories-bin ` ), the those files ** will be included** . The files included
244
244
are a union of the directives.
245
245
246
- !!! Warning
246
+ !!! Warning
247
247
Symlinks are not followed/supported.
248
248
249
249
@@ -252,7 +252,7 @@ compactors.
252
252
The finder (` object[] ` |` null ` default ` [] ` ) setting is a list of JSON objects. Each object (key, value) tuple is a
253
253
(method, arguments) of the [ Symfony Finder] [ symfony-finder ] used by Box. If an array of values is provided for a single
254
254
key, the method will be called once per value in the array.
255
-
255
+
256
256
Note that the paths specified for the ` in ` method are relative to [ ` base-path ` ] [ base-path ] and that the finder will
257
257
account for the files registered in the [ ` blacklist ` ] [ blacklist ] .
258
258
@@ -307,7 +307,7 @@ blacklisted are the ones found using the other available configuration settings:
307
307
Note that all the blacklisted paths are relative to the settings configured above. For example if you have the following
308
308
file structure:
309
309
310
- ```
310
+ ``` text
311
311
project/
312
312
├── box.json.dist
313
313
├── A/
@@ -335,7 +335,7 @@ With:
335
335
Box will try to collect all the files found in ` project ` (cf. [ Including files] [ including-files ] ) but will exclude ` A/ `
336
336
and `B/A resulting in the following files being collected:
337
337
338
- ```
338
+ ``` text
339
339
project/
340
340
├── box.json.dist
341
341
└── B/
@@ -372,14 +372,15 @@ belonging to dev only packages. For example for the given project:
372
372
}
373
373
}
374
374
```
375
+
375
376
</details >
376
377
377
378
The ` vendor ` directory will have ` beberlei/assert ` and ` bamarni/composer-bin-plugin ` . If ` exclude-dev-files ` is not
378
379
disabled, the ` bamarni/composer-bin-plugin ` package will be removed from the PHAR.
379
380
380
381
This setting will automatically be disabled when [ ` dump-autoload ` ] [ dump-autoload ] is disabled. Indeed, otherwise some
381
- files will not be shipped in the PHAR but may still appear in the Composer autoload classmap, resulting in an
382
- autoloading error.
382
+ files will not be shipped in the PHAR but may still appear in the Composer autoload classmap, resulting in an
383
+ autoloading error.
383
384
384
385
385
386
### Map (` map ` )
@@ -420,13 +421,14 @@ the above files will be stored with the following paths in the PHAR:
420
421
The [ PHAR stub] [ phar.fileformat.stub ] file is the PHAR bootstrapping file, i.e. the very first file executed whenever
421
422
the PHAR is executed. It usually contains things like the PHAR configuration and executing the [ main script file] [ main ] .
422
423
423
- The default PHAR stub file can be used but Box also propose a couple of options to customize the stub used.
424
+ The default PHAR stub file can be used but Box also propose a couple of options to customize the stub used.
424
425
425
426
426
427
### Stub (` stub ` )
427
428
428
429
The stub (` string ` |` boolean ` |` null ` default ` true ` ) setting is used to specify the location of a stub file or if one
429
430
should be generated:
431
+
430
432
- ` string ` : Path to the stub file will be used as is inside the PHAR
431
433
- ` true ` (default): A new stub will be generated
432
434
- ` false ` : The default stub used by the PHAR class will be used
@@ -440,7 +442,7 @@ If a custom stub file is provided, none of the other options ([`shebang`][sheban
440
442
The shebang (` string ` |` false ` |` null ` ) setting is used to specify the shebang line used when generating a new stub. By
441
443
default, this line is used:
442
444
443
- ```
445
+ ``` sh
444
446
#! /usr/bin/env php
445
447
```
446
448
@@ -543,7 +545,7 @@ done for you.
543
545
544
546
For example ` Custom banner ` will result in the stub file:
545
547
546
- ```
548
+ ``` php
547
549
/*
548
550
* Custom banner
549
551
*/
@@ -659,7 +661,7 @@ command ✨.
659
661
### Annotations (` annotations ` )
660
662
661
663
The annotations (` boolean ` |` object ` |` null ` default ` true ` ) setting is used to enable compacting annotations in PHP source
662
- code.
664
+ code.
663
665
664
666
This setting is only taken into consideration if the [ ` KevinGH\Box\Compactor\Php ` compactor] [ compactors ] is enabled.
665
667
@@ -689,6 +691,7 @@ function foo($x, $y): int {
689
691
return $x <=> $y;
690
692
}
691
693
```
694
+
692
695
</details >
693
696
694
697
<details >
@@ -715,6 +718,7 @@ function foo($x, $y): int {
715
718
return $x <=> $y;
716
719
}
717
720
```
721
+
718
722
</details >
719
723
720
724
@@ -786,7 +790,7 @@ available:
786
790
787
791
By default, PHARs are ` SHA1 ` signed.
788
792
789
- The ` OPENSSL ` algorithm will require to provide [ a key] [ key ] .
793
+ The ` OPENSSL ` algorithm will require to provide [ a key] [ key ] .
790
794
791
795
!!! warning
792
796
@@ -846,7 +850,7 @@ With the configuration excerpt:
846
850
847
851
Then the ` Phar::getMetadata() ` will return ` ['application_version' => '1.0.0-dev'] ` array.
848
852
849
- !!! warning
853
+ !!! warning
850
854
851
855
Your callable function must be readable by your autoloader.
852
856
@@ -1037,7 +1041,6 @@ The short commit hash will only be used if no tag is available.
1037
1041
[ git-commit-short ] : #short-git-commit-placeholder-git-commit-short
1038
1042
[ git-tag-placeholder ] : #git-tag-placeholder-git-tag
1039
1043
[ git-version-placeholder ] : #git-version-placeholder-git-version
1040
- [ herrera-io/php-annotations ] : https://github.com/herrera-io/php-annotations
1041
1044
[ including-files ] : #including-files
1042
1045
[ intercept ] : #intercept-intercept
1043
1046
[ key-pass ] : #the-private-key-password-key-pass
@@ -1055,7 +1058,6 @@ The short commit hash will only be used if no tag is available.
1055
1058
[ phar.mapphar ] : https://secure.php.net/manual/en/phar.mapphar.php
1056
1059
[ phar.setalias ] : https://secure.php.net/manual/en/phar.setalias.php
1057
1060
[ phar.setsignaturealgorithm ] : https://secure.php.net/manual/en/phar.setsignaturealgorithm.php
1058
- [ phar.webphar ] : https://secure.php.net/manual/en/phar.webphar.php
1059
1061
[ php-date-format ] : https://secure.php.net/manual/en/function.date.php
1060
1062
[ php-scoper-compactor ] : #php-scoper-php-scoper
1061
1063
[ php-scoper-configuration ] : https://github.com/humbug/php-scoper#configuration
0 commit comments