Download the PHP package lsrur/inspector without Composer

On this page you can find all versions of the php package lsrur/inspector. 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 inspector

Laravel Inspector

At a Glance

Messages Exceptions
idd() - Dump and die on steroids idd() SQLs page
Laravel Inspector as the default Exception renderer Timers and Timeline
Redirection API/Ajax calls
Using Postman REST client app laravel_inspector=dump parameter
Available Collectors Information about
MessageCollector User's messages and dumps
ExceptionCollector Exceptions
DBCollector Queries, including execution time and parameters binding
TimersCollector Timers and time stamps
RoutesCollector Application routes
RequestCollector Current Request
ResponseCollector Current Response
SessionCollector Session variables
ServerCollector $_SERVER dump
More to come...

Installation

This package was tested under PHP 5.6, PHP 7, Laravel 5.2 and Laravel 5.3-Dev

Installing the package via composer:

Next, add InspectorServiceProvider to the providers array in config/app.php:

And this Facade in the same configuration file:

For usage only during development and not during production, do not edit the config/app.php and add the following to your AppServiceProvider :

Configuration

In order to use Inspector as the default exceptions renderer, add the following line in the file app/Exceptions/Handler.php of your Laravel project:

For usage only during development:

Usage

Laravel inspector can be invoked using the Facade, the provided helper functions and a Blade directive:

Laravel inspector will only be active if the config variable app.debug is true.
Anyway, you can temporarily turn Inspector off (just for the current request) with:

Messages

You can inspect objects and variables with the following methods, each of which has its own output format:

Method Description
log([string $description,] mixed $data) Outputs data with "log" format
info([string $description,] mixed $data) Outputs data with "info" format
error([string $description,] mixed $data) Outputs data with "error" format
warning([string $description,] mixed $data) Outputs data with "warning" format
success([string $description,] mixed $data) Outputs data with "success" format
table([string $description,] mixed $data) Outputs data inside a table

Examples:

Additionally, you can use the "inspect" helper function to quickly inspect objects and variables.

Grouping Messages

Laravel Inspector allows you to group messages into nodes and subnodes:

In addition to the ability to group information, each group and subgroup excecution time will be measured and shown. If you forget to close a group, Laravel Inspector will automatically do it at the end of the script, but the excecution time for that group can not be taken.

Timers

Method Description
time(string $timerName) Starts a timer
timeEnd(string $timerName) Ends a timer
timeStamp(string $name) Adds a single marker to the timeline

Examples:

Redirects

Laravel Inspector handles redirects smoothly; showing the collectors bag for both, the original and the target views.

Dump and die

The dd() method (or idd() helper) will dump the entire collectors bag and terminates the script:

As the rest of the package, this feature intelligently determines how will be the format of the output, even if the call was performed from CLI.

Another way to make an inspection, but without interrupting the flow of the request/response, is by adding the parameter laravel_inspector=dump to the URL:

http://myapp.dev/contacts?id=1&laravel_inspector=dump

Thus, Laravel Inspector wont be activated until the a terminable middleware is reached.

Exceptions

The function addException() will inspect our caught exceptions:

Optionally, you can setup LI as the default exception renderer during development time (app.debug=true). Refer to the configuration to do so.

VIEW/AJAX/API requests, how it works

Laravel Inspector (LI) automatically detects the type of the request/response pair and determines the output format. If a View response is detected, the code needed to elegantly show the collected information in the browser console will be injected as a javascript into that view. Along with this, LI will also add a small piece of pure javascript code that serves as a generic http interceptor, which will examine subsequent AJAX calls looking for information injected by LI (this interceptor was tested under pure javascript, Angular 1.x ($http) and jQuery ($.ajax) and should work with any js framework). The interceptor also adds a header in each client AJAX call to let LI know that the interceptor is present. Then, from Laravel side, during an AJAX request or a JSON response, LI will send a script to be interpreted (and properly rendered in the browsers console) by the interceptor, OR a pure Json if that header is not present and then assuming that the request was sent from cURL, a REST client app or something else.

If you are developing, for example, an SPA and using Laravel only for the API but not to serve the web page/s, you can include the following code in your client app to take full advantage of all formatting features of Laravel Inspector.

License

Laravel Inspector is licensed under the MIT License.


All versions of inspector with dependencies

PHP Build Version
Package Version
Requires lsrur/toolbelt Version 0.3.*
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 lsrur/inspector contains the following files

Loading the files please wait ....