Download the PHP package saad/api-debugger without Composer

On this page you can find all versions of the php package saad/api-debugger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package api-debugger

API-Debugger

Travis

Easily debug your JSON API.

This Package is an enhancement of Laravel-API-Debugger Package to add compatibility for Lumen framework

When you are developing JSON API sometimes you need to debug it, but if you will use dd() or var_dump() you will break the output that will affect every client that is working with your API at the moment. Debugger is made to provide you with all your debug information and not corrupt the output.

Installation

This help is for Laravel 5.4 only. Readme for earlier versions can be found in the relevant branches of this repo.

PHP >=5.5.9+ or HHVM 3.3+, Composer and Laravel 5.4+ are required.

Installation

For Lumen

1- Register the package service provider

2- this package will be enabled/disabled according to api-debugger.enabled configuration which depends on this env value ENABLE_API_DEBUG

you can copy the configuration file api-debugger.php to config directory and customize it as you like by doing this, you will have to register the new configuration file in bootstrap/app.php

For Laravel 5.4

Open up config/app.php and add the following to the providers key.

Also you can register a Facade for easier access to the Debugger methods.

For Laravel 5.5

package supports package discovery feature.

Json response

Before extension will populate your answer it will try to distinguish if it is a json response. It will do it by validating if it is a JsonResponse instance. The best way to do it is to return response()->json(); in your controller's method.

Also please be careful with what you return. As if your answer will not be wrapped in any kind of data attribute (pages in the example above), frontend could be damaged because of waiting the particular set of attributes but it will return extra debug one.

So the best way to return your responses is like this

For more info about better practices in JSON APIs you can find here http://jsonapi.org/

Debugging

Debugger's two main tasks are to dump variables and collect anny additional info about your request.

Var dump

Debugger provides you with the easy way to dump any variable you want right in your JSON answer. This functionality sometimes very handy when you have to urgently debug your production environment.

You can simultaneously dump as many vars as you want and they will appear in the answer.

Note! Of course it it not the best way do debug your production environment, but sometimes it is the only way. So be careful with this, because everyone will see your output, but at least debug will not break your clients.

Collecting data

Note! By default Debugger will collect data ONLY when you set APP_DEBUG=true. So you don't have to worry that someone will see your system data on production.

All available collections can be found in api-debugger.php config that you can publish and update as you wish.

QueriesCollection

This collections listens to all queries events and logs them in connections, query, time structure.

CacheCollection

It can show you cache hits, misses, writes and forgets.

ProfilingCollection

It allows you to measure time taken to perform actions in your code. There are 2 ways to do it.

Automatically:

Or manually:

Also helpers are available:

Extending

You can easily add your own data collections to debug output. Just look at how it was done in the package itself and repeat for anything you want (for example HTTP requests).

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.


All versions of api-debugger with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.0
illuminate/support Version >=5.4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package saad/api-debugger contains the following files

Loading the files please wait ....