From ea6f2d4c5097a0c42d18f89fb0d62e19b79fc5b2 Mon Sep 17 00:00:00 2001 From: Ajoy Date: Wed, 30 Apr 2014 14:59:30 -0700 Subject: [PATCH 1/4] serialize data before storing in backend --- src/DataCacheBehaviorPeerBuilderModifier.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/DataCacheBehaviorPeerBuilderModifier.php b/src/DataCacheBehaviorPeerBuilderModifier.php index d519801..984e681 100644 --- a/src/DataCacheBehaviorPeerBuilderModifier.php +++ b/src/DataCacheBehaviorPeerBuilderModifier.php @@ -70,6 +70,8 @@ public static function cacheFetch(\$key) \$result = \Domino\CacheStore\Factory::factory('{$backend}')->get(self::TABLE_NAME, \$key); if (\$result !== null) { + $unserializedResult = unserialize($result); + $result = ($unserializedResult === FALSE) ? $result : $unserializedResult; if (\$result instanceof ArrayAccess) { foreach (\$result as \$element) { if (\$element instanceof {$objectClassname}) { @@ -93,7 +95,7 @@ protected function addCacheStore(&$script) $script .= " public static function cacheStore(\$key, \$data, \$lifetime) { - return \Domino\CacheStore\Factory::factory('{$backend}')->set(self::TABLE_NAME, \$key, \$data, \$lifetime); + return \Domino\CacheStore\Factory::factory('{$backend}')->set(self::TABLE_NAME, \$key, serialize(\$data), \$lifetime); } "; } From ef4d3ffa96e45e025111bd39163b068d6045bffb Mon Sep 17 00:00:00 2001 From: Ajoy Date: Wed, 30 Apr 2014 15:06:38 -0700 Subject: [PATCH 2/4] trying to create a new package with data serialization functionality --- composer.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index f188f5c..cb9eae7 100644 --- a/composer.json +++ b/composer.json @@ -1,12 +1,11 @@ { - "name": "snakano/propel-data-cache-behavior", - "description": "A Propel ORM behavior that provide auto data caching to your model.", + "name": "beethoven/propel-data-cache-behavior", + "description": "A Propel ORM behavior that provide serialized data caching to your model.", "keywords": ["propel", "behavior", "cache"], "license": "MIT", "authors": [ { - "name": "Shinya Nakano", - "email": "s.nakano@do-mino.jp" + "name": "Ajoy Sojan", } ], "autoload": { From d59adf99f308e7b5ecbe8dacd5800e77a7a6777b Mon Sep 17 00:00:00 2001 From: Ajoy Date: Wed, 30 Apr 2014 15:07:18 -0700 Subject: [PATCH 3/4] remove trailing comma --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cb9eae7..33327aa 100644 --- a/composer.json +++ b/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "authors": [ { - "name": "Ajoy Sojan", + "name": "Ajoy Sojan" } ], "autoload": { From 6ccf4678f2d0e6372ed65da04a5fd9496d43c74e Mon Sep 17 00:00:00 2001 From: Ajoy Date: Wed, 30 Apr 2014 15:49:45 -0700 Subject: [PATCH 4/4] new packagist name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 33327aa..d1d5622 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "beethoven/propel-data-cache-behavior", + "name": "mozart/propel-data-cache-behavior", "description": "A Propel ORM behavior that provide serialized data caching to your model.", "keywords": ["propel", "behavior", "cache"], "license": "MIT",