Download the PHP package hiraeth/signal without Composer

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

Signal

Signal is a generic callback wrapper / proxy which enables custom resolution, including lazy instantiation and dependency injection in places where it might not otherwise be supported.

If you think you know what the above means and want to skip the explanation you can simply:

Install

Othewise, read on to understand...

What's the Problem?

I was looking at using igorw/evenement and saw this:

Lots of libraries support generic callbacks which are usually shown as anonymous functions. This is great if you write a lot of custom wiring, not so great if you separate wiring/configuration data from wiring logic, and use classes, e.g.:

FILE: config.php

Now when you read the config, you could do:

But then you're resolving all your handlers and their dependencies up front. So maybe instead you do:

OK, that's not so bad, but now you're kind of assuming your handlers will always implement __invoke. And what if you need to handle different callback styles elsewhere? Now you have custom proxy callbacks all over.

Is There a Better Way?

Yes! ONE CALLBACK (RESOLVER) TO RULE THEM ALL!

Then:

Isn't that nice?

If you want to make it even nicer, you can move your resolver functionality into a separate class that implements __invoke($signal):

Is that All?

No... because whatever $handler is gets passed to your custom resolver, you can do whatever you want when you resolve the handler. For example, maybe you want to handle "artisan" callbacks (not sure why, but whatever):

Maybe you want to create URL callbacks:

Who the hell knows! The world is your oyster.

OK, Aren't You Still Instantiating Everything Up Front?

No... $signal->create($handler) does not return the resolved handler. Rather, it merely tracks the $handler and returns a proxy callback in its place, so the handler isn't resolved until it actually needs to be. See the one test it has:

Run The Test Yourself


All versions of signal with dependencies

PHP Build Version
Package Version
Requires psr/container Version ^1.0
hiraeth/app Version ^2.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 hiraeth/signal contains the following files

Loading the files please wait ....