├── README.md ├── apache.conf ├── api ├── .gitignore ├── .htaccess ├── bin │ ├── phantomjs │ └── phantomjs-linux ├── config.php ├── constants.php ├── controller │ ├── crawler.controller.php │ └── report.controller.php ├── index.php ├── model │ ├── crawl.model.php │ ├── product.model.php │ ├── report.model.php │ ├── store.model.php │ └── variant.model.php ├── scripts │ ├── jq.js │ ├── shopifyiq.js │ ├── shopifyiq_crawler.js │ ├── shopifyiq_crawler.sh │ ├── shopifyiq_rank.js │ ├── shopifyiq_rank.sh │ ├── shopifyiq_rank_crawler.js │ ├── shopifyiq_store_stats.js │ └── shopifyiq_store_stats.sh └── sql_queries.php ├── dashboard ├── .htaccess ├── config.php ├── constants.php ├── controller │ ├── dashboard.controller.php │ └── login.controller.php ├── index.php ├── model │ └── user.model.php └── view │ ├── assets │ ├── css │ │ └── dashboard.css │ ├── img │ │ ├── android-chrome-192x192.png │ │ ├── android-chrome-384x384.png │ │ ├── apple-touch-icon.png │ │ ├── arrow_down.png │ │ ├── arrow_up.png │ │ ├── browserconfig.xml │ │ ├── chart_icon.png │ │ ├── favicon-16x16.png │ │ ├── favicon-32x32.png │ │ ├── favicon.ico │ │ ├── google_icon.png │ │ ├── green.png │ │ ├── logo.png │ │ ├── manifest.json │ │ ├── mstile-150x150.png │ │ ├── products_icon.png │ │ ├── red.png │ │ ├── safari-pinned-tab.svg │ │ ├── shopify_icon.png │ │ ├── siq_login.gif │ │ ├── siq_main_logo.png │ │ ├── speed_icon.png │ │ ├── tool_tip.png │ │ ├── video.png │ │ └── warning.png │ └── js │ │ ├── Chart.bundle.js │ │ ├── Chart.min.js │ │ ├── loading.js │ │ ├── moment.js │ │ ├── siq_auth.js │ │ ├── siq_config.js │ │ ├── siq_dashboard.js │ │ ├── siq_livespy.js │ │ ├── siq_ranking_global.js │ │ ├── siq_ranking_store.js │ │ ├── siq_sitelist.js │ │ └── utils.js │ ├── dashboard.view.php │ ├── footer.view.php │ ├── header.view.php │ └── login.view.php ├── index.html ├── shared └── lib │ ├── database.class.php │ ├── phpFastCache │ ├── .htaccess │ ├── CacheManager.php │ ├── Core │ │ ├── DriverAbstract.php │ │ ├── DriverInterface.php │ │ ├── phpFastCache.php │ │ └── phpFastCacheExtensions.php │ ├── Drivers │ │ ├── apc.php │ │ ├── cookie.php │ │ ├── example.php │ │ ├── files.php │ │ ├── memcache.php │ │ ├── memcached.php │ │ ├── mongodb.php │ │ ├── predis.php │ │ ├── redis.php │ │ ├── sqlite.php │ │ ├── ssdb.php │ │ ├── wincache.php │ │ └── xcache.php │ ├── Exceptions │ │ ├── phpFastCacheCoreException.php │ │ └── phpFastCacheDriverException.php │ ├── Plugins │ │ └── CronClearFiles.php │ ├── Util │ │ ├── Languages.php │ │ ├── Legacy.php │ │ └── OpenBaseDir.php │ ├── _extensions │ │ ├── SSDB.php │ │ └── predis-1.0 │ │ │ ├── CHANGELOG.md │ │ │ ├── CONTRIBUTING.md │ │ │ ├── FAQ.md │ │ │ ├── LICENSE │ │ │ ├── README.md │ │ │ ├── VERSION │ │ │ ├── autoload.php │ │ │ ├── composer.json │ │ │ ├── examples │ │ │ ├── custom_cluster_distributor.php │ │ │ ├── debuggable_connection.php │ │ │ ├── dispatcher_loop.php │ │ │ ├── executing_redis_commands.php │ │ │ ├── key_prefixing.php │ │ │ ├── lua_scripting_abstraction.php │ │ │ ├── monitor_consumer.php │ │ │ ├── pipelining_commands.php │ │ │ ├── pubsub_consumer.php │ │ │ ├── redis_collections_iterators.php │ │ │ ├── replication_complex.php │ │ │ ├── replication_simple.php │ │ │ ├── session_handler.php │ │ │ ├── shared.php │ │ │ └── transaction_using_cas.php │ │ │ ├── package.ini │ │ │ └── src │ │ │ ├── Autoloader.php │ │ │ ├── Client.php │ │ │ ├── ClientContextInterface.php │ │ │ ├── ClientException.php │ │ │ ├── ClientInterface.php │ │ │ ├── Cluster │ │ │ ├── ClusterStrategy.php │ │ │ ├── Distributor │ │ │ │ ├── DistributorInterface.php │ │ │ │ ├── EmptyRingException.php │ │ │ │ ├── HashRing.php │ │ │ │ └── KetamaRing.php │ │ │ ├── Hash │ │ │ │ ├── CRC16.php │ │ │ │ └── HashGeneratorInterface.php │ │ │ ├── PredisStrategy.php │ │ │ ├── RedisStrategy.php │ │ │ └── StrategyInterface.php │ │ │ ├── Collection │ │ │ └── Iterator │ │ │ │ ├── CursorBasedIterator.php │ │ │ │ ├── HashKey.php │ │ │ │ ├── Keyspace.php │ │ │ │ ├── ListKey.php │ │ │ │ ├── SetKey.php │ │ │ │ └── SortedSetKey.php │ │ │ ├── Command │ │ │ ├── Command.php │ │ │ ├── CommandInterface.php │ │ │ ├── ConnectionAuth.php │ │ │ ├── ConnectionEcho.php │ │ │ ├── ConnectionPing.php │ │ │ ├── ConnectionQuit.php │ │ │ ├── ConnectionSelect.php │ │ │ ├── HashDelete.php │ │ │ ├── HashExists.php │ │ │ ├── HashGet.php │ │ │ ├── HashGetAll.php │ │ │ ├── HashGetMultiple.php │ │ │ ├── HashIncrementBy.php │ │ │ ├── HashIncrementByFloat.php │ │ │ ├── HashKeys.php │ │ │ ├── HashLength.php │ │ │ ├── HashScan.php │ │ │ ├── HashSet.php │ │ │ ├── HashSetMultiple.php │ │ │ ├── HashSetPreserve.php │ │ │ ├── HashValues.php │ │ │ ├── HyperLogLogAdd.php │ │ │ ├── HyperLogLogCount.php │ │ │ ├── HyperLogLogMerge.php │ │ │ ├── KeyDelete.php │ │ │ ├── KeyDump.php │ │ │ ├── KeyExists.php │ │ │ ├── KeyExpire.php │ │ │ ├── KeyExpireAt.php │ │ │ ├── KeyKeys.php │ │ │ ├── KeyMove.php │ │ │ ├── KeyPersist.php │ │ │ ├── KeyPreciseExpire.php │ │ │ ├── KeyPreciseExpireAt.php │ │ │ ├── KeyPreciseTimeToLive.php │ │ │ ├── KeyRandom.php │ │ │ ├── KeyRename.php │ │ │ ├── KeyRenamePreserve.php │ │ │ ├── KeyRestore.php │ │ │ ├── KeyScan.php │ │ │ ├── KeySort.php │ │ │ ├── KeyTimeToLive.php │ │ │ ├── KeyType.php │ │ │ ├── ListIndex.php │ │ │ ├── ListInsert.php │ │ │ ├── ListLength.php │ │ │ ├── ListPopFirst.php │ │ │ ├── ListPopFirstBlocking.php │ │ │ ├── ListPopLast.php │ │ │ ├── ListPopLastBlocking.php │ │ │ ├── ListPopLastPushHead.php │ │ │ ├── ListPopLastPushHeadBlocking.php │ │ │ ├── ListPushHead.php │ │ │ ├── ListPushHeadX.php │ │ │ ├── ListPushTail.php │ │ │ ├── ListPushTailX.php │ │ │ ├── ListRange.php │ │ │ ├── ListRemove.php │ │ │ ├── ListSet.php │ │ │ ├── ListTrim.php │ │ │ ├── PrefixableCommandInterface.php │ │ │ ├── Processor │ │ │ │ ├── KeyPrefixProcessor.php │ │ │ │ ├── ProcessorChain.php │ │ │ │ └── ProcessorInterface.php │ │ │ ├── PubSubPublish.php │ │ │ ├── PubSubPubsub.php │ │ │ ├── PubSubSubscribe.php │ │ │ ├── PubSubSubscribeByPattern.php │ │ │ ├── PubSubUnsubscribe.php │ │ │ ├── PubSubUnsubscribeByPattern.php │ │ │ ├── RawCommand.php │ │ │ ├── ScriptCommand.php │ │ │ ├── ServerBackgroundRewriteAOF.php │ │ │ ├── ServerBackgroundSave.php │ │ │ ├── ServerClient.php │ │ │ ├── ServerCommand.php │ │ │ ├── ServerConfig.php │ │ │ ├── ServerDatabaseSize.php │ │ │ ├── ServerEval.php │ │ │ ├── ServerEvalSHA.php │ │ │ ├── ServerFlushAll.php │ │ │ ├── ServerFlushDatabase.php │ │ │ ├── ServerInfo.php │ │ │ ├── ServerInfoV26x.php │ │ │ ├── ServerLastSave.php │ │ │ ├── ServerMonitor.php │ │ │ ├── ServerObject.php │ │ │ ├── ServerSave.php │ │ │ ├── ServerScript.php │ │ │ ├── ServerSentinel.php │ │ │ ├── ServerShutdown.php │ │ │ ├── ServerSlaveOf.php │ │ │ ├── ServerSlowlog.php │ │ │ ├── ServerTime.php │ │ │ ├── SetAdd.php │ │ │ ├── SetCardinality.php │ │ │ ├── SetDifference.php │ │ │ ├── SetDifferenceStore.php │ │ │ ├── SetIntersection.php │ │ │ ├── SetIntersectionStore.php │ │ │ ├── SetIsMember.php │ │ │ ├── SetMembers.php │ │ │ ├── SetMove.php │ │ │ ├── SetPop.php │ │ │ ├── SetRandomMember.php │ │ │ ├── SetRemove.php │ │ │ ├── SetScan.php │ │ │ ├── SetUnion.php │ │ │ ├── SetUnionStore.php │ │ │ ├── StringAppend.php │ │ │ ├── StringBitCount.php │ │ │ ├── StringBitOp.php │ │ │ ├── StringBitPos.php │ │ │ ├── StringDecrement.php │ │ │ ├── StringDecrementBy.php │ │ │ ├── StringGet.php │ │ │ ├── StringGetBit.php │ │ │ ├── StringGetMultiple.php │ │ │ ├── StringGetRange.php │ │ │ ├── StringGetSet.php │ │ │ ├── StringIncrement.php │ │ │ ├── StringIncrementBy.php │ │ │ ├── StringIncrementByFloat.php │ │ │ ├── StringPreciseSetExpire.php │ │ │ ├── StringSet.php │ │ │ ├── StringSetBit.php │ │ │ ├── StringSetExpire.php │ │ │ ├── StringSetMultiple.php │ │ │ ├── StringSetMultiplePreserve.php │ │ │ ├── StringSetPreserve.php │ │ │ ├── StringSetRange.php │ │ │ ├── StringStrlen.php │ │ │ ├── StringSubstr.php │ │ │ ├── TransactionDiscard.php │ │ │ ├── TransactionExec.php │ │ │ ├── TransactionMulti.php │ │ │ ├── TransactionUnwatch.php │ │ │ ├── TransactionWatch.php │ │ │ ├── ZSetAdd.php │ │ │ ├── ZSetCardinality.php │ │ │ ├── ZSetCount.php │ │ │ ├── ZSetIncrementBy.php │ │ │ ├── ZSetIntersectionStore.php │ │ │ ├── ZSetLexCount.php │ │ │ ├── ZSetRange.php │ │ │ ├── ZSetRangeByLex.php │ │ │ ├── ZSetRangeByScore.php │ │ │ ├── ZSetRank.php │ │ │ ├── ZSetRemove.php │ │ │ ├── ZSetRemoveRangeByLex.php │ │ │ ├── ZSetRemoveRangeByRank.php │ │ │ ├── ZSetRemoveRangeByScore.php │ │ │ ├── ZSetReverseRange.php │ │ │ ├── ZSetReverseRangeByScore.php │ │ │ ├── ZSetReverseRank.php │ │ │ ├── ZSetScan.php │ │ │ ├── ZSetScore.php │ │ │ └── ZSetUnionStore.php │ │ │ ├── CommunicationException.php │ │ │ ├── Configuration │ │ │ ├── ClusterOption.php │ │ │ ├── ConnectionFactoryOption.php │ │ │ ├── ExceptionsOption.php │ │ │ ├── OptionInterface.php │ │ │ ├── Options.php │ │ │ ├── OptionsInterface.php │ │ │ ├── PrefixOption.php │ │ │ ├── ProfileOption.php │ │ │ └── ReplicationOption.php │ │ │ ├── Connection │ │ │ ├── AbstractConnection.php │ │ │ ├── Aggregate │ │ │ │ ├── ClusterInterface.php │ │ │ │ ├── MasterSlaveReplication.php │ │ │ │ ├── PredisCluster.php │ │ │ │ ├── RedisCluster.php │ │ │ │ └── ReplicationInterface.php │ │ │ ├── AggregateConnectionInterface.php │ │ │ ├── CompositeConnectionInterface.php │ │ │ ├── CompositeStreamConnection.php │ │ │ ├── ConnectionException.php │ │ │ ├── ConnectionInterface.php │ │ │ ├── Factory.php │ │ │ ├── FactoryInterface.php │ │ │ ├── NodeConnectionInterface.php │ │ │ ├── Parameters.php │ │ │ ├── ParametersInterface.php │ │ │ ├── PhpiredisSocketConnection.php │ │ │ ├── PhpiredisStreamConnection.php │ │ │ ├── StreamConnection.php │ │ │ └── WebdisConnection.php │ │ │ ├── Monitor │ │ │ └── Consumer.php │ │ │ ├── NotSupportedException.php │ │ │ ├── Pipeline │ │ │ ├── Atomic.php │ │ │ ├── ConnectionErrorProof.php │ │ │ ├── FireAndForget.php │ │ │ └── Pipeline.php │ │ │ ├── PredisException.php │ │ │ ├── Profile │ │ │ ├── Factory.php │ │ │ ├── ProfileInterface.php │ │ │ ├── RedisProfile.php │ │ │ ├── RedisUnstable.php │ │ │ ├── RedisVersion200.php │ │ │ ├── RedisVersion220.php │ │ │ ├── RedisVersion240.php │ │ │ ├── RedisVersion260.php │ │ │ ├── RedisVersion280.php │ │ │ └── RedisVersion300.php │ │ │ ├── Protocol │ │ │ ├── ProtocolException.php │ │ │ ├── ProtocolProcessorInterface.php │ │ │ ├── RequestSerializerInterface.php │ │ │ ├── ResponseReaderInterface.php │ │ │ └── Text │ │ │ │ ├── CompositeProtocolProcessor.php │ │ │ │ ├── Handler │ │ │ │ ├── BulkResponse.php │ │ │ │ ├── ErrorResponse.php │ │ │ │ ├── IntegerResponse.php │ │ │ │ ├── MultiBulkResponse.php │ │ │ │ ├── ResponseHandlerInterface.php │ │ │ │ ├── StatusResponse.php │ │ │ │ └── StreamableMultiBulkResponse.php │ │ │ │ ├── ProtocolProcessor.php │ │ │ │ ├── RequestSerializer.php │ │ │ │ └── ResponseReader.php │ │ │ ├── PubSub │ │ │ ├── AbstractConsumer.php │ │ │ ├── Consumer.php │ │ │ └── DispatcherLoop.php │ │ │ ├── Replication │ │ │ └── ReplicationStrategy.php │ │ │ ├── Response │ │ │ ├── Error.php │ │ │ ├── ErrorInterface.php │ │ │ ├── Iterator │ │ │ │ ├── MultiBulk.php │ │ │ │ ├── MultiBulkIterator.php │ │ │ │ └── MultiBulkTuple.php │ │ │ ├── ResponseInterface.php │ │ │ ├── ServerException.php │ │ │ └── Status.php │ │ │ ├── Session │ │ │ └── Handler.php │ │ │ └── Transaction │ │ │ ├── AbortedMultiExecException.php │ │ │ ├── MultiExec.php │ │ │ └── MultiExecState.php │ ├── index.html │ └── phpFastCache.php │ └── utility.php └── shopifyiq_db.sql /apache.conf: -------------------------------------------------------------------------------- 1 | 2 | ServerName dashboard.shopifyiq 3 | DocumentRoot ##########/Projects/shopifyiq/shopifyiq/src/dashboard 4 | ServerAdmin admin@shopifyiq.com 5 | UseCanonicalName Off 6 | CustomLog ##########/Projects/shopifyiq/shopifyiq/src/api/log/api.shopifyiq.log combined 7 | 8 | 9 | AllowOverride All 10 | Options Indexes FollowSymLinks MultiViews 11 | # AllowOverride None 12 | Order allow,deny 13 | allow from all 14 | 15 | 16 | -------------------------------------------------------------------------------- /api/.gitignore: -------------------------------------------------------------------------------- 1 | logs/ 2 | 3 | -------------------------------------------------------------------------------- /api/.htaccess: -------------------------------------------------------------------------------- 1 | #php_value memory_limit 800M 2 | Options +SymLinksIfOwnerMatch 3 | RewriteEngine On 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteRule . index.php [QSA,L] 7 | 8 | SetOutputFilter DEFLATE 9 | SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip 10 | 11 | 12 | 13 | Header set Access-Control-Allow-Origin "*" 14 | 15 | 16 | -------------------------------------------------------------------------------- /api/bin/phantomjs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/api/bin/phantomjs -------------------------------------------------------------------------------- /api/bin/phantomjs-linux: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/api/bin/phantomjs-linux -------------------------------------------------------------------------------- /api/constants.php: -------------------------------------------------------------------------------- 1 | $store_id == null) 27 | { 28 | throw new Exception('You must specify the model\'s store_id'); 29 | } 30 | 31 | if($store_id == null) $store_id = $this->store_id; 32 | 33 | //Lets fetch the table and load it into the object 34 | 35 | $db_columns = Array( 36 | 37 | ); 38 | 39 | $db_conditions = Array( 40 | 'store_id'=>$store_id 41 | ); 42 | $result = $this->db_retrieve(self::TABLE_NAME,$db_columns,$db_conditions,null,false); 43 | 44 | } 45 | 46 | 47 | } 48 | 49 | -------------------------------------------------------------------------------- /dashboard/.htaccess: -------------------------------------------------------------------------------- 1 | #php_value memory_limit 800M 2 | Options +SymLinksIfOwnerMatch 3 | RewriteEngine On 4 | RewriteCond %{REQUEST_FILENAME} !-f 5 | RewriteCond %{REQUEST_FILENAME} !-d 6 | RewriteRule . index.php [QSA,L] 7 | 8 | SetOutputFilter DEFLATE 9 | SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip 10 | 11 | 12 | 13 | Header set Access-Control-Allow-Origin "*" 14 | 15 | 16 | -------------------------------------------------------------------------------- /dashboard/constants.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /dashboard/view/assets/img/android-chrome-192x192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/android-chrome-192x192.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/android-chrome-384x384.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/android-chrome-384x384.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/apple-touch-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/apple-touch-icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/arrow_down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/arrow_down.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/arrow_up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/arrow_up.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/browserconfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | #da532c 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /dashboard/view/assets/img/chart_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/chart_icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/favicon-16x16.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/favicon-32x32.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/favicon.ico -------------------------------------------------------------------------------- /dashboard/view/assets/img/google_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/google_icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/green.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/green.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/logo.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "", 3 | "icons": [ 4 | { 5 | "src": "/assets/img/android-chrome-192x192.png", 6 | "sizes": "192x192", 7 | "type": "image/png" 8 | }, 9 | { 10 | "src": "/assets/img/android-chrome-384x384.png", 11 | "sizes": "384x384", 12 | "type": "image/png" 13 | } 14 | ], 15 | "theme_color": "#ffffff", 16 | "background_color": "#ffffff", 17 | "display": "standalone" 18 | } 19 | -------------------------------------------------------------------------------- /dashboard/view/assets/img/mstile-150x150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/mstile-150x150.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/products_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/products_icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/red.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/shopify_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/shopify_icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/siq_login.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/siq_login.gif -------------------------------------------------------------------------------- /dashboard/view/assets/img/siq_main_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/siq_main_logo.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/speed_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/speed_icon.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/tool_tip.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/tool_tip.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/video.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/video.png -------------------------------------------------------------------------------- /dashboard/view/assets/img/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/paulpierre/pp_shopifyiq/51df1b14d335f54874fc98772659e5fa74ea589b/dashboard/view/assets/img/warning.png -------------------------------------------------------------------------------- /dashboard/view/assets/js/siq_config.js: -------------------------------------------------------------------------------- 1 | 2 | //Debug settings 3 | var load_full_catalog = true, 4 | max_page_count = 1; 5 | 6 | 7 | /** ================ 8 | * Global Variables 9 | * ================ */ 10 | 11 | var page = 1, 12 | page_count, 13 | product_count = 0, 14 | is_crawling_page = false, 15 | is_crawling_product = false, 16 | is_crawling_product_details = false, 17 | products_per_page = 0, 18 | page_counter = 0, 19 | product_counter = 0, 20 | _site, 21 | _url, 22 | MODE, 23 | site_id, 24 | _store, 25 | date_start, 26 | date_end, 27 | _lastChart, 28 | product_counts, 29 | rank_product_list, 30 | API_DOMAIN, 31 | ranking_list = Array(), 32 | site_rank_list = Array(), 33 | product_rank = 1, 34 | product_list = Array(), 35 | is_empty_product_list = false, 36 | bar; 37 | 38 | MODE='prod'; 39 | 40 | 41 | 42 | 43 | switch(MODE) 44 | { 45 | case 'local': 46 | API_DOMAIN="api.shopifyiq"; 47 | 48 | $.ajaxSetup({ 49 | cache: false 50 | }); 51 | break; 52 | 53 | case 'prod': 54 | API_DOMAIN="api.shopifyiq.com"; 55 | 56 | $.ajaxSetup({ 57 | cache: true 58 | }); 59 | break; 60 | } 61 | -------------------------------------------------------------------------------- /dashboard/view/footer.view.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/.htaccess: -------------------------------------------------------------------------------- 1 | order deny,allow 2 | deny from all 3 | allow from 127.0.0.1 -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Core/phpFastCacheExtensions.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | namespace phpFastCache\Core; 16 | 17 | /** 18 | * Class phpFastCacheExtensions 19 | * @package phpFastCache\Core 20 | */ 21 | abstract class phpFastCacheExtensions 22 | { 23 | /** 24 | * @param $name 25 | * @param $agr 26 | */ 27 | public function __call($name, $agr) 28 | { 29 | 30 | } 31 | } -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Exceptions/phpFastCacheCoreException.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | namespace phpFastCache\Exceptions; 16 | 17 | use \Exception; 18 | 19 | /** 20 | * Class phpFastCacheCoreException 21 | * @package phpFastCache\Exceptions 22 | */ 23 | class phpFastCacheCoreException extends Exception 24 | { 25 | 26 | } -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Exceptions/phpFastCacheDriverException.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | namespace phpFastCache\Exceptions; 16 | 17 | use \Exception; 18 | 19 | /** 20 | * Class phpFastCacheDriverException 21 | * @package phpFastCache\Exceptions 22 | */ 23 | class phpFastCacheDriverException extends Exception 24 | { 25 | 26 | } -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Plugins/CronClearFiles.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | namespace phpFastCache\plugins; 16 | 17 | use phpFastCache\CacheManager; 18 | 19 | // Setup your cronjob to run this file every 20 | // 30 mins - 60 mins to help clean up 21 | // the expired files faster 22 | 23 | require_once (__DIR__ . "/../phpFastCache.php"); 24 | 25 | $setup = array( 26 | "path" => "/your_path/to_clean/" 27 | ); 28 | 29 | $cache = CacheManager::Files($setup); 30 | 31 | // clean up expired files cache every hour 32 | // For now only "files" drivers is supported 33 | $cache->autoCleanExpired(3600*1); -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Util/Languages.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | namespace phpFastCache\Util; 16 | use phpFastCache\Exceptions\phpFastCacheCoreException; 17 | 18 | 19 | /** 20 | * Class Languages 21 | * @author Khoa Bui (khoaofgod) http://www.phpfastcache.com 22 | * @author Georges.L (Geolim4) 23 | * 24 | */ 25 | class Languages 26 | { 27 | public static function setEncoding($encoding = 'UTF-8', $language = null) 28 | { 29 | if ($language === null || !in_array($language, array('uni', 'Japanese', 'ja', 'English', 'en'), true)) { 30 | $language = 'uni'; 31 | } 32 | switch(strtoupper($encoding)) 33 | { 34 | case 'UTF-8': 35 | if(extension_loaded("mbstring")) { 36 | mb_internal_encoding($encoding); 37 | mb_http_output($encoding); 38 | mb_http_input($encoding); 39 | mb_language($language); 40 | mb_regex_encoding($encoding); 41 | } else { 42 | throw new phpFastCacheCoreException("MB String need to be installed for Unicode Encoding"); 43 | } 44 | break; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /shared/lib/phpFastCache/Util/Legacy.php: -------------------------------------------------------------------------------- 1 | ".$tmp[0]." = ".$path." BY {$allowed_path}"; 21 | self::$stores[$index] = true; 22 | return true; 23 | } 24 | } 25 | self::$stores[$index] = false; 26 | } else { 27 | return self::$stores[$index]; 28 | } 29 | return false; 30 | } 31 | return true; 32 | } 33 | } -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2015 Daniele Alessandri 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/VERSION: -------------------------------------------------------------------------------- 1 | 1.0.2-dev 2 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/autoload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/src/Autoloader.php'; 13 | 14 | Predis\Autoloader::register(); 15 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "predis/predis", 3 | "type": "library", 4 | "description": "Flexible and feature-complete PHP client library for Redis", 5 | "keywords": ["nosql", "redis", "predis"], 6 | "homepage": "http://github.com/nrk/predis", 7 | "license": "MIT", 8 | "support": { 9 | "issues": "https://github.com/nrk/predis/issues" 10 | }, 11 | "authors": [ 12 | { 13 | "name": "Daniele Alessandri", 14 | "email": "suppakilla@gmail.com", 15 | "homepage": "http://clorophilla.net" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.3.2" 20 | }, 21 | "require-dev": { 22 | "phpunit/phpunit": "~4.0" 23 | }, 24 | "suggest": { 25 | "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol", 26 | "ext-curl": "Allows access to Webdis when paired with phpiredis" 27 | }, 28 | "autoload": { 29 | "psr-4": {"Predis\\": "src/"} 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/executing_redis_commands.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/shared.php'; 13 | 14 | $client = new Predis\Client($single_server); 15 | 16 | // Plain old SET and GET example... 17 | $client->set('library', 'predis'); 18 | $response = $client->get('library'); 19 | 20 | var_export($response); echo PHP_EOL; 21 | /* OUTPUT: 'predis' */ 22 | 23 | // Redis has the MSET and MGET commands to set or get multiple keys in one go, 24 | // cases like this Predis accepts arguments for variadic commands both as a list 25 | // of arguments or an array containing all of the keys and/or values. 26 | $mkv = array( 27 | 'uid:0001' => '1st user', 28 | 'uid:0002' => '2nd user', 29 | 'uid:0003' => '3rd user' 30 | ); 31 | 32 | $client->mset($mkv); 33 | $response = $client->mget(array_keys($mkv)); 34 | 35 | var_export($response); echo PHP_EOL; 36 | /* OUTPUT: 37 | array ( 38 | 0 => '1st user', 39 | 1 => '2nd user', 40 | 2 => '3rd user', 41 | ) */ 42 | 43 | // Predis can also send "raw" commands to Redis. The difference between sending 44 | // commands to Redis the usual way and the "raw" way is that in the latter case 45 | // their arguments are not filtered nor responses coming from Redis are parsed. 46 | 47 | $response = $client->executeRaw(array( 48 | 'MGET', 'uid:0001', 'uid:0002', 'uid:0003' 49 | )); 50 | 51 | var_export($response); echo PHP_EOL; 52 | /* OUTPUT: 53 | array ( 54 | 0 => '1st user', 55 | 1 => '2nd user', 56 | 2 => '3rd user', 57 | ) */ 58 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/key_prefixing.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/shared.php'; 13 | 14 | // Predis can prefix keys found in commands arguments before sending commands to 15 | // Redis, even for complex commands such as SORT, ZUNIONSTORE and ZINTERSTORE. 16 | // Prefixing keys can be useful to create user-level namespaces for you keyspace 17 | // thus reducing the need for separate logical databases in certain scenarios. 18 | 19 | $client = new Predis\Client($single_server, array('prefix' => 'nrk:')); 20 | 21 | $client->mset(array('foo' => 'bar', 'lol' => 'wut')); 22 | var_export($client->mget('foo', 'lol')); 23 | /* 24 | array ( 25 | 0 => 'bar', 26 | 1 => 'wut', 27 | ) 28 | */ 29 | 30 | var_export($client->keys('*')); 31 | /* 32 | array ( 33 | 0 => 'nrk:foo', 34 | 1 => 'nrk:lol', 35 | ) 36 | */ 37 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/monitor_consumer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/shared.php'; 13 | 14 | // This is a basic example on how to use the Predis\Monitor\Consumer class. You 15 | // can use redis-cli to send commands to the same Redis instance your client is 16 | // connected to, and then type "ECHO QUIT_MONITOR" in redis-cli when you want to 17 | // exit the monitor loop and terminate this script in a graceful way. 18 | 19 | // Create a client and disable r/w timeout on the socket. 20 | $client = new Predis\Client($single_server + array('read_write_timeout' => 0)); 21 | 22 | // Use only one instance of DateTime, we will update the timestamp later. 23 | $timestamp = new DateTime(); 24 | 25 | foreach (($monitor = $client->monitor()) as $event) { 26 | $timestamp->setTimestamp((int) $event->timestamp); 27 | 28 | // If we notice a ECHO command with the message QUIT_MONITOR, we stop the 29 | // monitor consumer and then break the loop. 30 | if ($event->command === 'ECHO' && $event->arguments === '"QUIT_MONITOR"') { 31 | echo "Exiting the monitor loop...", PHP_EOL; 32 | $monitor->stop(); 33 | break; 34 | } 35 | 36 | echo "* Received {$event->command} on DB {$event->database} at {$timestamp->format(DateTime::W3C)}", PHP_EOL; 37 | if (isset($event->arguments)) { 38 | echo " Arguments: {$event->arguments}", PHP_EOL; 39 | } 40 | } 41 | 42 | // Say goodbye :-) 43 | $version = redis_version($client->info()); 44 | echo "Goodbye from Redis $version!", PHP_EOL; 45 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/pipelining_commands.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/shared.php'; 13 | 14 | // When you have a whole set of consecutive commands to send to a redis server, 15 | // you can use a pipeline to dramatically improve performances. Pipelines can 16 | // greatly reduce the effects of network round-trips. 17 | 18 | $client = new Predis\Client($single_server); 19 | 20 | $responses = $client->pipeline(function ($pipe) { 21 | $pipe->flushdb(); 22 | $pipe->incrby('counter', 10); 23 | $pipe->incrby('counter', 30); 24 | $pipe->exists('counter'); 25 | $pipe->get('counter'); 26 | $pipe->mget('does_not_exist', 'counter'); 27 | }); 28 | 29 | var_export($responses); 30 | 31 | /* OUTPUT: 32 | array ( 33 | 0 => Predis\Response\Status::__set_state(array( 34 | 'payload' => 'OK', 35 | )), 36 | 1 => 10, 37 | 2 => 40, 38 | 3 => true, 39 | 4 => '40', 40 | 5 => array ( 41 | 0 => NULL, 42 | 1 => '40', 43 | ), 44 | ) 45 | */ 46 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/shared.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/../autoload.php'; 13 | 14 | function redis_version($info) 15 | { 16 | if (isset($info['Server']['redis_version'])) { 17 | return $info['Server']['redis_version']; 18 | } elseif (isset($info['redis_version'])) { 19 | return $info['redis_version']; 20 | } else { 21 | return 'unknown version'; 22 | } 23 | } 24 | 25 | $single_server = array( 26 | 'host' => '127.0.0.1', 27 | 'port' => 6379, 28 | 'database' => 15 29 | ); 30 | 31 | $multiple_servers = array( 32 | array( 33 | 'host' => '127.0.0.1', 34 | 'port' => 6379, 35 | 'database' => 15, 36 | 'alias' => 'first', 37 | ), 38 | array( 39 | 'host' => '127.0.0.1', 40 | 'port' => 6380, 41 | 'database' => 15, 42 | 'alias' => 'second', 43 | ), 44 | ); 45 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/examples/transaction_using_cas.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | require __DIR__ . '/shared.php'; 13 | 14 | // This is an implementation of an atomic client-side ZPOP using the support for 15 | // check-and-set (CAS) operations with MULTI/EXEC transactions, as described in 16 | // "WATCH explained" from http://redis.io/topics/transactions 17 | // 18 | // First, populate your database with a tiny sample data set: 19 | // 20 | // ./redis-cli 21 | // SELECT 15 22 | // ZADD zset 1 a 2 b 3 c 23 | // 24 | // Then execute this script four times and see its output. 25 | // 26 | 27 | function zpop($client, $key) 28 | { 29 | $element = null; 30 | $options = array( 31 | 'cas' => true, // Initialize with support for CAS operations 32 | 'watch' => $key, // Key that needs to be WATCHed to detect changes 33 | 'retry' => 3, // Number of retries on aborted transactions, after 34 | // which the client bails out with an exception. 35 | ); 36 | 37 | $client->transaction($options, function ($tx) use ($key, &$element) { 38 | @list($element) = $tx->zrange($key, 0, 0); 39 | 40 | if (isset($element)) { 41 | $tx->multi(); // With CAS, MULTI *must* be explicitly invoked. 42 | $tx->zrem($key, $element); 43 | } 44 | }); 45 | 46 | return $element; 47 | } 48 | 49 | $client = new Predis\Client($single_server); 50 | $zpopped = zpop($client, 'zset'); 51 | 52 | echo isset($zpopped) ? "ZPOPed $zpopped" : "Nothing to ZPOP!", PHP_EOL; 53 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/package.ini: -------------------------------------------------------------------------------- 1 | ; This file is meant to be used with Onion http://c9s.github.com/Onion/ 2 | ; For instructions on how to build a PEAR package of Predis please follow 3 | ; the instructions at this URL: 4 | ; 5 | ; https://github.com/c9s/Onion#a-quick-tutorial-for-building-pear-package 6 | ; 7 | 8 | [package] 9 | name = "Predis" 10 | desc = "Flexible and feature-complete PHP client library for Redis" 11 | homepage = "http://github.com/nrk/predis" 12 | license = "MIT" 13 | version = "1.0.2" 14 | stability = "devel" 15 | channel = "pear.nrk.io" 16 | 17 | author = "Daniele Alessandri \"nrk\" " 18 | 19 | [require] 20 | php = ">= 5.3.2" 21 | pearinstaller = "1.4.1" 22 | 23 | [roles] 24 | *.xml.dist = test 25 | *.md = doc 26 | LICENSE = doc 27 | 28 | [optional phpiredis] 29 | hint = "Add support for faster protocol handling with phpiredis" 30 | extensions[] = socket 31 | extensions[] = phpiredis 32 | 33 | [optional webdis] 34 | hint = "Add support for Webdis" 35 | extensions[] = curl 36 | extensions[] = phpiredis 37 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/ClientException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis; 13 | 14 | /** 15 | * Exception class that identifies client-side errors. 16 | * 17 | * @author Daniele Alessandri 18 | */ 19 | class ClientException extends PredisException 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Cluster/Distributor/EmptyRingException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Cluster\Distributor; 13 | 14 | use Exception; 15 | 16 | /** 17 | * Exception class that identifies empty rings. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | class EmptyRingException extends Exception 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Cluster/Hash/HashGeneratorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Cluster\Hash; 13 | 14 | /** 15 | * An hash generator implements the logic used to calculate the hash of a key to 16 | * distribute operations among Redis nodes. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | interface HashGeneratorInterface 21 | { 22 | /** 23 | * Generates an hash from a string to be used for distribution. 24 | * 25 | * @param string $value String value. 26 | * 27 | * @return int 28 | */ 29 | public function hash($value); 30 | } 31 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Cluster/RedisStrategy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Cluster; 13 | 14 | use Predis\NotSupportedException; 15 | use Predis\Cluster\Hash\HashGeneratorInterface; 16 | use Predis\Cluster\Hash\CRC16; 17 | 18 | /** 19 | * Default class used by Predis to calculate hashes out of keys of 20 | * commands supported by redis-cluster. 21 | * 22 | * @author Daniele Alessandri 23 | */ 24 | class RedisStrategy extends ClusterStrategy 25 | { 26 | protected $hashGenerator; 27 | 28 | /** 29 | * @param HashGeneratorInterface $hashGenerator Hash generator instance. 30 | */ 31 | public function __construct(HashGeneratorInterface $hashGenerator = null) 32 | { 33 | parent::__construct(); 34 | 35 | $this->hashGenerator = $hashGenerator ?: new CRC16(); 36 | } 37 | 38 | /** 39 | * {@inheritdoc} 40 | */ 41 | public function getSlotByKey($key) 42 | { 43 | $key = $this->extractKeyTag($key); 44 | $slot = $this->hashGenerator->hash($key) & 0x3FFF; 45 | 46 | return $slot; 47 | } 48 | 49 | /** 50 | * {@inheritdoc} 51 | */ 52 | public function getDistributor() 53 | { 54 | throw new NotSupportedException( 55 | 'This cluster strategy does not provide an external distributor' 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Cluster/StrategyInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Cluster; 13 | 14 | use Predis\Cluster\Distributor\DistributorInterface; 15 | use Predis\Command\CommandInterface; 16 | 17 | /** 18 | * Interface for classes defining the strategy used to calculate an hash out of 19 | * keys extracted from supported commands. 20 | * 21 | * This is mostly useful to support clustering via client-side sharding. 22 | * 23 | * @author Daniele Alessandri 24 | */ 25 | interface StrategyInterface 26 | { 27 | /** 28 | * Returns a slot for the given command used for clustering distribution or 29 | * NULL when this is not possible. 30 | * 31 | * @param CommandInterface $command Command instance. 32 | * 33 | * @return int 34 | */ 35 | public function getSlot(CommandInterface $command); 36 | 37 | /** 38 | * Returns a slot for the given key used for clustering distribution or NULL 39 | * when this is not possible. 40 | * 41 | * @param string $key Key string. 42 | * 43 | * @return int 44 | */ 45 | public function getSlotByKey($key); 46 | 47 | /** 48 | * Returns a distributor instance to be used by the cluster. 49 | * 50 | * @return DistributorInterface 51 | */ 52 | public function getDistributor(); 53 | } 54 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Collection/Iterator/HashKey.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Collection\Iterator; 13 | 14 | use Predis\ClientInterface; 15 | 16 | /** 17 | * Abstracts the iteration of fields and values of an hash by leveraging the 18 | * HSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. 19 | * 20 | * @author Daniele Alessandri 21 | * @link http://redis.io/commands/scan 22 | */ 23 | class HashKey extends CursorBasedIterator 24 | { 25 | protected $key; 26 | 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function __construct(ClientInterface $client, $key, $match = null, $count = null) 31 | { 32 | $this->requiredCommand($client, 'HSCAN'); 33 | 34 | parent::__construct($client, $match, $count); 35 | 36 | $this->key = $key; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | protected function executeCommand() 43 | { 44 | return $this->client->hscan($this->key, $this->cursor, $this->getScanOptions()); 45 | } 46 | 47 | /** 48 | * {@inheritdoc} 49 | */ 50 | protected function extractNext() 51 | { 52 | $this->position = key($this->elements); 53 | $this->current = array_shift($this->elements); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Collection/Iterator/Keyspace.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Collection\Iterator; 13 | 14 | use Predis\ClientInterface; 15 | 16 | /** 17 | * Abstracts the iteration of the keyspace on a Redis instance by leveraging the 18 | * SCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. 19 | * 20 | * @author Daniele Alessandri 21 | * @link http://redis.io/commands/scan 22 | */ 23 | class Keyspace extends CursorBasedIterator 24 | { 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function __construct(ClientInterface $client, $match = null, $count = null) 29 | { 30 | $this->requiredCommand($client, 'SCAN'); 31 | 32 | parent::__construct($client, $match, $count); 33 | } 34 | 35 | /** 36 | * {@inheritdoc} 37 | */ 38 | protected function executeCommand() 39 | { 40 | return $this->client->scan($this->cursor, $this->getScanOptions()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Collection/Iterator/SetKey.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Collection\Iterator; 13 | 14 | use Predis\ClientInterface; 15 | 16 | /** 17 | * Abstracts the iteration of members stored in a set by leveraging the SSCAN 18 | * command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. 19 | * 20 | * @author Daniele Alessandri 21 | * @link http://redis.io/commands/scan 22 | */ 23 | class SetKey extends CursorBasedIterator 24 | { 25 | protected $key; 26 | 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function __construct(ClientInterface $client, $key, $match = null, $count = null) 31 | { 32 | $this->requiredCommand($client, 'SSCAN'); 33 | 34 | parent::__construct($client, $match, $count); 35 | 36 | $this->key = $key; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | protected function executeCommand() 43 | { 44 | return $this->client->sscan($this->key, $this->cursor, $this->getScanOptions()); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Collection/Iterator/SortedSetKey.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Collection\Iterator; 13 | 14 | use Predis\ClientInterface; 15 | 16 | /** 17 | * Abstracts the iteration of members stored in a sorted set by leveraging the 18 | * ZSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. 19 | * 20 | * @author Daniele Alessandri 21 | * @link http://redis.io/commands/scan 22 | */ 23 | class SortedSetKey extends CursorBasedIterator 24 | { 25 | protected $key; 26 | 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function __construct(ClientInterface $client, $key, $match = null, $count = null) 31 | { 32 | $this->requiredCommand($client, 'ZSCAN'); 33 | 34 | parent::__construct($client, $match, $count); 35 | 36 | $this->key = $key; 37 | } 38 | 39 | /** 40 | * {@inheritdoc} 41 | */ 42 | protected function executeCommand() 43 | { 44 | return $this->client->zscan($this->key, $this->cursor, $this->getScanOptions()); 45 | } 46 | 47 | /** 48 | * {@inheritdoc} 49 | */ 50 | protected function extractNext() 51 | { 52 | if ($kv = each($this->elements)) { 53 | $this->position = $kv[0]; 54 | $this->current = $kv[1]; 55 | 56 | unset($this->elements[$this->position]); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ConnectionAuth.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/auth 16 | * @author Daniele Alessandri 17 | */ 18 | class ConnectionAuth extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'AUTH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ConnectionEcho.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/echo 16 | * @author Daniele Alessandri 17 | */ 18 | class ConnectionEcho extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ECHO'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ConnectionPing.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/ping 16 | * @author Daniele Alessandri 17 | */ 18 | class ConnectionPing extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PING'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ConnectionQuit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/quit 16 | * @author Daniele Alessandri 17 | */ 18 | class ConnectionQuit extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'QUIT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ConnectionSelect.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/select 16 | * @author Daniele Alessandri 17 | */ 18 | class ConnectionSelect extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SELECT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashDelete.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hdel 16 | * @author Daniele Alessandri 17 | */ 18 | class HashDelete extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HDEL'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashExists.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hexists 16 | * @author Daniele Alessandri 17 | */ 18 | class HashExists extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HEXISTS'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashGet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hget 16 | * @author Daniele Alessandri 17 | */ 18 | class HashGet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HGET'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashGetAll.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hgetall 16 | * @author Daniele Alessandri 17 | */ 18 | class HashGetAll extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HGETALL'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | $result = array(); 34 | 35 | for ($i = 0; $i < count($data); $i++) { 36 | $result[$data[$i]] = $data[++$i]; 37 | } 38 | 39 | return $result; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashGetMultiple.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hmget 16 | * @author Daniele Alessandri 17 | */ 18 | class HashGetMultiple extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HMGET'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashIncrementBy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hincrby 16 | * @author Daniele Alessandri 17 | */ 18 | class HashIncrementBy extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HINCRBY'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashIncrementByFloat.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hincrbyfloat 16 | * @author Daniele Alessandri 17 | */ 18 | class HashIncrementByFloat extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HINCRBYFLOAT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashKeys.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hkeys 16 | * @author Daniele Alessandri 17 | */ 18 | class HashKeys extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HKEYS'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashLength.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hlen 16 | * @author Daniele Alessandri 17 | */ 18 | class HashLength extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HLEN'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashSet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hset 16 | * @author Daniele Alessandri 17 | */ 18 | class HashSet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HSET'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashSetMultiple.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hmset 16 | * @author Daniele Alessandri 17 | */ 18 | class HashSetMultiple extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HMSET'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 2 && is_array($arguments[1])) { 34 | $flattenedKVs = array($arguments[0]); 35 | $args = $arguments[1]; 36 | 37 | foreach ($args as $k => $v) { 38 | $flattenedKVs[] = $k; 39 | $flattenedKVs[] = $v; 40 | } 41 | 42 | return $flattenedKVs; 43 | } 44 | 45 | return $arguments; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashSetPreserve.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hsetnx 16 | * @author Daniele Alessandri 17 | */ 18 | class HashSetPreserve extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HSETNX'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HashValues.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/hvals 16 | * @author Daniele Alessandri 17 | */ 18 | class HashValues extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'HVALS'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HyperLogLogAdd.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pfadd 16 | * @author Daniele Alessandri 17 | */ 18 | class HyperLogLogAdd extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PFADD'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | 36 | /** 37 | * {@inheritdoc} 38 | */ 39 | public function parseResponse($data) 40 | { 41 | return (bool) $data; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HyperLogLogCount.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pfcount 16 | * @author Daniele Alessandri 17 | */ 18 | class HyperLogLogCount extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PFCOUNT'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/HyperLogLogMerge.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pfmerge 16 | * @author Daniele Alessandri 17 | */ 18 | class HyperLogLogMerge extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PFMERGE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyDelete.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/del 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyDelete extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DEL'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyDump.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/dump 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyDump extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DUMP'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyExists.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/exists 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyExists extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EXISTS'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyExpire.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/expire 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyExpire extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EXPIRE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyExpireAt.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/expireat 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyExpireAt extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EXPIREAT'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyKeys.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/keys 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyKeys extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'KEYS'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyMove.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/move 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyMove extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MOVE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyPersist.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/persist 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyPersist extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PERSIST'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyPreciseExpire.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pexpire 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyPreciseExpire extends KeyExpire 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PEXPIRE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyPreciseExpireAt.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pexpireat 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyPreciseExpireAt extends KeyExpireAt 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PEXPIREAT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyPreciseTimeToLive.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pttl 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyPreciseTimeToLive extends KeyTimeToLive 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PTTL'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyRandom.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/randomkey 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyRandom extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RANDOMKEY'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return $data !== '' ? $data : null; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyRename.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/rename 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyRename extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RENAME'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyRenamePreserve.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/renamenx 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyRenamePreserve extends KeyRename 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RENAMENX'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyRestore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/restore 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyRestore extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RESTORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyScan.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/scan 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyScan extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SCAN'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 2 && is_array($arguments[1])) { 34 | $options = $this->prepareOptions(array_pop($arguments)); 35 | $arguments = array_merge($arguments, $options); 36 | } 37 | 38 | return $arguments; 39 | } 40 | 41 | /** 42 | * Returns a list of options and modifiers compatible with Redis. 43 | * 44 | * @param array $options List of options. 45 | * 46 | * @return array 47 | */ 48 | protected function prepareOptions($options) 49 | { 50 | $options = array_change_key_case($options, CASE_UPPER); 51 | $normalized = array(); 52 | 53 | if (!empty($options['MATCH'])) { 54 | $normalized[] = 'MATCH'; 55 | $normalized[] = $options['MATCH']; 56 | } 57 | 58 | if (!empty($options['COUNT'])) { 59 | $normalized[] = 'COUNT'; 60 | $normalized[] = $options['COUNT']; 61 | } 62 | 63 | return $normalized; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyTimeToLive.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/ttl 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyTimeToLive extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'TTL'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/KeyType.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/type 16 | * @author Daniele Alessandri 17 | */ 18 | class KeyType extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'TYPE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListIndex.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lindex 16 | * @author Daniele Alessandri 17 | */ 18 | class ListIndex extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LINDEX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListInsert.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/linsert 16 | * @author Daniele Alessandri 17 | */ 18 | class ListInsert extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LINSERT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListLength.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/llen 16 | * @author Daniele Alessandri 17 | */ 18 | class ListLength extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LLEN'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopFirst.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lpop 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopFirst extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LPOP'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopFirstBlocking.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/blpop 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopFirstBlocking extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BLPOP'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 2 && is_array($arguments[0])) { 34 | list($arguments, $timeout) = $arguments; 35 | array_push($arguments, $timeout); 36 | } 37 | 38 | return $arguments; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopLast.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/rpop 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopLast extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RPOP'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopLastBlocking.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/brpop 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopLastBlocking extends ListPopFirstBlocking 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BRPOP'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopLastPushHead.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/rpoplpush 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopLastPushHead extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RPOPLPUSH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPopLastPushHeadBlocking.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/brpoplpush 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPopLastPushHeadBlocking extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BRPOPLPUSH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPushHead.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lpush 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPushHead extends ListPushTail 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LPUSH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPushHeadX.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lpushx 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPushHeadX extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LPUSHX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPushTail.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/rpush 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPushTail extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RPUSH'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListPushTailX.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/rpushx 16 | * @author Daniele Alessandri 17 | */ 18 | class ListPushTailX extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'RPUSHX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListRange.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lrange 16 | * @author Daniele Alessandri 17 | */ 18 | class ListRange extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LRANGE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListRemove.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lrem 16 | * @author Daniele Alessandri 17 | */ 18 | class ListRemove extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LREM'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListSet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lset 16 | * @author Daniele Alessandri 17 | */ 18 | class ListSet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LSET'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ListTrim.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/ltrim 16 | * @author Daniele Alessandri 17 | */ 18 | class ListTrim extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LTRIM'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PrefixableCommandInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * Defines a command whose keys can be prefixed. 16 | * 17 | * @author Daniele Alessandri 18 | */ 19 | interface PrefixableCommandInterface extends CommandInterface 20 | { 21 | /** 22 | * Prefixes all the keys found in the arguments of the command. 23 | * 24 | * @param string $prefix String used to prefix the keys. 25 | */ 26 | public function prefixKeys($prefix); 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/Processor/ProcessorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command\Processor; 13 | 14 | use Predis\Command\CommandInterface; 15 | 16 | /** 17 | * A command processor processes Redis commands before they are sent to Redis. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | interface ProcessorInterface 22 | { 23 | /** 24 | * Processes the given Redis command. 25 | * 26 | * @param CommandInterface $command Command instance. 27 | */ 28 | public function process(CommandInterface $command); 29 | } 30 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubPublish.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/publish 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubPublish extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PUBLISH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubPubsub.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/pubsub 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubPubsub extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PUBSUB'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | switch (strtolower($this->getArgument(0))) { 34 | case 'numsub': 35 | return self::processNumsub($data); 36 | 37 | default: 38 | return $data; 39 | } 40 | } 41 | 42 | /** 43 | * Returns the processed response to PUBSUB NUMSUB. 44 | * 45 | * @param array $channels List of channels 46 | * 47 | * @return array 48 | */ 49 | protected static function processNumsub(array $channels) 50 | { 51 | $processed = array(); 52 | $count = count($channels); 53 | 54 | for ($i = 0; $i < $count; $i++) { 55 | $processed[$channels[$i]] = $channels[++$i]; 56 | } 57 | 58 | return $processed; 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubSubscribe.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/subscribe 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubSubscribe extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SUBSCRIBE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubSubscribeByPattern.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/psubscribe 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubSubscribeByPattern extends PubSubSubscribe 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PSUBSCRIBE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubUnsubscribe.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/unsubscribe 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubUnsubscribe extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'UNSUBSCRIBE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/PubSubUnsubscribeByPattern.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/punsubscribe 16 | * @author Daniele Alessandri 17 | */ 18 | class PubSubUnsubscribeByPattern extends PubSubUnsubscribe 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PUNSUBSCRIBE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerBackgroundRewriteAOF.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/bgrewriteaof 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerBackgroundRewriteAOF extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BGREWRITEAOF'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return $data == 'Background append only file rewriting started'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerBackgroundSave.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/bgsave 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerBackgroundSave extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BGSAVE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return $data === 'Background saving started' ? true : $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerCommand.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/command 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerCommand extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'COMMAND'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerConfig.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/config-set 16 | * @link http://redis.io/commands/config-get 17 | * @link http://redis.io/commands/config-resetstat 18 | * @link http://redis.io/commands/config-rewrite 19 | * @author Daniele Alessandri 20 | */ 21 | class ServerConfig extends Command 22 | { 23 | /** 24 | * {@inheritdoc} 25 | */ 26 | public function getId() 27 | { 28 | return 'CONFIG'; 29 | } 30 | 31 | /** 32 | * {@inheritdoc} 33 | */ 34 | public function parseResponse($data) 35 | { 36 | if (is_array($data)) { 37 | $result = array(); 38 | 39 | for ($i = 0; $i < count($data); $i++) { 40 | $result[$data[$i]] = $data[++$i]; 41 | } 42 | 43 | return $result; 44 | } 45 | 46 | return $data; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerDatabaseSize.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/dbsize 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerDatabaseSize extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DBSIZE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerEval.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/eval 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerEval extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EVAL'; 26 | } 27 | 28 | /** 29 | * Calculates the SHA1 hash of the body of the script. 30 | * 31 | * @return string SHA1 hash. 32 | */ 33 | public function getScriptHash() 34 | { 35 | return sha1($this->getArgument(0)); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerEvalSHA.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/evalsha 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerEvalSHA extends ServerEval 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EVALSHA'; 26 | } 27 | 28 | /** 29 | * Returns the SHA1 hash of the body of the script. 30 | * 31 | * @return string SHA1 hash. 32 | */ 33 | public function getScriptHash() 34 | { 35 | return $this->getArgument(0); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerFlushAll.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/flushall 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerFlushAll extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'FLUSHALL'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerFlushDatabase.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/flushdb 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerFlushDatabase extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'FLUSHDB'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerInfoV26x.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/info 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerInfoV26x extends ServerInfo 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function parseResponse($data) 24 | { 25 | if ($data === '') { 26 | return array(); 27 | } 28 | 29 | $info = array(); 30 | 31 | $current = null; 32 | $infoLines = preg_split('/\r?\n/', $data); 33 | 34 | if (isset($infoLines[0]) && $infoLines[0][0] !== '#') { 35 | return parent::parseResponse($data); 36 | } 37 | 38 | foreach ($infoLines as $row) { 39 | if ($row === '') { 40 | continue; 41 | } 42 | 43 | if (preg_match('/^# (\w+)$/', $row, $matches)) { 44 | $info[$matches[1]] = array(); 45 | $current = &$info[$matches[1]]; 46 | continue; 47 | } 48 | 49 | list($k, $v) = $this->parseRow($row); 50 | $current[$k] = $v; 51 | } 52 | 53 | return $info; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerLastSave.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/lastsave 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerLastSave extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'LASTSAVE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerMonitor.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/monitor 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerMonitor extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MONITOR'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerObject.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/object 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerObject extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'OBJECT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerSave.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/save 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerSave extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SAVE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerScript.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/script 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerScript extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SCRIPT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerSentinel.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/topics/sentinel 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerSentinel extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SENTINEL'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | switch (strtolower($this->getArgument(0))) { 34 | case 'masters': 35 | case 'slaves': 36 | return self::processMastersOrSlaves($data); 37 | 38 | default: 39 | return $data; 40 | } 41 | } 42 | 43 | /** 44 | * Returns a processed response to SENTINEL MASTERS or SENTINEL SLAVES. 45 | * 46 | * @param array $servers List of Redis servers. 47 | * 48 | * @return array 49 | */ 50 | protected static function processMastersOrSlaves(array $servers) 51 | { 52 | foreach ($servers as $idx => $node) { 53 | $processed = array(); 54 | $count = count($node); 55 | 56 | for ($i = 0; $i < $count; $i++) { 57 | $processed[$node[$i]] = $node[++$i]; 58 | } 59 | 60 | $servers[$idx] = $processed; 61 | } 62 | 63 | return $servers; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerShutdown.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/shutdown 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerShutdown extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SHUTDOWN'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerSlaveOf.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/slaveof 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerSlaveOf extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SLAVEOF'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 0 || $arguments[0] === 'NO ONE') { 34 | return array('NO', 'ONE'); 35 | } 36 | 37 | return $arguments; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerSlowlog.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/slowlog 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerSlowlog extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SLOWLOG'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | if (is_array($data)) { 34 | $log = array(); 35 | 36 | foreach ($data as $index => $entry) { 37 | $log[$index] = array( 38 | 'id' => $entry[0], 39 | 'timestamp' => $entry[1], 40 | 'duration' => $entry[2], 41 | 'command' => $entry[3], 42 | ); 43 | } 44 | 45 | return $log; 46 | } 47 | 48 | return $data; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ServerTime.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/time 16 | * @author Daniele Alessandri 17 | */ 18 | class ServerTime extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'TIME'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetAdd.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sadd 16 | * @author Daniele Alessandri 17 | */ 18 | class SetAdd extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SADD'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetCardinality.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/scard 16 | * @author Daniele Alessandri 17 | */ 18 | class SetCardinality extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SCARD'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetDifference.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sdiff 16 | * @author Daniele Alessandri 17 | */ 18 | class SetDifference extends SetIntersection 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SDIFF'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetDifferenceStore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sdiffstore 16 | * @author Daniele Alessandri 17 | */ 18 | class SetDifferenceStore extends SetIntersectionStore 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SDIFFSTORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetIntersection.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sinter 16 | * @author Daniele Alessandri 17 | */ 18 | class SetIntersection extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SINTER'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetIntersectionStore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sinterstore 16 | * @author Daniele Alessandri 17 | */ 18 | class SetIntersectionStore extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SINTERSTORE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 2 && is_array($arguments[1])) { 34 | return array_merge(array($arguments[0]), $arguments[1]); 35 | } 36 | 37 | return $arguments; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetIsMember.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sismember 16 | * @author Daniele Alessandri 17 | */ 18 | class SetIsMember extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SISMEMBER'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetMembers.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/smembers 16 | * @author Daniele Alessandri 17 | */ 18 | class SetMembers extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SMEMBERS'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetMove.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/smove 16 | * @author Daniele Alessandri 17 | */ 18 | class SetMove extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SMOVE'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetPop.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/spop 16 | * @author Daniele Alessandri 17 | */ 18 | class SetPop extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SPOP'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetRandomMember.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/srandmember 16 | * @author Daniele Alessandri 17 | */ 18 | class SetRandomMember extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SRANDMEMBER'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetRemove.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/srem 16 | * @author Daniele Alessandri 17 | */ 18 | class SetRemove extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SREM'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetScan.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sscan 16 | * @author Daniele Alessandri 17 | */ 18 | class SetScan extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SSCAN'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 3 && is_array($arguments[2])) { 34 | $options = $this->prepareOptions(array_pop($arguments)); 35 | $arguments = array_merge($arguments, $options); 36 | } 37 | 38 | return $arguments; 39 | } 40 | 41 | /** 42 | * Returns a list of options and modifiers compatible with Redis. 43 | * 44 | * @param array $options List of options. 45 | * 46 | * @return array 47 | */ 48 | protected function prepareOptions($options) 49 | { 50 | $options = array_change_key_case($options, CASE_UPPER); 51 | $normalized = array(); 52 | 53 | if (!empty($options['MATCH'])) { 54 | $normalized[] = 'MATCH'; 55 | $normalized[] = $options['MATCH']; 56 | } 57 | 58 | if (!empty($options['COUNT'])) { 59 | $normalized[] = 'COUNT'; 60 | $normalized[] = $options['COUNT']; 61 | } 62 | 63 | return $normalized; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetUnion.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sunion 16 | * @author Daniele Alessandri 17 | */ 18 | class SetUnion extends SetIntersection 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SUNION'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/SetUnionStore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/sunionstore 16 | * @author Daniele Alessandri 17 | */ 18 | class SetUnionStore extends SetIntersectionStore 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SUNIONSTORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringAppend.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/append 16 | * @author Daniele Alessandri 17 | */ 18 | class StringAppend extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'APPEND'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringBitCount.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/bitcount 16 | * @author Daniele Alessandri 17 | */ 18 | class StringBitCount extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BITCOUNT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringBitOp.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/bitop 16 | * @author Daniele Alessandri 17 | */ 18 | class StringBitOp extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BITOP'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 3 && is_array($arguments[2])) { 34 | list($operation, $destination, ) = $arguments; 35 | $arguments = $arguments[2]; 36 | array_unshift($arguments, $operation, $destination); 37 | } 38 | 39 | return $arguments; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringBitPos.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/bitpos 16 | * @author Daniele Alessandri 17 | */ 18 | class StringBitPos extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'BITPOS'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringDecrement.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/decr 16 | * @author Daniele Alessandri 17 | */ 18 | class StringDecrement extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DECR'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringDecrementBy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/decrby 16 | * @author Daniele Alessandri 17 | */ 18 | class StringDecrementBy extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DECRBY'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringGet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/get 16 | * @author Daniele Alessandri 17 | */ 18 | class StringGet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'GET'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringGetBit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/getbit 16 | * @author Daniele Alessandri 17 | */ 18 | class StringGetBit extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'GETBIT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringGetMultiple.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/mget 16 | * @author Daniele Alessandri 17 | */ 18 | class StringGetMultiple extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MGET'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeArguments($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringGetRange.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/getrange 16 | * @author Daniele Alessandri 17 | */ 18 | class StringGetRange extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'GETRANGE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringGetSet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/getset 16 | * @author Daniele Alessandri 17 | */ 18 | class StringGetSet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'GETSET'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringIncrement.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/incr 16 | * @author Daniele Alessandri 17 | */ 18 | class StringIncrement extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'INCR'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringIncrementBy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/incrby 16 | * @author Daniele Alessandri 17 | */ 18 | class StringIncrementBy extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'INCRBY'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringIncrementByFloat.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/incrbyfloat 16 | * @author Daniele Alessandri 17 | */ 18 | class StringIncrementByFloat extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'INCRBYFLOAT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringPreciseSetExpire.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/psetex 16 | * @author Daniele Alessandri 17 | */ 18 | class StringPreciseSetExpire extends StringSetExpire 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'PSETEX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSet.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/set 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSet extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SET'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetBit.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/setbit 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetBit extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SETBIT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetExpire.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/setex 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetExpire extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SETEX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetMultiple.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/mset 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetMultiple extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MSET'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 1 && is_array($arguments[0])) { 34 | $flattenedKVs = array(); 35 | $args = $arguments[0]; 36 | 37 | foreach ($args as $k => $v) { 38 | $flattenedKVs[] = $k; 39 | $flattenedKVs[] = $v; 40 | } 41 | 42 | return $flattenedKVs; 43 | } 44 | 45 | return $arguments; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetMultiplePreserve.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/msetnx 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetMultiplePreserve extends StringSetMultiple 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MSETNX'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetPreserve.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/setnx 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetPreserve extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SETNX'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | public function parseResponse($data) 32 | { 33 | return (bool) $data; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSetRange.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/setrange 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSetRange extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SETRANGE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringStrlen.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/strlen 16 | * @author Daniele Alessandri 17 | */ 18 | class StringStrlen extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'STRLEN'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/StringSubstr.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/substr 16 | * @author Daniele Alessandri 17 | */ 18 | class StringSubstr extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'SUBSTR'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/TransactionDiscard.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/discard 16 | * @author Daniele Alessandri 17 | */ 18 | class TransactionDiscard extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'DISCARD'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/TransactionExec.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/exec 16 | * @author Daniele Alessandri 17 | */ 18 | class TransactionExec extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'EXEC'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/TransactionMulti.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/multi 16 | * @author Daniele Alessandri 17 | */ 18 | class TransactionMulti extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'MULTI'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/TransactionUnwatch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/unwatch 16 | * @author Daniele Alessandri 17 | */ 18 | class TransactionUnwatch extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'UNWATCH'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/TransactionWatch.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/watch 16 | * @author Daniele Alessandri 17 | */ 18 | class TransactionWatch extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'WATCH'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (isset($arguments[0]) && is_array($arguments[0])) { 34 | return $arguments[0]; 35 | } 36 | 37 | return $arguments; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetAdd.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zadd 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetAdd extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZADD'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | if (count($arguments) === 2 && is_array($arguments[1])) { 34 | $flattened = array($arguments[0]); 35 | 36 | foreach ($arguments[1] as $member => $score) { 37 | $flattened[] = $score; 38 | $flattened[] = $member; 39 | } 40 | 41 | return $flattened; 42 | } 43 | 44 | return $arguments; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetCardinality.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zcard 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetCardinality extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZCARD'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetCount.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zcount 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetCount extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZCOUNT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetIncrementBy.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zincrby 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetIncrementBy extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZINCRBY'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetIntersectionStore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zinterstore 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetIntersectionStore extends ZSetUnionStore 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZINTERSTORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetLexCount.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zlexcount 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetLexCount extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZLEXCOUNT'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRangeByLex.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrangebylex 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRangeByLex extends ZSetRange 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZRANGEBYLEX'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function prepareOptions($options) 32 | { 33 | $opts = array_change_key_case($options, CASE_UPPER); 34 | $finalizedOpts = array(); 35 | 36 | if (isset($opts['LIMIT']) && is_array($opts['LIMIT'])) { 37 | $limit = array_change_key_case($opts['LIMIT'], CASE_UPPER); 38 | 39 | $finalizedOpts[] = 'LIMIT'; 40 | $finalizedOpts[] = isset($limit['OFFSET']) ? $limit['OFFSET'] : $limit[0]; 41 | $finalizedOpts[] = isset($limit['COUNT']) ? $limit['COUNT'] : $limit[1]; 42 | } 43 | 44 | return $finalizedOpts; 45 | } 46 | 47 | /** 48 | * {@inheritdoc} 49 | */ 50 | protected function withScores() 51 | { 52 | return false; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRank.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrank 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRank extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZRANK'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRemove.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrem 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRemove extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREM'; 26 | } 27 | 28 | /** 29 | * {@inheritdoc} 30 | */ 31 | protected function filterArguments(array $arguments) 32 | { 33 | return self::normalizeVariadic($arguments); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRemoveRangeByLex.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zremrangebylex 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRemoveRangeByLex extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREMRANGEBYLEX'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRemoveRangeByRank.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zremrangebyrank 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRemoveRangeByRank extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREMRANGEBYRANK'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetRemoveRangeByScore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zremrangebyscore 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetRemoveRangeByScore extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREMRANGEBYSCORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetReverseRange.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrevrange 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetReverseRange extends ZSetRange 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREVRANGE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetReverseRangeByScore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrevrangebyscore 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetReverseRangeByScore extends ZSetRangeByScore 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREVRANGEBYSCORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetReverseRank.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zrevrank 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetReverseRank extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZREVRANK'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Command/ZSetScore.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Command; 13 | 14 | /** 15 | * @link http://redis.io/commands/zscore 16 | * @author Daniele Alessandri 17 | */ 18 | class ZSetScore extends Command 19 | { 20 | /** 21 | * {@inheritdoc} 22 | */ 23 | public function getId() 24 | { 25 | return 'ZSCORE'; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Configuration/ConnectionFactoryOption.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Configuration; 13 | 14 | use InvalidArgumentException; 15 | use Predis\Connection\Factory; 16 | use Predis\Connection\FactoryInterface; 17 | 18 | /** 19 | * Configures a connection factory used by the client to create new connection 20 | * instances for single Redis nodes. 21 | * 22 | * @author Daniele Alessandri 23 | */ 24 | class ConnectionFactoryOption implements OptionInterface 25 | { 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | public function filter(OptionsInterface $options, $value) 30 | { 31 | if ($value instanceof FactoryInterface) { 32 | return $value; 33 | } elseif (is_array($value)) { 34 | $factory = $this->getDefault($options); 35 | 36 | foreach ($value as $scheme => $initializer) { 37 | $factory->define($scheme, $initializer); 38 | } 39 | 40 | return $factory; 41 | } else { 42 | throw new InvalidArgumentException( 43 | 'Invalid value provided for the connections option.' 44 | ); 45 | } 46 | } 47 | 48 | /** 49 | * {@inheritdoc} 50 | */ 51 | public function getDefault(OptionsInterface $options) 52 | { 53 | return new Factory(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Configuration/ExceptionsOption.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Configuration; 13 | 14 | /** 15 | * Configures whether consumers (such as the client) should throw Exceptions on 16 | * Redis errors (-ERR responses) or just return instances of error responses. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | class ExceptionsOption implements OptionInterface 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | public function filter(OptionsInterface $options, $value) 26 | { 27 | return filter_var($value, FILTER_VALIDATE_BOOLEAN); 28 | } 29 | 30 | /** 31 | * {@inheritdoc} 32 | */ 33 | public function getDefault(OptionsInterface $options) 34 | { 35 | return true; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Configuration/OptionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Configuration; 13 | 14 | /** 15 | * Defines an handler used by Predis\Configuration\Options to filter, validate 16 | * or return default values for a given option. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | interface OptionInterface 21 | { 22 | /** 23 | * Filters and validates the passed value. 24 | * 25 | * @param OptionsInterface $options Options container. 26 | * @param mixed $value Input value. 27 | * 28 | * @return mixed 29 | */ 30 | public function filter(OptionsInterface $options, $value); 31 | 32 | /** 33 | * Returns the default value for the option. 34 | * 35 | * @param OptionsInterface $options Options container. 36 | * 37 | * @return mixed 38 | */ 39 | public function getDefault(OptionsInterface $options); 40 | } 41 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Configuration/PrefixOption.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Configuration; 13 | 14 | use Predis\Command\Processor\KeyPrefixProcessor; 15 | use Predis\Command\Processor\ProcessorInterface; 16 | 17 | /** 18 | * Configures a command processor that apply the specified prefix string to a 19 | * series of Redis commands considered prefixable. 20 | * 21 | * @author Daniele Alessandri 22 | */ 23 | class PrefixOption implements OptionInterface 24 | { 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function filter(OptionsInterface $options, $value) 29 | { 30 | if ($value instanceof ProcessorInterface) { 31 | return $value; 32 | } 33 | 34 | return new KeyPrefixProcessor($value); 35 | } 36 | 37 | /** 38 | * {@inheritdoc} 39 | */ 40 | public function getDefault(OptionsInterface $options) 41 | { 42 | // NOOP 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Connection/Aggregate/ClusterInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Connection\Aggregate; 13 | 14 | use Predis\Connection\AggregateConnectionInterface; 15 | 16 | /** 17 | * Defines a cluster of Redis servers formed by aggregating multiple connection 18 | * instances to single Redis nodes. 19 | * 20 | * @author Daniele Alessandri 21 | */ 22 | interface ClusterInterface extends AggregateConnectionInterface 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Connection/Aggregate/ReplicationInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Connection\Aggregate; 13 | 14 | use Predis\Connection\AggregateConnectionInterface; 15 | use Predis\Connection\NodeConnectionInterface; 16 | 17 | /** 18 | * Defines a group of Redis nodes in a master / slave replication setup. 19 | * 20 | * @author Daniele Alessandri 21 | */ 22 | interface ReplicationInterface extends AggregateConnectionInterface 23 | { 24 | /** 25 | * Switches the internal connection instance in use. 26 | * 27 | * @param string $connection Alias of a connection 28 | */ 29 | public function switchTo($connection); 30 | 31 | /** 32 | * Returns the connection instance currently in use by the aggregate 33 | * connection. 34 | * 35 | * @return NodeConnectionInterface 36 | */ 37 | public function getCurrent(); 38 | 39 | /** 40 | * Returns the connection instance for the master Redis node. 41 | * 42 | * @return NodeConnectionInterface 43 | */ 44 | public function getMaster(); 45 | 46 | /** 47 | * Returns a list of connection instances to slave nodes. 48 | * 49 | * @return NodeConnectionInterface 50 | */ 51 | public function getSlaves(); 52 | } 53 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Connection/CompositeConnectionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Connection; 13 | 14 | /** 15 | * Defines a connection to communicate with a single Redis server that leverages 16 | * an external protocol processor to handle pluggable protocol handlers. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | interface CompositeConnectionInterface extends NodeConnectionInterface 21 | { 22 | /** 23 | * Returns the protocol processor used by the connection. 24 | */ 25 | public function getProtocol(); 26 | 27 | /** 28 | * Writes the buffer containing over the connection. 29 | * 30 | * @param string $buffer String buffer to be sent over the connection. 31 | */ 32 | public function writeBuffer($buffer); 33 | 34 | /** 35 | * Reads the given number of bytes from the connection. 36 | * 37 | * @param int $length Number of bytes to read from the connection. 38 | * 39 | * @return string 40 | */ 41 | public function readBuffer($length); 42 | 43 | /** 44 | * Reads a line from the connection. 45 | * 46 | * @param string 47 | */ 48 | public function readLine(); 49 | } 50 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Connection/ConnectionException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Connection; 13 | 14 | use Predis\CommunicationException; 15 | 16 | /** 17 | * Exception class that identifies connection-related errors. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | class ConnectionException extends CommunicationException 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Connection/NodeConnectionInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Connection; 13 | 14 | use Predis\Command\CommandInterface; 15 | 16 | /** 17 | * Defines a connection used to communicate with a single Redis node. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | interface NodeConnectionInterface extends ConnectionInterface 22 | { 23 | /** 24 | * Returns a string representation of the connection. 25 | * 26 | * @return string 27 | */ 28 | public function __toString(); 29 | 30 | /** 31 | * Returns the underlying resource used to communicate with Redis. 32 | * 33 | * @return mixed 34 | */ 35 | public function getResource(); 36 | 37 | /** 38 | * Returns the parameters used to initialize the connection. 39 | * 40 | * @return ParametersInterface 41 | */ 42 | public function getParameters(); 43 | 44 | /** 45 | * Pushes the given command into a queue of commands executed when 46 | * establishing the actual connection to Redis. 47 | * 48 | * @param CommandInterface $command Instance of a Redis command. 49 | */ 50 | public function addConnectCommand(CommandInterface $command); 51 | 52 | /** 53 | * Reads a response from the server. 54 | * 55 | * @return mixed 56 | */ 57 | public function read(); 58 | } 59 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/NotSupportedException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis; 13 | 14 | /** 15 | * Exception class thrown when trying to use features not supported by certain 16 | * classes or abstractions of Predis. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | class NotSupportedException extends PredisException 21 | { 22 | } 23 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Pipeline/FireAndForget.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Pipeline; 13 | 14 | use SplQueue; 15 | use Predis\Connection\ConnectionInterface; 16 | 17 | /** 18 | * Command pipeline that writes commands to the servers but discards responses. 19 | * 20 | * @author Daniele Alessandri 21 | */ 22 | class FireAndForget extends Pipeline 23 | { 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | protected function executePipeline(ConnectionInterface $connection, SplQueue $commands) 28 | { 29 | while (!$commands->isEmpty()) { 30 | $connection->writeRequest($commands->dequeue()); 31 | } 32 | 33 | $connection->disconnect(); 34 | 35 | return array(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/PredisException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis; 13 | 14 | use Exception; 15 | 16 | /** 17 | * Base exception class for Predis-related errors. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | abstract class PredisException extends Exception 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Profile/ProfileInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Profile; 13 | 14 | use Predis\Command\CommandInterface; 15 | 16 | /** 17 | * A profile defines all the features and commands supported by certain versions 18 | * of Redis. Instances of Predis\Client should use a server profile matching the 19 | * version of Redis being used. 20 | * 21 | * @author Daniele Alessandri 22 | */ 23 | interface ProfileInterface 24 | { 25 | /** 26 | * Returns the profile version corresponding to the Redis version. 27 | * 28 | * @return string 29 | */ 30 | public function getVersion(); 31 | 32 | /** 33 | * Checks if the profile supports the specified command. 34 | * 35 | * @param string $commandID Command ID. 36 | * 37 | * @return bool 38 | */ 39 | public function supportsCommand($commandID); 40 | 41 | /** 42 | * Checks if the profile supports the specified list of commands. 43 | * 44 | * @param array $commandIDs List of command IDs. 45 | * 46 | * @return string 47 | */ 48 | public function supportsCommands(array $commandIDs); 49 | 50 | /** 51 | * Creates a new command instance. 52 | * 53 | * @param string $commandID Command ID. 54 | * @param array $arguments Arguments for the command. 55 | * 56 | * @return CommandInterface 57 | */ 58 | public function createCommand($commandID, array $arguments = array()); 59 | } 60 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Profile/RedisUnstable.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Profile; 13 | 14 | /** 15 | * Server profile for the current unstable version of Redis. 16 | * 17 | * @author Daniele Alessandri 18 | */ 19 | class RedisUnstable extends RedisVersion300 20 | { 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function getVersion() 25 | { 26 | return '3.0'; 27 | } 28 | 29 | /** 30 | * {@inheritdoc} 31 | */ 32 | public function getSupportedCommands() 33 | { 34 | return array_merge(parent::getSupportedCommands(), array()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/ProtocolException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol; 13 | 14 | use Predis\CommunicationException; 15 | 16 | /** 17 | * Exception used to indentify errors encountered while parsing the Redis wire 18 | * protocol. 19 | * 20 | * @author Daniele Alessandri 21 | */ 22 | class ProtocolException extends CommunicationException 23 | { 24 | } 25 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/ProtocolProcessorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol; 13 | 14 | use Predis\Command\CommandInterface; 15 | use Predis\Connection\CompositeConnectionInterface; 16 | 17 | /** 18 | * Defines a pluggable protocol processor capable of serializing commands and 19 | * deserializing responses into PHP objects directly from a connection. 20 | * 21 | * @author Daniele Alessandri 22 | */ 23 | interface ProtocolProcessorInterface 24 | { 25 | /** 26 | * Writes a request over a connection to Redis. 27 | * 28 | * @param CompositeConnectionInterface $connection Redis connection. 29 | * @param CommandInterface $command Command instance. 30 | */ 31 | public function write(CompositeConnectionInterface $connection, CommandInterface $command); 32 | 33 | /** 34 | * Reads a response from a connection to Redis. 35 | * 36 | * @param CompositeConnectionInterface $connection Redis connection. 37 | * 38 | * @return mixed 39 | */ 40 | public function read(CompositeConnectionInterface $connection); 41 | } 42 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/RequestSerializerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol; 13 | 14 | use Predis\Command\CommandInterface; 15 | 16 | /** 17 | * Defines a pluggable serializer for Redis commands. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | interface RequestSerializerInterface 22 | { 23 | /** 24 | * Serializes a Redis command. 25 | * 26 | * @param CommandInterface $command Redis command. 27 | * 28 | * @return string 29 | */ 30 | public function serialize(CommandInterface $command); 31 | } 32 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/ResponseReaderInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol; 13 | 14 | use Predis\Connection\CompositeConnectionInterface; 15 | 16 | /** 17 | * Defines a pluggable reader capable of parsing responses returned by Redis and 18 | * deserializing them to PHP objects. 19 | * 20 | * @author Daniele Alessandri 21 | */ 22 | interface ResponseReaderInterface 23 | { 24 | /** 25 | * Reads a response from a connection to Redis. 26 | * 27 | * @param CompositeConnectionInterface $connection Redis connection. 28 | * 29 | * @return mixed 30 | */ 31 | public function read(CompositeConnectionInterface $connection); 32 | } 33 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/BulkResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\CommunicationException; 15 | use Predis\Connection\CompositeConnectionInterface; 16 | use Predis\Protocol\ProtocolException; 17 | 18 | /** 19 | * Handler for the bulk response type in the standard Redis wire protocol. 20 | * It translates the payload to a string or a NULL. 21 | * 22 | * @link http://redis.io/topics/protocol 23 | * @author Daniele Alessandri 24 | */ 25 | class BulkResponse implements ResponseHandlerInterface 26 | { 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function handle(CompositeConnectionInterface $connection, $payload) 31 | { 32 | $length = (int) $payload; 33 | 34 | if ("$length" !== $payload) { 35 | CommunicationException::handle(new ProtocolException( 36 | $connection, "Cannot parse '$payload' as a valid length for a bulk response." 37 | )); 38 | } 39 | 40 | if ($length >= 0) { 41 | return substr($connection->readBuffer($length + 2), 0, -2); 42 | } 43 | 44 | if ($length == -1) { 45 | return null; 46 | } 47 | 48 | CommunicationException::handle(new ProtocolException( 49 | $connection, "Value '$payload' is not a valid length for a bulk response." 50 | )); 51 | 52 | return; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/ErrorResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\Connection\CompositeConnectionInterface; 15 | use Predis\Response\Error; 16 | 17 | /** 18 | * Handler for the error response type in the standard Redis wire protocol. 19 | * It translates the payload to a complex response object for Predis. 20 | * 21 | * @link http://redis.io/topics/protocol 22 | * @author Daniele Alessandri 23 | */ 24 | class ErrorResponse implements ResponseHandlerInterface 25 | { 26 | /** 27 | * {@inheritdoc} 28 | */ 29 | public function handle(CompositeConnectionInterface $connection, $payload) 30 | { 31 | return new Error($payload); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/IntegerResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\CommunicationException; 15 | use Predis\Connection\CompositeConnectionInterface; 16 | use Predis\Protocol\ProtocolException; 17 | 18 | /** 19 | * Handler for the integer response type in the standard Redis wire protocol. 20 | * It translates the payload an integer or NULL. 21 | * 22 | * @link http://redis.io/topics/protocol 23 | * @author Daniele Alessandri 24 | */ 25 | class IntegerResponse implements ResponseHandlerInterface 26 | { 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function handle(CompositeConnectionInterface $connection, $payload) 31 | { 32 | if (is_numeric($payload)) { 33 | return (int) $payload; 34 | } 35 | 36 | if ($payload !== 'nil') { 37 | CommunicationException::handle(new ProtocolException( 38 | $connection, "Cannot parse '$payload' as a valid numeric response." 39 | )); 40 | } 41 | 42 | return null; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/ResponseHandlerInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\Connection\CompositeConnectionInterface; 15 | 16 | /** 17 | * Defines a pluggable handler used to parse a particular type of response. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | interface ResponseHandlerInterface 22 | { 23 | /** 24 | * Deserializes a response returned by Redis and reads more data from the 25 | * connection if needed. 26 | * 27 | * @param CompositeConnectionInterface $connection Redis connection. 28 | * @param string $payload String payload. 29 | * 30 | * @return mixed 31 | */ 32 | public function handle(CompositeConnectionInterface $connection, $payload); 33 | } 34 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/StatusResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\Connection\CompositeConnectionInterface; 15 | use Predis\Response\Status; 16 | 17 | /** 18 | * Handler for the status response type in the standard Redis wire protocol. It 19 | * translates certain classes of status response to PHP objects or just returns 20 | * the payload as a string. 21 | * 22 | * @link http://redis.io/topics/protocol 23 | * @author Daniele Alessandri 24 | */ 25 | class StatusResponse implements ResponseHandlerInterface 26 | { 27 | /** 28 | * {@inheritdoc} 29 | */ 30 | public function handle(CompositeConnectionInterface $connection, $payload) 31 | { 32 | return Status::get($payload); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/Handler/StreamableMultiBulkResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text\Handler; 13 | 14 | use Predis\CommunicationException; 15 | use Predis\Connection\CompositeConnectionInterface; 16 | use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; 17 | use Predis\Protocol\ProtocolException; 18 | 19 | /** 20 | * Handler for the multibulk response type in the standard Redis wire protocol. 21 | * It returns multibulk responses as iterators that can stream bulk elements. 22 | * 23 | * Streamable multibulk responses are not globally supported by the abstractions 24 | * built-in into Predis, such as transactions or pipelines. Use them with care! 25 | * 26 | * @link http://redis.io/topics/protocol 27 | * @author Daniele Alessandri 28 | */ 29 | class StreamableMultiBulkResponse implements ResponseHandlerInterface 30 | { 31 | /** 32 | * {@inheritdoc} 33 | */ 34 | public function handle(CompositeConnectionInterface $connection, $payload) 35 | { 36 | $length = (int) $payload; 37 | 38 | if ("$length" != $payload) { 39 | CommunicationException::handle(new ProtocolException( 40 | $connection, "Cannot parse '$payload' as a valid length for a multi-bulk response." 41 | )); 42 | } 43 | 44 | return new MultiBulkIterator($connection, $length); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Protocol/Text/RequestSerializer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Protocol\Text; 13 | 14 | use Predis\Command\CommandInterface; 15 | use Predis\Protocol\RequestSerializerInterface; 16 | 17 | /** 18 | * Request serializer for the standard Redis wire protocol. 19 | * 20 | * @link http://redis.io/topics/protocol 21 | * @author Daniele Alessandri 22 | */ 23 | class RequestSerializer implements RequestSerializerInterface 24 | { 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function serialize(CommandInterface $command) 29 | { 30 | $commandID = $command->getId(); 31 | $arguments = $command->getArguments(); 32 | 33 | $cmdlen = strlen($commandID); 34 | $reqlen = count($arguments) + 1; 35 | 36 | $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n"; 37 | 38 | for ($i = 0, $reqlen--; $i < $reqlen; $i++) { 39 | $argument = $arguments[$i]; 40 | $arglen = strlen($argument); 41 | $buffer .= "\${$arglen}\r\n{$argument}\r\n"; 42 | } 43 | 44 | return $buffer; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Response/Error.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Response; 13 | 14 | /** 15 | * Represents an error returned by Redis (-ERR responses) during the execution 16 | * of a command on the server. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | class Error implements ErrorInterface 21 | { 22 | private $message; 23 | 24 | /** 25 | * @param string $message Error message returned by Redis 26 | */ 27 | public function __construct($message) 28 | { 29 | $this->message = $message; 30 | } 31 | 32 | /** 33 | * {@inheritdoc} 34 | */ 35 | public function getMessage() 36 | { 37 | return $this->message; 38 | } 39 | 40 | /** 41 | * {@inheritdoc} 42 | */ 43 | public function getErrorType() 44 | { 45 | list($errorType, ) = explode(' ', $this->getMessage(), 2); 46 | 47 | return $errorType; 48 | } 49 | 50 | /** 51 | * Converts the object to its string representation. 52 | * 53 | * @return string 54 | */ 55 | public function __toString() 56 | { 57 | return $this->getMessage(); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Response/ErrorInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Response; 13 | 14 | /** 15 | * Represents an error returned by Redis (responses identified by "-" in the 16 | * Redis protocol) during the execution of an operation on the server. 17 | * 18 | * @author Daniele Alessandri 19 | */ 20 | interface ErrorInterface extends ResponseInterface 21 | { 22 | /** 23 | * Returns the error message 24 | * 25 | * @return string 26 | */ 27 | public function getMessage(); 28 | 29 | /** 30 | * Returns the error type (e.g. ERR, ASK, MOVED) 31 | * 32 | * @return string 33 | */ 34 | public function getErrorType(); 35 | } 36 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Response/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Response; 13 | 14 | /** 15 | * Represents a complex response object from Redis. 16 | * 17 | * @author Daniele Alessandri 18 | */ 19 | interface ResponseInterface 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Response/ServerException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Response; 13 | 14 | use Predis\PredisException; 15 | 16 | /** 17 | * Exception class that identifies server-side Redis errors. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | class ServerException extends PredisException implements ErrorInterface 22 | { 23 | /** 24 | * Gets the type of the error returned by Redis. 25 | * 26 | * @return string 27 | */ 28 | public function getErrorType() 29 | { 30 | list($errorType, ) = explode(' ', $this->getMessage(), 2); 31 | 32 | return $errorType; 33 | } 34 | 35 | /** 36 | * Converts the exception to an instance of Predis\Response\Error. 37 | * 38 | * @return Error 39 | */ 40 | public function toErrorResponse() 41 | { 42 | return new Error($this->getMessage()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/_extensions/predis-1.0/src/Transaction/AbortedMultiExecException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace Predis\Transaction; 13 | 14 | use Predis\PredisException; 15 | 16 | /** 17 | * Exception class that identifies a MULTI / EXEC transaction aborted by Redis. 18 | * 19 | * @author Daniele Alessandri 20 | */ 21 | class AbortedMultiExecException extends PredisException 22 | { 23 | private $transaction; 24 | 25 | /** 26 | * @param MultiExec $transaction Transaction that generated the exception. 27 | * @param string $message Error message. 28 | * @param int $code Error code. 29 | */ 30 | public function __construct(MultiExec $transaction, $message, $code = null) 31 | { 32 | parent::__construct($message, $code); 33 | $this->transaction = $transaction; 34 | } 35 | 36 | /** 37 | * Returns the transaction that generated the exception. 38 | * 39 | * @return MultiExec 40 | */ 41 | public function getTransaction() 42 | { 43 | return $this->transaction; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /shared/lib/phpFastCache/index.html: -------------------------------------------------------------------------------- 1 | Visit www.phpfastcache.com -------------------------------------------------------------------------------- /shared/lib/phpFastCache/phpFastCache.php: -------------------------------------------------------------------------------- 1 | http://www.phpfastcache.com 11 | * @author Georges.L (Geolim4) 12 | * 13 | */ 14 | 15 | use phpFastCache\CacheManager; 16 | define('PHP_EXT', substr(strrchr(__FILE__, '.'), 1)); 17 | 18 | if(!defined("PHPFASTCACHE_LEGACY")) { 19 | /** 20 | * Register Autoload 21 | */ 22 | spl_autoload_register(function ($entity) { 23 | // Explode is faster than substr & strstr also more control 24 | $module = explode('\\',$entity,2); 25 | if ($module[0] !== 'phpFastCache') { 26 | /** 27 | * Not a part of phpFastCache file 28 | * then we return here. 29 | */ 30 | return; 31 | } 32 | 33 | $entity = str_replace('\\', '/', $module[1]); 34 | $path = __DIR__ . '/' . $entity . '.' . PHP_EXT; 35 | if (is_readable($path)) { 36 | require_once $path; 37 | } 38 | }); 39 | 40 | } else { 41 | require_once __DIR__.'/Util/Legacy.php'; 42 | } 43 | 44 | /** 45 | * phpFastCache() Full alias 46 | * @param string $storage 47 | * @param array $config 48 | * @return mixed 49 | */ 50 | if (!function_exists("phpFastCache")) { 51 | function phpFastCache($storage = 'auto', $config = array()) 52 | { 53 | return CacheManager::getInstance($storage, $config); 54 | } 55 | } 56 | --------------------------------------------------------------------------------