GithubHelp home page GithubHelp logo

middlewares / debugbar Goto Github PK

View Code? Open in Web Editor NEW
16.0 2.0 5.0 44 KB

PSR-15 middleware to insert PHP DebugBar automatically in html responses

License: MIT License

PHP 100.00%
debugbar http psr-15 middleware debugger

debugbar's People

Contributors

ajgarlag avatar mav2287 avatar oscarotero avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

debugbar's Issues

Inline still tries to load font awesome via url

Even when set to inline the debug bar still tried to load the font awesome library. If your vendor folder is above the html root this creates 404 errors. The following are what it tries to load.

https://sample-domain.com/fonts/fontawesome-webfont.woff2?v=4.7.0
https://sample-domain.com/fonts/fontawesome-webfont.woff?v=4.7.0
https://sample-domain.com/fonts/fontawesome-webfont.ttf?v=4.7.0
https://sample-domain.com/fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular

Question: use with relayphp/Relay.Relay

I am trying to get this working with Relay. I have not been able to make it work. Relay is a PSR-15 middleware dispatcher. I am also using zend-diactoros for my message factory interface. In theory, these should all work together.

I think my problem is I just don't know exactly what to pass to the Relay queue. I've tried a few things, including something like the following:

$queue[] = new Middlewares\Debugbar();

Can anyone offer any suggestions on how to get it to work? Thank you.

Add info that vendor must be accessible via HTTP

You should note somewhere that the vendor directory must be accessible via HTTP.
If it's not accessible several 404 http errors appear and - of course - the debug bar will not work.
This information is neccessary because often (or should I say normally) the vendor is not accessible via HTTP.

Allow running from arbitrary server locations (i.e. not server-root).

Issue: The plugin expects that the vendor folder lives in http://<server>/vendor, otherwise asset loading fails to some extend.

Debugbar->inline() works to inline CSS and JS, but the fontawesome-font files are still requested from a wrong location.

It would be great if setting a base-URL for assets as in ->getJavascriptRenderer($baseUrl, $basePath) would be possible.

Adding to Slim Framework

How do I add this into a Slim3 app. It tried this $app->add(new Middlewares\Debugbar()); but got this error: Fatal error: Uncaught RuntimeException: {} is not resolvable in D:\checkinslim\vendor\slim\slim\Slim\CallableResolver.php on line 104

Option to embed JS and CSS inline

In my setup the webserver allows public access only to the folder where the front controller is located in (/var/www/html/public). When trying to use the debugbar it tries to embed JS and CSS files:

<link rel="stylesheet" type="text/css" href="/vendor/maximebf/debugbar/src/DebugBar/Resources/openhandler.css">
<script type="text/javascript" src="/vendor/maximebf/debugbar/src/DebugBar/Resources/vendor/jquery/dist/jquery.min.js"></script>

The problem is that the vendor folder is not publicly accessible (for security reasons) and thus those CSS and JS files cannot be loaded. That is why I would appreciate a setting to embed JS and CSS code inline.
This is possible by using $renderer->dumpJSAssets() and $renderer->dumpCSSAssets().

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.