Skip to content

Commit

Permalink
merge master
Browse files Browse the repository at this point in the history
  • Loading branch information
shumkov committed Apr 14, 2011
2 parents cc2a8cc + bccf000 commit 3136426
Show file tree
Hide file tree
Showing 8 changed files with 344 additions and 46 deletions.
144 changes: 144 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
Changelog
======

Version 0.5.5
---
March 8, 2011

* Feature #4214: Profiler
* Feature #9921: Implement SETBIT, GETBIT, SETRANGE, GETRANGE, STRLEN
* Feature #9932: Implement LINSERT, LPUSHX, RPUSHX
* Feature #9933: Implement BRPOPLPUSH
* Feature #3531: Implement WATCH, UNWATCH
* Feature #9876: Add removeServer method
* Improvement #10020: Move all command to new binary safe protocol
* Improvement #9920: Deprecate old expire behavior
* Improvement #8863: Add optional response iterator for sets, sortedsets and lists with realtime reading from socket
* Improvement #3967: Add timeout argument to getCommand and getMessage in monitor and pub/sub
* Improvement #4379: Remove case insensitive from options
* Improvement #4902: Set connection to blocking mode if only one connection in pub/sub channel
* Improvement #6751: Change Set with online sessions to SortedSet for optimization
* Improvement #6778: Autoloader optimization
* Improvement #9021: Add getByRank to Rediska_Key_SortedSet
* Improvement #9045: Add getFieldsAndValues() to Rediska_Key_Hash
* Improvement #9052: Add getValues to Rediska_Key_Set and Rediska_Key_List
* Improvement #10093: Add expire argument to Rediska_Key::getOrSetValue
* Bug #4900: Require Rediska bug in Rediska_PubSub_Channel
* Bug #6745: Pub/sub channel can't get Rediska_Connections
* Bug #10061: Subscribe throws exception by timeout if it not specified
* Bug #6746: True subscribe response throws exception
* Bug #6747: Add specified connection to publish
* Bug #6748: Fix memory leaks
* Bug #6777: Fix test bootstrap
* Bug #10159: Break typo in consitent hashing

Version 0.5.1
---
October 28, 2010

* Feature #2033: Implement ZCOUNT
* Improvement #4054: Add append and substring command to Rediska_Key
* Improvement #4055: Add setAndExpire command to Rediska_Key
* Bug #4290: Warning with empty namespace
* Bug #4476: Get parameter in sort command

Version 0.5.0
---
September 7, 2010

* Feature #2033: Implement hash commands: HSET, HGET, HDEL, HEXISTS, HLEN, HKEYS, HVALS, HGETALL, HMSET, HINCRBY, HMGET, HSETNX
* Feature #2035: Hash object
* Feature #2036: Transactions. Implement MULTI, EXEC, DISCARD
* Feature #2037: Publish/Subscribe. Implement SUBSCRIBE, UNSUBSCRIBE, PUBLISH
* Feature #1955: Multiple instance manager
* Feature #2325: Autoloader
* Feature #2028: Implement BLPOP and BRPOP
* Feature #2342: Implement SETEX
* Feature #3444: Implement APPEND
* Feature #3445: Implement SUBSTR
* Feature #3446: Implement CONFIG
* Feature #3526: Implement MONITOR
* Feature #3621: PhpDoc documentaion
* Improvement #2405: New serialzier. 'phpSerialize' and 'json' adapters. Rediska now can't serialize strings.
* Improvement #3246: Add read timeout to connection
* Improvement #3248: Add pushTo argument to pop method of List object
* Improvement #3250: Method generator for IDE autocomplete and phpDoc
* Improvement #3199: Refactor commands
* Bug #2812: Bad assignation in Rediska_Key_Abstract::setName
* Bug #3017: Fix cache multiload
* Bug #3442: Disconnect on destruct break persistent connection
* Bug #3547: Rediska_Key_SortedSet::union does not work properly

Version 0.4.2
---
April 21, 2010

