From 7f1cf35a62d92327f20f7b752e219c50d5fef9a0 Mon Sep 17 00:00:00 2001 From: Tony Piper Date: Mon, 26 Nov 2012 15:23:57 +0000 Subject: [PATCH] implement prefix removel --- lib/Resque/Redis.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/Resque/Redis.php b/lib/Resque/Redis.php index 053f2f9..5e18a01 100644 --- a/lib/Resque/Redis.php +++ b/lib/Resque/Redis.php @@ -113,5 +113,20 @@ class Resque_Redis extends Redisent return false; } } + + public static function getPrefix() + { + return self::$defaultNamespace; + } + + public static function removePrefix($string) + { + $prefix=self::getPrefix(); + + if (substr($string, 0, strlen($prefix)) == $prefix) { + $string = substr($string, strlen($prefix), strlen($string) ); + } + return $string; + } } ?> \ No newline at end of file