Download the PHP package limen/redmodel without Composer

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

Make redis manipulations easy. Unify commands for all data types.

Build Status Packagist

中文

Wiki

Python version

Features

Unified commands

Installation

Recommend to install via composer.

Usage

Concepts

Key representation

Every model has its own key representation which tells how to build query keys. For example

We can use where clauses to query the Redis.

The keys to query are

Key field

Key field is a dynamic part of the key representation.

Take the key representation above, it has two fields

Complete key

When a key has no unbound field, we treat it as complete. For example

On the contrary, an incomplete key is similar to

Returned data set

The returned data set would be an associated array whose indices are the query keys.

When both keys exist on Redis database, the returned data set would be

If a key not exist, the equivalent index would be not set.

The returned item's data type depends on the model's type which could be string, hash, list, set or zset.

Methods

create

Can use when a model's key representation has only one dynamic field as its primary field.

The item's ttl is optional.

Hash type with key representation

zset type with key representation

createExists

Similar to "setxx" but supports more data types: string, hash, set, zset and list.

createNotExists

Similar to "setnx" but supports more data types.

insert

An optional parameter make it possible to insert like "setnx" and "setxx". String type with key representation.

insertExists

Similar to createExists

insertNotExists

Similar to createNotExists

find

Can use when a model's key representation has only one dynamic field as its primary field.

findBatch

Similar to find. The returned data set are indexed by ids.

updateBatch

Similar to findBatch.

The key would be created if not exist. The key's ttl would not be modified if the ttl parameter not set.

all

key representation

where

Similar to SQL

whereIn

Similar to where

first

Get first exist item from query keys. Return null when all query keys not exist.

update

The key would be created if not exist. The key's ttl would not be modified if the ttl parameter not set.

delete

Delete query keys.

orderBy, sort

string type with key representation

count

Count the exist query keys.

max

Get the maximum item in the returned data set.

min

Get the minimum item in the returned data set.

sum

Get the sum of the returned data set.

Predis native methods

Predis native methods such as "sadd", "hset" can use when the query contains only one complete query key.

// string model
$model->where('id', 1)->set('maria');

// hash model
$model->where('id', 1)->update([
    'name' => 'Maria',
    'age' => '22',
]);
// equals to
$model->where('id', 1)->hmset([
    'name' => 'Maria',
    'age' => '22',
]);

Query builder

Taking the job to build query keys for model.

key representation

Development

Test


All versions of redmodel with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5
predis/predis Version ^1.1
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 limen/redmodel contains the following files

Loading the files please wait ....