* Feature #2236: Add Redis server version specification (added 'redisVersion' option)
* Feature #2029: Implement ZRANK and ZREVRANK
* Feature #2030: Implement WITHSCORES argument for ZRANGEBYSCORE
* Feature #2031: Implement ZREMRANGEBYRANK
* Feature #2032: Implement ZUNION and ZINTER
* Feature #2195: Implement SORT command as standalone
* Improvement #2233: Refactor configuration of test suite (now requires Zend Framework)
* Improvement #2314: Deprecate SORT attributes in GetList and GetSet
* Bug #2197: Limit and offset broke inverted selects (arguments changed for 'getList', 'getSortedSet', 'truncateList', 'getFromSortedSetByScore)
* Bug #2290: If sessions set is empty trown exception
* Bug #2321: Null lifetime not supported in cache backend

Version 0.4.0
---
April 1, 2010

* Feature #583: Create expample application
* Feature #766: Create pear package
* Feature #1926: Symfony integration
* Feature #591: Implement BGREWRITEAOF
* Feature #594: Implement ZINCRBY
* Feature #802: Implement ZREMRANGEBYSCORE
* Feature #803: Implement slaveof no one
* Feature #902: Add README and CHANGELOG
* Improvement #760: Optimize consistent hashing
* Improvement #763: Move to stream_socket_client
* Improvement #797: Add timeout for connection
* Improvement #582: Specify connection alias for key objects
* Improvement #640: Add with scores to ZRANGE
* Improvement #675: Throw exceptions if empty arguments
* Improvement #835: On method can get connection object
* Improvement #581: Add multiple values to set and list by pipeline
* Improvement #595: Add getScoreFromSortedSet to sorted set object
* Improvement #765: New test suite
* Improvement #794: Add EXPIREAT
* Bug #641: Broken RPOPLPUSH command
* Bug #648: Add increment and decrement to rediska key wrapper
* Bug #669: Create exception if connection not found
* Bug #670: Warning: Invalid argument supplied for foreach() in .../library/Rediska/Command/Abstract.php on line 128 (111)
* Bug #813: Quit must disconnect connections
* Bug #825: Save Handler throw exception on Rediska options

Version 0.3.0
---
January 22, 2010

* Feature #355: Alias for servers
* Feature #356: Operate with keys on specified (by alias) server
* Feature #471: Documentation
* Feature #472: Pipeline
* Improvement #520: Refactor commands
* Improvement #521: Support Redis 1.2 API
* Improvement #522: Lazy loading command classes
* Bug #524: Messages count return queues count
* Bug #559: Select specified db after connect

Version 0.2.2
---
November 27, 2009

* Feature #577: Persistent connection
* Feature #578: Move to BSD license

Version 0.2.1
---
November 25, 2009

* Feature #363: Writer for Zend_Log
* Feature #364: Adapter for Zend_Queue
123 changes: 123 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
Rediska (radish on russian) - PHP client for Redis.
============

Redis is an advanced fast key-value database written in C. It can be used like memcached, in front of a traditional database, or on its own thanks to the fact that the in-memory datasets are not volatile but instead persisted on disk. One of the cool features is that you can store not only strings, but lists and sets with atomic operations to push/pop elements.

