_id
stringlengths
2
7
title
stringlengths
3
151
partition
stringclasses
3 values
text
stringlengths
83
13k
language
stringclasses
1 value
meta_information
dict
q257400
SEOEditorAdmin.removeEmptyAttributes
test
private function removeEmptyAttributes(SS_List $list, $type) { $pageAttributes = $list->map('ID', $type)->toArray(); $emptyAttributess = array_map(function ($value) { return $value == ''; }, $pageAttributes); if (!count($emptyAttributess)) { return $list; ...
php
{ "resource": "" }
q257401
SEOEditorCSVLoader.processRecord
test
public function processRecord($record, $columnMap, &$results, $preview = false) { $page = $this->findExistingObject($record, $columnMap); if (!$page || !$page->exists()) { return false; } foreach ($record as $fieldName => $val) { if ($fieldName == 'MetaTitle...
php
{ "resource": "" }
q257402
Authorize.handle
test
public function handle($request, $next) { return resolve(AllReleases::class)->authorize($request) ? $next($request) : abort(403); }
php
{ "resource": "" }
q257403
Rediska_Profiler_Profile.getElapsedTime
test
public function getElapsedTime($decimals = null) { if (!$this->hasStopped()) { return false; } $elapsedTime = $this->_stopTime - $this->_startTime; if ($decimals) { return number_format($elapsedTime, $decimals); } else { return $elapsedTi...
php
{ "resource": "" }
q257404
Rediska_Command_Abstract.read
test
public function read() { $responses = array(); if (!$this->_isWritten) { throw new Rediska_Command_Exception('You need write before'); } foreach ($this->_execs as $exec) { $responses[] = $exec->read(); } if (isset($responses[0]) && $response...
php
{ "resource": "" }
q257405
Rediska_Command_Abstract._argumentsToString
test
protected function _argumentsToString($arguments) { $strings = array(); foreach($arguments as $name => $value) { $key = !is_integer($name) ? "'$name' => " : ''; if (is_object($value)) { $argument = get_class($value) . ' $' . $name; } else if (is_n...
php
{ "resource": "" }
q257406
Rediska_Command_Abstract._getAndValidateArguments
test
protected function _getAndValidateArguments($arguments) { $className = get_class($this); if (!isset(self::$_argumentNames[$className])) { $reflection = new ReflectionMethod($this, 'create'); self::$_argumentNames[$className] = array(); foreach($reflection->getPara...
php
{ "resource": "" }
q257407
Rediska_Command_Abstract._throwExceptionIfNotSupported
test
protected function _throwExceptionIfNotSupported($version = null) { if (null === $version) { $version = $this->_version; } $redisVersion = $this->_rediska->getOption('redisVersion'); if (version_compare($version, $redisVersion) == 1) { throw new Rediska_Comm...
php
{ "resource": "" }
q257408
Rediska_Autoloader.register
test
public static function register($prepend = false) { if (self::isRegistered()) { return false; } if (!is_bool($prepend)) { $prepend = (bool) $prepend; } if (version_compare(PHP_VERSION, '5.3.0', '<')) { self::$_isRegistered = spl_autoload_r...
php
{ "resource": "" }
q257409
Rediska_Autoloader.unregister
test
public static function unregister() { if (!self::isRegistered()) { return false; } self::$_isRegistered = !spl_autoload_unregister(self::$_callback); return self::$_isRegistered; }
php
{ "resource": "" }
q257410
Rediska_Autoloader.getRediskaPath
test
public static function getRediskaPath() { if (!self::$_rediskaPath) { self::$_rediskaPath = realpath(dirname(__FILE__) . '/..'); } return self::$_rediskaPath; }
php
{ "resource": "" }
q257411
Rediska_KeyDistributor_ConsistentHashing.getConnectionsByKeyName
test
public function getConnectionsByKeyName($name, $count) { // If we have only one backend, return it. if ($this->_backendsCount == 1) { return array_keys($this->_backends); } if (!$this->_hashringIsInitialized) { $this->_initializeHashring(); $this-...
php
{ "resource": "" }
q257412
Rediska_PubSub_Connections.getConnectionByChannelName
test
public function getConnectionByChannelName($name) { // Get connection if ($this->_specifiedConnection) { $connection = $this->_specifiedConnection; } else { $connection = $this->_channel->getRediska()->getConnectionByKeyName($name); } if (!array_key_e...
php
{ "resource": "" }
q257413
Rediska_PubSub_Connections.getChannelsByConnection
test
public function getChannelsByConnection(Rediska_Connection $connection) { if (!isset($this->_channelsByConnections[$connection->getAlias()])) { throw new Rediska_PubSub_Exception("Channels by this connection not present"); } return $this->_channelsByConnections[$connection->getA...
php
{ "resource": "" }
q257414
Rediska_Config.get
test
public function get($nameOrPattern) { $configGet = new Rediska_Connection_Exec($this->_connection, array('CONFIG', 'GET', $nameOrPattern)); $valuesAfterNames = $configGet->execute(); if (preg_match('/\W/i', $nameOrPattern)) { // Pattern $isParameter = true; $namesAnd...
php
{ "resource": "" }
q257415
Rediska_Config.set
test
public function set($name, $value) { $exec = new Rediska_Connection_Exec($this->_connection, array('CONFIG', 'SET', $name, $value)); $exec->execute(); return $this; }
php
{ "resource": "" }
q257416
Rediska_Config._throwIfNotSupported
test
protected function _throwIfNotSupported() { $version = '2.0'; $redisVersion = $this->_rediska->getOption('redisVersion'); if (version_compare($version, $this->_rediska->getOption('redisVersion')) == 1) { throw new Rediska_Transaction_Exception("Transaction requires {$version}+ ve...
php
{ "resource": "" }
q257417
Rediska_Zend_Queue_Adapter_Redis.create
test
public function create($name, $timeout = null) { $this->_queues->add($name); $this->_queueObjects[$name] = new Rediska_Key_List($this->_getKeyName("queue_$name"), array('rediska' => $this->_rediska)); return true; }
php
{ "resource": "" }
q257418
Rediska_Zend_Queue_Adapter_Redis.delete
test
public function delete($name) { if ($this->_queues->remove($name)) { if (isset($this->_queueObjects[$name])) { unset($this->_queueObjects[$name]); } return $this->_rediska->delete($this->_getKeyName("queue_$name")); } }
php
{ "resource": "" }
q257419
Rediska_Zend_Queue_Adapter_Redis.count
test
public function count(Zend_Queue $queue=null) { if ($queue === null) { $queue = $this->_queue; } $queueName = $queue->getName(); if (!$this->isExists($queueName)) { require_once 'Zend/Queue/Exception.php'; throw new Zend_Queue_Exception('Queue do...
php
{ "resource": "" }
q257420
Rediska_Zend_Queue_Adapter_Redis.send
test
public function send($message, Zend_Queue $queue=null) { if ($queue === null) { $queue = $this->_queue; } $queueName = $queue->getName(); if (!$this->isExists($queueName)) { require_once 'Zend/Queue/Exception.php'; throw new Zend_Queue_Exception(...
php
{ "resource": "" }
q257421
Rediska_Zend_Queue_Adapter_Redis.receive
test
public function receive($maxMessages=null, $timeout=null, Zend_Queue $queue=null) { if ($maxMessages === null) { $maxMessages = 1; } if ($queue === null) { $queue = $this->_queue; } $queueName = $queue->getName(); if (!$this->isExists($queueN...
php
{ "resource": "" }
q257422
Rediska_Zend_Queue_Adapter_Redis.deleteMessage
test
public function deleteMessage(Zend_Queue_Message $message) { $queueName = $this->_queue->getName(); if (!isset($this->_queueObjects[$queueName])) { $this->_queueObjects[$queueName] = new Rediska_Key_List($this->_getKeyName("queue_$queueName"), array('rediska' => $this->_rediska)); ...
php
{ "resource": "" }
q257423
Rediska_Profiler.getTotalElapsedTime
test
public function getTotalElapsedTime($decimals = null) { $totalElapsedTime = 0; foreach ($this->getProfiles() as $profile) { if ($profile->hasStopped()) { $totalElapsedTime += $profile->getElapsedTime(); } } if ($decimals) { return ...
php
{ "resource": "" }
q257424
Rediska_Key_Hash.set
test
public function set($fieldOrData, $value = null, $overwrite = true) { $result = $this->_getRediskaOn()->setToHash($this->getName(), $fieldOrData, $value, $overwrite); if (!is_null($this->getExpire()) && ((!$overwrite && $result) || ($overwrite))) { $this->expire($this->getExpire(), $thi...
php
{ "resource": "" }
q257425
Rediska_Key_Hash.offsetSet
test
public function offsetSet($field, $value) { if (is_null($field)) { throw new Rediska_Key_Exception('Field must be present'); } $this->set($field, $value); return $value; }
php
{ "resource": "" }
q257426
Rediska_Key_Hash.increment
test
public function increment($field, $amount = 1) { $result = $this->_getRediskaOn()->incrementInHash($this->getName(), $field, $amount); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257427
Rediska_Key_Hash.remove
test
public function remove($field) { $result = $this->_getRediskaOn()->deleteFromHash($this->getName(), $field); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257428
Rediska_Zend_Session_SaveHandler_Redis.write
test
public function write($id, $data) { try { $timestamp = time(); $this->_set[$timestamp] = $id; } catch (Rediska_Connection_Exec_Exception $e) { $this->_deleteSetOrThrowException($e); } return $this->getRediska()->setAndExpire( $this->_g...
php
{ "resource": "" }
q257429
Rediska_PubSub_Channel.subscribe
test
public function subscribe($channelOrChannels) { if (!is_array($channelOrChannels)) { $channels = array($channelOrChannels); } else { $channels = $channelOrChannels; } $this->_execCommand(self::SUBSCRIBE, $channels); return $this; }
php
{ "resource": "" }
q257430
Rediska_PubSub_Channel.publish
test
public function publish($message) { $rediska = $this->getRediska(); if ($this->getServerAlias() !== null) { $rediska = $rediska->on($this->getServerAlias()); } return $rediska->publish($this->_subscriptions, $message); }
php
{ "resource": "" }
q257431
Rediska_PubSub_Channel._addMessageToBuffer
test
protected function _addMessageToBuffer(Rediska_PubSub_Response_Message $message) { $key = "{$message->getConnection()->getAlias()}-{$message->getChannel()}"; if (!isset(self::$_messages[$key])) { self::$_messages[$key] = array(); } self::$_messages[$key][] = $message; ...
php
{ "resource": "" }
q257432
Rediska_PubSub_Channel._throwIfNotSupported
test
protected function _throwIfNotSupported() { $version = '1.3.8'; $redisVersion = $this->getRediska()->getOption('redisVersion'); if (version_compare($version, $this->getRediska()->getOption('redisVersion')) == 1) { throw new Rediska_PubSub_Exception("Publish/Subscribe requires {$v...
php
{ "resource": "" }
q257433
Rediska_Serializer_Adapter_PhpSerialize.catchUnserializeNotice
test
public function catchUnserializeNotice($errno, $errstr, $errfile, $errline, $errcontext) { if (!error_reporting() && strpos($errstr, 'unserialize()') !== false) { $this->_unserialized = false; return true; } else { return false; } }
php
{ "resource": "" }
q257434
Rediska_Zend_Queue_Adapter_Redis_Queues.add
test
public function add($name) { $result = $this->_queuesSet->add($name); if ($result) { $queuesCache = $this->_getQueuesCache(); $queuesCache[] = $name; $this->_setQueuesCache($queuesCache); } return $result; }
php
{ "resource": "" }
q257435
Rediska_Zend_Queue_Adapter_Redis_Queues.remove
test
public function remove($name) { $result = $this->_queuesSet->remove($name); if ($result) { $queuesCache = $this->_getQueuesCache(); $key = array_search($name, $queuesCache); unset($queuesCache[$key]); $this->_setQueuesCache($queuesCache); } ...
php
{ "resource": "" }
q257436
Rediska_Zend_Queue_Adapter_Redis_Queues._getQueuesCache
test
protected function _getQueuesCache() { if ($this->_queuesCache === null) { $this->_queuesCache = $this->_queuesSet->toArray(); } return $this->_queuesCache; }
php
{ "resource": "" }
q257437
Rediska_Transaction.watch
test
public function watch($keyOrKeys) { $this->_throwIfNotSupported('Watch', '2.1'); $command = array('WATCH'); if (!is_array($keyOrKeys)) { $keys = array($keyOrKeys); } else { $keys = $keyOrKeys; } foreach($keys as $key) { $command[...
php
{ "resource": "" }
q257438
Rediska_Transaction.unwatch
test
public function unwatch() { $this->_throwIfNotSupported('Unwatch', '2.1'); $command = 'UNWATCH'; $exec = new Rediska_Connection_Exec($this->_connection, $command); $exec->execute(); $this->_isWatched = false; return $this; }
php
{ "resource": "" }
q257439
Rediska_Transaction._addCommand
test
protected function _addCommand($name, $args = array()) { $this->_specifiedConnection->setConnection($this->_connection); $command = Rediska_Commands::get($this->_rediska, $name, $args); $command->initialize(); if (!$command->isAtomic()) { throw new Rediska_Exception("Co...
php
{ "resource": "" }
q257440
PostController.newAction
test
public function newAction() { $currentUser = Zend_Auth::getInstance()->getStorage()->read(); $form = new Form_Post; if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) { $postData = $form->getValues(); $p...
php
{ "resource": "" }
q257441
PostController.indexAction
test
public function indexAction() { $currentUser = Zend_Auth::getInstance()->getStorage()->read(); $feed = new Feed($currentUser['id']); $this->view->posts = array(); // just for example, better use multiget foreach ($feed as $postId) { $pos...
php
{ "resource": "" }
q257442
Rediska_Zend_Log_Writer_Redis.factory
test
static public function factory($config) { $config = self::_parseConfig($config); if (!isset($config['keyName'])) { throw new Zend_Log_Exception('keyName not present'); } if (!isset($config['rediska'])) { $config['rediska'] = Rediska::DEFAULT_NAME; ...
php
{ "resource": "" }
q257443
Rediska_Key_SortedSet.add
test
public function add($value, $score) { $result = $this->_getRediskaOn()->addToSortedSet($this->getName(), $value, $score); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257444
Rediska_Key_SortedSet.getLengthByScore
test
public function getLengthByScore($min, $max) { return $this->_getRediskaOn()->getSortedSetLengthByScore($this->getName(), $min, $max); }
php
{ "resource": "" }
q257445
Rediska_Key_SortedSet.getByScore
test
public function getByScore($min, $max, $withScores = false, $limit = null, $offset = null, $revert = false) { return $this->_getRediskaOn()->getFromSortedSetByScore($this->getName(), $min, $max, $withScores, $limit, $offset, $revert); }
php
{ "resource": "" }
q257446
Rediska_Key_SortedSet.removeByScore
test
public function removeByScore($min, $max) { return $this->_getRediskaOn()->DeleteFromSortedSetByScore($this->getName(), $min, $max); }
php
{ "resource": "" }
q257447
Rediska_Key_SortedSet.incrementScore
test
public function incrementScore($value, $score) { return $this->_getRediskaOn()->incrementScoreInSortedSet($this->getName(), $value, $score); }
php
{ "resource": "" }
q257448
Rediska_Key_SortedSet.getByRank
test
public function getByRank($withScores = false, $start = 0, $end = -1, $revert = false, $responseIterator = false) { return $this->_getRediskaOn()->getSortedSet($this->getName(), $withScores, $start, $end, $revert, $responseIterator); }
php
{ "resource": "" }
q257449
Rediska_Key_SortedSet.removeByRank
test
public function removeByRank($start, $end) { return $this->_getRediskaOn()->deleteFromSortedSetByRank($this->getName(), $start, $end); }
php
{ "resource": "" }
q257450
Rediska_Key_SortedSet.getRank
test
public function getRank($value, $revert = false) { return $this->_getRediskaOn()->getRankFromSortedSet($this->getName(), $value, $revert); }
php
{ "resource": "" }
q257451
Rediska_Key_SortedSet.union
test
public function union($setOrSets, $storeKeyName, $aggregation = 'sum') { $sets = $this->_prepareSetsForComapre($setOrSets); return $this->_getRediskaOn()->unionSortedSets($sets, $storeKeyName, $aggregation); }
php
{ "resource": "" }
q257452
Rediska_Key_SortedSet.intersect
test
public function intersect($setOrSets, $storeKeyName, $aggregation = 'sum') { $sets = $this->_prepareSetsForComapre($setOrSets); return $this->_getRediskaOn()->intersectSortedSets($sets, $storeKeyName, $aggregation); }
php
{ "resource": "" }
q257453
Rediska_Key_SortedSet.toArray
test
public function toArray($withScores = false, $start = 0, $end = -1, $revert = false, $responseIterator = false) { return $this->getByRank($withScores, $start, $end, $revert, $responseIterator); }
php
{ "resource": "" }
q257454
Rediska_Key_SortedSet.fromArray
test
public function fromArray(array $array) { $pipeline = $this->_getRediskaOn()->pipeline(); foreach($array as $score => $value) { $pipeline->addToSortedSet($this->getName(), $value, $score); } if (!is_null($this->getExpire())) { $pipeline->expire($this->getNam...
php
{ "resource": "" }
q257455
Rediska.setName
test
public function setName($name) { $this->_options['name'] = $name; if ($this->_options['addToManager']) { Rediska_Manager::add($this); } return $this; }
php
{ "resource": "" }
q257456
Rediska.getConnectionByKeyName
test
public function getConnectionByKeyName($name) { if ($this->_specifiedConnection->getConnection()) { $connection = $this->_specifiedConnection->getConnection(); } elseif (count($this->_connections) == 1) { $connections = array_values($this->_connections); $connecti...
php
{ "resource": "" }
q257457
Rediska.getConnections
test
public function getConnections() { if ($this->_specifiedConnection->getConnection()) { return array($this->_specifiedConnection->getConnection()); } else { return array_values($this->_connections); } }
php
{ "resource": "" }
q257458
Rediska.on
test
public function on($aliasOrConnection) { if ($aliasOrConnection instanceof Rediska_Connection) { $connection = $aliasOrConnection; } else { $alias = $aliasOrConnection; $connection = $this->getConnectionByAlias($alias); } $this->_specifiedConnecti...
php
{ "resource": "" }
q257459
Rediska.subscribe
test
public function subscribe($channelOrChannels, $timeout = null) { return new Rediska_PubSub_Channel($channelOrChannels, array( 'rediska' => $this, 'timeout' => $timeout, 'serverAlias' => $this->_specifiedConnection->getConnection() )); }
php
{ "resource": "" }
q257460
Rediska.config
test
public function config($aliasOrConnection = null) { if ($aliasOrConnection instanceof Rediska_Connection) { $connection = $aliasOrConnection; } elseif ($aliasOrConnection !== null) { $connection = $this->getConnectionByAlias($aliasOrConnection); } elseif ($this->_spec...
php
{ "resource": "" }
q257461
Rediska.setKeyDistributor
test
public function setKeyDistributor($name) { $this->_options['keyDistributor'] = $name; if (is_object($name)) { $this->_keyDistributor = $name; } else if (in_array($name, array('crc32', 'consistentHashing'))) { $name = ucfirst($name); $className = "Rediska_...
php
{ "resource": "" }
q257462
Rediska.getSerializer
test
public function getSerializer() { if ($this->_serializer === null) { $this->_serializer = new Rediska_Serializer($this->_options['serializerAdapter']); } return $this->_serializer; }
php
{ "resource": "" }
q257463
Rediska_Commands.get
test
public static function get(Rediska $rediska, $name, $arguments) { $lowerName = self::_getCommandLowerNameAndThrowIfNotPresent($name); return new self::$_commands[$lowerName]($rediska, $name, $arguments); }
php
{ "resource": "" }
q257464
Rediska_Commands._getCommandLowerNameAndThrowIfNotPresent
test
protected static function _getCommandLowerNameAndThrowIfNotPresent($name) { $lowerName = strtolower($name); if (!isset(self::$_commands[$lowerName])) { throw new Rediska_Exception("Command '$name' not found"); } return $lowerName; }
php
{ "resource": "" }
q257465
Rediska_Pipeline.execute
test
public function execute() { $results = array(); if (!empty($this->_commands)) { $this->_rediska->getProfiler()->start($this); foreach($this->_commands as $command) { $command->write(); } foreach($this->_commands as $command) { ...
php
{ "resource": "" }
q257466
Rediska_Pipeline._addCommand
test
protected function _addCommand($name, $args = array()) { if ($this->_oneTimeConnection) { $connection = $this->_oneTimeConnection; $this->_oneTimeConnection = null; } else { $connection = $this->_defaultConnection; } if ($connection !== null) { ...
php
{ "resource": "" }
q257467
Rediska_Connection_Exec.write
test
public function write() { $result = $this->getConnection()->write($this->getCommand()); $this->_isWritten = true; return $result; }
php
{ "resource": "" }
q257468
Rediska_Connection_Exec.setResponseCallback
test
public function setResponseCallback($callback) { if ($callback !== null && !is_callable($callback)) { throw new Rediska_Connection_Exec_Exception('Bad callback'); } $this->_responseCallback = $callback; return $this; }
php
{ "resource": "" }
q257469
Rediska_Connection_Exec.transformMultiBulkCommand
test
public static function transformMultiBulkCommand(array $command) { $commandString = self::REPLY_MULTY_BULK . count($command) . Rediska::EOL; foreach($command as $argument) { $commandString .= self::REPLY_BULK . strlen($argument) . Rediska::EOL . $argument . Rediska::EOL; } ...
php
{ "resource": "" }
q257470
Rediska_Key_List.append
test
public function append($value, $createIfNotExists = true) { $result = $this->_getRediskaOn()->appendToList($this->getName(), $value, $createIfNotExists); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } retu...
php
{ "resource": "" }
q257471
Rediska_Key_List.prepend
test
public function prepend($value, $createIfNotExists = true) { $result = $this->_getRediskaOn()->prependToList($this->getName(), $value, $createIfNotExists); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } re...
php
{ "resource": "" }
q257472
Rediska_Key_List.truncate
test
public function truncate($start, $end) { $result = $this->_getRediskaOn()->truncateList($this->getName(), $start, $end); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257473
Rediska_Key_List.set
test
public function set($index, $value) { $result = $this->_getRediskaOn()->setToList($this->getName(), $index, $value); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257474
Rediska_Key_List.insertAfter
test
public function insertAfter($referenceValue, $value) { return $this->_getRediskaOn()->insertToListAfter($this->getName(), $referenceValue, $value); }
php
{ "resource": "" }
q257475
Rediska_Key_List.insertBefore
test
public function insertBefore($referenceValue, $value) { return $this->_getRediskaOn()->insertToListBefore($this->getName(), $referenceValue, $value); }
php
{ "resource": "" }
q257476
Rediska_Key_List.insert
test
public function insert($position, $referenceValue, $value) { return $this->_getRediskaOn()->insertToList($this->getName(), $position, $referenceValue, $value); }
php
{ "resource": "" }
q257477
Rediska_Key_List.remove
test
public function remove($value, $count = 0) { $result = $this->_getRediskaOn()->deleteFromList($this->getName(), $value, $count); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257478
Rediska_Key_List.shift
test
public function shift() { $result = $this->_getRediskaOn()->shiftFromList($this->getName()); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257479
Rediska_Key_List.shiftBlocking
test
public function shiftBlocking($timeout = 0) { $result = $this->_getRediskaOn()->shiftFromListBlocking($this->getName(), $timeout); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257480
Rediska_Key_List.pop
test
public function pop($pushTo = null) { if ($pushTo instanceof Rediska_Key_List) { $pushTo = $pushTo->getName(); } $result = $this->_getRediskaOn()->popFromList($this->getName(), $pushTo); if (!is_null($this->getExpire()) && $result) { $this->expire($this->get...
php
{ "resource": "" }
q257481
Rediska_Key_List.popBlocking
test
public function popBlocking($timeout = 0, $pushToKey = null) { $result = $this->_getRediskaOn()->popFromListBlocking($this->getName(), $timeout, $pushToKey); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } ...
php
{ "resource": "" }
q257482
Rediska_Key_List.fromArray
test
public function fromArray(array $array) { $pipeline = $this->_getRediskaOn()->pipeline(); foreach($array as $item) { $pipeline->appendToList($this->getName(), $item); } if (!is_null($this->getExpire())) { $pipeline->expire($this->getName(), $this->getExpire()...
php
{ "resource": "" }
q257483
Rediska_Zend_Cache_Backend_Redis.load
test
public function load($id, $doNotTestCacheValidity = false) { $id = (array) $id; foreach ($id as $key){ $key = $this->_options['storage']['prefix_key'] . $key; $this->_getTransactionByKey($key) ->getFromHash( $key, self::...
php
{ "resource": "" }
q257484
Rediska_Zend_Cache_Backend_Redis.save
test
public function save($data, $id, $tags = array(), $specificLifetime = false) { if(!is_array($tags)) $tags = array($tags); $lifetime = $this->getLifetime($specificLifetime); $oldTags = explode( ',', $this->getRediska()->getFromHash( $this->_options['storage']['pr...
php
{ "resource": "" }
q257485
Rediska_Zend_Cache_Backend_Redis.remove
test
public function remove($id) { $tags = explode( ',', $this->getRediska()->getFromHash( $this->_options['storage']['prefix_key'].$id, self::FIELD_TAGS ) ); $this->_getTransactionByKey($this->_options['storage']['prefix_key'].$id) ->delete($t...
php
{ "resource": "" }
q257486
Rediska_Zend_Cache_Backend_Redis.clean
test
public function clean($mode = Zend_Cache::CLEANING_MODE_ALL, $tags = array()) { if( $tags && ! is_array($tags)) { $tags = array($tags); } $result = true; switch ($mode) { case Zend_Cache::CLEANING_MODE_ALL: $this->_removeIds($this->getIds()); ...
php
{ "resource": "" }
q257487
Rediska_Zend_Cache_Backend_Redis.setDirectives
test
public function setDirectives($directives) { parent::setDirectives($directives); $lifetime = $this->getLifetime(false); if ($lifetime > self::MAX_LIFETIME) { $this->_log( 'redis backend has a limit of 30 days (' . self::MAX_LIFETIME . ' seconds) fo...
php
{ "resource": "" }
q257488
Rediska_Zend_Cache_Backend_Redis.getIdsNotMatchingTags
test
public function getIdsNotMatchingTags($tags = array()) { $sets = $this->_preprocessTagIds($tags); array_unshift($sets, $this->_options['storage']['set_ids']); $data = $this->getRediska()->diffSets($sets); return $data; }
php
{ "resource": "" }
q257489
Rediska_Zend_Cache_Backend_Redis.getMetadatas
test
public function getMetadatas($id) { $metaData = $this->getRediska()->getFromHash( $this->_options['storage']['prefix_key'].$id, array(self::FIELD_DATA, self::FIELD_TAGS, self::FIELD_MTIME, self::FIELD_INF) ); if(!$metaData[self::FIELD_MTIME]) { return false;...
php
{ "resource": "" }
q257490
Rediska_Zend_Cache_Backend_Redis._collectGarbage
test
protected function _collectGarbage() { $exists = array(); $tags = $this->getTags(); foreach($tags as $tag){ $prefix_tag_ids = $this->_options['storage']['prefix_tag_ids'] . $tag; $tagMembers = $this->getRediska()->getSet($prefix_tag_ids); $this->_getTransa...
php
{ "resource": "" }
q257491
Rediska_Key_Set.add
test
public function add($value) { $result = $this->_getRediskaOn()->addToSet($this->getName(), $value); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257492
Rediska_Key_Set.remove
test
public function remove($value) { $result = $this->_getRediskaOn()->deleteFromSet($this->getName(), $value); if (!is_null($this->getExpire()) && $result) { $this->expire($this->getExpire(), $this->isExpireTimestamp()); } return $result; }
php
{ "resource": "" }
q257493
Rediska_Key_Set.move
test
public function move($set, $value) { if ($set instanceof Rediska_Key_Set) { $set = $set->getName(); } return $this->_getRediskaOn()->moveToSet($this->getName(), $set, $value); }
php
{ "resource": "" }
q257494
Rediska_Key_Set.intersect
test
public function intersect($setOrSets, $storeKeyName = null) { $sets = $this->_prepareSetsForCompare($setOrSets); return $this->_getRediskaOn()->intersectSets($sets, $storeKeyName); }
php
{ "resource": "" }
q257495
Rediska_Key_Set.union
test
public function union($setOrSets, $storeKeyName = null) { $sets = $this->_prepareSetsForCompare($setOrSets); return $this->_getRediskaOn()->unionSets($sets, $storeKeyName); }
php
{ "resource": "" }
q257496
Rediska_Key_Set.diff
test
public function diff($setOrSets, $storeKeyName = null) { $sets = $this->_prepareSetsForCompare($setOrSets); return $this->_getRediskaOn()->diffSets($sets, $storeKeyName); }
php
{ "resource": "" }
q257497
Rediska_Options_RediskaInstance.getRediska
test
public function getRediska() { if (!is_object($this->_rediska)) { $this->_rediska = self::getRediskaInstance($this->_rediska, $this->_optionsException, $this->_rediskaOptionName); } return $this->_rediska; }
php
{ "resource": "" }
q257498
Rediska_Key.setValue
test
public function setValue($value) { if ($this->getExpire() !== null && !$this->isExpireTimestamp()) { $reply = $this->setAndExpire($value, $this->getExpire()); } else { $reply = $this->_getRediskaOn()->set($this->getName(), $value); if ($reply && !is_null($this->g...
php
{ "resource": "" }
q257499
Rediska_Key.setAndExpire
test
public function setAndExpire($value, $seconds) { return $this->_getRediskaOn()->setAndExpire($this->getName(), $value, $seconds); }
php
{ "resource": "" }