hirokws / prepper
Registorate installing package's service provider and class alias by Composer facility.
Requires
- php: >=5.3.7
- illuminate/container: 4.0.*@dev
Requires (Dev)
- mockery/mockery: 0.8.*
- phpunit/phpunit: 3.7.*@dev
This package is not auto-updated.
Last update: 2016-10-23 08:48:27 UTC
README
Auto update app/config/app.php
for Laravel packages with Composer facility.
Summary
Add Prepper to require
or require-dev
section of your root composer.json.
"hirokws/prepper": "dev-master"
Then composer update
, Or :
composer require "hirokws/prepper:dev-master"
And to activate Prepper, run shell script :
vendor/bin/prepper-start.sh
Or on window environment :
vendor/bin/prepper-start.bat
( Sorry, not tested in windonws environment... )
How to use?
Not specially must do to work. Just normally install packages by composer.
If provides.json is there in the installing package, automatically update app.php to register service providers and class aliases by using information that defined in the json file.
Also when packages removed by composer, also remove service providers and class aliases registration from app.php.
Install
By using composer, install "hirokws/preppre": "dev-master"
.
And run vendor/bin/prepper-start.sh
(on Linux/Unix) or vendor/bin/prepper-start.bat
(on windows).
Or manually add following json into script
section of root composer.json.
"post-package-install": [
"Prepper\\Prepper::installPackage"
],
"pre-package-uninstall": [
"Prepper\\Prepper::uninstallPackage"
],
Uninstall
Run vendor/bin/prepper-stop.sh
or vendor/bin/prepper-stop.bat
.
Or remove "post-package-install" and "pre-package-uninstall" definitions from script
section of root composer.json.
provides.json
The provides.json
file include information to register/un-register service providers and class aliases for app.php.
Definitions are upper compatible with rtablada/package-installer.
For example, to "Juy/profile" package :
{
"providers": [
"Juy\\Profiler\\Providers\\ProfilerServiceProvider"
],
"aliases": [
{
"alias": "Profiler",
"facade": "Juy\\Profiler\\Facades\\Profiler"
}
],
"PostInstallMessage": "Updated app.php config file automatically for juy/profiler.",
"PostUninstallMessage": "Automatically remove juy/profiler setting from app.php config file."
}
So, definitions :
providers
: Registering service provider names.alias
andfacade
: Registering class aliases.PreInstallMessage
: A message before registration.PostInstallMessage
: A message after registration.PreUninstallMessage
: A message before un-registration.PostUninstallMessage
: A message after un-registration.
locally supported packages
Prepper have some install definition json files locally. So work on following packages out of box.
- barryvdh/laravel-ide-helper
- cartalyst/sentry
- frozennode/administrator
- jasonlewis/basset
- juy/profiler
- loic-sharma/profiler
- way/generators
- way/guard-laravel
- zizaco/confide
- zizaco/entrust
(ABC ordered)
Notes
Rrepper modify app/config/app.php
file only, don't touch other app.php files.
If the last item of 'providers' / 'aliases' arrays in app.php file never ending with a comma, anything will be added. So keeping the last (all) item must be ending with a comma.
This is forever beta. Because I think Taylor is working out for simuler registration functionlay for Laravel 4.1. So this package will be short time live.
In honesty, this kind of function became fully usefuly when all Laravel package have install information. To be it, must be offically supported.