Bläddra i källkod

Migrate from PSR-0 to PSR-4.

Daniele Alessandri 10 år sedan
förälder
incheckning
d226923484
100 ändrade filer med 8 tillägg och 9 borttagningar
  1. 1 1
      autoload.php
  2. 2 2
      bin/create-command-test
  3. 1 1
      bin/create-phar
  4. 3 4
      bin/create-single-file
  5. 1 1
      composer.json
  6. 0 0
      lib/Autoloader.php
  7. 0 0
      lib/BasicClientInterface.php
  8. 0 0
      lib/Client.php
  9. 0 0
      lib/ClientException.php
  10. 0 0
      lib/ClientInterface.php
  11. 0 0
      lib/Cluster/Distributor/DistributorInterface.php
  12. 0 0
      lib/Cluster/Distributor/EmptyRingException.php
  13. 0 0
      lib/Cluster/Distributor/HashRing.php
  14. 0 0
      lib/Cluster/Distributor/KetamaRing.php
  15. 0 0
      lib/Cluster/Hash/CRC16.php
  16. 0 0
      lib/Cluster/Hash/HashGeneratorInterface.php
  17. 0 0
      lib/Cluster/PredisStrategy.php
  18. 0 0
      lib/Cluster/RedisStrategy.php
  19. 0 0
      lib/Cluster/StrategyInterface.php
  20. 0 0
      lib/Collection/Iterator/CursorBasedIterator.php
  21. 0 0
      lib/Collection/Iterator/HashKey.php
  22. 0 0
      lib/Collection/Iterator/Keyspace.php
  23. 0 0
      lib/Collection/Iterator/ListKey.php
  24. 0 0
      lib/Collection/Iterator/SetKey.php
  25. 0 0
      lib/Collection/Iterator/SortedSetKey.php
  26. 0 0
      lib/Command/Command.php
  27. 0 0
      lib/Command/CommandInterface.php
  28. 0 0
      lib/Command/ConnectionAuth.php
  29. 0 0
      lib/Command/ConnectionEcho.php
  30. 0 0
      lib/Command/ConnectionPing.php
  31. 0 0
      lib/Command/ConnectionQuit.php
  32. 0 0
      lib/Command/ConnectionSelect.php
  33. 0 0
      lib/Command/HashDelete.php
  34. 0 0
      lib/Command/HashExists.php
  35. 0 0
      lib/Command/HashGet.php
  36. 0 0
      lib/Command/HashGetAll.php
  37. 0 0
      lib/Command/HashGetMultiple.php
  38. 0 0
      lib/Command/HashIncrementBy.php
  39. 0 0
      lib/Command/HashIncrementByFloat.php
  40. 0 0
      lib/Command/HashKeys.php
  41. 0 0
      lib/Command/HashLength.php
  42. 0 0
      lib/Command/HashScan.php
  43. 0 0
      lib/Command/HashSet.php
  44. 0 0
      lib/Command/HashSetMultiple.php
  45. 0 0
      lib/Command/HashSetPreserve.php
  46. 0 0
      lib/Command/HashValues.php
  47. 0 0
      lib/Command/HyperLogLogAdd.php
  48. 0 0
      lib/Command/HyperLogLogCount.php
  49. 0 0
      lib/Command/HyperLogLogMerge.php
  50. 0 0
      lib/Command/KeyDelete.php
  51. 0 0
      lib/Command/KeyDump.php
  52. 0 0
      lib/Command/KeyExists.php
  53. 0 0
      lib/Command/KeyExpire.php
  54. 0 0
      lib/Command/KeyExpireAt.php
  55. 0 0
      lib/Command/KeyKeys.php
  56. 0 0
      lib/Command/KeyKeysV12x.php
  57. 0 0
      lib/Command/KeyMove.php
  58. 0 0
      lib/Command/KeyPersist.php
  59. 0 0
      lib/Command/KeyPreciseExpire.php
  60. 0 0
      lib/Command/KeyPreciseExpireAt.php
  61. 0 0
      lib/Command/KeyPreciseTimeToLive.php
  62. 0 0
      lib/Command/KeyRandom.php
  63. 0 0
      lib/Command/KeyRename.php
  64. 0 0
      lib/Command/KeyRenamePreserve.php
  65. 0 0
      lib/Command/KeyRestore.php
  66. 0 0
      lib/Command/KeyScan.php
  67. 0 0
      lib/Command/KeySort.php
  68. 0 0
      lib/Command/KeyTimeToLive.php
  69. 0 0
      lib/Command/KeyType.php
  70. 0 0
      lib/Command/ListIndex.php
  71. 0 0
      lib/Command/ListInsert.php
  72. 0 0
      lib/Command/ListLength.php
  73. 0 0
      lib/Command/ListPopFirst.php
  74. 0 0
      lib/Command/ListPopFirstBlocking.php
  75. 0 0
      lib/Command/ListPopLast.php
  76. 0 0
      lib/Command/ListPopLastBlocking.php
  77. 0 0
      lib/Command/ListPopLastPushHead.php
  78. 0 0
      lib/Command/ListPopLastPushHeadBlocking.php
  79. 0 0
      lib/Command/ListPushHead.php
  80. 0 0
      lib/Command/ListPushHeadX.php
  81. 0 0
      lib/Command/ListPushTail.php
  82. 0 0
      lib/Command/ListPushTailX.php
  83. 0 0
      lib/Command/ListRange.php
  84. 0 0
      lib/Command/ListRemove.php
  85. 0 0
      lib/Command/ListSet.php
  86. 0 0
      lib/Command/ListTrim.php
  87. 0 0
      lib/Command/PrefixableCommandInterface.php
  88. 0 0
      lib/Command/Processor/KeyPrefixProcessor.php
  89. 0 0
      lib/Command/Processor/ProcessorChain.php
  90. 0 0
      lib/Command/Processor/ProcessorInterface.php
  91. 0 0
      lib/Command/PubSubPublish.php
  92. 0 0
      lib/Command/PubSubPubsub.php
  93. 0 0
      lib/Command/PubSubSubscribe.php
  94. 0 0
      lib/Command/PubSubSubscribeByPattern.php
  95. 0 0
      lib/Command/PubSubUnsubscribe.php
  96. 0 0
      lib/Command/PubSubUnsubscribeByPattern.php
  97. 0 0
      lib/Command/RawCommand.php
  98. 0 0
      lib/Command/ScriptCommand.php
  99. 0 0
      lib/Command/ServerBackgroundRewriteAOF.php
  100. 0 0
      lib/Command/ServerBackgroundSave.php

