Releases: box-project/box2
Fixed Bootstrap Loading
Thanks to @TomasVotruba, bootstrap files are now actually loaded!
Friendly Improvements
You can now remove the shebang line!
{
"shebang": false
}
Also, a new JavaScript minifier is bundled:
{
"compactors": [
"Herrera\\Box\\Compactor\\Javascript"
]
}
Yay!
Bug Fixes
Bug Fixes
Bug Fixes
Annotations Supported
With the release of 2.4.0, I bring support for compacting Doctrine-styled annotations.
With the following configuration settings:
{
"annotations": {
"ignore": ["author"]
},
"compactors": [
"Herrera\\Box\\Compactor\\Php"
]
}
This code:
<?php
/**
* This is an example docblock with annotations.
*
* @author Kevin Herrera <[email protected]
*
* @ORM\Entity()
* @ORM\Table(name="Test")
*/
class Test
{
}
Will be compacted to this:
<?php
/**
@ORM\Entity()
@ORM\Table(name="Test")
*/
class Test
{
}
I had to create a special library to handle this, so I recommend reading the documentation for herrera-io/php-annotations
for more details about how the whole process works.
You can also find details about the configuration settings by running: box build -h
Phar-less Existance
This release makes use of new features in php-box v1.4.0:
- Supports the
StubGenerator->extract()
method, which allows you to create phars that can still be executed without having thephar
extension installed on the system. Just make sure your application or library can function without any of its features. - Supports limited functionality when the
phar
extension is not available. At the moment, you can only use the following commands in Box without a phar extension:validate
verify
key:create
key:extract
You can find a complete change log here.
Mapping Paths
In this release, a new map
setting has been added.
{
"map": [
{ "path/to/match": "path/to/replace/with" },
{ "": "new/root/path/" }
]
}
As you can see, the setting is an array of objects. Each object is expected to have a single key/value pair, where the key is a path segment to match, and the value is the new segment to replace it with. Note that only relative paths, which begin with the path segment defined by the object key, will be matched.
Using the example above:
Before | After |
---|---|
path/to/match/file.php |
path/to/replace/with/file.php |
path/to/match/sub/file.php |
path/to/replace/with/sub/file.php |
another/path/file.php |
new/root/path/another/path/file.php |
An empty object key is a global match. However, instead performing path segment replacement, the value will be prefixed to the path that was matched. Don't forget to add a trailing slash for directory paths!
This could prove to be useful for Composer dependencies that have a target-dir
set.
Thank you, @lyrixx, for the request!