More information and documentation on homepage: [http://rediska.geometria-lab.net](http://rediska.geometria-lab.net)

Features
---

* Multiple servers support
* Consistent hashing, crc32 or you personal algorythm for key distribution
* Working with keys as objects
* Use Lists, Sets, Sorted sets and Hashes as native PHP arrays
* Transactions
* Publish/Subscribe
* Profiler
* Pipelining
* Easy extending Rediska by adding you own commands or overwrite standart
* [Zend Framework](http://framework.zend.com/) integration
* [Syfmony](http://www.symfony-project.org/) framework integration
* Full [documentation](http://rediska.geometria-lab.ru/documentation)
* Example application
* [PHPUnit](http://phpunit.de/) tests

Coming soon
---

* PHP extension
* Cloud key distribution
* Ketama (fast C library for key distribution) support
* Benchmarks and performance optimization

Get started!
---

1. **Get Rediska**

You can install Rediska from PEAR, download zip archive or get from git repository.

1.1. **Install from PEAR**

For begining you need to discover our PEAR channel:

`pear channel-discover pear.geometria-lab.net`

And install package:

`pear install geometria-lab/Rediska-beta`

1.2. **Download or get from repository**

[Download zip archive](http://rediska.geometria-lab.net/download/latest) with latest version or get last **unstable** version from git repository:

`git clone http://github.com/shumkov/rediska.git`

For adding Rediska to your applcation you need copy Rediska from library folder to you application library folder

* [Add Rediska to your Zend Framework application](http://rediska.geometria-lab.net/documentation/integration-with-frameworks/zend-framework/configuration-and-bootstraping)

* [Add Rediska plugin to your Symfony application](http://rediska.geometria-lab.net/documentation/integration-with-frameworks/symfony)


2. **Configure Rediska**

<?php

$options = array(
'namespace' => 'Application_',
'servers' => array(
array('host' => '127.0.0.1', 'port' => 6379),
array('host' => '127.0.0.1', 'port' => 6380)
)
);

require_once 'Rediska.php';
$rediska = new Rediska($options);

?>

[All configuration options](http://rediska.geometria-lab.net/documentation/configuration).

3. **Use Rediska**

<?php

// Set 'value' to key 'keyName'
$key = new Rediska_Key('keyName');
$key->setValue('value');

?>

* [Full usage documentation](http://rediska.geometria-lab.net/documentation/usage)
* Using Rediska with frameworks:
* [Zend Framework](http://rediska.geometria-lab.net/documentation/integration-with-frameworks/zend-framework)
* [Symfony](http://rediska.geometria-lab.net/documentation/integration-with-frameworks/symfony)


Project structure
---

* __CHANGELOG.txt__ - Histroy of Rediska
* __README.txt__ - This document
* __VERSION.txt__ - Current version of Rediska
* __benchmarks/__ - Rediska benchmarks. In progress...
* __examples/__ - Rediska expamples
* __library/__ - Rediska library. Put files from library to you include_path and use: `require_once "Rediska.php"`
* __package.xml__ - Install Rediska to PHP library dir: `pear install package.xml`. Now use Rediska is easy (without `include_path` configuration): `require_once "Rediska.php"`
* __scripts/__ - Maintenance scripts
* __tests/__ - PHPUnit tests. Use `phpunit` console command or right click on bootstrap.php and `Run As -> PHPUnit Test` in Zend Studio

Contributions
---

Rediska is an open source project: you can participate in development or become an author of integration module for your favorite framework.

Authors:
---

* [Ivan Shumkov](mailto:ivan@shumkov.ru)
* [Maxim Ivanov](mailto:maximiv@gmail.com)
* [Ryan Grenz](mailto:info@ryangrenz.com) (Symfony integration)
* [Till Klampaeckel](mailto:till@php.net) (PEAR package)
10 changes: 5 additions & 5 deletions library/Rediska/Command/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ abstract class Rediska_Command_Abstract implements Rediska_Command_Interface
*
* @var unknown_type
*/
protected $_isWrited = false;
protected $_isWritten = false;

/**
* Is queued to transaction
Expand Down Expand Up @@ -135,7 +135,7 @@ public function write()
$exec->write();
}

$this->_isWrited = true;
$this->_isWritten = true;

return true;
}
Expand All @@ -149,7 +149,7 @@ public function read()
{
$responses = array();

if (!$this->_isWrited) {
if (!$this->_isWritten) {
throw new Rediska_Command_Exception('You need write before');
}

Expand All @@ -162,7 +162,7 @@ public function read()

return true;
} else {
$this->_isWrited = false;
$this->_isWritten = false;
return $this->parseResponses($responses);
}
}
Expand Down Expand Up @@ -411,4 +411,4 @@ protected function _throwExceptionIfNotSupported($version = null)
throw new Rediska_Command_Exception("Command '{$this->_name}' requires {$version}+ version of Redis server. Current version is {$redisVersion}. To change it specify 'redisVersion' option.");
}
}
}
}
Loading

0 comments on commit 3136426

Please sign in to comment.