Download the PHP package seregazhuk/react-memcached without Composer

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

Asynchronous Memcached PHP Client for ReactPHP ecosystem.

Build Status Scrutinizer Code Quality Maintainability Test Coverage StyleCI

Table of Contents

Installation

Dependencies

Library requires PHP 5.6.0 or above.

The recommended way to install this library is via Composer. New to Composer?

See also the CHANGELOG for details about version upgrades.

Quick Start

See other examples.

Server address

When creating a client via the factory you can specify server address as a second argument:

If the address is not specified the client uses default localhost:11211.

Asynchronous Execution

For each Memcached command a client has a method. All commands are executed asynchronously. The client stored pending requests and once it receives the response from the server, it starts resolving these requests. That means that each command returns a promise. When the server executed a command and returns a response, the promise will be resolved with this response. If there was an error, the promise will be rejected.

Retrieval Commands

Get

Get value from key:

Storage Commands

For $flags you can use PHP MEMCACHE_COMPRESSED constant to specify on-the-fly compression. If the value was not stored indicate because condition for add or replace commands wasn’t met, or the item was in a delete queue, the promise will be rejected with FailedCommandException.

Set

Store key/value pair in Memcached:

Add

Store key/value pair in Memcached, but only if the server doesn’t already hold data for this key:

Replace

Store key/value pair in Memcached, but only if the server already hold data for this key:

Delete Command

Delete value by key from Memcached. If the key doesn't exist or has been deleted the promise rejects with FailedCommandException:

Increment/Decrement Commands

Increment

Increment value associated with key in Memcached, item must exist, increment command will not create it. The limit of increment is the 64 bit mark. If key is not found, the promise will be rejected with FailedCommandException:

Decrement

Decrement value associated with key in Memcached, item must exist, decrement command will not create it If you try to decrement a value bellow 0, value will stay at 0. If key is not found, the promise will be rejected with FailedCommandException:

If value not found, the promise will be rejected with FailedCommandException.

Touch Command

The touch command is used to update the expiration time of an existing item without fetching it. If the key doesn't exist or has been deleted the promise rejects with FailedCommandException:

Statistics Command

This command can return an array of various stats:

Misc Commands

Flush all

Flush the server key/value pairs (invalidating them) after an optional [

Version

Return the Memcached server version:

Verbosity

Change the verbosity output of Memcached server:

Connection Closing

End()

To close the connection call end() method on the client. The client waits till all pending requests are resolved and then closes the connection. All new requests to the client will be rejected with ConnectionClosedException exception.

Close()

If you want to force the closing and don't want to wait for pending requests to be resolved, call close() method. It immediately closes the connection and rejects all pending requests with ConnectionClosedException exception.

Events Handling

You can register event handlers for some client's events.

close

When the connection to Memcached server is closed, the close event is emitted. You can listen to this event to catch connection failures:

error

When an error occurs in the connection, the client emits error event and passes an exception with the problem description:

For example you can handle broken connections like this:

Errors Handling

All exceptions that are thrown by the client or are used to reject the promises extend from the base seregazhuk\React\Memcached\Exception\Exception class.

For example, if you call an unknown Memcached command the promise will be rejected with WrongCommandException:

When the connection is broken all pending promises will be rejected with ConnectionClosedException exception.


All versions of react-memcached with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
react/socket Version ^1.0
react/promise Version ^2.7
react/event-loop Version ^1.0
evenement/evenement Version 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 seregazhuk/react-memcached contains the following files

Loading the files please wait ....