Closed moufmouf closed 9 years ago
looks good, thanks.
However please don't require php 5.4, instead use if (defined('JSON_PRETTY_PRINT'))
- resulting in non-pretty JSON with php 5.3.
Or, you might even use the composer built in json formatter (they must have one, but I don't know if it is possible to use from a plugin)
Fixed. I used the JsonFile
class from Composer to keeps compatibility with PHP 5.3.
After testing a bit more, I realize that the "package.json" files are generated for the root package but also for the packages in vendor/. It makes no sense to generate "package.json" files in the vendor/ directory. I adapted the PR to remove "package.json" from dependencies and keep it only for root package.
Makes sense.
Thanks for this PR :D
Note: I'm allowing the user to modify
package.json
orbower.json
. Only thedependencies
section will be overwritten.This can be useful sometimes. For instance, the gulp-bower-files extensions allows the use to put an extra section in "bower.json" that allows "gulp-bower-files" to ignore some packages. Therefore, it can be useful to let the possibility for the user to put additional material in those files.
On a side note, I added the "JSON_PRETTY_PRINT" tag to json_encode to get a pretty print. This is only supported in PHP 5.4. Hope this is not an issue for koala-framework. Let me know if it is.