Comments (9)
@bennothommo ah, it's because Laravel parses installed.json itself:
We just need to override this in the October library, which is required anyways if we want to change its behaviour with a config value.
from debugbar-plugin.
@bennothommo does the don't discover section get properly merged in from just the plugin's composer.json? Why do we need it in the project root and in the plugin?
from debugbar-plugin.
@LukeTowers when I ran it with the Composer merge plugin, even with the "merge-extra" and "merge-extra-deep" options enabled, I couldn't get the Debug bar plugin to disallow discovery through the "extra" section - it would still discover the base package.
from debugbar-plugin.
The only extra section that is correctly parsed seems to be the root composer.json
.
from debugbar-plugin.
@LukeTowers I found another way:
We can copy over this block to our Application class and condition the highlighted line with a check for the config value - it allows the package discovery to still work, but just simply doesn't load the discovered packages.
from debugbar-plugin.
@bennothommo good idea. I'm not 100% sold on the config file disabling of it by default yet though, I'm sure it might affect @adrenth & other @vdlp devs since they're usually gung ho about Laravel features.
from debugbar-plugin.
We developed a Vdlp.Developer
plugin which we use internally in our agency. This plugin is shipped with the barryvdh/laravel-debugbar
package. This package publishes a config file debugbar.php
to the project config
folder.
Also we require our own plugin
vdlp/oc-developer-plugin
in the"require-dev"
section ofcomposer.json
. So it is never available on any testing/acceptance/production environment. It makes no sense by having debug packages/plugins installed there.
This default debugbar.php config file contains this line:
/*
|--------------------------------------------------------------------------
| Debugbar Settings
|--------------------------------------------------------------------------
|
| Debugbar is enabled by default, when debug is set to true in app.php.
| You can override the value by setting enable to true or false instead of null.
...
'enabled' => env('DEBUGBAR_ENABLED', null),
So, it's enabled by default.
BUT...
All our projects have .env
files by default and contain the DEBUGBAR_ENABLED
environment variable. The only thin a developer needs to do is change this variable to enable or disable it:
DEBUGBAR_ENABLED = false|true
The intention of this plugin is having a debugbar in your project. So why disable it by default?
from debugbar-plugin.
@adrenth sorry for the confusion, we're talking about the Laravel package autodiscovery feature. We're considering disabling it by default in October and encouraging developers to manually load external packages' aliases and service providers from within their plugins instead so that we can properly prevent them from being loaded when the plugin (and thus the dependency) is present but disabled.
from debugbar-plugin.
Resolved by octobercms/library#492.
from debugbar-plugin.
Related Issues (20)
- Two exceptions originating from debugbar HOT 8
- Plugin is hidden on the marketplace HOT 4
- Installed from Marketplace doesn't work (v3.0.0) HOT 5
- Failed to install from repository HOT 1
- Models collector does not work with October (Laravel 5.5 only) HOT 3
- Error when saving data from backend HOT 4
- v3.1.0 does't work HOT 11
- 500 Server Error after install ? HOT 12
- Plugin availability. HOT 1
- The plugin is hidden and cannot be installed - via artisan plugin:install HOT 3
- REST API profiling in 3.1.0 HOT 6
- Improve quality of event performance tracking HOT 4
- issues with debugAjax = true HOT 2
- Composer install crash the whole application HOT 2
- how to install DebugBar to octobercms version 470? HOT 1
- New Collectors HOT 7
- OctoberModelsCollector causes models not able to being serialized HOT 1
- Uncaught TypeError: url.indexOf is not a function HOT 1
- Twig "debug" functionality broken HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from debugbar-plugin.