+ 1 - 1
autoload.php

@@ -9,6 +9,6 @@
  * file that was distributed with this source code.
  */
 
-require __DIR__.'/lib/Predis/Autoloader.php';
+require __DIR__.'/lib/Autoloader.php';
 
 Predis\Autoloader::register();

+ 2 - 2
bin/create-command-test

@@ -61,7 +61,7 @@ class CommandTestCaseGenerator
 
         $options = array(
             'overwrite' => false,
-            'tests' => __DIR__.'/../tests',
+            'tests' => __DIR__.'/../tests/Predis',
         );
 
         foreach ($getops as $option => $value) {
@@ -93,7 +93,7 @@ class CommandTestCaseGenerator
         }
 
         $options['fqn'] = "Predis\\Command\\{$options['class']}";
-        $options['path'] = "Predis/Command/{$options['class']}.php";
+        $options['path'] = "Command/{$options['class']}.php";
 
         $source = __DIR__.'/../lib/'.$options['path'];
         if (!file_exists($source)) {

+ 1 - 1
bin/create-phar

@@ -52,7 +52,7 @@ function getPharStub($options)
 Phar::mapPhar('predis.phar');
 spl_autoload_register(function (\$class) {
     if (strpos(\$class, 'Predis\\\\') === 0) {
-        \$file = 'phar://predis.phar/'.strtr(\$class, '\\\', '/').'.php';
+        \$file = 'phar://predis.phar/'.strtr(substr(\$class, 7), '\\\', '/').'.php';
         if (file_exists(\$file)) {
             require \$file;
             return true;

+ 3 - 4
bin/create-single-file

@@ -36,7 +36,7 @@ class CommandLine
         $getops = getopt(implode(array_keys($parameters)), $parameters);
 
         $options = array(
-            'source'  => __DIR__ . "/../lib/",
+            'source'  => __DIR__ . "/../lib",
             'output'  => PredisFile::NS_ROOT . '.php',
             'exclude' => array(),
         );
@@ -82,9 +82,8 @@ class PredisFile
 
     public static function from($libraryPath, array $exclude = array())
     {
-        $nsroot = self::NS_ROOT;
         $predisFile = new PredisFile();
-        $libIterator = new RecursiveDirectoryIterator("$libraryPath$nsroot");
+        $libIterator = new RecursiveDirectoryIterator($libraryPath);
 
         foreach (new RecursiveIteratorIterator($libIterator) as $classFile)
         {
@@ -92,7 +91,7 @@ class PredisFile
                 continue;
             }
 
-            $namespace = strtr(str_replace($libraryPath, '', $classFile->getPath()), '/', '\\');
+            $namespace = self::NS_ROOT.strtr(str_replace($libraryPath, '', $classFile->getPath()), '/', '\\');
 
             if (in_array(sprintf('%s\\%s', $namespace, $classFile->getBasename('.php')), $exclude)) {
                 continue;

+ 1 - 1
composer.json

@@ -26,7 +26,7 @@
         "ext-curl": "Allows access to Webdis when paired with phpiredis"
     },
     "autoload": {
-        "psr-0": {"Predis": "lib/"}
+        "psr-4": {"Predis\\": "lib/"}
     },
     "extra": {
         "branch-alias": {

+ 0 - 0
lib/Predis/Autoloader.php → lib/Autoloader.php


+ 0 - 0
lib/Predis/BasicClientInterface.php → lib/BasicClientInterface.php


+ 0 - 0
lib/Predis/Client.php → lib/Client.php


+ 0 - 0
lib/Predis/ClientException.php → lib/ClientException.php


+ 0 - 0
lib/Predis/ClientInterface.php → lib/ClientInterface.php


+ 0 - 0
lib/Predis/Cluster/Distributor/DistributorInterface.php → lib/Cluster/Distributor/DistributorInterface.php


+ 0 - 0
lib/Predis/Cluster/Distributor/EmptyRingException.php → lib/Cluster/Distributor/EmptyRingException.php


+ 0 - 0
lib/Predis/Cluster/Distributor/HashRing.php → lib/Cluster/Distributor/HashRing.php


+ 0 - 0
lib/Predis/Cluster/Distributor/KetamaRing.php → lib/Cluster/Distributor/KetamaRing.php


+ 0 - 0
lib/Predis/Cluster/Hash/CRC16.php → lib/Cluster/Hash/CRC16.php


+ 0 - 0
lib/Predis/Cluster/Hash/HashGeneratorInterface.php → lib/Cluster/Hash/HashGeneratorInterface.php


+ 0 - 0
lib/Predis/Cluster/PredisStrategy.php → lib/Cluster/PredisStrategy.php


+ 0 - 0
lib/Predis/Cluster/RedisStrategy.php → lib/Cluster/RedisStrategy.php


+ 0 - 0
lib/Predis/Cluster/StrategyInterface.php → lib/Cluster/StrategyInterface.php


+ 0 - 0
lib/Predis/Collection/Iterator/CursorBasedIterator.php → lib/Collection/Iterator/CursorBasedIterator.php


+ 0 - 0
lib/Predis/Collection/Iterator/HashKey.php → lib/Collection/Iterator/HashKey.php


+ 0 - 0
lib/Predis/Collection/Iterator/Keyspace.php → lib/Collection/Iterator/Keyspace.php


+ 0 - 0
lib/Predis/Collection/Iterator/ListKey.php → lib/Collection/Iterator/ListKey.php


+ 0 - 0
lib/Predis/Collection/Iterator/SetKey.php → lib/Collection/Iterator/SetKey.php


+ 0 - 0
lib/Predis/Collection/Iterator/SortedSetKey.php → lib/Collection/Iterator/SortedSetKey.php


+ 0 - 0
lib/Predis/Command/Command.php → lib/Command/Command.php


+ 0 - 0
lib/Predis/Command/CommandInterface.php → lib/Command/CommandInterface.php


+ 0 - 0
lib/Predis/Command/ConnectionAuth.php → lib/Command/ConnectionAuth.php


+ 0 - 0
lib/Predis/Command/ConnectionEcho.php → lib/Command/ConnectionEcho.php


+ 0 - 0
lib/Predis/Command/ConnectionPing.php → lib/Command/ConnectionPing.php


+ 0 - 0
lib/Predis/Command/ConnectionQuit.php → lib/Command/ConnectionQuit.php


+ 0 - 0
lib/Predis/Command/ConnectionSelect.php → lib/Command/ConnectionSelect.php


+ 0 - 0
lib/Predis/Command/HashDelete.php → lib/Command/HashDelete.php


+ 0 - 0
lib/Predis/Command/HashExists.php → lib/Command/HashExists.php


+ 0 - 0
lib/Predis/Command/HashGet.php → lib/Command/HashGet.php


+ 0 - 0
lib/Predis/Command/HashGetAll.php → lib/Command/HashGetAll.php


+ 0 - 0
lib/Predis/Command/HashGetMultiple.php → lib/Command/HashGetMultiple.php


+ 0 - 0
lib/Predis/Command/HashIncrementBy.php → lib/Command/HashIncrementBy.php


+ 0 - 0
lib/Predis/Command/HashIncrementByFloat.php → lib/Command/HashIncrementByFloat.php


+ 0 - 0
lib/Predis/Command/HashKeys.php → lib/Command/HashKeys.php


+ 0 - 0
lib/Predis/Command/HashLength.php → lib/Command/HashLength.php


+ 0 - 0
lib/Predis/Command/HashScan.php → lib/Command/HashScan.php


+ 0 - 0
lib/Predis/Command/HashSet.php → lib/Command/HashSet.php


+ 0 - 0
lib/Predis/Command/HashSetMultiple.php → lib/Command/HashSetMultiple.php


+ 0 - 0
lib/Predis/Command/HashSetPreserve.php → lib/Command/HashSetPreserve.php


+ 0 - 0
lib/Predis/Command/HashValues.php → lib/Command/HashValues.php


+ 0 - 0
lib/Predis/Command/HyperLogLogAdd.php → lib/Command/HyperLogLogAdd.php


+ 0 - 0
lib/Predis/Command/HyperLogLogCount.php → lib/Command/HyperLogLogCount.php


+ 0 - 0
lib/Predis/Command/HyperLogLogMerge.php → lib/Command/HyperLogLogMerge.php


+ 0 - 0
lib/Predis/Command/KeyDelete.php → lib/Command/KeyDelete.php


+ 0 - 0
lib/Predis/Command/KeyDump.php → lib/Command/KeyDump.php


+ 0 - 0
lib/Predis/Command/KeyExists.php → lib/Command/KeyExists.php


+ 0 - 0
lib/Predis/Command/KeyExpire.php → lib/Command/KeyExpire.php


+ 0 - 0
lib/Predis/Command/KeyExpireAt.php → lib/Command/KeyExpireAt.php


+ 0 - 0
lib/Predis/Command/KeyKeys.php → lib/Command/KeyKeys.php


+ 0 - 0
lib/Predis/Command/KeyKeysV12x.php → lib/Command/KeyKeysV12x.php


+ 0 - 0
lib/Predis/Command/KeyMove.php → lib/Command/KeyMove.php


+ 0 - 0
lib/Predis/Command/KeyPersist.php → lib/Command/KeyPersist.php


+ 0 - 0
lib/Predis/Command/KeyPreciseExpire.php → lib/Command/KeyPreciseExpire.php


+ 0 - 0
lib/Predis/Command/KeyPreciseExpireAt.php → lib/Command/KeyPreciseExpireAt.php


+ 0 - 0
lib/Predis/Command/KeyPreciseTimeToLive.php → lib/Command/KeyPreciseTimeToLive.php


+ 0 - 0
lib/Predis/Command/KeyRandom.php → lib/Command/KeyRandom.php


+ 0 - 0
lib/Predis/Command/KeyRename.php → lib/Command/KeyRename.php


+ 0 - 0
lib/Predis/Command/KeyRenamePreserve.php → lib/Command/KeyRenamePreserve.php


+ 0 - 0
lib/Predis/Command/KeyRestore.php → lib/Command/KeyRestore.php


+ 0 - 0
lib/Predis/Command/KeyScan.php → lib/Command/KeyScan.php


+ 0 - 0
lib/Predis/Command/KeySort.php → lib/Command/KeySort.php


+ 0 - 0
lib/Predis/Command/KeyTimeToLive.php → lib/Command/KeyTimeToLive.php


+ 0 - 0
lib/Predis/Command/KeyType.php → lib/Command/KeyType.php


+ 0 - 0
lib/Predis/Command/ListIndex.php → lib/Command/ListIndex.php


+ 0 - 0
lib/Predis/Command/ListInsert.php → lib/Command/ListInsert.php


+ 0 - 0
lib/Predis/Command/ListLength.php → lib/Command/ListLength.php


+ 0 - 0
lib/Predis/Command/ListPopFirst.php → lib/Command/ListPopFirst.php


+ 0 - 0
lib/Predis/Command/ListPopFirstBlocking.php → lib/Command/ListPopFirstBlocking.php


+ 0 - 0
lib/Predis/Command/ListPopLast.php → lib/Command/ListPopLast.php


+ 0 - 0
lib/Predis/Command/ListPopLastBlocking.php → lib/Command/ListPopLastBlocking.php


+ 0 - 0
lib/Predis/Command/ListPopLastPushHead.php → lib/Command/ListPopLastPushHead.php


+ 0 - 0
lib/Predis/Command/ListPopLastPushHeadBlocking.php → lib/Command/ListPopLastPushHeadBlocking.php


+ 0 - 0
lib/Predis/Command/ListPushHead.php → lib/Command/ListPushHead.php


+ 0 - 0
lib/Predis/Command/ListPushHeadX.php → lib/Command/ListPushHeadX.php


+ 0 - 0
lib/Predis/Command/ListPushTail.php → lib/Command/ListPushTail.php


+ 0 - 0
lib/Predis/Command/ListPushTailX.php → lib/Command/ListPushTailX.php


+ 0 - 0
lib/Predis/Command/ListRange.php → lib/Command/ListRange.php


+ 0 - 0
lib/Predis/Command/ListRemove.php → lib/Command/ListRemove.php


+ 0 - 0
lib/Predis/Command/ListSet.php → lib/Command/ListSet.php


+ 0 - 0
lib/Predis/Command/ListTrim.php → lib/Command/ListTrim.php


+ 0 - 0
lib/Predis/Command/PrefixableCommandInterface.php → lib/Command/PrefixableCommandInterface.php


+ 0 - 0
lib/Predis/Command/Processor/KeyPrefixProcessor.php → lib/Command/Processor/KeyPrefixProcessor.php


+ 0 - 0
lib/Predis/Command/Processor/ProcessorChain.php → lib/Command/Processor/ProcessorChain.php


+ 0 - 0
lib/Predis/Command/Processor/ProcessorInterface.php → lib/Command/Processor/ProcessorInterface.php


+ 0 - 0
lib/Predis/Command/PubSubPublish.php → lib/Command/PubSubPublish.php


+ 0 - 0
lib/Predis/Command/PubSubPubsub.php → lib/Command/PubSubPubsub.php


+ 0 - 0
lib/Predis/Command/PubSubSubscribe.php → lib/Command/PubSubSubscribe.php


+ 0 - 0
lib/Predis/Command/PubSubSubscribeByPattern.php → lib/Command/PubSubSubscribeByPattern.php


+ 0 - 0
lib/Predis/Command/PubSubUnsubscribe.php → lib/Command/PubSubUnsubscribe.php


+ 0 - 0
lib/Predis/Command/PubSubUnsubscribeByPattern.php → lib/Command/PubSubUnsubscribeByPattern.php


+ 0 - 0
lib/Predis/Command/RawCommand.php → lib/Command/RawCommand.php


+ 0 - 0
lib/Predis/Command/ScriptCommand.php → lib/Command/ScriptCommand.php


+ 0 - 0
lib/Predis/Command/ServerBackgroundRewriteAOF.php → lib/Command/ServerBackgroundRewriteAOF.php


+ 0 - 0
lib/Predis/Command/ServerBackgroundSave.php → lib/Command/ServerBackgroundSave.php


Vissa filer visades inte eftersom för många filer har ändrats