Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify Redis Backend #11125

Closed
wants to merge 88 commits into from
Closed
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
31bb51a
column[0] can be undefined
Apr 21, 2015
3db24f3
MySQL has a double type which has a scale
Apr 21, 2015
874c47d
Merge pull request #10119 from masenocturnal/master
andresgutierrez Apr 22, 2015
6c5967f
Fixed checking case insensitive image extensions
agim-a Apr 22, 2015
4739c29
Updated security.zep with fixes and new functionality
agim-a Apr 22, 2015
0529628
Update security.zep
agim-a Apr 22, 2015
9907ca6
Merge pull request #2 from agim-alb/agim-alb-patch-2
agim-a Apr 22, 2015
62754bd
isLegacyHash
agim-a Apr 24, 2015
0622910
Changed strcasecmp to using strtolower. Fixed bug with imagepng for p…
agim-a Apr 24, 2015
f22e54d
Merge pull request #10142 from agim-alb/patch-2
andresgutierrez Apr 24, 2015
501eaf6
Revert "Updated security.zep with fixes and new functionality"
andresgutierrez Apr 24, 2015
e93893f
Merge pull request #10164 from phalcon/revert-10142-patch-2
andresgutierrez Apr 24, 2015
c4a3da5
Merge pull request #10141 from agim-alb/patch-1
andresgutierrez Apr 25, 2015
cd8f5f7
Revert "Fixed checking case insensitive image extensions"
andresgutierrez Apr 25, 2015
95d03ad
Merge pull request #10171 from phalcon/revert-10141-patch-1
andresgutierrez Apr 25, 2015
44da535
Merge branch 'master' into 2.0.x
andresgutierrez May 7, 2015
ad62026
Merge branch '2.0.x'
andresgutierrez May 7, 2015
234dce9
Merge pull request #10247 from phalcon/2.0.x
andresgutierrez May 7, 2015
5508906
Fix "Wrong number of parameters" exception in Phalcon\Mvc\Collection\…
endeveit May 10, 2015
a3db77a
Merge pull request #10308 from endeveit/master
May 10, 2015
70e338f
Revert "[2.0.x] Fix "Wrong number of parameters" collection manager"
andresgutierrez May 10, 2015
df31130
Merge pull request #10309 from phalcon/revert-10308-master
andresgutierrez May 10, 2015
3070344
Merge pull request #10393 from phalcon/2.0.x
andresgutierrez May 25, 2015
c705e11
Merge pull request #10402 from phalcon/2.0.x
andresgutierrez May 26, 2015
c967827
Merge pull request #10488 from phalcon/2.0.x
andresgutierrez Jun 9, 2015
b922cca
Merge pull request #10493 from phalcon/2.0.x
andresgutierrez Jun 9, 2015
a1e0752
Update CHANGELOG.md
niden Jun 10, 2015
f8cb2c1
Merge branch 'master' into 2.0.x
andresgutierrez Jul 6, 2015
e0c2afd
Merge branch '2.0.x'
andresgutierrez Jul 6, 2015
02e7b82
Merge pull request #10599 from phalcon/2.0.x
andresgutierrez Jul 7, 2015
54fa817
Fixed columns merge
andresgutierrez Jul 7, 2015
e69843e
Merge pull request #10600 from phalcon/column-patch-1
andresgutierrez Jul 7, 2015
dc2ab65
Merge pull request #10645 from phalcon/2.0.x
andresgutierrez Jul 14, 2015
b346d3b
Merge pull request #10692 from phalcon/2.0.x
andresgutierrez Jul 21, 2015
442c646
Update CHANGELOG.md
niden Jul 22, 2015
52d7524
Merge branch 'master' into 2.0.x
andresgutierrez Aug 17, 2015
880b4fd
Merge branch '2.0.x'
andresgutierrez Aug 17, 2015
ff17a9c
Merge branch 'master' into 2.0.x
andresgutierrez Sep 25, 2015
c8d4916
Merge branch '2.0.x'
andresgutierrez Sep 25, 2015
e048830
1. Modify cache redis backend, delete _PHCR
pantaovay Nov 11, 2015
da0f96b
Fixed misspelling in doc
sergeyklay Sep 11, 2015
4ea95f2
Update CHANGELOG.md [ci skip]
sergeyklay Sep 13, 2015
05867a0
Added mixed return type Phalcon\Config::get
sergeyklay Sep 20, 2015
7887354
Added mixed return types to Request
sergeyklay Sep 22, 2015
25b79ca
Fix: cookie is allways resent after get.
Sep 24, 2015
179d18b
fix the indentation
Sep 24, 2015
ea8faf9
Update di.zep
sergeyklay Sep 27, 2015
b9e4cf9
Update di.zep
sergeyklay Sep 29, 2015
481f9e5
Fix #10829
dreamsxin Sep 30, 2015
412476e
Fixed logger doc
sergeyklay Sep 30, 2015
ae0fc3b
Update file.zep
sergeyklay Sep 30, 2015
97212f2
Update stream.zep
sergeyklay Sep 30, 2015
4d7fdb2
Update syslog.zep
sergeyklay Sep 30, 2015
1e85cfd
Updating version to 2.0.9, using latest Zephir
andresgutierrez Oct 1, 2015
983eee1
Added console:boot event
sergeyklay Sep 30, 2015
06d6d67
Removes duplicate use statement in router
Green-Cat Oct 6, 2015
5641cb8
Removes duplicate use statement in response
Green-Cat Oct 8, 2015
63e6544
#10992 - Added implementation options "allowEmpty"
KorsaR-ZN Oct 2, 2015
f6f206c
Fixed issue #11014
sergeyklay Oct 9, 2015
dabfb21
Fixed issue #10997
sergeyklay Oct 4, 2015
c2d11bf
Added tests for SQLite indexes
sergeyklay Oct 4, 2015
2a87d21
Updated CHANGELOG [ci skip]
sergeyklay Oct 4, 2015
96c84bb
Escape table & keyName in Sqlite::listIndexesSql
sergeyklay Oct 4, 2015
ff40314
Amended Router Mvc Test
sergeyklay Oct 18, 2015
7f264a7
Small fixes in Sqlite::describeIndexes
sergeyklay Oct 21, 2015
aaf3f55
Fixed issue #11036
sergeyklay Oct 21, 2015
fffbede
Added tests for MySQL indexes
sergeyklay Oct 21, 2015
63d96d4
Updated CHANGELOG
sergeyklay Oct 21, 2015
34e37a4
Fixed typo in Db\Dialect (filed -> field).
SidRoberts Oct 22, 2015
5a28c3e
Removed redundant type-checking code from `Db\Dialect::getSqlExpressi…
SidRoberts Oct 22, 2015
5e14667
Added another example to Mvc\Url::get() (phalcon/docs#432)
SidRoberts Oct 22, 2015
41e88ff
Added stricter type-checking to `Db\Dialect::getSqlExpressionHaving()`.
SidRoberts Oct 22, 2015
924932e
Fixed notice in query builder paginator when totalQuery result is empty
ashpumpkin Oct 22, 2015
b045a1f
Update Phalcon\Queue\Beanstalk\Job doc for getters
sergeyklay Oct 22, 2015
2b38bd5
Added missed RouteInterface::setHostname, RouteInterface::getHostname
sergeyklay Oct 18, 2015
a5cc0dd
Fixed Filter::sanitize return type
sergeyklay Oct 27, 2015
e5162e7
Update filter.zep
sergeyklay Oct 29, 2015
3e834ea
Replaced spaces to tabs
sergeyklay Oct 31, 2015
a43f4cb
Add 'strict' option in ExclusionIn validator
altapo Nov 3, 2015
45949db
Update CHANGELOG.md
altapo Nov 4, 2015
a779fda
Added Text::humanize, Text::underscore
sergeyklay Nov 8, 2015
0ff2b00
Update routeinterface.zep
sergeyklay Nov 8, 2015
0850151
Fixed issue #11109
sergeyklay Nov 9, 2015
04a942a
Fixed Serghei email
sergeyklay Nov 9, 2015
9127811
Fixed issue #11112 [ci skip]
sergeyklay Nov 9, 2015
95d67fb
Fixed issue #11115 [ci skip]
sergeyklay Nov 9, 2015
b40a700
Amended doc for Phalcon\Security\Random [ci skip]
sergeyklay Nov 10, 2015
b4aece6
Merge branch '2.0.x' of https://github.com/pantaovay/cphalcon into 2.0.x
pantaovay Nov 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 25 additions & 19 deletions phalcon/cache/backend/redis.zep
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class Redis extends Backend implements BackendInterface
let options = [];
}

if isset options["redis"] && !empty options["redis"] && typeof options["redis"] == "object" {
let this->_redis = options["redis"];
}

if !isset options["host"] {
let options["host"] = "127.0.0.1";
}
Expand All @@ -87,7 +91,7 @@ class Redis extends Backend implements BackendInterface
let options["persistent"] = false;
}

if !isset options["statsKey"] || empty options["statsKey"] {
if !isset options["statsKey"] {
let options["statsKey"] = "_PHCR";
}

Expand Down Expand Up @@ -156,7 +160,7 @@ class Redis extends Backend implements BackendInterface

let frontend = this->_frontend;
let prefix = this->_prefix;
let lastKey = "_PHCR" . prefix . keyName;
let lastKey = prefix . keyName;
let this->_lastKey = lastKey;
let cachedContent = redis->get(lastKey);

Expand Down Expand Up @@ -186,11 +190,11 @@ class Redis extends Backend implements BackendInterface

if !keyName {
let lastKey = this->_lastKey;
let prefixedKey = substr(lastKey, 5);
let prefixedKey = lastKey;
} else {
let prefix = this->_prefix;
let prefixedKey = prefix . keyName;
let lastKey = "_PHCR" . prefixedKey;
let lastKey = prefixedKey;
}

if !lastKey {
Expand Down Expand Up @@ -247,13 +251,13 @@ class Redis extends Backend implements BackendInterface

let options = this->_options;

if !isset options["statsKey"] {
if !fetch specialKey, options["statsKey"] {
throw new Exception("Unexpected inconsistency in options");
}

let specialKey = options["statsKey"];

redis->sAdd(specialKey, prefixedKey);
if specialKey != "" {
redis->sAdd(specialKey, prefixedKey);
}

let isBuffering = frontend->isBuffering();

Expand Down Expand Up @@ -286,16 +290,16 @@ class Redis extends Backend implements BackendInterface

let prefix = this->_prefix;
let prefixedKey = prefix . keyName;
let lastKey = "_PHCR" . prefixedKey;
let lastKey = prefixedKey;
let options = this->_options;

if !isset options["statsKey"] {
if !fetch specialKey, options["statsKey"] {
throw new Exception("Unexpected inconsistency in options");
}

let specialKey = options["statsKey"];

redis->sRem(specialKey, prefixedKey);
if specialKey != "" {
redis->sRem(specialKey, prefixedKey);
}

/**
* Delete the key from redis
Expand All @@ -322,11 +326,13 @@ class Redis extends Backend implements BackendInterface

let options = this->_options;

if !isset options["statsKey"] {
if !fetch specialKey, options["statsKey"] {
throw new Exception("Unexpected inconsistency in options");
}

let specialKey = options["statsKey"];
if specialKey == "" {
throw new Exception("Cached keys were disabled (options['statsKey'] == ''), you shouldn't use this function");
}

/**
* Get the key from redis
Expand Down Expand Up @@ -358,7 +364,7 @@ class Redis extends Backend implements BackendInterface
let lastKey = this->_lastKey;
} else {
let prefix = this->_prefix;
let lastKey = "_PHCR" . prefix . keyName;
let lastKey = prefix . keyName;
}

if lastKey {
Expand Down Expand Up @@ -399,7 +405,7 @@ class Redis extends Backend implements BackendInterface
let lastKey = this->_lastKey;
} else {
let prefix = this->_prefix;
let lastKey = "_PHCR" . prefix . keyName;
let lastKey = prefix . keyName;
let this->_lastKey = lastKey;
}

Expand Down Expand Up @@ -432,7 +438,7 @@ class Redis extends Backend implements BackendInterface
let lastKey = this->_lastKey;
} else {
let prefix = this->_prefix;
let lastKey = "_PHCR" . prefix . keyName;
let lastKey = prefix . keyName;
let this->_lastKey = lastKey;
}

Expand Down Expand Up @@ -468,7 +474,7 @@ class Redis extends Backend implements BackendInterface
let keys = redis->sMembers(specialKey);
if typeof keys == "array" {
for key in keys {
let lastKey = "_PHCR" . key;
let lastKey = key;
redis->sRem(specialKey, key);
redis->delete(lastKey);
}
Expand Down