Download the PHP package tuupke/laravel-finalizer without Composer

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

Introduction

Laravel's implementation of finalizers (through middleware) are still synchronous with the request and will therefor increase the response-time of your application. There are many use-cases - logging for instance - for which this is not desired.

Normally speaking, standard Laravel practices dictate that a job should be used in these cases. When this is overkill, this package can be used. It provides a small wrapper around PHP's register_shutdown_function, to help with these use-cases.

Installation

Installation of this packages is done through composer.

composer require "tuupke/laravel-finalizer"

Then open config/app.php and append to the providers array:

Tuupke\Finalizer\FinalizerServiceProvider::class,

and add to the aliasses array:

'Finalizer' => Tuupke\Finalizer\FinalizerFacade::class,

Usage

From somewhere within your application you can now call: Finalizer::register($closure)) with $closure some closure executing some action. Optionally, you can provide an integer as the second parameter, which will server as the priority. The lower this priority, the earlier it is executed. When 2 closures are registered with the same priority. The closure which was registered first, will be executed first.

Example

A minimalist example which stores some contents in a file is listed below. Note that this should not be used in an actual application. When logging is required, use the Log facade.

After a request has been executed which contained this code-block, the contents of /tmp/finalizer-test is:

Use in non-Laravel applications

Strictly speaking, this package can also be used in non-Laravel PHP applications which use composer. But it is not recommended and defeats the purpose of this package. If you want, you can still use it. A minimal example is provided below.


All versions of laravel-finalizer with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0.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 tuupke/laravel-finalizer contains the following files

Loading the files please wait ....