Download the PHP package sapphirecat/lisp-signals without Composer

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

lisp-signals

A signal/condition/restart system, inspired by Common Lisp and Peter Seibel.

What even?

In most languages, PHP included, an exception is thrown at a low level and caught higher on the call stack. By the time it is caught, execution has left the lower levels, and there's no way to return to them.

In Common Lisp, the equivalent notions are that a signal is sent, and handled by a signal handler function. But, there's a third part, restarts, which can be registered at any level in between. The signal handler can choose any restart to invoke, and execution resumes inside that function, even if it's below the level of where the signal handler was registered.

The simplest example is implemented in the appDoesNothing.php example, using stuff defined in common.inc.php. All of the examples follow the log-parsing example in Chapter 19 of Practical Common Lisp.

I'm a lisper, how does it happen in PHP?

Restarts are a special exception class that gets thrown, and declaring the restart is actually writing a try/catch block and telling the Signal class the restart exists. Low-level code calls downward into the signal-handling stuff to send errors or other conditions, so the stack stays intact.

I took another liberty with the Common Lisp design: signal names are actually the class name of a signal object that is sent. So an error is really a Sapphirecat\Signal\Error instance. This allows for signals to package however much data they want, and provide behavior for it, all in a single argument to the signal system (and handler functions.)

In this library, a signal handler is bound by Signal::receive(), signals are sent with Signal::send(), and active restarts are declared by Signal::restart(). The condition is a SignalInterface and a restart is actually invoked by throwing a BaseRestart.

The error and warning protocols are implemented in Signal::error() and Signal::warning() (with a Silence restart), respectively. Finally, the built-in Error condition can be subclassed, and sent with Signal::sendError().

(I hope this terminology is accurate. I haven't gone deep into Lisp in a while.)

Installation

Get it from composer:

composer require sapphirecat/lisp-signals "~0.9.0"

Alternatively, include the autoload.php in this repository's top level, and enjoy.

License

2-clause BSD. If it breaks, you get to keep the pieces.


All versions of lisp-signals with dependencies

PHP Build Version
Package Version
Requires php Version ^5.6 || ^7.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 sapphirecat/lisp-signals contains the following files

Loading the files please wait ....