From f7f06ecb6d342fa002f710444628281b2e7f4d8d Mon Sep 17 00:00:00 2001 From: Techwolf Date: Wed, 16 May 2018 15:23:30 -0700 Subject: [PATCH] Use Composer to manage PHP dependencies. --- .gitignore | 1 + composer.json | 18 + composer.lock | 1058 +++ gulpfile.js | 15 +- package.json | 1 + rainloop/v/0.0.0/app/handle.php | 45 +- .../Facebook/Authentication/AccessToken.php | 160 - .../Authentication/AccessTokenMetadata.php | 390 -- .../Facebook/Authentication/OAuth2Client.php | 292 - .../FacebookAuthenticationException.php | 33 - .../FacebookAuthorizationException.php | 33 - .../Exceptions/FacebookClientException.php | 33 - .../Exceptions/FacebookOtherException.php | 33 - .../Exceptions/FacebookResponseException.php | 208 - .../Exceptions/FacebookSDKException.php | 33 - .../Exceptions/FacebookServerException.php | 33 - .../Exceptions/FacebookThrottleException.php | 33 - .../0.0.0/app/libraries/Facebook/Facebook.php | 589 -- .../app/libraries/Facebook/FacebookApp.php | 101 - .../Facebook/FacebookBatchRequest.php | 303 - .../Facebook/FacebookBatchResponse.php | 154 - .../app/libraries/Facebook/FacebookClient.php | 250 - .../libraries/Facebook/FacebookRequest.php | 536 -- .../libraries/Facebook/FacebookResponse.php | 410 -- .../Facebook/FileUpload/FacebookFile.php | 135 - .../Facebook/FileUpload/FacebookVideo.php | 33 - .../Facebook/FileUpload/Mimetypes.php | 987 --- .../Facebook/GraphNodes/Collection.php | 242 - .../Facebook/GraphNodes/GraphAchievement.php | 113 - .../Facebook/GraphNodes/GraphAlbum.php | 183 - .../Facebook/GraphNodes/GraphApplication.php | 43 - .../Facebook/GraphNodes/GraphCoverPhoto.php | 72 - .../Facebook/GraphNodes/GraphEdge.php | 260 - .../Facebook/GraphNodes/GraphEvent.php | 242 - .../Facebook/GraphNodes/GraphGroup.php | 171 - .../Facebook/GraphNodes/GraphList.php | 36 - .../Facebook/GraphNodes/GraphLocation.php | 102 - .../Facebook/GraphNodes/GraphNode.php | 185 - .../Facebook/GraphNodes/GraphNodeFactory.php | 392 -- .../Facebook/GraphNodes/GraphObject.php | 36 - .../GraphNodes/GraphObjectFactory.php | 86 - .../Facebook/GraphNodes/GraphPage.php | 125 - .../Facebook/GraphNodes/GraphPicture.php | 72 - .../Facebook/GraphNodes/GraphSessionInfo.php | 102 - .../Facebook/GraphNodes/GraphUser.php | 162 - .../Facebook/Helpers/FacebookCanvasHelper.php | 52 - .../Helpers/FacebookJavaScriptHelper.php | 42 - .../Helpers/FacebookPageTabHelper.php | 95 - .../Helpers/FacebookRedirectLoginHelper.php | 360 -- .../FacebookSignedRequestFromInputHelper.php | 166 - .../Facebook/Http/GraphRawResponse.php | 137 - .../Facebook/Http/RequestBodyInterface.php | 39 - .../Facebook/Http/RequestBodyMultipart.php | 170 - .../Facebook/Http/RequestBodyUrlEncoded.php | 55 - .../Facebook/HttpClients/FacebookCurl.php | 129 - .../HttpClients/FacebookCurlHttpClient.php | 210 - .../HttpClients/FacebookGuzzleHttpClient.php | 97 - .../FacebookHttpClientInterface.php | 47 - .../Facebook/HttpClients/FacebookStream.php | 80 - .../HttpClients/FacebookStreamHttpClient.php | 94 - .../certs/DigiCertHighAssuranceEVRootCA.pem | 23 - .../FacebookMemoryPersistentDataHandler.php | 53 - .../FacebookSessionPersistentDataHandler.php | 76 - .../PersistentDataInterface.php | 49 - .../McryptPseudoRandomStringGenerator.php | 68 - .../OpenSslPseudoRandomStringGenerator.php | 67 - .../PseudoRandomStringGeneratorInterface.php | 45 - .../PseudoRandomStringGeneratorTrait.php | 58 - .../UrandomPseudoRandomStringGenerator.php | 89 - .../app/libraries/Facebook/SignedRequest.php | 332 - .../Url/FacebookUrlDetectionHandler.php | 163 - .../Facebook/Url/FacebookUrlManipulator.php | 167 - .../Facebook/Url/UrlDetectionInterface.php | 39 - .../0.0.0/app/libraries/Facebook/autoload.php | 79 - .../Imagine/Draw/DrawerInterface.php | 149 - .../Imagine/Effects/EffectsInterface.php | 80 - .../libraries/Imagine/Exception/Exception.php | 19 - .../Exception/InvalidArgumentException.php | 19 - .../Exception/NotSupportedException.php | 19 - .../Exception/OutOfBoundsException.php | 19 - .../Imagine/Exception/RuntimeException.php | 19 - .../Imagine/Filter/Advanced/Border.php | 98 - .../Imagine/Filter/Advanced/Canvas.php | 74 - .../Imagine/Filter/Advanced/Grayscale.php | 30 - .../Imagine/Filter/Advanced/OnPixelBased.php | 57 - .../Filter/Advanced/RelativeResize.php | 50 - .../Imagine/Filter/Basic/ApplyMask.php | 42 - .../Imagine/Filter/Basic/Autorotate.php | 87 - .../libraries/Imagine/Filter/Basic/Copy.php | 29 - .../libraries/Imagine/Filter/Basic/Crop.php | 54 - .../libraries/Imagine/Filter/Basic/Fill.php | 43 - .../Imagine/Filter/Basic/FlipHorizontally.php | 29 - .../Imagine/Filter/Basic/FlipVertically.php | 29 - .../libraries/Imagine/Filter/Basic/Paste.php | 53 - .../libraries/Imagine/Filter/Basic/Resize.php | 48 - .../libraries/Imagine/Filter/Basic/Rotate.php | 52 - .../libraries/Imagine/Filter/Basic/Save.php | 51 - .../libraries/Imagine/Filter/Basic/Show.php | 51 - .../libraries/Imagine/Filter/Basic/Strip.php | 29 - .../Imagine/Filter/Basic/Thumbnail.php | 59 - .../Imagine/Filter/Basic/WebOptimization.php | 57 - .../Imagine/Filter/FilterInterface.php | 30 - .../libraries/Imagine/Filter/ImagineAware.php | 54 - .../Imagine/Filter/Transformation.php | 240 - .../0.0.0/app/libraries/Imagine/Gd/Drawer.php | 333 - .../app/libraries/Imagine/Gd/Effects.php | 109 - .../v/0.0.0/app/libraries/Imagine/Gd/Font.php | 41 - .../0.0.0/app/libraries/Imagine/Gd/Image.php | 735 --- .../app/libraries/Imagine/Gd/Imagine.php | 195 - .../0.0.0/app/libraries/Imagine/Gd/Layers.php | 144 - .../app/libraries/Imagine/Gmagick/Drawer.php | 356 - .../app/libraries/Imagine/Gmagick/Effects.php | 106 - .../app/libraries/Imagine/Gmagick/Font.php | 63 - .../app/libraries/Imagine/Gmagick/Image.php | 786 --- .../app/libraries/Imagine/Gmagick/Imagine.php | 167 - .../app/libraries/Imagine/Gmagick/Layers.php | 272 - .../libraries/Imagine/Image/AbstractFont.php | 75 - .../libraries/Imagine/Image/AbstractImage.php | 120 - .../Imagine/Image/AbstractImagine.php | 79 - .../Imagine/Image/AbstractLayers.php | 61 - .../0.0.0/app/libraries/Imagine/Image/Box.php | 122 - .../libraries/Imagine/Image/BoxInterface.php | 94 - .../Imagine/Image/Fill/FillInterface.php | 30 - .../Image/Fill/Gradient/Horizontal.php | 28 - .../Imagine/Image/Fill/Gradient/Linear.php | 95 - .../Imagine/Image/Fill/Gradient/Vertical.php | 28 - .../libraries/Imagine/Image/FontInterface.php | 51 - .../Imagine/Image/Histogram/Bucket.php | 56 - .../Imagine/Image/Histogram/Range.php | 56 - .../Imagine/Image/ImageInterface.php | 173 - .../Imagine/Image/ImagineInterface.php | 83 - .../Imagine/Image/LayersInterface.php | 107 - .../Imagine/Image/ManipulatorInterface.php | 181 - .../Image/Metadata/AbstractMetadataReader.php | 101 - .../Image/Metadata/DefaultMetadataReader.php | 42 - .../Image/Metadata/ExifMetadataReader.php | 114 - .../Imagine/Image/Metadata/MetadataBag.php | 97 - .../Metadata/MetadataReaderInterface.php | 48 - .../libraries/Imagine/Image/Palette/CMYK.php | 118 - .../Imagine/Image/Palette/Color/CMYK.php | 219 - .../Image/Palette/Color/ColorInterface.php | 95 - .../Imagine/Image/Palette/Color/Gray.php | 164 - .../Imagine/Image/Palette/Color/RGB.php | 214 - .../Imagine/Image/Palette/ColorParser.php | 153 - .../Imagine/Image/Palette/Grayscale.php | 123 - .../Image/Palette/PaletteInterface.php | 87 - .../libraries/Imagine/Image/Palette/RGB.php | 129 - .../app/libraries/Imagine/Image/Point.php | 88 - .../libraries/Imagine/Image/Point/Center.php | 77 - .../Imagine/Image/PointInterface.php | 56 - .../app/libraries/Imagine/Image/Profile.php | 60 - .../Imagine/Image/ProfileInterface.php | 29 - .../app/libraries/Imagine/Imagick/Drawer.php | 404 -- .../app/libraries/Imagine/Imagick/Effects.php | 113 - .../app/libraries/Imagine/Imagick/Font.php | 68 - .../app/libraries/Imagine/Imagick/Image.php | 880 --- .../app/libraries/Imagine/Imagick/Imagine.php | 176 - .../app/libraries/Imagine/Imagick/Layers.php | 271 - .../app/libraries/Mobile_Detect/LICENSE.txt | 48 - .../Mobile_Detect/Mobile_Detect.json | 1 - .../libraries/Mobile_Detect/Mobile_Detect.php | 1460 ----- .../app/libraries/Mobile_Detect/README.md | 283 - .../app/libraries/Mobile_Detect/composer.json | 28 - .../namespaced/Detection/MobileDetect.php | 22 - .../app/libraries/Mobile_Detect/ruleset.xml | 187 - .../0.0.0/app/libraries/PHP-OAuth2/Client.php | 513 -- .../GrantType/AuthorizationCode.php | 41 - .../GrantType/ClientCredentials.php | 25 - .../PHP-OAuth2/GrantType/IGrantType.php | 15 - .../PHP-OAuth2/GrantType/Password.php | 41 - .../PHP-OAuth2/GrantType/RefreshToken.php | 34 - .../v/0.0.0/app/libraries/PHP-OAuth2/README | 117 - .../PHPGangsta/GoogleAuthenticator.php | 201 - .../v/0.0.0/app/libraries/PHPThumb/GD.php | 1417 ---- .../0.0.0/app/libraries/PHPThumb/PHPThumb.php | 143 - .../libraries/PHPThumb/PluginInterface.php | 12 - .../libraries/PHPThumb/Plugins/Reflection.php | 261 - .../0.0.0/app/libraries/Predis/Autoloader.php | 62 - .../v/0.0.0/app/libraries/Predis/Client.php | 523 -- .../Predis/ClientContextInterface.php | 189 - .../app/libraries/Predis/ClientException.php | 21 - .../app/libraries/Predis/ClientInterface.php | 230 - .../Predis/Cluster/ClusterStrategy.php | 398 -- .../Distributor/DistributorInterface.php | 82 - .../Distributor/EmptyRingException.php | 21 - .../Predis/Cluster/Distributor/HashRing.php | 270 - .../Predis/Cluster/Distributor/KetamaRing.php | 71 - .../libraries/Predis/Cluster/Hash/CRC16.php | 72 - .../Cluster/Hash/HashGeneratorInterface.php | 30 - .../Predis/Cluster/PredisStrategy.php | 79 - .../Predis/Cluster/RedisStrategy.php | 58 - .../Predis/Cluster/StrategyInterface.php | 53 - .../Iterator/CursorBasedIterator.php | 191 - .../Predis/Collection/Iterator/HashKey.php | 56 - .../Predis/Collection/Iterator/Keyspace.php | 43 - .../Predis/Collection/Iterator/ListKey.php | 176 - .../Predis/Collection/Iterator/SetKey.php | 47 - .../Collection/Iterator/SortedSetKey.php | 60 - .../app/libraries/Predis/Command/Command.php | 129 - .../Predis/Command/CommandInterface.php | 81 - .../Predis/Command/ConnectionAuth.php | 28 - .../Predis/Command/ConnectionEcho.php | 28 - .../Predis/Command/ConnectionPing.php | 28 - .../Predis/Command/ConnectionQuit.php | 28 - .../Predis/Command/ConnectionSelect.php | 28 - .../libraries/Predis/Command/HashDelete.php | 36 - .../libraries/Predis/Command/HashExists.php | 36 - .../app/libraries/Predis/Command/HashGet.php | 28 - .../libraries/Predis/Command/HashGetAll.php | 42 - .../Predis/Command/HashGetMultiple.php | 36 - .../Predis/Command/HashIncrementBy.php | 28 - .../Predis/Command/HashIncrementByFloat.php | 28 - .../app/libraries/Predis/Command/HashKeys.php | 28 - .../libraries/Predis/Command/HashLength.php | 28 - .../app/libraries/Predis/Command/HashScan.php | 85 - .../app/libraries/Predis/Command/HashSet.php | 36 - .../Predis/Command/HashSetMultiple.php | 48 - .../Predis/Command/HashSetPreserve.php | 36 - .../Predis/Command/HashStringLength.php | 28 - .../libraries/Predis/Command/HashValues.php | 28 - .../Predis/Command/HyperLogLogAdd.php | 44 - .../Predis/Command/HyperLogLogCount.php | 36 - .../Predis/Command/HyperLogLogMerge.php | 36 - .../libraries/Predis/Command/KeyDelete.php | 36 - .../app/libraries/Predis/Command/KeyDump.php | 28 - .../libraries/Predis/Command/KeyExists.php | 36 - .../libraries/Predis/Command/KeyExpire.php | 36 - .../libraries/Predis/Command/KeyExpireAt.php | 36 - .../app/libraries/Predis/Command/KeyKeys.php | 28 - .../libraries/Predis/Command/KeyMigrate.php | 50 - .../app/libraries/Predis/Command/KeyMove.php | 36 - .../libraries/Predis/Command/KeyPersist.php | 36 - .../Predis/Command/KeyPreciseExpire.php | 28 - .../Predis/Command/KeyPreciseExpireAt.php | 28 - .../Predis/Command/KeyPreciseTimeToLive.php | 28 - .../libraries/Predis/Command/KeyRandom.php | 36 - .../libraries/Predis/Command/KeyRename.php | 28 - .../Predis/Command/KeyRenamePreserve.php | 36 - .../libraries/Predis/Command/KeyRestore.php | 28 - .../app/libraries/Predis/Command/KeyScan.php | 66 - .../app/libraries/Predis/Command/KeySort.php | 83 - .../Predis/Command/KeyTimeToLive.php | 28 - .../app/libraries/Predis/Command/KeyType.php | 28 - .../libraries/Predis/Command/ListIndex.php | 28 - .../libraries/Predis/Command/ListInsert.php | 28 - .../libraries/Predis/Command/ListLength.php | 28 - .../libraries/Predis/Command/ListPopFirst.php | 28 - .../Predis/Command/ListPopFirstBlocking.php | 41 - .../libraries/Predis/Command/ListPopLast.php | 28 - .../Predis/Command/ListPopLastBlocking.php | 28 - .../Predis/Command/ListPopLastPushHead.php | 28 - .../Command/ListPopLastPushHeadBlocking.php | 28 - .../libraries/Predis/Command/ListPushHead.php | 28 - .../Predis/Command/ListPushHeadX.php | 28 - .../libraries/Predis/Command/ListPushTail.php | 36 - .../Predis/Command/ListPushTailX.php | 28 - .../libraries/Predis/Command/ListRange.php | 28 - .../libraries/Predis/Command/ListRemove.php | 28 - .../app/libraries/Predis/Command/ListSet.php | 28 - .../app/libraries/Predis/Command/ListTrim.php | 28 - .../Command/PrefixableCommandInterface.php | 27 - .../Command/Processor/KeyPrefixProcessor.php | 415 -- .../Command/Processor/ProcessorChain.php | 130 - .../Command/Processor/ProcessorInterface.php | 29 - .../Predis/Command/PubSubPublish.php | 28 - .../libraries/Predis/Command/PubSubPubsub.php | 61 - .../Predis/Command/PubSubSubscribe.php | 36 - .../Command/PubSubSubscribeByPattern.php | 28 - .../Predis/Command/PubSubUnsubscribe.php | 36 - .../Command/PubSubUnsubscribeByPattern.php | 28 - .../libraries/Predis/Command/RawCommand.php | 131 - .../Predis/Command/ScriptCommand.php | 77 - .../Command/ServerBackgroundRewriteAOF.php | 36 - .../Predis/Command/ServerBackgroundSave.php | 36 - .../libraries/Predis/Command/ServerClient.php | 74 - .../Predis/Command/ServerCommand.php | 28 - .../libraries/Predis/Command/ServerConfig.php | 49 - .../Predis/Command/ServerDatabaseSize.php | 28 - .../libraries/Predis/Command/ServerEval.php | 38 - .../Predis/Command/ServerEvalSHA.php | 38 - .../Predis/Command/ServerFlushAll.php | 28 - .../Predis/Command/ServerFlushDatabase.php | 28 - .../libraries/Predis/Command/ServerInfo.php | 111 - .../Predis/Command/ServerInfoV26x.php | 56 - .../Predis/Command/ServerLastSave.php | 28 - .../Predis/Command/ServerMonitor.php | 28 - .../libraries/Predis/Command/ServerObject.php | 28 - .../libraries/Predis/Command/ServerSave.php | 28 - .../libraries/Predis/Command/ServerScript.php | 28 - .../Predis/Command/ServerSentinel.php | 66 - .../Predis/Command/ServerShutdown.php | 28 - .../Predis/Command/ServerSlaveOf.php | 40 - .../Predis/Command/ServerSlowlog.php | 51 - .../libraries/Predis/Command/ServerTime.php | 28 - .../app/libraries/Predis/Command/SetAdd.php | 36 - .../Predis/Command/SetCardinality.php | 28 - .../Predis/Command/SetDifference.php | 28 - .../Predis/Command/SetDifferenceStore.php | 28 - .../Predis/Command/SetIntersection.php | 36 - .../Predis/Command/SetIntersectionStore.php | 40 - .../libraries/Predis/Command/SetIsMember.php | 36 - .../libraries/Predis/Command/SetMembers.php | 28 - .../app/libraries/Predis/Command/SetMove.php | 36 - .../app/libraries/Predis/Command/SetPop.php | 28 - .../Predis/Command/SetRandomMember.php | 28 - .../libraries/Predis/Command/SetRemove.php | 36 - .../app/libraries/Predis/Command/SetScan.php | 66 - .../app/libraries/Predis/Command/SetUnion.php | 28 - .../Predis/Command/SetUnionStore.php | 28 - .../libraries/Predis/Command/StringAppend.php | 28 - .../Predis/Command/StringBitCount.php | 28 - .../libraries/Predis/Command/StringBitOp.php | 42 - .../libraries/Predis/Command/StringBitPos.php | 28 - .../Predis/Command/StringDecrement.php | 28 - .../Predis/Command/StringDecrementBy.php | 28 - .../libraries/Predis/Command/StringGet.php | 28 - .../libraries/Predis/Command/StringGetBit.php | 28 - .../Predis/Command/StringGetMultiple.php | 36 - .../Predis/Command/StringGetRange.php | 28 - .../libraries/Predis/Command/StringGetSet.php | 28 - .../Predis/Command/StringIncrement.php | 28 - .../Predis/Command/StringIncrementBy.php | 28 - .../Predis/Command/StringIncrementByFloat.php | 28 - .../Predis/Command/StringPreciseSetExpire.php | 28 - .../libraries/Predis/Command/StringSet.php | 28 - .../libraries/Predis/Command/StringSetBit.php | 28 - .../Predis/Command/StringSetExpire.php | 28 - .../Predis/Command/StringSetMultiple.php | 48 - .../Command/StringSetMultiplePreserve.php | 36 - .../Predis/Command/StringSetPreserve.php | 36 - .../Predis/Command/StringSetRange.php | 28 - .../libraries/Predis/Command/StringStrlen.php | 28 - .../libraries/Predis/Command/StringSubstr.php | 28 - .../Predis/Command/TransactionDiscard.php | 28 - .../Predis/Command/TransactionExec.php | 28 - .../Predis/Command/TransactionMulti.php | 28 - .../Predis/Command/TransactionUnwatch.php | 28 - .../Predis/Command/TransactionWatch.php | 40 - .../app/libraries/Predis/Command/ZSetAdd.php | 43 - .../Predis/Command/ZSetCardinality.php | 28 - .../libraries/Predis/Command/ZSetCount.php | 28 - .../Predis/Command/ZSetIncrementBy.php | 28 - .../Predis/Command/ZSetIntersectionStore.php | 28 - .../libraries/Predis/Command/ZSetLexCount.php | 28 - .../libraries/Predis/Command/ZSetRange.php | 105 - .../Predis/Command/ZSetRangeByLex.php | 55 - .../Predis/Command/ZSetRangeByScore.php | 68 - .../app/libraries/Predis/Command/ZSetRank.php | 28 - .../libraries/Predis/Command/ZSetRemove.php | 36 - .../Predis/Command/ZSetRemoveRangeByLex.php | 28 - .../Predis/Command/ZSetRemoveRangeByRank.php | 28 - .../Predis/Command/ZSetRemoveRangeByScore.php | 28 - .../Predis/Command/ZSetReverseRange.php | 28 - .../Predis/Command/ZSetReverseRangeByLex.php | 23 - .../Command/ZSetReverseRangeByScore.php | 28 - .../Predis/Command/ZSetReverseRank.php | 28 - .../app/libraries/Predis/Command/ZSetScan.php | 85 - .../libraries/Predis/Command/ZSetScore.php | 28 - .../Predis/Command/ZSetUnionStore.php | 78 - .../Predis/CommunicationException.php | 80 - .../Predis/Configuration/ClusterOption.php | 76 - .../Configuration/ConnectionFactoryOption.php | 54 - .../Predis/Configuration/ExceptionsOption.php | 37 - .../Predis/Configuration/OptionInterface.php | 40 - .../Predis/Configuration/Options.php | 122 - .../Predis/Configuration/OptionsInterface.php | 64 - .../Predis/Configuration/PrefixOption.php | 44 - .../Predis/Configuration/ProfileOption.php | 69 - .../Configuration/ReplicationOption.php | 61 - .../Predis/Connection/AbstractConnection.php | 239 - .../Connection/Aggregate/ClusterInterface.php | 24 - .../Aggregate/MasterSlaveReplication.php | 264 - .../Connection/Aggregate/PredisCluster.php | 235 - .../Connection/Aggregate/RedisCluster.php | 553 -- .../Aggregate/ReplicationInterface.php | 52 - .../AggregateConnectionInterface.php | 57 - .../CompositeConnectionInterface.php | 49 - .../Connection/CompositeStreamConnection.php | 125 - .../Predis/Connection/ConnectionException.php | 23 - .../Predis/Connection/ConnectionInterface.php | 66 - .../libraries/Predis/Connection/Factory.php | 151 - .../Predis/Connection/FactoryInterface.php | 52 - .../Connection/NodeConnectionInterface.php | 58 - .../Predis/Connection/Parameters.php | 176 - .../Predis/Connection/ParametersInterface.php | 62 - .../Connection/PhpiredisSocketConnection.php | 393 -- .../Connection/PhpiredisStreamConnection.php | 228 - .../Predis/Connection/StreamConnection.php | 292 - .../Predis/Connection/WebdisConnection.php | 353 - .../app/libraries/Predis/Monitor/Consumer.php | 173 - .../Predis/NotSupportedException.php | 22 - .../app/libraries/Predis/Pipeline/Atomic.php | 119 - .../Predis/Pipeline/ConnectionErrorProof.php | 130 - .../Predis/Pipeline/FireAndForget.php | 36 - .../libraries/Predis/Pipeline/Pipeline.php | 247 - .../app/libraries/Predis/PredisException.php | 21 - .../app/libraries/Predis/Profile/Factory.php | 100 - .../Predis/Profile/ProfileInterface.php | 59 - .../libraries/Predis/Profile/RedisProfile.php | 146 - .../Predis/Profile/RedisUnstable.php | 41 - .../Predis/Profile/RedisVersion200.php | 173 - .../Predis/Profile/RedisVersion220.php | 202 - .../Predis/Profile/RedisVersion240.php | 207 - .../Predis/Profile/RedisVersion260.php | 235 - .../Predis/Profile/RedisVersion280.php | 267 - .../Predis/Profile/RedisVersion300.php | 270 - .../Predis/Protocol/ProtocolException.php | 24 - .../Protocol/ProtocolProcessorInterface.php | 41 - .../Protocol/RequestSerializerInterface.php | 31 - .../Protocol/ResponseReaderInterface.php | 32 - .../Text/CompositeProtocolProcessor.php | 107 - .../Protocol/Text/Handler/BulkResponse.php | 55 - .../Protocol/Text/Handler/ErrorResponse.php | 34 - .../Protocol/Text/Handler/IntegerResponse.php | 45 - .../Text/Handler/MultiBulkResponse.php | 68 - .../Text/Handler/ResponseHandlerInterface.php | 33 - .../Protocol/Text/Handler/StatusResponse.php | 35 - .../Handler/StreamableMultiBulkResponse.php | 47 - .../Protocol/Text/ProtocolProcessor.php | 122 - .../Protocol/Text/RequestSerializer.php | 47 - .../Predis/Protocol/Text/ResponseReader.php | 116 - .../Predis/PubSub/AbstractConsumer.php | 219 - .../app/libraries/Predis/PubSub/Consumer.php | 158 - .../Predis/PubSub/DispatcherLoop.php | 170 - .../Replication/ReplicationStrategy.php | 237 - .../app/libraries/Predis/Response/Error.php | 59 - .../Predis/Response/ErrorInterface.php | 35 - .../Predis/Response/Iterator/MultiBulk.php | 77 - .../Response/Iterator/MultiBulkIterator.php | 104 - .../Response/Iterator/MultiBulkTuple.php | 90 - .../Predis/Response/ResponseInterface.php | 21 - .../Predis/Response/ServerException.php | 44 - .../app/libraries/Predis/Response/Status.php | 79 - .../app/libraries/Predis/Session/Handler.php | 142 - .../Transaction/AbortedMultiExecException.php | 45 - .../Predis/Transaction/MultiExec.php | 461 -- .../Predis/Transaction/MultiExecState.php | 166 - .../0.0.0/app/libraries/RainLoop/Actions.php | 2 - .../app/libraries/RainLoop/Providers/Prem.php | 2 - .../TwoFactorAuth/GoogleTwoFactorAuth.php | 4 - .../app/libraries/RainLoop/ServiceActions.php | 5 +- .../v/0.0.0/app/libraries/RainLoop/Social.php | 10 +- .../v/0.0.0/app/libraries/RainLoop/Utils.php | 4 +- .../CalDAV/Backend/AbstractBackend.php | 155 - .../CalDAV/Backend/BackendInterface.php | 233 - .../CalDAV/Backend/NotificationSupport.php | 47 - .../SabreForRainLoop/CalDAV/Backend/PDO.php | 691 -- .../CalDAV/Backend/SharingSupport.php | 243 - .../SabreForRainLoop/CalDAV/Calendar.php | 376 -- .../CalDAV/CalendarObject.php | 279 - .../CalDAV/CalendarQueryParser.php | 298 - .../CalDAV/CalendarQueryValidator.php | 392 -- .../CalDAV/CalendarRootNode.php | 77 - .../CalDAV/Exception/InvalidComponentType.php | 35 - .../CalDAV/ICSExportPlugin.php | 142 - .../SabreForRainLoop/CalDAV/ICalendar.php | 36 - .../CalDAV/ICalendarObject.php | 21 - .../CalDAV/IShareableCalendar.php | 48 - .../CalDAV/ISharedCalendar.php | 36 - .../CalDAV/Notifications/Collection.php | 173 - .../CalDAV/Notifications/ICollection.php | 24 - .../CalDAV/Notifications/INode.php | 38 - .../Notifications/INotificationType.php | 44 - .../CalDAV/Notifications/Node.php | 192 - .../Notifications/Notification/Invite.php | 324 - .../Notification/InviteReply.php | 218 - .../Notification/SystemStatus.php | 182 - .../SabreForRainLoop/CalDAV/Plugin.php | 1338 ---- .../CalDAV/Principal/Collection.php | 32 - .../CalDAV/Principal/IProxyRead.php | 19 - .../CalDAV/Principal/IProxyWrite.php | 19 - .../CalDAV/Principal/ProxyRead.php | 180 - .../CalDAV/Principal/ProxyWrite.php | 180 - .../CalDAV/Principal/User.php | 134 - .../CalDAV/Property/AllowedSharingModes.php | 74 - .../CalDAV/Property/Invite.php | 227 - .../Property/ScheduleCalendarTransp.php | 102 - .../SupportedCalendarComponentSet.php | 88 - .../CalDAV/Property/SupportedCalendarData.php | 40 - .../CalDAV/Property/SupportedCollationSet.php | 45 - .../SabreForRainLoop/CalDAV/Schedule/IMip.php | 111 - .../CalDAV/Schedule/IOutbox.php | 16 - .../CalDAV/Schedule/Outbox.php | 163 - .../CalDAV/ShareableCalendar.php | 72 - .../CalDAV/SharedCalendar.php | 116 - .../SabreForRainLoop/CalDAV/SharingPlugin.php | 526 -- .../SabreForRainLoop/CalDAV/UserCalendars.php | 342 - .../SabreForRainLoop/CalDAV/Version.php | 24 - .../SabreForRainLoop/CardDAV/AddressBook.php | 315 - .../CardDAV/AddressBookQueryParser.php | 221 - .../CardDAV/AddressBookRoot.php | 80 - .../CardDAV/Backend/AbstractBackend.php | 18 - .../CardDAV/Backend/BackendInterface.php | 166 - .../SabreForRainLoop/CardDAV/Backend/PDO.php | 333 - .../SabreForRainLoop/CardDAV/Card.php | 260 - .../SabreForRainLoop/CardDAV/IAddressBook.php | 20 - .../SabreForRainLoop/CardDAV/ICard.php | 20 - .../SabreForRainLoop/CardDAV/IDirectory.php | 21 - .../SabreForRainLoop/CardDAV/Plugin.php | 706 -- .../CardDAV/Property/SupportedAddressData.php | 72 - .../CardDAV/UserAddressBooks.php | 260 - .../CardDAV/VCFExportPlugin.php | 108 - .../SabreForRainLoop/CardDAV/Version.php | 26 - .../DAV/Auth/Backend/AbstractBasic.php | 87 - .../DAV/Auth/Backend/AbstractDigest.php | 101 - .../DAV/Auth/Backend/Apache.php | 63 - .../DAV/Auth/Backend/BackendInterface.php | 36 - .../DAV/Auth/Backend/File.php | 77 - .../SabreForRainLoop/DAV/Auth/Backend/PDO.php | 65 - .../SabreForRainLoop/DAV/Auth/Plugin.php | 112 - .../DAV/Browser/GuessContentType.php | 99 - .../DAV/Browser/MapGetToPropFind.php | 57 - .../SabreForRainLoop/DAV/Browser/Plugin.php | 491 -- .../DAV/Browser/assets/favicon.ico | Bin 4286 -> 0 bytes .../DAV/Browser/assets/icons/addressbook.png | Bin 7232 -> 0 bytes .../DAV/Browser/assets/icons/calendar.png | Bin 4388 -> 0 bytes .../DAV/Browser/assets/icons/card.png | Bin 5695 -> 0 bytes .../DAV/Browser/assets/icons/collection.png | Bin 3474 -> 0 bytes .../DAV/Browser/assets/icons/file.png | Bin 2837 -> 0 bytes .../DAV/Browser/assets/icons/parent.png | Bin 3474 -> 0 bytes .../DAV/Browser/assets/icons/principal.png | Bin 5480 -> 0 bytes .../libraries/SabreForRainLoop/DAV/Client.php | 641 -- .../SabreForRainLoop/DAV/Collection.php | 110 - .../SabreForRainLoop/DAV/Exception.php | 64 - .../DAV/Exception/BadRequest.php | 28 - .../DAV/Exception/Conflict.php | 28 - .../DAV/Exception/ConflictingLock.php | 37 - .../DAV/Exception/FileNotFound.php | 19 - .../DAV/Exception/Forbidden.php | 27 - .../DAV/Exception/InsufficientStorage.php | 27 - .../DAV/Exception/InvalidResourceType.php | 33 - .../Exception/LockTokenMatchesRequestUri.php | 41 - .../SabreForRainLoop/DAV/Exception/Locked.php | 73 - .../DAV/Exception/MethodNotAllowed.php | 45 - .../DAV/Exception/NotAuthenticated.php | 30 - .../DAV/Exception/NotFound.php | 28 - .../DAV/Exception/NotImplemented.php | 27 - .../DAV/Exception/PaymentRequired.php | 30 - .../DAV/Exception/PreconditionFailed.php | 71 - .../DAV/Exception/ReportNotSupported.php | 32 - .../RequestedRangeNotSatisfiable.php | 31 - .../DAV/Exception/ServiceUnavailable.php | 30 - .../DAV/Exception/UnsupportedMediaType.php | 28 - .../SabreForRainLoop/DAV/FS/Directory.php | 140 - .../SabreForRainLoop/DAV/FS/File.php | 91 - .../SabreForRainLoop/DAV/FS/Node.php | 82 - .../SabreForRainLoop/DAV/FSExt/Directory.php | 159 - .../SabreForRainLoop/DAV/FSExt/File.php | 118 - .../SabreForRainLoop/DAV/FSExt/Node.php | 214 - .../libraries/SabreForRainLoop/DAV/File.php | 85 - .../SabreForRainLoop/DAV/ICollection.php | 77 - .../DAV/IExtendedCollection.php | 28 - .../libraries/SabreForRainLoop/DAV/IFile.php | 77 - .../libraries/SabreForRainLoop/DAV/INode.php | 46 - .../SabreForRainLoop/DAV/IProperties.php | 71 - .../libraries/SabreForRainLoop/DAV/IQuota.php | 27 - .../DAV/Locks/Backend/AbstractBackend.php | 21 - .../DAV/Locks/Backend/BackendInterface.php | 51 - .../SabreForRainLoop/DAV/Locks/Backend/FS.php | 193 - .../DAV/Locks/Backend/File.php | 183 - .../DAV/Locks/Backend/PDO.php | 167 - .../SabreForRainLoop/DAV/Locks/LockInfo.php | 81 - .../SabreForRainLoop/DAV/Locks/Plugin.php | 642 -- .../SabreForRainLoop/DAV/Mount/Plugin.php | 83 - .../libraries/SabreForRainLoop/DAV/Node.php | 55 - .../SabreForRainLoop/DAV/ObjectTree.php | 159 - .../DAV/PartialUpdate/IFile.php | 40 - .../DAV/PartialUpdate/Plugin.php | 212 - .../SabreForRainLoop/DAV/Property.php | 31 - .../DAV/Property/GetLastModified.php | 78 - .../SabreForRainLoop/DAV/Property/Href.php | 99 - .../DAV/Property/HrefList.php | 105 - .../SabreForRainLoop/DAV/Property/IHref.php | 25 - .../DAV/Property/LockDiscovery.php | 104 - .../DAV/Property/ResourceType.php | 127 - .../DAV/Property/Response.php | 157 - .../DAV/Property/ResponseList.php | 59 - .../DAV/Property/SupportedLock.php | 78 - .../DAV/Property/SupportedReportSet.php | 111 - .../DAV/PropertyInterface.php | 21 - .../libraries/SabreForRainLoop/DAV/Server.php | 2175 ------- .../SabreForRainLoop/DAV/ServerPlugin.php | 90 - .../SabreForRainLoop/DAV/SimpleCollection.php | 108 - .../SabreForRainLoop/DAV/SimpleFile.php | 121 - .../SabreForRainLoop/DAV/StringUtil.php | 91 - .../DAV/TemporaryFileFilterPlugin.php | 289 - .../libraries/SabreForRainLoop/DAV/Tree.php | 193 - .../SabreForRainLoop/DAV/Tree/Filesystem.php | 133 - .../SabreForRainLoop/DAV/URLUtil.php | 121 - .../SabreForRainLoop/DAV/UUIDUtil.php | 64 - .../SabreForRainLoop/DAV/Version.php | 24 - .../SabreForRainLoop/DAV/XMLUtil.php | 187 - .../DAVACL/AbstractPrincipalCollection.php | 155 - .../DAVACL/Exception/AceConflict.php | 35 - .../DAVACL/Exception/NeedPrivileges.php | 83 - .../DAVACL/Exception/NoAbstract.php | 35 - .../Exception/NotRecognizedPrincipal.php | 35 - .../Exception/NotSupportedPrivilege.php | 35 - .../SabreForRainLoop/DAVACL/IACL.php | 74 - .../SabreForRainLoop/DAVACL/IPrincipal.php | 77 - .../DAVACL/IPrincipalCollection.php | 42 - .../SabreForRainLoop/DAVACL/Plugin.php | 1402 ---- .../SabreForRainLoop/DAVACL/Principal.php | 281 - .../PrincipalBackend/AbstractBackend.php | 18 - .../PrincipalBackend/BackendInterface.php | 153 - .../DAVACL/PrincipalBackend/PDO.php | 428 -- .../DAVACL/PrincipalCollection.php | 33 - .../SabreForRainLoop/DAVACL/Property/Acl.php | 211 - .../DAVACL/Property/AclRestrictions.php | 34 - .../Property/CurrentUserPrivilegeSet.php | 124 - .../DAVACL/Property/Principal.php | 161 - .../DAVACL/Property/SupportedPrivilegeSet.php | 94 - .../SabreForRainLoop/DAVACL/Version.php | 24 - .../SabreForRainLoop/HTTP/AWSAuth.php | 227 - .../SabreForRainLoop/HTTP/AbstractAuth.php | 111 - .../SabreForRainLoop/HTTP/BasicAuth.php | 67 - .../SabreForRainLoop/HTTP/DigestAuth.php | 240 - .../SabreForRainLoop/HTTP/Request.php | 284 - .../SabreForRainLoop/HTTP/Response.php | 175 - .../libraries/SabreForRainLoop/HTTP/Util.php | 82 - .../SabreForRainLoop/HTTP/Version.php | 24 - .../SabreForRainLoop/VObject/Cli.php | 735 --- .../SabreForRainLoop/VObject/Component.php | 473 -- .../VObject/Component/VAlarm.php | 108 - .../VObject/Component/VCalendar.php | 369 -- .../VObject/Component/VCard.php | 353 - .../VObject/Component/VEvent.php | 70 - .../VObject/Component/VFreeBusy.php | 68 - .../VObject/Component/VJournal.php | 46 - .../VObject/Component/VTodo.php | 68 - .../VObject/DateTimeParser.php | 415 -- .../SabreForRainLoop/VObject/Document.php | 261 - .../SabreForRainLoop/VObject/ElementList.php | 172 - .../SabreForRainLoop/VObject/EofException.php | 13 - .../VObject/FreeBusyGenerator.php | 322 - .../SabreForRainLoop/VObject/Node.php | 201 - .../SabreForRainLoop/VObject/Parameter.php | 343 - .../VObject/ParseException.php | 12 - .../SabreForRainLoop/VObject/Parser/Json.php | 188 - .../VObject/Parser/MimeDir.php | 602 -- .../VObject/Parser/Parser.php | 77 - .../SabreForRainLoop/VObject/Property.php | 502 -- .../VObject/Property/Binary.php | 127 - .../VObject/Property/Boolean.php | 63 - .../VObject/Property/FlatText.php | 49 - .../VObject/Property/Float.php | 101 - .../VObject/Property/ICalendar/CalAddress.php | 41 - .../VObject/Property/ICalendar/Date.php | 24 - .../VObject/Property/ICalendar/DateTime.php | 308 - .../VObject/Property/ICalendar/Duration.php | 86 - .../VObject/Property/ICalendar/Period.php | 126 - .../VObject/Property/ICalendar/Recur.php | 189 - .../VObject/Property/Integer.php | 72 - .../VObject/Property/Text.php | 330 - .../VObject/Property/Time.php | 94 - .../VObject/Property/Unknown.php | 50 - .../SabreForRainLoop/VObject/Property/Uri.php | 70 - .../VObject/Property/UtcOffset.php | 37 - .../VObject/Property/VCard/Date.php | 33 - .../VObject/Property/VCard/DateAndOrTime.php | 144 - .../VObject/Property/VCard/DateTime.php | 33 - .../VObject/Property/VCard/LanguageTag.php | 59 - .../VObject/Property/VCard/TimeStamp.php | 69 - .../SabreForRainLoop/VObject/Reader.php | 73 - .../VObject/RecurrenceIterator.php | 1153 ---- .../VObject/Splitter/ICalendar.php | 114 - .../VObject/Splitter/SplitterInterface.php | 39 - .../VObject/Splitter/VCard.php | 74 - .../SabreForRainLoop/VObject/StringUtil.php | 61 - .../SabreForRainLoop/VObject/TimeZoneUtil.php | 482 -- .../VObject/VCardConverter.php | 382 -- .../SabreForRainLoop/VObject/Version.php | 19 - .../SabreForRainLoop/VObject/includes.php | 66 - .../v/0.0.0/app/libraries/lessphp/LICENSE | 660 -- .../v/0.0.0/app/libraries/lessphp/README.md | 96 - .../v/0.0.0/app/libraries/lessphp/ctype.php | 40 - .../0.0.0/app/libraries/lessphp/lessc.inc.php | 3479 ---------- .../app/libraries/pclzip/_pclzip.lib.php | 5693 ---------------- .../v/0.0.0/app/libraries/pclzip/gnu-lgpl.txt | 504 -- .../0.0.0/app/libraries/pclzip/pclzip.lib.php | 5719 ----------------- .../v/0.0.0/app/libraries/pclzip/readme.txt | 421 -- rainloop/v/0.0.0/app/libraries/spyc/COPYING | 21 - rainloop/v/0.0.0/app/libraries/spyc/README.md | 30 - rainloop/v/0.0.0/app/libraries/spyc/Spyc.php | 1155 ---- .../v/0.0.0/app/libraries/spyc/composer.json | 30 - .../v/0.0.0/app/libraries/tmhOAuth/LICENSE | 202 - .../v/0.0.0/app/libraries/tmhOAuth/README.md | 211 - .../v/0.0.0/app/libraries/tmhOAuth/cacert.pem | 3376 ---------- .../0.0.0/app/libraries/tmhOAuth/tmhOAuth.php | 724 --- .../app/libraries/tmhOAuth/tmhUtilities.php | 280 - 690 files changed, 1108 insertions(+), 102876 deletions(-) create mode 100644 composer.json create mode 100644 composer.lock delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessToken.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessTokenMetadata.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Authentication/OAuth2Client.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookAuthenticationException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookAuthorizationException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookClientException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookOtherException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookResponseException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookSDKException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookServerException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookThrottleException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Facebook.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookApp.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchRequest.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookClient.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookRequest.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FacebookResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookFile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookVideo.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/Mimetypes.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/Collection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAchievement.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAlbum.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphApplication.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphCoverPhoto.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEdge.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEvent.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphGroup.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphList.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphLocation.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNode.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNodeFactory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphObject.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphObjectFactory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPage.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPicture.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphSessionInfo.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphUser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookCanvasHelper.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookJavaScriptHelper.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookPageTabHelper.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookRedirectLoginHelper.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Http/GraphRawResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyMultipart.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyUrlEncoded.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurl.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurlHttpClient.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookGuzzleHttpClient.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookHttpClientInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookStream.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookStreamHttpClient.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/certs/DigiCertHighAssuranceEVRootCA.pem delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/PersistentDataInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/McryptPseudoRandomStringGenerator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/PseudoRandomStringGeneratorTrait.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/UrandomPseudoRandomStringGenerator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/SignedRequest.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlDetectionHandler.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlManipulator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/Url/UrlDetectionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Facebook/autoload.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Draw/DrawerInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Effects/EffectsInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Exception/Exception.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Exception/InvalidArgumentException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Exception/NotSupportedException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Exception/OutOfBoundsException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Exception/RuntimeException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Border.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Canvas.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Grayscale.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/OnPixelBased.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/RelativeResize.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/ApplyMask.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Autorotate.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Copy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Crop.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Fill.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipHorizontally.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipVertically.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Paste.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Resize.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Rotate.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Save.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Show.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Strip.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Thumbnail.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/WebOptimization.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/FilterInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/ImagineAware.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Filter/Transformation.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Drawer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Effects.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Font.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Image.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Imagine.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gd/Layers.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Drawer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Effects.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Font.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Image.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Imagine.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Layers.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractFont.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImage.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImagine.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractLayers.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Box.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/BoxInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/FillInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Horizontal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Linear.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Vertical.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/FontInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Bucket.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Range.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/ImageInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/ImagineInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/LayersInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/ManipulatorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/AbstractMetadataReader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/DefaultMetadataReader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/ExifMetadataReader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataBag.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataReaderInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/CMYK.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/CMYK.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/ColorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/Gray.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/RGB.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/ColorParser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Grayscale.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/PaletteInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/RGB.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Point.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Point/Center.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/PointInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/Profile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Image/ProfileInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Drawer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Effects.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Font.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Image.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Imagine.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Layers.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/LICENSE.txt delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.json delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/README.md delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/composer.json delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/namespaced/Detection/MobileDetect.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Mobile_Detect/ruleset.xml delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/Client.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/AuthorizationCode.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/ClientCredentials.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/IGrantType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/Password.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/RefreshToken.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHP-OAuth2/README delete mode 100644 rainloop/v/0.0.0/app/libraries/PHPGangsta/GoogleAuthenticator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHPThumb/GD.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHPThumb/PHPThumb.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHPThumb/PluginInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/PHPThumb/Plugins/Reflection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Autoloader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Client.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/ClientContextInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/ClientException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/ClientInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/ClusterStrategy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/DistributorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/EmptyRingException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/HashRing.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/KetamaRing.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/CRC16.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/HashGeneratorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/PredisStrategy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/RedisStrategy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Cluster/StrategyInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/CursorBasedIterator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/HashKey.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/Keyspace.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/ListKey.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SetKey.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SortedSetKey.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/Command.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/CommandInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionEcho.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionPing.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionQuit.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionSelect.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashDelete.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashExists.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashGet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetAll.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetMultiple.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementBy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementByFloat.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashKeys.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashLength.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashScan.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetMultiple.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetPreserve.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashStringLength.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HashValues.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogAdd.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogCount.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogMerge.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDelete.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDump.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExists.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpire.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpireAt.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyKeys.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMigrate.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMove.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPersist.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpire.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpireAt.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseTimeToLive.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRandom.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRename.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRenamePreserve.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRestore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyScan.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeySort.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyTimeToLive.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/KeyType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListIndex.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListInsert.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListLength.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirst.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirstBlocking.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLast.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastBlocking.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHead.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHeadBlocking.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHead.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHeadX.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTail.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTailX.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListRange.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListRemove.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ListTrim.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PrefixableCommandInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/KeyPrefixProcessor.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorChain.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPublish.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPubsub.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribe.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribeByPattern.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribe.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribeByPattern.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/RawCommand.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ScriptCommand.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundRewriteAOF.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundSave.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerClient.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerCommand.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerConfig.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerDatabaseSize.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEval.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEvalSHA.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushAll.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushDatabase.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfo.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfoV26x.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerLastSave.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerMonitor.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerObject.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSave.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerScript.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSentinel.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerShutdown.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlaveOf.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlowlog.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ServerTime.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetAdd.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetCardinality.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifference.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifferenceStore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersectionStore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetIsMember.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetMembers.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetMove.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetPop.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetRandomMember.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetRemove.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetScan.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnion.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnionStore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringAppend.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitCount.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitOp.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitPos.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrement.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrementBy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringGet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetBit.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetMultiple.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetRange.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrement.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementBy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementByFloat.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringPreciseSetExpire.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetBit.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetExpire.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiple.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiplePreserve.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetPreserve.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetRange.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringStrlen.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/StringSubstr.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionDiscard.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionExec.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionMulti.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionUnwatch.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionWatch.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetAdd.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCardinality.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCount.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIncrementBy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIntersectionStore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetLexCount.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRange.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByLex.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByScore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRank.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemove.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByLex.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByRank.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByScore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRange.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByLex.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByScore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRank.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScan.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetUnionStore.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/CommunicationException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/ClusterOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/ConnectionFactoryOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/ExceptionsOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/Options.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionsInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/PrefixOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/ProfileOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Configuration/ReplicationOption.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/AbstractConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ClusterInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/MasterSlaveReplication.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/PredisCluster.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/RedisCluster.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ReplicationInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/AggregateConnectionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeConnectionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeStreamConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Factory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/FactoryInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/NodeConnectionInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/Parameters.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/ParametersInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisSocketConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisStreamConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/StreamConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Connection/WebdisConnection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Monitor/Consumer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/NotSupportedException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Atomic.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Pipeline/ConnectionErrorProof.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Pipeline/FireAndForget.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Pipeline.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/PredisException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/Factory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/ProfileInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisProfile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisUnstable.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion200.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion220.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion240.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion260.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion280.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion300.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolProcessorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/RequestSerializerInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/ResponseReaderInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/CompositeProtocolProcessor.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/BulkResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ErrorResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/IntegerResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/MultiBulkResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StatusResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ProtocolProcessor.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/RequestSerializer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ResponseReader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/PubSub/AbstractConsumer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/PubSub/Consumer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/PubSub/DispatcherLoop.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Replication/ReplicationStrategy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/Error.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/ErrorInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulk.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkIterator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkTuple.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/ResponseInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/ServerException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Response/Status.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Session/Handler.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Transaction/AbortedMultiExecException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExec.php delete mode 100644 rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExecState.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/NotificationSupport.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/PDO.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Calendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarObject.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryParser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Exception/InvalidComponentType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICSExportPlugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICalendarObject.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/IShareableCalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ISharedCalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Collection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/ICollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/INode.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/INotificationType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Node.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/Invite.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/InviteReply.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/SystemStatus.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/IProxyRead.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/IProxyWrite.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/ProxyRead.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/ProxyWrite.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/User.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/AllowedSharingModes.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/Invite.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/ScheduleCalendarTransp.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarComponentSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarData.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCollationSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IMip.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IOutbox.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/Outbox.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ShareableCalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharedCalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharingPlugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBook.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookQueryParser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookRoot.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/AbstractBackend.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/BackendInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/PDO.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Card.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/IAddressBook.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/ICard.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/IDirectory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/UserAddressBooks.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/VCFExportPlugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/AbstractBasic.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/AbstractDigest.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/Apache.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/BackendInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/File.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/PDO.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/GuessContentType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/MapGetToPropFind.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/favicon.ico delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/addressbook.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/calendar.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/card.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/collection.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/file.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/parent.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/principal.png delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Client.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/BadRequest.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Conflict.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ConflictingLock.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/FileNotFound.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Forbidden.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/InsufficientStorage.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/InvalidResourceType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/LockTokenMatchesRequestUri.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Locked.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/MethodNotAllowed.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotFound.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotImplemented.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/PaymentRequired.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/PreconditionFailed.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ReportNotSupported.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/RequestedRangeNotSatisfiable.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ServiceUnavailable.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/Directory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/File.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/Node.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Directory.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/File.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/File.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ICollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IExtendedCollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IFile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/INode.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IProperties.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IQuota.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/AbstractBackend.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/BackendInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/FS.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/File.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/PDO.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/LockInfo.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Node.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ObjectTree.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PartialUpdate/IFile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PartialUpdate/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/GetLastModified.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Href.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/HrefList.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/IHref.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/LockDiscovery.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResourceType.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Response.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResponseList.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedReportSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PropertyInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Server.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleCollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/StringUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/TemporaryFileFilterPlugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree/Filesystem.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/URLUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/UUIDUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/XMLUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/AbstractPrincipalCollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/AceConflict.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NeedPrivileges.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NoAbstract.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotRecognizedPrincipal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotSupportedPrivilege.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IACL.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IPrincipal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IPrincipalCollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Plugin.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/AbstractBackend.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/BackendInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/PDO.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalCollection.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Acl.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/AclRestrictions.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/CurrentUserPrivilegeSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Principal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/SupportedPrivilegeSet.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/AWSAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/AbstractAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/BasicAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Request.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Response.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Util.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Cli.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VFreeBusy.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VJournal.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VTodo.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/DateTimeParser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Document.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ElementList.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/EofException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/FreeBusyGenerator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parameter.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ParseException.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/Json.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/MimeDir.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/Parser.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Binary.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Boolean.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/FlatText.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Float.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/CalAddress.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Date.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/DateTime.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Duration.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Period.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Recur.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Integer.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Text.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Time.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Unknown.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Uri.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/UtcOffset.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/Date.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/DateAndOrTime.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/DateTime.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/LanguageTag.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/TimeStamp.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Reader.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/RecurrenceIterator.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/ICalendar.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/SplitterInterface.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/VCard.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/StringUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/TimeZoneUtil.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/VCardConverter.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Version.php delete mode 100644 rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/includes.php delete mode 100644 rainloop/v/0.0.0/app/libraries/lessphp/LICENSE delete mode 100644 rainloop/v/0.0.0/app/libraries/lessphp/README.md delete mode 100644 rainloop/v/0.0.0/app/libraries/lessphp/ctype.php delete mode 100644 rainloop/v/0.0.0/app/libraries/lessphp/lessc.inc.php delete mode 100644 rainloop/v/0.0.0/app/libraries/pclzip/_pclzip.lib.php delete mode 100644 rainloop/v/0.0.0/app/libraries/pclzip/gnu-lgpl.txt delete mode 100644 rainloop/v/0.0.0/app/libraries/pclzip/pclzip.lib.php delete mode 100644 rainloop/v/0.0.0/app/libraries/pclzip/readme.txt delete mode 100644 rainloop/v/0.0.0/app/libraries/spyc/COPYING delete mode 100644 rainloop/v/0.0.0/app/libraries/spyc/README.md delete mode 100644 rainloop/v/0.0.0/app/libraries/spyc/Spyc.php delete mode 100644 rainloop/v/0.0.0/app/libraries/spyc/composer.json delete mode 100644 rainloop/v/0.0.0/app/libraries/tmhOAuth/LICENSE delete mode 100644 rainloop/v/0.0.0/app/libraries/tmhOAuth/README.md delete mode 100644 rainloop/v/0.0.0/app/libraries/tmhOAuth/cacert.pem delete mode 100644 rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhOAuth.php delete mode 100644 rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhUtilities.php diff --git a/.gitignore b/.gitignore index 44d279280a..9b9aa8c0c6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ /rainloop/v/0.0.0/static/* /rainloop/v/0.0.0/app/localization/moment/* !/rainloop/v/0.0.0/app/localization/moment/.gitempty +/rainloop/v/0.0.0/app/vendor/* /tests/e2e/configuration.js /tests/e2e/output/* !/tests/e2e/output/.gitempty diff --git a/composer.json b/composer.json new file mode 100644 index 0000000000..e823988c50 --- /dev/null +++ b/composer.json @@ -0,0 +1,18 @@ +{ + "config": { + "vendor-dir": "rainloop/v/0.0.0/app/vendor" + }, + "require": { + "facebook/graph-sdk": "^5.6", + "mobiledetect/mobiledetectlib": "^2.8", + "phpgangsta/googleauthenticator": "dev-master", + "predis/predis": "^1.1", + "themattharris/tmhoauth": "^0.8.4", + "imagine/imagine": "^0.7.1", + "pclzip/pclzip": "^2.8", + "adoy/oauth2": "^1.3", + "mustangostang/spyc": "^0.6.2", + "sabre/dav": "^3.2", + "oyejorge/less.php": "v1.7.0.14" + } +} diff --git a/composer.lock b/composer.lock new file mode 100644 index 0000000000..8e0e3c4626 --- /dev/null +++ b/composer.lock @@ -0,0 +1,1058 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "e3eb8f651a19be2cbf2f519f4c675e80", + "packages": [ + { + "name": "adoy/oauth2", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/adoy/PHP-OAuth2.git", + "reference": "617d8605955cbb0ca929358fda74eab308c39cfa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/adoy/PHP-OAuth2/zipball/617d8605955cbb0ca929358fda74eab308c39cfa", + "reference": "617d8605955cbb0ca929358fda74eab308c39cfa", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "OAuth2": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Berejeb Anis", + "email": "anis.berejeb@gmail.com" + }, + { + "name": "Charron Pierrick", + "email": "pierrick@webstart.fr" + } + ], + "description": "Light PHP wrapper for the OAuth 2.0 protocol (based on OAuth 2.0 Authorization Protocol draft-ietf-oauth-v2-15)", + "time": "2015-08-03T19:57:06+00:00" + }, + { + "name": "facebook/graph-sdk", + "version": "5.6.2", + "source": { + "type": "git", + "url": "https://github.com/facebook/php-graph-sdk.git", + "reference": "030f8c5b9b1a6c09e71719fd638b66ea4daa2f10" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/facebook/php-graph-sdk/zipball/030f8c5b9b1a6c09e71719fd638b66ea4daa2f10", + "reference": "030f8c5b9b1a6c09e71719fd638b66ea4daa2f10", + "shasum": "" + }, + "require": { + "php": "^5.4|^7.0" + }, + "require-dev": { + "guzzlehttp/guzzle": "~5.0", + "mockery/mockery": "~0.8", + "phpunit/phpunit": "~4.0" + }, + "suggest": { + "guzzlehttp/guzzle": "Allows for implementation of the Guzzle HTTP client", + "paragonie/random_compat": "Provides a better CSPRNG option in PHP 5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "Facebook\\": "src/Facebook/" + }, + "files": [ + "src/Facebook/polyfills.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Facebook Platform" + ], + "authors": [ + { + "name": "Facebook", + "homepage": "https://github.com/facebook/php-graph-sdk/contributors" + } + ], + "description": "Facebook SDK for PHP", + "homepage": "https://github.com/facebook/php-graph-sdk", + "keywords": [ + "facebook", + "sdk" + ], + "time": "2018-02-14T23:24:51+00:00" + }, + { + "name": "imagine/imagine", + "version": "v0.7.1", + "source": { + "type": "git", + "url": "https://github.com/avalanche123/Imagine.git", + "reference": "a9a702a946073cbca166718f1b02a1e72d742daa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/avalanche123/Imagine/zipball/a9a702a946073cbca166718f1b02a1e72d742daa", + "reference": "a9a702a946073cbca166718f1b02a1e72d742daa", + "shasum": "" + }, + "require": { + "php": ">=5.3.2" + }, + "require-dev": { + "sami/sami": "^3.3", + "symfony/phpunit-bridge": "^3.2" + }, + "suggest": { + "ext-gd": "to use the GD implementation", + "ext-gmagick": "to use the Gmagick implementation", + "ext-imagick": "to use the Imagick implementation" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-develop": "0.7-dev" + } + }, + "autoload": { + "psr-0": { + "Imagine": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bulat Shakirzyanov", + "email": "mallluhuct@gmail.com", + "homepage": "http://avalanche123.com" + } + ], + "description": "Image processing for PHP 5.3", + "homepage": "http://imagine.readthedocs.org/", + "keywords": [ + "drawing", + "graphics", + "image manipulation", + "image processing" + ], + "time": "2017-05-16T10:31:22+00:00" + }, + { + "name": "mobiledetect/mobiledetectlib", + "version": "2.8.31", + "source": { + "type": "git", + "url": "https://github.com/serbanghita/Mobile-Detect.git", + "reference": "adb882ea3b9d154f087ecb2c333180dad6f4dd37" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/adb882ea3b9d154f087ecb2c333180dad6f4dd37", + "reference": "adb882ea3b9d154f087ecb2c333180dad6f4dd37", + "shasum": "" + }, + "require": { + "php": ">=5.0.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.35||~5.7" + }, + "type": "library", + "autoload": { + "classmap": [ + "Mobile_Detect.php" + ], + "psr-0": { + "Detection": "namespaced/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Serban Ghita", + "email": "serbanghita@gmail.com", + "homepage": "http://mobiledetect.net", + "role": "Developer" + } + ], + "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", + "homepage": "https://github.com/serbanghita/Mobile-Detect", + "keywords": [ + "detect mobile devices", + "mobile", + "mobile detect", + "mobile detector", + "php mobile detect" + ], + "time": "2018-02-26T19:39:55+00:00" + }, + { + "name": "mustangostang/spyc", + "version": "0.6.2", + "source": { + "type": "git", + "url": "https://github.com/mustangostang/spyc.git", + "reference": "23c35ae854d835f2d7bcc3e3ad743d7e57a8c14d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/mustangostang/spyc/zipball/23c35ae854d835f2d7bcc3e3ad743d7e57a8c14d", + "reference": "23c35ae854d835f2d7bcc3e3ad743d7e57a8c14d", + "shasum": "" + }, + "require": { + "php": ">=5.3.1" + }, + "require-dev": { + "phpunit/phpunit": "4.3.*@dev" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.5.x-dev" + } + }, + "autoload": { + "files": [ + "Spyc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "mustangostang", + "email": "vlad.andersen@gmail.com" + } + ], + "description": "A simple YAML loader/dumper class for PHP", + "homepage": "https://github.com/mustangostang/spyc/", + "keywords": [ + "spyc", + "yaml", + "yml" + ], + "time": "2017-02-24T16:06:33+00:00" + }, + { + "name": "oyejorge/less.php", + "version": "v1.7.0.14", + "source": { + "type": "git", + "url": "https://github.com/oyejorge/less.php.git", + "reference": "42925c5a01a07d67ca7e82dfc8fb31814d557bc9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/oyejorge/less.php/zipball/42925c5a01a07d67ca7e82dfc8fb31814d557bc9", + "reference": "42925c5a01a07d67ca7e82dfc8fb31814d557bc9", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~4.8.24" + }, + "bin": [ + "bin/lessc" + ], + "type": "library", + "autoload": { + "psr-0": { + "Less": "lib/" + }, + "classmap": [ + "lessc.inc.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "Matt Agar", + "homepage": "https://github.com/agar" + }, + { + "name": "Martin Jantošovič", + "homepage": "https://github.com/Mordred" + }, + { + "name": "Josh Schmidt", + "homepage": "https://github.com/oyejorge" + } + ], + "description": "PHP port of the Javascript version of LESS http://lesscss.org (Originally maintained by Josh Schmidt)", + "homepage": "http://lessphp.gpeasy.com", + "keywords": [ + "css", + "less", + "less.js", + "lesscss", + "php", + "stylesheet" + ], + "time": "2017-03-28T22:19:25+00:00" + }, + { + "name": "pclzip/pclzip", + "version": "2.8.2", + "source": { + "type": "git", + "url": "https://github.com/ivanlanin/pclzip.git", + "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ivanlanin/pclzip/zipball/19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", + "reference": "19dd1de9d3f5fc4d7d70175b4c344dee329f45fd", + "shasum": "" + }, + "type": "library", + "autoload": { + "classmap": [ + "pclzip.lib.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-2.1" + ], + "authors": [ + { + "name": "Vincent Blavet" + } + ], + "description": "A PHP library that offers compression and extraction functions for Zip formatted archives", + "homepage": "http://www.phpconcept.net/pclzip", + "keywords": [ + "php", + "zip" + ], + "time": "2014-06-05T11:42:24+00:00" + }, + { + "name": "phpgangsta/googleauthenticator", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/PHPGangsta/GoogleAuthenticator.git", + "reference": "3baa997f399d4afd5d6a81d42244ec9cc3eeb080" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPGangsta/GoogleAuthenticator/zipball/3baa997f399d4afd5d6a81d42244ec9cc3eeb080", + "reference": "3baa997f399d4afd5d6a81d42244ec9cc3eeb080", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "type": "library", + "autoload": { + "classmap": [ + "PHPGangsta/GoogleAuthenticator.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-4-Clause" + ], + "authors": [ + { + "name": "Michael Kliewe", + "email": "info@phpgangsta.de", + "homepage": "http://www.phpgangsta.de/", + "role": "Developer" + } + ], + "description": "Google Authenticator 2-factor authentication", + "keywords": [ + "googleauthenticator", + "rfc6238", + "totp" + ], + "time": "2016-10-08T16:35:34+00:00" + }, + { + "name": "phpseclib/phpseclib", + "version": "2.0.11", + "source": { + "type": "git", + "url": "https://github.com/phpseclib/phpseclib.git", + "reference": "7053f06f91b3de78e143d430e55a8f7889efc08b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7053f06f91b3de78e143d430e55a8f7889efc08b", + "reference": "7053f06f91b3de78e143d430e55a8f7889efc08b", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "require-dev": { + "phing/phing": "~2.7", + "phpunit/phpunit": "^4.8.35|^5.7|^6.0", + "sami/sami": "~2.0", + "squizlabs/php_codesniffer": "~2.0" + }, + "suggest": { + "ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.", + "ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.", + "ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.", + "ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations." + }, + "type": "library", + "autoload": { + "files": [ + "phpseclib/bootstrap.php" + ], + "psr-4": { + "phpseclib\\": "phpseclib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jim Wigginton", + "email": "terrafrost@php.net", + "role": "Lead Developer" + }, + { + "name": "Patrick Monnerat", + "email": "pm@datasphere.ch", + "role": "Developer" + }, + { + "name": "Andreas Fischer", + "email": "bantu@phpbb.com", + "role": "Developer" + }, + { + "name": "Hans-Jürgen Petrich", + "email": "petrich@tronic-media.com", + "role": "Developer" + }, + { + "name": "Graham Campbell", + "email": "graham@alt-three.com", + "role": "Developer" + } + ], + "description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.", + "homepage": "http://phpseclib.sourceforge.net", + "keywords": [ + "BigInteger", + "aes", + "asn.1", + "asn1", + "blowfish", + "crypto", + "cryptography", + "encryption", + "rsa", + "security", + "sftp", + "signature", + "signing", + "ssh", + "twofish", + "x.509", + "x509" + ], + "time": "2018-04-15T16:55:05+00:00" + }, + { + "name": "predis/predis", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/nrk/predis.git", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nrk/predis/zipball/f0210e38881631afeafb56ab43405a92cafd9fd1", + "reference": "f0210e38881631afeafb56ab43405a92cafd9fd1", + "shasum": "" + }, + "require": { + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "~4.8" + }, + "suggest": { + "ext-curl": "Allows access to Webdis when paired with phpiredis", + "ext-phpiredis": "Allows faster serialization and deserialization of the Redis protocol" + }, + "type": "library", + "autoload": { + "psr-4": { + "Predis\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Daniele Alessandri", + "email": "suppakilla@gmail.com", + "homepage": "http://clorophilla.net" + } + ], + "description": "Flexible and feature-complete Redis client for PHP and HHVM", + "homepage": "http://github.com/nrk/predis", + "keywords": [ + "nosql", + "predis", + "redis" + ], + "time": "2016-06-16T16:22:20+00:00" + }, + { + "name": "psr/log", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "Psr/Log/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "time": "2016-10-10T12:19:37+00:00" + }, + { + "name": "sabre/dav", + "version": "3.2.2", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/dav.git", + "reference": "e987775e619728f12205606c9cc3ee565ffb1516" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/dav/zipball/e987775e619728f12205606c9cc3ee565ffb1516", + "reference": "e987775e619728f12205606c9cc3ee565ffb1516", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-date": "*", + "ext-dom": "*", + "ext-iconv": "*", + "ext-mbstring": "*", + "ext-pcre": "*", + "ext-simplexml": "*", + "ext-spl": "*", + "lib-libxml": ">=2.7.0", + "php": ">=5.5.0", + "psr/log": "^1.0", + "sabre/event": ">=2.0.0, <4.0.0", + "sabre/http": "^4.2.1", + "sabre/uri": "^1.0.1", + "sabre/vobject": "^4.1.0", + "sabre/xml": "^1.4.0" + }, + "require-dev": { + "evert/phpdoc-md": "~0.1.0", + "monolog/monolog": "^1.18", + "phpunit/phpunit": "> 4.8, <6.0.0", + "sabre/cs": "^1.0.0" + }, + "suggest": { + "ext-curl": "*", + "ext-pdo": "*" + }, + "bin": [ + "bin/sabredav", + "bin/naturalselection" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Sabre\\DAV\\": "lib/DAV/", + "Sabre\\DAVACL\\": "lib/DAVACL/", + "Sabre\\CalDAV\\": "lib/CalDAV/", + "Sabre\\CardDAV\\": "lib/CardDAV/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "WebDAV Framework for PHP", + "homepage": "http://sabre.io/", + "keywords": [ + "CalDAV", + "CardDAV", + "WebDAV", + "framework", + "iCalendar" + ], + "time": "2017-02-15T03:06:08+00:00" + }, + { + "name": "sabre/event", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/event.git", + "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/event/zipball/831d586f5a442dceacdcf5e9c4c36a4db99a3534", + "reference": "831d586f5a442dceacdcf5e9c4c36a4db99a3534", + "shasum": "" + }, + "require": { + "php": ">=5.5" + }, + "require-dev": { + "phpunit/phpunit": "*", + "sabre/cs": "~0.0.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Sabre\\Event\\": "lib/" + }, + "files": [ + "lib/coroutine.php", + "lib/Loop/functions.php", + "lib/Promise/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "sabre/event is a library for lightweight event-based programming", + "homepage": "http://sabre.io/event/", + "keywords": [ + "EventEmitter", + "async", + "events", + "hooks", + "plugin", + "promise", + "signal" + ], + "time": "2015-11-05T20:14:39+00:00" + }, + { + "name": "sabre/http", + "version": "v4.2.4", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/http.git", + "reference": "acccec4ba863959b2d10c1fa0fb902736c5c8956" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/http/zipball/acccec4ba863959b2d10c1fa0fb902736c5c8956", + "reference": "acccec4ba863959b2d10c1fa0fb902736c5c8956", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-mbstring": "*", + "php": ">=5.4", + "sabre/event": ">=1.0.0,<4.0.0", + "sabre/uri": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~4.3", + "sabre/cs": "~0.0.1" + }, + "suggest": { + "ext-curl": " to make http requests with the Client class" + }, + "type": "library", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\HTTP\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "The sabre/http library provides utilities for dealing with http requests and responses. ", + "homepage": "https://github.com/fruux/sabre-http", + "keywords": [ + "http" + ], + "time": "2018-02-23T11:10:29+00:00" + }, + { + "name": "sabre/uri", + "version": "1.2.1", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/uri.git", + "reference": "ada354d83579565949d80b2e15593c2371225e61" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/uri/zipball/ada354d83579565949d80b2e15593c2371225e61", + "reference": "ada354d83579565949d80b2e15593c2371225e61", + "shasum": "" + }, + "require": { + "php": ">=5.4.7" + }, + "require-dev": { + "phpunit/phpunit": ">=4.0,<6.0", + "sabre/cs": "~1.0.0" + }, + "type": "library", + "autoload": { + "files": [ + "lib/functions.php" + ], + "psr-4": { + "Sabre\\Uri\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + } + ], + "description": "Functions for making sense out of URIs.", + "homepage": "http://sabre.io/uri/", + "keywords": [ + "rfc3986", + "uri", + "url" + ], + "time": "2017-02-20T19:59:28+00:00" + }, + { + "name": "sabre/vobject", + "version": "4.1.6", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/vobject.git", + "reference": "122cacbdea2c6133ac04db86ec05854beef75adf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/vobject/zipball/122cacbdea2c6133ac04db86ec05854beef75adf", + "reference": "122cacbdea2c6133ac04db86ec05854beef75adf", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.5", + "sabre/xml": ">=1.5 <3.0" + }, + "require-dev": { + "phpunit/phpunit": "> 4.8.35, <6.0.0", + "sabre/cs": "^1.0.0" + }, + "suggest": { + "hoa/bench": "If you would like to run the benchmark scripts" + }, + "bin": [ + "bin/vobject", + "bin/generate_vcards" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Sabre\\VObject\\": "lib/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + }, + { + "name": "Dominik Tobschall", + "email": "dominik@fruux.com", + "homepage": "http://tobschall.de/", + "role": "Developer" + }, + { + "name": "Ivan Enderlin", + "email": "ivan.enderlin@hoa-project.net", + "homepage": "http://mnt.io/", + "role": "Developer" + } + ], + "description": "The VObject library for PHP allows you to easily parse and manipulate iCalendar and vCard objects", + "homepage": "http://sabre.io/vobject/", + "keywords": [ + "availability", + "freebusy", + "iCalendar", + "ical", + "ics", + "jCal", + "jCard", + "recurrence", + "rfc2425", + "rfc2426", + "rfc2739", + "rfc4770", + "rfc5545", + "rfc5546", + "rfc6321", + "rfc6350", + "rfc6351", + "rfc6474", + "rfc6638", + "rfc6715", + "rfc6868", + "vCalendar", + "vCard", + "vcf", + "xCal", + "xCard" + ], + "time": "2018-04-20T07:22:50+00:00" + }, + { + "name": "sabre/xml", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/sabre-io/xml.git", + "reference": "59b20e5bbace9912607481634f97d05a776ffca7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sabre-io/xml/zipball/59b20e5bbace9912607481634f97d05a776ffca7", + "reference": "59b20e5bbace9912607481634f97d05a776ffca7", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-xmlreader": "*", + "ext-xmlwriter": "*", + "lib-libxml": ">=2.6.20", + "php": ">=5.5.5", + "sabre/uri": ">=1.0,<3.0.0" + }, + "require-dev": { + "phpunit/phpunit": "*", + "sabre/cs": "~1.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Sabre\\Xml\\": "lib/" + }, + "files": [ + "lib/Deserializer/functions.php", + "lib/Serializer/functions.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Evert Pot", + "email": "me@evertpot.com", + "homepage": "http://evertpot.com/", + "role": "Developer" + }, + { + "name": "Markus Staab", + "email": "markus.staab@redaxo.de", + "role": "Developer" + } + ], + "description": "sabre/xml is an XML library that you may not hate.", + "homepage": "https://sabre.io/xml/", + "keywords": [ + "XMLReader", + "XMLWriter", + "dom", + "xml" + ], + "time": "2016-10-09T22:57:52+00:00" + }, + { + "name": "themattharris/tmhoauth", + "version": "0.8.4", + "source": { + "type": "git", + "url": "https://github.com/themattharris/tmhOAuth.git", + "reference": "455552d6c57549632644b6c9ac9204766be2b5ee" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/themattharris/tmhOAuth/zipball/455552d6c57549632644b6c9ac9204766be2b5ee", + "reference": "455552d6c57549632644b6c9ac9204766be2b5ee", + "shasum": "" + }, + "require": { + "ext-curl": "*", + "php": ">=5.3.0" + }, + "type": "library", + "autoload": { + "psr-0": { + "tmhOAuth": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "Apache-2.0" + ], + "authors": [ + { + "name": "themattharris", + "email": "matt@themattharris.com", + "role": "Developer" + } + ], + "description": "An OAuth library written in PHP by @themattharris", + "keywords": [ + "oauth", + "twitter" + ], + "time": "2014-08-06T22:29:35+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": { + "phpgangsta/googleauthenticator": 20 + }, + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [] +} diff --git a/gulpfile.js b/gulpfile.js index ecee52209c..1fac0877e9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -38,6 +38,7 @@ var argv = require('yargs').argv, gulp = require('gulp'), + composer = require('gulp-composer'), concat = require('gulp-concat-util'), header = require('gulp-header'), stripbom = require('gulp-stripbom'), @@ -132,6 +133,7 @@ function copyFile(sFile, sNewFile, callback) } cfg.paths.globjs = 'dev/**/*.js'; +cfg.paths.php = 'rainloop/v/' + cfg.devVersion + '/app/vendor/'; cfg.paths.static = 'rainloop/v/' + cfg.devVersion + '/static/'; cfg.paths.staticJS = 'rainloop/v/' + cfg.devVersion + '/static/js/'; cfg.paths.staticMinJS = 'rainloop/v/' + cfg.devVersion + '/static/js/min/'; @@ -237,6 +239,15 @@ cfg.paths.js = { }; +// PHP +gulp.task('php:clean', function() { + return cleanDir(cfg.paths.php); +}); + +gulp.task('php', function() { + composer(); +}); + // assets gulp.task('assets:clean', function() { @@ -591,7 +602,7 @@ gulp.task('css', ['css:min']); gulp.task('vendors', ['moment', 'ckeditor', 'fontastic', 'lightgallery']); -gulp.task('clean', ['js:clean', 'css:clean', 'assets:clean']); +gulp.task('clean', ['php:clean', 'js:clean', 'css:clean', 'assets:clean']); gulp.task('rainloop:start', ['rainloop:copy', 'rainloop:setup']); @@ -603,7 +614,7 @@ gulp.task('owncloud', ['rainloop:owncloud:copy', // default gulp.task('default', function(callback) { - runSequence('clean', ['js', 'css', 'vendors'], callback); + runSequence('clean', ['php', 'js', 'css', 'vendors'], callback); }); // watch diff --git a/package.json b/package.json index 96ff86dba5..02c632b566 100644 --- a/package.json +++ b/package.json @@ -74,6 +74,7 @@ "gulp-cached": "1.1.1", "gulp-chmod": "2.0.0", "gulp-clean-css": "3.10.0", + "gulp-composer": "0.4.5", "gulp-concat-util": "0.5.5", "gulp-eol": "0.2.0", "gulp-eslint": "5.0.0", diff --git a/rainloop/v/0.0.0/app/handle.php b/rainloop/v/0.0.0/app/handle.php index f763f20cb7..68ffb3d612 100644 --- a/rainloop/v/0.0.0/app/handle.php +++ b/rainloop/v/0.0.0/app/handle.php @@ -4,8 +4,8 @@ { \define('RAINLOOP_APP_PATH', \rtrim(\realpath(__DIR__), '\\/').'/'); \define('RAINLOOP_APP_LIBRARIES_PATH', RAINLOOP_APP_PATH.'libraries/'); + \define('RAINLOOP_APP_VENDOR_PATH', RAINLOOP_APP_PATH.'vendor/'); \define('RAINLOOP_MB_SUPPORTED', \function_exists('mb_strtoupper')); - \define('RAINLOOP_INCLUDE_AS_API_DEF', isset($_ENV['RAINLOOP_INCLUDE_AS_API']) && $_ENV['RAINLOOP_INCLUDE_AS_API']); if (!defined('RL_BACKWARD_CAPABILITY')) @@ -14,15 +14,16 @@ include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/Common/BackwardCapability/Account.php'; } - /** - * @param string $sClassName - * - * @return mixed - */ - function rainLoopSplAutoloadNamespaces() + if (!RAINLOOP_MB_SUPPORTED && !defined('RL_MB_FIXED')) + { + \define('RL_MB_FIXED', true); + include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/Common/MbStringFix.php'; + } + + if (!defined('RL_VENDOR_LIBRARY_LOADER')) { - return RAINLOOP_INCLUDE_AS_API_DEF ? array('RainLoop', 'Predis') : - array('RainLoop', 'Facebook', 'PHPThumb', 'Predis', 'SabreForRainLoop', 'Imagine', 'Detection'); + \define('RL_VENDOR_LIBRARY_LOADER', true); + include_once RAINLOOP_APP_VENDOR_PATH.'autoload.php'; } /** @@ -37,24 +38,9 @@ function rainLoopSplAutoloadRegisterFunction($sClassName) $sClassName = \substr($sClassName, 1); } - foreach (rainLoopSplAutoloadNamespaces() as $sNamespaceName) + if (0 === \strpos($sClassName, 'RainLoop\\')) { - if (0 === \strpos($sClassName, $sNamespaceName.'\\')) - { - $sPrefix = ''; - if ('Detection' === $sNamespaceName) - { - $sPrefix = 'Mobile_Detect/namespaced/'; - } - - if ('SabreForRainLoop' === $sNamespaceName && !RAINLOOP_MB_SUPPORTED && !defined('RL_MB_FIXED')) - { - \define('RL_MB_FIXED', true); - include_once RAINLOOP_APP_LIBRARIES_PATH.'RainLoop/Common/MbStringFix.php'; - } - - return include RAINLOOP_APP_LIBRARIES_PATH.$sPrefix.\strtr($sClassName, '\\', '/').'.php'; - } + return include RAINLOOP_APP_LIBRARIES_PATH.\strtr($sClassName, '\\', '/').'.php'; } return false; @@ -67,12 +53,7 @@ function rainLoopSplAutoloadRegisterFunction($sClassName) { if (!\class_exists('MailSo\Version', false)) { - include APP_VERSION_ROOT_PATH.'app/libraries/MailSo/MailSo.php'; - } - - if (!\function_exists('spyc_load_file')) - { - include APP_VERSION_ROOT_PATH.'app/libraries/spyc/Spyc.php'; + include RAINLOOP_APP_LIBRARIES_PATH.'MailSo/MailSo.php'; } if (\class_exists('MailSo\Version')) diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessToken.php b/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessToken.php deleted file mode 100644 index 582ea61360..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessToken.php +++ /dev/null @@ -1,160 +0,0 @@ -value = $accessToken; - if ($expiresAt) { - $this->setExpiresAtFromTimeStamp($expiresAt); - } - } - - /** - * Generate an app secret proof to sign a request to Graph. - * - * @param string $appSecret The app secret. - * - * @return string - */ - public function getAppSecretProof($appSecret) - { - return hash_hmac('sha256', $this->value, $appSecret); - } - - /** - * Getter for expiresAt. - * - * @return \DateTime|null - */ - public function getExpiresAt() - { - return $this->expiresAt; - } - - /** - * Determines whether or not this is an app access token. - * - * @return bool - */ - public function isAppAccessToken() - { - return strpos($this->value, '|') !== false; - } - - /** - * Determines whether or not this is a long-lived token. - * - * @return bool - */ - public function isLongLived() - { - if ($this->expiresAt) { - return $this->expiresAt->getTimestamp() > time() + (60 * 60 * 2); - } - - if ($this->isAppAccessToken()) { - return true; - } - - return false; - } - - /** - * Checks the expiration of the access token. - * - * @return boolean|null - */ - public function isExpired() - { - if ($this->getExpiresAt() instanceof \DateTime) { - return $this->getExpiresAt()->getTimestamp() < time(); - } - - if ($this->isAppAccessToken()) { - return false; - } - - return null; - } - - /** - * Returns the access token as a string. - * - * @return string - */ - public function getValue() - { - return $this->value; - } - - /** - * Returns the access token as a string. - * - * @return string - */ - public function __toString() - { - return $this->getValue(); - } - - /** - * Setter for expires_at. - * - * @param int $timeStamp - */ - protected function setExpiresAtFromTimeStamp($timeStamp) - { - $dt = new \DateTime(); - $dt->setTimestamp($timeStamp); - $this->expiresAt = $dt; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessTokenMetadata.php b/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessTokenMetadata.php deleted file mode 100644 index f302a6d2fb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/AccessTokenMetadata.php +++ /dev/null @@ -1,390 +0,0 @@ -metadata = $metadata['data']; - - $this->castTimestampsToDateTime(); - } - - /** - * Returns a value from the metadata. - * - * @param string $field The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - */ - public function getField($field, $default = null) - { - if (isset($this->metadata[$field])) { - return $this->metadata[$field]; - } - - return $default; - } - - /** - * Returns a value from the metadata. - * - * @param string $field The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - * - * @deprecated 5.0.0 getProperty() has been renamed to getField() - * @todo v6: Remove this method - */ - public function getProperty($field, $default = null) - { - return $this->getField($field, $default); - } - - /** - * Returns a value from a child property in the metadata. - * - * @param string $parentField The parent property. - * @param string $field The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - */ - public function getChildProperty($parentField, $field, $default = null) - { - if (!isset($this->metadata[$parentField])) { - return $default; - } - - if (!isset($this->metadata[$parentField][$field])) { - return $default; - } - - return $this->metadata[$parentField][$field]; - } - - /** - * Returns a value from the error metadata. - * - * @param string $field The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - */ - public function getErrorProperty($field, $default = null) - { - return $this->getChildProperty('error', $field, $default); - } - - /** - * Returns a value from the "metadata" metadata. *Brain explodes* - * - * @param string $field The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - */ - public function getMetadataProperty($field, $default = null) - { - return $this->getChildProperty('metadata', $field, $default); - } - - /** - * The ID of the application this access token is for. - * - * @return string|null - */ - public function getAppId() - { - return $this->getField('app_id'); - } - - /** - * Name of the application this access token is for. - * - * @return string|null - */ - public function getApplication() - { - return $this->getField('application'); - } - - /** - * Any error that a request to the graph api - * would return due to the access token. - * - * @return bool|null - */ - public function isError() - { - return $this->getField('error') !== null; - } - - /** - * The error code for the error. - * - * @return int|null - */ - public function getErrorCode() - { - return $this->getErrorProperty('code'); - } - - /** - * The error message for the error. - * - * @return string|null - */ - public function getErrorMessage() - { - return $this->getErrorProperty('message'); - } - - /** - * The error subcode for the error. - * - * @return int|null - */ - public function getErrorSubcode() - { - return $this->getErrorProperty('subcode'); - } - - /** - * DateTime when this access token expires. - * - * @return \DateTime|null - */ - public function getExpiresAt() - { - return $this->getField('expires_at'); - } - - /** - * Whether the access token is still valid or not. - * - * @return boolean|null - */ - public function getIsValid() - { - return $this->getField('is_valid'); - } - - /** - * DateTime when this access token was issued. - * - * Note that the issued_at field is not returned - * for short-lived access tokens. - * - * @see https://developers.facebook.com/docs/facebook-login/access-tokens#debug - * - * @return \DateTime|null - */ - public function getIssuedAt() - { - return $this->getField('issued_at'); - } - - /** - * General metadata associated with the access token. - * Can contain data like 'sso', 'auth_type', 'auth_nonce'. - * - * @return array|null - */ - public function getMetadata() - { - return $this->getField('metadata'); - } - - /** - * The 'sso' child property from the 'metadata' parent property. - * - * @return string|null - */ - public function getSso() - { - return $this->getMetadataProperty('sso'); - } - - /** - * The 'auth_type' child property from the 'metadata' parent property. - * - * @return string|null - */ - public function getAuthType() - { - return $this->getMetadataProperty('auth_type'); - } - - /** - * The 'auth_nonce' child property from the 'metadata' parent property. - * - * @return string|null - */ - public function getAuthNonce() - { - return $this->getMetadataProperty('auth_nonce'); - } - - /** - * For impersonated access tokens, the ID of - * the page this token contains. - * - * @return string|null - */ - public function getProfileId() - { - return $this->getField('profile_id'); - } - - /** - * List of permissions that the user has granted for - * the app in this access token. - * - * @return array - */ - public function getScopes() - { - return $this->getField('scopes'); - } - - /** - * The ID of the user this access token is for. - * - * @return string|null - */ - public function getUserId() - { - return $this->getField('user_id'); - } - - /** - * Ensures the app ID from the access token - * metadata is what we expect. - * - * @param string $appId - * - * @throws FacebookSDKException - */ - public function validateAppId($appId) - { - if ($this->getAppId() !== $appId) { - throw new FacebookSDKException('Access token metadata contains unexpected app ID.', 401); - } - } - - /** - * Ensures the user ID from the access token - * metadata is what we expect. - * - * @param string $userId - * - * @throws FacebookSDKException - */ - public function validateUserId($userId) - { - if ($this->getUserId() !== $userId) { - throw new FacebookSDKException('Access token metadata contains unexpected user ID.', 401); - } - } - - /** - * Ensures the access token has not expired yet. - * - * @throws FacebookSDKException - */ - public function validateExpiration() - { - if (!$this->getExpiresAt() instanceof \DateTime) { - return; - } - - if ($this->getExpiresAt()->getTimestamp() < time()) { - throw new FacebookSDKException('Inspection of access token metadata shows that the access token has expired.', 401); - } - } - - /** - * Converts a unix timestamp into a DateTime entity. - * - * @param int $timestamp - * - * @return \DateTime - */ - private function convertTimestampToDateTime($timestamp) - { - $dt = new \DateTime(); - $dt->setTimestamp($timestamp); - - return $dt; - } - - /** - * Casts the unix timestamps as DateTime entities. - */ - private function castTimestampsToDateTime() - { - foreach (static::$dateProperties as $key) { - if (isset($this->metadata[$key])) { - $this->metadata[$key] = $this->convertTimestampToDateTime($this->metadata[$key]); - } - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/OAuth2Client.php b/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/OAuth2Client.php deleted file mode 100644 index 8e364ec832..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Authentication/OAuth2Client.php +++ /dev/null @@ -1,292 +0,0 @@ -app = $app; - $this->client = $client; - $this->graphVersion = $graphVersion ?: Facebook::DEFAULT_GRAPH_VERSION; - } - - /** - * Returns the last FacebookRequest that was sent. - * Useful for debugging and testing. - * - * @return FacebookRequest|null - */ - public function getLastRequest() - { - return $this->lastRequest; - } - - /** - * Get the metadata associated with the access token. - * - * @param AccessToken|string $accessToken The access token to debug. - * - * @return AccessTokenMetadata - */ - public function debugToken($accessToken) - { - $accessToken = $accessToken instanceof AccessToken ? $accessToken->getValue() : $accessToken; - $params = ['input_token' => $accessToken]; - - $this->lastRequest = new FacebookRequest( - $this->app, - $this->app->getAccessToken(), - 'GET', - '/debug_token', - $params, - null, - $this->graphVersion - ); - $response = $this->client->sendRequest($this->lastRequest); - $metadata = $response->getDecodedBody(); - - return new AccessTokenMetadata($metadata); - } - - /** - * Generates an authorization URL to begin the process of authenticating a user. - * - * @param string $redirectUrl The callback URL to redirect to. - * @param array $scope An array of permissions to request. - * @param string $state The CSPRNG-generated CSRF value. - * @param array $params An array of parameters to generate URL. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - */ - public function getAuthorizationUrl($redirectUrl, $state, array $scope = [], array $params = [], $separator = '&') - { - $params += [ - 'client_id' => $this->app->getId(), - 'state' => $state, - 'response_type' => 'code', - 'sdk' => 'php-sdk-' . Facebook::VERSION, - 'redirect_uri' => $redirectUrl, - 'scope' => implode(',', $scope) - ]; - - return static::BASE_AUTHORIZATION_URL . '/' . $this->graphVersion . '/dialog/oauth?' . http_build_query($params, null, $separator); - } - - /** - * Get a valid access token from a code. - * - * @param string $code - * @param string $redirectUri - * - * @return AccessToken - * - * @throws FacebookSDKException - */ - public function getAccessTokenFromCode($code, $redirectUri = '') - { - $params = [ - 'code' => $code, - 'redirect_uri' => $redirectUri, - ]; - - return $this->requestAnAccessToken($params); - } - - /** - * Exchanges a short-lived access token with a long-lived access token. - * - * @param AccessToken|string $accessToken - * - * @return AccessToken - * - * @throws FacebookSDKException - */ - public function getLongLivedAccessToken($accessToken) - { - $accessToken = $accessToken instanceof AccessToken ? $accessToken->getValue() : $accessToken; - $params = [ - 'grant_type' => 'fb_exchange_token', - 'fb_exchange_token' => $accessToken, - ]; - - return $this->requestAnAccessToken($params); - } - - /** - * Get a valid code from an access token. - * - * @param AccessToken|string $accessToken - * @param string $redirectUri - * - * @return AccessToken - * - * @throws FacebookSDKException - */ - public function getCodeFromLongLivedAccessToken($accessToken, $redirectUri = '') - { - $params = [ - 'redirect_uri' => $redirectUri, - ]; - - $response = $this->sendRequestWithClientParams('/oauth/client_code', $params, $accessToken); - $data = $response->getDecodedBody(); - - if (!isset($data['code'])) { - throw new FacebookSDKException('Code was not returned from Graph.', 401); - } - - return $data['code']; - } - - /** - * Send a request to the OAuth endpoint. - * - * @param array $params - * - * @return AccessToken - * - * @throws FacebookSDKException - */ - protected function requestAnAccessToken(array $params) - { - $response = $this->sendRequestWithClientParams('/oauth/access_token', $params); - $data = $response->getDecodedBody(); - - if (!isset($data['access_token'])) { - throw new FacebookSDKException('Access token was not returned from Graph.', 401); - } - - // Graph returns two different key names for expiration time - // on the same endpoint. Doh! :/ - $expiresAt = 0; - if (isset($data['expires'])) { - // For exchanging a short lived token with a long lived token. - // The expiration time in seconds will be returned as "expires". - $expiresAt = time() + $data['expires']; - } elseif (isset($data['expires_in'])) { - // For exchanging a code for a short lived access token. - // The expiration time in seconds will be returned as "expires_in". - // See: https://developers.facebook.com/docs/facebook-login/access-tokens#long-via-code - $expiresAt = time() + $data['expires_in']; - } - - return new AccessToken($data['access_token'], $expiresAt); - } - - /** - * Send a request to Graph with an app access token. - * - * @param string $endpoint - * @param array $params - * @param string|null $accessToken - * - * @return FacebookResponse - * - * @throws FacebookResponseException - */ - protected function sendRequestWithClientParams($endpoint, array $params, $accessToken = null) - { - $params += $this->getClientParams(); - - $accessToken = $accessToken ?: $this->app->getAccessToken(); - - $this->lastRequest = new FacebookRequest( - $this->app, - $accessToken, - 'GET', - $endpoint, - $params, - null, - $this->graphVersion - ); - - return $this->client->sendRequest($this->lastRequest); - } - - /** - * Returns the client_* params for OAuth requests. - * - * @return array - */ - protected function getClientParams() - { - return [ - 'client_id' => $this->app->getId(), - 'client_secret' => $this->app->getSecret(), - ]; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookAuthenticationException.php b/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookAuthenticationException.php deleted file mode 100644 index 449cf93e61..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookAuthenticationException.php +++ /dev/null @@ -1,33 +0,0 @@ -response = $response; - $this->responseData = $response->getDecodedBody(); - - $errorMessage = $this->get('message', 'Unknown error from Graph.'); - $errorCode = $this->get('code', -1); - - parent::__construct($errorMessage, $errorCode, $previousException); - } - - /** - * A factory for creating the appropriate exception based on the response from Graph. - * - * @param FacebookResponse $response The response that threw the exception. - * - * @return FacebookResponseException - */ - public static function create(FacebookResponse $response) - { - $data = $response->getDecodedBody(); - - if (!isset($data['error']['code']) && isset($data['code'])) { - $data = ['error' => $data]; - } - - $code = isset($data['error']['code']) ? $data['error']['code'] : null; - $message = isset($data['error']['message']) ? $data['error']['message'] : 'Unknown error from Graph.'; - - $previousException = null; - - if (isset($data['error']['error_subcode'])) { - switch ($data['error']['error_subcode']) { - // Other authentication issues - case 458: - case 459: - case 460: - case 463: - case 464: - case 467: - return new static($response, new FacebookAuthenticationException($message, $code)); - } - } - - switch ($code) { - // Login status or token expired, revoked, or invalid - case 100: - case 102: - case 190: - return new static($response, new FacebookAuthenticationException($message, $code)); - - // Server issue, possible downtime - case 1: - case 2: - return new static($response, new FacebookServerException($message, $code)); - - // API Throttling - case 4: - case 17: - case 341: - return new static($response, new FacebookThrottleException($message, $code)); - - // Duplicate Post - case 506: - return new static($response, new FacebookClientException($message, $code)); - } - - // Missing Permissions - if ($code == 10 || ($code >= 200 && $code <= 299)) { - return new static($response, new FacebookAuthorizationException($message, $code)); - } - - // OAuth authentication error - if (isset($data['error']['type']) && $data['error']['type'] === 'OAuthException') { - return new static($response, new FacebookAuthenticationException($message, $code)); - } - - // All others - return new static($response, new FacebookOtherException($message, $code)); - } - - /** - * Checks isset and returns that or a default value. - * - * @param string $key - * @param mixed $default - * - * @return mixed - */ - private function get($key, $default = null) - { - if (isset($this->responseData['error'][$key])) { - return $this->responseData['error'][$key]; - } - - return $default; - } - - /** - * Returns the HTTP status code - * - * @return int - */ - public function getHttpStatusCode() - { - return $this->response->getHttpStatusCode(); - } - - /** - * Returns the sub-error code - * - * @return int - */ - public function getSubErrorCode() - { - return $this->get('error_subcode', -1); - } - - /** - * Returns the error type - * - * @return string - */ - public function getErrorType() - { - return $this->get('type', ''); - } - - /** - * Returns the raw response used to create the exception. - * - * @return string - */ - public function getRawResponse() - { - return $this->response->getBody(); - } - - /** - * Returns the decoded response used to create the exception. - * - * @return array - */ - public function getResponseData() - { - return $this->responseData; - } - - /** - * Returns the response entity used to create the exception. - * - * @return FacebookResponse - */ - public function getResponse() - { - return $this->response; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookSDKException.php b/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookSDKException.php deleted file mode 100644 index 03219b0ef5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Exceptions/FacebookSDKException.php +++ /dev/null @@ -1,33 +0,0 @@ -app = new FacebookApp($appId, $appSecret); - - $httpClientHandler = null; - if (isset($config['http_client_handler'])) { - if ($config['http_client_handler'] instanceof FacebookHttpClientInterface) { - $httpClientHandler = $config['http_client_handler']; - } elseif ($config['http_client_handler'] === 'curl') { - $httpClientHandler = new FacebookCurlHttpClient(); - } elseif ($config['http_client_handler'] === 'stream') { - $httpClientHandler = new FacebookStreamHttpClient(); - } elseif ($config['http_client_handler'] === 'guzzle') { - $httpClientHandler = new FacebookGuzzleHttpClient(); - } else { - throw new \InvalidArgumentException('The http_client_handler must be set to "curl", "stream", "guzzle", or be an instance of Facebook\HttpClients\FacebookHttpClientInterface'); - } - } - - $enableBeta = isset($config['enable_beta_mode']) && $config['enable_beta_mode'] === true; - $this->client = new FacebookClient($httpClientHandler, $enableBeta); - - if (isset($config['url_detection_handler'])) { - if ($config['url_detection_handler'] instanceof UrlDetectionInterface) { - $this->urlDetectionHandler = $config['url_detection_handler']; - } else { - throw new \InvalidArgumentException('The url_detection_handler must be an instance of Facebook\Url\UrlDetectionInterface'); - } - } - - if (isset($config['pseudo_random_string_generator'])) { - if ($config['pseudo_random_string_generator'] instanceof PseudoRandomStringGeneratorInterface) { - $this->pseudoRandomStringGenerator = $config['pseudo_random_string_generator']; - } elseif ($config['pseudo_random_string_generator'] === 'mcrypt') { - $this->pseudoRandomStringGenerator = new McryptPseudoRandomStringGenerator(); - } elseif ($config['pseudo_random_string_generator'] === 'openssl') { - $this->pseudoRandomStringGenerator = new OpenSslPseudoRandomStringGenerator(); - } elseif ($config['pseudo_random_string_generator'] === 'urandom') { - $this->pseudoRandomStringGenerator = new UrandomPseudoRandomStringGenerator(); - } else { - throw new \InvalidArgumentException('The pseudo_random_string_generator must be set to "mcrypt", "openssl", or "urandom", or be an instance of Facebook\PseudoRandomString\PseudoRandomStringGeneratorInterface'); - } - } - - if (isset($config['persistent_data_handler'])) { - if ($config['persistent_data_handler'] instanceof PersistentDataInterface) { - $this->persistentDataHandler = $config['persistent_data_handler']; - } elseif ($config['persistent_data_handler'] === 'session') { - $this->persistentDataHandler = new FacebookSessionPersistentDataHandler(); - } elseif ($config['persistent_data_handler'] === 'memory') { - $this->persistentDataHandler = new FacebookMemoryPersistentDataHandler(); - } else { - throw new \InvalidArgumentException('The persistent_data_handler must be set to "session", "memory", or be an instance of Facebook\PersistentData\PersistentDataInterface'); - } - } - - if (isset($config['default_access_token'])) { - $this->setDefaultAccessToken($config['default_access_token']); - } - - if (isset($config['default_graph_version'])) { - $this->defaultGraphVersion = $config['default_graph_version']; - } else { - // @todo v6: Throw an InvalidArgumentException if "default_graph_version" is not set - $this->defaultGraphVersion = static::DEFAULT_GRAPH_VERSION; - } - } - - /** - * Returns the FacebookApp entity. - * - * @return FacebookApp - */ - public function getApp() - { - return $this->app; - } - - /** - * Returns the FacebookClient service. - * - * @return FacebookClient - */ - public function getClient() - { - return $this->client; - } - - /** - * Returns the OAuth 2.0 client service. - * - * @return OAuth2Client - */ - public function getOAuth2Client() - { - if (!$this->oAuth2Client instanceof OAuth2Client) { - $app = $this->getApp(); - $client = $this->getClient(); - $this->oAuth2Client = new OAuth2Client($app, $client, $this->defaultGraphVersion); - } - - return $this->oAuth2Client; - } - - /** - * Returns the last response returned from Graph. - * - * @return FacebookResponse|FacebookBatchResponse|null - */ - public function getLastResponse() - { - return $this->lastResponse; - } - - /** - * Returns the URL detection handler. - * - * @return UrlDetectionInterface - */ - public function getUrlDetectionHandler() - { - if (!$this->urlDetectionHandler instanceof UrlDetectionInterface) { - $this->urlDetectionHandler = new FacebookUrlDetectionHandler(); - } - - return $this->urlDetectionHandler; - } - - /** - * Returns the default AccessToken entity. - * - * @return AccessToken|null - */ - public function getDefaultAccessToken() - { - return $this->defaultAccessToken; - } - - /** - * Sets the default access token to use with requests. - * - * @param AccessToken|string $accessToken The access token to save. - * - * @throws \InvalidArgumentException - */ - public function setDefaultAccessToken($accessToken) - { - if (is_string($accessToken)) { - $this->defaultAccessToken = new AccessToken($accessToken); - - return; - } - - if ($accessToken instanceof AccessToken) { - $this->defaultAccessToken = $accessToken; - - return; - } - - throw new \InvalidArgumentException('The default access token must be of type "string" or Facebook\AccessToken'); - } - - /** - * Returns the default Graph version. - * - * @return string - */ - public function getDefaultGraphVersion() - { - return $this->defaultGraphVersion; - } - - /** - * Returns the redirect login helper. - * - * @return FacebookRedirectLoginHelper - */ - public function getRedirectLoginHelper() - { - return new FacebookRedirectLoginHelper( - $this->getOAuth2Client(), - $this->persistentDataHandler, - $this->urlDetectionHandler, - $this->pseudoRandomStringGenerator - ); - } - - /** - * Returns the JavaScript helper. - * - * @return FacebookJavaScriptHelper - */ - public function getJavaScriptHelper() - { - return new FacebookJavaScriptHelper($this->app, $this->client, $this->defaultGraphVersion); - } - - /** - * Returns the canvas helper. - * - * @return FacebookCanvasHelper - */ - public function getCanvasHelper() - { - return new FacebookCanvasHelper($this->app, $this->client, $this->defaultGraphVersion); - } - - /** - * Returns the page tab helper. - * - * @return FacebookPageTabHelper - */ - public function getPageTabHelper() - { - return new FacebookPageTabHelper($this->app, $this->client, $this->defaultGraphVersion); - } - - /** - * Sends a GET request to Graph and returns the result. - * - * @param string $endpoint - * @param AccessToken|string|null $accessToken - * @param string|null $eTag - * @param string|null $graphVersion - * - * @return FacebookResponse - * - * @throws FacebookSDKException - */ - public function get($endpoint, $accessToken = null, $eTag = null, $graphVersion = null) - { - return $this->sendRequest( - 'GET', - $endpoint, - $params = [], - $accessToken, - $eTag, - $graphVersion - ); - } - - /** - * Sends a POST request to Graph and returns the result. - * - * @param string $endpoint - * @param array $params - * @param AccessToken|string|null $accessToken - * @param string|null $eTag - * @param string|null $graphVersion - * - * @return FacebookResponse - * - * @throws FacebookSDKException - */ - public function post($endpoint, array $params = [], $accessToken = null, $eTag = null, $graphVersion = null) - { - return $this->sendRequest( - 'POST', - $endpoint, - $params, - $accessToken, - $eTag, - $graphVersion - ); - } - - /** - * Sends a DELETE request to Graph and returns the result. - * - * @param string $endpoint - * @param array $params - * @param AccessToken|string|null $accessToken - * @param string|null $eTag - * @param string|null $graphVersion - * - * @return FacebookResponse - * - * @throws FacebookSDKException - */ - public function delete($endpoint, array $params = [], $accessToken = null, $eTag = null, $graphVersion = null) - { - return $this->sendRequest( - 'DELETE', - $endpoint, - $params, - $accessToken, - $eTag, - $graphVersion - ); - } - - /** - * Sends a request to Graph for the next page of results. - * - * @param GraphEdge $graphEdge The GraphEdge to paginate over. - * - * @return GraphEdge|null - * - * @throws FacebookSDKException - */ - public function next(GraphEdge $graphEdge) - { - return $this->getPaginationResults($graphEdge, 'next'); - } - - /** - * Sends a request to Graph for the previous page of results. - * - * @param GraphEdge $graphEdge The GraphEdge to paginate over. - * - * @return GraphEdge|null - * - * @throws FacebookSDKException - */ - public function previous(GraphEdge $graphEdge) - { - return $this->getPaginationResults($graphEdge, 'previous'); - } - - /** - * Sends a request to Graph for the next page of results. - * - * @param GraphEdge $graphEdge The GraphEdge to paginate over. - * @param string $direction The direction of the pagination: next|previous. - * - * @return GraphEdge|null - * - * @throws FacebookSDKException - */ - public function getPaginationResults(GraphEdge $graphEdge, $direction) - { - $paginationRequest = $graphEdge->getPaginationRequest($direction); - if (!$paginationRequest) { - return null; - } - - $this->lastResponse = $this->client->sendRequest($paginationRequest); - - // Keep the same GraphNode subclass - $subClassName = $graphEdge->getSubClassName(); - $graphEdge = $this->lastResponse->getGraphEdge($subClassName, false); - - return count($graphEdge) > 0 ? $graphEdge : null; - } - - /** - * Sends a request to Graph and returns the result. - * - * @param string $method - * @param string $endpoint - * @param array $params - * @param AccessToken|string|null $accessToken - * @param string|null $eTag - * @param string|null $graphVersion - * - * @return FacebookResponse - * - * @throws FacebookSDKException - */ - public function sendRequest($method, $endpoint, array $params = [], $accessToken = null, $eTag = null, $graphVersion = null) - { - $accessToken = $accessToken ?: $this->defaultAccessToken; - $graphVersion = $graphVersion ?: $this->defaultGraphVersion; - $request = $this->request($method, $endpoint, $params, $accessToken, $eTag, $graphVersion); - - return $this->lastResponse = $this->client->sendRequest($request); - } - - /** - * Sends a batched request to Graph and returns the result. - * - * @param array $requests - * @param AccessToken|string|null $accessToken - * @param string|null $graphVersion - * - * @return FacebookBatchResponse - * - * @throws FacebookSDKException - */ - public function sendBatchRequest(array $requests, $accessToken = null, $graphVersion = null) - { - $accessToken = $accessToken ?: $this->defaultAccessToken; - $graphVersion = $graphVersion ?: $this->defaultGraphVersion; - $batchRequest = new FacebookBatchRequest( - $this->app, - $requests, - $accessToken, - $graphVersion - ); - - return $this->lastResponse = $this->client->sendBatchRequest($batchRequest); - } - - /** - * Instantiates a new FacebookRequest entity. - * - * @param string $method - * @param string $endpoint - * @param array $params - * @param AccessToken|string|null $accessToken - * @param string|null $eTag - * @param string|null $graphVersion - * - * @return FacebookRequest - * - * @throws FacebookSDKException - */ - public function request($method, $endpoint, array $params = [], $accessToken = null, $eTag = null, $graphVersion = null) - { - $accessToken = $accessToken ?: $this->defaultAccessToken; - $graphVersion = $graphVersion ?: $this->defaultGraphVersion; - - return new FacebookRequest( - $this->app, - $accessToken, - $method, - $endpoint, - $params, - $eTag, - $graphVersion - ); - } - - /** - * Factory to create FacebookFile's. - * - * @param string $pathToFile - * - * @return FacebookFile - * - * @throws FacebookSDKException - */ - public function fileToUpload($pathToFile) - { - return new FacebookFile($pathToFile); - } - - /** - * Factory to create FacebookVideo's. - * - * @param string $pathToFile - * - * @return FacebookVideo - * - * @throws FacebookSDKException - */ - public function videoToUpload($pathToFile) - { - return new FacebookVideo($pathToFile); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookApp.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookApp.php deleted file mode 100644 index 84956ce98d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookApp.php +++ /dev/null @@ -1,101 +0,0 @@ -id = $id; - $this->secret = $secret; - } - - /** - * Returns the app ID. - * - * @return string - */ - public function getId() - { - return $this->id; - } - - /** - * Returns the app secret. - * - * @return string - */ - public function getSecret() - { - return $this->secret; - } - - /** - * Returns an app access token. - * - * @return AccessToken - */ - public function getAccessToken() - { - return new AccessToken($this->id . '|' . $this->secret); - } - - /** - * Serializes the FacebookApp entity as a string. - * - * @return string - */ - public function serialize() - { - return serialize([$this->id, $this->secret]); - } - - /** - * Unserializes a string as a FacebookApp entity. - * - * @param string $serialized - */ - public function unserialize($serialized) - { - list($id, $secret) = unserialize($serialized); - - $this->__construct($id, $secret); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchRequest.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchRequest.php deleted file mode 100644 index 33c489cf8d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchRequest.php +++ /dev/null @@ -1,303 +0,0 @@ -add($requests); - } - - /** - * A a new request to the array. - * - * @param FacebookRequest|array $request - * @param string|null $name - * - * @return FacebookBatchRequest - * - * @throws \InvalidArgumentException - */ - public function add($request, $name = null) - { - if (is_array($request)) { - foreach ($request as $key => $req) { - $this->add($req, $key); - } - - return $this; - } - - if (!$request instanceof FacebookRequest) { - throw new \InvalidArgumentException('Argument for add() must be of type array or FacebookRequest.'); - } - - $this->addFallbackDefaults($request); - $requestToAdd = [ - 'name' => $name, - 'request' => $request, - ]; - - // File uploads - $attachedFiles = $this->extractFileAttachments($request); - if ($attachedFiles) { - $requestToAdd['attached_files'] = $attachedFiles; - } - $this->requests[] = $requestToAdd; - - return $this; - } - - /** - * Ensures that the FacebookApp and access token fall back when missing. - * - * @param FacebookRequest $request - * - * @throws FacebookSDKException - */ - public function addFallbackDefaults(FacebookRequest $request) - { - if (!$request->getApp()) { - $app = $this->getApp(); - if (!$app) { - throw new FacebookSDKException('Missing FacebookApp on FacebookRequest and no fallback detected on FacebookBatchRequest.'); - } - $request->setApp($app); - } - - if (!$request->getAccessToken()) { - $accessToken = $this->getAccessToken(); - if (!$accessToken) { - throw new FacebookSDKException('Missing access token on FacebookRequest and no fallback detected on FacebookBatchRequest.'); - } - $request->setAccessToken($accessToken); - } - } - - /** - * Extracts the files from a request. - * - * @param FacebookRequest $request - * - * @return string|null - * - * @throws FacebookSDKException - */ - public function extractFileAttachments(FacebookRequest $request) - { - if (!$request->containsFileUploads()) { - return null; - } - - $files = $request->getFiles(); - $fileNames = []; - foreach ($files as $file) { - $fileName = uniqid(); - $this->addFile($fileName, $file); - $fileNames[] = $fileName; - } - - $request->resetFiles(); - - // @TODO Does Graph support multiple uploads on one endpoint? - return implode(',', $fileNames); - } - - /** - * Return the FacebookRequest entities. - * - * @return array - */ - public function getRequests() - { - return $this->requests; - } - - /** - * Prepares the requests to be sent as a batch request. - * - * @return string - */ - public function prepareRequestsForBatch() - { - $this->validateBatchRequestCount(); - - $params = [ - 'batch' => $this->convertRequestsToJson(), - 'include_headers' => true, - ]; - $this->setParams($params); - } - - /** - * Converts the requests into a JSON(P) string. - * - * @return string - */ - public function convertRequestsToJson() - { - $requests = []; - foreach ($this->requests as $request) { - $attachedFiles = isset($request['attached_files']) ? $request['attached_files'] : null; - $requests[] = $this->requestEntityToBatchArray($request['request'], $request['name'], $attachedFiles); - } - - return json_encode($requests); - } - - /** - * Validate the request count before sending them as a batch. - * - * @throws FacebookSDKException - */ - public function validateBatchRequestCount() - { - $batchCount = count($this->requests); - if ($batchCount === 0) { - throw new FacebookSDKException('There are no batch requests to send.'); - } elseif ($batchCount > 50) { - // Per: https://developers.facebook.com/docs/graph-api/making-multiple-requests#limits - throw new FacebookSDKException('You cannot send more than 50 batch requests at a time.'); - } - } - - /** - * Converts a Request entity into an array that is batch-friendly. - * - * @param FacebookRequest $request The request entity to convert. - * @param string|null $requestName The name of the request. - * @param string|null $attachedFiles Names of files associated with the request. - * - * @return array - */ - public function requestEntityToBatchArray(FacebookRequest $request, $requestName = null, $attachedFiles = null) - { - $compiledHeaders = []; - $headers = $request->getHeaders(); - foreach ($headers as $name => $value) { - $compiledHeaders[] = $name . ': ' . $value; - } - - $batch = [ - 'headers' => $compiledHeaders, - 'method' => $request->getMethod(), - 'relative_url' => $request->getUrl(), - ]; - - // Since file uploads are moved to the root request of a batch request, - // the child requests will always be URL-encoded. - $body = $request->getUrlEncodedBody()->getBody(); - if ($body) { - $batch['body'] = $body; - } - - if (isset($requestName)) { - $batch['name'] = $requestName; - } - - if (isset($attachedFiles)) { - $batch['attached_files'] = $attachedFiles; - } - - // @TODO Add support for "omit_response_on_success" - // @TODO Add support for "depends_on" - // @TODO Add support for JSONP with "callback" - - return $batch; - } - - /** - * Get an iterator for the items. - * - * @return ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->requests); - } - - /** - * @inheritdoc - */ - public function offsetSet($offset, $value) - { - $this->add($value, $offset); - } - - /** - * @inheritdoc - */ - public function offsetExists($offset) - { - return isset($this->requests[$offset]); - } - - /** - * @inheritdoc - */ - public function offsetUnset($offset) - { - unset($this->requests[$offset]); - } - - /** - * @inheritdoc - */ - public function offsetGet($offset) - { - return isset($this->requests[$offset]) ? $this->requests[$offset] : null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchResponse.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchResponse.php deleted file mode 100644 index 5ea765e302..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookBatchResponse.php +++ /dev/null @@ -1,154 +0,0 @@ -batchRequest = $batchRequest; - - $request = $response->getRequest(); - $body = $response->getBody(); - $httpStatusCode = $response->getHttpStatusCode(); - $headers = $response->getHeaders(); - parent::__construct($request, $body, $httpStatusCode, $headers); - - $responses = $response->getDecodedBody(); - $this->setResponses($responses); - } - - /** - * Returns an array of FacebookResponse entities. - * - * @return array - */ - public function getResponses() - { - return $this->responses; - } - - /** - * The main batch response will be an array of requests so - * we need to iterate over all the responses. - * - * @param array $responses - */ - public function setResponses(array $responses) - { - $this->responses = []; - - foreach ($responses as $key => $graphResponse) { - $this->addResponse($key, $graphResponse); - } - } - - /** - * Add a response to the list. - * - * @param int $key - * @param array|null $response - */ - public function addResponse($key, $response) - { - $originalRequestName = isset($this->batchRequest[$key]['name']) ? $this->batchRequest[$key]['name'] : $key; - $originalRequest = isset($this->batchRequest[$key]['request']) ? $this->batchRequest[$key]['request'] : null; - - $httpResponseBody = isset($response['body']) ? $response['body'] : null; - $httpResponseCode = isset($response['code']) ? $response['code'] : null; - $httpResponseHeaders = isset($response['headers']) ? $response['headers'] : []; - - $this->responses[$originalRequestName] = new FacebookResponse( - $originalRequest, - $httpResponseBody, - $httpResponseCode, - $httpResponseHeaders - ); - } - - /** - * @inheritdoc - */ - public function getIterator() - { - return new ArrayIterator($this->responses); - } - - /** - * @inheritdoc - */ - public function offsetSet($offset, $value) - { - $this->addResponse($offset, $value); - } - - /** - * @inheritdoc - */ - public function offsetExists($offset) - { - return isset($this->responses[$offset]); - } - - /** - * @inheritdoc - */ - public function offsetUnset($offset) - { - unset($this->responses[$offset]); - } - - /** - * @inheritdoc - */ - public function offsetGet($offset) - { - return isset($this->responses[$offset]) ? $this->responses[$offset] : null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookClient.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookClient.php deleted file mode 100644 index b10762f1ba..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookClient.php +++ /dev/null @@ -1,250 +0,0 @@ -httpClientHandler = $httpClientHandler ?: $this->detectHttpClientHandler(); - $this->enableBetaMode = $enableBeta; - } - - /** - * Sets the HTTP client handler. - * - * @param FacebookHttpClientInterface $httpClientHandler - */ - public function setHttpClientHandler(FacebookHttpClientInterface $httpClientHandler) - { - $this->httpClientHandler = $httpClientHandler; - } - - /** - * Returns the HTTP client handler. - * - * @return FacebookHttpClientInterface - */ - public function getHttpClientHandler() - { - return $this->httpClientHandler; - } - - /** - * Detects which HTTP client handler to use. - * - * @return FacebookHttpClientInterface - */ - public function detectHttpClientHandler() - { - return function_exists('curl_init') ? new FacebookCurlHttpClient() : new FacebookStreamHttpClient(); - } - - /** - * Toggle beta mode. - * - * @param boolean $betaMode - */ - public function enableBetaMode($betaMode = true) - { - $this->enableBetaMode = $betaMode; - } - - /** - * Returns the base Graph URL. - * - * @param boolean $postToVideoUrl Post to the video API if videos are being uploaded. - * - * @return string - */ - public function getBaseGraphUrl($postToVideoUrl = false) - { - if ($postToVideoUrl) { - return $this->enableBetaMode ? static::BASE_GRAPH_VIDEO_URL_BETA : static::BASE_GRAPH_VIDEO_URL; - } - - return $this->enableBetaMode ? static::BASE_GRAPH_URL_BETA : static::BASE_GRAPH_URL; - } - - /** - * Prepares the request for sending to the client handler. - * - * @param FacebookRequest $request - * - * @return array - */ - public function prepareRequestMessage(FacebookRequest $request) - { - $postToVideoUrl = $request->containsVideoUploads(); - $url = $this->getBaseGraphUrl($postToVideoUrl) . $request->getUrl(); - - // If we're sending files they should be sent as multipart/form-data - if ($request->containsFileUploads()) { - $requestBody = $request->getMultipartBody(); - $request->setHeaders([ - 'Content-Type' => 'multipart/form-data; boundary=' . $requestBody->getBoundary(), - ]); - } else { - $requestBody = $request->getUrlEncodedBody(); - $request->setHeaders([ - 'Content-Type' => 'application/x-www-form-urlencoded', - ]); - } - - return [ - $url, - $request->getMethod(), - $request->getHeaders(), - $requestBody->getBody(), - ]; - } - - /** - * Makes the request to Graph and returns the result. - * - * @param FacebookRequest $request - * - * @return FacebookResponse - * - * @throws FacebookSDKException - */ - public function sendRequest(FacebookRequest $request) - { - if (get_class($request) === 'FacebookRequest') { - $request->validateAccessToken(); - } - - list($url, $method, $headers, $body) = $this->prepareRequestMessage($request); - - // Since file uploads can take a while, we need to give more time for uploads - $timeOut = static::DEFAULT_REQUEST_TIMEOUT; - if ($request->containsFileUploads()) { - $timeOut = static::DEFAULT_FILE_UPLOAD_REQUEST_TIMEOUT; - } elseif ($request->containsVideoUploads()) { - $timeOut = static::DEFAULT_VIDEO_UPLOAD_REQUEST_TIMEOUT; - } - - // Should throw `FacebookSDKException` exception on HTTP client error. - // Don't catch to allow it to bubble up. - $rawResponse = $this->httpClientHandler->send($url, $method, $body, $headers, $timeOut); - - static::$requestCount++; - - $returnResponse = new FacebookResponse( - $request, - $rawResponse->getBody(), - $rawResponse->getHttpResponseCode(), - $rawResponse->getHeaders() - ); - - if ($returnResponse->isError()) { - throw $returnResponse->getThrownException(); - } - - return $returnResponse; - } - - /** - * Makes a batched request to Graph and returns the result. - * - * @param FacebookBatchRequest $request - * - * @return FacebookBatchResponse - * - * @throws FacebookSDKException - */ - public function sendBatchRequest(FacebookBatchRequest $request) - { - $request->prepareRequestsForBatch(); - $facebookResponse = $this->sendRequest($request); - - return new FacebookBatchResponse($request, $facebookResponse); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookRequest.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookRequest.php deleted file mode 100644 index 5e4083f8a8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookRequest.php +++ /dev/null @@ -1,536 +0,0 @@ -setApp($app); - $this->setAccessToken($accessToken); - $this->setMethod($method); - $this->setEndpoint($endpoint); - $this->setParams($params); - $this->setETag($eTag); - $this->graphVersion = $graphVersion ?: Facebook::DEFAULT_GRAPH_VERSION; - } - - /** - * Set the access token for this request. - * - * @param AccessToken|string - * - * @return FacebookRequest - */ - public function setAccessToken($accessToken) - { - $this->accessToken = $accessToken; - if ($accessToken instanceof AccessToken) { - $this->accessToken = $accessToken->getValue(); - } - - return $this; - } - - /** - * Sets the access token with one harvested from a URL or POST params. - * - * @param string $accessToken The access token. - * - * @return FacebookRequest - * - * @throws FacebookSDKException - */ - public function setAccessTokenFromParams($accessToken) - { - $existingAccessToken = $this->getAccessToken(); - if (!$existingAccessToken) { - $this->setAccessToken($accessToken); - } elseif ($accessToken !== $existingAccessToken) { - throw new FacebookSDKException('Access token mismatch. The access token provided in the FacebookRequest and the one provided in the URL or POST params do not match.'); - } - - return $this; - } - - /** - * Return the access token for this request. - * - * @return string|null - */ - public function getAccessToken() - { - return $this->accessToken; - } - - /** - * Return the access token for this request an an AccessToken entity. - * - * @return AccessToken|null - */ - public function getAccessTokenEntity() - { - return $this->accessToken ? new AccessToken($this->accessToken) : null; - } - - /** - * Set the FacebookApp entity used for this request. - * - * @param FacebookApp|null $app - */ - public function setApp(FacebookApp $app = null) - { - $this->app = $app; - } - - /** - * Return the FacebookApp entity used for this request. - * - * @return FacebookApp - */ - public function getApp() - { - return $this->app; - } - - /** - * Generate an app secret proof to sign this request. - * - * @return string|null - */ - public function getAppSecretProof() - { - if (!$accessTokenEntity = $this->getAccessTokenEntity()) { - return null; - } - - return $accessTokenEntity->getAppSecretProof($this->app->getSecret()); - } - - /** - * Validate that an access token exists for this request. - * - * @throws FacebookSDKException - */ - public function validateAccessToken() - { - $accessToken = $this->getAccessToken(); - if (!$accessToken) { - throw new FacebookSDKException('You must provide an access token.'); - } - } - - /** - * Set the HTTP method for this request. - * - * @param string - * - * @return FacebookRequest - */ - public function setMethod($method) - { - $this->method = strtoupper($method); - } - - /** - * Return the HTTP method for this request. - * - * @return string - */ - public function getMethod() - { - return $this->method; - } - - /** - * Validate that the HTTP method is set. - * - * @throws FacebookSDKException - */ - public function validateMethod() - { - if (!$this->method) { - throw new FacebookSDKException('HTTP method not specified.'); - } - - if (!in_array($this->method, ['GET', 'POST', 'DELETE'])) { - throw new FacebookSDKException('Invalid HTTP method specified.'); - } - } - - /** - * Set the endpoint for this request. - * - * @param string - * - * @return FacebookRequest - * - * @throws FacebookSDKException - */ - public function setEndpoint($endpoint) - { - // Harvest the access token from the endpoint to keep things in sync - $params = FacebookUrlManipulator::getParamsAsArray($endpoint); - if (isset($params['access_token'])) { - $this->setAccessTokenFromParams($params['access_token']); - } - - // Clean the token & app secret proof from the endpoint. - $filterParams = ['access_token', 'appsecret_proof']; - $this->endpoint = FacebookUrlManipulator::removeParamsFromUrl($endpoint, $filterParams); - - return $this; - } - - /** - * Return the HTTP method for this request. - * - * @return string - */ - public function getEndpoint() - { - // For batch requests, this will be empty - return $this->endpoint; - } - - /** - * Generate and return the headers for this request. - * - * @return array - */ - public function getHeaders() - { - $headers = static::getDefaultHeaders(); - - if ($this->eTag) { - $headers['If-None-Match'] = $this->eTag; - } - - return array_merge($this->headers, $headers); - } - - /** - * Set the headers for this request. - * - * @param array $headers - */ - public function setHeaders(array $headers) - { - $this->headers = array_merge($this->headers, $headers); - } - - /** - * Sets the eTag value. - * - * @param string $eTag - */ - public function setETag($eTag) - { - $this->eTag = $eTag; - } - - /** - * Set the params for this request. - * - * @param array $params - * - * @return FacebookRequest - * - * @throws FacebookSDKException - */ - public function setParams(array $params = []) - { - if (isset($params['access_token'])) { - $this->setAccessTokenFromParams($params['access_token']); - } - - // Don't let these buggers slip in. - unset($params['access_token'], $params['appsecret_proof']); - - // @TODO Refactor code above with this - //$params = $this->sanitizeAuthenticationParams($params); - $params = $this->sanitizeFileParams($params); - $this->dangerouslySetParams($params); - - return $this; - } - - /** - * Set the params for this request without filtering them first. - * - * @param array $params - * - * @return FacebookRequest - */ - public function dangerouslySetParams(array $params = []) - { - $this->params = array_merge($this->params, $params); - - return $this; - } - - /** - * Iterate over the params and pull out the file uploads. - * - * @param array $params - * - * @return array - */ - public function sanitizeFileParams(array $params) - { - foreach ($params as $key => $value) { - if ($value instanceof FacebookFile) { - $this->addFile($key, $value); - unset($params[$key]); - } - } - - return $params; - } - - /** - * Add a file to be uploaded. - * - * @param string $key - * @param FacebookFile $file - */ - public function addFile($key, FacebookFile $file) - { - $this->files[$key] = $file; - } - - /** - * Removes all the files from the upload queue. - */ - public function resetFiles() - { - $this->files = []; - } - - /** - * Get the list of files to be uploaded. - * - * @return array - */ - public function getFiles() - { - return $this->files; - } - - /** - * Let's us know if there is a file upload with this request. - * - * @return boolean - */ - public function containsFileUploads() - { - return !empty($this->files); - } - - /** - * Let's us know if there is a video upload with this request. - * - * @return boolean - */ - public function containsVideoUploads() - { - foreach ($this->files as $file) { - if ($file instanceof FacebookVideo) { - return true; - } - } - - return false; - } - - /** - * Returns the body of the request as multipart/form-data. - * - * @return RequestBodyMultipart - */ - public function getMultipartBody() - { - $params = $this->getPostParams(); - - return new RequestBodyMultipart($params, $this->files); - } - - /** - * Returns the body of the request as URL-encoded. - * - * @return RequestBodyUrlEncoded - */ - public function getUrlEncodedBody() - { - $params = $this->getPostParams(); - - return new RequestBodyUrlEncoded($params); - } - - /** - * Generate and return the params for this request. - * - * @return array - */ - public function getParams() - { - $params = $this->params; - - $accessToken = $this->getAccessToken(); - if ($accessToken) { - $params['access_token'] = $accessToken; - $params['appsecret_proof'] = $this->getAppSecretProof(); - } - - return $params; - } - - /** - * Only return params on POST requests. - * - * @return array - */ - public function getPostParams() - { - if ($this->getMethod() === 'POST') { - return $this->getParams(); - } - - return []; - } - - /** - * The graph version used for this request. - * - * @return string - */ - public function getGraphVersion() - { - return $this->graphVersion; - } - - /** - * Generate and return the URL for this request. - * - * @return string - */ - public function getUrl() - { - $this->validateMethod(); - - $graphVersion = FacebookUrlManipulator::forceSlashPrefix($this->graphVersion); - $endpoint = FacebookUrlManipulator::forceSlashPrefix($this->getEndpoint()); - - $url = $graphVersion . $endpoint; - - if ($this->getMethod() !== 'POST') { - $params = $this->getParams(); - $url = FacebookUrlManipulator::appendParamsToUrl($url, $params); - } - - return $url; - } - - /** - * Return the default headers that every request should use. - * - * @return array - */ - public static function getDefaultHeaders() - { - return [ - 'User-Agent' => 'fb-php-' . Facebook::VERSION, - 'Accept-Encoding' => '*', - ]; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookResponse.php b/rainloop/v/0.0.0/app/libraries/Facebook/FacebookResponse.php deleted file mode 100644 index ce55b14339..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FacebookResponse.php +++ /dev/null @@ -1,410 +0,0 @@ -request = $request; - $this->body = $body; - $this->httpStatusCode = $httpStatusCode; - $this->headers = $headers; - - $this->decodeBody(); - } - - /** - * Return the original request that returned this response. - * - * @return FacebookRequest - */ - public function getRequest() - { - return $this->request; - } - - /** - * Return the FacebookApp entity used for this response. - * - * @return FacebookApp - */ - public function getApp() - { - return $this->request->getApp(); - } - - /** - * Return the access token that was used for this response. - * - * @return string|null - */ - public function getAccessToken() - { - return $this->request->getAccessToken(); - } - - /** - * Return the HTTP status code for this response. - * - * @return int - */ - public function getHttpStatusCode() - { - return $this->httpStatusCode; - } - - /** - * Return the HTTP headers for this response. - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Return the raw body response. - * - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * Return the decoded body response. - * - * @return array - */ - public function getDecodedBody() - { - return $this->decodedBody; - } - - /** - * Get the app secret proof that was used for this response. - * - * @return string|null - */ - public function getAppSecretProof() - { - return $this->request->getAppSecretProof(); - } - - /** - * Get the ETag associated with the response. - * - * @return string|null - */ - public function getETag() - { - return isset($this->headers['ETag']) ? $this->headers['ETag'] : null; - } - - /** - * Get the version of Graph that returned this response. - * - * @return string|null - */ - public function getGraphVersion() - { - return isset($this->headers['Facebook-API-Version']) ? $this->headers['Facebook-API-Version'] : null; - } - - /** - * Returns true if Graph returned an error message. - * - * @return boolean - */ - public function isError() - { - return isset($this->decodedBody['error']); - } - - /** - * Throws the exception. - * - * @throws FacebookSDKException - */ - public function throwException() - { - throw $this->thrownException; - } - - /** - * Instantiates an exception to be thrown later. - */ - public function makeException() - { - $this->thrownException = FacebookResponseException::create($this); - } - - /** - * Returns the exception that was thrown for this request. - * - * @return FacebookSDKException|null - */ - public function getThrownException() - { - return $this->thrownException; - } - - /** - * Convert the raw response into an array if possible. - * - * Graph will return 2 types of responses: - * - JSON(P) - * Most responses from Grpah are JSON(P) - * - application/x-www-form-urlencoded key/value pairs - * Happens on the `/oauth/access_token` endpoint when exchanging - * a short-lived access token for a long-lived access token - * - And sometimes nothing :/ but that'd be a bug. - */ - public function decodeBody() - { - $this->decodedBody = json_decode($this->body, true); - - if ($this->decodedBody === null) { - $this->decodedBody = []; - parse_str($this->body, $this->decodedBody); - } elseif (is_bool($this->decodedBody)) { - // Backwards compatibility for Graph < 2.1. - // Mimics 2.1 responses. - // @TODO Remove this after Graph 2.0 is no longer supported - $this->decodedBody = ['success' => $this->decodedBody]; - } elseif (is_numeric($this->decodedBody)) { - $this->decodedBody = ['id' => $this->decodedBody]; - } - - if (!is_array($this->decodedBody)) { - $this->decodedBody = []; - } - - if ($this->isError()) { - $this->makeException(); - } - } - - /** - * Instantiate a new GraphObject from response. - * - * @param string|null $subclassName The GraphNode sub class to cast to. - * - * @return \Facebook\GraphNodes\GraphObject - * - * @throws FacebookSDKException - * - * @deprecated 5.0.0 getGraphObject() has been renamed to getGraphNode() - * @todo v6: Remove this method - */ - public function getGraphObject($subclassName = null) - { - return $this->getGraphNode($subclassName); - } - - /** - * Instantiate a new GraphNode from response. - * - * @param string|null $subclassName The GraphNode sub class to cast to. - * - * @return \Facebook\GraphNodes\GraphNode - * - * @throws FacebookSDKException - */ - public function getGraphNode($subclassName = null) - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphNode($subclassName); - } - - /** - * Convenience method for creating a GraphAlbum collection. - * - * @return \Facebook\GraphNodes\GraphAlbum - * - * @throws FacebookSDKException - */ - public function getGraphAlbum() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphAlbum(); - } - - /** - * Convenience method for creating a GraphPage collection. - * - * @return \Facebook\GraphNodes\GraphPage - * - * @throws FacebookSDKException - */ - public function getGraphPage() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphPage(); - } - - /** - * Convenience method for creating a GraphSessionInfo collection. - * - * @return \Facebook\GraphNodes\GraphSessionInfo - * - * @throws FacebookSDKException - */ - public function getGraphSessionInfo() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphSessionInfo(); - } - - /** - * Convenience method for creating a GraphUser collection. - * - * @return \Facebook\GraphNodes\GraphUser - * - * @throws FacebookSDKException - */ - public function getGraphUser() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphUser(); - } - - /** - * Convenience method for creating a GraphEvent collection. - * - * @return \Facebook\GraphNodes\GraphEvent - * - * @throws FacebookSDKException - */ - public function getGraphEvent() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphEvent(); - } - - /** - * Convenience method for creating a GraphGroup collection. - * - * @return \Facebook\GraphNodes\GraphGroup - * - * @throws FacebookSDKException - */ - public function getGraphGroup() - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphGroup(); - } - - /** - * Instantiate a new GraphList from response. - * - * @param string|null $subclassName The GraphNode sub class to cast list items to. - * @param boolean $auto_prefix Toggle to auto-prefix the subclass name. - * - * @return \Facebook\GraphNodes\GraphList - * - * @throws FacebookSDKException - * - * @deprecated 5.0.0 getGraphList() has been renamed to getGraphEdge() - * @todo v6: Remove this method - */ - public function getGraphList($subclassName = null, $auto_prefix = true) - { - return $this->getGraphEdge($subclassName, $auto_prefix); - } - - /** - * Instantiate a new GraphEdge from response. - * - * @param string|null $subclassName The GraphNode sub class to cast list items to. - * @param boolean $auto_prefix Toggle to auto-prefix the subclass name. - * - * @return \Facebook\GraphNodes\GraphEdge - * - * @throws FacebookSDKException - */ - public function getGraphEdge($subclassName = null, $auto_prefix = true) - { - $factory = new GraphNodeFactory($this); - - return $factory->makeGraphEdge($subclassName, $auto_prefix); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookFile.php b/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookFile.php deleted file mode 100644 index f8b990548d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookFile.php +++ /dev/null @@ -1,135 +0,0 @@ -path = $filePath; - $this->open(); - } - - /** - * Closes the stream when destructed. - */ - public function __destruct() - { - $this->close(); - } - - /** - * Opens a stream for the file. - * - * @throws FacebookSDKException - */ - public function open() - { - if (!$this->isRemoteFile($this->path) && !is_readable($this->path)) { - throw new FacebookSDKException('Failed to create FacebookFile entity. Unable to read resource: ' . $this->path . '.'); - } - - $this->stream = fopen($this->path, 'r'); - - if (!$this->stream) { - throw new FacebookSDKException('Failed to create FacebookFile entity. Unable to open resource: ' . $this->path . '.'); - } - } - - /** - * Stops the file stream. - */ - public function close() - { - if (is_resource($this->stream)) { - fclose($this->stream); - } - } - - /** - * Return the contents of the file. - * - * @return string - */ - public function getContents() - { - return stream_get_contents($this->stream); - } - - /** - * Return the name of the file. - * - * @return string - */ - public function getFileName() - { - return basename($this->path); - } - - /** - * Return the mimetype of the file. - * - * @return string - */ - public function getMimetype() - { - return Mimetypes::getInstance()->fromFilename($this->path) ?: 'text/plain'; - } - - /** - * Returns true if the path to the file is remote. - * - * @param string $pathToFile - * - * @return boolean - */ - protected function isRemoteFile($pathToFile) - { - return preg_match('/^(https?|ftp):\/\/.*/', $pathToFile) === 1; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookVideo.php b/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookVideo.php deleted file mode 100644 index 1e8c55aa80..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/FileUpload/FacebookVideo.php +++ /dev/null @@ -1,33 +0,0 @@ - 'text/vnd.in3d.3dml', - '3g2' => 'video/3gpp2', - '3gp' => 'video/3gpp', - '7z' => 'application/x-7z-compressed', - 'aab' => 'application/x-authorware-bin', - 'aac' => 'audio/x-aac', - 'aam' => 'application/x-authorware-map', - 'aas' => 'application/x-authorware-seg', - 'abw' => 'application/x-abiword', - 'ac' => 'application/pkix-attr-cert', - 'acc' => 'application/vnd.americandynamics.acc', - 'ace' => 'application/x-ace-compressed', - 'acu' => 'application/vnd.acucobol', - 'acutc' => 'application/vnd.acucorp', - 'adp' => 'audio/adpcm', - 'aep' => 'application/vnd.audiograph', - 'afm' => 'application/x-font-type1', - 'afp' => 'application/vnd.ibm.modcap', - 'ahead' => 'application/vnd.ahead.space', - 'ai' => 'application/postscript', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'air' => 'application/vnd.adobe.air-application-installer-package+zip', - 'ait' => 'application/vnd.dvb.ait', - 'ami' => 'application/vnd.amiga.ami', - 'apk' => 'application/vnd.android.package-archive', - 'application' => 'application/x-ms-application', - 'apr' => 'application/vnd.lotus-approach', - 'asa' => 'text/plain', - 'asax' => 'application/octet-stream', - 'asc' => 'application/pgp-signature', - 'ascx' => 'text/plain', - 'asf' => 'video/x-ms-asf', - 'ashx' => 'text/plain', - 'asm' => 'text/x-asm', - 'asmx' => 'text/plain', - 'aso' => 'application/vnd.accpac.simply.aso', - 'asp' => 'text/plain', - 'aspx' => 'text/plain', - 'asx' => 'video/x-ms-asf', - 'atc' => 'application/vnd.acucorp', - 'atom' => 'application/atom+xml', - 'atomcat' => 'application/atomcat+xml', - 'atomsvc' => 'application/atomsvc+xml', - 'atx' => 'application/vnd.antix.game-component', - 'au' => 'audio/basic', - 'avi' => 'video/x-msvideo', - 'aw' => 'application/applixware', - 'axd' => 'text/plain', - 'azf' => 'application/vnd.airzip.filesecure.azf', - 'azs' => 'application/vnd.airzip.filesecure.azs', - 'azw' => 'application/vnd.amazon.ebook', - 'bat' => 'application/x-msdownload', - 'bcpio' => 'application/x-bcpio', - 'bdf' => 'application/x-font-bdf', - 'bdm' => 'application/vnd.syncml.dm+wbxml', - 'bed' => 'application/vnd.realvnc.bed', - 'bh2' => 'application/vnd.fujitsu.oasysprs', - 'bin' => 'application/octet-stream', - 'bmi' => 'application/vnd.bmi', - 'bmp' => 'image/bmp', - 'book' => 'application/vnd.framemaker', - 'box' => 'application/vnd.previewsystems.box', - 'boz' => 'application/x-bzip2', - 'bpk' => 'application/octet-stream', - 'btif' => 'image/prs.btif', - 'bz' => 'application/x-bzip', - 'bz2' => 'application/x-bzip2', - 'c' => 'text/x-c', - 'c11amc' => 'application/vnd.cluetrust.cartomobile-config', - 'c11amz' => 'application/vnd.cluetrust.cartomobile-config-pkg', - 'c4d' => 'application/vnd.clonk.c4group', - 'c4f' => 'application/vnd.clonk.c4group', - 'c4g' => 'application/vnd.clonk.c4group', - 'c4p' => 'application/vnd.clonk.c4group', - 'c4u' => 'application/vnd.clonk.c4group', - 'cab' => 'application/vnd.ms-cab-compressed', - 'car' => 'application/vnd.curl.car', - 'cat' => 'application/vnd.ms-pki.seccat', - 'cc' => 'text/x-c', - 'cct' => 'application/x-director', - 'ccxml' => 'application/ccxml+xml', - 'cdbcmsg' => 'application/vnd.contact.cmsg', - 'cdf' => 'application/x-netcdf', - 'cdkey' => 'application/vnd.mediastation.cdkey', - 'cdmia' => 'application/cdmi-capability', - 'cdmic' => 'application/cdmi-container', - 'cdmid' => 'application/cdmi-domain', - 'cdmio' => 'application/cdmi-object', - 'cdmiq' => 'application/cdmi-queue', - 'cdx' => 'chemical/x-cdx', - 'cdxml' => 'application/vnd.chemdraw+xml', - 'cdy' => 'application/vnd.cinderella', - 'cer' => 'application/pkix-cert', - 'cfc' => 'application/x-coldfusion', - 'cfm' => 'application/x-coldfusion', - 'cgm' => 'image/cgm', - 'chat' => 'application/x-chat', - 'chm' => 'application/vnd.ms-htmlhelp', - 'chrt' => 'application/vnd.kde.kchart', - 'cif' => 'chemical/x-cif', - 'cii' => 'application/vnd.anser-web-certificate-issue-initiation', - 'cil' => 'application/vnd.ms-artgalry', - 'cla' => 'application/vnd.claymore', - 'class' => 'application/java-vm', - 'clkk' => 'application/vnd.crick.clicker.keyboard', - 'clkp' => 'application/vnd.crick.clicker.palette', - 'clkt' => 'application/vnd.crick.clicker.template', - 'clkw' => 'application/vnd.crick.clicker.wordbank', - 'clkx' => 'application/vnd.crick.clicker', - 'clp' => 'application/x-msclip', - 'cmc' => 'application/vnd.cosmocaller', - 'cmdf' => 'chemical/x-cmdf', - 'cml' => 'chemical/x-cml', - 'cmp' => 'application/vnd.yellowriver-custom-menu', - 'cmx' => 'image/x-cmx', - 'cod' => 'application/vnd.rim.cod', - 'com' => 'application/x-msdownload', - 'conf' => 'text/plain', - 'cpio' => 'application/x-cpio', - 'cpp' => 'text/x-c', - 'cpt' => 'application/mac-compactpro', - 'crd' => 'application/x-mscardfile', - 'crl' => 'application/pkix-crl', - 'crt' => 'application/x-x509-ca-cert', - 'cryptonote' => 'application/vnd.rig.cryptonote', - 'cs' => 'text/plain', - 'csh' => 'application/x-csh', - 'csml' => 'chemical/x-csml', - 'csp' => 'application/vnd.commonspace', - 'css' => 'text/css', - 'cst' => 'application/x-director', - 'csv' => 'text/csv', - 'cu' => 'application/cu-seeme', - 'curl' => 'text/vnd.curl', - 'cww' => 'application/prs.cww', - 'cxt' => 'application/x-director', - 'cxx' => 'text/x-c', - 'dae' => 'model/vnd.collada+xml', - 'daf' => 'application/vnd.mobius.daf', - 'dataless' => 'application/vnd.fdsn.seed', - 'davmount' => 'application/davmount+xml', - 'dcr' => 'application/x-director', - 'dcurl' => 'text/vnd.curl.dcurl', - 'dd2' => 'application/vnd.oma.dd2+xml', - 'ddd' => 'application/vnd.fujixerox.ddd', - 'deb' => 'application/x-debian-package', - 'def' => 'text/plain', - 'deploy' => 'application/octet-stream', - 'der' => 'application/x-x509-ca-cert', - 'dfac' => 'application/vnd.dreamfactory', - 'dic' => 'text/x-c', - 'dir' => 'application/x-director', - 'dis' => 'application/vnd.mobius.dis', - 'dist' => 'application/octet-stream', - 'distz' => 'application/octet-stream', - 'djv' => 'image/vnd.djvu', - 'djvu' => 'image/vnd.djvu', - 'dll' => 'application/x-msdownload', - 'dmg' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'dna' => 'application/vnd.dna', - 'doc' => 'application/msword', - 'docm' => 'application/vnd.ms-word.document.macroenabled.12', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dot' => 'application/msword', - 'dotm' => 'application/vnd.ms-word.template.macroenabled.12', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'dp' => 'application/vnd.osgi.dp', - 'dpg' => 'application/vnd.dpgraph', - 'dra' => 'audio/vnd.dra', - 'dsc' => 'text/prs.lines.tag', - 'dssc' => 'application/dssc+der', - 'dtb' => 'application/x-dtbook+xml', - 'dtd' => 'application/xml-dtd', - 'dts' => 'audio/vnd.dts', - 'dtshd' => 'audio/vnd.dts.hd', - 'dump' => 'application/octet-stream', - 'dvi' => 'application/x-dvi', - 'dwf' => 'model/vnd.dwf', - 'dwg' => 'image/vnd.dwg', - 'dxf' => 'image/vnd.dxf', - 'dxp' => 'application/vnd.spotfire.dxp', - 'dxr' => 'application/x-director', - 'ecelp4800' => 'audio/vnd.nuera.ecelp4800', - 'ecelp7470' => 'audio/vnd.nuera.ecelp7470', - 'ecelp9600' => 'audio/vnd.nuera.ecelp9600', - 'ecma' => 'application/ecmascript', - 'edm' => 'application/vnd.novadigm.edm', - 'edx' => 'application/vnd.novadigm.edx', - 'efif' => 'application/vnd.picsel', - 'ei6' => 'application/vnd.pg.osasli', - 'elc' => 'application/octet-stream', - 'eml' => 'message/rfc822', - 'emma' => 'application/emma+xml', - 'eol' => 'audio/vnd.digital-winds', - 'eot' => 'application/vnd.ms-fontobject', - 'eps' => 'application/postscript', - 'epub' => 'application/epub+zip', - 'es3' => 'application/vnd.eszigno3+xml', - 'esf' => 'application/vnd.epson.esf', - 'et3' => 'application/vnd.eszigno3+xml', - 'etx' => 'text/x-setext', - 'exe' => 'application/x-msdownload', - 'exi' => 'application/exi', - 'ext' => 'application/vnd.novadigm.ext', - 'ez' => 'application/andrew-inset', - 'ez2' => 'application/vnd.ezpix-album', - 'ez3' => 'application/vnd.ezpix-package', - 'f' => 'text/x-fortran', - 'f4v' => 'video/x-f4v', - 'f77' => 'text/x-fortran', - 'f90' => 'text/x-fortran', - 'fbs' => 'image/vnd.fastbidsheet', - 'fcs' => 'application/vnd.isac.fcs', - 'fdf' => 'application/vnd.fdf', - 'fe_launch' => 'application/vnd.denovo.fcselayout-link', - 'fg5' => 'application/vnd.fujitsu.oasysgp', - 'fgd' => 'application/x-director', - 'fh' => 'image/x-freehand', - 'fh4' => 'image/x-freehand', - 'fh5' => 'image/x-freehand', - 'fh7' => 'image/x-freehand', - 'fhc' => 'image/x-freehand', - 'fig' => 'application/x-xfig', - 'fli' => 'video/x-fli', - 'flo' => 'application/vnd.micrografx.flo', - 'flv' => 'video/x-flv', - 'flw' => 'application/vnd.kde.kivio', - 'flx' => 'text/vnd.fmi.flexstor', - 'fly' => 'text/vnd.fly', - 'fm' => 'application/vnd.framemaker', - 'fnc' => 'application/vnd.frogans.fnc', - 'for' => 'text/x-fortran', - 'fpx' => 'image/vnd.fpx', - 'frame' => 'application/vnd.framemaker', - 'fsc' => 'application/vnd.fsc.weblaunch', - 'fst' => 'image/vnd.fst', - 'ftc' => 'application/vnd.fluxtime.clip', - 'fti' => 'application/vnd.anser-web-funds-transfer-initiation', - 'fvt' => 'video/vnd.fvt', - 'fxp' => 'application/vnd.adobe.fxp', - 'fxpl' => 'application/vnd.adobe.fxp', - 'fzs' => 'application/vnd.fuzzysheet', - 'g2w' => 'application/vnd.geoplan', - 'g3' => 'image/g3fax', - 'g3w' => 'application/vnd.geospace', - 'gac' => 'application/vnd.groove-account', - 'gdl' => 'model/vnd.gdl', - 'geo' => 'application/vnd.dynageo', - 'gex' => 'application/vnd.geometry-explorer', - 'ggb' => 'application/vnd.geogebra.file', - 'ggt' => 'application/vnd.geogebra.tool', - 'ghf' => 'application/vnd.groove-help', - 'gif' => 'image/gif', - 'gim' => 'application/vnd.groove-identity-message', - 'gmx' => 'application/vnd.gmx', - 'gnumeric' => 'application/x-gnumeric', - 'gph' => 'application/vnd.flographit', - 'gqf' => 'application/vnd.grafeq', - 'gqs' => 'application/vnd.grafeq', - 'gram' => 'application/srgs', - 'gre' => 'application/vnd.geometry-explorer', - 'grv' => 'application/vnd.groove-injector', - 'grxml' => 'application/srgs+xml', - 'gsf' => 'application/x-font-ghostscript', - 'gtar' => 'application/x-gtar', - 'gtm' => 'application/vnd.groove-tool-message', - 'gtw' => 'model/vnd.gtw', - 'gv' => 'text/vnd.graphviz', - 'gxt' => 'application/vnd.geonext', - 'h' => 'text/x-c', - 'h261' => 'video/h261', - 'h263' => 'video/h263', - 'h264' => 'video/h264', - 'hal' => 'application/vnd.hal+xml', - 'hbci' => 'application/vnd.hbci', - 'hdf' => 'application/x-hdf', - 'hh' => 'text/x-c', - 'hlp' => 'application/winhlp', - 'hpgl' => 'application/vnd.hp-hpgl', - 'hpid' => 'application/vnd.hp-hpid', - 'hps' => 'application/vnd.hp-hps', - 'hqx' => 'application/mac-binhex40', - 'hta' => 'application/octet-stream', - 'htc' => 'text/html', - 'htke' => 'application/vnd.kenameaapp', - 'htm' => 'text/html', - 'html' => 'text/html', - 'hvd' => 'application/vnd.yamaha.hv-dic', - 'hvp' => 'application/vnd.yamaha.hv-voice', - 'hvs' => 'application/vnd.yamaha.hv-script', - 'i2g' => 'application/vnd.intergeo', - 'icc' => 'application/vnd.iccprofile', - 'ice' => 'x-conference/x-cooltalk', - 'icm' => 'application/vnd.iccprofile', - 'ico' => 'image/x-icon', - 'ics' => 'text/calendar', - 'ief' => 'image/ief', - 'ifb' => 'text/calendar', - 'ifm' => 'application/vnd.shana.informed.formdata', - 'iges' => 'model/iges', - 'igl' => 'application/vnd.igloader', - 'igm' => 'application/vnd.insors.igm', - 'igs' => 'model/iges', - 'igx' => 'application/vnd.micrografx.igx', - 'iif' => 'application/vnd.shana.informed.interchange', - 'imp' => 'application/vnd.accpac.simply.imp', - 'ims' => 'application/vnd.ms-ims', - 'in' => 'text/plain', - 'ini' => 'text/plain', - 'ipfix' => 'application/ipfix', - 'ipk' => 'application/vnd.shana.informed.package', - 'irm' => 'application/vnd.ibm.rights-management', - 'irp' => 'application/vnd.irepository.package+xml', - 'iso' => 'application/octet-stream', - 'itp' => 'application/vnd.shana.informed.formtemplate', - 'ivp' => 'application/vnd.immervision-ivp', - 'ivu' => 'application/vnd.immervision-ivu', - 'jad' => 'text/vnd.sun.j2me.app-descriptor', - 'jam' => 'application/vnd.jam', - 'jar' => 'application/java-archive', - 'java' => 'text/x-java-source', - 'jisp' => 'application/vnd.jisp', - 'jlt' => 'application/vnd.hp-jlyt', - 'jnlp' => 'application/x-java-jnlp-file', - 'joda' => 'application/vnd.joost.joda-archive', - 'jpe' => 'image/jpeg', - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'jpgm' => 'video/jpm', - 'jpgv' => 'video/jpeg', - 'jpm' => 'video/jpm', - 'js' => 'text/javascript', - 'json' => 'application/json', - 'kar' => 'audio/midi', - 'karbon' => 'application/vnd.kde.karbon', - 'kfo' => 'application/vnd.kde.kformula', - 'kia' => 'application/vnd.kidspiration', - 'kml' => 'application/vnd.google-earth.kml+xml', - 'kmz' => 'application/vnd.google-earth.kmz', - 'kne' => 'application/vnd.kinar', - 'knp' => 'application/vnd.kinar', - 'kon' => 'application/vnd.kde.kontour', - 'kpr' => 'application/vnd.kde.kpresenter', - 'kpt' => 'application/vnd.kde.kpresenter', - 'ksp' => 'application/vnd.kde.kspread', - 'ktr' => 'application/vnd.kahootz', - 'ktx' => 'image/ktx', - 'ktz' => 'application/vnd.kahootz', - 'kwd' => 'application/vnd.kde.kword', - 'kwt' => 'application/vnd.kde.kword', - 'lasxml' => 'application/vnd.las.las+xml', - 'latex' => 'application/x-latex', - 'lbd' => 'application/vnd.llamagraphics.life-balance.desktop', - 'lbe' => 'application/vnd.llamagraphics.life-balance.exchange+xml', - 'les' => 'application/vnd.hhe.lesson-player', - 'lha' => 'application/octet-stream', - 'link66' => 'application/vnd.route66.link66+xml', - 'list' => 'text/plain', - 'list3820' => 'application/vnd.ibm.modcap', - 'listafp' => 'application/vnd.ibm.modcap', - 'log' => 'text/plain', - 'lostxml' => 'application/lost+xml', - 'lrf' => 'application/octet-stream', - 'lrm' => 'application/vnd.ms-lrm', - 'ltf' => 'application/vnd.frogans.ltf', - 'lvp' => 'audio/vnd.lucent.voice', - 'lwp' => 'application/vnd.lotus-wordpro', - 'lzh' => 'application/octet-stream', - 'm13' => 'application/x-msmediaview', - 'm14' => 'application/x-msmediaview', - 'm1v' => 'video/mpeg', - 'm21' => 'application/mp21', - 'm2a' => 'audio/mpeg', - 'm2v' => 'video/mpeg', - 'm3a' => 'audio/mpeg', - 'm3u' => 'audio/x-mpegurl', - 'm3u8' => 'application/vnd.apple.mpegurl', - 'm4a' => 'audio/mp4', - 'm4u' => 'video/vnd.mpegurl', - 'm4v' => 'video/mp4', - 'ma' => 'application/mathematica', - 'mads' => 'application/mads+xml', - 'mag' => 'application/vnd.ecowin.chart', - 'maker' => 'application/vnd.framemaker', - 'man' => 'text/troff', - 'mathml' => 'application/mathml+xml', - 'mb' => 'application/mathematica', - 'mbk' => 'application/vnd.mobius.mbk', - 'mbox' => 'application/mbox', - 'mc1' => 'application/vnd.medcalcdata', - 'mcd' => 'application/vnd.mcd', - 'mcurl' => 'text/vnd.curl.mcurl', - 'mdb' => 'application/x-msaccess', - 'mdi' => 'image/vnd.ms-modi', - 'me' => 'text/troff', - 'mesh' => 'model/mesh', - 'meta4' => 'application/metalink4+xml', - 'mets' => 'application/mets+xml', - 'mfm' => 'application/vnd.mfmp', - 'mgp' => 'application/vnd.osgeo.mapguide.package', - 'mgz' => 'application/vnd.proteus.magazine', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mif' => 'application/vnd.mif', - 'mime' => 'message/rfc822', - 'mj2' => 'video/mj2', - 'mjp2' => 'video/mj2', - 'mlp' => 'application/vnd.dolby.mlp', - 'mmd' => 'application/vnd.chipnuts.karaoke-mmd', - 'mmf' => 'application/vnd.smaf', - 'mmr' => 'image/vnd.fujixerox.edmics-mmr', - 'mny' => 'application/x-msmoney', - 'mobi' => 'application/x-mobipocket-ebook', - 'mods' => 'application/mods+xml', - 'mov' => 'video/quicktime', - 'movie' => 'video/x-sgi-movie', - 'mp2' => 'audio/mpeg', - 'mp21' => 'application/mp21', - 'mp2a' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mp4' => 'video/mp4', - 'mp4a' => 'audio/mp4', - 'mp4s' => 'application/mp4', - 'mp4v' => 'video/mp4', - 'mpc' => 'application/vnd.mophun.certificate', - 'mpe' => 'video/mpeg', - 'mpeg' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mpg4' => 'video/mp4', - 'mpga' => 'audio/mpeg', - 'mpkg' => 'application/vnd.apple.installer+xml', - 'mpm' => 'application/vnd.blueice.multipass', - 'mpn' => 'application/vnd.mophun.application', - 'mpp' => 'application/vnd.ms-project', - 'mpt' => 'application/vnd.ms-project', - 'mpy' => 'application/vnd.ibm.minipay', - 'mqy' => 'application/vnd.mobius.mqy', - 'mrc' => 'application/marc', - 'mrcx' => 'application/marcxml+xml', - 'ms' => 'text/troff', - 'mscml' => 'application/mediaservercontrol+xml', - 'mseed' => 'application/vnd.fdsn.mseed', - 'mseq' => 'application/vnd.mseq', - 'msf' => 'application/vnd.epson.msf', - 'msh' => 'model/mesh', - 'msi' => 'application/x-msdownload', - 'msl' => 'application/vnd.mobius.msl', - 'msty' => 'application/vnd.muvee.style', - 'mts' => 'model/vnd.mts', - 'mus' => 'application/vnd.musician', - 'musicxml' => 'application/vnd.recordare.musicxml+xml', - 'mvb' => 'application/x-msmediaview', - 'mwf' => 'application/vnd.mfer', - 'mxf' => 'application/mxf', - 'mxl' => 'application/vnd.recordare.musicxml', - 'mxml' => 'application/xv+xml', - 'mxs' => 'application/vnd.triscape.mxs', - 'mxu' => 'video/vnd.mpegurl', - 'n-gage' => 'application/vnd.nokia.n-gage.symbian.install', - 'n3' => 'text/n3', - 'nb' => 'application/mathematica', - 'nbp' => 'application/vnd.wolfram.player', - 'nc' => 'application/x-netcdf', - 'ncx' => 'application/x-dtbncx+xml', - 'ngdat' => 'application/vnd.nokia.n-gage.data', - 'nlu' => 'application/vnd.neurolanguage.nlu', - 'nml' => 'application/vnd.enliven', - 'nnd' => 'application/vnd.noblenet-directory', - 'nns' => 'application/vnd.noblenet-sealer', - 'nnw' => 'application/vnd.noblenet-web', - 'npx' => 'image/vnd.net-fpx', - 'nsf' => 'application/vnd.lotus-notes', - 'oa2' => 'application/vnd.fujitsu.oasys2', - 'oa3' => 'application/vnd.fujitsu.oasys3', - 'oas' => 'application/vnd.fujitsu.oasys', - 'obd' => 'application/x-msbinder', - 'oda' => 'application/oda', - 'odb' => 'application/vnd.oasis.opendocument.database', - 'odc' => 'application/vnd.oasis.opendocument.chart', - 'odf' => 'application/vnd.oasis.opendocument.formula', - 'odft' => 'application/vnd.oasis.opendocument.formula-template', - 'odg' => 'application/vnd.oasis.opendocument.graphics', - 'odi' => 'application/vnd.oasis.opendocument.image', - 'odm' => 'application/vnd.oasis.opendocument.text-master', - 'odp' => 'application/vnd.oasis.opendocument.presentation', - 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', - 'odt' => 'application/vnd.oasis.opendocument.text', - 'oga' => 'audio/ogg', - 'ogg' => 'audio/ogg', - 'ogv' => 'video/ogg', - 'ogx' => 'application/ogg', - 'onepkg' => 'application/onenote', - 'onetmp' => 'application/onenote', - 'onetoc' => 'application/onenote', - 'onetoc2' => 'application/onenote', - 'opf' => 'application/oebps-package+xml', - 'oprc' => 'application/vnd.palm', - 'org' => 'application/vnd.lotus-organizer', - 'osf' => 'application/vnd.yamaha.openscoreformat', - 'osfpvg' => 'application/vnd.yamaha.openscoreformat.osfpvg+xml', - 'otc' => 'application/vnd.oasis.opendocument.chart-template', - 'otf' => 'application/x-font-otf', - 'otg' => 'application/vnd.oasis.opendocument.graphics-template', - 'oth' => 'application/vnd.oasis.opendocument.text-web', - 'oti' => 'application/vnd.oasis.opendocument.image-template', - 'otp' => 'application/vnd.oasis.opendocument.presentation-template', - 'ots' => 'application/vnd.oasis.opendocument.spreadsheet-template', - 'ott' => 'application/vnd.oasis.opendocument.text-template', - 'oxt' => 'application/vnd.openofficeorg.extension', - 'p' => 'text/x-pascal', - 'p10' => 'application/pkcs10', - 'p12' => 'application/x-pkcs12', - 'p7b' => 'application/x-pkcs7-certificates', - 'p7c' => 'application/pkcs7-mime', - 'p7m' => 'application/pkcs7-mime', - 'p7r' => 'application/x-pkcs7-certreqresp', - 'p7s' => 'application/pkcs7-signature', - 'p8' => 'application/pkcs8', - 'pas' => 'text/x-pascal', - 'paw' => 'application/vnd.pawaafile', - 'pbd' => 'application/vnd.powerbuilder6', - 'pbm' => 'image/x-portable-bitmap', - 'pcf' => 'application/x-font-pcf', - 'pcl' => 'application/vnd.hp-pcl', - 'pclxl' => 'application/vnd.hp-pclxl', - 'pct' => 'image/x-pict', - 'pcurl' => 'application/vnd.curl.pcurl', - 'pcx' => 'image/x-pcx', - 'pdb' => 'application/vnd.palm', - 'pdf' => 'application/pdf', - 'pfa' => 'application/x-font-type1', - 'pfb' => 'application/x-font-type1', - 'pfm' => 'application/x-font-type1', - 'pfr' => 'application/font-tdpfr', - 'pfx' => 'application/x-pkcs12', - 'pgm' => 'image/x-portable-graymap', - 'pgn' => 'application/x-chess-pgn', - 'pgp' => 'application/pgp-encrypted', - 'php' => 'text/x-php', - 'phps' => 'application/x-httpd-phps', - 'pic' => 'image/x-pict', - 'pkg' => 'application/octet-stream', - 'pki' => 'application/pkixcmp', - 'pkipath' => 'application/pkix-pkipath', - 'plb' => 'application/vnd.3gpp.pic-bw-large', - 'plc' => 'application/vnd.mobius.plc', - 'plf' => 'application/vnd.pocketlearn', - 'pls' => 'application/pls+xml', - 'pml' => 'application/vnd.ctc-posml', - 'png' => 'image/png', - 'pnm' => 'image/x-portable-anymap', - 'portpkg' => 'application/vnd.macports.portpkg', - 'pot' => 'application/vnd.ms-powerpoint', - 'potm' => 'application/vnd.ms-powerpoint.template.macroenabled.12', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppam' => 'application/vnd.ms-powerpoint.addin.macroenabled.12', - 'ppd' => 'application/vnd.cups-ppd', - 'ppm' => 'image/x-portable-pixmap', - 'pps' => 'application/vnd.ms-powerpoint', - 'ppsm' => 'application/vnd.ms-powerpoint.slideshow.macroenabled.12', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'ppt' => 'application/vnd.ms-powerpoint', - 'pptm' => 'application/vnd.ms-powerpoint.presentation.macroenabled.12', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'pqa' => 'application/vnd.palm', - 'prc' => 'application/x-mobipocket-ebook', - 'pre' => 'application/vnd.lotus-freelance', - 'prf' => 'application/pics-rules', - 'ps' => 'application/postscript', - 'psb' => 'application/vnd.3gpp.pic-bw-small', - 'psd' => 'image/vnd.adobe.photoshop', - 'psf' => 'application/x-font-linux-psf', - 'pskcxml' => 'application/pskc+xml', - 'ptid' => 'application/vnd.pvi.ptid1', - 'pub' => 'application/x-mspublisher', - 'pvb' => 'application/vnd.3gpp.pic-bw-var', - 'pwn' => 'application/vnd.3m.post-it-notes', - 'pya' => 'audio/vnd.ms-playready.media.pya', - 'pyv' => 'video/vnd.ms-playready.media.pyv', - 'qam' => 'application/vnd.epson.quickanime', - 'qbo' => 'application/vnd.intu.qbo', - 'qfx' => 'application/vnd.intu.qfx', - 'qps' => 'application/vnd.publishare-delta-tree', - 'qt' => 'video/quicktime', - 'qwd' => 'application/vnd.quark.quarkxpress', - 'qwt' => 'application/vnd.quark.quarkxpress', - 'qxb' => 'application/vnd.quark.quarkxpress', - 'qxd' => 'application/vnd.quark.quarkxpress', - 'qxl' => 'application/vnd.quark.quarkxpress', - 'qxt' => 'application/vnd.quark.quarkxpress', - 'ra' => 'audio/x-pn-realaudio', - 'ram' => 'audio/x-pn-realaudio', - 'rar' => 'application/x-rar-compressed', - 'ras' => 'image/x-cmu-raster', - 'rb' => 'text/plain', - 'rcprofile' => 'application/vnd.ipunplugged.rcprofile', - 'rdf' => 'application/rdf+xml', - 'rdz' => 'application/vnd.data-vision.rdz', - 'rep' => 'application/vnd.businessobjects', - 'res' => 'application/x-dtbresource+xml', - 'resx' => 'text/xml', - 'rgb' => 'image/x-rgb', - 'rif' => 'application/reginfo+xml', - 'rip' => 'audio/vnd.rip', - 'rl' => 'application/resource-lists+xml', - 'rlc' => 'image/vnd.fujixerox.edmics-rlc', - 'rld' => 'application/resource-lists-diff+xml', - 'rm' => 'application/vnd.rn-realmedia', - 'rmi' => 'audio/midi', - 'rmp' => 'audio/x-pn-realaudio-plugin', - 'rms' => 'application/vnd.jcp.javame.midlet-rms', - 'rnc' => 'application/relax-ng-compact-syntax', - 'roff' => 'text/troff', - 'rp9' => 'application/vnd.cloanto.rp9', - 'rpss' => 'application/vnd.nokia.radio-presets', - 'rpst' => 'application/vnd.nokia.radio-preset', - 'rq' => 'application/sparql-query', - 'rs' => 'application/rls-services+xml', - 'rsd' => 'application/rsd+xml', - 'rss' => 'application/rss+xml', - 'rtf' => 'application/rtf', - 'rtx' => 'text/richtext', - 's' => 'text/x-asm', - 'saf' => 'application/vnd.yamaha.smaf-audio', - 'sbml' => 'application/sbml+xml', - 'sc' => 'application/vnd.ibm.secure-container', - 'scd' => 'application/x-msschedule', - 'scm' => 'application/vnd.lotus-screencam', - 'scq' => 'application/scvp-cv-request', - 'scs' => 'application/scvp-cv-response', - 'scurl' => 'text/vnd.curl.scurl', - 'sda' => 'application/vnd.stardivision.draw', - 'sdc' => 'application/vnd.stardivision.calc', - 'sdd' => 'application/vnd.stardivision.impress', - 'sdkd' => 'application/vnd.solent.sdkm+xml', - 'sdkm' => 'application/vnd.solent.sdkm+xml', - 'sdp' => 'application/sdp', - 'sdw' => 'application/vnd.stardivision.writer', - 'see' => 'application/vnd.seemail', - 'seed' => 'application/vnd.fdsn.seed', - 'sema' => 'application/vnd.sema', - 'semd' => 'application/vnd.semd', - 'semf' => 'application/vnd.semf', - 'ser' => 'application/java-serialized-object', - 'setpay' => 'application/set-payment-initiation', - 'setreg' => 'application/set-registration-initiation', - 'sfd-hdstx' => 'application/vnd.hydrostatix.sof-data', - 'sfs' => 'application/vnd.spotfire.sfs', - 'sgl' => 'application/vnd.stardivision.writer-global', - 'sgm' => 'text/sgml', - 'sgml' => 'text/sgml', - 'sh' => 'application/x-sh', - 'shar' => 'application/x-shar', - 'shf' => 'application/shf+xml', - 'sig' => 'application/pgp-signature', - 'silo' => 'model/mesh', - 'sis' => 'application/vnd.symbian.install', - 'sisx' => 'application/vnd.symbian.install', - 'sit' => 'application/x-stuffit', - 'sitx' => 'application/x-stuffitx', - 'skd' => 'application/vnd.koan', - 'skm' => 'application/vnd.koan', - 'skp' => 'application/vnd.koan', - 'skt' => 'application/vnd.koan', - 'sldm' => 'application/vnd.ms-powerpoint.slide.macroenabled.12', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'slt' => 'application/vnd.epson.salt', - 'sm' => 'application/vnd.stepmania.stepchart', - 'smf' => 'application/vnd.stardivision.math', - 'smi' => 'application/smil+xml', - 'smil' => 'application/smil+xml', - 'snd' => 'audio/basic', - 'snf' => 'application/x-font-snf', - 'so' => 'application/octet-stream', - 'spc' => 'application/x-pkcs7-certificates', - 'spf' => 'application/vnd.yamaha.smaf-phrase', - 'spl' => 'application/x-futuresplash', - 'spot' => 'text/vnd.in3d.spot', - 'spp' => 'application/scvp-vp-response', - 'spq' => 'application/scvp-vp-request', - 'spx' => 'audio/ogg', - 'src' => 'application/x-wais-source', - 'sru' => 'application/sru+xml', - 'srx' => 'application/sparql-results+xml', - 'sse' => 'application/vnd.kodak-descriptor', - 'ssf' => 'application/vnd.epson.ssf', - 'ssml' => 'application/ssml+xml', - 'st' => 'application/vnd.sailingtracker.track', - 'stc' => 'application/vnd.sun.xml.calc.template', - 'std' => 'application/vnd.sun.xml.draw.template', - 'stf' => 'application/vnd.wt.stf', - 'sti' => 'application/vnd.sun.xml.impress.template', - 'stk' => 'application/hyperstudio', - 'stl' => 'application/vnd.ms-pki.stl', - 'str' => 'application/vnd.pg.format', - 'stw' => 'application/vnd.sun.xml.writer.template', - 'sub' => 'image/vnd.dvb.subtitle', - 'sus' => 'application/vnd.sus-calendar', - 'susp' => 'application/vnd.sus-calendar', - 'sv4cpio' => 'application/x-sv4cpio', - 'sv4crc' => 'application/x-sv4crc', - 'svc' => 'application/vnd.dvb.service', - 'svd' => 'application/vnd.svd', - 'svg' => 'image/svg+xml', - 'svgz' => 'image/svg+xml', - 'swa' => 'application/x-director', - 'swf' => 'application/x-shockwave-flash', - 'swi' => 'application/vnd.aristanetworks.swi', - 'sxc' => 'application/vnd.sun.xml.calc', - 'sxd' => 'application/vnd.sun.xml.draw', - 'sxg' => 'application/vnd.sun.xml.writer.global', - 'sxi' => 'application/vnd.sun.xml.impress', - 'sxm' => 'application/vnd.sun.xml.math', - 'sxw' => 'application/vnd.sun.xml.writer', - 't' => 'text/troff', - 'tao' => 'application/vnd.tao.intent-module-archive', - 'tar' => 'application/x-tar', - 'tcap' => 'application/vnd.3gpp2.tcap', - 'tcl' => 'application/x-tcl', - 'teacher' => 'application/vnd.smart.teacher', - 'tei' => 'application/tei+xml', - 'teicorpus' => 'application/tei+xml', - 'tex' => 'application/x-tex', - 'texi' => 'application/x-texinfo', - 'texinfo' => 'application/x-texinfo', - 'text' => 'text/plain', - 'tfi' => 'application/thraud+xml', - 'tfm' => 'application/x-tex-tfm', - 'thmx' => 'application/vnd.ms-officetheme', - 'tif' => 'image/tiff', - 'tiff' => 'image/tiff', - 'tmo' => 'application/vnd.tmobile-livetv', - 'torrent' => 'application/x-bittorrent', - 'tpl' => 'application/vnd.groove-tool-template', - 'tpt' => 'application/vnd.trid.tpt', - 'tr' => 'text/troff', - 'tra' => 'application/vnd.trueapp', - 'trm' => 'application/x-msterminal', - 'tsd' => 'application/timestamped-data', - 'tsv' => 'text/tab-separated-values', - 'ttc' => 'application/x-font-ttf', - 'ttf' => 'application/x-font-ttf', - 'ttl' => 'text/turtle', - 'twd' => 'application/vnd.simtech-mindmapper', - 'twds' => 'application/vnd.simtech-mindmapper', - 'txd' => 'application/vnd.genomatix.tuxedo', - 'txf' => 'application/vnd.mobius.txf', - 'txt' => 'text/plain', - 'u32' => 'application/x-authorware-bin', - 'udeb' => 'application/x-debian-package', - 'ufd' => 'application/vnd.ufdl', - 'ufdl' => 'application/vnd.ufdl', - 'umj' => 'application/vnd.umajin', - 'unityweb' => 'application/vnd.unity', - 'uoml' => 'application/vnd.uoml+xml', - 'uri' => 'text/uri-list', - 'uris' => 'text/uri-list', - 'urls' => 'text/uri-list', - 'ustar' => 'application/x-ustar', - 'utz' => 'application/vnd.uiq.theme', - 'uu' => 'text/x-uuencode', - 'uva' => 'audio/vnd.dece.audio', - 'uvd' => 'application/vnd.dece.data', - 'uvf' => 'application/vnd.dece.data', - 'uvg' => 'image/vnd.dece.graphic', - 'uvh' => 'video/vnd.dece.hd', - 'uvi' => 'image/vnd.dece.graphic', - 'uvm' => 'video/vnd.dece.mobile', - 'uvp' => 'video/vnd.dece.pd', - 'uvs' => 'video/vnd.dece.sd', - 'uvt' => 'application/vnd.dece.ttml+xml', - 'uvu' => 'video/vnd.uvvu.mp4', - 'uvv' => 'video/vnd.dece.video', - 'uvva' => 'audio/vnd.dece.audio', - 'uvvd' => 'application/vnd.dece.data', - 'uvvf' => 'application/vnd.dece.data', - 'uvvg' => 'image/vnd.dece.graphic', - 'uvvh' => 'video/vnd.dece.hd', - 'uvvi' => 'image/vnd.dece.graphic', - 'uvvm' => 'video/vnd.dece.mobile', - 'uvvp' => 'video/vnd.dece.pd', - 'uvvs' => 'video/vnd.dece.sd', - 'uvvt' => 'application/vnd.dece.ttml+xml', - 'uvvu' => 'video/vnd.uvvu.mp4', - 'uvvv' => 'video/vnd.dece.video', - 'uvvx' => 'application/vnd.dece.unspecified', - 'uvx' => 'application/vnd.dece.unspecified', - 'vcd' => 'application/x-cdlink', - 'vcf' => 'text/x-vcard', - 'vcg' => 'application/vnd.groove-vcard', - 'vcs' => 'text/x-vcalendar', - 'vcx' => 'application/vnd.vcx', - 'vis' => 'application/vnd.visionary', - 'viv' => 'video/vnd.vivo', - 'vor' => 'application/vnd.stardivision.writer', - 'vox' => 'application/x-authorware-bin', - 'vrml' => 'model/vrml', - 'vsd' => 'application/vnd.visio', - 'vsf' => 'application/vnd.vsf', - 'vss' => 'application/vnd.visio', - 'vst' => 'application/vnd.visio', - 'vsw' => 'application/vnd.visio', - 'vtu' => 'model/vnd.vtu', - 'vxml' => 'application/voicexml+xml', - 'w3d' => 'application/x-director', - 'wad' => 'application/x-doom', - 'wav' => 'audio/x-wav', - 'wax' => 'audio/x-ms-wax', - 'wbmp' => 'image/vnd.wap.wbmp', - 'wbs' => 'application/vnd.criticaltools.wbs+xml', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wcm' => 'application/vnd.ms-works', - 'wdb' => 'application/vnd.ms-works', - 'weba' => 'audio/webm', - 'webm' => 'video/webm', - 'webp' => 'image/webp', - 'wg' => 'application/vnd.pmi.widget', - 'wgt' => 'application/widget', - 'wks' => 'application/vnd.ms-works', - 'wm' => 'video/x-ms-wm', - 'wma' => 'audio/x-ms-wma', - 'wmd' => 'application/x-ms-wmd', - 'wmf' => 'application/x-msmetafile', - 'wml' => 'text/vnd.wap.wml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'wmls' => 'text/vnd.wap.wmlscript', - 'wmlsc' => 'application/vnd.wap.wmlscriptc', - 'wmv' => 'video/x-ms-wmv', - 'wmx' => 'video/x-ms-wmx', - 'wmz' => 'application/x-ms-wmz', - 'woff' => 'application/x-font-woff', - 'wpd' => 'application/vnd.wordperfect', - 'wpl' => 'application/vnd.ms-wpl', - 'wps' => 'application/vnd.ms-works', - 'wqd' => 'application/vnd.wqd', - 'wri' => 'application/x-mswrite', - 'wrl' => 'model/vrml', - 'wsdl' => 'application/wsdl+xml', - 'wspolicy' => 'application/wspolicy+xml', - 'wtb' => 'application/vnd.webturbo', - 'wvx' => 'video/x-ms-wvx', - 'x32' => 'application/x-authorware-bin', - 'x3d' => 'application/vnd.hzn-3d-crossword', - 'xap' => 'application/x-silverlight-app', - 'xar' => 'application/vnd.xara', - 'xbap' => 'application/x-ms-xbap', - 'xbd' => 'application/vnd.fujixerox.docuworks.binder', - 'xbm' => 'image/x-xbitmap', - 'xdf' => 'application/xcap-diff+xml', - 'xdm' => 'application/vnd.syncml.dm+xml', - 'xdp' => 'application/vnd.adobe.xdp+xml', - 'xdssc' => 'application/dssc+xml', - 'xdw' => 'application/vnd.fujixerox.docuworks', - 'xenc' => 'application/xenc+xml', - 'xer' => 'application/patch-ops-error+xml', - 'xfdf' => 'application/vnd.adobe.xfdf', - 'xfdl' => 'application/vnd.xfdl', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'xhvml' => 'application/xv+xml', - 'xif' => 'image/vnd.xiff', - 'xla' => 'application/vnd.ms-excel', - 'xlam' => 'application/vnd.ms-excel.addin.macroenabled.12', - 'xlc' => 'application/vnd.ms-excel', - 'xlm' => 'application/vnd.ms-excel', - 'xls' => 'application/vnd.ms-excel', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroenabled.12', - 'xlsm' => 'application/vnd.ms-excel.sheet.macroenabled.12', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xlt' => 'application/vnd.ms-excel', - 'xltm' => 'application/vnd.ms-excel.template.macroenabled.12', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'xlw' => 'application/vnd.ms-excel', - 'xml' => 'application/xml', - 'xo' => 'application/vnd.olpc-sugar', - 'xop' => 'application/xop+xml', - 'xpi' => 'application/x-xpinstall', - 'xpm' => 'image/x-xpixmap', - 'xpr' => 'application/vnd.is-xpr', - 'xps' => 'application/vnd.ms-xpsdocument', - 'xpw' => 'application/vnd.intercon.formnet', - 'xpx' => 'application/vnd.intercon.formnet', - 'xsl' => 'application/xml', - 'xslt' => 'application/xslt+xml', - 'xsm' => 'application/vnd.syncml+xml', - 'xspf' => 'application/xspf+xml', - 'xul' => 'application/vnd.mozilla.xul+xml', - 'xvm' => 'application/xv+xml', - 'xvml' => 'application/xv+xml', - 'xwd' => 'image/x-xwindowdump', - 'xyz' => 'chemical/x-xyz', - 'yaml' => 'text/yaml', - 'yang' => 'application/yang', - 'yin' => 'application/yin+xml', - 'yml' => 'text/yaml', - 'zaz' => 'application/vnd.zzazz.deck+xml', - 'zip' => 'application/zip', - 'zir' => 'application/vnd.zul', - 'zirz' => 'application/vnd.zul', - 'zmm' => 'application/vnd.handheld-entertainment+xml' - ]; - - /** - * Get a singleton instance of the class - * - * @return self - * @codeCoverageIgnore - */ - public static function getInstance() - { - if (!self::$instance) { - self::$instance = new self(); - } - - return self::$instance; - } - - /** - * Get a mimetype value from a file extension - * - * @param string $extension File extension - * - * @return string|null - */ - public function fromExtension($extension) - { - $extension = strtolower($extension); - - return isset($this->mimetypes[$extension]) ? $this->mimetypes[$extension] : null; - } - - /** - * Get a mimetype from a filename - * - * @param string $filename Filename to generate a mimetype from - * - * @return string|null - */ - public function fromFilename($filename) - { - return $this->fromExtension(pathinfo($filename, PATHINFO_EXTENSION)); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/Collection.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/Collection.php deleted file mode 100644 index cac010ba35..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/Collection.php +++ /dev/null @@ -1,242 +0,0 @@ -items = $items; - } - - /** - * Gets the value of a field from the Graph node. - * - * @param string $name The field to retrieve. - * @param mixed $default The default to return if the field doesn't exist. - * - * @return mixed - */ - public function getField($name, $default = null) - { - if (isset($this->items[$name])) { - return $this->items[$name]; - } - - return $default ?: null; - } - - /** - * Gets the value of the named property for this graph object. - * - * @param string $name The property to retrieve. - * @param mixed $default The default to return if the property doesn't exist. - * - * @return mixed - * - * @deprecated 5.0.0 getProperty() has been renamed to getField() - * @todo v6: Remove this method - */ - public function getProperty($name, $default = null) - { - return $this->getField($name, $default); - } - - /** - * Returns a list of all fields set on the object. - * - * @return array - */ - public function getFieldNames() - { - return array_keys($this->items); - } - - /** - * Returns a list of all properties set on the object. - * - * @return array - * - * @deprecated 5.0.0 getPropertyNames() has been renamed to getFieldNames() - * @todo v6: Remove this method - */ - public function getPropertyNames() - { - return $this->getFieldNames(); - } - - /** - * Get all of the items in the collection. - * - * @return array - */ - public function all() - { - return $this->items; - } - - /** - * Get the collection of items as a plain array. - * - * @return array - */ - public function asArray() - { - return array_map(function ($value) { - return $value instanceof Collection ? $value->asArray() : $value; - }, $this->items); - } - - /** - * Run a map over each of the items. - * - * @param \Closure $callback - * - * @return static - */ - public function map(\Closure $callback) - { - return new static(array_map($callback, $this->items, array_keys($this->items))); - } - - /** - * Get the collection of items as JSON. - * - * @param int $options - * - * @return string - */ - public function asJson($options = 0) - { - return json_encode($this->asArray(), $options); - } - - /** - * Count the number of items in the collection. - * - * @return int - */ - public function count() - { - return count($this->items); - } - - /** - * Get an iterator for the items. - * - * @return ArrayIterator - */ - public function getIterator() - { - return new ArrayIterator($this->items); - } - - /** - * Determine if an item exists at an offset. - * - * @param mixed $key - * - * @return bool - */ - public function offsetExists($key) - { - return array_key_exists($key, $this->items); - } - - /** - * Get an item at a given offset. - * - * @param mixed $key - * - * @return mixed - */ - public function offsetGet($key) - { - return $this->items[$key]; - } - - /** - * Set the item at a given offset. - * - * @param mixed $key - * @param mixed $value - * - * @return void - */ - public function offsetSet($key, $value) - { - if (is_null($key)) { - $this->items[] = $value; - } else { - $this->items[$key] = $value; - } - } - - /** - * Unset the item at a given offset. - * - * @param string $key - * - * @return void - */ - public function offsetUnset($key) - { - unset($this->items[$key]); - } - - /** - * Convert the collection to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->asJson(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAchievement.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAchievement.php deleted file mode 100644 index 3fba815c91..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAchievement.php +++ /dev/null @@ -1,113 +0,0 @@ - '\Facebook\GraphNodes\GraphUser', - 'application' => '\Facebook\GraphNodes\GraphApplication', - ]; - - /** - * Returns the ID for the achievement. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns the user who achieved this. - * - * @return GraphUser|null - */ - public function getFrom() - { - return $this->getField('from'); - } - - /** - * Returns the time at which this was achieved. - * - * @return \DateTime|null - */ - public function getPublishTime() - { - return $this->getField('publish_time'); - } - - /** - * Returns the app in which the user achieved this. - * - * @return GraphApplication|null - */ - public function getApplication() - { - return $this->getField('application'); - } - - /** - * Returns information about the achievement type this instance is connected with. - * - * @return array|null - */ - public function getData() - { - return $this->getField('data'); - } - - /** - * Returns the type of achievement. - * - * @see https://developers.facebook.com/docs/graph-api/reference/v2.2/achievement - * - * @return string - */ - public function getType() - { - return 'game.achievement'; - } - - /** - * Indicates whether gaining the achievement published a feed story for the user. - * - * @return boolean|null - */ - public function isNoFeedStory() - { - return $this->getField('no_feed_story'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAlbum.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAlbum.php deleted file mode 100644 index 50d1f2c378..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphAlbum.php +++ /dev/null @@ -1,183 +0,0 @@ - '\Facebook\GraphNodes\GraphUser', - 'place' => '\Facebook\GraphNodes\GraphPage', - ]; - - /** - * Returns the ID for the album. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns whether the viewer can upload photos to this album. - * - * @return boolean|null - */ - public function getCanUpload() - { - return $this->getField('can_upload'); - } - - /** - * Returns the number of photos in this album. - * - * @return int|null - */ - public function getCount() - { - return $this->getField('count'); - } - - /** - * Returns the ID of the album's cover photo. - * - * @return string|null - */ - public function getCoverPhoto() - { - return $this->getField('cover_photo'); - } - - /** - * Returns the time the album was initially created. - * - * @return \DateTime|null - */ - public function getCreatedTime() - { - return $this->getField('created_time'); - } - - /** - * Returns the time the album was updated. - * - * @return \DateTime|null - */ - public function getUpdatedTime() - { - return $this->getField('updated_time'); - } - - /** - * Returns the description of the album. - * - * @return string|null - */ - public function getDescription() - { - return $this->getField('description'); - } - - /** - * Returns profile that created the album. - * - * @return GraphUser|null - */ - public function getFrom() - { - return $this->getField('from'); - } - - /** - * Returns profile that created the album. - * - * @return GraphPage|null - */ - public function getPlace() - { - return $this->getField('place'); - } - - /** - * Returns a link to this album on Facebook. - * - * @return string|null - */ - public function getLink() - { - return $this->getField('link'); - } - - /** - * Returns the textual location of the album. - * - * @return string|null - */ - public function getLocation() - { - return $this->getField('location'); - } - - /** - * Returns the title of the album. - * - * @return string|null - */ - public function getName() - { - return $this->getField('name'); - } - - /** - * Returns the privacy settings for the album. - * - * @return string|null - */ - public function getPrivacy() - { - return $this->getField('privacy'); - } - - /** - * Returns the type of the album. - * - * enum{ profile, mobile, wall, normal, album } - * - * @return string|null - */ - public function getType() - { - return $this->getField('type'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphApplication.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphApplication.php deleted file mode 100644 index 69b09bb57c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphApplication.php +++ /dev/null @@ -1,43 +0,0 @@ -getField('id'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphCoverPhoto.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphCoverPhoto.php deleted file mode 100644 index ee6075075d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphCoverPhoto.php +++ /dev/null @@ -1,72 +0,0 @@ -getField('id'); - } - - /** - * Returns the source of cover if it exists - * - * @return string|null - */ - public function getSource() - { - return $this->getField('source'); - } - - /** - * Returns the offset_x of cover if it exists - * - * @return int|null - */ - public function getOffsetX() - { - return $this->getField('offset_x'); - } - - /** - * Returns the offset_y of cover if it exists - * - * @return int|null - */ - public function getOffsetY() - { - return $this->getField('offset_y'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEdge.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEdge.php deleted file mode 100644 index 95f32849a8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEdge.php +++ /dev/null @@ -1,260 +0,0 @@ -request = $request; - $this->metaData = $metaData; - $this->parentEdgeEndpoint = $parentEdgeEndpoint; - $this->subclassName = $subclassName; - - parent::__construct($data); - } - - /** - * Gets the parent Graph edge endpoint that generated the list. - * - * @return string|null - */ - public function getParentGraphEdge() - { - return $this->parentEdgeEndpoint; - } - - /** - * Gets the subclass name that the child GraphNode's are cast as. - * - * @return string|null - */ - public function getSubClassName() - { - return $this->subclassName; - } - - /** - * Returns the raw meta data associated with this GraphEdge. - * - * @return array - */ - public function getMetaData() - { - return $this->metaData; - } - - /** - * Returns the next cursor if it exists. - * - * @return string|null - */ - public function getNextCursor() - { - return $this->getCursor('after'); - } - - /** - * Returns the previous cursor if it exists. - * - * @return string|null - */ - public function getPreviousCursor() - { - return $this->getCursor('before'); - } - - /** - * Returns the cursor for a specific direction if it exists. - * - * @param string $direction The direction of the page: after|before - * - * @return string|null - */ - public function getCursor($direction) - { - if (isset($this->metaData['paging']['cursors'][$direction])) { - return $this->metaData['paging']['cursors'][$direction]; - } - - return null; - } - - /** - * Generates a pagination URL based on a cursor. - * - * @param string $direction The direction of the page: next|previous - * - * @return string|null - * - * @throws FacebookSDKException - */ - public function getPaginationUrl($direction) - { - $this->validateForPagination(); - - // Do we have a paging URL? - if (isset($this->metaData['paging'][$direction])) { - // Graph returns the full URL with all the original params. - // We just want the endpoint though. - $pageUrl = $this->metaData['paging'][$direction]; - - return FacebookUrlManipulator::baseGraphUrlEndpoint($pageUrl); - } - - // Do we have a cursor to work with? - $cursorDirection = $direction === 'next' ? 'after' : 'before'; - $cursor = $this->getCursor($cursorDirection); - if (!$cursor) { - return null; - } - - // If we don't know the ID of the parent node, this ain't gonna work. - if (!$this->parentEdgeEndpoint) { - return null; - } - - // We have the parent node ID, paging cursor & original request. - // These were the ingredients chosen to create the perfect little URL. - $pageUrl = $this->parentEdgeEndpoint . '?' . $cursorDirection . '=' . urlencode($cursor); - - // Pull in the original params - $originalUrl = $this->request->getUrl(); - $pageUrl = FacebookUrlManipulator::mergeUrlParams($originalUrl, $pageUrl); - - return FacebookUrlManipulator::forceSlashPrefix($pageUrl); - } - - /** - * Validates whether or not we can paginate on this request. - * - * @throws FacebookSDKException - */ - public function validateForPagination() - { - if ($this->request->getMethod() !== 'GET') { - throw new FacebookSDKException('You can only paginate on a GET request.', 720); - } - } - - /** - * Gets the request object needed to make a next|previous page request. - * - * @param string $direction The direction of the page: next|previous - * - * @return FacebookRequest|null - * - * @throws FacebookSDKException - */ - public function getPaginationRequest($direction) - { - $pageUrl = $this->getPaginationUrl($direction); - if (!$pageUrl) { - return null; - } - - $newRequest = clone $this->request; - $newRequest->setEndpoint($pageUrl); - - return $newRequest; - } - - /** - * Gets the request object needed to make a "next" page request. - * - * @return FacebookRequest|null - * - * @throws FacebookSDKException - */ - public function getNextPageRequest() - { - return $this->getPaginationRequest('next'); - } - - /** - * Gets the request object needed to make a "previous" page request. - * - * @return FacebookRequest|null - * - * @throws FacebookSDKException - */ - public function getPreviousPageRequest() - { - return $this->getPaginationRequest('previous'); - } - - /** - * The total number of results according to Graph if it exists. - * - * This will be returned if the summary=true modifier is present in the request. - * - * @return int|null - */ - public function getTotalCount() - { - if (isset($this->metaData['summary']['total_count'])) { - return $this->metaData['summary']['total_count']; - } - - return null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEvent.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEvent.php deleted file mode 100644 index 19ff2fb4aa..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphEvent.php +++ /dev/null @@ -1,242 +0,0 @@ - '\Facebook\GraphNodes\GraphCoverPhoto', - 'place' => '\Facebook\GraphNodes\GraphPage', - 'picture' => '\Facebook\GraphNodes\GraphPicture', - 'parent_group' => '\Facebook\GraphNodes\GraphGroup', - ]; - - /** - * Returns the `id` (The event ID) as string if present. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns the `cover` (Cover picture) as GraphCoverPhoto if present. - * - * @return GraphCoverPhoto|null - */ - public function getCover() - { - return $this->getField('cover'); - } - - /** - * Returns the `description` (Long-form description) as string if present. - * - * @return string|null - */ - public function getDescription() - { - return $this->getField('description'); - } - - /** - * Returns the `end_time` (End time, if one has been set) as DateTime if present. - * - * @return \DateTime|null - */ - public function getEndTime() - { - return $this->getField('end_time'); - } - - /** - * Returns the `is_date_only` (Whether the event only has a date specified, but no time) as bool if present. - * - * @return bool|null - */ - public function getIsDateOnly() - { - return $this->getField('is_date_only'); - } - - /** - * Returns the `name` (Event name) as string if present. - * - * @return string|null - */ - public function getName() - { - return $this->getField('name'); - } - - /** - * Returns the `owner` (The profile that created the event) as GraphNode if present. - * - * @return GraphNode|null - */ - public function getOwner() - { - return $this->getField('owner'); - } - - /** - * Returns the `parent_group` (The group the event belongs to) as GraphGroup if present. - * - * @return GraphGroup|null - */ - public function getParentGroup() - { - return $this->getField('parent_group'); - } - - /** - * Returns the `place` (Event Place information) as GraphPage if present. - * - * @return GraphPage|null - */ - public function getPlace() - { - return $this->getField('place'); - } - - /** - * Returns the `privacy` (Who can see the event) as string if present. - * - * @return string|null - */ - public function getPrivacy() - { - return $this->getField('privacy'); - } - - /** - * Returns the `start_time` (Start time) as DateTime if present. - * - * @return \DateTime|null - */ - public function getStartTime() - { - return $this->getField('start_time'); - } - - /** - * Returns the `ticket_uri` (The link users can visit to buy a ticket to this event) as string if present. - * - * @return string|null - */ - public function getTicketUri() - { - return $this->getField('ticket_uri'); - } - - /** - * Returns the `timezone` (Timezone) as string if present. - * - * @return string|null - */ - public function getTimezone() - { - return $this->getField('timezone'); - } - - /** - * Returns the `updated_time` (Last update time) as DateTime if present. - * - * @return \DateTime|null - */ - public function getUpdatedTime() - { - return $this->getField('updated_time'); - } - - /** - * Returns the `picture` (Event picture) as GraphPicture if present. - * - * @return GraphPicture|null - */ - public function getPicture() - { - return $this->getField('picture'); - } - - /** - * Returns the `attending_count` (Number of people attending the event) as int if present. - * - * @return int|null - */ - public function getAttendingCount() - { - return $this->getField('attending_count'); - } - - /** - * Returns the `declined_count` (Number of people who declined the event) as int if present. - * - * @return int|null - */ - public function getDeclinedCount() - { - return $this->getField('declined_count'); - } - - /** - * Returns the `maybe_count` (Number of people who maybe going to the event) as int if present. - * - * @return int|null - */ - public function getMaybeCount() - { - return $this->getField('maybe_count'); - } - - /** - * Returns the `noreply_count` (Number of people who did not reply to the event) as int if present. - * - * @return int|null - */ - public function getNoreplyCount() - { - return $this->getField('noreply_count'); - } - - /** - * Returns the `invited_count` (Number of people invited to the event) as int if present. - * - * @return int|null - */ - public function getInvitedCount() - { - return $this->getField('invited_count'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphGroup.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphGroup.php deleted file mode 100644 index 07a4dbd75e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphGroup.php +++ /dev/null @@ -1,171 +0,0 @@ - '\Facebook\GraphNodes\GraphCoverPhoto', - 'venue' => '\Facebook\GraphNodes\GraphLocation', - ]; - - /** - * Returns the `id` (The Group ID) as string if present. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns the `cover` (The cover photo of the Group) as GraphCoverPhoto if present. - * - * @return GraphCoverPhoto|null - */ - public function getCover() - { - return $this->getField('cover'); - } - - /** - * Returns the `description` (A brief description of the Group) as string if present. - * - * @return string|null - */ - public function getDescription() - { - return $this->getField('description'); - } - - /** - * Returns the `email` (The email address to upload content to the Group. Only current members of the Group can use this) as string if present. - * - * @return string|null - */ - public function getEmail() - { - return $this->getField('email'); - } - - /** - * Returns the `icon` (The URL for the Group's icon) as string if present. - * - * @return string|null - */ - public function getIcon() - { - return $this->getField('icon'); - } - - /** - * Returns the `link` (The Group's website) as string if present. - * - * @return string|null - */ - public function getLink() - { - return $this->getField('link'); - } - - /** - * Returns the `name` (The name of the Group) as string if present. - * - * @return string|null - */ - public function getName() - { - return $this->getField('name'); - } - - /** - * Returns the `member_request_count` (Number of people asking to join the group.) as int if present. - * - * @return int|null - */ - public function getMemberRequestCount() - { - return $this->getField('member_request_count'); - } - - /** - * Returns the `owner` (The profile that created this Group) as GraphNode if present. - * - * @return GraphNode|null - */ - public function getOwner() - { - return $this->getField('owner'); - } - - /** - * Returns the `parent` (The parent Group of this Group, if it exists) as GraphNode if present. - * - * @return GraphNode|null - */ - public function getParent() - { - return $this->getField('parent'); - } - - /** - * Returns the `privacy` (The privacy setting of the Group) as string if present. - * - * @return string|null - */ - public function getPrivacy() - { - return $this->getField('privacy'); - } - - /** - * Returns the `updated_time` (The last time the Group was updated (this includes changes in the Group's properties and changes in posts and comments if user can see them)) as \DateTime if present. - * - * @return \DateTime|null - */ - public function getUpdatedTime() - { - return $this->getField('updated_time'); - } - - /** - * Returns the `venue` (The location for the Group) as GraphLocation if present. - * - * @return GraphLocation|null - */ - public function getVenue() - { - return $this->getField('venue'); - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphList.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphList.php deleted file mode 100644 index a60a07a7e5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphList.php +++ /dev/null @@ -1,36 +0,0 @@ -getField('street'); - } - - /** - * Returns the city component of the location - * - * @return string|null - */ - public function getCity() - { - return $this->getField('city'); - } - - /** - * Returns the state component of the location - * - * @return string|null - */ - public function getState() - { - return $this->getField('state'); - } - - /** - * Returns the country component of the location - * - * @return string|null - */ - public function getCountry() - { - return $this->getField('country'); - } - - /** - * Returns the zipcode component of the location - * - * @return string|null - */ - public function getZip() - { - return $this->getField('zip'); - } - - /** - * Returns the latitude component of the location - * - * @return float|null - */ - public function getLatitude() - { - return $this->getField('latitude'); - } - - /** - * Returns the street component of the location - * - * @return float|null - */ - public function getLongitude() - { - return $this->getField('longitude'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNode.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNode.php deleted file mode 100644 index 0d2f504c1e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNode.php +++ /dev/null @@ -1,185 +0,0 @@ -castItems($data)); - } - - /** - * Iterates over an array and detects the types each node - * should be cast to and returns all the items as an array. - * - * @TODO Add auto-casting to AccessToken entities. - * - * @param array $data The array to iterate over. - * - * @return array - */ - public function castItems(array $data) - { - $items = []; - - foreach ($data as $k => $v) { - if ($this->shouldCastAsDateTime($k) - && (is_numeric($v) - || $k === 'birthday' - || $this->isIso8601DateString($v)) - ) { - $items[$k] = $this->castToDateTime($v); - } else { - $items[$k] = $v; - } - } - - return $items; - } - - /** - * Uncasts any auto-casted datatypes. - * Basically the reverse of castItems(). - * - * @return array - */ - public function uncastItems() - { - $items = $this->asArray(); - - return array_map(function ($v) { - if ($v instanceof \DateTime) { - return $v->format(\DateTime::ISO8601); - } - - return $v; - }, $items); - } - - /** - * Get the collection of items as JSON. - * - * @param int $options - * - * @return string - */ - public function asJson($options = 0) - { - return json_encode($this->uncastItems(), $options); - } - - /** - * Detects an ISO 8601 formatted string. - * - * @param string $string - * - * @return boolean - * - * @see https://developers.facebook.com/docs/graph-api/using-graph-api/#readmodifiers - * @see http://www.cl.cam.ac.uk/~mgk25/iso-time.html - * @see http://en.wikipedia.org/wiki/ISO_8601 - */ - public function isIso8601DateString($string) - { - // This insane regex was yoinked from here: - // http://www.pelagodesign.com/blog/2009/05/20/iso-8601-date-validation-that-doesnt-suck/ - // ...and I'm all like: - // http://thecodinglove.com/post/95378251969/when-code-works-and-i-dont-know-why - $crazyInsaneRegexThatSomehowDetectsIso8601 = '/^([\+-]?\d{4}(?!\d{2}\b))' - . '((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?' - . '|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d' - . '|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])' - . '((:?)[0-5]\d)?|24\:?00)([\.,]\d+(?!:))?)?(\17[0-5]\d' - . '([\.,]\d+)?)?([zZ]|([\+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/'; - - return preg_match($crazyInsaneRegexThatSomehowDetectsIso8601, $string) === 1; - } - - /** - * Determines if a value from Graph should be cast to DateTime. - * - * @param string $key - * - * @return boolean - */ - public function shouldCastAsDateTime($key) - { - return in_array($key, [ - 'created_time', - 'updated_time', - 'start_time', - 'end_time', - 'backdated_time', - 'issued_at', - 'expires_at', - 'birthday', - 'publish_time' - ], true); - } - - /** - * Casts a date value from Graph to DateTime. - * - * @param int|string $value - * - * @return \DateTime - */ - public function castToDateTime($value) - { - if (is_int($value)) { - $dt = new \DateTime(); - $dt->setTimestamp($value); - } else { - $dt = new \DateTime($value); - } - - return $dt; - } - - /** - * Getter for $graphObjectMap. - * - * @return array - */ - public static function getObjectMap() - { - return static::$graphObjectMap; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNodeFactory.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNodeFactory.php deleted file mode 100644 index e1bedd910b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphNodeFactory.php +++ /dev/null @@ -1,392 +0,0 @@ -response = $response; - $this->decodedBody = $response->getDecodedBody(); - } - - /** - * Tries to convert a FacebookResponse entity into a GraphNode. - * - * @param string|null $subclassName The GraphNode sub class to cast to. - * - * @return GraphNode - * - * @throws FacebookSDKException - */ - public function makeGraphNode($subclassName = null) - { - $this->validateResponseAsArray(); - $this->validateResponseCastableAsGraphNode(); - - return $this->castAsGraphNodeOrGraphEdge($this->decodedBody, $subclassName); - } - - /** - * Convenience method for creating a GraphAchievement collection. - * - * @return GraphAchievement - * - * @throws FacebookSDKException - */ - public function makeGraphAchievement() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphAchievement'); - } - - /** - * Convenience method for creating a GraphAlbum collection. - * - * @return GraphAlbum - * - * @throws FacebookSDKException - */ - public function makeGraphAlbum() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphAlbum'); - } - - /** - * Convenience method for creating a GraphPage collection. - * - * @return GraphPage - * - * @throws FacebookSDKException - */ - public function makeGraphPage() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphPage'); - } - - /** - * Convenience method for creating a GraphSessionInfo collection. - * - * @return GraphSessionInfo - * - * @throws FacebookSDKException - */ - public function makeGraphSessionInfo() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphSessionInfo'); - } - - /** - * Convenience method for creating a GraphUser collection. - * - * @return GraphUser - * - * @throws FacebookSDKException - */ - public function makeGraphUser() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphUser'); - } - - /** - * Convenience method for creating a GraphEvent collection. - * - * @return GraphEvent - * - * @throws FacebookSDKException - */ - public function makeGraphEvent() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphEvent'); - } - - /** - * Convenience method for creating a GraphGroup collection. - * - * @return GraphGroup - * - * @throws FacebookSDKException - */ - public function makeGraphGroup() - { - return $this->makeGraphNode(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphGroup'); - } - - /** - * Tries to convert a FacebookResponse entity into a GraphEdge. - * - * @param string|null $subclassName The GraphNode sub class to cast the list items to. - * @param boolean $auto_prefix Toggle to auto-prefix the subclass name. - * - * @return GraphEdge - * - * @throws FacebookSDKException - */ - public function makeGraphEdge($subclassName = null, $auto_prefix = true) - { - $this->validateResponseAsArray(); - $this->validateResponseCastableAsGraphEdge(); - - if ($subclassName && $auto_prefix) { - $subclassName = static::BASE_GRAPH_OBJECT_PREFIX . $subclassName; - } - - return $this->castAsGraphNodeOrGraphEdge($this->decodedBody, $subclassName); - } - - /** - * Validates the decoded body. - * - * @throws FacebookSDKException - */ - public function validateResponseAsArray() - { - if (!is_array($this->decodedBody)) { - throw new FacebookSDKException('Unable to get response from Graph as array.', 620); - } - } - - /** - * Validates that the return data can be cast as a GraphNode. - * - * @throws FacebookSDKException - */ - public function validateResponseCastableAsGraphNode() - { - if (isset($this->decodedBody['data']) && static::isCastableAsGraphEdge($this->decodedBody['data'])) { - throw new FacebookSDKException( - 'Unable to convert response from Graph to a GraphNode because the response looks like a GraphEdge. Try using GraphNodeFactory::makeGraphEdge() instead.', - 620 - ); - } - } - - /** - * Validates that the return data can be cast as a GraphEdge. - * - * @throws FacebookSDKException - */ - public function validateResponseCastableAsGraphEdge() - { - if (!(isset($this->decodedBody['data']) && static::isCastableAsGraphEdge($this->decodedBody['data']))) { - throw new FacebookSDKException( - 'Unable to convert response from Graph to a GraphEdge because the response does not look like a GraphEdge. Try using GraphNodeFactory::makeGraphNode() instead.', - 620 - ); - } - } - - /** - * Safely instantiates a GraphNode of $subclassName. - * - * @param array $data The array of data to iterate over. - * @param string|null $subclassName The subclass to cast this collection to. - * - * @return GraphNode - * - * @throws FacebookSDKException - */ - public function safelyMakeGraphNode(array $data, $subclassName = null) - { - $subclassName = $subclassName ?: static::BASE_GRAPH_NODE_CLASS; - static::validateSubclass($subclassName); - - // Remember the parent node ID - $parentNodeId = isset($data['id']) ? $data['id'] : null; - - $items = []; - - foreach ($data as $k => $v) { - // Array means could be recurable - if (is_array($v)) { - // Detect any smart-casting from the $graphObjectMap array. - // This is always empty on the GraphNode collection, but subclasses can define - // their own array of smart-casting types. - $graphObjectMap = $subclassName::getObjectMap(); - $objectSubClass = isset($graphObjectMap[$k]) - ? $graphObjectMap[$k] - : null; - - // Could be a GraphEdge or GraphNode - $items[$k] = $this->castAsGraphNodeOrGraphEdge($v, $objectSubClass, $k, $parentNodeId); - } else { - $items[$k] = $v; - } - } - - return new $subclassName($items); - } - - /** - * Takes an array of values and determines how to cast each node. - * - * @param array $data The array of data to iterate over. - * @param string|null $subclassName The subclass to cast this collection to. - * @param string|null $parentKey The key of this data (Graph edge). - * @param string|null $parentNodeId The parent Graph node ID. - * - * @return GraphNode|GraphEdge - * - * @throws FacebookSDKException - */ - public function castAsGraphNodeOrGraphEdge(array $data, $subclassName = null, $parentKey = null, $parentNodeId = null) - { - if (isset($data['data'])) { - // Create GraphEdge - if (static::isCastableAsGraphEdge($data['data'])) { - return $this->safelyMakeGraphEdge($data, $subclassName, $parentKey, $parentNodeId); - } - // Sometimes Graph is a weirdo and returns a GraphNode under the "data" key - $data = $data['data']; - } - - // Create GraphNode - return $this->safelyMakeGraphNode($data, $subclassName); - } - - /** - * Return an array of GraphNode's. - * - * @param array $data The array of data to iterate over. - * @param string|null $subclassName The GraphNode subclass to cast each item in the list to. - * @param string|null $parentKey The key of this data (Graph edge). - * @param string|null $parentNodeId The parent Graph node ID. - * - * @return GraphEdge - * - * @throws FacebookSDKException - */ - public function safelyMakeGraphEdge(array $data, $subclassName = null, $parentKey = null, $parentNodeId = null) - { - if (!isset($data['data'])) { - throw new FacebookSDKException('Cannot cast data to GraphEdge. Expected a "data" key.', 620); - } - - $dataList = []; - foreach ($data['data'] as $graphNode) { - $dataList[] = $this->safelyMakeGraphNode($graphNode, $subclassName, $parentKey, $parentNodeId); - } - - $metaData = $this->getMetaData($data); - - // We'll need to make an edge endpoint for this in case it's a GraphEdge (for cursor pagination) - $parentGraphEdgeEndpoint = $parentNodeId && $parentKey ? '/' . $parentNodeId . '/' . $parentKey : null; - $className = static::BASE_GRAPH_EDGE_CLASS; - - return new $className($this->response->getRequest(), $dataList, $metaData, $parentGraphEdgeEndpoint, $subclassName); - } - - /** - * Get the meta data from a list in a Graph response. - * - * @param array $data The Graph response. - * - * @return array - */ - public function getMetaData(array $data) - { - unset($data['data']); - - return $data; - } - - /** - * Determines whether or not the data should be cast as a GraphEdge. - * - * @param array $data - * - * @return boolean - */ - public static function isCastableAsGraphEdge(array $data) - { - if ($data === []) { - return true; - } - - // Checks for a sequential numeric array which would be a GraphEdge - return array_keys($data) === range(0, count($data) - 1); - } - - /** - * Ensures that the subclass in question is valid. - * - * @param string $subclassName The GraphNode subclass to validate. - * - * @throws FacebookSDKException - */ - public static function validateSubclass($subclassName) - { - if ($subclassName == static::BASE_GRAPH_NODE_CLASS || is_subclass_of($subclassName, static::BASE_GRAPH_NODE_CLASS)) { - return; - } - - throw new FacebookSDKException('The given subclass "' . $subclassName . '" is not valid. Cannot cast to an object that is not a GraphNode subclass.', 620); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphObject.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphObject.php deleted file mode 100644 index bb8f8e40c1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphObject.php +++ /dev/null @@ -1,36 +0,0 @@ -makeGraphNode($subclassName); - } - - /** - * Convenience method for creating a GraphEvent collection. - * - * @return GraphEvent - * - * @throws FacebookSDKException - */ - public function makeGraphEvent() - { - return $this->makeGraphObject(static::BASE_GRAPH_OBJECT_PREFIX . 'GraphEvent'); - } - - /** - * Tries to convert a FacebookResponse entity into a GraphEdge. - * - * @param string|null $subclassName The GraphNode sub class to cast the list items to. - * @param boolean $auto_prefix Toggle to auto-prefix the subclass name. - * - * @return GraphEdge - * - * @deprecated 5.0.0 GraphObjectFactory has been renamed to GraphNodeFactory - */ - public function makeGraphList($subclassName = null, $auto_prefix = true) - { - return $this->makeGraphEdge($subclassName, $auto_prefix); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPage.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPage.php deleted file mode 100644 index ab8e31a6c4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPage.php +++ /dev/null @@ -1,125 +0,0 @@ - '\Facebook\GraphNodes\GraphPage', - 'global_brand_parent_page' => '\Facebook\GraphNodes\GraphPage', - 'location' => '\Facebook\GraphNodes\GraphLocation', - ]; - - /** - * Returns the ID for the user's page as a string if present. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns the Category for the user's page as a string if present. - * - * @return string|null - */ - public function getCategory() - { - return $this->getField('category'); - } - - /** - * Returns the Name of the user's page as a string if present. - * - * @return string|null - */ - public function getName() - { - return $this->getField('name'); - } - - /** - * Returns the best available Page on Facebook. - * - * @return GraphPage|null - */ - public function getBestPage() - { - return $this->getField('best_page'); - } - - /** - * Returns the brand's global (parent) Page. - * - * @return GraphPage|null - */ - public function getGlobalBrandParentPage() - { - return $this->getField('global_brand_parent_page'); - } - - /** - * Returns the location of this place. - * - * @return GraphLocation|null - */ - public function getLocation() - { - return $this->getField('location'); - } - - /** - * Returns the page access token for the admin user. - * - * Only available in the `/me/accounts` context. - * - * @return string|null - */ - public function getAccessToken() - { - return $this->getField('access_token'); - } - - /** - * Returns the roles of the page admin user. - * - * Only available in the `/me/accounts` context. - * - * @return array|null - */ - public function getPerms() - { - return $this->getField('perms'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPicture.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPicture.php deleted file mode 100644 index bfd37fabce..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphPicture.php +++ /dev/null @@ -1,72 +0,0 @@ -getField('is_silhouette'); - } - - /** - * Returns the url of user picture if it exists - * - * @return string|null - */ - public function getUrl() - { - return $this->getField('url'); - } - - /** - * Returns the width of user picture if it exists - * - * @return int|null - */ - public function getWidth() - { - return $this->getField('width'); - } - - /** - * Returns the height of user picture if it exists - * - * @return int|null - */ - public function getHeight() - { - return $this->getField('height'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphSessionInfo.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphSessionInfo.php deleted file mode 100644 index 3c9e2ff485..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphSessionInfo.php +++ /dev/null @@ -1,102 +0,0 @@ -getField('app_id'); - } - - /** - * Returns the application name the token was issued for. - * - * @return string|null - */ - public function getApplication() - { - return $this->getField('application'); - } - - /** - * Returns the date & time that the token expires. - * - * @return \DateTime|null - */ - public function getExpiresAt() - { - return $this->getField('expires_at'); - } - - /** - * Returns whether the token is valid. - * - * @return boolean - */ - public function getIsValid() - { - return $this->getField('is_valid'); - } - - /** - * Returns the date & time the token was issued at. - * - * @return \DateTime|null - */ - public function getIssuedAt() - { - return $this->getField('issued_at'); - } - - /** - * Returns the scope permissions associated with the token. - * - * @return array - */ - public function getScopes() - { - return $this->getField('scopes'); - } - - /** - * Returns the login id of the user associated with the token. - * - * @return string|null - */ - public function getUserId() - { - return $this->getField('user_id'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphUser.php b/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphUser.php deleted file mode 100644 index cb9ddbb5d9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/GraphNodes/GraphUser.php +++ /dev/null @@ -1,162 +0,0 @@ - '\Facebook\GraphNodes\GraphPage', - 'location' => '\Facebook\GraphNodes\GraphPage', - 'significant_other' => '\Facebook\GraphNodes\GraphUser', - 'picture' => '\Facebook\GraphNodes\GraphPicture', - ]; - - /** - * Returns the ID for the user as a string if present. - * - * @return string|null - */ - public function getId() - { - return $this->getField('id'); - } - - /** - * Returns the name for the user as a string if present. - * - * @return string|null - */ - public function getName() - { - return $this->getField('name'); - } - - /** - * Returns the first name for the user as a string if present. - * - * @return string|null - */ - public function getFirstName() - { - return $this->getField('first_name'); - } - - /** - * Returns the middle name for the user as a string if present. - * - * @return string|null - */ - public function getMiddleName() - { - return $this->getField('middle_name'); - } - - /** - * Returns the last name for the user as a string if present. - * - * @return string|null - */ - public function getLastName() - { - return $this->getField('last_name'); - } - - /** - * Returns the gender for the user as a string if present. - * - * @return string|null - */ - public function getGender() - { - return $this->getField('gender'); - } - - /** - * Returns the Facebook URL for the user as a string if available. - * - * @return string|null - */ - public function getLink() - { - return $this->getField('link'); - } - - /** - * Returns the users birthday, if available. - * - * @return \DateTime|null - */ - public function getBirthday() - { - return $this->getField('birthday'); - } - - /** - * Returns the current location of the user as a GraphPage. - * - * @return GraphPage|null - */ - public function getLocation() - { - return $this->getField('location'); - } - - /** - * Returns the current location of the user as a GraphPage. - * - * @return GraphPage|null - */ - public function getHometown() - { - return $this->getField('hometown'); - } - - /** - * Returns the current location of the user as a GraphUser. - * - * @return GraphUser|null - */ - public function getSignificantOther() - { - return $this->getField('significant_other'); - } - - /** - * Returns the picture of the user as a GraphPicture - * - * @return GraphPicture|null - */ - public function getPicture() - { - return $this->getField('picture'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookCanvasHelper.php b/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookCanvasHelper.php deleted file mode 100644 index 8068526ad3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookCanvasHelper.php +++ /dev/null @@ -1,52 +0,0 @@ -signedRequest ? $this->signedRequest->get('app_data') : null; - } - - /** - * Get raw signed request from POST. - * - * @return string|null - */ - public function getRawSignedRequest() - { - return $this->getRawSignedRequestFromPost() ?: null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookJavaScriptHelper.php b/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookJavaScriptHelper.php deleted file mode 100644 index 5d406b5394..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookJavaScriptHelper.php +++ /dev/null @@ -1,42 +0,0 @@ -getRawSignedRequestFromCookie(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookPageTabHelper.php b/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookPageTabHelper.php deleted file mode 100644 index ee43f5e897..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookPageTabHelper.php +++ /dev/null @@ -1,95 +0,0 @@ -signedRequest) { - return; - } - - $this->pageData = $this->signedRequest->get('page'); - } - - /** - * Returns a value from the page data. - * - * @param string $key - * @param mixed|null $default - * - * @return mixed|null - */ - public function getPageData($key, $default = null) - { - if (isset($this->pageData[$key])) { - return $this->pageData[$key]; - } - - return $default; - } - - /** - * Returns true if the user is an admin. - * - * @return boolean - */ - public function isAdmin() - { - return $this->getPageData('admin') === true; - } - - /** - * Returns the page id if available. - * - * @return string|null - */ - public function getPageId() - { - return $this->getPageData('id'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookRedirectLoginHelper.php b/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookRedirectLoginHelper.php deleted file mode 100644 index 144a5b4546..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookRedirectLoginHelper.php +++ /dev/null @@ -1,360 +0,0 @@ -oAuth2Client = $oAuth2Client; - $this->persistentDataHandler = $persistentDataHandler ?: new FacebookSessionPersistentDataHandler(); - $this->urlDetectionHandler = $urlHandler ?: new FacebookUrlDetectionHandler(); - $this->pseudoRandomStringGenerator = $prsg ?: $this->detectPseudoRandomStringGenerator(); - } - - /** - * Returns the persistent data handler. - * - * @return PersistentDataInterface - */ - public function getPersistentDataHandler() - { - return $this->persistentDataHandler; - } - - /** - * Returns the URL detection handler. - * - * @return UrlDetectionInterface - */ - public function getUrlDetectionHandler() - { - return $this->urlDetectionHandler; - } - - /** - * Returns the cryptographically secure pseudo-random string generator. - * - * @return PseudoRandomStringGeneratorInterface - */ - public function getPseudoRandomStringGenerator() - { - return $this->pseudoRandomStringGenerator; - } - - /** - * Detects which pseudo-random string generator to use. - * - * @return PseudoRandomStringGeneratorInterface - * - * @throws FacebookSDKException - */ - public function detectPseudoRandomStringGenerator() - { - // Since openssl_random_pseudo_bytes() can sometimes return non-cryptographically - // secure pseudo-random strings (in rare cases), we check for mcrypt_create_iv() first. - if (function_exists('mcrypt_create_iv')) { - return new McryptPseudoRandomStringGenerator(); - } - - if (function_exists('openssl_random_pseudo_bytes')) { - return new OpenSslPseudoRandomStringGenerator(); - } - - if (!ini_get('open_basedir') && is_readable('/dev/urandom')) { - return new UrandomPseudoRandomStringGenerator(); - } - - throw new FacebookSDKException('Unable to detect a cryptographically secure pseudo-random string generator.'); - } - - /** - * Stores CSRF state and returns a URL to which the user should be sent to in order to continue the login process with Facebook. - * - * @param string $redirectUrl The URL Facebook should redirect users to after login. - * @param array $scope List of permissions to request during login. - * @param array $params An array of parameters to generate URL. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - */ - private function makeUrl($redirectUrl, array $scope, array $params = [], $separator = '&') - { - $state = $this->pseudoRandomStringGenerator->getPseudoRandomString(static::CSRF_LENGTH); - $this->persistentDataHandler->set('state', $state); - - return $this->oAuth2Client->getAuthorizationUrl($redirectUrl, $state, $scope, $params, $separator); - } - - /** - * Returns the URL to send the user in order to login to Facebook. - * - * @param string $redirectUrl The URL Facebook should redirect users to after login. - * @param array $scope List of permissions to request during login. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - */ - public function getLoginUrl($redirectUrl, array $scope = [], $separator = '&') - { - return $this->makeUrl($redirectUrl, $scope, [], $separator); - } - - /** - * Returns the URL to send the user in order to log out of Facebook. - * - * @param AccessToken|string $accessToken The access token that will be logged out. - * @param string $next The url Facebook should redirect the user to after a successful logout. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - * - * @throws FacebookSDKException - */ - public function getLogoutUrl($accessToken, $next, $separator = '&') - { - if (!$accessToken instanceof AccessToken) { - $accessToken = new AccessToken($accessToken); - } - - if ($accessToken->isAppAccessToken()) { - throw new FacebookSDKException('Cannot generate a logout URL with an app access token.', 722); - } - - $params = [ - 'next' => $next, - 'access_token' => $accessToken->getValue(), - ]; - - return 'https://www.facebook.com/logout.php?' . http_build_query($params, null, $separator); - } - - /** - * Returns the URL to send the user in order to login to Facebook with permission(s) to be re-asked. - * - * @param string $redirectUrl The URL Facebook should redirect users to after login. - * @param array $scope List of permissions to request during login. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - */ - public function getReRequestUrl($redirectUrl, array $scope = [], $separator = '&') - { - $params = ['auth_type' => 'rerequest']; - - return $this->makeUrl($redirectUrl, $scope, $params, $separator); - } - - /** - * Returns the URL to send the user in order to login to Facebook with user to be re-authenticated. - * - * @param string $redirectUrl The URL Facebook should redirect users to after login. - * @param array $scope List of permissions to request during login. - * @param string $separator The separator to use in http_build_query(). - * - * @return string - */ - public function getReAuthenticationUrl($redirectUrl, array $scope = [], $separator = '&') - { - $params = ['auth_type' => 'reauthenticate']; - - return $this->makeUrl($redirectUrl, $scope, $params, $separator); - } - - /** - * Takes a valid code from a login redirect, and returns an AccessToken entity. - * - * @param string|null $redirectUrl The redirect URL. - * - * @return AccessToken|null - * - * @throws FacebookSDKException - */ - public function getAccessToken($redirectUrl = null) - { - if (!$code = $this->getCode()) { - return null; - } - - $this->validateCsrf(); - - $redirectUrl = $redirectUrl ?: $this->urlDetectionHandler->getCurrentUrl(); - // At minimum we need to remove the state param - $redirectUrl = FacebookUrlManipulator::removeParamsFromUrl($redirectUrl, ['state']); - - return $this->oAuth2Client->getAccessTokenFromCode($code, $redirectUrl); - } - - /** - * Validate the request against a cross-site request forgery. - * - * @throws FacebookSDKException - */ - protected function validateCsrf() - { - $state = $this->getState(); - $savedState = $this->persistentDataHandler->get('state'); - - if (!$state || !$savedState) { - throw new FacebookSDKException('Cross-site request forgery validation failed. Required param "state" missing.'); - } - - $savedLen = strlen($savedState); - $givenLen = strlen($state); - - if ($savedLen !== $givenLen) { - throw new FacebookSDKException('Cross-site request forgery validation failed. The "state" param from the URL and session do not match.'); - } - - $result = 0; - for ($i = 0; $i < $savedLen; $i++) { - $result |= ord($state[$i]) ^ ord($savedState[$i]); - } - - if ($result !== 0) { - throw new FacebookSDKException('Cross-site request forgery validation failed. The "state" param from the URL and session do not match.'); - } - } - - /** - * Return the code. - * - * @return string|null - */ - protected function getCode() - { - return $this->getInput('code'); - } - - /** - * Return the state. - * - * @return string|null - */ - protected function getState() - { - return $this->getInput('state'); - } - - /** - * Return the error code. - * - * @return string|null - */ - public function getErrorCode() - { - return $this->getInput('error_code'); - } - - /** - * Returns the error. - * - * @return string|null - */ - public function getError() - { - return $this->getInput('error'); - } - - /** - * Returns the error reason. - * - * @return string|null - */ - public function getErrorReason() - { - return $this->getInput('error_reason'); - } - - /** - * Returns the error description. - * - * @return string|null - */ - public function getErrorDescription() - { - return $this->getInput('error_description'); - } - - /** - * Returns a value from a GET param. - * - * @param string $key - * - * @return string|null - */ - private function getInput($key) - { - return isset($_GET[$key]) ? $_GET[$key] : null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php b/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php deleted file mode 100644 index aafa24645f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Helpers/FacebookSignedRequestFromInputHelper.php +++ /dev/null @@ -1,166 +0,0 @@ -app = $app; - $graphVersion = $graphVersion ?: Facebook::DEFAULT_GRAPH_VERSION; - $this->oAuth2Client = new OAuth2Client($this->app, $client, $graphVersion); - - $this->instantiateSignedRequest(); - } - - /** - * Instantiates a new SignedRequest entity. - * - * @param string|null - */ - public function instantiateSignedRequest($rawSignedRequest = null) - { - $rawSignedRequest = $rawSignedRequest ?: $this->getRawSignedRequest(); - - if (!$rawSignedRequest) { - return; - } - - $this->signedRequest = new SignedRequest($this->app, $rawSignedRequest); - } - - /** - * Returns an AccessToken entity from the signed request. - * - * @return AccessToken|null - * - * @throws \Facebook\Exceptions\FacebookSDKException - */ - public function getAccessToken() - { - if ($this->signedRequest && $this->signedRequest->hasOAuthData()) { - $code = $this->signedRequest->get('code'); - $accessToken = $this->signedRequest->get('oauth_token'); - - if ($code && !$accessToken) { - return $this->oAuth2Client->getAccessTokenFromCode($code); - } - - $expiresAt = $this->signedRequest->get('expires', 0); - - return new AccessToken($accessToken, $expiresAt); - } - - return null; - } - - /** - * Returns the SignedRequest entity. - * - * @return SignedRequest|null - */ - public function getSignedRequest() - { - return $this->signedRequest; - } - - /** - * Returns the user_id if available. - * - * @return string|null - */ - public function getUserId() - { - return $this->signedRequest ? $this->signedRequest->getUserId() : null; - } - - /** - * Get raw signed request from input. - * - * @return string|null - */ - abstract public function getRawSignedRequest(); - - /** - * Get raw signed request from POST input. - * - * @return string|null - */ - public function getRawSignedRequestFromPost() - { - if (isset($_POST['signed_request'])) { - return $_POST['signed_request']; - } - - return null; - } - - /** - * Get raw signed request from cookie set from the Javascript SDK. - * - * @return string|null - */ - public function getRawSignedRequestFromCookie() - { - if (isset($_COOKIE['fbsr_' . $this->app->getId()])) { - return $_COOKIE['fbsr_' . $this->app->getId()]; - } - - return null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Http/GraphRawResponse.php b/rainloop/v/0.0.0/app/libraries/Facebook/Http/GraphRawResponse.php deleted file mode 100644 index 583d3033c5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Http/GraphRawResponse.php +++ /dev/null @@ -1,137 +0,0 @@ -httpResponseCode = (int)$httpStatusCode; - } - - if (is_array($headers)) { - $this->headers = $headers; - } else { - $this->setHeadersFromString($headers); - } - - $this->body = $body; - } - - /** - * Return the response headers. - * - * @return array - */ - public function getHeaders() - { - return $this->headers; - } - - /** - * Return the body of the response. - * - * @return string - */ - public function getBody() - { - return $this->body; - } - - /** - * Return the HTTP response code. - * - * @return int - */ - public function getHttpResponseCode() - { - return $this->httpResponseCode; - } - - /** - * Sets the HTTP response code from a raw header. - * - * @param string $rawResponseHeader - */ - public function setHttpResponseCodeFromHeader($rawResponseHeader) - { - preg_match('|HTTP/\d\.\d\s+(\d+)\s+.*|', $rawResponseHeader, $match); - $this->httpResponseCode = (int)$match[1]; - } - - /** - * Parse the raw headers and set as an array. - * - * @param string $rawHeaders The raw headers from the response. - */ - protected function setHeadersFromString($rawHeaders) - { - // Normalize line breaks - $rawHeaders = str_replace("\r\n", "\n", $rawHeaders); - - // There will be multiple headers if a 301 was followed - // or a proxy was followed, etc - $headerCollection = explode("\n\n", trim($rawHeaders)); - // We just want the last response (at the end) - $rawHeader = array_pop($headerCollection); - - $headerComponents = explode("\n", $rawHeader); - foreach ($headerComponents as $line) { - if (strpos($line, ': ') === false) { - $this->setHttpResponseCodeFromHeader($line); - } else { - list($key, $value) = explode(': ', $line); - $this->headers[$key] = $value; - } - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyInterface.php b/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyInterface.php deleted file mode 100644 index 97e0a2e876..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -params = $params; - $this->files = $files; - $this->boundary = $boundary ?: uniqid(); - } - - /** - * @inheritdoc - */ - public function getBody() - { - $body = ''; - - // Compile normal params - $params = $this->getNestedParams($this->params); - foreach ($params as $k => $v) { - $body .= $this->getParamString($k, $v); - } - - // Compile files - foreach ($this->files as $k => $v) { - $body .= $this->getFileString($k, $v); - } - - // Peace out - $body .= "--{$this->boundary}--\r\n"; - - return $body; - } - - /** - * Get the boundary - * - * @return string - */ - public function getBoundary() - { - return $this->boundary; - } - - /** - * Get the string needed to transfer a file. - * - * @param string $name - * @param FacebookFile $file - * - * @return string - */ - private function getFileString($name, FacebookFile $file) - { - return sprintf( - "--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"%s\r\n\r\n%s\r\n", - $this->boundary, - $name, - $file->getFileName(), - $this->getFileHeaders($file), - $file->getContents() - ); - } - - /** - * Get the string needed to transfer a POST field. - * - * @param string $name - * @param string $value - * - * @return string - */ - private function getParamString($name, $value) - { - return sprintf( - "--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", - $this->boundary, - $name, - $value - ); - } - - /** - * Returns the params as an array of nested params. - * - * @param array $params - * - * @return array - */ - private function getNestedParams(array $params) - { - $query = http_build_query($params, null, '&'); - $params = explode('&', $query); - $result = []; - - foreach ($params as $param) { - list($key, $value) = explode('=', $param, 2); - $result[urldecode($key)] = urldecode($value); - } - - return $result; - } - - /** - * Get the headers needed before transferring the content of a POST file. - * - * @param FacebookFile $file - * - * @return string - */ - protected function getFileHeaders(FacebookFile $file) - { - return "\r\nContent-Type: {$file->getMimetype()}"; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyUrlEncoded.php b/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyUrlEncoded.php deleted file mode 100644 index 77c2b64928..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Http/RequestBodyUrlEncoded.php +++ /dev/null @@ -1,55 +0,0 @@ -params = $params; - } - - /** - * @inheritdoc - */ - public function getBody() - { - return http_build_query($this->params, null, '&'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurl.php b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurl.php deleted file mode 100644 index e5d124ac42..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurl.php +++ /dev/null @@ -1,129 +0,0 @@ -curl = curl_init(); - } - - /** - * Set a curl option - * - * @param $key - * @param $value - */ - public function setopt($key, $value) - { - curl_setopt($this->curl, $key, $value); - } - - /** - * Set an array of options to a curl resource - * - * @param array $options - */ - public function setoptArray(array $options) - { - curl_setopt_array($this->curl, $options); - } - - /** - * Send a curl request - * - * @return mixed - */ - public function exec() - { - return curl_exec($this->curl); - } - - /** - * Return the curl error number - * - * @return int - */ - public function errno() - { - return curl_errno($this->curl); - } - - /** - * Return the curl error message - * - * @return string - */ - public function error() - { - return curl_error($this->curl); - } - - /** - * Get info from a curl reference - * - * @param $type - * - * @return mixed - */ - public function getinfo($type) - { - return curl_getinfo($this->curl, $type); - } - - /** - * Get the currently installed curl version - * - * @return array - */ - public function version() - { - return curl_version(); - } - - /** - * Close the resource connection to curl - */ - public function close() - { - curl_close($this->curl); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurlHttpClient.php b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurlHttpClient.php deleted file mode 100644 index 955ac06229..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookCurlHttpClient.php +++ /dev/null @@ -1,210 +0,0 @@ -facebookCurl = $facebookCurl ?: new FacebookCurl(); - } - - /** - * @inheritdoc - */ - public function send($url, $method, $body, array $headers, $timeOut) - { - $this->openConnection($url, $method, $body, $headers, $timeOut); - $this->sendRequest(); - - if ($curlErrorCode = $this->facebookCurl->errno()) { - throw new FacebookSDKException($this->facebookCurl->error(), $curlErrorCode); - } - - // Separate the raw headers from the raw body - list($rawHeaders, $rawBody) = $this->extractResponseHeadersAndBody(); - - $this->closeConnection(); - - return new GraphRawResponse($rawHeaders, $rawBody); - } - - /** - * Opens a new curl connection. - * - * @param string $url The endpoint to send the request to. - * @param string $method The request method. - * @param string $body The body of the request. - * @param array $headers The request headers. - * @param int $timeOut The timeout in seconds for the request. - */ - public function openConnection($url, $method, $body, array $headers, $timeOut) - { - $options = [ - CURLOPT_CUSTOMREQUEST => $method, - CURLOPT_HTTPHEADER => $this->compileRequestHeaders($headers), - CURLOPT_URL => $url, - CURLOPT_CONNECTTIMEOUT => 10, - CURLOPT_TIMEOUT => $timeOut, - CURLOPT_RETURNTRANSFER => true, // Follow 301 redirects - CURLOPT_HEADER => true, // Enable header processing - CURLOPT_SSL_VERIFYHOST => 2, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_CAINFO => __DIR__ . '/certs/DigiCertHighAssuranceEVRootCA.pem', - ]; - - if ($method !== "GET") { - $options[CURLOPT_POSTFIELDS] = $body; - } - - $this->facebookCurl->init(); - $this->facebookCurl->setoptArray($options); - } - - /** - * Closes an existing curl connection - */ - public function closeConnection() - { - $this->facebookCurl->close(); - } - - /** - * Send the request and get the raw response from curl - */ - public function sendRequest() - { - $this->rawResponse = $this->facebookCurl->exec(); - } - - /** - * Compiles the request headers into a curl-friendly format. - * - * @param array $headers The request headers. - * - * @return array - */ - public function compileRequestHeaders(array $headers) - { - $return = []; - - foreach ($headers as $key => $value) { - $return[] = $key . ': ' . $value; - } - - return $return; - } - - /** - * Extracts the headers and the body into a two-part array - * - * @return array - */ - public function extractResponseHeadersAndBody() - { - $headerSize = $this->getHeaderSize(); - - $rawHeaders = mb_substr($this->rawResponse, 0, $headerSize); - $rawBody = mb_substr($this->rawResponse, $headerSize); - - return [trim($rawHeaders), trim($rawBody)]; - } - - /** - * Return proper header size - * - * @return integer - */ - private function getHeaderSize() - { - $headerSize = $this->facebookCurl->getinfo(CURLINFO_HEADER_SIZE); - // This corrects a Curl bug where header size does not account - // for additional Proxy headers. - if ($this->needsCurlProxyFix()) { - // Additional way to calculate the request body size. - if (preg_match('/Content-Length: (\d+)/', $this->rawResponse, $m)) { - $headerSize = mb_strlen($this->rawResponse) - $m[1]; - } elseif (stripos($this->rawResponse, self::CONNECTION_ESTABLISHED) !== false) { - $headerSize += mb_strlen(self::CONNECTION_ESTABLISHED); - } - } - - return $headerSize; - } - - /** - * Detect versions of Curl which report incorrect header lengths when - * using Proxies. - * - * @return boolean - */ - private function needsCurlProxyFix() - { - $ver = $this->facebookCurl->version(); - $version = $ver['version_number']; - - return $version < self::CURL_PROXY_QUIRK_VER; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookGuzzleHttpClient.php b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookGuzzleHttpClient.php deleted file mode 100644 index 6f2a1c6f22..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookGuzzleHttpClient.php +++ /dev/null @@ -1,97 +0,0 @@ -guzzleClient = $guzzleClient ?: new Client(); - } - - /** - * @inheritdoc - */ - public function send($url, $method, $body, array $headers, $timeOut) - { - $options = [ - 'headers' => $headers, - 'body' => $body, - 'timeout' => $timeOut, - 'connect_timeout' => 10, - 'verify' => __DIR__ . '/certs/DigiCertHighAssuranceEVRootCA.pem', - ]; - $request = $this->guzzleClient->createRequest($method, $url, $options); - - try { - $rawResponse = $this->guzzleClient->send($request); - } catch (RequestException $e) { - $rawResponse = $e->getResponse(); - - if ($e->getPrevious() instanceof RingException || !$rawResponse instanceof ResponseInterface) { - throw new FacebookSDKException($e->getMessage(), $e->getCode()); - } - } - - $rawHeaders = $this->getHeadersAsString($rawResponse); - $rawBody = $rawResponse->getBody(); - $httpStatusCode = $rawResponse->getStatusCode(); - - return new GraphRawResponse($rawHeaders, $rawBody, $httpStatusCode); - } - - /** - * Returns the Guzzle array of headers as a string. - * - * @param ResponseInterface $response The Guzzle response. - * - * @return string - */ - public function getHeadersAsString(ResponseInterface $response) - { - $headers = $response->getHeaders(); - $rawHeaders = []; - foreach ($headers as $name => $values) { - $rawHeaders[] = $name . ": " . implode(", ", $values); - } - - return implode("\r\n", $rawHeaders); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookHttpClientInterface.php b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookHttpClientInterface.php deleted file mode 100644 index 0029bc022e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookHttpClientInterface.php +++ /dev/null @@ -1,47 +0,0 @@ -stream = stream_context_create($options); - } - - /** - * The response headers from the stream wrapper - * - * @return array|null - */ - public function getResponseHeaders() - { - return $this->responseHeaders; - } - - /** - * Send a stream wrapped request - * - * @param string $url - * - * @return mixed - */ - public function fileGetContents($url) - { - $rawResponse = file_get_contents($url, false, $this->stream); - $this->responseHeaders = $http_response_header; - - return $rawResponse; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookStreamHttpClient.php b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookStreamHttpClient.php deleted file mode 100644 index b157514310..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/FacebookStreamHttpClient.php +++ /dev/null @@ -1,94 +0,0 @@ -facebookStream = $facebookStream ?: new FacebookStream(); - } - - /** - * @inheritdoc - */ - public function send($url, $method, $body, array $headers, $timeOut) - { - $options = [ - 'http' => [ - 'method' => $method, - 'header' => $this->compileHeader($headers), - 'content' => $body, - 'timeout' => $timeOut, - 'ignore_errors' => true - ], - 'ssl' => [ - 'verify_peer' => true, - 'verify_peer_name' => true, - 'allow_self_signed' => true, // All root certificates are self-signed - 'cafile' => __DIR__ . '/certs/DigiCertHighAssuranceEVRootCA.pem', - ], - ]; - - $this->facebookStream->streamContextCreate($options); - $rawBody = $this->facebookStream->fileGetContents($url); - $rawHeaders = $this->facebookStream->getResponseHeaders(); - - if ($rawBody === false || !$rawHeaders) { - throw new FacebookSDKException('Stream returned an empty response', 660); - } - - $rawHeaders = implode("\r\n", $rawHeaders); - - return new GraphRawResponse($rawHeaders, $rawBody); - } - - /** - * Formats the headers for use in the stream wrapper. - * - * @param array $headers The request headers. - * - * @return string - */ - public function compileHeader(array $headers) - { - $header = []; - foreach ($headers as $k => $v) { - $header[] = $k . ': ' . $v; - } - - return implode("\r\n", $header); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/certs/DigiCertHighAssuranceEVRootCA.pem b/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/certs/DigiCertHighAssuranceEVRootCA.pem deleted file mode 100644 index 9e6810ab70..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/HttpClients/certs/DigiCertHighAssuranceEVRootCA.pem +++ /dev/null @@ -1,23 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs -MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 -d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j -ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL -MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 -LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug -RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm -+9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW -PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM -xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB -Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 -hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg -EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA -FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec -nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z -eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF -hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 -Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep -+OkuE6N36B9K ------END CERTIFICATE----- diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php b/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php deleted file mode 100644 index 93a6686153..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookMemoryPersistentDataHandler.php +++ /dev/null @@ -1,53 +0,0 @@ -sessionData[$key]) ? $this->sessionData[$key] : null; - } - - /** - * @inheritdoc - */ - public function set($key, $value) - { - $this->sessionData[$key] = $value; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php b/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php deleted file mode 100644 index 698bfd046c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/FacebookSessionPersistentDataHandler.php +++ /dev/null @@ -1,76 +0,0 @@ -sessionPrefix . $key])) { - return $_SESSION[$this->sessionPrefix . $key]; - } - - return null; - } - - /** - * @inheritdoc - */ - public function set($key, $value) - { - $_SESSION[$this->sessionPrefix . $key] = $value; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/PersistentDataInterface.php b/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/PersistentDataInterface.php deleted file mode 100644 index bd7e072a83..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/PersistentData/PersistentDataInterface.php +++ /dev/null @@ -1,49 +0,0 @@ -validateLength($length); - - $binaryString = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); - - if ($binaryString === false) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'mcrypt_create_iv() returned an error.' - ); - } - - return $this->binToHex($binaryString, $length); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php b/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php deleted file mode 100644 index f4ea6b8707..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/OpenSslPseudoRandomStringGenerator.php +++ /dev/null @@ -1,67 +0,0 @@ -validateLength($length); - - $wasCryptographicallyStrong = false; - $binaryString = openssl_random_pseudo_bytes($length, $wasCryptographicallyStrong); - - if ($binaryString === false) { - throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned an unknown error.'); - } - - if ($wasCryptographicallyStrong !== true) { - throw new FacebookSDKException(static::ERROR_MESSAGE . 'openssl_random_pseudo_bytes() returned a pseudo-random string but it was not cryptographically secure and cannot be used.'); - } - - return $this->binToHex($binaryString, $length); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php b/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php deleted file mode 100644 index 970330c856..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/PseudoRandomString/PseudoRandomStringGeneratorInterface.php +++ /dev/null @@ -1,45 +0,0 @@ -validateLength($length); - - $stream = fopen('/dev/urandom', 'rb'); - if (!is_resource($stream)) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'Unable to open stream to /dev/urandom.' - ); - } - - if (!defined('HHVM_VERSION')) { - stream_set_read_buffer($stream, 0); - } - - $binaryString = fread($stream, $length); - fclose($stream); - - if (!$binaryString) { - throw new FacebookSDKException( - static::ERROR_MESSAGE . - 'Stream to /dev/urandom returned no data.' - ); - } - - return $this->binToHex($binaryString, $length); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/SignedRequest.php b/rainloop/v/0.0.0/app/libraries/Facebook/SignedRequest.php deleted file mode 100644 index 77099a346d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/SignedRequest.php +++ /dev/null @@ -1,332 +0,0 @@ -app = $facebookApp; - - if (!$rawSignedRequest) { - return; - } - - $this->rawSignedRequest = $rawSignedRequest; - - $this->parse(); - } - - /** - * Returns the raw signed request data. - * - * @return string|null - */ - public function getRawSignedRequest() - { - return $this->rawSignedRequest; - } - - /** - * Returns the parsed signed request data. - * - * @return array|null - */ - public function getPayload() - { - return $this->payload; - } - - /** - * Returns a property from the signed request data if available. - * - * @param string $key - * @param mixed|null $default - * - * @return mixed|null - */ - public function get($key, $default = null) - { - if (isset($this->payload[$key])) { - return $this->payload[$key]; - } - - return $default; - } - - /** - * Returns user_id from signed request data if available. - * - * @return string|null - */ - public function getUserId() - { - return $this->get('user_id'); - } - - /** - * Checks for OAuth data in the payload. - * - * @return boolean - */ - public function hasOAuthData() - { - return $this->get('oauth_token') || $this->get('code'); - } - - /** - * Creates a signed request from an array of data. - * - * @param array $payload - * - * @return string - */ - public function make(array $payload) - { - $payload['algorithm'] = isset($payload['algorithm']) ? $payload['algorithm'] : 'HMAC-SHA256'; - $payload['issued_at'] = isset($payload['issued_at']) ? $payload['issued_at'] : time(); - $encodedPayload = $this->base64UrlEncode(json_encode($payload)); - - $hashedSig = $this->hashSignature($encodedPayload); - $encodedSig = $this->base64UrlEncode($hashedSig); - - return $encodedSig . '.' . $encodedPayload; - } - - /** - * Validates and decodes a signed request and saves - * the payload to an array. - */ - protected function parse() - { - list($encodedSig, $encodedPayload) = $this->split(); - - // Signature validation - $sig = $this->decodeSignature($encodedSig); - $hashedSig = $this->hashSignature($encodedPayload); - $this->validateSignature($hashedSig, $sig); - - $this->payload = $this->decodePayload($encodedPayload); - - // Payload validation - $this->validateAlgorithm(); - } - - /** - * Splits a raw signed request into signature and payload. - * - * @returns array - * - * @throws FacebookSDKException - */ - protected function split() - { - if (strpos($this->rawSignedRequest, '.') === false) { - throw new FacebookSDKException('Malformed signed request.', 606); - } - - return explode('.', $this->rawSignedRequest, 2); - } - - /** - * Decodes the raw signature from a signed request. - * - * @param string $encodedSig - * - * @returns string - * - * @throws FacebookSDKException - */ - protected function decodeSignature($encodedSig) - { - $sig = $this->base64UrlDecode($encodedSig); - - if (!$sig) { - throw new FacebookSDKException('Signed request has malformed encoded signature data.', 607); - } - - return $sig; - } - - /** - * Decodes the raw payload from a signed request. - * - * @param string $encodedPayload - * - * @returns array - * - * @throws FacebookSDKException - */ - protected function decodePayload($encodedPayload) - { - $payload = $this->base64UrlDecode($encodedPayload); - - if ($payload) { - $payload = json_decode($payload, true); - } - - if (!is_array($payload)) { - throw new FacebookSDKException('Signed request has malformed encoded payload data.', 607); - } - - return $payload; - } - - /** - * Validates the algorithm used in a signed request. - * - * @throws FacebookSDKException - */ - protected function validateAlgorithm() - { - if ($this->get('algorithm') !== 'HMAC-SHA256') { - throw new FacebookSDKException('Signed request is using the wrong algorithm.', 605); - } - } - - /** - * Hashes the signature used in a signed request. - * - * @param string $encodedData - * - * @return string - * - * @throws FacebookSDKException - */ - protected function hashSignature($encodedData) - { - $hashedSig = hash_hmac( - 'sha256', - $encodedData, - $this->app->getSecret(), - $raw_output = true - ); - - if (!$hashedSig) { - throw new FacebookSDKException('Unable to hash signature from encoded payload data.', 602); - } - - return $hashedSig; - } - - /** - * Validates the signature used in a signed request. - * - * @param string $hashedSig - * @param string $sig - * - * @throws FacebookSDKException - */ - protected function validateSignature($hashedSig, $sig) - { - if (mb_strlen($hashedSig) === mb_strlen($sig)) { - $validate = 0; - for ($i = 0; $i < mb_strlen($sig); $i++) { - $validate |= ord($hashedSig[$i]) ^ ord($sig[$i]); - } - if ($validate === 0) { - return; - } - } - - throw new FacebookSDKException('Signed request has an invalid signature.', 602); - } - - /** - * Base64 decoding which replaces characters: - * + instead of - - * / instead of _ - * - * @link http://en.wikipedia.org/wiki/Base64#URL_applications - * - * @param string $input base64 url encoded input - * - * @return string decoded string - */ - public function base64UrlDecode($input) - { - $urlDecodedBase64 = strtr($input, '-_', '+/'); - $this->validateBase64($urlDecodedBase64); - - return base64_decode($urlDecodedBase64); - } - - /** - * Base64 encoding which replaces characters: - * + instead of - - * / instead of _ - * - * @link http://en.wikipedia.org/wiki/Base64#URL_applications - * - * @param string $input string to encode - * - * @return string base64 url encoded input - */ - public function base64UrlEncode($input) - { - return strtr(base64_encode($input), '+/', '-_'); - } - - /** - * Validates a base64 string. - * - * @param string $input base64 value to validate - * - * @throws FacebookSDKException - */ - protected function validateBase64($input) - { - if (!preg_match('/^[a-zA-Z0-9\/\r\n+]*={0,2}$/', $input)) { - throw new FacebookSDKException('Signed request contains malformed base64 encoding.', 608); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlDetectionHandler.php b/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlDetectionHandler.php deleted file mode 100644 index 5fbb9ce478..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlDetectionHandler.php +++ /dev/null @@ -1,163 +0,0 @@ -getHttpScheme() . '://' . $this->getHostName() . $this->getServerVar('REQUEST_URI'); - } - - /** - * Get the currently active URL scheme. - * - * @return string - */ - protected function getHttpScheme() - { - return $this->isBehindSsl() ? 'https' : 'http'; - } - - /** - * Tries to detect if the server is running behind an SSL. - * - * @return boolean - */ - protected function isBehindSsl() - { - // Check for proxy first - $protocol = $this->getHeader('X_FORWARDED_PROTO'); - if ($protocol) { - return $this->protocolWithActiveSsl($protocol); - } - - $protocol = $this->getServerVar('HTTPS'); - if ($protocol) { - return $this->protocolWithActiveSsl($protocol); - } - - return (string)$this->getServerVar('SERVER_PORT') === '443'; - } - - /** - * Detects an active SSL protocol value. - * - * @param string $protocol - * - * @return boolean - */ - protected function protocolWithActiveSsl($protocol) - { - $protocol = strtolower((string)$protocol); - - return in_array($protocol, ['on', '1', 'https', 'ssl'], true); - } - - /** - * Tries to detect the host name of the server. - * - * Some elements adapted from - * - * @see https://github.com/symfony/HttpFoundation/blob/master/Request.php - * - * @return string - */ - protected function getHostName() - { - // Check for proxy first - if ($host = $this->getHeader('X_FORWARDED_HOST')) { - $elements = explode(',', $host); - $host = $elements[count($elements) - 1]; - } elseif (!$host = $this->getHeader('HOST')) { - if (!$host = $this->getServerVar('SERVER_NAME')) { - $host = $this->getServerVar('SERVER_ADDR'); - } - } - - // trim and remove port number from host - // host is lowercase as per RFC 952/2181 - $host = strtolower(preg_replace('/:\d+$/', '', trim($host))); - - // Port number - $scheme = $this->getHttpScheme(); - $port = $this->getCurrentPort(); - $appendPort = ':' . $port; - - // Don't append port number if a normal port. - if (($scheme == 'http' && $port == '80') || ($scheme == 'https' && $port == '443')) { - $appendPort = ''; - } - - return $host . $appendPort; - } - - protected function getCurrentPort() - { - // Check for proxy first - $port = $this->getHeader('X_FORWARDED_PORT'); - if ($port) { - return (string)$port; - } - - $protocol = (string)$this->getHeader('X_FORWARDED_PROTO'); - if ($protocol === 'https') { - return '443'; - } - - return (string)$this->getServerVar('SERVER_PORT'); - } - - /** - * Returns the a value from the $_SERVER super global. - * - * @param string $key - * - * @return string - */ - protected function getServerVar($key) - { - return isset($_SERVER[$key]) ? $_SERVER[$key] : ''; - } - - /** - * Gets a value from the HTTP request headers. - * - * @param string $key - * - * @return string - */ - protected function getHeader($key) - { - return $this->getServerVar('HTTP_' . $key); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlManipulator.php b/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlManipulator.php deleted file mode 100644 index 20a0299e0d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Url/FacebookUrlManipulator.php +++ /dev/null @@ -1,167 +0,0 @@ - 0) { - $query = '?' . http_build_query($params, null, '&'); - } - } - - $scheme = isset($parts['scheme']) ? $parts['scheme'] . '://' : ''; - $host = isset($parts['host']) ? $parts['host'] : ''; - $port = isset($parts['port']) ? ':' . $parts['port'] : ''; - $path = isset($parts['path']) ? $parts['path'] : ''; - $fragment = isset($parts['fragment']) ? '#' . $parts['fragment'] : ''; - - return $scheme . $host . $port . $path . $query . $fragment; - } - - /** - * Gracefully appends params to the URL. - * - * @param string $url The URL that will receive the params. - * @param array $newParams The params to append to the URL. - * - * @return string - */ - public static function appendParamsToUrl($url, array $newParams = []) - { - if (!$newParams) { - return $url; - } - - if (strpos($url, '?') === false) { - return $url . '?' . http_build_query($newParams, null, '&'); - } - - list($path, $query) = explode('?', $url, 2); - $existingParams = []; - parse_str($query, $existingParams); - - // Favor params from the original URL over $newParams - $newParams = array_merge($newParams, $existingParams); - - // Sort for a predicable order - ksort($newParams); - - return $path . '?' . http_build_query($newParams, null, '&'); - } - - /** - * Returns the params from a URL in the form of an array. - * - * @param string $url The URL to parse the params from. - * - * @return array - */ - public static function getParamsAsArray($url) - { - $query = parse_url($url, PHP_URL_QUERY); - if (!$query) { - return []; - } - $params = []; - parse_str($query, $params); - - return $params; - } - - /** - * Adds the params of the first URL to the second URL. - * - * Any params that already exist in the second URL will go untouched. - * - * @param string $urlToStealFrom The URL harvest the params from. - * @param string $urlToAddTo The URL that will receive the new params. - * - * @return string The $urlToAddTo with any new params from $urlToStealFrom. - */ - public static function mergeUrlParams($urlToStealFrom, $urlToAddTo) - { - $newParams = static::getParamsAsArray($urlToStealFrom); - // Nothing new to add, return as-is - if (!$newParams) { - return $urlToAddTo; - } - - return static::appendParamsToUrl($urlToAddTo, $newParams); - } - - /** - * Check for a "/" prefix and prepend it if not exists. - * - * @param string|null $string - * - * @return string|null - */ - public static function forceSlashPrefix($string) - { - if (!$string) { - return $string; - } - - return strpos($string, '/') === 0 ? $string : '/' . $string; - } - - /** - * Trims off the hostname and Graph version from a URL. - * - * @param string $urlToTrim The URL the needs the surgery. - * - * @return string The $urlToTrim with the hostname and Graph version removed. - */ - public static function baseGraphUrlEndpoint($urlToTrim) - { - return '/' . preg_replace('/^https:\/\/.+\.facebook\.com(\/v.+?)?\//', '', $urlToTrim); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Facebook/Url/UrlDetectionInterface.php b/rainloop/v/0.0.0/app/libraries/Facebook/Url/UrlDetectionInterface.php deleted file mode 100644 index 764a606e09..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Facebook/Url/UrlDetectionInterface.php +++ /dev/null @@ -1,39 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Draw; - -use Imagine\Image\AbstractFont; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\PointInterface; -use Imagine\Exception\RuntimeException; - -/** - * Interface for the drawer - */ -interface DrawerInterface -{ - /** - * Draws an arc on a starting at a given x, y coordinates under a given - * start and end angles - * - * @param PointInterface $center - * @param BoxInterface $size - * @param integer $start - * @param integer $end - * @param ColorInterface $color - * @param integer $thickness - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function arc(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $thickness = 1); - - /** - * Same as arc, but also connects end points with a straight line - * - * @param PointInterface $center - * @param BoxInterface $size - * @param integer $start - * @param integer $end - * @param ColorInterface $color - * @param Boolean $fill - * @param integer $thickness - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function chord(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1); - - /** - * Draws and ellipse with center at the given x, y coordinates, and given - * width and height - * - * @param PointInterface $center - * @param BoxInterface $size - * @param ColorInterface $color - * @param Boolean $fill - * @param integer $thickness - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, $fill = false, $thickness = 1); - - /** - * Draws a line from start(x, y) to end(x, y) coordinates - * - * @param PointInterface $start - * @param PointInterface $end - * @param ColorInterface $outline - * @param integer $thickness - * - * @return DrawerInterface - */ - public function line(PointInterface $start, PointInterface $end, ColorInterface $outline, $thickness = 1); - - /** - * Same as arc, but connects end points and the center - * - * @param PointInterface $center - * @param BoxInterface $size - * @param integer $start - * @param integer $end - * @param ColorInterface $color - * @param Boolean $fill - * @param integer $thickness - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function pieSlice(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1); - - /** - * Places a one pixel point at specific coordinates and fills it with - * specified color - * - * @param PointInterface $position - * @param ColorInterface $color - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function dot(PointInterface $position, ColorInterface $color); - - /** - * Draws a polygon using array of x, y coordinates. Must contain at least - * three coordinates - * - * @param array $coordinates - * @param ColorInterface $color - * @param Boolean $fill - * @param integer $thickness - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function polygon(array $coordinates, ColorInterface $color, $fill = false, $thickness = 1); - - /** - * Annotates image with specified text at a given position starting on the - * top left of the final text box - * - * The rotation is done CW - * - * @param string $string - * @param AbstractFont $font - * @param PointInterface $position - * @param integer $angle - * @param integer $width - * - * @throws RuntimeException - * - * @return DrawerInterface - */ - public function text($string, AbstractFont $font, PointInterface $position, $angle = 0, $width = null); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Effects/EffectsInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Effects/EffectsInterface.php deleted file mode 100644 index 3593d75da6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Effects/EffectsInterface.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Effects; - -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Interface for the effects - */ -interface EffectsInterface -{ - /** - * Apply gamma correction - * - * @param float $correction - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function gamma($correction); - - /** - * Invert the colors of the image - * - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function negative(); - - /** - * Grayscale the image - * - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function grayscale(); - - /** - * Colorize the image - * - * @param ColorInterface $color - * - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function colorize(ColorInterface $color); - - /** - * Sharpens the image - * - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function sharpen(); - - /** - * Blur the image - * - * @param float|int $sigma - * - * @return EffectsInterface - * - * @throws RuntimeException - */ - public function blur($sigma); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/Exception.php b/rainloop/v/0.0.0/app/libraries/Imagine/Exception/Exception.php deleted file mode 100644 index 39a67afed7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/Exception.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Exception; - -/** - * Imagine-specific exception - */ -interface Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/InvalidArgumentException.php b/rainloop/v/0.0.0/app/libraries/Imagine/Exception/InvalidArgumentException.php deleted file mode 100644 index 5ac1396728..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/InvalidArgumentException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Exception; - -/** - * Imagine-specific invalid argument exception - */ -class InvalidArgumentException extends \InvalidArgumentException implements Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/NotSupportedException.php b/rainloop/v/0.0.0/app/libraries/Imagine/Exception/NotSupportedException.php deleted file mode 100644 index fd68ce7c06..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/NotSupportedException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Exception; - -/** - * Should be used when a driver does not support an operation. - */ -class NotSupportedException extends RuntimeException implements Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/OutOfBoundsException.php b/rainloop/v/0.0.0/app/libraries/Imagine/Exception/OutOfBoundsException.php deleted file mode 100644 index f51cc9b4f2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/OutOfBoundsException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Exception; - -/** - * Imagine-specific out of bounds exception - */ -class OutOfBoundsException extends \OutOfBoundsException implements Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/RuntimeException.php b/rainloop/v/0.0.0/app/libraries/Imagine/Exception/RuntimeException.php deleted file mode 100644 index 205ad85e84..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Exception/RuntimeException.php +++ /dev/null @@ -1,19 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Exception; - -/** - * Imagine-specific runtime exception - */ -class RuntimeException extends \RuntimeException implements Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Border.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Border.php deleted file mode 100644 index 47a3ceb1ff..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Border.php +++ /dev/null @@ -1,98 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Advanced; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Point; - -/** - * A border filter - */ -class Border implements FilterInterface -{ - /** - * @var ColorInterface - */ - private $color; - - /** - * @var integer - */ - private $width; - - /** - * @var integer - */ - private $height; - - /** - * Constructs Border filter with given color, width and height - * - * @param ColorInterface $color - * @param integer $width Width of the border on the left and right sides of the image - * @param integer $height Height of the border on the top and bottom sides of the image - */ - public function __construct(ColorInterface $color, $width = 1, $height = 1) - { - $this->color = $color; - $this->width = $width; - $this->height = $height; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - $size = $image->getSize(); - $width = $size->getWidth(); - $height = $size->getHeight(); - - $draw = $image->draw(); - - // Draw top and bottom lines - $draw - ->line( - new Point(0, 0), - new Point($width - 1, 0), - $this->color, - $this->height - ) - ->line( - new Point($width - 1, $height - 1), - new Point(0, $height - 1), - $this->color, - $this->height - ) - ; - - // Draw sides - $draw - ->line( - new Point(0, 0), - new Point(0, $height - 1), - $this->color, - $this->width - ) - ->line( - new Point($width - 1, 0), - new Point($width - 1, $height - 1), - $this->color, - $this->width - ) - ; - - return $image; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Canvas.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Canvas.php deleted file mode 100644 index 685b8ae73e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Canvas.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Advanced; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\BoxInterface; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\ImagineInterface; - -/** - * A canvas filter - */ -class Canvas implements FilterInterface -{ - /** - * @var BoxInterface - */ - private $size; - - /** - * @var PointInterface - */ - private $placement; - - /** - * @var ColorInterface - */ - private $background; - - /** - * @var ImagineInterface - */ - private $imagine; - - /** - * Constructs Canvas filter with given width and height and the placement of the current image - * inside the new canvas - * - * @param ImagineInterface $imagine - * @param BoxInterface $size - * @param PointInterface $placement - * @param ColorInterface $background - */ - public function __construct(ImagineInterface $imagine, BoxInterface $size, PointInterface $placement = null, ColorInterface $background = null) - { - $this->imagine = $imagine; - $this->size = $size; - $this->placement = $placement ?: new Point(0, 0); - $this->background = $background; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - $canvas = $this->imagine->create($this->size, $this->background); - $canvas->paste($image, $this->placement); - - return $canvas; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Grayscale.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Grayscale.php deleted file mode 100644 index b3a08b403c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/Grayscale.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Advanced; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Point; - -/** - * The Grayscale filter calculates the gray-value based on RGB. - */ -class Grayscale extends OnPixelBased implements FilterInterface -{ - public function __construct() - { - parent::__construct(function (ImageInterface $image, Point $point) { - $color = $image->getColorAt($point); - $image->draw()->dot($point, $color->grayscale()); - }); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/OnPixelBased.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/OnPixelBased.php deleted file mode 100644 index ef297eaf6b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/OnPixelBased.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Advanced; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Point; - -/** - * The OnPixelBased takes a callable, and for each pixel, this callable is called with the - * image (\Imagine\Image\ImageInterface) and the current point (\Imagine\Image\Point) - */ -class OnPixelBased implements FilterInterface -{ - protected $callback; - - public function __construct($callback) - { - if (!is_callable($callback)) { - throw new InvalidArgumentException('$callback has to be callable'); - } - - $this->callback = $callback; - } - - /** - * Applies scheduled transformation to ImageInterface instance - * Returns processed ImageInterface instance - * - * @param ImageInterface $image - * - * @return ImageInterface - */ - public function apply(ImageInterface $image) - { - $w = $image->getSize()->getWidth(); - $h = $image->getSize()->getHeight(); - - for ($x = 0; $x < $w; $x++) { - for ($y = 0; $y < $h; $y++) { - call_user_func($this->callback, $image, new Point($x, $y)); - } - } - - return $image; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/RelativeResize.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/RelativeResize.php deleted file mode 100644 index 954587ad24..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Advanced/RelativeResize.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Advanced; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; - -/** - * The RelativeResize filter allows images to be resized relative to their - * existing dimensions. - */ -class RelativeResize implements FilterInterface -{ - private $method; - private $parameter; - - /** - * Constructs a RelativeResize filter with the given method and argument. - * - * @param string $method BoxInterface method - * @param mixed $parameter Parameter for BoxInterface method - */ - public function __construct($method, $parameter) - { - if (!in_array($method, array('heighten', 'increase', 'scale', 'widen'))) { - throw new InvalidArgumentException(sprintf('Unsupported method: ', $method)); - } - - $this->method = $method; - $this->parameter = $parameter; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->resize(call_user_func(array($image->getSize(), $this->method), $this->parameter)); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/ApplyMask.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/ApplyMask.php deleted file mode 100644 index 2be2786f99..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/ApplyMask.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; - -/** - * An apply mask filter - */ -class ApplyMask implements FilterInterface -{ - /** - * @var ImageInterface - */ - private $mask; - - /** - * @param ImageInterface $mask - */ - public function __construct(ImageInterface $mask) - { - $this->mask = $mask; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->applyMask($this->mask); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Autorotate.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Autorotate.php deleted file mode 100644 index 3ef7cbec72..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Autorotate.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Rotates an image automatically based on exif information. - * - * Your attention please: This filter requires the use of the - * ExifMetadataReader to work. - * - * @see https://imagine.readthedocs.org/en/latest/usage/metadata.html - */ -class Autorotate implements FilterInterface -{ - private $color; - - /** - * @param string|array|ColorInterface $color A color - */ - public function __construct($color = '000000') - { - $this->color = $color; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - $metadata = $image->metadata(); - - switch (isset($metadata['ifd0.Orientation']) ? $metadata['ifd0.Orientation'] : null) { - case 1: // top-left - break; - case 2: // top-right - $image->flipHorizontally(); - break; - case 3: // bottom-right - $image->rotate(180, $this->getColor($image)); - break; - case 4: // bottom-left - $image->flipHorizontally(); - $image->rotate(180, $this->getColor($image)); - break; - case 5: // left-top - $image->flipHorizontally(); - $image->rotate(-90, $this->getColor($image)); - break; - case 6: // right-top - $image->rotate(90, $this->getColor($image)); - break; - case 7: // right-bottom - $image->flipHorizontally(); - $image->rotate(90, $this->getColor($image)); - break; - case 8: // left-bottom - $image->rotate(-90, $this->getColor($image)); - break; - default: // Invalid orientation - break; - } - - return $image; - } - - private function getColor(ImageInterface $image) - { - if ($this->color instanceof ColorInterface) { - return $this->color; - } - - return $image->palette()->color($this->color); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Copy.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Copy.php deleted file mode 100644 index 781b23a7ef..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Copy.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; - -/** - * A copy filter - */ -class Copy implements FilterInterface -{ - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->copy(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Crop.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Crop.php deleted file mode 100644 index 6559e2298d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Crop.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Image\BoxInterface; -use Imagine\Image\PointInterface; -use Imagine\Filter\FilterInterface; - -/** - * A crop filter - */ -class Crop implements FilterInterface -{ - /** - * @var PointInterface - */ - private $start; - - /** - * @var BoxInterface - */ - private $size; - - /** - * Constructs a Crop filter with given x, y, coordinates and crop width and - * height values - * - * @param PointInterface $start - * @param BoxInterface $size - */ - public function __construct(PointInterface $start, BoxInterface $size) - { - $this->start = $start; - $this->size = $size; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->crop($this->start, $this->size); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Fill.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Fill.php deleted file mode 100644 index 4be0d0f2ba..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Fill.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\ImageInterface; - -/** - * A fill filter - */ -class Fill implements FilterInterface -{ - /** - * @var FillInterface - */ - private $fill; - - /** - * @param FillInterface $fill - */ - public function __construct(FillInterface $fill) - { - $this->fill = $fill; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->fill($this->fill); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipHorizontally.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipHorizontally.php deleted file mode 100644 index 50203748d0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipHorizontally.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Filter\FilterInterface; - -/** - * A "flip horizontally" filter - */ -class FlipHorizontally implements FilterInterface -{ - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->flipHorizontally(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipVertically.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipVertically.php deleted file mode 100644 index 684c31b3de..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/FlipVertically.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Filter\FilterInterface; - -/** - * A "flip vertically" filter - */ -class FlipVertically implements FilterInterface -{ - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->flipVertically(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Paste.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Paste.php deleted file mode 100644 index bd274a1791..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Paste.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Image\PointInterface; -use Imagine\Filter\FilterInterface; - -/** - * A paste filter - */ -class Paste implements FilterInterface -{ - /** - * @var ImageInterface - */ - private $image; - - /** - * @var PointInterface - */ - private $start; - - /** - * Constructs a Paste filter with given ImageInterface to paste and x, y - * coordinates of target position - * - * @param ImageInterface $image - * @param PointInterface $start - */ - public function __construct(ImageInterface $image, PointInterface $start) - { - $this->image = $image; - $this->start = $start; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->paste($this->image, $this->start); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Resize.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Resize.php deleted file mode 100644 index 934cfe2fd4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Resize.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Filter\FilterInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\BoxInterface; - -/** - * A resize filter - */ -class Resize implements FilterInterface -{ - /** - * @var BoxInterface - */ - private $size; - private $filter; - - /** - * Constructs Resize filter with given width and height - * - * @param BoxInterface $size - * @param string $filter - */ - public function __construct(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED) - { - $this->size = $size; - $this->filter = $filter; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->resize($this->size, $this->filter); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Rotate.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Rotate.php deleted file mode 100644 index 7b5553ff92..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Rotate.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Filter\FilterInterface; - -/** - * A rotate filter - */ -class Rotate implements FilterInterface -{ - /** - * @var integer - */ - private $angle; - - /** - * @var ColorInterface - */ - private $background; - - /** - * Constructs Rotate filter with given angle and background color - * - * @param integer $angle - * @param ColorInterface $background - */ - public function __construct($angle, ColorInterface $background = null) - { - $this->angle = $angle; - $this->background = $background; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->rotate($this->angle, $this->background); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Save.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Save.php deleted file mode 100644 index 0f76625a1a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Save.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Filter\FilterInterface; - -/** - * A save filter - */ -class Save implements FilterInterface -{ - /** - * @var string - */ - private $path; - - /** - * @var array - */ - private $options; - - /** - * Constructs Save filter with given path and options - * - * @param string $path - * @param array $options - */ - public function __construct($path = null, array $options = array()) - { - $this->path = $path; - $this->options = $options; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->save($this->path, $this->options); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Show.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Show.php deleted file mode 100644 index a7d4cbc444..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Show.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Filter\FilterInterface; - -/** - * A show filter - */ -class Show implements FilterInterface -{ - /** - * @var string - */ - private $format; - - /** - * @var array - */ - private $options; - - /** - * Constructs the Show filter with given format and options - * - * @param string $format - * @param array $options - */ - public function __construct($format, array $options = array()) - { - $this->format = $format; - $this->options = $options; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->show($this->format, $this->options); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Strip.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Strip.php deleted file mode 100644 index c096a51bcd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Strip.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Filter\FilterInterface; - -/** - * A strip filter - */ -class Strip implements FilterInterface -{ - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->strip(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Thumbnail.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Thumbnail.php deleted file mode 100644 index 3176f1c395..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/Thumbnail.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Image\BoxInterface; -use Imagine\Filter\FilterInterface; - -/** - * A thumbnail filter - */ -class Thumbnail implements FilterInterface -{ - /** - * @var BoxInterface - */ - private $size; - - /** - * @var string - */ - private $mode; - - /** - * @var string - */ - private $filter; - - /** - * Constructs the Thumbnail filter with given width, height and mode - * - * @param BoxInterface $size - * @param string $mode - * @param string $filter - */ - public function __construct(BoxInterface $size, $mode = ImageInterface::THUMBNAIL_INSET, $filter = ImageInterface::FILTER_UNDEFINED) - { - $this->size = $size; - $this->mode = $mode; - $this->filter = $filter; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return $image->thumbnail($this->size, $this->mode, $this->filter); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/WebOptimization.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/WebOptimization.php deleted file mode 100644 index 37f5f3f1ae..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Basic/WebOptimization.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter\Basic; - -use Imagine\Image\ImageInterface; -use Imagine\Image\Palette\RGB; -use Imagine\Filter\FilterInterface; - -/** - * A filter to render web-optimized images - */ -class WebOptimization implements FilterInterface -{ - private $palette; - private $path; - private $options; - - public function __construct($path = null, array $options = array()) - { - $this->path = $path; - $this->options = array_replace(array( - 'resolution-units' => ImageInterface::RESOLUTION_PIXELSPERINCH, - 'resolution-y' => 72, - 'resolution-x' => 72, - ), $options); - $this->palette = new RGB(); - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - $image - ->usePalette($this->palette) - ->strip(); - - if (is_callable($this->path)) { - $path = call_user_func($this->path, $image); - } elseif (null !== $this->path) { - $path = $this->path; - } else { - return $image; - } - - return $image->save($path, $this->options); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/FilterInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/FilterInterface.php deleted file mode 100644 index e23ab70e09..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/FilterInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter; - -use Imagine\Image\ImageInterface; - -/** - * Interface for imagine filters - */ -interface FilterInterface -{ - /** - * Applies scheduled transformation to ImageInterface instance - * Returns processed ImageInterface instance - * - * @param ImageInterface $image - * - * @return ImageInterface - */ - public function apply(ImageInterface $image); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/ImagineAware.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/ImagineAware.php deleted file mode 100644 index 606c5254c0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/ImagineAware.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Image\ImagineInterface; - -/** - * ImagineAware base class - */ -abstract class ImagineAware implements FilterInterface -{ - /** - * An ImagineInterface instance. - * - * @var ImagineInterface - */ - private $imagine; - - /** - * Set ImagineInterface instance. - * - * @param ImagineInterface $imagine An ImagineInterface instance - */ - public function setImagine(ImagineInterface $imagine) - { - $this->imagine = $imagine; - } - - /** - * Get ImagineInterface instance. - * - * @return ImagineInterface - * - * @throws InvalidArgumentException - */ - public function getImagine() - { - if (!$this->imagine instanceof ImagineInterface) { - throw new InvalidArgumentException(sprintf('In order to use %s pass an Imagine\Image\ImagineInterface instance to filter constructor', get_class($this))); - } - - return $this->imagine; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Transformation.php b/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Transformation.php deleted file mode 100644 index 26c023a0f3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Filter/Transformation.php +++ /dev/null @@ -1,240 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Filter; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Filter\Basic\ApplyMask; -use Imagine\Filter\Basic\Copy; -use Imagine\Filter\Basic\Crop; -use Imagine\Filter\Basic\Fill; -use Imagine\Filter\Basic\FlipVertically; -use Imagine\Filter\Basic\FlipHorizontally; -use Imagine\Filter\Basic\Paste; -use Imagine\Filter\Basic\Resize; -use Imagine\Filter\Basic\Rotate; -use Imagine\Filter\Basic\Save; -use Imagine\Filter\Basic\Show; -use Imagine\Filter\Basic\Strip; -use Imagine\Filter\Basic\Thumbnail; -use Imagine\Image\ImageInterface; -use Imagine\Image\ImagineInterface; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\ManipulatorInterface; -use Imagine\Image\PointInterface; - -/** - * A transformation filter - */ -final class Transformation implements FilterInterface, ManipulatorInterface -{ - /** - * @var array - */ - private $filters = array(); - - /** - * @var array - */ - private $sorted; - - /** - * An ImagineInterface instance. - * - * @var ImagineInterface - */ - private $imagine; - - /** - * Class constructor. - * - * @param ImagineInterface $imagine An ImagineInterface instance - */ - public function __construct(ImagineInterface $imagine = null) - { - $this->imagine = $imagine; - } - - /** - * Applies a given FilterInterface onto given ImageInterface and returns - * modified ImageInterface - * - * @param ImageInterface $image - * @param FilterInterface $filter - * - * @return ImageInterface - * @throws InvalidArgumentException - */ - public function applyFilter(ImageInterface $image, FilterInterface $filter) - { - if ($filter instanceof ImagineAware) { - if ($this->imagine === null) { - throw new InvalidArgumentException(sprintf('In order to use %s pass an Imagine\Image\ImagineInterface instance to Transformation constructor', get_class($filter))); - } - $filter->setImagine($this->imagine); - } - - return $filter->apply($image); - } - - /** - * Returns a list of filters sorted by their priority. Filters with same priority will be returned in the order they were added. - * - * @return array - */ - public function getFilters() - { - if (null === $this->sorted) { - if (!empty($this->filters)) { - ksort($this->filters); - $this->sorted = call_user_func_array('array_merge', $this->filters); - } else { - $this->sorted = array(); - } - } - - return $this->sorted; - } - - /** - * {@inheritdoc} - */ - public function apply(ImageInterface $image) - { - return array_reduce( - $this->getFilters(), - array($this, 'applyFilter'), - $image - ); - } - - /** - * {@inheritdoc} - */ - public function copy() - { - return $this->add(new Copy()); - } - - /** - * {@inheritdoc} - */ - public function crop(PointInterface $start, BoxInterface $size) - { - return $this->add(new Crop($start, $size)); - } - - /** - * {@inheritdoc} - */ - public function flipHorizontally() - { - return $this->add(new FlipHorizontally()); - } - - /** - * {@inheritdoc} - */ - public function flipVertically() - { - return $this->add(new FlipVertically()); - } - - /** - * {@inheritdoc} - */ - public function strip() - { - return $this->add(new Strip()); - } - - /** - * {@inheritdoc} - */ - public function paste(ImageInterface $image, PointInterface $start) - { - return $this->add(new Paste($image, $start)); - } - - /** - * {@inheritdoc} - */ - public function applyMask(ImageInterface $mask) - { - return $this->add(new ApplyMask($mask)); - } - - /** - * {@inheritdoc} - */ - public function fill(FillInterface $fill) - { - return $this->add(new Fill($fill)); - } - - /** - * {@inheritdoc} - */ - public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED) - { - return $this->add(new Resize($size, $filter)); - } - - /** - * {@inheritdoc} - */ - public function rotate($angle, ColorInterface $background = null) - { - return $this->add(new Rotate($angle, $background)); - } - - /** - * {@inheritdoc} - */ - public function save($path = null, array $options = array()) - { - return $this->add(new Save($path, $options)); - } - - /** - * {@inheritdoc} - */ - public function show($format, array $options = array()) - { - return $this->add(new Show($format, $options)); - } - - /** - * {@inheritdoc} - */ - public function thumbnail(BoxInterface $size, $mode = ImageInterface::THUMBNAIL_INSET, $filter = ImageInterface::FILTER_UNDEFINED) - { - return $this->add(new Thumbnail($size, $mode, $filter)); - } - - /** - * Registers a given FilterInterface in an internal array of filters for - * later application to an instance of ImageInterface - * - * @param FilterInterface $filter - * @param int $priority - * @return Transformation - */ - public function add(FilterInterface $filter, $priority = 0) - { - $this->filters[$priority][] = $filter; - $this->sorted = null; - - return $this; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Drawer.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Drawer.php deleted file mode 100644 index e5d74e0d94..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Drawer.php +++ /dev/null @@ -1,333 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Draw\DrawerInterface; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractFont; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Palette\Color\RGB as RGBColor; -use Imagine\Image\PointInterface; - -/** - * Drawer implementation using the GD library - */ -final class Drawer implements DrawerInterface -{ - /** - * @var resource - */ - private $resource; - - /** - * @var array - */ - private $info; - - /** - * Constructs Drawer with a given gd image resource - * - * @param resource $resource - */ - public function __construct($resource) - { - $this->loadGdInfo(); - $this->resource = $resource; - } - - /** - * {@inheritdoc} - */ - public function arc(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw arc operation failed'); - } - - if (false === imagearc($this->resource, $center->getX(), $center->getY(), $size->getWidth(), $size->getHeight(), $start, $end, $this->getColor($color))) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw arc operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw arc operation failed'); - } - - return $this; - } - - /** - * This function does not work properly because of a bug in GD - * - * {@inheritdoc} - */ - public function chord(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if ($fill) { - $style = IMG_ARC_CHORD; - } else { - $style = IMG_ARC_CHORD | IMG_ARC_NOFILL; - } - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw chord operation failed'); - } - - if (false === imagefilledarc($this->resource, $center->getX(), $center->getY(), $size->getWidth(), $size->getHeight(), $start, $end, $this->getColor($color), $style)) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw chord operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw chord operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, $fill = false, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if ($fill) { - $callback = 'imagefilledellipse'; - } else { - $callback = 'imageellipse'; - } - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw ellipse operation failed'); - } - - if (false === $callback($this->resource, $center->getX(), $center->getY(), $size->getWidth(), $size->getHeight(), $this->getColor($color))) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw ellipse operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw ellipse operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function line(PointInterface $start, PointInterface $end, ColorInterface $color, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw line operation failed'); - } - - if (false === imageline($this->resource, $start->getX(), $start->getY(), $end->getX(), $end->getY(), $this->getColor($color))) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw line operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw line operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function pieSlice(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if ($fill) { - $style = IMG_ARC_EDGED; - } else { - $style = IMG_ARC_EDGED | IMG_ARC_NOFILL; - } - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw chord operation failed'); - } - - if (false === imagefilledarc($this->resource, $center->getX(), $center->getY(), $size->getWidth(), $size->getHeight(), $start, $end, $this->getColor($color), $style)) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw chord operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw chord operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function dot(PointInterface $position, ColorInterface $color) - { - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw point operation failed'); - } - - if (false === imagesetpixel($this->resource, $position->getX(), $position->getY(), $this->getColor($color))) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw point operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw point operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function polygon(array $coordinates, ColorInterface $color, $fill = false, $thickness = 1) - { - imagesetthickness($this->resource, max(1, (int) $thickness)); - - if (count($coordinates) < 3) { - throw new InvalidArgumentException(sprintf('A polygon must consist of at least 3 points, %d given', count($coordinates))); - } - - $points = call_user_func_array('array_merge', array_map(function (PointInterface $p) { - return array($p->getX(), $p->getY()); - }, $coordinates)); - - if ($fill) { - $callback = 'imagefilledpolygon'; - } else { - $callback = 'imagepolygon'; - } - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Draw polygon operation failed'); - } - - if (false === $callback($this->resource, $points, count($coordinates), $this->getColor($color))) { - imagealphablending($this->resource, false); - throw new RuntimeException('Draw polygon operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Draw polygon operation failed'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function text($string, AbstractFont $font, PointInterface $position, $angle = 0, $width = null) - { - if (!$this->info['FreeType Support']) { - throw new RuntimeException('GD is not compiled with FreeType support'); - } - - $angle = -1 * $angle; - $fontsize = $font->getSize(); - $fontfile = $font->getFile(); - $x = $position->getX(); - $y = $position->getY() + $fontsize; - - if ($width !== null) { - $string = $this->wrapText($string, $font, $angle, $width); - } - - if (false === imagealphablending($this->resource, true)) { - throw new RuntimeException('Font mask operation failed'); - } - - if (false === imagefttext($this->resource, $fontsize, $angle, $x, $y, $this->getColor($font->getColor()), $fontfile, $string)) { - imagealphablending($this->resource, false); - throw new RuntimeException('Font mask operation failed'); - } - - if (false === imagealphablending($this->resource, false)) { - throw new RuntimeException('Font mask operation failed'); - } - - return $this; - } - - /** - * Internal - * - * Generates a GD color from Color instance - * - * @param ColorInterface $color - * - * @return resource - * - * @throws RuntimeException - * @throws InvalidArgumentException - */ - private function getColor(ColorInterface $color) - { - if (!$color instanceof RGBColor) { - throw new InvalidArgumentException('GD driver only supports RGB colors'); - } - - $gdColor = imagecolorallocatealpha($this->resource, $color->getRed(), $color->getGreen(), $color->getBlue(), (100 - $color->getAlpha()) * 127 / 100); - if (false === $gdColor) { - throw new RuntimeException(sprintf('Unable to allocate color "RGB(%s, %s, %s)" with transparency of %d percent', $color->getRed(), $color->getGreen(), $color->getBlue(), $color->getAlpha())); - } - - return $gdColor; - } - - private function loadGdInfo() - { - if (!function_exists('gd_info')) { - throw new RuntimeException('Gd not installed'); - } - - $this->info = gd_info(); - } - - /** - * Internal - * - * Fits a string into box with given width - */ - private function wrapText($string, AbstractFont $font, $angle, $width) - { - $result = ''; - $words = explode(' ', $string); - foreach ($words as $word) { - $teststring = $result . ' ' . $word; - $testbox = imagettfbbox($font->getSize(), $angle, $font->getFile(), $teststring); - if ($testbox[2] > $width) { - $result .= ($result == '' ? '' : "\n") . $word; - } else { - $result .= ($result == '' ? '' : ' ') . $word; - } - } - - return $result; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Effects.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Effects.php deleted file mode 100644 index d86c4f8a27..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Effects.php +++ /dev/null @@ -1,109 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Effects\EffectsInterface; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Palette\Color\RGB as RGBColor; - -/** - * Effects implementation using the GD library - */ -class Effects implements EffectsInterface -{ - private $resource; - - public function __construct($resource) - { - $this->resource = $resource; - } - - /** - * {@inheritdoc} - */ - public function gamma($correction) - { - if (false === imagegammacorrect($this->resource, 1.0, $correction)) { - throw new RuntimeException('Failed to apply gamma correction to the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function negative() - { - if (false === imagefilter($this->resource, IMG_FILTER_NEGATE)) { - throw new RuntimeException('Failed to negate the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - if (false === imagefilter($this->resource, IMG_FILTER_GRAYSCALE)) { - throw new RuntimeException('Failed to grayscale the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function colorize(ColorInterface $color) - { - if (!$color instanceof RGBColor) { - throw new RuntimeException('Colorize effects only accepts RGB color in GD context'); - } - - if (false === imagefilter($this->resource, IMG_FILTER_COLORIZE, $color->getRed(), $color->getGreen(), $color->getBlue())) { - throw new RuntimeException('Failed to colorize the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function sharpen() - { - $sharpenMatrix = array(array(-1,-1,-1), array(-1,16,-1), array(-1,-1,-1)); - $divisor = array_sum(array_map('array_sum', $sharpenMatrix)); - - if (false === imageconvolution($this->resource, $sharpenMatrix, $divisor, 0)) { - throw new RuntimeException('Failed to sharpen the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function blur($sigma = 1) - { - if (false === imagefilter($this->resource, IMG_FILTER_GAUSSIAN_BLUR)) { - throw new RuntimeException('Failed to blur the image'); - } - - return $this; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Font.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Font.php deleted file mode 100644 index 8bc2b04d43..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Font.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractFont; -use Imagine\Image\Box; - -/** - * Font implementation using the GD library - */ -final class Font extends AbstractFont -{ - /** - * {@inheritdoc} - */ - public function box($string, $angle = 0) - { - if (!function_exists('imageftbbox')) { - throw new RuntimeException('GD must have been compiled with `--with-freetype-dir` option to use the Font feature.'); - } - - $angle = -1 * $angle; - $info = imageftbbox($this->size, $angle, $this->file, $string); - $xs = array($info[0], $info[2], $info[4], $info[6]); - $ys = array($info[1], $info[3], $info[5], $info[7]); - $width = abs(max($xs) - min($xs)); - $height = abs(max($ys) - min($ys)); - - return new Box($width, $height); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Image.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Image.php deleted file mode 100644 index 73d7b9506f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Image.php +++ /dev/null @@ -1,735 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Image\AbstractImage; -use Imagine\Image\ImageInterface; -use Imagine\Image\Box; -use Imagine\Image\BoxInterface; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; -use Imagine\Image\Palette\PaletteInterface; -use Imagine\Image\Palette\Color\RGB as RGBColor; -use Imagine\Image\ProfileInterface; -use Imagine\Image\Palette\RGB; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\RuntimeException; - -/** - * Image implementation using the GD library - */ -final class Image extends AbstractImage -{ - /** - * @var resource - */ - private $resource; - - /** - * @var Layers|null - */ - private $layers; - - /** - * @var PaletteInterface - */ - private $palette; - - /** - * Constructs a new Image instance - * - * @param resource $resource - * @param PaletteInterface $palette - * @param MetadataBag $metadata - */ - public function __construct($resource, PaletteInterface $palette, MetadataBag $metadata) - { - $this->metadata = $metadata; - $this->palette = $palette; - $this->resource = $resource; - } - - /** - * Makes sure the current image resource is destroyed - */ - public function __destruct() - { - if (is_resource($this->resource) && 'gd' === get_resource_type($this->resource)) { - imagedestroy($this->resource); - } - } - - /** - * Returns Gd resource - * - * @return resource - */ - public function getGdResource() - { - return $this->resource; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function copy() - { - $size = $this->getSize(); - $copy = $this->createImage($size, 'copy'); - - if (false === imagecopy($copy, $this->resource, 0, 0, 0, 0, $size->getWidth(), $size->getHeight())) { - throw new RuntimeException('Image copy operation failed'); - } - - return new Image($copy, $this->palette, $this->metadata); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function crop(PointInterface $start, BoxInterface $size) - { - if (!$start->in($this->getSize())) { - throw new OutOfBoundsException('Crop coordinates must start at minimum 0, 0 position from top left corner, crop height and width must be positive integers and must not exceed the current image borders'); - } - - $width = $size->getWidth(); - $height = $size->getHeight(); - - $dest = $this->createImage($size, 'crop'); - - if (false === imagecopy($dest, $this->resource, 0, 0, $start->getX(), $start->getY(), $width, $height)) { - throw new RuntimeException('Image crop operation failed'); - } - - imagedestroy($this->resource); - - $this->resource = $dest; - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function paste(ImageInterface $image, PointInterface $start) - { - if (!$image instanceof self) { - throw new InvalidArgumentException(sprintf('Gd\Image can only paste() Gd\Image instances, %s given', get_class($image))); - } - - $size = $image->getSize(); - if (!$this->getSize()->contains($size, $start)) { - throw new OutOfBoundsException('Cannot paste image of the given size at the specified position, as it moves outside of the current image\'s box'); - } - - imagealphablending($this->resource, true); - imagealphablending($image->resource, true); - - if (false === imagecopy($this->resource, $image->resource, $start->getX(), $start->getY(), 0, 0, $size->getWidth(), $size->getHeight())) { - throw new RuntimeException('Image paste operation failed'); - } - - imagealphablending($this->resource, false); - imagealphablending($image->resource, false); - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED) - { - if (ImageInterface::FILTER_UNDEFINED !== $filter) { - throw new InvalidArgumentException('Unsupported filter type, GD only supports ImageInterface::FILTER_UNDEFINED filter'); - } - - $width = $size->getWidth(); - $height = $size->getHeight(); - - $dest = $this->createImage($size, 'resize'); - - imagealphablending($this->resource, true); - imagealphablending($dest, true); - - if (false === imagecopyresampled($dest, $this->resource, 0, 0, 0, 0, $width, $height, imagesx($this->resource), imagesy($this->resource))) { - throw new RuntimeException('Image resize operation failed'); - } - - imagealphablending($this->resource, false); - imagealphablending($dest, false); - - imagedestroy($this->resource); - - $this->resource = $dest; - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function rotate($angle, ColorInterface $background = null) - { - $color = $background ? $background : $this->palette->color('fff'); - $resource = imagerotate($this->resource, -1 * $angle, $this->getColor($color)); - - if (false === $resource) { - throw new RuntimeException('Image rotate operation failed'); - } - - imagedestroy($this->resource); - $this->resource = $resource; - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function save($path = null, array $options = array()) - { - $path = null === $path ? (isset($this->metadata['filepath']) ? $this->metadata['filepath'] : $path) : $path; - - if (null === $path) { - throw new RuntimeException('You can omit save path only if image has been open from a file'); - } - - if (isset($options['format'])) { - $format = $options['format']; - } elseif ('' !== $extension = pathinfo($path, \PATHINFO_EXTENSION)) { - $format = $extension; - } else { - $originalPath = isset($this->metadata['filepath']) ? $this->metadata['filepath'] : null; - $format = pathinfo($originalPath, \PATHINFO_EXTENSION); - } - - $this->saveOrOutput($format, $options, $path); - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function show($format, array $options = array()) - { - header('Content-type: '.$this->getMimeType($format)); - - $this->saveOrOutput($format, $options); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function get($format, array $options = array()) - { - ob_start(); - $this->saveOrOutput($format, $options); - - return ob_get_clean(); - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->get('png'); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function flipHorizontally() - { - $size = $this->getSize(); - $width = $size->getWidth(); - $height = $size->getHeight(); - $dest = $this->createImage($size, 'flip'); - - for ($i = 0; $i < $width; $i++) { - if (false === imagecopy($dest, $this->resource, $i, 0, ($width - 1) - $i, 0, 1, $height)) { - throw new RuntimeException('Horizontal flip operation failed'); - } - } - - imagedestroy($this->resource); - - $this->resource = $dest; - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function flipVertically() - { - $size = $this->getSize(); - $width = $size->getWidth(); - $height = $size->getHeight(); - $dest = $this->createImage($size, 'flip'); - - for ($i = 0; $i < $height; $i++) { - if (false === imagecopy($dest, $this->resource, 0, $i, 0, ($height - 1) - $i, $width, 1)) { - throw new RuntimeException('Vertical flip operation failed'); - } - } - - imagedestroy($this->resource); - - $this->resource = $dest; - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - final public function strip() - { - // GD strips profiles and comment, so there's nothing to do here - return $this; - } - - /** - * {@inheritdoc} - */ - public function draw() - { - return new Drawer($this->resource); - } - - /** - * {@inheritdoc} - */ - public function effects() - { - return new Effects($this->resource); - } - - /** - * {@inheritdoc} - */ - public function getSize() - { - return new Box(imagesx($this->resource), imagesy($this->resource)); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function applyMask(ImageInterface $mask) - { - if (!$mask instanceof self) { - throw new InvalidArgumentException('Cannot mask non-gd images'); - } - - $size = $this->getSize(); - $maskSize = $mask->getSize(); - - if ($size != $maskSize) { - throw new InvalidArgumentException(sprintf('The given mask doesn\'t match current image\'s size, Current mask\'s dimensions are %s, while image\'s dimensions are %s', $maskSize, $size)); - } - - for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) { - for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) { - $position = new Point($x, $y); - $color = $this->getColorAt($position); - $maskColor = $mask->getColorAt($position); - $round = (int) round(max($color->getAlpha(), (100 - $color->getAlpha()) * $maskColor->getRed() / 255)); - - if (false === imagesetpixel($this->resource, $x, $y, $this->getColor($color->dissolve($round - $color->getAlpha())))) { - throw new RuntimeException('Apply mask operation failed'); - } - } - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function fill(FillInterface $fill) - { - $size = $this->getSize(); - - for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) { - for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) { - if (false === imagesetpixel($this->resource, $x, $y, $this->getColor($fill->getColor(new Point($x, $y))))) { - throw new RuntimeException('Fill operation failed'); - } - } - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function mask() - { - $mask = $this->copy(); - - if (false === imagefilter($mask->resource, IMG_FILTER_GRAYSCALE)) { - throw new RuntimeException('Mask operation failed'); - } - - return $mask; - } - - /** - * {@inheritdoc} - */ - public function histogram() - { - $size = $this->getSize(); - $colors = array(); - - for ($x = 0, $width = $size->getWidth(); $x < $width; $x++) { - for ($y = 0, $height = $size->getHeight(); $y < $height; $y++) { - $colors[] = $this->getColorAt(new Point($x, $y)); - } - } - - return array_unique($colors); - } - - /** - * {@inheritdoc} - */ - public function getColorAt(PointInterface $point) - { - if (!$point->in($this->getSize())) { - throw new RuntimeException(sprintf('Error getting color at point [%s,%s]. The point must be inside the image of size [%s,%s]', $point->getX(), $point->getY(), $this->getSize()->getWidth(), $this->getSize()->getHeight())); - } - - $index = imagecolorat($this->resource, $point->getX(), $point->getY()); - $info = imagecolorsforindex($this->resource, $index); - - return $this->palette->color(array($info['red'], $info['green'], $info['blue']), max(min(100 - (int) round($info['alpha'] / 127 * 100), 100), 0)); - } - - /** - * {@inheritdoc} - */ - public function layers() - { - if (null === $this->layers) { - $this->layers = new Layers($this, $this->palette, $this->resource); - } - - return $this->layers; - } - - /** - * {@inheritdoc} - **/ - public function interlace($scheme) - { - static $supportedInterlaceSchemes = array( - ImageInterface::INTERLACE_NONE => 0, - ImageInterface::INTERLACE_LINE => 1, - ImageInterface::INTERLACE_PLANE => 1, - ImageInterface::INTERLACE_PARTITION => 1, - ); - - if (!array_key_exists($scheme, $supportedInterlaceSchemes)) { - throw new InvalidArgumentException('Unsupported interlace type'); - } - - imageinterlace($this->resource, $supportedInterlaceSchemes[$scheme]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function palette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function profile(ProfileInterface $profile) - { - throw new RuntimeException('GD driver does not support color profiles'); - } - - /** - * {@inheritdoc} - */ - public function usePalette(PaletteInterface $palette) - { - if (!$palette instanceof RGB) { - throw new RuntimeException('GD driver only supports RGB palette'); - } - - $this->palette = $palette; - - return $this; - } - - /** - * Internal - * - * Performs save or show operation using one of GD's image... functions - * - * @param string $format - * @param array $options - * @param string $filename - * - * @throws InvalidArgumentException - * @throws RuntimeException - */ - private function saveOrOutput($format, array $options, $filename = null) - { - $format = $this->normalizeFormat($format); - - if (!$this->supported($format)) { - throw new InvalidArgumentException(sprintf('Saving image in "%s" format is not supported, please use one of the following extensions: "%s"', $format, implode('", "', $this->supported()))); - } - - $save = 'image'.$format; - $args = array(&$this->resource, $filename); - - // Preserve BC until version 1.0 - if (isset($options['quality']) && !isset($options['png_compression_level'])) { - $options['png_compression_level'] = round((100 - $options['quality']) * 9 / 100); - } - if (isset($options['filters']) && !isset($options['png_compression_filter'])) { - $options['png_compression_filter'] = $options['filters']; - } - - $options = $this->updateSaveOptions($options); - - if ($format === 'jpeg' && isset($options['jpeg_quality'])) { - $args[] = $options['jpeg_quality']; - } - - if ($format === 'png') { - if (isset($options['png_compression_level'])) { - if ($options['png_compression_level'] < 0 || $options['png_compression_level'] > 9) { - throw new InvalidArgumentException('png_compression_level option should be an integer from 0 to 9'); - } - $args[] = $options['png_compression_level']; - } else { - $args[] = -1; // use default level - } - - if (isset($options['png_compression_filter'])) { - if (~PNG_ALL_FILTERS & $options['png_compression_filter']) { - throw new InvalidArgumentException('png_compression_filter option should be a combination of the PNG_FILTER_XXX constants'); - } - $args[] = $options['png_compression_filter']; - } - } - - if (($format === 'wbmp' || $format === 'xbm') && isset($options['foreground'])) { - $args[] = $options['foreground']; - } - - $this->setExceptionHandler(); - - if (false === call_user_func_array($save, $args)) { - throw new RuntimeException('Save operation failed'); - } - - $this->resetExceptionHandler(); - } - - /** - * Internal - * - * Generates a GD image - * - * @param BoxInterface $size - * @param string the operation initiating the creation - * - * @return resource - * - * @throws RuntimeException - * - */ - private function createImage(BoxInterface $size, $operation) - { - $resource = imagecreatetruecolor($size->getWidth(), $size->getHeight()); - - if (false === $resource) { - throw new RuntimeException('Image '.$operation.' failed'); - } - - if (false === imagealphablending($resource, false) || false === imagesavealpha($resource, true)) { - throw new RuntimeException('Image '.$operation.' failed'); - } - - if (function_exists('imageantialias')) { - imageantialias($resource, true); - } - - $transparent = imagecolorallocatealpha($resource, 255, 255, 255, 127); - imagefill($resource, 0, 0, $transparent); - imagecolortransparent($resource, $transparent); - - return $resource; - } - - /** - * Internal - * - * Generates a GD color from Color instance - * - * @param ColorInterface $color - * - * @return integer A color identifier - * - * @throws RuntimeException - * @throws InvalidArgumentException - */ - private function getColor(ColorInterface $color) - { - if (!$color instanceof RGBColor) { - throw new InvalidArgumentException('GD driver only supports RGB colors'); - } - - $index = imagecolorallocatealpha($this->resource, $color->getRed(), $color->getGreen(), $color->getBlue(), round(127 * (100 - $color->getAlpha()) / 100)); - - if (false === $index) { - throw new RuntimeException(sprintf('Unable to allocate color "RGB(%s, %s, %s)" with transparency of %d percent', $color->getRed(), $color->getGreen(), $color->getBlue(), $color->getAlpha())); - } - - return $index; - } - - /** - * Internal - * - * Normalizes a given format name - * - * @param string $format - * - * @return string - */ - private function normalizeFormat($format) - { - $format = strtolower($format); - - if ('jpg' === $format || 'pjpeg' === $format) { - $format = 'jpeg'; - } - - return $format; - } - - /** - * Internal - * - * Checks whether a given format is supported by GD library - * - * @param string $format - * - * @return Boolean - */ - private function supported($format = null) - { - $formats = array('gif', 'jpeg', 'png', 'wbmp', 'xbm'); - - if (null === $format) { - return $formats; - } - - return in_array($format, $formats); - } - - private function setExceptionHandler() - { - set_error_handler(function ($errno, $errstr, $errfile, $errline) { - if (0 === error_reporting()) { - return; - } - - throw new RuntimeException($errstr, $errno, new \ErrorException($errstr, 0, $errno, $errfile, $errline)); - }, E_WARNING | E_NOTICE); - } - - private function resetExceptionHandler() - { - restore_error_handler(); - } - - /** - * Internal - * - * Get the mime type based on format. - * - * @param string $format - * - * @return string mime-type - * - * @throws RuntimeException - */ - private function getMimeType($format) - { - $format = $this->normalizeFormat($format); - - if (!$this->supported($format)) { - throw new RuntimeException('Invalid format'); - } - - static $mimeTypes = array( - 'jpeg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'wbmp' => 'image/vnd.wap.wbmp', - 'xbm' => 'image/xbm', - ); - - return $mimeTypes[$format]; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Imagine.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Imagine.php deleted file mode 100644 index f9e9508761..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Imagine.php +++ /dev/null @@ -1,195 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Image\AbstractImagine; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Palette\RGB; -use Imagine\Image\Palette\PaletteInterface; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\RGB as RGBColor; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; - -/** - * Imagine implementation using the GD library - */ -final class Imagine extends AbstractImagine -{ - /** - * @var array - */ - private $info; - - /** - * @throws RuntimeException - */ - public function __construct() - { - $this->loadGdInfo(); - $this->requireGdVersion('2.0.1'); - } - - /** - * {@inheritdoc} - */ - public function create(BoxInterface $size, ColorInterface $color = null) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - $resource = imagecreatetruecolor($width, $height); - - if (false === $resource) { - throw new RuntimeException('Create operation failed'); - } - - $palette = null !== $color ? $color->getPalette() : new RGB(); - $color = $color ? $color : $palette->color('fff'); - - if (!$color instanceof RGBColor) { - throw new InvalidArgumentException('GD driver only supports RGB colors'); - } - - $index = imagecolorallocatealpha($resource, $color->getRed(), $color->getGreen(), $color->getBlue(), round(127 * (100 - $color->getAlpha()) / 100)); - - if (false === $index) { - throw new RuntimeException('Unable to allocate color'); - } - - if (false === imagefill($resource, 0, 0, $index)) { - throw new RuntimeException('Could not set background color fill'); - } - - if ($color->getAlpha() >= 95) { - imagecolortransparent($resource, $index); - } - - return $this->wrap($resource, $palette, new MetadataBag()); - } - - /** - * {@inheritdoc} - */ - public function open($path) - { - $path = $this->checkPath($path); - $data = @file_get_contents($path); - - if (false === $data) { - throw new RuntimeException(sprintf('Failed to open file %s', $path)); - } - - $resource = @imagecreatefromstring($data); - - if (!is_resource($resource)) { - throw new RuntimeException(sprintf('Unable to open image %s', $path)); - } - - return $this->wrap($resource, new RGB(), $this->getMetadataReader()->readFile($path)); - } - - /** - * {@inheritdoc} - */ - public function load($string) - { - return $this->doLoad($string, $this->getMetadataReader()->readData($string)); - } - - /** - * {@inheritdoc} - */ - public function read($resource) - { - if (!is_resource($resource)) { - throw new InvalidArgumentException('Variable does not contain a stream resource'); - } - - $content = stream_get_contents($resource); - - if (false === $content) { - throw new InvalidArgumentException('Cannot read resource content'); - } - - return $this->doLoad($content, $this->getMetadataReader()->readStream($resource)); - } - - /** - * {@inheritdoc} - */ - public function font($file, $size, ColorInterface $color) - { - if (!$this->info['FreeType Support']) { - throw new RuntimeException('GD is not compiled with FreeType support'); - } - - return new Font($file, $size, $color); - } - - private function wrap($resource, PaletteInterface $palette, MetadataBag $metadata) - { - if (!imageistruecolor($resource)) { - list($width, $height) = array(imagesx($resource), imagesy($resource)); - - // create transparent truecolor canvas - $truecolor = imagecreatetruecolor($width, $height); - $transparent = imagecolorallocatealpha($truecolor, 255, 255, 255, 127); - - imagefill($truecolor, 0, 0, $transparent); - imagecolortransparent($truecolor, $transparent); - - imagecopymerge($truecolor, $resource, 0, 0, 0, 0, $width, $height, 100); - - imagedestroy($resource); - $resource = $truecolor; - } - - if (false === imagealphablending($resource, false) || false === imagesavealpha($resource, true)) { - throw new RuntimeException('Could not set alphablending, savealpha and antialias values'); - } - - if (function_exists('imageantialias')) { - imageantialias($resource, true); - } - - return new Image($resource, $palette, $metadata); - } - - private function loadGdInfo() - { - if (!function_exists('gd_info')) { - throw new RuntimeException('Gd not installed'); - } - - $this->info = gd_info(); - } - - private function requireGdVersion($version) - { - if (version_compare(GD_VERSION, $version, '<')) { - throw new RuntimeException(sprintf('GD2 version %s or higher is required', $version)); - } - } - - private function doLoad($string, MetadataBag $metadata) - { - $resource = @imagecreatefromstring($string); - - if (!is_resource($resource)) { - throw new RuntimeException('An image could not be created from the given input'); - } - - return $this->wrap($resource, new RGB(), $metadata); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Layers.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Layers.php deleted file mode 100644 index 93c7a26958..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gd/Layers.php +++ /dev/null @@ -1,144 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gd; - -use Imagine\Image\AbstractLayers; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\PaletteInterface; -use Imagine\Exception\NotSupportedException; - -class Layers extends AbstractLayers -{ - private $image; - private $offset; - private $resource; - private $palette; - - public function __construct(Image $image, PaletteInterface $palette, $resource) - { - if (!is_resource($resource)) { - throw new RuntimeException('Invalid Gd resource provided'); - } - - $this->image = $image; - $this->resource = $resource; - $this->offset = 0; - $this->palette = $palette; - } - - /** - * {@inheritdoc} - */ - public function merge() - { - } - - /** - * {@inheritdoc} - */ - public function coalesce() - { - } - - /** - * {@inheritdoc} - */ - public function animate($format, $delay, $loops) - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function current() - { - return new Image($this->resource, $this->palette, new MetadataBag()); - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->offset; - } - - /** - * {@inheritdoc} - */ - public function next() - { - ++$this->offset; - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->offset = 0; - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->offset < 1; - } - - /** - * {@inheritdoc} - */ - public function count() - { - return 1; - } - - /** - * {@inheritdoc} - */ - public function offsetExists($offset) - { - return 0 === $offset; - } - - /** - * {@inheritdoc} - */ - public function offsetGet($offset) - { - if (0 === $offset) { - return new Image($this->resource, $this->palette, new MetadataBag()); - } - - throw new RuntimeException('GD only supports one layer at offset 0'); - } - - /** - * {@inheritdoc} - */ - public function offsetSet($offset, $value) - { - throw new NotSupportedException('GD does not support layer set'); - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($offset) - { - throw new NotSupportedException('GD does not support layer unset'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Drawer.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Drawer.php deleted file mode 100644 index de6cc90485..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Drawer.php +++ /dev/null @@ -1,356 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Draw\DrawerInterface; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\NotSupportedException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractFont; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; - -/** - * Drawer implementation using the Gmagick PHP extension - */ -final class Drawer implements DrawerInterface -{ - /** - * @var \Gmagick - */ - private $gmagick; - - /** - * @param \Gmagick $gmagick - */ - public function __construct(\Gmagick $gmagick) - { - $this->gmagick = $gmagick; - } - - /** - * {@inheritdoc} - */ - public function arc(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $thickness = 1) - { - $x = $center->getX(); - $y = $center->getY(); - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $arc = new \GmagickDraw(); - - $arc->setstrokecolor($pixel); - $arc->setstrokewidth(max(1, (int) $thickness)); - $arc->setfillcolor('transparent'); - $arc->arc( - $x - $width / 2, - $y - $height / 2, - $x + $width / 2, - $y + $height / 2, - $start, - $end - ); - - $this->gmagick->drawImage($arc); - - $pixel = null; - - $arc = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Draw arc operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function chord(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - $x = $center->getX(); - $y = $center->getY(); - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $chord = new \GmagickDraw(); - - $chord->setstrokecolor($pixel); - $chord->setstrokewidth(max(1, (int) $thickness)); - - if ($fill) { - $chord->setfillcolor($pixel); - } else { - $x1 = round($x + $width / 2 * cos(deg2rad($start))); - $y1 = round($y + $height / 2 * sin(deg2rad($start))); - $x2 = round($x + $width / 2 * cos(deg2rad($end))); - $y2 = round($y + $height / 2 * sin(deg2rad($end))); - - $this->line(new Point($x1, $y1), new Point($x2, $y2), $color); - - $chord->setfillcolor('transparent'); - } - - $chord->arc($x - $width / 2, $y - $height / 2, $x + $width / 2, $y + $height / 2, $start, $end); - - $this->gmagick->drawImage($chord); - - $pixel = null; - - $chord = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Draw chord operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, $fill = false, $thickness = 1) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $ellipse = new \GmagickDraw(); - - $ellipse->setstrokecolor($pixel); - $ellipse->setstrokewidth(max(1, (int) $thickness)); - - if ($fill) { - $ellipse->setfillcolor($pixel); - } else { - $ellipse->setfillcolor('transparent'); - } - - $ellipse->ellipse( - $center->getX(), - $center->getY(), - $width / 2, - $height / 2, - 0, 360 - ); - - $this->gmagick->drawImage($ellipse); - - $pixel = null; - - $ellipse = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Draw ellipse operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function line(PointInterface $start, PointInterface $end, ColorInterface $color, $thickness = 1) - { - try { - $pixel = $this->getColor($color); - $line = new \GmagickDraw(); - - $line->setstrokecolor($pixel); - $line->setstrokewidth(max(1, (int) $thickness)); - $line->setfillcolor($pixel); - $line->line( - $start->getX(), - $start->getY(), - $end->getX(), - $end->getY() - ); - - $this->gmagick->drawImage($line); - - $pixel = null; - - $line = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Draw line operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function pieSlice(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - $x1 = round($center->getX() + $width / 2 * cos(deg2rad($start))); - $y1 = round($center->getY() + $height / 2 * sin(deg2rad($start))); - $x2 = round($center->getX() + $width / 2 * cos(deg2rad($end))); - $y2 = round($center->getY() + $height / 2 * sin(deg2rad($end))); - - if ($fill) { - $this->chord($center, $size, $start, $end, $color, true, $thickness); - $this->polygon( - array( - $center, - new Point($x1, $y1), - new Point($x2, $y2), - ), - $color, - true, - $thickness - ); - } else { - $this->arc($center, $size, $start, $end, $color, $thickness); - $this->line($center, new Point($x1, $y1), $color, $thickness); - $this->line($center, new Point($x2, $y2), $color, $thickness); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function dot(PointInterface $position, ColorInterface $color) - { - $x = $position->getX(); - $y = $position->getY(); - - try { - $pixel = $this->getColor($color); - $point = new \GmagickDraw(); - - $point->setfillcolor($pixel); - $point->point($x, $y); - - $this->gmagick->drawimage($point); - - $pixel = null; - $point = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Draw point operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function polygon(array $coordinates, ColorInterface $color, $fill = false, $thickness = 1) - { - if (count($coordinates) < 3) { - throw new InvalidArgumentException(sprintf('Polygon must consist of at least 3 coordinates, %d given', count($coordinates))); - } - - $points = array_map(function (PointInterface $p) { - return array('x' => $p->getX(), 'y' => $p->getY()); - }, $coordinates); - - try { - $pixel = $this->getColor($color); - $polygon = new \GmagickDraw(); - - $polygon->setstrokecolor($pixel); - $polygon->setstrokewidth(max(1, (int) $thickness)); - - if ($fill) { - $polygon->setfillcolor($pixel); - } else { - $polygon->setfillcolor('transparent'); - } - - $polygon->polygon($points); - - $this->gmagick->drawImage($polygon); - - unset($pixel, $polygon); - } catch (\GmagickException $e) { - throw new RuntimeException('Draw polygon operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function text($string, AbstractFont $font, PointInterface $position, $angle = 0, $width = null) - { - try { - $pixel = $this->getColor($font->getColor()); - $text = new \GmagickDraw(); - - $text->setfont($font->getFile()); - /** - * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027 - * - * ensure font resolution is the same as GD's hard-coded 96 - */ - $text->setfontsize((int) ($font->getSize() * (96 / 72))); - $text->setfillcolor($pixel); - - $info = $this->gmagick->queryfontmetrics($text, $string); - $rad = deg2rad($angle); - $cos = cos($rad); - $sin = sin($rad); - - $x1 = round(0 * $cos - 0 * $sin); - $x2 = round($info['textWidth'] * $cos - $info['textHeight'] * $sin); - $y1 = round(0 * $sin + 0 * $cos); - $y2 = round($info['textWidth'] * $sin + $info['textHeight'] * $cos); - - $xdiff = 0 - min($x1, $x2); - $ydiff = 0 - min($y1, $y2); - - if ($width !== null) { - throw new NotSupportedException('Gmagick doesn\'t support queryfontmetrics function for multiline text', 1); - } - - $this->gmagick->annotateimage($text, $position->getX() + $x1 + $xdiff, $position->getY() + $y2 + $ydiff, $angle, $string); - - unset($pixel, $text); - } catch (\GmagickException $e) { - throw new RuntimeException('Draw text operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * Gets specifically formatted color string from Color instance - * - * @param ColorInterface $color - * - * @return \GmagickPixel - * - * @throws InvalidArgumentException In case a non-opaque color is passed - */ - private function getColor(ColorInterface $color) - { - if (!$color->isOpaque()) { - throw new InvalidArgumentException('Gmagick doesn\'t support transparency'); - } - - return new \GmagickPixel((string) $color); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Effects.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Effects.php deleted file mode 100644 index 3f9c5cd08d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Effects.php +++ /dev/null @@ -1,106 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Effects\EffectsInterface; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Exception\NotSupportedException; - -/** - * Effects implementation using the Gmagick PHP extension - */ -class Effects implements EffectsInterface -{ - private $gmagick; - - public function __construct(\Gmagick $gmagick) - { - $this->gmagick = $gmagick; - } - - /** - * {@inheritdoc} - */ - public function gamma($correction) - { - try { - $this->gmagick->gammaimage($correction); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to apply gamma correction to the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function negative() - { - if (!method_exists($this->gmagick, 'negateimage')) { - throw new NotSupportedException('Gmagick version 1.1.0 RC3 is required for negative effect'); - } - - try { - $this->gmagick->negateimage(false, \Gmagick::CHANNEL_ALL); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to negate the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - try { - $this->gmagick->setImageType(2); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to grayscale the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function colorize(ColorInterface $color) - { - throw new NotSupportedException('Gmagick does not support colorize'); - } - - /** - * {@inheritdoc} - */ - public function sharpen() - { - throw new NotSupportedException('Gmagick does not support sharpen yet'); - } - - /** - * {@inheritdoc} - */ - public function blur($sigma = 1) - { - try { - $this->gmagick->blurImage(0, $sigma); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to blur the image', $e->getCode(), $e); - } - - return $this; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Font.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Font.php deleted file mode 100644 index ad67c56471..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Font.php +++ /dev/null @@ -1,63 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Image\AbstractFont; -use Imagine\Image\Box; -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Font implementation using the Gmagick PHP extension - */ -final class Font extends AbstractFont -{ - /** - * @var \Gmagick - */ - private $gmagick; - - /** - * @param \Gmagick $gmagick - * @param string $file - * @param integer $size - * @param ColorInterface $color - */ - public function __construct(\Gmagick $gmagick, $file, $size, ColorInterface $color) - { - $this->gmagick = $gmagick; - - parent::__construct($file, $size, $color); - } - - /** - * {@inheritdoc} - */ - public function box($string, $angle = 0) - { - $text = new \GmagickDraw(); - - $text->setfont($this->file); - /** - * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027 - * - * ensure font resolution is the same as GD's hard-coded 96 - */ - $text->setfontsize((int) ($this->size * (96 / 72))); - $text->setfontstyle(\Gmagick::STYLE_OBLIQUE); - - $info = $this->gmagick->queryfontmetrics($text, $string); - - $box = new Box($info['textWidth'], $info['textHeight']); - - return $box; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Image.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Image.php deleted file mode 100644 index 61ef858c1d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Image.php +++ /dev/null @@ -1,786 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractImage; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\PaletteInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Box; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; -use Imagine\Image\ProfileInterface; - -/** - * Image implementation using the Gmagick PHP extension - */ -final class Image extends AbstractImage -{ - /** - * @var \Gmagick - */ - private $gmagick; - /** - * @var Layers - */ - private $layers; - - /** - * @var PaletteInterface - */ - private $palette; - - private static $colorspaceMapping = array( - PaletteInterface::PALETTE_CMYK => \Gmagick::COLORSPACE_CMYK, - PaletteInterface::PALETTE_RGB => \Gmagick::COLORSPACE_RGB, - ); - - /** - * Constructs a new Image instance - * - * @param \Gmagick $gmagick - * @param PaletteInterface $palette - * @param MetadataBag $metadata - */ - public function __construct(\Gmagick $gmagick, PaletteInterface $palette, MetadataBag $metadata) - { - $this->metadata = $metadata; - $this->gmagick = $gmagick; - $this->setColorspace($palette); - $this->layers = new Layers($this, $this->palette, $this->gmagick); - } - - /** - * Destroys allocated gmagick resources - */ - public function __destruct() - { - if ($this->gmagick instanceof \Gmagick) { - $this->gmagick->clear(); - $this->gmagick->destroy(); - } - } - - /** - * Returns gmagick instance - * - * @return Gmagick - */ - public function getGmagick() - { - return $this->gmagick; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function copy() - { - return new self(clone $this->gmagick, $this->palette, clone $this->metadata); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function crop(PointInterface $start, BoxInterface $size) - { - if (!$start->in($this->getSize())) { - throw new OutOfBoundsException('Crop coordinates must start at minimum 0, 0 position from top left corner, crop height and width must be positive integers and must not exceed the current image borders'); - } - - try { - $this->gmagick->cropimage($size->getWidth(), $size->getHeight(), $start->getX(), $start->getY()); - } catch (\GmagickException $e) { - throw new RuntimeException('Crop operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function flipHorizontally() - { - try { - $this->gmagick->flopimage(); - } catch (\GmagickException $e) { - throw new RuntimeException('Horizontal flip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function flipVertically() - { - try { - $this->gmagick->flipimage(); - } catch (\GmagickException $e) { - throw new RuntimeException('Vertical flip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function strip() - { - try { - try { - $this->profile($this->palette->profile()); - } catch (\Exception $e) { - // here we discard setting the profile as the previous incorporated profile - // is corrupted, let's now strip the image - } - $this->gmagick->stripimage(); - } catch (\GmagickException $e) { - throw new RuntimeException('Strip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function paste(ImageInterface $image, PointInterface $start) - { - if (!$image instanceof self) { - throw new InvalidArgumentException(sprintf('Gmagick\Image can only paste() Gmagick\Image instances, %s given', get_class($image))); - } - - if (!$this->getSize()->contains($image->getSize(), $start)) { - throw new OutOfBoundsException('Cannot paste image of the given size at the specified position, as it moves outside of the current image\'s box'); - } - - try { - $this->gmagick->compositeimage($image->gmagick, \Gmagick::COMPOSITE_DEFAULT, $start->getX(), $start->getY()); - } catch (\GmagickException $e) { - throw new RuntimeException('Paste operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED) - { - static $supportedFilters = array( - ImageInterface::FILTER_UNDEFINED => \Gmagick::FILTER_UNDEFINED, - ImageInterface::FILTER_BESSEL => \Gmagick::FILTER_BESSEL, - ImageInterface::FILTER_BLACKMAN => \Gmagick::FILTER_BLACKMAN, - ImageInterface::FILTER_BOX => \Gmagick::FILTER_BOX, - ImageInterface::FILTER_CATROM => \Gmagick::FILTER_CATROM, - ImageInterface::FILTER_CUBIC => \Gmagick::FILTER_CUBIC, - ImageInterface::FILTER_GAUSSIAN => \Gmagick::FILTER_GAUSSIAN, - ImageInterface::FILTER_HANNING => \Gmagick::FILTER_HANNING, - ImageInterface::FILTER_HAMMING => \Gmagick::FILTER_HAMMING, - ImageInterface::FILTER_HERMITE => \Gmagick::FILTER_HERMITE, - ImageInterface::FILTER_LANCZOS => \Gmagick::FILTER_LANCZOS, - ImageInterface::FILTER_MITCHELL => \Gmagick::FILTER_MITCHELL, - ImageInterface::FILTER_POINT => \Gmagick::FILTER_POINT, - ImageInterface::FILTER_QUADRATIC => \Gmagick::FILTER_QUADRATIC, - ImageInterface::FILTER_SINC => \Gmagick::FILTER_SINC, - ImageInterface::FILTER_TRIANGLE => \Gmagick::FILTER_TRIANGLE - ); - - if (!array_key_exists($filter, $supportedFilters)) { - throw new InvalidArgumentException('Unsupported filter type'); - } - - try { - $this->gmagick->resizeimage($size->getWidth(), $size->getHeight(), $supportedFilters[$filter], 1); - } catch (\GmagickException $e) { - throw new RuntimeException('Resize operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function rotate($angle, ColorInterface $background = null) - { - try { - $background = $background ?: $this->palette->color('fff'); - $pixel = $this->getColor($background); - - $this->gmagick->rotateimage($pixel, $angle); - - unset($pixel); - } catch (\GmagickException $e) { - throw new RuntimeException('Rotate operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * Internal - * - * Applies options before save or output - * - * @param \Gmagick $image - * @param array $options - * @param string $path - * - * @throws InvalidArgumentException - */ - private function applyImageOptions(\Gmagick $image, array $options, $path) - { - if (isset($options['format'])) { - $format = $options['format']; - } elseif ('' !== $extension = pathinfo($path, \PATHINFO_EXTENSION)) { - $format = $extension; - } else { - $format = pathinfo($image->getImageFilename(), \PATHINFO_EXTENSION); - } - - $format = strtolower($format); - - $options = $this->updateSaveOptions($options); - - if (isset($options['jpeg_quality']) && in_array($format, array('jpeg', 'jpg', 'pjpeg'))) { - $image->setCompressionQuality($options['jpeg_quality']); - } - - if ((isset($options['png_compression_level']) || isset($options['png_compression_filter'])) && $format === 'png') { - // first digit: compression level (default: 7) - if (isset($options['png_compression_level'])) { - if ($options['png_compression_level'] < 0 || $options['png_compression_level'] > 9) { - throw new InvalidArgumentException('png_compression_level option should be an integer from 0 to 9'); - } - $compression = $options['png_compression_level'] * 10; - } else { - $compression = 70; - } - - // second digit: compression filter (default: 5) - if (isset($options['png_compression_filter'])) { - if ($options['png_compression_filter'] < 0 || $options['png_compression_filter'] > 9) { - throw new InvalidArgumentException('png_compression_filter option should be an integer from 0 to 9'); - } - $compression += $options['png_compression_filter']; - } else { - $compression += 5; - } - - $image->setCompressionQuality($compression); - } - - if (isset($options['resolution-units']) && isset($options['resolution-x']) && isset($options['resolution-y'])) { - if ($options['resolution-units'] == ImageInterface::RESOLUTION_PIXELSPERCENTIMETER) { - $image->setimageunits(\Gmagick::RESOLUTION_PIXELSPERCENTIMETER); - } elseif ($options['resolution-units'] == ImageInterface::RESOLUTION_PIXELSPERINCH) { - $image->setimageunits(\Gmagick::RESOLUTION_PIXELSPERINCH); - } else { - throw new InvalidArgumentException('Unsupported image unit format'); - } - - $image->setimageresolution($options['resolution-x'], $options['resolution-y']); - } - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function save($path = null, array $options = array()) - { - $path = null === $path ? $this->gmagick->getImageFilename() : $path; - - if ('' === trim($path)) { - throw new RuntimeException('You can omit save path only if image has been open from a file'); - } - - try { - $this->prepareOutput($options, $path); - $allFrames = !isset($options['animated']) || false === $options['animated']; - $this->gmagick->writeimage($path, $allFrames); - } catch (\GmagickException $e) { - throw new RuntimeException('Save operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function show($format, array $options = array()) - { - header('Content-type: '.$this->getMimeType($format)); - echo $this->get($format, $options); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function get($format, array $options = array()) - { - try { - $options['format'] = $format; - $this->prepareOutput($options); - } catch (\GmagickException $e) { - throw new RuntimeException('Get operation failed', $e->getCode(), $e); - } - - return $this->gmagick->getimagesblob(); - } - - /** - * @param array $options - * @param string $path - */ - private function prepareOutput(array $options, $path = null) - { - if (isset($options['format'])) { - $this->gmagick->setimageformat($options['format']); - } - - if (isset($options['animated']) && true === $options['animated']) { - $format = isset($options['format']) ? $options['format'] : 'gif'; - $delay = isset($options['animated.delay']) ? $options['animated.delay'] : null; - $loops = isset($options['animated.loops']) ? $options['animated.loops'] : 0; - - $options['flatten'] = false; - - $this->layers->animate($format, $delay, $loops); - } else { - $this->layers->merge(); - } - $this->applyImageOptions($this->gmagick, $options, $path); - - // flatten only if image has multiple layers - if ((!isset($options['flatten']) || $options['flatten'] === true) && count($this->layers) > 1) { - $this->flatten(); - } - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->get('png'); - } - - /** - * {@inheritdoc} - */ - public function draw() - { - return new Drawer($this->gmagick); - } - - /** - * {@inheritdoc} - */ - public function effects() - { - return new Effects($this->gmagick); - } - - /** - * {@inheritdoc} - */ - public function getSize() - { - try { - $i = $this->gmagick->getimageindex(); - $this->gmagick->setimageindex(0); //rewind - $width = $this->gmagick->getimagewidth(); - $height = $this->gmagick->getimageheight(); - $this->gmagick->setimageindex($i); - } catch (\GmagickException $e) { - throw new RuntimeException('Get size operation failed', $e->getCode(), $e); - } - - return new Box($width, $height); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function applyMask(ImageInterface $mask) - { - if (!$mask instanceof self) { - throw new InvalidArgumentException('Can only apply instances of Imagine\Gmagick\Image as masks'); - } - - $size = $this->getSize(); - $maskSize = $mask->getSize(); - - if ($size != $maskSize) { - throw new InvalidArgumentException(sprintf('The given mask doesn\'t match current image\'s size, current mask\'s dimensions are %s, while image\'s dimensions are %s', $maskSize, $size)); - } - - try { - $mask = $mask->copy(); - $this->gmagick->compositeimage($mask->gmagick, \Gmagick::COMPOSITE_DEFAULT, 0, 0); - } catch (\GmagickException $e) { - throw new RuntimeException('Apply mask operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function mask() - { - $mask = $this->copy(); - - try { - $mask->gmagick->modulateimage(100, 0, 100); - } catch (\GmagickException $e) { - throw new RuntimeException('Mask operation failed', $e->getCode(), $e); - } - - return $mask; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function fill(FillInterface $fill) - { - try { - $draw = new \GmagickDraw(); - $size = $this->getSize(); - - $w = $size->getWidth(); - $h = $size->getHeight(); - - for ($x = 0; $x <= $w; $x++) { - for ($y = 0; $y <= $h; $y++) { - $pixel = $this->getColor($fill->getColor(new Point($x, $y))); - - $draw->setfillcolor($pixel); - $draw->point($x, $y); - - $pixel = null; - } - } - - $this->gmagick->drawimage($draw); - - $draw = null; - } catch (\GmagickException $e) { - throw new RuntimeException('Fill operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function histogram() - { - try { - $pixels = $this->gmagick->getimagehistogram(); - } catch (\GmagickException $e) { - throw new RuntimeException('Error while fetching histogram', $e->getCode(), $e); - } - - $image = $this; - - return array_map(function (\GmagickPixel $pixel) use ($image) { - return $image->pixelToColor($pixel); - }, $pixels); - } - - /** - * {@inheritdoc} - */ - public function getColorAt(PointInterface $point) - { - if (!$point->in($this->getSize())) { - throw new InvalidArgumentException(sprintf('Error getting color at point [%s,%s]. The point must be inside the image of size [%s,%s]', $point->getX(), $point->getY(), $this->getSize()->getWidth(), $this->getSize()->getHeight())); - } - - try { - $cropped = clone $this->gmagick; - $histogram = $cropped - ->cropImage(1, 1, $point->getX(), $point->getY()) - ->getImageHistogram(); - } catch (\GmagickException $e) { - throw new RuntimeException('Unable to get the pixel'); - } - - $pixel = array_shift($histogram); - - unset($histogram, $cropped); - - return $this->pixelToColor($pixel); - } - - /** - * Returns a color given a pixel, depending the Palette context - * - * Note : this method is public for PHP 5.3 compatibility - * - * @param \GmagickPixel $pixel - * - * @return ColorInterface - * - * @throws InvalidArgumentException In case a unknown color is requested - */ - public function pixelToColor(\GmagickPixel $pixel) - { - static $colorMapping = array( - ColorInterface::COLOR_RED => \Gmagick::COLOR_RED, - ColorInterface::COLOR_GREEN => \Gmagick::COLOR_GREEN, - ColorInterface::COLOR_BLUE => \Gmagick::COLOR_BLUE, - ColorInterface::COLOR_CYAN => \Gmagick::COLOR_CYAN, - ColorInterface::COLOR_MAGENTA => \Gmagick::COLOR_MAGENTA, - ColorInterface::COLOR_YELLOW => \Gmagick::COLOR_YELLOW, - ColorInterface::COLOR_KEYLINE => \Gmagick::COLOR_BLACK, - // There is no gray component in \Gmagick, let's use one of the RGB comp - ColorInterface::COLOR_GRAY => \Gmagick::COLOR_RED, - ); - - if ($this->palette->supportsAlpha()) { - try { - $alpha = (int) round($pixel->getcolorvalue(\Gmagick::COLOR_ALPHA) * 100); - } catch (\GmagickPixelException $e) { - $alpha = null; - } - } else { - $alpha = null; - } - - $palette = $this->palette(); - - return $this->palette->color(array_map(function ($color) use ($palette, $pixel, $colorMapping) { - if (!isset($colorMapping[$color])) { - throw new InvalidArgumentException(sprintf('Color %s is not mapped in Gmagick', $color)); - } - $multiplier = 255; - if ($palette->name() === PaletteInterface::PALETTE_CMYK) { - $multiplier = 100; - } - - return $pixel->getcolorvalue($colorMapping[$color]) * $multiplier; - }, $this->palette->pixelDefinition()), $alpha); - } - - /** - * {@inheritdoc} - */ - public function layers() - { - return $this->layers; - } - - /** - * {@inheritdoc} - */ - public function interlace($scheme) - { - static $supportedInterlaceSchemes = array( - ImageInterface::INTERLACE_NONE => \Gmagick::INTERLACE_NO, - ImageInterface::INTERLACE_LINE => \Gmagick::INTERLACE_LINE, - ImageInterface::INTERLACE_PLANE => \Gmagick::INTERLACE_PLANE, - ImageInterface::INTERLACE_PARTITION => \Gmagick::INTERLACE_PARTITION, - ); - - if (!array_key_exists($scheme, $supportedInterlaceSchemes)) { - throw new InvalidArgumentException('Unsupported interlace type'); - } - - $this->gmagick->setInterlaceScheme($supportedInterlaceSchemes[$scheme]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function usePalette(PaletteInterface $palette) - { - if (!isset(static::$colorspaceMapping[$palette->name()])) { - throw new InvalidArgumentException(sprintf('The palette %s is not supported by Gmagick driver',$palette->name())); - } - - if ($this->palette->name() === $palette->name()) { - return $this; - } - - try { - try { - $hasICCProfile = (Boolean) $this->gmagick->getimageprofile('ICM'); - } catch (\GmagickException $e) { - $hasICCProfile = false; - } - - if (!$hasICCProfile) { - $this->profile($this->palette->profile()); - } - - $this->profile($palette->profile()); - - $this->setColorspace($palette); - $this->palette = $palette; - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to set colorspace', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function palette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function profile(ProfileInterface $profile) - { - try { - $this->gmagick->profileimage('ICM', $profile->data()); - } catch (\GmagickException $e) { - throw new RuntimeException(sprintf('Unable to add profile %s to image', $profile->name()), $e->getCode(), $e); - } - - return $this; - } - - /** - * Internal - * - * Flatten the image. - */ - private function flatten() - { - /** - * @see http://pecl.php.net/bugs/bug.php?id=22435 - */ - if (method_exists($this->gmagick, 'flattenImages')) { - try { - $this->gmagick = $this->gmagick->flattenImages(); - } catch (\GmagickException $e) { - throw new RuntimeException('Flatten operation failed', $e->getCode(), $e); - } - } - } - - /** - * Gets specifically formatted color string from Color instance - * - * @param ColorInterface $color - * - * @return \GmagickPixel - * - * @throws InvalidArgumentException - */ - private function getColor(ColorInterface $color) - { - if (!$color->isOpaque()) { - throw new InvalidArgumentException('Gmagick doesn\'t support transparency'); - } - - return new \GmagickPixel((string) $color); - } - - /** - * Internal - * - * Get the mime type based on format. - * - * @param string $format - * - * @return string mime-type - * - * @throws InvalidArgumentException - */ - private function getMimeType($format) - { - static $mimeTypes = array( - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'wbmp' => 'image/vnd.wap.wbmp', - 'xbm' => 'image/xbm', - ); - - if (!isset($mimeTypes[$format])) { - throw new InvalidArgumentException(sprintf('Unsupported format given. Only %s are supported, %s given', implode(", ", array_keys($mimeTypes)), $format)); - } - - return $mimeTypes[$format]; - } - - /** - * Sets colorspace and image type, assigns the palette. - * - * @param PaletteInterface $palette - * - * @throws InvalidArgumentException - */ - private function setColorspace(PaletteInterface $palette) - { - if (!isset(static::$colorspaceMapping[$palette->name()])) { - throw new InvalidArgumentException(sprintf('The palette %s is not supported by Gmagick driver', $palette->name())); - } - - $this->gmagick->setimagecolorspace(static::$colorspaceMapping[$palette->name()]); - $this->palette = $palette; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Imagine.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Imagine.php deleted file mode 100644 index ce4d4ed6c2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Imagine.php +++ /dev/null @@ -1,167 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Image\AbstractImagine; -use Imagine\Exception\NotSupportedException; -use Imagine\Image\BoxInterface; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Palette\Grayscale; -use Imagine\Image\Palette\CMYK; -use Imagine\Image\Palette\RGB; -use Imagine\Image\Palette\Color\CMYK as CMYKColor; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; - -/** - * Imagine implementation using the Gmagick PHP extension - */ -class Imagine extends AbstractImagine -{ - /** - * @throws RuntimeException - */ - public function __construct() - { - if (!class_exists('Gmagick')) { - throw new RuntimeException('Gmagick not installed'); - } - } - - /** - * {@inheritdoc} - */ - public function open($path) - { - $path = $this->checkPath($path); - - try { - $gmagick = new \Gmagick($path); - $image = new Image($gmagick, $this->createPalette($gmagick), $this->getMetadataReader()->readFile($path)); - } catch (\GmagickException $e) { - throw new RuntimeException(sprintf('Unable to open image %s', $path), $e->getCode(), $e); - } - - return $image; - } - - /** - * {@inheritdoc} - */ - public function create(BoxInterface $size, ColorInterface $color = null) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - $palette = null !== $color ? $color->getPalette() : new RGB(); - $color = null !== $color ? $color : $palette->color('fff'); - - try { - $gmagick = new \Gmagick(); - // Gmagick does not support creation of CMYK GmagickPixel - // see https://bugs.php.net/bug.php?id=64466 - if ($color instanceof CMYKColor) { - $switchPalette = $palette; - $palette = new RGB(); - $pixel = new \GmagickPixel($palette->color((string) $color)); - } else { - $switchPalette = null; - $pixel = new \GmagickPixel((string) $color); - } - - if ($color->getPalette()->supportsAlpha() && $color->getAlpha() < 100) { - throw new NotSupportedException('alpha transparency is not supported'); - } - - $gmagick->newimage($width, $height, $pixel->getcolor(false)); - $gmagick->setimagecolorspace(\Gmagick::COLORSPACE_TRANSPARENT); - $gmagick->setimagebackgroundcolor($pixel); - - $image = new Image($gmagick, $palette, new MetadataBag()); - - if ($switchPalette) { - $image->usePalette($switchPalette); - } - - return $image; - } catch (\GmagickException $e) { - throw new RuntimeException('Could not create empty image', $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function load($string) - { - return $this->doLoad($string, $this->getMetadataReader()->readData($string)); - } - - /** - * {@inheritdoc} - */ - public function read($resource) - { - if (!is_resource($resource)) { - throw new InvalidArgumentException('Variable does not contain a stream resource'); - } - - $content = stream_get_contents($resource); - - if (false === $content) { - throw new InvalidArgumentException('Couldn\'t read given resource'); - } - - return $this->doLoad($content, $this->getMetadataReader()->readStream($resource)); - } - - /** - * {@inheritdoc} - */ - public function font($file, $size, ColorInterface $color) - { - $gmagick = new \Gmagick(); - $gmagick->newimage(1, 1, 'transparent'); - - return new Font($gmagick, $file, $size, $color); - } - - private function createPalette(\Gmagick $gmagick) - { - switch ($gmagick->getimagecolorspace()) { - case \Gmagick::COLORSPACE_SRGB: - case \Gmagick::COLORSPACE_RGB: - return new RGB(); - case \Gmagick::COLORSPACE_CMYK: - return new CMYK(); - case \Gmagick::COLORSPACE_GRAY: - return new Grayscale(); - default: - throw new NotSupportedException('Only RGB and CMYK colorspace are currently supported'); - } - } - - private function doLoad($content, MetadataBag $metadata) - { - try { - $gmagick = new \Gmagick(); - $gmagick->readimageblob($content); - } catch (\GmagickException $e) { - throw new RuntimeException( - 'Could not load image from string', $e->getCode(), $e - ); - } - - return new Image($gmagick, $this->createPalette($gmagick), $metadata); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Layers.php b/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Layers.php deleted file mode 100644 index d708812a14..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Gmagick/Layers.php +++ /dev/null @@ -1,272 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Gmagick; - -use Imagine\Image\AbstractLayers; -use Imagine\Exception\RuntimeException; -use Imagine\Exception\NotSupportedException; -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\PaletteInterface; - -class Layers extends AbstractLayers -{ - /** - * @var Image - */ - private $image; - - /** - * @var \Gmagick - */ - private $resource; - - /** - * @var integer - */ - private $offset = 0; - - /** - * @var array - */ - private $layers = array(); - - /** - * @var PaletteInterface - */ - private $palette; - - public function __construct(Image $image, PaletteInterface $palette, \Gmagick $resource) - { - $this->image = $image; - $this->resource = $resource; - $this->palette = $palette; - } - - /** - * {@inheritdoc} - */ - public function merge() - { - foreach ($this->layers as $offset => $image) { - try { - $this->resource->setimageindex($offset); - $this->resource->setimage($image->getGmagick()); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to substitute layer', $e->getCode(), $e); - } - } - } - - /** - * {@inheritdoc} - */ - public function coalesce() - { - throw new NotSupportedException('Gmagick does not support coalescing'); - } - - /** - * {@inheritdoc} - */ - public function animate($format, $delay, $loops) - { - if ('gif' !== strtolower($format)) { - throw new NotSupportedException('Animated picture is currently only supported on gif'); - } - - if (!is_int($loops) || $loops < 0) { - throw new InvalidArgumentException('Loops must be a positive integer.'); - } - - if (null !== $delay && (!is_int($delay) || $delay < 0)) { - throw new InvalidArgumentException('Delay must be either null or a positive integer.'); - } - - try { - foreach ($this as $offset => $layer) { - $this->resource->setimageindex($offset); - $this->resource->setimageformat($format); - - if (null !== $delay) { - $this->resource->setimagedelay($delay / 10); - } - - $this->resource->setimageiterations($loops); - } - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to animate layers', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function current() - { - return $this->extractAt($this->offset); - } - - /** - * Tries to extract layer at given offset - * - * @param integer $offset - * @return Image - * @throws RuntimeException - */ - private function extractAt($offset) - { - if (!isset($this->layers[$offset])) { - try { - $this->resource->setimageindex($offset); - $this->layers[$offset] = new Image($this->resource->getimage(), $this->palette, new MetadataBag()); - } catch (\GmagickException $e) { - throw new RuntimeException(sprintf('Failed to extract layer %d', $offset), $e->getCode(), $e); - } - } - - return $this->layers[$offset]; - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->offset; - } - - /** - * {@inheritdoc} - */ - public function next() - { - ++$this->offset; - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->offset = 0; - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->offset < count($this); - } - - /** - * {@inheritdoc} - */ - public function count() - { - try { - return $this->resource->getnumberimages(); - } catch (\GmagickException $e) { - throw new RuntimeException('Failed to count the number of layers', $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function offsetExists($offset) - { - return is_int($offset) && $offset >= 0 && $offset < count($this); - } - - /** - * {@inheritdoc} - */ - public function offsetGet($offset) - { - return $this->extractAt($offset); - } - - /** - * {@inheritdoc} - */ - public function offsetSet($offset, $image) - { - if (!$image instanceof Image) { - throw new InvalidArgumentException('Only a Gmagick Image can be used as layer'); - } - - if (null === $offset) { - $offset = count($this) - 1; - } else { - if (!is_int($offset)) { - throw new InvalidArgumentException('Invalid offset for layer, it must be an integer'); - } - - if (count($this) < $offset || 0 > $offset) { - throw new OutOfBoundsException(sprintf('Invalid offset for layer, it must be a value between 0 and %d, %d given', count($this), $offset)); - } - - if (isset($this[$offset])) { - unset($this[$offset]); - $offset = $offset - 1; - } - } - - $frame = $image->getGmagick(); - - try { - if (count($this) > 0) { - $this->resource->setimageindex($offset); - $this->resource->nextimage(); - } - $this->resource->addimage($frame); - - /** - * ugly hack to bypass issue https://bugs.php.net/bug.php?id=64623 - */ - if (count($this) == 2) { - $this->resource->setimageindex($offset+1); - $this->resource->nextimage(); - $this->resource->addimage($frame); - unset($this[0]); - } - } catch (\GmagickException $e) { - throw new RuntimeException('Unable to set the layer', $e->getCode(), $e); - } - - $this->layers = array(); - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($offset) - { - try { - $this->extractAt($offset); - } catch (RuntimeException $e) { - return; - } - - try { - $this->resource->setimageindex($offset); - $this->resource->removeimage(); - } catch (\GmagickException $e) { - throw new RuntimeException('Unable to remove layer', $e->getCode(), $e); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractFont.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractFont.php deleted file mode 100644 index 59e9a45ba2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractFont.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Abstract font base class - */ -abstract class AbstractFont implements FontInterface -{ - /** - * @var string - */ - protected $file; - - /** - * @var integer - */ - protected $size; - - /** - * @var ColorInterface - */ - protected $color; - - /** - * Constructs a font with specified $file, $size and $color - * - * The font size is to be specified in points (e.g. 10pt means 10) - * - * @param string $file - * @param integer $size - * @param ColorInterface $color - */ - public function __construct($file, $size, ColorInterface $color) - { - $this->file = $file; - $this->size = $size; - $this->color = $color; - } - - /** - * {@inheritdoc} - */ - final public function getFile() - { - return $this->file; - } - - /** - * {@inheritdoc} - */ - final public function getSize() - { - return $this->size; - } - - /** - * {@inheritdoc} - */ - final public function getColor() - { - return $this->color; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImage.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImage.php deleted file mode 100644 index 5c85769fd1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImage.php +++ /dev/null @@ -1,120 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Image\Metadata\MetadataBag; - -abstract class AbstractImage implements ImageInterface -{ - /** - * @var MetadataBag - */ - protected $metadata; - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function thumbnail(BoxInterface $size, $mode = ImageInterface::THUMBNAIL_INSET, $filter = ImageInterface::FILTER_UNDEFINED) - { - if ($mode !== ImageInterface::THUMBNAIL_INSET && - $mode !== ImageInterface::THUMBNAIL_OUTBOUND) { - throw new InvalidArgumentException('Invalid mode specified'); - } - - $imageSize = $this->getSize(); - $ratios = array( - $size->getWidth() / $imageSize->getWidth(), - $size->getHeight() / $imageSize->getHeight() - ); - - $thumbnail = $this->copy(); - - $thumbnail->usePalette($this->palette()); - $thumbnail->strip(); - // if target width is larger than image width - // AND target height is longer than image height - if ($size->contains($imageSize)) { - return $thumbnail; - } - - if ($mode === ImageInterface::THUMBNAIL_INSET) { - $ratio = min($ratios); - } else { - $ratio = max($ratios); - } - - if ($mode === ImageInterface::THUMBNAIL_OUTBOUND) { - if (!$imageSize->contains($size)) { - $size = new Box( - min($imageSize->getWidth(), $size->getWidth()), - min($imageSize->getHeight(), $size->getHeight()) - ); - } else { - $imageSize = $thumbnail->getSize()->scale($ratio); - $thumbnail->resize($imageSize, $filter); - } - $thumbnail->crop(new Point( - max(0, round(($imageSize->getWidth() - $size->getWidth()) / 2)), - max(0, round(($imageSize->getHeight() - $size->getHeight()) / 2)) - ), $size); - } else { - if (!$imageSize->contains($size)) { - $imageSize = $imageSize->scale($ratio); - $thumbnail->resize($imageSize, $filter); - } else { - $imageSize = $thumbnail->getSize()->scale($ratio); - $thumbnail->resize($imageSize, $filter); - } - } - - return $thumbnail; - } - - /** - * Updates a given array of save options for backward compatibility with legacy names - * - * @param array $options - * - * @return array - */ - protected function updateSaveOptions(array $options) - { - // Preserve BC until version 1.0 - if (isset($options['quality']) && !isset($options['jpeg_quality'])) { - $options['jpeg_quality'] = $options['quality']; - } - - return $options; - } - - /** - * {@inheritdoc} - */ - public function metadata() - { - return $this->metadata; - } - - /** - * Assures the metadata instance will be cloned, too - */ - public function __clone() - { - if ($this->metadata !== null) { - $this->metadata = clone $this->metadata; - } - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImagine.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImagine.php deleted file mode 100644 index fcb1a3d678..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractImagine.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Image\Metadata\DefaultMetadataReader; -use Imagine\Image\Metadata\ExifMetadataReader; -use Imagine\Image\Metadata\MetadataReaderInterface; -use Imagine\Exception\InvalidArgumentException; - -abstract class AbstractImagine implements ImagineInterface -{ - /** @var MetadataReaderInterface */ - private $metadataReader; - - /** - * @param MetadataReaderInterface $metadataReader - * - * @return ImagineInterface - */ - public function setMetadataReader(MetadataReaderInterface $metadataReader) - { - $this->metadataReader = $metadataReader; - - return $this; - } - - /** - * @return MetadataReaderInterface - */ - public function getMetadataReader() - { - if (null === $this->metadataReader) { - if (ExifMetadataReader::isSupported()) { - $this->metadataReader = new ExifMetadataReader(); - } else { - $this->metadataReader = new DefaultMetadataReader(); - } - } - - return $this->metadataReader; - } - - /** - * Checks a path that could be used with ImagineInterface::open and returns - * a proper string. - * - * @param string|object $path - * - * @return string - * - * @throws InvalidArgumentException In case the given path is invalid. - */ - protected function checkPath($path) - { - // provide compatibility with objects such as \SplFileInfo - if (is_object($path) && method_exists($path, '__toString')) { - $path = (string) $path; - } - - $handle = @fopen($path, 'r'); - - if (false === $handle) { - throw new InvalidArgumentException(sprintf('File %s does not exist.', $path)); - } - - fclose($handle); - - return $path; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractLayers.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractLayers.php deleted file mode 100644 index 486a722283..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/AbstractLayers.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -abstract class AbstractLayers implements LayersInterface -{ - /** - * {@inheritdoc} - */ - public function add(ImageInterface $image) - { - $this[] = $image; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function set($offset, ImageInterface $image) - { - $this[$offset] = $image; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function remove($offset) - { - unset($this[$offset]); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function get($offset) - { - return $this[$offset]; - } - - /** - * {@inheritdoc} - */ - public function has($offset) - { - return isset($this[$offset]); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Box.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Box.php deleted file mode 100644 index 37b85135a9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Box.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\InvalidArgumentException; - -/** - * A box implementation - */ -final class Box implements BoxInterface -{ - /** - * @var integer - */ - private $width; - - /** - * @var integer - */ - private $height; - - /** - * Constructs the Size with given width and height - * - * @param integer $width - * @param integer $height - * - * @throws InvalidArgumentException - */ - public function __construct($width, $height) - { - if ($height < 1 || $width < 1) { - throw new InvalidArgumentException(sprintf('Length of either side cannot be 0 or negative, current size is %sx%s', $width, $height)); - } - - $this->width = (int) $width; - $this->height = (int) $height; - } - - /** - * {@inheritdoc} - */ - public function getWidth() - { - return $this->width; - } - - /** - * {@inheritdoc} - */ - public function getHeight() - { - return $this->height; - } - - /** - * {@inheritdoc} - */ - public function scale($ratio) - { - return new Box(round($ratio * $this->width), round($ratio * $this->height)); - } - - /** - * {@inheritdoc} - */ - public function increase($size) - { - return new Box((int) $size + $this->width, (int) $size + $this->height); - } - - /** - * {@inheritdoc} - */ - public function contains(BoxInterface $box, PointInterface $start = null) - { - $start = $start ? $start : new Point(0, 0); - - return $start->in($this) && $this->width >= $box->getWidth() + $start->getX() && $this->height >= $box->getHeight() + $start->getY(); - } - - /** - * {@inheritdoc} - */ - public function square() - { - return $this->width * $this->height; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('%dx%d px', $this->width, $this->height); - } - - /** - * {@inheritdoc} - */ - public function widen($width) - { - return $this->scale($width / $this->width); - } - - /** - * {@inheritdoc} - */ - public function heighten($height) - { - return $this->scale($height / $this->height); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/BoxInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/BoxInterface.php deleted file mode 100644 index 4a086c39ff..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/BoxInterface.php +++ /dev/null @@ -1,94 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -/** - * Interface for a box - */ -interface BoxInterface -{ - /** - * Gets current image height - * - * @return integer - */ - public function getHeight(); - - /** - * Gets current image width - * - * @return integer - */ - public function getWidth(); - - /** - * Creates new BoxInterface instance with ratios applied to both sides - * - * @param float $ratio - * - * @return BoxInterface - */ - public function scale($ratio); - - /** - * Creates new BoxInterface, adding given size to both sides - * - * @param integer $size - * - * @return BoxInterface - */ - public function increase($size); - - /** - * Checks whether current box can fit given box at a given start position, - * start position defaults to top left corner xy(0,0) - * - * @param BoxInterface $box - * @param PointInterface $start - * - * @return Boolean - */ - public function contains(BoxInterface $box, PointInterface $start = null); - - /** - * Gets current box square, useful for getting total number of pixels in a - * given box - * - * @return integer - */ - public function square(); - - /** - * Returns a string representation of the current box - * - * @return string - */ - public function __toString(); - - /** - * Resizes box to given width, constraining proportions and returns the new box - * - * @param integer $width - * - * @return BoxInterface - */ - public function widen($width); - - /** - * Resizes box to given height, constraining proportions and returns the new box - * - * @param integer $height - * - * @return BoxInterface - */ - public function heighten($height); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/FillInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/FillInterface.php deleted file mode 100644 index c8d69e5d4d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/FillInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Fill; - -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\PointInterface; - -/** - * Interface for the fill - */ -interface FillInterface -{ - /** - * Gets color of the fill for the given position - * - * @param PointInterface $position - * - * @return ColorInterface - */ - public function getColor(PointInterface $position); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Horizontal.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Horizontal.php deleted file mode 100644 index 4a4230671e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Horizontal.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Fill\Gradient; - -use Imagine\Image\PointInterface; - -/** - * Horizontal gradient fill - */ -final class Horizontal extends Linear -{ - /** - * {@inheritdoc} - */ - public function getDistance(PointInterface $position) - { - return $position->getX(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Linear.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Linear.php deleted file mode 100644 index 9bf2cf6cca..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Linear.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Fill\Gradient; - -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\PointInterface; - -/** - * Linear gradient fill - */ -abstract class Linear implements FillInterface -{ - /** - * @var integer - */ - private $length; - - /** - * @var ColorInterface - */ - private $start; - - /** - * @var ColorInterface - */ - private $end; - - /** - * Constructs a linear gradient with overall gradient length, and start and - * end shades, which default to 0 and 255 accordingly - * - * @param integer $length - * @param ColorInterface $start - * @param ColorInterface $end - */ - final public function __construct($length, ColorInterface $start, ColorInterface $end) - { - $this->length = $length; - $this->start = $start; - $this->end = $end; - } - - /** - * {@inheritdoc} - */ - final public function getColor(PointInterface $position) - { - $l = $this->getDistance($position); - - if ($l >= $this->length) { - return $this->end; - } - - if ($l < 0) { - return $this->start; - } - - return $this->start->getPalette()->blend($this->start, $this->end, $l / $this->length); - } - - /** - * @return ColorInterface - */ - final public function getStart() - { - return $this->start; - } - - /** - * @return ColorInterface - */ - final public function getEnd() - { - return $this->end; - } - - /** - * Get the distance of the position relative to the beginning of the gradient - * - * @param PointInterface $position - * - * @return integer - */ - abstract protected function getDistance(PointInterface $position); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Vertical.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Vertical.php deleted file mode 100644 index 9a26b77892..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Fill/Gradient/Vertical.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Fill\Gradient; - -use Imagine\Image\PointInterface; - -/** - * Vertical gradient fill - */ -final class Vertical extends Linear -{ - /** - * {@inheritdoc} - */ - public function getDistance(PointInterface $position) - { - return $position->getY(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/FontInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/FontInterface.php deleted file mode 100644 index 59d4a265af..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/FontInterface.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * The font interface - */ -interface FontInterface -{ - /** - * Gets the fontfile for current font - * - * @return string - */ - public function getFile(); - - /** - * Gets font's integer point size - * - * @return integer - */ - public function getSize(); - - /** - * Gets font's color - * - * @return ColorInterface - */ - public function getColor(); - - /** - * Gets BoxInterface of font size on the image based on string and angle - * - * @param string $string - * @param integer $angle - * - * @return BoxInterface - */ - public function box($string, $angle = 0); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Bucket.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Bucket.php deleted file mode 100644 index 34dad5eedc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Bucket.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Histogram; - -/** - * Bucket histogram - */ -final class Bucket implements \Countable -{ - /** - * @var Range - */ - private $range; - - /** - * @var integer - */ - private $count; - - /** - * @param Range $range - * @param integer $count - */ - public function __construct(Range $range, $count = 0) - { - $this->range = $range; - $this->count = $count; - } - - /** - * @param integer $value - */ - public function add($value) - { - if ($this->range->contains($value)) { - $this->count++; - } - } - - /** - * @return integer The number of elements in the bucket. - */ - public function count() - { - return $this->count; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Range.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Range.php deleted file mode 100644 index 9dc9f9928e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Histogram/Range.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Histogram; - -use Imagine\Exception\OutOfBoundsException; - -/** - * Range histogram - */ -final class Range -{ - /** - * @var integer - */ - private $start; - - /** - * @var integer - */ - private $end; - - /** - * @param integer $start - * @param integer $end - * - * @throws OutOfBoundsException - */ - public function __construct($start, $end) - { - if ($end <= $start) { - throw new OutOfBoundsException(sprintf('Range end cannot be bigger than start, %d %d given accordingly', $this->start, $this->end)); - } - - $this->start = $start; - $this->end = $end; - } - - /** - * @param integer $value - * - * @return Boolean - */ - public function contains($value) - { - return $value >= $this->start && $value < $this->end; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImageInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImageInterface.php deleted file mode 100644 index 6cf1dd87d6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImageInterface.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Draw\DrawerInterface; -use Imagine\Effects\EffectsInterface; -use Imagine\Image\Palette\PaletteInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Exception\RuntimeException; -use Imagine\Exception\OutOfBoundsException; - -/** - * The image interface - */ -interface ImageInterface extends ManipulatorInterface -{ - const RESOLUTION_PIXELSPERINCH = 'ppi'; - const RESOLUTION_PIXELSPERCENTIMETER = 'ppc'; - - const INTERLACE_NONE = 'none'; - const INTERLACE_LINE = 'line'; - const INTERLACE_PLANE = 'plane'; - const INTERLACE_PARTITION = 'partition'; - - const FILTER_UNDEFINED = 'undefined'; - const FILTER_POINT = 'point'; - const FILTER_BOX = 'box'; - const FILTER_TRIANGLE = 'triangle'; - const FILTER_HERMITE = 'hermite'; - const FILTER_HANNING = 'hanning'; - const FILTER_HAMMING = 'hamming'; - const FILTER_BLACKMAN = 'blackman'; - const FILTER_GAUSSIAN = 'gaussian'; - const FILTER_QUADRATIC = 'quadratic'; - const FILTER_CUBIC = 'cubic'; - const FILTER_CATROM = 'catrom'; - const FILTER_MITCHELL = 'mitchell'; - const FILTER_LANCZOS = 'lanczos'; - const FILTER_BESSEL = 'bessel'; - const FILTER_SINC = 'sinc'; - - /** - * Returns the image content as a binary string - * - * @param string $format - * @param array $options - * - * @throws RuntimeException - * - * @return string binary - */ - public function get($format, array $options = array()); - - /** - * Returns the image content as a PNG binary string - * - * @throws RuntimeException - * - * @return string binary - */ - public function __toString(); - - /** - * Instantiates and returns a DrawerInterface instance for image drawing - * - * @return DrawerInterface - */ - public function draw(); - - /** - * @return EffectsInterface - */ - public function effects(); - - /** - * Returns current image size - * - * @return BoxInterface - */ - public function getSize(); - - /** - * Transforms creates a grayscale mask from current image, returns a new - * image, while keeping the existing image unmodified - * - * @return ImageInterface - */ - public function mask(); - - /** - * Returns array of image colors as Imagine\Image\Palette\Color\ColorInterface instances - * - * @return array - */ - public function histogram(); - - /** - * Returns color at specified positions of current image - * - * @param PointInterface $point - * - * @throws RuntimeException - * - * @return ColorInterface - */ - public function getColorAt(PointInterface $point); - - /** - * Returns the image layers when applicable. - * - * @throws RuntimeException In case the layer can not be returned - * @throws OutOfBoundsException In case the index is not a valid value - * - * @return LayersInterface - */ - public function layers(); - - /** - * Enables or disables interlacing - * - * @param string $scheme - * - * @throws InvalidArgumentException When an unsupported Interface type is supplied - * - * @return ImageInterface - */ - public function interlace($scheme); - - /** - * Return the current color palette - * - * @return PaletteInterface - */ - public function palette(); - - /** - * Set a palette for the image. Useful to change colorspace. - * - * @param PaletteInterface $palette - * - * @return ImageInterface - * - * @throws RuntimeException - */ - public function usePalette(PaletteInterface $palette); - - /** - * Applies a color profile on the Image - * - * @param ProfileInterface $profile - * - * @return ImageInterface - * - * @throws RuntimeException - */ - public function profile(ProfileInterface $profile); - - /** - * Returns the Image's meta data - * - * @return Metadata\MetadataInterface - */ - public function metadata(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImagineInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImagineInterface.php deleted file mode 100644 index b5c942c73d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ImagineInterface.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; - -/** - * The imagine interface - */ -interface ImagineInterface -{ - const VERSION = '0.7-dev'; - - /** - * Creates a new empty image with an optional background color - * - * @param BoxInterface $size - * @param ColorInterface $color - * - * @throws InvalidArgumentException - * @throws RuntimeException - * - * @return ImageInterface - */ - public function create(BoxInterface $size, ColorInterface $color = null); - - /** - * Opens an existing image from $path - * - * @param string $path - * - * @throws RuntimeException - * - * @return ImageInterface - */ - public function open($path); - - /** - * Loads an image from a binary $string - * - * @param string $string - * - * @throws RuntimeException - * - * @return ImageInterface - */ - public function load($string); - - /** - * Loads an image from a resource $resource - * - * @param resource $resource - * - * @throws RuntimeException - * - * @return ImageInterface - */ - public function read($resource); - - /** - * Constructs a font with specified $file, $size and $color - * - * The font size is to be specified in points (e.g. 10pt means 10) - * - * @param string $file - * @param integer $size - * @param ColorInterface $color - * - * @return FontInterface - */ - public function font($file, $size, ColorInterface $color); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/LayersInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/LayersInterface.php deleted file mode 100644 index 44df423697..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/LayersInterface.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\RuntimeException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\OutOfBoundsException; - -/** - * The layers interface - */ -interface LayersInterface extends \Iterator, \Countable, \ArrayAccess -{ - /** - * Merge layers into the original objects - * - * @throws RuntimeException - */ - public function merge(); - - /** - * Animates layers - * - * @param string $format The output output format - * @param integer $delay The delay in milliseconds between two frames - * @param integer $loops The number of loops, 0 means infinite - * - * @return LayersInterface - * - * @throws InvalidArgumentException In case an invalid argument is provided - * @throws RuntimeException In case the driver fails to animate - */ - public function animate($format, $delay, $loops); - - /** - * Coalesce layers. Each layer in the sequence is the same size as the first and composited with the next layer in - * the sequence. - */ - public function coalesce(); - - /** - * Adds an image at the end of the layers stack - * - * @param ImageInterface $image - * - * @return LayersInterface - * - * @throws RuntimeException - */ - public function add(ImageInterface $image); - - /** - * Set an image at offset - * - * @param integer $offset - * @param ImageInterface $image - * - * @return LayersInterface - * - * @throws RuntimeException - * @throws InvalidArgumentException - * @throws OutOfBoundsException - */ - public function set($offset, ImageInterface $image); - - /** - * Removes the image at offset - * - * @param integer $offset - * - * @return LayersInterface - * - * @throws RuntimeException - * @throws InvalidArgumentException - */ - public function remove($offset); - - /** - * Returns the image at offset - * - * @param integer $offset - * - * @return ImageInterface - * - * @throws RuntimeException - * @throws InvalidArgumentException - */ - public function get($offset); - - /** - * Returns true if a layer at offset is preset - * - * @param integer $offset - * - * @return Boolean - */ - public function has($offset); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ManipulatorInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/ManipulatorInterface.php deleted file mode 100644 index 392b90828c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ManipulatorInterface.php +++ /dev/null @@ -1,181 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; - -/** - * The manipulator interface - */ -interface ManipulatorInterface -{ - const THUMBNAIL_INSET = 'inset'; - const THUMBNAIL_OUTBOUND = 'outbound'; - - /** - * Copies current source image into a new ImageInterface instance - * - * @throws RuntimeException - * - * @return static - */ - public function copy(); - - /** - * Crops a specified box out of the source image (modifies the source image) - * Returns cropped self - * - * @param PointInterface $start - * @param BoxInterface $size - * - * @throws OutOfBoundsException - * @throws RuntimeException - * - * @return static - */ - public function crop(PointInterface $start, BoxInterface $size); - - /** - * Resizes current image and returns self - * - * @param BoxInterface $size - * @param string $filter - * - * @throws RuntimeException - * - * @return static - */ - public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED); - - /** - * Rotates an image at the given angle. - * Optional $background can be used to specify the fill color of the empty - * area of rotated image. - * - * @param integer $angle - * @param ColorInterface $background - * - * @throws RuntimeException - * - * @return static - */ - public function rotate($angle, ColorInterface $background = null); - - /** - * Pastes an image into a parent image - * Throws exceptions if image exceeds parent image borders or if paste - * operation fails - * - * Returns source image - * - * @param ImageInterface $image - * @param PointInterface $start - * - * @throws InvalidArgumentException - * @throws OutOfBoundsException - * @throws RuntimeException - * - * @return static - */ - public function paste(ImageInterface $image, PointInterface $start); - - /** - * Saves the image at a specified path, the target file extension is used - * to determine file format, only jpg, jpeg, gif, png, wbmp and xbm are - * supported - * - * @param string $path - * @param array $options - * - * @throws RuntimeException - * - * @return static - */ - public function save($path = null, array $options = array()); - - /** - * Outputs the image content - * - * @param string $format - * @param array $options - * - * @throws RuntimeException - * - * @return static - */ - public function show($format, array $options = array()); - - /** - * Flips current image using horizontal axis - * - * @throws RuntimeException - * - * @return static - */ - public function flipHorizontally(); - - /** - * Flips current image using vertical axis - * - * @throws RuntimeException - * - * @return static - */ - public function flipVertically(); - - /** - * Remove all profiles and comments - * - * @throws RuntimeException - * - * @return static - */ - public function strip(); - - /** - * Generates a thumbnail from a current image - * Returns it as a new image, doesn't modify the current image - * - * @param BoxInterface $size - * @param string $mode - * @param string $filter The filter to use for resizing, one of ImageInterface::FILTER_* - * - * @throws RuntimeException - * - * @return static - */ - public function thumbnail(BoxInterface $size, $mode = self::THUMBNAIL_INSET, $filter = ImageInterface::FILTER_UNDEFINED); - - /** - * Applies a given mask to current image's alpha channel - * - * @param ImageInterface $mask - * - * @return static - */ - public function applyMask(ImageInterface $mask); - - /** - * Fills image with provided filling, by replacing each pixel's color in - * the current image with corresponding color from FillInterface, and - * returns modified image - * - * @param FillInterface $fill - * - * @return static - */ - public function fill(FillInterface $fill); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/AbstractMetadataReader.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/AbstractMetadataReader.php deleted file mode 100644 index a709655bef..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/AbstractMetadataReader.php +++ /dev/null @@ -1,101 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Metadata; - -use Imagine\Exception\InvalidArgumentException; - -abstract class AbstractMetadataReader implements MetadataReaderInterface -{ - /** - * {@inheritdoc} - */ - public function readFile($file) - { - if (stream_is_local($file)) { - if (!is_file($file)) { - throw new InvalidArgumentException(sprintf('File %s does not exist.', $file)); - } - - return new MetadataBag(array_merge(array('filepath' => realpath($file), 'uri' => $file), $this->extractFromFile($file))); - } - - return new MetadataBag(array_merge(array('uri' => $file), $this->extractFromFile($file))); - } - - /** - * {@inheritdoc} - */ - public function readData($data) - { - return new MetadataBag($this->extractFromData($data)); - } - - /** - * {@inheritdoc} - */ - public function readStream($resource) - { - if (!is_resource($resource)) { - throw new InvalidArgumentException('Invalid resource provided.'); - } - - return new MetadataBag(array_merge($this->getStreamMetadata($resource), $this->extractFromStream($resource))); - } - - /** - * Gets the URI from a stream resource - * - * @param resource $resource - * - * @return string|null The URI f ava - */ - private function getStreamMetadata($resource) - { - $metadata = array(); - - if (false !== $data = @stream_get_meta_data($resource)) { - $metadata['uri'] = $data['uri']; - if (stream_is_local($resource)) { - $metadata['filepath'] = realpath($data['uri']); - } - } - - return $metadata; - } - - /** - * Extracts metadata from a file - * - * @param $file - * - * @return array An associative array of metadata - */ - abstract protected function extractFromFile($file); - - /** - * Extracts metadata from raw data - * - * @param $data - * - * @return array An associative array of metadata - */ - abstract protected function extractFromData($data); - - /** - * Extracts metadata from a stream - * - * @param $resource - * - * @return array An associative array of metadata - */ - abstract protected function extractFromStream($resource); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/DefaultMetadataReader.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/DefaultMetadataReader.php deleted file mode 100644 index 349366e06b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/DefaultMetadataReader.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Metadata; - -/** - * Default metadata reader - */ -class DefaultMetadataReader extends AbstractMetadataReader -{ - /** - * {@inheritdoc} - */ - protected function extractFromFile($file) - { - return array(); - } - - /** - * {@inheritdoc} - */ - protected function extractFromData($data) - { - return array(); - } - - /** - * {@inheritdoc} - */ - protected function extractFromStream($resource) - { - return array(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/ExifMetadataReader.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/ExifMetadataReader.php deleted file mode 100644 index dd8e7d0934..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/ExifMetadataReader.php +++ /dev/null @@ -1,114 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Metadata; - -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\NotSupportedException; - -/** - * Metadata driven by Exif information - */ -class ExifMetadataReader extends AbstractMetadataReader -{ - public function __construct() - { - if (!self::isSupported()) { - throw new NotSupportedException('PHP exif extension is required to use the ExifMetadataReader'); - } - } - - public static function isSupported() - { - return function_exists('exif_read_data'); - } - - /** - * {@inheritdoc} - */ - protected function extractFromFile($file) - { - if (false === $data = @file_get_contents($file)) { - throw new InvalidArgumentException(sprintf('File %s is not readable.', $file)); - } - - return $this->doReadData($data); - } - - /** - * {@inheritdoc} - */ - protected function extractFromData($data) - { - return $this->doReadData($data); - } - - /** - * {@inheritdoc} - */ - protected function extractFromStream($resource) - { - if (0 < ftell($resource)) { - $metadata = stream_get_meta_data($resource); - if ($metadata['seekable']) { - rewind($resource); - } - } - - return $this->doReadData(stream_get_contents($resource)); - } - - /** - * Extracts metadata from raw data, merges with existing metadata - * - * @param string $data - * - * @return MetadataBag - */ - private function doReadData($data) - { - if (substr($data, 0, 2) === 'II') { - $mime = 'image/tiff'; - } else { - $mime = 'image/jpeg'; - } - - return $this->extract('data://' . $mime . ';base64,' . base64_encode($data)); - } - - /** - * Performs the exif data extraction given a path or data-URI representation. - * - * @param string $path The path to the file or the data-URI representation. - * - * @return MetadataBag - */ - private function extract($path) - { - if (false === $exifData = @exif_read_data($path, null, true, false)) { - return array(); - } - - $metadata = array(); - $sources = array('EXIF' => 'exif', 'IFD0' => 'ifd0'); - - foreach ($sources as $name => $prefix) { - if (!isset($exifData[$name])) { - continue; - } - foreach ($exifData[$name] as $prop => $value) { - $metadata[$prefix.'.'.$prop] = $value; - } - } - - return $metadata; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataBag.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataBag.php deleted file mode 100644 index b7e917a387..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataBag.php +++ /dev/null @@ -1,97 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Metadata; - -/** - * An interface for Image Metadata - */ -class MetadataBag implements \ArrayAccess, \IteratorAggregate, \Countable -{ - /** @var array */ - private $data; - - public function __construct(array $data = array()) - { - $this->data = $data; - } - - /** - * Returns the metadata key, default value if it does not exist - * - * @param string $key - * @param mixed|null $default - * - * @return mixed - */ - public function get($key, $default = null) - { - return array_key_exists($key, $this->data) ? $this->data[$key] : $default; - } - - /** - * {@inheritdoc} - */ - public function count() - { - return count($this->data); - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - return new \ArrayIterator($this->data); - } - - /** - * {@inheritdoc} - */ - public function offsetExists($offset) - { - return array_key_exists($offset, $this->data); - } - - /** - * {@inheritdoc} - */ - public function offsetSet($offset, $value) - { - $this->data[$offset] = $value; - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($offset) - { - unset($this->data[$offset]); - } - - /** - * {@inheritdoc} - */ - public function offsetGet($offset) - { - return $this->get($offset); - } - - /** - * Returns metadata as an array - * - * @return array An associative array - */ - public function toArray() - { - return $this->data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataReaderInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataReaderInterface.php deleted file mode 100644 index 62fcc88174..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Metadata/MetadataReaderInterface.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Metadata; - -use Imagine\Exception\InvalidArgumentException; - -interface MetadataReaderInterface -{ - /** - * Reads metadata from a file. - * - * @param $file The path to the file where to read metadata. - * - * @throws InvalidArgumentException In case the file does not exist. - * - * @return MetadataBag - */ - public function readFile($file); - - /** - * Reads metadata from a binary string. - * - * @param $data The binary string to read. - * - * @return MetadataBag - */ - public function readData($data); - - /** - * Reads metadata from a stream. - * - * @param $resource The stream to read. - * - * @throws InvalidArgumentException In case the resource is not valid. - * - * @return MetadataBag - */ - public function readStream($resource); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/CMYK.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/CMYK.php deleted file mode 100644 index 2beecf28a9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/CMYK.php +++ /dev/null @@ -1,118 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette; - -use Imagine\Image\Palette\Color\CMYK as CMYKColor; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Exception\RuntimeException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Image\Profile; -use Imagine\Image\ProfileInterface; - -class CMYK implements PaletteInterface -{ - private $parser; - private $profile; - private static $colors = array(); - - public function __construct() - { - $this->parser = new ColorParser(); - } - - /** - * {@inheritdoc} - */ - public function name() - { - return PaletteInterface::PALETTE_CMYK; - } - - /** - * {@inheritdoc} - */ - public function pixelDefinition() - { - return array( - ColorInterface::COLOR_CYAN, - ColorInterface::COLOR_MAGENTA, - ColorInterface::COLOR_YELLOW, - ColorInterface::COLOR_KEYLINE, - ); - } - - /** - * {@inheritdoc} - */ - public function supportsAlpha() - { - return false; - } - - /** - * {@inheritdoc} - */ - public function color($color, $alpha = null) - { - if (null !== $alpha) { - throw new InvalidArgumentException('CMYK palette does not support alpha'); - } - - $color = $this->parser->parseToCMYK($color); - $index = sprintf('cmyk(%d, %d, %d, %d)', $color[0], $color[1], $color[2], $color[3]); - - if (false === array_key_exists($index, self::$colors)) { - self::$colors[$index] = new CMYKColor($this, $color); - } - - return self::$colors[$index]; - } - - /** - * {@inheritdoc} - */ - public function blend(ColorInterface $color1, ColorInterface $color2, $amount) - { - if (!$color1 instanceof CMYKColor || ! $color2 instanceof CMYKColor) { - throw new RuntimeException('CMYK palette can only blend CMYK colors'); - } - - return $this->color(array( - min(100, $color1->getCyan() + $color2->getCyan() * $amount), - min(100, $color1->getMagenta() + $color2->getMagenta() * $amount), - min(100, $color1->getYellow() + $color2->getYellow() * $amount), - min(100, $color1->getKeyline() + $color2->getKeyline() * $amount), - )); - } - - /** - * {@inheritdoc} - */ - public function useProfile(ProfileInterface $profile) - { - $this->profile = $profile; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function profile() - { - if (!$this->profile) { - $this->profile = Profile::fromPath(__DIR__ . '/../../resources/Adobe/CMYK/USWebUncoated.icc'); - } - - return $this->profile; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/CMYK.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/CMYK.php deleted file mode 100644 index 3165433551..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/CMYK.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette\Color; - -use Imagine\Image\Palette\CMYK as CMYKPalette; -use Imagine\Exception\RuntimeException; -use Imagine\Exception\InvalidArgumentException; - -final class CMYK implements ColorInterface -{ - /** - * @var integer - */ - private $c; - - /** - * @var integer - */ - private $m; - - /** - * @var integer - */ - private $y; - - /** - * @var integer - */ - private $k; - - /** - * - * @var CMYK - */ - private $palette; - - public function __construct(CMYKPalette $palette, array $color) - { - $this->palette = $palette; - $this->setColor($color); - } - - /** - * {@inheritdoc} - */ - public function getValue($component) - { - switch ($component) { - case ColorInterface::COLOR_CYAN: - return $this->getCyan(); - case ColorInterface::COLOR_MAGENTA: - return $this->getMagenta(); - case ColorInterface::COLOR_YELLOW: - return $this->getYellow(); - case ColorInterface::COLOR_KEYLINE: - return $this->getKeyline(); - default: - throw new InvalidArgumentException(sprintf('Color component %s is not valid', $component)); - } - } - - /** - * Returns Cyan value of the color - * - * @return integer - */ - public function getCyan() - { - return $this->c; - } - - /** - * Returns Magenta value of the color - * - * @return integer - */ - public function getMagenta() - { - return $this->m; - } - - /** - * Returns Yellow value of the color - * - * @return integer - */ - public function getYellow() - { - return $this->y; - } - - /** - * Returns Key value of the color - * - * @return integer - */ - public function getKeyline() - { - return $this->k; - } - - /** - * {@inheritdoc} - */ - public function getPalette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function getAlpha() - { - return null; - } - - /** - * {@inheritdoc} - */ - public function dissolve($alpha) - { - throw new RuntimeException('CMYK does not support dissolution'); - } - - /** - * {@inheritdoc} - */ - public function lighten($shade) - { - return $this->palette->color( - array( - $this->c, - $this->m, - $this->y, - max(0, $this->k - $shade), - ) - ); - } - - /** - * {@inheritdoc} - */ - public function darken($shade) - { - return $this->palette->color( - array( - $this->c, - $this->m, - $this->y, - min(100, $this->k + $shade), - ) - ); - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - $color = array( - $this->c * (1 - $this->k / 100) + $this->k, - $this->m * (1 - $this->k / 100) + $this->k, - $this->y * (1 - $this->k / 100) + $this->k, - ); - - $gray = min(100, round(0.299 * $color[0] + 0.587 * $color[1] + 0.114 * $color[2])); - - return $this->palette->color(array($gray, $gray, $gray, $this->k)); - } - - /** - * {@inheritdoc} - */ - public function isOpaque() - { - return true; - } - - /** - * Returns hex representation of the color - * - * @return string - */ - public function __toString() - { - return sprintf('cmyk(%d%%, %d%%, %d%%, %d%%)', $this->c, $this->m, $this->y, $this->k); - } - - /** - * Internal, Performs checks for color validity (an of array(C, M, Y, K)) - * - * @param array $color - * - * @throws InvalidArgumentException - */ - private function setColor(array $color) - { - if (count($color) !== 4) { - throw new InvalidArgumentException('Color argument must look like array(C, M, Y, K), where C, M, Y, K are the integer values between 0 and 255 for cyan, magenta, yellow and black color indexes accordingly'); - } - - $colors = array_values($color); - array_walk($colors, function ($color) { - return max(0, min(100, $color)); - }); - - list($this->c, $this->m, $this->y, $this->k) = $colors; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/ColorInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/ColorInterface.php deleted file mode 100644 index 8784c4ed3e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/ColorInterface.php +++ /dev/null @@ -1,95 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette\Color; - -use Imagine\Image\Palette\PaletteInterface; - -interface ColorInterface -{ - const COLOR_RED = 'red'; - const COLOR_GREEN = 'green'; - const COLOR_BLUE = 'blue'; - - const COLOR_CYAN = 'cyan'; - const COLOR_MAGENTA = 'magenta'; - const COLOR_YELLOW = 'yellow'; - const COLOR_KEYLINE = 'keyline'; - - const COLOR_GRAY = 'gray'; - - /** - * Return the value of one of the component. - * - * @param string $component One of the ColorInterface::COLOR_* component - * - * @return Integer - */ - public function getValue($component); - - /** - * Returns percentage of transparency of the color - * - * @return integer - */ - public function getAlpha(); - - /** - * Returns the palette attached to the current color - * - * @return PaletteInterface - */ - public function getPalette(); - - /** - * Returns a copy of current color, incrementing the alpha channel by the - * given amount - * - * @param integer $alpha - * - * @return ColorInterface - */ - public function dissolve($alpha); - - /** - * Returns a copy of the current color, lightened by the specified number - * of shades - * - * @param integer $shade - * - * @return ColorInterface - */ - public function lighten($shade); - - /** - * Returns a copy of the current color, darkened by the specified number of - * shades - * - * @param integer $shade - * - * @return ColorInterface - */ - public function darken($shade); - - /** - * Returns a gray related to the current color - * - * @return ColorInterface - */ - public function grayscale(); - - /** - * Checks if the current color is opaque - * - * @return Boolean - */ - public function isOpaque(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/Gray.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/Gray.php deleted file mode 100644 index c8096450fc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/Gray.php +++ /dev/null @@ -1,164 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette\Color; - -use Imagine\Image\Palette\Grayscale; -use Imagine\Exception\InvalidArgumentException; - -final class Gray implements ColorInterface -{ - /** - * @var integer - */ - private $gray; - - /** - * @var integer - */ - private $alpha; - - /** - * - * @var Grayscale - */ - private $palette; - - public function __construct(Grayscale $palette, array $color, $alpha) - { - $this->palette = $palette; - $this->setColor($color); - $this->setAlpha($alpha); - } - - /** - * {@inheritdoc} - */ - public function getValue($component) - { - switch ($component) { - case ColorInterface::COLOR_GRAY: - return $this->getGray(); - default: - throw new InvalidArgumentException(sprintf('Color component %s is not valid', $component)); - } - } - - /** - * Returns Gray value of the color - * - * @return integer - */ - public function getGray() - { - return $this->gray; - } - - /** - * {@inheritdoc} - */ - public function getPalette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function getAlpha() - { - return $this->alpha; - } - - /** - * {@inheritdoc} - */ - public function dissolve($alpha) - { - return $this->palette->color( - array($this->gray), $this->alpha + $alpha - ); - } - - /** - * {@inheritdoc} - */ - public function lighten($shade) - { - return $this->palette->color(array(min(255, $this->gray + $shade)), $this->alpha); - } - - /** - * {@inheritdoc} - */ - public function darken($shade) - { - return $this->palette->color(array(max(0, $this->gray - $shade)), $this->alpha); - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - return $this; - } - - /** - * {@inheritdoc} - */ - public function isOpaque() - { - return 100 === $this->alpha; - } - - /** - * Returns hex representation of the color - * - * @return string - */ - public function __toString() - { - return sprintf('#%02x%02x%02x', $this->gray, $this->gray, $this->gray); - } - - /** - * Performs checks for validity of given alpha value and sets it - * - * @param integer $alpha - * - * @throws InvalidArgumentException - */ - private function setAlpha($alpha) - { - if (!is_int($alpha) || $alpha < 0 || $alpha > 100) { - throw new InvalidArgumentException(sprintf('Alpha must be an integer between 0 and 100, %s given', $alpha)); - } - - $this->alpha = $alpha; - } - - /** - * Performs checks for color validity (array of array(gray)) - * - * @param array $color - * - * @throws InvalidArgumentException - */ - private function setColor(array $color) - { - if (count($color) !== 1) { - throw new InvalidArgumentException('Color argument must look like array(gray), where gray is the integer value between 0 and 255 for the grayscale'); - } - - list($this->gray) = array_values($color); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/RGB.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/RGB.php deleted file mode 100644 index a0b4f0d017..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Color/RGB.php +++ /dev/null @@ -1,214 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette\Color; - -use Imagine\Image\Palette\RGB as RGBPalette; -use Imagine\Exception\InvalidArgumentException; - -final class RGB implements ColorInterface -{ - /** - * @var integer - */ - private $r; - - /** - * @var integer - */ - private $g; - - /** - * @var integer - */ - private $b; - - /** - * @var integer - */ - private $alpha; - - /** - * - * @var RGBPalette - */ - private $palette; - - public function __construct(RGBPalette $palette, array $color, $alpha) - { - $this->palette = $palette; - $this->setColor($color); - $this->setAlpha($alpha); - } - - /** - * {@inheritdoc} - */ - public function getValue($component) - { - switch ($component) { - case ColorInterface::COLOR_RED: - return $this->getRed(); - case ColorInterface::COLOR_GREEN: - return $this->getGreen(); - case ColorInterface::COLOR_BLUE: - return $this->getBlue(); - default: - throw new InvalidArgumentException(sprintf('Color component %s is not valid', $component)); - } - } - - /** - * Returns RED value of the color - * - * @return integer - */ - public function getRed() - { - return $this->r; - } - - /** - * Returns GREEN value of the color - * - * @return integer - */ - public function getGreen() - { - return $this->g; - } - - /** - * Returns BLUE value of the color - * - * @return integer - */ - public function getBlue() - { - return $this->b; - } - - /** - * {@inheritdoc} - */ - public function getPalette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function getAlpha() - { - return $this->alpha; - } - - /** - * {@inheritdoc} - */ - public function dissolve($alpha) - { - return $this->palette->color(array($this->r, $this->g, $this->b), $this->alpha + $alpha); - } - - /** - * {@inheritdoc} - */ - public function lighten($shade) - { - return $this->palette->color( - array( - min(255, $this->r + $shade), - min(255, $this->g + $shade), - min(255, $this->b + $shade), - ), $this->alpha - ); - } - - /** - * {@inheritdoc} - */ - public function darken($shade) - { - return $this->palette->color( - array( - max(0, $this->r - $shade), - max(0, $this->g - $shade), - max(0, $this->b - $shade), - ), $this->alpha - ); - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - $gray = min(255, round(0.299 * $this->getRed() + 0.114 * $this->getBlue() + 0.587 * $this->getGreen())); - - return $this->palette->color(array($gray, $gray, $gray), $this->alpha); - } - - /** - * {@inheritdoc} - */ - public function isOpaque() - { - return 100 === $this->alpha; - } - - /** - * Returns hex representation of the color - * - * @return string - */ - public function __toString() - { - return sprintf('#%02x%02x%02x', $this->r, $this->g, $this->b); - } - - /** - * Internal - * - * Performs checks for validity of given alpha value and sets it - * - * @param integer $alpha - * - * @throws InvalidArgumentException - */ - private function setAlpha($alpha) - { - if (!is_int($alpha) || $alpha < 0 || $alpha > 100) { - throw new InvalidArgumentException(sprintf('Alpha must be an integer between 0 and 100, %s given', $alpha)); - } - - $this->alpha = $alpha; - } - - /** - * Internal - * - * Performs checks for color validity (array of array(R, G, B)) - * - * @param array $color - * - * @throws InvalidArgumentException - */ - private function setColor(array $color) - { - if (count($color) !== 3) { - throw new InvalidArgumentException('Color argument must look like array(R, G, B), where R, G, B are the integer values between 0 and 255 for red, green and blue color indexes accordingly'); - } - - list($this->r, $this->g, $this->b) = array_values($color); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/ColorParser.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/ColorParser.php deleted file mode 100644 index 35cf4e9523..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/ColorParser.php +++ /dev/null @@ -1,153 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette; - -use Imagine\Exception\InvalidArgumentException; - -class ColorParser -{ - /** - * Parses a color to a RGB tuple - * - * @param string|array|integer $color - * - * @return array - * - * @throws InvalidArgumentException - */ - public function parseToRGB($color) - { - $color = $this->parse($color); - - if (4 === count($color)) { - $color = array( - 255 * (1 - $color[0] / 100) * (1 - $color[3] / 100), - 255 * (1 - $color[1] / 100) * (1 - $color[3] / 100), - 255 * (1 - $color[2] / 100) * (1 - $color[3] / 100), - ); - } - - return $color; - } - - /** - * Parses a color to a CMYK tuple - * - * @param string|array|integer $color - * - * @return array - * - * @throws InvalidArgumentException - */ - public function parseToCMYK($color) - { - $color = $this->parse($color); - - if (3 === count($color)) { - $r = $color[0] / 255; - $g = $color[1] / 255; - $b = $color[2] / 255; - - $k = 1 - max($r, $g, $b); - - $color = array( - 1 === $k ? 0 : round((1 - $r - $k) / (1- $k) * 100), - 1 === $k ? 0 : round((1 - $g - $k) / (1- $k) * 100), - 1 === $k ? 0 : round((1 - $b - $k) / (1- $k) * 100), - round($k * 100) - ); - } - - return $color; - } - - /** - * Parses a color to a grayscale value - * - * @param string|array|integer $color - * - * @return array - * - * @throws InvalidArgumentException - */ - public function parseToGrayscale($color) - { - if (is_array($color) && 1 === count($color)) { - return array_values($color); - } - - $color = array_unique($this->parse($color)); - - if (1 !== count($color)) { - throw new InvalidArgumentException('The provided color has different values of red, green and blue components. Grayscale colors must have the same values for these.'); - } - - return $color; - } - - /** - * Parses a color - * - * @param string|array|integer $color - * - * @return array - * - * @throws InvalidArgumentException - */ - private function parse($color) - { - if (!is_string($color) && !is_array($color) && !is_int($color)) { - throw new InvalidArgumentException(sprintf('Color must be specified as a hexadecimal string, array or integer, %s given', gettype($color))); - } - - if (is_array($color)) { - if (3 === count($color) || 4 === count($color)) { - return array_values($color); - } - throw new InvalidArgumentException('Color argument if array, must look like array(R, G, B), or array(C, M, Y, K) where R, G, B are the integer values between 0 and 255 for red, green and blue or cyan, magenta, yellow and black color indexes accordingly'); - } - - if (is_string($color)) { - if (0 === strpos($color, 'cmyk(')) { - $substrColor = substr($color, 5, strlen($color) - 6); - - $components = array_map(function ($component) { - return round(trim($component, ' %')); - }, explode(',', $substrColor)); - - if (count($components) !== 4) { - throw new InvalidArgumentException(sprintf('Unable to parse color %s', $color)); - } - - return $components; - } else { - $color = ltrim($color, '#'); - - if (strlen($color) !== 3 && strlen($color) !== 6) { - throw new InvalidArgumentException(sprintf('Color must be a hex value in regular (6 characters) or short (3 characters) notation, "%s" given', $color)); - } - - if (strlen($color) === 3) { - $color = $color[0] . $color[0] . $color[1] . $color[1] . $color[2] . $color[2]; - } - - $color = array_map('hexdec', str_split($color, 2)); - } - } - - if (is_int($color)) { - $color = array(255 & ($color >> 16), 255 & ($color >> 8), 255 & $color); - } - - return $color; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Grayscale.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Grayscale.php deleted file mode 100644 index 088b7909af..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/Grayscale.php +++ /dev/null @@ -1,123 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette; - -use Imagine\Image\Palette\Color\Gray as GrayColor; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\ProfileInterface; -use Imagine\Image\Profile; -use Imagine\Exception\RuntimeException; - -class Grayscale implements PaletteInterface -{ - /** - * @var ColorParser - */ - private $parser; - - /** - * @var ProfileInterface - */ - private $profile; - - /** - * @var array - */ - protected static $colors = array(); - - public function __construct() - { - $this->parser = new ColorParser(); - } - - /** - * {@inheritdoc} - */ - public function name() - { - return PaletteInterface::PALETTE_GRAYSCALE; - } - - /** - * {@inheritdoc} - */ - public function pixelDefinition() - { - return array(ColorInterface::COLOR_GRAY); - } - - /** - * {@inheritdoc} - */ - public function supportsAlpha() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function useProfile(ProfileInterface $profile) - { - $this->profile = $profile; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function profile() - { - if (!$this->profile) { - $this->profile = Profile::fromPath(__DIR__ . '/../../resources/colormanagement.org/ISOcoated_v2_grey1c_bas.ICC'); - } - - return $this->profile; - } - - /** - * {@inheritdoc} - */ - public function color($color, $alpha = null) - { - if (null === $alpha) { - $alpha = 0; - } - - $color = $this->parser->parseToGrayscale($color); - $index = sprintf('#%02x%02x%02x-%d', $color[0], $color[0], $color[0], $alpha); - - if (false === array_key_exists($index, static::$colors)) { - static::$colors[$index] = new GrayColor($this, $color, $alpha); - } - - return static::$colors[$index]; - } - - /** - * {@inheritdoc} - */ - public function blend(ColorInterface $color1, ColorInterface $color2, $amount) - { - if (!$color1 instanceof GrayColor || ! $color2 instanceof GrayColor) { - throw new RuntimeException('Grayscale palette can only blend Grayscale colors'); - } - - return $this->color( - array( - (int) min(255, min($color1->getGray(), $color2->getGray()) + round(abs($color2->getGray() - $color1->getGray()) * $amount)), - ), - (int) min(100, min($color1->getAlpha(), $color2->getAlpha()) + round(abs($color2->getAlpha() - $color1->getAlpha()) * $amount)) - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/PaletteInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/PaletteInterface.php deleted file mode 100644 index 855c244c41..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/PaletteInterface.php +++ /dev/null @@ -1,87 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette; - -use Imagine\Image\ProfileInterface; -use Imagine\Image\Palette\Color\ColorInterface; - -interface PaletteInterface -{ - const PALETTE_GRAYSCALE = 'gray'; - const PALETTE_RGB = 'rgb'; - const PALETTE_CMYK = 'cmyk'; - - /** - * Returns a color given some values - * - * @param string|array|integer $color A color - * @param integer|null $alpha Set alpha to null to disable it - * - * @return ColorInterface - * - * @throws InvalidArgumentException In case you pass an alpha value to a - * Palette that does not support alpha - */ - public function color($color, $alpha = null); - - /** - * Blend two colors given an amount - * - * @param ColorInterface $color1 - * @param ColorInterface $color2 - * @param float $amount The amount of color2 in color1 - * - * @return ColorInterface - */ - public function blend(ColorInterface $color1, ColorInterface $color2, $amount); - - /** - * Attachs an ICC profile to this Palette. - * - * (A default profile is provided by default) - * - * @param ProfileInterface $profile - * - * @return PaletteInterface - */ - public function useProfile(ProfileInterface $profile); - - /** - * Returns the ICC profile attached to this Palette. - * - * @return ProfileInterface - */ - public function profile(); - - /** - * Returns the name of this Palette, one of PaletteInterface::PALETTE_* - * constants - * - * @return String - */ - public function name(); - - /** - * Returns an array containing ColorInterface::COLOR_* constants that - * define the structure of colors for a pixel. - * - * @return array - */ - public function pixelDefinition(); - - /** - * Tells if alpha channel is supported in this palette - * - * @return Boolean - */ - public function supportsAlpha(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/RGB.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/RGB.php deleted file mode 100644 index 0462ca4daa..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Palette/RGB.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Palette; - -use Imagine\Image\Palette\Color\RGB as RGBColor; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\ProfileInterface; -use Imagine\Image\Profile; -use Imagine\Exception\RuntimeException; - -class RGB implements PaletteInterface -{ - /** - * @var ColorParser - */ - private $parser; - - /** - * @var ProfileInterface - */ - private $profile; - - /** - * @var array - */ - protected static $colors = array(); - - public function __construct() - { - $this->parser = new ColorParser(); - } - - /** - * {@inheritdoc} - */ - public function name() - { - return PaletteInterface::PALETTE_RGB; - } - - /** - * {@inheritdoc} - */ - public function pixelDefinition() - { - return array( - ColorInterface::COLOR_RED, - ColorInterface::COLOR_GREEN, - ColorInterface::COLOR_BLUE, - ); - } - - /** - * {@inheritdoc} - */ - public function supportsAlpha() - { - return true; - } - - /** - * {@inheritdoc} - */ - public function useProfile(ProfileInterface $profile) - { - $this->profile = $profile; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function profile() - { - if (!$this->profile) { - $this->profile = Profile::fromPath(__DIR__ . '/../../resources/color.org/sRGB_IEC61966-2-1_black_scaled.icc'); - } - - return $this->profile; - } - - /** - * {@inheritdoc} - */ - public function color($color, $alpha = null) - { - if (null === $alpha) { - $alpha = 100; - } - - $color = $this->parser->parseToRGB($color); - $index = sprintf('#%02x%02x%02x-%d', $color[0], $color[1], $color[2], $alpha); - - if (false === array_key_exists($index, static::$colors)) { - static::$colors[$index] = new RGBColor($this, $color, $alpha); - } - - return static::$colors[$index]; - } - - /** - * {@inheritdoc} - */ - public function blend(ColorInterface $color1, ColorInterface $color2, $amount) - { - if (!$color1 instanceof RGBColor || ! $color2 instanceof RGBColor) { - throw new RuntimeException('RGB palette can only blend RGB colors'); - } - - return $this->color( - array( - (int) min(255, min($color1->getRed(), $color2->getRed()) + round(abs($color2->getRed() - $color1->getRed()) * $amount)), - (int) min(255, min($color1->getGreen(), $color2->getGreen()) + round(abs($color2->getGreen() - $color1->getGreen()) * $amount)), - (int) min(255, min($color1->getBlue(), $color2->getBlue()) + round(abs($color2->getBlue() - $color1->getBlue()) * $amount)), - ), - (int) min(100, min($color1->getAlpha(), $color2->getAlpha()) + round(abs($color2->getAlpha() - $color1->getAlpha()) * $amount)) - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point.php deleted file mode 100644 index abfc7c3a8c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point.php +++ /dev/null @@ -1,88 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\InvalidArgumentException; - -/** - * The point class - */ -final class Point implements PointInterface -{ - /** - * @var integer - */ - private $x; - - /** - * @var integer - */ - private $y; - - /** - * Constructs a point of coordinates - * - * @param integer $x - * @param integer $y - * - * @throws InvalidArgumentException - */ - public function __construct($x, $y) - { - if ($x < 0 || $y < 0) { - throw new InvalidArgumentException(sprintf('A coordinate cannot be positioned outside of a bounding box (x: %s, y: %s given)', $x, $y)); - } - - $this->x = $x; - $this->y = $y; - } - - /** - * {@inheritdoc} - */ - public function getX() - { - return $this->x; - } - - /** - * {@inheritdoc} - */ - public function getY() - { - return $this->y; - } - - /** - * {@inheritdoc} - */ - public function in(BoxInterface $box) - { - return $this->x < $box->getWidth() && $this->y < $box->getHeight(); - } - - /** - * {@inheritdoc} - */ - public function move($amount) - { - return new Point($this->x + $amount, $this->y + $amount); - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('(%d, %d)', $this->x, $this->y); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point/Center.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point/Center.php deleted file mode 100644 index 0e60349e1a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Point/Center.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image\Point; - -use Imagine\Image\BoxInterface; -use Imagine\Image\Point as OriginalPoint; -use Imagine\Image\PointInterface; - -/** - * Point center - */ -final class Center implements PointInterface -{ - /** - * @var BoxInterface - */ - private $box; - - /** - * Constructs coordinate with size instance, it needs to be relative to - * - * @param BoxInterface $box - */ - public function __construct(BoxInterface $box) - { - $this->box = $box; - } - - /** - * {@inheritdoc} - */ - public function getX() - { - return ceil($this->box->getWidth() / 2); - } - - /** - * {@inheritdoc} - */ - public function getY() - { - return ceil($this->box->getHeight() / 2); - } - - /** - * {@inheritdoc} - */ - public function in(BoxInterface $box) - { - return $this->getX() < $box->getWidth() && $this->getY() < $box->getHeight(); - } - - /** - * {@inheritdoc} - */ - public function move($amount) - { - return new OriginalPoint($this->getX() + $amount, $this->getY() + $amount); - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return sprintf('(%d, %d)', $this->getX(), $this->getY()); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/PointInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/PointInterface.php deleted file mode 100644 index f35fa80da2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/PointInterface.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -/** - * The point interface - */ -interface PointInterface -{ - /** - * Gets points x coordinate - * - * @return integer - */ - public function getX(); - - /** - * Gets points y coordinate - * - * @return integer - */ - public function getY(); - - /** - * Checks if current coordinate is inside a given bo - * - * @param BoxInterface $box - * - * @return Boolean - */ - public function in(BoxInterface $box); - - /** - * Returns another point, moved by a given amount from current coordinates - * - * @param integer $amount - * @return ImageInterface - */ - public function move($amount); - - /** - * Gets a string representation for the current point - * - * @return string - */ - public function __toString(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Profile.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/Profile.php deleted file mode 100644 index fda5415a6e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/Profile.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -use Imagine\Exception\InvalidArgumentException; - -class Profile implements ProfileInterface -{ - private $data; - private $name; - - public function __construct($name, $data) - { - $this->name = $name; - $this->data = $data; - } - - /** - * {@inheritdoc} - */ - public function name() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function data() - { - return $this->data; - } - - /** - * Creates a profile from a path to a file - * - * @param String $path - * - * @return Profile - * - * @throws InvalidArgumentException In case the provided path is not valid - */ - public static function fromPath($path) - { - if (!file_exists($path) || !is_file($path) || !is_readable($path)) { - throw new InvalidArgumentException(sprintf('Path %s is an invalid profile file or is not readable', $path)); - } - - return new static(basename($path), file_get_contents($path)); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ProfileInterface.php b/rainloop/v/0.0.0/app/libraries/Imagine/Image/ProfileInterface.php deleted file mode 100644 index b2caa9c9a7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Image/ProfileInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Image; - -interface ProfileInterface -{ - /** - * Returns the name of the profile - * - * @return String - */ - public function name(); - - /** - * Returns the profile data - * - * @return String - */ - public function data(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Drawer.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Drawer.php deleted file mode 100644 index 2f86364912..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Drawer.php +++ /dev/null @@ -1,404 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Draw\DrawerInterface; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractFont; -use Imagine\Image\BoxInterface; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; - -/** - * Drawer implementation using the Imagick PHP extension - */ -final class Drawer implements DrawerInterface -{ - /** - * @var Imagick - */ - private $imagick; - - /** - * @param \Imagick $imagick - */ - public function __construct(\Imagick $imagick) - { - $this->imagick = $imagick; - } - - /** - * {@inheritdoc} - */ - public function arc(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $thickness = 1) - { - $x = $center->getX(); - $y = $center->getY(); - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $arc = new \ImagickDraw(); - - $arc->setStrokeColor($pixel); - $arc->setStrokeWidth(max(1, (int) $thickness)); - $arc->setFillColor('transparent'); - $arc->arc($x - $width / 2, $y - $height / 2, $x + $width / 2, $y + $height / 2, $start, $end); - - $this->imagick->drawImage($arc); - - $pixel->clear(); - $pixel->destroy(); - - $arc->clear(); - $arc->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw arc operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function chord(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - $x = $center->getX(); - $y = $center->getY(); - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $chord = new \ImagickDraw(); - - $chord->setStrokeColor($pixel); - $chord->setStrokeWidth(max(1, (int) $thickness)); - - if ($fill) { - $chord->setFillColor($pixel); - } else { - $this->line( - new Point(round($x + $width / 2 * cos(deg2rad($start))), round($y + $height / 2 * sin(deg2rad($start)))), - new Point(round($x + $width / 2 * cos(deg2rad($end))), round($y + $height / 2 * sin(deg2rad($end)))), - $color - ); - - $chord->setFillColor('transparent'); - } - - $chord->arc( - $x - $width / 2, - $y - $height / 2, - $x + $width / 2, - $y + $height / 2, - $start, - $end - ); - - $this->imagick->drawImage($chord); - - $pixel->clear(); - $pixel->destroy(); - - $chord->clear(); - $chord->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw chord operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function ellipse(PointInterface $center, BoxInterface $size, ColorInterface $color, $fill = false, $thickness = 1) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - try { - $pixel = $this->getColor($color); - $ellipse = new \ImagickDraw(); - - $ellipse->setStrokeColor($pixel); - $ellipse->setStrokeWidth(max(1, (int) $thickness)); - - if ($fill) { - $ellipse->setFillColor($pixel); - } else { - $ellipse->setFillColor('transparent'); - } - - $ellipse->ellipse( - $center->getX(), - $center->getY(), - $width / 2, - $height / 2, - 0, 360 - ); - - if (false === $this->imagick->drawImage($ellipse)) { - throw new RuntimeException('Ellipse operation failed'); - } - - $pixel->clear(); - $pixel->destroy(); - - $ellipse->clear(); - $ellipse->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw ellipse operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function line(PointInterface $start, PointInterface $end, ColorInterface $color, $thickness = 1) - { - try { - $pixel = $this->getColor($color); - $line = new \ImagickDraw(); - - $line->setStrokeColor($pixel); - $line->setStrokeWidth(max(1, (int) $thickness)); - $line->setFillColor($pixel); - $line->line( - $start->getX(), - $start->getY(), - $end->getX(), - $end->getY() - ); - - $this->imagick->drawImage($line); - - $pixel->clear(); - $pixel->destroy(); - - $line->clear(); - $line->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw line operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function pieSlice(PointInterface $center, BoxInterface $size, $start, $end, ColorInterface $color, $fill = false, $thickness = 1) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - $x1 = round($center->getX() + $width / 2 * cos(deg2rad($start))); - $y1 = round($center->getY() + $height / 2 * sin(deg2rad($start))); - $x2 = round($center->getX() + $width / 2 * cos(deg2rad($end))); - $y2 = round($center->getY() + $height / 2 * sin(deg2rad($end))); - - if ($fill) { - $this->chord($center, $size, $start, $end, $color, true, $thickness); - $this->polygon( - array( - $center, - new Point($x1, $y1), - new Point($x2, $y2), - ), - $color, - true, - $thickness - ); - } else { - $this->arc($center, $size, $start, $end, $color, $thickness); - $this->line($center, new Point($x1, $y1), $color, $thickness); - $this->line($center, new Point($x2, $y2), $color, $thickness); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function dot(PointInterface $position, ColorInterface $color) - { - $x = $position->getX(); - $y = $position->getY(); - - try { - $pixel = $this->getColor($color); - $point = new \ImagickDraw(); - - $point->setFillColor($pixel); - $point->point($x, $y); - - $this->imagick->drawimage($point); - - $pixel->clear(); - $pixel->destroy(); - - $point->clear(); - $point->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw point operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function polygon(array $coordinates, ColorInterface $color, $fill = false, $thickness = 1) - { - if (count($coordinates) < 3) { - throw new InvalidArgumentException(sprintf('Polygon must consist of at least 3 coordinates, %d given', count($coordinates))); - } - - $points = array_map(function (PointInterface $p) { - return array('x' => $p->getX(), 'y' => $p->getY()); - }, $coordinates); - - try { - $pixel = $this->getColor($color); - $polygon = new \ImagickDraw(); - - $polygon->setStrokeColor($pixel); - $polygon->setStrokeWidth(max(1, (int) $thickness)); - - if ($fill) { - $polygon->setFillColor($pixel); - } else { - $polygon->setFillColor('transparent'); - } - - $polygon->polygon($points); - $this->imagick->drawImage($polygon); - - $pixel->clear(); - $pixel->destroy(); - - $polygon->clear(); - $polygon->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw polygon operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function text($string, AbstractFont $font, PointInterface $position, $angle = 0, $width = null) - { - try { - $pixel = $this->getColor($font->getColor()); - $text = new \ImagickDraw(); - - $text->setFont($font->getFile()); - /** - * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027 - * - * ensure font resolution is the same as GD's hard-coded 96 - */ - if (version_compare(phpversion("imagick"), "3.0.2", ">=")) { - $text->setResolution(96, 96); - $text->setFontSize($font->getSize()); - } else { - $text->setFontSize((int) ($font->getSize() * (96 / 72))); - } - $text->setFillColor($pixel); - $text->setTextAntialias(true); - - $info = $this->imagick->queryFontMetrics($text, $string); - $rad = deg2rad($angle); - $cos = cos($rad); - $sin = sin($rad); - - // round(0 * $cos - 0 * $sin) - $x1 = 0; - $x2 = round($info['characterWidth'] * $cos - $info['characterHeight'] * $sin); - // round(0 * $sin + 0 * $cos) - $y1 = 0; - $y2 = round($info['characterWidth'] * $sin + $info['characterHeight'] * $cos); - - $xdiff = 0 - min($x1, $x2); - $ydiff = 0 - min($y1, $y2); - - if ($width !== null) { - $string = $this->wrapText($string, $text, $angle, $width); - } - - $this->imagick->annotateImage( - $text, $position->getX() + $x1 + $xdiff, - $position->getY() + $y2 + $ydiff, $angle, $string - ); - - $pixel->clear(); - $pixel->destroy(); - - $text->clear(); - $text->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Draw text operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * Gets specifically formatted color string from ColorInterface instance - * - * @param ColorInterface $color - * - * @return string - */ - private function getColor(ColorInterface $color) - { - $pixel = new \ImagickPixel((string) $color); - $pixel->setColorValue(\Imagick::COLOR_ALPHA, $color->getAlpha() / 100); - - return $pixel; - } - - /** - * Internal - * - * Fits a string into box with given width - */ - private function wrapText($string, $text, $angle, $width) - { - $result = ''; - $words = explode(' ', $string); - foreach ($words as $word) { - $teststring = $result . ' ' . $word; - $testbox = $this->imagick->queryFontMetrics($text, $teststring, true); - if ($testbox['textWidth'] > $width) { - $result .= ($result == '' ? '' : "\n") . $word; - } else { - $result .= ($result == '' ? '' : ' ') . $word; - } - } - - return $result; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Effects.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Effects.php deleted file mode 100644 index debe32a609..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Effects.php +++ /dev/null @@ -1,113 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Effects\EffectsInterface; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Effects implementation using the Imagick PHP extension - */ -class Effects implements EffectsInterface -{ - private $imagick; - - public function __construct(\Imagick $imagick) - { - $this->imagick = $imagick; - } - - /** - * {@inheritdoc} - */ - public function gamma($correction) - { - try { - $this->imagick->gammaImage($correction, \Imagick::CHANNEL_ALL); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to apply gamma correction to the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function negative() - { - try { - $this->imagick->negateImage(false, \Imagick::CHANNEL_ALL); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to negate the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function grayscale() - { - try { - $this->imagick->setImageType(\Imagick::IMGTYPE_GRAYSCALE); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to grayscale the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function colorize(ColorInterface $color) - { - try { - $this->imagick->colorizeImage((string) $color, 1); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to colorize the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function sharpen() - { - try { - $this->imagick->sharpenImage(2, 1); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to sharpen the image'); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function blur($sigma = 1) - { - try { - $this->imagick->gaussianBlurImage(0, $sigma); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to blur the image', $e->getCode(), $e); - } - - return $this; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Font.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Font.php deleted file mode 100644 index 3fc41dd2f2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Font.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Image\AbstractFont; -use Imagine\Image\Box; -use Imagine\Image\Palette\Color\ColorInterface; - -/** - * Font implementation using the Imagick PHP extension - */ -final class Font extends AbstractFont -{ - /** - * @var \Imagick - */ - private $imagick; - - /** - * @param \Imagick $imagick - * @param string $file - * @param integer $size - * @param ColorInterface $color - */ - public function __construct(\Imagick $imagick, $file, $size, ColorInterface $color) - { - $this->imagick = $imagick; - - parent::__construct($file, $size, $color); - } - - /** - * {@inheritdoc} - */ - public function box($string, $angle = 0) - { - $text = new \ImagickDraw(); - - $text->setFont($this->file); - - /** - * @see http://www.php.net/manual/en/imagick.queryfontmetrics.php#101027 - * - * ensure font resolution is the same as GD's hard-coded 96 - */ - if (version_compare(phpversion("imagick"), "3.0.2", ">=")) { - $text->setResolution(96, 96); - $text->setFontSize($this->size); - } else { - $text->setFontSize((int) ($this->size * (96 / 72))); - } - - $info = $this->imagick->queryFontMetrics($text, $string); - - $box = new Box($info['textWidth'], $info['textHeight']); - - return $box; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Image.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Image.php deleted file mode 100644 index c94f605d57..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Image.php +++ /dev/null @@ -1,880 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\AbstractImage; -use Imagine\Image\Box; -use Imagine\Image\BoxInterface; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Image\Fill\FillInterface; -use Imagine\Image\Fill\Gradient\Horizontal; -use Imagine\Image\Fill\Gradient\Linear; -use Imagine\Image\Point; -use Imagine\Image\PointInterface; -use Imagine\Image\ProfileInterface; -use Imagine\Image\ImageInterface; -use Imagine\Image\Palette\PaletteInterface; - -/** - * Image implementation using the Imagick PHP extension - */ -final class Image extends AbstractImage -{ - /** - * @var \Imagick - */ - private $imagick; - /** - * @var Layers - */ - private $layers; - /** - * @var PaletteInterface - */ - private $palette; - - /** - * @var Boolean - */ - private static $supportsColorspaceConversion; - - private static $colorspaceMapping = array( - PaletteInterface::PALETTE_CMYK => \Imagick::COLORSPACE_CMYK, - PaletteInterface::PALETTE_RGB => \Imagick::COLORSPACE_RGB, - PaletteInterface::PALETTE_GRAYSCALE => \Imagick::COLORSPACE_GRAY, - ); - - /** - * Constructs a new Image instance - * - * @param \Imagick $imagick - * @param PaletteInterface $palette - * @param MetadataBag $metadata - */ - public function __construct(\Imagick $imagick, PaletteInterface $palette, MetadataBag $metadata) - { - $this->metadata = $metadata; - $this->detectColorspaceConversionSupport(); - $this->imagick = $imagick; - if (static::$supportsColorspaceConversion) { - $this->setColorspace($palette); - } - $this->palette = $palette; - $this->layers = new Layers($this, $this->palette, $this->imagick); - } - - /** - * Destroys allocated imagick resources - */ - public function __destruct() - { - if ($this->imagick instanceof \Imagick) { - $this->imagick->clear(); - $this->imagick->destroy(); - } - } - - /** - * Returns the underlying \Imagick instance - * - * @return \Imagick - */ - public function getImagick() - { - return $this->imagick; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function copy() - { - try { - if (version_compare(phpversion("imagick"), "3.1.0b1", ">=") || defined("HHVM_VERSION")) { - $clone = clone $this->imagick; - } else { - $clone = $this->imagick->clone(); - } - } catch (\ImagickException $e) { - throw new RuntimeException('Copy operation failed', $e->getCode(), $e); - } - - return new self($clone, $this->palette, clone $this->metadata); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function crop(PointInterface $start, BoxInterface $size) - { - if (!$start->in($this->getSize())) { - throw new OutOfBoundsException('Crop coordinates must start at minimum 0, 0 position from top left corner, crop height and width must be positive integers and must not exceed the current image borders'); - } - - try { - $this->imagick->cropImage($size->getWidth(), $size->getHeight(), $start->getX(), $start->getY()); - // Reset canvas for gif format - $this->imagick->setImagePage(0, 0, 0, 0); - } catch (\ImagickException $e) { - throw new RuntimeException('Crop operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function flipHorizontally() - { - try { - $this->imagick->flopImage(); - } catch (\ImagickException $e) { - throw new RuntimeException('Horizontal Flip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function flipVertically() - { - try { - $this->imagick->flipImage(); - } catch (\ImagickException $e) { - throw new RuntimeException('Vertical flip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function strip() - { - try { - try { - $this->profile($this->palette->profile()); - } catch (\Exception $e) { - // here we discard setting the profile as the previous incorporated profile - // is corrupted, let's now strip the image - } - $this->imagick->stripImage(); - } catch (\ImagickException $e) { - throw new RuntimeException('Strip operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function paste(ImageInterface $image, PointInterface $start) - { - if (!$image instanceof self) { - throw new InvalidArgumentException(sprintf('Imagick\Image can only paste() Imagick\Image instances, %s given', get_class($image))); - } - - if (!$this->getSize()->contains($image->getSize(), $start)) { - throw new OutOfBoundsException('Cannot paste image of the given size at the specified position, as it moves outside of the current image\'s box'); - } - - try { - $this->imagick->compositeImage($image->imagick, \Imagick::COMPOSITE_DEFAULT, $start->getX(), $start->getY()); - } catch (\ImagickException $e) { - throw new RuntimeException('Paste operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function resize(BoxInterface $size, $filter = ImageInterface::FILTER_UNDEFINED) - { - try { - $this->imagick->resizeImage($size->getWidth(), $size->getHeight(), $this->getFilter($filter), 1); - } catch (\ImagickException $e) { - throw new RuntimeException('Resize operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function rotate($angle, ColorInterface $background = null) - { - $color = $background ? $background : $this->palette->color('fff'); - - try { - $pixel = $this->getColor($color); - - $this->imagick->rotateimage($pixel, $angle); - - $pixel->clear(); - $pixel->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Rotate operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function save($path = null, array $options = array()) - { - $path = null === $path ? $this->imagick->getImageFilename() : $path; - if (null === $path) { - throw new RuntimeException('You can omit save path only if image has been open from a file'); - } - - try { - $this->prepareOutput($options, $path); - $this->imagick->writeImages($path, true); - } catch (\ImagickException $e) { - throw new RuntimeException('Save operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function show($format, array $options = array()) - { - header('Content-type: '.$this->getMimeType($format)); - echo $this->get($format, $options); - - return $this; - } - - /** - * {@inheritdoc} - */ - public function get($format, array $options = array()) - { - try { - $options['format'] = $format; - $this->prepareOutput($options); - } catch (\ImagickException $e) { - throw new RuntimeException('Get operation failed', $e->getCode(), $e); - } - - return $this->imagick->getImagesBlob(); - } - - /** - * {@inheritdoc} - */ - public function interlace($scheme) - { - static $supportedInterlaceSchemes = array( - ImageInterface::INTERLACE_NONE => \Imagick::INTERLACE_NO, - ImageInterface::INTERLACE_LINE => \Imagick::INTERLACE_LINE, - ImageInterface::INTERLACE_PLANE => \Imagick::INTERLACE_PLANE, - ImageInterface::INTERLACE_PARTITION => \Imagick::INTERLACE_PARTITION, - ); - - if (!array_key_exists($scheme, $supportedInterlaceSchemes)) { - throw new InvalidArgumentException('Unsupported interlace type'); - } - - $this->imagick->setInterlaceScheme($supportedInterlaceSchemes[$scheme]); - - return $this; - } - - /** - * @param array $options - * @param string $path - */ - private function prepareOutput(array $options, $path = null) - { - if (isset($options['format'])) { - $this->imagick->setImageFormat($options['format']); - } - - if (isset($options['animated']) && true === $options['animated']) { - $format = isset($options['format']) ? $options['format'] : 'gif'; - $delay = isset($options['animated.delay']) ? $options['animated.delay'] : null; - $loops = isset($options['animated.loops']) ? $options['animated.loops'] : 0; - - $options['flatten'] = false; - - $this->layers->animate($format, $delay, $loops); - } else { - $this->layers->merge(); - } - $this->applyImageOptions($this->imagick, $options, $path); - - // flatten only if image has multiple layers - if ((!isset($options['flatten']) || $options['flatten'] === true) && count($this->layers) > 1) { - $this->flatten(); - } - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->get('png'); - } - - /** - * {@inheritdoc} - */ - public function draw() - { - return new Drawer($this->imagick); - } - - /** - * {@inheritdoc} - */ - public function effects() - { - return new Effects($this->imagick); - } - - /** - * {@inheritdoc} - */ - public function getSize() - { - try { - $i = $this->imagick->getIteratorIndex(); - $this->imagick->rewind(); - $width = $this->imagick->getImageWidth(); - $height = $this->imagick->getImageHeight(); - $this->imagick->setIteratorIndex($i); - } catch (\ImagickException $e) { - throw new RuntimeException('Could not get size', $e->getCode(), $e); - } - - return new Box($width, $height); - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function applyMask(ImageInterface $mask) - { - if (!$mask instanceof self) { - throw new InvalidArgumentException('Can only apply instances of Imagine\Imagick\Image as masks'); - } - - $size = $this->getSize(); - $maskSize = $mask->getSize(); - - if ($size != $maskSize) { - throw new InvalidArgumentException(sprintf('The given mask doesn\'t match current image\'s size, Current mask\'s dimensions are %s, while image\'s dimensions are %s', $maskSize, $size)); - } - - $mask = $mask->mask(); - $mask->imagick->negateImage(true); - - try { - // remove transparent areas of the original from the mask - $mask->imagick->compositeImage($this->imagick, \Imagick::COMPOSITE_DSTIN, 0, 0); - $this->imagick->compositeImage($mask->imagick, \Imagick::COMPOSITE_COPYOPACITY, 0, 0); - - $mask->imagick->clear(); - $mask->imagick->destroy(); - } catch (\ImagickException $e) { - throw new RuntimeException('Apply mask operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function mask() - { - $mask = $this->copy(); - - try { - $mask->imagick->modulateImage(100, 0, 100); - $mask->imagick->setImageMatte(false); - } catch (\ImagickException $e) { - throw new RuntimeException('Mask operation failed', $e->getCode(), $e); - } - - return $mask; - } - - /** - * {@inheritdoc} - * - * @return ImageInterface - */ - public function fill(FillInterface $fill) - { - try { - if ($this->isLinearOpaque($fill)) { - $this->applyFastLinear($fill); - } else { - $iterator = $this->imagick->getPixelIterator(); - - foreach ($iterator as $y => $pixels) { - foreach ($pixels as $x => $pixel) { - $color = $fill->getColor(new Point($x, $y)); - - $pixel->setColor((string) $color); - $pixel->setColorValue(\Imagick::COLOR_ALPHA, $color->getAlpha() / 100); - } - - $iterator->syncIterator(); - } - } - } catch (\ImagickException $e) { - throw new RuntimeException('Fill operation failed', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function histogram() - { - try { - $pixels = $this->imagick->getImageHistogram(); - } catch (\ImagickException $e) { - throw new RuntimeException('Error while fetching histogram', $e->getCode(), $e); - } - - $image = $this; - - return array_map(function (\ImagickPixel $pixel) use ($image) { - return $image->pixelToColor($pixel); - },$pixels); - } - - /** - * {@inheritdoc} - */ - public function getColorAt(PointInterface $point) - { - if (!$point->in($this->getSize())) { - throw new RuntimeException(sprintf('Error getting color at point [%s,%s]. The point must be inside the image of size [%s,%s]', $point->getX(), $point->getY(), $this->getSize()->getWidth(), $this->getSize()->getHeight())); - } - - try { - $pixel = $this->imagick->getImagePixelColor($point->getX(), $point->getY()); - } catch (\ImagickException $e) { - throw new RuntimeException('Error while getting image pixel color', $e->getCode(), $e); - } - - return $this->pixelToColor($pixel); - } - - /** - * Returns a color given a pixel, depending the Palette context - * - * Note : this method is public for PHP 5.3 compatibility - * - * @param \ImagickPixel $pixel - * - * @return ColorInterface - * - * @throws InvalidArgumentException In case a unknown color is requested - */ - public function pixelToColor(\ImagickPixel $pixel) - { - static $colorMapping = array( - ColorInterface::COLOR_RED => \Imagick::COLOR_RED, - ColorInterface::COLOR_GREEN => \Imagick::COLOR_GREEN, - ColorInterface::COLOR_BLUE => \Imagick::COLOR_BLUE, - ColorInterface::COLOR_CYAN => \Imagick::COLOR_CYAN, - ColorInterface::COLOR_MAGENTA => \Imagick::COLOR_MAGENTA, - ColorInterface::COLOR_YELLOW => \Imagick::COLOR_YELLOW, - ColorInterface::COLOR_KEYLINE => \Imagick::COLOR_BLACK, - // There is no gray component in \Imagick, let's use one of the RGB comp - ColorInterface::COLOR_GRAY => \Imagick::COLOR_RED, - ); - - $alpha = $this->palette->supportsAlpha() ? (int) round($pixel->getColorValue(\Imagick::COLOR_ALPHA) * 100) : null; - $palette = $this->palette(); - - return $this->palette->color(array_map(function ($color) use ($palette, $pixel, $colorMapping) { - if (!isset($colorMapping[$color])) { - throw new InvalidArgumentException(sprintf('Color %s is not mapped in Imagick', $color)); - } - $multiplier = 255; - if ($palette->name() === PaletteInterface::PALETTE_CMYK) { - $multiplier = 100; - } - - return $pixel->getColorValue($colorMapping[$color]) * $multiplier; - }, $this->palette->pixelDefinition()), $alpha); - } - - /** - * {@inheritdoc} - */ - public function layers() - { - return $this->layers; - } - - /** - * {@inheritdoc} - */ - public function usePalette(PaletteInterface $palette) - { - if (!isset(static::$colorspaceMapping[$palette->name()])) { - throw new InvalidArgumentException(sprintf('The palette %s is not supported by Imagick driver', $palette->name())); - } - - if ($this->palette->name() === $palette->name()) { - return $this; - } - - if (!static::$supportsColorspaceConversion) { - throw new RuntimeException('Your version of Imagick does not support colorspace conversions.'); - } - - try { - try { - $hasICCProfile = (Boolean) $this->imagick->getImageProfile('icc'); - } catch (\ImagickException $e) { - $hasICCProfile = false; - } - - if (!$hasICCProfile) { - $this->profile($this->palette->profile()); - } - - $this->profile($palette->profile()); - $this->setColorspace($palette); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to set colorspace', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function palette() - { - return $this->palette; - } - - /** - * {@inheritdoc} - */ - public function profile(ProfileInterface $profile) - { - try { - $this->imagick->profileImage('icc', $profile->data()); - } catch (\ImagickException $e) { - throw new RuntimeException(sprintf('Unable to add profile %s to image', $profile->name()), $e->getCode(), $e); - } - - return $this; - } - - /** - * Internal - * - * Flatten the image. - */ - private function flatten() - { - /** - * @see https://github.com/mkoppanen/imagick/issues/45 - */ - try { - if (method_exists($this->imagick, 'mergeImageLayers') && defined('Imagick::LAYERMETHOD_UNDEFINED')) { - $this->imagick = $this->imagick->mergeImageLayers(\Imagick::LAYERMETHOD_UNDEFINED); - } elseif (method_exists($this->imagick, 'flattenImages')) { - $this->imagick = $this->imagick->flattenImages(); - } - } catch (\ImagickException $e) { - throw new RuntimeException('Flatten operation failed', $e->getCode(), $e); - } - } - - /** - * Internal - * - * Applies options before save or output - * - * @param \Imagick $image - * @param array $options - * @param string $path - * - * @throws InvalidArgumentException - * @throws RuntimeException - */ - private function applyImageOptions(\Imagick $image, array $options, $path) - { - if (isset($options['format'])) { - $format = $options['format']; - } elseif ('' !== $extension = pathinfo($path, \PATHINFO_EXTENSION)) { - $format = $extension; - } else { - $format = pathinfo($image->getImageFilename(), \PATHINFO_EXTENSION); - } - - $format = strtolower($format); - - $options = $this->updateSaveOptions($options); - - if (isset($options['jpeg_quality']) && in_array($format, array('jpeg', 'jpg', 'pjpeg'))) { - $image->setImageCompressionQuality($options['jpeg_quality']); - } - - if ((isset($options['png_compression_level']) || isset($options['png_compression_filter'])) && $format === 'png') { - // first digit: compression level (default: 7) - if (isset($options['png_compression_level'])) { - if ($options['png_compression_level'] < 0 || $options['png_compression_level'] > 9) { - throw new InvalidArgumentException('png_compression_level option should be an integer from 0 to 9'); - } - $compression = $options['png_compression_level'] * 10; - } else { - $compression = 70; - } - - // second digit: compression filter (default: 5) - if (isset($options['png_compression_filter'])) { - if ($options['png_compression_filter'] < 0 || $options['png_compression_filter'] > 9) { - throw new InvalidArgumentException('png_compression_filter option should be an integer from 0 to 9'); - } - $compression += $options['png_compression_filter']; - } else { - $compression += 5; - } - - $image->setImageCompressionQuality($compression); - } - - if (isset($options['resolution-units']) && isset($options['resolution-x']) && isset($options['resolution-y'])) { - if ($options['resolution-units'] == ImageInterface::RESOLUTION_PIXELSPERCENTIMETER) { - $image->setImageUnits(\Imagick::RESOLUTION_PIXELSPERCENTIMETER); - } elseif ($options['resolution-units'] == ImageInterface::RESOLUTION_PIXELSPERINCH) { - $image->setImageUnits(\Imagick::RESOLUTION_PIXELSPERINCH); - } else { - throw new RuntimeException('Unsupported image unit format'); - } - - $filter = ImageInterface::FILTER_UNDEFINED; - if (!empty($options['resampling-filter'])) { - $filter = $options['resampling-filter']; - } - - $image->setImageResolution($options['resolution-x'], $options['resolution-y']); - $image->resampleImage($options['resolution-x'], $options['resolution-y'], $this->getFilter($filter), 0); - } - } - - /** - * Gets specifically formatted color string from Color instance - * - * @param ColorInterface $color - * - * @return \ImagickPixel - */ - private function getColor(ColorInterface $color) - { - $pixel = new \ImagickPixel((string) $color); - $pixel->setColorValue(\Imagick::COLOR_ALPHA, $color->getAlpha() / 100); - - return $pixel; - } - - /** - * Checks whether given $fill is linear and opaque - * - * @param FillInterface $fill - * - * @return Boolean - */ - private function isLinearOpaque(FillInterface $fill) - { - return $fill instanceof Linear && $fill->getStart()->isOpaque() && $fill->getEnd()->isOpaque(); - } - - /** - * Performs optimized gradient fill for non-opaque linear gradients - * - * @param Linear $fill - */ - private function applyFastLinear(Linear $fill) - { - $gradient = new \Imagick(); - $size = $this->getSize(); - $color = sprintf('gradient:%s-%s', (string) $fill->getStart(), (string) $fill->getEnd()); - - if ($fill instanceof Horizontal) { - $gradient->newPseudoImage($size->getHeight(), $size->getWidth(), $color); - $gradient->rotateImage(new \ImagickPixel(), 90); - } else { - $gradient->newPseudoImage($size->getWidth(), $size->getHeight(), $color); - } - - $this->imagick->compositeImage($gradient, \Imagick::COMPOSITE_OVER, 0, 0); - $gradient->clear(); - $gradient->destroy(); - } - - /** - * Internal - * - * Get the mime type based on format. - * - * @param string $format - * - * @return string mime-type - * - * @throws RuntimeException - */ - private function getMimeType($format) - { - static $mimeTypes = array( - 'jpeg' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - 'wbmp' => 'image/vnd.wap.wbmp', - 'xbm' => 'image/xbm', - ); - - if (!isset($mimeTypes[$format])) { - throw new RuntimeException(sprintf('Unsupported format given. Only %s are supported, %s given', implode(", ", array_keys($mimeTypes)), $format)); - } - - return $mimeTypes[$format]; - } - - /** - * Sets colorspace and image type, assigns the palette. - * - * @param PaletteInterface $palette - * - * @throws InvalidArgumentException - */ - private function setColorspace(PaletteInterface $palette) - { - static $typeMapping = array( - // We use Matte variants to preserve alpha - PaletteInterface::PALETTE_CMYK => \Imagick::IMGTYPE_TRUECOLORMATTE, - PaletteInterface::PALETTE_RGB => \Imagick::IMGTYPE_TRUECOLORMATTE, - PaletteInterface::PALETTE_GRAYSCALE => \Imagick::IMGTYPE_GRAYSCALEMATTE, - ); - - if (!isset(static::$colorspaceMapping[$palette->name()])) { - throw new InvalidArgumentException(sprintf('The palette %s is not supported by Imagick driver', $palette->name())); - } - - $this->imagick->setType($typeMapping[$palette->name()]); - $this->imagick->setColorspace(static::$colorspaceMapping[$palette->name()]); - $this->palette = $palette; - } - - /** - * Older imagemagick versions does not support colorspace conversions. - * Let's detect if it is supported. - * - * @return Boolean - */ - private function detectColorspaceConversionSupport() - { - if (null !== static::$supportsColorspaceConversion) { - return static::$supportsColorspaceConversion; - } - - return static::$supportsColorspaceConversion = method_exists('Imagick', 'setColorspace'); - } - - /** - * Returns the filter if it's supported. - * - * @param string $filter - * - * @return string - * - * @throws InvalidArgumentException If the filter is unsupported. - */ - private function getFilter($filter = ImageInterface::FILTER_UNDEFINED) - { - static $supportedFilters = array( - ImageInterface::FILTER_UNDEFINED => \Imagick::FILTER_UNDEFINED, - ImageInterface::FILTER_BESSEL => \Imagick::FILTER_BESSEL, - ImageInterface::FILTER_BLACKMAN => \Imagick::FILTER_BLACKMAN, - ImageInterface::FILTER_BOX => \Imagick::FILTER_BOX, - ImageInterface::FILTER_CATROM => \Imagick::FILTER_CATROM, - ImageInterface::FILTER_CUBIC => \Imagick::FILTER_CUBIC, - ImageInterface::FILTER_GAUSSIAN => \Imagick::FILTER_GAUSSIAN, - ImageInterface::FILTER_HANNING => \Imagick::FILTER_HANNING, - ImageInterface::FILTER_HAMMING => \Imagick::FILTER_HAMMING, - ImageInterface::FILTER_HERMITE => \Imagick::FILTER_HERMITE, - ImageInterface::FILTER_LANCZOS => \Imagick::FILTER_LANCZOS, - ImageInterface::FILTER_MITCHELL => \Imagick::FILTER_MITCHELL, - ImageInterface::FILTER_POINT => \Imagick::FILTER_POINT, - ImageInterface::FILTER_QUADRATIC => \Imagick::FILTER_QUADRATIC, - ImageInterface::FILTER_SINC => \Imagick::FILTER_SINC, - ImageInterface::FILTER_TRIANGLE => \Imagick::FILTER_TRIANGLE - ); - - if (!array_key_exists($filter, $supportedFilters)) { - throw new InvalidArgumentException(sprintf( - 'The resampling filter "%s" is not supported by Imagick driver.', - $filter - )); - } - - return $supportedFilters[$filter]; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Imagine.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Imagine.php deleted file mode 100644 index aa6e926463..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Imagine.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Exception\NotSupportedException; -use Imagine\Image\AbstractImagine; -use Imagine\Image\BoxInterface; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Image\Palette\Color\ColorInterface; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Exception\RuntimeException; -use Imagine\Image\Palette\CMYK; -use Imagine\Image\Palette\RGB; -use Imagine\Image\Palette\Grayscale; - -/** - * Imagine implementation using the Imagick PHP extension - */ -final class Imagine extends AbstractImagine -{ - /** - * @throws RuntimeException - */ - public function __construct() - { - if (!class_exists('Imagick')) { - throw new RuntimeException('Imagick not installed'); - } - - if (version_compare('6.2.9', $this->getVersion(new \Imagick())) > 0) { - throw new RuntimeException('ImageMagick version 6.2.9 or higher is required'); - } - } - - /** - * {@inheritdoc} - */ - public function open($path) - { - $path = $this->checkPath($path); - - try { - $imagick = new \Imagick($path); - $image = new Image($imagick, $this->createPalette($imagick), $this->getMetadataReader()->readFile($path)); - } catch (\Exception $e) { - throw new RuntimeException(sprintf('Unable to open image %s', $path), $e->getCode(), $e); - } - - return $image; - } - - /** - * {@inheritdoc} - */ - public function create(BoxInterface $size, ColorInterface $color = null) - { - $width = $size->getWidth(); - $height = $size->getHeight(); - - $palette = null !== $color ? $color->getPalette() : new RGB(); - $color = null !== $color ? $color : $palette->color('fff'); - - try { - $pixel = new \ImagickPixel((string) $color); - $pixel->setColorValue(\Imagick::COLOR_ALPHA, $color->getAlpha() / 100); - - $imagick = new \Imagick(); - $imagick->newImage($width, $height, $pixel); - $imagick->setImageMatte(true); - $imagick->setImageBackgroundColor($pixel); - - if (version_compare('6.3.1', $this->getVersion($imagick)) < 0) { - $imagick->setImageOpacity($pixel->getColorValue(\Imagick::COLOR_ALPHA)); - } - - $pixel->clear(); - $pixel->destroy(); - - return new Image($imagick, $palette, new MetadataBag()); - } catch (\ImagickException $e) { - throw new RuntimeException('Could not create empty image', $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function load($string) - { - try { - $imagick = new \Imagick(); - - $imagick->readImageBlob($string); - $imagick->setImageMatte(true); - - return new Image($imagick, $this->createPalette($imagick), $this->getMetadataReader()->readData($string)); - } catch (\ImagickException $e) { - throw new RuntimeException('Could not load image from string', $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function read($resource) - { - if (!is_resource($resource)) { - throw new InvalidArgumentException('Variable does not contain a stream resource'); - } - - try { - $imagick = new \Imagick(); - $imagick->readImageFile($resource); - } catch (\ImagickException $e) { - throw new RuntimeException('Could not read image from resource', $e->getCode(), $e); - } - - return new Image($imagick, $this->createPalette($imagick), $this->getMetadataReader()->readStream($resource)); - } - - /** - * {@inheritdoc} - */ - public function font($file, $size, ColorInterface $color) - { - return new Font(new \Imagick(), $file, $size, $color); - } - - /** - * Returns the palette corresponding to an \Imagick resource colorspace - * - * @param \Imagick $imagick - * - * @return CMYK|Grayscale|RGB - * - * @throws NotSupportedException - */ - private function createPalette(\Imagick $imagick) - { - switch ($imagick->getImageColorspace()) { - case \Imagick::COLORSPACE_RGB: - case \Imagick::COLORSPACE_SRGB: - return new RGB(); - case \Imagick::COLORSPACE_CMYK: - return new CMYK(); - case \Imagick::COLORSPACE_GRAY: - return new Grayscale(); - default: - throw new NotSupportedException('Only RGB and CMYK colorspace are currently supported'); - } - } - - /** - * Returns ImageMagick version - * - * @param \Imagick $imagick - * - * @return string - */ - private function getVersion(\Imagick $imagick) - { - $v = $imagick->getVersion(); - list($version) = sscanf($v['versionString'], 'ImageMagick %s %04d-%02d-%02d %s %s'); - - return $version; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Layers.php b/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Layers.php deleted file mode 100644 index 7809447ad6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Imagine/Imagick/Layers.php +++ /dev/null @@ -1,271 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Imagine\Imagick; - -use Imagine\Image\AbstractLayers; -use Imagine\Image\Metadata\MetadataBag; -use Imagine\Exception\RuntimeException; -use Imagine\Exception\OutOfBoundsException; -use Imagine\Exception\InvalidArgumentException; -use Imagine\Image\Palette\PaletteInterface; - -class Layers extends AbstractLayers -{ - /** - * @var Image - */ - private $image; - /** - * @var \Imagick - */ - private $resource; - /** - * @var integer - */ - private $offset = 0; - /** - * @var array - */ - private $layers = array(); - - private $palette; - - public function __construct(Image $image, PaletteInterface $palette, \Imagick $resource) - { - $this->image = $image; - $this->resource = $resource; - $this->palette = $palette; - } - - /** - * {@inheritdoc} - */ - public function merge() - { - foreach ($this->layers as $offset => $image) { - try { - $this->resource->setIteratorIndex($offset); - $this->resource->setImage($image->getImagick()); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to substitute layer', $e->getCode(), $e); - } - } - } - - /** - * {@inheritdoc} - */ - public function animate($format, $delay, $loops) - { - if ('gif' !== strtolower($format)) { - throw new InvalidArgumentException('Animated picture is currently only supported on gif'); - } - - if (!is_int($loops) || $loops < 0) { - throw new InvalidArgumentException('Loops must be a positive integer.'); - } - - if (null !== $delay && (!is_int($delay) || $delay < 0)) { - throw new InvalidArgumentException('Delay must be either null or a positive integer.'); - } - - try { - foreach ($this as $offset => $layer) { - $this->resource->setIteratorIndex($offset); - $this->resource->setFormat($format); - - if (null !== $delay) { - $layer->getImagick()->setImageDelay($delay / 10); - $layer->getImagick()->setImageTicksPerSecond(100); - } - $layer->getImagick()->setImageIterations($loops); - - $this->resource->setImage($layer->getImagick()); - } - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to animate layers', $e->getCode(), $e); - } - - return $this; - } - - /** - * {@inheritdoc} - */ - public function coalesce() - { - try { - $coalescedResource = $this->resource->coalesceImages(); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to coalesce layers', $e->getCode(), $e); - } - - $count = $coalescedResource->getNumberImages(); - for ($offset = 0; $offset < $count; $offset++) { - try { - $coalescedResource->setIteratorIndex($offset); - $this->layers[$offset] = new Image($coalescedResource->getImage(), $this->palette, new MetadataBag()); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to retrieve layer', $e->getCode(), $e); - } - } - } - - /** - * {@inheritdoc} - */ - public function current() - { - return $this->extractAt($this->offset); - } - - /** - * Tries to extract layer at given offset - * - * @param integer $offset - * - * @return Image - * @throws RuntimeException - */ - private function extractAt($offset) - { - if (!isset($this->layers[$offset])) { - try { - $this->resource->setIteratorIndex($offset); - $this->layers[$offset] = new Image($this->resource->getImage(), $this->palette, new MetadataBag()); - } catch (\ImagickException $e) { - throw new RuntimeException(sprintf('Failed to extract layer %d', $offset), $e->getCode(), $e); - } - } - - return $this->layers[$offset]; - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->offset; - } - - /** - * {@inheritdoc} - */ - public function next() - { - ++$this->offset; - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->offset = 0; - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->offset < count($this); - } - - /** - * {@inheritdoc} - */ - public function count() - { - try { - return $this->resource->getNumberImages(); - } catch (\ImagickException $e) { - throw new RuntimeException('Failed to count the number of layers', $e->getCode(), $e); - } - } - - /** - * {@inheritdoc} - */ - public function offsetExists($offset) - { - return is_int($offset) && $offset >= 0 && $offset < count($this); - } - - /** - * {@inheritdoc} - */ - public function offsetGet($offset) - { - return $this->extractAt($offset); - } - - /** - * {@inheritdoc} - */ - public function offsetSet($offset, $image) - { - if (!$image instanceof Image) { - throw new InvalidArgumentException('Only an Imagick Image can be used as layer'); - } - - if (null === $offset) { - $offset = count($this) - 1; - } else { - if (!is_int($offset)) { - throw new InvalidArgumentException('Invalid offset for layer, it must be an integer'); - } - - if (count($this) < $offset || 0 > $offset) { - throw new OutOfBoundsException(sprintf('Invalid offset for layer, it must be a value between 0 and %d, %d given', count($this), $offset)); - } - - if (isset($this[$offset])) { - unset($this[$offset]); - $offset = $offset - 1; - } - } - - $frame = $image->getImagick(); - - try { - if (count($this) > 0) { - $this->resource->setIteratorIndex($offset); - } - $this->resource->addImage($frame); - } catch (\ImagickException $e) { - throw new RuntimeException('Unable to set the layer', $e->getCode(), $e); - } - - $this->layers = array(); - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($offset) - { - try { - $this->extractAt($offset); - } catch (RuntimeException $e) { - return; - } - - try { - $this->resource->setIteratorIndex($offset); - $this->resource->removeImage(); - } catch (\ImagickException $e) { - throw new RuntimeException('Unable to remove layer', $e->getCode(), $e); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/LICENSE.txt b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/LICENSE.txt deleted file mode 100644 index 90e632a787..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ -MIT License - -Copyright (c) <2011-2015> Serban Ghita, Nick Ilyin and contributors. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Developer’s Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.json b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.json deleted file mode 100644 index 63d2aa7ba8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"2.8.26","headerMatch":{"HTTP_ACCEPT":{"matches":["application\/x-obml2d","application\/vnd.rim.html","text\/vnd.wap.wml","application\/vnd.wap.xhtml+xml"]},"HTTP_X_WAP_PROFILE":null,"HTTP_X_WAP_CLIENTID":null,"HTTP_WAP_CONNECTION":null,"HTTP_PROFILE":null,"HTTP_X_OPERAMINI_PHONE_UA":null,"HTTP_X_NOKIA_GATEWAY_ID":null,"HTTP_X_ORANGE_ID":null,"HTTP_X_VODAFONE_3GPDPCONTEXT":null,"HTTP_X_HUAWEI_USERID":null,"HTTP_UA_OS":null,"HTTP_X_MOBILE_GATEWAY":null,"HTTP_X_ATT_DEVICEID":null,"HTTP_UA_CPU":{"matches":["ARM"]}},"uaHttpHeaders":["HTTP_USER_AGENT","HTTP_X_OPERAMINI_PHONE_UA","HTTP_X_DEVICE_USER_AGENT","HTTP_X_ORIGINAL_USER_AGENT","HTTP_X_SKYFIRE_PHONE","HTTP_X_BOLT_PHONE_UA","HTTP_DEVICE_STOCK_UA","HTTP_X_UCBROWSER_DEVICE_UA"],"uaMatch":{"phones":{"iPhone":"\\biPhone\\b|\\biPod\\b","BlackBerry":"BlackBerry|\\bBB10\\b|rim[0-9]+","HTC":"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m","Nexus":"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6","Dell":"Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b","Motorola":"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b","Samsung":"\\bSamsung\\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C","LG":"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)","Sony":"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533","Asus":"Asus.*Galaxy|PadFone.*Mobile","NokiaLumia":"Lumia [0-9]{3,4}","Micromax":"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b","Palm":"PalmSource|Palm","Vertu":"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature","Pantech":"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790","Fly":"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250","Wiko":"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM","iMobile":"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)","SimValley":"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b","Wolfgang":"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q","Alcatel":"Alcatel","Nintendo":"Nintendo 3DS","Amoi":"Amoi","INQ":"INQ","GenericPhone":"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},"tablets":{"iPad":"iPad|iPad.*Mobile","NexusTablet":"Android.*Nexus[\\s]+(7|9|10)","SamsungTablet":"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y","Kindle":"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk\/[0-9.]+ like Chrome\/[0-9.]+ (?!Mobile)","SurfaceTablet":"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)","HPTablet":"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10","AsusTablet":"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b","BlackBerryTablet":"PlayBook|RIM Tablet","HTCtablet":"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410","MotorolaTablet":"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617","NookTablet":"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2","AcerTablet":"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30","ToshibaTablet":"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO","LGTablet":"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b","FujitsuTablet":"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b","PrestigioTablet":"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002","LenovoTablet":"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)","DellTablet":"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7","YarvikTablet":"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b","MedionTablet":"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB","ArnovaTablet":"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2","IntensoTablet":"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004","IRUTablet":"M702pro","MegafonTablet":"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b","EbodaTablet":"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)","AllViewTablet":"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)","ArchosTablet":"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b","AinolTablet":"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark","NokiaLumiaTablet":"Lumia 2520","SonyTablet":"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31","PhilipsTablet":"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b","CubeTablet":"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT","CobyTablet":"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010","MIDTablet":"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10","MSITablet":"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b","SMiTTablet":"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)","RockChipTablet":"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A","FlyTablet":"IQ310|Fly Vision","bqTablet":"Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris [E|M]10)|Maxwell.*Lite|Maxwell.*Plus","HuaweiTablet":"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim","NecTablet":"\\bN-06D|\\bN-08D","PantechTablet":"Pantech.*P4100","BronchoTablet":"Broncho.*(N701|N708|N802|a710)","VersusTablet":"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b","ZyncTablet":"z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900","PositivoTablet":"TB07STA|TB10STA|TB07FTA|TB10FTA","NabiTablet":"Android.*\\bNabi","KoboTablet":"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build","DanewTablet":"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b","TexetTablet":"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE","PlaystationTablet":"Playstation.*(Portable|Vita)","TrekstorTablet":"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab","PyleAudioTablet":"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b","AdvanTablet":"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ","DanyTechTablet":"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1","GalapadTablet":"Android.*\\bG1\\b","MicromaxTablet":"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b","KarbonnTablet":"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b","AllFineTablet":"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide","PROSCANTablet":"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b","YONESTablet":"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026","ChangJiaTablet":"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503","GUTablet":"TX-A1301|TX-M9002|Q702|kf026","PointOfViewTablet":"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10","OvermaxTablet":"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)","HCLTablet":"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync","DPSTablet":"DPS Dream 9|DPS Dual 7","VistureTablet":"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10","CrestaTablet":"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989","MediatekTablet":"\\bMT8125|MT8389|MT8135|MT8377\\b","ConcordeTablet":"Concorde([ ]+)?Tab|ConCorde ReadMan","GoCleverTablet":"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042","ModecomTablet":"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003","VoninoTablet":"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b","ECSTablet":"V07OT2|TM105A|S10OT1|TR10CS1","StorexTablet":"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab","VodafoneTablet":"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497","EssentielBTablet":"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2","RossMoorTablet":"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711","iMobileTablet":"i-mobile i-note","TolinoTablet":"tolino tab [0-9.]+|tolino shine","AudioSonicTablet":"\\bC-22Q|T7-QC|T-17B|T-17P\\b","AMPETablet":"Android.* A78 ","SkkTablet":"Android.* (SKYPAD|PHOENIX|CYCLOPS)","TecnoTablet":"TECNO P9","JXDTablet":"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b","iJoyTablet":"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)","FX2Tablet":"FX2 PAD7|FX2 PAD10","XoroTablet":"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151","ViewsonicTablet":"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a","OdysTablet":"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10","CaptivaTablet":"CAPTIVA PAD","IconbitTablet":"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S","TeclastTablet":"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi","OndaTablet":"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+","JaytechTablet":"TPC-PA762","BlaupunktTablet":"Endeavour 800NG|Endeavour 1010","DigmaTablet":"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b","EvolioTablet":"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b","LavaTablet":"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b","AocTablet":"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712","MpmanTablet":"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010","CelkonTablet":"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b","WolderTablet":"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b","MiTablet":"\\bMI PAD\\b|\\bHM NOTE 1W\\b","NibiruTablet":"Nibiru M1|Nibiru Jupiter One","NexoTablet":"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI","LeaderTablet":"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100","UbislateTablet":"UbiSlate[\\s]?7C","PocketBookTablet":"Pocketbook","KocasoTablet":"\\b(TB-1207)\\b","HisenseTablet":"\\b(F5281|E2371)\\b","Hudl":"Hudl HT7S3|Hudl 2","TelstraTablet":"T-Hub2","GenericTablet":"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b"},"browsers":{"Chrome":"\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?","Dolfin":"\\bDolfin\\b","Opera":"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+|Coast\/[0-9.]+","Skyfire":"Skyfire","Edge":"Mobile Safari\/[.0-9]* Edge","IE":"IEMobile|MSIEMobile","Firefox":"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS","Bolt":"bolt","TeaShark":"teashark","Blazer":"Blazer","Safari":"Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari","UCBrowser":"UC.*Browser|UCWEB","baiduboxapp":"baiduboxapp","baidubrowser":"baidubrowser","DiigoBrowser":"DiigoBrowser","Puffin":"Puffin","Mercury":"\\bMercury\\b","ObigoBrowser":"Obigo","NetFront":"NF-Browser","GenericBrowser":"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger","PaleMoon":"Android.*PaleMoon|Mobile.*PaleMoon"},"os":{"AndroidOS":"Android","BlackBerryOS":"blackberry|\\bBB10\\b|rim tablet os","PalmOS":"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino","SymbianOS":"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b","WindowsMobileOS":"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;","WindowsPhoneOS":"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;","iOS":"\\biPhone.*Mobile|\\biPod|\\biPad","MeeGoOS":"MeeGo","MaemoOS":"Maemo","JavaOS":"J2ME\/|\\bMIDP\\b|\\bCLDC\\b","webOS":"webOS|hpwOS","badaOS":"\\bBada\\b","BREWOS":"BREW"},"utilities":{"Bot":"Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom","MobileBot":"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2","DesktopMode":"WPDesktop","TV":"SonyDTV|HbbTV","WebKit":"(webkit)[ \/]([\\w.]+)","Console":"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\\b","Watch":"SM-V700"}}} \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.php b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.php deleted file mode 100644 index 6d0a36d5d7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/Mobile_Detect.php +++ /dev/null @@ -1,1460 +0,0 @@ - - * Nick Ilyin - * - * Original author: Victor Stanciu - * - * @license Code and contributions have 'MIT License' - * More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt - * - * @link Homepage: http://mobiledetect.net - * GitHub Repo: https://github.com/serbanghita/Mobile-Detect - * Google Code: http://code.google.com/p/php-mobile-detect/ - * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md - * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples - * - * @version 2.8.26 - */ - -class Mobile_Detect -{ - /** - * Mobile detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_MOBILE = 'mobile'; - - /** - * Extended detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_EXTENDED = 'extended'; - - /** - * A frequently used regular expression to extract version #s. - * - * @deprecated since version 2.6.9 - */ - const VER = '([\w._\+]+)'; - - /** - * Top-level device. - */ - const MOBILE_GRADE_A = 'A'; - - /** - * Mid-level device. - */ - const MOBILE_GRADE_B = 'B'; - - /** - * Low-level device. - */ - const MOBILE_GRADE_C = 'C'; - - /** - * Stores the version number of the current release. - */ - const VERSION = '2.8.26'; - - /** - * A type for the version() method indicating a string return value. - */ - const VERSION_TYPE_STRING = 'text'; - - /** - * A type for the version() method indicating a float return value. - */ - const VERSION_TYPE_FLOAT = 'float'; - - /** - * A cache for resolved matches - * @var array - */ - protected $cache = array(); - - /** - * The User-Agent HTTP header is stored in here. - * @var string - */ - protected $userAgent = null; - - /** - * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE. - * @var array - */ - protected $httpHeaders = array(); - - /** - * CloudFront headers. E.g. CloudFront-Is-Desktop-Viewer, CloudFront-Is-Mobile-Viewer & CloudFront-Is-Tablet-Viewer. - * @var array - */ - protected $cloudfrontHeaders = array(); - - /** - * The matching Regex. - * This is good for debug. - * @var string - */ - protected $matchingRegex = null; - - /** - * The matches extracted from the regex expression. - * This is good for debug. - * @var string - */ - protected $matchesArray = null; - - /** - * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED. - * - * @deprecated since version 2.6.9 - * - * @var string - */ - protected $detectionType = self::DETECTION_TYPE_MOBILE; - - /** - * HTTP headers that trigger the 'isMobile' detection - * to be true. - * - * @var array - */ - protected static $mobileHeaders = array( - - 'HTTP_ACCEPT' => array('matches' => array( - // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ - 'application/x-obml2d', - // BlackBerry devices. - 'application/vnd.rim.html', - 'text/vnd.wap.wml', - 'application/vnd.wap.xhtml+xml' - )), - 'HTTP_X_WAP_PROFILE' => null, - 'HTTP_X_WAP_CLIENTID' => null, - 'HTTP_WAP_CONNECTION' => null, - 'HTTP_PROFILE' => null, - // Reported by Opera on Nokia devices (eg. C3). - 'HTTP_X_OPERAMINI_PHONE_UA' => null, - 'HTTP_X_NOKIA_GATEWAY_ID' => null, - 'HTTP_X_ORANGE_ID' => null, - 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null, - 'HTTP_X_HUAWEI_USERID' => null, - // Reported by Windows Smartphones. - 'HTTP_UA_OS' => null, - // Reported by Verizon, Vodafone proxy system. - 'HTTP_X_MOBILE_GATEWAY' => null, - // Seen this on HTC Sensation. SensationXE_Beats_Z715e. - 'HTTP_X_ATT_DEVICEID' => null, - // Seen this on a HTC. - 'HTTP_UA_CPU' => array('matches' => array('ARM')), - ); - - /** - * List of mobile devices (phones). - * - * @var array - */ - protected static $phoneDevices = array( - 'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes - 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+', - 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m', - 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6', - // @todo: Is 'Dell Streak' a tablet or a phone? ;) - 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b', - 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b', - 'Samsung' => '\bSamsung\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C', - 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)', - 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533', - 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', - 'NokiaLumia' => 'Lumia [0-9]{3,4}', - // http://www.micromaxinfo.com/mobiles/smartphones - // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', - // @todo Complete the regex. - 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; - 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) - // http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) - // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android. - 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790', - // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones. - 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250', - // http://fr.wikomobile.com - 'Wiko' => 'KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM', - 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)', - // Added simvalley mobile just for fun. They have some interesting devices. - // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html - 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b', - // Wolfgang - a brand that is sold by Aldi supermarkets. - // http://www.wolfgangmobile.com/ - 'Wolfgang' => 'AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q', - 'Alcatel' => 'Alcatel', - 'Nintendo' => 'Nintendo 3DS', - // http://en.wikipedia.org/wiki/Amoi - 'Amoi' => 'Amoi', - // http://en.wikipedia.org/wiki/INQ - 'INQ' => 'INQ', - // @Tapatalk is a mobile app; http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039 - 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser', - ); - - /** - * List of tablet devices. - * - * @var array - */ - protected static $tabletDevices = array( - // @todo: check for mobile friendly emails topic. - 'iPad' => 'iPad|iPad.*Mobile', - // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$ - // @see #442 - 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone. - // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html - 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)', - // Only the Surface tablets with Windows RT are considered mobile. - // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx - 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)', - // http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT - 'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10', - // Watch out for PadFone, see #132. - // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/ - 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\bME70C\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\bP027\b', - 'BlackBerryTablet' => 'PlayBook|RIM Tablet', - 'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410', - 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', - 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2', - // http://www.acer.ro/ac/ro/RO/content/drivers - // http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer) - // http://us.acer.com/ac/en/US/content/group/tablets - // http://www.acer.de/ac/de/DE/content/models/tablets/ - // Can conflict with Micromax and Motorola phones codes. - 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b|\bA3-A11\b|\bA3-A20\b|\bA3-A30', - // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/ - // http://us.toshiba.com/tablets/tablet-finder - // http://www.toshiba.co.jp/regza/tablet/ - 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO', - // http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html - // http://www.lg.com/us/tablets - 'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b', - 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b', - // Prestigio Tablets http://www.prestigio.com/support - 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002', - // http://support.lenovo.com/en_GB/downloads/default.page?# - 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)', - // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets - 'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7', - // http://www.yarvik.com/en/matrix/tablets/ - 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b', - 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', - 'ArnovaTablet' => '97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2', - // http://www.intenso.de/kategorie_en.php?kategorie=33 - // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate - 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004', - // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/ - 'IRUTablet' => 'M702pro', - 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b', - // http://www.e-boda.ro/tablete-pc.html - 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)', - // http://www.allview.ro/produse/droseries/lista-tablete-pc/ - 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)', - // http://wiki.archosfans.com/index.php?title=Main_Page - // @note Rewrite the regex format after we add more UAs. - 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b', - // http://www.ainol.com/plugin.php?identifier=ainol&module=product - 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark', - 'NokiaLumiaTablet' => 'Lumia 2520', - // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER - // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser - // http://www.sony.jp/support/tablet/ - 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31', - // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8 - 'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b', - // db + http://www.cube-tablet.com/buy-products.html - 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT', - // http://www.cobyusa.com/?p=pcat&pcat_id=3001 - 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010', - // http://www.match.net.cn/products.asp - 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10', - // http://www.msi.com/support - // @todo Research the Windows Tablets. - 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b', - // @todo http://www.kyoceramobile.com/support/drivers/ - // 'KyoceraTablet' => null, - // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/ - // 'IntextTablet' => null, - // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) - // http://www.imp3.net/14/show.php?itemid=20454 - 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', - // http://www.rock-chips.com/index.php?do=prod&pid=2 - 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', - // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ - 'FlyTablet' => 'IQ310|Fly Vision', - // http://www.bqreaders.com/gb/tablets-prices-sale.html - 'bqTablet' => 'Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris [E|M]10)|Maxwell.*Lite|Maxwell.*Plus', - // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 - // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) - 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim', - // Nec or Medias Tab - 'NecTablet' => '\bN-06D|\bN-08D', - // Pantech Tablets: http://www.pantechusa.com/phones/ - 'PantechTablet' => 'Pantech.*P4100', - // Broncho Tablets: http://www.broncho.cn/ (hard to find) - 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)', - // http://versusuk.com/support.html - 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b', - // http://www.zync.in/index.php/our-products/tablet-phablets - 'ZyncTablet' => 'z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900', - // http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ - 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA', - // https://www.nabitablet.com/ - 'NabiTablet' => 'Android.*\bNabi', - 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build', - // French Danew Tablets http://www.danew.com/produits-tablette.php - 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b', - // Texet Tablets and Readers http://www.texet.ru/tablet/ - 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE', - // Avoid detecting 'PLAYSTATION 3' as mobile. - 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', - // http://www.trekstor.de/surftabs.html - 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab', - // http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets - 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b', - // http://www.advandigital.com/index.php?link=content-product&jns=JP001 - // because of the short codenames we have to include whitespaces to reduce the possible conflicts. - 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ', - // http://www.danytech.com/category/tablet-pc - 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1', - // http://www.galapad.net/product.html - 'GalapadTablet' => 'Android.*\bG1\b', - // http://www.micromaxinfo.com/tablet/funbook - 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b', - // http://www.karbonnmobiles.com/products_tablet.php - 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b', - // http://www.myallfine.com/Products.asp - 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide', - // http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= - 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b', - // http://www.yonesnav.com/products/products.php - 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026', - // http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 - // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html) - 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503', - // http://www.gloryunion.cn/products.asp - // http://www.allwinnertech.com/en/apply/mobile.html - // http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB) - // @todo: Softwiner tablets? - // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions. - 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G - // http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118 - 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10', - // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/ - // @todo: add more tests. - 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)', - // http://hclmetablet.com/India/index.php - 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync', - // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html - 'DPSTablet' => 'DPS Dream 9|DPS Dual 7', - // http://www.visture.com/index.asp - 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10', - // http://www.mijncresta.nl/tablet - 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989', - // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309 - 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b', - // Concorde tab - 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan', - // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/ - 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042', - // Modecom Tablets - http://www.modecom.eu/tablets/portal/ - 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003', - // Vonino Tablets - http://www.vonino.eu/tablets - 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b', - // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0 - 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1', - // Storex Tablets - http://storex.fr/espace_client/support.html - // @note: no need to add all the tablet codes since they are guided by the first regex. - 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab', - // Generic Vodafone tablets. - 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497', - // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb - // Aka: http://www.essentielb.fr/ - 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2', - // Ross & Moor - http://ross-moor.ru/ - 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711', - // i-mobile http://product.i-mobilephone.com/Mobile_Device - 'iMobileTablet' => 'i-mobile i-note', - // http://www.tolino.de/de/vergleichen/ - 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine', - // AudioSonic - a Kmart brand - // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72¤tPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1 - 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b', - // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/ - // @todo: add them gradually to avoid conflicts. - 'AMPETablet' => 'Android.* A78 ', - // Skk Mobile - http://skkmobile.com.ph/product_tablets.php - 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)', - // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1 - 'TecnoTablet' => 'TECNO P9', - // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3 - 'JXDTablet' => 'Android.* \b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b', - // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/ - 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)', - // http://www.intracon.eu/tablet - 'FX2Tablet' => 'FX2 PAD7|FX2 PAD10', - // http://www.xoro.de/produkte/ - // @note: Might be the same brand with 'Simply tablets' - 'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151', - // http://www1.viewsonic.com/products/computing/tablets/ - 'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a', - // http://www.odys.de/web/internet-tablet_en.html - 'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10', - // http://www.captiva-power.de/products.html#tablets-en - 'CaptivaTablet' => 'CAPTIVA PAD', - // IconBIT - http://www.iconbit.com/products/tablets/ - 'IconbitTablet' => 'NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S', - // http://www.teclast.com/topic.php?channelID=70&topicID=140&pid=63 - 'TeclastTablet' => 'T98 4G|\bP80\b|\bX90HD\b|X98 Air|X98 Air 3G|\bX89\b|P80 3G|\bX80h\b|P98 Air|\bX89HD\b|P98 3G|\bP90HD\b|P89 3G|X98 3G|\bP70h\b|P79HD 3G|G18d 3G|\bP79HD\b|\bP89s\b|\bA88\b|\bP10HD\b|\bP19HD\b|G18 3G|\bP78HD\b|\bA78\b|\bP75\b|G17s 3G|G17h 3G|\bP85t\b|\bP90\b|\bP11\b|\bP98t\b|\bP98HD\b|\bG18d\b|\bP85s\b|\bP11HD\b|\bP88s\b|\bA80HD\b|\bA80se\b|\bA10h\b|\bP89\b|\bP78s\b|\bG18\b|\bP85\b|\bA70h\b|\bA70\b|\bG17\b|\bP18\b|\bA80s\b|\bA11s\b|\bP88HD\b|\bA80h\b|\bP76s\b|\bP76h\b|\bP98\b|\bA10HD\b|\bP78\b|\bP88\b|\bA11\b|\bA10t\b|\bP76a\b|\bP76t\b|\bP76e\b|\bP85HD\b|\bP85a\b|\bP86\b|\bP75HD\b|\bP76v\b|\bA12\b|\bP75a\b|\bA15\b|\bP76Ti\b|\bP81HD\b|\bA10\b|\bT760VE\b|\bT720HD\b|\bP76\b|\bP73\b|\bP71\b|\bP72\b|\bT720SE\b|\bC520Ti\b|\bT760\b|\bT720VE\b|T720-3GE|T720-WiFi', - // Onda - http://www.onda-tablet.com/buy-android-onda.html?dir=desc&limit=all&order=price - 'OndaTablet' => '\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\b[\s]+', - 'JaytechTablet' => 'TPC-PA762', - 'BlaupunktTablet' => 'Endeavour 800NG|Endeavour 1010', - // http://www.digma.ru/support/download/ - // @todo: Ebooks also (if requested) - 'DigmaTablet' => '\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\b', - // http://www.evolioshop.com/ro/tablete-pc.html - // http://www.evolio.ro/support/downloads_static.html?cat=2 - // @todo: Research some more - 'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b', - // @todo http://www.lavamobiles.com/tablets-data-cards - 'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b', - // http://www.breezetablet.com/ - 'AocTablet' => 'MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712', - // http://www.mpmaneurope.com/en/products/internet-tablets-14/android-tablets-14/ - 'MpmanTablet' => 'MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\bMPG7\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010', - // https://www.celkonmobiles.com/?_a=categoryphones&sid=2 - 'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b', - // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab - 'WolderTablet' => 'miTab \b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\b', - // http://www.mi.com/en - 'MiTablet' => '\bMI PAD\b|\bHM NOTE 1W\b', - // http://www.nbru.cn/index.html - 'NibiruTablet' => 'Nibiru M1|Nibiru Jupiter One', - // http://navroad.com/products/produkty/tablety/ - // http://navroad.com/products/produkty/tablety/ - 'NexoTablet' => 'NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI', - // http://leader-online.com/new_site/product-category/tablets/ - // http://www.leader-online.net.au/List/Tablet - 'LeaderTablet' => 'TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100', - // http://www.datawind.com/ubislate/ - 'UbislateTablet' => 'UbiSlate[\s]?7C', - // http://www.pocketbook-int.com/ru/support - 'PocketBookTablet' => 'Pocketbook', - // http://www.kocaso.com/product_tablet.html - 'KocasoTablet' => '\b(TB-1207)\b', - // http://global.hisense.com/product/asia/tablet/Sero7/201412/t20141215_91832.htm - 'HisenseTablet' => '\b(F5281|E2371)\b', - // http://www.tesco.com/direct/hudl/ - 'Hudl' => 'Hudl HT7S3|Hudl 2', - // http://www.telstra.com.au/home-phone/thub-2/ - 'TelstraTablet' => 'T-Hub2', - 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bTP750\b|\bQTAQZ3\b' - ); - - /** - * List of mobile Operating Systems. - * - * @var array - */ - protected static $operatingSystems = array( - 'AndroidOS' => 'Android', - 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os', - 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', - 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', - // @reference: http://en.wikipedia.org/wiki/Windows_Mobile - 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', - // @reference: http://en.wikipedia.org/wiki/Windows_Phone - // http://wifeng.cn/?r=blog&a=view&id=106 - // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx - // http://msdn.microsoft.com/library/ms537503.aspx - // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx - 'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;', - 'iOS' => '\biPhone.*Mobile|\biPod|\biPad', - // http://en.wikipedia.org/wiki/MeeGo - // @todo: research MeeGo in UAs - 'MeeGoOS' => 'MeeGo', - // http://en.wikipedia.org/wiki/Maemo - // @todo: research Maemo in UAs - 'MaemoOS' => 'Maemo', - 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135 - 'webOS' => 'webOS|hpwOS', - 'badaOS' => '\bBada\b', - 'BREWOS' => 'BREW', - ); - - /** - * List of mobile User Agents. - * - * IMPORTANT: This is a list of only mobile browsers. - * Mobile Detect 2.x supports only mobile browsers, - * it was never designed to detect all browsers. - * The change will come in 2017 in the 3.x release for PHP7. - * - * @var array - */ - protected static $browsers = array( - //'Vivaldi' => 'Vivaldi', - // @reference: https://developers.google.com/chrome/mobile/docs/user-agent - 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', - 'Dolfin' => '\bDolfin\b', - 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+', - 'Skyfire' => 'Skyfire', - 'Edge' => 'Mobile Safari/[.0-9]* Edge', - 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+ - 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS', - 'Bolt' => 'bolt', - 'TeaShark' => 'teashark', - 'Blazer' => 'Blazer', - // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 - 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari', - // http://en.wikipedia.org/wiki/Midori_(web_browser) - //'Midori' => 'midori', - //'Tizen' => 'Tizen', - 'UCBrowser' => 'UC.*Browser|UCWEB', - 'baiduboxapp' => 'baiduboxapp', - 'baidubrowser' => 'baidubrowser', - // https://github.com/serbanghita/Mobile-Detect/issues/7 - 'DiigoBrowser' => 'DiigoBrowser', - // http://www.puffinbrowser.com/index.php - 'Puffin' => 'Puffin', - // http://mercury-browser.com/index.html - 'Mercury' => '\bMercury\b', - // http://en.wikipedia.org/wiki/Obigo_Browser - 'ObigoBrowser' => 'Obigo', - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NF-Browser', - // @reference: http://en.wikipedia.org/wiki/Minimo - // http://en.wikipedia.org/wiki/Vision_Mobile_Browser - 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger', - // @reference: https://en.wikipedia.org/wiki/Pale_Moon_(web_browser) - 'PaleMoon' => 'Android.*PaleMoon|Mobile.*PaleMoon', - ); - - /** - * Utilities. - * - * @var array - */ - protected static $utilities = array( - // Experimental. When a mobile device wants to switch to 'Desktop Mode'. - // http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/ - // https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011 - // https://developers.facebook.com/docs/sharing/best-practices - 'Bot' => 'Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom', - 'MobileBot' => 'Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2', - 'DesktopMode' => 'WPDesktop', - 'TV' => 'SonyDTV|HbbTV', // experimental - 'WebKit' => '(webkit)[ /]([\w.]+)', - // @todo: Include JXD consoles. - 'Console' => '\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b', - 'Watch' => 'SM-V700', - ); - - /** - * All possible HTTP headers that represent the - * User-Agent string. - * - * @var array - */ - protected static $uaHttpHeaders = array( - // The default User-Agent string. - 'HTTP_USER_AGENT', - // Header can occur on devices using Opera Mini. - 'HTTP_X_OPERAMINI_PHONE_UA', - // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ - 'HTTP_X_DEVICE_USER_AGENT', - 'HTTP_X_ORIGINAL_USER_AGENT', - 'HTTP_X_SKYFIRE_PHONE', - 'HTTP_X_BOLT_PHONE_UA', - 'HTTP_DEVICE_STOCK_UA', - 'HTTP_X_UCBROWSER_DEVICE_UA' - ); - - /** - * The individual segments that could exist in a User-Agent string. VER refers to the regular - * expression defined in the constant self::VER. - * - * @var array - */ - protected static $properties = array( - - // Build - 'Mobile' => 'Mobile/[VER]', - 'Build' => 'Build/[VER]', - 'Version' => 'Version/[VER]', - 'VendorID' => 'VendorID/[VER]', - - // Devices - 'iPad' => 'iPad.*CPU[a-z ]+[VER]', - 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', - 'iPod' => 'iPod.*CPU[a-z ]+[VER]', - //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), - 'Kindle' => 'Kindle/[VER]', - - // Browser - 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'), - 'Coast' => array('Coast/[VER]'), - 'Dolfin' => 'Dolfin/[VER]', - // @reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox - 'Firefox' => array('Firefox/[VER]', 'FxiOS/[VER]'), - 'Fennec' => 'Fennec/[VER]', - // http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx - // https://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx - 'Edge' => 'Edge/[VER]', - 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'Trident/[0-9.]+;.*rv:[VER]'), - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NetFront/[VER]', - 'NokiaBrowser' => 'NokiaBrowser/[VER]', - 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ), - 'Opera Mini' => 'Opera Mini/[VER]', - 'Opera Mobi' => 'Version/[VER]', - 'UC Browser' => 'UC Browser[VER]', - 'MQQBrowser' => 'MQQBrowser/[VER]', - 'MicroMessenger' => 'MicroMessenger/[VER]', - 'baiduboxapp' => 'baiduboxapp/[VER]', - 'baidubrowser' => 'baidubrowser/[VER]', - 'SamsungBrowser' => 'SamsungBrowser/[VER]', - 'Iron' => 'Iron/[VER]', - // @note: Safari 7534.48.3 is actually Version 5.1. - // @note: On BlackBerry the Version is overwriten by the OS. - 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ), - 'Skyfire' => 'Skyfire/[VER]', - 'Tizen' => 'Tizen/[VER]', - 'Webkit' => 'webkit[ /][VER]', - 'PaleMoon' => 'PaleMoon/[VER]', - - // Engine - 'Gecko' => 'Gecko/[VER]', - 'Trident' => 'Trident/[VER]', - 'Presto' => 'Presto/[VER]', - 'Goanna' => 'Goanna/[VER]', - - // OS - 'iOS' => ' \bi?OS\b [VER][ ;]{1}', - 'Android' => 'Android [VER]', - 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'), - 'BREW' => 'BREW [VER]', - 'Java' => 'Java/[VER]', - // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx - // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases - 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'), - 'Windows Phone' => 'Windows Phone [VER]', - 'Windows CE' => 'Windows CE/[VER]', - // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd - 'Windows NT' => 'Windows NT [VER]', - 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), - 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), - ); - - /** - * Construct an instance of this class. - * - * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored. - * If left empty, will use the global _SERVER['HTTP_*'] vars instead. - * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT - * from the $headers array instead. - */ - public function __construct( - array $headers = null, - $userAgent = null - ) { - $this->setHttpHeaders($headers); - $this->setUserAgent($userAgent); - } - - /** - * Get the current script version. - * This is useful for the demo.php file, - * so people can check on what version they are testing - * for mobile devices. - * - * @return string The version number in semantic version format. - */ - public static function getScriptVersion() - { - return self::VERSION; - } - - /** - * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. - * - * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract - * the headers. The default null is left for backwards compatibility. - */ - public function setHttpHeaders($httpHeaders = null) - { - // use global _SERVER if $httpHeaders aren't defined - if (!is_array($httpHeaders) || !count($httpHeaders)) { - $httpHeaders = $_SERVER; - } - - // clear existing headers - $this->httpHeaders = array(); - - // Only save HTTP headers. In PHP land, that means only _SERVER vars that - // start with HTTP_. - foreach ($httpHeaders as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $this->httpHeaders[$key] = $value; - } - } - - // In case we're dealing with CloudFront, we need to know. - $this->setCfHeaders($httpHeaders); - } - - /** - * Retrieves the HTTP headers. - * - * @return array - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Retrieves a particular header. If it doesn't exist, no exception/error is caused. - * Simply null is returned. - * - * @param string $header The name of the header to retrieve. Can be HTTP compliant such as - * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the - * all-caps, HTTP_ prefixed, underscore seperated awesomeness. - * - * @return string|null The value of the header. - */ - public function getHttpHeader($header) - { - // are we using PHP-flavored headers? - if (strpos($header, '_') === false) { - $header = str_replace('-', '_', $header); - $header = strtoupper($header); - } - - // test the alternate, too - $altHeader = 'HTTP_' . $header; - - //Test both the regular and the HTTP_ prefix - if (isset($this->httpHeaders[$header])) { - return $this->httpHeaders[$header]; - } elseif (isset($this->httpHeaders[$altHeader])) { - return $this->httpHeaders[$altHeader]; - } - - return null; - } - - public function getMobileHeaders() - { - return self::$mobileHeaders; - } - - /** - * Get all possible HTTP headers that - * can contain the User-Agent string. - * - * @return array List of HTTP headers. - */ - public function getUaHttpHeaders() - { - return self::$uaHttpHeaders; - } - - - /** - * Set CloudFront headers - * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device - * - * @param array $cfHeaders List of HTTP headers - * - * @return boolean If there were CloudFront headers to be set - */ - public function setCfHeaders($cfHeaders = null) { - // use global _SERVER if $cfHeaders aren't defined - if (!is_array($cfHeaders) || !count($cfHeaders)) { - $cfHeaders = $_SERVER; - } - - // clear existing headers - $this->cloudfrontHeaders = array(); - - // Only save CLOUDFRONT headers. In PHP land, that means only _SERVER vars that - // start with cloudfront-. - $response = false; - foreach ($cfHeaders as $key => $value) { - if (substr(strtolower($key), 0, 16) === 'http_cloudfront_') { - $this->cloudfrontHeaders[strtoupper($key)] = $value; - $response = true; - } - } - - return $response; - } - - /** - * Retrieves the cloudfront headers. - * - * @return array - */ - public function getCfHeaders() - { - return $this->cloudfrontHeaders; - } - - /** - * Set the User-Agent to be used. - * - * @param string $userAgent The user agent string to set. - * - * @return string|null - */ - public function setUserAgent($userAgent = null) - { - // Invalidate cache due to #375 - $this->cache = array(); - - if (false === empty($userAgent)) { - return $this->userAgent = $userAgent; - } else { - $this->userAgent = null; - foreach ($this->getUaHttpHeaders() as $altHeader) { - if (false === empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban) - $this->userAgent .= $this->httpHeaders[$altHeader] . " "; - } - } - - if (!empty($this->userAgent)) { - return $this->userAgent = trim($this->userAgent); - } - } - - if (count($this->getCfHeaders()) > 0) { - return $this->userAgent = 'Amazon CloudFront'; - } - return $this->userAgent = null; - } - - /** - * Retrieve the User-Agent. - * - * @return string|null The user agent if it's set. - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or - * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. - * - * @deprecated since version 2.6.9 - * - * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default - * parameter is null which will default to self::DETECTION_TYPE_MOBILE. - */ - public function setDetectionType($type = null) - { - if ($type === null) { - $type = self::DETECTION_TYPE_MOBILE; - } - - if ($type !== self::DETECTION_TYPE_MOBILE && $type !== self::DETECTION_TYPE_EXTENDED) { - return; - } - - $this->detectionType = $type; - } - - public function getMatchingRegex() - { - return $this->matchingRegex; - } - - public function getMatchesArray() - { - return $this->matchesArray; - } - - /** - * Retrieve the list of known phone devices. - * - * @return array List of phone devices. - */ - public static function getPhoneDevices() - { - return self::$phoneDevices; - } - - /** - * Retrieve the list of known tablet devices. - * - * @return array List of tablet devices. - */ - public static function getTabletDevices() - { - return self::$tabletDevices; - } - - /** - * Alias for getBrowsers() method. - * - * @return array List of user agents. - */ - public static function getUserAgents() - { - return self::getBrowsers(); - } - - /** - * Retrieve the list of known browsers. Specifically, the user agents. - * - * @return array List of browsers / user agents. - */ - public static function getBrowsers() - { - return self::$browsers; - } - - /** - * Retrieve the list of known utilities. - * - * @return array List of utilities. - */ - public static function getUtilities() - { - return self::$utilities; - } - - /** - * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). - * - * @deprecated since version 2.6.9 - * - * @return array All the rules (but not extended). - */ - public static function getMobileDetectionRules() - { - static $rules; - - if (!$rules) { - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers - ); - } - - return $rules; - - } - - /** - * Method gets the mobile detection rules + utilities. - * The reason this is separate is because utilities rules - * don't necessary imply mobile. This method is used inside - * the new $detect->is('stuff') method. - * - * @deprecated since version 2.6.9 - * - * @return array All the rules + extended. - */ - public function getMobileDetectionRulesExtended() - { - static $rules; - - if (!$rules) { - // Merge all rules together. - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers, - self::$utilities - ); - } - - return $rules; - } - - /** - * Retrieve the current set of rules. - * - * @deprecated since version 2.6.9 - * - * @return array - */ - public function getRules() - { - if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) { - return self::getMobileDetectionRulesExtended(); - } else { - return self::getMobileDetectionRules(); - } - } - - /** - * Retrieve the list of mobile operating systems. - * - * @return array The list of mobile operating systems. - */ - public static function getOperatingSystems() - { - return self::$operatingSystems; - } - - /** - * Check the HTTP headers for signs of mobile. - * This is the fastest mobile check possible; it's used - * inside isMobile() method. - * - * @return bool - */ - public function checkHttpHeadersForMobile() - { - - foreach ($this->getMobileHeaders() as $mobileHeader => $matchType) { - if (isset($this->httpHeaders[$mobileHeader])) { - if (is_array($matchType['matches'])) { - foreach ($matchType['matches'] as $_match) { - if (strpos($this->httpHeaders[$mobileHeader], $_match) !== false) { - return true; - } - } - - return false; - } else { - return true; - } - } - } - - return false; - - } - - /** - * Magic overloading method. - * - * @method boolean is[...]() - * @param string $name - * @param array $arguments - * @return mixed - * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' - */ - public function __call($name, $arguments) - { - // make sure the name starts with 'is', otherwise - if (substr($name, 0, 2) !== 'is') { - throw new BadMethodCallException("No such method exists: $name"); - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - $key = substr($name, 2); - - return $this->matchUAAgainstKey($key); - } - - /** - * Find a detection rule that matches the current User-agent. - * - * @param null $userAgent deprecated - * @return boolean - */ - protected function matchDetectionRulesAgainstUA($userAgent = null) - { - // Begin general search. - foreach ($this->getRules() as $_regex) { - if (empty($_regex)) { - continue; - } - - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * Search for a certain key in the rules array. - * If the key is found then try to match the corresponding - * regex against the User-Agent. - * - * @param string $key - * - * @return boolean - */ - protected function matchUAAgainstKey($key) - { - // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. - $key = strtolower($key); - if (false === isset($this->cache[$key])) { - - // change the keys to lower case - $_rules = array_change_key_case($this->getRules()); - - if (false === empty($_rules[$key])) { - $this->cache[$key] = $this->match($_rules[$key]); - } - - if (false === isset($this->cache[$key])) { - $this->cache[$key] = false; - } - } - - return $this->cache[$key]; - } - - /** - * Check if the device is mobile. - * Returns true if any type of mobile device detected, including special ones - * @param null $userAgent deprecated - * @param null $httpHeaders deprecated - * @return bool - */ - public function isMobile($userAgent = null, $httpHeaders = null) - { - - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_MOBILE_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - if ($this->checkHttpHeadersForMobile()) { - return true; - } else { - return $this->matchDetectionRulesAgainstUA(); - } - - } - - /** - * Check if the device is a tablet. - * Return true if any type of tablet device is detected. - * - * @param string $userAgent deprecated - * @param array $httpHeaders deprecated - * @return bool - */ - public function isTablet($userAgent = null, $httpHeaders = null) - { - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_TABLET_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_TABLET_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - foreach (self::$tabletDevices as $_regex) { - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * This method checks for a certain property in the - * userAgent. - * @todo: The httpHeaders part is not yet used. - * - * @param string $key - * @param string $userAgent deprecated - * @param string $httpHeaders deprecated - * @return bool|int|null - */ - public function is($key, $userAgent = null, $httpHeaders = null) - { - // Set the UA and HTTP headers only if needed (eg. batch mode). - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - $this->setDetectionType(self::DETECTION_TYPE_EXTENDED); - - return $this->matchUAAgainstKey($key); - } - - /** - * Some detection rules are relative (not standard), - * because of the diversity of devices, vendors and - * their conventions in representing the User-Agent or - * the HTTP headers. - * - * This method will be used to check custom regexes against - * the User-Agent string. - * - * @param $regex - * @param string $userAgent - * @return bool - * - * @todo: search in the HTTP headers too. - */ - public function match($regex, $userAgent = null) - { - $match = (bool) preg_match(sprintf('#%s#is', $regex), (false === empty($userAgent) ? $userAgent : $this->userAgent), $matches); - // If positive match is found, store the results for debug. - if ($match) { - $this->matchingRegex = $regex; - $this->matchesArray = $matches; - } - - return $match; - } - - /** - * Get the properties array. - * - * @return array - */ - public static function getProperties() - { - return self::$properties; - } - - /** - * Prepare the version number. - * - * @todo Remove the error supression from str_replace() call. - * - * @param string $ver The string version, like "2.6.21.2152"; - * - * @return float - */ - public function prepareVersionNo($ver) - { - $ver = str_replace(array('_', ' ', '/'), '.', $ver); - $arrVer = explode('.', $ver, 2); - - if (isset($arrVer[1])) { - $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. - } - - return (float) implode('.', $arrVer); - } - - /** - * Check the version of the given property in the User-Agent. - * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) - * - * @param string $propertyName The name of the property. See self::getProperties() array - * keys for all possible properties. - * @param string $type Either self::VERSION_TYPE_STRING to get a string value or - * self::VERSION_TYPE_FLOAT indicating a float value. This parameter - * is optional and defaults to self::VERSION_TYPE_STRING. Passing an - * invalid parameter will default to the this type as well. - * - * @return string|float The version of the property we are trying to extract. - */ - public function version($propertyName, $type = self::VERSION_TYPE_STRING) - { - if (empty($propertyName)) { - return false; - } - - // set the $type to the default if we don't recognize the type - if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) { - $type = self::VERSION_TYPE_STRING; - } - - $properties = self::getProperties(); - - // Check if the property exists in the properties array. - if (true === isset($properties[$propertyName])) { - - // Prepare the pattern to be matched. - // Make sure we always deal with an array (string is converted). - $properties[$propertyName] = (array) $properties[$propertyName]; - - foreach ($properties[$propertyName] as $propertyMatchString) { - - $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); - - // Identify and extract the version. - preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match); - - if (false === empty($match[1])) { - $version = ($type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]); - - return $version; - } - - } - - } - - return false; - } - - /** - * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. - * - * @return string One of the self::MOBILE_GRADE_* constants. - */ - public function mobileGrade() - { - $isMobile = $this->isMobile(); - - if ( - // Apple iOS 4-7.0 – Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3 / 5.1 / 6.1), iPad 3 (5.1 / 6.0), iPad Mini (6.1), iPad Retina (7.0), iPhone 3GS (4.3), iPhone 4 (4.3 / 5.1), iPhone 4S (5.1 / 6.0), iPhone 5 (6.0), and iPhone 5S (7.0) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) >= 4.3 || - - // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) - // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM - // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices - // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 - ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) || - - // Windows Phone 7.5-8 - Tested on the HTC Surround (7.5), HTC Trophy (7.5), LG-E900 (7.5), Nokia 800 (7.8), HTC Mazaa (7.8), Nokia Lumia 520 (8), Nokia Lumia 920 (8), HTC 8x (8) - $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT) >= 7.5 || - - // Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry® Torch 9810 (7), BlackBerry Z10 (10) - $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 6.0 || - // Blackberry Playbook (1.0-2.0) - Tested on PlayBook - $this->match('Playbook.*Tablet') || - - // Palm WebOS (1.4-3.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0), HP TouchPad (3.0) - ( $this->version('webOS', self::VERSION_TYPE_FLOAT) >= 1.4 && $this->match('Palm|Pre|Pixi') ) || - // Palm WebOS 3.0 - Tested on HP TouchPad - $this->match('hp.*TouchPad') || - - // Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices - ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 18 ) || - - // Chrome for Android - Tested on Android 4.0, 4.1 device - ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 4.0 ) || - - // Skyfire 4.1 - Tested on Android 2.3 device - ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT) >= 4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Opera Mobile 11.5-12: Tested on Android 2.3 - ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11.5 && $this->is('AndroidOS') ) || - - // Meego 1.2 - Tested on Nokia 950 and N9 - $this->is('MeeGoOS') || - - // Tizen (pre-release) - Tested on early hardware - $this->is('Tizen') || - - // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser - // @todo: more tests here! - $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT) >= 2.0 || - - // UC Browser - Tested on Android 2.3 device - ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Kindle 3 and Fire - Tested on the built-in WebKit browser for each - ( $this->match('Kindle Fire') || - $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT) >= 3.0 ) || - - // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet - $this->is('AndroidOS') && $this->is('NookTablet') || - - // Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7 - $this->version('Chrome', self::VERSION_TYPE_FLOAT) >= 16 && !$isMobile || - - // Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7 - $this->version('Safari', self::VERSION_TYPE_FLOAT) >= 5.0 && !$isMobile || - - // Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7 - $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 10.0 && !$isMobile || - - // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 - $this->version('IE', self::VERSION_TYPE_FLOAT) >= 7.0 && !$isMobile || - - // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 - $this->version('Opera', self::VERSION_TYPE_FLOAT) >= 10 && !$isMobile - ){ - return self::MOBILE_GRADE_A; - } - - if ( - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 || - - // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 - $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 || - - //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 - ($this->version('Opera Mini', self::VERSION_TYPE_FLOAT) >= 5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT) <= 7.0 && - ($this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 || $this->is('iOS')) ) || - - // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) - $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || - - // @todo: report this (tested on Nokia N71) - $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11 && $this->is('SymbianOS') - ){ - return self::MOBILE_GRADE_B; - } - - if ( - // Blackberry 4.x - Tested on the Curve 8330 - $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) <= 5.0 || - // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) - $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT) <= 5.2 || - - // Tested on original iPhone (3.1), iPhone 3 (3.2) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) <= 3.2 || - - // Internet Explorer 7 and older - Tested on Windows XP - $this->version('IE', self::VERSION_TYPE_FLOAT) <= 7.0 && !$isMobile - ){ - return self::MOBILE_GRADE_C; - } - - // All older smartphone platforms and featurephones - Any device that doesn't support media queries - // will receive the basic, C grade experience. - return self::MOBILE_GRADE_C; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/README.md b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/README.md deleted file mode 100644 index c33d70149f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/README.md +++ /dev/null @@ -1,283 +0,0 @@ -![Mobile Detect](http://demo.mobiledetect.net/logo-github.png) - -> Motto: "Every business should have a mobile detection script to detect mobile readers." - -[![Build Status](https://travis-ci.org/serbanghita/Mobile-Detect.svg?branch=devel)](https://travis-ci.org/serbanghita/Mobile-Detect) -[![Latest Stable Version](https://poser.pugx.org/mobiledetect/mobiledetectlib/v/stable.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![Total Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/downloads.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![Daily Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/d/daily.png)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![License](https://poser.pugx.org/mobiledetect/mobiledetectlib/license.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) - -*Mobile_Detect is a lightweight PHP class for detecting mobile devices (including tablets). -It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.* - -We're committed to make Mobile_Detect the best open-source mobile detection resource and this is why before -each release we're running [unit tests](./tests), we also research and update the detection rules on **daily** -and **weekly** basis. - -Your website's _content strategy_ is important! You need a complete toolkit to deliver an experience that is _optimized_, _fast_ and _relevant_ to your users. Mobile_Detect class is a [server-side detection](http://www.w3.org/TR/mwabp/#bp-devcap-detection) tool that can help you with your RWD strategy, it is not a replacement for CSS3 media queries or other forms of client-side feature detection. - -##### Announcements - -For `2.x` branch we are no longer taking optimizations pull requests, but only new regexes and User-Agents for our tests. -On `2.x` releases we are focusing on **new tablets only**. All the pull requests about TVs, bots or optimizations will be closed and analyzed after `3.0.0-beta` is released. - -Still working on `3.0.0` branch to provide you with device detection! -We're really excited on this one! -We would like to speed this up, but life and family gets in the way ;) - -Special thanks to **JetBrains** for providing licenses for **PHPStorm**. In case you never heard or tried PHPStorm, you're -clearly missing out! [Check PHPStorm](https://www.jetbrains.com/phpstorm/) out! - -##### Download and demo - -|Download|Docs|Examples| -|-------------|-------------|-------------| -|[Go to releases](../../tags)|[Become a contributor](../../wiki/Become-a-contributor)|[Code examples](../../wiki/Code-examples) -|[Mobile_Detect.php](./Mobile_Detect.php)|[History](../../wiki/History)|[:iphone: Live demo!](http://is.gd/mobiletest) -|[Composer package](https://packagist.org/packages/mobiledetect/mobiledetectlib)| - -#### Continuous updates - -You can use [composer](https://getcomposer.org/doc/00-intro.md) in your release and update process to make sure you have the latest Mobile_Detect version. - -``` -composer require mobiledetect/mobiledetectlib -``` - -```json -{ - "require": { - "mobiledetect/mobiledetectlib": "^2.8" - } -} -``` - -##### Help - -|Pledgie|Paypal| -|-------|------| -|[Donate :+1:](https://pledgie.com/campaigns/21856)|[Donate :beer:](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mobiledetectlib%40gmail%2ecom&lc=US&item_name=Mobile%20Detect¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)| - - -I'm currently paying for hosting and spend a lot of my family time to maintain the project and planning the future releases. -I would highly appreciate any money donations that will keep the research going. - -Special thanks to the community :+1: for donations, [BrowserStack](https://www.browserstack.com/) - for providing access to their great platform, [Zend](http://www.zend.com/) - for donating licenses, [Dragos Gavrila](https://twitter.com/grafician) who contributed with the logo. - -##### 3rd party modules / [Submit new](../../issues/new?title=New%203rd%20party%20module&body=Name, Link and Description of the module.) - -:point_right: Keep `Mobile_Detect.php` class in a separate `module` and do NOT include it in your script core because of the high frequency of updates. -:point_right: When including the class into you `web application` or `module` always use `include_once '../path/to/Mobile_Detect.php` to prevent conflicts. - -**JavaScript** - -* mobile-detect.js - A [JavaScript port](https://github.com/hgoebl/mobile-detect.js) of Mobile-Detect class. Made by [Heinrich Goebl](https://github.com/hgoebl). - -**Varnish Cache** - -* [Varnish Mobile Detect](https://github.com/willemk/varnish-mobiletranslate) - Drop-in varnish solution to mobile user -detection based on the Mobile-Detect library. Made by [willemk](https://github.com/willemk). -* [mobiledetect2vcl](https://github.com/carlosabalde/mobiledetect2vcl) - Python script to transform the Mobile -Detect JSON database into an UA-based mobile detection VCL subroutine easily integrable in any Varnish Cache -configuration. Made by [Carlos Abalde](https://github.com/carlosabalde). - -**LUA** - -* [mobile-detect.lua](https://github.com/yourpalmark/mobile-detect.lua) is a port of Mobile-Detect to Lua for -NGINX HTTP servers. Follows closely to mobile-detect.js. Supports all methods that server-side -mobile-detect.js supports. Fully unit-tested and synced with Travis CI (Build Passing badge included). -Made by [Mark Walters](https://github.com/yourpalmark). - -**PHP** - -**WordPress** - -* [WordPress Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/) - Gives you the ability to wrap that -infographic in a `[notdevice][/notdevice]` shortcode so at the server level WordPress will -decide to show that content only if the user is NOT on a phone or tablet. -Made by [Jesse Friedman](https://profiles.wordpress.org/professor44/). - -* [mobble](https://wordpress.org/plugins/mobble/) - provides mobile related conditional functions for your site. -e.g. `is_iphone()`, `is_mobile()` and `is_tablet()`. Made by Scott Evans. - -* [WordPress Responsage](https://github.com/iamspacehead/responsage) - A small WordPress theme plugin that allows -you to make your images responsive. Made by [Adrian Ciaschetti](https://github.com/iamspacehead). - -* [WP247 Body Classes](https://wordpress.org/plugins/wp247-body-classes/) - Add unique classes to the `body` tag for -easy styling based on various attributes (archive, user, post, mobile) and various WordPress "is" functions. -Mobile attributes include type of device, Operating System, Browser, etc. Examples: .is-mobile, .is-not-mobile, -.is-tablet, .is-ios, .is-not-ios, .is-androidos, .is-chromebrowser. -Made by [wescleveland56](https://github.com/wescleveland56). - -**Drupal** - -* [Drupal Mobile Switch](https://www.drupal.org/project/mobile_switch) - The Mobile Switch Drupal module provides a -automatic theme switch functionality for mobile devices, detected by Browscap or Mobile Detect. -Made by [Siegfried Neumann](https://www.drupal.org/user/45267). - -* [Drupal Context Mobile Detect](https://www.drupal.org/project/context_mobile_detect) - This is a Drupal context module -which integrates Context and PHP Mobile Detect library. -Created by [Artem Shymko](https://www.drupal.org/user/432492). - -* [Drupal Mobile Detect](https://www.drupal.org/project/mobile_detect) - Lightweight mobile detect module for Drupal - created by [Matthew Donadio](https://www.drupal.org/user/325244). - -**Joomla** - -* [yagendoo Joomla! Mobile Detection Plugin](http://www.yagendoo.com/en/blog/free-mobile-detection-plugin-for-joomla.html) - Lightweight PHP plugin for Joomla! -that detects a mobile browser using the Mobile Detect class. -Made by yagendoo media. - -* [User Agent Detector plugin](https://github.com/renekreijveld/UserAgentDetector) - This system plugin detects the user -agent of your website visitor and sets a session variable accordingly. Based on the user agent, the plugin detects if the -site is running on a desktop pc, tablet or smartphone. It can also detect if the visitor is a spider bot (search engine). -Session variable that is set: `ualayout`. Possible values: desktop, tablet, mobile, bot. -Made by @ReneKreijveld. - -**Magento** - -* [Magento helper](http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16835/) from Optimise Web enables -the use of all functions provided by Mobile Detect. Made by [Kathir Vel](http://www.kathirvel.com). - -* [Magento 2 Mobile Detect Theme Change](https://github.com/EaDesgin/magento2-mobiledetect) is an extension for Magento 2 -that will change the theme or redirect to a different URL. Also containing a helper to check for the device type. - -**PrestaShop** - -* [PrestaShop](https://www.prestashop.com) is a free, secure and open source shopping cart platform. Mobile_Detect -is included in the default package since 1.5.x. - -**Laravel** - -* [Agent](https://github.com/jenssegers/agent) is a user agent class for Laravel based on Mobile Detect with some -additional functionality. -Made by [Jens Segers](https://github.com/jenssegers). - -* [BrowserDetect](https://github.com/hisorange/browser-detect) is a browser and mobile detection package, collects -and wrap together the best user-agent identifiers for Laravel. -Created by [Varga Zsolt](https://github.com/hisorange). - -**Zend Framework** - -* [ZF2 Mobile-Detect](https://github.com/neilime/zf2-mobile-detect.git) is a Zend Framework 2 module that provides -Mobile-Detect features (Mobile_Detect class as a service, helper for views and plugin controllers). -Made by [neilime](https://github.com/neilime). - -* [ZF2 MobileDetectModule](https://github.com/nikolaposa/MobileDetectModule) facilitates integration of a PHP MobileDetect -class with some ZF2-based application. Has similar idea like the existing ZF2 Mobile-Detect module, -but differs in initialization and provision routine of the actual Mobile_Detect class. -Appropriate view helper and controller plugin also have different conceptions. -Made by [Nikola Posa](https://github.com/nikolaposa). - -**Symfony** - -* [Symfony2 Mobile Detect Bundle](https://github.com/suncat2000/MobileDetectBundle) is a bundle for detecting mobile devices, -manage mobile view and redirect to the mobile and tablet version. -Made by [Nikolay Ivlev](https://github.com/suncat2000). - -* [Silex Mobile Detect Service Provider](https://github.com/jbinfo/MobileDetectServiceProvider) is a service provider to -interact with Mobile detect class methods. -Made by [Lhassan Baazzi](https://github.com/jbinfo). - -**Slim Framework** - -* [Slim_Mobile_Detect](https://github.com/zguillez/slim_mobile_detect) implements Mobile_Detect lib for different -responses write on Slim Framework App. - -**ExpressionEngine** - -* [EE2 Detect Mobile](https://github.com/garethtdavies/detect-mobile) is a lightweight PHP plugin for EE2 that detects - a mobile browser using the Mobile Detect class. Made by [Gareth Davies](https://github.com/garethtdavies). - -**Yii Framework** - -* [Yii Extension](https://github.com/iamsalnikov/MobileDetect) - Mobile detect plugin for Yii framework. -Made by [Alexey Salnikov](https://github.com/iamsalnikov). - -* [Yii Extension](https://github.com/candasm/yii1-mobile-detect-component) - Mobile detect component for Yii framework -1.x version which supports composer package manager. Made by [Candas Minareci](https://github.com/candasm). - -* [Yii2 Device Detect](https://github.com/alexandernst/yii2-device-detect/) - Yii2 extension for Mobile-Detect library. -Made by [Alexander Nestorov](https://github.com/alexandernst). - -**CakePHP** - -* [CakePHP MobileDetect](https://github.com/chronon/CakePHP-MobileDetectComponent-Plugin) is a plugin component for -CakePHP 2.x. Made by [Gregory Gaskill](https://github.com/chronon). - -**FuelPHP** - -* [Special Agent](https://github.com/rob-bar/special_agent) is a FuelPHP package which uses php-mobile-detect to -determine whether a device is mobile or not. It overrides the Fuelphp Agent class its methods. -Made by [Robbie Bardjin](https://github.com/rob-bar). - - -**TYPO3** - -* [px_mobiledetect](https://typo3.org/extensions/repository/view/px_mobiledetect) is an extension that helps to detect -visitor's mobile device class (if that’s tablet or mobile device like smartphone). Made by Alexander Tretyak. - -**Other** - -* [PageCache](https://github.com/mmamedov/page-cache) is a lightweight PHP library for full page cache, -with built-in Mobile-Detect support. Made by [Muhammed Mamedov](https://github.com/mmamedov). - -* [Statamic CMS Mobile Detect](https://github.com/haikulab/statamic-mobile-detect) is a plugin. -Made by [Sergei Filippov](https://github.com/haikulab/statamic-mobile-detect) of Haiku Lab. - -* [Kohana Mobile Detect](https://github.com/madeinnordeste/kohana-mobile-detect) is an example of implementation of -Mobile_Detect class with Kohana framework. -Written by [Luiz Alberto S. Ribeiro](https://github.com/madeinnordeste). - -* [MemHT](https://www.memht.com) is a Free PHP CMS and Blog that permit the creation and the management online -of websites with few and easy steps. Has the class included in the core. - -* [concrete5](https://www.concrete5.org) is a CMS that is free and open source. The library is included in the core. - -* [engine7](https://github.com/QOXCorp/exengine) is PHP Open Source Framework. The Mobile_Detect class is included in -the engine. - -* [Zikula](http://zikula.org) is a free and open-source Content Management Framework, which allows you to run -impressive websites and build powerful online applications. The core uses Mobile-Detect to switch to a special -Mobile theme, using jQueryMobile. - -* [UserAgentInfo](https://github.com/quentin389/UserAgentInfo) is a PHP class for parsing user agent strings -(HTTP_USER_AGENT). Includes mobile checks, bot checks, browser types/versions and more. -Based on browscap, Mobile_Detect and ua-parser. Created for high traffic websites and fast batch processing. -Made by [quentin389](https://github.com/quentin389). - -* [LJ Mobile Detect](https://github.com/lewisjenkins/craft-lj-mobiledetect) is a simple implementation of Mobile Detect -for Craft CMS. Made by [Lewis Jenkins](https://github.com/lewisjenkins). - -* [Grav Plugin Mobile Detect](https://github.com/dimitrilongo/grav-plugin-mobile-detect/) is a simple implementation -of Mobile Detect for Grav CMS. Made by [Dimitri Longo](https://github.com/dimitrilongo). - - -**Perl** - - * [MobileDetect.pm](https://www.buzzerstar.com/development/) is a Perl module for Mobile Detect. - Made by [Sebastian Enger](https://devop.tools/). - -**Python** - -* [pymobiledetect](https://pypi.python.org/pypi/pymobiledetect) - Mobile detect python package. -Made by Bas van Oostveen. - -**Ruby** - -* [mobile_detect.rb](https://github.com/ktaragorn/mobile_detect) is a Ruby gem using the JSON data exposed by the -php project and implementing a basic subset of the API (as much as can be done by the exposed data). -Made by [Karthik T](https://github.com/ktaragorn). - -**Go** - -* [GoMobileDetect](https://github.com/Shaked/gomobiledetect) is a Go port of Mobile Detect class. -Made by [https://github.com/Shaked](Shaked). - - -**LUA** - -* [ua-lua](https://github.com/robinef/ua-lua) is a small lib written in LUA providing device type detection. -ua-lua is detecting mobile or tablet devices based on user-agent inside nginx daemon. -Made by [Frédéric Robinet](https://github.com/robinef). diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/composer.json b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/composer.json deleted file mode 100644 index 0131e4937e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/composer.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "mobiledetect/mobiledetectlib", - "type": "library", - "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", - "keywords": ["mobile", "mobile detect", "mobile detector", "php mobile detect", "detect mobile devices"], - "homepage": "https://github.com/serbanghita/Mobile-Detect", - "license": "MIT", - "authors": [ - { - "name": "Serban Ghita", - "email": "serbanghita@gmail.com", - "homepage": "http://mobiledetect.net", - "role": "Developer" - } - ], - "require": { - "php": ">=5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "autoload": { - "classmap": ["Mobile_Detect.php"], - "psr-0": { - "Detection": "namespaced/" - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/namespaced/Detection/MobileDetect.php b/rainloop/v/0.0.0/app/libraries/Mobile_Detect/namespaced/Detection/MobileDetect.php deleted file mode 100644 index ca7efec23f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Mobile_Detect/namespaced/Detection/MobileDetect.php +++ /dev/null @@ -1,22 +0,0 @@ - - - The PSR-2 coding standard. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - 0 - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/Client.php b/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/Client.php deleted file mode 100644 index 6fae0925de..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/Client.php +++ /dev/null @@ -1,513 +0,0 @@ - - * @author Anis Berejeb - * @version 1.2-dev - */ -namespace OAuth2; - -class Client -{ - /** - * Different AUTH method - */ - const AUTH_TYPE_URI = 0; - const AUTH_TYPE_AUTHORIZATION_BASIC = 1; - const AUTH_TYPE_FORM = 2; - - /** - * Different Access token type - */ - const ACCESS_TOKEN_URI = 0; - const ACCESS_TOKEN_BEARER = 1; - const ACCESS_TOKEN_OAUTH = 2; - const ACCESS_TOKEN_MAC = 3; - - /** - * Different Grant types - */ - const GRANT_TYPE_AUTH_CODE = 'authorization_code'; - const GRANT_TYPE_PASSWORD = 'password'; - const GRANT_TYPE_CLIENT_CREDENTIALS = 'client_credentials'; - const GRANT_TYPE_REFRESH_TOKEN = 'refresh_token'; - - /** - * HTTP Methods - */ - const HTTP_METHOD_GET = 'GET'; - const HTTP_METHOD_POST = 'POST'; - const HTTP_METHOD_PUT = 'PUT'; - const HTTP_METHOD_DELETE = 'DELETE'; - const HTTP_METHOD_HEAD = 'HEAD'; - - /** - * HTTP Form content types - */ - const HTTP_FORM_CONTENT_TYPE_APPLICATION = 0; - const HTTP_FORM_CONTENT_TYPE_MULTIPART = 1; - - /** - * Client ID - * - * @var string - */ - protected $client_id = null; - - /** - * Client Secret - * - * @var string - */ - protected $client_secret = null; - - /** - * Client Authentication method - * - * @var int - */ - protected $client_auth = self::AUTH_TYPE_URI; - - /** - * Access Token - * - * @var string - */ - protected $access_token = null; - - /** - * Access Token Type - * - * @var int - */ - protected $access_token_type = self::ACCESS_TOKEN_URI; - - /** - * Access Token Secret - * - * @var string - */ - protected $access_token_secret = null; - - /** - * Access Token crypt algorithm - * - * @var string - */ - protected $access_token_algorithm = null; - - /** - * Access Token Parameter name - * - * @var string - */ - protected $access_token_param_name = 'access_token'; - - /** - * The path to the certificate file to use for https connections - * - * @var string Defaults to . - */ - protected $certificate_file = null; - - /** - * cURL options - * - * @var array - */ - protected $curl_options = array(); - - /** - * Construct - * - * @param string $client_id Client ID - * @param string $client_secret Client Secret - * @param int $client_auth (AUTH_TYPE_URI, AUTH_TYPE_AUTHORIZATION_BASIC, AUTH_TYPE_FORM) - * @param string $certificate_file Indicates if we want to use a certificate file to trust the server. Optional, defaults to null. - * @return void - */ - public function __construct($client_id, $client_secret, $client_auth = self::AUTH_TYPE_URI, $certificate_file = null) - { - if (!extension_loaded('curl')) { - throw new Exception('The PHP extension curl must be installed to use this library.', Exception::CURL_NOT_FOUND); - } - - $this->client_id = $client_id; - $this->client_secret = $client_secret; - $this->client_auth = $client_auth; - $this->certificate_file = $certificate_file; - if (!empty($this->certificate_file) && !is_file($this->certificate_file)) { - throw new InvalidArgumentException('The certificate file was not found', InvalidArgumentException::CERTIFICATE_NOT_FOUND); - } - } - - /** - * Get the client Id - * - * @return string Client ID - */ - public function getClientId() - { - return $this->client_id; - } - - /** - * Get the client Secret - * - * @return string Client Secret - */ - public function getClientSecret() - { - return $this->client_secret; - } - - /** - * getAuthenticationUrl - * - * @param string $auth_endpoint Url of the authentication endpoint - * @param string $redirect_uri Redirection URI - * @param array $extra_parameters Array of extra parameters like scope or state (Ex: array('scope' => null, 'state' => '')) - * @return string URL used for authentication - */ - public function getAuthenticationUrl($auth_endpoint, $redirect_uri, array $extra_parameters = array()) - { - $parameters = array_merge(array( - 'response_type' => 'code', - 'client_id' => $this->client_id, - 'redirect_uri' => $redirect_uri - ), $extra_parameters); - return $auth_endpoint . '?' . http_build_query($parameters, null, '&'); - } - - /** - * getAccessToken - * - * @param string $token_endpoint Url of the token endpoint - * @param int $grant_type Grant Type ('authorization_code', 'password', 'client_credentials', 'refresh_token', or a custom code (@see GrantType Classes) - * @param array $parameters Array sent to the server (depend on which grant type you're using) - * @return array Array of parameters required by the grant_type (CF SPEC) - */ - public function getAccessToken($token_endpoint, $grant_type, array $parameters) - { - if (!$grant_type) { - throw new InvalidArgumentException('The grant_type is mandatory.', InvalidArgumentException::INVALID_GRANT_TYPE); - } - $grantTypeClassName = $this->convertToCamelCase($grant_type); - $grantTypeClass = __NAMESPACE__ . '\\GrantType\\' . $grantTypeClassName; - if (!class_exists($grantTypeClass)) { - throw new InvalidArgumentException('Unknown grant type \'' . $grant_type . '\'', InvalidArgumentException::INVALID_GRANT_TYPE); - } - $grantTypeObject = new $grantTypeClass(); - $grantTypeObject->validateParameters($parameters); - if (!defined($grantTypeClass . '::GRANT_TYPE')) { - throw new Exception('Unknown constant GRANT_TYPE for class ' . $grantTypeClassName, Exception::GRANT_TYPE_ERROR); - } - $parameters['grant_type'] = $grantTypeClass::GRANT_TYPE; - $http_headers = array(); - switch ($this->client_auth) { - case self::AUTH_TYPE_URI: - case self::AUTH_TYPE_FORM: - $parameters['client_id'] = $this->client_id; - $parameters['client_secret'] = $this->client_secret; - break; - case self::AUTH_TYPE_AUTHORIZATION_BASIC: - $parameters['client_id'] = $this->client_id; - $http_headers['Authorization'] = 'Basic ' . base64_encode($this->client_id . ':' . $this->client_secret); - break; - default: - throw new Exception('Unknown client auth type.', Exception::INVALID_CLIENT_AUTHENTICATION_TYPE); - break; - } - - return $this->executeRequest($token_endpoint, $parameters, self::HTTP_METHOD_POST, $http_headers, self::HTTP_FORM_CONTENT_TYPE_APPLICATION); - } - - /** - * setToken - * - * @param string $token Set the access token - * @return void - */ - public function setAccessToken($token) - { - $this->access_token = $token; - } - - /** - * Set the client authentication type - * - * @param string $client_auth (AUTH_TYPE_URI, AUTH_TYPE_AUTHORIZATION_BASIC, AUTH_TYPE_FORM) - * @return void - */ - public function setClientAuthType($client_auth) - { - $this->client_auth = $client_auth; - } - - /** - * Set an option for the curl transfer - * - * @param int $option The CURLOPT_XXX option to set - * @param mixed $value The value to be set on option - * @return void - */ - public function setCurlOption($option, $value) - { - $this->curl_options[$option] = $value; - } - - /** - * Set multiple options for a cURL transfer - * - * @param array $options An array specifying which options to set and their values - * @return void - */ - public function setCurlOptions($options) - { - $this->curl_options = array_merge($this->curl_options, $options); - } - - /** - * Set the access token type - * - * @param int $type Access token type (ACCESS_TOKEN_BEARER, ACCESS_TOKEN_MAC, ACCESS_TOKEN_URI) - * @param string $secret The secret key used to encrypt the MAC header - * @param string $algorithm Algorithm used to encrypt the signature - * @return void - */ - public function setAccessTokenType($type, $secret = null, $algorithm = null) - { - $this->access_token_type = $type; - $this->access_token_secret = $secret; - $this->access_token_algorithm = $algorithm; - } - - /** - * Fetch a protected ressource - * - * @param string $protected_ressource_url Protected resource URL - * @param array $parameters Array of parameters - * @param string $http_method HTTP Method to use (POST, PUT, GET, HEAD, DELETE) - * @param array $http_headers HTTP headers - * @param int $form_content_type HTTP form content type to use - * @return array - */ - public function fetch($protected_resource_url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = array(), $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) - { - if ($this->access_token) { - switch ($this->access_token_type) { - case self::ACCESS_TOKEN_URI: - if (is_array($parameters)) { - $parameters[$this->access_token_param_name] = $this->access_token; - } else { - throw new InvalidArgumentException( - 'You need to give parameters as array if you want to give the token within the URI.', - InvalidArgumentException::REQUIRE_PARAMS_AS_ARRAY - ); - } - break; - case self::ACCESS_TOKEN_BEARER: - $http_headers['Authorization'] = 'Bearer ' . $this->access_token; - break; - case self::ACCESS_TOKEN_OAUTH: - $http_headers['Authorization'] = 'OAuth ' . $this->access_token; - break; - case self::ACCESS_TOKEN_MAC: - $http_headers['Authorization'] = 'MAC ' . $this->generateMACSignature($protected_resource_url, $parameters, $http_method); - break; - default: - throw new Exception('Unknown access token type.', Exception::INVALID_ACCESS_TOKEN_TYPE); - break; - } - } - return $this->executeRequest($protected_resource_url, $parameters, $http_method, $http_headers, $form_content_type); - } - - /** - * Generate the MAC signature - * - * @param string $url Called URL - * @param array $parameters Parameters - * @param string $http_method Http Method - * @return string - */ - private function generateMACSignature($url, $parameters, $http_method) - { - $timestamp = time(); - $nonce = uniqid(); - $parsed_url = parse_url($url); - if (!isset($parsed_url['port'])) - { - $parsed_url['port'] = ($parsed_url['scheme'] == 'https') ? 443 : 80; - } - if ($http_method == self::HTTP_METHOD_GET) { - if (is_array($parameters)) { - $parsed_url['path'] .= '?' . http_build_query($parameters, null, '&'); - } elseif ($parameters) { - $parsed_url['path'] .= '?' . $parameters; - } - } - - $signature = base64_encode(hash_hmac($this->access_token_algorithm, - $timestamp . "\n" - . $nonce . "\n" - . $http_method . "\n" - . $parsed_url['path'] . "\n" - . $parsed_url['host'] . "\n" - . $parsed_url['port'] . "\n\n" - , $this->access_token_secret, true)); - - return 'id="' . $this->access_token . '", ts="' . $timestamp . '", nonce="' . $nonce . '", mac="' . $signature . '"'; - } - - /** - * Execute a request (with curl) - * - * @param string $url URL - * @param mixed $parameters Array of parameters - * @param string $http_method HTTP Method - * @param array $http_headers HTTP Headers - * @param int $form_content_type HTTP form content type to use - * @return array - */ - private function executeRequest($url, $parameters = array(), $http_method = self::HTTP_METHOD_GET, array $http_headers = null, $form_content_type = self::HTTP_FORM_CONTENT_TYPE_MULTIPART) - { - $curl_options = array( - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYPEER => true, - CURLOPT_CUSTOMREQUEST => $http_method - ); - - switch($http_method) { - case self::HTTP_METHOD_POST: - $curl_options[CURLOPT_POST] = true; - /* No break */ - case self::HTTP_METHOD_PUT: - - /** - * Passing an array to CURLOPT_POSTFIELDS will encode the data as multipart/form-data, - * while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded. - * http://php.net/manual/en/function.curl-setopt.php - */ - if(is_array($parameters) && self::HTTP_FORM_CONTENT_TYPE_APPLICATION === $form_content_type) { - $parameters = http_build_query($parameters, null, '&'); - } - $curl_options[CURLOPT_POSTFIELDS] = $parameters; - break; - case self::HTTP_METHOD_HEAD: - $curl_options[CURLOPT_NOBODY] = true; - /* No break */ - case self::HTTP_METHOD_DELETE: - case self::HTTP_METHOD_GET: - if (is_array($parameters)) { - $url .= '?' . http_build_query($parameters, null, '&'); - } elseif ($parameters) { - $url .= '?' . $parameters; - } - break; - default: - break; - } - - $curl_options[CURLOPT_URL] = $url; - - if (is_array($http_headers)) { - $header = array(); - foreach($http_headers as $key => $parsed_urlvalue) { - $header[] = "$key: $parsed_urlvalue"; - } - $curl_options[CURLOPT_HTTPHEADER] = $header; - } - - $ch = curl_init(); - curl_setopt_array($ch, $curl_options); - // https handling - if (!empty($this->certificate_file)) { - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); - curl_setopt($ch, CURLOPT_CAINFO, $this->certificate_file); - } else { - // bypass ssl verification - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); - } - if (!empty($this->curl_options)) { - curl_setopt_array($ch, $this->curl_options); - } - $result = curl_exec($ch); - $http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); - $content_type = curl_getinfo($ch, CURLINFO_CONTENT_TYPE); - if ($curl_error = curl_error($ch)) { - throw new Exception($curl_error, Exception::CURL_ERROR); - } else { - $json_decode = json_decode($result, true); - } - curl_close($ch); - - return array( - 'result' => (null === $json_decode) ? $result : $json_decode, - 'code' => $http_code, - 'content_type' => $content_type - ); - } - - /** - * Set the name of the parameter that carry the access token - * - * @param string $name Token parameter name - * @return void - */ - public function setAccessTokenParamName($name) - { - $this->access_token_param_name = $name; - } - - /** - * Converts the class name to camel case - * - * @param mixed $grant_type the grant type - * @return string - */ - private function convertToCamelCase($grant_type) - { - $parts = explode('_', $grant_type); - array_walk($parts, function(&$item) { $item = ucfirst($item);}); - return implode('', $parts); - } -} - -class Exception extends \Exception -{ - const CURL_NOT_FOUND = 0x01; - const CURL_ERROR = 0x02; - const GRANT_TYPE_ERROR = 0x03; - const INVALID_CLIENT_AUTHENTICATION_TYPE = 0x04; - const INVALID_ACCESS_TOKEN_TYPE = 0x05; -} - -class InvalidArgumentException extends \InvalidArgumentException -{ - const INVALID_GRANT_TYPE = 0x01; - const CERTIFICATE_NOT_FOUND = 0x02; - const REQUIRE_PARAMS_AS_ARRAY = 0x03; - const MISSING_PARAMETER = 0x04; -} diff --git a/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/AuthorizationCode.php b/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/AuthorizationCode.php deleted file mode 100644 index f3436e4c54..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHP-OAuth2/GrantType/AuthorizationCode.php +++ /dev/null @@ -1,41 +0,0 @@ -getAuthenticationUrl(AUTHORIZATION_ENDPOINT, REDIRECT_URI); - header('Location: ' . $auth_url); - die('Redirect'); -} -else -{ - $params = array('code' => $_GET['code'], 'redirect_uri' => REDIRECT_URI); - $response = $client->getAccessToken(TOKEN_ENDPOINT, 'authorization_code', $params); - parse_str($response['result'], $info); - $client->setAccessToken($info['access_token']); - $response = $client->fetch('https://graph.facebook.com/me'); - var_dump($response, $response['result']); -} - -How can I add a new Grant Type ? -================================ -Simply write a new class in the namespace OAuth2\GrantType. You can place the class file under GrantType. -Here is an example : - -namespace OAuth2\GrantType; - -/** - * MyCustomGrantType Grant Type - */ -class MyCustomGrantType implements IGrantType -{ - /** - * Defines the Grant Type - * - * @var string Defaults to 'my_custom_grant_type'. - */ - const GRANT_TYPE = 'my_custom_grant_type'; - - /** - * Adds a specific Handling of the parameters - * - * @return array of Specific parameters to be sent. - * @param mixed $parameters the parameters array (passed by reference) - */ - public function validateParameters(&$parameters) - { - if (!isset($parameters['first_mandatory_parameter'])) - { - throw new \Exception('The \'first_mandatory_parameter\' parameter must be defined for the Password grant type'); - } - elseif (!isset($parameters['second_mandatory_parameter'])) - { - throw new \Exception('The \'seconde_mandatory_parameter\' parameter must be defined for the Password grant type'); - } - } -} - -call the OAuth client getAccessToken with the grantType you defined in the GRANT_TYPE constant, As following : -$response = $client->getAccessToken(TOKEN_ENDPOINT, 'my_custom_grant_type', $params); - diff --git a/rainloop/v/0.0.0/app/libraries/PHPGangsta/GoogleAuthenticator.php b/rainloop/v/0.0.0/app/libraries/PHPGangsta/GoogleAuthenticator.php deleted file mode 100644 index 5e70eed7e6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHPGangsta/GoogleAuthenticator.php +++ /dev/null @@ -1,201 +0,0 @@ -_getBase32LookupTable(); - unset($validChars[32]); - - $secret = ''; - for ($i = 0; $i < $secretLength; $i++) { - $secret .= $validChars[array_rand($validChars)]; - } - return $secret; - } - - /** - * Calculate the code, with given secret and point in time - * - * @param string $secret - * @param int|null $timeSlice - * @return string - */ - public function getCode($secret, $timeSlice = null) - { - if ($timeSlice === null) { - $timeSlice = floor(time() / 30); - } - - $secretkey = $this->_base32Decode($secret); - - // Pack time into binary string - $time = chr(0).chr(0).chr(0).chr(0).pack('N*', $timeSlice); - // Hash it with users secret key - $hm = hash_hmac('SHA1', $time, $secretkey, true); - // Use last nipple of result as index/offset - $offset = ord(substr($hm, -1)) & 0x0F; - // grab 4 bytes of the result - $hashpart = substr($hm, $offset, 4); - - // Unpak binary value - $value = unpack('N', $hashpart); - $value = $value[1]; - // Only 32 bits - $value = $value & 0x7FFFFFFF; - - $modulo = pow(10, $this->_codeLength); - return str_pad($value % $modulo, $this->_codeLength, '0', STR_PAD_LEFT); - } - - /** - * Get QR-Code URL for image, from google charts - * - * @param string $name - * @param string $secret - * @return string - */ - public function getQRCodeGoogleUrl($name, $secret) { - $urlencoded = urlencode('otpauth://totp/'.$name.'?secret='.$secret.''); - return 'https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl='.$urlencoded.''; - } - - /** - * Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now - * - * @param string $secret - * @param string $code - * @param int $discrepancy This is the allowed time drift in 30 second units (8 means 4 minutes before or after) - * @return bool - */ - public function verifyCode($secret, $code, $discrepancy = 1) - { - $currentTimeSlice = floor(time() / 30); - - for ($i = -$discrepancy; $i <= $discrepancy; $i++) { - $calculatedCode = $this->getCode($secret, $currentTimeSlice + $i); - if ($calculatedCode == $code ) { - return true; - } - } - - return false; - } - - /** - * Set the code length, should be >=6 - * - * @param int $length - * @return PHPGangsta_GoogleAuthenticator - */ - public function setCodeLength($length) - { - $this->_codeLength = $length; - return $this; - } - - /** - * Helper class to decode base32 - * - * @param $secret - * @return bool|string - */ - protected function _base32Decode($secret) - { - if (empty($secret)) return ''; - - $base32chars = $this->_getBase32LookupTable(); - $base32charsFlipped = array_flip($base32chars); - - $paddingCharCount = substr_count($secret, $base32chars[32]); - $allowedValues = array(6, 4, 3, 1, 0); - if (!in_array($paddingCharCount, $allowedValues)) return false; - for ($i = 0; $i < 4; $i++){ - if ($paddingCharCount == $allowedValues[$i] && - substr($secret, -($allowedValues[$i])) != str_repeat($base32chars[32], $allowedValues[$i])) return false; - } - $secret = str_replace('=','', $secret); - $secret = str_split($secret); - $binaryString = ""; - for ($i = 0; $i < count($secret); $i = $i+8) { - $x = ""; - if (!in_array($secret[$i], $base32chars)) return false; - for ($j = 0; $j < 8; $j++) { - $x .= str_pad(base_convert(@$base32charsFlipped[@$secret[$i + $j]], 10, 2), 5, '0', STR_PAD_LEFT); - } - $eightBits = str_split($x, 8); - for ($z = 0; $z < count($eightBits); $z++) { - $binaryString .= ( ($y = chr(base_convert($eightBits[$z], 2, 10))) || ord($y) == 48 ) ? $y:""; - } - } - return $binaryString; - } - - /** - * Helper class to encode base32 - * - * @param string $secret - * @param bool $padding - * @return string - */ - protected function _base32Encode($secret, $padding = true) - { - if (empty($secret)) return ''; - - $base32chars = $this->_getBase32LookupTable(); - - $secret = str_split($secret); - $binaryString = ""; - for ($i = 0; $i < count($secret); $i++) { - $binaryString .= str_pad(base_convert(ord($secret[$i]), 10, 2), 8, '0', STR_PAD_LEFT); - } - $fiveBitBinaryArray = str_split($binaryString, 5); - $base32 = ""; - $i = 0; - while ($i < count($fiveBitBinaryArray)) { - $base32 .= $base32chars[base_convert(str_pad($fiveBitBinaryArray[$i], 5, '0'), 2, 10)]; - $i++; - } - if ($padding && ($x = strlen($binaryString) % 40) != 0) { - if ($x == 8) $base32 .= str_repeat($base32chars[32], 6); - elseif ($x == 16) $base32 .= str_repeat($base32chars[32], 4); - elseif ($x == 24) $base32 .= str_repeat($base32chars[32], 3); - elseif ($x == 32) $base32 .= $base32chars[32]; - } - return $base32; - } - - /** - * Get array with all 32 characters for decoding from/encoding to base32 - * - * @return array - */ - protected function _getBase32LookupTable() - { - return array( - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', // 7 - 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', // 15 - 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', // 23 - 'Y', 'Z', '2', '3', '4', '5', '6', '7', // 31 - '=' // padding char - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/PHPThumb/GD.php b/rainloop/v/0.0.0/app/libraries/PHPThumb/GD.php deleted file mode 100644 index 53469eda3a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHPThumb/GD.php +++ /dev/null @@ -1,1417 +0,0 @@ - - * Copyright (c) 2009, Ian Selby/Gen X Design - * - * Author(s): Ian Selby - * - * Licensed under the MIT License - * Redistributions of files must retain the above copyright notice. - * - * @author Ian Selby - * @copyright Copyright (c) 2009 Gen X Design - * @link http://phpthumb.gxdlabs.com - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ - -class GD extends PHPThumb -{ - /** - * The prior image (before manipulation) - * - * @var resource - */ - protected $oldImage; - - /** - * The working image (used during manipulation) - * - * @var resource - */ - protected $workingImage; - - /** - * The current dimensions of the image - * - * @var array - */ - protected $currentDimensions; - - /** - * The new, calculated dimensions of the image - * - * @var array - */ - protected $newDimensions; - - /** - * The options for this class - * - * This array contains various options that determine the behavior in - * various functions throughout the class. Functions note which specific - * option key / values are used in their documentation - * - * @var array - */ - protected $options; - - /** - * The maximum width an image can be after resizing (in pixels) - * - * @var int - */ - protected $maxWidth; - - /** - * The maximum height an image can be after resizing (in pixels) - * - * @var int - */ - protected $maxHeight; - - /** - * The percentage to resize the image by - * - * @var int - */ - protected $percent; - - /** - * @param string $fileName - * @param array $options - * @param array $plugins - */ - public function __construct($fileName, $options = array(), array $plugins = array()) - { - parent::__construct($fileName, $options, $plugins); - - $this->determineFormat(); - $this->verifyFormatCompatiblity(); - - switch ($this->format) { - case 'GIF': - $this->oldImage = @imagecreatefromgif($this->fileName); - break; - case 'JPG': - $this->oldImage = @imagecreatefromjpeg($this->fileName); - break; - case 'PNG': - $this->oldImage = @imagecreatefrompng($this->fileName); - break; - case 'STRING': - $this->oldImage = @imagecreatefromstring($this->fileName); - break; - } - - if (!is_resource($this->oldImage)) - { - throw new \Exception('Invalid image file'); - } - else - { - $this->currentDimensions = array ( - 'width' => imagesx($this->oldImage), - 'height' => imagesy($this->oldImage) - ); - } - } - - public function __destruct() - { - if (is_resource($this->oldImage)) { - imagedestroy($this->oldImage); - } - - if (is_resource($this->workingImage)) { - imagedestroy($this->workingImage); - } - } - - /** - * Pad an image to desired dimensions. Moves the image into the center and fills the rest with $color. - * @param $width - * @param $height - * @param array $color - * @return GD - */ - public function pad($width, $height, $color = array(255, 255, 255)) - { - // no resize - woohoo! - if ($width == $this->currentDimensions['width'] && $height == $this->currentDimensions['height']) { - return $this; - } - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($width, $height); - } else { - $this->workingImage = imagecreate($width, $height); - } - - // create the fill color - $fillColor = imagecolorallocate( - $this->workingImage, - $color[0], - $color[1], - $color[2] - ); - - // fill our working image with the fill color - imagefill( - $this->workingImage, - 0, - 0, - $fillColor - ); - - // copy the image into the center of our working image - imagecopyresampled( - $this->workingImage, - $this->oldImage, - intval(($width-$this->currentDimensions['width']) / 2), - intval(($height-$this->currentDimensions['height']) / 2), - 0, - 0, - $this->currentDimensions['width'], - $this->currentDimensions['height'], - $this->currentDimensions['width'], - $this->currentDimensions['height'] - ); - - // update all the variables and resources to be correct - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $width; - $this->currentDimensions['height'] = $height; - - return $this; - } - - /** - * Resizes an image to be no larger than $maxWidth or $maxHeight - * - * If either param is set to zero, then that dimension will not be considered as a part of the resize. - * Additionally, if $this->options['resizeUp'] is set to true (false by default), then this function will - * also scale the image up to the maximum dimensions provided. - * - * @param int $maxWidth The maximum width of the image in pixels - * @param int $maxHeight The maximum height of the image in pixels - * @return \PHPThumb\GD - */ - public function resize($maxWidth = 0, $maxHeight = 0) - { - // make sure our arguments are valid - if (!is_numeric($maxWidth)) { - throw new \InvalidArgumentException('$maxWidth must be numeric'); - } - - if (!is_numeric($maxHeight)) { - throw new \InvalidArgumentException('$maxHeight must be numeric'); - } - - // make sure we're not exceeding our image size if we're not supposed to - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($maxHeight) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $maxHeight; - $this->maxWidth = (intval($maxWidth) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $maxWidth; - } else { - $this->maxHeight = intval($maxHeight); - $this->maxWidth = intval($maxWidth); - } - - // get the new dimensions... - $this->calcImageSize($this->currentDimensions['width'], $this->currentDimensions['height']); - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - } else { - $this->workingImage = imagecreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - } - - $this->preserveAlpha(); - - // and create the newly sized image - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - 0, - 0, - $this->newDimensions['newWidth'], - $this->newDimensions['newHeight'], - $this->currentDimensions['width'], - $this->currentDimensions['height'] - ); - - // update all the variables and resources to be correct - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $this->newDimensions['newWidth']; - $this->currentDimensions['height'] = $this->newDimensions['newHeight']; - - return $this; - } - - /** - * Adaptively Resizes the Image - * - * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the - * remaining overflow (from the center) to get the image to be the size specified - * - * @param int $maxWidth - * @param int $maxHeight - * @return \PHPThumb\GD - */ - public function adaptiveResize($width, $height) - { - // make sure our arguments are valid - if ((!is_numeric($width) || $width == 0) && (!is_numeric($height) || $height == 0)) { - throw new \InvalidArgumentException('$width and $height must be numeric and greater than zero'); - } - - if (!is_numeric($width) || $width == 0) { - $width = ($height * $this->currentDimensions['width']) / $this->currentDimensions['height']; - } - - if (!is_numeric($height) || $height == 0) { - $height = ($width * $this->currentDimensions['height']) / $this->currentDimensions['width']; - } - - // make sure we're not exceeding our image size if we're not supposed to - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - $this->calcImageSizeStrict($this->currentDimensions['width'], $this->currentDimensions['height']); - - // resize the image to be close to our desired dimensions - $this->resize($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - - // reset the max dimensions... - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($this->maxWidth, $this->maxHeight); - } else { - $this->workingImage = imagecreate($this->maxWidth, $this->maxHeight); - } - - $this->preserveAlpha(); - - $cropWidth = $this->maxWidth; - $cropHeight = $this->maxHeight; - $cropX = 0; - $cropY = 0; - - // now, figure out how to crop the rest of the image... - if ($this->currentDimensions['width'] > $this->maxWidth) { - $cropX = intval(($this->currentDimensions['width'] - $this->maxWidth) / 2); - } elseif ($this->currentDimensions['height'] > $this->maxHeight) { - $cropY = intval(($this->currentDimensions['height'] - $this->maxHeight) / 2); - } - - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - $cropX, - $cropY, - $cropWidth, - $cropHeight, - $cropWidth, - $cropHeight - ); - - // update all the variables and resources to be correct - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $this->maxWidth; - $this->currentDimensions['height'] = $this->maxHeight; - - return $this; - } - - /** - * Adaptively Resizes the Image and Crops Using a Percentage - * - * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the - * remaining overflow using a provided percentage to get the image to be the size specified. - * - * The percentage mean different things depending on the orientation of the original image. - * - * For Landscape images: - * --------------------- - * - * A percentage of 1 would crop the image all the way to the left, which would be the same as - * using adaptiveResizeQuadrant() with $quadrant = 'L' - * - * A percentage of 50 would crop the image to the center which would be the same as using - * adaptiveResizeQuadrant() with $quadrant = 'C', or even the original adaptiveResize() - * - * A percentage of 100 would crop the image to the image all the way to the right, etc, etc. - * Note that you can use any percentage between 1 and 100. - * - * For Portrait images: - * -------------------- - * - * This works the same as for Landscape images except that a percentage of 1 means top and 100 means bottom - * - * @param int $maxWidth - * @param int $maxHeight - * @param int $percent - * @return \PHPThumb\GD - */ - public function adaptiveResizePercent($width, $height, $percent = 50) - { - // make sure our arguments are valid - if (!is_numeric($width) || $width == 0) { - throw new \InvalidArgumentException('$width must be numeric and greater than zero'); - } - - if (!is_numeric($height) || $height == 0) { - throw new \InvalidArgumentException('$height must be numeric and greater than zero'); - } - - // make sure we're not exceeding our image size if we're not supposed to - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - $this->calcImageSizeStrict($this->currentDimensions['width'], $this->currentDimensions['height']); - - // resize the image to be close to our desired dimensions - $this->resize($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - - // reset the max dimensions... - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($this->maxWidth, $this->maxHeight); - } else { - $this->workingImage = imagecreate($this->maxWidth, $this->maxHeight); - } - - $this->preserveAlpha(); - - $cropWidth = $this->maxWidth; - $cropHeight = $this->maxHeight; - $cropX = 0; - $cropY = 0; - - // Crop the rest of the image using the quadrant - - if ($percent > 100) { - $percent = 100; - } elseif ($percent < 1) { - $percent = 1; - } - - if ($this->currentDimensions['width'] > $this->maxWidth) { - // Image is landscape - $maxCropX = $this->currentDimensions['width'] - $this->maxWidth; - $cropX = intval(($percent / 100) * $maxCropX); - - } elseif ($this->currentDimensions['height'] > $this->maxHeight) { - // Image is portrait - $maxCropY = $this->currentDimensions['height'] - $this->maxHeight; - $cropY = intval(($percent / 100) * $maxCropY); - } - - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - $cropX, - $cropY, - $cropWidth, - $cropHeight, - $cropWidth, - $cropHeight - ); - - // update all the variables and resources to be correct - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $this->maxWidth; - $this->currentDimensions['height'] = $this->maxHeight; - - return $this; - } - - /** - * Adaptively Resizes the Image and Crops Using a Quadrant - * - * This function attempts to get the image to as close to the provided dimensions as possible, and then crops the - * remaining overflow using the quadrant to get the image to be the size specified. - * - * The quadrants available are Top, Bottom, Center, Left, and Right: - * - * - * +---+---+---+ - * | | T | | - * +---+---+---+ - * | L | C | R | - * +---+---+---+ - * | | B | | - * +---+---+---+ - * - * Note that if your image is Landscape and you choose either of the Top or Bottom quadrants (which won't - * make sence since only the Left and Right would be available, then the Center quadrant will be used - * to crop. This would have exactly the same result as using adaptiveResize(). - * The same goes if your image is portrait and you choose either the Left or Right quadrants. - * - * @param int $maxWidth - * @param int $maxHeight - * @param string $quadrant T, B, C, L, R - * @return \PHPThumb\GD - */ - public function adaptiveResizeQuadrant($width, $height, $quadrant = 'C') - { - // make sure our arguments are valid - if (!is_numeric($width) || $width == 0) { - throw new \InvalidArgumentException('$width must be numeric and greater than zero'); - } - - if (!is_numeric($height) || $height == 0) { - throw new \InvalidArgumentException('$height must be numeric and greater than zero'); - } - - // make sure we're not exceeding our image size if we're not supposed to - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - $this->calcImageSizeStrict($this->currentDimensions['width'], $this->currentDimensions['height']); - - // resize the image to be close to our desired dimensions - $this->resize($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - - // reset the max dimensions... - if ($this->options['resizeUp'] === false) { - $this->maxHeight = (intval($height) > $this->currentDimensions['height']) ? $this->currentDimensions['height'] : $height; - $this->maxWidth = (intval($width) > $this->currentDimensions['width']) ? $this->currentDimensions['width'] : $width; - } else { - $this->maxHeight = intval($height); - $this->maxWidth = intval($width); - } - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($this->maxWidth, $this->maxHeight); - } else { - $this->workingImage = imagecreate($this->maxWidth, $this->maxHeight); - } - - $this->preserveAlpha(); - - $cropWidth = $this->maxWidth; - $cropHeight = $this->maxHeight; - $cropX = 0; - $cropY = 0; - - // Crop the rest of the image using the quadrant - - if ($this->currentDimensions['width'] > $this->maxWidth) { - // Image is landscape - switch ($quadrant) { - case 'L': - $cropX = 0; - break; - case 'R': - $cropX = intval(($this->currentDimensions['width'] - $this->maxWidth)); - break; - case 'C': - default: - $cropX = intval(($this->currentDimensions['width'] - $this->maxWidth) / 2); - break; - } - } elseif ($this->currentDimensions['height'] > $this->maxHeight) { - // Image is portrait - switch ($quadrant) { - case 'T': - $cropY = 0; - break; - case 'B': - $cropY = intval(($this->currentDimensions['height'] - $this->maxHeight)); - break; - case 'C': - default: - $cropY = intval(($this->currentDimensions['height'] - $this->maxHeight) / 2); - break; - } - } - - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - $cropX, - $cropY, - $cropWidth, - $cropHeight, - $cropWidth, - $cropHeight - ); - - // update all the variables and resources to be correct - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $this->maxWidth; - $this->currentDimensions['height'] = $this->maxHeight; - - return $this; - } - - /** - * Resizes an image by a given percent uniformly, - * Percentage should be whole number representation (i.e. 1-100) - * - * @param int $percent - * @return GD - * @throws \InvalidArgumentException - */ - public function resizePercent($percent = 0) - { - if (!is_numeric($percent)) { - throw new \InvalidArgumentException ('$percent must be numeric'); - } - - $this->percent = intval($percent); - - $this->calcImageSizePercent($this->currentDimensions['width'], $this->currentDimensions['height']); - - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - } else { - $this->workingImage = imagecreate($this->newDimensions['newWidth'], $this->newDimensions['newHeight']); - } - - $this->preserveAlpha(); - - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - 0, - 0, - $this->newDimensions['newWidth'], - $this->newDimensions['newHeight'], - $this->currentDimensions['width'], - $this->currentDimensions['height'] - ); - - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $this->newDimensions['newWidth']; - $this->currentDimensions['height'] = $this->newDimensions['newHeight']; - - return $this; - } - - /** - * Crops an image from the center with provided dimensions - * - * If no height is given, the width will be used as a height, thus creating a square crop - * - * @param int $cropWidth - * @param int $cropHeight - * @return \PHPThumb\GD - */ - public function cropFromCenter($cropWidth, $cropHeight = null) - { - if (!is_numeric($cropWidth)) { - throw new \InvalidArgumentException('$cropWidth must be numeric'); - } - - if ($cropHeight !== null && !is_numeric($cropHeight)) { - throw new \InvalidArgumentException('$cropHeight must be numeric'); - } - - if ($cropHeight === null) { - $cropHeight = $cropWidth; - } - - $cropWidth = ($this->currentDimensions['width'] < $cropWidth) ? $this->currentDimensions['width'] : $cropWidth; - $cropHeight = ($this->currentDimensions['height'] < $cropHeight) ? $this->currentDimensions['height'] : $cropHeight; - - $cropX = intval(($this->currentDimensions['width'] - $cropWidth) / 2); - $cropY = intval(($this->currentDimensions['height'] - $cropHeight) / 2); - - $this->crop($cropX, $cropY, $cropWidth, $cropHeight); - - return $this; - } - - /** - * Vanilla Cropping - Crops from x,y with specified width and height - * - * @param int $startX - * @param int $startY - * @param int $cropWidth - * @param int $cropHeight - * @return \PHPThumb\GD - */ - public function crop($startX, $startY, $cropWidth, $cropHeight) - { - // validate input - if (!is_numeric($startX)) { - throw new \InvalidArgumentException('$startX must be numeric'); - } - - if (!is_numeric($startY)) { - throw new \InvalidArgumentException('$startY must be numeric'); - } - - if (!is_numeric($cropWidth)) { - throw new \InvalidArgumentException('$cropWidth must be numeric'); - } - - if (!is_numeric($cropHeight)) { - throw new \InvalidArgumentException('$cropHeight must be numeric'); - } - - // do some calculations - $cropWidth = ($this->currentDimensions['width'] < $cropWidth) ? $this->currentDimensions['width'] : $cropWidth; - $cropHeight = ($this->currentDimensions['height'] < $cropHeight) ? $this->currentDimensions['height'] : $cropHeight; - - // ensure everything's in bounds - if (($startX + $cropWidth) > $this->currentDimensions['width']) { - $startX = ($this->currentDimensions['width'] - $cropWidth); - } - - if (($startY + $cropHeight) > $this->currentDimensions['height']) { - $startY = ($this->currentDimensions['height'] - $cropHeight); - } - - if ($startX < 0) { - $startX = 0; - } - - if ($startY < 0) { - $startY = 0; - } - - // create the working image - if (function_exists('imagecreatetruecolor')) { - $this->workingImage = imagecreatetruecolor($cropWidth, $cropHeight); - } else { - $this->workingImage = imagecreate($cropWidth, $cropHeight); - } - - $this->preserveAlpha(); - - imagecopyresampled( - $this->workingImage, - $this->oldImage, - 0, - 0, - $startX, - $startY, - $cropWidth, - $cropHeight, - $cropWidth, - $cropHeight - ); - - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $cropWidth; - $this->currentDimensions['height'] = $cropHeight; - - return $this; - } - - /** - * Rotates image either 90 degrees clockwise or counter-clockwise - * - * @param string $direction - * @retunrn \PHPThumb\GD - */ - public function rotateImage($direction = 'CW') - { - if ($direction == 'CW') { - $this->rotateImageNDegrees(90); - } else { - $this->rotateImageNDegrees(-90); - } - - return $this; - } - - /** - * Rotates image specified number of degrees - * - * @param int $degrees - * @return \PHPThumb\GD - */ - public function rotateImageNDegrees($degrees) - { - if (!is_numeric($degrees)) { - throw new \InvalidArgumentException('$degrees must be numeric'); - } - - if (!function_exists('imagerotate')) { - throw new \RuntimeException('Your version of GD does not support image rotation'); - } - - $this->workingImage = imagerotate($this->oldImage, $degrees, 0); - - $newWidth = $this->currentDimensions['height']; - $newHeight = $this->currentDimensions['width']; - $this->oldImage = $this->workingImage; - $this->currentDimensions['width'] = $newWidth; - $this->currentDimensions['height'] = $newHeight; - - return $this; - } - - /** - * Applies a filter to the image - * - * @param int $filter - * @return \PHPThumb\GD - */ - public function imageFilter($filter, $arg1 = false, $arg2 = false, $arg3 = false, $arg4 = false) - { - if (!is_numeric($filter)) { - throw new \InvalidArgumentException('$filter must be numeric'); - } - - if (!function_exists('imagefilter')) { - throw new \RuntimeException('Your version of GD does not support image filters'); - } - - $result = false; - if ($arg1 === false) { - $result = imagefilter($this->oldImage, $filter); - } elseif ($arg2 === false) { - $result = imagefilter($this->oldImage, $filter, $arg1); - } elseif ($arg3 === false) { - $result = imagefilter($this->oldImage, $filter, $arg1, $arg2); - } elseif ($arg4 === false) { - $result = imagefilter($this->oldImage, $filter, $arg1, $arg2, $arg3); - } else { - $result = imagefilter($this->oldImage, $filter, $arg1, $arg2, $arg3, $arg4); - } - - if (!$result) { - throw new \RuntimeException('GD imagefilter failed'); - } - - $this->workingImage = $this->oldImage; - - return $this; - } - - /** - * Shows an image - * - * This function will show the current image by first sending the appropriate header - * for the format, and then outputting the image data. If headers have already been sent, - * a runtime exception will be thrown - * - * @param bool $rawData Whether or not the raw image stream should be output - * @return \PHPThumb\GD - */ - public function show($rawData = false) - { - //Execute any plugins - if ($this->plugins) { - foreach ($this->plugins as $plugin) { - /* @var $plugin \PHPThumb\PluginInterface */ - $plugin->execute($this); - } - } - - if (headers_sent() && php_sapi_name() != 'cli') { - throw new \RuntimeException('Cannot show image, headers have already been sent'); - } - - // When the interlace option equals true or false call imageinterlace else leave it to default - if ($this->options['interlace'] === true) { - imageinterlace($this->oldImage, 1); - } elseif ($this->options['interlace'] === false) { - imageinterlace($this->oldImage, 0); - } - - switch ($this->format) { - case 'GIF': - if ($rawData === false) { - header('Content-type: image/gif'); - } - imagegif($this->oldImage); - break; - case 'JPG': - if ($rawData === false) { - header('Content-type: image/jpeg'); - } - imagejpeg($this->oldImage, null, $this->options['jpegQuality']); - break; - case 'PNG': - case 'STRING': - if ($rawData === false) { - header('Content-type: image/png'); - } - imagepng($this->oldImage); - break; - } - - return $this; - } - - /** - * Returns the Working Image as a String - * - * This function is useful for getting the raw image data as a string for storage in - * a database, or other similar things. - * - * @return string - */ - public function getImageAsString() - { - $data = null; - ob_start(); - $this->show(true); - $data = ob_get_contents(); - ob_end_clean(); - - return $data; - } - - /** - * Saves an image - * - * This function will make sure the target directory is writeable, and then save the image. - * - * If the target directory is not writeable, the function will try to correct the permissions (if allowed, this - * is set as an option ($this->options['correctPermissions']). If the target cannot be made writeable, then a - * \RuntimeException is thrown. - * - * @param string $fileName The full path and filename of the image to save - * @param string $format The format to save the image in (optional, must be one of [GIF,JPG,PNG] - * @return \PHPThumb\GD - */ - public function save($fileName, $format = null) - { - $validFormats = array('GIF', 'JPG', 'PNG'); - $format = ($format !== null) ? strtoupper($format) : $this->format; - - if (!in_array($format, $validFormats)) { - throw new \InvalidArgumentException("Invalid format type specified in save function: {$format}"); - } - - // make sure the directory is writeable - if (!is_writeable(dirname($fileName))) { - // try to correct the permissions - if ($this->options['correctPermissions'] === true) { - @chmod(dirname($fileName), 0777); - - // throw an exception if not writeable - if (!is_writeable(dirname($fileName))) { - throw new \RuntimeException("File is not writeable, and could not correct permissions: {$fileName}"); - } - } else { // throw an exception if not writeable - throw new \RuntimeException("File not writeable: {$fileName}"); - } - } - - // When the interlace option equals true or false call imageinterlace else leave it to default - if ($this->options['interlace'] === true) { - imageinterlace($this->oldImage, 1); - } elseif ($this->options['interlace'] === false) { - imageinterlace($this->oldImage, 0); - } - - switch ($format) { - case 'GIF': - imagegif($this->oldImage, $fileName); - break; - case 'JPG': - imagejpeg($this->oldImage, $fileName, $this->options['jpegQuality']); - break; - case 'PNG': - imagepng($this->oldImage, $fileName); - break; - } - - return $this; - } - - ################################# - # ----- GETTERS / SETTERS ----- # - ################################# - - /** - * Sets options for all operations. - * @param array $options - * @return GD - */ - public function setOptions(array $options = array()) - { - // we've yet to init the default options, so create them here - if (sizeof($this->options) == 0) { - $defaultOptions = array( - 'resizeUp' => false, - 'jpegQuality' => 100, - 'correctPermissions' => false, - 'preserveAlpha' => true, - 'alphaMaskColor' => array (255, 255, 255), - 'preserveTransparency' => true, - 'transparencyMaskColor' => array (0, 0, 0), - 'interlace' => null - ); - } else { // otherwise, let's use what we've got already - $defaultOptions = $this->options; - } - - $this->options = array_merge($defaultOptions, $options); - - return $this; - } - - /** - * Returns $currentDimensions. - * - * @see \PHPThumb\GD::$currentDimensions - */ - public function getCurrentDimensions() - { - return $this->currentDimensions; - } - - /** - * @param $currentDimensions - * @return GD - */ - public function setCurrentDimensions($currentDimensions) - { - $this->currentDimensions = $currentDimensions; - - return $this; - } - - /** - * @return int - */ - public function getMaxHeight() - { - return $this->maxHeight; - } - - /** - * @param $maxHeight - * @return GD - */ - public function setMaxHeight($maxHeight) - { - $this->maxHeight = $maxHeight; - - return $this; - } - - /** - * @return int - */ - public function getMaxWidth() - { - return $this->maxWidth; - } - - /** - * @param $maxWidth - * @return GD - */ - public function setMaxWidth($maxWidth) - { - $this->maxWidth = $maxWidth; - - return $this; - } - - /** - * Returns $newDimensions. - * - * @see \PHPThumb\GD::$newDimensions - */ - public function getNewDimensions() - { - return $this->newDimensions; - } - - /** - * Sets $newDimensions. - * - * @param object $newDimensions - * @see \PHPThumb\GD::$newDimensions - */ - public function setNewDimensions($newDimensions) - { - $this->newDimensions = $newDimensions; - - return $this; - } - - /** - * Returns $options. - * - * @see \PHPThumb\GD::$options - */ - public function getOptions() - { - return $this->options; - } - - /** - * Returns $percent. - * - * @see \PHPThumb\GD::$percent - */ - public function getPercent() - { - return $this->percent; - } - - /** - * Sets $percent. - * - * @param object $percent - * @see \PHPThumb\GD::$percent - */ - public function setPercent($percent) - { - $this->percent = $percent; - - return $this; - } - - /** - * Returns $oldImage. - * - * @see \PHPThumb\GD::$oldImage - */ - public function getOldImage() - { - return $this->oldImage; - } - - /** - * Sets $oldImage. - * - * @param object $oldImage - * @see \PHPThumb\GD::$oldImage - */ - public function setOldImage($oldImage) - { - $this->oldImage = $oldImage; - - return $this; - } - - /** - * Returns $workingImage. - * - * @see \PHPThumb\GD::$workingImage - */ - public function getWorkingImage() - { - return $this->workingImage; - } - - /** - * Sets $workingImage. - * - * @param object $workingImage - * @see \PHPThumb\GD::$workingImage - */ - public function setWorkingImage($workingImage) - { - $this->workingImage = $workingImage; - - return $this; - } - - - ################################# - # ----- UTILITY FUNCTIONS ----- # - ################################# - - /** - * Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions - * - * @return array - * @param int $width - * @param int $height - */ - protected function calcWidth($width, $height) - { - $newWidthPercentage = (100 * $this->maxWidth) / $width; - $newHeight = ($height * $newWidthPercentage) / 100; - - return array( - 'newWidth' => intval($this->maxWidth), - 'newHeight' => intval($newHeight) - ); - } - - /** - * Calculates a new width and height for the image based on $this->maxWidth and the provided dimensions - * - * @return array - * @param int $width - * @param int $height - */ - protected function calcHeight($width, $height) - { - $newHeightPercentage = (100 * $this->maxHeight) / $height; - $newWidth = ($width * $newHeightPercentage) / 100; - - return array( - 'newWidth' => ceil($newWidth), - 'newHeight' => ceil($this->maxHeight) - ); - } - - /** - * Calculates a new width and height for the image based on $this->percent and the provided dimensions - * - * @return array - * @param int $width - * @param int $height - */ - protected function calcPercent($width, $height) - { - $newWidth = ($width * $this->percent) / 100; - $newHeight = ($height * $this->percent) / 100; - - return array( - 'newWidth' => ceil($newWidth), - 'newHeight' => ceil($newHeight) - ); - } - - /** - * Calculates the new image dimensions - * - * These calculations are based on both the provided dimensions and $this->maxWidth and $this->maxHeight - * - * @param int $width - * @param int $height - */ - protected function calcImageSize($width, $height) - { - $newSize = array( - 'newWidth' => $width, - 'newHeight' => $height - ); - - if ($this->maxWidth > 0) { - $newSize = $this->calcWidth($width, $height); - - if ($this->maxHeight > 0 && $newSize['newHeight'] > $this->maxHeight) { - $newSize = $this->calcHeight($newSize['newWidth'], $newSize['newHeight']); - } - } - - if ($this->maxHeight > 0) { - $newSize = $this->calcHeight($width, $height); - - if ($this->maxWidth > 0 && $newSize['newWidth'] > $this->maxWidth) { - $newSize = $this->calcWidth($newSize['newWidth'], $newSize['newHeight']); - } - } - - $this->newDimensions = $newSize; - } - - /** - * Calculates new image dimensions, not allowing the width and height to be less than either the max width or height - * - * @param int $width - * @param int $height - */ - protected function calcImageSizeStrict($width, $height) - { - // first, we need to determine what the longest resize dimension is.. - if ($this->maxWidth >= $this->maxHeight) { - // and determine the longest original dimension - if ($width > $height) { - $newDimensions = $this->calcHeight($width, $height); - - if ($newDimensions['newWidth'] < $this->maxWidth) { - $newDimensions = $this->calcWidth($width, $height); - } - } elseif ($height >= $width) { - $newDimensions = $this->calcWidth($width, $height); - - if ($newDimensions['newHeight'] < $this->maxHeight) { - $newDimensions = $this->calcHeight($width, $height); - } - } - } elseif ($this->maxHeight > $this->maxWidth) { - if ($width >= $height) { - $newDimensions = $this->calcWidth($width, $height); - - if ($newDimensions['newHeight'] < $this->maxHeight) { - $newDimensions = $this->calcHeight($width, $height); - } - } elseif ($height > $width) { - $newDimensions = $this->calcHeight($width, $height); - - if ($newDimensions['newWidth'] < $this->maxWidth) { - $newDimensions = $this->calcWidth($width, $height); - } - } - } - - $this->newDimensions = $newDimensions; - } - - /** - * Calculates new dimensions based on $this->percent and the provided dimensions - * - * @param int $width - * @param int $height - */ - protected function calcImageSizePercent($width, $height) - { - if ($this->percent > 0) { - $this->newDimensions = $this->calcPercent($width, $height); - } - } - - /** - * Determines the file format by mime-type - * - * This function will throw exceptions for invalid images / mime-types - * - */ - protected function determineFormat() - { - $formatInfo = getimagesize($this->fileName); - - // non-image files will return false - if ($formatInfo === false) { - if ($this->remoteImage) { - throw new \Exception("Could not determine format of remote image: {$this->fileName}"); - } else { - throw new \Exception("File is not a valid image: {$this->fileName}"); - } - } - - $mimeType = isset($formatInfo['mime']) ? $formatInfo['mime'] : null; - - switch ($mimeType) { - case 'image/gif': - $this->format = 'GIF'; - break; - case 'image/jpeg': - $this->format = 'JPG'; - break; - case 'image/png': - $this->format = 'PNG'; - break; - default: - throw new \Exception("Image format not supported: {$mimeType}"); - } - } - - /** - * Makes sure the correct GD implementation exists for the file type - * - */ - protected function verifyFormatCompatiblity() - { - $isCompatible = true; - $gdInfo = gd_info(); - - switch ($this->format) { - case 'GIF': - $isCompatible = isset($gdInfo['GIF Create Support']); - break; - case 'JPG': - $isCompatible = (isset($gdInfo['JPG Support']) || isset($gdInfo['JPEG Support'])) ? true : false; - break; - case 'PNG': - $isCompatible = isset($gdInfo[$this->format . ' Support']); - break; - default: - $isCompatible = false; - } - - if (!$isCompatible) { - // one last check for "JPEG" instead - $isCompatible = isset($gdInfo['JPEG Support']); - - if (!$isCompatible) { - throw new \Exception("Your GD installation does not support {$this->format} image types"); - } - } - } - - /** - * Preserves the alpha or transparency for PNG and GIF files - * - * Alpha / transparency will not be preserved if the appropriate options are set to false. - * Also, the GIF transparency is pretty skunky (the results aren't awesome), but it works like a - * champ... that's the nature of GIFs tho, so no huge surprise. - * - * This functionality was originally suggested by commenter Aimi (no links / site provided) - Thanks! :) - * - */ - protected function preserveAlpha() - { - if ($this->format == 'PNG' && $this->options['preserveAlpha'] === true) { - imagealphablending($this->workingImage, false); - - $colorTransparent = imagecolorallocatealpha( - $this->workingImage, - $this->options['alphaMaskColor'][0], - $this->options['alphaMaskColor'][1], - $this->options['alphaMaskColor'][2], - 0 - ); - - imagefill($this->workingImage, 0, 0, $colorTransparent); - imagesavealpha($this->workingImage, true); - } - // preserve transparency in GIFs... this is usually pretty rough tho - if ($this->format == 'GIF' && $this->options['preserveTransparency'] === true) { - $colorTransparent = imagecolorallocate( - $this->workingImage, - $this->options['transparencyMaskColor'][0], - $this->options['transparencyMaskColor'][1], - $this->options['transparencyMaskColor'][2] - ); - - imagecolortransparent($this->workingImage, $colorTransparent); - imagetruecolortopalette($this->workingImage, true, 256); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/PHPThumb/PHPThumb.php b/rainloop/v/0.0.0/app/libraries/PHPThumb/PHPThumb.php deleted file mode 100644 index a86c8c91e5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHPThumb/PHPThumb.php +++ /dev/null @@ -1,143 +0,0 @@ - - * Copyright (c) 2009, Ian Selby/Gen X Design - * - * Author(s): Ian Selby - * - * Licensed under the MIT License - * Redistributions of files must retain the above copyright notice. - * - * @author Ian Selby - * @copyright Copyright (c) 2009 Gen X Design - * @link http://phpthumb.gxdlabs.com - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - */ - -abstract class PHPThumb -{ - /** - * The name of the file we're manipulating - * This must include the path to the file (absolute paths recommended) - * - * @var string - */ - protected $fileName; - - /** - * What the file format is (mime-type) - * - * @var string - */ - protected $format; - - /** - * Whether or not the image is hosted remotely - * - * @var bool - */ - protected $remoteImage; - - /** - * An array of attached plugins to execute in order. - * @var array - */ - protected $plugins; - - /** - * @param $fileName - * @param array $options - * @param array $plugins - */ - public function __construct($fileName, array $options = array(), array $plugins = array()) - { - $this->fileName = $fileName; - $this->remoteImage = false; - - if(!$this->validateRequestedResource($fileName)) { - throw new \InvalidArgumentException("Image file not found: {$fileName}"); - } - - $this->setOptions($options); - - $this->plugins = $plugins; - } - - abstract public function setOptions(array $options = array()); - - /** - * Check the provided filename/url. If it is a url, validate that it is properly - * formatted. If it is a file, check to make sure that it actually exists on - * the filesystem. - * - * @param $filename - * @return bool - */ - protected function validateRequestedResource($filename) - { - if(false !== filter_var($filename, FILTER_VALIDATE_URL)) { - $this->remoteImage = true; - return true; - } - - if (file_exists($filename)) { - return true; - } - - return false; - } - - /** - * Returns the filename. - * @return string - */ - public function getFileName() - { - return $this->fileName; - } - - /** - * Sets the filename. - * @param $fileName - * @return PHPThumb - */ - public function setFileName($fileName) - { - $this->fileName = $fileName; - - return $this; - } - - /** - * Returns the format. - * @return string - */ - public function getFormat() - { - return $this->format; - } - - /** - * Sets the format. - * @param $format - * @return PHPThumb - */ - public function setFormat($format) - { - $this->format = $format; - - return $this; - } - - /** - * Returns whether the image exists remotely, i.e. it was loaded via a URL. - * @return bool - */ - public function getIsRemoteImage() - { - return $this->remoteImage; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/PHPThumb/PluginInterface.php b/rainloop/v/0.0.0/app/libraries/PHPThumb/PluginInterface.php deleted file mode 100644 index 56df9768ab..0000000000 --- a/rainloop/v/0.0.0/app/libraries/PHPThumb/PluginInterface.php +++ /dev/null @@ -1,12 +0,0 @@ - - * Copyright (c) 2009, Ian Selby/Gen X Design - * - * Author(s): Ian Selby - * - * Licensed under the MIT License - * Redistributions of files must retain the above copyright notice. - * - * @author Ian Selby - * @copyright Copyright (c) 2009 Gen X Design - * @link http://phpthumb.gxdlabs.com - * @license http://www.opensource.org/licenses/mit-license.php The MIT License - * @version 3.0 - * @package PhpThumb - * @filesource - */ - -/** - * GD Reflection Lib Plugin - * - * This plugin allows you to create those fun Apple(tm)-style reflections in your images - * - * @package PhpThumb - * @subpackage Plugins - */ -class Reflection implements \PHPThumb\PluginInterface -{ - protected $currentDimensions; - protected $workingImage; - protected $newImage; - protected $options; - - protected $percent; - protected $reflection; - protected $white; - protected $border; - protected $borderColor; - - public function __construct($percent, $reflection, $white, $border, $borderColor) - { - $this->percent = $percent; - $this->reflection = $reflection; - $this->white = $white; - $this->border = $border; - $this->borderColor = $borderColor; - } - - /** - * @param \PHPThumb\PHPThumb $phpthumb - * @return \PHPThumb\PHPThumb - */ - public function execute($phpthumb) - { - $this->currentDimensions = $phpthumb->getCurrentDimensions(); - $this->workingImage = $phpthumb->getWorkingImage(); - $this->newImage = $phpthumb->getOldImage(); - $this->options = $phpthumb->getOptions(); - - $width = $this->currentDimensions['width']; - $height = $this->currentDimensions['height']; - $this->reflectionHeight = intval($height * ($this->reflection / 100)); - $newHeight = $height + $this->reflectionHeight; - $reflectedPart = $height * ($this->percent / 100); - - $this->workingImage = imagecreatetruecolor($width, $newHeight); - - imagealphablending($this->workingImage, true); - - $colorToPaint = imagecolorallocatealpha( - $this->workingImage, - 255, - 255, - 255, - 0 - ); - - imagefilledrectangle( - $this->workingImage, - 0, - 0, - $width, - $newHeight, - $colorToPaint - ); - - imagecopyresampled( - $this->workingImage, - $this->newImage, - 0, - 0, - 0, - $reflectedPart, - $width, - $this->reflectionHeight, - $width, - ($height - $reflectedPart) - ); - - $this->imageFlipVertical(); - - imagecopy( - $this->workingImage, - $this->newImage, - 0, - 0, - 0, - 0, - $width, - $height - ); - - imagealphablending($this->workingImage, true); - - for ($i = 0; $i < $this->reflectionHeight; $i++) { - $colorToPaint = imagecolorallocatealpha( - $this->workingImage, - 255, - 255, - 255, - ($i / $this->reflectionHeight * -1 + 1) * $this->white - ); - - imagefilledrectangle( - $this->workingImage, - 0, - $height + $i, - $width, - $height + $i, - $colorToPaint - ); - } - - if ($this->border == true) { - $rgb = $this->hex2rgb($this->borderColor, false); - $colorToPaint = imagecolorallocate($this->workingImage, $rgb[0], $rgb[1], $rgb[2]); - - //top line - imageline( - $this->workingImage, - 0, - 0, - $width, - 0, - $colorToPaint - ); - - //bottom line - imageline( - $this->workingImage, - 0, - $height, - $width, - $height, - $colorToPaint - ); - - //left line - imageline( - $this->workingImage, - 0, - 0, - 0, - $height, - $colorToPaint - ); - - //right line - imageline( - $this->workingImage, - $width - 1, - 0, - $width - 1, - $height, - $colorToPaint - ); - } - - if ($phpthumb->getFormat() == 'PNG') { - $colorTransparent = imagecolorallocatealpha( - $this->workingImage, - $this->options['alphaMaskColor'][0], - $this->options['alphaMaskColor'][1], - $this->options['alphaMaskColor'][2], - 0 - ); - - imagefill($this->workingImage, 0, 0, $colorTransparent); - imagesavealpha($this->workingImage, true); - } - - $phpthumb->setOldImage($this->workingImage); - $this->currentDimensions['width'] = $width; - $this->currentDimensions['height'] = $newHeight; - $phpthumb->setCurrentDimensions($this->currentDimensions); - - return $phpthumb; - } - - /** - * Flips the image vertically - * - */ - protected function imageFlipVertical () - { - $x_i = imagesx($this->workingImage); - $y_i = imagesy($this->workingImage); - - for ($x = 0; $x < $x_i; $x++) { - for ($y = 0; $y < $y_i; $y++) { - imagecopy( - $this->workingImage, - $this->workingImage, - $x, - $y_i - $y - 1, - $x, - $y, - 1, - 1 - ); - } - } - } - - /** - * Converts a hex color to rgb tuples - * - * @return mixed - * @param string $hex - * @param bool $asString - */ - protected function hex2rgb ($hex, $asString = false) - { - // strip off any leading # - if (0 === strpos($hex, '#')) { - $hex = substr($hex, 1); - } elseif (0 === strpos($hex, '&H')) { - $hex = substr($hex, 2); - } - - // break into hex 3-tuple - $cutpoint = ceil(strlen($hex) / 2)-1; - $rgb = explode(':', wordwrap($hex, $cutpoint, ':', $cutpoint), 3); - - // convert each tuple to decimal - $rgb[0] = (isset($rgb[0]) ? hexdec($rgb[0]) : 0); - $rgb[1] = (isset($rgb[1]) ? hexdec($rgb[1]) : 0); - $rgb[2] = (isset($rgb[2]) ? hexdec($rgb[2]) : 0); - - return ($asString ? "{$rgb[0]} {$rgb[1]} {$rgb[2]}" : $rgb); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Autoloader.php b/rainloop/v/0.0.0/app/libraries/Predis/Autoloader.php deleted file mode 100644 index 17ec2ff1df..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Autoloader.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -/** - * Implements a lightweight PSR-0 compliant autoloader for Predis. - * - * @author Eric Naeseth - * @author Daniele Alessandri - */ -class Autoloader -{ - private $directory; - private $prefix; - private $prefixLength; - - /** - * @param string $baseDirectory Base directory where the source files are located. - */ - public function __construct($baseDirectory = __DIR__) - { - $this->directory = $baseDirectory; - $this->prefix = __NAMESPACE__.'\\'; - $this->prefixLength = strlen($this->prefix); - } - - /** - * Registers the autoloader class with the PHP SPL autoloader. - * - * @param bool $prepend Prepend the autoloader on the stack instead of appending it. - */ - public static function register($prepend = false) - { - spl_autoload_register(array(new self(), 'autoload'), true, $prepend); - } - - /** - * Loads a class from a file using its fully qualified name. - * - * @param string $className Fully qualified name of a class. - */ - public function autoload($className) - { - if (0 === strpos($className, $this->prefix)) { - $parts = explode('\\', substr($className, $this->prefixLength)); - $filepath = $this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php'; - - if (is_file($filepath)) { - require $filepath; - } - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Client.php b/rainloop/v/0.0.0/app/libraries/Predis/Client.php deleted file mode 100644 index 87596ec928..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Client.php +++ /dev/null @@ -1,523 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -use Predis\Command\CommandInterface; -use Predis\Command\RawCommand; -use Predis\Command\ScriptCommand; -use Predis\Configuration\Options; -use Predis\Configuration\OptionsInterface; -use Predis\Connection\AggregateConnectionInterface; -use Predis\Connection\ConnectionInterface; -use Predis\Connection\ParametersInterface; -use Predis\Monitor\Consumer as MonitorConsumer; -use Predis\Pipeline\Pipeline; -use Predis\PubSub\Consumer as PubSubConsumer; -use Predis\Response\ErrorInterface as ErrorResponseInterface; -use Predis\Response\ResponseInterface; -use Predis\Response\ServerException; -use Predis\Transaction\MultiExec as MultiExecTransaction; - -/** - * Client class used for connecting and executing commands on Redis. - * - * This is the main high-level abstraction of Predis upon which various other - * abstractions are built. Internally it aggregates various other classes each - * one with its own responsibility and scope. - * - * {@inheritdoc} - * - * @author Daniele Alessandri - */ -class Client implements ClientInterface -{ - const VERSION = '1.0.3'; - - protected $connection; - protected $options; - private $profile; - - /** - * @param mixed $parameters Connection parameters for one or more servers. - * @param mixed $options Options to configure some behaviours of the client. - */ - public function __construct($parameters = null, $options = null) - { - $this->options = $this->createOptions($options ?: array()); - $this->connection = $this->createConnection($parameters ?: array()); - $this->profile = $this->options->profile; - } - - /** - * Creates a new instance of Predis\Configuration\Options from different - * types of arguments or simply returns the passed argument if it is an - * instance of Predis\Configuration\OptionsInterface. - * - * @param mixed $options Client options. - * - * @throws \InvalidArgumentException - * - * @return OptionsInterface - */ - protected function createOptions($options) - { - if (is_array($options)) { - return new Options($options); - } - - if ($options instanceof OptionsInterface) { - return $options; - } - - throw new \InvalidArgumentException('Invalid type for client options.'); - } - - /** - * Creates single or aggregate connections from different types of arguments - * (string, array) or returns the passed argument if it is an instance of a - * class implementing Predis\Connection\ConnectionInterface. - * - * Accepted types for connection parameters are: - * - * - Instance of Predis\Connection\ConnectionInterface. - * - Instance of Predis\Connection\ParametersInterface. - * - Array - * - String - * - Callable - * - * @param mixed $parameters Connection parameters or connection instance. - * - * @throws \InvalidArgumentException - * - * @return ConnectionInterface - */ - protected function createConnection($parameters) - { - if ($parameters instanceof ConnectionInterface) { - return $parameters; - } - - if ($parameters instanceof ParametersInterface || is_string($parameters)) { - return $this->options->connections->create($parameters); - } - - if (is_array($parameters)) { - if (!isset($parameters[0])) { - return $this->options->connections->create($parameters); - } - - $options = $this->options; - - if ($options->defined('aggregate')) { - $initializer = $this->getConnectionInitializerWrapper($options->aggregate); - $connection = $initializer($parameters, $options); - } else { - if ($options->defined('replication') && $replication = $options->replication) { - $connection = $replication; - } else { - $connection = $options->cluster; - } - - $options->connections->aggregate($connection, $parameters); - } - - return $connection; - } - - if (is_callable($parameters)) { - $initializer = $this->getConnectionInitializerWrapper($parameters); - $connection = $initializer($this->options); - - return $connection; - } - - throw new \InvalidArgumentException('Invalid type for connection parameters.'); - } - - /** - * Wraps a callable to make sure that its returned value represents a valid - * connection type. - * - * @param mixed $callable - * - * @return \Closure - */ - protected function getConnectionInitializerWrapper($callable) - { - return function () use ($callable) { - $connection = call_user_func_array($callable, func_get_args()); - - if (!$connection instanceof ConnectionInterface) { - throw new \UnexpectedValueException( - 'The callable connection initializer returned an invalid type.' - ); - } - - return $connection; - }; - } - - /** - * {@inheritdoc} - */ - public function getProfile() - { - return $this->profile; - } - - /** - * {@inheritdoc} - */ - public function getOptions() - { - return $this->options; - } - - /** - * Creates a new client instance for the specified connection ID or alias, - * only when working with an aggregate connection (cluster, replication). - * The new client instances uses the same options of the original one. - * - * @param string $connectionID Identifier of a connection. - * - * @throws \InvalidArgumentException - * - * @return Client - */ - public function getClientFor($connectionID) - { - if (!$connection = $this->getConnectionById($connectionID)) { - throw new \InvalidArgumentException("Invalid connection ID: $connectionID."); - } - - return new static($connection, $this->options); - } - - /** - * Opens the underlying connection and connects to the server. - */ - public function connect() - { - $this->connection->connect(); - } - - /** - * Closes the underlying connection and disconnects from the server. - */ - public function disconnect() - { - $this->connection->disconnect(); - } - - /** - * Closes the underlying connection and disconnects from the server. - * - * This is the same as `Client::disconnect()` as it does not actually send - * the `QUIT` command to Redis, but simply closes the connection. - */ - public function quit() - { - $this->disconnect(); - } - - /** - * Returns the current state of the underlying connection. - * - * @return bool - */ - public function isConnected() - { - return $this->connection->isConnected(); - } - - /** - * {@inheritdoc} - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Retrieves the specified connection from the aggregate connection when the - * client is in cluster or replication mode. - * - * @param string $connectionID Index or alias of the single connection. - * - * @throws NotSupportedException - * - * @return Connection\NodeConnectionInterface - */ - public function getConnectionById($connectionID) - { - if (!$this->connection instanceof AggregateConnectionInterface) { - throw new NotSupportedException( - 'Retrieving connections by ID is supported only by aggregate connections.' - ); - } - - return $this->connection->getConnectionById($connectionID); - } - - /** - * Executes a command without filtering its arguments, parsing the response, - * applying any prefix to keys or throwing exceptions on Redis errors even - * regardless of client options. - * - * It is possibile to indentify Redis error responses from normal responses - * using the second optional argument which is populated by reference. - * - * @param array $arguments Command arguments as defined by the command signature. - * @param bool $error Set to TRUE when Redis returned an error response. - * - * @return mixed - */ - public function executeRaw(array $arguments, &$error = null) - { - $error = false; - - $response = $this->connection->executeCommand( - new RawCommand($arguments) - ); - - if ($response instanceof ResponseInterface) { - if ($response instanceof ErrorResponseInterface) { - $error = true; - } - - return (string) $response; - } - - return $response; - } - - /** - * {@inheritdoc} - */ - public function __call($commandID, $arguments) - { - return $this->executeCommand( - $this->createCommand($commandID, $arguments) - ); - } - - /** - * {@inheritdoc} - */ - public function createCommand($commandID, $arguments = array()) - { - return $this->profile->createCommand($commandID, $arguments); - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - $response = $this->connection->executeCommand($command); - - if ($response instanceof ResponseInterface) { - if ($response instanceof ErrorResponseInterface) { - $response = $this->onErrorResponse($command, $response); - } - - return $response; - } - - return $command->parseResponse($response); - } - - /** - * Handles -ERR responses returned by Redis. - * - * @param CommandInterface $command Redis command that generated the error. - * @param ErrorResponseInterface $response Instance of the error response. - * - * @throws ServerException - * - * @return mixed - */ - protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $response) - { - if ($command instanceof ScriptCommand && $response->getErrorType() === 'NOSCRIPT') { - $eval = $this->createCommand('EVAL'); - $eval->setRawArguments($command->getEvalArguments()); - - $response = $this->executeCommand($eval); - - if (!$response instanceof ResponseInterface) { - $response = $command->parseResponse($response); - } - - return $response; - } - - if ($this->options->exceptions) { - throw new ServerException($response->getMessage()); - } - - return $response; - } - - /** - * Executes the specified initializer method on `$this` by adjusting the - * actual invokation depending on the arity (0, 1 or 2 arguments). This is - * simply an utility method to create Redis contexts instances since they - * follow a common initialization path. - * - * @param string $initializer Method name. - * @param array $argv Arguments for the method. - * - * @return mixed - */ - private function sharedContextFactory($initializer, $argv = null) - { - switch (count($argv)) { - case 0: - return $this->$initializer(); - - case 1: - return is_array($argv[0]) - ? $this->$initializer($argv[0]) - : $this->$initializer(null, $argv[0]); - - case 2: - list($arg0, $arg1) = $argv; - - return $this->$initializer($arg0, $arg1); - - default: - return $this->$initializer($this, $argv); - } - } - - /** - * Creates a new pipeline context and returns it, or returns the results of - * a pipeline executed inside the optionally provided callable object. - * - * @param mixed ... Array of options, a callable for execution, or both. - * - * @return Pipeline|array - */ - public function pipeline(/* arguments */) - { - return $this->sharedContextFactory('createPipeline', func_get_args()); - } - - /** - * Actual pipeline context initializer method. - * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. - * - * @return Pipeline|array - */ - protected function createPipeline(array $options = null, $callable = null) - { - if (isset($options['atomic']) && $options['atomic']) { - $class = 'Predis\Pipeline\Atomic'; - } elseif (isset($options['fire-and-forget']) && $options['fire-and-forget']) { - $class = 'Predis\Pipeline\FireAndForget'; - } else { - $class = 'Predis\Pipeline\Pipeline'; - } - - /* - * @var ClientContextInterface - */ - $pipeline = new $class($this); - - if (isset($callable)) { - return $pipeline->execute($callable); - } - - return $pipeline; - } - - /** - * Creates a new transaction context and returns it, or returns the results - * of a transaction executed inside the optionally provided callable object. - * - * @param mixed ... Array of options, a callable for execution, or both. - * - * @return MultiExecTransaction|array - */ - public function transaction(/* arguments */) - { - return $this->sharedContextFactory('createTransaction', func_get_args()); - } - - /** - * Actual transaction context initializer method. - * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. - * - * @return MultiExecTransaction|array - */ - protected function createTransaction(array $options = null, $callable = null) - { - $transaction = new MultiExecTransaction($this, $options); - - if (isset($callable)) { - return $transaction->execute($callable); - } - - return $transaction; - } - - /** - * Creates a new publis/subscribe context and returns it, or starts its loop - * inside the optionally provided callable object. - * - * @param mixed ... Array of options, a callable for execution, or both. - * - * @return PubSubConsumer|null - */ - public function pubSubLoop(/* arguments */) - { - return $this->sharedContextFactory('createPubSub', func_get_args()); - } - - /** - * Actual publish/subscribe context initializer method. - * - * @param array $options Options for the context. - * @param mixed $callable Optional callable used to execute the context. - * - * @return PubSubConsumer|null - */ - protected function createPubSub(array $options = null, $callable = null) - { - $pubsub = new PubSubConsumer($this, $options); - - if (!isset($callable)) { - return $pubsub; - } - - foreach ($pubsub as $message) { - if (call_user_func($callable, $pubsub, $message) === false) { - $pubsub->stop(); - } - } - } - - /** - * Creates a new monitor consumer and returns it. - * - * @return MonitorConsumer - */ - public function monitor() - { - return new MonitorConsumer($this); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/ClientContextInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/ClientContextInterface.php deleted file mode 100644 index 7f695b78de..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/ClientContextInterface.php +++ /dev/null @@ -1,189 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -use Predis\Command\CommandInterface; - -/** - * Interface defining a client-side context such as a pipeline or transaction. - * - * @method $this del(array $keys) - * @method $this dump($key) - * @method $this exists($key) - * @method $this expire($key, $seconds) - * @method $this expireat($key, $timestamp) - * @method $this keys($pattern) - * @method $this move($key, $db) - * @method $this object($subcommand, $key) - * @method $this persist($key) - * @method $this pexpire($key, $milliseconds) - * @method $this pexpireat($key, $timestamp) - * @method $this pttl($key) - * @method $this randomkey() - * @method $this rename($key, $target) - * @method $this renamenx($key, $target) - * @method $this scan($cursor, array $options = null) - * @method $this sort($key, array $options = null) - * @method $this ttl($key) - * @method $this type($key) - * @method $this append($key, $value) - * @method $this bitcount($key, $start = null, $end = null) - * @method $this bitop($operation, $destkey, $key) - * @method $this decr($key) - * @method $this decrby($key, $decrement) - * @method $this get($key) - * @method $this getbit($key, $offset) - * @method $this getrange($key, $start, $end) - * @method $this getset($key, $value) - * @method $this incr($key) - * @method $this incrby($key, $increment) - * @method $this incrbyfloat($key, $increment) - * @method $this mget(array $keys) - * @method $this mset(array $dictionary) - * @method $this msetnx(array $dictionary) - * @method $this psetex($key, $milliseconds, $value) - * @method $this set($key, $value, $expireResolution = null, $expireTTL = null, $flag = null) - * @method $this setbit($key, $offset, $value) - * @method $this setex($key, $seconds, $value) - * @method $this setnx($key, $value) - * @method $this setrange($key, $offset, $value) - * @method $this strlen($key) - * @method $this hdel($key, array $fields) - * @method $this hexists($key, $field) - * @method $this hget($key, $field) - * @method $this hgetall($key) - * @method $this hincrby($key, $field, $increment) - * @method $this hincrbyfloat($key, $field, $increment) - * @method $this hkeys($key) - * @method $this hlen($key) - * @method $this hmget($key, array $fields) - * @method $this hmset($key, array $dictionary) - * @method $this hscan($key, $cursor, array $options = null) - * @method $this hset($key, $field, $value) - * @method $this hsetnx($key, $field, $value) - * @method $this hvals($key) - * @method $this blpop(array $keys, $timeout) - * @method $this brpop(array $keys, $timeout) - * @method $this brpoplpush($source, $destination, $timeout) - * @method $this lindex($key, $index) - * @method $this linsert($key, $whence, $pivot, $value) - * @method $this llen($key) - * @method $this lpop($key) - * @method $this lpush($key, array $values) - * @method $this lpushx($key, $value) - * @method $this lrange($key, $start, $stop) - * @method $this lrem($key, $count, $value) - * @method $this lset($key, $index, $value) - * @method $this ltrim($key, $start, $stop) - * @method $this rpop($key) - * @method $this rpoplpush($source, $destination) - * @method $this rpush($key, array $values) - * @method $this rpushx($key, $value) - * @method $this sadd($key, array $members) - * @method $this scard($key) - * @method $this sdiff(array $keys) - * @method $this sdiffstore($destination, array $keys) - * @method $this sinter(array $keys) - * @method $this sinterstore($destination, array $keys) - * @method $this sismember($key, $member) - * @method $this smembers($key) - * @method $this smove($source, $destination, $member) - * @method $this spop($key) - * @method $this srandmember($key, $count = null) - * @method $this srem($key, $member) - * @method $this sscan($key, $cursor, array $options = null) - * @method $this sunion(array $keys) - * @method $this sunionstore($destination, array $keys) - * @method $this zadd($key, array $membersAndScoresDictionary) - * @method $this zcard($key) - * @method $this zcount($key, $min, $max) - * @method $this zincrby($key, $increment, $member) - * @method $this zinterstore($destination, array $keys, array $options = null) - * @method $this zrange($key, $start, $stop, array $options = null) - * @method $this zrangebyscore($key, $min, $max, array $options = null) - * @method $this zrank($key, $member) - * @method $this zrem($key, $member) - * @method $this zremrangebyrank($key, $start, $stop) - * @method $this zremrangebyscore($key, $min, $max) - * @method $this zrevrange($key, $start, $stop, array $options = null) - * @method $this zrevrangebyscore($key, $min, $max, array $options = null) - * @method $this zrevrank($key, $member) - * @method $this zunionstore($destination, array $keys, array $options = null) - * @method $this zscore($key, $member) - * @method $this zscan($key, $cursor, array $options = null) - * @method $this zrangebylex($key, $start, $stop, array $options = null) - * @method $this zremrangebylex($key, $min, $max) - * @method $this zlexcount($key, $min, $max) - * @method $this pfadd($key, array $elements) - * @method $this pfmerge($destinationKey, array $sourceKeys) - * @method $this pfcount(array $keys) - * @method $this pubsub($subcommand, $argument) - * @method $this publish($channel, $message) - * @method $this discard() - * @method $this exec() - * @method $this multi() - * @method $this unwatch() - * @method $this watch($key) - * @method $this eval($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) - * @method $this evalsha($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) - * @method $this script($subcommand, $argument = null) - * @method $this auth($password) - * @method $this echo($message) - * @method $this ping($message = null) - * @method $this select($database) - * @method $this bgrewriteaof() - * @method $this bgsave() - * @method $this client($subcommand, $argument = null) - * @method $this config($subcommand, $argument = null) - * @method $this dbsize() - * @method $this flushall() - * @method $this flushdb() - * @method $this info($section = null) - * @method $this lastsave() - * @method $this save() - * @method $this slaveof($host, $port) - * @method $this slowlog($subcommand, $argument = null) - * @method $this time() - * @method $this command() - * - * @author Daniele Alessandri - */ -interface ClientContextInterface -{ - /** - * Sends the specified command instance to Redis. - * - * @param CommandInterface $command Command instance. - * - * @return mixed - */ - public function executeCommand(CommandInterface $command); - - /** - * Sends the specified command with its arguments to Redis. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - * - * @return mixed - */ - public function __call($method, $arguments); - - /** - * Starts the execution of the context. - * - * @param mixed $callable Optional callback for execution. - * - * @return array - */ - public function execute($callable = null); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/ClientException.php b/rainloop/v/0.0.0/app/libraries/Predis/ClientException.php deleted file mode 100644 index 6c07aaf0d0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/ClientException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -/** - * Exception class that identifies client-side errors. - * - * @author Daniele Alessandri - */ -class ClientException extends PredisException -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/ClientInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/ClientInterface.php deleted file mode 100644 index f216c470ce..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/ClientInterface.php +++ /dev/null @@ -1,230 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -use Predis\Command\CommandInterface; -use Predis\Configuration\OptionsInterface; -use Predis\Connection\ConnectionInterface; -use Predis\Profile\ProfileInterface; - -/** - * Interface defining a client able to execute commands against Redis. - * - * All the commands exposed by the client generally have the same signature as - * described by the Redis documentation, but some of them offer an additional - * and more friendly interface to ease programming which is described in the - * following list of methods: - * - * @method int del(array $keys) - * @method string dump($key) - * @method int exists($key) - * @method int expire($key, $seconds) - * @method int expireat($key, $timestamp) - * @method array keys($pattern) - * @method int move($key, $db) - * @method mixed object($subcommand, $key) - * @method int persist($key) - * @method int pexpire($key, $milliseconds) - * @method int pexpireat($key, $timestamp) - * @method int pttl($key) - * @method string randomkey() - * @method mixed rename($key, $target) - * @method int renamenx($key, $target) - * @method array scan($cursor, array $options = null) - * @method array sort($key, array $options = null) - * @method int ttl($key) - * @method mixed type($key) - * @method int append($key, $value) - * @method int bitcount($key, $start = null, $end = null) - * @method int bitop($operation, $destkey, $key) - * @method int decr($key) - * @method int decrby($key, $decrement) - * @method string get($key) - * @method int getbit($key, $offset) - * @method string getrange($key, $start, $end) - * @method string getset($key, $value) - * @method int incr($key) - * @method int incrby($key, $increment) - * @method string incrbyfloat($key, $increment) - * @method array mget(array $keys) - * @method mixed mset(array $dictionary) - * @method int msetnx(array $dictionary) - * @method mixed psetex($key, $milliseconds, $value) - * @method mixed set($key, $value, $expireResolution = null, $expireTTL = null, $flag = null) - * @method int setbit($key, $offset, $value) - * @method int setex($key, $seconds, $value) - * @method int setnx($key, $value) - * @method int setrange($key, $offset, $value) - * @method int strlen($key) - * @method int hdel($key, array $fields) - * @method int hexists($key, $field) - * @method string hget($key, $field) - * @method array hgetall($key) - * @method int hincrby($key, $field, $increment) - * @method string hincrbyfloat($key, $field, $increment) - * @method array hkeys($key) - * @method int hlen($key) - * @method array hmget($key, array $fields) - * @method mixed hmset($key, array $dictionary) - * @method array hscan($key, $cursor, array $options = null) - * @method int hset($key, $field, $value) - * @method int hsetnx($key, $field, $value) - * @method array hvals($key) - * @method array blpop(array $keys, $timeout) - * @method array brpop(array $keys, $timeout) - * @method array brpoplpush($source, $destination, $timeout) - * @method string lindex($key, $index) - * @method int linsert($key, $whence, $pivot, $value) - * @method int llen($key) - * @method string lpop($key) - * @method int lpush($key, array $values) - * @method int lpushx($key, $value) - * @method array lrange($key, $start, $stop) - * @method int lrem($key, $count, $value) - * @method mixed lset($key, $index, $value) - * @method mixed ltrim($key, $start, $stop) - * @method string rpop($key) - * @method string rpoplpush($source, $destination) - * @method int rpush($key, array $values) - * @method int rpushx($key, $value) - * @method int sadd($key, array $members) - * @method int scard($key) - * @method array sdiff(array $keys) - * @method int sdiffstore($destination, array $keys) - * @method array sinter(array $keys) - * @method int sinterstore($destination, array $keys) - * @method int sismember($key, $member) - * @method array smembers($key) - * @method int smove($source, $destination, $member) - * @method string spop($key) - * @method string srandmember($key, $count = null) - * @method int srem($key, $member) - * @method array sscan($key, $cursor, array $options = null) - * @method array sunion(array $keys) - * @method int sunionstore($destination, array $keys) - * @method int zadd($key, array $membersAndScoresDictionary) - * @method int zcard($key) - * @method string zcount($key, $min, $max) - * @method string zincrby($key, $increment, $member) - * @method int zinterstore($destination, array $keys, array $options = null) - * @method array zrange($key, $start, $stop, array $options = null) - * @method array zrangebyscore($key, $min, $max, array $options = null) - * @method int zrank($key, $member) - * @method int zrem($key, $member) - * @method int zremrangebyrank($key, $start, $stop) - * @method int zremrangebyscore($key, $min, $max) - * @method array zrevrange($key, $start, $stop, array $options = null) - * @method array zrevrangebyscore($key, $min, $max, array $options = null) - * @method int zrevrank($key, $member) - * @method int zunionstore($destination, array $keys, array $options = null) - * @method string zscore($key, $member) - * @method array zscan($key, $cursor, array $options = null) - * @method array zrangebylex($key, $start, $stop, array $options = null) - * @method int zremrangebylex($key, $min, $max) - * @method int zlexcount($key, $min, $max) - * @method int pfadd($key, array $elements) - * @method mixed pfmerge($destinationKey, array $sourceKeys) - * @method int pfcount(array $keys) - * @method mixed pubsub($subcommand, $argument) - * @method int publish($channel, $message) - * @method mixed discard() - * @method array exec() - * @method mixed multi() - * @method mixed unwatch() - * @method mixed watch($key) - * @method mixed eval($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) - * @method mixed evalsha($script, $numkeys, $keyOrArg1 = null, $keyOrArgN = null) - * @method mixed script($subcommand, $argument = null) - * @method mixed auth($password) - * @method string echo($message) - * @method mixed ping($message = null) - * @method mixed select($database) - * @method mixed bgrewriteaof() - * @method mixed bgsave() - * @method mixed client($subcommand, $argument = null) - * @method mixed config($subcommand, $argument = null) - * @method int dbsize() - * @method mixed flushall() - * @method mixed flushdb() - * @method array info($section = null) - * @method int lastsave() - * @method mixed save() - * @method mixed slaveof($host, $port) - * @method mixed slowlog($subcommand, $argument = null) - * @method array time() - * @method array command() - * - * @author Daniele Alessandri - */ -interface ClientInterface -{ - /** - * Returns the server profile used by the client. - * - * @return ProfileInterface - */ - public function getProfile(); - - /** - * Returns the client options specified upon initialization. - * - * @return OptionsInterface - */ - public function getOptions(); - - /** - * Opens the underlying connection to the server. - */ - public function connect(); - - /** - * Closes the underlying connection from the server. - */ - public function disconnect(); - - /** - * Returns the underlying connection instance. - * - * @return ConnectionInterface - */ - public function getConnection(); - - /** - * Creates a new instance of the specified Redis command. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - * - * @return CommandInterface - */ - public function createCommand($method, $arguments = array()); - - /** - * Executes the specified Redis command. - * - * @param CommandInterface $command Command instance. - * - * @return mixed - */ - public function executeCommand(CommandInterface $command); - - /** - * Creates a Redis command with the specified arguments and sends a request - * to the server. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - * - * @return mixed - */ - public function __call($method, $arguments); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/ClusterStrategy.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/ClusterStrategy.php deleted file mode 100644 index 7635000ec6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/ClusterStrategy.php +++ /dev/null @@ -1,398 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster; - -use Predis\Command\CommandInterface; -use Predis\Command\ScriptCommand; - -/** - * Common class implementing the logic needed to support clustering strategies. - * - * @author Daniele Alessandri - */ -abstract class ClusterStrategy implements StrategyInterface -{ - protected $commands; - - /** - * - */ - public function __construct() - { - $this->commands = $this->getDefaultCommands(); - } - - /** - * Returns the default map of supported commands with their handlers. - * - * @return array - */ - protected function getDefaultCommands() - { - $getKeyFromFirstArgument = array($this, 'getKeyFromFirstArgument'); - $getKeyFromAllArguments = array($this, 'getKeyFromAllArguments'); - - return array( - /* commands operating on the key space */ - 'EXISTS' => $getKeyFromFirstArgument, - 'DEL' => $getKeyFromAllArguments, - 'TYPE' => $getKeyFromFirstArgument, - 'EXPIRE' => $getKeyFromFirstArgument, - 'EXPIREAT' => $getKeyFromFirstArgument, - 'PERSIST' => $getKeyFromFirstArgument, - 'PEXPIRE' => $getKeyFromFirstArgument, - 'PEXPIREAT' => $getKeyFromFirstArgument, - 'TTL' => $getKeyFromFirstArgument, - 'PTTL' => $getKeyFromFirstArgument, - 'SORT' => $getKeyFromFirstArgument, // TODO - 'DUMP' => $getKeyFromFirstArgument, - 'RESTORE' => $getKeyFromFirstArgument, - - /* commands operating on string values */ - 'APPEND' => $getKeyFromFirstArgument, - 'DECR' => $getKeyFromFirstArgument, - 'DECRBY' => $getKeyFromFirstArgument, - 'GET' => $getKeyFromFirstArgument, - 'GETBIT' => $getKeyFromFirstArgument, - 'MGET' => $getKeyFromAllArguments, - 'SET' => $getKeyFromFirstArgument, - 'GETRANGE' => $getKeyFromFirstArgument, - 'GETSET' => $getKeyFromFirstArgument, - 'INCR' => $getKeyFromFirstArgument, - 'INCRBY' => $getKeyFromFirstArgument, - 'INCRBYFLOAT' => $getKeyFromFirstArgument, - 'SETBIT' => $getKeyFromFirstArgument, - 'SETEX' => $getKeyFromFirstArgument, - 'MSET' => array($this, 'getKeyFromInterleavedArguments'), - 'MSETNX' => array($this, 'getKeyFromInterleavedArguments'), - 'SETNX' => $getKeyFromFirstArgument, - 'SETRANGE' => $getKeyFromFirstArgument, - 'STRLEN' => $getKeyFromFirstArgument, - 'SUBSTR' => $getKeyFromFirstArgument, - 'BITOP' => array($this, 'getKeyFromBitOp'), - 'BITCOUNT' => $getKeyFromFirstArgument, - - /* commands operating on lists */ - 'LINSERT' => $getKeyFromFirstArgument, - 'LINDEX' => $getKeyFromFirstArgument, - 'LLEN' => $getKeyFromFirstArgument, - 'LPOP' => $getKeyFromFirstArgument, - 'RPOP' => $getKeyFromFirstArgument, - 'RPOPLPUSH' => $getKeyFromAllArguments, - 'BLPOP' => array($this, 'getKeyFromBlockingListCommands'), - 'BRPOP' => array($this, 'getKeyFromBlockingListCommands'), - 'BRPOPLPUSH' => array($this, 'getKeyFromBlockingListCommands'), - 'LPUSH' => $getKeyFromFirstArgument, - 'LPUSHX' => $getKeyFromFirstArgument, - 'RPUSH' => $getKeyFromFirstArgument, - 'RPUSHX' => $getKeyFromFirstArgument, - 'LRANGE' => $getKeyFromFirstArgument, - 'LREM' => $getKeyFromFirstArgument, - 'LSET' => $getKeyFromFirstArgument, - 'LTRIM' => $getKeyFromFirstArgument, - - /* commands operating on sets */ - 'SADD' => $getKeyFromFirstArgument, - 'SCARD' => $getKeyFromFirstArgument, - 'SDIFF' => $getKeyFromAllArguments, - 'SDIFFSTORE' => $getKeyFromAllArguments, - 'SINTER' => $getKeyFromAllArguments, - 'SINTERSTORE' => $getKeyFromAllArguments, - 'SUNION' => $getKeyFromAllArguments, - 'SUNIONSTORE' => $getKeyFromAllArguments, - 'SISMEMBER' => $getKeyFromFirstArgument, - 'SMEMBERS' => $getKeyFromFirstArgument, - 'SSCAN' => $getKeyFromFirstArgument, - 'SPOP' => $getKeyFromFirstArgument, - 'SRANDMEMBER' => $getKeyFromFirstArgument, - 'SREM' => $getKeyFromFirstArgument, - - /* commands operating on sorted sets */ - 'ZADD' => $getKeyFromFirstArgument, - 'ZCARD' => $getKeyFromFirstArgument, - 'ZCOUNT' => $getKeyFromFirstArgument, - 'ZINCRBY' => $getKeyFromFirstArgument, - 'ZINTERSTORE' => array($this, 'getKeyFromZsetAggregationCommands'), - 'ZRANGE' => $getKeyFromFirstArgument, - 'ZRANGEBYSCORE' => $getKeyFromFirstArgument, - 'ZRANK' => $getKeyFromFirstArgument, - 'ZREM' => $getKeyFromFirstArgument, - 'ZREMRANGEBYRANK' => $getKeyFromFirstArgument, - 'ZREMRANGEBYSCORE' => $getKeyFromFirstArgument, - 'ZREVRANGE' => $getKeyFromFirstArgument, - 'ZREVRANGEBYSCORE' => $getKeyFromFirstArgument, - 'ZREVRANK' => $getKeyFromFirstArgument, - 'ZSCORE' => $getKeyFromFirstArgument, - 'ZUNIONSTORE' => array($this, 'getKeyFromZsetAggregationCommands'), - 'ZSCAN' => $getKeyFromFirstArgument, - 'ZLEXCOUNT' => $getKeyFromFirstArgument, - 'ZRANGEBYLEX' => $getKeyFromFirstArgument, - 'ZREMRANGEBYLEX' => $getKeyFromFirstArgument, - 'ZREVRANGEBYLEX' => $getKeyFromFirstArgument, - - /* commands operating on hashes */ - 'HDEL' => $getKeyFromFirstArgument, - 'HEXISTS' => $getKeyFromFirstArgument, - 'HGET' => $getKeyFromFirstArgument, - 'HGETALL' => $getKeyFromFirstArgument, - 'HMGET' => $getKeyFromFirstArgument, - 'HMSET' => $getKeyFromFirstArgument, - 'HINCRBY' => $getKeyFromFirstArgument, - 'HINCRBYFLOAT' => $getKeyFromFirstArgument, - 'HKEYS' => $getKeyFromFirstArgument, - 'HLEN' => $getKeyFromFirstArgument, - 'HSET' => $getKeyFromFirstArgument, - 'HSETNX' => $getKeyFromFirstArgument, - 'HVALS' => $getKeyFromFirstArgument, - 'HSCAN' => $getKeyFromFirstArgument, - 'HSTRLEN' => $getKeyFromFirstArgument, - - /* commands operating on HyperLogLog */ - 'PFADD' => $getKeyFromFirstArgument, - 'PFCOUNT' => $getKeyFromAllArguments, - 'PFMERGE' => $getKeyFromAllArguments, - - /* scripting */ - 'EVAL' => array($this, 'getKeyFromScriptingCommands'), - 'EVALSHA' => array($this, 'getKeyFromScriptingCommands'), - ); - } - - /** - * Returns the list of IDs for the supported commands. - * - * @return array - */ - public function getSupportedCommands() - { - return array_keys($this->commands); - } - - /** - * Sets an handler for the specified command ID. - * - * The signature of the callback must have a single parameter of type - * Predis\Command\CommandInterface. - * - * When the callback argument is omitted or NULL, the previously associated - * handler for the specified command ID is removed. - * - * @param string $commandID Command ID. - * @param mixed $callback A valid callable object, or NULL to unset the handler. - * - * @throws \InvalidArgumentException - */ - public function setCommandHandler($commandID, $callback = null) - { - $commandID = strtoupper($commandID); - - if (!isset($callback)) { - unset($this->commands[$commandID]); - - return; - } - - if (!is_callable($callback)) { - throw new \InvalidArgumentException( - 'The argument must be a callable object or NULL.' - ); - } - - $this->commands[$commandID] = $callback; - } - - /** - * Extracts the key from the first argument of a command instance. - * - * @param CommandInterface $command Command instance. - * - * @return string - */ - protected function getKeyFromFirstArgument(CommandInterface $command) - { - return $command->getArgument(0); - } - - /** - * Extracts the key from a command with multiple keys only when all keys in - * the arguments array produce the same hash. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromAllArguments(CommandInterface $command) - { - $arguments = $command->getArguments(); - - if ($this->checkSameSlotForKeys($arguments)) { - return $arguments[0]; - } - } - - /** - * Extracts the key from a command with multiple keys only when all keys in - * the arguments array produce the same hash. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromInterleavedArguments(CommandInterface $command) - { - $arguments = $command->getArguments(); - $keys = array(); - - for ($i = 0; $i < count($arguments); $i += 2) { - $keys[] = $arguments[$i]; - } - - if ($this->checkSameSlotForKeys($keys)) { - return $arguments[0]; - } - } - - /** - * Extracts the key from BLPOP and BRPOP commands. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromBlockingListCommands(CommandInterface $command) - { - $arguments = $command->getArguments(); - - if ($this->checkSameSlotForKeys(array_slice($arguments, 0, count($arguments) - 1))) { - return $arguments[0]; - } - } - - /** - * Extracts the key from BITOP command. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromBitOp(CommandInterface $command) - { - $arguments = $command->getArguments(); - - if ($this->checkSameSlotForKeys(array_slice($arguments, 1, count($arguments)))) { - return $arguments[1]; - } - } - - /** - * Extracts the key from ZINTERSTORE and ZUNIONSTORE commands. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromZsetAggregationCommands(CommandInterface $command) - { - $arguments = $command->getArguments(); - $keys = array_merge(array($arguments[0]), array_slice($arguments, 2, $arguments[1])); - - if ($this->checkSameSlotForKeys($keys)) { - return $arguments[0]; - } - } - - /** - * Extracts the key from EVAL and EVALSHA commands. - * - * @param CommandInterface $command Command instance. - * - * @return string|null - */ - protected function getKeyFromScriptingCommands(CommandInterface $command) - { - if ($command instanceof ScriptCommand) { - $keys = $command->getKeys(); - } else { - $keys = array_slice($args = $command->getArguments(), 2, $args[1]); - } - - if ($keys && $this->checkSameSlotForKeys($keys)) { - return $keys[0]; - } - } - - /** - * {@inheritdoc} - */ - public function getSlot(CommandInterface $command) - { - $slot = $command->getSlot(); - - if (!isset($slot) && isset($this->commands[$cmdID = $command->getId()])) { - $key = call_user_func($this->commands[$cmdID], $command); - - if (isset($key)) { - $slot = $this->getSlotByKey($key); - $command->setSlot($slot); - } - } - - return $slot; - } - - /** - * Checks if the specified array of keys will generate the same hash. - * - * @param array $keys Array of keys. - * - * @return bool - */ - protected function checkSameSlotForKeys(array $keys) - { - if (!$count = count($keys)) { - return false; - } - - $currentSlot = $this->getSlotByKey($keys[0]); - - for ($i = 1; $i < $count; ++$i) { - $nextSlot = $this->getSlotByKey($keys[$i]); - - if ($currentSlot !== $nextSlot) { - return false; - } - - $currentSlot = $nextSlot; - } - - return true; - } - - /** - * Returns only the hashable part of a key (delimited by "{...}"), or the - * whole key if a key tag is not found in the string. - * - * @param string $key A key. - * - * @return string - */ - protected function extractKeyTag($key) - { - if (false !== $start = strpos($key, '{')) { - if (false !== ($end = strpos($key, '}', $start)) && $end !== ++$start) { - $key = substr($key, $start, $end - $start); - } - } - - return $key; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/DistributorInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/DistributorInterface.php deleted file mode 100644 index 831f52c529..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/DistributorInterface.php +++ /dev/null @@ -1,82 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Distributor; - -use Predis\Cluster\Hash\HashGeneratorInterface; - -/** - * A distributor implements the logic to automatically distribute keys among - * several nodes for client-side sharding. - * - * @author Daniele Alessandri - */ -interface DistributorInterface -{ - /** - * Adds a node to the distributor with an optional weight. - * - * @param mixed $node Node object. - * @param int $weight Weight for the node. - */ - public function add($node, $weight = null); - - /** - * Removes a node from the distributor. - * - * @param mixed $node Node object. - */ - public function remove($node); - - /** - * Returns the corresponding slot of a node from the distributor using the - * computed hash of a key. - * - * @param mixed $hash - * - * @return mixed - */ - public function getSlot($hash); - - /** - * Returns a node from the distributor using its assigned slot ID. - * - * @param mixed $slot - * - * @return mixed|null - */ - public function getBySlot($slot); - - /** - * Returns a node from the distributor using the computed hash of a key. - * - * @param mixed $hash - * - * @return mixed - */ - public function getByHash($hash); - - /** - * Returns a node from the distributor mapping to the specified value. - * - * @param string $value - * - * @return mixed - */ - public function get($value); - - /** - * Returns the underlying hash generator instance. - * - * @return HashGeneratorInterface - */ - public function getHashGenerator(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/EmptyRingException.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/EmptyRingException.php deleted file mode 100644 index 039f2f2e83..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/EmptyRingException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Distributor; - -/** - * Exception class that identifies empty rings. - * - * @author Daniele Alessandri - */ -class EmptyRingException extends \Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/HashRing.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/HashRing.php deleted file mode 100644 index db864d9127..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/HashRing.php +++ /dev/null @@ -1,270 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Distributor; - -use Predis\Cluster\Hash\HashGeneratorInterface; - -/** - * This class implements an hashring-based distributor that uses the same - * algorithm of memcache to distribute keys in a cluster using client-side - * sharding. - * - * @author Daniele Alessandri - * @author Lorenzo Castelli - */ -class HashRing implements DistributorInterface, HashGeneratorInterface -{ - const DEFAULT_REPLICAS = 128; - const DEFAULT_WEIGHT = 100; - - private $ring; - private $ringKeys; - private $ringKeysCount; - private $replicas; - private $nodeHashCallback; - private $nodes = array(); - - /** - * @param int $replicas Number of replicas in the ring. - * @param mixed $nodeHashCallback Callback returning a string used to calculate the hash of nodes. - */ - public function __construct($replicas = self::DEFAULT_REPLICAS, $nodeHashCallback = null) - { - $this->replicas = $replicas; - $this->nodeHashCallback = $nodeHashCallback; - } - - /** - * Adds a node to the ring with an optional weight. - * - * @param mixed $node Node object. - * @param int $weight Weight for the node. - */ - public function add($node, $weight = null) - { - // In case of collisions in the hashes of the nodes, the node added - // last wins, thus the order in which nodes are added is significant. - $this->nodes[] = array( - 'object' => $node, - 'weight' => (int) $weight ?: $this::DEFAULT_WEIGHT, - ); - - $this->reset(); - } - - /** - * {@inheritdoc} - */ - public function remove($node) - { - // A node is removed by resetting the ring so that it's recreated from - // scratch, in order to reassign possible hashes with collisions to the - // right node according to the order in which they were added in the - // first place. - for ($i = 0; $i < count($this->nodes); ++$i) { - if ($this->nodes[$i]['object'] === $node) { - array_splice($this->nodes, $i, 1); - $this->reset(); - - break; - } - } - } - - /** - * Resets the distributor. - */ - private function reset() - { - unset( - $this->ring, - $this->ringKeys, - $this->ringKeysCount - ); - } - - /** - * Returns the initialization status of the distributor. - * - * @return bool - */ - private function isInitialized() - { - return isset($this->ringKeys); - } - - /** - * Calculates the total weight of all the nodes in the distributor. - * - * @return int - */ - private function computeTotalWeight() - { - $totalWeight = 0; - - foreach ($this->nodes as $node) { - $totalWeight += $node['weight']; - } - - return $totalWeight; - } - - /** - * Initializes the distributor. - */ - private function initialize() - { - if ($this->isInitialized()) { - return; - } - - if (!$this->nodes) { - throw new EmptyRingException('Cannot initialize an empty hashring.'); - } - - $this->ring = array(); - $totalWeight = $this->computeTotalWeight(); - $nodesCount = count($this->nodes); - - foreach ($this->nodes as $node) { - $weightRatio = $node['weight'] / $totalWeight; - $this->addNodeToRing($this->ring, $node, $nodesCount, $this->replicas, $weightRatio); - } - - ksort($this->ring, SORT_NUMERIC); - $this->ringKeys = array_keys($this->ring); - $this->ringKeysCount = count($this->ringKeys); - } - - /** - * Implements the logic needed to add a node to the hashring. - * - * @param array $ring Source hashring. - * @param mixed $node Node object to be added. - * @param int $totalNodes Total number of nodes. - * @param int $replicas Number of replicas in the ring. - * @param float $weightRatio Weight ratio for the node. - */ - protected function addNodeToRing(&$ring, $node, $totalNodes, $replicas, $weightRatio) - { - $nodeObject = $node['object']; - $nodeHash = $this->getNodeHash($nodeObject); - $replicas = (int) round($weightRatio * $totalNodes * $replicas); - - for ($i = 0; $i < $replicas; ++$i) { - $key = crc32("$nodeHash:$i"); - $ring[$key] = $nodeObject; - } - } - - /** - * {@inheritdoc} - */ - protected function getNodeHash($nodeObject) - { - if (!isset($this->nodeHashCallback)) { - return (string) $nodeObject; - } - - return call_user_func($this->nodeHashCallback, $nodeObject); - } - - /** - * {@inheritdoc} - */ - public function hash($value) - { - return crc32($value); - } - - /** - * {@inheritdoc} - */ - public function getByHash($hash) - { - return $this->ring[$this->getSlot($hash)]; - } - - /** - * {@inheritdoc} - */ - public function getBySlot($slot) - { - $this->initialize(); - - if (isset($this->ring[$slot])) { - return $this->ring[$slot]; - } - } - - /** - * {@inheritdoc} - */ - public function getSlot($hash) - { - $this->initialize(); - - $ringKeys = $this->ringKeys; - $upper = $this->ringKeysCount - 1; - $lower = 0; - - while ($lower <= $upper) { - $index = ($lower + $upper) >> 1; - $item = $ringKeys[$index]; - - if ($item > $hash) { - $upper = $index - 1; - } elseif ($item < $hash) { - $lower = $index + 1; - } else { - return $item; - } - } - - return $ringKeys[$this->wrapAroundStrategy($upper, $lower, $this->ringKeysCount)]; - } - - /** - * {@inheritdoc} - */ - public function get($value) - { - $hash = $this->hash($value); - $node = $this->getByHash($hash); - - return $node; - } - - /** - * Implements a strategy to deal with wrap-around errors during binary searches. - * - * @param int $upper - * @param int $lower - * @param int $ringKeysCount - * - * @return int - */ - protected function wrapAroundStrategy($upper, $lower, $ringKeysCount) - { - // Binary search for the last item in ringkeys with a value less or - // equal to the key. If no such item exists, return the last item. - return $upper >= 0 ? $upper : $ringKeysCount - 1; - } - - /** - * {@inheritdoc} - */ - public function getHashGenerator() - { - return $this; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/KetamaRing.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/KetamaRing.php deleted file mode 100644 index dc77f320f4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Distributor/KetamaRing.php +++ /dev/null @@ -1,71 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Distributor; - -/** - * This class implements an hashring-based distributor that uses the same - * algorithm of libketama to distribute keys in a cluster using client-side - * sharding. - * - * @author Daniele Alessandri - * @author Lorenzo Castelli - */ -class KetamaRing extends HashRing -{ - const DEFAULT_REPLICAS = 160; - - /** - * @param mixed $nodeHashCallback Callback returning a string used to calculate the hash of nodes. - */ - public function __construct($nodeHashCallback = null) - { - parent::__construct($this::DEFAULT_REPLICAS, $nodeHashCallback); - } - - /** - * {@inheritdoc} - */ - protected function addNodeToRing(&$ring, $node, $totalNodes, $replicas, $weightRatio) - { - $nodeObject = $node['object']; - $nodeHash = $this->getNodeHash($nodeObject); - $replicas = (int) floor($weightRatio * $totalNodes * ($replicas / 4)); - - for ($i = 0; $i < $replicas; ++$i) { - $unpackedDigest = unpack('V4', md5("$nodeHash-$i", true)); - - foreach ($unpackedDigest as $key) { - $ring[$key] = $nodeObject; - } - } - } - - /** - * {@inheritdoc} - */ - public function hash($value) - { - $hash = unpack('V', md5($value, true)); - - return $hash[1]; - } - - /** - * {@inheritdoc} - */ - protected function wrapAroundStrategy($upper, $lower, $ringKeysCount) - { - // Binary search for the first item in ringkeys with a value greater - // or equal to the key. If no such item exists, return the first item. - return $lower < $ringKeysCount ? $lower : 0; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/CRC16.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/CRC16.php deleted file mode 100644 index 3add0cef2f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/CRC16.php +++ /dev/null @@ -1,72 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Hash; - -/** - * Hash generator implementing the CRC-CCITT-16 algorithm used by redis-cluster. - * - * @author Daniele Alessandri - */ -class CRC16 implements HashGeneratorInterface -{ - private static $CCITT_16 = array( - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0, - ); - - /** - * {@inheritdoc} - */ - public function hash($value) - { - // CRC-CCITT-16 algorithm - $crc = 0; - $CCITT_16 = self::$CCITT_16; - $strlen = strlen($value); - - for ($i = 0; $i < $strlen; ++$i) { - $crc = (($crc << 8) ^ $CCITT_16[($crc >> 8) ^ ord($value[$i])]) & 0xFFFF; - } - - return $crc; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/HashGeneratorInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/HashGeneratorInterface.php deleted file mode 100644 index 271b9e720e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/Hash/HashGeneratorInterface.php +++ /dev/null @@ -1,30 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster\Hash; - -/** - * An hash generator implements the logic used to calculate the hash of a key to - * distribute operations among Redis nodes. - * - * @author Daniele Alessandri - */ -interface HashGeneratorInterface -{ - /** - * Generates an hash from a string to be used for distribution. - * - * @param string $value String value. - * - * @return int - */ - public function hash($value); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/PredisStrategy.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/PredisStrategy.php deleted file mode 100644 index 2066842798..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/PredisStrategy.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster; - -use Predis\Cluster\Distributor\DistributorInterface; -use Predis\Cluster\Distributor\HashRing; - -/** - * Default cluster strategy used by Predis to handle client-side sharding. - * - * @author Daniele Alessandri - */ -class PredisStrategy extends ClusterStrategy -{ - protected $distributor; - - /** - * @param DistributorInterface $distributor Optional distributor instance. - */ - public function __construct(DistributorInterface $distributor = null) - { - parent::__construct(); - - $this->distributor = $distributor ?: new HashRing(); - } - - /** - * {@inheritdoc} - */ - public function getSlotByKey($key) - { - $key = $this->extractKeyTag($key); - $hash = $this->distributor->hash($key); - $slot = $this->distributor->getSlot($hash); - - return $slot; - } - - /** - * {@inheritdoc} - */ - protected function checkSameSlotForKeys(array $keys) - { - if (!$count = count($keys)) { - return false; - } - - $currentKey = $this->extractKeyTag($keys[0]); - - for ($i = 1; $i < $count; ++$i) { - $nextKey = $this->extractKeyTag($keys[$i]); - - if ($currentKey !== $nextKey) { - return false; - } - - $currentKey = $nextKey; - } - - return true; - } - - /** - * {@inheritdoc} - */ - public function getDistributor() - { - return $this->distributor; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/RedisStrategy.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/RedisStrategy.php deleted file mode 100644 index df0bdb49b2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/RedisStrategy.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster; - -use Predis\Cluster\Hash\CRC16; -use Predis\Cluster\Hash\HashGeneratorInterface; -use Predis\NotSupportedException; - -/** - * Default class used by Predis to calculate hashes out of keys of - * commands supported by redis-cluster. - * - * @author Daniele Alessandri - */ -class RedisStrategy extends ClusterStrategy -{ - protected $hashGenerator; - - /** - * @param HashGeneratorInterface $hashGenerator Hash generator instance. - */ - public function __construct(HashGeneratorInterface $hashGenerator = null) - { - parent::__construct(); - - $this->hashGenerator = $hashGenerator ?: new CRC16(); - } - - /** - * {@inheritdoc} - */ - public function getSlotByKey($key) - { - $key = $this->extractKeyTag($key); - $slot = $this->hashGenerator->hash($key) & 0x3FFF; - - return $slot; - } - - /** - * {@inheritdoc} - */ - public function getDistributor() - { - throw new NotSupportedException( - 'This cluster strategy does not provide an external distributor' - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/StrategyInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Cluster/StrategyInterface.php deleted file mode 100644 index cdf7d09fac..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Cluster/StrategyInterface.php +++ /dev/null @@ -1,53 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Cluster; - -use Predis\Cluster\Distributor\DistributorInterface; -use Predis\Command\CommandInterface; - -/** - * Interface for classes defining the strategy used to calculate an hash out of - * keys extracted from supported commands. - * - * This is mostly useful to support clustering via client-side sharding. - * - * @author Daniele Alessandri - */ -interface StrategyInterface -{ - /** - * Returns a slot for the given command used for clustering distribution or - * NULL when this is not possible. - * - * @param CommandInterface $command Command instance. - * - * @return int - */ - public function getSlot(CommandInterface $command); - - /** - * Returns a slot for the given key used for clustering distribution or NULL - * when this is not possible. - * - * @param string $key Key string. - * - * @return int - */ - public function getSlotByKey($key); - - /** - * Returns a distributor instance to be used by the cluster. - * - * @return DistributorInterface - */ - public function getDistributor(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/CursorBasedIterator.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/CursorBasedIterator.php deleted file mode 100644 index 922883f05e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/CursorBasedIterator.php +++ /dev/null @@ -1,191 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; -use Predis\NotSupportedException; - -/** - * Provides the base implementation for a fully-rewindable PHP iterator that can - * incrementally iterate over cursor-based collections stored on Redis using the - * commands in the `SCAN` family. - * - * Given their incremental nature with multiple fetches, these kind of iterators - * offer limited guarantees about the returned elements because the collection - * can change several times during the iteration process. - * - * @see http://redis.io/commands/scan - * - * @author Daniele Alessandri - */ -abstract class CursorBasedIterator implements \Iterator -{ - protected $client; - protected $match; - protected $count; - - protected $valid; - protected $fetchmore; - protected $elements; - protected $cursor; - protected $position; - protected $current; - - /** - * @param ClientInterface $client Client connected to Redis. - * @param string $match Pattern to match during the server-side iteration. - * @param int $count Hint used by Redis to compute the number of results per iteration. - */ - public function __construct(ClientInterface $client, $match = null, $count = null) - { - $this->client = $client; - $this->match = $match; - $this->count = $count; - - $this->reset(); - } - - /** - * Ensures that the client supports the specified Redis command required to - * fetch elements from the server to perform the iteration. - * - * @param ClientInterface $client Client connected to Redis. - * @param string $commandID Command ID. - * - * @throws NotSupportedException - */ - protected function requiredCommand(ClientInterface $client, $commandID) - { - if (!$client->getProfile()->supportsCommand($commandID)) { - throw new NotSupportedException("The current profile does not support '$commandID'."); - } - } - - /** - * Resets the inner state of the iterator. - */ - protected function reset() - { - $this->valid = true; - $this->fetchmore = true; - $this->elements = array(); - $this->cursor = 0; - $this->position = -1; - $this->current = null; - } - - /** - * Returns an array of options for the `SCAN` command. - * - * @return array - */ - protected function getScanOptions() - { - $options = array(); - - if (strlen($this->match) > 0) { - $options['MATCH'] = $this->match; - } - - if ($this->count > 0) { - $options['COUNT'] = $this->count; - } - - return $options; - } - - /** - * Fetches a new set of elements from the remote collection, effectively - * advancing the iteration process. - * - * @return array - */ - abstract protected function executeCommand(); - - /** - * Populates the local buffer of elements fetched from the server during - * the iteration. - */ - protected function fetch() - { - list($cursor, $elements) = $this->executeCommand(); - - if (!$cursor) { - $this->fetchmore = false; - } - - $this->cursor = $cursor; - $this->elements = $elements; - } - - /** - * Extracts next values for key() and current(). - */ - protected function extractNext() - { - ++$this->position; - $this->current = array_shift($this->elements); - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->reset(); - $this->next(); - } - - /** - * {@inheritdoc} - */ - public function current() - { - return $this->current; - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - public function next() - { - tryFetch: { - if (!$this->elements && $this->fetchmore) { - $this->fetch(); - } - - if ($this->elements) { - $this->extractNext(); - } elseif ($this->cursor) { - goto tryFetch; - } else { - $this->valid = false; - } - } - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->valid; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/HashKey.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/HashKey.php deleted file mode 100644 index aa8aeaf02b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/HashKey.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; - -/** - * Abstracts the iteration of fields and values of an hash by leveraging the - * HSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. - * - * @author Daniele Alessandri - * - * @link http://redis.io/commands/scan - */ -class HashKey extends CursorBasedIterator -{ - protected $key; - - /** - * {@inheritdoc} - */ - public function __construct(ClientInterface $client, $key, $match = null, $count = null) - { - $this->requiredCommand($client, 'HSCAN'); - - parent::__construct($client, $match, $count); - - $this->key = $key; - } - - /** - * {@inheritdoc} - */ - protected function executeCommand() - { - return $this->client->hscan($this->key, $this->cursor, $this->getScanOptions()); - } - - /** - * {@inheritdoc} - */ - protected function extractNext() - { - $this->position = key($this->elements); - $this->current = array_shift($this->elements); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/Keyspace.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/Keyspace.php deleted file mode 100644 index 5d985b9bc3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/Keyspace.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; - -/** - * Abstracts the iteration of the keyspace on a Redis instance by leveraging the - * SCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. - * - * @author Daniele Alessandri - * - * @link http://redis.io/commands/scan - */ -class Keyspace extends CursorBasedIterator -{ - /** - * {@inheritdoc} - */ - public function __construct(ClientInterface $client, $match = null, $count = null) - { - $this->requiredCommand($client, 'SCAN'); - - parent::__construct($client, $match, $count); - } - - /** - * {@inheritdoc} - */ - protected function executeCommand() - { - return $this->client->scan($this->cursor, $this->getScanOptions()); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/ListKey.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/ListKey.php deleted file mode 100644 index 7a6eb479e3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/ListKey.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; -use Predis\NotSupportedException; - -/** - * Abstracts the iteration of items stored in a list by leveraging the LRANGE - * command wrapped in a fully-rewindable PHP iterator. - * - * This iterator tries to emulate the behaviour of cursor-based iterators based - * on the SCAN-family of commands introduced in Redis <= 2.8, meaning that due - * to its incremental nature with multiple fetches it can only offer limited - * guarantees on the returned elements because the collection can change several - * times (trimmed, deleted, overwritten) during the iteration process. - * - * @author Daniele Alessandri - * - * @link http://redis.io/commands/lrange - */ -class ListKey implements \Iterator -{ - protected $client; - protected $count; - protected $key; - - protected $valid; - protected $fetchmore; - protected $elements; - protected $position; - protected $current; - - /** - * @param ClientInterface $client Client connected to Redis. - * @param string $key Redis list key. - * @param int $count Number of items retrieved on each fetch operation. - * - * @throws \InvalidArgumentException - */ - public function __construct(ClientInterface $client, $key, $count = 10) - { - $this->requiredCommand($client, 'LRANGE'); - - if ((false === $count = filter_var($count, FILTER_VALIDATE_INT)) || $count < 0) { - throw new \InvalidArgumentException('The $count argument must be a positive integer.'); - } - - $this->client = $client; - $this->key = $key; - $this->count = $count; - - $this->reset(); - } - - /** - * Ensures that the client instance supports the specified Redis command - * required to fetch elements from the server to perform the iteration. - * - * @param ClientInterface $client Client connected to Redis. - * @param string $commandID Command ID. - * - * @throws NotSupportedException - */ - protected function requiredCommand(ClientInterface $client, $commandID) - { - if (!$client->getProfile()->supportsCommand($commandID)) { - throw new NotSupportedException("The current profile does not support '$commandID'."); - } - } - - /** - * Resets the inner state of the iterator. - */ - protected function reset() - { - $this->valid = true; - $this->fetchmore = true; - $this->elements = array(); - $this->position = -1; - $this->current = null; - } - - /** - * Fetches a new set of elements from the remote collection, effectively - * advancing the iteration process. - * - * @return array - */ - protected function executeCommand() - { - return $this->client->lrange($this->key, $this->position + 1, $this->position + $this->count); - } - - /** - * Populates the local buffer of elements fetched from the server during the - * iteration. - */ - protected function fetch() - { - $elements = $this->executeCommand(); - - if (count($elements) < $this->count) { - $this->fetchmore = false; - } - - $this->elements = $elements; - } - - /** - * Extracts next values for key() and current(). - */ - protected function extractNext() - { - ++$this->position; - $this->current = array_shift($this->elements); - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - $this->reset(); - $this->next(); - } - - /** - * {@inheritdoc} - */ - public function current() - { - return $this->current; - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - public function next() - { - if (!$this->elements && $this->fetchmore) { - $this->fetch(); - } - - if ($this->elements) { - $this->extractNext(); - } else { - $this->valid = false; - } - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->valid; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SetKey.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SetKey.php deleted file mode 100644 index bf25439751..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SetKey.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; - -/** - * Abstracts the iteration of members stored in a set by leveraging the SSCAN - * command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. - * - * @author Daniele Alessandri - * - * @link http://redis.io/commands/scan - */ -class SetKey extends CursorBasedIterator -{ - protected $key; - - /** - * {@inheritdoc} - */ - public function __construct(ClientInterface $client, $key, $match = null, $count = null) - { - $this->requiredCommand($client, 'SSCAN'); - - parent::__construct($client, $match, $count); - - $this->key = $key; - } - - /** - * {@inheritdoc} - */ - protected function executeCommand() - { - return $this->client->sscan($this->key, $this->cursor, $this->getScanOptions()); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SortedSetKey.php b/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SortedSetKey.php deleted file mode 100644 index e2f1789227..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Collection/Iterator/SortedSetKey.php +++ /dev/null @@ -1,60 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Collection\Iterator; - -use Predis\ClientInterface; - -/** - * Abstracts the iteration of members stored in a sorted set by leveraging the - * ZSCAN command (Redis >= 2.8) wrapped in a fully-rewindable PHP iterator. - * - * @author Daniele Alessandri - * - * @link http://redis.io/commands/scan - */ -class SortedSetKey extends CursorBasedIterator -{ - protected $key; - - /** - * {@inheritdoc} - */ - public function __construct(ClientInterface $client, $key, $match = null, $count = null) - { - $this->requiredCommand($client, 'ZSCAN'); - - parent::__construct($client, $match, $count); - - $this->key = $key; - } - - /** - * {@inheritdoc} - */ - protected function executeCommand() - { - return $this->client->zscan($this->key, $this->cursor, $this->getScanOptions()); - } - - /** - * {@inheritdoc} - */ - protected function extractNext() - { - if ($kv = each($this->elements)) { - $this->position = $kv[0]; - $this->current = $kv[1]; - - unset($this->elements[$this->position]); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/Command.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/Command.php deleted file mode 100644 index bb538e7c5e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/Command.php +++ /dev/null @@ -1,129 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * Base class for Redis commands. - * - * @author Daniele Alessandri - */ -abstract class Command implements CommandInterface -{ - private $slot; - private $arguments = array(); - - /** - * Returns a filtered array of the arguments. - * - * @param array $arguments List of arguments. - * - * @return array - */ - protected function filterArguments(array $arguments) - { - return $arguments; - } - - /** - * {@inheritdoc} - */ - public function setArguments(array $arguments) - { - $this->arguments = $this->filterArguments($arguments); - unset($this->slot); - } - - /** - * {@inheritdoc} - */ - public function setRawArguments(array $arguments) - { - $this->arguments = $arguments; - unset($this->slot); - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * {@inheritdoc} - */ - public function getArgument($index) - { - if (isset($this->arguments[$index])) { - return $this->arguments[$index]; - } - } - - /** - * {@inheritdoc} - */ - public function setSlot($slot) - { - $this->slot = $slot; - } - - /** - * {@inheritdoc} - */ - public function getSlot() - { - if (isset($this->slot)) { - return $this->slot; - } - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return $data; - } - - /** - * Normalizes the arguments array passed to a Redis command. - * - * @param array $arguments Arguments for a command. - * - * @return array - */ - public static function normalizeArguments(array $arguments) - { - if (count($arguments) === 1 && is_array($arguments[0])) { - return $arguments[0]; - } - - return $arguments; - } - - /** - * Normalizes the arguments array passed to a variadic Redis command. - * - * @param array $arguments Arguments for a command. - * - * @return array - */ - public static function normalizeVariadic(array $arguments) - { - if (count($arguments) === 2 && is_array($arguments[1])) { - return array_merge(array($arguments[0]), $arguments[1]); - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/CommandInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/CommandInterface.php deleted file mode 100644 index 9f349e1dfc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/CommandInterface.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * Defines an abstraction representing a Redis command. - * - * @author Daniele Alessandri - */ -interface CommandInterface -{ - /** - * Returns the ID of the Redis command. By convention, command identifiers - * must always be uppercase. - * - * @return string - */ - public function getId(); - - /** - * Assign the specified slot to the command for clustering distribution. - * - * @param int $slot Slot ID. - */ - public function setSlot($slot); - - /** - * Returns the assigned slot of the command for clustering distribution. - * - * @return int|null - */ - public function getSlot(); - - /** - * Sets the arguments for the command. - * - * @param array $arguments List of arguments. - */ - public function setArguments(array $arguments); - - /** - * Sets the raw arguments for the command without processing them. - * - * @param array $arguments List of arguments. - */ - public function setRawArguments(array $arguments); - - /** - * Gets the arguments of the command. - * - * @return array - */ - public function getArguments(); - - /** - * Gets the argument of the command at the specified index. - * - * @param int $index Index of the desired argument. - * - * @return mixed|null - */ - public function getArgument($index); - - /** - * Parses a raw response and returns a PHP object. - * - * @param string $data Binary string containing the whole response. - * - * @return mixed - */ - public function parseResponse($data); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionAuth.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionAuth.php deleted file mode 100644 index c8c9dedce4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionAuth.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/auth - * - * @author Daniele Alessandri - */ -class ConnectionAuth extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'AUTH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionEcho.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionEcho.php deleted file mode 100644 index fd49609714..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionEcho.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/echo - * - * @author Daniele Alessandri - */ -class ConnectionEcho extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ECHO'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionPing.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionPing.php deleted file mode 100644 index fa9d7346f8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionPing.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/ping - * - * @author Daniele Alessandri - */ -class ConnectionPing extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PING'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionQuit.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionQuit.php deleted file mode 100644 index e59e31e3eb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionQuit.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/quit - * - * @author Daniele Alessandri - */ -class ConnectionQuit extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'QUIT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionSelect.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionSelect.php deleted file mode 100644 index 1da8256776..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ConnectionSelect.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/select - * - * @author Daniele Alessandri - */ -class ConnectionSelect extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SELECT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashDelete.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashDelete.php deleted file mode 100644 index d5d4c38c06..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashDelete.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hdel - * - * @author Daniele Alessandri - */ -class HashDelete extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HDEL'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashExists.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashExists.php deleted file mode 100644 index a2c69b90c7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashExists.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hexists - * - * @author Daniele Alessandri - */ -class HashExists extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HEXISTS'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGet.php deleted file mode 100644 index 20f33da547..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGet.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hget - * - * @author Daniele Alessandri - */ -class HashGet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HGET'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetAll.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetAll.php deleted file mode 100644 index d698675210..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetAll.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hgetall - * - * @author Daniele Alessandri - */ -class HashGetAll extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HGETALL'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - $result = array(); - - for ($i = 0; $i < count($data); ++$i) { - $result[$data[$i]] = $data[++$i]; - } - - return $result; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetMultiple.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetMultiple.php deleted file mode 100644 index 820ce958ea..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashGetMultiple.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hmget - * - * @author Daniele Alessandri - */ -class HashGetMultiple extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HMGET'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementBy.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementBy.php deleted file mode 100644 index a37359ffb7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementBy.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hincrby - * - * @author Daniele Alessandri - */ -class HashIncrementBy extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HINCRBY'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementByFloat.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementByFloat.php deleted file mode 100644 index bce9714fc6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashIncrementByFloat.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hincrbyfloat - * - * @author Daniele Alessandri - */ -class HashIncrementByFloat extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HINCRBYFLOAT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashKeys.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashKeys.php deleted file mode 100644 index 28266020a4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashKeys.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hkeys - * - * @author Daniele Alessandri - */ -class HashKeys extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HKEYS'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashLength.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashLength.php deleted file mode 100644 index d70926f1c7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashLength.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hlen - * - * @author Daniele Alessandri - */ -class HashLength extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HLEN'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashScan.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashScan.php deleted file mode 100644 index afde74eb90..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashScan.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hscan - * - * @author Daniele Alessandri - */ -class HashScan extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HSCAN'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 3 && is_array($arguments[2])) { - $options = $this->prepareOptions(array_pop($arguments)); - $arguments = array_merge($arguments, $options); - } - - return $arguments; - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - protected function prepareOptions($options) - { - $options = array_change_key_case($options, CASE_UPPER); - $normalized = array(); - - if (!empty($options['MATCH'])) { - $normalized[] = 'MATCH'; - $normalized[] = $options['MATCH']; - } - - if (!empty($options['COUNT'])) { - $normalized[] = 'COUNT'; - $normalized[] = $options['COUNT']; - } - - return $normalized; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if (is_array($data)) { - $fields = $data[1]; - $result = array(); - - for ($i = 0; $i < count($fields); ++$i) { - $result[$fields[$i]] = $fields[++$i]; - } - - $data[1] = $result; - } - - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSet.php deleted file mode 100644 index d3154a9b29..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSet.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hset - * - * @author Daniele Alessandri - */ -class HashSet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HSET'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetMultiple.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetMultiple.php deleted file mode 100644 index 6069e2ad9a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetMultiple.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hmset - * - * @author Daniele Alessandri - */ -class HashSetMultiple extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HMSET'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 2 && is_array($arguments[1])) { - $flattenedKVs = array($arguments[0]); - $args = $arguments[1]; - - foreach ($args as $k => $v) { - $flattenedKVs[] = $k; - $flattenedKVs[] = $v; - } - - return $flattenedKVs; - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetPreserve.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetPreserve.php deleted file mode 100644 index 582100d499..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashSetPreserve.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hsetnx - * - * @author Daniele Alessandri - */ -class HashSetPreserve extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HSETNX'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashStringLength.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashStringLength.php deleted file mode 100644 index 7cfda80df9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashStringLength.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hstrlen - * - * @author Daniele Alessandri - */ -class HashStringLength extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HSTRLEN'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashValues.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HashValues.php deleted file mode 100644 index 0a5ea5f618..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HashValues.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/hvals - * - * @author Daniele Alessandri - */ -class HashValues extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'HVALS'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogAdd.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogAdd.php deleted file mode 100644 index 18d2bd7b55..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogAdd.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pfadd - * - * @author Daniele Alessandri - */ -class HyperLogLogAdd extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PFADD'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogCount.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogCount.php deleted file mode 100644 index 0afe542700..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogCount.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pfcount - * - * @author Daniele Alessandri - */ -class HyperLogLogCount extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PFCOUNT'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogMerge.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogMerge.php deleted file mode 100644 index c160be5b20..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/HyperLogLogMerge.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pfmerge - * - * @author Daniele Alessandri - */ -class HyperLogLogMerge extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PFMERGE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDelete.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDelete.php deleted file mode 100644 index 89bdfdb7f7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDelete.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/del - * - * @author Daniele Alessandri - */ -class KeyDelete extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DEL'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDump.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDump.php deleted file mode 100644 index 6d9c488004..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyDump.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/dump - * - * @author Daniele Alessandri - */ -class KeyDump extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DUMP'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExists.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExists.php deleted file mode 100644 index 5196ca16b2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExists.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/exists - * - * @author Daniele Alessandri - */ -class KeyExists extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EXISTS'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpire.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpire.php deleted file mode 100644 index fd7c9c802c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpire.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/expire - * - * @author Daniele Alessandri - */ -class KeyExpire extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EXPIRE'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpireAt.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpireAt.php deleted file mode 100644 index e2fe7aeb6d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyExpireAt.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/expireat - * - * @author Daniele Alessandri - */ -class KeyExpireAt extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EXPIREAT'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyKeys.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyKeys.php deleted file mode 100644 index 6d74c40d28..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyKeys.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/keys - * - * @author Daniele Alessandri - */ -class KeyKeys extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'KEYS'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMigrate.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMigrate.php deleted file mode 100644 index 3324ef94c2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMigrate.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/migrate - * - * @author Daniele Alessandri - */ -class KeyMigrate extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MIGRATE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (is_array(end($arguments))) { - foreach (array_pop($arguments) as $modifier => $value) { - $modifier = strtoupper($modifier); - - if ($modifier === 'COPY' && $value == true) { - $arguments[] = $modifier; - } - - if ($modifier === 'REPLACE' && $value == true) { - $arguments[] = $modifier; - } - } - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMove.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMove.php deleted file mode 100644 index 8f1ab2a735..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyMove.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/move - * - * @author Daniele Alessandri - */ -class KeyMove extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MOVE'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPersist.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPersist.php deleted file mode 100644 index e772955367..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPersist.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/persist - * - * @author Daniele Alessandri - */ -class KeyPersist extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PERSIST'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpire.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpire.php deleted file mode 100644 index 258ec4766e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpire.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pexpire - * - * @author Daniele Alessandri - */ -class KeyPreciseExpire extends KeyExpire -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PEXPIRE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpireAt.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpireAt.php deleted file mode 100644 index e41921870c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseExpireAt.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pexpireat - * - * @author Daniele Alessandri - */ -class KeyPreciseExpireAt extends KeyExpireAt -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PEXPIREAT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseTimeToLive.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseTimeToLive.php deleted file mode 100644 index bdcd34b925..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyPreciseTimeToLive.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pttl - * - * @author Daniele Alessandri - */ -class KeyPreciseTimeToLive extends KeyTimeToLive -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PTTL'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRandom.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRandom.php deleted file mode 100644 index b208b2db43..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRandom.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/randomkey - * - * @author Daniele Alessandri - */ -class KeyRandom extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RANDOMKEY'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return $data !== '' ? $data : null; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRename.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRename.php deleted file mode 100644 index 82e44fb2e6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRename.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/rename - * - * @author Daniele Alessandri - */ -class KeyRename extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RENAME'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRenamePreserve.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRenamePreserve.php deleted file mode 100644 index 773ece6d31..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRenamePreserve.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/renamenx - * - * @author Daniele Alessandri - */ -class KeyRenamePreserve extends KeyRename -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RENAMENX'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRestore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRestore.php deleted file mode 100644 index a5b0b2dbc3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyRestore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/restore - * - * @author Daniele Alessandri - */ -class KeyRestore extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RESTORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyScan.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyScan.php deleted file mode 100644 index 05f5bb3acc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyScan.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/scan - * - * @author Daniele Alessandri - */ -class KeyScan extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SCAN'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 2 && is_array($arguments[1])) { - $options = $this->prepareOptions(array_pop($arguments)); - $arguments = array_merge($arguments, $options); - } - - return $arguments; - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - protected function prepareOptions($options) - { - $options = array_change_key_case($options, CASE_UPPER); - $normalized = array(); - - if (!empty($options['MATCH'])) { - $normalized[] = 'MATCH'; - $normalized[] = $options['MATCH']; - } - - if (!empty($options['COUNT'])) { - $normalized[] = 'COUNT'; - $normalized[] = $options['COUNT']; - } - - return $normalized; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeySort.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeySort.php deleted file mode 100644 index fd449f13df..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeySort.php +++ /dev/null @@ -1,83 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sort - * - * @author Daniele Alessandri - */ -class KeySort extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SORT'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 1) { - return $arguments; - } - - $query = array($arguments[0]); - $sortParams = array_change_key_case($arguments[1], CASE_UPPER); - - if (isset($sortParams['BY'])) { - $query[] = 'BY'; - $query[] = $sortParams['BY']; - } - - if (isset($sortParams['GET'])) { - $getargs = $sortParams['GET']; - - if (is_array($getargs)) { - foreach ($getargs as $getarg) { - $query[] = 'GET'; - $query[] = $getarg; - } - } else { - $query[] = 'GET'; - $query[] = $getargs; - } - } - - if (isset($sortParams['LIMIT']) && - is_array($sortParams['LIMIT']) && - count($sortParams['LIMIT']) == 2) { - $query[] = 'LIMIT'; - $query[] = $sortParams['LIMIT'][0]; - $query[] = $sortParams['LIMIT'][1]; - } - - if (isset($sortParams['SORT'])) { - $query[] = strtoupper($sortParams['SORT']); - } - - if (isset($sortParams['ALPHA']) && $sortParams['ALPHA'] == true) { - $query[] = 'ALPHA'; - } - - if (isset($sortParams['STORE'])) { - $query[] = 'STORE'; - $query[] = $sortParams['STORE']; - } - - return $query; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyTimeToLive.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyTimeToLive.php deleted file mode 100644 index 67697a6fbd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyTimeToLive.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/ttl - * - * @author Daniele Alessandri - */ -class KeyTimeToLive extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'TTL'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyType.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyType.php deleted file mode 100644 index f4f06e451a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/KeyType.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/type - * - * @author Daniele Alessandri - */ -class KeyType extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'TYPE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListIndex.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListIndex.php deleted file mode 100644 index 27c64be732..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListIndex.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lindex - * - * @author Daniele Alessandri - */ -class ListIndex extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LINDEX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListInsert.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListInsert.php deleted file mode 100644 index 7d53d11b21..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListInsert.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/linsert - * - * @author Daniele Alessandri - */ -class ListInsert extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LINSERT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListLength.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListLength.php deleted file mode 100644 index 6495beb778..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListLength.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/llen - * - * @author Daniele Alessandri - */ -class ListLength extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LLEN'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirst.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirst.php deleted file mode 100644 index 84d5d6734a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirst.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lpop - * - * @author Daniele Alessandri - */ -class ListPopFirst extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LPOP'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirstBlocking.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirstBlocking.php deleted file mode 100644 index 7dc7c0002a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopFirstBlocking.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/blpop - * - * @author Daniele Alessandri - */ -class ListPopFirstBlocking extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BLPOP'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 2 && is_array($arguments[0])) { - list($arguments, $timeout) = $arguments; - array_push($arguments, $timeout); - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLast.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLast.php deleted file mode 100644 index 9e92db5f46..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLast.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/rpop - * - * @author Daniele Alessandri - */ -class ListPopLast extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RPOP'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastBlocking.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastBlocking.php deleted file mode 100644 index 781eb9192d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastBlocking.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/brpop - * - * @author Daniele Alessandri - */ -class ListPopLastBlocking extends ListPopFirstBlocking -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BRPOP'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHead.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHead.php deleted file mode 100644 index f430eb227e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHead.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/rpoplpush - * - * @author Daniele Alessandri - */ -class ListPopLastPushHead extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RPOPLPUSH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHeadBlocking.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHeadBlocking.php deleted file mode 100644 index ee9c93c85a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPopLastPushHeadBlocking.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/brpoplpush - * - * @author Daniele Alessandri - */ -class ListPopLastPushHeadBlocking extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BRPOPLPUSH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHead.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHead.php deleted file mode 100644 index 74bf7c4911..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHead.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lpush - * - * @author Daniele Alessandri - */ -class ListPushHead extends ListPushTail -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LPUSH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHeadX.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHeadX.php deleted file mode 100644 index 8e136b880f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushHeadX.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lpushx - * - * @author Daniele Alessandri - */ -class ListPushHeadX extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LPUSHX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTail.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTail.php deleted file mode 100644 index f2a057c0b3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTail.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/rpush - * - * @author Daniele Alessandri - */ -class ListPushTail extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RPUSH'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTailX.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTailX.php deleted file mode 100644 index 1af3645b47..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListPushTailX.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/rpushx - * - * @author Daniele Alessandri - */ -class ListPushTailX extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'RPUSHX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRange.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRange.php deleted file mode 100644 index 32a21a6e63..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRange.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lrange - * - * @author Daniele Alessandri - */ -class ListRange extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LRANGE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRemove.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRemove.php deleted file mode 100644 index c5800899b3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListRemove.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lrem - * - * @author Daniele Alessandri - */ -class ListRemove extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LREM'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListSet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListSet.php deleted file mode 100644 index 5e59864dea..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListSet.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lset - * - * @author Daniele Alessandri - */ -class ListSet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LSET'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListTrim.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ListTrim.php deleted file mode 100644 index 193141809f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ListTrim.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/ltrim - * - * @author Daniele Alessandri - */ -class ListTrim extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LTRIM'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PrefixableCommandInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PrefixableCommandInterface.php deleted file mode 100644 index 6d54554faa..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PrefixableCommandInterface.php +++ /dev/null @@ -1,27 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * Defines a command whose keys can be prefixed. - * - * @author Daniele Alessandri - */ -interface PrefixableCommandInterface extends CommandInterface -{ - /** - * Prefixes all the keys found in the arguments of the command. - * - * @param string $prefix String used to prefix the keys. - */ - public function prefixKeys($prefix); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/KeyPrefixProcessor.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/KeyPrefixProcessor.php deleted file mode 100644 index d966d0e107..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/KeyPrefixProcessor.php +++ /dev/null @@ -1,415 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command\Processor; - -use Predis\Command\CommandInterface; -use Predis\Command\PrefixableCommandInterface; - -/** - * Command processor capable of prefixing keys stored in the arguments of Redis - * commands supported. - * - * @author Daniele Alessandri - */ -class KeyPrefixProcessor implements ProcessorInterface -{ - private $prefix; - private $commands; - - /** - * @param string $prefix Prefix for the keys. - */ - public function __construct($prefix) - { - $this->prefix = $prefix; - $this->commands = array( - /* ---------------- Redis 1.2 ---------------- */ - 'EXISTS' => 'static::first', - 'DEL' => 'static::all', - 'TYPE' => 'static::first', - 'KEYS' => 'static::first', - 'RENAME' => 'static::all', - 'RENAMENX' => 'static::all', - 'EXPIRE' => 'static::first', - 'EXPIREAT' => 'static::first', - 'TTL' => 'static::first', - 'MOVE' => 'static::first', - 'SORT' => 'static::sort', - 'DUMP' => 'static::first', - 'RESTORE' => 'static::first', - 'SET' => 'static::first', - 'SETNX' => 'static::first', - 'MSET' => 'static::interleaved', - 'MSETNX' => 'static::interleaved', - 'GET' => 'static::first', - 'MGET' => 'static::all', - 'GETSET' => 'static::first', - 'INCR' => 'static::first', - 'INCRBY' => 'static::first', - 'DECR' => 'static::first', - 'DECRBY' => 'static::first', - 'RPUSH' => 'static::first', - 'LPUSH' => 'static::first', - 'LLEN' => 'static::first', - 'LRANGE' => 'static::first', - 'LTRIM' => 'static::first', - 'LINDEX' => 'static::first', - 'LSET' => 'static::first', - 'LREM' => 'static::first', - 'LPOP' => 'static::first', - 'RPOP' => 'static::first', - 'RPOPLPUSH' => 'static::all', - 'SADD' => 'static::first', - 'SREM' => 'static::first', - 'SPOP' => 'static::first', - 'SMOVE' => 'static::skipLast', - 'SCARD' => 'static::first', - 'SISMEMBER' => 'static::first', - 'SINTER' => 'static::all', - 'SINTERSTORE' => 'static::all', - 'SUNION' => 'static::all', - 'SUNIONSTORE' => 'static::all', - 'SDIFF' => 'static::all', - 'SDIFFSTORE' => 'static::all', - 'SMEMBERS' => 'static::first', - 'SRANDMEMBER' => 'static::first', - 'ZADD' => 'static::first', - 'ZINCRBY' => 'static::first', - 'ZREM' => 'static::first', - 'ZRANGE' => 'static::first', - 'ZREVRANGE' => 'static::first', - 'ZRANGEBYSCORE' => 'static::first', - 'ZCARD' => 'static::first', - 'ZSCORE' => 'static::first', - 'ZREMRANGEBYSCORE' => 'static::first', - /* ---------------- Redis 2.0 ---------------- */ - 'SETEX' => 'static::first', - 'APPEND' => 'static::first', - 'SUBSTR' => 'static::first', - 'BLPOP' => 'static::skipLast', - 'BRPOP' => 'static::skipLast', - 'ZUNIONSTORE' => 'static::zsetStore', - 'ZINTERSTORE' => 'static::zsetStore', - 'ZCOUNT' => 'static::first', - 'ZRANK' => 'static::first', - 'ZREVRANK' => 'static::first', - 'ZREMRANGEBYRANK' => 'static::first', - 'HSET' => 'static::first', - 'HSETNX' => 'static::first', - 'HMSET' => 'static::first', - 'HINCRBY' => 'static::first', - 'HGET' => 'static::first', - 'HMGET' => 'static::first', - 'HDEL' => 'static::first', - 'HEXISTS' => 'static::first', - 'HLEN' => 'static::first', - 'HKEYS' => 'static::first', - 'HVALS' => 'static::first', - 'HGETALL' => 'static::first', - 'SUBSCRIBE' => 'static::all', - 'UNSUBSCRIBE' => 'static::all', - 'PSUBSCRIBE' => 'static::all', - 'PUNSUBSCRIBE' => 'static::all', - 'PUBLISH' => 'static::first', - /* ---------------- Redis 2.2 ---------------- */ - 'PERSIST' => 'static::first', - 'STRLEN' => 'static::first', - 'SETRANGE' => 'static::first', - 'GETRANGE' => 'static::first', - 'SETBIT' => 'static::first', - 'GETBIT' => 'static::first', - 'RPUSHX' => 'static::first', - 'LPUSHX' => 'static::first', - 'LINSERT' => 'static::first', - 'BRPOPLPUSH' => 'static::skipLast', - 'ZREVRANGEBYSCORE' => 'static::first', - 'WATCH' => 'static::all', - /* ---------------- Redis 2.6 ---------------- */ - 'PTTL' => 'static::first', - 'PEXPIRE' => 'static::first', - 'PEXPIREAT' => 'static::first', - 'PSETEX' => 'static::first', - 'INCRBYFLOAT' => 'static::first', - 'BITOP' => 'static::skipFirst', - 'BITCOUNT' => 'static::first', - 'HINCRBYFLOAT' => 'static::first', - 'EVAL' => 'static::evalKeys', - 'EVALSHA' => 'static::evalKeys', - 'MIGRATE' => 'static::migrate', - /* ---------------- Redis 2.8 ---------------- */ - 'SSCAN' => 'static::first', - 'ZSCAN' => 'static::first', - 'HSCAN' => 'static::first', - 'PFADD' => 'static::first', - 'PFCOUNT' => 'static::all', - 'PFMERGE' => 'static::all', - 'ZLEXCOUNT' => 'static::first', - 'ZRANGEBYLEX' => 'static::first', - 'ZREMRANGEBYLEX' => 'static::first', - 'ZREVRANGEBYLEX' => 'static::first', - 'BITPOS' => 'static::first', - /* ---------------- Redis 3.2 ---------------- */ - 'HSTRLEN' => 'static::first', - ); - } - - /** - * Sets a prefix that is applied to all the keys. - * - * @param string $prefix Prefix for the keys. - */ - public function setPrefix($prefix) - { - $this->prefix = $prefix; - } - - /** - * Gets the current prefix. - * - * @return string - */ - public function getPrefix() - { - return $this->prefix; - } - - /** - * {@inheritdoc} - */ - public function process(CommandInterface $command) - { - if ($command instanceof PrefixableCommandInterface) { - $command->prefixKeys($this->prefix); - } elseif (isset($this->commands[$commandID = strtoupper($command->getId())])) { - call_user_func($this->commands[$commandID], $command, $this->prefix); - } - } - - /** - * Sets an handler for the specified command ID. - * - * The callback signature must have 2 parameters of the following types: - * - * - Predis\Command\CommandInterface (command instance) - * - String (prefix) - * - * When the callback argument is omitted or NULL, the previously - * associated handler for the specified command ID is removed. - * - * @param string $commandID The ID of the command to be handled. - * @param mixed $callback A valid callable object or NULL. - * - * @throws \InvalidArgumentException - */ - public function setCommandHandler($commandID, $callback = null) - { - $commandID = strtoupper($commandID); - - if (!isset($callback)) { - unset($this->commands[$commandID]); - - return; - } - - if (!is_callable($callback)) { - throw new \InvalidArgumentException( - 'Callback must be a valid callable object or NULL' - ); - } - - $this->commands[$commandID] = $callback; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return $this->getPrefix(); - } - - /** - * Applies the specified prefix only the first argument. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function first(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $arguments[0] = "$prefix{$arguments[0]}"; - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to all the arguments. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function all(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - foreach ($arguments as &$key) { - $key = "$prefix$key"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix only to even arguments in the list. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function interleaved(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $length = count($arguments); - - for ($i = 0; $i < $length; $i += 2) { - $arguments[$i] = "$prefix{$arguments[$i]}"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to all the arguments but the first one. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function skipFirst(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $length = count($arguments); - - for ($i = 1; $i < $length; ++$i) { - $arguments[$i] = "$prefix{$arguments[$i]}"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to all the arguments but the last one. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function skipLast(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $length = count($arguments); - - for ($i = 0; $i < $length - 1; ++$i) { - $arguments[$i] = "$prefix{$arguments[$i]}"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to the keys of a SORT command. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function sort(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $arguments[0] = "$prefix{$arguments[0]}"; - - if (($count = count($arguments)) > 1) { - for ($i = 1; $i < $count; ++$i) { - switch ($arguments[$i]) { - case 'BY': - case 'STORE': - $arguments[$i] = "$prefix{$arguments[++$i]}"; - break; - - case 'GET': - $value = $arguments[++$i]; - if ($value !== '#') { - $arguments[$i] = "$prefix$value"; - } - break; - - case 'LIMIT'; - $i += 2; - break; - } - } - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to the keys of an EVAL-based command. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function evalKeys(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - for ($i = 2; $i < $arguments[1] + 2; ++$i) { - $arguments[$i] = "$prefix{$arguments[$i]}"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to the keys of Z[INTERSECTION|UNION]STORE. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function zsetStore(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $arguments[0] = "$prefix{$arguments[0]}"; - $length = ((int) $arguments[1]) + 2; - - for ($i = 2; $i < $length; ++$i) { - $arguments[$i] = "$prefix{$arguments[$i]}"; - } - - $command->setRawArguments($arguments); - } - } - - /** - * Applies the specified prefix to the key of a MIGRATE command. - * - * @param CommandInterface $command Command instance. - * @param string $prefix Prefix string. - */ - public static function migrate(CommandInterface $command, $prefix) - { - if ($arguments = $command->getArguments()) { - $arguments[2] = "$prefix{$arguments[2]}"; - $command->setRawArguments($arguments); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorChain.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorChain.php deleted file mode 100644 index 0a4768b0a7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorChain.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command\Processor; - -use Predis\Command\CommandInterface; - -/** - * Default implementation of a command processors chain. - * - * @author Daniele Alessandri - */ -class ProcessorChain implements \ArrayAccess, ProcessorInterface -{ - private $processors = array(); - - /** - * @param array $processors List of instances of ProcessorInterface. - */ - public function __construct($processors = array()) - { - foreach ($processors as $processor) { - $this->add($processor); - } - } - - /** - * {@inheritdoc} - */ - public function add(ProcessorInterface $processor) - { - $this->processors[] = $processor; - } - - /** - * {@inheritdoc} - */ - public function remove(ProcessorInterface $processor) - { - if (false !== $index = array_search($processor, $this->processors, true)) { - unset($this[$index]); - } - } - - /** - * {@inheritdoc} - */ - public function process(CommandInterface $command) - { - for ($i = 0; $i < $count = count($this->processors); ++$i) { - $this->processors[$i]->process($command); - } - } - - /** - * {@inheritdoc} - */ - public function getProcessors() - { - return $this->processors; - } - - /** - * Returns an iterator over the list of command processor in the chain. - * - * @return \ArrayIterator - */ - public function getIterator() - { - return new \ArrayIterator($this->processors); - } - - /** - * Returns the number of command processors in the chain. - * - * @return int - */ - public function count() - { - return count($this->processors); - } - - /** - * {@inheritdoc} - */ - public function offsetExists($index) - { - return isset($this->processors[$index]); - } - - /** - * {@inheritdoc} - */ - public function offsetGet($index) - { - return $this->processors[$index]; - } - - /** - * {@inheritdoc} - */ - public function offsetSet($index, $processor) - { - if (!$processor instanceof ProcessorInterface) { - throw new \InvalidArgumentException( - 'A processor chain accepts only instances of '. - "'Predis\Command\Processor\ProcessorInterface'." - ); - } - - $this->processors[$index] = $processor; - } - - /** - * {@inheritdoc} - */ - public function offsetUnset($index) - { - unset($this->processors[$index]); - $this->processors = array_values($this->processors); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorInterface.php deleted file mode 100644 index 2f9105802b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/Processor/ProcessorInterface.php +++ /dev/null @@ -1,29 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command\Processor; - -use Predis\Command\CommandInterface; - -/** - * A command processor processes Redis commands before they are sent to Redis. - * - * @author Daniele Alessandri - */ -interface ProcessorInterface -{ - /** - * Processes the given Redis command. - * - * @param CommandInterface $command Command instance. - */ - public function process(CommandInterface $command); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPublish.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPublish.php deleted file mode 100644 index 55508f8d95..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPublish.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/publish - * - * @author Daniele Alessandri - */ -class PubSubPublish extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PUBLISH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPubsub.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPubsub.php deleted file mode 100644 index 8cf812973c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubPubsub.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/pubsub - * - * @author Daniele Alessandri - */ -class PubSubPubsub extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PUBSUB'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - switch (strtolower($this->getArgument(0))) { - case 'numsub': - return self::processNumsub($data); - - default: - return $data; - } - } - - /** - * Returns the processed response to PUBSUB NUMSUB. - * - * @param array $channels List of channels - * - * @return array - */ - protected static function processNumsub(array $channels) - { - $processed = array(); - $count = count($channels); - - for ($i = 0; $i < $count; ++$i) { - $processed[$channels[$i]] = $channels[++$i]; - } - - return $processed; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribe.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribe.php deleted file mode 100644 index e477b313b0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribe.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/subscribe - * - * @author Daniele Alessandri - */ -class PubSubSubscribe extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SUBSCRIBE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribeByPattern.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribeByPattern.php deleted file mode 100644 index 0118280665..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubSubscribeByPattern.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/psubscribe - * - * @author Daniele Alessandri - */ -class PubSubSubscribeByPattern extends PubSubSubscribe -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PSUBSCRIBE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribe.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribe.php deleted file mode 100644 index d57c3ac6d2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribe.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/unsubscribe - * - * @author Daniele Alessandri - */ -class PubSubUnsubscribe extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'UNSUBSCRIBE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribeByPattern.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribeByPattern.php deleted file mode 100644 index 4d76508b2a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/PubSubUnsubscribeByPattern.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/punsubscribe - * - * @author Daniele Alessandri - */ -class PubSubUnsubscribeByPattern extends PubSubUnsubscribe -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PUNSUBSCRIBE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/RawCommand.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/RawCommand.php deleted file mode 100644 index 2dd48ca173..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/RawCommand.php +++ /dev/null @@ -1,131 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * Class for generic "anonymous" Redis commands. - * - * This command class does not filter input arguments or parse responses, but - * can be used to leverage the standard Predis API to execute any command simply - * by providing the needed arguments following the command signature as defined - * by Redis in its documentation. - * - * @author Daniele Alessandri - */ -class RawCommand implements CommandInterface -{ - private $slot; - private $commandID; - private $arguments; - - /** - * @param array $arguments Command ID and its arguments. - * - * @throws \InvalidArgumentException - */ - public function __construct(array $arguments) - { - if (!$arguments) { - throw new \InvalidArgumentException( - 'The arguments array must contain at least the command ID.' - ); - } - - $this->commandID = strtoupper(array_shift($arguments)); - $this->arguments = $arguments; - } - - /** - * Creates a new raw command using a variadic method. - * - * @param string $commandID Redis command ID. - * @param string ... Arguments list for the command. - * - * @return CommandInterface - */ - public static function create($commandID /* [ $arg, ... */) - { - $arguments = func_get_args(); - $command = new self($arguments); - - return $command; - } - - /** - * {@inheritdoc} - */ - public function getId() - { - return $this->commandID; - } - - /** - * {@inheritdoc} - */ - public function setArguments(array $arguments) - { - $this->arguments = $arguments; - unset($this->slot); - } - - /** - * {@inheritdoc} - */ - public function setRawArguments(array $arguments) - { - $this->setArguments($arguments); - } - - /** - * {@inheritdoc} - */ - public function getArguments() - { - return $this->arguments; - } - - /** - * {@inheritdoc} - */ - public function getArgument($index) - { - if (isset($this->arguments[$index])) { - return $this->arguments[$index]; - } - } - - /** - * {@inheritdoc} - */ - public function setSlot($slot) - { - $this->slot = $slot; - } - - /** - * {@inheritdoc} - */ - public function getSlot() - { - if (isset($this->slot)) { - return $this->slot; - } - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ScriptCommand.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ScriptCommand.php deleted file mode 100644 index a30bc1d283..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ScriptCommand.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * Base class used to implement an higher level abstraction for commands based - * on Lua scripting with EVAL and EVALSHA. - * - * @link http://redis.io/commands/eval - * - * @author Daniele Alessandri - */ -abstract class ScriptCommand extends ServerEvalSHA -{ - /** - * Gets the body of a Lua script. - * - * @return string - */ - abstract public function getScript(); - - /** - * Specifies the number of arguments that should be considered as keys. - * - * The default behaviour for the base class is to return 0 to indicate that - * all the elements of the arguments array should be considered as keys, but - * subclasses can enforce a static number of keys. - * - * @return int - */ - protected function getKeysCount() - { - return 0; - } - - /** - * Returns the elements from the arguments that are identified as keys. - * - * @return array - */ - public function getKeys() - { - return array_slice($this->getArguments(), 2, $this->getKeysCount()); - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (($numkeys = $this->getKeysCount()) && $numkeys < 0) { - $numkeys = count($arguments) + $numkeys; - } - - return array_merge(array(sha1($this->getScript()), (int) $numkeys), $arguments); - } - - /** - * @return array - */ - public function getEvalArguments() - { - $arguments = $this->getArguments(); - $arguments[0] = $this->getScript(); - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundRewriteAOF.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundRewriteAOF.php deleted file mode 100644 index c66a294e53..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundRewriteAOF.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/bgrewriteaof - * - * @author Daniele Alessandri - */ -class ServerBackgroundRewriteAOF extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BGREWRITEAOF'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return $data == 'Background append only file rewriting started'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundSave.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundSave.php deleted file mode 100644 index 4bf67ef30c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerBackgroundSave.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/bgsave - * - * @author Daniele Alessandri - */ -class ServerBackgroundSave extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BGSAVE'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return $data === 'Background saving started' ? true : $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerClient.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerClient.php deleted file mode 100644 index d00ebbfff9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerClient.php +++ /dev/null @@ -1,74 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/client-list - * @link http://redis.io/commands/client-kill - * @link http://redis.io/commands/client-getname - * @link http://redis.io/commands/client-setname - * - * @author Daniele Alessandri - */ -class ServerClient extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'CLIENT'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - $args = array_change_key_case($this->getArguments(), CASE_UPPER); - - switch (strtoupper($args[0])) { - case 'LIST': - return $this->parseClientList($data); - case 'KILL': - case 'GETNAME': - case 'SETNAME': - default: - return $data; - } - } - - /** - * Parses the response to CLIENT LIST and returns a structured list. - * - * @param string $data Response buffer. - * - * @return array - */ - protected function parseClientList($data) - { - $clients = array(); - - foreach (explode("\n", $data, -1) as $clientData) { - $client = array(); - - foreach (explode(' ', $clientData) as $kv) { - @list($k, $v) = explode('=', $kv); - $client[$k] = $v; - } - - $clients[] = $client; - } - - return $clients; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerCommand.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerCommand.php deleted file mode 100644 index e9b3393c7a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerCommand.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/command - * - * @author Daniele Alessandri - */ -class ServerCommand extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'COMMAND'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerConfig.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerConfig.php deleted file mode 100644 index 81e497aead..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerConfig.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/config-set - * @link http://redis.io/commands/config-get - * @link http://redis.io/commands/config-resetstat - * @link http://redis.io/commands/config-rewrite - * - * @author Daniele Alessandri - */ -class ServerConfig extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'CONFIG'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if (is_array($data)) { - $result = array(); - - for ($i = 0; $i < count($data); ++$i) { - $result[$data[$i]] = $data[++$i]; - } - - return $result; - } - - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerDatabaseSize.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerDatabaseSize.php deleted file mode 100644 index 6bc89724d2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerDatabaseSize.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/dbsize - * - * @author Daniele Alessandri - */ -class ServerDatabaseSize extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DBSIZE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEval.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEval.php deleted file mode 100644 index f5eefd811e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEval.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/eval - * - * @author Daniele Alessandri - */ -class ServerEval extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EVAL'; - } - - /** - * Calculates the SHA1 hash of the body of the script. - * - * @return string SHA1 hash. - */ - public function getScriptHash() - { - return sha1($this->getArgument(0)); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEvalSHA.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEvalSHA.php deleted file mode 100644 index 520a8e9851..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerEvalSHA.php +++ /dev/null @@ -1,38 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/evalsha - * - * @author Daniele Alessandri - */ -class ServerEvalSHA extends ServerEval -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EVALSHA'; - } - - /** - * Returns the SHA1 hash of the body of the script. - * - * @return string SHA1 hash. - */ - public function getScriptHash() - { - return $this->getArgument(0); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushAll.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushAll.php deleted file mode 100644 index c35b2ad6ab..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushAll.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/flushall - * - * @author Daniele Alessandri - */ -class ServerFlushAll extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'FLUSHALL'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushDatabase.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushDatabase.php deleted file mode 100644 index 3da6b320d6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerFlushDatabase.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/flushdb - * - * @author Daniele Alessandri - */ -class ServerFlushDatabase extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'FLUSHDB'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfo.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfo.php deleted file mode 100644 index 96d6adad98..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfo.php +++ /dev/null @@ -1,111 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/info - * - * @author Daniele Alessandri - */ -class ServerInfo extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'INFO'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - $info = array(); - $infoLines = preg_split('/\r?\n/', $data); - - foreach ($infoLines as $row) { - if (strpos($row, ':') === false) { - continue; - } - - list($k, $v) = $this->parseRow($row); - $info[$k] = $v; - } - - return $info; - } - - /** - * Parses a single row of the response and returns the key-value pair. - * - * @param string $row Single row of the response. - * - * @return array - */ - protected function parseRow($row) - { - list($k, $v) = explode(':', $row, 2); - - if (preg_match('/^db\d+$/', $k)) { - $v = $this->parseDatabaseStats($v); - } - - return array($k, $v); - } - - /** - * Extracts the statistics of each logical DB from the string buffer. - * - * @param string $str Response buffer. - * - * @return array - */ - protected function parseDatabaseStats($str) - { - $db = array(); - - foreach (explode(',', $str) as $dbvar) { - list($dbvk, $dbvv) = explode('=', $dbvar); - $db[trim($dbvk)] = $dbvv; - } - - return $db; - } - - /** - * Parses the response and extracts the allocation statistics. - * - * @param string $str Response buffer. - * - * @return array - */ - protected function parseAllocationStats($str) - { - $stats = array(); - - foreach (explode(',', $str) as $kv) { - @list($size, $objects, $extra) = explode('=', $kv); - - // hack to prevent incorrect values when parsing the >=256 key - if (isset($extra)) { - $size = ">=$objects"; - $objects = $extra; - } - - $stats[$size] = $objects; - } - - return $stats; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfoV26x.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfoV26x.php deleted file mode 100644 index 90c9b71633..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerInfoV26x.php +++ /dev/null @@ -1,56 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/info - * - * @author Daniele Alessandri - */ -class ServerInfoV26x extends ServerInfo -{ - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if ($data === '') { - return array(); - } - - $info = array(); - - $current = null; - $infoLines = preg_split('/\r?\n/', $data); - - if (isset($infoLines[0]) && $infoLines[0][0] !== '#') { - return parent::parseResponse($data); - } - - foreach ($infoLines as $row) { - if ($row === '') { - continue; - } - - if (preg_match('/^# (\w+)$/', $row, $matches)) { - $info[$matches[1]] = array(); - $current = &$info[$matches[1]]; - continue; - } - - list($k, $v) = $this->parseRow($row); - $current[$k] = $v; - } - - return $info; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerLastSave.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerLastSave.php deleted file mode 100644 index feeb19a8af..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerLastSave.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/lastsave - * - * @author Daniele Alessandri - */ -class ServerLastSave extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'LASTSAVE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerMonitor.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerMonitor.php deleted file mode 100644 index 1c3d330952..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerMonitor.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/monitor - * - * @author Daniele Alessandri - */ -class ServerMonitor extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MONITOR'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerObject.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerObject.php deleted file mode 100644 index f921701c23..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerObject.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/object - * - * @author Daniele Alessandri - */ -class ServerObject extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'OBJECT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSave.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSave.php deleted file mode 100644 index addefe20fe..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSave.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/save - * - * @author Daniele Alessandri - */ -class ServerSave extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SAVE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerScript.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerScript.php deleted file mode 100644 index 7a01018d9f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerScript.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/script - * - * @author Daniele Alessandri - */ -class ServerScript extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SCRIPT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSentinel.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSentinel.php deleted file mode 100644 index c0962db3de..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSentinel.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/topics/sentinel - * - * @author Daniele Alessandri - */ -class ServerSentinel extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SENTINEL'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - switch (strtolower($this->getArgument(0))) { - case 'masters': - case 'slaves': - return self::processMastersOrSlaves($data); - - default: - return $data; - } - } - - /** - * Returns a processed response to SENTINEL MASTERS or SENTINEL SLAVES. - * - * @param array $servers List of Redis servers. - * - * @return array - */ - protected static function processMastersOrSlaves(array $servers) - { - foreach ($servers as $idx => $node) { - $processed = array(); - $count = count($node); - - for ($i = 0; $i < $count; ++$i) { - $processed[$node[$i]] = $node[++$i]; - } - - $servers[$idx] = $processed; - } - - return $servers; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerShutdown.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerShutdown.php deleted file mode 100644 index f5b745a213..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerShutdown.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/shutdown - * - * @author Daniele Alessandri - */ -class ServerShutdown extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SHUTDOWN'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlaveOf.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlaveOf.php deleted file mode 100644 index 4ff44556ab..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlaveOf.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/slaveof - * - * @author Daniele Alessandri - */ -class ServerSlaveOf extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SLAVEOF'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 0 || $arguments[0] === 'NO ONE') { - return array('NO', 'ONE'); - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlowlog.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlowlog.php deleted file mode 100644 index 137ff59e7f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerSlowlog.php +++ /dev/null @@ -1,51 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/slowlog - * - * @author Daniele Alessandri - */ -class ServerSlowlog extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SLOWLOG'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if (is_array($data)) { - $log = array(); - - foreach ($data as $index => $entry) { - $log[$index] = array( - 'id' => $entry[0], - 'timestamp' => $entry[1], - 'duration' => $entry[2], - 'command' => $entry[3], - ); - } - - return $log; - } - - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerTime.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerTime.php deleted file mode 100644 index 589f92c556..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ServerTime.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/time - * - * @author Daniele Alessandri - */ -class ServerTime extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'TIME'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetAdd.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetAdd.php deleted file mode 100644 index c118818165..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetAdd.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sadd - * - * @author Daniele Alessandri - */ -class SetAdd extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SADD'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetCardinality.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetCardinality.php deleted file mode 100644 index a9f959b781..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetCardinality.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/scard - * - * @author Daniele Alessandri - */ -class SetCardinality extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SCARD'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifference.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifference.php deleted file mode 100644 index 35f23f98a8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifference.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sdiff - * - * @author Daniele Alessandri - */ -class SetDifference extends SetIntersection -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SDIFF'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifferenceStore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifferenceStore.php deleted file mode 100644 index 0cb78155fd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetDifferenceStore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sdiffstore - * - * @author Daniele Alessandri - */ -class SetDifferenceStore extends SetIntersectionStore -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SDIFFSTORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersection.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersection.php deleted file mode 100644 index d18258fd71..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersection.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sinter - * - * @author Daniele Alessandri - */ -class SetIntersection extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SINTER'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersectionStore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersectionStore.php deleted file mode 100644 index b748618aab..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIntersectionStore.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sinterstore - * - * @author Daniele Alessandri - */ -class SetIntersectionStore extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SINTERSTORE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 2 && is_array($arguments[1])) { - return array_merge(array($arguments[0]), $arguments[1]); - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIsMember.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIsMember.php deleted file mode 100644 index 1b484907e1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetIsMember.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sismember - * - * @author Daniele Alessandri - */ -class SetIsMember extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SISMEMBER'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMembers.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMembers.php deleted file mode 100644 index f4076ae8ba..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMembers.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/smembers - * - * @author Daniele Alessandri - */ -class SetMembers extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SMEMBERS'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMove.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMove.php deleted file mode 100644 index 72d514be7e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetMove.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/smove - * - * @author Daniele Alessandri - */ -class SetMove extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SMOVE'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetPop.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetPop.php deleted file mode 100644 index b78d3f33bc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetPop.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/spop - * - * @author Daniele Alessandri - */ -class SetPop extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SPOP'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRandomMember.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRandomMember.php deleted file mode 100644 index 2cb79a0494..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRandomMember.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/srandmember - * - * @author Daniele Alessandri - */ -class SetRandomMember extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SRANDMEMBER'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRemove.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRemove.php deleted file mode 100644 index b34710c621..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetRemove.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/srem - * - * @author Daniele Alessandri - */ -class SetRemove extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SREM'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetScan.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetScan.php deleted file mode 100644 index d42b28dfb2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetScan.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sscan - * - * @author Daniele Alessandri - */ -class SetScan extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SSCAN'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 3 && is_array($arguments[2])) { - $options = $this->prepareOptions(array_pop($arguments)); - $arguments = array_merge($arguments, $options); - } - - return $arguments; - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - protected function prepareOptions($options) - { - $options = array_change_key_case($options, CASE_UPPER); - $normalized = array(); - - if (!empty($options['MATCH'])) { - $normalized[] = 'MATCH'; - $normalized[] = $options['MATCH']; - } - - if (!empty($options['COUNT'])) { - $normalized[] = 'COUNT'; - $normalized[] = $options['COUNT']; - } - - return $normalized; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnion.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnion.php deleted file mode 100644 index 7da842b459..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnion.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sunion - * - * @author Daniele Alessandri - */ -class SetUnion extends SetIntersection -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SUNION'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnionStore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnionStore.php deleted file mode 100644 index eac821ad79..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/SetUnionStore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/sunionstore - * - * @author Daniele Alessandri - */ -class SetUnionStore extends SetIntersectionStore -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SUNIONSTORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringAppend.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringAppend.php deleted file mode 100644 index dac8b84793..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringAppend.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/append - * - * @author Daniele Alessandri - */ -class StringAppend extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'APPEND'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitCount.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitCount.php deleted file mode 100644 index 193cce9165..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitCount.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/bitcount - * - * @author Daniele Alessandri - */ -class StringBitCount extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BITCOUNT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitOp.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitOp.php deleted file mode 100644 index e04ee79c2e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitOp.php +++ /dev/null @@ -1,42 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/bitop - * - * @author Daniele Alessandri - */ -class StringBitOp extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BITOP'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 3 && is_array($arguments[2])) { - list($operation, $destination) = $arguments; - $arguments = $arguments[2]; - array_unshift($arguments, $operation, $destination); - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitPos.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitPos.php deleted file mode 100644 index 42957665d3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringBitPos.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/bitpos - * - * @author Daniele Alessandri - */ -class StringBitPos extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'BITPOS'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrement.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrement.php deleted file mode 100644 index aa5808cd06..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrement.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/decr - * - * @author Daniele Alessandri - */ -class StringDecrement extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DECR'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrementBy.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrementBy.php deleted file mode 100644 index cbf3e1124c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringDecrementBy.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/decrby - * - * @author Daniele Alessandri - */ -class StringDecrementBy extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DECRBY'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGet.php deleted file mode 100644 index 138e915c2f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGet.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/get - * - * @author Daniele Alessandri - */ -class StringGet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'GET'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetBit.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetBit.php deleted file mode 100644 index 3c5b4f9b75..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetBit.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/getbit - * - * @author Daniele Alessandri - */ -class StringGetBit extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'GETBIT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetMultiple.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetMultiple.php deleted file mode 100644 index e340f9cfc6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetMultiple.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/mget - * - * @author Daniele Alessandri - */ -class StringGetMultiple extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MGET'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeArguments($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetRange.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetRange.php deleted file mode 100644 index bb10565b56..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetRange.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/getrange - * - * @author Daniele Alessandri - */ -class StringGetRange extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'GETRANGE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetSet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetSet.php deleted file mode 100644 index b68870d4c4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringGetSet.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/getset - * - * @author Daniele Alessandri - */ -class StringGetSet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'GETSET'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrement.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrement.php deleted file mode 100644 index fa1846e2ea..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrement.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/incr - * - * @author Daniele Alessandri - */ -class StringIncrement extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'INCR'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementBy.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementBy.php deleted file mode 100644 index 9d8241a25e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementBy.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/incrby - * - * @author Daniele Alessandri - */ -class StringIncrementBy extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'INCRBY'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementByFloat.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementByFloat.php deleted file mode 100644 index 164a0869bd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringIncrementByFloat.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/incrbyfloat - * - * @author Daniele Alessandri - */ -class StringIncrementByFloat extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'INCRBYFLOAT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringPreciseSetExpire.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringPreciseSetExpire.php deleted file mode 100644 index 2faa954d0b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringPreciseSetExpire.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/psetex - * - * @author Daniele Alessandri - */ -class StringPreciseSetExpire extends StringSetExpire -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'PSETEX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSet.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSet.php deleted file mode 100644 index b1469945c5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSet.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/set - * - * @author Daniele Alessandri - */ -class StringSet extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SET'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetBit.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetBit.php deleted file mode 100644 index 7933b6be36..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetBit.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/setbit - * - * @author Daniele Alessandri - */ -class StringSetBit extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SETBIT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetExpire.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetExpire.php deleted file mode 100644 index f088170853..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetExpire.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/setex - * - * @author Daniele Alessandri - */ -class StringSetExpire extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SETEX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiple.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiple.php deleted file mode 100644 index a3c5324dc3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiple.php +++ /dev/null @@ -1,48 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/mset - * - * @author Daniele Alessandri - */ -class StringSetMultiple extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MSET'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 1 && is_array($arguments[0])) { - $flattenedKVs = array(); - $args = $arguments[0]; - - foreach ($args as $k => $v) { - $flattenedKVs[] = $k; - $flattenedKVs[] = $v; - } - - return $flattenedKVs; - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiplePreserve.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiplePreserve.php deleted file mode 100644 index f98f1f7c26..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetMultiplePreserve.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/msetnx - * - * @author Daniele Alessandri - */ -class StringSetMultiplePreserve extends StringSetMultiple -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MSETNX'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetPreserve.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetPreserve.php deleted file mode 100644 index 726c35c878..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetPreserve.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/setnx - * - * @author Daniele Alessandri - */ -class StringSetPreserve extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SETNX'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - return (bool) $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetRange.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetRange.php deleted file mode 100644 index 4d9389f48b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSetRange.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/setrange - * - * @author Daniele Alessandri - */ -class StringSetRange extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SETRANGE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringStrlen.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringStrlen.php deleted file mode 100644 index 10f492fd99..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringStrlen.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/strlen - * - * @author Daniele Alessandri - */ -class StringStrlen extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'STRLEN'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSubstr.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSubstr.php deleted file mode 100644 index 3aab7ade87..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/StringSubstr.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/substr - * - * @author Daniele Alessandri - */ -class StringSubstr extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'SUBSTR'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionDiscard.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionDiscard.php deleted file mode 100644 index 44aca2b11e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionDiscard.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/discard - * - * @author Daniele Alessandri - */ -class TransactionDiscard extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'DISCARD'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionExec.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionExec.php deleted file mode 100644 index dbd81aae96..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionExec.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/exec - * - * @author Daniele Alessandri - */ -class TransactionExec extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'EXEC'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionMulti.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionMulti.php deleted file mode 100644 index 673bf55da9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionMulti.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/multi - * - * @author Daniele Alessandri - */ -class TransactionMulti extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'MULTI'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionUnwatch.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionUnwatch.php deleted file mode 100644 index 792555449c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionUnwatch.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/unwatch - * - * @author Daniele Alessandri - */ -class TransactionUnwatch extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'UNWATCH'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionWatch.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionWatch.php deleted file mode 100644 index d3607801bd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/TransactionWatch.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/watch - * - * @author Daniele Alessandri - */ -class TransactionWatch extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'WATCH'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (isset($arguments[0]) && is_array($arguments[0])) { - return $arguments[0]; - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetAdd.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetAdd.php deleted file mode 100644 index 55e4729e53..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetAdd.php +++ /dev/null @@ -1,43 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zadd - * - * @author Daniele Alessandri - */ -class ZSetAdd extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZADD'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (is_array(end($arguments))) { - foreach (array_pop($arguments) as $member => $score) { - $arguments[] = $score; - $arguments[] = $member; - } - } - - return $arguments; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCardinality.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCardinality.php deleted file mode 100644 index 10332009a4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCardinality.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zcard - * - * @author Daniele Alessandri - */ -class ZSetCardinality extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZCARD'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCount.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCount.php deleted file mode 100644 index 918bd2b808..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetCount.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zcount - * - * @author Daniele Alessandri - */ -class ZSetCount extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZCOUNT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIncrementBy.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIncrementBy.php deleted file mode 100644 index 245a8e0f5c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIncrementBy.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zincrby - * - * @author Daniele Alessandri - */ -class ZSetIncrementBy extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZINCRBY'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIntersectionStore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIntersectionStore.php deleted file mode 100644 index 572a7a324c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetIntersectionStore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zinterstore - * - * @author Daniele Alessandri - */ -class ZSetIntersectionStore extends ZSetUnionStore -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZINTERSTORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetLexCount.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetLexCount.php deleted file mode 100644 index 447b8eb329..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetLexCount.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zlexcount - * - * @author Daniele Alessandri - */ -class ZSetLexCount extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZLEXCOUNT'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRange.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRange.php deleted file mode 100644 index ce72c7c077..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRange.php +++ /dev/null @@ -1,105 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrange - * - * @author Daniele Alessandri - */ -class ZSetRange extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZRANGE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 4) { - $lastType = gettype($arguments[3]); - - if ($lastType === 'string' && strtoupper($arguments[3]) === 'WITHSCORES') { - // Used for compatibility with older versions - $arguments[3] = array('WITHSCORES' => true); - $lastType = 'array'; - } - - if ($lastType === 'array') { - $options = $this->prepareOptions(array_pop($arguments)); - - return array_merge($arguments, $options); - } - } - - return $arguments; - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - protected function prepareOptions($options) - { - $opts = array_change_key_case($options, CASE_UPPER); - $finalizedOpts = array(); - - if (!empty($opts['WITHSCORES'])) { - $finalizedOpts[] = 'WITHSCORES'; - } - - return $finalizedOpts; - } - - /** - * Checks for the presence of the WITHSCORES modifier. - * - * @return bool - */ - protected function withScores() - { - $arguments = $this->getArguments(); - - if (count($arguments) < 4) { - return false; - } - - return strtoupper($arguments[3]) === 'WITHSCORES'; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if ($this->withScores()) { - $result = array(); - - for ($i = 0; $i < count($data); ++$i) { - $result[$data[$i]] = $data[++$i]; - } - - return $result; - } - - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByLex.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByLex.php deleted file mode 100644 index 9b2991a81f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByLex.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrangebylex - * - * @author Daniele Alessandri - */ -class ZSetRangeByLex extends ZSetRange -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZRANGEBYLEX'; - } - - /** - * {@inheritdoc} - */ - protected function prepareOptions($options) - { - $opts = array_change_key_case($options, CASE_UPPER); - $finalizedOpts = array(); - - if (isset($opts['LIMIT']) && is_array($opts['LIMIT'])) { - $limit = array_change_key_case($opts['LIMIT'], CASE_UPPER); - - $finalizedOpts[] = 'LIMIT'; - $finalizedOpts[] = isset($limit['OFFSET']) ? $limit['OFFSET'] : $limit[0]; - $finalizedOpts[] = isset($limit['COUNT']) ? $limit['COUNT'] : $limit[1]; - } - - return $finalizedOpts; - } - - /** - * {@inheritdoc} - */ - protected function withScores() - { - return false; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByScore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByScore.php deleted file mode 100644 index 961a5bc2ee..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRangeByScore.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrangebyscore - * - * @author Daniele Alessandri - */ -class ZSetRangeByScore extends ZSetRange -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZRANGEBYSCORE'; - } - - /** - * {@inheritdoc} - */ - protected function prepareOptions($options) - { - $opts = array_change_key_case($options, CASE_UPPER); - $finalizedOpts = array(); - - if (isset($opts['LIMIT']) && is_array($opts['LIMIT'])) { - $limit = array_change_key_case($opts['LIMIT'], CASE_UPPER); - - $finalizedOpts[] = 'LIMIT'; - $finalizedOpts[] = isset($limit['OFFSET']) ? $limit['OFFSET'] : $limit[0]; - $finalizedOpts[] = isset($limit['COUNT']) ? $limit['COUNT'] : $limit[1]; - } - - return array_merge($finalizedOpts, parent::prepareOptions($options)); - } - - /** - * {@inheritdoc} - */ - protected function withScores() - { - $arguments = $this->getArguments(); - - for ($i = 3; $i < count($arguments); ++$i) { - switch (strtoupper($arguments[$i])) { - case 'WITHSCORES': - return true; - - case 'LIMIT': - $i += 2; - break; - } - } - - return false; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRank.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRank.php deleted file mode 100644 index d0c9c536eb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRank.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrank - * - * @author Daniele Alessandri - */ -class ZSetRank extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZRANK'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemove.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemove.php deleted file mode 100644 index cd8ada05ce..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemove.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrem - * - * @author Daniele Alessandri - */ -class ZSetRemove extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREM'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - return self::normalizeVariadic($arguments); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByLex.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByLex.php deleted file mode 100644 index 9ea2d9e5bb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByLex.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zremrangebylex - * - * @author Daniele Alessandri - */ -class ZSetRemoveRangeByLex extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREMRANGEBYLEX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByRank.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByRank.php deleted file mode 100644 index 89cd5baffb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByRank.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zremrangebyrank - * - * @author Daniele Alessandri - */ -class ZSetRemoveRangeByRank extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREMRANGEBYRANK'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByScore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByScore.php deleted file mode 100644 index a7c30814b1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetRemoveRangeByScore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zremrangebyscore - * - * @author Daniele Alessandri - */ -class ZSetRemoveRangeByScore extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREMRANGEBYSCORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRange.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRange.php deleted file mode 100644 index 6a46a7a5af..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRange.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrevrange - * - * @author Daniele Alessandri - */ -class ZSetReverseRange extends ZSetRange -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREVRANGE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByLex.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByLex.php deleted file mode 100644 index cdd8ba6233..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByLex.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -class ZSetReverseRangeByLex extends ZSetRangeByLex -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREVRANGEBYLEX'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByScore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByScore.php deleted file mode 100644 index 1078eb72bf..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRangeByScore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrevrangebyscore - * - * @author Daniele Alessandri - */ -class ZSetReverseRangeByScore extends ZSetRangeByScore -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREVRANGEBYSCORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRank.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRank.php deleted file mode 100644 index 33fb81584e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetReverseRank.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zrevrank - * - * @author Daniele Alessandri - */ -class ZSetReverseRank extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZREVRANK'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScan.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScan.php deleted file mode 100644 index 1dc2352ed1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScan.php +++ /dev/null @@ -1,85 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zscan - * - * @author Daniele Alessandri - */ -class ZSetScan extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZSCAN'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - if (count($arguments) === 3 && is_array($arguments[2])) { - $options = $this->prepareOptions(array_pop($arguments)); - $arguments = array_merge($arguments, $options); - } - - return $arguments; - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - protected function prepareOptions($options) - { - $options = array_change_key_case($options, CASE_UPPER); - $normalized = array(); - - if (!empty($options['MATCH'])) { - $normalized[] = 'MATCH'; - $normalized[] = $options['MATCH']; - } - - if (!empty($options['COUNT'])) { - $normalized[] = 'COUNT'; - $normalized[] = $options['COUNT']; - } - - return $normalized; - } - - /** - * {@inheritdoc} - */ - public function parseResponse($data) - { - if (is_array($data)) { - $members = $data[1]; - $result = array(); - - for ($i = 0; $i < count($members); ++$i) { - $result[$members[$i]] = (float) $members[++$i]; - } - - $data[1] = $result; - } - - return $data; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScore.php deleted file mode 100644 index 2e7fce8edc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetScore.php +++ /dev/null @@ -1,28 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zscore - * - * @author Daniele Alessandri - */ -class ZSetScore extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZSCORE'; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetUnionStore.php b/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetUnionStore.php deleted file mode 100644 index befc5ce7c8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Command/ZSetUnionStore.php +++ /dev/null @@ -1,78 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Command; - -/** - * @link http://redis.io/commands/zunionstore - * - * @author Daniele Alessandri - */ -class ZSetUnionStore extends Command -{ - /** - * {@inheritdoc} - */ - public function getId() - { - return 'ZUNIONSTORE'; - } - - /** - * {@inheritdoc} - */ - protected function filterArguments(array $arguments) - { - $options = array(); - $argc = count($arguments); - - if ($argc > 2 && is_array($arguments[$argc - 1])) { - $options = $this->prepareOptions(array_pop($arguments)); - } - - if (is_array($arguments[1])) { - $arguments = array_merge( - array($arguments[0], count($arguments[1])), - $arguments[1] - ); - } - - return array_merge($arguments, $options); - } - - /** - * Returns a list of options and modifiers compatible with Redis. - * - * @param array $options List of options. - * - * @return array - */ - private function prepareOptions($options) - { - $opts = array_change_key_case($options, CASE_UPPER); - $finalizedOpts = array(); - - if (isset($opts['WEIGHTS']) && is_array($opts['WEIGHTS'])) { - $finalizedOpts[] = 'WEIGHTS'; - - foreach ($opts['WEIGHTS'] as $weight) { - $finalizedOpts[] = $weight; - } - } - - if (isset($opts['AGGREGATE'])) { - $finalizedOpts[] = 'AGGREGATE'; - $finalizedOpts[] = $opts['AGGREGATE']; - } - - return $finalizedOpts; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/CommunicationException.php b/rainloop/v/0.0.0/app/libraries/Predis/CommunicationException.php deleted file mode 100644 index 13fe357c31..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/CommunicationException.php +++ /dev/null @@ -1,80 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -use Predis\Connection\NodeConnectionInterface; - -/** - * Base exception class for network-related errors. - * - * @author Daniele Alessandri - */ -abstract class CommunicationException extends PredisException -{ - private $connection; - - /** - * @param NodeConnectionInterface $connection Connection that generated the exception. - * @param string $message Error message. - * @param int $code Error code. - * @param \Exception $innerException Inner exception for wrapping the original error. - */ - public function __construct( - NodeConnectionInterface $connection, - $message = null, - $code = null, - \Exception $innerException = null - ) { - parent::__construct($message, $code, $innerException); - $this->connection = $connection; - } - - /** - * Gets the connection that generated the exception. - * - * @return NodeConnectionInterface - */ - public function getConnection() - { - return $this->connection; - } - - /** - * Indicates if the receiver should reset the underlying connection. - * - * @return bool - */ - public function shouldResetConnection() - { - return true; - } - - /** - * Helper method to handle exceptions generated by a connection object. - * - * @param CommunicationException $exception Exception. - * - * @throws CommunicationException - */ - public static function handle(CommunicationException $exception) - { - if ($exception->shouldResetConnection()) { - $connection = $exception->getConnection(); - - if ($connection->isConnected()) { - $connection->disconnect(); - } - } - - throw $exception; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ClusterOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ClusterOption.php deleted file mode 100644 index 69e36de77a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ClusterOption.php +++ /dev/null @@ -1,76 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -use Predis\Connection\Aggregate\ClusterInterface; -use Predis\Connection\Aggregate\PredisCluster; -use Predis\Connection\Aggregate\RedisCluster; - -/** - * Configures an aggregate connection used for clustering - * multiple Redis nodes using various implementations with - * different algorithms or strategies. - * - * @author Daniele Alessandri - */ -class ClusterOption implements OptionInterface -{ - /** - * Creates a new cluster connection from on a known descriptive name. - * - * @param OptionsInterface $options Instance of the client options. - * @param string $id Descriptive identifier of the cluster type (`predis`, `redis-cluster`) - * - * @return ClusterInterface|null - */ - protected function createByDescription(OptionsInterface $options, $id) - { - switch ($id) { - case 'predis': - case 'predis-cluster': - return new PredisCluster(); - - case 'redis': - case 'redis-cluster': - return new RedisCluster($options->connections); - - default: - return; - } - } - - /** - * {@inheritdoc} - */ - public function filter(OptionsInterface $options, $value) - { - if (is_string($value)) { - $value = $this->createByDescription($options, $value); - } - - if (!$value instanceof ClusterInterface) { - throw new \InvalidArgumentException( - "An instance of type 'Predis\Connection\Aggregate\ClusterInterface' was expected." - ); - } - - return $value; - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - return new PredisCluster(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ConnectionFactoryOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ConnectionFactoryOption.php deleted file mode 100644 index ba38df96fc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ConnectionFactoryOption.php +++ /dev/null @@ -1,54 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -use Predis\Connection\Factory; -use Predis\Connection\FactoryInterface; - -/** - * Configures a connection factory used by the client to create new connection - * instances for single Redis nodes. - * - * @author Daniele Alessandri - */ -class ConnectionFactoryOption implements OptionInterface -{ - /** - * {@inheritdoc} - */ - public function filter(OptionsInterface $options, $value) - { - if ($value instanceof FactoryInterface) { - return $value; - } elseif (is_array($value)) { - $factory = $this->getDefault($options); - - foreach ($value as $scheme => $initializer) { - $factory->define($scheme, $initializer); - } - - return $factory; - } else { - throw new \InvalidArgumentException( - 'Invalid value provided for the connections option.' - ); - } - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - return new Factory(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ExceptionsOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ExceptionsOption.php deleted file mode 100644 index 337733e4b2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ExceptionsOption.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -/** - * Configures whether consumers (such as the client) should throw exceptions on - * Redis errors (-ERR responses) or just return instances of error responses. - * - * @author Daniele Alessandri - */ -class ExceptionsOption implements OptionInterface -{ - /** - * {@inheritdoc} - */ - public function filter(OptionsInterface $options, $value) - { - return filter_var($value, FILTER_VALIDATE_BOOLEAN); - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - return true; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionInterface.php deleted file mode 100644 index b31e0c98f2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionInterface.php +++ /dev/null @@ -1,40 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -/** - * Defines an handler used by Predis\Configuration\Options to filter, validate - * or return default values for a given option. - * - * @author Daniele Alessandri - */ -interface OptionInterface -{ - /** - * Filters and validates the passed value. - * - * @param OptionsInterface $options Options container. - * @param mixed $value Input value. - * - * @return mixed - */ - public function filter(OptionsInterface $options, $value); - - /** - * Returns the default value for the option. - * - * @param OptionsInterface $options Options container. - * - * @return mixed - */ - public function getDefault(OptionsInterface $options); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/Options.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/Options.php deleted file mode 100644 index 6f3b331b55..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/Options.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -/** - * Manages Predis options with filtering, conversion and lazy initialization of - * values using a mini-DI container approach. - * - * {@inheritdoc} - * - * @author Daniele Alessandri - */ -class Options implements OptionsInterface -{ - protected $input; - protected $options; - protected $handlers; - - /** - * @param array $options Array of options with their values - */ - public function __construct(array $options = array()) - { - $this->input = $options; - $this->options = array(); - $this->handlers = $this->getHandlers(); - } - - /** - * Ensures that the default options are initialized. - * - * @return array - */ - protected function getHandlers() - { - return array( - 'cluster' => 'Predis\Configuration\ClusterOption', - 'connections' => 'Predis\Configuration\ConnectionFactoryOption', - 'exceptions' => 'Predis\Configuration\ExceptionsOption', - 'prefix' => 'Predis\Configuration\PrefixOption', - 'profile' => 'Predis\Configuration\ProfileOption', - 'replication' => 'Predis\Configuration\ReplicationOption', - ); - } - - /** - * {@inheritdoc} - */ - public function getDefault($option) - { - if (isset($this->handlers[$option])) { - $handler = $this->handlers[$option]; - $handler = new $handler(); - - return $handler->getDefault($this); - } - } - - /** - * {@inheritdoc} - */ - public function defined($option) - { - return ( - array_key_exists($option, $this->options) || - array_key_exists($option, $this->input) - ); - } - - /** - * {@inheritdoc} - */ - public function __isset($option) - { - return ( - array_key_exists($option, $this->options) || - array_key_exists($option, $this->input) - ) && $this->__get($option) !== null; - } - - /** - * {@inheritdoc} - */ - public function __get($option) - { - if (isset($this->options[$option]) || array_key_exists($option, $this->options)) { - return $this->options[$option]; - } - - if (isset($this->input[$option]) || array_key_exists($option, $this->input)) { - $value = $this->input[$option]; - unset($this->input[$option]); - - if (is_object($value) && method_exists($value, '__invoke')) { - $value = $value($this, $option); - } - - if (isset($this->handlers[$option])) { - $handler = $this->handlers[$option]; - $handler = new $handler(); - $value = $handler->filter($this, $value); - } - - return $this->options[$option] = $value; - } - - if (isset($this->handlers[$option])) { - return $this->options[$option] = $this->getDefault($option); - } - - return; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionsInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionsInterface.php deleted file mode 100644 index f811647083..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/OptionsInterface.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -/** - * Interface defining a container for client options. - * - * @property-read mixed aggregate Custom connection aggregator. - * @property-read mixed cluster Aggregate connection for clustering. - * @property-read mixed connections Connection factory. - * @property-read mixed exceptions Toggles exceptions in client for -ERR responses. - * @property-read mixed prefix Key prefixing strategy using the given prefix. - * @property-read mixed profile Server profile. - * @property-read mixed replication Aggregate connection for replication. - * - * @author Daniele Alessandri - */ -interface OptionsInterface -{ - /** - * Returns the default value for the given option. - * - * @param string $option Name of the option. - * - * @return mixed|null - */ - public function getDefault($option); - - /** - * Checks if the given option has been set by the user upon initialization. - * - * @param string $option Name of the option. - * - * @return bool - */ - public function defined($option); - - /** - * Checks if the given option has been set and does not evaluate to NULL. - * - * @param string $option Name of the option. - * - * @return bool - */ - public function __isset($option); - - /** - * Returns the value of the given option. - * - * @param string $option Name of the option. - * - * @return mixed|null - */ - public function __get($option); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/PrefixOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/PrefixOption.php deleted file mode 100644 index 5827cdc37b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/PrefixOption.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -use Predis\Command\Processor\KeyPrefixProcessor; -use Predis\Command\Processor\ProcessorInterface; - -/** - * Configures a command processor that apply the specified prefix string to a - * series of Redis commands considered prefixable. - * - * @author Daniele Alessandri - */ -class PrefixOption implements OptionInterface -{ - /** - * {@inheritdoc} - */ - public function filter(OptionsInterface $options, $value) - { - if ($value instanceof ProcessorInterface) { - return $value; - } - - return new KeyPrefixProcessor($value); - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - // NOOP - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ProfileOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ProfileOption.php deleted file mode 100644 index 864936e0af..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ProfileOption.php +++ /dev/null @@ -1,69 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -use Predis\Profile\Factory; -use Predis\Profile\ProfileInterface; -use Predis\Profile\RedisProfile; - -/** - * Configures the server profile to be used by the client to create command - * instances depending on the specified version of the Redis server. - * - * @author Daniele Alessandri - */ -class ProfileOption implements OptionInterface -{ - /** - * Sets the commands processors that need to be applied to the profile. - * - * @param OptionsInterface $options Client options. - * @param ProfileInterface $profile Server profile. - */ - protected function setProcessors(OptionsInterface $options, ProfileInterface $profile) - { - if (isset($options->prefix) && $profile instanceof RedisProfile) { - // NOTE: directly using __get('prefix') is actually a workaround for - // HHVM 2.3.0. It's correct and respects the options interface, it's - // just ugly. We will remove this hack when HHVM will fix re-entrant - // calls to __get() once and for all. - - $profile->setProcessor($options->__get('prefix')); - } - } - - /** - * {@inheritdoc} - */ - public function filter(OptionsInterface $options, $value) - { - if (is_string($value)) { - $value = Factory::get($value); - $this->setProcessors($options, $value); - } elseif (!$value instanceof ProfileInterface) { - throw new \InvalidArgumentException('Invalid value for the profile option.'); - } - - return $value; - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - $profile = Factory::getDefault(); - $this->setProcessors($options, $profile); - - return $profile; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ReplicationOption.php b/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ReplicationOption.php deleted file mode 100644 index fd2c8108d6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Configuration/ReplicationOption.php +++ /dev/null @@ -1,61 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Configuration; - -use Predis\Connection\Aggregate\MasterSlaveReplication; -use Predis\Connection\Aggregate\ReplicationInterface; - -/** - * Configures an aggregate connection used for master/slave replication among - * multiple Redis nodes. - * - * @author Daniele Alessandri - */ -class ReplicationOption implements OptionInterface -{ - /** - * {@inheritdoc} - * - * @todo There's more code than needed due to a bug in filter_var() as - * discussed here https://bugs.php.net/bug.php?id=49510 and different - * behaviours when encountering NULL values on PHP 5.3. - */ - public function filter(OptionsInterface $options, $value) - { - if ($value instanceof ReplicationInterface) { - return $value; - } - - if (is_bool($value) || $value === null) { - return $value ? $this->getDefault($options) : null; - } - - if ( - !is_object($value) && - null !== $asbool = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE) - ) { - return $asbool ? $this->getDefault($options) : null; - } - - throw new \InvalidArgumentException( - "An instance of type 'Predis\Connection\Aggregate\ReplicationInterface' was expected." - ); - } - - /** - * {@inheritdoc} - */ - public function getDefault(OptionsInterface $options) - { - return new MasterSlaveReplication(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/AbstractConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/AbstractConnection.php deleted file mode 100644 index 029a337eb0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/AbstractConnection.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\CommunicationException; -use Predis\Protocol\ProtocolException; - -/** - * Base class with the common logic used by connection classes to communicate - * with Redis. - * - * @author Daniele Alessandri - */ -abstract class AbstractConnection implements NodeConnectionInterface -{ - private $resource; - private $cachedId; - - protected $parameters; - protected $initCommands = array(); - - /** - * @param ParametersInterface $parameters Initialization parameters for the connection. - */ - public function __construct(ParametersInterface $parameters) - { - $this->parameters = $this->assertParameters($parameters); - } - - /** - * Disconnects from the server and destroys the underlying resource when - * PHP's garbage collector kicks in. - */ - public function __destruct() - { - $this->disconnect(); - } - - /** - * Checks some of the parameters used to initialize the connection. - * - * @param ParametersInterface $parameters Initialization parameters for the connection. - * - * @throws \InvalidArgumentException - * - * @return ParametersInterface - */ - protected function assertParameters(ParametersInterface $parameters) - { - switch ($parameters->scheme) { - case 'tcp': - case 'redis': - case 'unix': - break; - - default: - throw new \InvalidArgumentException("Invalid scheme: '$parameters->scheme'."); - } - - return $parameters; - } - - /** - * Creates the underlying resource used to communicate with Redis. - * - * @return mixed - */ - abstract protected function createResource(); - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return isset($this->resource); - } - - /** - * {@inheritdoc} - */ - public function connect() - { - if (!$this->isConnected()) { - $this->resource = $this->createResource(); - - return true; - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - unset($this->resource); - } - - /** - * {@inheritdoc} - */ - public function addConnectCommand(CommandInterface $command) - { - $this->initCommands[] = $command; - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - $this->writeRequest($command); - - return $this->readResponse($command); - } - - /** - * {@inheritdoc} - */ - public function readResponse(CommandInterface $command) - { - return $this->read(); - } - - /** - * Helper method that returns an exception message augmented with useful - * details from the connection parameters. - * - * @param string $message Error message. - * - * @return string - */ - private function createExceptionMessage($message) - { - $parameters = $this->parameters; - - if ($parameters->scheme === 'unix') { - return "$message [$parameters->scheme:$parameters->path]"; - } - - if (filter_var($parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - return "$message [$parameters->scheme://[$parameters->host]:$parameters->port]"; - } - - return "$message [$parameters->scheme://$parameters->host:$parameters->port]"; - } - - /** - * Helper method to handle connection errors. - * - * @param string $message Error message. - * @param int $code Error code. - */ - protected function onConnectionError($message, $code = null) - { - CommunicationException::handle( - new ConnectionException($this, static::createExceptionMessage($message), $code) - ); - } - - /** - * Helper method to handle protocol errors. - * - * @param string $message Error message. - */ - protected function onProtocolError($message) - { - CommunicationException::handle( - new ProtocolException($this, static::createExceptionMessage($message)) - ); - } - - /** - * {@inheritdoc} - */ - public function getResource() - { - if (isset($this->resource)) { - return $this->resource; - } - - $this->connect(); - - return $this->resource; - } - - /** - * {@inheritdoc} - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * Gets an identifier for the connection. - * - * @return string - */ - protected function getIdentifier() - { - if ($this->parameters->scheme === 'unix') { - return $this->parameters->path; - } - - return "{$this->parameters->host}:{$this->parameters->port}"; - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - if (!isset($this->cachedId)) { - $this->cachedId = $this->getIdentifier(); - } - - return $this->cachedId; - } - - /** - * {@inheritdoc} - */ - public function __sleep() - { - return array('parameters', 'initCommands'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ClusterInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ClusterInterface.php deleted file mode 100644 index af0f5aab55..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ClusterInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection\Aggregate; - -use Predis\Connection\AggregateConnectionInterface; - -/** - * Defines a cluster of Redis servers formed by aggregating multiple connection - * instances to single Redis nodes. - * - * @author Daniele Alessandri - */ -interface ClusterInterface extends AggregateConnectionInterface -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/MasterSlaveReplication.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/MasterSlaveReplication.php deleted file mode 100644 index 3104a753c1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/MasterSlaveReplication.php +++ /dev/null @@ -1,264 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection\Aggregate; - -use Predis\Command\CommandInterface; -use Predis\Connection\NodeConnectionInterface; -use Predis\Replication\ReplicationStrategy; - -/** - * Aggregate connection handling replication of Redis nodes configured in a - * single master / multiple slaves setup. - * - * @author Daniele Alessandri - */ -class MasterSlaveReplication implements ReplicationInterface -{ - protected $strategy; - protected $master; - protected $slaves; - protected $current; - - /** - * {@inheritdoc} - */ - public function __construct(ReplicationStrategy $strategy = null) - { - $this->slaves = array(); - $this->strategy = $strategy ?: new ReplicationStrategy(); - } - - /** - * Checks if one master and at least one slave have been defined. - */ - protected function check() - { - if (!isset($this->master) || !$this->slaves) { - throw new \RuntimeException('Replication needs one master and at least one slave.'); - } - } - - /** - * Resets the connection state. - */ - protected function reset() - { - $this->current = null; - } - - /** - * {@inheritdoc} - */ - public function add(NodeConnectionInterface $connection) - { - $alias = $connection->getParameters()->alias; - - if ($alias === 'master') { - $this->master = $connection; - } else { - $this->slaves[$alias ?: count($this->slaves)] = $connection; - } - - $this->reset(); - } - - /** - * {@inheritdoc} - */ - public function remove(NodeConnectionInterface $connection) - { - if ($connection->getParameters()->alias === 'master') { - $this->master = null; - $this->reset(); - - return true; - } else { - if (($id = array_search($connection, $this->slaves, true)) !== false) { - unset($this->slaves[$id]); - $this->reset(); - - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getConnection(CommandInterface $command) - { - if ($this->current === null) { - $this->check(); - $this->current = $this->strategy->isReadOperation($command) - ? $this->pickSlave() - : $this->master; - - return $this->current; - } - - if ($this->current === $this->master) { - return $this->current; - } - - if (!$this->strategy->isReadOperation($command)) { - $this->current = $this->master; - } - - return $this->current; - } - - /** - * {@inheritdoc} - */ - public function getConnectionById($connectionId) - { - if ($connectionId === 'master') { - return $this->master; - } - - if (isset($this->slaves[$connectionId])) { - return $this->slaves[$connectionId]; - } - - return; - } - - /** - * {@inheritdoc} - */ - public function switchTo($connection) - { - $this->check(); - - if (!$connection instanceof NodeConnectionInterface) { - $connection = $this->getConnectionById($connection); - } - if ($connection !== $this->master && !in_array($connection, $this->slaves, true)) { - throw new \InvalidArgumentException('Invalid connection or connection not found.'); - } - - $this->current = $connection; - } - - /** - * {@inheritdoc} - */ - public function getCurrent() - { - return $this->current; - } - - /** - * {@inheritdoc} - */ - public function getMaster() - { - return $this->master; - } - - /** - * {@inheritdoc} - */ - public function getSlaves() - { - return array_values($this->slaves); - } - - /** - * Returns the underlying replication strategy. - * - * @return ReplicationStrategy - */ - public function getReplicationStrategy() - { - return $this->strategy; - } - - /** - * Returns a random slave. - * - * @return NodeConnectionInterface - */ - protected function pickSlave() - { - return $this->slaves[array_rand($this->slaves)]; - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return $this->current ? $this->current->isConnected() : false; - } - - /** - * {@inheritdoc} - */ - public function connect() - { - if ($this->current === null) { - $this->check(); - $this->current = $this->pickSlave(); - } - - $this->current->connect(); - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - if ($this->master) { - $this->master->disconnect(); - } - - foreach ($this->slaves as $connection) { - $connection->disconnect(); - } - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $this->getConnection($command)->writeRequest($command); - } - - /** - * {@inheritdoc} - */ - public function readResponse(CommandInterface $command) - { - return $this->getConnection($command)->readResponse($command); - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - return $this->getConnection($command)->executeCommand($command); - } - - /** - * {@inheritdoc} - */ - public function __sleep() - { - return array('master', 'slaves', 'strategy'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/PredisCluster.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/PredisCluster.php deleted file mode 100644 index 33f98bf2ef..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/PredisCluster.php +++ /dev/null @@ -1,235 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection\Aggregate; - -use Predis\Cluster\PredisStrategy; -use Predis\Cluster\StrategyInterface; -use Predis\Command\CommandInterface; -use Predis\Connection\NodeConnectionInterface; -use Predis\NotSupportedException; - -/** - * Abstraction for a cluster of aggregate connections to various Redis servers - * implementing client-side sharding based on pluggable distribution strategies. - * - * @author Daniele Alessandri - * - * @todo Add the ability to remove connections from pool. - */ -class PredisCluster implements ClusterInterface, \IteratorAggregate, \Countable -{ - private $pool; - private $strategy; - private $distributor; - - /** - * @param StrategyInterface $strategy Optional cluster strategy. - */ - public function __construct(StrategyInterface $strategy = null) - { - $this->pool = array(); - $this->strategy = $strategy ?: new PredisStrategy(); - $this->distributor = $this->strategy->getDistributor(); - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - foreach ($this->pool as $connection) { - if ($connection->isConnected()) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function connect() - { - foreach ($this->pool as $connection) { - $connection->connect(); - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - foreach ($this->pool as $connection) { - $connection->disconnect(); - } - } - - /** - * {@inheritdoc} - */ - public function add(NodeConnectionInterface $connection) - { - $parameters = $connection->getParameters(); - - if (isset($parameters->alias)) { - $this->pool[$parameters->alias] = $connection; - } else { - $this->pool[] = $connection; - } - - $weight = isset($parameters->weight) ? $parameters->weight : null; - $this->distributor->add($connection, $weight); - } - - /** - * {@inheritdoc} - */ - public function remove(NodeConnectionInterface $connection) - { - if (($id = array_search($connection, $this->pool, true)) !== false) { - unset($this->pool[$id]); - $this->distributor->remove($connection); - - return true; - } - - return false; - } - - /** - * Removes a connection instance using its alias or index. - * - * @param string $connectionID Alias or index of a connection. - * - * @return bool Returns true if the connection was in the pool. - */ - public function removeById($connectionID) - { - if ($connection = $this->getConnectionById($connectionID)) { - return $this->remove($connection); - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function getConnection(CommandInterface $command) - { - $slot = $this->strategy->getSlot($command); - - if (!isset($slot)) { - throw new NotSupportedException( - "Cannot use '{$command->getId()}' over clusters of connections." - ); - } - - $node = $this->distributor->getBySlot($slot); - - return $node; - } - - /** - * {@inheritdoc} - */ - public function getConnectionById($connectionID) - { - return isset($this->pool[$connectionID]) ? $this->pool[$connectionID] : null; - } - - /** - * Retrieves a connection instance from the cluster using a key. - * - * @param string $key Key string. - * - * @return NodeConnectionInterface - */ - public function getConnectionByKey($key) - { - $hash = $this->strategy->getSlotByKey($key); - $node = $this->distributor->getBySlot($hash); - - return $node; - } - - /** - * Returns the underlying command hash strategy used to hash commands by - * using keys found in their arguments. - * - * @return StrategyInterface - */ - public function getClusterStrategy() - { - return $this->strategy; - } - - /** - * {@inheritdoc} - */ - public function count() - { - return count($this->pool); - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - return new \ArrayIterator($this->pool); - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $this->getConnection($command)->writeRequest($command); - } - - /** - * {@inheritdoc} - */ - public function readResponse(CommandInterface $command) - { - return $this->getConnection($command)->readResponse($command); - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - return $this->getConnection($command)->executeCommand($command); - } - - /** - * Executes the specified Redis command on all the nodes of a cluster. - * - * @param CommandInterface $command A Redis command. - * - * @return array - */ - public function executeCommandOnNodes(CommandInterface $command) - { - $responses = array(); - - foreach ($this->pool as $connection) { - $responses[] = $connection->executeCommand($command); - } - - return $responses; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/RedisCluster.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/RedisCluster.php deleted file mode 100644 index 337c28702d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/RedisCluster.php +++ /dev/null @@ -1,553 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection\Aggregate; - -use Predis\Cluster\RedisStrategy as RedisClusterStrategy; -use Predis\Cluster\StrategyInterface; -use Predis\Command\CommandInterface; -use Predis\Command\RawCommand; -use Predis\Connection\FactoryInterface; -use Predis\Connection\NodeConnectionInterface; -use Predis\NotSupportedException; -use Predis\Response\ErrorInterface as ErrorResponseInterface; - -/** - * Abstraction for a Redis-backed cluster of nodes (Redis >= 3.0.0). - * - * This connection backend offers smart support for redis-cluster by handling - * automatic slots map (re)generation upon -MOVED or -ASK responses returned by - * Redis when redirecting a client to a different node. - * - * The cluster can be pre-initialized using only a subset of the actual nodes in - * the cluster, Predis will do the rest by adjusting the slots map and creating - * the missing underlying connection instances on the fly. - * - * It is possible to pre-associate connections to a slots range with the "slots" - * parameter in the form "$first-$last". This can greatly reduce runtime node - * guessing and redirections. - * - * It is also possible to ask for the full and updated slots map directly to one - * of the nodes and optionally enable such a behaviour upon -MOVED redirections. - * Asking for the cluster configuration to Redis is actually done by issuing a - * CLUSTER SLOTS command to a random node in the pool. - * - * @author Daniele Alessandri - */ -class RedisCluster implements ClusterInterface, \IteratorAggregate, \Countable -{ - private $useClusterSlots = true; - private $defaultParameters = array(); - private $pool = array(); - private $slots = array(); - private $slotsMap; - private $strategy; - private $connections; - - /** - * @param FactoryInterface $connections Optional connection factory. - * @param StrategyInterface $strategy Optional cluster strategy. - */ - public function __construct( - FactoryInterface $connections, - StrategyInterface $strategy = null - ) { - $this->connections = $connections; - $this->strategy = $strategy ?: new RedisClusterStrategy(); - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - foreach ($this->pool as $connection) { - if ($connection->isConnected()) { - return true; - } - } - - return false; - } - - /** - * {@inheritdoc} - */ - public function connect() - { - if ($connection = $this->getRandomConnection()) { - $connection->connect(); - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - foreach ($this->pool as $connection) { - $connection->disconnect(); - } - } - - /** - * {@inheritdoc} - */ - public function add(NodeConnectionInterface $connection) - { - $this->pool[(string) $connection] = $connection; - unset($this->slotsMap); - } - - /** - * {@inheritdoc} - */ - public function remove(NodeConnectionInterface $connection) - { - if (false !== $id = array_search($connection, $this->pool, true)) { - unset( - $this->pool[$id], - $this->slotsMap - ); - - return true; - } - - return false; - } - - /** - * Removes a connection instance by using its identifier. - * - * @param string $connectionID Connection identifier. - * - * @return bool True if the connection was in the pool. - */ - public function removeById($connectionID) - { - if (isset($this->pool[$connectionID])) { - unset( - $this->pool[$connectionID], - $this->slotsMap - ); - - return true; - } - - return false; - } - - /** - * Generates the current slots map by guessing the cluster configuration out - * of the connection parameters of the connections in the pool. - * - * Generation is based on the same algorithm used by Redis to generate the - * cluster, so it is most effective when all of the connections supplied on - * initialization have the "slots" parameter properly set accordingly to the - * current cluster configuration. - */ - public function buildSlotsMap() - { - $this->slotsMap = array(); - - foreach ($this->pool as $connectionID => $connection) { - $parameters = $connection->getParameters(); - - if (!isset($parameters->slots)) { - continue; - } - - $slots = explode('-', $parameters->slots, 2); - $this->setSlots($slots[0], $slots[1], $connectionID); - } - } - - /** - * Generates an updated slots map fetching the cluster configuration using - * the CLUSTER SLOTS command against the specified node or a random one from - * the pool. - * - * @param NodeConnectionInterface $connection Optional connection instance. - * - * @return array - */ - public function askSlotsMap(NodeConnectionInterface $connection = null) - { - if (!$connection && !$connection = $this->getRandomConnection()) { - return array(); - } - - $command = RawCommand::create('CLUSTER', 'SLOTS'); - $response = $connection->executeCommand($command); - - foreach ($response as $slots) { - // We only support master servers for now, so we ignore subsequent - // elements in the $slots array identifying slaves. - list($start, $end, $master) = $slots; - - if ($master[0] === '') { - $this->setSlots($start, $end, (string) $connection); - } else { - $this->setSlots($start, $end, "{$master[0]}:{$master[1]}"); - } - } - - return $this->slotsMap; - } - - /** - * Returns the current slots map for the cluster. - * - * @return array - */ - public function getSlotsMap() - { - if (!isset($this->slotsMap)) { - $this->slotsMap = array(); - } - - return $this->slotsMap; - } - - /** - * Pre-associates a connection to a slots range to avoid runtime guessing. - * - * @param int $first Initial slot of the range. - * @param int $last Last slot of the range. - * @param NodeConnectionInterface|string $connection ID or connection instance. - * - * @throws \OutOfBoundsException - */ - public function setSlots($first, $last, $connection) - { - if ($first < 0x0000 || $first > 0x3FFF || - $last < 0x0000 || $last > 0x3FFF || - $last < $first - ) { - throw new \OutOfBoundsException( - "Invalid slot range for $connection: [$first-$last]." - ); - } - - $slots = array_fill($first, $last - $first + 1, (string) $connection); - $this->slotsMap = $this->getSlotsMap() + $slots; - } - - /** - * Guesses the correct node associated to a given slot using a precalculated - * slots map, falling back to the same logic used by Redis to initialize a - * cluster (best-effort). - * - * @param int $slot Slot index. - * - * @return string Connection ID. - */ - protected function guessNode($slot) - { - if (!isset($this->slotsMap)) { - $this->buildSlotsMap(); - } - - if (isset($this->slotsMap[$slot])) { - return $this->slotsMap[$slot]; - } - - $count = count($this->pool); - $index = min((int) ($slot / (int) (16384 / $count)), $count - 1); - $nodes = array_keys($this->pool); - - return $nodes[$index]; - } - - /** - * Creates a new connection instance from the given connection ID. - * - * @param string $connectionID Identifier for the connection. - * - * @return NodeConnectionInterface - */ - protected function createConnection($connectionID) - { - $separator = strrpos($connectionID, ':'); - - $parameters = array_merge($this->defaultParameters, array( - 'host' => substr($connectionID, 0, $separator), - 'port' => substr($connectionID, $separator + 1), - )); - - $connection = $this->connections->create($parameters); - - return $connection; - } - - /** - * {@inheritdoc} - */ - public function getConnection(CommandInterface $command) - { - $slot = $this->strategy->getSlot($command); - - if (!isset($slot)) { - throw new NotSupportedException( - "Cannot use '{$command->getId()}' with redis-cluster." - ); - } - - if (isset($this->slots[$slot])) { - return $this->slots[$slot]; - } else { - return $this->getConnectionBySlot($slot); - } - } - - /** - * Returns the connection currently associated to a given slot. - * - * @param int $slot Slot index. - * - * @throws \OutOfBoundsException - * - * @return NodeConnectionInterface - */ - public function getConnectionBySlot($slot) - { - if ($slot < 0x0000 || $slot > 0x3FFF) { - throw new \OutOfBoundsException("Invalid slot [$slot]."); - } - - if (isset($this->slots[$slot])) { - return $this->slots[$slot]; - } - - $connectionID = $this->guessNode($slot); - - if (!$connection = $this->getConnectionById($connectionID)) { - $connection = $this->createConnection($connectionID); - $this->pool[$connectionID] = $connection; - } - - return $this->slots[$slot] = $connection; - } - - /** - * {@inheritdoc} - */ - public function getConnectionById($connectionID) - { - if (isset($this->pool[$connectionID])) { - return $this->pool[$connectionID]; - } - } - - /** - * Returns a random connection from the pool. - * - * @return NodeConnectionInterface|null - */ - protected function getRandomConnection() - { - if ($this->pool) { - return $this->pool[array_rand($this->pool)]; - } - } - - /** - * Permanently associates the connection instance to a new slot. - * The connection is added to the connections pool if not yet included. - * - * @param NodeConnectionInterface $connection Connection instance. - * @param int $slot Target slot index. - */ - protected function move(NodeConnectionInterface $connection, $slot) - { - $this->pool[(string) $connection] = $connection; - $this->slots[(int) $slot] = $connection; - } - - /** - * Handles -ERR responses returned by Redis. - * - * @param CommandInterface $command Command that generated the -ERR response. - * @param ErrorResponseInterface $error Redis error response object. - * - * @return mixed - */ - protected function onErrorResponse(CommandInterface $command, ErrorResponseInterface $error) - { - $details = explode(' ', $error->getMessage(), 2); - - switch ($details[0]) { - case 'MOVED': - return $this->onMovedResponse($command, $details[1]); - - case 'ASK': - return $this->onAskResponse($command, $details[1]); - - default: - return $error; - } - } - - /** - * Handles -MOVED responses by executing again the command against the node - * indicated by the Redis response. - * - * @param CommandInterface $command Command that generated the -MOVED response. - * @param string $details Parameters of the -MOVED response. - * - * @return mixed - */ - protected function onMovedResponse(CommandInterface $command, $details) - { - list($slot, $connectionID) = explode(' ', $details, 2); - - if (!$connection = $this->getConnectionById($connectionID)) { - $connection = $this->createConnection($connectionID); - } - - if ($this->useClusterSlots) { - $this->askSlotsMap($connection); - } - - $this->move($connection, $slot); - $response = $this->executeCommand($command); - - return $response; - } - - /** - * Handles -ASK responses by executing again the command against the node - * indicated by the Redis response. - * - * @param CommandInterface $command Command that generated the -ASK response. - * @param string $details Parameters of the -ASK response. - * - * @return mixed - */ - protected function onAskResponse(CommandInterface $command, $details) - { - list($slot, $connectionID) = explode(' ', $details, 2); - - if (!$connection = $this->getConnectionById($connectionID)) { - $connection = $this->createConnection($connectionID); - } - - $connection->executeCommand(RawCommand::create('ASKING')); - $response = $connection->executeCommand($command); - - return $response; - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $this->getConnection($command)->writeRequest($command); - } - - /** - * {@inheritdoc} - */ - public function readResponse(CommandInterface $command) - { - return $this->getConnection($command)->readResponse($command); - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - $connection = $this->getConnection($command); - $response = $connection->executeCommand($command); - - if ($response instanceof ErrorResponseInterface) { - return $this->onErrorResponse($command, $response); - } - - return $response; - } - - /** - * {@inheritdoc} - */ - public function count() - { - return count($this->pool); - } - - /** - * {@inheritdoc} - */ - public function getIterator() - { - return new \ArrayIterator(array_values($this->pool)); - } - - /** - * Returns the underlying command hash strategy used to hash commands by - * using keys found in their arguments. - * - * @return StrategyInterface - */ - public function getClusterStrategy() - { - return $this->strategy; - } - - /** - * Returns the underlying connection factory used to create new connection - * instances to Redis nodes indicated by redis-cluster. - * - * @return FactoryInterface - */ - public function getConnectionFactory() - { - return $this->connections; - } - - /** - * Enables automatic fetching of the current slots map from one of the nodes - * using the CLUSTER SLOTS command. This option is disabled by default but - * asking the current slots map to Redis upon -MOVED responses may reduce - * overhead by eliminating the trial-and-error nature of the node guessing - * procedure, mostly when targeting many keys that would end up in a lot of - * redirections. - * - * The slots map can still be manually fetched using the askSlotsMap() - * method whether or not this option is enabled. - * - * @param bool $value Enable or disable the use of CLUSTER SLOTS. - */ - public function useClusterSlots($value) - { - $this->useClusterSlots = (bool) $value; - } - - /** - * Sets a default array of connection parameters to be applied when creating - * new connection instances on the fly when they are not part of the initial - * pool supplied upon cluster initialization. - * - * These parameters are not applied to connections added to the pool using - * the add() method. - * - * @param array $parameters Array of connection parameters. - */ - public function setDefaultParameters(array $parameters) - { - $this->defaultParameters = array_merge( - $this->defaultParameters, - $parameters ?: array() - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ReplicationInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ReplicationInterface.php deleted file mode 100644 index e09e8265c4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Aggregate/ReplicationInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection\Aggregate; - -use Predis\Connection\AggregateConnectionInterface; -use Predis\Connection\NodeConnectionInterface; - -/** - * Defines a group of Redis nodes in a master / slave replication setup. - * - * @author Daniele Alessandri - */ -interface ReplicationInterface extends AggregateConnectionInterface -{ - /** - * Switches the internal connection instance in use. - * - * @param string $connection Alias of a connection - */ - public function switchTo($connection); - - /** - * Returns the connection instance currently in use by the aggregate - * connection. - * - * @return NodeConnectionInterface - */ - public function getCurrent(); - - /** - * Returns the connection instance for the master Redis node. - * - * @return NodeConnectionInterface - */ - public function getMaster(); - - /** - * Returns a list of connection instances to slave nodes. - * - * @return NodeConnectionInterface - */ - public function getSlaves(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/AggregateConnectionInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/AggregateConnectionInterface.php deleted file mode 100644 index 7eeaede769..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/AggregateConnectionInterface.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; - -/** - * Defines a virtual connection composed of multiple connection instances to - * single Redis nodes. - * - * @author Daniele Alessandri - */ -interface AggregateConnectionInterface extends ConnectionInterface -{ - /** - * Adds a connection instance to the aggregate connection. - * - * @param NodeConnectionInterface $connection Connection instance. - */ - public function add(NodeConnectionInterface $connection); - - /** - * Removes the specified connection instance from the aggregate connection. - * - * @param NodeConnectionInterface $connection Connection instance. - * - * @return bool Returns true if the connection was in the pool. - */ - public function remove(NodeConnectionInterface $connection); - - /** - * Returns the connection instance in charge for the given command. - * - * @param CommandInterface $command Command instance. - * - * @return NodeConnectionInterface - */ - public function getConnection(CommandInterface $command); - - /** - * Returns a connection instance from the aggregate connection by its alias. - * - * @param string $connectionID Connection alias. - * - * @return NodeConnectionInterface|null - */ - public function getConnectionById($connectionID); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeConnectionInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeConnectionInterface.php deleted file mode 100644 index 286e082ccf..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeConnectionInterface.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -/** - * Defines a connection to communicate with a single Redis server that leverages - * an external protocol processor to handle pluggable protocol handlers. - * - * @author Daniele Alessandri - */ -interface CompositeConnectionInterface extends NodeConnectionInterface -{ - /** - * Returns the protocol processor used by the connection. - */ - public function getProtocol(); - - /** - * Writes the buffer containing over the connection. - * - * @param string $buffer String buffer to be sent over the connection. - */ - public function writeBuffer($buffer); - - /** - * Reads the given number of bytes from the connection. - * - * @param int $length Number of bytes to read from the connection. - * - * @return string - */ - public function readBuffer($length); - - /** - * Reads a line from the connection. - * - * @param string - */ - public function readLine(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeStreamConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeStreamConnection.php deleted file mode 100644 index 7a35340542..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/CompositeStreamConnection.php +++ /dev/null @@ -1,125 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\Protocol\ProtocolProcessorInterface; -use Predis\Protocol\Text\ProtocolProcessor as TextProtocolProcessor; - -/** - * Connection abstraction to Redis servers based on PHP's stream that uses an - * external protocol processor defining the protocol used for the communication. - * - * @author Daniele Alessandri - */ -class CompositeStreamConnection extends StreamConnection implements CompositeConnectionInterface -{ - protected $protocol; - - /** - * @param ParametersInterface $parameters Initialization parameters for the connection. - * @param ProtocolProcessorInterface $protocol Protocol processor. - */ - public function __construct( - ParametersInterface $parameters, - ProtocolProcessorInterface $protocol = null - ) { - $this->parameters = $this->assertParameters($parameters); - $this->protocol = $protocol ?: new TextProtocolProcessor(); - } - - /** - * {@inheritdoc} - */ - public function getProtocol() - { - return $this->protocol; - } - - /** - * {@inheritdoc} - */ - public function writeBuffer($buffer) - { - $this->write($buffer); - } - - /** - * {@inheritdoc} - */ - public function readBuffer($length) - { - if ($length <= 0) { - throw new \InvalidArgumentException('Length parameter must be greater than 0.'); - } - - $value = ''; - $socket = $this->getResource(); - - do { - $chunk = fread($socket, $length); - - if ($chunk === false || $chunk === '') { - $this->onConnectionError('Error while reading bytes from the server.'); - } - - $value .= $chunk; - } while (($length -= strlen($chunk)) > 0); - - return $value; - } - - /** - * {@inheritdoc} - */ - public function readLine() - { - $value = ''; - $socket = $this->getResource(); - - do { - $chunk = fgets($socket); - - if ($chunk === false || $chunk === '') { - $this->onConnectionError('Error while reading line from the server.'); - } - - $value .= $chunk; - } while (substr($value, -2) !== "\r\n"); - - return substr($value, 0, -2); - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $this->protocol->write($this, $command); - } - - /** - * {@inheritdoc} - */ - public function read() - { - return $this->protocol->read($this); - } - - /** - * {@inheritdoc} - */ - public function __sleep() - { - return array_merge(parent::__sleep(), array('protocol')); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionException.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionException.php deleted file mode 100644 index ef2e9d73ae..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionException.php +++ /dev/null @@ -1,23 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\CommunicationException; - -/** - * Exception class that identifies connection-related errors. - * - * @author Daniele Alessandri - */ -class ConnectionException extends CommunicationException -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionInterface.php deleted file mode 100644 index 11ace1b697..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ConnectionInterface.php +++ /dev/null @@ -1,66 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; - -/** - * Defines a connection object used to communicate with one or multiple - * Redis servers. - * - * @author Daniele Alessandri - */ -interface ConnectionInterface -{ - /** - * Opens the connection to Redis. - */ - public function connect(); - - /** - * Closes the connection to Redis. - */ - public function disconnect(); - - /** - * Checks if the connection to Redis is considered open. - * - * @return bool - */ - public function isConnected(); - - /** - * Writes the request for the given command over the connection. - * - * @param CommandInterface $command Command instance. - */ - public function writeRequest(CommandInterface $command); - - /** - * Reads the response to the given command from the connection. - * - * @param CommandInterface $command Command instance. - * - * @return mixed - */ - public function readResponse(CommandInterface $command); - - /** - * Writes a request for the given command over the connection and reads back - * the response returned by Redis. - * - * @param CommandInterface $command Command instance. - * - * @return mixed - */ - public function executeCommand(CommandInterface $command); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Factory.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Factory.php deleted file mode 100644 index c2e93f8801..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Factory.php +++ /dev/null @@ -1,151 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\RawCommand; - -/** - * Standard connection factory for creating connections to Redis nodes. - * - * @author Daniele Alessandri - */ -class Factory implements FactoryInterface -{ - protected $schemes = array( - 'tcp' => 'Predis\Connection\StreamConnection', - 'unix' => 'Predis\Connection\StreamConnection', - 'redis' => 'Predis\Connection\StreamConnection', - 'http' => 'Predis\Connection\WebdisConnection', - ); - - /** - * Checks if the provided argument represents a valid connection class - * implementing Predis\Connection\NodeConnectionInterface. Optionally, - * callable objects are used for lazy initialization of connection objects. - * - * @param mixed $initializer FQN of a connection class or a callable for lazy initialization. - * - * @throws \InvalidArgumentException - * - * @return mixed - */ - protected function checkInitializer($initializer) - { - if (is_callable($initializer)) { - return $initializer; - } - - $class = new \ReflectionClass($initializer); - - if (!$class->isSubclassOf('Predis\Connection\NodeConnectionInterface')) { - throw new \InvalidArgumentException( - 'A connection initializer must be a valid connection class or a callable object.' - ); - } - - return $initializer; - } - - /** - * {@inheritdoc} - */ - public function define($scheme, $initializer) - { - $this->schemes[$scheme] = $this->checkInitializer($initializer); - } - - /** - * {@inheritdoc} - */ - public function undefine($scheme) - { - unset($this->schemes[$scheme]); - } - - /** - * {@inheritdoc} - */ - public function create($parameters) - { - if (!$parameters instanceof ParametersInterface) { - $parameters = $this->createParameters($parameters); - } - - $scheme = $parameters->scheme; - - if (!isset($this->schemes[$scheme])) { - throw new \InvalidArgumentException("Unknown connection scheme: '$scheme'."); - } - - $initializer = $this->schemes[$scheme]; - - if (is_callable($initializer)) { - $connection = call_user_func($initializer, $parameters, $this); - } else { - $connection = new $initializer($parameters); - $this->prepareConnection($connection); - } - - if (!$connection instanceof NodeConnectionInterface) { - throw new \UnexpectedValueException( - 'Objects returned by connection initializers must implement '. - "'Predis\Connection\NodeConnectionInterface'." - ); - } - - return $connection; - } - - /** - * {@inheritdoc} - */ - public function aggregate(AggregateConnectionInterface $connection, array $parameters) - { - foreach ($parameters as $node) { - $connection->add($node instanceof NodeConnectionInterface ? $node : $this->create($node)); - } - } - - /** - * Creates a connection parameters instance from the supplied argument. - * - * @param mixed $parameters Original connection parameters. - * - * @return ParametersInterface - */ - protected function createParameters($parameters) - { - return Parameters::create($parameters); - } - - /** - * Prepares a connection instance after its initialization. - * - * @param NodeConnectionInterface $connection Connection instance. - */ - protected function prepareConnection(NodeConnectionInterface $connection) - { - $parameters = $connection->getParameters(); - - if (isset($parameters->password)) { - $connection->addConnectCommand( - new RawCommand(array('AUTH', $parameters->password)) - ); - } - - if (isset($parameters->database)) { - $connection->addConnectCommand( - new RawCommand(array('SELECT', $parameters->database)) - ); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/FactoryInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/FactoryInterface.php deleted file mode 100644 index 2bae0839e9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/FactoryInterface.php +++ /dev/null @@ -1,52 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -/** - * Interface for classes providing a factory of connections to Redis nodes. - * - * @author Daniele Alessandri - */ -interface FactoryInterface -{ - /** - * Defines or overrides the connection class identified by a scheme prefix. - * - * @param string $scheme Target connection scheme. - * @param mixed $initializer Fully-qualified name of a class or a callable for lazy initialization. - */ - public function define($scheme, $initializer); - - /** - * Undefines the connection identified by a scheme prefix. - * - * @param string $scheme Target connection scheme. - */ - public function undefine($scheme); - - /** - * Creates a new connection object. - * - * @param mixed $parameters Initialization parameters for the connection. - * - * @return NodeConnectionInterface - */ - public function create($parameters); - - /** - * Aggregates single connections into an aggregate connection instance. - * - * @param AggregateConnectionInterface $aggregate Aggregate connection instance. - * @param array $parameters List of parameters for each connection. - */ - public function aggregate(AggregateConnectionInterface $aggregate, array $parameters); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/NodeConnectionInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/NodeConnectionInterface.php deleted file mode 100644 index 665b862c1b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/NodeConnectionInterface.php +++ /dev/null @@ -1,58 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; - -/** - * Defines a connection used to communicate with a single Redis node. - * - * @author Daniele Alessandri - */ -interface NodeConnectionInterface extends ConnectionInterface -{ - /** - * Returns a string representation of the connection. - * - * @return string - */ - public function __toString(); - - /** - * Returns the underlying resource used to communicate with Redis. - * - * @return mixed - */ - public function getResource(); - - /** - * Returns the parameters used to initialize the connection. - * - * @return ParametersInterface - */ - public function getParameters(); - - /** - * Pushes the given command into a queue of commands executed when - * establishing the actual connection to Redis. - * - * @param CommandInterface $command Instance of a Redis command. - */ - public function addConnectCommand(CommandInterface $command); - - /** - * Reads a response from the server. - * - * @return mixed - */ - public function read(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Parameters.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/Parameters.php deleted file mode 100644 index b7d9861532..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/Parameters.php +++ /dev/null @@ -1,176 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -/** - * Container for connection parameters used to initialize connections to Redis. - * - * {@inheritdoc} - * - * @author Daniele Alessandri - */ -class Parameters implements ParametersInterface -{ - private $parameters; - - private static $defaults = array( - 'scheme' => 'tcp', - 'host' => '127.0.0.1', - 'port' => 6379, - 'timeout' => 5.0, - ); - - /** - * @param array $parameters Named array of connection parameters. - */ - public function __construct(array $parameters = array()) - { - $this->parameters = $this->filter($parameters) + $this->getDefaults(); - } - - /** - * Returns some default parameters with their values. - * - * @return array - */ - protected function getDefaults() - { - return self::$defaults; - } - - /** - * Creates a new instance by supplying the initial parameters either in the - * form of an URI string or a named array. - * - * @param array|string $parameters Set of connection parameters. - * - * @return Parameters - */ - public static function create($parameters) - { - if (is_string($parameters)) { - $parameters = static::parse($parameters); - } - - return new static($parameters ?: array()); - } - - /** - * Parses an URI string returning an array of connection parameters. - * - * When using the "redis" and "rediss" schemes the URI is parsed according - * to the rules defined by the provisional registration documents approved - * by IANA. If the URI has a password in its "user-information" part or a - * database number in the "path" part these values override the values of - * "password" and "database" if they are present in the "query" part. - * - * @link http://www.iana.org/assignments/uri-schemes/prov/redis - * @link http://www.iana.org/assignments/uri-schemes/prov/redis - * - * @param string $uri URI string. - * - * @throws \InvalidArgumentException - * - * @return array - */ - public static function parse($uri) - { - if (stripos($uri, 'unix') === 0) { - // Hack to support URIs for UNIX sockets with minimal effort. - $uri = str_ireplace('unix:///', 'unix://localhost/', $uri); - } - - if (!$parsed = parse_url($uri)) { - throw new \InvalidArgumentException("Invalid parameters URI: $uri"); - } - - if ( - isset($parsed['host']) - && false !== strpos($parsed['host'], '[') - && false !== strpos($parsed['host'], ']') - ) { - $parsed['host'] = substr($parsed['host'], 1, -1); - } - - if (isset($parsed['query'])) { - parse_str($parsed['query'], $queryarray); - unset($parsed['query']); - - $parsed = array_merge($parsed, $queryarray); - } - - if (stripos($uri, 'redis') === 0) { - if (isset($parsed['pass'])) { - $parsed['password'] = $parsed['pass']; - unset($parsed['pass']); - } - - if (isset($parsed['path']) && preg_match('/^\/(\d+)(\/.*)?/', $parsed['path'], $path)) { - $parsed['database'] = $path[1]; - - if (isset($path[2])) { - $parsed['path'] = $path[2]; - } else { - unset($parsed['path']); - } - } - } - - return $parsed; - } - - /** - * Validates and converts each value of the connection parameters array. - * - * @param array $parameters Connection parameters. - * - * @return array - */ - protected function filter(array $parameters) - { - return $parameters ?: array(); - } - - /** - * {@inheritdoc} - */ - public function __get($parameter) - { - if (isset($this->parameters[$parameter])) { - return $this->parameters[$parameter]; - } - } - - /** - * {@inheritdoc} - */ - public function __isset($parameter) - { - return isset($this->parameters[$parameter]); - } - - /** - * {@inheritdoc} - */ - public function toArray() - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function __sleep() - { - return array('parameters'); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ParametersInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/ParametersInterface.php deleted file mode 100644 index fd8a908e66..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/ParametersInterface.php +++ /dev/null @@ -1,62 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -/** - * Interface defining a container for connection parameters. - * - * The actual list of connection parameters depends on the features supported by - * each connection backend class (please refer to their specific documentation), - * but the most common parameters used through the library are: - * - * @property-read string scheme Connection scheme, such as 'tcp' or 'unix'. - * @property-read string host IP address or hostname of Redis. - * @property-read int port TCP port on which Redis is listening to. - * @property-read string path Path of a UNIX domain socket file. - * @property-read string alias Alias for the connection. - * @property-read float timeout Timeout for the connect() operation. - * @property-read float read_write_timeout Timeout for read() and write() operations. - * @property-read bool async_connect Performs the connect() operation asynchronously. - * @property-read bool tcp_nodelay Toggles the Nagle's algorithm for coalescing. - * @property-read bool persistent Leaves the connection open after a GC collection. - * @property-read string password Password to access Redis (see the AUTH command). - * @property-read string database Database index (see the SELECT command). - * - * @author Daniele Alessandri - */ -interface ParametersInterface -{ - /** - * Checks if the specified parameters is set. - * - * @param string $parameter Name of the parameter. - * - * @return bool - */ - public function __isset($parameter); - - /** - * Returns the value of the specified parameter. - * - * @param string $parameter Name of the parameter. - * - * @return mixed|null - */ - public function __get($parameter); - - /** - * Returns an array representation of the connection parameters. - * - * @return array - */ - public function toArray(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisSocketConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisSocketConnection.php deleted file mode 100644 index 6948f035f7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisSocketConnection.php +++ /dev/null @@ -1,393 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\NotSupportedException; -use Predis\Response\Error as ErrorResponse; -use Predis\Response\Status as StatusResponse; - -/** - * This class provides the implementation of a Predis connection that uses the - * PHP socket extension for network communication and wraps the phpiredis C - * extension (PHP bindings for hiredis) to parse the Redis protocol. - * - * This class is intended to provide an optional low-overhead alternative for - * processing responses from Redis compared to the standard pure-PHP classes. - * Differences in speed when dealing with short inline responses are practically - * nonexistent, the actual speed boost is for big multibulk responses when this - * protocol processor can parse and return responses very fast. - * - * For instructions on how to build and install the phpiredis extension, please - * consult the repository of the project. - * - * The connection parameters supported by this class are: - * - * - scheme: it can be either 'redis', 'tcp' or 'unix'. - * - host: hostname or IP address of the server. - * - port: TCP port of the server. - * - path: path of a UNIX domain socket when scheme is 'unix'. - * - timeout: timeout to perform the connection. - * - read_write_timeout: timeout of read / write operations. - * - * @link http://github.com/nrk/phpiredis - * - * @author Daniele Alessandri - */ -class PhpiredisSocketConnection extends AbstractConnection -{ - private $reader; - - /** - * {@inheritdoc} - */ - public function __construct(ParametersInterface $parameters) - { - $this->assertExtensions(); - - parent::__construct($parameters); - - $this->reader = $this->createReader(); - } - - /** - * Disconnects from the server and destroys the underlying resource and the - * protocol reader resource when PHP's garbage collector kicks in. - */ - public function __destruct() - { - phpiredis_reader_destroy($this->reader); - - parent::__destruct(); - } - - /** - * Checks if the socket and phpiredis extensions are loaded in PHP. - */ - protected function assertExtensions() - { - if (!extension_loaded('sockets')) { - throw new NotSupportedException( - 'The "sockets" extension is required by this connection backend.' - ); - } - - if (!extension_loaded('phpiredis')) { - throw new NotSupportedException( - 'The "phpiredis" extension is required by this connection backend.' - ); - } - } - - /** - * {@inheritdoc} - */ - protected function assertParameters(ParametersInterface $parameters) - { - parent::assertParameters($parameters); - - if (isset($parameters->persistent)) { - throw new NotSupportedException( - 'Persistent connections are not supported by this connection backend.' - ); - } - - return $parameters; - } - - /** - * Creates a new instance of the protocol reader resource. - * - * @return resource - */ - private function createReader() - { - $reader = phpiredis_reader_create(); - - phpiredis_reader_set_status_handler($reader, $this->getStatusHandler()); - phpiredis_reader_set_error_handler($reader, $this->getErrorHandler()); - - return $reader; - } - - /** - * Returns the underlying protocol reader resource. - * - * @return resource - */ - protected function getReader() - { - return $this->reader; - } - - /** - * Returns the handler used by the protocol reader for inline responses. - * - * @return \Closure - */ - private function getStatusHandler() - { - return function ($payload) { - return StatusResponse::get($payload); - }; - } - - /** - * Returns the handler used by the protocol reader for error responses. - * - * @return \Closure - */ - protected function getErrorHandler() - { - return function ($payload) { - return new ErrorResponse($payload); - }; - } - - /** - * Helper method used to throw exceptions on socket errors. - */ - private function emitSocketError() - { - $errno = socket_last_error(); - $errstr = socket_strerror($errno); - - $this->disconnect(); - - $this->onConnectionError(trim($errstr), $errno); - } - - /** - * Gets the address of an host from connection parameters. - * - * @param ParametersInterface $parameters Parameters used to initialize the connection. - * - * @return string - */ - protected static function getAddress(ParametersInterface $parameters) - { - if (filter_var($host = $parameters->host, FILTER_VALIDATE_IP)) { - return $host; - } - - if ($host === $address = gethostbyname($host)) { - return false; - } - - return $address; - } - - /** - * {@inheritdoc} - */ - protected function createResource() - { - $parameters = $this->parameters; - - if ($parameters->scheme === 'unix') { - $address = $parameters->path; - $domain = AF_UNIX; - $protocol = 0; - } else { - if (false === $address = self::getAddress($parameters)) { - $this->onConnectionError("Cannot resolve the address of '$parameters->host'."); - } - - $domain = filter_var($address, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) ? AF_INET6 : AF_INET; - $protocol = SOL_TCP; - } - - $socket = @socket_create($domain, SOCK_STREAM, $protocol); - - if (!is_resource($socket)) { - $this->emitSocketError(); - } - - $this->setSocketOptions($socket, $parameters); - $this->connectWithTimeout($socket, $address, $parameters); - - return $socket; - } - - /** - * Sets options on the socket resource from the connection parameters. - * - * @param resource $socket Socket resource. - * @param ParametersInterface $parameters Parameters used to initialize the connection. - */ - private function setSocketOptions($socket, ParametersInterface $parameters) - { - if ($parameters->scheme !== 'unix') { - if (!socket_set_option($socket, SOL_TCP, TCP_NODELAY, 1)) { - $this->emitSocketError(); - } - - if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) { - $this->emitSocketError(); - } - } - - if (isset($parameters->read_write_timeout)) { - $rwtimeout = (float) $parameters->read_write_timeout; - $timeoutSec = floor($rwtimeout); - $timeoutUsec = ($rwtimeout - $timeoutSec) * 1000000; - - $timeout = array( - 'sec' => $timeoutSec, - 'usec' => $timeoutUsec, - ); - - if (!socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, $timeout)) { - $this->emitSocketError(); - } - - if (!socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, $timeout)) { - $this->emitSocketError(); - } - } - } - - /** - * Opens the actual connection to the server with a timeout. - * - * @param resource $socket Socket resource. - * @param string $address IP address (DNS-resolved from hostname) - * @param ParametersInterface $parameters Parameters used to initialize the connection. - * - * @return string - */ - private function connectWithTimeout($socket, $address, ParametersInterface $parameters) - { - socket_set_nonblock($socket); - - if (@socket_connect($socket, $address, (int) $parameters->port) === false) { - $error = socket_last_error(); - - if ($error != SOCKET_EINPROGRESS && $error != SOCKET_EALREADY) { - $this->emitSocketError(); - } - } - - socket_set_block($socket); - - $null = null; - $selectable = array($socket); - - $timeout = (float) $parameters->timeout; - $timeoutSecs = floor($timeout); - $timeoutUSecs = ($timeout - $timeoutSecs) * 1000000; - - $selected = socket_select($selectable, $selectable, $null, $timeoutSecs, $timeoutUSecs); - - if ($selected === 2) { - $this->onConnectionError('Connection refused.', SOCKET_ECONNREFUSED); - } - - if ($selected === 0) { - $this->onConnectionError('Connection timed out.', SOCKET_ETIMEDOUT); - } - - if ($selected === false) { - $this->emitSocketError(); - } - } - - /** - * {@inheritdoc} - */ - public function connect() - { - if (parent::connect() && $this->initCommands) { - foreach ($this->initCommands as $command) { - $this->executeCommand($command); - } - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - if ($this->isConnected()) { - socket_close($this->getResource()); - parent::disconnect(); - } - } - - /** - * {@inheritdoc} - */ - protected function write($buffer) - { - $socket = $this->getResource(); - - while (($length = strlen($buffer)) > 0) { - $written = socket_write($socket, $buffer, $length); - - if ($length === $written) { - return; - } - - if ($written === false) { - $this->onConnectionError('Error while writing bytes to the server.'); - } - - $buffer = substr($buffer, $written); - } - } - - /** - * {@inheritdoc} - */ - public function read() - { - $socket = $this->getResource(); - $reader = $this->reader; - - while (PHPIREDIS_READER_STATE_INCOMPLETE === $state = phpiredis_reader_get_state($reader)) { - if (@socket_recv($socket, $buffer, 4096, 0) === false || $buffer === '' || $buffer === null) { - $this->emitSocketError(); - } - - phpiredis_reader_feed($reader, $buffer); - } - - if ($state === PHPIREDIS_READER_STATE_COMPLETE) { - return phpiredis_reader_get_reply($reader); - } else { - $this->onProtocolError(phpiredis_reader_get_error($reader)); - - return; - } - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $arguments = $command->getArguments(); - array_unshift($arguments, $command->getId()); - - $this->write(phpiredis_format_command($arguments)); - } - - /** - * {@inheritdoc} - */ - public function __wakeup() - { - $this->assertExtensions(); - $this->reader = $this->createReader(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisStreamConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisStreamConnection.php deleted file mode 100644 index beb235758c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/PhpiredisStreamConnection.php +++ /dev/null @@ -1,228 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\NotSupportedException; -use Predis\Response\Error as ErrorResponse; -use Predis\Response\Status as StatusResponse; - -/** - * This class provides the implementation of a Predis connection that uses PHP's - * streams for network communication and wraps the phpiredis C extension (PHP - * bindings for hiredis) to parse and serialize the Redis protocol. - * - * This class is intended to provide an optional low-overhead alternative for - * processing responses from Redis compared to the standard pure-PHP classes. - * Differences in speed when dealing with short inline responses are practically - * nonexistent, the actual speed boost is for big multibulk responses when this - * protocol processor can parse and return responses very fast. - * - * For instructions on how to build and install the phpiredis extension, please - * consult the repository of the project. - * - * The connection parameters supported by this class are: - * - * - scheme: it can be either 'redis', 'tcp' or 'unix'. - * - host: hostname or IP address of the server. - * - port: TCP port of the server. - * - path: path of a UNIX domain socket when scheme is 'unix'. - * - timeout: timeout to perform the connection. - * - read_write_timeout: timeout of read / write operations. - * - async_connect: performs the connection asynchronously. - * - tcp_nodelay: enables or disables Nagle's algorithm for coalescing. - * - persistent: the connection is left intact after a GC collection. - * - * @link https://github.com/nrk/phpiredis - * - * @author Daniele Alessandri - */ -class PhpiredisStreamConnection extends StreamConnection -{ - private $reader; - - /** - * {@inheritdoc} - */ - public function __construct(ParametersInterface $parameters) - { - $this->assertExtensions(); - - parent::__construct($parameters); - - $this->reader = $this->createReader(); - } - - /** - * {@inheritdoc} - */ - public function __destruct() - { - phpiredis_reader_destroy($this->reader); - - parent::__destruct(); - } - - /** - * Checks if the phpiredis extension is loaded in PHP. - */ - private function assertExtensions() - { - if (!extension_loaded('phpiredis')) { - throw new NotSupportedException( - 'The "phpiredis" extension is required by this connection backend.' - ); - } - } - - /** - * {@inheritdoc} - */ - protected function tcpStreamInitializer(ParametersInterface $parameters) - { - $uri = "tcp://[{$parameters->host}]:{$parameters->port}"; - $flags = STREAM_CLIENT_CONNECT; - $socket = null; - - if (isset($parameters->async_connect) && (bool) $parameters->async_connect) { - $flags |= STREAM_CLIENT_ASYNC_CONNECT; - } - - if (isset($parameters->persistent) && (bool) $parameters->persistent) { - $flags |= STREAM_CLIENT_PERSISTENT; - $uri .= strpos($path = $parameters->path, '/') === 0 ? $path : "/$path"; - } - - $resource = @stream_socket_client($uri, $errno, $errstr, (float) $parameters->timeout, $flags); - - if (!$resource) { - $this->onConnectionError(trim($errstr), $errno); - } - - if (isset($parameters->read_write_timeout) && function_exists('socket_import_stream')) { - $rwtimeout = (float) $parameters->read_write_timeout; - $rwtimeout = $rwtimeout > 0 ? $rwtimeout : -1; - - $timeout = array( - 'sec' => $timeoutSeconds = floor($rwtimeout), - 'usec' => ($rwtimeout - $timeoutSeconds) * 1000000, - ); - - $socket = $socket ?: socket_import_stream($resource); - @socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, $timeout); - @socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, $timeout); - } - - if (isset($parameters->tcp_nodelay) && function_exists('socket_import_stream')) { - $socket = $socket ?: socket_import_stream($resource); - socket_set_option($socket, SOL_TCP, TCP_NODELAY, (int) $parameters->tcp_nodelay); - } - - return $resource; - } - - /** - * Creates a new instance of the protocol reader resource. - * - * @return resource - */ - private function createReader() - { - $reader = phpiredis_reader_create(); - - phpiredis_reader_set_status_handler($reader, $this->getStatusHandler()); - phpiredis_reader_set_error_handler($reader, $this->getErrorHandler()); - - return $reader; - } - - /** - * Returns the underlying protocol reader resource. - * - * @return resource - */ - protected function getReader() - { - return $this->reader; - } - - /** - * Returns the handler used by the protocol reader for inline responses. - * - * @return \Closure - */ - protected function getStatusHandler() - { - return function ($payload) { - return StatusResponse::get($payload); - }; - } - - /** - * Returns the handler used by the protocol reader for error responses. - * - * @return \Closure - */ - protected function getErrorHandler() - { - return function ($errorMessage) { - return new ErrorResponse($errorMessage); - }; - } - - /** - * {@inheritdoc} - */ - public function read() - { - $socket = $this->getResource(); - $reader = $this->reader; - - while (PHPIREDIS_READER_STATE_INCOMPLETE === $state = phpiredis_reader_get_state($reader)) { - $buffer = stream_socket_recvfrom($socket, 4096); - - if ($buffer === false || $buffer === '') { - $this->onConnectionError('Error while reading bytes from the server.'); - } - - phpiredis_reader_feed($reader, $buffer); - } - - if ($state === PHPIREDIS_READER_STATE_COMPLETE) { - return phpiredis_reader_get_reply($reader); - } else { - $this->onProtocolError(phpiredis_reader_get_error($reader)); - - return; - } - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $arguments = $command->getArguments(); - array_unshift($arguments, $command->getId()); - - $this->write(phpiredis_format_command($arguments)); - } - - /** - * {@inheritdoc} - */ - public function __wakeup() - { - $this->assertExtensions(); - $this->reader = $this->createReader(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/StreamConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/StreamConnection.php deleted file mode 100644 index ed6540b878..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/StreamConnection.php +++ /dev/null @@ -1,292 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\Response\Error as ErrorResponse; -use Predis\Response\Status as StatusResponse; - -/** - * Standard connection to Redis servers implemented on top of PHP's streams. - * The connection parameters supported by this class are:. - * - * - scheme: it can be either 'redis', 'tcp' or 'unix'. - * - host: hostname or IP address of the server. - * - port: TCP port of the server. - * - path: path of a UNIX domain socket when scheme is 'unix'. - * - timeout: timeout to perform the connection. - * - read_write_timeout: timeout of read / write operations. - * - async_connect: performs the connection asynchronously. - * - tcp_nodelay: enables or disables Nagle's algorithm for coalescing. - * - persistent: the connection is left intact after a GC collection. - * - * @author Daniele Alessandri - */ -class StreamConnection extends AbstractConnection -{ - /** - * Disconnects from the server and destroys the underlying resource when the - * garbage collector kicks in only if the connection has not been marked as - * persistent. - */ - public function __destruct() - { - if (isset($this->parameters->persistent) && $this->parameters->persistent) { - return; - } - - $this->disconnect(); - } - - /** - * {@inheritdoc} - */ - protected function createResource() - { - switch ($this->parameters->scheme) { - case 'tcp': - case 'redis': - return $this->tcpStreamInitializer($this->parameters); - - case 'unix': - return $this->unixStreamInitializer($this->parameters); - - default: - throw new \InvalidArgumentException("Invalid scheme: '{$this->parameters->scheme}'."); - } - } - - /** - * Initializes a TCP stream resource. - * - * @param ParametersInterface $parameters Initialization parameters for the connection. - * - * @return resource - */ - protected function tcpStreamInitializer(ParametersInterface $parameters) - { - if (!filter_var($parameters->host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) { - $uri = "tcp://$parameters->host:$parameters->port"; - } else { - $uri = "tcp://[$parameters->host]:$parameters->port"; - } - - $flags = STREAM_CLIENT_CONNECT; - - if (isset($parameters->async_connect) && (bool) $parameters->async_connect) { - $flags |= STREAM_CLIENT_ASYNC_CONNECT; - } - - if (isset($parameters->persistent) && (bool) $parameters->persistent) { - $flags |= STREAM_CLIENT_PERSISTENT; - $uri .= strpos($path = $parameters->path, '/') === 0 ? $path : "/$path"; - } - - $resource = @stream_socket_client($uri, $errno, $errstr, (float) $parameters->timeout, $flags); - - if (!$resource) { - $this->onConnectionError(trim($errstr), $errno); - } - - if (isset($parameters->read_write_timeout)) { - $rwtimeout = (float) $parameters->read_write_timeout; - $rwtimeout = $rwtimeout > 0 ? $rwtimeout : -1; - $timeoutSeconds = floor($rwtimeout); - $timeoutUSeconds = ($rwtimeout - $timeoutSeconds) * 1000000; - stream_set_timeout($resource, $timeoutSeconds, $timeoutUSeconds); - } - - if (isset($parameters->tcp_nodelay) && function_exists('socket_import_stream')) { - $socket = socket_import_stream($resource); - socket_set_option($socket, SOL_TCP, TCP_NODELAY, (int) $parameters->tcp_nodelay); - } - - return $resource; - } - - /** - * Initializes a UNIX stream resource. - * - * @param ParametersInterface $parameters Initialization parameters for the connection. - * - * @return resource - */ - protected function unixStreamInitializer(ParametersInterface $parameters) - { - if (!isset($parameters->path)) { - throw new InvalidArgumentException('Missing UNIX domain socket path.'); - } - - $uri = "unix://{$parameters->path}"; - $flags = STREAM_CLIENT_CONNECT; - - if ((bool) $parameters->persistent) { - $flags |= STREAM_CLIENT_PERSISTENT; - } - - $resource = @stream_socket_client($uri, $errno, $errstr, (float) $parameters->timeout, $flags); - - if (!$resource) { - $this->onConnectionError(trim($errstr), $errno); - } - - if (isset($parameters->read_write_timeout)) { - $rwtimeout = (float) $parameters->read_write_timeout; - $rwtimeout = $rwtimeout > 0 ? $rwtimeout : -1; - $timeoutSeconds = floor($rwtimeout); - $timeoutUSeconds = ($rwtimeout - $timeoutSeconds) * 1000000; - stream_set_timeout($resource, $timeoutSeconds, $timeoutUSeconds); - } - - return $resource; - } - - /** - * {@inheritdoc} - */ - public function connect() - { - if (parent::connect() && $this->initCommands) { - foreach ($this->initCommands as $command) { - $this->executeCommand($command); - } - } - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - if ($this->isConnected()) { - fclose($this->getResource()); - parent::disconnect(); - } - } - - /** - * Performs a write operation over the stream of the buffer containing a - * command serialized with the Redis wire protocol. - * - * @param string $buffer Representation of a command in the Redis wire protocol. - */ - protected function write($buffer) - { - $socket = $this->getResource(); - - while (($length = strlen($buffer)) > 0) { - $written = @fwrite($socket, $buffer); - - if ($length === $written) { - return; - } - - if ($written === false || $written === 0) { - $this->onConnectionError('Error while writing bytes to the server.'); - } - - $buffer = substr($buffer, $written); - } - } - - /** - * {@inheritdoc} - */ - public function read() - { - $socket = $this->getResource(); - $chunk = fgets($socket); - - if ($chunk === false || $chunk === '') { - $this->onConnectionError('Error while reading line from the server.'); - } - - $prefix = $chunk[0]; - $payload = substr($chunk, 1, -2); - - switch ($prefix) { - case '+': - return StatusResponse::get($payload); - - case '$': - $size = (int) $payload; - - if ($size === -1) { - return; - } - - $bulkData = ''; - $bytesLeft = ($size += 2); - - do { - $chunk = fread($socket, min($bytesLeft, 4096)); - - if ($chunk === false || $chunk === '') { - $this->onConnectionError('Error while reading bytes from the server.'); - } - - $bulkData .= $chunk; - $bytesLeft = $size - strlen($bulkData); - } while ($bytesLeft > 0); - - return substr($bulkData, 0, -2); - - case '*': - $count = (int) $payload; - - if ($count === -1) { - return; - } - - $multibulk = array(); - - for ($i = 0; $i < $count; ++$i) { - $multibulk[$i] = $this->read(); - } - - return $multibulk; - - case ':': - return (int) $payload; - - case '-': - return new ErrorResponse($payload); - - default: - $this->onProtocolError("Unknown response prefix: '$prefix'."); - - return; - } - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $commandID = $command->getId(); - $arguments = $command->getArguments(); - - $cmdlen = strlen($commandID); - $reqlen = count($arguments) + 1; - - $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n"; - - for ($i = 0, $reqlen--; $i < $reqlen; ++$i) { - $argument = $arguments[$i]; - $arglen = strlen($argument); - $buffer .= "\${$arglen}\r\n{$argument}\r\n"; - } - - $this->write($buffer); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Connection/WebdisConnection.php b/rainloop/v/0.0.0/app/libraries/Predis/Connection/WebdisConnection.php deleted file mode 100644 index 9cff9d023b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Connection/WebdisConnection.php +++ /dev/null @@ -1,353 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Connection; - -use Predis\Command\CommandInterface; -use Predis\NotSupportedException; -use Predis\Protocol\ProtocolException; -use Predis\Response\Error as ErrorResponse; -use Predis\Response\Status as StatusResponse; - -/** - * This class implements a Predis connection that actually talks with Webdis - * instead of connecting directly to Redis. It relies on the cURL extension to - * communicate with the web server and the phpiredis extension to parse the - * protocol for responses returned in the http response bodies. - * - * Some features are not yet available or they simply cannot be implemented: - * - Pipelining commands. - * - Publish / Subscribe. - * - MULTI / EXEC transactions (not yet supported by Webdis). - * - * The connection parameters supported by this class are: - * - * - scheme: must be 'http'. - * - host: hostname or IP address of the server. - * - port: TCP port of the server. - * - timeout: timeout to perform the connection. - * - user: username for authentication. - * - pass: password for authentication. - * - * @link http://webd.is - * @link http://github.com/nicolasff/webdis - * @link http://github.com/seppo0010/phpiredis - * - * @author Daniele Alessandri - */ -class WebdisConnection implements NodeConnectionInterface -{ - private $parameters; - private $resource; - private $reader; - - /** - * @param ParametersInterface $parameters Initialization parameters for the connection. - * - * @throws \InvalidArgumentException - */ - public function __construct(ParametersInterface $parameters) - { - $this->assertExtensions(); - - if ($parameters->scheme !== 'http') { - throw new \InvalidArgumentException("Invalid scheme: '{$parameters->scheme}'."); - } - - $this->parameters = $parameters; - - $this->resource = $this->createCurl(); - $this->reader = $this->createReader(); - } - - /** - * Frees the underlying cURL and protocol reader resources when the garbage - * collector kicks in. - */ - public function __destruct() - { - curl_close($this->resource); - phpiredis_reader_destroy($this->reader); - } - - /** - * Helper method used to throw on unsupported methods. - * - * @param string $method Name of the unsupported method. - * - * @throws NotSupportedException - */ - private function throwNotSupportedException($method) - { - $class = __CLASS__; - throw new NotSupportedException("The method $class::$method() is not supported."); - } - - /** - * Checks if the cURL and phpiredis extensions are loaded in PHP. - */ - private function assertExtensions() - { - if (!extension_loaded('curl')) { - throw new NotSupportedException( - 'The "curl" extension is required by this connection backend.' - ); - } - - if (!extension_loaded('phpiredis')) { - throw new NotSupportedException( - 'The "phpiredis" extension is required by this connection backend.' - ); - } - } - - /** - * Initializes cURL. - * - * @return resource - */ - private function createCurl() - { - $parameters = $this->getParameters(); - - if (filter_var($host = $parameters->host, FILTER_VALIDATE_IP)) { - $host = "[$host]"; - } - - $options = array( - CURLOPT_FAILONERROR => true, - CURLOPT_CONNECTTIMEOUT_MS => $parameters->timeout * 1000, - CURLOPT_URL => "$parameters->scheme://$host:$parameters->port", - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, - CURLOPT_POST => true, - CURLOPT_WRITEFUNCTION => array($this, 'feedReader'), - ); - - if (isset($parameters->user, $parameters->pass)) { - $options[CURLOPT_USERPWD] = "{$parameters->user}:{$parameters->pass}"; - } - - curl_setopt_array($resource = curl_init(), $options); - - return $resource; - } - - /** - * Initializes the phpiredis protocol reader. - * - * @return resource - */ - private function createReader() - { - $reader = phpiredis_reader_create(); - - phpiredis_reader_set_status_handler($reader, $this->getStatusHandler()); - phpiredis_reader_set_error_handler($reader, $this->getErrorHandler()); - - return $reader; - } - - /** - * Returns the handler used by the protocol reader for inline responses. - * - * @return \Closure - */ - protected function getStatusHandler() - { - return function ($payload) { - return StatusResponse::get($payload); - }; - } - - /** - * Returns the handler used by the protocol reader for error responses. - * - * @return \Closure - */ - protected function getErrorHandler() - { - return function ($payload) { - return new ErrorResponse($payload); - }; - } - - /** - * Feeds the phpredis reader resource with the data read from the network. - * - * @param resource $resource Reader resource. - * @param string $buffer Buffer of data read from a connection. - * - * @return int - */ - protected function feedReader($resource, $buffer) - { - phpiredis_reader_feed($this->reader, $buffer); - - return strlen($buffer); - } - - /** - * {@inheritdoc} - */ - public function connect() - { - // NOOP - } - - /** - * {@inheritdoc} - */ - public function disconnect() - { - // NOOP - } - - /** - * {@inheritdoc} - */ - public function isConnected() - { - return true; - } - - /** - * Checks if the specified command is supported by this connection class. - * - * @param CommandInterface $command Command instance. - * - * @throws NotSupportedException - * - * @return string - */ - protected function getCommandId(CommandInterface $command) - { - switch ($commandID = $command->getId()) { - case 'AUTH': - case 'SELECT': - case 'MULTI': - case 'EXEC': - case 'WATCH': - case 'UNWATCH': - case 'DISCARD': - case 'MONITOR': - throw new NotSupportedException("Command '$commandID' is not allowed by Webdis."); - - default: - return $commandID; - } - } - - /** - * {@inheritdoc} - */ - public function writeRequest(CommandInterface $command) - { - $this->throwNotSupportedException(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function readResponse(CommandInterface $command) - { - $this->throwNotSupportedException(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function executeCommand(CommandInterface $command) - { - $resource = $this->resource; - $commandId = $this->getCommandId($command); - - if ($arguments = $command->getArguments()) { - $arguments = implode('/', array_map('urlencode', $arguments)); - $serializedCommand = "$commandId/$arguments.raw"; - } else { - $serializedCommand = "$commandId.raw"; - } - - curl_setopt($resource, CURLOPT_POSTFIELDS, $serializedCommand); - - if (curl_exec($resource) === false) { - $error = curl_error($resource); - $errno = curl_errno($resource); - - throw new ConnectionException($this, trim($error), $errno); - } - - if (phpiredis_reader_get_state($this->reader) !== PHPIREDIS_READER_STATE_COMPLETE) { - throw new ProtocolException($this, phpiredis_reader_get_error($this->reader)); - } - - return phpiredis_reader_get_reply($this->reader); - } - - /** - * {@inheritdoc} - */ - public function getResource() - { - return $this->resource; - } - - /** - * {@inheritdoc} - */ - public function getParameters() - { - return $this->parameters; - } - - /** - * {@inheritdoc} - */ - public function addConnectCommand(CommandInterface $command) - { - $this->throwNotSupportedException(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function read() - { - $this->throwNotSupportedException(__FUNCTION__); - } - - /** - * {@inheritdoc} - */ - public function __toString() - { - return "{$this->parameters->host}:{$this->parameters->port}"; - } - - /** - * {@inheritdoc} - */ - public function __sleep() - { - return array('parameters'); - } - - /** - * {@inheritdoc} - */ - public function __wakeup() - { - $this->assertExtensions(); - - $this->resource = $this->createCurl(); - $this->reader = $this->createReader(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Monitor/Consumer.php b/rainloop/v/0.0.0/app/libraries/Predis/Monitor/Consumer.php deleted file mode 100644 index d10bad1a09..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Monitor/Consumer.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Monitor; - -use Predis\ClientInterface; -use Predis\Connection\AggregateConnectionInterface; -use Predis\NotSupportedException; - -/** - * Redis MONITOR consumer. - * - * @author Daniele Alessandri - */ -class Consumer implements \Iterator -{ - private $client; - private $valid; - private $position; - - /** - * @param ClientInterface $client Client instance used by the consumer. - */ - public function __construct(ClientInterface $client) - { - $this->assertClient($client); - - $this->client = $client; - - $this->start(); - } - - /** - * Automatically stops the consumer when the garbage collector kicks in. - */ - public function __destruct() - { - $this->stop(); - } - - /** - * Checks if the passed client instance satisfies the required conditions - * needed to initialize a monitor consumer. - * - * @param ClientInterface $client Client instance used by the consumer. - * - * @throws NotSupportedException - */ - private function assertClient(ClientInterface $client) - { - if ($client->getConnection() instanceof AggregateConnectionInterface) { - throw new NotSupportedException( - 'Cannot initialize a monitor consumer over aggregate connections.' - ); - } - - if ($client->getProfile()->supportsCommand('MONITOR') === false) { - throw new NotSupportedException("The current profile does not support 'MONITOR'."); - } - } - - /** - * Initializes the consumer and sends the MONITOR command to the server. - */ - protected function start() - { - $this->client->executeCommand( - $this->client->createCommand('MONITOR') - ); - $this->valid = true; - } - - /** - * Stops the consumer. Internally this is done by disconnecting from server - * since there is no way to terminate the stream initialized by MONITOR. - */ - public function stop() - { - $this->client->disconnect(); - $this->valid = false; - } - - /** - * {@inheritdoc} - */ - public function rewind() - { - // NOOP - } - - /** - * Returns the last message payload retrieved from the server. - * - * @return Object - */ - public function current() - { - return $this->getValue(); - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - public function next() - { - ++$this->position; - } - - /** - * Checks if the the consumer is still in a valid state to continue. - * - * @return bool - */ - public function valid() - { - return $this->valid; - } - - /** - * Waits for a new message from the server generated by MONITOR and returns - * it when available. - * - * @return Object - */ - private function getValue() - { - $database = 0; - $client = null; - $event = $this->client->getConnection()->read(); - - $callback = function ($matches) use (&$database, &$client) { - if (2 === $count = count($matches)) { - // Redis <= 2.4 - $database = (int) $matches[1]; - } - - if (4 === $count) { - // Redis >= 2.6 - $database = (int) $matches[2]; - $client = $matches[3]; - } - - return ' '; - }; - - $event = preg_replace_callback('/ \(db (\d+)\) | \[(\d+) (.*?)\] /', $callback, $event, 1); - @list($timestamp, $command, $arguments) = explode(' ', $event, 3); - - return (object) array( - 'timestamp' => (float) $timestamp, - 'database' => $database, - 'client' => $client, - 'command' => substr($command, 1, -1), - 'arguments' => $arguments, - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/NotSupportedException.php b/rainloop/v/0.0.0/app/libraries/Predis/NotSupportedException.php deleted file mode 100644 index be82aba723..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/NotSupportedException.php +++ /dev/null @@ -1,22 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -/** - * Exception class thrown when trying to use features not supported by certain - * classes or abstractions of Predis. - * - * @author Daniele Alessandri - */ -class NotSupportedException extends PredisException -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Atomic.php b/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Atomic.php deleted file mode 100644 index 1c9c92aa29..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Atomic.php +++ /dev/null @@ -1,119 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Pipeline; - -use Predis\ClientException; -use Predis\ClientInterface; -use Predis\Connection\ConnectionInterface; -use Predis\Connection\NodeConnectionInterface; -use Predis\Response\ErrorInterface as ErrorResponseInterface; -use Predis\Response\ResponseInterface; -use Predis\Response\ServerException; - -/** - * Command pipeline wrapped into a MULTI / EXEC transaction. - * - * @author Daniele Alessandri - */ -class Atomic extends Pipeline -{ - /** - * {@inheritdoc} - */ - public function __construct(ClientInterface $client) - { - if (!$client->getProfile()->supportsCommands(array('multi', 'exec', 'discard'))) { - throw new ClientException( - "The current profile does not support 'MULTI', 'EXEC' and 'DISCARD'." - ); - } - - parent::__construct($client); - } - - /** - * {@inheritdoc} - */ - protected function getConnection() - { - $connection = $this->getClient()->getConnection(); - - if (!$connection instanceof NodeConnectionInterface) { - $class = __CLASS__; - - throw new ClientException("The class '$class' does not support aggregate connections."); - } - - return $connection; - } - - /** - * {@inheritdoc} - */ - protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands) - { - $profile = $this->getClient()->getProfile(); - $connection->executeCommand($profile->createCommand('multi')); - - foreach ($commands as $command) { - $connection->writeRequest($command); - } - - foreach ($commands as $command) { - $response = $connection->readResponse($command); - - if ($response instanceof ErrorResponseInterface) { - $connection->executeCommand($profile->createCommand('discard')); - throw new ServerException($response->getMessage()); - } - } - - $executed = $connection->executeCommand($profile->createCommand('exec')); - - if (!isset($executed)) { - // TODO: should be throwing a more appropriate exception. - throw new ClientException( - 'The underlying transaction has been aborted by the server.' - ); - } - - if (count($executed) !== count($commands)) { - $expected = count($commands); - $received = count($executed); - - throw new ClientException( - "Invalid number of responses [expected $expected, received $received]." - ); - } - - $responses = array(); - $sizeOfPipe = count($commands); - $exceptions = $this->throwServerExceptions(); - - for ($i = 0; $i < $sizeOfPipe; ++$i) { - $command = $commands->dequeue(); - $response = $executed[$i]; - - if (!$response instanceof ResponseInterface) { - $responses[] = $command->parseResponse($response); - } elseif ($response instanceof ErrorResponseInterface && $exceptions) { - $this->exception($connection, $response); - } else { - $responses[] = $response; - } - - unset($executed[$i]); - } - - return $responses; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/ConnectionErrorProof.php b/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/ConnectionErrorProof.php deleted file mode 100644 index d3bc732e41..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/ConnectionErrorProof.php +++ /dev/null @@ -1,130 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Pipeline; - -use Predis\CommunicationException; -use Predis\Connection\Aggregate\ClusterInterface; -use Predis\Connection\ConnectionInterface; -use Predis\Connection\NodeConnectionInterface; -use Predis\NotSupportedException; - -/** - * Command pipeline that does not throw exceptions on connection errors, but - * returns the exception instances as the rest of the response elements. - * - * @todo Awful naming! - * - * @author Daniele Alessandri - */ -class ConnectionErrorProof extends Pipeline -{ - /** - * {@inheritdoc} - */ - protected function getConnection() - { - return $this->getClient()->getConnection(); - } - - /** - * {@inheritdoc} - */ - protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands) - { - if ($connection instanceof NodeConnectionInterface) { - return $this->executeSingleNode($connection, $commands); - } elseif ($connection instanceof ClusterInterface) { - return $this->executeCluster($connection, $commands); - } else { - $class = get_class($connection); - - throw new NotSupportedException("The connection class '$class' is not supported."); - } - } - - /** - * {@inheritdoc} - */ - protected function executeSingleNode(NodeConnectionInterface $connection, \SplQueue $commands) - { - $responses = array(); - $sizeOfPipe = count($commands); - - foreach ($commands as $command) { - try { - $connection->writeRequest($command); - } catch (CommunicationException $exception) { - return array_fill(0, $sizeOfPipe, $exception); - } - } - - for ($i = 0; $i < $sizeOfPipe; ++$i) { - $command = $commands->dequeue(); - - try { - $responses[$i] = $connection->readResponse($command); - } catch (CommunicationException $exception) { - $add = count($commands) - count($responses); - $responses = array_merge($responses, array_fill(0, $add, $exception)); - - break; - } - } - - return $responses; - } - - /** - * {@inheritdoc} - */ - protected function executeCluster(ClusterInterface $connection, \SplQueue $commands) - { - $responses = array(); - $sizeOfPipe = count($commands); - $exceptions = array(); - - foreach ($commands as $command) { - $cmdConnection = $connection->getConnection($command); - - if (isset($exceptions[spl_object_hash($cmdConnection)])) { - continue; - } - - try { - $cmdConnection->writeRequest($command); - } catch (CommunicationException $exception) { - $exceptions[spl_object_hash($cmdConnection)] = $exception; - } - } - - for ($i = 0; $i < $sizeOfPipe; ++$i) { - $command = $commands->dequeue(); - - $cmdConnection = $connection->getConnection($command); - $connectionHash = spl_object_hash($cmdConnection); - - if (isset($exceptions[$connectionHash])) { - $responses[$i] = $exceptions[$connectionHash]; - continue; - } - - try { - $responses[$i] = $cmdConnection->readResponse($command); - } catch (CommunicationException $exception) { - $responses[$i] = $exception; - $exceptions[$connectionHash] = $exception; - } - } - - return $responses; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/FireAndForget.php b/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/FireAndForget.php deleted file mode 100644 index 95a062b64e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/FireAndForget.php +++ /dev/null @@ -1,36 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Pipeline; - -use Predis\Connection\ConnectionInterface; - -/** - * Command pipeline that writes commands to the servers but discards responses. - * - * @author Daniele Alessandri - */ -class FireAndForget extends Pipeline -{ - /** - * {@inheritdoc} - */ - protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands) - { - while (!$commands->isEmpty()) { - $connection->writeRequest($commands->dequeue()); - } - - $connection->disconnect(); - - return array(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Pipeline.php b/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Pipeline.php deleted file mode 100644 index cf9c59e4fc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Pipeline/Pipeline.php +++ /dev/null @@ -1,247 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Pipeline; - -use Predis\ClientContextInterface; -use Predis\ClientException; -use Predis\ClientInterface; -use Predis\Command\CommandInterface; -use Predis\Connection\Aggregate\ReplicationInterface; -use Predis\Connection\ConnectionInterface; -use Predis\Response\ErrorInterface as ErrorResponseInterface; -use Predis\Response\ResponseInterface; -use Predis\Response\ServerException; - -/** - * Implementation of a command pipeline in which write and read operations of - * Redis commands are pipelined to alleviate the effects of network round-trips. - * - * {@inheritdoc} - * - * @author Daniele Alessandri - */ -class Pipeline implements ClientContextInterface -{ - private $client; - private $pipeline; - - private $responses = array(); - private $running = false; - - /** - * @param ClientInterface $client Client instance used by the context. - */ - public function __construct(ClientInterface $client) - { - $this->client = $client; - $this->pipeline = new \SplQueue(); - } - - /** - * Queues a command into the pipeline buffer. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - * - * @return $this - */ - public function __call($method, $arguments) - { - $command = $this->client->createCommand($method, $arguments); - $this->recordCommand($command); - - return $this; - } - - /** - * Queues a command instance into the pipeline buffer. - * - * @param CommandInterface $command Command to be queued in the buffer. - */ - protected function recordCommand(CommandInterface $command) - { - $this->pipeline->enqueue($command); - } - - /** - * Queues a command instance into the pipeline buffer. - * - * @param CommandInterface $command Command instance to be queued in the buffer. - * - * @return $this - */ - public function executeCommand(CommandInterface $command) - { - $this->recordCommand($command); - - return $this; - } - - /** - * Throws an exception on -ERR responses returned by Redis. - * - * @param ConnectionInterface $connection Redis connection that returned the error. - * @param ErrorResponseInterface $response Instance of the error response. - * - * @throws ServerException - */ - protected function exception(ConnectionInterface $connection, ErrorResponseInterface $response) - { - $connection->disconnect(); - $message = $response->getMessage(); - - throw new ServerException($message); - } - - /** - * Returns the underlying connection to be used by the pipeline. - * - * @return ConnectionInterface - */ - protected function getConnection() - { - $connection = $this->getClient()->getConnection(); - - if ($connection instanceof ReplicationInterface) { - $connection->switchTo('master'); - } - - return $connection; - } - - /** - * Implements the logic to flush the queued commands and read the responses - * from the current connection. - * - * @param ConnectionInterface $connection Current connection instance. - * @param \SplQueue $commands Queued commands. - * - * @return array - */ - protected function executePipeline(ConnectionInterface $connection, \SplQueue $commands) - { - foreach ($commands as $command) { - $connection->writeRequest($command); - } - - $responses = array(); - $exceptions = $this->throwServerExceptions(); - - while (!$commands->isEmpty()) { - $command = $commands->dequeue(); - $response = $connection->readResponse($command); - - if (!$response instanceof ResponseInterface) { - $responses[] = $command->parseResponse($response); - } elseif ($response instanceof ErrorResponseInterface && $exceptions) { - $this->exception($connection, $response); - } else { - $responses[] = $response; - } - } - - return $responses; - } - - /** - * Flushes the buffer holding all of the commands queued so far. - * - * @param bool $send Specifies if the commands in the buffer should be sent to Redis. - * - * @return $this - */ - public function flushPipeline($send = true) - { - if ($send && !$this->pipeline->isEmpty()) { - $responses = $this->executePipeline($this->getConnection(), $this->pipeline); - $this->responses = array_merge($this->responses, $responses); - } else { - $this->pipeline = new \SplQueue(); - } - - return $this; - } - - /** - * Marks the running status of the pipeline. - * - * @param bool $bool Sets the running status of the pipeline. - * - * @throws ClientException - */ - private function setRunning($bool) - { - if ($bool && $this->running) { - throw new ClientException('The current pipeline context is already being executed.'); - } - - $this->running = $bool; - } - - /** - * Handles the actual execution of the whole pipeline. - * - * @param mixed $callable Optional callback for execution. - * - * @throws \Exception - * @throws \InvalidArgumentException - * - * @return array - */ - public function execute($callable = null) - { - if ($callable && !is_callable($callable)) { - throw new \InvalidArgumentException('The argument must be a callable object.'); - } - - $exception = null; - $this->setRunning(true); - - try { - if ($callable) { - call_user_func($callable, $this); - } - - $this->flushPipeline(); - } catch (\Exception $exception) { - // NOOP - } - - $this->setRunning(false); - - if ($exception) { - throw $exception; - } - - return $this->responses; - } - - /** - * Returns if the pipeline should throw exceptions on server errors. - * - * @return bool - */ - protected function throwServerExceptions() - { - return (bool) $this->client->getOptions()->exceptions; - } - - /** - * Returns the underlying client instance used by the pipeline object. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/PredisException.php b/rainloop/v/0.0.0/app/libraries/Predis/PredisException.php deleted file mode 100644 index 122bde16d9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/PredisException.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis; - -/** - * Base exception class for Predis-related errors. - * - * @author Daniele Alessandri - */ -abstract class PredisException extends \Exception -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/Factory.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/Factory.php deleted file mode 100644 index bcee3c2cfb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/Factory.php +++ /dev/null @@ -1,100 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -use Predis\ClientException; - -/** - * Factory class for creating profile instances from strings. - * - * @author Daniele Alessandri - */ -final class Factory -{ - private static $profiles = array( - '2.0' => 'Predis\Profile\RedisVersion200', - '2.2' => 'Predis\Profile\RedisVersion220', - '2.4' => 'Predis\Profile\RedisVersion240', - '2.6' => 'Predis\Profile\RedisVersion260', - '2.8' => 'Predis\Profile\RedisVersion280', - '3.0' => 'Predis\Profile\RedisVersion300', - 'dev' => 'Predis\Profile\RedisUnstable', - 'default' => 'Predis\Profile\RedisVersion300', - ); - - /** - * - */ - private function __construct() - { - // NOOP - } - - /** - * Returns the default server profile. - * - * @return ProfileInterface - */ - public static function getDefault() - { - return self::get('default'); - } - - /** - * Returns the development server profile. - * - * @return ProfileInterface - */ - public static function getDevelopment() - { - return self::get('dev'); - } - - /** - * Registers a new server profile. - * - * @param string $alias Profile version or alias. - * @param string $class FQN of a class implementing Predis\Profile\ProfileInterface. - * - * @throws \InvalidArgumentException - */ - public static function define($alias, $class) - { - $reflection = new \ReflectionClass($class); - - if (!$reflection->isSubclassOf('Predis\Profile\ProfileInterface')) { - throw new \InvalidArgumentException("The class '$class' is not a valid profile class."); - } - - self::$profiles[$alias] = $class; - } - - /** - * Returns the specified server profile. - * - * @param string $version Profile version or alias. - * - * @throws ClientException - * - * @return ProfileInterface - */ - public static function get($version) - { - if (!isset(self::$profiles[$version])) { - throw new ClientException("Unknown server profile: '$version'."); - } - - $profile = self::$profiles[$version]; - - return new $profile(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/ProfileInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/ProfileInterface.php deleted file mode 100644 index abe71aa639..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/ProfileInterface.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -use Predis\Command\CommandInterface; - -/** - * A profile defines all the features and commands supported by certain versions - * of Redis. Instances of Predis\Client should use a server profile matching the - * version of Redis being used. - * - * @author Daniele Alessandri - */ -interface ProfileInterface -{ - /** - * Returns the profile version corresponding to the Redis version. - * - * @return string - */ - public function getVersion(); - - /** - * Checks if the profile supports the specified command. - * - * @param string $commandID Command ID. - * - * @return bool - */ - public function supportsCommand($commandID); - - /** - * Checks if the profile supports the specified list of commands. - * - * @param array $commandIDs List of command IDs. - * - * @return string - */ - public function supportsCommands(array $commandIDs); - - /** - * Creates a new command instance. - * - * @param string $commandID Command ID. - * @param array $arguments Arguments for the command. - * - * @return CommandInterface - */ - public function createCommand($commandID, array $arguments = array()); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisProfile.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisProfile.php deleted file mode 100644 index 3ef316886a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisProfile.php +++ /dev/null @@ -1,146 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -use Predis\ClientException; -use Predis\Command\Processor\ProcessorInterface; - -/** - * Base class implementing common functionalities for Redis server profiles. - * - * @author Daniele Alessandri - */ -abstract class RedisProfile implements ProfileInterface -{ - private $commands; - private $processor; - - /** - * - */ - public function __construct() - { - $this->commands = $this->getSupportedCommands(); - } - - /** - * Returns a map of all the commands supported by the profile and their - * actual PHP classes. - * - * @return array - */ - abstract protected function getSupportedCommands(); - - /** - * {@inheritdoc} - */ - public function supportsCommand($commandID) - { - return isset($this->commands[strtoupper($commandID)]); - } - - /** - * {@inheritdoc} - */ - public function supportsCommands(array $commandIDs) - { - foreach ($commandIDs as $commandID) { - if (!$this->supportsCommand($commandID)) { - return false; - } - } - - return true; - } - - /** - * Returns the fully-qualified name of a class representing the specified - * command ID registered in the current server profile. - * - * @param string $commandID Command ID. - * - * @return string|null - */ - public function getCommandClass($commandID) - { - if (isset($this->commands[$commandID = strtoupper($commandID)])) { - return $this->commands[$commandID]; - } - } - - /** - * {@inheritdoc} - */ - public function createCommand($commandID, array $arguments = array()) - { - $commandID = strtoupper($commandID); - - if (!isset($this->commands[$commandID])) { - throw new ClientException("Command '$commandID' is not a registered Redis command."); - } - - $commandClass = $this->commands[$commandID]; - $command = new $commandClass(); - $command->setArguments($arguments); - - if (isset($this->processor)) { - $this->processor->process($command); - } - - return $command; - } - - /** - * Defines a new command in the server profile. - * - * @param string $commandID Command ID. - * @param string $class Fully-qualified name of a Predis\Command\CommandInterface. - * - * @throws \InvalidArgumentException - */ - public function defineCommand($commandID, $class) - { - $reflection = new \ReflectionClass($class); - - if (!$reflection->isSubclassOf('Predis\Command\CommandInterface')) { - throw new \InvalidArgumentException("The class '$class' is not a valid command class."); - } - - $this->commands[strtoupper($commandID)] = $class; - } - - /** - * {@inheritdoc} - */ - public function setProcessor(ProcessorInterface $processor = null) - { - $this->processor = $processor; - } - - /** - * {@inheritdoc} - */ - public function getProcessor() - { - return $this->processor; - } - - /** - * Returns the version of server profile as its string representation. - * - * @return string - */ - public function __toString() - { - return $this->getVersion(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisUnstable.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisUnstable.php deleted file mode 100644 index cf6174feb4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisUnstable.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for the current unstable version of Redis. - * - * @author Daniele Alessandri - */ -class RedisUnstable extends RedisVersion300 -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '3.2'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array_merge(parent::getSupportedCommands(), array( - /* ---------------- Redis 3.2 ---------------- */ - - /* commands operating on hashes */ - 'HSTRLEN' => 'Predis\Command\HashStringLength', - )); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion200.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion200.php deleted file mode 100644 index 234d53c003..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion200.php +++ /dev/null @@ -1,173 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 2.0. - * - * @author Daniele Alessandri - */ -class RedisVersion200 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.0'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfo', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion220.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion220.php deleted file mode 100644 index 899014e285..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion220.php +++ /dev/null @@ -1,202 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 2.2. - * - * @author Daniele Alessandri - */ -class RedisVersion220 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.2'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfo', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'PERSIST' => 'Predis\Command\KeyPersist', - - /* commands operating on string values */ - 'STRLEN' => 'Predis\Command\StringStrlen', - 'SETRANGE' => 'Predis\Command\StringSetRange', - 'GETRANGE' => 'Predis\Command\StringGetRange', - 'SETBIT' => 'Predis\Command\StringSetBit', - 'GETBIT' => 'Predis\Command\StringGetBit', - - /* commands operating on lists */ - 'RPUSHX' => 'Predis\Command\ListPushTailX', - 'LPUSHX' => 'Predis\Command\ListPushHeadX', - 'LINSERT' => 'Predis\Command\ListInsert', - 'BRPOPLPUSH' => 'Predis\Command\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'ZREVRANGEBYSCORE' => 'Predis\Command\ZSetReverseRangeByScore', - - /* transactions */ - 'WATCH' => 'Predis\Command\TransactionWatch', - 'UNWATCH' => 'Predis\Command\TransactionUnwatch', - - /* remote server control commands */ - 'OBJECT' => 'Predis\Command\ServerObject', - 'SLOWLOG' => 'Predis\Command\ServerSlowlog', - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion240.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion240.php deleted file mode 100644 index 0856c37c44..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion240.php +++ /dev/null @@ -1,207 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 2.4. - * - * @author Daniele Alessandri - */ -class RedisVersion240 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.4'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfo', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'PERSIST' => 'Predis\Command\KeyPersist', - - /* commands operating on string values */ - 'STRLEN' => 'Predis\Command\StringStrlen', - 'SETRANGE' => 'Predis\Command\StringSetRange', - 'GETRANGE' => 'Predis\Command\StringGetRange', - 'SETBIT' => 'Predis\Command\StringSetBit', - 'GETBIT' => 'Predis\Command\StringGetBit', - - /* commands operating on lists */ - 'RPUSHX' => 'Predis\Command\ListPushTailX', - 'LPUSHX' => 'Predis\Command\ListPushHeadX', - 'LINSERT' => 'Predis\Command\ListInsert', - 'BRPOPLPUSH' => 'Predis\Command\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'ZREVRANGEBYSCORE' => 'Predis\Command\ZSetReverseRangeByScore', - - /* transactions */ - 'WATCH' => 'Predis\Command\TransactionWatch', - 'UNWATCH' => 'Predis\Command\TransactionUnwatch', - - /* remote server control commands */ - 'OBJECT' => 'Predis\Command\ServerObject', - 'SLOWLOG' => 'Predis\Command\ServerSlowlog', - - /* ---------------- Redis 2.4 ---------------- */ - - /* remote server control commands */ - 'CLIENT' => 'Predis\Command\ServerClient', - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion260.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion260.php deleted file mode 100644 index ba5084aa0a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion260.php +++ /dev/null @@ -1,235 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 2.6. - * - * @author Daniele Alessandri - */ -class RedisVersion260 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.6'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - 'DUMP' => 'Predis\Command\KeyDump', - 'RESTORE' => 'Predis\Command\KeyRestore', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfoV26x', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'PERSIST' => 'Predis\Command\KeyPersist', - - /* commands operating on string values */ - 'STRLEN' => 'Predis\Command\StringStrlen', - 'SETRANGE' => 'Predis\Command\StringSetRange', - 'GETRANGE' => 'Predis\Command\StringGetRange', - 'SETBIT' => 'Predis\Command\StringSetBit', - 'GETBIT' => 'Predis\Command\StringGetBit', - - /* commands operating on lists */ - 'RPUSHX' => 'Predis\Command\ListPushTailX', - 'LPUSHX' => 'Predis\Command\ListPushHeadX', - 'LINSERT' => 'Predis\Command\ListInsert', - 'BRPOPLPUSH' => 'Predis\Command\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'ZREVRANGEBYSCORE' => 'Predis\Command\ZSetReverseRangeByScore', - - /* transactions */ - 'WATCH' => 'Predis\Command\TransactionWatch', - 'UNWATCH' => 'Predis\Command\TransactionUnwatch', - - /* remote server control commands */ - 'OBJECT' => 'Predis\Command\ServerObject', - 'SLOWLOG' => 'Predis\Command\ServerSlowlog', - - /* ---------------- Redis 2.4 ---------------- */ - - /* remote server control commands */ - 'CLIENT' => 'Predis\Command\ServerClient', - - /* ---------------- Redis 2.6 ---------------- */ - - /* commands operating on the key space */ - 'PTTL' => 'Predis\Command\KeyPreciseTimeToLive', - 'PEXPIRE' => 'Predis\Command\KeyPreciseExpire', - 'PEXPIREAT' => 'Predis\Command\KeyPreciseExpireAt', - 'MIGRATE' => 'Predis\Command\KeyMigrate', - - /* commands operating on string values */ - 'PSETEX' => 'Predis\Command\StringPreciseSetExpire', - 'INCRBYFLOAT' => 'Predis\Command\StringIncrementByFloat', - 'BITOP' => 'Predis\Command\StringBitOp', - 'BITCOUNT' => 'Predis\Command\StringBitCount', - - /* commands operating on hashes */ - 'HINCRBYFLOAT' => 'Predis\Command\HashIncrementByFloat', - - /* scripting */ - 'EVAL' => 'Predis\Command\ServerEval', - 'EVALSHA' => 'Predis\Command\ServerEvalSHA', - 'SCRIPT' => 'Predis\Command\ServerScript', - - /* remote server control commands */ - 'TIME' => 'Predis\Command\ServerTime', - 'SENTINEL' => 'Predis\Command\ServerSentinel', - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion280.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion280.php deleted file mode 100644 index ea17e68296..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion280.php +++ /dev/null @@ -1,267 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 2.8. - * - * @author Daniele Alessandri - */ -class RedisVersion280 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '2.8'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - 'DUMP' => 'Predis\Command\KeyDump', - 'RESTORE' => 'Predis\Command\KeyRestore', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfoV26x', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'PERSIST' => 'Predis\Command\KeyPersist', - - /* commands operating on string values */ - 'STRLEN' => 'Predis\Command\StringStrlen', - 'SETRANGE' => 'Predis\Command\StringSetRange', - 'GETRANGE' => 'Predis\Command\StringGetRange', - 'SETBIT' => 'Predis\Command\StringSetBit', - 'GETBIT' => 'Predis\Command\StringGetBit', - - /* commands operating on lists */ - 'RPUSHX' => 'Predis\Command\ListPushTailX', - 'LPUSHX' => 'Predis\Command\ListPushHeadX', - 'LINSERT' => 'Predis\Command\ListInsert', - 'BRPOPLPUSH' => 'Predis\Command\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'ZREVRANGEBYSCORE' => 'Predis\Command\ZSetReverseRangeByScore', - - /* transactions */ - 'WATCH' => 'Predis\Command\TransactionWatch', - 'UNWATCH' => 'Predis\Command\TransactionUnwatch', - - /* remote server control commands */ - 'OBJECT' => 'Predis\Command\ServerObject', - 'SLOWLOG' => 'Predis\Command\ServerSlowlog', - - /* ---------------- Redis 2.4 ---------------- */ - - /* remote server control commands */ - 'CLIENT' => 'Predis\Command\ServerClient', - - /* ---------------- Redis 2.6 ---------------- */ - - /* commands operating on the key space */ - 'PTTL' => 'Predis\Command\KeyPreciseTimeToLive', - 'PEXPIRE' => 'Predis\Command\KeyPreciseExpire', - 'PEXPIREAT' => 'Predis\Command\KeyPreciseExpireAt', - 'MIGRATE' => 'Predis\Command\KeyMigrate', - - /* commands operating on string values */ - 'PSETEX' => 'Predis\Command\StringPreciseSetExpire', - 'INCRBYFLOAT' => 'Predis\Command\StringIncrementByFloat', - 'BITOP' => 'Predis\Command\StringBitOp', - 'BITCOUNT' => 'Predis\Command\StringBitCount', - - /* commands operating on hashes */ - 'HINCRBYFLOAT' => 'Predis\Command\HashIncrementByFloat', - - /* scripting */ - 'EVAL' => 'Predis\Command\ServerEval', - 'EVALSHA' => 'Predis\Command\ServerEvalSHA', - 'SCRIPT' => 'Predis\Command\ServerScript', - - /* remote server control commands */ - 'TIME' => 'Predis\Command\ServerTime', - 'SENTINEL' => 'Predis\Command\ServerSentinel', - - /* ---------------- Redis 2.8 ---------------- */ - - /* commands operating on the key space */ - 'SCAN' => 'Predis\Command\KeyScan', - - /* commands operating on string values */ - 'BITPOS' => 'Predis\Command\StringBitPos', - - /* commands operating on sets */ - 'SSCAN' => 'Predis\Command\SetScan', - - /* commands operating on sorted sets */ - 'ZSCAN' => 'Predis\Command\ZSetScan', - 'ZLEXCOUNT' => 'Predis\Command\ZSetLexCount', - 'ZRANGEBYLEX' => 'Predis\Command\ZSetRangeByLex', - 'ZREMRANGEBYLEX' => 'Predis\Command\ZSetRemoveRangeByLex', - 'ZREVRANGEBYLEX' => 'Predis\Command\ZSetReverseRangeByLex', - - /* commands operating on hashes */ - 'HSCAN' => 'Predis\Command\HashScan', - - /* publish - subscribe */ - 'PUBSUB' => 'Predis\Command\PubSubPubsub', - - /* commands operating on HyperLogLog */ - 'PFADD' => 'Predis\Command\HyperLogLogAdd', - 'PFCOUNT' => 'Predis\Command\HyperLogLogCount', - 'PFMERGE' => 'Predis\Command\HyperLogLogMerge', - - /* remote server control commands */ - 'COMMAND' => 'Predis\Command\ServerCommand', - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion300.php b/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion300.php deleted file mode 100644 index 8a2fac8b79..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Profile/RedisVersion300.php +++ /dev/null @@ -1,270 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Profile; - -/** - * Server profile for Redis 3.0. - * - * @author Daniele Alessandri - */ -class RedisVersion300 extends RedisProfile -{ - /** - * {@inheritdoc} - */ - public function getVersion() - { - return '3.0'; - } - - /** - * {@inheritdoc} - */ - public function getSupportedCommands() - { - return array( - /* ---------------- Redis 1.2 ---------------- */ - - /* commands operating on the key space */ - 'EXISTS' => 'Predis\Command\KeyExists', - 'DEL' => 'Predis\Command\KeyDelete', - 'TYPE' => 'Predis\Command\KeyType', - 'KEYS' => 'Predis\Command\KeyKeys', - 'RANDOMKEY' => 'Predis\Command\KeyRandom', - 'RENAME' => 'Predis\Command\KeyRename', - 'RENAMENX' => 'Predis\Command\KeyRenamePreserve', - 'EXPIRE' => 'Predis\Command\KeyExpire', - 'EXPIREAT' => 'Predis\Command\KeyExpireAt', - 'TTL' => 'Predis\Command\KeyTimeToLive', - 'MOVE' => 'Predis\Command\KeyMove', - 'SORT' => 'Predis\Command\KeySort', - 'DUMP' => 'Predis\Command\KeyDump', - 'RESTORE' => 'Predis\Command\KeyRestore', - - /* commands operating on string values */ - 'SET' => 'Predis\Command\StringSet', - 'SETNX' => 'Predis\Command\StringSetPreserve', - 'MSET' => 'Predis\Command\StringSetMultiple', - 'MSETNX' => 'Predis\Command\StringSetMultiplePreserve', - 'GET' => 'Predis\Command\StringGet', - 'MGET' => 'Predis\Command\StringGetMultiple', - 'GETSET' => 'Predis\Command\StringGetSet', - 'INCR' => 'Predis\Command\StringIncrement', - 'INCRBY' => 'Predis\Command\StringIncrementBy', - 'DECR' => 'Predis\Command\StringDecrement', - 'DECRBY' => 'Predis\Command\StringDecrementBy', - - /* commands operating on lists */ - 'RPUSH' => 'Predis\Command\ListPushTail', - 'LPUSH' => 'Predis\Command\ListPushHead', - 'LLEN' => 'Predis\Command\ListLength', - 'LRANGE' => 'Predis\Command\ListRange', - 'LTRIM' => 'Predis\Command\ListTrim', - 'LINDEX' => 'Predis\Command\ListIndex', - 'LSET' => 'Predis\Command\ListSet', - 'LREM' => 'Predis\Command\ListRemove', - 'LPOP' => 'Predis\Command\ListPopFirst', - 'RPOP' => 'Predis\Command\ListPopLast', - 'RPOPLPUSH' => 'Predis\Command\ListPopLastPushHead', - - /* commands operating on sets */ - 'SADD' => 'Predis\Command\SetAdd', - 'SREM' => 'Predis\Command\SetRemove', - 'SPOP' => 'Predis\Command\SetPop', - 'SMOVE' => 'Predis\Command\SetMove', - 'SCARD' => 'Predis\Command\SetCardinality', - 'SISMEMBER' => 'Predis\Command\SetIsMember', - 'SINTER' => 'Predis\Command\SetIntersection', - 'SINTERSTORE' => 'Predis\Command\SetIntersectionStore', - 'SUNION' => 'Predis\Command\SetUnion', - 'SUNIONSTORE' => 'Predis\Command\SetUnionStore', - 'SDIFF' => 'Predis\Command\SetDifference', - 'SDIFFSTORE' => 'Predis\Command\SetDifferenceStore', - 'SMEMBERS' => 'Predis\Command\SetMembers', - 'SRANDMEMBER' => 'Predis\Command\SetRandomMember', - - /* commands operating on sorted sets */ - 'ZADD' => 'Predis\Command\ZSetAdd', - 'ZINCRBY' => 'Predis\Command\ZSetIncrementBy', - 'ZREM' => 'Predis\Command\ZSetRemove', - 'ZRANGE' => 'Predis\Command\ZSetRange', - 'ZREVRANGE' => 'Predis\Command\ZSetReverseRange', - 'ZRANGEBYSCORE' => 'Predis\Command\ZSetRangeByScore', - 'ZCARD' => 'Predis\Command\ZSetCardinality', - 'ZSCORE' => 'Predis\Command\ZSetScore', - 'ZREMRANGEBYSCORE' => 'Predis\Command\ZSetRemoveRangeByScore', - - /* connection related commands */ - 'PING' => 'Predis\Command\ConnectionPing', - 'AUTH' => 'Predis\Command\ConnectionAuth', - 'SELECT' => 'Predis\Command\ConnectionSelect', - 'ECHO' => 'Predis\Command\ConnectionEcho', - 'QUIT' => 'Predis\Command\ConnectionQuit', - - /* remote server control commands */ - 'INFO' => 'Predis\Command\ServerInfoV26x', - 'SLAVEOF' => 'Predis\Command\ServerSlaveOf', - 'MONITOR' => 'Predis\Command\ServerMonitor', - 'DBSIZE' => 'Predis\Command\ServerDatabaseSize', - 'FLUSHDB' => 'Predis\Command\ServerFlushDatabase', - 'FLUSHALL' => 'Predis\Command\ServerFlushAll', - 'SAVE' => 'Predis\Command\ServerSave', - 'BGSAVE' => 'Predis\Command\ServerBackgroundSave', - 'LASTSAVE' => 'Predis\Command\ServerLastSave', - 'SHUTDOWN' => 'Predis\Command\ServerShutdown', - 'BGREWRITEAOF' => 'Predis\Command\ServerBackgroundRewriteAOF', - - /* ---------------- Redis 2.0 ---------------- */ - - /* commands operating on string values */ - 'SETEX' => 'Predis\Command\StringSetExpire', - 'APPEND' => 'Predis\Command\StringAppend', - 'SUBSTR' => 'Predis\Command\StringSubstr', - - /* commands operating on lists */ - 'BLPOP' => 'Predis\Command\ListPopFirstBlocking', - 'BRPOP' => 'Predis\Command\ListPopLastBlocking', - - /* commands operating on sorted sets */ - 'ZUNIONSTORE' => 'Predis\Command\ZSetUnionStore', - 'ZINTERSTORE' => 'Predis\Command\ZSetIntersectionStore', - 'ZCOUNT' => 'Predis\Command\ZSetCount', - 'ZRANK' => 'Predis\Command\ZSetRank', - 'ZREVRANK' => 'Predis\Command\ZSetReverseRank', - 'ZREMRANGEBYRANK' => 'Predis\Command\ZSetRemoveRangeByRank', - - /* commands operating on hashes */ - 'HSET' => 'Predis\Command\HashSet', - 'HSETNX' => 'Predis\Command\HashSetPreserve', - 'HMSET' => 'Predis\Command\HashSetMultiple', - 'HINCRBY' => 'Predis\Command\HashIncrementBy', - 'HGET' => 'Predis\Command\HashGet', - 'HMGET' => 'Predis\Command\HashGetMultiple', - 'HDEL' => 'Predis\Command\HashDelete', - 'HEXISTS' => 'Predis\Command\HashExists', - 'HLEN' => 'Predis\Command\HashLength', - 'HKEYS' => 'Predis\Command\HashKeys', - 'HVALS' => 'Predis\Command\HashValues', - 'HGETALL' => 'Predis\Command\HashGetAll', - - /* transactions */ - 'MULTI' => 'Predis\Command\TransactionMulti', - 'EXEC' => 'Predis\Command\TransactionExec', - 'DISCARD' => 'Predis\Command\TransactionDiscard', - - /* publish - subscribe */ - 'SUBSCRIBE' => 'Predis\Command\PubSubSubscribe', - 'UNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribe', - 'PSUBSCRIBE' => 'Predis\Command\PubSubSubscribeByPattern', - 'PUNSUBSCRIBE' => 'Predis\Command\PubSubUnsubscribeByPattern', - 'PUBLISH' => 'Predis\Command\PubSubPublish', - - /* remote server control commands */ - 'CONFIG' => 'Predis\Command\ServerConfig', - - /* ---------------- Redis 2.2 ---------------- */ - - /* commands operating on the key space */ - 'PERSIST' => 'Predis\Command\KeyPersist', - - /* commands operating on string values */ - 'STRLEN' => 'Predis\Command\StringStrlen', - 'SETRANGE' => 'Predis\Command\StringSetRange', - 'GETRANGE' => 'Predis\Command\StringGetRange', - 'SETBIT' => 'Predis\Command\StringSetBit', - 'GETBIT' => 'Predis\Command\StringGetBit', - - /* commands operating on lists */ - 'RPUSHX' => 'Predis\Command\ListPushTailX', - 'LPUSHX' => 'Predis\Command\ListPushHeadX', - 'LINSERT' => 'Predis\Command\ListInsert', - 'BRPOPLPUSH' => 'Predis\Command\ListPopLastPushHeadBlocking', - - /* commands operating on sorted sets */ - 'ZREVRANGEBYSCORE' => 'Predis\Command\ZSetReverseRangeByScore', - - /* transactions */ - 'WATCH' => 'Predis\Command\TransactionWatch', - 'UNWATCH' => 'Predis\Command\TransactionUnwatch', - - /* remote server control commands */ - 'OBJECT' => 'Predis\Command\ServerObject', - 'SLOWLOG' => 'Predis\Command\ServerSlowlog', - - /* ---------------- Redis 2.4 ---------------- */ - - /* remote server control commands */ - 'CLIENT' => 'Predis\Command\ServerClient', - - /* ---------------- Redis 2.6 ---------------- */ - - /* commands operating on the key space */ - 'PTTL' => 'Predis\Command\KeyPreciseTimeToLive', - 'PEXPIRE' => 'Predis\Command\KeyPreciseExpire', - 'PEXPIREAT' => 'Predis\Command\KeyPreciseExpireAt', - 'MIGRATE' => 'Predis\Command\KeyMigrate', - - /* commands operating on string values */ - 'PSETEX' => 'Predis\Command\StringPreciseSetExpire', - 'INCRBYFLOAT' => 'Predis\Command\StringIncrementByFloat', - 'BITOP' => 'Predis\Command\StringBitOp', - 'BITCOUNT' => 'Predis\Command\StringBitCount', - - /* commands operating on hashes */ - 'HINCRBYFLOAT' => 'Predis\Command\HashIncrementByFloat', - - /* scripting */ - 'EVAL' => 'Predis\Command\ServerEval', - 'EVALSHA' => 'Predis\Command\ServerEvalSHA', - 'SCRIPT' => 'Predis\Command\ServerScript', - - /* remote server control commands */ - 'TIME' => 'Predis\Command\ServerTime', - 'SENTINEL' => 'Predis\Command\ServerSentinel', - - /* ---------------- Redis 2.8 ---------------- */ - - /* commands operating on the key space */ - 'SCAN' => 'Predis\Command\KeyScan', - - /* commands operating on string values */ - 'BITPOS' => 'Predis\Command\StringBitPos', - - /* commands operating on sets */ - 'SSCAN' => 'Predis\Command\SetScan', - - /* commands operating on sorted sets */ - 'ZSCAN' => 'Predis\Command\ZSetScan', - 'ZLEXCOUNT' => 'Predis\Command\ZSetLexCount', - 'ZRANGEBYLEX' => 'Predis\Command\ZSetRangeByLex', - 'ZREMRANGEBYLEX' => 'Predis\Command\ZSetRemoveRangeByLex', - 'ZREVRANGEBYLEX' => 'Predis\Command\ZSetReverseRangeByLex', - - /* commands operating on hashes */ - 'HSCAN' => 'Predis\Command\HashScan', - - /* publish - subscribe */ - 'PUBSUB' => 'Predis\Command\PubSubPubsub', - - /* commands operating on HyperLogLog */ - 'PFADD' => 'Predis\Command\HyperLogLogAdd', - 'PFCOUNT' => 'Predis\Command\HyperLogLogCount', - 'PFMERGE' => 'Predis\Command\HyperLogLogMerge', - - /* remote server control commands */ - 'COMMAND' => 'Predis\Command\ServerCommand', - - /* ---------------- Redis 3.0 ---------------- */ - - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolException.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolException.php deleted file mode 100644 index 6fe5d6d3ab..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolException.php +++ /dev/null @@ -1,24 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol; - -use Predis\CommunicationException; - -/** - * Exception used to indentify errors encountered while parsing the Redis wire - * protocol. - * - * @author Daniele Alessandri - */ -class ProtocolException extends CommunicationException -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolProcessorInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolProcessorInterface.php deleted file mode 100644 index b34ea18143..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ProtocolProcessorInterface.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol; - -use Predis\Command\CommandInterface; -use Predis\Connection\CompositeConnectionInterface; - -/** - * Defines a pluggable protocol processor capable of serializing commands and - * deserializing responses into PHP objects directly from a connection. - * - * @author Daniele Alessandri - */ -interface ProtocolProcessorInterface -{ - /** - * Writes a request over a connection to Redis. - * - * @param CompositeConnectionInterface $connection Redis connection. - * @param CommandInterface $command Command instance. - */ - public function write(CompositeConnectionInterface $connection, CommandInterface $command); - - /** - * Reads a response from a connection to Redis. - * - * @param CompositeConnectionInterface $connection Redis connection. - * - * @return mixed - */ - public function read(CompositeConnectionInterface $connection); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/RequestSerializerInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/RequestSerializerInterface.php deleted file mode 100644 index eef72a640f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/RequestSerializerInterface.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol; - -use Predis\Command\CommandInterface; - -/** - * Defines a pluggable serializer for Redis commands. - * - * @author Daniele Alessandri - */ -interface RequestSerializerInterface -{ - /** - * Serializes a Redis command. - * - * @param CommandInterface $command Redis command. - * - * @return string - */ - public function serialize(CommandInterface $command); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ResponseReaderInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ResponseReaderInterface.php deleted file mode 100644 index 86a7bdcce8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/ResponseReaderInterface.php +++ /dev/null @@ -1,32 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol; - -use Predis\Connection\CompositeConnectionInterface; - -/** - * Defines a pluggable reader capable of parsing responses returned by Redis and - * deserializing them to PHP objects. - * - * @author Daniele Alessandri - */ -interface ResponseReaderInterface -{ - /** - * Reads a response from a connection to Redis. - * - * @param CompositeConnectionInterface $connection Redis connection. - * - * @return mixed - */ - public function read(CompositeConnectionInterface $connection); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/CompositeProtocolProcessor.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/CompositeProtocolProcessor.php deleted file mode 100644 index ea85ed3039..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/CompositeProtocolProcessor.php +++ /dev/null @@ -1,107 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text; - -use Predis\Command\CommandInterface; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolProcessorInterface; -use Predis\Protocol\RequestSerializerInterface; -use Predis\Protocol\ResponseReaderInterface; - -/** - * Composite protocol processor for the standard Redis wire protocol using - * pluggable handlers to serialize requests and deserialize responses. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class CompositeProtocolProcessor implements ProtocolProcessorInterface -{ - /* - * @var RequestSerializerInterface - */ - protected $serializer; - - /* - * @var ResponseReaderInterface - */ - protected $reader; - - /** - * @param RequestSerializerInterface $serializer Request serializer. - * @param ResponseReaderInterface $reader Response reader. - */ - public function __construct( - RequestSerializerInterface $serializer = null, - ResponseReaderInterface $reader = null - ) { - $this->setRequestSerializer($serializer ?: new RequestSerializer()); - $this->setResponseReader($reader ?: new ResponseReader()); - } - - /** - * {@inheritdoc} - */ - public function write(CompositeConnectionInterface $connection, CommandInterface $command) - { - $connection->writeBuffer($this->serializer->serialize($command)); - } - - /** - * {@inheritdoc} - */ - public function read(CompositeConnectionInterface $connection) - { - return $this->reader->read($connection); - } - - /** - * Sets the request serializer used by the protocol processor. - * - * @param RequestSerializerInterface $serializer Request serializer. - */ - public function setRequestSerializer(RequestSerializerInterface $serializer) - { - $this->serializer = $serializer; - } - - /** - * Returns the request serializer used by the protocol processor. - * - * @return RequestSerializerInterface - */ - public function getRequestSerializer() - { - return $this->serializer; - } - - /** - * Sets the response reader used by the protocol processor. - * - * @param ResponseReaderInterface $reader Response reader. - */ - public function setResponseReader(ResponseReaderInterface $reader) - { - $this->reader = $reader; - } - - /** - * Returns the Response reader used by the protocol processor. - * - * @return ResponseReaderInterface - */ - public function getResponseReader() - { - return $this->reader; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/BulkResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/BulkResponse.php deleted file mode 100644 index 5b0bf3c2d1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/BulkResponse.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; - -/** - * Handler for the bulk response type in the standard Redis wire protocol. - * It translates the payload to a string or a NULL. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class BulkResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - $length = (int) $payload; - - if ("$length" !== $payload) { - CommunicationException::handle(new ProtocolException( - $connection, "Cannot parse '$payload' as a valid length for a bulk response." - )); - } - - if ($length >= 0) { - return substr($connection->readBuffer($length + 2), 0, -2); - } - - if ($length == -1) { - return; - } - - CommunicationException::handle(new ProtocolException( - $connection, "Value '$payload' is not a valid length for a bulk response." - )); - - return; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ErrorResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ErrorResponse.php deleted file mode 100644 index 3e18b7b9e9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ErrorResponse.php +++ /dev/null @@ -1,34 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\Connection\CompositeConnectionInterface; -use Predis\Response\Error; - -/** - * Handler for the error response type in the standard Redis wire protocol. - * It translates the payload to a complex response object for Predis. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class ErrorResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - return new Error($payload); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/IntegerResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/IntegerResponse.php deleted file mode 100644 index 4639d7792f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/IntegerResponse.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; - -/** - * Handler for the integer response type in the standard Redis wire protocol. - * It translates the payload an integer or NULL. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class IntegerResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - if (is_numeric($payload)) { - return (int) $payload; - } - - if ($payload !== 'nil') { - CommunicationException::handle(new ProtocolException( - $connection, "Cannot parse '$payload' as a valid numeric response." - )); - } - - return; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/MultiBulkResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/MultiBulkResponse.php deleted file mode 100644 index 820b9b4a6f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/MultiBulkResponse.php +++ /dev/null @@ -1,68 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; - -/** - * Handler for the multibulk response type in the standard Redis wire protocol. - * It returns multibulk responses as PHP arrays. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class MultiBulkResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - $length = (int) $payload; - - if ("$length" !== $payload) { - CommunicationException::handle(new ProtocolException( - $connection, "Cannot parse '$payload' as a valid length of a multi-bulk response." - )); - } - - if ($length === -1) { - return; - } - - $list = array(); - - if ($length > 0) { - $handlersCache = array(); - $reader = $connection->getProtocol()->getResponseReader(); - - for ($i = 0; $i < $length; ++$i) { - $header = $connection->readLine(); - $prefix = $header[0]; - - if (isset($handlersCache[$prefix])) { - $handler = $handlersCache[$prefix]; - } else { - $handler = $reader->getHandler($prefix); - $handlersCache[$prefix] = $handler; - } - - $list[$i] = $handler->handle($connection, substr($header, 1)); - } - } - - return $list; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php deleted file mode 100644 index ca08a9c538..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/ResponseHandlerInterface.php +++ /dev/null @@ -1,33 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\Connection\CompositeConnectionInterface; - -/** - * Defines a pluggable handler used to parse a particular type of response. - * - * @author Daniele Alessandri - */ -interface ResponseHandlerInterface -{ - /** - * Deserializes a response returned by Redis and reads more data from the - * connection if needed. - * - * @param CompositeConnectionInterface $connection Redis connection. - * @param string $payload String payload. - * - * @return mixed - */ - public function handle(CompositeConnectionInterface $connection, $payload); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StatusResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StatusResponse.php deleted file mode 100644 index 7bde5558f2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StatusResponse.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\Connection\CompositeConnectionInterface; -use Predis\Response\Status; - -/** - * Handler for the status response type in the standard Redis wire protocol. It - * translates certain classes of status response to PHP objects or just returns - * the payload as a string. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class StatusResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - return Status::get($payload); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php deleted file mode 100644 index 7cdb736af3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/Handler/StreamableMultiBulkResponse.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text\Handler; - -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; -use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; - -/** - * Handler for the multibulk response type in the standard Redis wire protocol. - * It returns multibulk responses as iterators that can stream bulk elements. - * - * Streamable multibulk responses are not globally supported by the abstractions - * built-in into Predis, such as transactions or pipelines. Use them with care! - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class StreamableMultiBulkResponse implements ResponseHandlerInterface -{ - /** - * {@inheritdoc} - */ - public function handle(CompositeConnectionInterface $connection, $payload) - { - $length = (int) $payload; - - if ("$length" != $payload) { - CommunicationException::handle(new ProtocolException( - $connection, "Cannot parse '$payload' as a valid length for a multi-bulk response." - )); - } - - return new MultiBulkIterator($connection, $length); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ProtocolProcessor.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ProtocolProcessor.php deleted file mode 100644 index f04c3ed5bb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ProtocolProcessor.php +++ /dev/null @@ -1,122 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text; - -use Predis\Command\CommandInterface; -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; -use Predis\Protocol\ProtocolProcessorInterface; -use Predis\Response\Error as ErrorResponse; -use Predis\Response\Iterator\MultiBulk as MultiBulkIterator; -use Predis\Response\Status as StatusResponse; - -/** - * Protocol processor for the standard Redis wire protocol. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class ProtocolProcessor implements ProtocolProcessorInterface -{ - protected $mbiterable; - protected $serializer; - - /** - * - */ - public function __construct() - { - $this->mbiterable = false; - $this->serializer = new RequestSerializer(); - } - - /** - * {@inheritdoc} - */ - public function write(CompositeConnectionInterface $connection, CommandInterface $command) - { - $request = $this->serializer->serialize($command); - $connection->writeBuffer($request); - } - - /** - * {@inheritdoc} - */ - public function read(CompositeConnectionInterface $connection) - { - $chunk = $connection->readLine(); - $prefix = $chunk[0]; - $payload = substr($chunk, 1); - - switch ($prefix) { - case '+': - return new StatusResponse($payload); - - case '$': - $size = (int) $payload; - if ($size === -1) { - return; - } - - return substr($connection->readBuffer($size + 2), 0, -2); - - case '*': - $count = (int) $payload; - - if ($count === -1) { - return; - } - if ($this->mbiterable) { - return new MultiBulkIterator($connection, $count); - } - - $multibulk = array(); - - for ($i = 0; $i < $count; ++$i) { - $multibulk[$i] = $this->read($connection); - } - - return $multibulk; - - case ':': - return (int) $payload; - - case '-': - return new ErrorResponse($payload); - - default: - CommunicationException::handle(new ProtocolException( - $connection, "Unknown response prefix: '$prefix'." - )); - - return; - } - } - - /** - * Enables or disables returning multibulk responses as specialized PHP - * iterators used to stream bulk elements of a multibulk response instead - * returning a plain array. - * - * Streamable multibulk responses are not globally supported by the - * abstractions built-in into Predis, such as transactions or pipelines. - * Use them with care! - * - * @param bool $value Enable or disable streamable multibulk responses. - */ - public function useIterableMultibulk($value) - { - $this->mbiterable = (bool) $value; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/RequestSerializer.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/RequestSerializer.php deleted file mode 100644 index c8cbbfbcd1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/RequestSerializer.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text; - -use Predis\Command\CommandInterface; -use Predis\Protocol\RequestSerializerInterface; - -/** - * Request serializer for the standard Redis wire protocol. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class RequestSerializer implements RequestSerializerInterface -{ - /** - * {@inheritdoc} - */ - public function serialize(CommandInterface $command) - { - $commandID = $command->getId(); - $arguments = $command->getArguments(); - - $cmdlen = strlen($commandID); - $reqlen = count($arguments) + 1; - - $buffer = "*{$reqlen}\r\n\${$cmdlen}\r\n{$commandID}\r\n"; - - for ($i = 0, $reqlen--; $i < $reqlen; ++$i) { - $argument = $arguments[$i]; - $arglen = strlen($argument); - $buffer .= "\${$arglen}\r\n{$argument}\r\n"; - } - - return $buffer; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ResponseReader.php b/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ResponseReader.php deleted file mode 100644 index d96218dfa4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Protocol/Text/ResponseReader.php +++ /dev/null @@ -1,116 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Protocol\Text; - -use Predis\CommunicationException; -use Predis\Connection\CompositeConnectionInterface; -use Predis\Protocol\ProtocolException; -use Predis\Protocol\ResponseReaderInterface; - -/** - * Response reader for the standard Redis wire protocol. - * - * @link http://redis.io/topics/protocol - * - * @author Daniele Alessandri - */ -class ResponseReader implements ResponseReaderInterface -{ - protected $handlers; - - /** - * - */ - public function __construct() - { - $this->handlers = $this->getDefaultHandlers(); - } - - /** - * Returns the default handlers for the supported type of responses. - * - * @return array - */ - protected function getDefaultHandlers() - { - return array( - '+' => new Handler\StatusResponse(), - '-' => new Handler\ErrorResponse(), - ':' => new Handler\IntegerResponse(), - '$' => new Handler\BulkResponse(), - '*' => new Handler\MultiBulkResponse(), - ); - } - - /** - * Sets the handler for the specified prefix identifying the response type. - * - * @param string $prefix Identifier of the type of response. - * @param Handler\ResponseHandlerInterface $handler Response handler. - */ - public function setHandler($prefix, Handler\ResponseHandlerInterface $handler) - { - $this->handlers[$prefix] = $handler; - } - - /** - * Returns the response handler associated to a certain type of response. - * - * @param string $prefix Identifier of the type of response. - * - * @return Handler\ResponseHandlerInterface - */ - public function getHandler($prefix) - { - if (isset($this->handlers[$prefix])) { - return $this->handlers[$prefix]; - } - - return; - } - - /** - * {@inheritdoc} - */ - public function read(CompositeConnectionInterface $connection) - { - $header = $connection->readLine(); - - if ($header === '') { - $this->onProtocolError($connection, 'Unexpected empty reponse header.'); - } - - $prefix = $header[0]; - - if (!isset($this->handlers[$prefix])) { - $this->onProtocolError($connection, "Unknown response prefix: '$prefix'."); - } - - $payload = $this->handlers[$prefix]->handle($connection, substr($header, 1)); - - return $payload; - } - - /** - * Handles protocol errors generated while reading responses from a - * connection. - * - * @param CompositeConnectionInterface $connection Redis connection that generated the error. - * @param string $message Error message. - */ - protected function onProtocolError(CompositeConnectionInterface $connection, $message) - { - CommunicationException::handle( - new ProtocolException($connection, $message) - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/AbstractConsumer.php b/rainloop/v/0.0.0/app/libraries/Predis/PubSub/AbstractConsumer.php deleted file mode 100644 index d7423f1e30..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/AbstractConsumer.php +++ /dev/null @@ -1,219 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\PubSub; - -/** - * Base implementation of a PUB/SUB consumer abstraction based on PHP iterators. - * - * @author Daniele Alessandri - */ -abstract class AbstractConsumer implements \Iterator -{ - const SUBSCRIBE = 'subscribe'; - const UNSUBSCRIBE = 'unsubscribe'; - const PSUBSCRIBE = 'psubscribe'; - const PUNSUBSCRIBE = 'punsubscribe'; - const MESSAGE = 'message'; - const PMESSAGE = 'pmessage'; - const PONG = 'pong'; - - const STATUS_VALID = 1; // 0b0001 - const STATUS_SUBSCRIBED = 2; // 0b0010 - const STATUS_PSUBSCRIBED = 4; // 0b0100 - - private $position = null; - private $statusFlags = self::STATUS_VALID; - - /** - * Automatically stops the consumer when the garbage collector kicks in. - */ - public function __destruct() - { - $this->stop(true); - } - - /** - * Checks if the specified flag is valid based on the state of the consumer. - * - * @param int $value Flag. - * - * @return bool - */ - protected function isFlagSet($value) - { - return ($this->statusFlags & $value) === $value; - } - - /** - * Subscribes to the specified channels. - * - * @param mixed $channel,... One or more channel names. - */ - public function subscribe($channel /*, ... */) - { - $this->writeRequest(self::SUBSCRIBE, func_get_args()); - $this->statusFlags |= self::STATUS_SUBSCRIBED; - } - - /** - * Unsubscribes from the specified channels. - * - * @param string ... One or more channel names. - */ - public function unsubscribe(/* ... */) - { - $this->writeRequest(self::UNSUBSCRIBE, func_get_args()); - } - - /** - * Subscribes to the specified channels using a pattern. - * - * @param mixed $pattern,... One or more channel name patterns. - */ - public function psubscribe($pattern /* ... */) - { - $this->writeRequest(self::PSUBSCRIBE, func_get_args()); - $this->statusFlags |= self::STATUS_PSUBSCRIBED; - } - - /** - * Unsubscribes from the specified channels using a pattern. - * - * @param string ... One or more channel name patterns. - */ - public function punsubscribe(/* ... */) - { - $this->writeRequest(self::PUNSUBSCRIBE, func_get_args()); - } - - /** - * PING the server with an optional payload that will be echoed as a - * PONG message in the pub/sub loop. - * - * @param string $payload Optional PING payload. - */ - public function ping($payload = null) - { - $this->writeRequest('PING', array($payload)); - } - - /** - * Closes the context by unsubscribing from all the subscribed channels. The - * context can be forcefully closed by dropping the underlying connection. - * - * @param bool $drop Indicates if the context should be closed by dropping the connection. - * - * @return bool Returns false when there are no pending messages. - */ - public function stop($drop = false) - { - if (!$this->valid()) { - return false; - } - - if ($drop) { - $this->invalidate(); - $this->disconnect(); - } else { - if ($this->isFlagSet(self::STATUS_SUBSCRIBED)) { - $this->unsubscribe(); - } - if ($this->isFlagSet(self::STATUS_PSUBSCRIBED)) { - $this->punsubscribe(); - } - } - - return !$drop; - } - - /** - * Closes the underlying connection when forcing a disconnection. - */ - abstract protected function disconnect(); - - /** - * Writes a Redis command on the underlying connection. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - */ - abstract protected function writeRequest($method, $arguments); - - /** - * {@inheritdoc} - */ - public function rewind() - { - // NOOP - } - - /** - * Returns the last message payload retrieved from the server and generated - * by one of the active subscriptions. - * - * @return array - */ - public function current() - { - return $this->getValue(); - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - public function next() - { - if ($this->valid()) { - ++$this->position; - } - - return $this->position; - } - - /** - * Checks if the the consumer is still in a valid state to continue. - * - * @return bool - */ - public function valid() - { - $isValid = $this->isFlagSet(self::STATUS_VALID); - $subscriptionFlags = self::STATUS_SUBSCRIBED | self::STATUS_PSUBSCRIBED; - $hasSubscriptions = ($this->statusFlags & $subscriptionFlags) > 0; - - return $isValid && $hasSubscriptions; - } - - /** - * Resets the state of the consumer. - */ - protected function invalidate() - { - $this->statusFlags = 0; // 0b0000; - } - - /** - * Waits for a new message from the server generated by one of the active - * subscriptions and returns it when available. - * - * @return array - */ - abstract protected function getValue(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/Consumer.php b/rainloop/v/0.0.0/app/libraries/Predis/PubSub/Consumer.php deleted file mode 100644 index 5f2d8a8bc4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/Consumer.php +++ /dev/null @@ -1,158 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\PubSub; - -use Predis\ClientException; -use Predis\ClientInterface; -use Predis\Command\Command; -use Predis\Connection\AggregateConnectionInterface; -use Predis\NotSupportedException; - -/** - * PUB/SUB consumer abstraction. - * - * @author Daniele Alessandri - */ -class Consumer extends AbstractConsumer -{ - private $client; - private $options; - - /** - * @param ClientInterface $client Client instance used by the consumer. - * @param array $options Options for the consumer initialization. - */ - public function __construct(ClientInterface $client, array $options = null) - { - $this->checkCapabilities($client); - - $this->options = $options ?: array(); - $this->client = $client; - - $this->genericSubscribeInit('subscribe'); - $this->genericSubscribeInit('psubscribe'); - } - - /** - * Returns the underlying client instance used by the pub/sub iterator. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Checks if the client instance satisfies the required conditions needed to - * initialize a PUB/SUB consumer. - * - * @param ClientInterface $client Client instance used by the consumer. - * - * @throws NotSupportedException - */ - private function checkCapabilities(ClientInterface $client) - { - if ($client->getConnection() instanceof AggregateConnectionInterface) { - throw new NotSupportedException( - 'Cannot initialize a PUB/SUB consumer over aggregate connections.' - ); - } - - $commands = array('publish', 'subscribe', 'unsubscribe', 'psubscribe', 'punsubscribe'); - - if ($client->getProfile()->supportsCommands($commands) === false) { - throw new NotSupportedException( - 'The current profile does not support PUB/SUB related commands.' - ); - } - } - - /** - * This method shares the logic to handle both SUBSCRIBE and PSUBSCRIBE. - * - * @param string $subscribeAction Type of subscription. - */ - private function genericSubscribeInit($subscribeAction) - { - if (isset($this->options[$subscribeAction])) { - $this->$subscribeAction($this->options[$subscribeAction]); - } - } - - /** - * {@inheritdoc} - */ - protected function writeRequest($method, $arguments) - { - $this->client->getConnection()->writeRequest( - $this->client->createCommand($method, - Command::normalizeArguments($arguments) - ) - ); - } - - /** - * {@inheritdoc} - */ - protected function disconnect() - { - $this->client->disconnect(); - } - - /** - * {@inheritdoc} - */ - protected function getValue() - { - $response = $this->client->getConnection()->read(); - - switch ($response[0]) { - case self::SUBSCRIBE: - case self::UNSUBSCRIBE: - case self::PSUBSCRIBE: - case self::PUNSUBSCRIBE: - if ($response[2] === 0) { - $this->invalidate(); - } - // The missing break here is intentional as we must process - // subscriptions and unsubscriptions as standard messages. - // no break - - case self::MESSAGE: - return (object) array( - 'kind' => $response[0], - 'channel' => $response[1], - 'payload' => $response[2], - ); - - case self::PMESSAGE: - return (object) array( - 'kind' => $response[0], - 'pattern' => $response[1], - 'channel' => $response[2], - 'payload' => $response[3], - ); - - case self::PONG: - return (object) array( - 'kind' => $response[0], - 'payload' => $response[1], - ); - - default: - throw new ClientException( - "Unknown message type '{$response[0]}' received in the PUB/SUB context." - ); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/DispatcherLoop.php b/rainloop/v/0.0.0/app/libraries/Predis/PubSub/DispatcherLoop.php deleted file mode 100644 index 0d4a08ef72..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/PubSub/DispatcherLoop.php +++ /dev/null @@ -1,170 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\PubSub; - -/** - * Method-dispatcher loop built around the client-side abstraction of a Redis - * PUB / SUB context. - * - * @author Daniele Alessandri - */ -class DispatcherLoop -{ - private $pubsub; - - protected $callbacks; - protected $defaultCallback; - protected $subscriptionCallback; - - /** - * @param Consumer $pubsub PubSub consumer instance used by the loop. - */ - public function __construct(Consumer $pubsub) - { - $this->callbacks = array(); - $this->pubsub = $pubsub; - } - - /** - * Checks if the passed argument is a valid callback. - * - * @param mixed $callable A callback. - * - * @throws \InvalidArgumentException - */ - protected function assertCallback($callable) - { - if (!is_callable($callable)) { - throw new \InvalidArgumentException('The given argument must be a callable object.'); - } - } - - /** - * Returns the underlying PUB / SUB context. - * - * @return Consumer - */ - public function getPubSubConsumer() - { - return $this->pubsub; - } - - /** - * Sets a callback that gets invoked upon new subscriptions. - * - * @param mixed $callable A callback. - */ - public function subscriptionCallback($callable = null) - { - if (isset($callable)) { - $this->assertCallback($callable); - } - - $this->subscriptionCallback = $callable; - } - - /** - * Sets a callback that gets invoked when a message is received on a - * channel that does not have an associated callback. - * - * @param mixed $callable A callback. - */ - public function defaultCallback($callable = null) - { - if (isset($callable)) { - $this->assertCallback($callable); - } - - $this->subscriptionCallback = $callable; - } - - /** - * Binds a callback to a channel. - * - * @param string $channel Channel name. - * @param Callable $callback A callback. - */ - public function attachCallback($channel, $callback) - { - $callbackName = $this->getPrefixKeys().$channel; - - $this->assertCallback($callback); - $this->callbacks[$callbackName] = $callback; - $this->pubsub->subscribe($channel); - } - - /** - * Stops listening to a channel and removes the associated callback. - * - * @param string $channel Redis channel. - */ - public function detachCallback($channel) - { - $callbackName = $this->getPrefixKeys().$channel; - - if (isset($this->callbacks[$callbackName])) { - unset($this->callbacks[$callbackName]); - $this->pubsub->unsubscribe($channel); - } - } - - /** - * Starts the dispatcher loop. - */ - public function run() - { - foreach ($this->pubsub as $message) { - $kind = $message->kind; - - if ($kind !== Consumer::MESSAGE && $kind !== Consumer::PMESSAGE) { - if (isset($this->subscriptionCallback)) { - $callback = $this->subscriptionCallback; - call_user_func($callback, $message); - } - - continue; - } - - if (isset($this->callbacks[$message->channel])) { - $callback = $this->callbacks[$message->channel]; - call_user_func($callback, $message->payload); - } elseif (isset($this->defaultCallback)) { - $callback = $this->defaultCallback; - call_user_func($callback, $message); - } - } - } - - /** - * Terminates the dispatcher loop. - */ - public function stop() - { - $this->pubsub->stop(); - } - - /** - * Return the prefix used for keys. - * - * @return string - */ - protected function getPrefixKeys() - { - $options = $this->pubsub->getClient()->getOptions(); - - if (isset($options->prefix)) { - return $options->prefix->getPrefix(); - } - - return ''; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Replication/ReplicationStrategy.php b/rainloop/v/0.0.0/app/libraries/Predis/Replication/ReplicationStrategy.php deleted file mode 100644 index 0b76940546..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Replication/ReplicationStrategy.php +++ /dev/null @@ -1,237 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Replication; - -use Predis\Command\CommandInterface; -use Predis\NotSupportedException; - -/** - * Defines a strategy for master/slave replication. - * - * @author Daniele Alessandri - */ -class ReplicationStrategy -{ - protected $disallowed; - protected $readonly; - protected $readonlySHA1; - - /** - * - */ - public function __construct() - { - $this->disallowed = $this->getDisallowedOperations(); - $this->readonly = $this->getReadOnlyOperations(); - $this->readonlySHA1 = array(); - } - - /** - * Returns if the specified command will perform a read-only operation - * on Redis or not. - * - * @param CommandInterface $command Command instance. - * - * @throws NotSupportedException - * - * @return bool - */ - public function isReadOperation(CommandInterface $command) - { - if (isset($this->disallowed[$id = $command->getId()])) { - throw new NotSupportedException( - "The command '$id' is not allowed in replication mode." - ); - } - - if (isset($this->readonly[$id])) { - if (true === $readonly = $this->readonly[$id]) { - return true; - } - - return call_user_func($readonly, $command); - } - - if (($eval = $id === 'EVAL') || $id === 'EVALSHA') { - $sha1 = $eval ? sha1($command->getArgument(0)) : $command->getArgument(0); - - if (isset($this->readonlySHA1[$sha1])) { - if (true === $readonly = $this->readonlySHA1[$sha1]) { - return true; - } - - return call_user_func($readonly, $command); - } - } - - return false; - } - - /** - * Returns if the specified command is not allowed for execution in a master - * / slave replication context. - * - * @param CommandInterface $command Command instance. - * - * @return bool - */ - public function isDisallowedOperation(CommandInterface $command) - { - return isset($this->disallowed[$command->getId()]); - } - - /** - * Checks if a SORT command is a readable operation by parsing the arguments - * array of the specified commad instance. - * - * @param CommandInterface $command Command instance. - * - * @return bool - */ - protected function isSortReadOnly(CommandInterface $command) - { - $arguments = $command->getArguments(); - - return ($c = count($arguments)) === 1 ? true : $arguments[$c - 2] !== 'STORE'; - } - - /** - * Marks a command as a read-only operation. - * - * When the behavior of a command can be decided only at runtime depending - * on its arguments, a callable object can be provided to dynamically check - * if the specified command performs a read or a write operation. - * - * @param string $commandID Command ID. - * @param mixed $readonly A boolean value or a callable object. - */ - public function setCommandReadOnly($commandID, $readonly = true) - { - $commandID = strtoupper($commandID); - - if ($readonly) { - $this->readonly[$commandID] = $readonly; - } else { - unset($this->readonly[$commandID]); - } - } - - /** - * Marks a Lua script for EVAL and EVALSHA as a read-only operation. When - * the behaviour of a script can be decided only at runtime depending on - * its arguments, a callable object can be provided to dynamically check - * if the passed instance of EVAL or EVALSHA performs write operations or - * not. - * - * @param string $script Body of the Lua script. - * @param mixed $readonly A boolean value or a callable object. - */ - public function setScriptReadOnly($script, $readonly = true) - { - $sha1 = sha1($script); - - if ($readonly) { - $this->readonlySHA1[$sha1] = $readonly; - } else { - unset($this->readonlySHA1[$sha1]); - } - } - - /** - * Returns the default list of disallowed commands. - * - * @return array - */ - protected function getDisallowedOperations() - { - return array( - 'SHUTDOWN' => true, - 'INFO' => true, - 'DBSIZE' => true, - 'LASTSAVE' => true, - 'CONFIG' => true, - 'MONITOR' => true, - 'SLAVEOF' => true, - 'SAVE' => true, - 'BGSAVE' => true, - 'BGREWRITEAOF' => true, - 'SLOWLOG' => true, - ); - } - - /** - * Returns the default list of commands performing read-only operations. - * - * @return array - */ - protected function getReadOnlyOperations() - { - return array( - 'EXISTS' => true, - 'TYPE' => true, - 'KEYS' => true, - 'SCAN' => true, - 'RANDOMKEY' => true, - 'TTL' => true, - 'GET' => true, - 'MGET' => true, - 'SUBSTR' => true, - 'STRLEN' => true, - 'GETRANGE' => true, - 'GETBIT' => true, - 'LLEN' => true, - 'LRANGE' => true, - 'LINDEX' => true, - 'SCARD' => true, - 'SISMEMBER' => true, - 'SINTER' => true, - 'SUNION' => true, - 'SDIFF' => true, - 'SMEMBERS' => true, - 'SSCAN' => true, - 'SRANDMEMBER' => true, - 'ZRANGE' => true, - 'ZREVRANGE' => true, - 'ZRANGEBYSCORE' => true, - 'ZREVRANGEBYSCORE' => true, - 'ZCARD' => true, - 'ZSCORE' => true, - 'ZCOUNT' => true, - 'ZRANK' => true, - 'ZREVRANK' => true, - 'ZSCAN' => true, - 'ZLEXCOUNT' => true, - 'ZRANGEBYLEX' => true, - 'ZREVRANGEBYLEX' => true, - 'HGET' => true, - 'HMGET' => true, - 'HEXISTS' => true, - 'HLEN' => true, - 'HKEYS' => true, - 'HVALS' => true, - 'HGETALL' => true, - 'HSCAN' => true, - 'HSTRLEN' => true, - 'PING' => true, - 'AUTH' => true, - 'SELECT' => true, - 'ECHO' => true, - 'QUIT' => true, - 'OBJECT' => true, - 'BITCOUNT' => true, - 'BITPOS' => true, - 'TIME' => true, - 'PFCOUNT' => true, - 'SORT' => array($this, 'isSortReadOnly'), - ); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/Error.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/Error.php deleted file mode 100644 index 3933857e23..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/Error.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response; - -/** - * Represents an error returned by Redis (-ERR responses) during the execution - * of a command on the server. - * - * @author Daniele Alessandri - */ -class Error implements ErrorInterface -{ - private $message; - - /** - * @param string $message Error message returned by Redis - */ - public function __construct($message) - { - $this->message = $message; - } - - /** - * {@inheritdoc} - */ - public function getMessage() - { - return $this->message; - } - - /** - * {@inheritdoc} - */ - public function getErrorType() - { - list($errorType) = explode(' ', $this->getMessage(), 2); - - return $errorType; - } - - /** - * Converts the object to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->getMessage(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/ErrorInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/ErrorInterface.php deleted file mode 100644 index a4a4a02f79..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/ErrorInterface.php +++ /dev/null @@ -1,35 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response; - -/** - * Represents an error returned by Redis (responses identified by "-" in the - * Redis protocol) during the execution of an operation on the server. - * - * @author Daniele Alessandri - */ -interface ErrorInterface extends ResponseInterface -{ - /** - * Returns the error message. - * - * @return string - */ - public function getMessage(); - - /** - * Returns the error type (e.g. ERR, ASK, MOVED). - * - * @return string - */ - public function getErrorType(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulk.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulk.php deleted file mode 100644 index b1d29241c7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulk.php +++ /dev/null @@ -1,77 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response\Iterator; - -use Predis\Connection\NodeConnectionInterface; - -/** - * Streamable multibulk response. - * - * @author Daniele Alessandri - */ -class MultiBulk extends MultiBulkIterator -{ - private $connection; - - /** - * @param NodeConnectionInterface $connection Connection to Redis. - * @param int $size Number of elements of the multibulk response. - */ - public function __construct(NodeConnectionInterface $connection, $size) - { - $this->connection = $connection; - $this->size = $size; - $this->position = 0; - $this->current = $size > 0 ? $this->getValue() : null; - } - - /** - * Handles the synchronization of the client with the Redis protocol when - * the garbage collector kicks in (e.g. when the iterator goes out of the - * scope of a foreach or it is unset). - */ - public function __destruct() - { - $this->drop(true); - } - - /** - * Drop queued elements that have not been read from the connection either - * by consuming the rest of the multibulk response or quickly by closing the - * underlying connection. - * - * @param bool $disconnect Consume the iterator or drop the connection. - */ - public function drop($disconnect = false) - { - if ($disconnect) { - if ($this->valid()) { - $this->position = $this->size; - $this->connection->disconnect(); - } - } else { - while ($this->valid()) { - $this->next(); - } - } - } - - /** - * Reads the next item of the multibulk response from the connection. - * - * @return mixed - */ - protected function getValue() - { - return $this->connection->read(); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkIterator.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkIterator.php deleted file mode 100644 index 5d328869b4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkIterator.php +++ /dev/null @@ -1,104 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response\Iterator; - -use Predis\Response\ResponseInterface; - -/** - * Iterator that abstracts the access to multibulk responses allowing them to be - * consumed in a streamable fashion without keeping the whole payload in memory. - * - * This iterator does not support rewinding which means that the iteration, once - * consumed, cannot be restarted. - * - * Always make sure that the whole iteration is consumed (or dropped) to prevent - * protocol desynchronization issues. - * - * @author Daniele Alessandri - */ -abstract class MultiBulkIterator implements \Iterator, \Countable, ResponseInterface -{ - protected $current; - protected $position; - protected $size; - - /** - * {@inheritdoc} - */ - public function rewind() - { - // NOOP - } - - /** - * {@inheritdoc} - */ - public function current() - { - return $this->current; - } - - /** - * {@inheritdoc} - */ - public function key() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - public function next() - { - if (++$this->position < $this->size) { - $this->current = $this->getValue(); - } - } - - /** - * {@inheritdoc} - */ - public function valid() - { - return $this->position < $this->size; - } - - /** - * Returns the number of items comprising the whole multibulk response. - * - * This method should be used instead of iterator_count() to get the size of - * the current multibulk response since the former consumes the iteration to - * count the number of elements, but our iterators do not support rewinding. - * - * @return int - */ - public function count() - { - return $this->size; - } - - /** - * Returns the current position of the iterator. - * - * @return int - */ - public function getPosition() - { - return $this->position; - } - - /** - * {@inheritdoc} - */ - abstract protected function getValue(); -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkTuple.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkTuple.php deleted file mode 100644 index 2b6f593c46..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/Iterator/MultiBulkTuple.php +++ /dev/null @@ -1,90 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response\Iterator; - -/** - * Outer iterator consuming streamable multibulk responses by yielding tuples of - * keys and values. - * - * This wrapper is useful for responses to commands such as `HGETALL` that can - * be iterater as $key => $value pairs. - * - * @author Daniele Alessandri - */ -class MultiBulkTuple extends MultiBulk implements \OuterIterator -{ - private $iterator; - - /** - * @param MultiBulk $iterator Inner multibulk response iterator. - */ - public function __construct(MultiBulk $iterator) - { - $this->checkPreconditions($iterator); - - $this->size = count($iterator) / 2; - $this->iterator = $iterator; - $this->position = $iterator->getPosition(); - $this->current = $this->size > 0 ? $this->getValue() : null; - } - - /** - * Checks for valid preconditions. - * - * @param MultiBulk $iterator Inner multibulk response iterator. - * - * @throws \InvalidArgumentException - * @throws \UnexpectedValueException - */ - protected function checkPreconditions(MultiBulk $iterator) - { - if ($iterator->getPosition() !== 0) { - throw new \InvalidArgumentException( - 'Cannot initialize a tuple iterator using an already initiated iterator.' - ); - } - - if (($size = count($iterator)) % 2 !== 0) { - throw new \UnexpectedValueException('Invalid response size for a tuple iterator.'); - } - } - - /** - * {@inheritdoc} - */ - public function getInnerIterator() - { - return $this->iterator; - } - - /** - * {@inheritdoc} - */ - public function __destruct() - { - $this->iterator->drop(true); - } - - /** - * {@inheritdoc} - */ - protected function getValue() - { - $k = $this->iterator->current(); - $this->iterator->next(); - - $v = $this->iterator->current(); - $this->iterator->next(); - - return array($k, $v); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/ResponseInterface.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/ResponseInterface.php deleted file mode 100644 index 0af1357453..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/ResponseInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response; - -/** - * Represents a complex response object from Redis. - * - * @author Daniele Alessandri - */ -interface ResponseInterface -{ -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/ServerException.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/ServerException.php deleted file mode 100644 index 407dc5b764..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/ServerException.php +++ /dev/null @@ -1,44 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response; - -use Predis\PredisException; - -/** - * Exception class that identifies server-side Redis errors. - * - * @author Daniele Alessandri - */ -class ServerException extends PredisException implements ErrorInterface -{ - /** - * Gets the type of the error returned by Redis. - * - * @return string - */ - public function getErrorType() - { - list($errorType) = explode(' ', $this->getMessage(), 2); - - return $errorType; - } - - /** - * Converts the exception to an instance of Predis\Response\Error. - * - * @return Error - */ - public function toErrorResponse() - { - return new Error($this->getMessage()); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Response/Status.php b/rainloop/v/0.0.0/app/libraries/Predis/Response/Status.php deleted file mode 100644 index 729bb66354..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Response/Status.php +++ /dev/null @@ -1,79 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Response; - -/** - * Represents a status response returned by Redis. - * - * @author Daniele Alessandri - */ -class Status implements ResponseInterface -{ - private static $OK; - private static $QUEUED; - - private $payload; - - /** - * @param string $payload Payload of the status response as returned by Redis. - */ - public function __construct($payload) - { - $this->payload = $payload; - } - - /** - * Converts the response object to its string representation. - * - * @return string - */ - public function __toString() - { - return $this->payload; - } - - /** - * Returns the payload of status response. - * - * @return string - */ - public function getPayload() - { - return $this->payload; - } - - /** - * Returns an instance of a status response object. - * - * Common status responses such as OK or QUEUED are cached in order to lower - * the global memory usage especially when using pipelines. - * - * @param string $payload Status response payload. - * - * @return string - */ - public static function get($payload) - { - switch ($payload) { - case 'OK': - case 'QUEUED': - if (isset(self::$$payload)) { - return self::$$payload; - } - - return self::$$payload = new self($payload); - - default: - return new self($payload); - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Session/Handler.php b/rainloop/v/0.0.0/app/libraries/Predis/Session/Handler.php deleted file mode 100644 index cecb9d5395..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Session/Handler.php +++ /dev/null @@ -1,142 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Session; - -use Predis\ClientInterface; - -/** - * Session handler class that relies on Predis\Client to store PHP's sessions - * data into one or multiple Redis servers. - * - * This class is mostly intended for PHP 5.4 but it can be used under PHP 5.3 - * provided that a polyfill for `SessionHandlerInterface` is defined by either - * you or an external package such as `symfony/http-foundation`. - * - * @author Daniele Alessandri - */ -class Handler implements \SessionHandlerInterface -{ - protected $client; - protected $ttl; - - /** - * @param ClientInterface $client Fully initialized client instance. - * @param array $options Session handler options. - */ - public function __construct(ClientInterface $client, array $options = array()) - { - $this->client = $client; - - if (isset($options['gc_maxlifetime'])) { - $this->ttl = (int) $options['gc_maxlifetime']; - } else { - $this->ttl = ini_get('session.gc_maxlifetime'); - } - } - - /** - * Registers this instance as the current session handler. - */ - public function register() - { - if (PHP_VERSION_ID >= 50400) { - session_set_save_handler($this, true); - } else { - session_set_save_handler( - array($this, 'open'), - array($this, 'close'), - array($this, 'read'), - array($this, 'write'), - array($this, 'destroy'), - array($this, 'gc') - ); - } - } - - /** - * {@inheritdoc} - */ - public function open($save_path, $session_id) - { - // NOOP - return true; - } - - /** - * {@inheritdoc} - */ - public function close() - { - // NOOP - return true; - } - - /** - * {@inheritdoc} - */ - public function gc($maxlifetime) - { - // NOOP - return true; - } - - /** - * {@inheritdoc} - */ - public function read($session_id) - { - if ($data = $this->client->get($session_id)) { - return $data; - } - - return ''; - } - /** - * {@inheritdoc} - */ - public function write($session_id, $session_data) - { - $this->client->setex($session_id, $this->ttl, $session_data); - - return true; - } - - /** - * {@inheritdoc} - */ - public function destroy($session_id) - { - $this->client->del($session_id); - - return true; - } - - /** - * Returns the underlying client instance. - * - * @return ClientInterface - */ - public function getClient() - { - return $this->client; - } - - /** - * Returns the session max lifetime value. - * - * @return int - */ - public function getMaxLifeTime() - { - return $this->ttl; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/AbortedMultiExecException.php b/rainloop/v/0.0.0/app/libraries/Predis/Transaction/AbortedMultiExecException.php deleted file mode 100644 index b36f38aac9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/AbortedMultiExecException.php +++ /dev/null @@ -1,45 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Transaction; - -use Predis\PredisException; - -/** - * Exception class that identifies a MULTI / EXEC transaction aborted by Redis. - * - * @author Daniele Alessandri - */ -class AbortedMultiExecException extends PredisException -{ - private $transaction; - - /** - * @param MultiExec $transaction Transaction that generated the exception. - * @param string $message Error message. - * @param int $code Error code. - */ - public function __construct(MultiExec $transaction, $message, $code = null) - { - parent::__construct($message, $code); - $this->transaction = $transaction; - } - - /** - * Returns the transaction that generated the exception. - * - * @return MultiExec - */ - public function getTransaction() - { - return $this->transaction; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExec.php b/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExec.php deleted file mode 100644 index 0cf1962da5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExec.php +++ /dev/null @@ -1,461 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Transaction; - -use Predis\ClientContextInterface; -use Predis\ClientException; -use Predis\ClientInterface; -use Predis\Command\CommandInterface; -use Predis\CommunicationException; -use Predis\Connection\AggregateConnectionInterface; -use Predis\NotSupportedException; -use Predis\Protocol\ProtocolException; -use Predis\Response\ErrorInterface as ErrorResponseInterface; -use Predis\Response\ServerException; -use Predis\Response\Status as StatusResponse; - -/** - * Client-side abstraction of a Redis transaction based on MULTI / EXEC. - * - * {@inheritdoc} - * - * @author Daniele Alessandri - */ -class MultiExec implements ClientContextInterface -{ - private $state; - - protected $client; - protected $commands; - protected $exceptions = true; - protected $attempts = 0; - protected $watchKeys = array(); - protected $modeCAS = false; - - /** - * @param ClientInterface $client Client instance used by the transaction. - * @param array $options Initialization options. - */ - public function __construct(ClientInterface $client, array $options = null) - { - $this->assertClient($client); - - $this->client = $client; - $this->state = new MultiExecState(); - - $this->configure($client, $options ?: array()); - $this->reset(); - } - - /** - * Checks if the passed client instance satisfies the required conditions - * needed to initialize the transaction object. - * - * @param ClientInterface $client Client instance used by the transaction object. - * - * @throws NotSupportedException - */ - private function assertClient(ClientInterface $client) - { - if ($client->getConnection() instanceof AggregateConnectionInterface) { - throw new NotSupportedException( - 'Cannot initialize a MULTI/EXEC transaction over aggregate connections.' - ); - } - - if (!$client->getProfile()->supportsCommands(array('MULTI', 'EXEC', 'DISCARD'))) { - throw new NotSupportedException( - 'The current profile does not support MULTI, EXEC and DISCARD.' - ); - } - } - - /** - * Configures the transaction using the provided options. - * - * @param ClientInterface $client Underlying client instance. - * @param array $options Array of options for the transaction. - **/ - protected function configure(ClientInterface $client, array $options) - { - if (isset($options['exceptions'])) { - $this->exceptions = (bool) $options['exceptions']; - } else { - $this->exceptions = $client->getOptions()->exceptions; - } - - if (isset($options['cas'])) { - $this->modeCAS = (bool) $options['cas']; - } - - if (isset($options['watch']) && $keys = $options['watch']) { - $this->watchKeys = $keys; - } - - if (isset($options['retry'])) { - $this->attempts = (int) $options['retry']; - } - } - - /** - * Resets the state of the transaction. - */ - protected function reset() - { - $this->state->reset(); - $this->commands = new \SplQueue(); - } - - /** - * Initializes the transaction context. - */ - protected function initialize() - { - if ($this->state->isInitialized()) { - return; - } - - if ($this->modeCAS) { - $this->state->flag(MultiExecState::CAS); - } - - if ($this->watchKeys) { - $this->watch($this->watchKeys); - } - - $cas = $this->state->isCAS(); - $discarded = $this->state->isDiscarded(); - - if (!$cas || ($cas && $discarded)) { - $this->call('MULTI'); - - if ($discarded) { - $this->state->unflag(MultiExecState::CAS); - } - } - - $this->state->unflag(MultiExecState::DISCARDED); - $this->state->flag(MultiExecState::INITIALIZED); - } - - /** - * Dynamically invokes a Redis command with the specified arguments. - * - * @param string $method Command ID. - * @param array $arguments Arguments for the command. - * - * @return mixed - */ - public function __call($method, $arguments) - { - return $this->executeCommand( - $this->client->createCommand($method, $arguments) - ); - } - - /** - * Executes a Redis command bypassing the transaction logic. - * - * @param string $commandID Command ID. - * @param array $arguments Arguments for the command. - * - * @throws ServerException - * - * @return mixed - */ - protected function call($commandID, array $arguments = array()) - { - $response = $this->client->executeCommand( - $this->client->createCommand($commandID, $arguments) - ); - - if ($response instanceof ErrorResponseInterface) { - throw new ServerException($response->getMessage()); - } - - return $response; - } - - /** - * Executes the specified Redis command. - * - * @param CommandInterface $command Command instance. - * - * @throws AbortedMultiExecException - * @throws CommunicationException - * - * @return $this|mixed - */ - public function executeCommand(CommandInterface $command) - { - $this->initialize(); - - if ($this->state->isCAS()) { - return $this->client->executeCommand($command); - } - - $response = $this->client->getConnection()->executeCommand($command); - - if ($response instanceof StatusResponse && $response == 'QUEUED') { - $this->commands->enqueue($command); - } elseif ($response instanceof ErrorResponseInterface) { - throw new AbortedMultiExecException($this, $response->getMessage()); - } else { - $this->onProtocolError('The server did not return a +QUEUED status response.'); - } - - return $this; - } - - /** - * Executes WATCH against one or more keys. - * - * @param string|array $keys One or more keys. - * - * @throws NotSupportedException - * @throws ClientException - * - * @return mixed - */ - public function watch($keys) - { - if (!$this->client->getProfile()->supportsCommand('WATCH')) { - throw new NotSupportedException('WATCH is not supported by the current profile.'); - } - - if ($this->state->isWatchAllowed()) { - throw new ClientException('Sending WATCH after MULTI is not allowed.'); - } - - $response = $this->call('WATCH', is_array($keys) ? $keys : array($keys)); - $this->state->flag(MultiExecState::WATCH); - - return $response; - } - - /** - * Finalizes the transaction by executing MULTI on the server. - * - * @return MultiExec - */ - public function multi() - { - if ($this->state->check(MultiExecState::INITIALIZED | MultiExecState::CAS)) { - $this->state->unflag(MultiExecState::CAS); - $this->call('MULTI'); - } else { - $this->initialize(); - } - - return $this; - } - - /** - * Executes UNWATCH. - * - * @throws NotSupportedException - * - * @return MultiExec - */ - public function unwatch() - { - if (!$this->client->getProfile()->supportsCommand('UNWATCH')) { - throw new NotSupportedException( - 'UNWATCH is not supported by the current profile.' - ); - } - - $this->state->unflag(MultiExecState::WATCH); - $this->__call('UNWATCH', array()); - - return $this; - } - - /** - * Resets the transaction by UNWATCH-ing the keys that are being WATCHed and - * DISCARD-ing pending commands that have been already sent to the server. - * - * @return MultiExec - */ - public function discard() - { - if ($this->state->isInitialized()) { - $this->call($this->state->isCAS() ? 'UNWATCH' : 'DISCARD'); - - $this->reset(); - $this->state->flag(MultiExecState::DISCARDED); - } - - return $this; - } - - /** - * Executes the whole transaction. - * - * @return mixed - */ - public function exec() - { - return $this->execute(); - } - - /** - * Checks the state of the transaction before execution. - * - * @param mixed $callable Callback for execution. - * - * @throws \InvalidArgumentException - * @throws ClientException - */ - private function checkBeforeExecution($callable) - { - if ($this->state->isExecuting()) { - throw new ClientException( - 'Cannot invoke "execute" or "exec" inside an active transaction context.' - ); - } - - if ($callable) { - if (!is_callable($callable)) { - throw new \InvalidArgumentException('The argument must be a callable object.'); - } - - if (!$this->commands->isEmpty()) { - $this->discard(); - - throw new ClientException( - 'Cannot execute a transaction block after using fluent interface.' - ); - } - } elseif ($this->attempts) { - $this->discard(); - - throw new ClientException( - 'Automatic retries are supported only when a callable block is provided.' - ); - } - } - - /** - * Handles the actual execution of the whole transaction. - * - * @param mixed $callable Optional callback for execution. - * - * @throws CommunicationException - * @throws AbortedMultiExecException - * @throws ServerException - * - * @return array - */ - public function execute($callable = null) - { - $this->checkBeforeExecution($callable); - - $execResponse = null; - $attempts = $this->attempts; - - do { - if ($callable) { - $this->executeTransactionBlock($callable); - } - - if ($this->commands->isEmpty()) { - if ($this->state->isWatching()) { - $this->discard(); - } - - return; - } - - $execResponse = $this->call('EXEC'); - - if ($execResponse === null) { - if ($attempts === 0) { - throw new AbortedMultiExecException( - $this, 'The current transaction has been aborted by the server.' - ); - } - - $this->reset(); - - continue; - } - - break; - } while ($attempts-- > 0); - - $response = array(); - $commands = $this->commands; - $size = count($execResponse); - - if ($size !== count($commands)) { - $this->onProtocolError('EXEC returned an unexpected number of response items.'); - } - - for ($i = 0; $i < $size; ++$i) { - $cmdResponse = $execResponse[$i]; - - if ($cmdResponse instanceof ErrorResponseInterface && $this->exceptions) { - throw new ServerException($cmdResponse->getMessage()); - } - - $response[$i] = $commands->dequeue()->parseResponse($cmdResponse); - } - - return $response; - } - - /** - * Passes the current transaction object to a callable block for execution. - * - * @param mixed $callable Callback. - * - * @throws CommunicationException - * @throws ServerException - */ - protected function executeTransactionBlock($callable) - { - $exception = null; - $this->state->flag(MultiExecState::INSIDEBLOCK); - - try { - call_user_func($callable, $this); - } catch (CommunicationException $exception) { - // NOOP - } catch (ServerException $exception) { - // NOOP - } catch (\Exception $exception) { - $this->discard(); - } - - $this->state->unflag(MultiExecState::INSIDEBLOCK); - - if ($exception) { - throw $exception; - } - } - - /** - * Helper method for protocol errors encountered inside the transaction. - * - * @param string $message Error message. - */ - private function onProtocolError($message) - { - // Since a MULTI/EXEC block cannot be initialized when using aggregate - // connections we can safely assume that Predis\Client::getConnection() - // will return a Predis\Connection\NodeConnectionInterface instance. - CommunicationException::handle(new ProtocolException( - $this->client->getConnection(), $message - )); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExecState.php b/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExecState.php deleted file mode 100644 index a0a8285295..0000000000 --- a/rainloop/v/0.0.0/app/libraries/Predis/Transaction/MultiExecState.php +++ /dev/null @@ -1,166 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Predis\Transaction; - -/** - * Utility class used to track the state of a MULTI / EXEC transaction. - * - * @author Daniele Alessandri - */ -class MultiExecState -{ - const INITIALIZED = 1; // 0b00001 - const INSIDEBLOCK = 2; // 0b00010 - const DISCARDED = 4; // 0b00100 - const CAS = 8; // 0b01000 - const WATCH = 16; // 0b10000 - - private $flags; - - /** - * - */ - public function __construct() - { - $this->flags = 0; - } - - /** - * Sets the internal state flags. - * - * @param int $flags Set of flags - */ - public function set($flags) - { - $this->flags = $flags; - } - - /** - * Gets the internal state flags. - * - * @return int - */ - public function get() - { - return $this->flags; - } - - /** - * Sets one or more flags. - * - * @param int $flags Set of flags - */ - public function flag($flags) - { - $this->flags |= $flags; - } - - /** - * Resets one or more flags. - * - * @param int $flags Set of flags - */ - public function unflag($flags) - { - $this->flags &= ~$flags; - } - - /** - * Returns if the specified flag or set of flags is set. - * - * @param int $flags Flag - * - * @return bool - */ - public function check($flags) - { - return ($this->flags & $flags) === $flags; - } - - /** - * Resets the state of a transaction. - */ - public function reset() - { - $this->flags = 0; - } - - /** - * Returns the state of the RESET flag. - * - * @return bool - */ - public function isReset() - { - return $this->flags === 0; - } - - /** - * Returns the state of the INITIALIZED flag. - * - * @return bool - */ - public function isInitialized() - { - return $this->check(self::INITIALIZED); - } - - /** - * Returns the state of the INSIDEBLOCK flag. - * - * @return bool - */ - public function isExecuting() - { - return $this->check(self::INSIDEBLOCK); - } - - /** - * Returns the state of the CAS flag. - * - * @return bool - */ - public function isCAS() - { - return $this->check(self::CAS); - } - - /** - * Returns if WATCH is allowed in the current state. - * - * @return bool - */ - public function isWatchAllowed() - { - return $this->check(self::INITIALIZED) && !$this->check(self::CAS); - } - - /** - * Returns the state of the WATCH flag. - * - * @return bool - */ - public function isWatching() - { - return $this->check(self::WATCH); - } - - /** - * Returns the state of the DISCARDED flag. - * - * @return bool - */ - public function isDiscarded() - { - return $this->check(self::DISCARDED); - } -} diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 5a43fe9a72..866aafcf81 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -4727,8 +4727,6 @@ public function DoAdminPackageInstall() if ('' !== $sTmp) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/pclzip/pclzip.lib.php'; - $oArchive = new \PclZip($sTmp); if ('plugin' === $sType) { diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php index 5472079aad..dc342606f9 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/Prem.php @@ -291,8 +291,6 @@ public function UpdateCore($oActions, $sFile) $sTmp = $oActions->downloadRemotePackageByUrl($sFile); if (!empty($sTmp)) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/pclzip/pclzip.lib.php'; - $oArchive = new \PclZip($sTmp); $sTmpFolder = APP_PRIVATE_DATA.\md5($sTmp); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php index 0835d90bdc..68118c97bc 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Providers/TwoFactorAuth/GoogleTwoFactorAuth.php @@ -14,8 +14,6 @@ class GoogleTwoFactorAuth */ public function VerifyCode($sSecret, $sCode) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; - $oGoogleAuthenticator = new \PHPGangsta_GoogleAuthenticator(); return $oGoogleAuthenticator->verifyCode($sSecret, $sCode, 8); } @@ -25,8 +23,6 @@ public function VerifyCode($sSecret, $sCode) */ public function CreateSecret() { - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHPGangsta/GoogleAuthenticator.php'; - $oGoogleAuthenticator = new \PHPGangsta_GoogleAuthenticator(); return $oGoogleAuthenticator->createSecret(); } diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 9f383809ac..b6885e17de 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -728,10 +728,7 @@ public function ServiceCss() { try { - include_once APP_VERSION_ROOT_PATH.'app/libraries/lessphp/ctype.php'; - include_once APP_VERSION_ROOT_PATH.'app/libraries/lessphp/lessc.inc.php'; - - $oLess = new \RainLoopVendor\lessc(); + $oLess = new \lessc(); $oLess->setFormatter('compressed'); $aResult = array(); diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php index a1363756bd..2cc01091fc 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Social.php @@ -617,11 +617,6 @@ public function GoogleConnector() '' !== \trim($oConfig->Get('social', 'google_client_id', '')) && '' !== \trim($oConfig->Get('social', 'google_client_secret', ''))) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHP-OAuth2/Client.php'; - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHP-OAuth2/GrantType/IGrantType.php'; - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHP-OAuth2/GrantType/AuthorizationCode.php'; - include_once APP_VERSION_ROOT_PATH.'app/libraries/PHP-OAuth2/GrantType/RefreshToken.php'; - try { $oGoogle = new \OAuth2\Client( @@ -660,9 +655,6 @@ public function TwitterConnector() '' !== \trim($oConfig->Get('social', 'twitter_consumer_key', '')) && '' !== \trim($oConfig->Get('social', 'twitter_consumer_secret', ''))) { - include_once APP_VERSION_ROOT_PATH.'app/libraries/tmhOAuth/tmhOAuth.php'; - include_once APP_VERSION_ROOT_PATH.'app/libraries/tmhOAuth/tmhUtilities.php'; - $sProxy = $this->oActions->Config()->Get('labs', 'curl_proxy', ''); $sProxyAuth = $this->oActions->Config()->Get('labs', 'curl_proxy_auth', ''); @@ -789,4 +781,4 @@ private function loginProcess(&$oAccount, $sEmail, $sPassword) return $iErrorCode; } -} \ No newline at end of file +} diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php index ceb7f68772..8cec66e8d5 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Utils.php @@ -352,7 +352,7 @@ public static function ReadAndAddLang($sFileName, &$aResultLang) $isYml = '.yml' === substr($sFileName, -4); if ($isYml) { - $aLang = \spyc_load(\str_replace(array(': >-', ': |-', ': |+'), array(': >', ': |', ': |'), \file_get_contents($sFileName))); + $aLang = \Spyc::YAMLLoad(\str_replace(array(': >-', ': |-', ': |+'), array(': >', ': |', ': |'), \file_get_contents($sFileName))); if (\is_array($aLang)) { \reset($aLang); @@ -687,4 +687,4 @@ public static function CustomBaseConvert($sNumberInput, $sFromBaseInput = '01234 return $mRetVal; } -} \ No newline at end of file +} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php deleted file mode 100644 index eab6440765..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/AbstractBackend.php +++ /dev/null @@ -1,155 +0,0 @@ - array( - * '{DAV:}displayname' => null, - * ), - * 424 => array( - * '{DAV:}owner' => null, - * ) - * ) - * - * In this example it was forbidden to update {DAV:}displayname. - * (403 Forbidden), which in turn also caused {DAV:}owner to fail - * (424 Failed Dependency) because the request needs to be atomic. - * - * @param mixed $calendarId - * @param array $mutations - * @return bool|array - */ - public function updateCalendar($calendarId, array $mutations) { - - return false; - - } - - /** - * Performs a calendar-query on the contents of this calendar. - * - * The calendar-query is defined in RFC4791 : CalDAV. Using the - * calendar-query it is possible for a client to request a specific set of - * object, based on contents of iCalendar properties, date-ranges and - * iCalendar component types (VTODO, VEVENT). - * - * This method should just return a list of (relative) urls that match this - * query. - * - * The list of filters are specified as an array. The exact array is - * documented by \SabreForRainLoop\CalDAV\CalendarQueryParser. - * - * Note that it is extremely likely that getCalendarObject for every path - * returned from this method will be called almost immediately after. You - * may want to anticipate this to speed up these requests. - * - * This method provides a default implementation, which parses *all* the - * iCalendar objects in the specified calendar. - * - * This default may well be good enough for personal use, and calendars - * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. - * - * The best way to do so is override this method and to optimize - * specifically for 'common filters'. - * - * Requests that are extremely common are: - * * requests for just VEVENTS - * * requests for just VTODO - * * requests with a time-range-filter on either VEVENT or VTODO. - * - * ..and combinations of these requests. It may not be worth it to try to - * handle every possible situation and just rely on the (relatively - * easy to use) CalendarQueryValidator to handle the rest. - * - * Note that especially time-range-filters may be difficult to parse. A - * time-range filter specified on a VEVENT must for instance also handle - * recurrence rules correctly. - * A good example of how to interprete all these filters can also simply - * be found in \SabreForRainLoop\CalDAV\CalendarQueryFilter. This class is as correct - * as possible, so it gives you a good idea on what type of stuff you need - * to think of. - * - * @param mixed $calendarId - * @param array $filters - * @return array - */ - public function calendarQuery($calendarId, array $filters) { - - $result = array(); - $objects = $this->getCalendarObjects($calendarId); - - $validator = new \SabreForRainLoop\CalDAV\CalendarQueryValidator(); - - foreach($objects as $object) { - - if ($this->validateFilterForObject($object, $filters)) { - $result[] = $object['uri']; - } - - } - - return $result; - - } - - /** - * This method validates if a filters (as passed to calendarQuery) matches - * the given object. - * - * @param array $object - * @param array $filters - * @return bool - */ - protected function validateFilterForObject(array $object, array $filters) { - - // Unfortunately, setting the 'calendardata' here is optional. If - // it was excluded, we actually need another call to get this as - // well. - if (!isset($object['calendardata'])) { - $object = $this->getCalendarObject($object['calendarid'], $object['uri']); - } - - $data = is_resource($object['calendardata'])?stream_get_contents($object['calendardata']):$object['calendardata']; - $vObject = VObject\Reader::read($data); - - $validator = new CalDAV\CalendarQueryValidator(); - return $validator->validate($vObject, $filters); - - } - - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php deleted file mode 100644 index ddfe5d8c0c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/BackendInterface.php +++ /dev/null @@ -1,233 +0,0 @@ - array( - * '{DAV:}displayname' => null, - * ), - * 424 => array( - * '{DAV:}owner' => null, - * ) - * ) - * - * In this example it was forbidden to update {DAV:}displayname. - * (403 Forbidden), which in turn also caused {DAV:}owner to fail - * (424 Failed Dependency) because the request needs to be atomic. - * - * @param mixed $calendarId - * @param array $mutations - * @return bool|array - */ - public function updateCalendar($calendarId, array $mutations); - - /** - * Delete a calendar and all it's objects - * - * @param mixed $calendarId - * @return void - */ - public function deleteCalendar($calendarId); - - /** - * Returns all calendar objects within a calendar. - * - * Every item contains an array with the following keys: - * * id - unique identifier which will be used for subsequent updates - * * calendardata - The iCalendar-compatible calendar data - * * uri - a unique key which will be used to construct the uri. This can be any arbitrary string. - * * lastmodified - a timestamp of the last modification time - * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: - * ' "abcdef"') - * * calendarid - The calendarid as it was passed to this function. - * * size - The size of the calendar objects, in bytes. - * - * Note that the etag is optional, but it's highly encouraged to return for - * speed reasons. - * - * The calendardata is also optional. If it's not returned - * 'getCalendarObject' will be called later, which *is* expected to return - * calendardata. - * - * If neither etag or size are specified, the calendardata will be - * used/fetched to determine these numbers. If both are specified the - * amount of times this is needed is reduced by a great degree. - * - * @param mixed $calendarId - * @return array - */ - public function getCalendarObjects($calendarId); - - /** - * Returns information from a single calendar object, based on it's object - * uri. - * - * The returned array must have the same keys as getCalendarObjects. The - * 'calendardata' object is required here though, while it's not required - * for getCalendarObjects. - * - * This method must return null if the object did not exist. - * - * @param mixed $calendarId - * @param string $objectUri - * @return array|null - */ - public function getCalendarObject($calendarId,$objectUri); - - /** - * Creates a new calendar object. - * - * It is possible return an etag from this function, which will be used in - * the response to this PUT request. Note that the ETag must be surrounded - * by double-quotes. - * - * However, you should only really return this ETag if you don't mangle the - * calendar-data. If the result of a subsequent GET to this object is not - * the exact same as this request body, you should omit the ETag. - * - * @param mixed $calendarId - * @param string $objectUri - * @param string $calendarData - * @return string|null - */ - public function createCalendarObject($calendarId,$objectUri,$calendarData); - - /** - * Updates an existing calendarobject, based on it's uri. - * - * It is possible return an etag from this function, which will be used in - * the response to this PUT request. Note that the ETag must be surrounded - * by double-quotes. - * - * However, you should only really return this ETag if you don't mangle the - * calendar-data. If the result of a subsequent GET to this object is not - * the exact same as this request body, you should omit the ETag. - * - * @param mixed $calendarId - * @param string $objectUri - * @param string $calendarData - * @return string|null - */ - public function updateCalendarObject($calendarId,$objectUri,$calendarData); - - /** - * Deletes an existing calendar object. - * - * @param mixed $calendarId - * @param string $objectUri - * @return void - */ - public function deleteCalendarObject($calendarId,$objectUri); - - /** - * Performs a calendar-query on the contents of this calendar. - * - * The calendar-query is defined in RFC4791 : CalDAV. Using the - * calendar-query it is possible for a client to request a specific set of - * object, based on contents of iCalendar properties, date-ranges and - * iCalendar component types (VTODO, VEVENT). - * - * This method should just return a list of (relative) urls that match this - * query. - * - * The list of filters are specified as an array. The exact array is - * documented by SabreForRainLoop\CalDAV\CalendarQueryParser. - * - * Note that it is extremely likely that getCalendarObject for every path - * returned from this method will be called almost immediately after. You - * may want to anticipate this to speed up these requests. - * - * This method provides a default implementation, which parses *all* the - * iCalendar objects in the specified calendar. - * - * This default may well be good enough for personal use, and calendars - * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. - * - * The best way to do so is override this method and to optimize - * specifically for 'common filters'. - * - * Requests that are extremely common are: - * * requests for just VEVENTS - * * requests for just VTODO - * * requests with a time-range-filter on either VEVENT or VTODO. - * - * ..and combinations of these requests. It may not be worth it to try to - * handle every possible situation and just rely on the (relatively - * easy to use) CalendarQueryValidator to handle the rest. - * - * Note that especially time-range-filters may be difficult to parse. A - * time-range filter specified on a VEVENT must for instance also handle - * recurrence rules correctly. - * A good example of how to interprete all these filters can also simply - * be found in SabreForRainLoop\CalDAV\CalendarQueryFilter. This class is as correct - * as possible, so it gives you a good idea on what type of stuff you need - * to think of. - * - * @param mixed $calendarId - * @param array $filters - * @return array - */ - public function calendarQuery($calendarId, array $filters); - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/NotificationSupport.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/NotificationSupport.php deleted file mode 100644 index 9ae43c8b93..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/NotificationSupport.php +++ /dev/null @@ -1,47 +0,0 @@ - 'displayname', - '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'description', - '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => 'timezone', - '{http://apple.com/ns/ical/}calendar-order' => 'calendarorder', - '{http://apple.com/ns/ical/}calendar-color' => 'calendarcolor', - ); - - /** - * Creates the backend - * - * @param \PDO $pdo - * @param string $calendarTableName - * @param string $calendarObjectTableName - */ - public function __construct(\PDO $pdo, $calendarTableName = 'calendars', $calendarObjectTableName = 'calendarobjects') { - - $this->pdo = $pdo; - $this->calendarTableName = $calendarTableName; - $this->calendarObjectTableName = $calendarObjectTableName; - - } - - /** - * Returns a list of calendars for a principal. - * - * Every project is an array with the following keys: - * * id, a unique id that will be used by other functions to modify the - * calendar. This can be the same as the uri or a database key. - * * uri, which the basename of the uri with which the calendar is - * accessed. - * * principaluri. The owner of the calendar. Almost always the same as - * principalUri passed to this method. - * - * Furthermore it can contain webdav properties in clark notation. A very - * common one is '{DAV:}displayname'. - * - * @param string $principalUri - * @return array - */ - public function getCalendarsForUser($principalUri) { - - $fields = array_values($this->propertyMap); - $fields[] = 'id'; - $fields[] = 'uri'; - $fields[] = 'ctag'; - $fields[] = 'components'; - $fields[] = 'principaluri'; - $fields[] = 'transparent'; - - // Making fields a comma-delimited list - $fields = implode(', ', $fields); - $stmt = $this->pdo->prepare("SELECT " . $fields . " FROM ".$this->calendarTableName." WHERE principaluri = ? ORDER BY calendarorder ASC"); - $stmt->execute(array($principalUri)); - - $calendars = array(); - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - - $components = array(); - if ($row['components']) { - $components = explode(',',$row['components']); - } - - $calendar = array( - 'id' => $row['id'], - 'uri' => $row['uri'], - 'principaluri' => $row['principaluri'], - '{' . CalDAV\Plugin::NS_CALENDARSERVER . '}getctag' => $row['ctag']?$row['ctag']:'0', - '{' . CalDAV\Plugin::NS_CALDAV . '}supported-calendar-component-set' => new CalDAV\Property\SupportedCalendarComponentSet($components), - '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp' => new CalDAV\Property\ScheduleCalendarTransp($row['transparent']?'transparent':'opaque'), - ); - - - foreach($this->propertyMap as $xmlName=>$dbName) { - $calendar[$xmlName] = $row[$dbName]; - } - - $calendars[] = $calendar; - - } - - return $calendars; - - } - - /** - * Creates a new calendar for a principal. - * - * If the creation was a success, an id must be returned that can be used to reference - * this calendar in other methods, such as updateCalendar - * - * @param string $principalUri - * @param string $calendarUri - * @param array $properties - * @return string - */ - public function createCalendar($principalUri, $calendarUri, array $properties) { - - $fieldNames = array( - 'principaluri', - 'uri', - 'ctag', - 'transparent', - ); - $values = array( - ':principaluri' => $principalUri, - ':uri' => $calendarUri, - ':ctag' => 1, - ':transparent' => 0, - ); - - // Default value - $sccs = '{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set'; - $fieldNames[] = 'components'; - if (!isset($properties[$sccs])) { - $values[':components'] = 'VEVENT,VTODO'; - } else { - if (!($properties[$sccs] instanceof CalDAV\Property\SupportedCalendarComponentSet)) { - throw new DAV\Exception('The ' . $sccs . ' property must be of type: \SabreForRainLoop\CalDAV\Property\SupportedCalendarComponentSet'); - } - $values[':components'] = implode(',',$properties[$sccs]->getValue()); - } - $transp = '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp'; - if (isset($properties[$transp])) { - $values[':transparent'] = $properties[$transp]->getValue()==='transparent'; - } - - foreach($this->propertyMap as $xmlName=>$dbName) { - if (isset($properties[$xmlName])) { - - $values[':' . $dbName] = $properties[$xmlName]; - $fieldNames[] = $dbName; - } - } - - $stmt = $this->pdo->prepare("INSERT INTO ".$this->calendarTableName." (".implode(', ', $fieldNames).") VALUES (".implode(', ',array_keys($values)).")"); - $stmt->execute($values); - - return $this->pdo->lastInsertId(); - - } - - /** - * Updates properties for a calendar. - * - * The mutations array uses the propertyName in clark-notation as key, - * and the array value for the property value. In the case a property - * should be deleted, the property value will be null. - * - * This method must be atomic. If one property cannot be changed, the - * entire operation must fail. - * - * If the operation was successful, true can be returned. - * If the operation failed, false can be returned. - * - * Deletion of a non-existent property is always successful. - * - * Lastly, it is optional to return detailed information about any - * failures. In this case an array should be returned with the following - * structure: - * - * array( - * 403 => array( - * '{DAV:}displayname' => null, - * ), - * 424 => array( - * '{DAV:}owner' => null, - * ) - * ) - * - * In this example it was forbidden to update {DAV:}displayname. - * (403 Forbidden), which in turn also caused {DAV:}owner to fail - * (424 Failed Dependency) because the request needs to be atomic. - * - * @param string $calendarId - * @param array $mutations - * @return bool|array - */ - public function updateCalendar($calendarId, array $mutations) { - - $newValues = array(); - $result = array( - 200 => array(), // Ok - 403 => array(), // Forbidden - 424 => array(), // Failed Dependency - ); - - $hasError = false; - - foreach($mutations as $propertyName=>$propertyValue) { - - switch($propertyName) { - case '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-calendar-transp' : - $fieldName = 'transparent'; - $newValues[$fieldName] = $propertyValue->getValue()==='transparent'; - break; - default : - // Checking the property map - if (!isset($this->propertyMap[$propertyName])) { - // We don't know about this property. - $hasError = true; - $result[403][$propertyName] = null; - unset($mutations[$propertyName]); - continue; - } - - $fieldName = $this->propertyMap[$propertyName]; - $newValues[$fieldName] = $propertyValue; - } - - } - - // If there were any errors we need to fail the request - if ($hasError) { - // Properties has the remaining properties - foreach($mutations as $propertyName=>$propertyValue) { - $result[424][$propertyName] = null; - } - - // Removing unused statuscodes for cleanliness - foreach($result as $status=>$properties) { - if (is_array($properties) && count($properties)===0) unset($result[$status]); - } - - return $result; - - } - - // Success - - // Now we're generating the sql query. - $valuesSql = array(); - foreach($newValues as $fieldName=>$value) { - $valuesSql[] = $fieldName . ' = ?'; - } - $valuesSql[] = 'ctag = ctag + 1'; - - $stmt = $this->pdo->prepare("UPDATE " . $this->calendarTableName . " SET " . implode(', ',$valuesSql) . " WHERE id = ?"); - $newValues['id'] = $calendarId; - $stmt->execute(array_values($newValues)); - - return true; - - } - - /** - * Delete a calendar and all it's objects - * - * @param string $calendarId - * @return void - */ - public function deleteCalendar($calendarId) { - - $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?'); - $stmt->execute(array($calendarId)); - - $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarTableName.' WHERE id = ?'); - $stmt->execute(array($calendarId)); - - } - - /** - * Returns all calendar objects within a calendar. - * - * Every item contains an array with the following keys: - * * id - unique identifier which will be used for subsequent updates - * * calendardata - The iCalendar-compatible calendar data - * * uri - a unique key which will be used to construct the uri. This can be any arbitrary string. - * * lastmodified - a timestamp of the last modification time - * * etag - An arbitrary string, surrounded by double-quotes. (e.g.: - * ' "abcdef"') - * * calendarid - The calendarid as it was passed to this function. - * * size - The size of the calendar objects, in bytes. - * - * Note that the etag is optional, but it's highly encouraged to return for - * speed reasons. - * - * The calendardata is also optional. If it's not returned - * 'getCalendarObject' will be called later, which *is* expected to return - * calendardata. - * - * If neither etag or size are specified, the calendardata will be - * used/fetched to determine these numbers. If both are specified the - * amount of times this is needed is reduced by a great degree. - * - * @param string $calendarId - * @return array - */ - public function getCalendarObjects($calendarId) { - - $stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size FROM '.$this->calendarObjectTableName.' WHERE calendarid = ?'); - $stmt->execute(array($calendarId)); - - $result = array(); - foreach($stmt->fetchAll(\PDO::FETCH_ASSOC) as $row) { - $result[] = array( - 'id' => $row['id'], - 'uri' => $row['uri'], - 'lastmodified' => $row['lastmodified'], - 'etag' => '"' . $row['etag'] . '"', - 'calendarid' => $row['calendarid'], - 'size' => (int)$row['size'], - ); - } - - return $result; - - } - - /** - * Returns information from a single calendar object, based on it's object - * uri. - * - * The returned array must have the same keys as getCalendarObjects. The - * 'calendardata' object is required here though, while it's not required - * for getCalendarObjects. - * - * This method must return null if the object did not exist. - * - * @param string $calendarId - * @param string $objectUri - * @return array|null - */ - public function getCalendarObject($calendarId,$objectUri) { - - $stmt = $this->pdo->prepare('SELECT id, uri, lastmodified, etag, calendarid, size, calendardata FROM '.$this->calendarObjectTableName.' WHERE calendarid = ? AND uri = ?'); - $stmt->execute(array($calendarId, $objectUri)); - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - - if(!$row) return null; - - return array( - 'id' => $row['id'], - 'uri' => $row['uri'], - 'lastmodified' => $row['lastmodified'], - 'etag' => '"' . $row['etag'] . '"', - 'calendarid' => $row['calendarid'], - 'size' => (int)$row['size'], - 'calendardata' => $row['calendardata'], - ); - - } - - - /** - * Creates a new calendar object. - * - * It is possible return an etag from this function, which will be used in - * the response to this PUT request. Note that the ETag must be surrounded - * by double-quotes. - * - * However, you should only really return this ETag if you don't mangle the - * calendar-data. If the result of a subsequent GET to this object is not - * the exact same as this request body, you should omit the ETag. - * - * @param mixed $calendarId - * @param string $objectUri - * @param string $calendarData - * @return string|null - */ - public function createCalendarObject($calendarId,$objectUri,$calendarData) { - - $extraData = $this->getDenormalizedData($calendarData); - - $stmt = $this->pdo->prepare('INSERT INTO '.$this->calendarObjectTableName.' (calendarid, uri, calendardata, lastmodified, etag, size, componenttype, firstoccurence, lastoccurence) VALUES (?,?,?,?,?,?,?,?,?)'); - $stmt->execute(array( - $calendarId, - $objectUri, - $calendarData, - time(), - $extraData['etag'], - $extraData['size'], - $extraData['componentType'], - $extraData['firstOccurence'], - $extraData['lastOccurence'], - )); - $stmt = $this->pdo->prepare('UPDATE '.$this->calendarTableName.' SET ctag = ctag + 1 WHERE id = ?'); - $stmt->execute(array($calendarId)); - - return '"' . $extraData['etag'] . '"'; - - } - - /** - * Updates an existing calendarobject, based on it's uri. - * - * It is possible return an etag from this function, which will be used in - * the response to this PUT request. Note that the ETag must be surrounded - * by double-quotes. - * - * However, you should only really return this ETag if you don't mangle the - * calendar-data. If the result of a subsequent GET to this object is not - * the exact same as this request body, you should omit the ETag. - * - * @param mixed $calendarId - * @param string $objectUri - * @param string $calendarData - * @return string|null - */ - public function updateCalendarObject($calendarId,$objectUri,$calendarData) { - - $extraData = $this->getDenormalizedData($calendarData); - - $stmt = $this->pdo->prepare('UPDATE '.$this->calendarObjectTableName.' SET calendardata = ?, lastmodified = ?, etag = ?, size = ?, componenttype = ?, firstoccurence = ?, lastoccurence = ? WHERE calendarid = ? AND uri = ?'); - $stmt->execute(array($calendarData,time(), $extraData['etag'], $extraData['size'], $extraData['componentType'], $extraData['firstOccurence'], $extraData['lastOccurence'] ,$calendarId,$objectUri)); - $stmt = $this->pdo->prepare('UPDATE '.$this->calendarTableName.' SET ctag = ctag + 1 WHERE id = ?'); - $stmt->execute(array($calendarId)); - - return '"' . $extraData['etag'] . '"'; - - } - - /** - * Parses some information from calendar objects, used for optimized - * calendar-queries. - * - * Returns an array with the following keys: - * * etag - * * size - * * componentType - * * firstOccurence - * * lastOccurence - * - * @param string $calendarData - * @return array - */ - protected function getDenormalizedData($calendarData) { - - $vObject = VObject\Reader::read($calendarData); - $componentType = null; - $component = null; - $firstOccurence = null; - $lastOccurence = null; - foreach($vObject->getComponents() as $component) { - if ($component->name!=='VTIMEZONE') { - $componentType = $component->name; - break; - } - } - if (!$componentType) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component'); - } - if ($componentType === 'VEVENT') { - $firstOccurence = $component->DTSTART->getDateTime()->getTimeStamp(); - // Finding the last occurence is a bit harder - if (!isset($component->RRULE)) { - if (isset($component->DTEND)) { - $lastOccurence = $component->DTEND->getDateTime()->getTimeStamp(); - } elseif (isset($component->DURATION)) { - $endDate = clone $component->DTSTART->getDateTime(); - $endDate->add(VObject\DateTimeParser::parse($component->DURATION->getValue())); - $lastOccurence = $endDate->getTimeStamp(); - } elseif (!$component->DTSTART->hasTime()) { - $endDate = clone $component->DTSTART->getDateTime(); - $endDate->modify('+1 day'); - $lastOccurence = $endDate->getTimeStamp(); - } else { - $lastOccurence = $firstOccurence; - } - } else { - $it = new VObject\RecurrenceIterator($vObject, (string)$component->UID); - $maxDate = new \DateTime(self::MAX_DATE); - if ($it->isInfinite()) { - $lastOccurence = $maxDate->getTimeStamp(); - } else { - $end = $it->getDtEnd(); - while($it->valid() && $end < $maxDate) { - $end = $it->getDtEnd(); - $it->next(); - - } - $lastOccurence = $end->getTimeStamp(); - } - - } - } - - return array( - 'etag' => md5($calendarData), - 'size' => strlen($calendarData), - 'componentType' => $componentType, - 'firstOccurence' => $firstOccurence, - 'lastOccurence' => $lastOccurence, - ); - - } - - /** - * Deletes an existing calendar object. - * - * @param string $calendarId - * @param string $objectUri - * @return void - */ - public function deleteCalendarObject($calendarId,$objectUri) { - - $stmt = $this->pdo->prepare('DELETE FROM '.$this->calendarObjectTableName.' WHERE calendarid = ? AND uri = ?'); - $stmt->execute(array($calendarId,$objectUri)); - $stmt = $this->pdo->prepare('UPDATE '. $this->calendarTableName .' SET ctag = ctag + 1 WHERE id = ?'); - $stmt->execute(array($calendarId)); - - } - - /** - * Performs a calendar-query on the contents of this calendar. - * - * The calendar-query is defined in RFC4791 : CalDAV. Using the - * calendar-query it is possible for a client to request a specific set of - * object, based on contents of iCalendar properties, date-ranges and - * iCalendar component types (VTODO, VEVENT). - * - * This method should just return a list of (relative) urls that match this - * query. - * - * The list of filters are specified as an array. The exact array is - * documented by \SabreForRainLoop\CalDAV\CalendarQueryParser. - * - * Note that it is extremely likely that getCalendarObject for every path - * returned from this method will be called almost immediately after. You - * may want to anticipate this to speed up these requests. - * - * This method provides a default implementation, which parses *all* the - * iCalendar objects in the specified calendar. - * - * This default may well be good enough for personal use, and calendars - * that aren't very large. But if you anticipate high usage, big calendars - * or high loads, you are strongly adviced to optimize certain paths. - * - * The best way to do so is override this method and to optimize - * specifically for 'common filters'. - * - * Requests that are extremely common are: - * * requests for just VEVENTS - * * requests for just VTODO - * * requests with a time-range-filter on a VEVENT. - * - * ..and combinations of these requests. It may not be worth it to try to - * handle every possible situation and just rely on the (relatively - * easy to use) CalendarQueryValidator to handle the rest. - * - * Note that especially time-range-filters may be difficult to parse. A - * time-range filter specified on a VEVENT must for instance also handle - * recurrence rules correctly. - * A good example of how to interprete all these filters can also simply - * be found in \SabreForRainLoop\CalDAV\CalendarQueryFilter. This class is as correct - * as possible, so it gives you a good idea on what type of stuff you need - * to think of. - * - * This specific implementation (for the PDO) backend optimizes filters on - * specific components, and VEVENT time-ranges. - * - * @param string $calendarId - * @param array $filters - * @return array - */ - public function calendarQuery($calendarId, array $filters) { - - $result = array(); - $validator = new \SabreForRainLoop\CalDAV\CalendarQueryValidator(); - - $componentType = null; - $requirePostFilter = true; - $timeRange = null; - - // if no filters were specified, we don't need to filter after a query - if (!$filters['prop-filters'] && !$filters['comp-filters']) { - $requirePostFilter = false; - } - - // Figuring out if there's a component filter - if (count($filters['comp-filters']) > 0 && !$filters['comp-filters'][0]['is-not-defined']) { - $componentType = $filters['comp-filters'][0]['name']; - - // Checking if we need post-filters - if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['time-range'] && !$filters['comp-filters'][0]['prop-filters']) { - $requirePostFilter = false; - } - // There was a time-range filter - if ($componentType == 'VEVENT' && isset($filters['comp-filters'][0]['time-range'])) { - $timeRange = $filters['comp-filters'][0]['time-range']; - - // If start time OR the end time is not specified, we can do a - // 100% accurate mysql query. - if (!$filters['prop-filters'] && !$filters['comp-filters'][0]['comp-filters'] && !$filters['comp-filters'][0]['prop-filters'] && (!$timeRange['start'] || !$timeRange['end'])) { - $requirePostFilter = false; - } - } - - } - - if ($requirePostFilter) { - $query = "SELECT uri, calendardata FROM ".$this->calendarObjectTableName." WHERE calendarid = :calendarid"; - } else { - $query = "SELECT uri FROM ".$this->calendarObjectTableName." WHERE calendarid = :calendarid"; - } - - $values = array( - 'calendarid' => $calendarId, - ); - - if ($componentType) { - $query.=" AND componenttype = :componenttype"; - $values['componenttype'] = $componentType; - } - - if ($timeRange && $timeRange['start']) { - $query.=" AND lastoccurence > :startdate"; - $values['startdate'] = $timeRange['start']->getTimeStamp(); - } - if ($timeRange && $timeRange['end']) { - $query.=" AND firstoccurence < :enddate"; - $values['enddate'] = $timeRange['end']->getTimeStamp(); - } - - $stmt = $this->pdo->prepare($query); - $stmt->execute($values); - - $result = array(); - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - if ($requirePostFilter) { - if (!$this->validateFilterForObject($row, $filters)) { - continue; - } - } - $result[] = $row['uri']; - - } - - return $result; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php deleted file mode 100644 index 3bfcc145d1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Backend/SharingSupport.php +++ /dev/null @@ -1,243 +0,0 @@ -caldavBackend = $caldavBackend; - $this->calendarInfo = $calendarInfo; - - } - - /** - * Returns the name of the calendar - * - * @return string - */ - public function getName() { - - return $this->calendarInfo['uri']; - - } - - /** - * Updates properties such as the display name and description - * - * @param array $mutations - * @return array - */ - public function updateProperties($mutations) { - - return $this->caldavBackend->updateCalendar($this->calendarInfo['id'],$mutations); - - } - - /** - * Returns the list of properties - * - * @param array $requestedProperties - * @return array - */ - public function getProperties($requestedProperties) { - - $response = array(); - - foreach($requestedProperties as $prop) switch($prop) { - - case '{urn:ietf:params:xml:ns:caldav}supported-calendar-data' : - $response[$prop] = new Property\SupportedCalendarData(); - break; - case '{urn:ietf:params:xml:ns:caldav}supported-collation-set' : - $response[$prop] = new Property\SupportedCollationSet(); - break; - case '{DAV:}owner' : - $response[$prop] = new DAVACL\Property\Principal(DAVACL\Property\Principal::HREF,$this->calendarInfo['principaluri']); - break; - default : - if (isset($this->calendarInfo[$prop])) $response[$prop] = $this->calendarInfo[$prop]; - break; - - } - return $response; - - } - - /** - * Returns a calendar object - * - * The contained calendar objects are for example Events or Todo's. - * - * @param string $name - * @return \SabreForRainLoop\CalDAV\ICalendarObject - */ - public function getChild($name) { - - $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'],$name); - - if (!$obj) throw new DAV\Exception\NotFound('Calendar object not found'); - - $obj['acl'] = $this->getACL(); - // Removing the irrelivant - foreach($obj['acl'] as $key=>$acl) { - if ($acl['privilege'] === '{' . Plugin::NS_CALDAV . '}read-free-busy') { - unset($obj['acl'][$key]); - } - } - - return new CalendarObject($this->caldavBackend,$this->calendarInfo,$obj); - - } - - /** - * Returns the full list of calendar objects - * - * @return array - */ - public function getChildren() { - - $objs = $this->caldavBackend->getCalendarObjects($this->calendarInfo['id']); - $children = array(); - foreach($objs as $obj) { - $obj['acl'] = $this->getACL(); - // Removing the irrelivant - foreach($obj['acl'] as $key=>$acl) { - if ($acl['privilege'] === '{' . Plugin::NS_CALDAV . '}read-free-busy') { - unset($obj['acl'][$key]); - } - } - $children[] = new CalendarObject($this->caldavBackend,$this->calendarInfo,$obj); - } - return $children; - - } - - /** - * Checks if a child-node exists. - * - * @param string $name - * @return bool - */ - public function childExists($name) { - - $obj = $this->caldavBackend->getCalendarObject($this->calendarInfo['id'],$name); - if (!$obj) - return false; - else - return true; - - } - - /** - * Creates a new directory - * - * We actually block this, as subdirectories are not allowed in calendars. - * - * @param string $name - * @return void - */ - public function createDirectory($name) { - - throw new DAV\Exception\MethodNotAllowed('Creating collections in calendar objects is not allowed'); - - } - - /** - * Creates a new file - * - * The contents of the new file must be a valid ICalendar string. - * - * @param string $name - * @param resource $calendarData - * @return string|null - */ - public function createFile($name,$calendarData = null) { - - if (is_resource($calendarData)) { - $calendarData = stream_get_contents($calendarData); - } - return $this->caldavBackend->createCalendarObject($this->calendarInfo['id'],$name,$calendarData); - - } - - /** - * Deletes the calendar. - * - * @return void - */ - public function delete() { - - $this->caldavBackend->deleteCalendar($this->calendarInfo['id']); - - } - - /** - * Renames the calendar. Note that most calendars use the - * {DAV:}displayname to display a name to display a name. - * - * @param string $newName - * @return void - */ - public function setName($newName) { - - throw new DAV\Exception\MethodNotAllowed('Renaming calendars is not yet supported'); - - } - - /** - * Returns the last modification date as a unix timestamp. - * - * @return void - */ - public function getLastModified() { - - return null; - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->calendarInfo['principaluri']; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->getOwner(), - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->getOwner(), - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->getOwner() . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->getOwner() . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->getOwner() . '/calendar-proxy-read', - 'protected' => true, - ), - array( - 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy', - 'principal' => '{DAV:}authenticated', - 'protected' => true, - ), - - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See \SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - $default = DAVACL\Plugin::getDefaultSupportedPrivilegeSet(); - - // We need to inject 'read-free-busy' in the tree, aggregated under - // {DAV:}read. - foreach($default['aggregates'] as &$agg) { - - if ($agg['privilege'] !== '{DAV:}read') continue; - - $agg['aggregates'][] = array( - 'privilege' => '{' . Plugin::NS_CALDAV . '}read-free-busy', - ); - - } - return $default; - - } - - /** - * Performs a calendar-query on the contents of this calendar. - * - * The calendar-query is defined in RFC4791 : CalDAV. Using the - * calendar-query it is possible for a client to request a specific set of - * object, based on contents of iCalendar properties, date-ranges and - * iCalendar component types (VTODO, VEVENT). - * - * This method should just return a list of (relative) urls that match this - * query. - * - * The list of filters are specified as an array. The exact array is - * documented by SabreForRainLoop\CalDAV\CalendarQueryParser. - * - * @param array $filters - * @return array - */ - public function calendarQuery(array $filters) { - - return $this->caldavBackend->calendarQuery($this->calendarInfo['id'], $filters); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarObject.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarObject.php deleted file mode 100644 index 9f6b498882..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarObject.php +++ /dev/null @@ -1,279 +0,0 @@ -caldavBackend = $caldavBackend; - - if (!isset($objectData['calendarid'])) { - throw new \InvalidArgumentException('The objectData argument must contain a \'calendarid\' property'); - } - if (!isset($objectData['uri'])) { - throw new \InvalidArgumentException('The objectData argument must contain an \'uri\' property'); - } - - $this->calendarInfo = $calendarInfo; - $this->objectData = $objectData; - - } - - /** - * Returns the uri for this object - * - * @return string - */ - public function getName() { - - return $this->objectData['uri']; - - } - - /** - * Returns the ICalendar-formatted object - * - * @return string - */ - public function get() { - - // Pre-populating the 'calendardata' is optional, if we don't have it - // already we fetch it from the backend. - if (!isset($this->objectData['calendardata'])) { - $this->objectData = $this->caldavBackend->getCalendarObject($this->objectData['calendarid'], $this->objectData['uri']); - } - return $this->objectData['calendardata']; - - } - - /** - * Updates the ICalendar-formatted object - * - * @param string|resource $calendarData - * @return string - */ - public function put($calendarData) { - - if (is_resource($calendarData)) { - $calendarData = stream_get_contents($calendarData); - } - $etag = $this->caldavBackend->updateCalendarObject($this->calendarInfo['id'],$this->objectData['uri'],$calendarData); - $this->objectData['calendardata'] = $calendarData; - $this->objectData['etag'] = $etag; - - return $etag; - - } - - /** - * Deletes the calendar object - * - * @return void - */ - public function delete() { - - $this->caldavBackend->deleteCalendarObject($this->calendarInfo['id'],$this->objectData['uri']); - - } - - /** - * Returns the mime content-type - * - * @return string - */ - public function getContentType() { - - return 'text/calendar; charset=utf-8'; - - } - - /** - * Returns an ETag for this object. - * - * The ETag is an arbitrary string, but MUST be surrounded by double-quotes. - * - * @return string - */ - public function getETag() { - - if (isset($this->objectData['etag'])) { - return $this->objectData['etag']; - } else { - return '"' . md5($this->get()). '"'; - } - - } - - /** - * Returns the last modification date as a unix timestamp - * - * @return int - */ - public function getLastModified() { - - return $this->objectData['lastmodified']; - - } - - /** - * Returns the size of this object in bytes - * - * @return int - */ - public function getSize() { - - if (array_key_exists('size',$this->objectData)) { - return $this->objectData['size']; - } else { - return strlen($this->get()); - } - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->calendarInfo['principaluri']; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - // An alternative acl may be specified in the object data. - if (isset($this->objectData['acl'])) { - return $this->objectData['acl']; - } - - // The default ACL - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->calendarInfo['principaluri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->calendarInfo['principaluri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->calendarInfo['principaluri'] . '/calendar-proxy-read', - 'protected' => true, - ), - - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new \SabreForRainLoop\DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See \SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryParser.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryParser.php deleted file mode 100644 index 8a3aec7f28..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryParser.php +++ /dev/null @@ -1,298 +0,0 @@ -dom = $dom; - $this->xpath = new \DOMXPath($dom); - $this->xpath->registerNameSpace('cal',Plugin::NS_CALDAV); - $this->xpath->registerNameSpace('dav','urn:DAV'); - - } - - /** - * Parses the request. - * - * @return void - */ - public function parse() { - - $filterNode = null; - - $filter = $this->xpath->query('/cal:calendar-query/cal:filter'); - if ($filter->length !== 1) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('Only one filter element is allowed'); - } - - $compFilters = $this->parseCompFilters($filter->item(0)); - if (count($compFilters)!==1) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('There must be exactly 1 top-level comp-filter.'); - } - - $this->filters = $compFilters[0]; - $this->requestedProperties = array_keys(\SabreForRainLoop\DAV\XMLUtil::parseProperties($this->dom->firstChild)); - - $expand = $this->xpath->query('/cal:calendar-query/dav:prop/cal:calendar-data/cal:expand'); - if ($expand->length>0) { - $this->expand = $this->parseExpand($expand->item(0)); - } - - - } - - /** - * Parses all the 'comp-filter' elements from a node - * - * @param \DOMElement $parentNode - * @return array - */ - protected function parseCompFilters(\DOMElement $parentNode) { - - $compFilterNodes = $this->xpath->query('cal:comp-filter', $parentNode); - $result = array(); - - for($ii=0; $ii < $compFilterNodes->length; $ii++) { - - $compFilterNode = $compFilterNodes->item($ii); - - $compFilter = array(); - $compFilter['name'] = $compFilterNode->getAttribute('name'); - $compFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $compFilterNode)->length>0; - $compFilter['comp-filters'] = $this->parseCompFilters($compFilterNode); - $compFilter['prop-filters'] = $this->parsePropFilters($compFilterNode); - $compFilter['time-range'] = $this->parseTimeRange($compFilterNode); - - if ($compFilter['time-range'] && !in_array($compFilter['name'],array( - 'VEVENT', - 'VTODO', - 'VJOURNAL', - 'VFREEBUSY', - 'VALARM', - ))) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The time-range filter is not defined for the ' . $compFilter['name'] . ' component'); - }; - - $result[] = $compFilter; - - } - - return $result; - - } - - /** - * Parses all the prop-filter elements from a node - * - * @param \DOMElement $parentNode - * @return array - */ - protected function parsePropFilters(\DOMElement $parentNode) { - - $propFilterNodes = $this->xpath->query('cal:prop-filter', $parentNode); - $result = array(); - - for ($ii=0; $ii < $propFilterNodes->length; $ii++) { - - $propFilterNode = $propFilterNodes->item($ii); - $propFilter = array(); - $propFilter['name'] = $propFilterNode->getAttribute('name'); - $propFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $propFilterNode)->length>0; - $propFilter['param-filters'] = $this->parseParamFilters($propFilterNode); - $propFilter['text-match'] = $this->parseTextMatch($propFilterNode); - $propFilter['time-range'] = $this->parseTimeRange($propFilterNode); - - $result[] = $propFilter; - - } - - return $result; - - } - - /** - * Parses the param-filter element - * - * @param \DOMElement $parentNode - * @return array - */ - protected function parseParamFilters(\DOMElement $parentNode) { - - $paramFilterNodes = $this->xpath->query('cal:param-filter', $parentNode); - $result = array(); - - for($ii=0;$ii<$paramFilterNodes->length;$ii++) { - - $paramFilterNode = $paramFilterNodes->item($ii); - $paramFilter = array(); - $paramFilter['name'] = $paramFilterNode->getAttribute('name'); - $paramFilter['is-not-defined'] = $this->xpath->query('cal:is-not-defined', $paramFilterNode)->length>0; - $paramFilter['text-match'] = $this->parseTextMatch($paramFilterNode); - - $result[] = $paramFilter; - - } - - return $result; - - } - - /** - * Parses the text-match element - * - * @param \DOMElement $parentNode - * @return array|null - */ - protected function parseTextMatch(\DOMElement $parentNode) { - - $textMatchNodes = $this->xpath->query('cal:text-match', $parentNode); - - if ($textMatchNodes->length === 0) - return null; - - $textMatchNode = $textMatchNodes->item(0); - $negateCondition = $textMatchNode->getAttribute('negate-condition'); - $negateCondition = $negateCondition==='yes'; - $collation = $textMatchNode->getAttribute('collation'); - if (!$collation) $collation = 'i;ascii-casemap'; - - return array( - 'negate-condition' => $negateCondition, - 'collation' => $collation, - 'value' => $textMatchNode->nodeValue - ); - - } - - /** - * Parses the time-range element - * - * @param \DOMElement $parentNode - * @return array|null - */ - protected function parseTimeRange(\DOMElement $parentNode) { - - $timeRangeNodes = $this->xpath->query('cal:time-range', $parentNode); - if ($timeRangeNodes->length === 0) { - return null; - } - - $timeRangeNode = $timeRangeNodes->item(0); - - if ($start = $timeRangeNode->getAttribute('start')) { - $start = VObject\DateTimeParser::parseDateTime($start); - } else { - $start = null; - } - if ($end = $timeRangeNode->getAttribute('end')) { - $end = VObject\DateTimeParser::parseDateTime($end); - } else { - $end = null; - } - - if (!is_null($start) && !is_null($end) && $end <= $start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the time-range filter'); - } - - return array( - 'start' => $start, - 'end' => $end, - ); - - } - - /** - * Parses the CALDAV:expand element - * - * @param \DOMElement $parentNode - * @return void - */ - protected function parseExpand(\DOMElement $parentNode) { - - $start = $parentNode->getAttribute('start'); - if(!$start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The "start" attribute is required for the CALDAV:expand element'); - } - $start = VObject\DateTimeParser::parseDateTime($start); - - $end = $parentNode->getAttribute('end'); - if(!$end) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The "end" attribute is required for the CALDAV:expand element'); - } - - $end = VObject\DateTimeParser::parseDateTime($end); - - if ($end <= $start) { - throw new \SabreForRainLoop\DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.'); - } - - return array( - 'start' => $start, - 'end' => $end, - ); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php deleted file mode 100644 index 4537d3bf58..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarQueryValidator.php +++ /dev/null @@ -1,392 +0,0 @@ -name !== $filters['name']) { - return false; - } - - return - $this->validateCompFilters($vObject, $filters['comp-filters']) && - $this->validatePropFilters($vObject, $filters['prop-filters']); - - - } - - /** - * This method checks the validity of comp-filters. - * - * A list of comp-filters needs to be specified. Also the parent of the - * component we're checking should be specified, not the component to check - * itself. - * - * @param VObject\Component $parent - * @param array $filters - * @return bool - */ - protected function validateCompFilters(VObject\Component $parent, array $filters) { - - foreach($filters as $filter) { - - $isDefined = isset($parent->$filter['name']); - - if ($filter['is-not-defined']) { - - if ($isDefined) { - return false; - } else { - continue; - } - - } - if (!$isDefined) { - return false; - } - - if ($filter['time-range']) { - foreach($parent->$filter['name'] as $subComponent) { - if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) { - continue 2; - } - } - return false; - } - - if (!$filter['comp-filters'] && !$filter['prop-filters']) { - continue; - } - - // If there are sub-filters, we need to find at least one component - // for which the subfilters hold true. - foreach($parent->$filter['name'] as $subComponent) { - - if ( - $this->validateCompFilters($subComponent, $filter['comp-filters']) && - $this->validatePropFilters($subComponent, $filter['prop-filters'])) { - // We had a match, so this comp-filter succeeds - continue 2; - } - - } - - // If we got here it means there were sub-comp-filters or - // sub-prop-filters and there was no match. This means this filter - // needs to return false. - return false; - - } - - // If we got here it means we got through all comp-filters alive so the - // filters were all true. - return true; - - } - - /** - * This method checks the validity of prop-filters. - * - * A list of prop-filters needs to be specified. Also the parent of the - * property we're checking should be specified, not the property to check - * itself. - * - * @param VObject\Component $parent - * @param array $filters - * @return bool - */ - protected function validatePropFilters(VObject\Component $parent, array $filters) { - - foreach($filters as $filter) { - - $isDefined = isset($parent->$filter['name']); - - if ($filter['is-not-defined']) { - - if ($isDefined) { - return false; - } else { - continue; - } - - } - if (!$isDefined) { - return false; - } - - if ($filter['time-range']) { - foreach($parent->$filter['name'] as $subComponent) { - if ($this->validateTimeRange($subComponent, $filter['time-range']['start'], $filter['time-range']['end'])) { - continue 2; - } - } - return false; - } - - if (!$filter['param-filters'] && !$filter['text-match']) { - continue; - } - - // If there are sub-filters, we need to find at least one property - // for which the subfilters hold true. - foreach($parent->$filter['name'] as $subComponent) { - - if( - $this->validateParamFilters($subComponent, $filter['param-filters']) && - (!$filter['text-match'] || $this->validateTextMatch($subComponent, $filter['text-match'])) - ) { - // We had a match, so this prop-filter succeeds - continue 2; - } - - } - - // If we got here it means there were sub-param-filters or - // text-match filters and there was no match. This means the - // filter needs to return false. - return false; - - } - - // If we got here it means we got through all prop-filters alive so the - // filters were all true. - return true; - - } - - /** - * This method checks the validity of param-filters. - * - * A list of param-filters needs to be specified. Also the parent of the - * parameter we're checking should be specified, not the parameter to check - * itself. - * - * @param VObject\Property $parent - * @param array $filters - * @return bool - */ - protected function validateParamFilters(VObject\Property $parent, array $filters) { - - foreach($filters as $filter) { - - $isDefined = isset($parent[$filter['name']]); - - if ($filter['is-not-defined']) { - - if ($isDefined) { - return false; - } else { - continue; - } - - } - if (!$isDefined) { - return false; - } - - if (!$filter['text-match']) { - continue; - } - - if (version_compare(VObject\Version::VERSION, '3.0.0beta1', '>=')) { - - // If there are sub-filters, we need to find at least one parameter - // for which the subfilters hold true. - foreach($parent[$filter['name']]->getParts() as $subParam) { - - if($this->validateTextMatch($subParam,$filter['text-match'])) { - // We had a match, so this param-filter succeeds - continue 2; - } - - } - - } else { - - // If there are sub-filters, we need to find at least one parameter - // for which the subfilters hold true. - foreach($parent[$filter['name']] as $subParam) { - - if($this->validateTextMatch($subParam,$filter['text-match'])) { - // We had a match, so this param-filter succeeds - continue 2; - } - - } - - } - - // If we got here it means there was a text-match filter and there - // were no matches. This means the filter needs to return false. - return false; - - } - - // If we got here it means we got through all param-filters alive so the - // filters were all true. - return true; - - } - - /** - * This method checks the validity of a text-match. - * - * A single text-match should be specified as well as the specific property - * or parameter we need to validate. - * - * @param VObject\Node|string $check Value to check against. - * @param array $textMatch - * @return bool - */ - protected function validateTextMatch($check, array $textMatch) { - - if ($check instanceof VObject\Node) { - $check = (string)$check; - } - - $isMatching = \SabreForRainLoop\DAV\StringUtil::textMatch($check, $textMatch['value'], $textMatch['collation']); - - return ($textMatch['negate-condition'] xor $isMatching); - - } - - /** - * Validates if a component matches the given time range. - * - * This is all based on the rules specified in rfc4791, which are quite - * complex. - * - * @param VObject\Node $component - * @param DateTime $start - * @param DateTime $end - * @return bool - */ - protected function validateTimeRange(VObject\Node $component, $start, $end) { - - if (is_null($start)) { - $start = new DateTime('1900-01-01'); - } - if (is_null($end)) { - $end = new DateTime('3000-01-01'); - } - - switch($component->name) { - - case 'VEVENT' : - case 'VTODO' : - case 'VJOURNAL' : - - return $component->isInTimeRange($start, $end); - - case 'VALARM' : - - // If the valarm is wrapped in a recurring event, we need to - // expand the recursions, and validate each. - // - // Our datamodel doesn't easily allow us to do this straight - // in the VALARM component code, so this is a hack, and an - // expensive one too. - if ($component->parent->name === 'VEVENT' && $component->parent->RRULE) { - - // Fire up the iterator! - $it = new VObject\RecurrenceIterator($component->parent->parent, (string)$component->parent->UID); - while($it->valid()) { - $expandedEvent = $it->getEventObject(); - - // We need to check from these expanded alarms, which - // one is the first to trigger. Based on this, we can - // determine if we can 'give up' expanding events. - $firstAlarm = null; - if ($expandedEvent->VALARM !== null) { - foreach($expandedEvent->VALARM as $expandedAlarm) { - - $effectiveTrigger = $expandedAlarm->getEffectiveTriggerTime(); - if ($expandedAlarm->isInTimeRange($start, $end)) { - return true; - } - - if ((string)$expandedAlarm->TRIGGER['VALUE'] === 'DATE-TIME') { - // This is an alarm with a non-relative trigger - // time, likely created by a buggy client. The - // implication is that every alarm in this - // recurring event trigger at the exact same - // time. It doesn't make sense to traverse - // further. - } else { - // We store the first alarm as a means to - // figure out when we can stop traversing. - if (!$firstAlarm || $effectiveTrigger < $firstAlarm) { - $firstAlarm = $effectiveTrigger; - } - } - } - } - if (is_null($firstAlarm)) { - // No alarm was found. - // - // Or technically: No alarm that will change for - // every instance of the recurrence was found, - // which means we can assume there was no match. - return false; - } - if ($firstAlarm > $end) { - return false; - } - $it->next(); - } - return false; - } else { - return $component->isInTimeRange($start, $end); - } - - case 'VFREEBUSY' : - throw new \SabreForRainLoop\DAV\Exception\NotImplemented('time-range filters are currently not supported on ' . $component->name . ' components'); - - case 'COMPLETED' : - case 'CREATED' : - case 'DTEND' : - case 'DTSTAMP' : - case 'DTSTART' : - case 'DUE' : - case 'LAST-MODIFIED' : - return ($start <= $component->getDateTime() && $end >= $component->getDateTime()); - - - - default : - throw new \SabreForRainLoop\DAV\Exception\BadRequest('You cannot create a time-range filter on a ' . $component->name . ' component'); - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php deleted file mode 100644 index 69e01b1a4d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/CalendarRootNode.php +++ /dev/null @@ -1,77 +0,0 @@ -caldavBackend = $caldavBackend; - - } - - /** - * Returns the nodename - * - * We're overriding this, because the default will be the 'principalPrefix', - * and we want it to be SabreForRainLoop\CalDAV\Plugin::CALENDAR_ROOT - * - * @return string - */ - public function getName() { - - return Plugin::CALENDAR_ROOT; - - } - - /** - * This method returns a node for a principal. - * - * The passed array contains principal information, and is guaranteed to - * at least contain a uri item. Other properties may or may not be - * supplied by the authentication backend. - * - * @param array $principal - * @return \SabreForRainLoop\DAV\INode - */ - public function getChildForPrincipal(array $principal) { - - return new UserCalendars($this->caldavBackend, $principal); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Exception/InvalidComponentType.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Exception/InvalidComponentType.php deleted file mode 100644 index c7d0ea9204..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Exception/InvalidComponentType.php +++ /dev/null @@ -1,35 +0,0 @@ -ownerDocument; - - $np = $doc->createElementNS(CalDAV\Plugin::NS_CALDAV,'cal:supported-calendar-component'); - $errorNode->appendChild($np); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICSExportPlugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICSExportPlugin.php deleted file mode 100644 index 6e36274ed9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICSExportPlugin.php +++ /dev/null @@ -1,142 +0,0 @@ -server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'beforeMethod'), 90); - - } - - /** - * 'beforeMethod' event handles. This event handles intercepts GET requests ending - * with ?export - * - * @param string $method - * @param string $uri - * @return bool - */ - public function beforeMethod($method, $uri) { - - if ($method!='GET') return; - if ($this->server->httpRequest->getQueryString()!='export') return; - - // splitting uri - list($uri) = explode('?',$uri,2); - - $node = $this->server->tree->getNodeForPath($uri); - - if (!($node instanceof Calendar)) return; - - // Checking ACL, if available. - if ($aclPlugin = $this->server->getPlugin('acl')) { - $aclPlugin->checkPrivileges($uri, '{DAV:}read'); - } - - $this->server->httpResponse->setHeader('Content-Type','text/calendar'); - $this->server->httpResponse->sendStatus(200); - - $nodes = $this->server->getPropertiesForPath($uri, array( - '{' . Plugin::NS_CALDAV . '}calendar-data', - ),1); - - $this->server->httpResponse->sendBody($this->generateICS($nodes)); - - // Returning false to break the event chain - return false; - - } - - /** - * Merges all calendar objects, and builds one big ics export - * - * @param array $nodes - * @return string - */ - public function generateICS(array $nodes) { - - $calendar = new VObject\Component\VCalendar(); - $calendar->version = '2.0'; - if (DAV\Server::$exposeVersion) { - $calendar->prodid = '-//SabreDAV//SabreDAV ' . DAV\Version::VERSION . '//EN'; - } else { - $calendar->prodid = '-//SabreDAV//SabreDAV//EN'; - } - $calendar->calscale = 'GREGORIAN'; - - $collectedTimezones = array(); - - $timezones = array(); - $objects = array(); - - foreach($nodes as $node) { - - if (!isset($node[200]['{' . Plugin::NS_CALDAV . '}calendar-data'])) { - continue; - } - $nodeData = $node[200]['{' . Plugin::NS_CALDAV . '}calendar-data']; - - $nodeComp = VObject\Reader::read($nodeData); - - foreach($nodeComp->children() as $child) { - - switch($child->name) { - case 'VEVENT' : - case 'VTODO' : - case 'VJOURNAL' : - $objects[] = $child; - break; - - // VTIMEZONE is special, because we need to filter out the duplicates - case 'VTIMEZONE' : - // Naively just checking tzid. - if (in_array((string)$child->TZID, $collectedTimezones)) continue; - - $timezones[] = $child; - $collectedTimezones[] = $child->TZID; - break; - - } - - } - - } - - foreach($timezones as $tz) $calendar->add($tz); - foreach($objects as $obj) $calendar->add($obj); - - return $calendar->serialize(); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICalendar.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICalendar.php deleted file mode 100644 index e6de95b554..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ICalendar.php +++ /dev/null @@ -1,36 +0,0 @@ -caldavBackend = $caldavBackend; - $this->principalUri = $principalUri; - - } - - /** - * Returns all notifications for a principal - * - * @return array - */ - public function getChildren() { - - $children = array(); - $notifications = $this->caldavBackend->getNotificationsForPrincipal($this->principalUri); - - foreach($notifications as $notification) { - - $children[] = new Node( - $this->caldavBackend, - $this->principalUri, - $notification - ); - } - - return $children; - - } - - /** - * Returns the name of this object - * - * @return string - */ - public function getName() { - - return 'notifications'; - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalUri; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'principal' => $this->getOwner(), - 'privilege' => '{DAV:}read', - 'protected' => true, - ), - array( - 'principal' => $this->getOwner(), - 'privilege' => '{DAV:}write', - 'protected' => true, - ) - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's as an array argument. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\NotImplemented('Updating ACLs is not implemented here'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/ICollection.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/ICollection.php deleted file mode 100644 index f145f38891..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/ICollection.php +++ /dev/null @@ -1,24 +0,0 @@ -caldavBackend = $caldavBackend; - $this->principalUri = $principalUri; - $this->notification = $notification; - - } - - /** - * Returns the path name for this notification - * - * @return id - */ - public function getName() { - - return $this->notification->getId() . '.xml'; - - } - - /** - * Returns the etag for the notification. - * - * The etag must be surrounded by litteral double-quotes. - * - * @return string - */ - public function getETag() { - - return $this->notification->getETag(); - - } - - /** - * This method must return an xml element, using the - * SabreForRainLoop\CalDAV\Notifications\INotificationType classes. - * - * @return INotificationType - */ - public function getNotificationType() { - - return $this->notification; - - } - - /** - * Deletes this notification - * - * @return void - */ - public function delete() { - - $this->caldavBackend->deleteNotification($this->getOwner(), $this->notification); - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalUri; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'principal' => $this->getOwner(), - 'privilege' => '{DAV:}read', - 'protected' => true, - ), - array( - 'principal' => $this->getOwner(), - 'privilege' => '{DAV:}write', - 'protected' => true, - ) - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's as an array argument. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\NotImplemented('Updating ACLs is not implemented here'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/Invite.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/Invite.php deleted file mode 100644 index 262375506d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/Invite.php +++ /dev/null @@ -1,324 +0,0 @@ -$value) { - if (!property_exists($this, $key)) { - throw new \InvalidArgumentException('Unknown option: ' . $key); - } - $this->$key = $value; - } - - } - - /** - * Serializes the notification as a single property. - * - * You should usually just encode the single top-level element of the - * notification. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $node) { - - $prop = $node->ownerDocument->createElement('cs:invite-notification'); - $node->appendChild($prop); - - } - - /** - * This method serializes the entire notification, as it is used in the - * response body. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serializeBody(DAV\Server $server, \DOMElement $node) { - - $doc = $node->ownerDocument; - - $dt = $doc->createElement('cs:dtstamp'); - $this->dtStamp->setTimezone(new \DateTimezone('GMT')); - $dt->appendChild($doc->createTextNode($this->dtStamp->format('Ymd\\THis\\Z'))); - $node->appendChild($dt); - - $prop = $doc->createElement('cs:invite-notification'); - $node->appendChild($prop); - - $uid = $doc->createElement('cs:uid'); - $uid->appendChild( $doc->createTextNode($this->id) ); - $prop->appendChild($uid); - - $href = $doc->createElement('d:href'); - $href->appendChild( $doc->createTextNode( $this->href ) ); - $prop->appendChild($href); - - $nodeName = null; - switch($this->type) { - - case SharingPlugin::STATUS_ACCEPTED : - $nodeName = 'cs:invite-accepted'; - break; - case SharingPlugin::STATUS_DECLINED : - $nodeName = 'cs:invite-declined'; - break; - case SharingPlugin::STATUS_DELETED : - $nodeName = 'cs:invite-deleted'; - break; - case SharingPlugin::STATUS_NORESPONSE : - $nodeName = 'cs:invite-noresponse'; - break; - - } - $prop->appendChild( - $doc->createElement($nodeName) - ); - $hostHref = $doc->createElement('d:href', $server->getBaseUri() . $this->hostUrl); - $hostUrl = $doc->createElement('cs:hosturl'); - $hostUrl->appendChild($hostHref); - $prop->appendChild($hostUrl); - - $access = $doc->createElement('cs:access'); - if ($this->readOnly) { - $access->appendChild($doc->createElement('cs:read')); - } else { - $access->appendChild($doc->createElement('cs:read-write')); - } - $prop->appendChild($access); - - $organizerUrl = $doc->createElement('cs:organizer'); - // If the organizer contains a 'mailto:' part, it means it should be - // treated as absolute. - if (strtolower(substr($this->organizer,0,7))==='mailto:') { - $organizerHref = new DAV\Property\Href($this->organizer, false); - } else { - $organizerHref = new DAV\Property\Href($this->organizer, true); - } - $organizerHref->serialize($server, $organizerUrl); - - if ($this->commonName) { - $commonName = $doc->createElement('cs:common-name'); - $commonName->appendChild($doc->createTextNode($this->commonName)); - $organizerUrl->appendChild($commonName); - - $commonNameOld = $doc->createElement('cs:organizer-cn'); - $commonNameOld->appendChild($doc->createTextNode($this->commonName)); - $prop->appendChild($commonNameOld); - - } - if ($this->firstName) { - $firstName = $doc->createElement('cs:first-name'); - $firstName->appendChild($doc->createTextNode($this->firstName)); - $organizerUrl->appendChild($firstName); - - $firstNameOld = $doc->createElement('cs:organizer-first'); - $firstNameOld->appendChild($doc->createTextNode($this->firstName)); - $prop->appendChild($firstNameOld); - } - if ($this->lastName) { - $lastName = $doc->createElement('cs:last-name'); - $lastName->appendChild($doc->createTextNode($this->lastName)); - $organizerUrl->appendChild($lastName); - - $lastNameOld = $doc->createElement('cs:organizer-last'); - $lastNameOld->appendChild($doc->createTextNode($this->lastName)); - $prop->appendChild($lastNameOld); - } - $prop->appendChild($organizerUrl); - - if ($this->summary) { - $summary = $doc->createElement('cs:summary'); - $summary->appendChild($doc->createTextNode($this->summary)); - $prop->appendChild($summary); - } - if ($this->supportedComponents) { - - $xcomp = $doc->createElement('cal:supported-calendar-component-set'); - $this->supportedComponents->serialize($server, $xcomp); - $prop->appendChild($xcomp); - - } - - } - - /** - * Returns a unique id for this notification - * - * This is just the base url. This should generally be some kind of unique - * id. - * - * @return string - */ - public function getId() { - - return $this->id; - - } - - /** - * Returns the ETag for this notification. - * - * The ETag must be surrounded by literal double-quotes. - * - * @return string - */ - public function getETag() { - - return $this->etag; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/InviteReply.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/InviteReply.php deleted file mode 100644 index 3964c9406d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/InviteReply.php +++ /dev/null @@ -1,218 +0,0 @@ -$value) { - if (!property_exists($this, $key)) { - throw new \InvalidArgumentException('Unknown option: ' . $key); - } - $this->$key = $value; - } - - } - - /** - * Serializes the notification as a single property. - * - * You should usually just encode the single top-level element of the - * notification. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $node) { - - $prop = $node->ownerDocument->createElement('cs:invite-reply'); - $node->appendChild($prop); - - } - - /** - * This method serializes the entire notification, as it is used in the - * response body. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serializeBody(DAV\Server $server, \DOMElement $node) { - - $doc = $node->ownerDocument; - - $dt = $doc->createElement('cs:dtstamp'); - $this->dtStamp->setTimezone(new \DateTimezone('GMT')); - $dt->appendChild($doc->createTextNode($this->dtStamp->format('Ymd\\THis\\Z'))); - $node->appendChild($dt); - - $prop = $doc->createElement('cs:invite-reply'); - $node->appendChild($prop); - - $uid = $doc->createElement('cs:uid'); - $uid->appendChild($doc->createTextNode($this->id)); - $prop->appendChild($uid); - - $inReplyTo = $doc->createElement('cs:in-reply-to'); - $inReplyTo->appendChild( $doc->createTextNode($this->inReplyTo) ); - $prop->appendChild($inReplyTo); - - $href = $doc->createElement('d:href'); - $href->appendChild( $doc->createTextNode($this->href) ); - $prop->appendChild($href); - - $nodeName = null; - switch($this->type) { - - case SharingPlugin::STATUS_ACCEPTED : - $nodeName = 'cs:invite-accepted'; - break; - case SharingPlugin::STATUS_DECLINED : - $nodeName = 'cs:invite-declined'; - break; - - } - $prop->appendChild( - $doc->createElement($nodeName) - ); - $hostHref = $doc->createElement('d:href', $server->getBaseUri() . $this->hostUrl); - $hostUrl = $doc->createElement('cs:hosturl'); - $hostUrl->appendChild($hostHref); - $prop->appendChild($hostUrl); - - if ($this->summary) { - $summary = $doc->createElement('cs:summary'); - $summary->appendChild($doc->createTextNode($this->summary)); - $prop->appendChild($summary); - } - - } - - /** - * Returns a unique id for this notification - * - * This is just the base url. This should generally be some kind of unique - * id. - * - * @return string - */ - public function getId() { - - return $this->id; - - } - - /** - * Returns the ETag for this notification. - * - * The ETag must be surrounded by literal double-quotes. - * - * @return string - */ - public function getETag() { - - return $this->etag; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/SystemStatus.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/SystemStatus.php deleted file mode 100644 index dfe571a527..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Notifications/Notification/SystemStatus.php +++ /dev/null @@ -1,182 +0,0 @@ -id = $id; - $this->type = $type; - $this->description = $description; - $this->href = $href; - $this->etag = $etag; - - } - - /** - * Serializes the notification as a single property. - * - * You should usually just encode the single top-level element of the - * notification. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $node) { - - switch($this->type) { - case self::TYPE_LOW : - $type = 'low'; - break; - case self::TYPE_MEDIUM : - $type = 'medium'; - break; - default : - case self::TYPE_HIGH : - $type = 'high'; - break; - } - - $prop = $node->ownerDocument->createElement('cs:systemstatus'); - $prop->setAttribute('type', $type); - - $node->appendChild($prop); - - } - - /** - * This method serializes the entire notification, as it is used in the - * response body. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serializeBody(DAV\Server $server, \DOMElement $node) { - - switch($this->type) { - case self::TYPE_LOW : - $type = 'low'; - break; - case self::TYPE_MEDIUM : - $type = 'medium'; - break; - default : - case self::TYPE_HIGH : - $type = 'high'; - break; - } - - $prop = $node->ownerDocument->createElement('cs:systemstatus'); - $prop->setAttribute('type', $type); - - if ($this->description) { - $text = $node->ownerDocument->createTextNode($this->description); - $desc = $node->ownerDocument->createElement('cs:description'); - $desc->appendChild($text); - $prop->appendChild($desc); - } - if ($this->href) { - $text = $node->ownerDocument->createTextNode($this->href); - $href = $node->ownerDocument->createElement('d:href'); - $href->appendChild($text); - $prop->appendChild($href); - } - - $node->appendChild($prop); - - } - - /** - * Returns a unique id for this notification - * - * This is just the base url. This should generally be some kind of unique - * id. - * - * @return string - */ - public function getId() { - - return $this->id; - - } - - /* - * Returns the ETag for this notification. - * - * The ETag must be surrounded by literal double-quotes. - * - * @return string - */ - public function getETag() { - - return $this->etag; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Plugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Plugin.php deleted file mode 100644 index 9ed5695523..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Plugin.php +++ /dev/null @@ -1,1338 +0,0 @@ -imipHandler = $imipHandler; - - } - - /** - * Use this method to tell the server this plugin defines additional - * HTTP methods. - * - * This method is passed a uri. It should only return HTTP methods that are - * available for the specified uri. - * - * @param string $uri - * @return array - */ - public function getHTTPMethods($uri) { - - // The MKCALENDAR is only available on unmapped uri's, whose - // parents extend IExtendedCollection - list($parent, $name) = DAV\URLUtil::splitPath($uri); - - $node = $this->server->tree->getNodeForPath($parent); - - if ($node instanceof DAV\IExtendedCollection) { - try { - $node->getChild($name); - } catch (DAV\Exception\NotFound $e) { - return array('MKCALENDAR'); - } - } - return array(); - - } - - /** - * Returns a list of features for the DAV: HTTP header. - * - * @return array - */ - public function getFeatures() { - - return array('calendar-access', 'calendar-proxy'); - - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() { - - return 'caldav'; - - } - - /** - * Returns a list of reports this plugin supports. - * - * This will be used in the {DAV:}supported-report-set property. - * Note that you still need to subscribe to the 'report' event to actually - * implement them - * - * @param string $uri - * @return array - */ - public function getSupportedReportSet($uri) { - - $node = $this->server->tree->getNodeForPath($uri); - - $reports = array(); - if ($node instanceof ICalendar || $node instanceof ICalendarObject) { - $reports[] = '{' . self::NS_CALDAV . '}calendar-multiget'; - $reports[] = '{' . self::NS_CALDAV . '}calendar-query'; - } - if ($node instanceof ICalendar) { - $reports[] = '{' . self::NS_CALDAV . '}free-busy-query'; - } - return $reports; - - } - - /** - * Initializes the plugin - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - - $server->subscribeEvent('unknownMethod',array($this,'unknownMethod')); - //$server->subscribeEvent('unknownMethod',array($this,'unknownMethod2'),1000); - $server->subscribeEvent('report',array($this,'report')); - $server->subscribeEvent('beforeGetProperties',array($this,'beforeGetProperties')); - $server->subscribeEvent('onHTMLActionsPanel', array($this,'htmlActionsPanel')); - $server->subscribeEvent('onBrowserPostAction', array($this,'browserPostAction')); - $server->subscribeEvent('beforeWriteContent', array($this, 'beforeWriteContent')); - $server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile')); - $server->subscribeEvent('beforeMethod', array($this,'beforeMethod')); - - $server->xmlNamespaces[self::NS_CALDAV] = 'cal'; - $server->xmlNamespaces[self::NS_CALENDARSERVER] = 'cs'; - - $server->propertyMap['{' . self::NS_CALDAV . '}supported-calendar-component-set'] = 'SabreForRainLoop\\CalDAV\\Property\\SupportedCalendarComponentSet'; - $server->propertyMap['{' . self::NS_CALDAV . '}schedule-calendar-transp'] = 'SabreForRainLoop\\CalDAV\\Property\\ScheduleCalendarTransp'; - - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\ICalendar'] = '{urn:ietf:params:xml:ns:caldav}calendar'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Schedule\\IOutbox'] = '{urn:ietf:params:xml:ns:caldav}schedule-outbox'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Principal\\IProxyRead'] = '{http://calendarserver.org/ns/}calendar-proxy-read'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Principal\\IProxyWrite'] = '{http://calendarserver.org/ns/}calendar-proxy-write'; - $server->resourceTypeMapping['\\SabreForRainLoop\\CalDAV\\Notifications\\ICollection'] = '{' . self::NS_CALENDARSERVER . '}notification'; - - array_push($server->protectedProperties, - - '{' . self::NS_CALDAV . '}supported-calendar-component-set', - '{' . self::NS_CALDAV . '}supported-calendar-data', - '{' . self::NS_CALDAV . '}max-resource-size', - '{' . self::NS_CALDAV . '}min-date-time', - '{' . self::NS_CALDAV . '}max-date-time', - '{' . self::NS_CALDAV . '}max-instances', - '{' . self::NS_CALDAV . '}max-attendees-per-instance', - '{' . self::NS_CALDAV . '}calendar-home-set', - '{' . self::NS_CALDAV . '}supported-collation-set', - '{' . self::NS_CALDAV . '}calendar-data', - - // scheduling extension - '{' . self::NS_CALDAV . '}schedule-inbox-URL', - '{' . self::NS_CALDAV . '}schedule-outbox-URL', - '{' . self::NS_CALDAV . '}calendar-user-address-set', - '{' . self::NS_CALDAV . '}calendar-user-type', - - // CalendarServer extensions - '{' . self::NS_CALENDARSERVER . '}getctag', - '{' . self::NS_CALENDARSERVER . '}calendar-proxy-read-for', - '{' . self::NS_CALENDARSERVER . '}calendar-proxy-write-for', - '{' . self::NS_CALENDARSERVER . '}notification-URL', - '{' . self::NS_CALENDARSERVER . '}notificationtype' - - ); - } - - /** - * This function handles support for the MKCALENDAR method - * - * @param string $method - * @param string $uri - * @return bool - */ - public function unknownMethod($method, $uri) { - - switch ($method) { - case 'MKCALENDAR' : - $this->httpMkCalendar($uri); - // false is returned to stop the propagation of the - // unknownMethod event. - return false; - case 'POST' : - - // Checking if this is a text/calendar content type - $contentType = $this->server->httpRequest->getHeader('Content-Type'); - if (strpos($contentType, 'text/calendar')!==0) { - return; - } - - // Checking if we're talking to an outbox - try { - $node = $this->server->tree->getNodeForPath($uri); - } catch (DAV\Exception\NotFound $e) { - return; - } - if (!$node instanceof Schedule\IOutbox) - return; - - $this->outboxRequest($node, $uri); - return false; - - } - - } - - /** - * This functions handles REPORT requests specific to CalDAV - * - * @param string $reportName - * @param \DOMNode $dom - * @return bool - */ - public function report($reportName,$dom) { - - switch($reportName) { - case '{'.self::NS_CALDAV.'}calendar-multiget' : - $this->calendarMultiGetReport($dom); - return false; - case '{'.self::NS_CALDAV.'}calendar-query' : - $this->calendarQueryReport($dom); - return false; - case '{'.self::NS_CALDAV.'}free-busy-query' : - $this->freeBusyQueryReport($dom); - return false; - - } - - - } - - /** - * This function handles the MKCALENDAR HTTP method, which creates - * a new calendar. - * - * @param string $uri - * @return void - */ - public function httpMkCalendar($uri) { - - // Due to unforgivable bugs in iCal, we're completely disabling MKCALENDAR support - // for clients matching iCal in the user agent - //$ua = $this->server->httpRequest->getHeader('User-Agent'); - //if (strpos($ua,'iCal/')!==false) { - // throw new \SabreForRainLoop\DAV\Exception\Forbidden('iCal has major bugs in it\'s RFC3744 support. Therefore we are left with no other choice but disabling this feature.'); - //} - - $body = $this->server->httpRequest->getBody(true); - $properties = array(); - - if ($body) { - - $dom = DAV\XMLUtil::loadDOMDocument($body); - - foreach($dom->firstChild->childNodes as $child) { - - if (DAV\XMLUtil::toClarkNotation($child)!=='{DAV:}set') continue; - foreach(DAV\XMLUtil::parseProperties($child,$this->server->propertyMap) as $k=>$prop) { - $properties[$k] = $prop; - } - - } - } - - $resourceType = array('{DAV:}collection','{urn:ietf:params:xml:ns:caldav}calendar'); - - $this->server->createCollection($uri,$resourceType,$properties); - - $this->server->httpResponse->sendStatus(201); - $this->server->httpResponse->setHeader('Content-Length',0); - } - - /** - * beforeGetProperties - * - * This method handler is invoked before any after properties for a - * resource are fetched. This allows us to add in any CalDAV specific - * properties. - * - * @param string $path - * @param DAV\INode $node - * @param array $requestedProperties - * @param array $returnedProperties - * @return void - */ - public function beforeGetProperties($path, DAV\INode $node, &$requestedProperties, &$returnedProperties) { - - if ($node instanceof DAVACL\IPrincipal) { - - // calendar-home-set property - $calHome = '{' . self::NS_CALDAV . '}calendar-home-set'; - if (in_array($calHome,$requestedProperties)) { - $principalId = $node->getName(); - $calendarHomePath = self::CALENDAR_ROOT . '/' . $principalId . '/'; - - unset($requestedProperties[array_search($calHome, $requestedProperties)]); - $returnedProperties[200][$calHome] = new DAV\Property\Href($calendarHomePath); - - } - - // schedule-outbox-URL property - $scheduleProp = '{' . self::NS_CALDAV . '}schedule-outbox-URL'; - if (in_array($scheduleProp,$requestedProperties)) { - $principalId = $node->getName(); - $outboxPath = self::CALENDAR_ROOT . '/' . $principalId . '/outbox'; - - unset($requestedProperties[array_search($scheduleProp, $requestedProperties)]); - $returnedProperties[200][$scheduleProp] = new DAV\Property\Href($outboxPath); - - } - - // calendar-user-address-set property - $calProp = '{' . self::NS_CALDAV . '}calendar-user-address-set'; - if (in_array($calProp,$requestedProperties)) { - - $addresses = $node->getAlternateUriSet(); - $addresses[] = $this->server->getBaseUri() . DAV\URLUtil::encodePath($node->getPrincipalUrl() . '/'); - unset($requestedProperties[array_search($calProp, $requestedProperties)]); - $returnedProperties[200][$calProp] = new DAV\Property\HrefList($addresses, false); - - } - - // These two properties are shortcuts for ical to easily find - // other principals this principal has access to. - $propRead = '{' . self::NS_CALENDARSERVER . '}calendar-proxy-read-for'; - $propWrite = '{' . self::NS_CALENDARSERVER . '}calendar-proxy-write-for'; - if (in_array($propRead,$requestedProperties) || in_array($propWrite,$requestedProperties)) { - - $aclPlugin = $this->server->getPlugin('acl'); - $membership = $aclPlugin->getPrincipalMembership($path); - $readList = array(); - $writeList = array(); - - foreach($membership as $group) { - - $groupNode = $this->server->tree->getNodeForPath($group); - - // If the node is either ap proxy-read or proxy-write - // group, we grab the parent principal and add it to the - // list. - if ($groupNode instanceof Principal\IProxyRead) { - list($readList[]) = DAV\URLUtil::splitPath($group); - } - if ($groupNode instanceof Principal\IProxyWrite) { - list($writeList[]) = DAV\URLUtil::splitPath($group); - } - - } - if (in_array($propRead,$requestedProperties)) { - unset($requestedProperties[$propRead]); - $returnedProperties[200][$propRead] = new DAV\Property\HrefList($readList); - } - if (in_array($propWrite,$requestedProperties)) { - unset($requestedProperties[$propWrite]); - $returnedProperties[200][$propWrite] = new DAV\Property\HrefList($writeList); - } - - } - - // notification-URL property - $notificationUrl = '{' . self::NS_CALENDARSERVER . '}notification-URL'; - if (($index = array_search($notificationUrl, $requestedProperties)) !== false) { - $principalId = $node->getName(); - $calendarHomePath = 'calendars/' . $principalId . '/notifications/'; - unset($requestedProperties[$index]); - $returnedProperties[200][$notificationUrl] = new DAV\Property\Href($calendarHomePath); - } - - } // instanceof IPrincipal - - if ($node instanceof Notifications\INode) { - - $propertyName = '{' . self::NS_CALENDARSERVER . '}notificationtype'; - if (($index = array_search($propertyName, $requestedProperties)) !== false) { - - $returnedProperties[200][$propertyName] = - $node->getNotificationType(); - - unset($requestedProperties[$index]); - - } - - } // instanceof Notifications_INode - - - if ($node instanceof ICalendarObject) { - // The calendar-data property is not supposed to be a 'real' - // property, but in large chunks of the spec it does act as such. - // Therefore we simply expose it as a property. - $calDataProp = '{' . Plugin::NS_CALDAV . '}calendar-data'; - if (in_array($calDataProp, $requestedProperties)) { - unset($requestedProperties[$calDataProp]); - $val = $node->get(); - if (is_resource($val)) - $val = stream_get_contents($val); - - // Taking out \r to not screw up the xml output - $returnedProperties[200][$calDataProp] = str_replace("\r","", $val); - - } - } - - } - - /** - * This function handles the calendar-multiget REPORT. - * - * This report is used by the client to fetch the content of a series - * of urls. Effectively avoiding a lot of redundant requests. - * - * @param \DOMNode $dom - * @return void - */ - public function calendarMultiGetReport($dom) { - - $properties = array_keys(DAV\XMLUtil::parseProperties($dom->firstChild)); - $hrefElems = $dom->getElementsByTagNameNS('urn:DAV','href'); - - $xpath = new \DOMXPath($dom); - $xpath->registerNameSpace('cal',Plugin::NS_CALDAV); - $xpath->registerNameSpace('dav','urn:DAV'); - - $expand = $xpath->query('/cal:calendar-multiget/dav:prop/cal:calendar-data/cal:expand'); - if ($expand->length>0) { - $expandElem = $expand->item(0); - $start = $expandElem->getAttribute('start'); - $end = $expandElem->getAttribute('end'); - if(!$start || !$end) { - throw new DAV\Exception\BadRequest('The "start" and "end" attributes are required for the CALDAV:expand element'); - } - $start = VObject\DateTimeParser::parseDateTime($start); - $end = VObject\DateTimeParser::parseDateTime($end); - - if ($end <= $start) { - throw new DAV\Exception\BadRequest('The end-date must be larger than the start-date in the expand element.'); - } - - $expand = true; - - } else { - - $expand = false; - - } - - foreach($hrefElems as $elem) { - $uri = $this->server->calculateUri($elem->nodeValue); - list($objProps) = $this->server->getPropertiesForPath($uri,$properties); - - if ($expand && isset($objProps[200]['{' . self::NS_CALDAV . '}calendar-data'])) { - $vObject = VObject\Reader::read($objProps[200]['{' . self::NS_CALDAV . '}calendar-data']); - $vObject->expand($start, $end); - $objProps[200]['{' . self::NS_CALDAV . '}calendar-data'] = $vObject->serialize(); - } - - $propertyList[]=$objProps; - - } - - $prefer = $this->server->getHTTPPRefer(); - - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Vary','Brief,Prefer'); - $this->server->httpResponse->sendBody($this->server->generateMultiStatus($propertyList, $prefer['return-minimal'])); - - } - - /** - * This function handles the calendar-query REPORT - * - * This report is used by clients to request calendar objects based on - * complex conditions. - * - * @param \DOMNode $dom - * @return void - */ - public function calendarQueryReport($dom) { - - $parser = new CalendarQueryParser($dom); - $parser->parse(); - - $node = $this->server->tree->getNodeForPath($this->server->getRequestUri()); - $depth = $this->server->getHTTPDepth(0); - - // The default result is an empty array - $result = array(); - - // The calendarobject was requested directly. In this case we handle - // this locally. - if ($depth == 0 && $node instanceof ICalendarObject) { - - $requestedCalendarData = true; - $requestedProperties = $parser->requestedProperties; - - if (!in_array('{urn:ietf:params:xml:ns:caldav}calendar-data', $requestedProperties)) { - - // We always retrieve calendar-data, as we need it for filtering. - $requestedProperties[] = '{urn:ietf:params:xml:ns:caldav}calendar-data'; - - // If calendar-data wasn't explicitly requested, we need to remove - // it after processing. - $requestedCalendarData = false; - } - - $properties = $this->server->getPropertiesForPath( - $this->server->getRequestUri(), - $requestedProperties, - 0 - ); - - // This array should have only 1 element, the first calendar - // object. - $properties = current($properties); - - // If there wasn't any calendar-data returned somehow, we ignore - // this. - if (isset($properties[200]['{urn:ietf:params:xml:ns:caldav}calendar-data'])) { - - $validator = new CalendarQueryValidator(); - - $vObject = VObject\Reader::read($properties[200]['{urn:ietf:params:xml:ns:caldav}calendar-data']); - if ($validator->validate($vObject,$parser->filters)) { - - // If the client didn't require the calendar-data property, - // we won't give it back. - if (!$requestedCalendarData) { - unset($properties[200]['{urn:ietf:params:xml:ns:caldav}calendar-data']); - } else { - if ($parser->expand) { - $vObject->expand($parser->expand['start'], $parser->expand['end']); - $properties[200]['{' . self::NS_CALDAV . '}calendar-data'] = $vObject->serialize(); - } - } - - $result = array($properties); - - } - - } - - } - // If we're dealing with a calendar, the calendar itself is responsible - // for the calendar-query. - if ($node instanceof ICalendar && $depth = 1) { - - $nodePaths = $node->calendarQuery($parser->filters); - - foreach($nodePaths as $path) { - - list($properties) = - $this->server->getPropertiesForPath($this->server->getRequestUri() . '/' . $path, $parser->requestedProperties); - - if ($parser->expand) { - // We need to do some post-processing - $vObject = VObject\Reader::read($properties[200]['{urn:ietf:params:xml:ns:caldav}calendar-data']); - $vObject->expand($parser->expand['start'], $parser->expand['end']); - $properties[200]['{' . self::NS_CALDAV . '}calendar-data'] = $vObject->serialize(); - } - - $result[] = $properties; - - } - - } - - $prefer = $this->server->getHTTPPRefer(); - - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Vary','Brief,Prefer'); - $this->server->httpResponse->sendBody($this->server->generateMultiStatus($result, $prefer['return-minimal'])); - - } - - /** - * This method is responsible for parsing the request and generating the - * response for the CALDAV:free-busy-query REPORT. - * - * @param \DOMNode $dom - * @return void - */ - protected function freeBusyQueryReport(\DOMNode $dom) { - - $start = null; - $end = null; - - foreach($dom->firstChild->childNodes as $childNode) { - - $clark = DAV\XMLUtil::toClarkNotation($childNode); - if ($clark == '{' . self::NS_CALDAV . '}time-range') { - $start = $childNode->getAttribute('start'); - $end = $childNode->getAttribute('end'); - break; - } - - } - if ($start) { - $start = VObject\DateTimeParser::parseDateTime($start); - } - if ($end) { - $end = VObject\DateTimeParser::parseDateTime($end); - } - - if (!$start && !$end) { - throw new DAV\Exception\BadRequest('The freebusy report must have a time-range filter'); - } - $acl = $this->server->getPlugin('acl'); - - if (!$acl) { - throw new DAV\Exception('The ACL plugin must be loaded for free-busy queries to work'); - } - $uri = $this->server->getRequestUri(); - $acl->checkPrivileges($uri,'{' . self::NS_CALDAV . '}read-free-busy'); - - $calendar = $this->server->tree->getNodeForPath($uri); - if (!$calendar instanceof ICalendar) { - throw new DAV\Exception\NotImplemented('The free-busy-query REPORT is only implemented on calendars'); - } - - // Doing a calendar-query first, to make sure we get the most - // performance. - $urls = $calendar->calendarQuery(array( - 'name' => 'VCALENDAR', - 'comp-filters' => array( - array( - 'name' => 'VEVENT', - 'comp-filters' => array(), - 'prop-filters' => array(), - 'is-not-defined' => false, - 'time-range' => array( - 'start' => $start, - 'end' => $end, - ), - ), - ), - 'prop-filters' => array(), - 'is-not-defined' => false, - 'time-range' => null, - )); - - $objects = array_map(function($url) use ($calendar) { - $obj = $calendar->getChild($url)->get(); - return $obj; - }, $urls); - - $generator = new VObject\FreeBusyGenerator(); - $generator->setObjects($objects); - $generator->setTimeRange($start, $end); - $result = $generator->getResult(); - $result = $result->serialize(); - - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->setHeader('Content-Type', 'text/calendar'); - $this->server->httpResponse->setHeader('Content-Length', strlen($result)); - $this->server->httpResponse->sendBody($result); - - } - - /** - * This method is triggered before a file gets updated with new content. - * - * This plugin uses this method to ensure that CalDAV objects receive - * valid calendar data. - * - * @param string $path - * @param DAV\IFile $node - * @param resource $data - * @return void - */ - public function beforeWriteContent($path, DAV\IFile $node, &$data) { - - if (!$node instanceof ICalendarObject) - return; - - $this->validateICalendar($data, $path); - - } - - /** - * This method is triggered before a new file is created. - * - * This plugin uses this method to ensure that newly created calendar - * objects contain valid calendar data. - * - * @param string $path - * @param resource $data - * @param DAV\ICollection $parentNode - * @return void - */ - public function beforeCreateFile($path, &$data, DAV\ICollection $parentNode) { - - if (!$parentNode instanceof Calendar) - return; - - $this->validateICalendar($data, $path); - - } - - /** - * This event is triggered before any HTTP request is handled. - * - * We use this to intercept GET calls to notification nodes, and return the - * proper response. - * - * @param string $method - * @param string $path - * @return void - */ - public function beforeMethod($method, $path) { - - if ($method!=='GET') return; - - try { - $node = $this->server->tree->getNodeForPath($path); - } catch (DAV\Exception\NotFound $e) { - return; - } - - if (!$node instanceof Notifications\INode) - return; - - if (!$this->server->checkPreconditions(true)) return false; - $dom = new \DOMDocument('1.0', 'UTF-8'); - - $dom->formatOutput = true; - - $root = $dom->createElement('cs:notification'); - foreach($this->server->xmlNamespaces as $namespace => $prefix) { - $root->setAttribute('xmlns:' . $prefix, $namespace); - } - - $dom->appendChild($root); - $node->getNotificationType()->serializeBody($this->server, $root); - - $this->server->httpResponse->setHeader('Content-Type','application/xml'); - $this->server->httpResponse->setHeader('ETag',$node->getETag()); - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->sendBody($dom->saveXML()); - - return false; - - } - - /** - * Checks if the submitted iCalendar data is in fact, valid. - * - * An exception is thrown if it's not. - * - * @param resource|string $data - * @param string $path - * @return void - */ - protected function validateICalendar(&$data, $path) { - - // If it's a stream, we convert it to a string first. - if (is_resource($data)) { - $data = stream_get_contents($data); - } - - // Converting the data to unicode, if needed. - $data = DAV\StringUtil::ensureUTF8($data); - - try { - - $vobj = VObject\Reader::read($data); - - } catch (VObject\ParseException $e) { - - throw new DAV\Exception\UnsupportedMediaType('This resource only supports valid iCalendar 2.0 data. Parse error: ' . $e->getMessage()); - - } - - if ($vobj->name !== 'VCALENDAR') { - throw new DAV\Exception\UnsupportedMediaType('This collection can only support iCalendar objects.'); - } - - // Get the Supported Components for the target calendar - list($parentPath,$object) = DAV\URLUtil::splitPath($path); - $calendarProperties = $this->server->getProperties($parentPath,array('{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set')); - $supportedComponents = $calendarProperties['{urn:ietf:params:xml:ns:caldav}supported-calendar-component-set']->getValue(); - - $foundType = null; - $foundUID = null; - foreach($vobj->getComponents() as $component) { - switch($component->name) { - case 'VTIMEZONE' : - continue 2; - case 'VEVENT' : - case 'VTODO' : - case 'VJOURNAL' : - if (is_null($foundType)) { - $foundType = $component->name; - if (!in_array($foundType, $supportedComponents)) { - throw new Exception\InvalidComponentType('This calendar only supports ' . implode(', ', $supportedComponents) . '. We found a ' . $foundType); - } - if (!isset($component->UID)) { - throw new DAV\Exception\BadRequest('Every ' . $component->name . ' component must have an UID'); - } - $foundUID = (string)$component->UID; - } else { - if ($foundType !== $component->name) { - throw new DAV\Exception\BadRequest('A calendar object must only contain 1 component. We found a ' . $component->name . ' as well as a ' . $foundType); - } - if ($foundUID !== (string)$component->UID) { - throw new DAV\Exception\BadRequest('Every ' . $component->name . ' in this object must have identical UIDs'); - } - } - break; - default : - throw new DAV\Exception\BadRequest('You are not allowed to create components of type: ' . $component->name . ' here'); - - } - } - if (!$foundType) - throw new DAV\Exception\BadRequest('iCalendar object must contain at least 1 of VEVENT, VTODO or VJOURNAL'); - - } - - /** - * This method handles POST requests to the schedule-outbox. - * - * Currently, two types of requests are support: - * * FREEBUSY requests from RFC 6638 - * * Simple iTIP messages from draft-desruisseaux-caldav-sched-04 - * - * The latter is from an expired early draft of the CalDAV scheduling - * extensions, but iCal depends on a feature from that spec, so we - * implement it. - * - * @param Schedule\IOutbox $outboxNode - * @param string $outboxUri - * @return void - */ - public function outboxRequest(Schedule\IOutbox $outboxNode, $outboxUri) { - - // Parsing the request body - try { - $vObject = VObject\Reader::read($this->server->httpRequest->getBody(true)); - } catch (VObject\ParseException $e) { - throw new DAV\Exception\BadRequest('The request body must be a valid iCalendar object. Parse error: ' . $e->getMessage()); - } - - // The incoming iCalendar object must have a METHOD property, and a - // component. The combination of both determines what type of request - // this is. - $componentType = null; - foreach($vObject->getComponents() as $component) { - if ($component->name !== 'VTIMEZONE') { - $componentType = $component->name; - break; - } - } - if (is_null($componentType)) { - throw new DAV\Exception\BadRequest('We expected at least one VTODO, VJOURNAL, VFREEBUSY or VEVENT component'); - } - - // Validating the METHOD - $method = strtoupper((string)$vObject->METHOD); - if (!$method) { - throw new DAV\Exception\BadRequest('A METHOD property must be specified in iTIP messages'); - } - - // So we support two types of requests: - // - // REQUEST with a VFREEBUSY component - // REQUEST, REPLY, ADD, CANCEL on VEVENT components - - $acl = $this->server->getPlugin('acl'); - - if ($componentType === 'VFREEBUSY' && $method === 'REQUEST') { - - $acl && $acl->checkPrivileges($outboxUri,'{' . Plugin::NS_CALDAV . '}schedule-query-freebusy'); - $this->handleFreeBusyRequest($outboxNode, $vObject); - - } elseif ($componentType === 'VEVENT' && in_array($method, array('REQUEST','REPLY','ADD','CANCEL'))) { - - $acl && $acl->checkPrivileges($outboxUri,'{' . Plugin::NS_CALDAV . '}schedule-post-vevent'); - $this->handleEventNotification($outboxNode, $vObject); - - } else { - - throw new DAV\Exception\NotImplemented('SabreDAV supports only VFREEBUSY (REQUEST) and VEVENT (REQUEST, REPLY, ADD, CANCEL)'); - - } - - } - - /** - * This method handles the REQUEST, REPLY, ADD and CANCEL methods for - * VEVENT iTip messages. - * - * @return void - */ - protected function handleEventNotification(Schedule\IOutbox $outboxNode, VObject\Component $vObject) { - - $originator = $this->server->httpRequest->getHeader('Originator'); - $recipients = $this->server->httpRequest->getHeader('Recipient'); - - if (!$originator) { - throw new DAV\Exception\BadRequest('The Originator: header must be specified when making POST requests'); - } - if (!$recipients) { - throw new DAV\Exception\BadRequest('The Recipient: header must be specified when making POST requests'); - } - - $recipients = explode(',',$recipients); - foreach($recipients as $k=>$recipient) { - - $recipient = trim($recipient); - if (!preg_match('/^mailto:(.*)@(.*)$/i', $recipient)) { - throw new DAV\Exception\BadRequest('Recipients must start with mailto: and must be valid email address'); - } - $recipient = substr($recipient, 7); - $recipients[$k] = $recipient; - } - - // We need to make sure that 'originator' matches one of the email - // addresses of the selected principal. - $principal = $outboxNode->getOwner(); - $props = $this->server->getProperties($principal,array( - '{' . self::NS_CALDAV . '}calendar-user-address-set', - )); - - $addresses = array(); - if (isset($props['{' . self::NS_CALDAV . '}calendar-user-address-set'])) { - $addresses = $props['{' . self::NS_CALDAV . '}calendar-user-address-set']->getHrefs(); - } - - $found = false; - foreach($addresses as $address) { - - // Trimming the / on both sides, just in case.. - if (rtrim(strtolower($originator),'/') === rtrim(strtolower($address),'/')) { - $found = true; - break; - } - - } - - if (!$found) { - throw new DAV\Exception\Forbidden('The addresses specified in the Originator header did not match any addresses in the owners calendar-user-address-set header'); - } - - // If the Originator header was a url, and not a mailto: address.. - // we're going to try to pull the mailto: from the vobject body. - if (strtolower(substr($originator,0,7)) !== 'mailto:') { - $originator = (string)$vObject->VEVENT->ORGANIZER; - - } - if (strtolower(substr($originator,0,7)) !== 'mailto:') { - throw new DAV\Exception\Forbidden('Could not find mailto: address in both the Orignator header, and the ORGANIZER property in the VEVENT'); - } - $originator = substr($originator,7); - - $result = $this->iMIPMessage($originator, $recipients, $vObject, $principal); - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->setHeader('Content-Type','application/xml'); - $this->server->httpResponse->sendBody($this->generateScheduleResponse($result)); - - } - - /** - * Sends an iMIP message by email. - * - * This method must return an array with status codes per recipient. - * This should look something like: - * - * array( - * 'user1@example.org' => '2.0;Success' - * ) - * - * Formatting for this status code can be found at: - * https://tools.ietf.org/html/rfc5545#section-3.8.8.3 - * - * A list of valid status codes can be found at: - * https://tools.ietf.org/html/rfc5546#section-3.6 - * - * @param string $originator - * @param array $recipients - * @param VObject\Component $vObject - * @param string $principal Principal url - * @return array - */ - protected function iMIPMessage($originator, array $recipients, VObject\Component $vObject, $principal) { - - if (!$this->imipHandler) { - $resultStatus = '5.2;This server does not support this operation'; - } else { - $this->imipHandler->sendMessage($originator, $recipients, $vObject, $principal); - $resultStatus = '2.0;Success'; - } - - $result = array(); - foreach($recipients as $recipient) { - $result[$recipient] = $resultStatus; - } - - return $result; - - } - - /** - * Generates a schedule-response XML body - * - * The recipients array is a key->value list, containing email addresses - * and iTip status codes. See the iMIPMessage method for a description of - * the value. - * - * @param array $recipients - * @return string - */ - public function generateScheduleResponse(array $recipients) { - - $dom = new \DOMDocument('1.0','utf-8'); - $dom->formatOutput = true; - $xscheduleResponse = $dom->createElement('cal:schedule-response'); - $dom->appendChild($xscheduleResponse); - - foreach($this->server->xmlNamespaces as $namespace=>$prefix) { - - $xscheduleResponse->setAttribute('xmlns:' . $prefix, $namespace); - - } - - foreach($recipients as $recipient=>$status) { - $xresponse = $dom->createElement('cal:response'); - - $xrecipient = $dom->createElement('cal:recipient'); - $xrecipient->appendChild($dom->createTextNode($recipient)); - $xresponse->appendChild($xrecipient); - - $xrequestStatus = $dom->createElement('cal:request-status'); - $xrequestStatus->appendChild($dom->createTextNode($status)); - $xresponse->appendChild($xrequestStatus); - - $xscheduleResponse->appendChild($xresponse); - - } - - return $dom->saveXML(); - - } - - /** - * This method is responsible for parsing a free-busy query request and - * returning it's result. - * - * @param Schedule\IOutbox $outbox - * @param string $request - * @return string - */ - protected function handleFreeBusyRequest(Schedule\IOutbox $outbox, VObject\Component $vObject) { - - $vFreeBusy = $vObject->VFREEBUSY; - $organizer = $vFreeBusy->organizer; - - $organizer = (string)$organizer; - - // Validating if the organizer matches the owner of the inbox. - $owner = $outbox->getOwner(); - - $caldavNS = '{' . Plugin::NS_CALDAV . '}'; - - $uas = $caldavNS . 'calendar-user-address-set'; - $props = $this->server->getProperties($owner,array($uas)); - - if (empty($props[$uas]) || !in_array($organizer, $props[$uas]->getHrefs())) { - throw new DAV\Exception\Forbidden('The organizer in the request did not match any of the addresses for the owner of this inbox'); - } - - if (!isset($vFreeBusy->ATTENDEE)) { - throw new DAV\Exception\BadRequest('You must at least specify 1 attendee'); - } - - $attendees = array(); - foreach($vFreeBusy->ATTENDEE as $attendee) { - $attendees[]= (string)$attendee; - } - - - if (!isset($vFreeBusy->DTSTART) || !isset($vFreeBusy->DTEND)) { - throw new DAV\Exception\BadRequest('DTSTART and DTEND must both be specified'); - } - - $startRange = $vFreeBusy->DTSTART->getDateTime(); - $endRange = $vFreeBusy->DTEND->getDateTime(); - - $results = array(); - foreach($attendees as $attendee) { - $results[] = $this->getFreeBusyForEmail($attendee, $startRange, $endRange, $vObject); - } - - $dom = new \DOMDocument('1.0','utf-8'); - $dom->formatOutput = true; - $scheduleResponse = $dom->createElement('cal:schedule-response'); - foreach($this->server->xmlNamespaces as $namespace=>$prefix) { - - $scheduleResponse->setAttribute('xmlns:' . $prefix,$namespace); - - } - $dom->appendChild($scheduleResponse); - - foreach($results as $result) { - $response = $dom->createElement('cal:response'); - - $recipient = $dom->createElement('cal:recipient'); - $recipientHref = $dom->createElement('d:href'); - - $recipientHref->appendChild($dom->createTextNode($result['href'])); - $recipient->appendChild($recipientHref); - $response->appendChild($recipient); - - $reqStatus = $dom->createElement('cal:request-status'); - $reqStatus->appendChild($dom->createTextNode($result['request-status'])); - $response->appendChild($reqStatus); - - if (isset($result['calendar-data'])) { - - $calendardata = $dom->createElement('cal:calendar-data'); - $calendardata->appendChild($dom->createTextNode(str_replace("\r\n","\n",$result['calendar-data']->serialize()))); - $response->appendChild($calendardata); - - } - $scheduleResponse->appendChild($response); - } - - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->setHeader('Content-Type','application/xml'); - $this->server->httpResponse->sendBody($dom->saveXML()); - - } - - /** - * Returns free-busy information for a specific address. The returned - * data is an array containing the following properties: - * - * calendar-data : A VFREEBUSY VObject - * request-status : an iTip status code. - * href: The principal's email address, as requested - * - * The following request status codes may be returned: - * * 2.0;description - * * 3.7;description - * - * @param string $email address - * @param \DateTime $start - * @param \DateTime $end - * @param VObject\Component $request - * @return array - */ - protected function getFreeBusyForEmail($email, \DateTime $start, \DateTime $end, VObject\Component $request) { - - $caldavNS = '{' . Plugin::NS_CALDAV . '}'; - - $aclPlugin = $this->server->getPlugin('acl'); - if (substr($email,0,7)==='mailto:') $email = substr($email,7); - - $result = $aclPlugin->principalSearch( - array('{http://sabredav.org/ns}email-address' => $email), - array( - '{DAV:}principal-URL', $caldavNS . 'calendar-home-set', - '{http://sabredav.org/ns}email-address', - ) - ); - - if (!count($result)) { - return array( - 'request-status' => '3.7;Could not find principal', - 'href' => 'mailto:' . $email, - ); - } - - if (!isset($result[0][200][$caldavNS . 'calendar-home-set'])) { - return array( - 'request-status' => '3.7;No calendar-home-set property found', - 'href' => 'mailto:' . $email, - ); - } - $homeSet = $result[0][200][$caldavNS . 'calendar-home-set']->getHref(); - - // Grabbing the calendar list - $objects = array(); - foreach($this->server->tree->getNodeForPath($homeSet)->getChildren() as $node) { - if (!$node instanceof ICalendar) { - continue; - } - $aclPlugin->checkPrivileges($homeSet . $node->getName() ,$caldavNS . 'read-free-busy'); - - // Getting the list of object uris within the time-range - $urls = $node->calendarQuery(array( - 'name' => 'VCALENDAR', - 'comp-filters' => array( - array( - 'name' => 'VEVENT', - 'comp-filters' => array(), - 'prop-filters' => array(), - 'is-not-defined' => false, - 'time-range' => array( - 'start' => $start, - 'end' => $end, - ), - ), - ), - 'prop-filters' => array(), - 'is-not-defined' => false, - 'time-range' => null, - )); - - $calObjects = array_map(function($url) use ($node) { - $obj = $node->getChild($url)->get(); - return $obj; - }, $urls); - - $objects = array_merge($objects,$calObjects); - - } - - $vcalendar = new VObject\Component\VCalendar(); - $vcalendar->VERSION = '2.0'; - $vcalendar->METHOD = 'REPLY'; - $vcalendar->CALSCALE = 'GREGORIAN'; - $vcalendar->PRODID = '-//SabreDAV//SabreDAV ' . DAV\Version::VERSION . '//EN'; - - $generator = new VObject\FreeBusyGenerator(); - $generator->setObjects($objects); - $generator->setTimeRange($start, $end); - $generator->setBaseObject($vcalendar); - - $result = $generator->getResult(); - - $vcalendar->VFREEBUSY->ATTENDEE = 'mailto:' . $email; - $vcalendar->VFREEBUSY->UID = (string)$request->VFREEBUSY->UID; - $vcalendar->VFREEBUSY->ORGANIZER = clone $request->VFREEBUSY->ORGANIZER; - - return array( - 'calendar-data' => $result, - 'request-status' => '2.0;Success', - 'href' => 'mailto:' . $email, - ); - } - - /** - * This method is used to generate HTML output for the - * DAV\Browser\Plugin. This allows us to generate an interface users - * can use to create new calendars. - * - * @param DAV\INode $node - * @param string $output - * @return bool - */ - public function htmlActionsPanel(DAV\INode $node, &$output) { - - if (!$node instanceof UserCalendars) - return; - - $output.= '
-

Create new calendar

- -
-
- -
- '; - - return false; - - } - - /** - * This method allows us to intercept the 'mkcalendar' sabreAction. This - * action enables the user to create new calendars from the browser plugin. - * - * @param string $uri - * @param string $action - * @param array $postVars - * @return bool - */ - public function browserPostAction($uri, $action, array $postVars) { - - if ($action!=='mkcalendar') - return; - - $resourceType = array('{DAV:}collection','{urn:ietf:params:xml:ns:caldav}calendar'); - $properties = array(); - if (isset($postVars['{DAV:}displayname'])) { - $properties['{DAV:}displayname'] = $postVars['{DAV:}displayname']; - } - $this->server->createCollection($uri . '/' . $postVars['name'],$resourceType,$properties); - return false; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php deleted file mode 100644 index e4559c8788..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/Collection.php +++ /dev/null @@ -1,32 +0,0 @@ -principalBackend, $principalInfo); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/IProxyRead.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/IProxyRead.php deleted file mode 100644 index f2215ebe71..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/IProxyRead.php +++ /dev/null @@ -1,19 +0,0 @@ -principalInfo = $principalInfo; - $this->principalBackend = $principalBackend; - - } - - /** - * Returns this principals name. - * - * @return string - */ - public function getName() { - - return 'calendar-proxy-read'; - - } - - /** - * Returns the last modification time - * - * @return null - */ - public function getLastModified() { - - return null; - - } - - /** - * Deletes the current node - * - * @throws DAV\Exception\Forbidden - * @return void - */ - public function delete() { - - throw new DAV\Exception\Forbidden('Permission denied to delete node'); - - } - - /** - * Renames the node - * - * @throws DAV\Exception\Forbidden - * @param string $name The new name - * @return void - */ - public function setName($name) { - - throw new DAV\Exception\Forbidden('Permission denied to rename file'); - - } - - - /** - * Returns a list of alternative urls for a principal - * - * This can for example be an email address, or ldap url. - * - * @return array - */ - public function getAlternateUriSet() { - - return array(); - - } - - /** - * Returns the full principal url - * - * @return string - */ - public function getPrincipalUrl() { - - return $this->principalInfo['uri'] . '/' . $this->getName(); - - } - - /** - * Returns the list of group members - * - * If this principal is a group, this function should return - * all member principal uri's for the group. - * - * @return array - */ - public function getGroupMemberSet() { - - return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl()); - - } - - /** - * Returns the list of groups this principal is member of - * - * If this principal is a member of a (list of) groups, this function - * should return a list of principal uri's for it's members. - * - * @return array - */ - public function getGroupMembership() { - - return $this->principalBackend->getGroupMembership($this->getPrincipalUrl()); - - } - - /** - * Sets a list of group members - * - * If this principal is a group, this method sets all the group members. - * The list of members is always overwritten, never appended to. - * - * This method should throw an exception if the members could not be set. - * - * @param array $principals - * @return void - */ - public function setGroupMemberSet(array $principals) { - - $this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals); - - } - - /** - * Returns the displayname - * - * This should be a human readable name for the principal. - * If none is available, return the nodename. - * - * @return string - */ - public function getDisplayName() { - - return $this->getName(); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/ProxyWrite.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/ProxyWrite.php deleted file mode 100644 index 1ebaf6a10b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/ProxyWrite.php +++ /dev/null @@ -1,180 +0,0 @@ -principalInfo = $principalInfo; - $this->principalBackend = $principalBackend; - - } - - /** - * Returns this principals name. - * - * @return string - */ - public function getName() { - - return 'calendar-proxy-write'; - - } - - /** - * Returns the last modification time - * - * @return null - */ - public function getLastModified() { - - return null; - - } - - /** - * Deletes the current node - * - * @throws DAV\Exception\Forbidden - * @return void - */ - public function delete() { - - throw new DAV\Exception\Forbidden('Permission denied to delete node'); - - } - - /** - * Renames the node - * - * @throws DAV\Exception\Forbidden - * @param string $name The new name - * @return void - */ - public function setName($name) { - - throw new DAV\Exception\Forbidden('Permission denied to rename file'); - - } - - - /** - * Returns a list of alternative urls for a principal - * - * This can for example be an email address, or ldap url. - * - * @return array - */ - public function getAlternateUriSet() { - - return array(); - - } - - /** - * Returns the full principal url - * - * @return string - */ - public function getPrincipalUrl() { - - return $this->principalInfo['uri'] . '/' . $this->getName(); - - } - - /** - * Returns the list of group members - * - * If this principal is a group, this function should return - * all member principal uri's for the group. - * - * @return array - */ - public function getGroupMemberSet() { - - return $this->principalBackend->getGroupMemberSet($this->getPrincipalUrl()); - - } - - /** - * Returns the list of groups this principal is member of - * - * If this principal is a member of a (list of) groups, this function - * should return a list of principal uri's for it's members. - * - * @return array - */ - public function getGroupMembership() { - - return $this->principalBackend->getGroupMembership($this->getPrincipalUrl()); - - } - - /** - * Sets a list of group members - * - * If this principal is a group, this method sets all the group members. - * The list of members is always overwritten, never appended to. - * - * This method should throw an exception if the members could not be set. - * - * @param array $principals - * @return void - */ - public function setGroupMemberSet(array $principals) { - - $this->principalBackend->setGroupMemberSet($this->getPrincipalUrl(), $principals); - - } - - /** - * Returns the displayname - * - * This should be a human readable name for the principal. - * If none is available, return the nodename. - * - * @return string - */ - public function getDisplayName() { - - return $this->getName(); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/User.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/User.php deleted file mode 100644 index 1887f8ad02..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Principal/User.php +++ /dev/null @@ -1,134 +0,0 @@ -principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/' . $name); - if (!$principal) { - throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found'); - } - if ($name === 'calendar-proxy-read') - return new ProxyRead($this->principalBackend, $this->principalProperties); - - if ($name === 'calendar-proxy-write') - return new ProxyWrite($this->principalBackend, $this->principalProperties); - - throw new DAV\Exception\NotFound('Node with name ' . $name . ' was not found'); - - } - - /** - * Returns an array with all the child nodes - * - * @return DAV\INode[] - */ - public function getChildren() { - - $r = array(); - if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-read')) { - $r[] = new ProxyRead($this->principalBackend, $this->principalProperties); - } - if ($this->principalBackend->getPrincipalByPath($this->getPrincipalURL() . '/calendar-proxy-write')) { - $r[] = new ProxyWrite($this->principalBackend, $this->principalProperties); - } - - return $r; - - } - - /** - * Returns whether or not the child node exists - * - * @param string $name - * @return bool - */ - public function childExists($name) { - - try { - $this->getChild($name); - return true; - } catch (DAV\Exception\NotFound $e) { - return false; - } - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - $acl = parent::getACL(); - $acl[] = array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-read', - 'protected' => true, - ); - $acl[] = array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalProperties['uri'] . '/calendar-proxy-write', - 'protected' => true, - ); - return $acl; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/AllowedSharingModes.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/AllowedSharingModes.php deleted file mode 100644 index 97b888a0dd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/AllowedSharingModes.php +++ /dev/null @@ -1,74 +0,0 @@ -canBeShared = $canBeShared; - $this->canBePublished = $canBePublished; - - } - - /** - * Serializes the property in a DOMDocument - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $node) { - - $doc = $node->ownerDocument; - if ($this->canBeShared) { - $xcomp = $doc->createElement('cs:can-be-shared'); - $node->appendChild($xcomp); - } - if ($this->canBePublished) { - $xcomp = $doc->createElement('cs:can-be-published'); - $node->appendChild($xcomp); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/Invite.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/Invite.php deleted file mode 100644 index 7a8683acb1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/Invite.php +++ /dev/null @@ -1,227 +0,0 @@ -users = $users; - $this->organizer = $organizer; - - } - - /** - * Returns the list of users, as it was passed to the constructor. - * - * @return array - */ - public function getValue() { - - return $this->users; - - } - - /** - * Serializes the property in a DOMDocument - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - - if (!is_null($this->organizer)) { - - $xorganizer = $doc->createElement('cs:organizer'); - - $href = $doc->createElement('d:href'); - $href->appendChild($doc->createTextNode($this->organizer['href'])); - $xorganizer->appendChild($href); - - if (isset($this->organizer['commonName']) && $this->organizer['commonName']) { - $commonName = $doc->createElement('cs:common-name'); - $commonName->appendChild($doc->createTextNode($this->organizer['commonName'])); - $xorganizer->appendChild($commonName); - } - if (isset($this->organizer['firstName']) && $this->organizer['firstName']) { - $firstName = $doc->createElement('cs:first-name'); - $firstName->appendChild($doc->createTextNode($this->organizer['firstName'])); - $xorganizer->appendChild($firstName); - } - if (isset($this->organizer['lastName']) && $this->organizer['lastName']) { - $lastName = $doc->createElement('cs:last-name'); - $lastName->appendChild($doc->createTextNode($this->organizer['lastName'])); - $xorganizer->appendChild($lastName); - } - - $node->appendChild($xorganizer); - - - } - - foreach($this->users as $user) { - - $xuser = $doc->createElement('cs:user'); - - $href = $doc->createElement('d:href'); - $href->appendChild($doc->createTextNode($user['href'])); - $xuser->appendChild($href); - - if (isset($user['commonName']) && $user['commonName']) { - $commonName = $doc->createElement('cs:common-name'); - $commonName->appendChild($doc->createTextNode($user['commonName'])); - $xuser->appendChild($commonName); - } - - switch($user['status']) { - - case SharingPlugin::STATUS_ACCEPTED : - $status = $doc->createElement('cs:invite-accepted'); - $xuser->appendChild($status); - break; - case SharingPlugin::STATUS_DECLINED : - $status = $doc->createElement('cs:invite-declined'); - $xuser->appendChild($status); - break; - case SharingPlugin::STATUS_NORESPONSE : - $status = $doc->createElement('cs:invite-noresponse'); - $xuser->appendChild($status); - break; - case SharingPlugin::STATUS_INVALID : - $status = $doc->createElement('cs:invite-invalid'); - $xuser->appendChild($status); - break; - - } - - $xaccess = $doc->createElement('cs:access'); - - if ($user['readOnly']) { - $xaccess->appendChild( - $doc->createElement('cs:read') - ); - } else { - $xaccess->appendChild( - $doc->createElement('cs:read-write') - ); - } - $xuser->appendChild($xaccess); - - if (isset($user['summary']) && $user['summary']) { - $summary = $doc->createElement('cs:summary'); - $summary->appendChild($doc->createTextNode($user['summary'])); - $xuser->appendChild($summary); - } - - $node->appendChild($xuser); - - } - - - } - - /** - * Unserializes the property. - * - * This static method should return a an instance of this object. - * - * @param \DOMElement $prop - * @return DAV\IProperty - */ - static function unserialize(\DOMElement $prop) { - - $xpath = new \DOMXPath($prop->ownerDocument); - $xpath->registerNamespace('cs', CalDAV\Plugin::NS_CALENDARSERVER); - $xpath->registerNamespace('d', 'urn:DAV'); - - $users = array(); - - foreach($xpath->query('cs:user', $prop) as $user) { - - $status = null; - if ($xpath->evaluate('boolean(cs:invite-accepted)', $user)) { - $status = SharingPlugin::STATUS_ACCEPTED; - } elseif ($xpath->evaluate('boolean(cs:invite-declined)', $user)) { - $status = SharingPlugin::STATUS_DECLINED; - } elseif ($xpath->evaluate('boolean(cs:invite-noresponse)', $user)) { - $status = SharingPlugin::STATUS_NORESPONSE; - } elseif ($xpath->evaluate('boolean(cs:invite-invalid)', $user)) { - $status = SharingPlugin::STATUS_INVALID; - } else { - throw new DAV\Exception('Every cs:user property must have one of cs:invite-accepted, cs:invite-declined, cs:invite-noresponse or cs:invite-invalid'); - } - $users[] = array( - 'href' => $xpath->evaluate('string(d:href)', $user), - 'commonName' => $xpath->evaluate('string(cs:common-name)', $user), - 'readOnly' => $xpath->evaluate('boolean(cs:access/cs:read)', $user), - 'summary' => $xpath->evaluate('string(cs:summary)', $user), - 'status' => $status, - ); - - } - - return new self($users); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/ScheduleCalendarTransp.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/ScheduleCalendarTransp.php deleted file mode 100644 index 328ac764ae..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/ScheduleCalendarTransp.php +++ /dev/null @@ -1,102 +0,0 @@ -value = $value; - - } - - /** - * Returns the current value - * - * @return string - */ - public function getValue() { - - return $this->value; - - } - - /** - * Serializes the property in a DOMDocument - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - switch($this->value) { - case self::TRANSPARENT : - $xval = $doc->createElement('cal:transparent'); - break; - case self::OPAQUE : - $xval = $doc->createElement('cal:opaque'); - break; - } - - $node->appendChild($xval); - - } - - /** - * Unserializes the DOMElement back into a Property class. - * - * @param \DOMElement $node - * @return ScheduleCalendarTransp - */ - static function unserialize(\DOMElement $node) { - - $value = null; - foreach($node->childNodes as $childNode) { - switch(DAV\XMLUtil::toClarkNotation($childNode)) { - case '{' . CalDAV\Plugin::NS_CALDAV . '}opaque' : - $value = self::OPAQUE; - break; - case '{' . CalDAV\Plugin::NS_CALDAV . '}transparent' : - $value = self::TRANSPARENT; - break; - } - } - if (is_null($value)) - return null; - - return new self($value); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarComponentSet.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarComponentSet.php deleted file mode 100644 index c533762e7d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarComponentSet.php +++ /dev/null @@ -1,88 +0,0 @@ -components = $components; - - } - - /** - * Returns the list of supported components - * - * @return array - */ - public function getValue() { - - return $this->components; - - } - - /** - * Serializes the property in a DOMDocument - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - foreach($this->components as $component) { - - $xcomp = $doc->createElement('cal:comp'); - $xcomp->setAttribute('name',$component); - $node->appendChild($xcomp); - - } - - } - - /** - * Unserializes the DOMElement back into a Property class. - * - * @param \DOMElement $node - * @return Property_SupportedCalendarComponentSet - */ - static function unserialize(\DOMElement $node) { - - $components = array(); - foreach($node->childNodes as $childNode) { - if (DAV\XMLUtil::toClarkNotation($childNode)==='{' . CalDAV\Plugin::NS_CALDAV . '}comp') { - $components[] = $childNode->getAttribute('name'); - } - } - return new self($components); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarData.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarData.php deleted file mode 100644 index ed742daf3b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCalendarData.php +++ /dev/null @@ -1,40 +0,0 @@ -ownerDocument; - - $prefix = isset($server->xmlNamespaces[Plugin::NS_CALDAV])?$server->xmlNamespaces[Plugin::NS_CALDAV]:'cal'; - - $caldata = $doc->createElement($prefix . ':calendar-data'); - $caldata->setAttribute('content-type','text/calendar'); - $caldata->setAttribute('version','2.0'); - - $node->appendChild($caldata); - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCollationSet.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCollationSet.php deleted file mode 100644 index 7c853f26ce..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Property/SupportedCollationSet.php +++ /dev/null @@ -1,45 +0,0 @@ -ownerDocument; - - $prefix = $node->lookupPrefix('urn:ietf:params:xml:ns:caldav'); - if (!$prefix) $prefix = 'cal'; - - $node->appendChild( - $doc->createElement($prefix . ':supported-collation','i;ascii-casemap') - ); - $node->appendChild( - $doc->createElement($prefix . ':supported-collation','i;octet') - ); - $node->appendChild( - $doc->createElement($prefix . ':supported-collation','i;unicode-casemap') - ); - - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IMip.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IMip.php deleted file mode 100644 index 0efacff6a4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IMip.php +++ /dev/null @@ -1,111 +0,0 @@ -senderEmail = $senderEmail; - - } - - /** - * Sends one or more iTip messages through email. - * - * @param string $originator Originator Email - * @param array $recipients Array of email addresses - * @param VObject\Component $vObject - * @param string $principal Principal Url of the originator - * @return void - */ - public function sendMessage($originator, array $recipients, VObject\Component $vObject, $principal) { - - foreach($recipients as $recipient) { - - $to = $recipient; - $replyTo = $originator; - $subject = 'SabreDAV iTIP message'; - - switch(strtoupper($vObject->METHOD)) { - case 'REPLY' : - $subject = 'Response for: ' . $vObject->VEVENT->SUMMARY; - break; - case 'REQUEST' : - $subject = 'Invitation for: ' .$vObject->VEVENT->SUMMARY; - break; - case 'CANCEL' : - $subject = 'Cancelled event: ' . $vObject->VEVENT->SUMMARY; - break; - } - - $headers = array(); - $headers[] = 'Reply-To: ' . $replyTo; - $headers[] = 'From: ' . $this->senderEmail; - $headers[] = 'Content-Type: text/calendar; method=' . (string)$vObject->method . '; charset=utf-8'; - if (DAV\Server::$exposeVersion) { - $headers[] = 'X-Sabre-Version: ' . DAV\Version::VERSION . '-' . DAV\Version::STABILITY; - } - - $vcalBody = $vObject->serialize(); - - $this->mail($to, $subject, $vcalBody, $headers); - - } - - } - - // @codeCoverageIgnoreStart - // This is deemed untestable in a reasonable manner - - /** - * This function is reponsible for sending the actual email. - * - * @param string $to Recipient email address - * @param string $subject Subject of the email - * @param string $body iCalendar body - * @param array $headers List of headers - * @return void - */ - protected function mail($to, $subject, $body, array $headers) { - - - mail($to, $subject, $body, implode("\r\n", $headers)); - - } - - // @codeCoverageIgnoreEnd - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IOutbox.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IOutbox.php deleted file mode 100644 index e9edc5105c..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Schedule/IOutbox.php +++ /dev/null @@ -1,16 +0,0 @@ -principalUri = $principalUri; - - } - - /** - * Returns the name of the node. - * - * This is used to generate the url. - * - * @return string - */ - public function getName() { - - return 'outbox'; - - } - - /** - * Returns an array with all the child nodes - * - * @return \SabreForRainLoop\DAV\INode[] - */ - public function getChildren() { - - return array(); - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalUri; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-query-freebusy', - 'principal' => $this->getOwner(), - 'protected' => true, - ), - array( - 'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-post-vevent', - 'principal' => $this->getOwner(), - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->getOwner(), - 'protected' => true, - ), - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('You\'re not allowed to update the ACL'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - $default = DAVACL\Plugin::getDefaultSupportedPrivilegeSet(); - $default['aggregates'][] = array( - 'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-query-freebusy', - ); - $default['aggregates'][] = array( - 'privilege' => '{' . CalDAV\Plugin::NS_CALDAV . '}schedule-post-vevent', - ); - - return $default; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ShareableCalendar.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ShareableCalendar.php deleted file mode 100644 index 43b051a215..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/ShareableCalendar.php +++ /dev/null @@ -1,72 +0,0 @@ -caldavBackend->updateShares($this->calendarInfo['id'], $add, $remove); - - } - - /** - * Returns the list of people whom this calendar is shared with. - * - * Every element in this array should have the following properties: - * * href - Often a mailto: address - * * commonName - Optional, for example a first + last name - * * status - See the SabreForRainLoop\CalDAV\SharingPlugin::STATUS_ constants. - * * readOnly - boolean - * * summary - Optional, a description for the share - * - * @return array - */ - public function getShares() { - - return $this->caldavBackend->getShares($this->calendarInfo['id']); - - } - - /** - * Marks this calendar as published. - * - * Publishing a calendar should automatically create a read-only, public, - * subscribable calendar. - * - * @param bool $value - * @return void - */ - public function setPublishStatus($value) { - - $this->caldavBackend->setPublishStatus($this->calendarInfo['id'], $value); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharedCalendar.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharedCalendar.php deleted file mode 100644 index fda75159b7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharedCalendar.php +++ /dev/null @@ -1,116 +0,0 @@ -calendarInfo['{http://calendarserver.org/ns/}shared-url']; - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->calendarInfo['{http://sabredav.org/ns}owner-principal']; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - // The top-level ACL only contains access information for the true - // owner of the calendar, so we need to add the information for the - // sharee. - $acl = parent::getACL(); - $acl[] = array( - 'privilege' => '{DAV:}read', - 'principal' => $this->calendarInfo['principaluri'], - 'protected' => true, - ); - if (!$this->calendarInfo['{http://sabredav.org/ns}read-only']) { - $acl[] = array( - 'privilege' => '{DAV:}write', - 'principal' => $this->calendarInfo['principaluri'], - 'protected' => true, - ); - } - return $acl; - - } - - /** - * Returns the list of people whom this calendar is shared with. - * - * Every element in this array should have the following properties: - * * href - Often a mailto: address - * * commonName - Optional, for example a first + last name - * * status - See the SabreForRainLoop\CalDAV\SharingPlugin::STATUS_ constants. - * * readOnly - boolean - * * summary - Optional, a description for the share - * - * @return array - */ - public function getShares() { - - return $this->caldavBackend->getShares($this->calendarInfo['id']); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharingPlugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharingPlugin.php deleted file mode 100644 index 7a89075a02..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/SharingPlugin.php +++ /dev/null @@ -1,526 +0,0 @@ -server = $server; - $server->resourceTypeMapping['SabreForRainLoop\\CalDAV\\ISharedCalendar'] = '{' . Plugin::NS_CALENDARSERVER . '}shared'; - - array_push( - $this->server->protectedProperties, - '{' . Plugin::NS_CALENDARSERVER . '}invite', - '{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes', - '{' . Plugin::NS_CALENDARSERVER . '}shared-url' - ); - - $this->server->subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties')); - $this->server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties')); - $this->server->subscribeEvent('updateProperties', array($this, 'updateProperties')); - $this->server->subscribeEvent('unknownMethod', array($this,'unknownMethod')); - - } - - /** - * This event is triggered when properties are requested for a certain - * node. - * - * This allows us to inject any properties early. - * - * @param string $path - * @param DAV\INode $node - * @param array $requestedProperties - * @param array $returnedProperties - * @return void - */ - public function beforeGetProperties($path, DAV\INode $node, &$requestedProperties, &$returnedProperties) { - - if ($node instanceof IShareableCalendar) { - if (($index = array_search('{' . Plugin::NS_CALENDARSERVER . '}invite', $requestedProperties))!==false) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{' . Plugin::NS_CALENDARSERVER . '}invite'] = - new Property\Invite( - $node->getShares() - ); - - } - - } - - if ($node instanceof ISharedCalendar) { - - if (($index = array_search('{' . Plugin::NS_CALENDARSERVER . '}shared-url', $requestedProperties))!==false) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{' . Plugin::NS_CALENDARSERVER . '}shared-url'] = - new DAV\Property\Href( - $node->getSharedUrl() - ); - - } - // The 'invite' property is slightly different for the 'shared' - // instance of the calendar, as it also contains the owner - // information. - if (($index = array_search('{' . Plugin::NS_CALENDARSERVER . '}invite', $requestedProperties))!==false) { - - unset($requestedProperties[$index]); - - // Fetching owner information - $props = $this->server->getPropertiesForPath($node->getOwner(), array( - '{http://sabredav.org/ns}email-address', - '{DAV:}displayname', - ), 1); - - $ownerInfo = array( - 'href' => $node->getOwner(), - ); - - if (isset($props[0][200])) { - - // We're mapping the internal webdav properties to the - // elements caldav-sharing expects. - if (isset($props[0][200]['{http://sabredav.org/ns}email-address'])) { - $ownerInfo['href'] = 'mailto:' . $props[0][200]['{http://sabredav.org/ns}email-address']; - } - if (isset($props[0][200]['{DAV:}displayname'])) { - $ownerInfo['commonName'] = $props[0][200]['{DAV:}displayname']; - } - - } - - $returnedProperties[200]['{' . Plugin::NS_CALENDARSERVER . '}invite'] = - new Property\Invite( - $node->getShares(), - $ownerInfo - ); - - } - - - } - - } - - /** - * This method is triggered *after* all properties have been retrieved. - * This allows us to inject the correct resourcetype for calendars that - * have been shared. - * - * @param string $path - * @param array $properties - * @param DAV\INode $node - * @return void - */ - public function afterGetProperties($path, &$properties, DAV\INode $node) { - - if ($node instanceof IShareableCalendar) { - if (isset($properties[200]['{DAV:}resourcetype'])) { - if (count($node->getShares())>0) { - $properties[200]['{DAV:}resourcetype']->add( - '{' . Plugin::NS_CALENDARSERVER . '}shared-owner' - ); - } - } - $propName = '{' . Plugin::NS_CALENDARSERVER . '}allowed-sharing-modes'; - if (array_key_exists($propName, $properties[404])) { - unset($properties[404][$propName]); - $properties[200][$propName] = new Property\AllowedSharingModes(true,false); - } - - } - - } - - /** - * This method is trigged when a user attempts to update a node's - * properties. - * - * A previous draft of the sharing spec stated that it was possible to use - * PROPPATCH to remove 'shared-owner' from the resourcetype, thus unsharing - * the calendar. - * - * Even though this is no longer in the current spec, we keep this around - * because OS X 10.7 may still make use of this feature. - * - * @param array $mutations - * @param array $result - * @param DAV\INode $node - * @return void - */ - public function updateProperties(array &$mutations, array &$result, DAV\INode $node) { - - if (!$node instanceof IShareableCalendar) - return; - - if (!isset($mutations['{DAV:}resourcetype'])) { - return; - } - - // Only doing something if shared-owner is indeed not in the list. - if($mutations['{DAV:}resourcetype']->is('{' . Plugin::NS_CALENDARSERVER . '}shared-owner')) return; - - $shares = $node->getShares(); - $remove = array(); - foreach($shares as $share) { - $remove[] = $share['href']; - } - $node->updateShares(array(), $remove); - - // We're marking this update as 200 OK - $result[200]['{DAV:}resourcetype'] = null; - - // Removing it from the mutations list - unset($mutations['{DAV:}resourcetype']); - - } - - /** - * This event is triggered when the server didn't know how to handle a - * certain request. - * - * We intercept this to handle POST requests on calendars. - * - * @param string $method - * @param string $uri - * @return null|bool - */ - public function unknownMethod($method, $uri) { - - if ($method!=='POST') { - return; - } - - // Only handling xml - $contentType = $this->server->httpRequest->getHeader('Content-Type'); - if (strpos($contentType,'application/xml')===false && strpos($contentType,'text/xml')===false) - return; - - // Making sure the node exists - try { - $node = $this->server->tree->getNodeForPath($uri); - } catch (DAV\Exception\NotFound $e) { - return; - } - - $requestBody = $this->server->httpRequest->getBody(true); - - // If this request handler could not deal with this POST request, it - // will return 'null' and other plugins get a chance to handle the - // request. - // - // However, we already requested the full body. This is a problem, - // because a body can only be read once. This is why we preemptively - // re-populated the request body with the existing data. - $this->server->httpRequest->setBody($requestBody); - - $dom = DAV\XMLUtil::loadDOMDocument($requestBody); - - $documentType = DAV\XMLUtil::toClarkNotation($dom->firstChild); - - switch($documentType) { - - // Dealing with the 'share' document, which modified invitees on a - // calendar. - case '{' . Plugin::NS_CALENDARSERVER . '}share' : - - // We can only deal with IShareableCalendar objects - if (!$node instanceof IShareableCalendar) { - return; - } - - // Getting ACL info - $acl = $this->server->getPlugin('acl'); - - // If there's no ACL support, we allow everything - if ($acl) { - $acl->checkPrivileges($uri, '{DAV:}write'); - } - - $mutations = $this->parseShareRequest($dom); - - $node->updateShares($mutations[0], $mutations[1]); - - $this->server->httpResponse->sendStatus(200); - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $this->server->httpResponse->setHeader('X-Sabre-Status', 'everything-went-well'); - - // Breaking the event chain - return false; - - // The invite-reply document is sent when the user replies to an - // invitation of a calendar share. - case '{'. Plugin::NS_CALENDARSERVER.'}invite-reply' : - - // This only works on the calendar-home-root node. - if (!$node instanceof UserCalendars) { - return; - } - - // Getting ACL info - $acl = $this->server->getPlugin('acl'); - - // If there's no ACL support, we allow everything - if ($acl) { - $acl->checkPrivileges($uri, '{DAV:}write'); - } - - $message = $this->parseInviteReplyRequest($dom); - - $url = $node->shareReply( - $message['href'], - $message['status'], - $message['calendarUri'], - $message['inReplyTo'], - $message['summary'] - ); - - $this->server->httpResponse->sendStatus(200); - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $this->server->httpResponse->setHeader('X-Sabre-Status', 'everything-went-well'); - - if ($url) { - $dom = new \DOMDocument('1.0', 'UTF-8'); - $dom->formatOutput = true; - - $root = $dom->createElement('cs:shared-as'); - foreach($this->server->xmlNamespaces as $namespace => $prefix) { - $root->setAttribute('xmlns:' . $prefix, $namespace); - } - - $dom->appendChild($root); - $href = new DAV\Property\Href($url); - - $href->serialize($this->server, $root); - $this->server->httpResponse->setHeader('Content-Type','application/xml'); - $this->server->httpResponse->sendBody($dom->saveXML()); - - } - - // Breaking the event chain - return false; - - case '{' . Plugin::NS_CALENDARSERVER . '}publish-calendar' : - - // We can only deal with IShareableCalendar objects - if (!$node instanceof IShareableCalendar) { - return; - } - - // Getting ACL info - $acl = $this->server->getPlugin('acl'); - - // If there's no ACL support, we allow everything - if ($acl) { - $acl->checkPrivileges($uri, '{DAV:}write'); - } - - $node->setPublishStatus(true); - - // iCloud sends back the 202, so we will too. - $this->server->httpResponse->sendStatus(202); - - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $this->server->httpResponse->setHeader('X-Sabre-Status', 'everything-went-well'); - - // Breaking the event chain - return false; - - case '{' . Plugin::NS_CALENDARSERVER . '}unpublish-calendar' : - - // We can only deal with IShareableCalendar objects - if (!$node instanceof IShareableCalendar) { - return; - } - - // Getting ACL info - $acl = $this->server->getPlugin('acl'); - - // If there's no ACL support, we allow everything - if ($acl) { - $acl->checkPrivileges($uri, '{DAV:}write'); - } - - $node->setPublishStatus(false); - - $this->server->httpResponse->sendStatus(200); - - // Adding this because sending a response body may cause issues, - // and I wanted some type of indicator the response was handled. - $this->server->httpResponse->setHeader('X-Sabre-Status', 'everything-went-well'); - - // Breaking the event chain - return false; - - } - - - - } - - /** - * Parses the 'share' POST request. - * - * This method returns an array, containing two arrays. - * The first array is a list of new sharees. Every element is a struct - * containing a: - * * href element. (usually a mailto: address) - * * commonName element (often a first and lastname, but can also be - * false) - * * readOnly (true or false) - * * summary (A description of the share, can also be false) - * - * The second array is a list of sharees that are to be removed. This is - * just a simple array with 'hrefs'. - * - * @param \DOMDocument $dom - * @return array - */ - protected function parseShareRequest(\DOMDocument $dom) { - - $xpath = new \DOMXPath($dom); - $xpath->registerNamespace('cs', Plugin::NS_CALENDARSERVER); - $xpath->registerNamespace('d', 'urn:DAV'); - - $set = array(); - $elems = $xpath->query('cs:set'); - - for($i=0; $i < $elems->length; $i++) { - - $xset = $elems->item($i); - $set[] = array( - 'href' => $xpath->evaluate('string(d:href)', $xset), - 'commonName' => $xpath->evaluate('string(cs:common-name)', $xset), - 'summary' => $xpath->evaluate('string(cs:summary)', $xset), - 'readOnly' => $xpath->evaluate('boolean(cs:read)', $xset)!==false - ); - - } - - $remove = array(); - $elems = $xpath->query('cs:remove'); - - for($i=0; $i < $elems->length; $i++) { - - $xremove = $elems->item($i); - $remove[] = $xpath->evaluate('string(d:href)', $xremove); - - } - - return array($set, $remove); - - } - - /** - * Parses the 'invite-reply' POST request. - * - * This method returns an array, containing the following properties: - * * href - The sharee who is replying - * * status - One of the self::STATUS_* constants - * * calendarUri - The url of the shared calendar - * * inReplyTo - The unique id of the share invitation. - * * summary - Optional description of the reply. - * - * @param \DOMDocument $dom - * @return array - */ - protected function parseInviteReplyRequest(\DOMDocument $dom) { - - $xpath = new \DOMXPath($dom); - $xpath->registerNamespace('cs', Plugin::NS_CALENDARSERVER); - $xpath->registerNamespace('d', 'urn:DAV'); - - $hostHref = $xpath->evaluate('string(cs:hosturl/d:href)'); - if (!$hostHref) { - throw new DAV\Exception\BadRequest('The {' . Plugin::NS_CALENDARSERVER . '}hosturl/{DAV:}href element is required'); - } - - return array( - 'href' => $xpath->evaluate('string(d:href)'), - 'calendarUri' => $this->server->calculateUri($hostHref), - 'inReplyTo' => $xpath->evaluate('string(cs:in-reply-to)'), - 'summary' => $xpath->evaluate('string(cs:summary)'), - 'status' => $xpath->evaluate('boolean(cs:invite-accepted)')?self::STATUS_ACCEPTED:self::STATUS_DECLINED - ); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php deleted file mode 100644 index 17f7956f09..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/UserCalendars.php +++ /dev/null @@ -1,342 +0,0 @@ -caldavBackend = $caldavBackend; - $this->principalInfo = $principalInfo; - - } - - /** - * Returns the name of this object - * - * @return string - */ - public function getName() { - - list(,$name) = DAV\URLUtil::splitPath($this->principalInfo['uri']); - return $name; - - } - - /** - * Updates the name of this object - * - * @param string $name - * @return void - */ - public function setName($name) { - - throw new DAV\Exception\Forbidden(); - - } - - /** - * Deletes this object - * - * @return void - */ - public function delete() { - - throw new DAV\Exception\Forbidden(); - - } - - /** - * Returns the last modification date - * - * @return int - */ - public function getLastModified() { - - return null; - - } - - /** - * Creates a new file under this object. - * - * This is currently not allowed - * - * @param string $filename - * @param resource $data - * @return void - */ - public function createFile($filename, $data=null) { - - throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); - - } - - /** - * Creates a new directory under this object. - * - * This is currently not allowed. - * - * @param string $filename - * @return void - */ - public function createDirectory($filename) { - - throw new DAV\Exception\MethodNotAllowed('Creating new collections in this collection is not supported'); - - } - - /** - * Returns a single calendar, by name - * - * @param string $name - * @todo needs optimizing - * @return Calendar - */ - public function getChild($name) { - - foreach($this->getChildren() as $child) { - if ($name==$child->getName()) - return $child; - - } - throw new DAV\Exception\NotFound('Calendar with name \'' . $name . '\' could not be found'); - - } - - /** - * Checks if a calendar exists. - * - * @param string $name - * @todo needs optimizing - * @return bool - */ - public function childExists($name) { - - foreach($this->getChildren() as $child) { - if ($name==$child->getName()) - return true; - - } - return false; - - } - - /** - * Returns a list of calendars - * - * @return array - */ - public function getChildren() { - - $calendars = $this->caldavBackend->getCalendarsForUser($this->principalInfo['uri']); - $objs = array(); - foreach($calendars as $calendar) { - if ($this->caldavBackend instanceof Backend\SharingSupport) { - if (isset($calendar['{http://calendarserver.org/ns/}shared-url'])) { - $objs[] = new SharedCalendar($this->caldavBackend, $calendar); - } else { - $objs[] = new ShareableCalendar($this->caldavBackend, $calendar); - } - } else { - $objs[] = new Calendar($this->caldavBackend, $calendar); - } - } - $objs[] = new Schedule\Outbox($this->principalInfo['uri']); - - // We're adding a notifications node, if it's supported by the backend. - if ($this->caldavBackend instanceof Backend\NotificationSupport) { - $objs[] = new Notifications\Collection($this->caldavBackend, $this->principalInfo['uri']); - } - return $objs; - - } - - /** - * Creates a new calendar - * - * @param string $name - * @param array $resourceType - * @param array $properties - * @return void - */ - public function createExtendedCollection($name, array $resourceType, array $properties) { - - $isCalendar = false; - foreach($resourceType as $rt) { - switch ($rt) { - case '{DAV:}collection' : - case '{http://calendarserver.org/ns/}shared-owner' : - // ignore - break; - case '{urn:ietf:params:xml:ns:caldav}calendar' : - $isCalendar = true; - break; - default : - throw new DAV\Exception\InvalidResourceType('Unknown resourceType: ' . $rt); - } - } - if (!$isCalendar) { - throw new DAV\Exception\InvalidResourceType('You can only create calendars in this collection'); - } - $this->caldavBackend->createCalendar($this->principalInfo['uri'], $name, $properties); - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalInfo['uri']; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalInfo['uri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->principalInfo['uri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->principalInfo['uri'] . '/calendar-proxy-write', - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalInfo['uri'] . '/calendar-proxy-read', - 'protected' => true, - ), - - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - - /** - * This method is called when a user replied to a request to share. - * - * This method should return the url of the newly created calendar if the - * share was accepted. - * - * @param string href The sharee who is replying (often a mailto: address) - * @param int status One of the SharingPlugin::STATUS_* constants - * @param string $calendarUri The url to the calendar thats being shared - * @param string $inReplyTo The unique id this message is a response to - * @param string $summary A description of the reply - * @return null|string - */ - public function shareReply($href, $status, $calendarUri, $inReplyTo, $summary = null) { - - if (!$this->caldavBackend instanceof Backend\SharingSupport) { - throw new DAV\Exception\NotImplemented('Sharing support is not implemented by this backend.'); - } - - return $this->caldavBackend->shareReply($href, $status, $calendarUri, $inReplyTo, $summary); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Version.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Version.php deleted file mode 100644 index b85b340067..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CalDAV/Version.php +++ /dev/null @@ -1,24 +0,0 @@ -carddavBackend = $carddavBackend; - $this->addressBookInfo = $addressBookInfo; - - } - - /** - * Returns the name of the addressbook - * - * @return string - */ - public function getName() { - - return $this->addressBookInfo['uri']; - - } - - /** - * Returns a card - * - * @param string $name - * @return \ICard - */ - public function getChild($name) { - - $obj = $this->carddavBackend->getCard($this->addressBookInfo['id'],$name); - if (!$obj) throw new DAV\Exception\NotFound('Card not found'); - return new Card($this->carddavBackend,$this->addressBookInfo,$obj); - - } - - /** - * Returns the full list of cards - * - * @return array - */ - public function getChildren() { - - $objs = $this->carddavBackend->getCards($this->addressBookInfo['id']); - $children = array(); - foreach($objs as $obj) { - $children[] = new Card($this->carddavBackend,$this->addressBookInfo,$obj); - } - return $children; - - } - - /** - * Creates a new directory - * - * We actually block this, as subdirectories are not allowed in addressbooks. - * - * @param string $name - * @return void - */ - public function createDirectory($name) { - - throw new DAV\Exception\MethodNotAllowed('Creating collections in addressbooks is not allowed'); - - } - - /** - * Creates a new file - * - * The contents of the new file must be a valid VCARD. - * - * This method may return an ETag. - * - * @param string $name - * @param resource $vcardData - * @return string|null - */ - public function createFile($name,$vcardData = null) { - - if (is_resource($vcardData)) { - $vcardData = stream_get_contents($vcardData); - } - // Converting to UTF-8, if needed - $vcardData = DAV\StringUtil::ensureUTF8($vcardData); - - return $this->carddavBackend->createCard($this->addressBookInfo['id'],$name,$vcardData); - - } - - /** - * Deletes the entire addressbook. - * - * @return void - */ - public function delete() { - - $this->carddavBackend->deleteAddressBook($this->addressBookInfo['id']); - - } - - /** - * Renames the addressbook - * - * @param string $newName - * @return void - */ - public function setName($newName) { - - throw new DAV\Exception\MethodNotAllowed('Renaming addressbooks is not yet supported'); - - } - - /** - * Returns the last modification date as a unix timestamp. - * - * @return void - */ - public function getLastModified() { - - return null; - - } - - /** - * Updates properties on this node, - * - * The properties array uses the propertyName in clark-notation as key, - * and the array value for the property value. In the case a property - * should be deleted, the property value will be null. - * - * This method must be atomic. If one property cannot be changed, the - * entire operation must fail. - * - * If the operation was successful, true can be returned. - * If the operation failed, false can be returned. - * - * Deletion of a non-existent property is always successful. - * - * Lastly, it is optional to return detailed information about any - * failures. In this case an array should be returned with the following - * structure: - * - * array( - * 403 => array( - * '{DAV:}displayname' => null, - * ), - * 424 => array( - * '{DAV:}owner' => null, - * ) - * ) - * - * In this example it was forbidden to update {DAV:}displayname. - * (403 Forbidden), which in turn also caused {DAV:}owner to fail - * (424 Failed Dependency) because the request needs to be atomic. - * - * @param array $mutations - * @return bool|array - */ - public function updateProperties($mutations) { - - return $this->carddavBackend->updateAddressBook($this->addressBookInfo['id'], $mutations); - - } - - /** - * Returns a list of properties for this nodes. - * - * The properties list is a list of propertynames the client requested, - * encoded in clark-notation {xmlnamespace}tagname - * - * If the array is empty, it means 'all properties' were requested. - * - * @param array $properties - * @return array - */ - public function getProperties($properties) { - - $response = array(); - foreach($properties as $propertyName) { - - if (isset($this->addressBookInfo[$propertyName])) { - - $response[$propertyName] = $this->addressBookInfo[$propertyName]; - - } - - } - - return $response; - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->addressBookInfo['principaluri']; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->addressBookInfo['principaluri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->addressBookInfo['principaluri'], - 'protected' => true, - ), - - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookQueryParser.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookQueryParser.php deleted file mode 100644 index 579937e828..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookQueryParser.php +++ /dev/null @@ -1,221 +0,0 @@ -dom = $dom; - - $this->xpath = new \DOMXPath($dom); - $this->xpath->registerNameSpace('card',Plugin::NS_CARDDAV); - - } - - /** - * Parses the request. - * - * @return void - */ - public function parse() { - - $filterNode = null; - - $limit = $this->xpath->evaluate('number(/card:addressbook-query/card:limit/card:nresults)'); - if (is_nan($limit)) $limit = null; - - $filter = $this->xpath->query('/card:addressbook-query/card:filter'); - - // According to the CardDAV spec there needs to be exactly 1 filter - // element. However, KDE 4.8.2 contains a bug that will encode 0 filter - // elements, so this is a workaround for that. - // - // See: https://bugs.kde.org/show_bug.cgi?id=300047 - if ($filter->length === 0) { - $test = null; - $filter = null; - } elseif ($filter->length === 1) { - $filter = $filter->item(0); - $test = $this->xpath->evaluate('string(@test)', $filter); - } else { - throw new DAV\Exception\BadRequest('Only one filter element is allowed'); - } - - if (!$test) $test = self::TEST_ANYOF; - if ($test !== self::TEST_ANYOF && $test !== self::TEST_ALLOF) { - throw new DAV\Exception\BadRequest('The test attribute must either hold "anyof" or "allof"'); - } - - $propFilters = array(); - - $propFilterNodes = $this->xpath->query('card:prop-filter', $filter); - for($ii=0; $ii < $propFilterNodes->length; $ii++) { - - $propFilters[] = $this->parsePropFilterNode($propFilterNodes->item($ii)); - - - } - - $this->filters = $propFilters; - $this->limit = $limit; - $this->requestedProperties = array_keys(DAV\XMLUtil::parseProperties($this->dom->firstChild)); - $this->test = $test; - - } - - /** - * Parses the prop-filter xml element - * - * @param \DOMElement $propFilterNode - * @return array - */ - protected function parsePropFilterNode(\DOMElement $propFilterNode) { - - $propFilter = array(); - $propFilter['name'] = $propFilterNode->getAttribute('name'); - $propFilter['test'] = $propFilterNode->getAttribute('test'); - if (!$propFilter['test']) $propFilter['test'] = 'anyof'; - - $propFilter['is-not-defined'] = $this->xpath->query('card:is-not-defined', $propFilterNode)->length>0; - - $paramFilterNodes = $this->xpath->query('card:param-filter', $propFilterNode); - - $propFilter['param-filters'] = array(); - - - for($ii=0;$ii<$paramFilterNodes->length;$ii++) { - - $propFilter['param-filters'][] = $this->parseParamFilterNode($paramFilterNodes->item($ii)); - - } - $propFilter['text-matches'] = array(); - $textMatchNodes = $this->xpath->query('card:text-match', $propFilterNode); - - for($ii=0;$ii<$textMatchNodes->length;$ii++) { - - $propFilter['text-matches'][] = $this->parseTextMatchNode($textMatchNodes->item($ii)); - - } - - return $propFilter; - - } - - /** - * Parses the param-filter element - * - * @param \DOMElement $paramFilterNode - * @return array - */ - public function parseParamFilterNode(\DOMElement $paramFilterNode) { - - $paramFilter = array(); - $paramFilter['name'] = $paramFilterNode->getAttribute('name'); - $paramFilter['is-not-defined'] = $this->xpath->query('card:is-not-defined', $paramFilterNode)->length>0; - $paramFilter['text-match'] = null; - - $textMatch = $this->xpath->query('card:text-match', $paramFilterNode); - if ($textMatch->length>0) { - $paramFilter['text-match'] = $this->parseTextMatchNode($textMatch->item(0)); - } - - return $paramFilter; - - } - - /** - * Text match - * - * @param \DOMElement $textMatchNode - * @return array - */ - public function parseTextMatchNode(\DOMElement $textMatchNode) { - - $matchType = $textMatchNode->getAttribute('match-type'); - if (!$matchType) $matchType = 'contains'; - - if (!in_array($matchType, array('contains', 'equals', 'starts-with', 'ends-with'))) { - throw new DAV\Exception\BadRequest('Unknown match-type: ' . $matchType); - } - - $negateCondition = $textMatchNode->getAttribute('negate-condition'); - $negateCondition = $negateCondition==='yes'; - $collation = $textMatchNode->getAttribute('collation'); - if (!$collation) $collation = 'i;unicode-casemap'; - - return array( - 'negate-condition' => $negateCondition, - 'collation' => $collation, - 'match-type' => $matchType, - 'value' => $textMatchNode->nodeValue - ); - - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookRoot.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookRoot.php deleted file mode 100644 index 5cbd918354..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/AddressBookRoot.php +++ /dev/null @@ -1,80 +0,0 @@ -carddavBackend = $carddavBackend; - parent::__construct($principalBackend, $principalPrefix); - - } - - /** - * Returns the name of the node - * - * @return string - */ - public function getName() { - - return Plugin::ADDRESSBOOK_ROOT; - - } - - /** - * This method returns a node for a principal. - * - * The passed array contains principal information, and is guaranteed to - * at least contain a uri item. Other properties may or may not be - * supplied by the authentication backend. - * - * @param array $principal - * @return \SabreForRainLoop\DAV\INode - */ - public function getChildForPrincipal(array $principal) { - - return new UserAddressBooks($this->carddavBackend, $principal['uri']); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/AbstractBackend.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/AbstractBackend.php deleted file mode 100644 index 14504d6fa8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Backend/AbstractBackend.php +++ /dev/null @@ -1,18 +0,0 @@ -pdo = $pdo; - $this->addressBooksTableName = $addressBooksTableName; - $this->cardsTableName = $cardsTableName; - - } - - /** - * Returns the list of addressbooks for a specific user. - * - * @param string $principalUri - * @return array - */ - public function getAddressBooksForUser($principalUri) { - - $stmt = $this->pdo->prepare('SELECT id, uri, displayname, principaluri, description, ctag FROM '.$this->addressBooksTableName.' WHERE principaluri = ?'); - $stmt->execute(array($principalUri)); - - $addressBooks = array(); - - foreach($stmt->fetchAll() as $row) { - - $addressBooks[] = array( - 'id' => $row['id'], - 'uri' => $row['uri'], - 'principaluri' => $row['principaluri'], - '{DAV:}displayname' => $row['displayname'], - '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' => $row['description'], - '{http://calendarserver.org/ns/}getctag' => $row['ctag'], - '{' . CardDAV\Plugin::NS_CARDDAV . '}supported-address-data' => - new CardDAV\Property\SupportedAddressData(), - ); - - } - - return $addressBooks; - - } - - - /** - * Updates an addressbook's properties - * - * See SabreForRainLoop\DAV\IProperties for a description of the mutations array, as - * well as the return value. - * - * @param mixed $addressBookId - * @param array $mutations - * @see SabreForRainLoop\DAV\IProperties::updateProperties - * @return bool|array - */ - public function updateAddressBook($addressBookId, array $mutations) { - - $updates = array(); - - foreach($mutations as $property=>$newValue) { - - switch($property) { - case '{DAV:}displayname' : - $updates['displayname'] = $newValue; - break; - case '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' : - $updates['description'] = $newValue; - break; - default : - // If any unsupported values were being updated, we must - // let the entire request fail. - return false; - } - - } - - // No values are being updated? - if (!$updates) { - return false; - } - - $query = 'UPDATE ' . $this->addressBooksTableName . ' SET ctag = ctag + 1 '; - foreach($updates as $key=>$value) { - $query.=', `' . $key . '` = :' . $key . ' '; - } - $query.=' WHERE id = :addressbookid'; - - $stmt = $this->pdo->prepare($query); - $updates['addressbookid'] = $addressBookId; - - $stmt->execute($updates); - - return true; - - } - - /** - * Creates a new address book - * - * @param string $principalUri - * @param string $url Just the 'basename' of the url. - * @param array $properties - * @return void - */ - public function createAddressBook($principalUri, $url, array $properties) { - - $values = array( - 'displayname' => null, - 'description' => null, - 'principaluri' => $principalUri, - 'uri' => $url, - ); - - foreach($properties as $property=>$newValue) { - - switch($property) { - case '{DAV:}displayname' : - $values['displayname'] = $newValue; - break; - case '{' . CardDAV\Plugin::NS_CARDDAV . '}addressbook-description' : - $values['description'] = $newValue; - break; - default : - throw new DAV\Exception\BadRequest('Unknown property: ' . $property); - } - - } - - $query = 'INSERT INTO ' . $this->addressBooksTableName . ' (uri, displayname, description, principaluri, ctag) VALUES (:uri, :displayname, :description, :principaluri, 1)'; - $stmt = $this->pdo->prepare($query); - $stmt->execute($values); - - } - - /** - * Deletes an entire addressbook and all its contents - * - * @param int $addressBookId - * @return void - */ - public function deleteAddressBook($addressBookId) { - - $stmt = $this->pdo->prepare('DELETE FROM ' . $this->cardsTableName . ' WHERE addressbookid = ?'); - $stmt->execute(array($addressBookId)); - - $stmt = $this->pdo->prepare('DELETE FROM ' . $this->addressBooksTableName . ' WHERE id = ?'); - $stmt->execute(array($addressBookId)); - - } - - /** - * Returns all cards for a specific addressbook id. - * - * This method should return the following properties for each card: - * * carddata - raw vcard data - * * uri - Some unique url - * * lastmodified - A unix timestamp - * - * It's recommended to also return the following properties: - * * etag - A unique etag. This must change every time the card changes. - * * size - The size of the card in bytes. - * - * If these last two properties are provided, less time will be spent - * calculating them. If they are specified, you can also ommit carddata. - * This may speed up certain requests, especially with large cards. - * - * @param mixed $addressbookId - * @return array - */ - public function getCards($addressbookId) { - - $stmt = $this->pdo->prepare('SELECT id, carddata, uri, lastmodified FROM ' . $this->cardsTableName . ' WHERE addressbookid = ?'); - $stmt->execute(array($addressbookId)); - - return $stmt->fetchAll(\PDO::FETCH_ASSOC); - - - } - - /** - * Returns a specfic card. - * - * The same set of properties must be returned as with getCards. The only - * exception is that 'carddata' is absolutely required. - * - * @param mixed $addressBookId - * @param string $cardUri - * @return array - */ - public function getCard($addressBookId, $cardUri) { - - $stmt = $this->pdo->prepare('SELECT id, carddata, uri, lastmodified FROM ' . $this->cardsTableName . ' WHERE addressbookid = ? AND uri = ? LIMIT 1'); - $stmt->execute(array($addressBookId, $cardUri)); - - $result = $stmt->fetchAll(\PDO::FETCH_ASSOC); - - return (count($result)>0?$result[0]:false); - - } - - /** - * Creates a new card. - * - * The addressbook id will be passed as the first argument. This is the - * same id as it is returned from the getAddressbooksForUser method. - * - * The cardUri is a base uri, and doesn't include the full path. The - * cardData argument is the vcard body, and is passed as a string. - * - * It is possible to return an ETag from this method. This ETag is for the - * newly created resource, and must be enclosed with double quotes (that - * is, the string itself must contain the double quotes). - * - * You should only return the ETag if you store the carddata as-is. If a - * subsequent GET request on the same card does not have the same body, - * byte-by-byte and you did return an ETag here, clients tend to get - * confused. - * - * If you don't return an ETag, you can just return null. - * - * @param mixed $addressBookId - * @param string $cardUri - * @param string $cardData - * @return string|null - */ - public function createCard($addressBookId, $cardUri, $cardData) { - - $stmt = $this->pdo->prepare('INSERT INTO ' . $this->cardsTableName . ' (carddata, uri, lastmodified, addressbookid) VALUES (?, ?, ?, ?)'); - - $result = $stmt->execute(array($cardData, $cardUri, time(), $addressBookId)); - - $stmt2 = $this->pdo->prepare('UPDATE ' . $this->addressBooksTableName . ' SET ctag = ctag + 1 WHERE id = ?'); - $stmt2->execute(array($addressBookId)); - - return '"' . md5($cardData) . '"'; - - } - - /** - * Updates a card. - * - * The addressbook id will be passed as the first argument. This is the - * same id as it is returned from the getAddressbooksForUser method. - * - * The cardUri is a base uri, and doesn't include the full path. The - * cardData argument is the vcard body, and is passed as a string. - * - * It is possible to return an ETag from this method. This ETag should - * match that of the updated resource, and must be enclosed with double - * quotes (that is: the string itself must contain the actual quotes). - * - * You should only return the ETag if you store the carddata as-is. If a - * subsequent GET request on the same card does not have the same body, - * byte-by-byte and you did return an ETag here, clients tend to get - * confused. - * - * If you don't return an ETag, you can just return null. - * - * @param mixed $addressBookId - * @param string $cardUri - * @param string $cardData - * @return string|null - */ - public function updateCard($addressBookId, $cardUri, $cardData) { - - $stmt = $this->pdo->prepare('UPDATE ' . $this->cardsTableName . ' SET carddata = ?, lastmodified = ? WHERE uri = ? AND addressbookid =?'); - $stmt->execute(array($cardData, time(), $cardUri, $addressBookId)); - - $stmt2 = $this->pdo->prepare('UPDATE ' . $this->addressBooksTableName . ' SET ctag = ctag + 1 WHERE id = ?'); - $stmt2->execute(array($addressBookId)); - - return '"' . md5($cardData) . '"'; - - } - - /** - * Deletes a card - * - * @param mixed $addressBookId - * @param string $cardUri - * @return bool - */ - public function deleteCard($addressBookId, $cardUri) { - - $stmt = $this->pdo->prepare('DELETE FROM ' . $this->cardsTableName . ' WHERE addressbookid = ? AND uri = ?'); - $stmt->execute(array($addressBookId, $cardUri)); - - $stmt2 = $this->pdo->prepare('UPDATE ' . $this->addressBooksTableName . ' SET ctag = ctag + 1 WHERE id = ?'); - $stmt2->execute(array($addressBookId)); - - return $stmt->rowCount()===1; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Card.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Card.php deleted file mode 100644 index dba09ec6d7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Card.php +++ /dev/null @@ -1,260 +0,0 @@ -carddavBackend = $carddavBackend; - $this->addressBookInfo = $addressBookInfo; - $this->cardData = $cardData; - - } - - /** - * Returns the uri for this object - * - * @return string - */ - public function getName() { - - return $this->cardData['uri']; - - } - - /** - * Returns the VCard-formatted object - * - * @return string - */ - public function get() { - - // Pre-populating 'carddata' is optional. If we don't yet have it - // already, we fetch it from the backend. - if (!isset($this->cardData['carddata'])) { - $this->cardData = $this->carddavBackend->getCard($this->addressBookInfo['id'], $this->cardData['uri']); - } - return $this->cardData['carddata']; - - } - - /** - * Updates the VCard-formatted object - * - * @param string $cardData - * @return string|null - */ - public function put($cardData) { - - if (is_resource($cardData)) - $cardData = stream_get_contents($cardData); - - // Converting to UTF-8, if needed - $cardData = DAV\StringUtil::ensureUTF8($cardData); - - $etag = $this->carddavBackend->updateCard($this->addressBookInfo['id'],$this->cardData['uri'],$cardData); - $this->cardData['carddata'] = $cardData; - $this->cardData['etag'] = $etag; - - return $etag; - - } - - /** - * Deletes the card - * - * @return void - */ - public function delete() { - - $this->carddavBackend->deleteCard($this->addressBookInfo['id'],$this->cardData['uri']); - - } - - /** - * Returns the mime content-type - * - * @return string - */ - public function getContentType() { - - return 'text/x-vcard; charset=utf-8'; - - } - - /** - * Returns an ETag for this object - * - * @return string - */ - public function getETag() { - - if (isset($this->cardData['etag'])) { - return $this->cardData['etag']; - } else { - $data = $this->get(); - if (is_string($data)) { - return '"' . md5($data) . '"'; - } else { - // We refuse to calculate the md5 if it's a stream. - return null; - } - } - - } - - /** - * Returns the last modification date as a unix timestamp - * - * @return int - */ - public function getLastModified() { - - return isset($this->cardData['lastmodified'])?$this->cardData['lastmodified']:null; - - } - - /** - * Returns the size of this object in bytes - * - * @return int - */ - public function getSize() { - - if (array_key_exists('size', $this->cardData)) { - return $this->cardData['size']; - } else { - return strlen($this->get()); - } - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->addressBookInfo['principaluri']; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->addressBookInfo['principaluri'], - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->addressBookInfo['principaluri'], - 'protected' => true, - ), - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/IAddressBook.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/IAddressBook.php deleted file mode 100644 index a8d74c6bb1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/IAddressBook.php +++ /dev/null @@ -1,20 +0,0 @@ -subscribeEvent('beforeGetProperties', array($this, 'beforeGetProperties')); - $server->subscribeEvent('afterGetProperties', array($this, 'afterGetProperties')); - $server->subscribeEvent('updateProperties', array($this, 'updateProperties')); - $server->subscribeEvent('report', array($this,'report')); - $server->subscribeEvent('onHTMLActionsPanel', array($this,'htmlActionsPanel')); - $server->subscribeEvent('onBrowserPostAction', array($this,'browserPostAction')); - $server->subscribeEvent('beforeWriteContent', array($this, 'beforeWriteContent')); - $server->subscribeEvent('beforeCreateFile', array($this, 'beforeCreateFile')); - - /* Namespaces */ - $server->xmlNamespaces[self::NS_CARDDAV] = 'card'; - - /* Mapping Interfaces to {DAV:}resourcetype values */ - $server->resourceTypeMapping['SabreForRainLoop\\CardDAV\\IAddressBook'] = '{' . self::NS_CARDDAV . '}addressbook'; - $server->resourceTypeMapping['SabreForRainLoop\\CardDAV\\IDirectory'] = '{' . self::NS_CARDDAV . '}directory'; - - /* Adding properties that may never be changed */ - $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-address-data'; - $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}max-resource-size'; - $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}addressbook-home-set'; - $server->protectedProperties[] = '{' . self::NS_CARDDAV . '}supported-collation-set'; - - $server->propertyMap['{http://calendarserver.org/ns/}me-card'] = 'SabreForRainLoop\\DAV\\Property\\Href'; - - $this->server = $server; - - } - - /** - * Returns a list of supported features. - * - * This is used in the DAV: header in the OPTIONS and PROPFIND requests. - * - * @return array - */ - public function getFeatures() { - - return array('addressbook'); - - } - - /** - * Returns a list of reports this plugin supports. - * - * This will be used in the {DAV:}supported-report-set property. - * Note that you still need to subscribe to the 'report' event to actually - * implement them - * - * @param string $uri - * @return array - */ - public function getSupportedReportSet($uri) { - - $node = $this->server->tree->getNodeForPath($uri); - if ($node instanceof IAddressBook || $node instanceof ICard) { - return array( - '{' . self::NS_CARDDAV . '}addressbook-multiget', - '{' . self::NS_CARDDAV . '}addressbook-query', - ); - } - return array(); - - } - - - /** - * Adds all CardDAV-specific properties - * - * @param string $path - * @param DAV\INode $node - * @param array $requestedProperties - * @param array $returnedProperties - * @return void - */ - public function beforeGetProperties($path, DAV\INode $node, array &$requestedProperties, array &$returnedProperties) { - - if ($node instanceof DAVACL\IPrincipal) { - - // calendar-home-set property - $addHome = '{' . self::NS_CARDDAV . '}addressbook-home-set'; - if (in_array($addHome,$requestedProperties)) { - $principalId = $node->getName(); - $addressbookHomePath = self::ADDRESSBOOK_ROOT . '/' . $principalId . '/'; - unset($requestedProperties[array_search($addHome, $requestedProperties)]); - $returnedProperties[200][$addHome] = new DAV\Property\Href($addressbookHomePath); - } - - $directories = '{' . self::NS_CARDDAV . '}directory-gateway'; - if ($this->directories && in_array($directories, $requestedProperties)) { - unset($requestedProperties[array_search($directories, $requestedProperties)]); - $returnedProperties[200][$directories] = new DAV\Property\HrefList($this->directories); - } - - } - - if ($node instanceof ICard) { - - // The address-data property is not supposed to be a 'real' - // property, but in large chunks of the spec it does act as such. - // Therefore we simply expose it as a property. - $addressDataProp = '{' . self::NS_CARDDAV . '}address-data'; - if (in_array($addressDataProp, $requestedProperties)) { - unset($requestedProperties[$addressDataProp]); - $val = $node->get(); - if (is_resource($val)) - $val = stream_get_contents($val); - - $returnedProperties[200][$addressDataProp] = $val; - - } - } - - if ($node instanceof UserAddressBooks) { - - $meCardProp = '{http://calendarserver.org/ns/}me-card'; - if (in_array($meCardProp, $requestedProperties)) { - - $props = $this->server->getProperties($node->getOwner(), array('{http://sabredav.org/ns}vcard-url')); - if (isset($props['{http://sabredav.org/ns}vcard-url'])) { - - $returnedProperties[200][$meCardProp] = new DAV\Property\Href( - $props['{http://sabredav.org/ns}vcard-url'] - ); - $pos = array_search($meCardProp, $requestedProperties); - unset($requestedProperties[$pos]); - - } - - } - - } - - } - - /** - * This event is triggered when a PROPPATCH method is executed - * - * @param array $mutations - * @param array $result - * @param DAV\INode $node - * @return bool - */ - public function updateProperties(&$mutations, &$result, DAV\INode $node) { - - if (!$node instanceof UserAddressBooks) { - return true; - } - - $meCard = '{http://calendarserver.org/ns/}me-card'; - - // The only property we care about - if (!isset($mutations[$meCard])) - return true; - - $value = $mutations[$meCard]; - unset($mutations[$meCard]); - - if ($value instanceof DAV\Property\IHref) { - $value = $value->getHref(); - $value = $this->server->calculateUri($value); - } elseif (!is_null($value)) { - $result[400][$meCard] = null; - return false; - } - - $innerResult = $this->server->updateProperties( - $node->getOwner(), - array( - '{http://sabredav.org/ns}vcard-url' => $value, - ) - ); - - $closureResult = false; - foreach($innerResult as $status => $props) { - if (is_array($props) && array_key_exists('{http://sabredav.org/ns}vcard-url', $props)) { - $result[$status][$meCard] = null; - $closureResult = ($status>=200 && $status<300); - } - - } - - return $result; - - } - - /** - * This functions handles REPORT requests specific to CardDAV - * - * @param string $reportName - * @param \DOMNode $dom - * @return bool - */ - public function report($reportName,$dom) { - - switch($reportName) { - case '{'.self::NS_CARDDAV.'}addressbook-multiget' : - $this->addressbookMultiGetReport($dom); - return false; - case '{'.self::NS_CARDDAV.'}addressbook-query' : - $this->addressBookQueryReport($dom); - return false; - default : - return; - - } - - - } - - /** - * This function handles the addressbook-multiget REPORT. - * - * This report is used by the client to fetch the content of a series - * of urls. Effectively avoiding a lot of redundant requests. - * - * @param \DOMNode $dom - * @return void - */ - public function addressbookMultiGetReport($dom) { - - $properties = array_keys(DAV\XMLUtil::parseProperties($dom->firstChild)); - - $hrefElems = $dom->getElementsByTagNameNS('urn:DAV','href'); - $propertyList = array(); - - foreach($hrefElems as $elem) { - - $uri = $this->server->calculateUri($elem->nodeValue); - list($propertyList[]) = $this->server->getPropertiesForPath($uri,$properties); - - } - - $prefer = $this->server->getHTTPPRefer(); - - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Vary','Brief,Prefer'); - $this->server->httpResponse->sendBody($this->server->generateMultiStatus($propertyList, $prefer['return-minimal'])); - - } - - /** - * This method is triggered before a file gets updated with new content. - * - * This plugin uses this method to ensure that Card nodes receive valid - * vcard data. - * - * @param string $path - * @param DAV\IFile $node - * @param resource $data - * @return void - */ - public function beforeWriteContent($path, DAV\IFile $node, &$data) { - - if (!$node instanceof ICard) - return; - - $this->validateVCard($data); - - } - - /** - * This method is triggered before a new file is created. - * - * This plugin uses this method to ensure that Card nodes receive valid - * vcard data. - * - * @param string $path - * @param resource $data - * @param DAV\ICollection $parentNode - * @return void - */ - public function beforeCreateFile($path, &$data, DAV\ICollection $parentNode) { - - if (!$parentNode instanceof IAddressBook) - return; - - $this->validateVCard($data); - - } - - /** - * Checks if the submitted iCalendar data is in fact, valid. - * - * An exception is thrown if it's not. - * - * @param resource|string $data - * @return void - */ - protected function validateVCard(&$data) { - - // If it's a stream, we convert it to a string first. - if (is_resource($data)) { - $data = stream_get_contents($data); - } - - // Converting the data to unicode, if needed. - $data = DAV\StringUtil::ensureUTF8($data); - - try { - - $vobj = VObject\Reader::read($data); - - } catch (VObject\ParseException $e) { - - throw new DAV\Exception\UnsupportedMediaType('This resource only supports valid vcard data. Parse error: ' . $e->getMessage()); - - } - - if ($vobj->name !== 'VCARD') { - throw new DAV\Exception\UnsupportedMediaType('This collection can only support vcard objects.'); - } - - if (!isset($vobj->UID)) { - // No UID in vcards is invalid, but we'll just add it in anyway. - $vobj->add('UID', DAV\UUIDUtil::getUUID()); - $data = $vobj->serialize(); - } - - } - - - /** - * This function handles the addressbook-query REPORT - * - * This report is used by the client to filter an addressbook based on a - * complex query. - * - * @param \DOMNode $dom - * @return void - */ - protected function addressbookQueryReport($dom) { - - $query = new AddressBookQueryParser($dom); - $query->parse(); - - $depth = $this->server->getHTTPDepth(0); - - if ($depth==0) { - $candidateNodes = array( - $this->server->tree->getNodeForPath($this->server->getRequestUri()) - ); - } else { - $candidateNodes = $this->server->tree->getChildren($this->server->getRequestUri()); - } - - $validNodes = array(); - foreach($candidateNodes as $node) { - - if (!$node instanceof ICard) - continue; - - $blob = $node->get(); - if (is_resource($blob)) { - $blob = stream_get_contents($blob); - } - - if (!$this->validateFilters($blob, $query->filters, $query->test)) { - continue; - } - - $validNodes[] = $node; - - if ($query->limit && $query->limit <= count($validNodes)) { - // We hit the maximum number of items, we can stop now. - break; - } - - } - - $result = array(); - foreach($validNodes as $validNode) { - - if ($depth==0) { - $href = $this->server->getRequestUri(); - } else { - $href = $this->server->getRequestUri() . '/' . $validNode->getName(); - } - - list($result[]) = $this->server->getPropertiesForPath($href, $query->requestedProperties, 0); - - } - - $prefer = $this->server->getHTTPPRefer(); - - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Vary','Brief,Prefer'); - $this->server->httpResponse->sendBody($this->server->generateMultiStatus($result, $prefer['return-minimal'])); - - } - - /** - * Validates if a vcard makes it throught a list of filters. - * - * @param string $vcardData - * @param array $filters - * @param string $test anyof or allof (which means OR or AND) - * @return bool - */ - public function validateFilters($vcardData, array $filters, $test) { - - $vcard = VObject\Reader::read($vcardData); - - if (!$filters) return true; - - foreach($filters as $filter) { - - $isDefined = isset($vcard->{$filter['name']}); - if ($filter['is-not-defined']) { - if ($isDefined) { - $success = false; - } else { - $success = true; - } - } elseif ((!$filter['param-filters'] && !$filter['text-matches']) || !$isDefined) { - - // We only need to check for existence - $success = $isDefined; - - } else { - - $vProperties = $vcard->select($filter['name']); - - $results = array(); - if ($filter['param-filters']) { - $results[] = $this->validateParamFilters($vProperties, $filter['param-filters'], $filter['test']); - } - if ($filter['text-matches']) { - $texts = array(); - foreach($vProperties as $vProperty) - $texts[] = $vProperty->getValue(); - - $results[] = $this->validateTextMatches($texts, $filter['text-matches'], $filter['test']); - } - - if (count($results)===1) { - $success = $results[0]; - } else { - if ($filter['test'] === 'anyof') { - $success = $results[0] || $results[1]; - } else { - $success = $results[0] && $results[1]; - } - } - - } // else - - // There are two conditions where we can already determine whether - // or not this filter succeeds. - if ($test==='anyof' && $success) { - return true; - } - if ($test==='allof' && !$success) { - return false; - } - - } // foreach - - // If we got all the way here, it means we haven't been able to - // determine early if the test failed or not. - // - // This implies for 'anyof' that the test failed, and for 'allof' that - // we succeeded. Sounds weird, but makes sense. - return $test==='allof'; - - } - - /** - * Validates if a param-filter can be applied to a specific property. - * - * @todo currently we're only validating the first parameter of the passed - * property. Any subsequence parameters with the same name are - * ignored. - * @param array $vProperties - * @param array $filters - * @param string $test - * @return bool - */ - protected function validateParamFilters(array $vProperties, array $filters, $test) { - - foreach($filters as $filter) { - - $isDefined = false; - foreach($vProperties as $vProperty) { - $isDefined = isset($vProperty[$filter['name']]); - if ($isDefined) break; - } - - if ($filter['is-not-defined']) { - if ($isDefined) { - $success = false; - } else { - $success = true; - } - - // If there's no text-match, we can just check for existence - } elseif (!$filter['text-match'] || !$isDefined) { - - $success = $isDefined; - - } else { - - $success = false; - foreach($vProperties as $vProperty) { - // If we got all the way here, we'll need to validate the - // text-match filter. - $success = DAV\StringUtil::textMatch($vProperty[$filter['name']]->getValue(), $filter['text-match']['value'], $filter['text-match']['collation'], $filter['text-match']['match-type']); - if ($success) break; - } - if ($filter['text-match']['negate-condition']) { - $success = !$success; - } - - } // else - - // There are two conditions where we can already determine whether - // or not this filter succeeds. - if ($test==='anyof' && $success) { - return true; - } - if ($test==='allof' && !$success) { - return false; - } - - } - - // If we got all the way here, it means we haven't been able to - // determine early if the test failed or not. - // - // This implies for 'anyof' that the test failed, and for 'allof' that - // we succeeded. Sounds weird, but makes sense. - return $test==='allof'; - - } - - /** - * Validates if a text-filter can be applied to a specific property. - * - * @param array $texts - * @param array $filters - * @param string $test - * @return bool - */ - protected function validateTextMatches(array $texts, array $filters, $test) { - - foreach($filters as $filter) { - - $success = false; - foreach($texts as $haystack) { - $success = DAV\StringUtil::textMatch($haystack, $filter['value'], $filter['collation'], $filter['match-type']); - - // Breaking on the first match - if ($success) break; - } - if ($filter['negate-condition']) { - $success = !$success; - } - - if ($success && $test==='anyof') - return true; - - if (!$success && $test=='allof') - return false; - - - } - - // If we got all the way here, it means we haven't been able to - // determine early if the test failed or not. - // - // This implies for 'anyof' that the test failed, and for 'allof' that - // we succeeded. Sounds weird, but makes sense. - return $test==='allof'; - - } - - /** - * This event is triggered after webdav-properties have been retrieved. - * - * @return bool - */ - public function afterGetProperties($uri, &$properties) { - - // If the request was made using the SOGO connector, we must rewrite - // the content-type property. By default SabreDAV will send back - // text/x-vcard; charset=utf-8, but for SOGO we must strip that last - // part. - if (!isset($properties[200]['{DAV:}getcontenttype'])) - return; - - if (strpos($this->server->httpRequest->getHeader('User-Agent'),'Thunderbird')===false) { - return; - } - - if (strpos($properties[200]['{DAV:}getcontenttype'],'text/x-vcard')===0) { - $properties[200]['{DAV:}getcontenttype'] = 'text/x-vcard'; - } - - } - - /** - * This method is used to generate HTML output for the - * SabreForRainLoop\DAV\Browser\Plugin. This allows us to generate an interface users - * can use to create new calendars. - * - * @param DAV\INode $node - * @param string $output - * @return bool - */ - public function htmlActionsPanel(DAV\INode $node, &$output) { - - if (!$node instanceof UserAddressBooks) - return; - - $output.= '
-

Create new address book

- -
-
- -
- '; - - return false; - - } - - /** - * This method allows us to intercept the 'mkcalendar' sabreAction. This - * action enables the user to create new calendars from the browser plugin. - * - * @param string $uri - * @param string $action - * @param array $postVars - * @return bool - */ - public function browserPostAction($uri, $action, array $postVars) { - - if ($action!=='mkaddressbook') - return; - - $resourceType = array('{DAV:}collection','{urn:ietf:params:xml:ns:carddav}addressbook'); - $properties = array(); - if (isset($postVars['{DAV:}displayname'])) { - $properties['{DAV:}displayname'] = $postVars['{DAV:}displayname']; - } - $this->server->createCollection($uri . '/' . $postVars['name'],$resourceType,$properties); - return false; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php deleted file mode 100644 index 084c06f32e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Property/SupportedAddressData.php +++ /dev/null @@ -1,72 +0,0 @@ - 'text/vcard', 'version' => '3.0'), - // array('contentType' => 'text/vcard', 'version' => '4.0'), - ); - } - - $this->supportedData = $supportedData; - - } - - /** - * Serializes the property in a DOMDocument - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - - $prefix = - isset($server->xmlNamespaces[CardDAV\Plugin::NS_CARDDAV]) ? - $server->xmlNamespaces[CardDAV\Plugin::NS_CARDDAV] : - 'card'; - - foreach($this->supportedData as $supported) { - - $caldata = $doc->createElementNS(CardDAV\Plugin::NS_CARDDAV, $prefix . ':address-data-type'); - $caldata->setAttribute('content-type',$supported['contentType']); - $caldata->setAttribute('version',$supported['version']); - $node->appendChild($caldata); - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/UserAddressBooks.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/UserAddressBooks.php deleted file mode 100644 index 0970fe3da5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/UserAddressBooks.php +++ /dev/null @@ -1,260 +0,0 @@ -carddavBackend = $carddavBackend; - $this->principalUri = $principalUri; - - } - - /** - * Returns the name of this object - * - * @return string - */ - public function getName() { - - list(,$name) = DAV\URLUtil::splitPath($this->principalUri); - return $name; - - } - - /** - * Updates the name of this object - * - * @param string $name - * @return void - */ - public function setName($name) { - - throw new DAV\Exception\MethodNotAllowed(); - - } - - /** - * Deletes this object - * - * @return void - */ - public function delete() { - - throw new DAV\Exception\MethodNotAllowed(); - - } - - /** - * Returns the last modification date - * - * @return int - */ - public function getLastModified() { - - return null; - - } - - /** - * Creates a new file under this object. - * - * This is currently not allowed - * - * @param string $filename - * @param resource $data - * @return void - */ - public function createFile($filename, $data=null) { - - throw new DAV\Exception\MethodNotAllowed('Creating new files in this collection is not supported'); - - } - - /** - * Creates a new directory under this object. - * - * This is currently not allowed. - * - * @param string $filename - * @return void - */ - public function createDirectory($filename) { - - throw new DAV\Exception\MethodNotAllowed('Creating new collections in this collection is not supported'); - - } - - /** - * Returns a single calendar, by name - * - * @param string $name - * @todo needs optimizing - * @return \AddressBook - */ - public function getChild($name) { - - foreach($this->getChildren() as $child) { - if ($name==$child->getName()) - return $child; - - } - throw new DAV\Exception\NotFound('Addressbook with name \'' . $name . '\' could not be found'); - - } - - /** - * Returns a list of addressbooks - * - * @return array - */ - public function getChildren() { - - $addressbooks = $this->carddavBackend->getAddressbooksForUser($this->principalUri); - $objs = array(); - foreach($addressbooks as $addressbook) { - $objs[] = new AddressBook($this->carddavBackend, $addressbook); - } - return $objs; - - } - - /** - * Creates a new addressbook - * - * @param string $name - * @param array $resourceType - * @param array $properties - * @return void - */ - public function createExtendedCollection($name, array $resourceType, array $properties) { - - if (!in_array('{'.Plugin::NS_CARDDAV.'}addressbook',$resourceType) || count($resourceType)!==2) { - throw new DAV\Exception\InvalidResourceType('Unknown resourceType for this collection'); - } - $this->carddavBackend->createAddressBook($this->principalUri, $name, $properties); - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalUri; - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->principalUri, - 'protected' => true, - ), - array( - 'privilege' => '{DAV:}write', - 'principal' => $this->principalUri, - 'protected' => true, - ), - - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Changing ACL is not yet supported'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/VCFExportPlugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/VCFExportPlugin.php deleted file mode 100644 index 081bdd22c6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/VCFExportPlugin.php +++ /dev/null @@ -1,108 +0,0 @@ -server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'beforeMethod'), 90); - - } - - /** - * 'beforeMethod' event handles. This event handles intercepts GET requests ending - * with ?export - * - * @param string $method - * @param string $uri - * @return bool - */ - public function beforeMethod($method, $uri) { - - if ($method!='GET') return; - if ($this->server->httpRequest->getQueryString()!='export') return; - - // splitting uri - list($uri) = explode('?',$uri,2); - - $node = $this->server->tree->getNodeForPath($uri); - - if (!($node instanceof IAddressBook)) return; - - // Checking ACL, if available. - if ($aclPlugin = $this->server->getPlugin('acl')) { - $aclPlugin->checkPrivileges($uri, '{DAV:}read'); - } - - $this->server->httpResponse->setHeader('Content-Type','text/directory'); - $this->server->httpResponse->sendStatus(200); - - $nodes = $this->server->getPropertiesForPath($uri, array( - '{' . Plugin::NS_CARDDAV . '}address-data', - ),1); - - $this->server->httpResponse->sendBody($this->generateVCF($nodes)); - - // Returning false to break the event chain - return false; - - } - - /** - * Merges all vcard objects, and builds one big vcf export - * - * @param array $nodes - * @return string - */ - public function generateVCF(array $nodes) { - - $output = ""; - - foreach($nodes as $node) { - - if (!isset($node[200]['{' . Plugin::NS_CARDDAV . '}address-data'])) { - continue; - } - $nodeData = $node[200]['{' . Plugin::NS_CARDDAV . '}address-data']; - - // Parsing this node so VObject can clean up the output. - $output .= - VObject\Reader::read($nodeData)->serialize(); - - } - - return $output; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Version.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Version.php deleted file mode 100644 index d3ce9816d1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/CardDAV/Version.php +++ /dev/null @@ -1,26 +0,0 @@ -currentUser; - } - - - /** - * Authenticates the user based on the current request. - * - * If authentication is successful, true must be returned. - * If authentication fails, an exception must be thrown. - * - * @param DAV\Server $server - * @param string $realm - * @throws DAV\Exception\NotAuthenticated - * @return bool - */ - public function authenticate(DAV\Server $server, $realm) { - - $auth = new HTTP\BasicAuth(); - $auth->setHTTPRequest($server->httpRequest); - $auth->setHTTPResponse($server->httpResponse); - $auth->setRealm($realm); - $userpass = $auth->getUserPass(); - if (!$userpass) { - $auth->requireLogin(); - throw new DAV\Exception\NotAuthenticated('No basic authentication headers were found'); - } - - // Authenticates the user - if (!$this->validateUserPass($userpass[0],$userpass[1])) { - $auth->requireLogin(); - throw new DAV\Exception\NotAuthenticated('Username or password does not match'); - } - $this->currentUser = $userpass[0]; - return true; - } - - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/AbstractDigest.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/AbstractDigest.php deleted file mode 100644 index ca642c6c24..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/AbstractDigest.php +++ /dev/null @@ -1,101 +0,0 @@ -setHTTPRequest($server->httpRequest); - $digest->setHTTPResponse($server->httpResponse); - - $digest->setRealm($realm); - $digest->init(); - - $username = $digest->getUsername(); - - // No username was given - if (!$username) { - $digest->requireLogin(); - throw new DAV\Exception\NotAuthenticated('No digest authentication headers were found'); - } - - $hash = $this->getDigestHash($realm, $username); - // If this was false, the user account didn't exist - if ($hash===false || is_null($hash)) { - $digest->requireLogin(); - throw new DAV\Exception\NotAuthenticated('The supplied username was not on file'); - } - if (!is_string($hash)) { - throw new DAV\Exception('The returned value from getDigestHash must be a string or null'); - } - - // If this was false, the password or part of the hash was incorrect. - if (!$digest->validateA1($hash)) { - $digest->requireLogin(); - throw new DAV\Exception\NotAuthenticated('Incorrect username'); - } - - $this->currentUser = $username; - return true; - - } - - /** - * Returns the currently logged in username. - * - * @return string|null - */ - public function getCurrentUser() { - - return $this->currentUser; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/Apache.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/Apache.php deleted file mode 100644 index be19a6810a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/Apache.php +++ /dev/null @@ -1,63 +0,0 @@ -httpRequest->getRawServerValue('REMOTE_USER'); - if (is_null($remoteUser)) { - throw new DAV\Exception('We did not receive the $_SERVER[REMOTE_USER] property. This means that apache might have been misconfigured'); - } - - $this->remoteUser = $remoteUser; - return true; - - } - - /** - * Returns information about the currently logged in user. - * - * If nobody is currently logged in, this method should return null. - * - * @return array|null - */ - public function getCurrentUser() { - - return $this->remoteUser; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/BackendInterface.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/BackendInterface.php deleted file mode 100644 index 1193489d4f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/BackendInterface.php +++ /dev/null @@ -1,36 +0,0 @@ -loadFile($filename); - - } - - /** - * Loads an htdigest-formatted file. This method can be called multiple times if - * more than 1 file is used. - * - * @param string $filename - * @return void - */ - public function loadFile($filename) { - - foreach(file($filename,FILE_IGNORE_NEW_LINES) as $line) { - - if (substr_count($line, ":") !== 2) - throw new DAV\Exception('Malformed htdigest file. Every line should contain 2 colons'); - - list($username,$realm,$A1) = explode(':',$line); - - if (!preg_match('/^[a-zA-Z0-9]{32}$/', $A1)) - throw new DAV\Exception('Malformed htdigest file. Invalid md5 hash'); - - $this->users[$realm . ':' . $username] = $A1; - - } - - } - - /** - * Returns a users' information - * - * @param string $realm - * @param string $username - * @return string - */ - public function getDigestHash($realm, $username) { - - return isset($this->users[$realm . ':' . $username])?$this->users[$realm . ':' . $username]:false; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/PDO.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/PDO.php deleted file mode 100644 index 7e8e31d6c7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Backend/PDO.php +++ /dev/null @@ -1,65 +0,0 @@ -pdo = $pdo; - $this->tableName = $tableName; - - } - - /** - * Returns the digest hash for a user. - * - * @param string $realm - * @param string $username - * @return string|null - */ - public function getDigestHash($realm,$username) { - - $stmt = $this->pdo->prepare('SELECT username, digesta1 FROM '.$this->tableName.' WHERE username = ?'); - $stmt->execute(array($username)); - $result = $stmt->fetchAll(); - - if (!count($result)) return; - - return $result[0]['digesta1']; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Plugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Plugin.php deleted file mode 100644 index ade6a5f752..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Auth/Plugin.php +++ /dev/null @@ -1,112 +0,0 @@ -authBackend = $authBackend; - $this->realm = $realm; - - } - - /** - * Initializes the plugin. This function is automatically called by the server - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'beforeMethod'),10); - - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() { - - return 'auth'; - - } - - /** - * Returns the current users' principal uri. - * - * If nobody is logged in, this will return null. - * - * @return string|null - */ - public function getCurrentUser() { - - $userInfo = $this->authBackend->getCurrentUser(); - if (!$userInfo) return null; - - return $userInfo; - - } - - /** - * This method is called before any HTTP method and forces users to be authenticated - * - * @param string $method - * @param string $uri - * @throws SabreForRainLoop\DAV\Exception\NotAuthenticated - * @return bool - */ - public function beforeMethod($method, $uri) { - - $this->authBackend->authenticate($this->server,$this->realm); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/GuessContentType.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/GuessContentType.php deleted file mode 100644 index c787fdda2e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/GuessContentType.php +++ /dev/null @@ -1,99 +0,0 @@ - 'image/jpeg', - 'gif' => 'image/gif', - 'png' => 'image/png', - - // groupware - 'ics' => 'text/calendar', - 'vcf' => 'text/x-vcard', - - // text - 'txt' => 'text/plain', - - ); - - /** - * Initializes the plugin - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - // Using a relatively low priority (200) to allow other extensions - // to set the content-type first. - $server->subscribeEvent('afterGetProperties',array($this,'afterGetProperties'),200); - - } - - /** - * Handler for teh afterGetProperties event - * - * @param string $path - * @param array $properties - * @return void - */ - public function afterGetProperties($path, &$properties) { - - if (array_key_exists('{DAV:}getcontenttype', $properties[404])) { - - list(, $fileName) = DAV\URLUtil::splitPath($path); - $contentType = $this->getContentType($fileName); - - if ($contentType) { - $properties[200]['{DAV:}getcontenttype'] = $contentType; - unset($properties[404]['{DAV:}getcontenttype']); - } - - } - - } - - /** - * Simple method to return the contenttype - * - * @param string $fileName - * @return string - */ - protected function getContentType($fileName) { - - // Just grabbing the extension - $extension = strtolower(substr($fileName,strrpos($fileName,'.')+1)); - if (isset($this->extensionMap[$extension])) - return $this->extensionMap[$extension]; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/MapGetToPropFind.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/MapGetToPropFind.php deleted file mode 100644 index 3792252b0d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/MapGetToPropFind.php +++ /dev/null @@ -1,57 +0,0 @@ -server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'httpGetInterceptor')); - } - - /** - * This method intercepts GET requests to non-files, and changes it into an HTTP PROPFIND request - * - * @param string $method - * @param string $uri - * @return bool - */ - public function httpGetInterceptor($method, $uri) { - - if ($method!='GET') return true; - - $node = $this->server->tree->getNodeForPath($uri); - if ($node instanceof DAV\IFile) return; - - $this->server->invokeMethod('PROPFIND',$uri); - return false; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/Plugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/Plugin.php deleted file mode 100644 index d19ba58ea8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/Plugin.php +++ /dev/null @@ -1,491 +0,0 @@ - 'icons/file', - 'SabreForRainLoop\\DAV\\ICollection' => 'icons/collection', - 'SabreForRainLoop\\DAVACL\\IPrincipal' => 'icons/principal', - 'SabreForRainLoop\\CalDAV\\ICalendar' => 'icons/calendar', - 'SabreForRainLoop\\CardDAV\\IAddressBook' => 'icons/addressbook', - 'SabreForRainLoop\\CardDAV\\ICard' => 'icons/card', - ); - - /** - * The file extension used for all icons - * - * @var string - */ - public $iconExtension = '.png'; - - /** - * reference to server class - * - * @var SabreForRainLoop\DAV\Server - */ - protected $server; - - /** - * enablePost turns on the 'actions' panel, which allows people to create - * folders and upload files straight from a browser. - * - * @var bool - */ - protected $enablePost = true; - - /** - * By default the browser plugin will generate a favicon and other images. - * To turn this off, set this property to false. - * - * @var bool - */ - protected $enableAssets = true; - - /** - * Creates the object. - * - * By default it will allow file creation and uploads. - * Specify the first argument as false to disable this - * - * @param bool $enablePost - * @param bool $enableAssets - */ - public function __construct($enablePost=true, $enableAssets = true) { - - $this->enablePost = $enablePost; - $this->enableAssets = $enableAssets; - - } - - /** - * Initializes the plugin and subscribes to events - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'httpGetInterceptor')); - $this->server->subscribeEvent('onHTMLActionsPanel', array($this, 'htmlActionsPanel'),200); - if ($this->enablePost) $this->server->subscribeEvent('unknownMethod',array($this,'httpPOSTHandler')); - } - - /** - * This method intercepts GET requests to collections and returns the html - * - * @param string $method - * @param string $uri - * @return bool - */ - public function httpGetInterceptor($method, $uri) { - - if ($method !== 'GET') return true; - - // We're not using straight-up $_GET, because we want everything to be - // unit testable. - $getVars = array(); - parse_str($this->server->httpRequest->getQueryString(), $getVars); - - if (isset($getVars['sabreAction']) && $getVars['sabreAction'] === 'asset' && isset($getVars['assetName'])) { - $this->serveAsset($getVars['assetName']); - return false; - } - - try { - $node = $this->server->tree->getNodeForPath($uri); - } catch (DAV\Exception\NotFound $e) { - // We're simply stopping when the file isn't found to not interfere - // with other plugins. - return; - } - if ($node instanceof DAV\IFile) - return; - - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->setHeader('Content-Type','text/html; charset=utf-8'); - - $this->server->httpResponse->sendBody( - $this->generateDirectoryIndex($uri) - ); - - return false; - - } - - /** - * Handles POST requests for tree operations. - * - * @param string $method - * @param string $uri - * @return bool - */ - public function httpPOSTHandler($method, $uri) { - - if ($method!='POST') return; - $contentType = $this->server->httpRequest->getHeader('Content-Type'); - list($contentType) = explode(';', $contentType); - if ($contentType !== 'application/x-www-form-urlencoded' && - $contentType !== 'multipart/form-data') { - return; - } - $postVars = $this->server->httpRequest->getPostVars(); - - if (!isset($postVars['sabreAction'])) - return; - - if ($this->server->broadcastEvent('onBrowserPostAction', array($uri, $postVars['sabreAction'], $postVars))) { - - switch($postVars['sabreAction']) { - - case 'mkcol' : - if (isset($postVars['name']) && trim($postVars['name'])) { - // Using basename() because we won't allow slashes - list(, $folderName) = DAV\URLUtil::splitPath(trim($postVars['name'])); - $this->server->createDirectory($uri . '/' . $folderName); - } - break; - case 'put' : - if ($_FILES) $file = current($_FILES); - else break; - - list(, $newName) = DAV\URLUtil::splitPath(trim($file['name'])); - if (isset($postVars['name']) && trim($postVars['name'])) - $newName = trim($postVars['name']); - - // Making sure we only have a 'basename' component - list(, $newName) = DAV\URLUtil::splitPath($newName); - - if (is_uploaded_file($file['tmp_name'])) { - $this->server->createFile($uri . '/' . $newName, fopen($file['tmp_name'],'r')); - } - break; - - } - - } - $this->server->httpResponse->setHeader('Location',$this->server->httpRequest->getUri()); - $this->server->httpResponse->sendStatus(302); - return false; - - } - - /** - * Escapes a string for html. - * - * @param string $value - * @return string - */ - public function escapeHTML($value) { - - return htmlspecialchars($value,ENT_QUOTES,'UTF-8'); - - } - - /** - * Generates the html directory index for a given url - * - * @param string $path - * @return string - */ - public function generateDirectoryIndex($path) { - - $version = ''; - if (DAV\Server::$exposeVersion) { - $version = DAV\Version::VERSION ."-". DAV\Version::STABILITY; - } - - $html = " - - Index for " . $this->escapeHTML($path) . "/ - SabreDAV " . $version . " - - "; - - if ($this->enableAssets) { - $html.=''; - } - - $html .= " - -

Index for " . $this->escapeHTML($path) . "/

- - - "; - - $files = $this->server->getPropertiesForPath($path,array( - '{DAV:}displayname', - '{DAV:}resourcetype', - '{DAV:}getcontenttype', - '{DAV:}getcontentlength', - '{DAV:}getlastmodified', - ),1); - - $parent = $this->server->tree->getNodeForPath($path); - - - if ($path) { - - list($parentUri) = DAV\URLUtil::splitPath($path); - $fullPath = DAV\URLUtil::encodePath($this->server->getBaseUri() . $parentUri); - - $icon = $this->enableAssets?'Parent':''; - $html.= " - - - - - - "; - - } - - foreach($files as $file) { - - // This is the current directory, we can skip it - if (rtrim($file['href'],'/')==$path) continue; - - list(, $name) = DAV\URLUtil::splitPath($file['href']); - - $type = null; - - - if (isset($file[200]['{DAV:}resourcetype'])) { - $type = $file[200]['{DAV:}resourcetype']->getValue(); - - // resourcetype can have multiple values - if (!is_array($type)) $type = array($type); - - foreach($type as $k=>$v) { - - // Some name mapping is preferred - switch($v) { - case '{DAV:}collection' : - $type[$k] = 'Collection'; - break; - case '{DAV:}principal' : - $type[$k] = 'Principal'; - break; - case '{urn:ietf:params:xml:ns:carddav}addressbook' : - $type[$k] = 'Addressbook'; - break; - case '{urn:ietf:params:xml:ns:caldav}calendar' : - $type[$k] = 'Calendar'; - break; - case '{urn:ietf:params:xml:ns:caldav}schedule-inbox' : - $type[$k] = 'Schedule Inbox'; - break; - case '{urn:ietf:params:xml:ns:caldav}schedule-outbox' : - $type[$k] = 'Schedule Outbox'; - break; - case '{http://calendarserver.org/ns/}calendar-proxy-read' : - $type[$k] = 'Proxy-Read'; - break; - case '{http://calendarserver.org/ns/}calendar-proxy-write' : - $type[$k] = 'Proxy-Write'; - break; - } - - } - $type = implode(', ', $type); - } - - // If no resourcetype was found, we attempt to use - // the contenttype property - if (!$type && isset($file[200]['{DAV:}getcontenttype'])) { - $type = $file[200]['{DAV:}getcontenttype']; - } - if (!$type) $type = 'Unknown'; - - $size = isset($file[200]['{DAV:}getcontentlength'])?(int)$file[200]['{DAV:}getcontentlength']:''; - $lastmodified = isset($file[200]['{DAV:}getlastmodified'])?$file[200]['{DAV:}getlastmodified']->getTime()->format(\DateTime::ATOM):''; - - $fullPath = DAV\URLUtil::encodePath('/' . trim($this->server->getBaseUri() . ($path?$path . '/':'') . $name,'/')); - - $displayName = isset($file[200]['{DAV:}displayname'])?$file[200]['{DAV:}displayname']:$name; - - $displayName = $this->escapeHTML($displayName); - $type = $this->escapeHTML($type); - - $icon = ''; - - if ($this->enableAssets) { - $node = $this->server->tree->getNodeForPath(($path?$path.'/':'') . $name); - foreach(array_reverse($this->iconMap) as $class=>$iconName) { - - if ($node instanceof $class) { - $icon = ''; - break; - } - - - } - - } - - $html.= " - - - - - - "; - - } - - $html.= ""; - - $output = ''; - - if ($this->enablePost) { - $this->server->broadcastEvent('onHTMLActionsPanel',array($parent, &$output)); - } - - $html.=$output; - - $html.= "
NameTypeSizeLast modified

$icon..[parent]
$icon{$displayName}{$type}{$size}{$lastmodified}

-
Generated by SabreDAV " . $version . " (c)2007-2013 http://code.google.com/p/sabredav/
- - "; - - return $html; - - } - - /** - * This method is used to generate the 'actions panel' output for - * collections. - * - * This specifically generates the interfaces for creating new files, and - * creating new directories. - * - * @param DAV\INode $node - * @param mixed $output - * @return void - */ - public function htmlActionsPanel(DAV\INode $node, &$output) { - - if (!$node instanceof DAV\ICollection) - return; - - // We also know fairly certain that if an object is a non-extended - // SimpleCollection, we won't need to show the panel either. - if (get_class($node)==='SabreForRainLoop\\DAV\\SimpleCollection') - return; - - $output.= '
-

Create new folder

- - Name:
- -
-
-

Upload file

- - Name (optional):
- File:
- -
- '; - - } - - /** - * This method takes a path/name of an asset and turns it into url - * suiteable for http access. - * - * @param string $assetName - * @return string - */ - protected function getAssetUrl($assetName) { - - return $this->server->getBaseUri() . '?sabreAction=asset&assetName=' . urlencode($assetName); - - } - - /** - * This method returns a local pathname to an asset. - * - * @param string $assetName - * @return string - */ - protected function getLocalAssetPath($assetName) { - - $assetDir = __DIR__ . '/assets/'; - $path = $assetDir . $assetName; - - // Making sure people aren't trying to escape from the base path. - if (strpos(realpath($path), realpath($assetDir)) === 0) { - return $path; - } - throw new DAV\Exception\Forbidden('Path does not exist, or escaping from the base path was detected'); - } - - /** - * This method reads an asset from disk and generates a full http response. - * - * @param string $assetName - * @return void - */ - protected function serveAsset($assetName) { - - $assetPath = $this->getLocalAssetPath($assetName); - if (!file_exists($assetPath)) { - throw new DAV\Exception\NotFound('Could not find an asset with this name'); - } - // Rudimentary mime type detection - switch(strtolower(substr($assetPath,strpos($assetPath,'.')+1))) { - - case 'ico' : - $mime = 'image/vnd.microsoft.icon'; - break; - - case 'png' : - $mime = 'image/png'; - break; - - default: - $mime = 'application/octet-stream'; - break; - - } - - $this->server->httpResponse->setHeader('Content-Type', $mime); - $this->server->httpResponse->setHeader('Content-Length', filesize($assetPath)); - $this->server->httpResponse->setHeader('Cache-Control', 'public, max-age=1209600'); - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->sendBody(fopen($assetPath,'r')); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/favicon.ico b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/favicon.ico deleted file mode 100644 index 2b2c10a22cc7a57c4dc5d7156f184448f2bee92b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmc&&O-NKx6uz%14NNBzA}E}JHil3^6a|4&P_&6!RGSD}1rgCAC@`9dTC_@vqNoT8 z0%;dQR0K_{iUM;bf#3*%o1h^C2N7@IH_nmc?Va~t5U6~f`_BE&`Of`&_n~tUev3uN zziw!)bL*XR-2hy!51_yCgT8fb3s`VC=e=KcI5&)PGGQlpSAh?}1mK&Pg8c>z0Y`y$ zAT_6qJ%yV?|0!S$5WO@z3+`QD17OyXL4PyiM}RavtA7Tu7p)pn^p7Ks@m6m7)A}X$ z4Y+@;NrHYq_;V@RoZ|;69MPx!46Ftg*Tc~711C+J`JMuUfYwNBzXPB9sZm3WK9272 z&x|>@f_EO{b3cubqjOyc~J3I$d_lHIpN}q z!{kjX{c{12XF=~Z$w$kazXHB!b53>u!rx}_$e&dD`xNgv+MR&p2yN1xb0>&9t@28Z zV&5u#j_D=P9mI#){2s8@eGGj(?>gooo<%RT14>`VSZ&_l6GlGnan=^bemD56rRN{? zSAqZD$i;oS9SF6#f5I`#^C&hW@13s_lc3LUl(PWmHcop2{vr^kO`kP(*4!m=3Hn3e#Oc!a2;iDn+FbXzcOHEQ zbXZ)u93cj1WA=KS+M>jZ=oYyXq}1?ZdsjsX0A zkJXCvi~cfO@2ffd7r^;>=SsL-3U%l5HRoEZ#0r%`7%&% ziLTXJqU*JeXt3H5`AS#h(dpfl+`Ox|)*~QS%h&VO!d#)!>r3U5_YsDi2fY6Sd&vw% diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/addressbook.png b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/addressbook.png deleted file mode 100644 index c9acc84172dad59708b6b298b310b8d29eeeb671..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7232 zcmeHMXH=70vktu%m8u{iNEJu|p@k-dEbh;oQp! z004N*&5Ug6PsrAvofQCJ0J8kPi!O*#jGZWUL@!DZii8CiV2GYrpt(N^hqc9`Fu^B& z$Li3XlkoOV6epx598L6BMs3+BQ~d+z-T;7(J~aS^_Qg_wo>&~7pbMI-s0IP?7+sK~ z8WMsGKw!P`W~WG4yHi&7=u^IEEeuFsk5h*Vrvvz7DJUS--;Y3sQ*}YxxN!P<>ophz z+%}>3>Vm!{<%F~bB8Vg`5T>l6tfGX5sH+0iRFzfLRMb^qia-?zL=z0r0INcjpqg-q z8XN`%e*b~=IDtAOj2GP2$mDxCx}*#8rceUlU~o`SkaCc!GLeJ>L$$QDzz`L%ii#55 zLWvwqprEKq1hUi?#5W8hEE!G02T<@t0&oixr=z>6WJ@7j?2K@s&Aduv@jf_Eq zv3^*8EP+A>LzSW6o%VDlZ1Fg63i*c{f&86iI^SR_DuC_+0h6|E{^l9rO{5UX-o$`^ z_WYsV_TL%OJb;3R(c^9r`oovLEA)1 zN5s+d$KcTvEQUfv6TQ5!SY-@$JAofL!3_c_-b51Fnn=cPu}SA}i)5e<1`YqV)ot+` z>jr+5Z_+o>55Gk<+z&;->4K&f4Xf4 z*@?Opg@UK}VRyv%Go$a__mho-f4Ygk@O1vF+EFt7eA{D5{^b9!NI%8a+1W>M#5WER zMEbcxQ_Klo#O-7AcN@F`hGa~opfIFAkJbOyBk+{qpKERDlW4o4eu8d|CSvGq|Ls8h z12~2BGjMyXpCge(pGp7dYwVB0|0n%X(x2Mxf_>}29Rr14jc@PhgNi;Q!9RxNw=(VM z?f=Sho2~x}@($2{gX|#V*UNwD`ZY&8EdHfy2N}O!{!7=dIoe_IFI_vx`1SH%x_-^k z4vYUp7w2EsEG&V3w+f&Lv``pA3oHbg@?#%M;1t1p-E2-|c|#H-_R1@JzcNBq&XcTyD{j<6UEo zI0B^10yQ<)ne~ii-I(2&&uI#3*c>cE#4F`4kjf9Yf_ZrA9}M*e%!^mAR}E$zo9Zu3 zORdt;YtL*^N_oifn?F+u*|JG0gxkI3G?lUOvJIf`xLe&LM~@;G2ok9*GlYr@Go9q^ zEz`#}@G`i`7&#X(r(J-?mH-)D<>Cgao26JlhL$0DkE{zbmf-K(&|l=DD*83q#uQGU zBfS~GLtVKIm&%cnvH3DXpH6YX+nd@SWMv({*9pmf$($M!medu{2S+`*XCh6t-wjlCNsFC~wA ztcbPif81a*Yr3ti?%Lg-nYeKf;M-OF)`;J@?PY=n6fA4v!4Y!-RK&GE!e|%E#rOE^ zoFOK;>>L^svjrm2h{sHx(ZWK2#aNC-Iyotq$HA~D8yWs;GH{Czl&W$vSX9co>CY_Jx^p$*HJ(W=11 z2PK+Q^PIpqE{Q$`e^qZ}9+2ghQRIQ~E)V}@K_6kS`C%KoxHO#-#55!NTr9BH z$Gf;zV1y&|YokQx-X0?N;CZI65bn4U4me(v9v zt~$4NQ0?3rdSimd1&!>(WtET&)ww0Fc3t+>j11iq;<6g?d`;6m(?o-v--hwhsT@)D z0tIfwG=F`%g`|b}Fj5F8rtn%b=Q*N4c476cdco@zbJ{%maeVAa3Aft*j9lATg{8YasCtKb*)A6 z&p)mOy?*~>Rz>8ALTwmBci{43pegY-Rz z@eqaDI>U++PdYkRyrs|SG9%{4tSuE@XNM|3erf14y>^dbo%`=<#-XIL;5_gIA^7h8{BBuh8QFCLWCMz zjybw8t#D>`diqPK?x2S16YVFy=Uha*f^b!zgR4JJ1ZT}vGx=G3Onb-tVMfdR7D0dD z`glZQZoz|4cc%WQut~kEYa)eZXSH#>_lm0s76*KCRHhC+4HUTh7P+wZx$aU#-1PwD zSw(J?U7Ia5Q(8A&im4#q-#hZkl`FX)bHqF}g8`PDLh%P9%#Y3|7lfHZ&tmX5;&hWT z<5fx_3!1T4E*<_n0Pc)>)%JSuOcLRfI-%tzZ;gP!lL*7d())_#@^@3z?2K^hXQMez zmDt>^G}ZL42){nsmzQ~bTugJ`1R|Rsv0yNHf_;8B=k-ptG#j-&17x9xZl-tKyA+#6 ztpovzDJU_K53r$#T&zg?0a^a6-O5L(t?|buEi^7SuU@r^ia5%0=)partDxHpgbYVJ zf7*m%AIoR4_ci_L>MqZ+*&Gus1R1Cu%z!(p(e54?)BHFeZReqE|p;9|xOx#=mi9BR2G+bFNE z-l%Yn{d&pegCmMktsLdiG9F(%KkR?98FB?ye>(quR3lC}e?WDi>cbomAm@FBzd$g^ zV;Gwwu)@-|QaU>tzvM-TZ+$#1$T~4m^(w?f*!&T{%)ZSN@d_#2fI@5Rm8uEfOL0E93XfHpv@9<(lpR4mCW=Wvos2vP=RffHC{UD;WbfFVr5`q+#U0o}O{-IJS~eAv(asK`d^)1aHQ ziy$S$GkI8i4v*0tgFSBcLh-pWdJsuP?pNabJmX@Z_2OKk=(*Z@o+mKR5yN;JSh0YO z;_LHf?tcg;o|L=R`eA^auo>D~-ub>gnZ&aogPZNsR-M?G+g#spUS#6M*q%}`oxWOC zeSONjTSg*?%f^N&jiG)pQcJJ-=+ayFwkTSC&8&4Qaq3x))DfvNqQv#nS&JAl^B7b(Tia2WaO$md0D6JDpTV=dCihh zQ4IexnVGqpv4g8h+U=%}z6rv`flBeFYR&i{J@Lk9WM+$=Dcj=aFB+24EdQMu1Z35i3S>ORB({g=d7Sfc(FkLfW`1UO z{)U`pu+|%A1{9(x2s#>kQGEY6mjQOyW35MuUrjoDTz&Cr=j$yJ%f!y>222$-wGR#^ zPN>LNhJplQ3fd3rD)m~H=?JTcNmm6(GWiC#@iqmIk{%gyHD^6lw7tt zhMhcptW>Ps#OeK11)H|fL)fJ|=F`I?@r=te)Adow=3hu^^>w4s zs9r~e!tV^N-`jWDP0kaCJGkt1WnrBrilEV4XHRx~iV?{UMKtsA@Ek2{pXlE0kR$8K zvUgsr*wQ{^erT2u61=e2S;I*CS-d4bT4LYe&2Z2R+NOWD&k|R#};cqIY8^5>EQfcq87f$;c)(zU)I@Er+1@JoG9p za9q{*!gAy(yOu~ku$Py95#Ec`?GJ;Omy3r6Q~g@+Je)1x%Tl~Q%D9&QWWh;Vh-wC- zOV=yUyC*dJXWMyT-U3!~it`e2?`E=SeW8nCPUFMoJ(mdqi$ZMzi+PbsS?Ln`$rt&C z22GC)MK|$t@NY4UO}@4o{^JomDd#w}qr&tsN2Ce$^FHtM``!2b+`s4fUDtck$-!DgP+AZK z0*Tlh*ze5wM{NA~`9L5p$hHm%5Qz5?(ba?IVQ+`VQ$k@l0>vMI(L=*HQ6P{Jh8~8) zhX6E)KM+VH8$;Q3O;8AtU<`HFwMW>8SpY%A12I&KFqB+kSui;S0W(Y0B7;3gb2=TCYf>=vNBJfmV7>&pw-N3~8 zQzB``P$*{}@?$x;FlS<55G~>-1v%mm<2V+=>9{bsHVgr$ZpOg>migav{v1re|BMZb zq>?rlK)}NR5)cZIX%QR_?JaN);g%k>JK*m^!_hVaekS{qD1jV#1R|aW5NH%UB_IF* zU<6>3i<67C=ahtiqv7^*GL4}eiw(38+FD4Yt2P3S&_ipZG!WWo1Y*-8h!Fvg#!~?t zjY8e<><`ymfbgx+mWd>yi6e;^1yCWb(KsrB5*-mjG=gu~$(h;8+8q5zGlKsOb%TZQ zpGy3R$&5t%E7L|%&?Fo=&=^YBA^-unND>Wd!Y*in*y9KQgi}Tw=LxT%tVlOA+`IvF zJSj4QBM%Zlp+a0jaS=g8av&!t5Enxv1OFuS2kWNLzYE(C8xiRr4B-Eewz(P2ae;po zYC^=^_85;xCr|hjlCTPp6P0W$PX1baQ$O{AY9F41TsJfXwMh zR8I4mLhO%;Pg5k5nOR-Tdcx6XN4R2$6lk6VHpVUe3;E-_E^l z;WvaTDoU-bF1J9GmD?cd>W@L*>GEeVKAk$;TWsH{xI5X?bzYQL47CPO7l5 z5ZvG24+e41nenL!Cz(oqPcyHbc%VVUvkR@m&uhl=QQqwp{9VZNc>ELdR;+XGIVS8i z7X#ASnX~?4lH%(Av>N}mv_pJ5_ObB!%i%mNHT41lHFHmWO%BsNnV~Y)XJ=OOf-3fk zwwSuw#$6q~oE2CBR_p;MG4d3O3TZC3b=)f z?%4ef>b~PcF(TJb?iLkfuMHWDe+eKSFisLGms@6*-%SzSU4m|ZI*9vfV$35Z?P9s_ z5}2=Ib}^yc^_~Bd8Rpj|zjJ$K=iY!+uo)i|VX^x~iHZpVyDZP7x*X2twh$DKJKp)( z2kw6GgE8L7esT)Qb>Tr( z9~+tndeS6(A`%>gHQC0hnDpG4a`j{Aduz4YDCCG^iN3zz)g)Fyfx|L90rp1bdXl%Y zyUK~Ei6NRKl;(cL^HNGscg=^^sLE%FyI~!%3h=7B zzszfnFp9c81oKP0C;anLqlfT^WPY1Z@7{s4JZJc5don3}Xh*wKc9qr01boh0X+-zr z-qf9*1w-|Y*FK@7JEW($S3f3=?#nlTGX>o zt(ig!wA>)%ps~lJw{NHHdL&-|VuBEU;_^bKN){=e-{_*9Qhv9FU;F#;R|PkE4)WVM z=HwJY51A>IesjE?+ILM(w!LRQOy5=DdDTD#_rgkCirx#5w|MSzRP~eG*YVei^U7Xc z@2{#@#=_rszahJG@g*g&G=ccRN0CQLUk1ly`R!v#T*v|A`7e}>QcL5Ds}Y5&?%#%{ zzTCZX>D}3tp_2ZU=(^l05g}L9Q|&iO`OUnzx40nvcAq(>PhSw~;ph5%l=1mEf#$g7 z@?r@~+^U}K&dhgLQ=A8Rcl#fy6*uz<=qY-=drm~sPhpAAyl(2XCGD-PLIw-wlM1PL zW}AeEFkz_4g;nyns7_l7;f!T0?t)?Ttnql>%J@p-XEwfP{r$*-6e+(pXH{FgGKt!o zDC*O6Zc(6eCLuU4zDA7u{L-6OLap6}QbDP{FmVwZWURR%d zA)jN{@_V&v=4G!I=!boXA}=H9HQX za=Ol`$kPr_kk=(;)$e(AbsZcL%<9CZ9xHXVJ(>DdYTOfc9wxuSKQ2y+Kz5ef;}}j= zm-RY!>Anw#Akxz&Xy5Mh+ZLT25<=s7lW`A0Df-2gvUYqeJ)%I0`IQ!l>D`Y^RCb^8 zynUl9z@@s{OY88>K3(Hz880-S-r9N#Nt77PFL(qtN)?V&kT3EcErwIw^NP{ zeNb4ET>U~W2{+9xQO-KaOq-TCxJcOEhB$M}C+RoSz8aPCSmmr9^>zRkDVLAUY<7|o@!c4td_gCN@+g! zCSG5xp{c)j!CKiPdoR)~7CrtTtp=nuH4MO}^Hv#&f_JF8fr(3ko`nr6DHXwim#9i- zcH?gJNB-vYRtT%6nZ*Phy@^U*31-w)(-{I|MfFTP&tt$|LzN7FwOz^9R|@3QHI-5G zTG!6AgaQo(YUuzM#{h)@4JzPIgn!;bQ1U2WFyl8(ZqYWEu|Lq3YR_~Zwlau0bM zVQ((GR&hm0E&l8dR*NMD^K#jJ+qp&Elk1>PBPOb#0?ebqQ4ulFIg;sj=3v3uvCm*T9iJ>!a>etUgsb!o&U zspnei)pt2djm+ zC|Tti+{zZKG{1J%A>Zgn6zH_Lif%tEkaeT7L! zR3$sXM`KHcZb3!$O!dLd!eK^6Mt8FI><G75RR_~_31AY4R>1)BBS#x|MpEfUkf*zmlzFecJsHpfVWoCLB zyw@?Gt6=OnP7ynk$d&&31>XnubtAEnk{~MexewOfWvE@IZh|FmWMZPnEB3jjvC-Gh zAPT@@o4o`FK^7-@8Z)wkX=wutKbHozw4qn=U0q$@7~t_;^UD|H^OlWg2f*WT&tJV_ zk|-2!nbR2=-rMDFl4F#U7}e1lJmkcFBVND25%a<>(FzG+E!|S9v=aFFR#24it$UAjtSmRU4DWYZp&MOpC4>2 VG`ly3;d~;1Y%Cr2-!R7}{u}gUbfEwM diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/card.png b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/card.png deleted file mode 100644 index 2ce954866d853edb737a7e281de221f7846846f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5695 zcmeHLdpMN&7ay0fZjDGHnIU_zPvqiXLJR^Cf~{zk;|Xg)J1@|U9t5%pOaNj{q6Y#nCn|vq-~j?D zD!diI@|=%S+`T|A7iSESPSqnU+URkp44yXxg0qmazu zo<=T67lthmOmU260&daU-HFkmL{k#n(n1o;!SDd607!sws9`h~hGP!r<6?O0#n%Wp zjBf&ln!}fp@^W#7+0vN+%uvrj&p?-mG)BRUP_3L%N#^ii5M*Ew2sWFo$42SVnPh~%si`RfX@D>=(B)a^ zvZ81pful=fZCr#{!oUG6B9p=ZDRdfa5t9%|j{wc#aGoCa5u8L^#%4q?!}!P~A_52l zr~nOQA@ue15rXzSCh!z;FvwbVqp?1+%;OuuAuxC@NCcB_^O+|jm=4le!F0yodoHW_ z{(>Q$7$DJ*7k81+WnbQ|i2P((APFI8!FT7^X({@0!Wd5=&q%(Ol z>2H1Qs07MC={=aAwETiCb)djN;ZvN}EdGfu$-k~y0F8IIV)HIh z5{E|(ArJ{WC!DoA=P{UeStb?<6;XwS#%;;LNbQ}{CM7#|?9Xh32Dh%x3TtD+4p}NX z=P33;*+id>O0iGPc83m}%^N~*wua<4LyK_8p+k!J`?_)c}(WuGwGA@!ezR_oo+Od{B|q6241IjlJgdO zt0-DJLWQ6S$lE}Psp!!rN*<=Kx7=v*sanVQU?~tKKQ9K)+6f(AnY>P8K1pf#TqeBS z$Vqb#QNlAhwEXRph1E7nj+({eIjq7oeeFw^ARD9$ScuTq;*aYf_cHWln_$v*hrBQ& zVybQRkK{?ER}xT2L#||ZYfIr%*xgm%ohRO9jr5sc06l^D+Jk(!J-KhFTSUGjL^WK!sA+18ml0HpUiCAi%da1ixGAcTjB}ST<6|c^O zb;Vjdzop!GveBdU$c$xEG{o0xpU>7~^yrB?6!Iu*93$O?E8aIC^GhRcLjuKH(doGC z>g>#i`DLb~d%7dmo&#@oN8I$V@l#0CH&zpB(caUa5C@Z_AA>t;`qo}S#BKDns84A& zktlJp&Cn}0>mFqbanu~f=u7SW=ts7#i9_@eilO9@bm=aYe?khhFtg%k-MKB2QxH5&9dJ%BoUAv9<>+K z&!i+MxZT|9@WNE%=1ECpD+IjSo$Fm`lAXsSzc$_`Q8D7beUrKS=9H#9tA5cz@-zSJ ztyNdD&YeeuJ|~@lF^h(OGlz>j(wK~pb2<{61@xBK&W$9|T{>SKSO2bb(`g&OtP%DA zSDX9ZwR_qkoml4}`3K`XTB<&#>#7D6*Wi)|UD<%YW&@pE`LJijg{Ef5S5@gJ>|$)n zj%rk$h8I0@tT!%BTo{C!<@=lp`1OV<&F`siSjOE0BNma|_VK=(xxE|Ls0yV+7B-=O z=m_3H7&6yJKijn16Ir=>-HiidZ=^#X(rR`nK>FoG zN~@eDM8L5!cP+`l7kRHz1{K!D7eQik+D6=!^V?NCwRY zd4*hGrygYw%hs9nJLmK_ z&D@&!ISrcJ+5EvCQkavY^)y$uLcCzGQXyPa;);)+Z%Jp=Bz8hax`~|In?Enk3BF@? z&%35i)iK4Q_;pj@Wr^2gt08j@=Z9+iE4#Uqz4DfzNv<;}_ReO{+l-83CtIBIPdTy=p?FxkVsl{i?s8V`{<&J} zd&Sef7bsM?L{moBE_j?(U<-m*@mDS{9d0Ww#M?RUh}QgLv-llgMDdZ)(OIJZMiEXAELrv z`K@ze{)cl57I`gKme=kVBbx&L#O06>H(N9R#EEb$-IT@vZ7O7i3cHSe)Sxw-sPw@l~2F-b$rpmHb^+G_g^smmN*w zLHndv&MEb0CKi{MkFs>@YPc5ma<1QH>m3Dc%7ndO2G8%|j+5UUAI9V)btp4?bEBy2 z8n(6fn3%Cp_vy5vLD9^&Ej}v)gcG2br#O4hDyNySR+ySvq&LeydAJ*jABP)&$qY^P zW^2yc2^uAkCea|`C9#I5`xL!XU5M9nr!PFUcqO@;g4J)(rE4uS4W-RH!KrD>nonw?_3 z-{*F+?e3#yLgQT_RW;EA`%Bcm@0wRkKe2TLxc=m+MvcR^Hai_#>zD$46R(reH$M=t z>)F<6JuzkG3uWEEzaGrDt?frTyKHh4IrgT}e6RdZPsT&%9hpZIj@^s&IrVr-6P=$U&LPIV iv*os~CbdYl&#K_=OkBmrhgdFt(si=ij;pWxEzMhwDg6VRB9Bbk!O z6tW@c#N~iA9v>u-KoWsq0uoKBtI5n{}YsCay6 zXecgpHIB45La^gu2Pk;h~+gfLUcWpMrcU>L`Qr@4?^ zsuNNYCM1NckxX+eVll;tKr|we+=&D#flMVD8xV+80%6)C(2U8TGWakg9duh6)1MX80*Pk(rsS>Cv||GyLCBr&ySORpJLGTA=V} zrm3P(10fE}94j(n!hTS2pb%>@c&Zw7f|xLflo3Ln7|V56h-ho4e_#8jQ-s& zzd$I28_fSNvx09LcmJct?A`0Q3wm*e z`r?VnFDmKiCBuXFJooSP4*}5gRtywBz3qeGUmH}Mtd5LTuaQb6O%3@sYx9blBsI;A zlExZ^^pW9bCUwadsyU_q`ZA={G*Tl`6spRN&H3$BZ*Qcc;iN?*V?=h*$S;1fRzOvg zjx40UKgPN3tm+bUKvGRcm|>Yy13P6EO366rn9RIDhtr4DCd@2ZL505eHF3AQ{I=N7 z_jjkWkMSlR7@ryWaG*i!S3!YTDG*XJ@b9UP)|cl+qwZ`%t<(=+x(`xU&|`0nk3JZ^ znm1clS#tZfLY}W5a~(Z*$qio`fl$hywQpZacC%KC^Qx;3SD2J7Z`+$cow$>C+IqvA z?RR-)3IsXds1@arpAx(cVtXzr)_BcVd~V-bUKY>5^sNxQ(tKZ<tM9$5tdWz%ej0ez^ya?f6Uo&{%mXC{m5-D|#M})nH&YH-de-MQ_7o1- z#CD#)h-GilV$|^-wK4g~F|==SXVAR;kpJOJ1QJh|oFtLRE%fX| z6QYi#L~SE1SFVxVR-KodqG8#ke`e#DwxLZ(TjPcNUV+ccwwC;%P~eLCW!nG}$^T5* z2KCN+25ld-C9`res#RIF2P5tNTFFQKZl)nOJ3ud(wWUs zigV_31!`Y>wXYA;a?fF$(=%0GqwWNR=hK#(^eg1=iA+9BvdZsrMKSZFgBQm?$NQu` z8ZI~ectr(JHJI%V2a*>8RF)v5JGOae_N$Wm${=X$hi-;9sN)kvM_4=Pfs=| zS6fzbZGnxWj`*s@zJp#mRncNO44E8)p~G)x#}$pp#DF0V_ifP^|3taUb;iljLK-u= zA6bT$8xsfkC2wEwO#~I!zKmC8__u1;#63TLz6lka$q6`+BpOakz5ZZrZ}=A#73X%3 z({QtIxVNXrh(9j^5Q#4!7NNWO(CB>_QSo7(eHhPOeUC z?V^-SvGAl$U%2WnSuJ;3uuJhX*QK-%=kK-0b(|&s4!GIP?Z1h-aVs>vOUAkGm^gR36sr&_zj%NG!0qfsPSSWYtzWaqIns?Yya)Zez_}3HkrU=7y$!KPW zZqo*AUyHJ*^w{93gBM1h74AJPqoQZOtK4%?yY{_CD1T+9OuhO?(MDGYTIw*KlH3>b zk{(_!kE{DF^KfdIM`vPMhm!umMB}U?x0K|j^mm>bN1vDvM4ldQnvU{wMbGop6+;X3O=sODx{wXdGn!#Iowd2S3j=3v%!vAF1s^TonKOpMr4QroDy zquS4he|@yd1iv=v5>ENHRZ|4FXT>M&JyMF^WMy~ zw<@-N9+-ID5_^>URu8zEs0$dnY|E(MuOEe5*(a%}q7^4R-GMnWm~Y3pugtL=B#07U zXtoU}A4b&&Fjh&IkTl%00j+p_z%KoqL-6H zsy0St$fopeoNbs^0c&p6~Uw>GXW; zOnr}u;fk}!A*9*X0m+VuA=cNgd}=IGkJO6S`nCFi_>?27XD9XAi>;K9$g&uxo*Iv% zN0vCW6uK=7Ymg@KEN`Tq0*&i*<@zl0-FwdV`f-&ABBYP9l zmiYvvoml12_ApZyNX5#l7|GAe=qHVnpNUhum)mVcXL~&dyBYC$&+{kjvMrxjRlfHa z=*~;8`n4bAQ>(4E_l(})VnJ}E-H#ZyGF=R`%OK2VpUn?#rMG@{Z-l*1a~S z1#>P&^t~(6`?%86zGjT^@;pwC}Q1RrXH8pScuyuG^&BCf5knD@5o zK&{USOy%2DN>RroTCx-MxT4oq7D$qmE~dBEt;$#{8h6o>mjZQNW$3K>`0h!3+Z^?0 zq#?|y0K3Zesv@7I_q+ol(sUCW*PZ(!&TCuIQtx%>IL6+g8JE!i^75e35Vq1nvVQz++X-2Na-jNuQTP-uom}bmOGfQTu9TlY;TkVum z;*bjI!YPtVa*0h_yQ|zQicoe*?XuSpyE>ioJZC-6thN62f8YDQ|NH&__e{Kp`${d% zxtag~Xt}yLd7@9U@`qCc01P;#b~*rHYxrzm#Mf;VgChv%45-EkfBHh`XNCAh=B`mkqWXc&RKp2cb zpgc?{k}>2g!Wb?CeOG=a5x}t!M8G20D+xhgHxJNJEQLWDkz&aqTP*=;Hbm-Dstw)7 z0(29LKzoT4BvU~unY;v~EM-{PFsyCB&lkZ~6J$!cAq-Ea6`vW=5sMItAQA?N6cG_Y zjIbh#r92XaPN$Q|R1%eHiAGq;6e0wYTZ&{RN{Dd`Cs@Xj@+Al#B~@ZV!Qya)MIfN_ z;KXtui6@^IipVA@M6%Dup%#+lkc31bl1b9B7}7VH|2yZ)U@m7eRuV21jxB)8A;Cg8 z3>G0Wl!G!3juMXRVfetoUI>JY1xzLf3&lKC9+%HSU@ju&h(khPn8=04xX@gN8(I=B zgg{PcCX0YtOt&OcEU8pBh0Gw^Feo&0GKE1Vk9h<#xf}*Z3PXrks`Tu$YhLiC@zJ=6 zLcZ;4A%8P01=$ghlq-&q3HVHs(oS?{JZo$;k;Wu_gQ{fV{!@uBnCykf*G$TyFockZ z$0Eorxo`*+E<^~n0~w{D8^nb{w2Tn?#xY)CBDY^Qc7x>{VYm#H2Zo5HpjQ|q3+0P= zXb=yIb@J5*PS=!iUbbxqY3$^8Q#3I?(=#zGZ2%*j5aOr=U zl}%_2`>w`Gl!+>Xh!`BN^VfjmqX}hWi}_Nxav|fp_Ww7$;*9ce(!pQ__#dSQzo+6W zOaEaV5B=g4qEg1cp{E<|Eu_ijf(|Cz6D&e|k`!$|{n#~4XyclLIQt@A;t&MgelRfJ zV_Z@5U{4t0DmK-^OaPeDuKi z(&CWpjmOsQtr2w2>c76os!MO>Zd~@+fphg(f}aGx)P_KmV|7e|d`h-{(CbSd9%vhF zD-g`C@IGm~^*x?y6f)b$$f(kL+o!)U$40xV@ob+MB!+$Q;zep%A2)_S`lfgGV>2B9 z2hQ>-i5k`pru^}+Y(wx;#cNYXHhY%IDy=k10QI-Puy3raN~UJp(EI4je@<`VZ1?HVUK1>j=z9~ zl{0=f)Ri^teW7EQA8LJxp6vPl;CvP5(@r}mAB(9vX%?D)md|UCdeRjAi)V_}+@8Lp z<--RKwdQm!dA#D~+`h&nBG9rObL#GJ`OLCY*<82y(=%=Ca^Kva>j<>o>W_nTc9+v$ zsNwXY*CZaHb&-yW@e%gyZIQ z)%t;po`#$EpHyEF*Xd?z;`)+cyR-cdmmg~j?&S?J&*!SFN`tMJ>kYRSAD3;5aQ#Ii zR{NI2+Xp~teVKTnKK^9hrkBZ>1kONW?f{S@C>#n|_`;ai=yQcbzlq zS~HTLQzFs0=pWLDpVNzG7v0@QCT}%0UKDCq8QM1b+p+FOU4xc{)j9aq!g%3Ri@MHd z3bpF1Bb03<&FQmrcKOn=%ih)$<$>b7F#jcPcR2cSf=#=#u@$u{ih+?cf|O@bZNnd7 zgKA!(%1y%tjCajQ(0yx{R}nH%;C6GMm|1x2rGl zWlUuHy>q<6=1a1)o@~uoR0lQK{6UTpm3ma}uX76XE8A|^kq#>M#}dueH?m4DTuN4r zx5~gRX5)G^25RslhBCNg*)i`y`%H2nt(LsUp>ijM#;*G4VZT~;Af@(#cA-jy_jK*I zUOQv_b7x@Q&<^*cspF=MEX1k`>{O8WH66uqwwAFHxtI6d1*D>Wy$EXVlTxk4Wqu8f z7pSbP89Cbr-Hi*kUw)Ki{CfEcgCxP`7w;Z!dA%oSTc)KECZ(XTSuFb{z@tEIWSp8j6-6W8K(M@5_M zzM(ap>AgjFUdfp&hob@i^-&!S%)^__m?ce)TcZPr$q<4Xd?BHHSI3IyO0DU()TXl(gK1eqCMlT5UAa%-vKs*e z{1f4!PyJ0*MUPbL)dU&7_9Lq@1gY)9cQZ`ZT7hdl{S1!vUE5%}_BJ6sJyyrpsY-CI z*LF*lK$;-lW$ky-w+=Ms&LPicKhRG>`;bXD&CR(v|9MK|Ky|y%;EDyN%xC)aYr1&`JU!`) zU`3-!RzOL*K6r~#TZ=CUG47?UtS$+c&%6n=q;a(zkC;{Ty<{g*)hWBOG^q9KmSxpt ze|j9eKR3^y1z4}zR2x?ALSLU0aFj~G5oFA%A#gxM$>ZYQhTOKRZqbjE>~73kxI^Tg zm}+D?;NE)t8bh(^J};-Md&W6t`*ob+{rStcW``Q%lQLXv%9Q_RU7g*X@*Fm7{~MA6 BY2g3> diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/parent.png b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Browser/assets/icons/parent.png deleted file mode 100644 index 156fa64fd50f15d9e838326d42d68feba2c23c3b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3474 zcmb7H2{=@1A3sx*ElZmr6{pFPFk2dCvP~gNlqE}xoS8YsL^ES%F!9N9n-C#MNxEne zBBg~(j5Sk9R1{fSrMg$$D9Z93RJZPTzwddzInT^F?|J|K-|zSS{_p#Lo{8V=yg^Ap zLjeE)C3`z-SL9BZ`pU@w01BKVoeu!$Cbqkm(93BfmBHPOgP2@8j1%qVAyEKeW+~!9 zi~v{&(qR^xV~!oHsK$b9ra9JgjT6C%w;uLq+lBFAw=idSMpyuY!o*ryD42<;2*7Sw z2!W#AfgAxxEzMhwDg6VRB9Bbk!O z6tW@c#N~iA9v>u-KoWsq0uoKBtI5n{}YsCay6 zXecgpHIB45La^gu2Pk;h~+gfLUcWpMrcU>L`Qr@4?^ zsuNNYCM1NckxX+eVll;tKr|we+=&D#flMVD8xV+80%6)C(2U8TGWakg9duh6)1MX80*Pk(rsS>Cv||GyLCBr&ySORpJLGTA=V} zrm3P(10fE}94j(n!hTS2pb%>@c&Zw7f|xLflo3Ln7|V56h-ho4e_#8jQ-s& zzd$I28_fSNvx09LcmJct?A`0Q3wm*e z`r?VnFDmKiCBuXFJooSP4*}5gRtywBz3qeGUmH}Mtd5LTuaQb6O%3@sYx9blBsI;A zlExZ^^pW9bCUwadsyU_q`ZA={G*Tl`6spRN&H3$BZ*Qcc;iN?*V?=h*$S;1fRzOvg zjx40UKgPN3tm+bUKvGRcm|>Yy13P6EO366rn9RIDhtr4DCd@2ZL505eHF3AQ{I=N7 z_jjkWkMSlR7@ryWaG*i!S3!YTDG*XJ@b9UP)|cl+qwZ`%t<(=+x(`xU&|`0nk3JZ^ znm1clS#tZfLY}W5a~(Z*$qio`fl$hywQpZacC%KC^Qx;3SD2J7Z`+$cow$>C+IqvA z?RR-)3IsXds1@arpAx(cVtXzr)_BcVd~V-bUKY>5^sNxQ(tKZ<tM9$5tdWz%ej0ez^ya?f6Uo&{%mXC{m5-D|#M})nH&YH-de-MQ_7o1- z#CD#)h-GilV$|^-wK4g~F|==SXVAR;kpJOJ1QJh|oFtLRE%fX| z6QYi#L~SE1SFVxVR-KodqG8#ke`e#DwxLZ(TjPcNUV+ccwwC;%P~eLCW!nG}$^T5* z2KCN+25ld-C9`res#RIF2P5tNTFFQKZl)nOJ3ud(wWUs zigV_31!`Y>wXYA;a?fF$(=%0GqwWNR=hK#(^eg1=iA+9BvdZsrMKSZFgBQm?$NQu` z8ZI~ectr(JHJI%V2a*>8RF)v5JGOae_N$Wm${=X$hi-;9sN)kvM_4=Pfs=| zS6fzbZGnxWj`*s@zJp#mRncNO44E8)p~G)x#}$pp#DF0V_ifP^|3taUb;iljLK-u= zA6bT$8xsfkC2wEwO#~I!zKmC8__u1;#63TLz6lka$q6`+BpOakz5ZZrZ}=A#73X%3 z({QtIxVNXrh(9j^5Q#4!7NNWO(CB>_QSo7(eHhPOeUC z?V^-SvGAl$U%2WnSuJ;3uuJhX*QK-%=kK-0b(|&s4!GIP?Z1h-aVs>vOUAkGm^gR36sr&_zj%NG!0qfsPSSWYtzWaqIns?Yya)Zez_}3HkrU=7y$!KPW zZqo*AUyHJ*^w{93gBM1h74AJPqoQZOtK4%?yY{_CD1T+9OuhO?(MDGYTIw*KlH3>b zk{(_!kE{DF^KfdIM`vPMhm!umMB}U?x0K|j^mm>bN1vDvM4ldQnvU{wMbGop6+;X3O=sODx{wXdGn!#Iowd2S3j=3v%!vAF1s^TonKOpMr4QroDy zquS4he|@yd1iv=v5>ENHRZ|4FXT>M&JyMF^WMy~ zw<@-N9+-ID5_^>URu8zEs0$dnY|E(MuOEe5*(a%}q7^4R-GMnWm~Y3pugtL=B#07U zXtoU}A4b&&Fjh&IkTl%00j+p_z%KoqL-6H zsy0St$fopeoNbs^0c&p6~Uw>GXW; zOnr}u;fk}!A*9*X0m+VuA=cNgd}=IGkJO6S`nCFi_>?27XD9XAi>;K9$g&uxo*Iv% zN0vCW6uK=7Ymg@KEN`Tq0*&i*<@zl0-FwdV`f-&ABBYP9l zmiYvvoml12_ApZyNX5#l7|GAe=qHVnpNUhum)mVcXL~&dyBYC$&+{kjvMrxjRlfHa z=*~;8`n4bAQ>(4E_l(})VnJ}E-H#ZyGF=R`%OK2VpUn?#rMG@{Z-l*1a~S z1#>P&^t~(6`?%86zGjT^@;pwC}Q1RrXH8pScuyuG^&BCf5knD@5o zK&{USOy%2DN>RroTCx-MxT4oq7D$qmE~dBEt;$#{8h6o>mjZQNW$3K>`0h!3+Z^?0 zq#?|y0K3Zesv@7I_q+ol(sUCW*PZ(!&TCuIQtx%>IL6+g8JE!i^75``Y6gr#$Vf>RpCKLvN z^z@Wgh%9j~V?{(G(ZN9^8k~#+r8YQ0GFRda0Ax=A7o;UY2qpnyvN-P8;j`zl7#7_f zyL?eFA(-m}C9?c7cu;u8(g<2c63vy4_4Lpn3rG@xWC#H|IEN zMI=Xi%=;hKLjyzR(HW#L>f-m|B$7Ke5ka^lJU%Tg4VUJCgLzE6y{oG$oUVFczU!rZ_2oL0;H z&5t^eUu9VPeU&*d$vSj%P9WQSobC=a=D*AN7q~%aTI07QFjZNbuuwkYoe>#hX zKy(DA!3+ij;pmVof$5w`lvE@U=J7*dK1<4`ghMIG7&4tkn%b&NoMN5AMy8}Gkc;vsT7Ri^K?+A#O%>REy`Xn}4zK=*gQyluhl5<5v{5cF*c5FVjVNvKj zUjYKrc^{6|f9ri%NcyL>VUkHCYp744htOcUr0u5;#NU7;yib8gKzV~|BzLPc$t6mCu;ISHTOg@8{`1v`W!_A;zE{UtDEr zWmQzGgfqu3{F+s9ezhnZa2)Z9uFly_+2XbaSRA()h1LeQ%&&Ta2PA<^aue(oO@qP85~&ePYGTyx|%5fgoi~uQi^> z^R~lr#QqcJ9`=+ib7xnz%$~dZ(#8E~<6(XZPiMH$_!Ml?JJ6rtbw!X2C~!EOMyL41 z-v0ivmTOnq+Am#F4`QP_Mhe0h8NZ5|?KO3W-!!Cjs8aOMy5sXFJX8AT#T`)B&>#fW zxbD<`wpV0`12&Y+{k{Meex?3e$;QU!mcJ4v$8TxiUPS|M4XSc}dtiW{(Zr;vuD!$36|9bDk{df1+vF6yo{oS3n4FqdohLjw_`5~{?3hM@%4|Xg-TL<{!O54QXQz7JRVWFg}t9!8~JKOWQ zXT$280Ugww0mhTe$9;WZJdLKd-;~kNxBIDXL_kvgLD9N(f|+G{RN;<4&mB8hEZn+a z+3YxvY)Whl6NGL$-)81KwT}IPb3++5b4S$3MoP7|K-3wHW^b(cq+{x2V4&ZIg?(=#W?0>RtB8i22g=Mf#Bi7Z;Qg%I8uy z*SJIR4Cq4fut#HiS#`znyk{DP`QOH`zcljnPSW~OyLiaeYxg{rZNc>=*5$S#6 z$DhrKGs_ges@%z*nI(Rk)O@Yryvm;X-SyNTRcbufHvzWR=#hhc1O460))F6`PN|DY z3N-G<8bnv+8mVk<3D`e5IeDrxy2})>S8_tJLtXkDs_SdLBZDEVnwznb8v)mu!!o08 z7^@cU@7;4z%`E)kNXGcUL9#`|B&23EE;ehpb-DTai0G=h~gE@oaLKP&CrKmLvQXGSLUx*u87evamzB<=YVdFE$c6=%+IIj zb(*XE*lGwo=q*;Z1ER)M`pb3R5s5^UVf$+Om}t;B)R!2drR3M%)xq=tY%(cF401Bm znz2|^8m9-u7y=s&RCQ@I)%Zd4l*@;n%^BA+O8oYV; zmSUuz`b>|k@p)ISH#d9PaR=L0-KLNK{u<^UE@8}_72?Kkaasu|BFt3t;CyiGfmo|8 z(kAw1)_s##8y6c|6xVLbRqmhnZ1@VU&hK0arg4ab{>^E|*JUl1MFe%lJw=>GLdz5O zqOLY_RmOhP?FW+24ZmO?*^Hr+W!1tihruhm?RS;tp3u`h`8t|>`Ww6Qg=sQYTaFybZ9Z5Y@)k-y*mr@hLWqYfqA;VU2Q zHBNnUR%_UBz^IQtcD4Ra(_LZl;oJ^`p5m8BPp(6#hwq6xvtIJ3L8A|>e|^?8zem00 zJ}v)`(cV4{T4cWWn<_^C={vqR@1<>k^WGgle2cM~Z}`oF!WYridplU=KYwT0mV}rO zX5u#U!P=-pW9^}4eV(a$l|!cJ(pT5KcRxu8R2%DxtGdD2wM$d{a=lZP&BEZyfE7_c zor&e>lw>hoN`E&ponu-*TOm7XrJC1)R{9#Rb!W65F4!5Ar}WPIboMORSS924n9T=H zFK9bUq3sFy!&sxys8c8RRp1}>PijmWx~i8JZkQKto%Ps~doqk#*?Q^i*trmf%RqJU z;#=VlXJ@*Ot@Tm7cQh70`TUgTilj9ygRTDMD_Wna-`nRr)Vk*kX+&p+_hoCb$go`z z(mGzZL{lr@+q}G%)%W7iTIF2Zt6P@o>RvYSKjuC`!I)?+XJl_PxHBh4;f`g!!E>A4VP5$SQ5CLF_=0&A@lnwhleUz`(>k&GBZWCDT3kgv cn$validSetting = $settings[$validSetting]; - } - } - - if (isset($settings['authType'])) { - $this->authType = $settings['authType']; - } else { - $this->authType = self::AUTH_BASIC | self::AUTH_DIGEST; - } - - $this->propertyMap['{DAV:}resourcetype'] = 'SabreForRainLoop\\DAV\\Property\\ResourceType'; - - } - - /** - * Add trusted root certificates to the webdav client. - * - * The parameter certificates should be a absolute path to a file - * which contains all trusted certificates - * - * @param string $certificates - */ - public function addTrustedCertificates($certificates) { - $this->trustedCertificates = $certificates; - } - - /** - * Enables/disables SSL peer verification - * - * @param boolean $value - */ - public function setVerifyPeer($value) { - $this->verifyPeer = $value; - } - - /** - * Does a PROPFIND request - * - * The list of requested properties must be specified as an array, in clark - * notation. - * - * The returned array will contain a list of filenames as keys, and - * properties as values. - * - * The properties array will contain the list of properties. Only properties - * that are actually returned from the server (without error) will be - * returned, anything else is discarded. - * - * Depth should be either 0 or 1. A depth of 1 will cause a request to be - * made to the server to also return all child resources. - * - * @param string $url - * @param array $properties - * @param int $depth - * @return array - */ - public function propFind($url, array $properties, $depth = 0) { - - $body = '' . "\n"; - $body.= '' . "\n"; - $body.= ' ' . "\n"; - - foreach($properties as $property) { - - list( - $namespace, - $elementName - ) = XMLUtil::parseClarkNotation($property); - - if ($namespace === 'DAV:') { - $body.=' ' . "\n"; - } else { - $body.=" \n"; - } - - } - - $body.= ' ' . "\n"; - $body.= ''; - - $response = $this->request('PROPFIND', $url, $body, array( - 'Depth' => $depth, - 'Content-Type' => 'application/xml' - )); - - $result = $this->parseMultiStatus($response['body']); - - // If depth was 0, we only return the top item - if ($depth===0) { - reset($result); - $result = current($result); - return isset($result[200])?$result[200]:array(); - } - - $newResult = array(); - foreach($result as $href => $statusList) { - - $newResult[$href] = isset($statusList[200])?$statusList[200]:array(); - - } - - return $newResult; - - } - - /** - * Updates a list of properties on the server - * - * The list of properties must have clark-notation properties for the keys, - * and the actual (string) value for the value. If the value is null, an - * attempt is made to delete the property. - * - * @todo Must be building the request using the DOM, and does not yet - * support complex properties. - * @param string $url - * @param array $properties - * @return void - */ - public function propPatch($url, array $properties) { - - $body = '' . "\n"; - $body.= '' . "\n"; - - foreach($properties as $propName => $propValue) { - - list( - $namespace, - $elementName - ) = XMLUtil::parseClarkNotation($propName); - - if ($propValue === null) { - - $body.="\n"; - - if ($namespace === 'DAV:') { - $body.=' ' . "\n"; - } else { - $body.=" \n"; - } - - $body.="\n"; - - } else { - - $body.="\n"; - if ($namespace === 'DAV:') { - $body.=' '; - } else { - $body.=" "; - } - // Shitty.. i know - $body.=htmlspecialchars($propValue, ENT_NOQUOTES, 'UTF-8'); - if ($namespace === 'DAV:') { - $body.='' . "\n"; - } else { - $body.="\n"; - } - $body.="\n"; - - } - - } - - $body.= ''; - - $this->request('PROPPATCH', $url, $body, array( - 'Content-Type' => 'application/xml' - )); - - } - - /** - * Performs an HTTP options request - * - * This method returns all the features from the 'DAV:' header as an array. - * If there was no DAV header, or no contents this method will return an - * empty array. - * - * @return array - */ - public function options() { - - $result = $this->request('OPTIONS'); - if (!isset($result['headers']['dav'])) { - return array(); - } - - $features = explode(',', $result['headers']['dav']); - foreach($features as &$v) { - $v = trim($v); - } - return $features; - - } - - /** - * Performs an actual HTTP request, and returns the result. - * - * If the specified url is relative, it will be expanded based on the base - * url. - * - * The returned array contains 3 keys: - * * body - the response body - * * httpCode - a HTTP code (200, 404, etc) - * * headers - a list of response http headers. The header names have - * been lowercased. - * - * @param string $method - * @param string $url - * @param string $body - * @param array $headers - * @return array - */ - public function request($method, $url = '', $body = null, $headers = array()) { - - $url = $this->getAbsoluteUrl($url); - - $curlSettings = array( - CURLOPT_RETURNTRANSFER => true, - // Return headers as part of the response - CURLOPT_HEADER => true, - CURLOPT_POSTFIELDS => $body, - CURLOPT_USERAGENT => 'RainLoop DAV Client', // TODO rainloop - // Automatically follow redirects - CURLOPT_FOLLOWLOCATION => true, - CURLOPT_MAXREDIRS => 5, - ); - - if($this->verifyPeer !== null) { - $curlSettings[CURLOPT_SSL_VERIFYPEER] = $this->verifyPeer; - // TODO rainloop - if (!$this->verifyPeer) { - $curlSettings[CURLOPT_SSL_VERIFYHOST] = 0; - } // --- - } - - if($this->trustedCertificates) { - $curlSettings[CURLOPT_CAINFO] = $this->trustedCertificates; - } - - switch ($method) { - case 'HEAD' : - - // do not read body with HEAD requests (this is necessary because cURL does not ignore the body with HEAD - // requests when the Content-Length header is given - which in turn is perfectly valid according to HTTP - // specs...) cURL does unfortunately return an error in this case ("transfer closed transfer closed with - // ... bytes remaining to read") this can be circumvented by explicitly telling cURL to ignore the - // response body - $curlSettings[CURLOPT_NOBODY] = true; - $curlSettings[CURLOPT_CUSTOMREQUEST] = 'HEAD'; - break; - - default: - $curlSettings[CURLOPT_CUSTOMREQUEST] = $method; - break; - - } - - // Adding HTTP headers - $nHeaders = array(); - foreach($headers as $key=>$value) { - - $nHeaders[] = $key . ': ' . $value; - - } - $curlSettings[CURLOPT_HTTPHEADER] = $nHeaders; - - if ($this->proxy) { - $curlSettings[CURLOPT_PROXY] = $this->proxy; - } - - if ($this->userName && $this->authType) { - $curlType = 0; - if ($this->authType & self::AUTH_BASIC) { - $curlType |= CURLAUTH_BASIC; - } - if ($this->authType & self::AUTH_DIGEST) { - $curlType |= CURLAUTH_DIGEST; - } - $curlSettings[CURLOPT_HTTPAUTH] = $curlType; - $curlSettings[CURLOPT_USERPWD] = $this->userName . ':' . $this->password; - } - -// var_dump($url); -// var_dump($curlSettings); - - list( - $response, - $curlInfo, - $curlErrNo, - $curlError - ) = $this->curlRequest($url, $curlSettings); - -// var_dump($response); - - $headerBlob = substr($response, 0, $curlInfo['header_size']); - $response = substr($response, $curlInfo['header_size']); - - - // In the case of 100 Continue, or redirects we'll have multiple lists - // of headers for each separate HTTP response. We can easily split this - // because they are separated by \r\n\r\n - $headerBlob = explode("\r\n\r\n", trim($headerBlob, "\r\n")); - - // We only care about the last set of headers - $headerBlob = $headerBlob[count($headerBlob)-1]; - - // Splitting headers - $headerBlob = explode("\r\n", $headerBlob); - - $headers = array(); - foreach($headerBlob as $header) { - $parts = explode(':', $header, 2); - if (count($parts)==2) { - $headers[strtolower(trim($parts[0]))] = trim($parts[1]); - } - } - - $response = array( - 'body' => $response, - 'statusCode' => $curlInfo['http_code'], - 'headers' => $headers - ); - - if ($curlErrNo) { - throw new Exception('[CURL] Error while making request: ' . $curlError . ' (error code: ' . $curlErrNo . ')'); - } - - if ($response['statusCode']>=400) { - switch ($response['statusCode']) { - case 400 : - throw new Exception\BadRequest('Bad request'); - case 401 : - throw new Exception\NotAuthenticated('Not authenticated'); - case 402 : - throw new Exception\PaymentRequired('Payment required'); - case 403 : - throw new Exception\Forbidden('Forbidden'); - case 404: - throw new Exception\NotFound('Resource not found.'); - case 405 : - throw new Exception\MethodNotAllowed('Method not allowed'); - case 409 : - throw new Exception\Conflict('Conflict'); - case 412 : - throw new Exception\PreconditionFailed('Precondition failed'); - case 416 : - throw new Exception\RequestedRangeNotSatisfiable('Requested Range Not Satisfiable'); - case 500 : - throw new Exception('Internal server error'); - case 501 : - throw new Exception\NotImplemented('Not Implemented'); - case 507 : - throw new Exception\InsufficientStorage('Insufficient storage'); - default: - throw new Exception('HTTP error response. (errorcode ' . $response['statusCode'] . ')'); - } - } - - return $response; - - } - - /** - * Wrapper for all curl functions. - * - * The only reason this was split out in a separate method, is so it - * becomes easier to unittest. - * - * @param string $url - * @param array $settings - * @return array - */ - // @codeCoverageIgnoreStart - protected function curlRequest($url, $settings) { - - // TODO rainloop - $curl = curl_init($url); - $sSafeMode = strtolower(trim(@ini_get('safe_mode'))); - $bSafeMode = 'on' === $sSafeMode || '1' === $sSafeMode; - - if (!$bSafeMode && ini_get('open_basedir') === '') - { - curl_setopt_array($curl, $settings); - $data = curl_exec($curl); - } - else - { - $settings[CURLOPT_FOLLOWLOCATION] = false; - curl_setopt_array($curl, $settings); - - $max_redirects = isset($settings[CURLOPT_MAXREDIRS]) ? $settings[CURLOPT_MAXREDIRS] : 5; - $mr = $max_redirects; - if ($mr > 0) - { - $newurl = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL); - - $rcurl = curl_copy_handle($curl); - curl_setopt($rcurl, CURLOPT_HEADER, true); - curl_setopt($rcurl, CURLOPT_NOBODY, true); - curl_setopt($rcurl, CURLOPT_FORBID_REUSE, false); - curl_setopt($rcurl, CURLOPT_RETURNTRANSFER, true); - do - { - curl_setopt($rcurl, CURLOPT_URL, $newurl); - $header = curl_exec($rcurl); - if (curl_errno($rcurl)) - { - $code = 0; - } - else - { - $code = curl_getinfo($rcurl, CURLINFO_HTTP_CODE); - if ($code == 301 || $code == 302) - { - $matches = array(); - preg_match('/Location:(.*?)\n/', $header, $matches); - $newurl = trim(array_pop($matches)); - } - else - { - $code = 0; - } - } - } while ($code && --$mr); - - curl_close($rcurl); - if ($mr > 0) - { - curl_setopt($curl, CURLOPT_URL, $newurl); - } - } - - if ($mr == 0 && $max_redirects > 0) - { - $data = false; - } - else - { - $data = curl_exec($curl); - } - } - - return array( - $data, - curl_getinfo($curl), - curl_errno($curl), - curl_error($curl) - ); - - } - // @codeCoverageIgnoreEnd - - /** - * Returns the full url based on the given url (which may be relative). All - * urls are expanded based on the base url as given by the server. - * - * @param string $url - * @return string - */ - protected function getAbsoluteUrl($url) { - - // If the url starts with http:// or https://, the url is already absolute. - if (preg_match('/^http(s?):\/\//', $url)) { - return $url; - } - - // If the url starts with a slash, we must calculate the url based off - // the root of the base url. - if (strpos($url,'/') === 0) { - $parts = parse_url($this->baseUri); - return $parts['scheme'] . '://' . $parts['host'] . (isset($parts['port'])?':' . $parts['port']:'') . $url; - } - - // Otherwise... - return $this->baseUri . $url; - - } - - /** - * Parses a WebDAV multistatus response body - * - * This method returns an array with the following structure - * - * array( - * 'url/to/resource' => array( - * '200' => array( - * '{DAV:}property1' => 'value1', - * '{DAV:}property2' => 'value2', - * ), - * '404' => array( - * '{DAV:}property1' => null, - * '{DAV:}property2' => null, - * ), - * ) - * 'url/to/resource2' => array( - * .. etc .. - * ) - * ) - * - * - * @param string $body xml body - * @return array - */ - public function parseMultiStatus($body) { - - $body = XMLUtil::convertDAVNamespace($body); - - $responseXML = simplexml_load_string($body, null, LIBXML_NOBLANKS | LIBXML_NOCDATA); - if ($responseXML===false) { - throw new \InvalidArgumentException('The passed data is not valid XML'); - } - - $responseXML->registerXPathNamespace('d', 'urn:DAV'); - - $propResult = array(); - - foreach($responseXML->xpath('d:response') as $response) { - $response->registerXPathNamespace('d', 'urn:DAV'); - $href = $response->xpath('d:href'); - $href = (string)$href[0]; - - $properties = array(); - - foreach($response->xpath('d:propstat') as $propStat) { - - $propStat->registerXPathNamespace('d', 'urn:DAV'); - $status = $propStat->xpath('d:status'); - list($httpVersion, $statusCode, $message) = explode(' ', (string)$status[0],3); - - // Only using the propertymap for results with status 200. - $propertyMap = $statusCode==='200' ? $this->propertyMap : array(); - - $properties[$statusCode] = XMLUtil::parseProperties(dom_import_simplexml($propStat), $propertyMap); - - } - - $propResult[$href] = $properties; - - } - - return $propResult; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php deleted file mode 100644 index 1e070e76c6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Collection.php +++ /dev/null @@ -1,110 +0,0 @@ -getChildren() as $child) { - - if ($child->getName()==$name) return $child; - - } - throw new Exception\NotFound('File not found: ' . $name); - - } - - /** - * Checks is a child-node exists. - * - * It is generally a good idea to try and override this. Usually it can be optimized. - * - * @param string $name - * @return bool - */ - public function childExists($name) { - - try { - - $this->getChild($name); - return true; - - } catch(Exception\NotFound $e) { - - return false; - - } - - } - - /** - * Creates a new file in the directory - * - * Data will either be supplied as a stream resource, or in certain cases - * as a string. Keep in mind that you may have to support either. - * - * After succesful creation of the file, you may choose to return the ETag - * of the new file here. - * - * The returned ETag must be surrounded by double-quotes (The quotes should - * be part of the actual string). - * - * If you cannot accurately determine the ETag, you should not return it. - * If you don't store the file exactly as-is (you're transforming it - * somehow) you should also not return an ETag. - * - * This means that if a subsequent GET to this new file does not exactly - * return the same contents of what was submitted here, you are strongly - * recommended to omit the ETag. - * - * @param string $name Name of the file - * @param resource|string $data Initial payload - * @return null|string - */ - public function createFile($name, $data = null) { - - throw new Exception\Forbidden('Permission denied to create file (filename ' . $name . ')'); - - } - - /** - * Creates a new subdirectory - * - * @param string $name - * @throws Exception\Forbidden - * @return void - */ - public function createDirectory($name) { - - throw new Exception\Forbidden('Permission denied to create directory'); - - } - - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception.php deleted file mode 100644 index 7140bdf4b4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception.php +++ /dev/null @@ -1,64 +0,0 @@ -lock) { - $error = $errorNode->ownerDocument->createElementNS('DAV:','d:no-conflicting-lock'); - $errorNode->appendChild($error); - if (!is_object($this->lock)) var_dump($this->lock); - $error->appendChild($errorNode->ownerDocument->createElementNS('DAV:','d:href',$this->lock->uri)); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/FileNotFound.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/FileNotFound.php deleted file mode 100644 index 24a0e64fe0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/FileNotFound.php +++ /dev/null @@ -1,19 +0,0 @@ -ownerDocument->createElementNS('DAV:','d:valid-resourcetype'); - $errorNode->appendChild($error); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/LockTokenMatchesRequestUri.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/LockTokenMatchesRequestUri.php deleted file mode 100644 index 6fbd28891d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/LockTokenMatchesRequestUri.php +++ /dev/null @@ -1,41 +0,0 @@ -message = 'The locktoken supplied does not match any locks on this entity'; - - } - - /** - * This method allows the exception to include additional information into the WebDAV error response - * - * @param DAV\Server $server - * @param \DOMElement $errorNode - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $errorNode) { - - $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-matches-request-uri'); - $errorNode->appendChild($error); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Locked.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Locked.php deleted file mode 100644 index ebcc46c5b2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/Locked.php +++ /dev/null @@ -1,73 +0,0 @@ -lock = $lock; - - } - - /** - * Returns the HTTP statuscode for this exception - * - * @return int - */ - public function getHTTPCode() { - - return 423; - - } - - /** - * This method allows the exception to include additional information into the WebDAV error response - * - * @param DAV\Server $server - * @param \DOMElement $errorNode - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $errorNode) { - - if ($this->lock) { - $error = $errorNode->ownerDocument->createElementNS('DAV:','d:lock-token-submitted'); - $errorNode->appendChild($error); - - $href = $errorNode->ownerDocument->createElementNS('DAV:','d:href'); - $href->appendChild($errorNode->ownerDocument->createTextNode($this->lock->uri)); - $error->appendChild( - $href - ); - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/MethodNotAllowed.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/MethodNotAllowed.php deleted file mode 100644 index 0c2b67eb1a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/MethodNotAllowed.php +++ /dev/null @@ -1,45 +0,0 @@ -getAllowedMethods($server->getRequestUri()); - - return array( - 'Allow' => strtoupper(implode(', ',$methods)), - ); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php deleted file mode 100644 index 99e2ad262b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/NotAuthenticated.php +++ /dev/null @@ -1,30 +0,0 @@ -header = $header; - - } - - /** - * Returns the HTTP statuscode for this exception - * - * @return int - */ - public function getHTTPCode() { - - return 412; - - } - - /** - * This method allows the exception to include additional information into the WebDAV error response - * - * @param DAV\Server $server - * @param \DOMElement $errorNode - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $errorNode) { - - if ($this->header) { - $prop = $errorNode->ownerDocument->createElement('s:header'); - $prop->nodeValue = $this->header; - $errorNode->appendChild($prop); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ReportNotSupported.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ReportNotSupported.php deleted file mode 100644 index d7fa05fb7b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/ReportNotSupported.php +++ /dev/null @@ -1,32 +0,0 @@ -ownerDocument->createElementNS('DAV:','d:supported-report'); - $errorNode->appendChild($error); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/RequestedRangeNotSatisfiable.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/RequestedRangeNotSatisfiable.php deleted file mode 100644 index 2080388cea..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/RequestedRangeNotSatisfiable.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License - */ -class ServiceUnavailable extends DAV\Exception { - - /** - * Returns the HTTP statuscode for this exception - * - * @return int - */ - public function getHTTPCode() { - - return 503; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php deleted file mode 100644 index 05b245d91e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Exception/UnsupportedMediaType.php +++ /dev/null @@ -1,28 +0,0 @@ -path . '/' . $name; - file_put_contents($newPath,$data); - - } - - /** - * Creates a new subdirectory - * - * @param string $name - * @return void - */ - public function createDirectory($name) { - - $newPath = $this->path . '/' . $name; - mkdir($newPath); - - } - - /** - * Returns a specific child node, referenced by its name - * - * This method must throw DAV\Exception\NotFound if the node does not - * exist. - * - * @param string $name - * @throws DAV\Exception\NotFound - * @return DAV\INode - */ - public function getChild($name) { - - $path = $this->path . '/' . $name; - - if (!file_exists($path)) throw new DAV\Exception\NotFound('File with name ' . $path . ' could not be located'); - - if (is_dir($path)) { - - return new Directory($path); - - } else { - - return new File($path); - - } - - } - - /** - * Returns an array with all the child nodes - * - * @return DAV\INode[] - */ - public function getChildren() { - - $nodes = array(); - foreach(scandir($this->path) as $node) if($node!='.' && $node!='..') $nodes[] = $this->getChild($node); - return $nodes; - - } - - /** - * Checks if a child exists. - * - * @param string $name - * @return bool - */ - public function childExists($name) { - - $path = $this->path . '/' . $name; - return file_exists($path); - - } - - /** - * Deletes all files in this directory, and then itself - * - * @return void - */ - public function delete() { - - foreach($this->getChildren() as $child) $child->delete(); - rmdir($this->path); - - } - - /** - * Returns available diskspace information - * - * @return array - */ - public function getQuotaInfo() { - - return array( - disk_total_space($this->path)-disk_free_space($this->path), - disk_free_space($this->path) - ); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/File.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/File.php deleted file mode 100644 index 36106deaeb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/File.php +++ /dev/null @@ -1,91 +0,0 @@ -path,$data); - - } - - /** - * Returns the data - * - * @return string - */ - public function get() { - - return fopen($this->path,'r'); - - } - - /** - * Delete the current file - * - * @return void - */ - public function delete() { - - unlink($this->path); - - } - - /** - * Returns the size of the node, in bytes - * - * @return int - */ - public function getSize() { - - return filesize($this->path); - - } - - /** - * Returns the ETag for a file - * - * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. - * The ETag is an arbitrary string, but MUST be surrounded by double-quotes. - * - * Return null if the ETag can not effectively be determined - * - * @return mixed - */ - public function getETag() { - - return null; - - } - - /** - * Returns the mime-type for a file - * - * If null is returned, we'll assume application/octet-stream - * - * @return mixed - */ - public function getContentType() { - - return null; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/Node.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/Node.php deleted file mode 100644 index 0e2145bb36..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FS/Node.php +++ /dev/null @@ -1,82 +0,0 @@ -path = $path; - - } - - - - /** - * Returns the name of the node - * - * @return string - */ - public function getName() { - - list(, $name) = DAV\URLUtil::splitPath($this->path); - return $name; - - } - - /** - * Renames the node - * - * @param string $name The new name - * @return void - */ - public function setName($name) { - - list($parentPath, ) = DAV\URLUtil::splitPath($this->path); - list(, $newName) = DAV\URLUtil::splitPath($name); - - $newPath = $parentPath . '/' . $newName; - rename($this->path,$newPath); - - $this->path = $newPath; - - } - - - - /** - * Returns the last modification time, as a unix timestamp - * - * @return int - */ - public function getLastModified() { - - return filemtime($this->path); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Directory.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Directory.php deleted file mode 100644 index ca26db09c1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Directory.php +++ /dev/null @@ -1,159 +0,0 @@ -path . '/' . $name; - file_put_contents($newPath,$data); - - return '"' . md5_file($newPath) . '"'; - - } - - /** - * Creates a new subdirectory - * - * @param string $name - * @return void - */ - public function createDirectory($name) { - - // We're not allowing dots - if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..'); - $newPath = $this->path . '/' . $name; - mkdir($newPath); - - } - - /** - * Returns a specific child node, referenced by its name - * - * This method must throw SabreForRainLoop\DAV\Exception\NotFound if the node does not - * exist. - * - * @param string $name - * @throws DAV\Exception\NotFound - * @return DAV\INode - */ - public function getChild($name) { - - $path = $this->path . '/' . $name; - - if (!file_exists($path)) throw new DAV\Exception\NotFound('File could not be located'); - if ($name=='.' || $name=='..') throw new DAV\Exception\Forbidden('Permission denied to . and ..'); - - if (is_dir($path)) { - - return new Directory($path); - - } else { - - return new File($path); - - } - - } - - /** - * Checks if a child exists. - * - * @param string $name - * @return bool - */ - public function childExists($name) { - - if ($name=='.' || $name=='..') - throw new DAV\Exception\Forbidden('Permission denied to . and ..'); - - $path = $this->path . '/' . $name; - return file_exists($path); - - } - - /** - * Returns an array with all the child nodes - * - * @return DAV\INode[] - */ - public function getChildren() { - - $nodes = array(); - foreach(scandir($this->path) as $node) if($node!='.' && $node!='..' && $node!='.sabredav') $nodes[] = $this->getChild($node); - return $nodes; - - } - - /** - * Deletes all files in this directory, and then itself - * - * @return bool - */ - public function delete() { - - // Deleting all children - foreach($this->getChildren() as $child) $child->delete(); - - // Removing resource info, if its still around - if (file_exists($this->path . '/.sabredav')) unlink($this->path . '/.sabredav'); - - // Removing the directory itself - rmdir($this->path); - - return parent::delete(); - - } - - /** - * Returns available diskspace information - * - * @return array - */ - public function getQuotaInfo() { - - return array( - disk_total_space($this->path)-disk_free_space($this->path), - disk_free_space($this->path) - ); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/File.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/File.php deleted file mode 100644 index 425637cef9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/File.php +++ /dev/null @@ -1,118 +0,0 @@ -path,$data); - return '"' . md5_file($this->path) . '"'; - - } - - /** - * Updates the data at a given offset - * - * The data argument is a readable stream resource. - * The offset argument is a 0-based offset where the data should be - * written. - * - * param resource|string $data - * @return void - */ - public function putRange($data, $offset) { - - $f = fopen($this->path, 'c'); - fseek($f,$offset-1); - if (is_string($data)) { - fwrite($f, $data); - } else { - stream_copy_to_stream($data,$f); - } - fclose($f); - return '"' . md5_file($this->path) . '"'; - - } - - /** - * Returns the data - * - * @return resource - */ - public function get() { - - return fopen($this->path,'r'); - - } - - /** - * Delete the current file - * - * @return bool - */ - public function delete() { - - unlink($this->path); - return parent::delete(); - - } - - /** - * Returns the ETag for a file - * - * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. - * The ETag is an arbitrary string, but MUST be surrounded by double-quotes. - * - * Return null if the ETag can not effectively be determined - * - * @return string|null - */ - public function getETag() { - - return '"' . md5_file($this->path). '"'; - - } - - /** - * Returns the mime-type for a file - * - * If null is returned, we'll assume application/octet-stream - * - * @return string|null - */ - public function getContentType() { - - return null; - - } - - /** - * Returns the size of the file, in bytes - * - * @return int - */ - public function getSize() { - - return filesize($this->path); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php deleted file mode 100644 index 17cd32c813..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/FSExt/Node.php +++ /dev/null @@ -1,214 +0,0 @@ -getResourceData(); - - foreach($properties as $propertyName=>$propertyValue) { - - // If it was null, we need to delete the property - if (is_null($propertyValue)) { - if (isset($resourceData['properties'][$propertyName])) { - unset($resourceData['properties'][$propertyName]); - } - } else { - $resourceData['properties'][$propertyName] = $propertyValue; - } - - } - - $this->putResourceData($resourceData); - return true; - } - - /** - * Returns a list of properties for this nodes.; - * - * The properties list is a list of propertynames the client requested, encoded as xmlnamespace#tagName, for example: http://www.example.org/namespace#author - * If the array is empty, all properties should be returned - * - * @param array $properties - * @return array - */ - function getProperties($properties) { - - $resourceData = $this->getResourceData(); - - // if the array was empty, we need to return everything - if (!$properties) return $resourceData['properties']; - - $props = array(); - foreach($properties as $property) { - if (isset($resourceData['properties'][$property])) $props[$property] = $resourceData['properties'][$property]; - } - - return $props; - - } - - /** - * Returns the path to the resource file - * - * @return string - */ - protected function getResourceInfoPath() { - - list($parentDir) = DAV\URLUtil::splitPath($this->path); - return $parentDir . '/.sabredav'; - - } - - /** - * Returns all the stored resource information - * - * @return array - */ - protected function getResourceData() { - - $path = $this->getResourceInfoPath(); - if (!file_exists($path)) return array('properties' => array()); - - // opening up the file, and creating a shared lock - $handle = fopen($path,'r'); - flock($handle,LOCK_SH); - $data = ''; - - // Reading data until the eof - while(!feof($handle)) { - $data.=fread($handle,8192); - } - - // We're all good - fclose($handle); - - // Unserializing and checking if the resource file contains data for this file - $data = unserialize($data); - if (!isset($data[$this->getName()])) { - return array('properties' => array()); - } - - $data = $data[$this->getName()]; - if (!isset($data['properties'])) $data['properties'] = array(); - return $data; - - } - - /** - * Updates the resource information - * - * @param array $newData - * @return void - */ - protected function putResourceData(array $newData) { - - $path = $this->getResourceInfoPath(); - - // opening up the file, and creating a shared lock - $handle = fopen($path,'a+'); - flock($handle,LOCK_EX); - $data = ''; - - rewind($handle); - - // Reading data until the eof - while(!feof($handle)) { - $data.=fread($handle,8192); - } - - // Unserializing and checking if the resource file contains data for this file - $data = unserialize($data); - $data[$this->getName()] = $newData; - ftruncate($handle,0); - rewind($handle); - - fwrite($handle,serialize($data)); - fclose($handle); - - } - - /** - * Renames the node - * - * @param string $name The new name - * @return void - */ - public function setName($name) { - - list($parentPath, ) = DAV\URLUtil::splitPath($this->path); - list(, $newName) = DAV\URLUtil::splitPath($name); - $newPath = $parentPath . '/' . $newName; - - // We're deleting the existing resourcedata, and recreating it - // for the new path. - $resourceData = $this->getResourceData(); - $this->deleteResourceData(); - - rename($this->path,$newPath); - $this->path = $newPath; - $this->putResourceData($resourceData); - - - } - - /** - * @return bool - */ - public function deleteResourceData() { - - // When we're deleting this node, we also need to delete any resource information - $path = $this->getResourceInfoPath(); - if (!file_exists($path)) return true; - - // opening up the file, and creating a shared lock - $handle = fopen($path,'a+'); - flock($handle,LOCK_EX); - $data = ''; - - rewind($handle); - - // Reading data until the eof - while(!feof($handle)) { - $data.=fread($handle,8192); - } - - // Unserializing and checking if the resource file contains data for this file - $data = unserialize($data); - if (isset($data[$this->getName()])) unset($data[$this->getName()]); - ftruncate($handle,0); - rewind($handle); - fwrite($handle,serialize($data)); - fclose($handle); - - return true; - } - - public function delete() { - - return $this->deleteResourceData(); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/File.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/File.php deleted file mode 100644 index e21d240b4b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/File.php +++ /dev/null @@ -1,85 +0,0 @@ - array( - * '{DAV:}displayname' => null, - * ), - * 424 => array( - * '{DAV:}owner' => null, - * ) - * ) - * - * In this example it was forbidden to update {DAV:}displayname. - * (403 Forbidden), which in turn also caused {DAV:}owner to fail - * (424 Failed Dependency) because the request needs to be atomic. - * - * @param array $mutations - * @return bool|array - */ - function updateProperties($mutations); - - /** - * Returns a list of properties for this nodes. - * - * The properties list is a list of propertynames the client requested, - * encoded in clark-notation {xmlnamespace}tagname - * - * If the array is empty, it means 'all properties' were requested. - * - * Note that it's fine to liberally give properties back, instead of - * conforming to the list of requested properties. - * The Server class will filter out the extra. - * - * @param array $properties - * @return void - */ - function getProperties($properties); - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IQuota.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IQuota.php deleted file mode 100644 index dd42fc51f0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/IQuota.php +++ /dev/null @@ -1,27 +0,0 @@ -dataDir = $dataDir; - - } - - protected function getFileNameForUri($uri) { - - return $this->dataDir . '/sabredav_' . md5($uri) . '.locks'; - - } - - - /** - * Returns a list of SabreForRainLoop\DAV\Locks\LockInfo objects - * - * This method should return all the locks for a particular uri, including - * locks that might be set on a parent uri. - * - * If returnChildLocks is set to true, this method should also look for - * any locks in the subtree of the uri for locks. - * - * @param string $uri - * @param bool $returnChildLocks - * @return array - */ - public function getLocks($uri, $returnChildLocks) { - - $lockList = array(); - $currentPath = ''; - - foreach(explode('/',$uri) as $uriPart) { - - // weird algorithm that can probably be improved, but we're traversing the path top down - if ($currentPath) $currentPath.='/'; - $currentPath.=$uriPart; - - $uriLocks = $this->getData($currentPath); - - foreach($uriLocks as $uriLock) { - - // Unless we're on the leaf of the uri-tree we should ignore locks with depth 0 - if($uri==$currentPath || $uriLock->depth!=0) { - $uriLock->uri = $currentPath; - $lockList[] = $uriLock; - } - - } - - } - - // Checking if we can remove any of these locks - foreach($lockList as $k=>$lock) { - if (time() > $lock->timeout + $lock->created) unset($lockList[$k]); - } - return $lockList; - - } - - /** - * Locks a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function lock($uri, LockInfo $lockInfo) { - - // We're making the lock timeout 30 minutes - $lockInfo->timeout = 1800; - $lockInfo->created = time(); - - $locks = $this->getLocks($uri,false); - foreach($locks as $k=>$lock) { - if ($lock->token == $lockInfo->token) unset($locks[$k]); - } - $locks[] = $lockInfo; - $this->putData($uri,$locks); - return true; - - } - - /** - * Removes a lock from a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function unlock($uri, LockInfo $lockInfo) { - - $locks = $this->getLocks($uri,false); - foreach($locks as $k=>$lock) { - - if ($lock->token == $lockInfo->token) { - - unset($locks[$k]); - $this->putData($uri,$locks); - return true; - - } - } - return false; - - } - - /** - * Returns the stored data for a uri - * - * @param string $uri - * @return array - */ - protected function getData($uri) { - - $path = $this->getFilenameForUri($uri); - if (!file_exists($path)) return array(); - - // opening up the file, and creating a shared lock - $handle = fopen($path,'r'); - flock($handle,LOCK_SH); - $data = ''; - - // Reading data until the eof - while(!feof($handle)) { - $data.=fread($handle,8192); - } - - // We're all good - fclose($handle); - - // Unserializing and checking if the resource file contains data for this file - $data = unserialize($data); - if (!$data) return array(); - return $data; - - } - - /** - * Updates the lock information - * - * @param string $uri - * @param array $newData - * @return void - */ - protected function putData($uri,array $newData) { - - $path = $this->getFileNameForUri($uri); - - // opening up the file, and creating a shared lock - $handle = fopen($path,'a+'); - flock($handle,LOCK_EX); - ftruncate($handle,0); - rewind($handle); - - fwrite($handle,serialize($newData)); - fclose($handle); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/File.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/File.php deleted file mode 100644 index b405085918..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/File.php +++ /dev/null @@ -1,183 +0,0 @@ -locksFile = $locksFile; - - } - - /** - * Returns a list of SabreForRainLoop\DAV\Locks\LockInfo objects - * - * This method should return all the locks for a particular uri, including - * locks that might be set on a parent uri. - * - * If returnChildLocks is set to true, this method should also look for - * any locks in the subtree of the uri for locks. - * - * @param string $uri - * @param bool $returnChildLocks - * @return array - */ - public function getLocks($uri, $returnChildLocks) { - - $newLocks = array(); - - $locks = $this->getData(); - - foreach($locks as $lock) { - - if ($lock->uri === $uri || - //deep locks on parents - ($lock->depth!=0 && strpos($uri, $lock->uri . '/')===0) || - - // locks on children - ($returnChildLocks && (strpos($lock->uri, $uri . '/')===0)) ) { - - $newLocks[] = $lock; - - } - - } - - // Checking if we can remove any of these locks - foreach($newLocks as $k=>$lock) { - if (time() > $lock->timeout + $lock->created) unset($newLocks[$k]); - } - return $newLocks; - - } - - /** - * Locks a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function lock($uri, LockInfo $lockInfo) { - - // We're making the lock timeout 30 minutes - $lockInfo->timeout = 1800; - $lockInfo->created = time(); - $lockInfo->uri = $uri; - - $locks = $this->getData(); - - foreach($locks as $k=>$lock) { - if ( - ($lock->token == $lockInfo->token) || - (time() > $lock->timeout + $lock->created) - ) { - unset($locks[$k]); - } - } - $locks[] = $lockInfo; - $this->putData($locks); - return true; - - } - - /** - * Removes a lock from a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function unlock($uri, LockInfo $lockInfo) { - - $locks = $this->getData(); - foreach($locks as $k=>$lock) { - - if ($lock->token == $lockInfo->token) { - - unset($locks[$k]); - $this->putData($locks); - return true; - - } - } - return false; - - } - - /** - * Loads the lockdata from the filesystem. - * - * @return array - */ - protected function getData() { - - if (!file_exists($this->locksFile)) return array(); - - // opening up the file, and creating a shared lock - $handle = fopen($this->locksFile,'r'); - flock($handle,LOCK_SH); - - // Reading data until the eof - $data = stream_get_contents($handle); - - // We're all good - fclose($handle); - - // Unserializing and checking if the resource file contains data for this file - $data = unserialize($data); - if (!$data) return array(); - return $data; - - } - - /** - * Saves the lockdata - * - * @param array $newData - * @return void - */ - protected function putData(array $newData) { - - // opening up the file, and creating an exclusive lock - $handle = fopen($this->locksFile,'a+'); - flock($handle,LOCK_EX); - - // We can only truncate and rewind once the lock is acquired. - ftruncate($handle,0); - rewind($handle); - - fwrite($handle,serialize($newData)); - fclose($handle); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/PDO.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/PDO.php deleted file mode 100644 index 271853339f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/Backend/PDO.php +++ /dev/null @@ -1,167 +0,0 @@ -pdo = $pdo; - $this->tableName = $tableName; - - } - - /** - * Returns a list of SabreForRainLoop\DAV\Locks\LockInfo objects - * - * This method should return all the locks for a particular uri, including - * locks that might be set on a parent uri. - * - * If returnChildLocks is set to true, this method should also look for - * any locks in the subtree of the uri for locks. - * - * @param string $uri - * @param bool $returnChildLocks - * @return array - */ - public function getLocks($uri, $returnChildLocks) { - - // NOTE: the following 10 lines or so could be easily replaced by - // pure sql. MySQL's non-standard string concatenation prevents us - // from doing this though. - $query = 'SELECT owner, token, timeout, created, scope, depth, uri FROM '.$this->tableName.' WHERE ((created + timeout) > CAST(? AS UNSIGNED INTEGER)) AND ((uri = ?)'; - $params = array(time(),$uri); - - // We need to check locks for every part in the uri. - $uriParts = explode('/',$uri); - - // We already covered the last part of the uri - array_pop($uriParts); - - $currentPath=''; - - foreach($uriParts as $part) { - - if ($currentPath) $currentPath.='/'; - $currentPath.=$part; - - $query.=' OR (depth!=0 AND uri = ?)'; - $params[] = $currentPath; - - } - - if ($returnChildLocks) { - - $query.=' OR (uri LIKE ?)'; - $params[] = $uri . '/%'; - - } - $query.=')'; - - $stmt = $this->pdo->prepare($query); - $stmt->execute($params); - $result = $stmt->fetchAll(); - - $lockList = array(); - foreach($result as $row) { - - $lockInfo = new LockInfo(); - $lockInfo->owner = $row['owner']; - $lockInfo->token = $row['token']; - $lockInfo->timeout = $row['timeout']; - $lockInfo->created = $row['created']; - $lockInfo->scope = $row['scope']; - $lockInfo->depth = $row['depth']; - $lockInfo->uri = $row['uri']; - $lockList[] = $lockInfo; - - } - - return $lockList; - - } - - /** - * Locks a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function lock($uri, LockInfo $lockInfo) { - - // We're making the lock timeout 30 minutes - $lockInfo->timeout = 30*60; - $lockInfo->created = time(); - $lockInfo->uri = $uri; - - $locks = $this->getLocks($uri,false); - $exists = false; - foreach($locks as $lock) { - if ($lock->token == $lockInfo->token) $exists = true; - } - - if ($exists) { - $stmt = $this->pdo->prepare('UPDATE '.$this->tableName.' SET owner = ?, timeout = ?, scope = ?, depth = ?, uri = ?, created = ? WHERE token = ?'); - $stmt->execute(array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token)); - } else { - $stmt = $this->pdo->prepare('INSERT INTO '.$this->tableName.' (owner,timeout,scope,depth,uri,created,token) VALUES (?,?,?,?,?,?,?)'); - $stmt->execute(array($lockInfo->owner,$lockInfo->timeout,$lockInfo->scope,$lockInfo->depth,$uri,$lockInfo->created,$lockInfo->token)); - } - - return true; - - } - - - - /** - * Removes a lock from a uri - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function unlock($uri, LockInfo $lockInfo) { - - $stmt = $this->pdo->prepare('DELETE FROM '.$this->tableName.' WHERE uri = ? AND token = ?'); - $stmt->execute(array($uri,$lockInfo->token)); - - return $stmt->rowCount()===1; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/LockInfo.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/LockInfo.php deleted file mode 100644 index 894ac574df..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Locks/LockInfo.php +++ /dev/null @@ -1,81 +0,0 @@ -addPlugin($lockPlugin); - * - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). - * @author Evert Pot (http://evertpot.com/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License - */ -class Plugin extends DAV\ServerPlugin { - - /** - * locksBackend - * - * @var Backend\Backend\Interface - */ - protected $locksBackend; - - /** - * server - * - * @var SabreForRainLoop\DAV\Server - */ - protected $server; - - /** - * __construct - * - * @param Backend\BackendInterface $locksBackend - */ - public function __construct(Backend\BackendInterface $locksBackend = null) { - - $this->locksBackend = $locksBackend; - - } - - /** - * Initializes the plugin - * - * This method is automatically called by the Server class after addPlugin. - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - $server->subscribeEvent('unknownMethod',array($this,'unknownMethod')); - $server->subscribeEvent('beforeMethod',array($this,'beforeMethod'),50); - $server->subscribeEvent('afterGetProperties',array($this,'afterGetProperties')); - - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using SabreForRainLoop\DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() { - - return 'locks'; - - } - - /** - * This method is called by the Server if the user used an HTTP method - * the server didn't recognize. - * - * This plugin intercepts the LOCK and UNLOCK methods. - * - * @param string $method - * @param string $uri - * @return bool - */ - public function unknownMethod($method, $uri) { - - switch($method) { - - case 'LOCK' : $this->httpLock($uri); return false; - case 'UNLOCK' : $this->httpUnlock($uri); return false; - - } - - } - - /** - * This method is called after most properties have been found - * it allows us to add in any Lock-related properties - * - * @param string $path - * @param array $newProperties - * @return bool - */ - public function afterGetProperties($path, &$newProperties) { - - foreach($newProperties[404] as $propName=>$discard) { - - switch($propName) { - - case '{DAV:}supportedlock' : - $val = false; - if ($this->locksBackend) $val = true; - $newProperties[200][$propName] = new DAV\Property\SupportedLock($val); - unset($newProperties[404][$propName]); - break; - - case '{DAV:}lockdiscovery' : - $newProperties[200][$propName] = new DAV\Property\LockDiscovery($this->getLocks($path)); - unset($newProperties[404][$propName]); - break; - - } - - - } - return true; - - } - - - /** - * This method is called before the logic for any HTTP method is - * handled. - * - * This plugin uses that feature to intercept access to locked resources. - * - * @param string $method - * @param string $uri - * @return bool - */ - public function beforeMethod($method, $uri) { - - switch($method) { - - case 'DELETE' : - $lastLock = null; - if (!$this->validateLock($uri,$lastLock, true)) - throw new DAV\Exception\Locked($lastLock); - break; - case 'MKCOL' : - case 'PROPPATCH' : - case 'PUT' : - case 'PATCH' : - $lastLock = null; - if (!$this->validateLock($uri,$lastLock)) - throw new DAV\Exception\Locked($lastLock); - break; - case 'MOVE' : - $lastLock = null; - if (!$this->validateLock(array( - $uri, - $this->server->calculateUri($this->server->httpRequest->getHeader('Destination')), - ),$lastLock, true)) - throw new DAV\Exception\Locked($lastLock); - break; - case 'COPY' : - $lastLock = null; - if (!$this->validateLock( - $this->server->calculateUri($this->server->httpRequest->getHeader('Destination')), - $lastLock, true)) - throw new DAV\Exception\Locked($lastLock); - break; - } - - return true; - - } - - /** - * Use this method to tell the server this plugin defines additional - * HTTP methods. - * - * This method is passed a uri. It should only return HTTP methods that are - * available for the specified uri. - * - * @param string $uri - * @return array - */ - public function getHTTPMethods($uri) { - - if ($this->locksBackend) - return array('LOCK','UNLOCK'); - - return array(); - - } - - /** - * Returns a list of features for the HTTP OPTIONS Dav: header. - * - * In this case this is only the number 2. The 2 in the Dav: header - * indicates the server supports locks. - * - * @return array - */ - public function getFeatures() { - - return array(2); - - } - - /** - * Returns all lock information on a particular uri - * - * This function should return an array with SabreForRainLoop\DAV\Locks\LockInfo objects. If there are no locks on a file, return an empty array. - * - * Additionally there is also the possibility of locks on parent nodes, so we'll need to traverse every part of the tree - * If the $returnChildLocks argument is set to true, we'll also traverse all the children of the object - * for any possible locks and return those as well. - * - * @param string $uri - * @param bool $returnChildLocks - * @return array - */ - public function getLocks($uri, $returnChildLocks = false) { - - $lockList = array(); - - if ($this->locksBackend) - $lockList = array_merge($lockList,$this->locksBackend->getLocks($uri, $returnChildLocks)); - - return $lockList; - - } - - /** - * Locks an uri - * - * The WebDAV lock request can be operated to either create a new lock on a file, or to refresh an existing lock - * If a new lock is created, a full XML body should be supplied, containing information about the lock such as the type - * of lock (shared or exclusive) and the owner of the lock - * - * If a lock is to be refreshed, no body should be supplied and there should be a valid If header containing the lock - * - * Additionally, a lock can be requested for a non-existent file. In these case we're obligated to create an empty file as per RFC4918:S7.3 - * - * @param string $uri - * @return void - */ - protected function httpLock($uri) { - - $lastLock = null; - if (!$this->validateLock($uri,$lastLock)) { - - // If the existing lock was an exclusive lock, we need to fail - if (!$lastLock || $lastLock->scope == LockInfo::EXCLUSIVE) { - //var_dump($lastLock); - throw new DAV\Exception\ConflictingLock($lastLock); - } - - } - - if ($body = $this->server->httpRequest->getBody(true)) { - // This is a new lock request - $lockInfo = $this->parseLockRequest($body); - $lockInfo->depth = $this->server->getHTTPDepth(); - $lockInfo->uri = $uri; - if($lastLock && $lockInfo->scope != LockInfo::SHARED) throw new DAV\Exception\ConflictingLock($lastLock); - - } elseif ($lastLock) { - - // This must have been a lock refresh - $lockInfo = $lastLock; - - // The resource could have been locked through another uri. - if ($uri!=$lockInfo->uri) $uri = $lockInfo->uri; - - } else { - - // There was neither a lock refresh nor a new lock request - throw new DAV\Exception\BadRequest('An xml body is required for lock requests'); - - } - - if ($timeout = $this->getTimeoutHeader()) $lockInfo->timeout = $timeout; - - $newFile = false; - - // If we got this far.. we should go check if this node actually exists. If this is not the case, we need to create it first - try { - $this->server->tree->getNodeForPath($uri); - - // We need to call the beforeWriteContent event for RFC3744 - // Edit: looks like this is not used, and causing problems now. - // - // See Issue 222 - // $this->server->broadcastEvent('beforeWriteContent',array($uri)); - - } catch (DAV\Exception\NotFound $e) { - - // It didn't, lets create it - $this->server->createFile($uri,fopen('php://memory','r')); - $newFile = true; - - } - - $this->lockNode($uri,$lockInfo); - - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Lock-Token','token . '>'); - $this->server->httpResponse->sendStatus($newFile?201:200); - $this->server->httpResponse->sendBody($this->generateLockResponse($lockInfo)); - - } - - /** - * Unlocks a uri - * - * This WebDAV method allows you to remove a lock from a node. The client should provide a valid locktoken through the Lock-token http header - * The server should return 204 (No content) on success - * - * @param string $uri - * @return void - */ - protected function httpUnlock($uri) { - - $lockToken = $this->server->httpRequest->getHeader('Lock-Token'); - - // If the locktoken header is not supplied, we need to throw a bad request exception - if (!$lockToken) throw new DAV\Exception\BadRequest('No lock token was supplied'); - - $locks = $this->getLocks($uri); - - // Windows sometimes forgets to include < and > in the Lock-Token - // header - if ($lockToken[0]!=='<') $lockToken = '<' . $lockToken . '>'; - - foreach($locks as $lock) { - - if ('token . '>' == $lockToken) { - - $this->unlockNode($uri,$lock); - $this->server->httpResponse->setHeader('Content-Length','0'); - $this->server->httpResponse->sendStatus(204); - return; - - } - - } - - // If we got here, it means the locktoken was invalid - throw new DAV\Exception\LockTokenMatchesRequestUri(); - - } - - /** - * Locks a uri - * - * All the locking information is supplied in the lockInfo object. The object has a suggested timeout, but this can be safely ignored - * It is important that if the existing timeout is ignored, the property is overwritten, as this needs to be sent back to the client - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function lockNode($uri,LockInfo $lockInfo) { - - if (!$this->server->broadcastEvent('beforeLock',array($uri,$lockInfo))) return; - - if ($this->locksBackend) return $this->locksBackend->lock($uri,$lockInfo); - throw new DAV\Exception\MethodNotAllowed('Locking support is not enabled for this resource. No Locking backend was found so if you didn\'t expect this error, please check your configuration.'); - - } - - /** - * Unlocks a uri - * - * This method removes a lock from a uri. It is assumed all the supplied information is correct and verified - * - * @param string $uri - * @param LockInfo $lockInfo - * @return bool - */ - public function unlockNode($uri, LockInfo $lockInfo) { - - if (!$this->server->broadcastEvent('beforeUnlock',array($uri,$lockInfo))) return; - if ($this->locksBackend) return $this->locksBackend->unlock($uri,$lockInfo); - - } - - - /** - * Returns the contents of the HTTP Timeout header. - * - * The method formats the header into an integer. - * - * @return int - */ - public function getTimeoutHeader() { - - $header = $this->server->httpRequest->getHeader('Timeout'); - - if ($header) { - - if (stripos($header,'second-')===0) $header = (int)(substr($header,7)); - else if (strtolower($header)=='infinite') $header = LockInfo::TIMEOUT_INFINITE; - else throw new DAV\Exception\BadRequest('Invalid HTTP timeout header'); - - } else { - - $header = 0; - - } - - return $header; - - } - - /** - * Generates the response for successful LOCK requests - * - * @param LockInfo $lockInfo - * @return string - */ - protected function generateLockResponse(LockInfo $lockInfo) { - - $dom = new \DOMDocument('1.0','utf-8'); - $dom->formatOutput = true; - - $prop = $dom->createElementNS('DAV:','d:prop'); - $dom->appendChild($prop); - - $lockDiscovery = $dom->createElementNS('DAV:','d:lockdiscovery'); - $prop->appendChild($lockDiscovery); - - $lockObj = new DAV\Property\LockDiscovery(array($lockInfo),true); - $lockObj->serialize($this->server,$lockDiscovery); - - return $dom->saveXML(); - - } - - /** - * validateLock should be called when a write operation is about to happen - * It will check if the requested url is locked, and see if the correct lock tokens are passed - * - * @param mixed $urls List of relevant urls. Can be an array, a string or nothing at all for the current request uri - * @param mixed $lastLock This variable will be populated with the last checked lock object (SabreForRainLoop\DAV\Locks\LockInfo) - * @param bool $checkChildLocks If set to true, this function will also look for any locks set on child resources of the supplied urls. This is needed for for example deletion of entire trees. - * @return bool - */ - protected function validateLock($urls = null,&$lastLock = null, $checkChildLocks = false) { - - if (is_null($urls)) { - $urls = array($this->server->getRequestUri()); - } elseif (is_string($urls)) { - $urls = array($urls); - } elseif (!is_array($urls)) { - throw new DAV\Exception('The urls parameter should either be null, a string or an array'); - } - - $conditions = $this->getIfConditions(); - - // We're going to loop through the urls and make sure all lock conditions are satisfied - foreach($urls as $url) { - - $locks = $this->getLocks($url, $checkChildLocks); - - // If there were no conditions, but there were locks, we fail - if (!$conditions && $locks) { - reset($locks); - $lastLock = current($locks); - return false; - } - - // If there were no locks or conditions, we go to the next url - if (!$locks && !$conditions) continue; - - foreach($conditions as $condition) { - - if (!$condition['uri']) { - $conditionUri = $this->server->getRequestUri(); - } else { - $conditionUri = $this->server->calculateUri($condition['uri']); - } - - // If the condition has a url, and it isn't part of the affected url at all, check the next condition - if ($conditionUri && strpos($url,$conditionUri)!==0) continue; - - // The tokens array contians arrays with 2 elements. 0=true/false for normal/not condition, 1=locktoken - // At least 1 condition has to be satisfied - foreach($condition['tokens'] as $conditionToken) { - - $etagValid = true; - $lockValid = true; - - // key 2 can contain an etag - if ($conditionToken[2]) { - - $uri = $conditionUri?$conditionUri:$this->server->getRequestUri(); - $node = $this->server->tree->getNodeForPath($uri); - $etagValid = $node->getETag()==$conditionToken[2]; - - } - - // key 1 can contain a lock token - if ($conditionToken[1]) { - - $lockValid = false; - // Match all the locks - foreach($locks as $lockIndex=>$lock) { - - $lockToken = 'opaquelocktoken:' . $lock->token; - - // Checking NOT - if (!$conditionToken[0] && $lockToken != $conditionToken[1]) { - - // Condition valid, onto the next - $lockValid = true; - break; - } - if ($conditionToken[0] && $lockToken == $conditionToken[1]) { - - $lastLock = $lock; - // Condition valid and lock matched - unset($locks[$lockIndex]); - $lockValid = true; - break; - - } - - } - - } - - // If, after checking both etags and locks they are stil valid, - // we can continue with the next condition. - if ($etagValid && $lockValid) continue 2; - } - // No conditions matched, so we fail - throw new DAV\Exception\PreconditionFailed('The tokens provided in the if header did not match','If'); - } - - // Conditions were met, we'll also need to check if all the locks are gone - if (count($locks)) { - - reset($locks); - - // There's still locks, we fail - $lastLock = current($locks); - return false; - - } - - - } - - // We got here, this means every condition was satisfied - return true; - - } - - /** - * This method is created to extract information from the WebDAV HTTP 'If:' header - * - * The If header can be quite complex, and has a bunch of features. We're using a regex to extract all relevant information - * The function will return an array, containing structs with the following keys - * - * * uri - the uri the condition applies to. If this is returned as an - * empty string, this implies it's referring to the request url. - * * tokens - The lock token. another 2 dimensional array containing 2 elements (0 = true/false.. If this is a negative condition its set to false, 1 = the actual token) - * * etag - an etag, if supplied - * - * @return array - */ - public function getIfConditions() { - - $header = $this->server->httpRequest->getHeader('If'); - if (!$header) return array(); - - $matches = array(); - - $regex = '/(?:\<(?P.*?)\>\s)?\((?PNot\s)?(?:\<(?P[^\>]*)\>)?(?:\s?)(?:\[(?P[^\]]*)\])?\)/im'; - preg_match_all($regex,$header,$matches,PREG_SET_ORDER); - - $conditions = array(); - - foreach($matches as $match) { - - $condition = array( - 'uri' => $match['uri'], - 'tokens' => array( - array($match['not']?0:1,$match['token'],isset($match['etag'])?$match['etag']:'') - ), - ); - - if (!$condition['uri'] && count($conditions)) $conditions[count($conditions)-1]['tokens'][] = array( - $match['not']?0:1, - $match['token'], - isset($match['etag'])?$match['etag']:'' - ); - else { - $conditions[] = $condition; - } - - } - - return $conditions; - - } - - /** - * Parses a webdav lock xml body, and returns a new SabreForRainLoop\DAV\Locks\LockInfo object - * - * @param string $body - * @return DAV\Locks\LockInfo - */ - protected function parseLockRequest($body) { - - $xml = simplexml_load_string( - DAV\XMLUtil::convertDAVNamespace($body), - null, - LIBXML_NOWARNING); - $xml->registerXPathNamespace('d','urn:DAV'); - $lockInfo = new LockInfo(); - - $children = $xml->children("urn:DAV"); - $lockInfo->owner = (string)$children->owner; - - $lockInfo->token = DAV\UUIDUtil::getUUID(); - $lockInfo->scope = count($xml->xpath('d:lockscope/d:exclusive'))>0 ? LockInfo::EXCLUSIVE : LockInfo::SHARED; - - return $lockInfo; - - } - - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php deleted file mode 100644 index 4959f012b3..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Mount/Plugin.php +++ /dev/null @@ -1,83 +0,0 @@ -server = $server; - $this->server->subscribeEvent('beforeMethod',array($this,'beforeMethod'), 90); - - } - - /** - * 'beforeMethod' event handles. This event handles intercepts GET requests ending - * with ?mount - * - * @param string $method - * @param string $uri - * @return bool - */ - public function beforeMethod($method, $uri) { - - if ($method!='GET') return; - if ($this->server->httpRequest->getQueryString()!='mount') return; - - $currentUri = $this->server->httpRequest->getAbsoluteUri(); - - // Stripping off everything after the ? - list($currentUri) = explode('?',$currentUri); - - $this->davMount($currentUri); - - // Returning false to break the event chain - return false; - - } - - /** - * Generates the davmount response - * - * @param string $uri absolute uri - * @return void - */ - public function davMount($uri) { - - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->setHeader('Content-Type','application/davmount+xml'); - ob_start(); - echo '', "\n"; - echo "\n"; - echo " ", htmlspecialchars($uri, ENT_NOQUOTES, 'UTF-8'), "\n"; - echo ""; - $this->server->httpResponse->sendBody(ob_get_clean()); - - } - - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Node.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Node.php deleted file mode 100644 index 52e460e212..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Node.php +++ /dev/null @@ -1,55 +0,0 @@ -rootNode = $rootNode; - - } - - /** - * Returns the INode object for the requested path - * - * @param string $path - * @return INode - */ - public function getNodeForPath($path) { - - $path = trim($path,'/'); - if (isset($this->cache[$path])) return $this->cache[$path]; - - // Is it the root node? - if (!strlen($path)) { - return $this->rootNode; - } - - // Attempting to fetch its parent - list($parentName, $baseName) = URLUtil::splitPath($path); - - // If there was no parent, we must simply ask it from the root node. - if ($parentName==="") { - $node = $this->rootNode->getChild($baseName); - } else { - // Otherwise, we recursively grab the parent and ask him/her. - $parent = $this->getNodeForPath($parentName); - - if (!($parent instanceof ICollection)) - throw new Exception\NotFound('Could not find node at path: ' . $path); - - $node = $parent->getChild($baseName); - - } - - $this->cache[$path] = $node; - return $node; - - } - - /** - * This function allows you to check if a node exists. - * - * @param string $path - * @return bool - */ - public function nodeExists($path) { - - try { - - // The root always exists - if ($path==='') return true; - - list($parent, $base) = URLUtil::splitPath($path); - - $parentNode = $this->getNodeForPath($parent); - if (!$parentNode instanceof ICollection) return false; - return $parentNode->childExists($base); - - } catch (Exception\NotFound $e) { - - return false; - - } - - } - - /** - * Returns a list of childnodes for a given path. - * - * @param string $path - * @return array - */ - public function getChildren($path) { - - $node = $this->getNodeForPath($path); - $children = $node->getChildren(); - foreach($children as $child) { - - $this->cache[trim($path,'/') . '/' . $child->getName()] = $child; - - } - return $children; - - } - - /** - * This method is called with every tree update - * - * Examples of tree updates are: - * * node deletions - * * node creations - * * copy - * * move - * * renaming nodes - * - * If Tree classes implement a form of caching, this will allow - * them to make sure caches will be expired. - * - * If a path is passed, it is assumed that the entire subtree is dirty - * - * @param string $path - * @return void - */ - public function markDirty($path) { - - // We don't care enough about sub-paths - // flushing the entire cache - $path = trim($path,'/'); - foreach($this->cache as $nodePath=>$node) { - if ($nodePath == $path || strpos($nodePath,$path.'/')===0) - unset($this->cache[$nodePath]); - - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PartialUpdate/IFile.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PartialUpdate/IFile.php deleted file mode 100644 index a3eee51e2a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PartialUpdate/IFile.php +++ /dev/null @@ -1,40 +0,0 @@ -addPlugin($patchPlugin); - * - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). - * @author Jean-Tiare LE BIGOT (http://www.jtlebi.fr/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License - */ -class Plugin extends DAV\ServerPlugin { - - /** - * Reference to server - * - * @var SabreForRainLoop\DAV\Server - */ - protected $server; - - /** - * Initializes the plugin - * - * This method is automatically called by the Server class after addPlugin. - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - $server->subscribeEvent('unknownMethod',array($this,'unknownMethod')); - - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() { - - return 'partialupdate'; - - } - - /** - * This method is called by the Server if the user used an HTTP method - * the server didn't recognize. - * - * This plugin intercepts the PATCH methods. - * - * @param string $method - * @param string $uri - * @return bool|null - */ - public function unknownMethod($method, $uri) { - - switch($method) { - - case 'PATCH': - return $this->httpPatch($uri); - - } - - } - - /** - * Use this method to tell the server this plugin defines additional - * HTTP methods. - * - * This method is passed a uri. It should only return HTTP methods that are - * available for the specified uri. - * - * We claim to support PATCH method (partial update) if and only if - * - the node exist - * - the node implements our partial update interface - * - * @param string $uri - * @return array - */ - public function getHTTPMethods($uri) { - - $tree = $this->server->tree; - - if ($tree->nodeExists($uri) && - $tree->getNodeForPath($uri) instanceof IFile) { - return array('PATCH'); - } - - return array(); - - } - - /** - * Returns a list of features for the HTTP OPTIONS Dav: header. - * - * @return array - */ - public function getFeatures() { - - return array('sabredav-partialupdate'); - - } - - /** - * Patch an uri - * - * The WebDAV patch request can be used to modify only a part of an - * existing resource. If the resource does not exist yet and the first - * offset is not 0, the request fails - * - * @param string $uri - * @return void - */ - protected function httpPatch($uri) { - - // Get the node. Will throw a 404 if not found - $node = $this->server->tree->getNodeForPath($uri); - if (!($node instanceof IFile)) { - throw new DAV\Exception\MethodNotAllowed('The target resource does not support the PATCH method.'); - } - - $range = $this->getHTTPUpdateRange(); - - if (!$range) { - throw new DAV\Exception\BadRequest('No valid "X-Update-Range" found in the headers'); - } - - $contentType = strtolower( - $this->server->httpRequest->getHeader('Content-Type') - ); - - if ($contentType != 'application/x-sabredav-partialupdate') { - throw new DAV\Exception\UnsupportedMediaType('Unknown Content-Type header "' . $contentType . '"'); - } - - $len = $this->server->httpRequest->getHeader('Content-Length'); - - // Load the begin and end data - $start = ($range[0])?$range[0]:0; - $end = ($range[1])?$range[1]:$len-1; - - // Check consistency - if($end < $start) - throw new DAV\Exception\RequestedRangeNotSatisfiable('The end offset (' . $range[1] . ') is lower than the start offset (' . $range[0] . ')'); - if($end - $start + 1 != $len) - throw new DAV\Exception\RequestedRangeNotSatisfiable('Actual data length (' . $len . ') is not consistent with begin (' . $range[0] . ') and end (' . $range[1] . ') offsets'); - - // Checking If-None-Match and related headers. - if (!$this->server->checkPreconditions()) return; - - if (!$this->server->broadcastEvent('beforeWriteContent',array($uri, $node, null))) - return; - - $body = $this->server->httpRequest->getBody(); - $etag = $node->putRange($body, $start-1); - - $this->server->broadcastEvent('afterWriteContent',array($uri, $node)); - - $this->server->httpResponse->setHeader('Content-Length','0'); - if ($etag) $this->server->httpResponse->setHeader('ETag',$etag); - $this->server->httpResponse->sendStatus(204); - - return false; - - } - - /** - * Returns the HTTP custom range update header - * - * This method returns null if there is no well-formed HTTP range request - * header or array($start, $end). - * - * The first number is the offset of the first byte in the range. - * The second number is the offset of the last byte in the range. - * - * If the second offset is null, it should be treated as the offset of the last byte of the entity - * If the first offset is null, the second offset should be used to retrieve the last x bytes of the entity - * - * @return array|null - */ - public function getHTTPUpdateRange() { - - $range = $this->server->httpRequest->getHeader('X-Update-Range'); - if (is_null($range)) return null; - - // Matching "Range: bytes=1234-5678: both numbers are optional - - if (!preg_match('/^bytes=([0-9]*)-([0-9]*)$/i',$range,$matches)) return null; - - if ($matches[1]==='' && $matches[2]==='') return null; - - return array( - $matches[1]!==''?$matches[1]:null, - $matches[2]!==''?$matches[2]:null, - ); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php deleted file mode 100644 index 36d4ea6942..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property.php +++ /dev/null @@ -1,31 +0,0 @@ -time = $time; - } elseif (is_int($time) || ctype_digit($time)) { - $this->time = new \DateTime('@' . $time); - } else { - $this->time = new \DateTime($time); - } - - // Setting timezone to UTC - $this->time->setTimezone(new \DateTimeZone('UTC')); - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $prop - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $prop) { - - $doc = $prop->ownerDocument; - //$prop->setAttribute('xmlns:b','urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/'); - //$prop->setAttribute('b:dt','dateTime.rfc1123'); - $prop->nodeValue = HTTP\Util::toHTTPDate($this->time); - - } - - /** - * getTime - * - * @return \DateTime - */ - public function getTime() { - - return $this->time; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Href.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Href.php deleted file mode 100644 index 71dcc244f0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Href.php +++ /dev/null @@ -1,99 +0,0 @@ -href = $href; - $this->autoPrefix = $autoPrefix; - - } - - /** - * Returns the uri - * - * @return string - */ - public function getHref() { - - return $this->href; - - } - - /** - * Serializes this property. - * - * It will additionally prepend the href property with the server's base uri. - * - * @param DAV\Server $server - * @param \DOMElement $dom - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $dom) { - - $prefix = $server->xmlNamespaces['DAV:']; - $elem = $dom->ownerDocument->createElement($prefix . ':href'); - - if ($this->autoPrefix) { - $value = $server->getBaseUri() . DAV\URLUtil::encodePath($this->href); - } else { - $value = $this->href; - } - $elem->appendChild($dom->ownerDocument->createTextNode($value)); - - $dom->appendChild($elem); - - } - - /** - * Unserializes this property from a DOM Element - * - * This method returns an instance of this class. - * It will only decode {DAV:}href values. For non-compatible elements null will be returned. - * - * @param \DOMElement $dom - * @return DAV\Property\Href - */ - static function unserialize(\DOMElement $dom) { - - if ($dom->firstChild && DAV\XMLUtil::toClarkNotation($dom->firstChild)==='{DAV:}href') { - return new self($dom->firstChild->textContent,false); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/HrefList.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/HrefList.php deleted file mode 100644 index 05ba266a27..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/HrefList.php +++ /dev/null @@ -1,105 +0,0 @@ -hrefs = $hrefs; - $this->autoPrefix = $autoPrefix; - - } - - /** - * Returns the uris - * - * @return array - */ - public function getHrefs() { - - return $this->hrefs; - - } - - /** - * Serializes this property. - * - * It will additionally prepend the href property with the server's base uri. - * - * @param DAV\Server $server - * @param \DOMElement $dom - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $dom) { - - $prefix = $server->xmlNamespaces['DAV:']; - - foreach($this->hrefs as $href) { - - $elem = $dom->ownerDocument->createElement($prefix . ':href'); - if ($this->autoPrefix) { - $value = $server->getBaseUri() . DAV\URLUtil::encodePath($href); - } else { - $value = $href; - } - $elem->appendChild($dom->ownerDocument->createTextNode($value)); - - $dom->appendChild($elem); - } - - } - - /** - * Unserializes this property from a DOM Element - * - * This method returns an instance of this class. - * It will only decode {DAV:}href values. - * - * @param \DOMElement $dom - * @return DAV\Property\HrefList - */ - static function unserialize(\DOMElement $dom) { - - $hrefs = array(); - foreach($dom->childNodes as $child) { - if (DAV\XMLUtil::toClarkNotation($child)==='{DAV:}href') { - $hrefs[] = $child->textContent; - } - } - return new self($hrefs, false); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/IHref.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/IHref.php deleted file mode 100644 index d2b4d4d2f4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/IHref.php +++ /dev/null @@ -1,25 +0,0 @@ -locks = $locks; - $this->revealLockToken = $revealLockToken; - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $prop - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $prop) { - - $doc = $prop->ownerDocument; - - foreach($this->locks as $lock) { - - $activeLock = $doc->createElementNS('DAV:','d:activelock'); - $prop->appendChild($activeLock); - - $lockScope = $doc->createElementNS('DAV:','d:lockscope'); - $activeLock->appendChild($lockScope); - - $lockScope->appendChild($doc->createElementNS('DAV:','d:' . ($lock->scope==DAV\Locks\LockInfo::EXCLUSIVE?'exclusive':'shared'))); - - $lockType = $doc->createElementNS('DAV:','d:locktype'); - $activeLock->appendChild($lockType); - - $lockType->appendChild($doc->createElementNS('DAV:','d:write')); - - /* {DAV:}lockroot */ - if (!self::$hideLockRoot) { - $lockRoot = $doc->createElementNS('DAV:','d:lockroot'); - $activeLock->appendChild($lockRoot); - $href = $doc->createElementNS('DAV:','d:href'); - $href->appendChild($doc->createTextNode($server->getBaseUri() . $lock->uri)); - $lockRoot->appendChild($href); - } - - $activeLock->appendChild($doc->createElementNS('DAV:','d:depth',($lock->depth == DAV\Server::DEPTH_INFINITY?'infinity':$lock->depth))); - $activeLock->appendChild($doc->createElementNS('DAV:','d:timeout','Second-' . $lock->timeout)); - - if ($this->revealLockToken) { - $lockToken = $doc->createElementNS('DAV:','d:locktoken'); - $activeLock->appendChild($lockToken); - $lockToken->appendChild($doc->createElementNS('DAV:','d:href','opaquelocktoken:' . $lock->token)); - } - - $activeLock->appendChild($doc->createElementNS('DAV:','d:owner',$lock->owner)); - - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResourceType.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResourceType.php deleted file mode 100644 index 7d12e3132f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResourceType.php +++ /dev/null @@ -1,127 +0,0 @@ -resourceType = array(); - elseif ($resourceType === DAV\Server::NODE_DIRECTORY) - $this->resourceType = array('{DAV:}collection'); - elseif (is_array($resourceType)) - $this->resourceType = $resourceType; - else - $this->resourceType = array($resourceType); - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $prop - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $prop) { - - $propName = null; - $rt = $this->resourceType; - - foreach($rt as $resourceType) { - if (preg_match('/^{([^}]*)}(.*)$/',$resourceType,$propName)) { - - if (isset($server->xmlNamespaces[$propName[1]])) { - $prop->appendChild($prop->ownerDocument->createElement($server->xmlNamespaces[$propName[1]] . ':' . $propName[2])); - } else { - $prop->appendChild($prop->ownerDocument->createElementNS($propName[1],'custom:' . $propName[2])); - } - - } - } - - } - - /** - * Returns the values in clark-notation - * - * For example array('{DAV:}collection') - * - * @return array - */ - public function getValue() { - - return $this->resourceType; - - } - - /** - * Checks if the principal contains a certain value - * - * @param string $type - * @return bool - */ - public function is($type) { - - return in_array($type, $this->resourceType); - - } - - /** - * Adds a resourcetype value to this property - * - * @param string $type - * @return void - */ - public function add($type) { - - $this->resourceType[] = $type; - $this->resourceType = array_unique($this->resourceType); - - } - - /** - * Unserializes a DOM element into a ResourceType property. - * - * @param \DOMElement $dom - * @return DAV\Property\ResourceType - */ - static public function unserialize(\DOMElement $dom) { - - $value = array(); - foreach($dom->childNodes as $child) { - - $value[] = DAV\XMLUtil::toClarkNotation($child); - - } - - return new self($value); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Response.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Response.php deleted file mode 100644 index 151e795d52..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/Response.php +++ /dev/null @@ -1,157 +0,0 @@ -href = $href; - $this->responseProperties = $responseProperties; - - } - - /** - * Returns the url - * - * @return string - */ - public function getHref() { - - return $this->href; - - } - - /** - * Returns the property list - * - * @return array - */ - public function getResponseProperties() { - - return $this->responseProperties; - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $dom - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $dom) { - - $document = $dom->ownerDocument; - $properties = $this->responseProperties; - - $xresponse = $document->createElement('d:response'); - $dom->appendChild($xresponse); - - $uri = DAV\URLUtil::encodePath($this->href); - - // Adding the baseurl to the beginning of the url - $uri = $server->getBaseUri() . $uri; - - $xresponse->appendChild($document->createElement('d:href',$uri)); - - // The properties variable is an array containing properties, grouped by - // HTTP status - foreach($properties as $httpStatus=>$propertyGroup) { - - // The 'href' is also in this array, and it's special cased. - // We will ignore it - if ($httpStatus=='href') continue; - - // If there are no properties in this group, we can also just carry on - if (!count($propertyGroup)) continue; - - $xpropstat = $document->createElement('d:propstat'); - $xresponse->appendChild($xpropstat); - - $xprop = $document->createElement('d:prop'); - $xpropstat->appendChild($xprop); - - $nsList = $server->xmlNamespaces; - - foreach($propertyGroup as $propertyName=>$propertyValue) { - - $propName = null; - preg_match('/^{([^}]*)}(.*)$/',$propertyName,$propName); - - // special case for empty namespaces - if ($propName[1]=='') { - - $currentProperty = $document->createElement($propName[2]); - $xprop->appendChild($currentProperty); - $currentProperty->setAttribute('xmlns',''); - - } else { - - if (!isset($nsList[$propName[1]])) { - $nsList[$propName[1]] = 'x' . count($nsList); - } - - // If the namespace was defined in the top-level xml namespaces, it means - // there was already a namespace declaration, and we don't have to worry about it. - if (isset($server->xmlNamespaces[$propName[1]])) { - $currentProperty = $document->createElement($nsList[$propName[1]] . ':' . $propName[2]); - } else { - $currentProperty = $document->createElementNS($propName[1],$nsList[$propName[1]].':' . $propName[2]); - } - $xprop->appendChild($currentProperty); - - } - - if (is_scalar($propertyValue)) { - $text = $document->createTextNode($propertyValue); - $currentProperty->appendChild($text); - } elseif ($propertyValue instanceof DAV\PropertyInterface) { - $propertyValue->serialize($server,$currentProperty); - } elseif (!is_null($propertyValue)) { - throw new DAV\Exception('Unknown property value type: ' . gettype($propertyValue) . ' for property: ' . $propertyName); - } - - } - - $xpropstat->appendChild($document->createElement('d:status',$server->httpResponse->getStatusMessage($httpStatus))); - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResponseList.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResponseList.php deleted file mode 100644 index 62c4308f51..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/ResponseList.php +++ /dev/null @@ -1,59 +0,0 @@ -responses = $responses; - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $dom - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $dom) { - - foreach($this->responses as $response) { - $response->serialize($server, $dom); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php deleted file mode 100644 index 5ddde64781..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedLock.php +++ /dev/null @@ -1,78 +0,0 @@ -supportsLocks = $supportsLocks; - - } - - /** - * serialize - * - * @param DAV\Server $server - * @param \DOMElement $prop - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $prop) { - - $doc = $prop->ownerDocument; - - if (!$this->supportsLocks) return null; - - $lockEntry1 = $doc->createElement('d:lockentry'); - $lockEntry2 = $doc->createElement('d:lockentry'); - - $prop->appendChild($lockEntry1); - $prop->appendChild($lockEntry2); - - $lockScope1 = $doc->createElement('d:lockscope'); - $lockScope2 = $doc->createElement('d:lockscope'); - $lockType1 = $doc->createElement('d:locktype'); - $lockType2 = $doc->createElement('d:locktype'); - - $lockEntry1->appendChild($lockScope1); - $lockEntry1->appendChild($lockType1); - $lockEntry2->appendChild($lockScope2); - $lockEntry2->appendChild($lockType2); - - $lockScope1->appendChild($doc->createElement('d:exclusive')); - $lockScope2->appendChild($doc->createElement('d:shared')); - - $lockType1->appendChild($doc->createElement('d:write')); - $lockType2->appendChild($doc->createElement('d:write')); - - //$frag->appendXML(''); - //$frag->appendXML(''); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedReportSet.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedReportSet.php deleted file mode 100644 index d0273e46cb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Property/SupportedReportSet.php +++ /dev/null @@ -1,111 +0,0 @@ -addReport($reports); - - } - - /** - * Adds a report to this property - * - * The report must be a string in clark-notation. - * Multiple reports can be specified as an array. - * - * @param mixed $report - * @return void - */ - public function addReport($report) { - - if (!is_array($report)) $report = array($report); - - foreach($report as $r) { - - if (!preg_match('/^{([^}]*)}(.*)$/',$r)) - throw new DAV\Exception('Reportname must be in clark-notation'); - - $this->reports[] = $r; - - } - - } - - /** - * Returns the list of supported reports - * - * @return array - */ - public function getValue() { - - return $this->reports; - - } - - /** - * Serializes the node - * - * @param DAV\Server $server - * @param \DOMElement $prop - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $prop) { - - foreach($this->reports as $reportName) { - - $supportedReport = $prop->ownerDocument->createElement('d:supported-report'); - $prop->appendChild($supportedReport); - - $report = $prop->ownerDocument->createElement('d:report'); - $supportedReport->appendChild($report); - - preg_match('/^{([^}]*)}(.*)$/',$reportName,$matches); - - list(, $namespace, $element) = $matches; - - $prefix = isset($server->xmlNamespaces[$namespace])?$server->xmlNamespaces[$namespace]:null; - - if ($prefix) { - $report->appendChild($prop->ownerDocument->createElement($prefix . ':' . $element)); - } else { - $report->appendChild($prop->ownerDocument->createElementNS($namespace, 'x:' . $element)); - } - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PropertyInterface.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PropertyInterface.php deleted file mode 100644 index fe0c016ea2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/PropertyInterface.php +++ /dev/null @@ -1,21 +0,0 @@ - 'd', - 'http://sabredav.org/ns' => 's', - ); - - /** - * The propertymap can be used to map properties from - * requests to property classes. - * - * @var array - */ - public $propertyMap = array( - '{DAV:}resourcetype' => 'SabreForRainLoop\\DAV\\Property\\ResourceType', - ); - - public $protectedProperties = array( - // RFC4918 - '{DAV:}getcontentlength', - '{DAV:}getetag', - '{DAV:}getlastmodified', - '{DAV:}lockdiscovery', - '{DAV:}supportedlock', - - // RFC4331 - '{DAV:}quota-available-bytes', - '{DAV:}quota-used-bytes', - - // RFC3744 - '{DAV:}supported-privilege-set', - '{DAV:}current-user-privilege-set', - '{DAV:}acl', - '{DAV:}acl-restrictions', - '{DAV:}inherited-acl-set', - - ); - - /** - * This is a flag that allow or not showing file, line and code - * of the exception in the returned XML - * - * @var bool - */ - public $debugExceptions = false; - - /** - * This property allows you to automatically add the 'resourcetype' value - * based on a node's classname or interface. - * - * The preset ensures that {DAV:}collection is automaticlly added for nodes - * implementing SabreForRainLoop\DAV\ICollection. - * - * @var array - */ - public $resourceTypeMapping = array( - 'SabreForRainLoop\\DAV\\ICollection' => '{DAV:}collection', - ); - - /** - * If this setting is turned off, SabreDAV's version number will be hidden - * from various places. - * - * Some people feel this is a good security measure. - * - * @var bool - */ - static public $exposeVersion = true; - - /** - * Sets up the server - * - * If a SabreForRainLoop\DAV\Tree object is passed as an argument, it will - * use it as the directory tree. If a SabreForRainLoop\DAV\INode is passed, it - * will create a SabreForRainLoop\DAV\ObjectTree and use the node as the root. - * - * If nothing is passed, a SabreForRainLoop\DAV\SimpleCollection is created in - * a SabreForRainLoop\DAV\ObjectTree. - * - * If an array is passed, we automatically create a root node, and use - * the nodes in the array as top-level children. - * - * @param Tree|INode|array|null $treeOrNode The tree object - */ - public function __construct($treeOrNode = null) { - - if ($treeOrNode instanceof Tree) { - $this->tree = $treeOrNode; - } elseif ($treeOrNode instanceof INode) { - $this->tree = new ObjectTree($treeOrNode); - } elseif (is_array($treeOrNode)) { - - // If it's an array, a list of nodes was passed, and we need to - // create the root node. - foreach($treeOrNode as $node) { - if (!($node instanceof INode)) { - throw new Exception('Invalid argument passed to constructor. If you\'re passing an array, all the values must implement SabreForRainLoop\\DAV\\INode'); - } - } - - $root = new SimpleCollection('root', $treeOrNode); - $this->tree = new ObjectTree($root); - - } elseif (is_null($treeOrNode)) { - $root = new SimpleCollection('root'); - $this->tree = new ObjectTree($root); - } else { - throw new Exception('Invalid argument passed to constructor. Argument must either be an instance of SabreForRainLoop\\DAV\\Tree, SabreForRainLoop\\DAV\\INode, an array or null'); - } - $this->httpResponse = new HTTP\Response(); - $this->httpRequest = new HTTP\Request(); - - } - - /** - * Starts the DAV Server - * - * @return void - */ - public function exec() { - - try { - - // If nginx (pre-1.2) is used as a proxy server, and SabreDAV as an - // origin, we must make sure we send back HTTP/1.0 if this was - // requested. - // This is mainly because nginx doesn't support Chunked Transfer - // Encoding, and this forces the webserver SabreDAV is running on, - // to buffer entire responses to calculate Content-Length. - $this->httpResponse->defaultHttpVersion = $this->httpRequest->getHTTPVersion(); - - $this->invokeMethod($this->httpRequest->getMethod(), $this->getRequestUri()); - - } catch (Exception $e) { - - try { - $this->broadcastEvent('exception', array($e)); - } catch (Exception $ignore) { - } - $DOM = new \DOMDocument('1.0','utf-8'); - $DOM->formatOutput = true; - - $error = $DOM->createElementNS('DAV:','d:error'); - $error->setAttribute('xmlns:s',self::NS_SABREDAV); - $DOM->appendChild($error); - - $h = function($v) { - - return htmlspecialchars($v, ENT_NOQUOTES, 'UTF-8'); - - }; - - $error->appendChild($DOM->createElement('s:exception',$h(get_class($e)))); - $error->appendChild($DOM->createElement('s:message',$h($e->getMessage()))); - if ($this->debugExceptions) { - $error->appendChild($DOM->createElement('s:file',$h($e->getFile()))); - $error->appendChild($DOM->createElement('s:line',$h($e->getLine()))); - $error->appendChild($DOM->createElement('s:code',$h($e->getCode()))); - $error->appendChild($DOM->createElement('s:stacktrace',$h($e->getTraceAsString()))); - - } - if (self::$exposeVersion) { - $error->appendChild($DOM->createElement('s:sabredav-version',$h(Version::VERSION))); - } - - if($e instanceof Exception) { - - $httpCode = $e->getHTTPCode(); - $e->serialize($this,$error); - $headers = $e->getHTTPHeaders($this); - - } else { - - $httpCode = 500; - $headers = array(); - - } - $headers['Content-Type'] = 'application/xml; charset=utf-8'; - - $this->httpResponse->sendStatus($httpCode); - $this->httpResponse->setHeaders($headers); - $this->httpResponse->sendBody($DOM->saveXML()); - - } - - } - - /** - * Sets the base server uri - * - * @param string $uri - * @return void - */ - public function setBaseUri($uri) { - - // If the baseUri does not end with a slash, we must add it - if ($uri[strlen($uri)-1]!=='/') - $uri.='/'; - - $this->baseUri = $uri; - - } - - /** - * Returns the base responding uri - * - * @return string - */ - public function getBaseUri() { - - if (is_null($this->baseUri)) $this->baseUri = $this->guessBaseUri(); - return $this->baseUri; - - } - - /** - * This method attempts to detect the base uri. - * Only the PATH_INFO variable is considered. - * - * If this variable is not set, the root (/) is assumed. - * - * @return string - */ - public function guessBaseUri() { - - $pathInfo = $this->httpRequest->getRawServerValue('PATH_INFO'); - $uri = $this->httpRequest->getRawServerValue('REQUEST_URI'); - - // If PATH_INFO is found, we can assume it's accurate. - if (!empty($pathInfo)) { - - // We need to make sure we ignore the QUERY_STRING part - if ($pos = strpos($uri,'?')) - $uri = substr($uri,0,$pos); - - // PATH_INFO is only set for urls, such as: /example.php/path - // in that case PATH_INFO contains '/path'. - // Note that REQUEST_URI is percent encoded, while PATH_INFO is - // not, Therefore they are only comparable if we first decode - // REQUEST_INFO as well. - $decodedUri = URLUtil::decodePath($uri); - - // A simple sanity check: - if(substr($decodedUri,strlen($decodedUri)-strlen($pathInfo))===$pathInfo) { - $baseUri = substr($decodedUri,0,strlen($decodedUri)-strlen($pathInfo)); - return rtrim($baseUri,'/') . '/'; - } - - throw new Exception('The REQUEST_URI ('. $uri . ') did not end with the contents of PATH_INFO (' . $pathInfo . '). This server might be misconfigured.'); - - } - - // The last fallback is that we're just going to assume the server root. - return '/'; - - } - - /** - * Adds a plugin to the server - * - * For more information, console the documentation of SabreForRainLoop\DAV\ServerPlugin - * - * @param ServerPlugin $plugin - * @return void - */ - public function addPlugin(ServerPlugin $plugin) { - - $this->plugins[$plugin->getPluginName()] = $plugin; - $plugin->initialize($this); - - } - - /** - * Returns an initialized plugin by it's name. - * - * This function returns null if the plugin was not found. - * - * @param string $name - * @return ServerPlugin - */ - public function getPlugin($name) { - - if (isset($this->plugins[$name])) - return $this->plugins[$name]; - - // This is a fallback and deprecated. - foreach($this->plugins as $plugin) { - if (get_class($plugin)===$name) return $plugin; - } - - return null; - - } - - /** - * Returns all plugins - * - * @return array - */ - public function getPlugins() { - - return $this->plugins; - - } - - - /** - * Subscribe to an event. - * - * When the event is triggered, we'll call all the specified callbacks. - * It is possible to control the order of the callbacks through the - * priority argument. - * - * This is for example used to make sure that the authentication plugin - * is triggered before anything else. If it's not needed to change this - * number, it is recommended to ommit. - * - * @param string $event - * @param callback $callback - * @param int $priority - * @return void - */ - public function subscribeEvent($event, $callback, $priority = 100) { - - if (!isset($this->eventSubscriptions[$event])) { - $this->eventSubscriptions[$event] = array(); - } - while(isset($this->eventSubscriptions[$event][$priority])) $priority++; - $this->eventSubscriptions[$event][$priority] = $callback; - ksort($this->eventSubscriptions[$event]); - - } - - /** - * Broadcasts an event - * - * This method will call all subscribers. If one of the subscribers returns false, the process stops. - * - * The arguments parameter will be sent to all subscribers - * - * @param string $eventName - * @param array $arguments - * @return bool - */ - public function broadcastEvent($eventName,$arguments = array()) { - - if (isset($this->eventSubscriptions[$eventName])) { - - foreach($this->eventSubscriptions[$eventName] as $subscriber) { - - $result = call_user_func_array($subscriber,$arguments); - if ($result===false) return false; - - } - - } - - return true; - - } - - /** - * Handles a http request, and execute a method based on its name - * - * @param string $method - * @param string $uri - * @return void - */ - public function invokeMethod($method, $uri) { - - $method = strtoupper($method); - - if (!$this->broadcastEvent('beforeMethod',array($method, $uri))) return; - - // Make sure this is a HTTP method we support - $internalMethods = array( - 'OPTIONS', - 'GET', - 'HEAD', - 'DELETE', - 'PROPFIND', - 'MKCOL', - 'PUT', - 'PROPPATCH', - 'COPY', - 'MOVE', - 'REPORT' - ); - - if (in_array($method,$internalMethods)) { - - call_user_func(array($this,'http' . $method), $uri); - - } else { - - if ($this->broadcastEvent('unknownMethod',array($method, $uri))) { - // Unsupported method - throw new Exception\NotImplemented('There was no handler found for this "' . $method . '" method'); - } - - } - - } - - // {{{ HTTP Method implementations - - /** - * HTTP OPTIONS - * - * @param string $uri - * @return void - */ - protected function httpOptions($uri) { - - $methods = $this->getAllowedMethods($uri); - - $this->httpResponse->setHeader('Allow',strtoupper(implode(', ',$methods))); - $features = array('1','3', 'extended-mkcol'); - - foreach($this->plugins as $plugin) $features = array_merge($features,$plugin->getFeatures()); - - $this->httpResponse->setHeader('DAV',implode(', ',$features)); - $this->httpResponse->setHeader('MS-Author-Via','DAV'); - $this->httpResponse->setHeader('Accept-Ranges','bytes'); - if (self::$exposeVersion) { - $this->httpResponse->setHeader('X-Sabre-Version',Version::VERSION); - } - $this->httpResponse->setHeader('Content-Length',0); - $this->httpResponse->sendStatus(200); - - } - - /** - * HTTP GET - * - * This method simply fetches the contents of a uri, like normal - * - * @param string $uri - * @return bool - */ - protected function httpGet($uri) { - - $node = $this->tree->getNodeForPath($uri,0); - - if (!$this->checkPreconditions(true)) return false; - if (!$node instanceof IFile) throw new Exception\NotImplemented('GET is only implemented on File objects'); - - $body = $node->get(); - - // Converting string into stream, if needed. - if (is_string($body)) { - $stream = fopen('php://temp','r+'); - fwrite($stream,$body); - rewind($stream); - $body = $stream; - } - - /* - * TODO: getetag, getlastmodified, getsize should also be used using - * this method - */ - $httpHeaders = $this->getHTTPHeaders($uri); - - /* ContentType needs to get a default, because many webservers will otherwise - * default to text/html, and we don't want this for security reasons. - */ - if (!isset($httpHeaders['Content-Type'])) { - $httpHeaders['Content-Type'] = 'application/octet-stream'; - } - - - if (isset($httpHeaders['Content-Length'])) { - - $nodeSize = $httpHeaders['Content-Length']; - - // Need to unset Content-Length, because we'll handle that during figuring out the range - unset($httpHeaders['Content-Length']); - - } else { - $nodeSize = null; - } - - $this->httpResponse->setHeaders($httpHeaders); - - $range = $this->getHTTPRange(); - $ifRange = $this->httpRequest->getHeader('If-Range'); - $ignoreRangeHeader = false; - - // If ifRange is set, and range is specified, we first need to check - // the precondition. - if ($nodeSize && $range && $ifRange) { - - // if IfRange is parsable as a date we'll treat it as a DateTime - // otherwise, we must treat it as an etag. - try { - $ifRangeDate = new \DateTime($ifRange); - - // It's a date. We must check if the entity is modified since - // the specified date. - if (!isset($httpHeaders['Last-Modified'])) $ignoreRangeHeader = true; - else { - $modified = new \DateTime($httpHeaders['Last-Modified']); - if($modified > $ifRangeDate) $ignoreRangeHeader = true; - } - - } catch (\Exception $e) { - - // It's an entity. We can do a simple comparison. - if (!isset($httpHeaders['ETag'])) $ignoreRangeHeader = true; - elseif ($httpHeaders['ETag']!==$ifRange) $ignoreRangeHeader = true; - } - } - - // We're only going to support HTTP ranges if the backend provided a filesize - if (!$ignoreRangeHeader && $nodeSize && $range) { - - // Determining the exact byte offsets - if (!is_null($range[0])) { - - $start = $range[0]; - $end = $range[1]?$range[1]:$nodeSize-1; - if($start >= $nodeSize) - throw new Exception\RequestedRangeNotSatisfiable('The start offset (' . $range[0] . ') exceeded the size of the entity (' . $nodeSize . ')'); - - if($end < $start) throw new Exception\RequestedRangeNotSatisfiable('The end offset (' . $range[1] . ') is lower than the start offset (' . $range[0] . ')'); - if($end >= $nodeSize) $end = $nodeSize-1; - - } else { - - $start = $nodeSize-$range[1]; - $end = $nodeSize-1; - - if ($start<0) $start = 0; - - } - - // New read/write stream - $newStream = fopen('php://temp','r+'); - - // stream_copy_to_stream() has a bug/feature: the `whence` argument - // is interpreted as SEEK_SET (count from absolute offset 0), while - // for a stream it should be SEEK_CUR (count from current offset). - // If a stream is nonseekable, the function fails. So we *emulate* - // the correct behaviour with fseek(): - if ($start > 0) { - if (($curOffs = ftell($body)) === false) $curOffs = 0; - fseek($body, $start - $curOffs, SEEK_CUR); - } - stream_copy_to_stream($body, $newStream, $end-$start+1); - rewind($newStream); - - $this->httpResponse->setHeader('Content-Length', $end-$start+1); - $this->httpResponse->setHeader('Content-Range','bytes ' . $start . '-' . $end . '/' . $nodeSize); - $this->httpResponse->sendStatus(206); - $this->httpResponse->sendBody($newStream); - - - } else { - - if ($nodeSize) $this->httpResponse->setHeader('Content-Length',$nodeSize); - $this->httpResponse->sendStatus(200); - $this->httpResponse->sendBody($body); - - } - - } - - /** - * HTTP HEAD - * - * This method is normally used to take a peak at a url, and only get the HTTP response headers, without the body - * This is used by clients to determine if a remote file was changed, so they can use a local cached version, instead of downloading it again - * - * @param string $uri - * @return void - */ - protected function httpHead($uri) { - - $node = $this->tree->getNodeForPath($uri); - /* This information is only collection for File objects. - * Ideally we want to throw 405 Method Not Allowed for every - * non-file, but MS Office does not like this - */ - if ($node instanceof IFile) { - $headers = $this->getHTTPHeaders($this->getRequestUri()); - if (!isset($headers['Content-Type'])) { - $headers['Content-Type'] = 'application/octet-stream'; - } - $this->httpResponse->setHeaders($headers); - } - $this->httpResponse->sendStatus(200); - - } - - /** - * HTTP Delete - * - * The HTTP delete method, deletes a given uri - * - * @param string $uri - * @return void - */ - protected function httpDelete($uri) { - - if (!$this->broadcastEvent('beforeUnbind',array($uri))) return; - $this->tree->delete($uri); - $this->broadcastEvent('afterUnbind',array($uri)); - - $this->httpResponse->sendStatus(204); - $this->httpResponse->setHeader('Content-Length','0'); - - } - - - /** - * WebDAV PROPFIND - * - * This WebDAV method requests information about an uri resource, or a list of resources - * If a client wants to receive the properties for a single resource it will add an HTTP Depth: header with a 0 value - * If the value is 1, it means that it also expects a list of sub-resources (e.g.: files in a directory) - * - * The request body contains an XML data structure that has a list of properties the client understands - * The response body is also an xml document, containing information about every uri resource and the requested properties - * - * It has to return a HTTP 207 Multi-status status code - * - * @param string $uri - * @return void - */ - protected function httpPropfind($uri) { - - $requestedProperties = $this->parsePropFindRequest($this->httpRequest->getBody(true)); - - $depth = $this->getHTTPDepth(1); - // The only two options for the depth of a propfind is 0 or 1 - if ($depth!=0) $depth = 1; - - $newProperties = $this->getPropertiesForPath($uri,$requestedProperties,$depth); - - // This is a multi-status response - $this->httpResponse->sendStatus(207); - $this->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->httpResponse->setHeader('Vary','Brief,Prefer'); - - // Normally this header is only needed for OPTIONS responses, however.. - // iCal seems to also depend on these being set for PROPFIND. Since - // this is not harmful, we'll add it. - $features = array('1','3', 'extended-mkcol'); - foreach($this->plugins as $plugin) $features = array_merge($features,$plugin->getFeatures()); - $this->httpResponse->setHeader('DAV',implode(', ',$features)); - - $prefer = $this->getHTTPPrefer(); - $minimal = $prefer['return-minimal']; - - $data = $this->generateMultiStatus($newProperties, $minimal); - $this->httpResponse->sendBody($data); - - } - - /** - * WebDAV PROPPATCH - * - * This method is called to update properties on a Node. The request is an XML body with all the mutations. - * In this XML body it is specified which properties should be set/updated and/or deleted - * - * @param string $uri - * @return void - */ - protected function httpPropPatch($uri) { - - $newProperties = $this->parsePropPatchRequest($this->httpRequest->getBody(true)); - - $result = $this->updateProperties($uri, $newProperties); - - $prefer = $this->getHTTPPrefer(); - $this->httpResponse->setHeader('Vary','Brief,Prefer'); - - if ($prefer['return-minimal']) { - - // If return-minimal is specified, we only have to check if the - // request was succesful, and don't need to return the - // multi-status. - $ok = true; - foreach($result as $code=>$prop) { - if ((int)$code > 299) { - $ok = false; - } - } - - if ($ok) { - - $this->httpResponse->sendStatus(204); - return; - - } - - } - - $this->httpResponse->sendStatus(207); - $this->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - - $this->httpResponse->sendBody( - $this->generateMultiStatus(array($result)) - ); - - } - - /** - * HTTP PUT method - * - * This HTTP method updates a file, or creates a new one. - * - * If a new resource was created, a 201 Created status code should be returned. If an existing resource is updated, it's a 204 No Content - * - * @param string $uri - * @return bool - */ - protected function httpPut($uri) { - - $body = $this->httpRequest->getBody(); - - // Intercepting Content-Range - if ($this->httpRequest->getHeader('Content-Range')) { - /** - Content-Range is dangerous for PUT requests: PUT per definition - stores a full resource. draft-ietf-httpbis-p2-semantics-15 says - in section 7.6: - An origin server SHOULD reject any PUT request that contains a - Content-Range header field, since it might be misinterpreted as - partial content (or might be partial content that is being mistakenly - PUT as a full representation). Partial content updates are possible - by targeting a separately identified resource with state that - overlaps a portion of the larger resource, or by using a different - method that has been specifically defined for partial updates (for - example, the PATCH method defined in [RFC5789]). - This clarifies RFC2616 section 9.6: - The recipient of the entity MUST NOT ignore any Content-* - (e.g. Content-Range) headers that it does not understand or implement - and MUST return a 501 (Not Implemented) response in such cases. - OTOH is a PUT request with a Content-Range currently the only way to - continue an aborted upload request and is supported by curl, mod_dav, - Tomcat and others. Since some clients do use this feature which results - in unexpected behaviour (cf PEAR::HTTP_WebDAV_Client 1.0.1), we reject - all PUT requests with a Content-Range for now. - */ - - throw new Exception\NotImplemented('PUT with Content-Range is not allowed.'); - } - - // Intercepting the Finder problem - if (($expected = $this->httpRequest->getHeader('X-Expected-Entity-Length')) && $expected > 0) { - - /** - Many webservers will not cooperate well with Finder PUT requests, - because it uses 'Chunked' transfer encoding for the request body. - - The symptom of this problem is that Finder sends files to the - server, but they arrive as 0-length files in PHP. - - If we don't do anything, the user might think they are uploading - files successfully, but they end up empty on the server. Instead, - we throw back an error if we detect this. - - The reason Finder uses Chunked, is because it thinks the files - might change as it's being uploaded, and therefore the - Content-Length can vary. - - Instead it sends the X-Expected-Entity-Length header with the size - of the file at the very start of the request. If this header is set, - but we don't get a request body we will fail the request to - protect the end-user. - */ - - // Only reading first byte - $firstByte = fread($body,1); - if (strlen($firstByte)!==1) { - throw new Exception\Forbidden('This server is not compatible with OS/X finder. Consider using a different WebDAV client or webserver.'); - } - - // The body needs to stay intact, so we copy everything to a - // temporary stream. - - $newBody = fopen('php://temp','r+'); - fwrite($newBody,$firstByte); - stream_copy_to_stream($body, $newBody); - rewind($newBody); - - $body = $newBody; - - } - - if ($this->tree->nodeExists($uri)) { - - $node = $this->tree->getNodeForPath($uri); - - // Checking If-None-Match and related headers. - if (!$this->checkPreconditions()) return; - - // If the node is a collection, we'll deny it - if (!($node instanceof IFile)) throw new Exception\Conflict('PUT is not allowed on non-files.'); - if (!$this->broadcastEvent('beforeWriteContent',array($uri, $node, &$body))) return false; - - $etag = $node->put($body); - - $this->broadcastEvent('afterWriteContent',array($uri, $node)); - - $this->httpResponse->setHeader('Content-Length','0'); - if ($etag) $this->httpResponse->setHeader('ETag',$etag); - $this->httpResponse->sendStatus(204); - - } else { - - $etag = null; - // If we got here, the resource didn't exist yet. - if (!$this->createFile($this->getRequestUri(),$body,$etag)) { - // For one reason or another the file was not created. - return; - } - - $this->httpResponse->setHeader('Content-Length','0'); - if ($etag) $this->httpResponse->setHeader('ETag', $etag); - $this->httpResponse->sendStatus(201); - - } - - } - - - /** - * WebDAV MKCOL - * - * The MKCOL method is used to create a new collection (directory) on the server - * - * @param string $uri - * @return void - */ - protected function httpMkcol($uri) { - - $requestBody = $this->httpRequest->getBody(true); - - if ($requestBody) { - - $contentType = $this->httpRequest->getHeader('Content-Type'); - if (strpos($contentType,'application/xml')!==0 && strpos($contentType,'text/xml')!==0) { - - // We must throw 415 for unsupported mkcol bodies - throw new Exception\UnsupportedMediaType('The request body for the MKCOL request must have an xml Content-Type'); - - } - - $dom = XMLUtil::loadDOMDocument($requestBody); - if (XMLUtil::toClarkNotation($dom->firstChild)!=='{DAV:}mkcol') { - - // We must throw 415 for unsupported mkcol bodies - throw new Exception\UnsupportedMediaType('The request body for the MKCOL request must be a {DAV:}mkcol request construct.'); - - } - - $properties = array(); - foreach($dom->firstChild->childNodes as $childNode) { - - if (XMLUtil::toClarkNotation($childNode)!=='{DAV:}set') continue; - $properties = array_merge($properties, XMLUtil::parseProperties($childNode, $this->propertyMap)); - - } - if (!isset($properties['{DAV:}resourcetype'])) - throw new Exception\BadRequest('The mkcol request must include a {DAV:}resourcetype property'); - - $resourceType = $properties['{DAV:}resourcetype']->getValue(); - unset($properties['{DAV:}resourcetype']); - - } else { - - $properties = array(); - $resourceType = array('{DAV:}collection'); - - } - - $result = $this->createCollection($uri, $resourceType, $properties); - - if (is_array($result)) { - $this->httpResponse->sendStatus(207); - $this->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - - $this->httpResponse->sendBody( - $this->generateMultiStatus(array($result)) - ); - - } else { - $this->httpResponse->setHeader('Content-Length','0'); - $this->httpResponse->sendStatus(201); - } - - } - - /** - * WebDAV HTTP MOVE method - * - * This method moves one uri to a different uri. A lot of the actual request processing is done in getCopyMoveInfo - * - * @param string $uri - * @return bool - */ - protected function httpMove($uri) { - - $moveInfo = $this->getCopyAndMoveInfo(); - - // If the destination is part of the source tree, we must fail - if ($moveInfo['destination']==$uri) - throw new Exception\Forbidden('Source and destination uri are identical.'); - - if ($moveInfo['destinationExists']) { - - if (!$this->broadcastEvent('beforeUnbind',array($moveInfo['destination']))) return false; - $this->tree->delete($moveInfo['destination']); - $this->broadcastEvent('afterUnbind',array($moveInfo['destination'])); - - } - - if (!$this->broadcastEvent('beforeUnbind',array($uri))) return false; - if (!$this->broadcastEvent('beforeBind',array($moveInfo['destination']))) return false; - $this->tree->move($uri,$moveInfo['destination']); - $this->broadcastEvent('afterUnbind',array($uri)); - $this->broadcastEvent('afterBind',array($moveInfo['destination'])); - - // If a resource was overwritten we should send a 204, otherwise a 201 - $this->httpResponse->setHeader('Content-Length','0'); - $this->httpResponse->sendStatus($moveInfo['destinationExists']?204:201); - - } - - /** - * WebDAV HTTP COPY method - * - * This method copies one uri to a different uri, and works much like the MOVE request - * A lot of the actual request processing is done in getCopyMoveInfo - * - * @param string $uri - * @return bool - */ - protected function httpCopy($uri) { - - $copyInfo = $this->getCopyAndMoveInfo(); - // If the destination is part of the source tree, we must fail - if ($copyInfo['destination']==$uri) - throw new Exception\Forbidden('Source and destination uri are identical.'); - - if ($copyInfo['destinationExists']) { - if (!$this->broadcastEvent('beforeUnbind',array($copyInfo['destination']))) return false; - $this->tree->delete($copyInfo['destination']); - - } - if (!$this->broadcastEvent('beforeBind',array($copyInfo['destination']))) return false; - $this->tree->copy($uri,$copyInfo['destination']); - $this->broadcastEvent('afterBind',array($copyInfo['destination'])); - - // If a resource was overwritten we should send a 204, otherwise a 201 - $this->httpResponse->setHeader('Content-Length','0'); - $this->httpResponse->sendStatus($copyInfo['destinationExists']?204:201); - - } - - - - /** - * HTTP REPORT method implementation - * - * Although the REPORT method is not part of the standard WebDAV spec (it's from rfc3253) - * It's used in a lot of extensions, so it made sense to implement it into the core. - * - * @param string $uri - * @return void - */ - protected function httpReport($uri) { - - $body = $this->httpRequest->getBody(true); - $dom = XMLUtil::loadDOMDocument($body); - - $reportName = XMLUtil::toClarkNotation($dom->firstChild); - - if ($this->broadcastEvent('report',array($reportName,$dom, $uri))) { - - // If broadcastEvent returned true, it means the report was not supported - throw new Exception\ReportNotSupported(); - - } - - } - - // }}} - // {{{ HTTP/WebDAV protocol helpers - - /** - * Returns an array with all the supported HTTP methods for a specific uri. - * - * @param string $uri - * @return array - */ - public function getAllowedMethods($uri) { - - $methods = array( - 'OPTIONS', - 'GET', - 'HEAD', - 'DELETE', - 'PROPFIND', - 'PUT', - 'PROPPATCH', - 'COPY', - 'MOVE', - 'REPORT' - ); - - // The MKCOL is only allowed on an unmapped uri - try { - $this->tree->getNodeForPath($uri); - } catch (Exception\NotFound $e) { - $methods[] = 'MKCOL'; - } - - // We're also checking if any of the plugins register any new methods - foreach($this->plugins as $plugin) $methods = array_merge($methods, $plugin->getHTTPMethods($uri)); - array_unique($methods); - - return $methods; - - } - - /** - * Gets the uri for the request, keeping the base uri into consideration - * - * @return string - */ - public function getRequestUri() { - - return $this->calculateUri($this->httpRequest->getUri()); - - } - - /** - * Calculates the uri for a request, making sure that the base uri is stripped out - * - * @param string $uri - * @throws Exception\Forbidden A permission denied exception is thrown whenever there was an attempt to supply a uri outside of the base uri - * @return string - */ - public function calculateUri($uri) { - - if ($uri[0]!='/' && strpos($uri,'://')) { - - $uri = parse_url($uri,PHP_URL_PATH); - - } - - $uri = str_replace('//','/',$uri); - - if (strpos($uri,$this->getBaseUri())===0) { - - return trim(URLUtil::decodePath(substr($uri,strlen($this->getBaseUri()))),'/'); - - // A special case, if the baseUri was accessed without a trailing - // slash, we'll accept it as well. - } elseif ($uri.'/' === $this->getBaseUri()) { - - return ''; - - } else { - - throw new Exception\Forbidden('Requested uri (' . $uri . ') is out of base uri (' . $this->getBaseUri() . ')'); - - } - - } - - /** - * Returns the HTTP depth header - * - * This method returns the contents of the HTTP depth request header. If the depth header was 'infinity' it will return the SabreForRainLoop\DAV\Server::DEPTH_INFINITY object - * It is possible to supply a default depth value, which is used when the depth header has invalid content, or is completely non-existent - * - * @param mixed $default - * @return int - */ - public function getHTTPDepth($default = self::DEPTH_INFINITY) { - - // If its not set, we'll grab the default - $depth = $this->httpRequest->getHeader('Depth'); - - if (is_null($depth)) return $default; - - if ($depth == 'infinity') return self::DEPTH_INFINITY; - - - // If its an unknown value. we'll grab the default - if (!ctype_digit($depth)) return $default; - - return (int)$depth; - - } - - /** - * Returns the HTTP range header - * - * This method returns null if there is no well-formed HTTP range request - * header or array($start, $end). - * - * The first number is the offset of the first byte in the range. - * The second number is the offset of the last byte in the range. - * - * If the second offset is null, it should be treated as the offset of the last byte of the entity - * If the first offset is null, the second offset should be used to retrieve the last x bytes of the entity - * - * @return array|null - */ - public function getHTTPRange() { - - $range = $this->httpRequest->getHeader('range'); - if (is_null($range)) return null; - - // Matching "Range: bytes=1234-5678: both numbers are optional - - if (!preg_match('/^bytes=([0-9]*)-([0-9]*)$/i',$range,$matches)) return null; - - if ($matches[1]==='' && $matches[2]==='') return null; - - return array( - $matches[1]!==''?$matches[1]:null, - $matches[2]!==''?$matches[2]:null, - ); - - } - - /** - * Returns the HTTP Prefer header information. - * - * The prefer header is defined in: - * http://tools.ietf.org/html/draft-snell-http-prefer-14 - * - * This method will return an array with options. - * - * Currently, the following options may be returned: - * array( - * 'return-asynch' => true, - * 'return-minimal' => true, - * 'return-representation' => true, - * 'wait' => 30, - * 'strict' => true, - * 'lenient' => true, - * ) - * - * This method also supports the Brief header, and will also return - * 'return-minimal' if the brief header was set to 't'. - * - * For the boolean options, false will be returned if the headers are not - * specified. For the integer options it will be 'null'. - * - * @return array - */ - public function getHTTPPrefer() { - - $result = array( - 'return-asynch' => false, - 'return-minimal' => false, - 'return-representation' => false, - 'wait' => null, - 'strict' => false, - 'lenient' => false, - ); - - if ($prefer = $this->httpRequest->getHeader('Prefer')) { - - $parameters = array_map('trim', - explode(',', $prefer) - ); - - foreach($parameters as $parameter) { - - // Right now our regex only supports the tokens actually - // specified in the draft. We may need to expand this if new - // tokens get registered. - if(!preg_match('/^(?P[a-z0-9-]+)(?:=(?P[0-9]+))?$/', $parameter, $matches)) { - continue; - } - - switch($matches['token']) { - - case 'return-asynch' : - case 'return-minimal' : - case 'return-representation' : - case 'strict' : - case 'lenient' : - $result[$matches['token']] = true; - break; - case 'wait' : - $result[$matches['token']] = $matches['value']; - break; - - } - - } - - } - - if ($this->httpRequest->getHeader('Brief')=='t') { - $result['return-minimal'] = true; - } - - return $result; - - } - - - /** - * Returns information about Copy and Move requests - * - * This function is created to help getting information about the source and the destination for the - * WebDAV MOVE and COPY HTTP request. It also validates a lot of information and throws proper exceptions - * - * The returned value is an array with the following keys: - * * destination - Destination path - * * destinationExists - Whether or not the destination is an existing url (and should therefore be overwritten) - * - * @return array - */ - public function getCopyAndMoveInfo() { - - // Collecting the relevant HTTP headers - if (!$this->httpRequest->getHeader('Destination')) throw new Exception\BadRequest('The destination header was not supplied'); - $destination = $this->calculateUri($this->httpRequest->getHeader('Destination')); - $overwrite = $this->httpRequest->getHeader('Overwrite'); - if (!$overwrite) $overwrite = 'T'; - if (strtoupper($overwrite)=='T') $overwrite = true; - elseif (strtoupper($overwrite)=='F') $overwrite = false; - // We need to throw a bad request exception, if the header was invalid - else throw new Exception\BadRequest('The HTTP Overwrite header should be either T or F'); - - list($destinationDir) = URLUtil::splitPath($destination); - - try { - $destinationParent = $this->tree->getNodeForPath($destinationDir); - if (!($destinationParent instanceof ICollection)) throw new Exception\UnsupportedMediaType('The destination node is not a collection'); - } catch (Exception\NotFound $e) { - - // If the destination parent node is not found, we throw a 409 - throw new Exception\Conflict('The destination node is not found'); - } - - try { - - $destinationNode = $this->tree->getNodeForPath($destination); - - // If this succeeded, it means the destination already exists - // we'll need to throw precondition failed in case overwrite is false - if (!$overwrite) throw new Exception\PreconditionFailed('The destination node already exists, and the overwrite header is set to false','Overwrite'); - - } catch (Exception\NotFound $e) { - - // Destination didn't exist, we're all good - $destinationNode = false; - - - - } - - // These are the three relevant properties we need to return - return array( - 'destination' => $destination, - 'destinationExists' => $destinationNode==true, - 'destinationNode' => $destinationNode, - ); - - } - - /** - * Returns a list of properties for a path - * - * This is a simplified version getPropertiesForPath. - * if you aren't interested in status codes, but you just - * want to have a flat list of properties. Use this method. - * - * @param string $path - * @param array $propertyNames - */ - public function getProperties($path, $propertyNames) { - - $result = $this->getPropertiesForPath($path,$propertyNames,0); - return $result[0][200]; - - } - - /** - * A kid-friendly way to fetch properties for a node's children. - * - * The returned array will be indexed by the path of the of child node. - * Only properties that are actually found will be returned. - * - * The parent node will not be returned. - * - * @param string $path - * @param array $propertyNames - * @return array - */ - public function getPropertiesForChildren($path, $propertyNames) { - - $result = array(); - foreach($this->getPropertiesForPath($path,$propertyNames,1) as $k=>$row) { - - // Skipping the parent path - if ($k === 0) continue; - - $result[$row['href']] = $row[200]; - - } - return $result; - - } - - /** - * Returns a list of HTTP headers for a particular resource - * - * The generated http headers are based on properties provided by the - * resource. The method basically provides a simple mapping between - * DAV property and HTTP header. - * - * The headers are intended to be used for HEAD and GET requests. - * - * @param string $path - * @return array - */ - public function getHTTPHeaders($path) { - - $propertyMap = array( - '{DAV:}getcontenttype' => 'Content-Type', - '{DAV:}getcontentlength' => 'Content-Length', - '{DAV:}getlastmodified' => 'Last-Modified', - '{DAV:}getetag' => 'ETag', - ); - - $properties = $this->getProperties($path,array_keys($propertyMap)); - - $headers = array(); - foreach($propertyMap as $property=>$header) { - if (!isset($properties[$property])) continue; - - if (is_scalar($properties[$property])) { - $headers[$header] = $properties[$property]; - - // GetLastModified gets special cased - } elseif ($properties[$property] instanceof Property\GetLastModified) { - $headers[$header] = HTTP\Util::toHTTPDate($properties[$property]->getTime()); - } - - } - - return $headers; - - } - - /** - * Returns a list of properties for a given path - * - * The path that should be supplied should have the baseUrl stripped out - * The list of properties should be supplied in Clark notation. If the list is empty - * 'allprops' is assumed. - * - * If a depth of 1 is requested child elements will also be returned. - * - * @param string $path - * @param array $propertyNames - * @param int $depth - * @return array - */ - public function getPropertiesForPath($path, $propertyNames = array(), $depth = 0) { - - if ($depth!=0) $depth = 1; - - $path = rtrim($path,'/'); - - // This event allows people to intercept these requests early on in the - // process. - // - // We're not doing anything with the result, but this can be helpful to - // pre-fetch certain expensive live properties. - $this->broadCastEvent('beforeGetPropertiesForPath', array($path, $propertyNames, $depth)); - - $returnPropertyList = array(); - - $parentNode = $this->tree->getNodeForPath($path); - $nodes = array( - $path => $parentNode - ); - if ($depth==1 && $parentNode instanceof ICollection) { - foreach($this->tree->getChildren($path) as $childNode) - $nodes[$path . '/' . $childNode->getName()] = $childNode; - } - - // If the propertyNames array is empty, it means all properties are requested. - // We shouldn't actually return everything we know though, and only return a - // sensible list. - $allProperties = count($propertyNames)==0; - - foreach($nodes as $myPath=>$node) { - - $currentPropertyNames = $propertyNames; - - $newProperties = array( - '200' => array(), - '404' => array(), - ); - - if ($allProperties) { - // Default list of propertyNames, when all properties were requested. - $currentPropertyNames = array( - '{DAV:}getlastmodified', - '{DAV:}getcontentlength', - '{DAV:}resourcetype', - '{DAV:}quota-used-bytes', - '{DAV:}quota-available-bytes', - '{DAV:}getetag', - '{DAV:}getcontenttype', - ); - } - - // If the resourceType was not part of the list, we manually add it - // and mark it for removal. We need to know the resourcetype in order - // to make certain decisions about the entry. - // WebDAV dictates we should add a / and the end of href's for collections - $removeRT = false; - if (!in_array('{DAV:}resourcetype',$currentPropertyNames)) { - $currentPropertyNames[] = '{DAV:}resourcetype'; - $removeRT = true; - } - - $result = $this->broadcastEvent('beforeGetProperties',array($myPath, $node, &$currentPropertyNames, &$newProperties)); - // If this method explicitly returned false, we must ignore this - // node as it is inaccessible. - if ($result===false) continue; - - if (count($currentPropertyNames) > 0) { - - if ($node instanceof IProperties) { - $nodeProperties = $node->getProperties($currentPropertyNames); - - // The getProperties method may give us too much, - // properties, in case the implementor was lazy. - // - // So as we loop through this list, we will only take the - // properties that were actually requested and discard the - // rest. - foreach($currentPropertyNames as $k=>$currentPropertyName) { - if (isset($nodeProperties[$currentPropertyName])) { - unset($currentPropertyNames[$k]); - $newProperties[200][$currentPropertyName] = $nodeProperties[$currentPropertyName]; - } - } - - } - - } - - foreach($currentPropertyNames as $prop) { - - if (isset($newProperties[200][$prop])) continue; - - switch($prop) { - case '{DAV:}getlastmodified' : if ($node->getLastModified()) $newProperties[200][$prop] = new Property\GetLastModified($node->getLastModified()); break; - case '{DAV:}getcontentlength' : - if ($node instanceof IFile) { - $size = $node->getSize(); - if (!is_null($size)) { - $newProperties[200][$prop] = (int)$node->getSize(); - } - } - break; - case '{DAV:}quota-used-bytes' : - if ($node instanceof IQuota) { - $quotaInfo = $node->getQuotaInfo(); - $newProperties[200][$prop] = $quotaInfo[0]; - } - break; - case '{DAV:}quota-available-bytes' : - if ($node instanceof IQuota) { - $quotaInfo = $node->getQuotaInfo(); - $newProperties[200][$prop] = $quotaInfo[1]; - } - break; - case '{DAV:}getetag' : if ($node instanceof IFile && $etag = $node->getETag()) $newProperties[200][$prop] = $etag; break; - case '{DAV:}getcontenttype' : if ($node instanceof IFile && $ct = $node->getContentType()) $newProperties[200][$prop] = $ct; break; - case '{DAV:}supported-report-set' : - $reports = array(); - foreach($this->plugins as $plugin) { - $reports = array_merge($reports, $plugin->getSupportedReportSet($myPath)); - } - $newProperties[200][$prop] = new Property\SupportedReportSet($reports); - break; - case '{DAV:}resourcetype' : - $newProperties[200]['{DAV:}resourcetype'] = new Property\ResourceType(); - foreach($this->resourceTypeMapping as $className => $resourceType) { - if ($node instanceof $className) $newProperties[200]['{DAV:}resourcetype']->add($resourceType); - } - break; - - } - - // If we were unable to find the property, we will list it as 404. - if (!$allProperties && !isset($newProperties[200][$prop])) $newProperties[404][$prop] = null; - - } - - $this->broadcastEvent('afterGetProperties',array(trim($myPath,'/'),&$newProperties, $node)); - - $newProperties['href'] = trim($myPath,'/'); - - // Its is a WebDAV recommendation to add a trailing slash to collectionnames. - // Apple's iCal also requires a trailing slash for principals (rfc 3744), though this is non-standard. - if ($myPath!='' && isset($newProperties[200]['{DAV:}resourcetype'])) { - $rt = $newProperties[200]['{DAV:}resourcetype']; - if ($rt->is('{DAV:}collection') || $rt->is('{DAV:}principal')) { - $newProperties['href'] .='/'; - } - } - - // If the resourcetype property was manually added to the requested property list, - // we will remove it again. - if ($removeRT) unset($newProperties[200]['{DAV:}resourcetype']); - - $returnPropertyList[] = $newProperties; - - } - - return $returnPropertyList; - - } - - /** - * This method is invoked by sub-systems creating a new file. - * - * Currently this is done by HTTP PUT and HTTP LOCK (in the Locks_Plugin). - * It was important to get this done through a centralized function, - * allowing plugins to intercept this using the beforeCreateFile event. - * - * This method will return true if the file was actually created - * - * @param string $uri - * @param resource $data - * @param string $etag - * @return bool - */ - public function createFile($uri,$data, &$etag = null) { - - list($dir,$name) = URLUtil::splitPath($uri); - - if (!$this->broadcastEvent('beforeBind',array($uri))) return false; - - $parent = $this->tree->getNodeForPath($dir); - if (!$parent instanceof ICollection) { - throw new Exception\Conflict('Files can only be created as children of collections'); - } - - if (!$this->broadcastEvent('beforeCreateFile',array($uri, &$data, $parent))) return false; - - $etag = $parent->createFile($name,$data); - $this->tree->markDirty($dir . '/' . $name); - - $this->broadcastEvent('afterBind',array($uri)); - $this->broadcastEvent('afterCreateFile',array($uri, $parent)); - - return true; - } - - /** - * This method is invoked by sub-systems creating a new directory. - * - * @param string $uri - * @return void - */ - public function createDirectory($uri) { - - $this->createCollection($uri,array('{DAV:}collection'),array()); - - } - - /** - * Use this method to create a new collection - * - * The {DAV:}resourcetype is specified using the resourceType array. - * At the very least it must contain {DAV:}collection. - * - * The properties array can contain a list of additional properties. - * - * @param string $uri The new uri - * @param array $resourceType The resourceType(s) - * @param array $properties A list of properties - * @return array|null - */ - public function createCollection($uri, array $resourceType, array $properties) { - - list($parentUri,$newName) = URLUtil::splitPath($uri); - - // Making sure {DAV:}collection was specified as resourceType - if (!in_array('{DAV:}collection', $resourceType)) { - throw new Exception\InvalidResourceType('The resourceType for this collection must at least include {DAV:}collection'); - } - - - // Making sure the parent exists - try { - - $parent = $this->tree->getNodeForPath($parentUri); - - } catch (Exception\NotFound $e) { - - throw new Exception\Conflict('Parent node does not exist'); - - } - - // Making sure the parent is a collection - if (!$parent instanceof ICollection) { - throw new Exception\Conflict('Parent node is not a collection'); - } - - - - // Making sure the child does not already exist - try { - $parent->getChild($newName); - - // If we got here.. it means there's already a node on that url, and we need to throw a 405 - throw new Exception\MethodNotAllowed('The resource you tried to create already exists'); - - } catch (Exception\NotFound $e) { - // This is correct - } - - - if (!$this->broadcastEvent('beforeBind',array($uri))) return; - - // There are 2 modes of operation. The standard collection - // creates the directory, and then updates properties - // the extended collection can create it directly. - if ($parent instanceof IExtendedCollection) { - - $parent->createExtendedCollection($newName, $resourceType, $properties); - - } else { - - // No special resourcetypes are supported - if (count($resourceType)>1) { - throw new Exception\InvalidResourceType('The {DAV:}resourcetype you specified is not supported here.'); - } - - $parent->createDirectory($newName); - $rollBack = false; - $exception = null; - $errorResult = null; - - if (count($properties)>0) { - - try { - - $errorResult = $this->updateProperties($uri, $properties); - if (!isset($errorResult[200])) { - $rollBack = true; - } - - } catch (Exception $e) { - - $rollBack = true; - $exception = $e; - - } - - } - - if ($rollBack) { - if (!$this->broadcastEvent('beforeUnbind',array($uri))) return; - $this->tree->delete($uri); - - // Re-throwing exception - if ($exception) throw $exception; - - return $errorResult; - } - - } - $this->tree->markDirty($parentUri); - $this->broadcastEvent('afterBind',array($uri)); - - } - - /** - * This method updates a resource's properties - * - * The properties array must be a list of properties. Array-keys are - * property names in clarknotation, array-values are it's values. - * If a property must be deleted, the value should be null. - * - * Note that this request should either completely succeed, or - * completely fail. - * - * The response is an array with statuscodes for keys, which in turn - * contain arrays with propertynames. This response can be used - * to generate a multistatus body. - * - * @param string $uri - * @param array $properties - * @return array - */ - public function updateProperties($uri, array $properties) { - - // we'll start by grabbing the node, this will throw the appropriate - // exceptions if it doesn't. - $node = $this->tree->getNodeForPath($uri); - - $result = array( - 200 => array(), - 403 => array(), - 424 => array(), - ); - $remainingProperties = $properties; - $hasError = false; - - // Running through all properties to make sure none of them are protected - if (!$hasError) foreach($properties as $propertyName => $value) { - if(in_array($propertyName, $this->protectedProperties)) { - $result[403][$propertyName] = null; - unset($remainingProperties[$propertyName]); - $hasError = true; - } - } - - if (!$hasError) { - // Allowing plugins to take care of property updating - $hasError = !$this->broadcastEvent('updateProperties',array( - &$remainingProperties, - &$result, - $node - )); - } - - // If the node is not an instance of SabreForRainLoop\DAV\IProperties, every - // property is 403 Forbidden - if (!$hasError && count($remainingProperties) && !($node instanceof IProperties)) { - $hasError = true; - foreach($properties as $propertyName=> $value) { - $result[403][$propertyName] = null; - } - $remainingProperties = array(); - } - - // Only if there were no errors we may attempt to update the resource - if (!$hasError) { - - if (count($remainingProperties)>0) { - - $updateResult = $node->updateProperties($remainingProperties); - - if ($updateResult===true) { - // success - foreach($remainingProperties as $propertyName=>$value) { - $result[200][$propertyName] = null; - } - - } elseif ($updateResult===false) { - // The node failed to update the properties for an - // unknown reason - foreach($remainingProperties as $propertyName=>$value) { - $result[403][$propertyName] = null; - } - - } elseif (is_array($updateResult)) { - - // The node has detailed update information - // We need to merge the results with the earlier results. - foreach($updateResult as $status => $props) { - if (is_array($props)) { - if (!isset($result[$status])) - $result[$status] = array(); - - $result[$status] = array_merge($result[$status], $updateResult[$status]); - } - } - - } else { - throw new Exception('Invalid result from updateProperties'); - } - $remainingProperties = array(); - } - - } - - foreach($remainingProperties as $propertyName=>$value) { - // if there are remaining properties, it must mean - // there's a dependency failure - $result[424][$propertyName] = null; - } - - // Removing empty array values - foreach($result as $status=>$props) { - - if (count($props)===0) unset($result[$status]); - - } - $result['href'] = $uri; - return $result; - - } - - /** - * This method checks the main HTTP preconditions. - * - * Currently these are: - * * If-Match - * * If-None-Match - * * If-Modified-Since - * * If-Unmodified-Since - * - * The method will return true if all preconditions are met - * The method will return false, or throw an exception if preconditions - * failed. If false is returned the operation should be aborted, and - * the appropriate HTTP response headers are already set. - * - * Normally this method will throw 412 Precondition Failed for failures - * related to If-None-Match, If-Match and If-Unmodified Since. It will - * set the status to 304 Not Modified for If-Modified_since. - * - * If the $handleAsGET argument is set to true, it will also return 304 - * Not Modified for failure of the If-None-Match precondition. This is the - * desired behaviour for HTTP GET and HTTP HEAD requests. - * - * @param bool $handleAsGET - * @return bool - */ - public function checkPreconditions($handleAsGET = false) { - - $uri = $this->getRequestUri(); - $node = null; - $lastMod = null; - $etag = null; - - if ($ifMatch = $this->httpRequest->getHeader('If-Match')) { - - // If-Match contains an entity tag. Only if the entity-tag - // matches we are allowed to make the request succeed. - // If the entity-tag is '*' we are only allowed to make the - // request succeed if a resource exists at that url. - try { - $node = $this->tree->getNodeForPath($uri); - } catch (Exception\NotFound $e) { - throw new Exception\PreconditionFailed('An If-Match header was specified and the resource did not exist','If-Match'); - } - - // Only need to check entity tags if they are not * - if ($ifMatch!=='*') { - - // There can be multiple etags - $ifMatch = explode(',',$ifMatch); - $haveMatch = false; - foreach($ifMatch as $ifMatchItem) { - - // Stripping any extra spaces - $ifMatchItem = trim($ifMatchItem,' '); - - $etag = $node->getETag(); - if ($etag===$ifMatchItem) { - $haveMatch = true; - } else { - // Evolution has a bug where it sometimes prepends the " - // with a \. This is our workaround. - if (str_replace('\\"','"', $ifMatchItem) === $etag) { - $haveMatch = true; - } - } - - } - if (!$haveMatch) { - throw new Exception\PreconditionFailed('An If-Match header was specified, but none of the specified the ETags matched.','If-Match'); - } - } - } - - if ($ifNoneMatch = $this->httpRequest->getHeader('If-None-Match')) { - - // The If-None-Match header contains an etag. - // Only if the ETag does not match the current ETag, the request will succeed - // The header can also contain *, in which case the request - // will only succeed if the entity does not exist at all. - $nodeExists = true; - if (!$node) { - try { - $node = $this->tree->getNodeForPath($uri); - } catch (Exception\NotFound $e) { - $nodeExists = false; - } - } - if ($nodeExists) { - $haveMatch = false; - if ($ifNoneMatch==='*') $haveMatch = true; - else { - - // There might be multiple etags - $ifNoneMatch = explode(',', $ifNoneMatch); - $etag = $node->getETag(); - - foreach($ifNoneMatch as $ifNoneMatchItem) { - - // Stripping any extra spaces - $ifNoneMatchItem = trim($ifNoneMatchItem,' '); - - if ($etag===$ifNoneMatchItem) $haveMatch = true; - - } - - } - - if ($haveMatch) { - if ($handleAsGET) { - $this->httpResponse->sendStatus(304); - return false; - } else { - throw new Exception\PreconditionFailed('An If-None-Match header was specified, but the ETag matched (or * was specified).','If-None-Match'); - } - } - } - - } - - if (!$ifNoneMatch && ($ifModifiedSince = $this->httpRequest->getHeader('If-Modified-Since'))) { - - // The If-Modified-Since header contains a date. We - // will only return the entity if it has been changed since - // that date. If it hasn't been changed, we return a 304 - // header - // Note that this header only has to be checked if there was no If-None-Match header - // as per the HTTP spec. - $date = HTTP\Util::parseHTTPDate($ifModifiedSince); - - if ($date) { - if (is_null($node)) { - $node = $this->tree->getNodeForPath($uri); - } - $lastMod = $node->getLastModified(); - if ($lastMod) { - $lastMod = new \DateTime('@' . $lastMod); - if ($lastMod <= $date) { - $this->httpResponse->sendStatus(304); - $this->httpResponse->setHeader('Last-Modified', HTTP\Util::toHTTPDate($lastMod)); - return false; - } - } - } - } - - if ($ifUnmodifiedSince = $this->httpRequest->getHeader('If-Unmodified-Since')) { - - // The If-Unmodified-Since will allow allow the request if the - // entity has not changed since the specified date. - $date = HTTP\Util::parseHTTPDate($ifUnmodifiedSince); - - // We must only check the date if it's valid - if ($date) { - if (is_null($node)) { - $node = $this->tree->getNodeForPath($uri); - } - $lastMod = $node->getLastModified(); - if ($lastMod) { - $lastMod = new \DateTime('@' . $lastMod); - if ($lastMod > $date) { - throw new Exception\PreconditionFailed('An If-Unmodified-Since header was specified, but the entity has been changed since the specified date.','If-Unmodified-Since'); - } - } - } - - } - return true; - - } - - // }}} - // {{{ XML Readers & Writers - - - /** - * Generates a WebDAV propfind response body based on a list of nodes. - * - * If 'strip404s' is set to true, all 404 responses will be removed. - * - * @param array $fileProperties The list with nodes - * @param bool strip404s - * @return string - */ - public function generateMultiStatus(array $fileProperties, $strip404s = false) { - - $dom = new \DOMDocument('1.0','utf-8'); - //$dom->formatOutput = true; - $multiStatus = $dom->createElement('d:multistatus'); - $dom->appendChild($multiStatus); - - // Adding in default namespaces - foreach($this->xmlNamespaces as $namespace=>$prefix) { - - $multiStatus->setAttribute('xmlns:' . $prefix,$namespace); - - } - - foreach($fileProperties as $entry) { - - $href = $entry['href']; - unset($entry['href']); - - if ($strip404s && isset($entry[404])) { - unset($entry[404]); - } - - $response = new Property\Response($href,$entry); - $response->serialize($this,$multiStatus); - - } - - return $dom->saveXML(); - - } - - /** - * This method parses a PropPatch request - * - * PropPatch changes the properties for a resource. This method - * returns a list of properties. - * - * The keys in the returned array contain the property name (e.g.: {DAV:}displayname, - * and the value contains the property value. If a property is to be removed the value - * will be null. - * - * @param string $body xml body - * @return array list of properties in need of updating or deletion - */ - public function parsePropPatchRequest($body) { - - //We'll need to change the DAV namespace declaration to something else in order to make it parsable - $dom = XMLUtil::loadDOMDocument($body); - - $newProperties = array(); - - foreach($dom->firstChild->childNodes as $child) { - - if ($child->nodeType !== XML_ELEMENT_NODE) continue; - - $operation = XMLUtil::toClarkNotation($child); - - if ($operation!=='{DAV:}set' && $operation!=='{DAV:}remove') continue; - - $innerProperties = XMLUtil::parseProperties($child, $this->propertyMap); - - foreach($innerProperties as $propertyName=>$propertyValue) { - - if ($operation==='{DAV:}remove') { - $propertyValue = null; - } - - $newProperties[$propertyName] = $propertyValue; - - } - - } - - return $newProperties; - - } - - /** - * This method parses the PROPFIND request and returns its information - * - * This will either be a list of properties, or an empty array; in which case - * an {DAV:}allprop was requested. - * - * @param string $body - * @return array - */ - public function parsePropFindRequest($body) { - - // If the propfind body was empty, it means IE is requesting 'all' properties - if (!$body) return array(); - - $dom = XMLUtil::loadDOMDocument($body); - $elem = $dom->getElementsByTagNameNS('urn:DAV','propfind')->item(0); - return array_keys(XMLUtil::parseProperties($elem)); - - } - - // }}} - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php deleted file mode 100644 index 83cde57567..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/ServerPlugin.php +++ /dev/null @@ -1,90 +0,0 @@ -name = $name; - foreach($children as $child) { - - if (!($child instanceof INode)) throw new Exception('Only instances of SabreForRainLoop\DAV\INode are allowed to be passed in the children argument'); - $this->addChild($child); - - } - - } - - /** - * Adds a new childnode to this collection - * - * @param INode $child - * @return void - */ - public function addChild(INode $child) { - - $this->children[$child->getName()] = $child; - - } - - /** - * Returns the name of the collection - * - * @return string - */ - public function getName() { - - return $this->name; - - } - - /** - * Returns a child object, by its name. - * - * This method makes use of the getChildren method to grab all the child nodes, and compares the name. - * Generally its wise to override this, as this can usually be optimized - * - * This method must throw SabreForRainLoop\DAV\Exception\NotFound if the node does not - * exist. - * - * @param string $name - * @throws Exception\NotFound - * @return INode - */ - public function getChild($name) { - - if (isset($this->children[$name])) return $this->children[$name]; - throw new Exception\NotFound('File not found: ' . $name . ' in \'' . $this->getName() . '\''); - - } - - /** - * Returns a list of children for this collection - * - * @return array - */ - public function getChildren() { - - return array_values($this->children); - - } - - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php deleted file mode 100644 index d1b2d7e3a4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/SimpleFile.php +++ /dev/null @@ -1,121 +0,0 @@ -name = $name; - $this->contents = $contents; - $this->mimeType = $mimeType; - - } - - /** - * Returns the node name for this file. - * - * This name is used to construct the url. - * - * @return string - */ - public function getName() { - - return $this->name; - - } - - /** - * Returns the data - * - * This method may either return a string or a readable stream resource - * - * @return mixed - */ - public function get() { - - return $this->contents; - - } - - /** - * Returns the size of the file, in bytes. - * - * @return int - */ - public function getSize() { - - return strlen($this->contents); - - } - - /** - * Returns the ETag for a file - * - * An ETag is a unique identifier representing the current version of the file. If the file changes, the ETag MUST change. - * The ETag is an arbitrary string, but MUST be surrounded by double-quotes. - * - * Return null if the ETag can not effectively be determined - * @return string - */ - public function getETag() { - - return '"' . md5($this->contents) . '"'; - - } - - /** - * Returns the mime-type for a file - * - * If null is returned, we'll assume application/octet-stream - * @return string - */ - public function getContentType() { - - return $this->mimeType; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/StringUtil.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/StringUtil.php deleted file mode 100644 index 4c9dcee5a2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/StringUtil.php +++ /dev/null @@ -1,91 +0,0 @@ -dataDir = $dataDir; - - } - - /** - * Initialize the plugin - * - * This is called automatically be the Server class after this plugin is - * added with SabreForRainLoop\DAV\Server::addPlugin() - * - * @param Server $server - * @return void - */ - public function initialize(Server $server) { - - $this->server = $server; - $server->subscribeEvent('beforeMethod',array($this,'beforeMethod')); - $server->subscribeEvent('beforeCreateFile',array($this,'beforeCreateFile')); - - } - - /** - * This method is called before any HTTP method handler - * - * This method intercepts any GET, DELETE, PUT and PROPFIND calls to - * filenames that are known to match the 'temporary file' regex. - * - * @param string $method - * @param string $uri - * @return bool - */ - public function beforeMethod($method, $uri) { - - if (!$tempLocation = $this->isTempFile($uri)) - return true; - - switch($method) { - case 'GET' : - return $this->httpGet($tempLocation); - case 'PUT' : - return $this->httpPut($tempLocation); - case 'PROPFIND' : - return $this->httpPropfind($tempLocation, $uri); - case 'DELETE' : - return $this->httpDelete($tempLocation); - } - return true; - - } - - /** - * This method is invoked if some subsystem creates a new file. - * - * This is used to deal with HTTP LOCK requests which create a new - * file. - * - * @param string $uri - * @param resource $data - * @return bool - */ - public function beforeCreateFile($uri,$data) { - - if ($tempPath = $this->isTempFile($uri)) { - - $hR = $this->server->httpResponse; - $hR->setHeader('X-Sabre-Temp','true'); - file_put_contents($tempPath,$data); - return false; - } - return true; - - } - - /** - * This method will check if the url matches the temporary file pattern - * if it does, it will return an path based on $this->dataDir for the - * temporary file storage. - * - * @param string $path - * @return boolean|string - */ - protected function isTempFile($path) { - - // We're only interested in the basename. - list(, $tempPath) = URLUtil::splitPath($path); - - foreach($this->temporaryFilePatterns as $tempFile) { - - if (preg_match($tempFile,$tempPath)) { - return $this->getDataDir() . '/sabredav_' . md5($path) . '.tempfile'; - } - - } - - return false; - - } - - - /** - * This method handles the GET method for temporary files. - * If the file doesn't exist, it will return false which will kick in - * the regular system for the GET method. - * - * @param string $tempLocation - * @return bool - */ - public function httpGet($tempLocation) { - - if (!file_exists($tempLocation)) return true; - - $hR = $this->server->httpResponse; - $hR->setHeader('Content-Type','application/octet-stream'); - $hR->setHeader('Content-Length',filesize($tempLocation)); - $hR->setHeader('X-Sabre-Temp','true'); - $hR->sendStatus(200); - $hR->sendBody(fopen($tempLocation,'r')); - return false; - - } - - /** - * This method handles the PUT method. - * - * @param string $tempLocation - * @return bool - */ - public function httpPut($tempLocation) { - - $hR = $this->server->httpResponse; - $hR->setHeader('X-Sabre-Temp','true'); - - $newFile = !file_exists($tempLocation); - - if (!$newFile && ($this->server->httpRequest->getHeader('If-None-Match'))) { - throw new Exception\PreconditionFailed('The resource already exists, and an If-None-Match header was supplied'); - } - - file_put_contents($tempLocation,$this->server->httpRequest->getBody()); - $hR->sendStatus($newFile?201:200); - return false; - - } - - /** - * This method handles the DELETE method. - * - * If the file didn't exist, it will return false, which will make the - * standard HTTP DELETE handler kick in. - * - * @param string $tempLocation - * @return bool - */ - public function httpDelete($tempLocation) { - - if (!file_exists($tempLocation)) return true; - - unlink($tempLocation); - $hR = $this->server->httpResponse; - $hR->setHeader('X-Sabre-Temp','true'); - $hR->sendStatus(204); - return false; - - } - - /** - * This method handles the PROPFIND method. - * - * It's a very lazy method, it won't bother checking the request body - * for which properties were requested, and just sends back a default - * set of properties. - * - * @param string $tempLocation - * @param string $uri - * @return bool - */ - public function httpPropfind($tempLocation, $uri) { - - if (!file_exists($tempLocation)) return true; - - $hR = $this->server->httpResponse; - $hR->setHeader('X-Sabre-Temp','true'); - $hR->sendStatus(207); - $hR->setHeader('Content-Type','application/xml; charset=utf-8'); - - $this->server->parsePropFindRequest($this->server->httpRequest->getBody(true)); - - $properties = array( - 'href' => $uri, - 200 => array( - '{DAV:}getlastmodified' => new Property\GetLastModified(filemtime($tempLocation)), - '{DAV:}getcontentlength' => filesize($tempLocation), - '{DAV:}resourcetype' => new Property\ResourceType(null), - '{'.Server::NS_SABREDAV.'}tempFile' => true, - - ), - ); - - $data = $this->server->generateMultiStatus(array($properties)); - $hR->sendBody($data); - return false; - - } - - - /** - * This method returns the directory where the temporary files should be stored. - * - * @return string - */ - protected function getDataDir() - { - return $this->dataDir; - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree.php deleted file mode 100644 index 49fa99d6d7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree.php +++ /dev/null @@ -1,193 +0,0 @@ -getNodeForPath($path); - return true; - - } catch (Exception\NotFound $e) { - - return false; - - } - - } - - /** - * Copies a file from path to another - * - * @param string $sourcePath The source location - * @param string $destinationPath The full destination path - * @return void - */ - public function copy($sourcePath, $destinationPath) { - - $sourceNode = $this->getNodeForPath($sourcePath); - - // grab the dirname and basename components - list($destinationDir, $destinationName) = URLUtil::splitPath($destinationPath); - - $destinationParent = $this->getNodeForPath($destinationDir); - $this->copyNode($sourceNode,$destinationParent,$destinationName); - - $this->markDirty($destinationDir); - - } - - /** - * Moves a file from one location to another - * - * @param string $sourcePath The path to the file which should be moved - * @param string $destinationPath The full destination path, so not just the destination parent node - * @return int - */ - public function move($sourcePath, $destinationPath) { - - list($sourceDir, $sourceName) = URLUtil::splitPath($sourcePath); - list($destinationDir, $destinationName) = URLUtil::splitPath($destinationPath); - - if ($sourceDir===$destinationDir) { - $renameable = $this->getNodeForPath($sourcePath); - $renameable->setName($destinationName); - } else { - $this->copy($sourcePath,$destinationPath); - $this->getNodeForPath($sourcePath)->delete(); - } - $this->markDirty($sourceDir); - $this->markDirty($destinationDir); - - } - - /** - * Deletes a node from the tree - * - * @param string $path - * @return void - */ - public function delete($path) { - - $node = $this->getNodeForPath($path); - $node->delete(); - - list($parent) = URLUtil::splitPath($path); - $this->markDirty($parent); - - } - - /** - * Returns a list of childnodes for a given path. - * - * @param string $path - * @return array - */ - public function getChildren($path) { - - $node = $this->getNodeForPath($path); - return $node->getChildren(); - - } - - /** - * This method is called with every tree update - * - * Examples of tree updates are: - * * node deletions - * * node creations - * * copy - * * move - * * renaming nodes - * - * If Tree classes implement a form of caching, this will allow - * them to make sure caches will be expired. - * - * If a path is passed, it is assumed that the entire subtree is dirty - * - * @param string $path - * @return void - */ - public function markDirty($path) { - - - } - - /** - * copyNode - * - * @param INode $source - * @param ICollection $destinationParent - * @param string $destinationName - * @return void - */ - protected function copyNode(INode $source,ICollection $destinationParent,$destinationName = null) { - - if (!$destinationName) $destinationName = $source->getName(); - - if ($source instanceof IFile) { - - $data = $source->get(); - - // If the body was a string, we need to convert it to a stream - if (is_string($data)) { - $stream = fopen('php://temp','r+'); - fwrite($stream,$data); - rewind($stream); - $data = $stream; - } - $destinationParent->createFile($destinationName,$data); - $destination = $destinationParent->getChild($destinationName); - - } elseif ($source instanceof ICollection) { - - $destinationParent->createDirectory($destinationName); - - $destination = $destinationParent->getChild($destinationName); - foreach($source->getChildren() as $child) { - - $this->copyNode($child,$destination); - - } - - } - if ($source instanceof IProperties && $destination instanceof IProperties) { - - $props = $source->getProperties(array()); - $destination->updateProperties($props); - - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree/Filesystem.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree/Filesystem.php deleted file mode 100644 index 7546c058c5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/Tree/Filesystem.php +++ /dev/null @@ -1,133 +0,0 @@ -basePath = $basePath; - - } - - /** - * Returns a new node for the given path - * - * @param string $path - * @return DAV\FS\Node - */ - public function getNodeForPath($path) { - - $realPath = $this->getRealPath($path); - if (!file_exists($realPath)) { - throw new DAV\Exception\NotFound('File at location ' . $realPath . ' not found'); - } - if (is_dir($realPath)) { - return new DAV\FS\Directory($realPath); - } else { - return new DAV\FS\File($realPath); - } - - } - - /** - * Returns the real filesystem path for a webdav url. - * - * @param string $publicPath - * @return string - */ - protected function getRealPath($publicPath) { - - return rtrim($this->basePath,'/') . '/' . trim($publicPath,'/'); - - } - - /** - * Copies a file or directory. - * - * This method must work recursively and delete the destination - * if it exists - * - * @param string $source - * @param string $destination - * @return void - */ - public function copy($source,$destination) { - - $source = $this->getRealPath($source); - $destination = $this->getRealPath($destination); - $this->realCopy($source,$destination); - - } - - /** - * Used by self::copy - * - * @param string $source - * @param string $destination - * @return void - */ - protected function realCopy($source,$destination) { - - if (is_file($source)) { - copy($source,$destination); - } else { - mkdir($destination); - foreach(scandir($source) as $subnode) { - - if ($subnode=='.' || $subnode=='..') continue; - $this->realCopy($source.'/'.$subnode,$destination.'/'.$subnode); - - } - } - - } - - /** - * Moves a file or directory recursively. - * - * If the destination exists, delete it first. - * - * @param string $source - * @param string $destination - * @return void - */ - public function move($source,$destination) { - - $source = $this->getRealPath($source); - $destination = $this->getRealPath($destination); - rename($source,$destination); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/URLUtil.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/URLUtil.php deleted file mode 100644 index 65f4d9ba96..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAV/URLUtil.php +++ /dev/null @@ -1,121 +0,0 @@ - - * will be returned as: - * {http://www.example.org}myelem - * - * This format is used throughout the SabreDAV sourcecode. - * Elements encoded with the urn:DAV namespace will - * be returned as if they were in the DAV: namespace. This is to avoid - * compatibility problems. - * - * This function will return null if a nodetype other than an Element is passed. - * - * @param \DOMNode $dom - * @return string - */ - static function toClarkNotation(\DOMNode $dom) { - - if ($dom->nodeType !== XML_ELEMENT_NODE) return null; - - // Mapping back to the real namespace, in case it was dav - if ($dom->namespaceURI=='urn:DAV') $ns = 'DAV:'; else $ns = $dom->namespaceURI; - - // Mapping to clark notation - return '{' . $ns . '}' . $dom->localName; - - } - - /** - * Parses a clark-notation string, and returns the namespace and element - * name components. - * - * If the string was invalid, it will throw an InvalidArgumentException. - * - * @param string $str - * @throws InvalidArgumentException - * @return array - */ - static function parseClarkNotation($str) { - - if (!preg_match('/^{([^}]*)}(.*)$/',$str,$matches)) { - throw new \InvalidArgumentException('\'' . $str . '\' is not a valid clark-notation formatted string'); - } - - return array( - $matches[1], - $matches[2] - ); - - } - - /** - * This method takes an XML document (as string) and converts all instances of the - * DAV: namespace to urn:DAV - * - * This is unfortunately needed, because the DAV: namespace violates the xml namespaces - * spec, and causes the DOM to throw errors - * - * @param string $xmlDocument - * @return array|string|null - */ - static function convertDAVNamespace($xmlDocument) { - - // This is used to map the DAV: namespace to urn:DAV. This is needed, because the DAV: - // namespace is actually a violation of the XML namespaces specification, and will cause errors - return preg_replace("/xmlns(:[A-Za-z0-9_]*)?=(\"|\')DAV:(\\2)/","xmlns\\1=\\2urn:DAV\\2",$xmlDocument); - - } - - /** - * This method provides a generic way to load a DOMDocument for WebDAV use. - * - * This method throws a SabreForRainLoop\DAV\Exception\BadRequest exception for any xml errors. - * It does not preserve whitespace, and it converts the DAV: namespace to urn:DAV. - * - * @param string $xml - * @throws SabreForRainLoop\DAV\Exception\BadRequest - * @return DOMDocument - */ - static function loadDOMDocument($xml) { - - if (empty($xml)) - throw new Exception\BadRequest('Empty XML document sent'); - - // The BitKinex client sends xml documents as UTF-16. PHP 5.3.1 (and presumably lower) - // does not support this, so we must intercept this and convert to UTF-8. - if (substr($xml,0,12) === "\x3c\x00\x3f\x00\x78\x00\x6d\x00\x6c\x00\x20\x00") { - - // Note: the preceeding byte sequence is "]*)encoding="UTF-16"([^>]*)>|u','',$xml); - - } - - // Retaining old error setting - $oldErrorSetting = libxml_use_internal_errors(true); - - // Clearing any previous errors - libxml_clear_errors(); - - $dom = new \DOMDocument(); - - // We don't generally care about any whitespace - $dom->preserveWhiteSpace = false; - - $dom->loadXML(self::convertDAVNamespace($xml),LIBXML_NOWARNING | LIBXML_NOERROR); - - if ($error = libxml_get_last_error()) { - libxml_clear_errors(); - throw new Exception\BadRequest('The request body had an invalid XML body. (message: ' . $error->message . ', errorcode: ' . $error->code . ', line: ' . $error->line . ')'); - } - - // Restoring old mechanism for error handling - if ($oldErrorSetting===false) libxml_use_internal_errors(false); - - return $dom; - - } - - /** - * Parses all WebDAV properties out of a DOM Element - * - * Generally WebDAV properties are enclosed in {DAV:}prop elements. This - * method helps by going through all these and pulling out the actual - * propertynames, making them array keys and making the property values, - * well.. the array values. - * - * If no value was given (self-closing element) null will be used as the - * value. This is used in for example PROPFIND requests. - * - * Complex values are supported through the propertyMap argument. The - * propertyMap should have the clark-notation properties as it's keys, and - * classnames as values. - * - * When any of these properties are found, the unserialize() method will be - * (statically) called. The result of this method is used as the value. - * - * @param \DOMElement $parentNode - * @param array $propertyMap - * @return array - */ - static function parseProperties(\DOMElement $parentNode, array $propertyMap = array()) { - - $propList = array(); - foreach($parentNode->childNodes as $propNode) { - - if (self::toClarkNotation($propNode)!=='{DAV:}prop') continue; - - foreach($propNode->childNodes as $propNodeData) { - - /* If there are no elements in here, we actually get 1 text node, this special case is dedicated to netdrive */ - if ($propNodeData->nodeType != XML_ELEMENT_NODE) continue; - - $propertyName = self::toClarkNotation($propNodeData); - if (isset($propertyMap[$propertyName])) { - $propList[$propertyName] = call_user_func(array($propertyMap[$propertyName],'unserialize'),$propNodeData); - } else { - $propList[$propertyName] = $propNodeData->textContent; - } - } - - - } - return $propList; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/AbstractPrincipalCollection.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/AbstractPrincipalCollection.php deleted file mode 100644 index 342796fb48..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/AbstractPrincipalCollection.php +++ /dev/null @@ -1,155 +0,0 @@ -principalPrefix = $principalPrefix; - $this->principalBackend = $principalBackend; - - } - - /** - * This method returns a node for a principal. - * - * The passed array contains principal information, and is guaranteed to - * at least contain a uri item. Other properties may or may not be - * supplied by the authentication backend. - * - * @param array $principalInfo - * @return IPrincipal - */ - abstract function getChildForPrincipal(array $principalInfo); - - /** - * Returns the name of this collection. - * - * @return string - */ - public function getName() { - - list(,$name) = DAV\URLUtil::splitPath($this->principalPrefix); - return $name; - - } - - /** - * Return the list of users - * - * @return array - */ - public function getChildren() { - - if ($this->disableListing) - throw new DAV\Exception\MethodNotAllowed('Listing members of this collection is disabled'); - - $children = array(); - foreach($this->principalBackend->getPrincipalsByPrefix($this->principalPrefix) as $principalInfo) { - - $children[] = $this->getChildForPrincipal($principalInfo); - - - } - return $children; - - } - - /** - * Returns a child object, by its name. - * - * @param string $name - * @throws DAV\Exception\NotFound - * @return IPrincipal - */ - public function getChild($name) { - - $principalInfo = $this->principalBackend->getPrincipalByPath($this->principalPrefix . '/' . $name); - if (!$principalInfo) throw new DAV\Exception\NotFound('Principal with name ' . $name . ' not found'); - return $this->getChildForPrincipal($principalInfo); - - } - - /** - * This method is used to search for principals matching a set of - * properties. - * - * This search is specifically used by RFC3744's principal-property-search - * REPORT. You should at least allow searching on - * http://sabredav.org/ns}email-address. - * - * The actual search should be a unicode-non-case-sensitive search. The - * keys in searchProperties are the WebDAV property names, while the values - * are the property values to search on. - * - * If multiple properties are being searched on, the search should be - * AND'ed. - * - * This method should simply return a list of 'child names', which may be - * used to call $this->getChild in the future. - * - * @param array $searchProperties - * @return array - */ - public function searchPrincipals(array $searchProperties) { - - $result = $this->principalBackend->searchPrincipals($this->principalPrefix, $searchProperties); - $r = array(); - - foreach($result as $row) { - list(, $r[]) = DAV\URLUtil::splitPath($row); - } - - return $r; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/AceConflict.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/AceConflict.php deleted file mode 100644 index cc91a95d0e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/AceConflict.php +++ /dev/null @@ -1,35 +0,0 @@ -ownerDocument; - - $np = $doc->createElementNS('DAV:','d:no-ace-conflict'); - $errorNode->appendChild($np); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NeedPrivileges.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NeedPrivileges.php deleted file mode 100644 index 9b4db9b52e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NeedPrivileges.php +++ /dev/null @@ -1,83 +0,0 @@ -uri = $uri; - $this->privileges = $privileges; - - parent::__construct('User did not have the required privileges (' . implode(',', $privileges) . ') for path "' . $uri . '"'); - - } - - /** - * Adds in extra information in the xml response. - * - * This method adds the {DAV:}need-privileges element as defined in rfc3744 - * - * @param DAV\Server $server - * @param \DOMElement $errorNode - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $errorNode) { - - $doc = $errorNode->ownerDocument; - - $np = $doc->createElementNS('DAV:','d:need-privileges'); - $errorNode->appendChild($np); - - foreach($this->privileges as $privilege) { - - $resource = $doc->createElementNS('DAV:','d:resource'); - $np->appendChild($resource); - - $resource->appendChild($doc->createElementNS('DAV:','d:href',$server->getBaseUri() . $this->uri)); - - $priv = $doc->createElementNS('DAV:','d:privilege'); - $resource->appendChild($priv); - - preg_match('/^{([^}]*)}(.*)$/',$privilege,$privilegeParts); - $priv->appendChild($doc->createElementNS($privilegeParts[1],'d:' . $privilegeParts[2])); - - - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NoAbstract.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NoAbstract.php deleted file mode 100644 index 0f821062dd..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NoAbstract.php +++ /dev/null @@ -1,35 +0,0 @@ -ownerDocument; - - $np = $doc->createElementNS('DAV:','d:no-abstract'); - $errorNode->appendChild($np); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotRecognizedPrincipal.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotRecognizedPrincipal.php deleted file mode 100644 index 9e95cc5142..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotRecognizedPrincipal.php +++ /dev/null @@ -1,35 +0,0 @@ -ownerDocument; - - $np = $doc->createElementNS('DAV:','d:recognized-principal'); - $errorNode->appendChild($np); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotSupportedPrivilege.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotSupportedPrivilege.php deleted file mode 100644 index 461ebe3f81..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Exception/NotSupportedPrivilege.php +++ /dev/null @@ -1,35 +0,0 @@ -ownerDocument; - - $np = $doc->createElementNS('DAV:','d:not-supported-privilege'); - $errorNode->appendChild($np); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IACL.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IACL.php deleted file mode 100644 index 31971d5444..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/IACL.php +++ /dev/null @@ -1,74 +0,0 @@ -getChild in the future. - * - * @param array $searchProperties - * @return array - */ - function searchPrincipals(array $searchProperties); - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Plugin.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Plugin.php deleted file mode 100644 index 89269b43b2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Plugin.php +++ /dev/null @@ -1,1402 +0,0 @@ - 'Display name', - '{http://sabredav.org/ns}email-address' => 'Email address', - ); - - /** - * Any principal uri's added here, will automatically be added to the list - * of ACL's. They will effectively receive {DAV:}all privileges, as a - * protected privilege. - * - * @var array - */ - public $adminPrincipals = array(); - - /** - * Returns a list of features added by this plugin. - * - * This list is used in the response of a HTTP OPTIONS request. - * - * @return array - */ - public function getFeatures() { - - return array('access-control', 'calendarserver-principal-property-search'); - - } - - /** - * Returns a list of available methods for a given url - * - * @param string $uri - * @return array - */ - public function getMethods($uri) { - - return array('ACL'); - - } - - /** - * Returns a plugin name. - * - * Using this name other plugins will be able to access other plugins - * using SabreForRainLoop\DAV\Server::getPlugin - * - * @return string - */ - public function getPluginName() { - - return 'acl'; - - } - - /** - * Returns a list of reports this plugin supports. - * - * This will be used in the {DAV:}supported-report-set property. - * Note that you still need to subscribe to the 'report' event to actually - * implement them - * - * @param string $uri - * @return array - */ - public function getSupportedReportSet($uri) { - - return array( - '{DAV:}expand-property', - '{DAV:}principal-property-search', - '{DAV:}principal-search-property-set', - ); - - } - - - /** - * Checks if the current user has the specified privilege(s). - * - * You can specify a single privilege, or a list of privileges. - * This method will throw an exception if the privilege is not available - * and return true otherwise. - * - * @param string $uri - * @param array|string $privileges - * @param int $recursion - * @param bool $throwExceptions if set to false, this method won't throw exceptions. - * @throws SabreForRainLoop\DAVACL\Exception\NeedPrivileges - * @return bool - */ - public function checkPrivileges($uri, $privileges, $recursion = self::R_PARENT, $throwExceptions = true) { - - if (!is_array($privileges)) $privileges = array($privileges); - - $acl = $this->getCurrentUserPrivilegeSet($uri); - - if (is_null($acl)) { - if ($this->allowAccessToNodesWithoutACL) { - return true; - } else { - if ($throwExceptions) - throw new Exception\NeedPrivileges($uri,$privileges); - else - return false; - - } - } - - $failed = array(); - foreach($privileges as $priv) { - - if (!in_array($priv, $acl)) { - $failed[] = $priv; - } - - } - - if ($failed) { - if ($throwExceptions) - throw new Exception\NeedPrivileges($uri,$failed); - else - return false; - } - return true; - - } - - /** - * Returns the standard users' principal. - * - * This is one authorative principal url for the current user. - * This method will return null if the user wasn't logged in. - * - * @return string|null - */ - public function getCurrentUserPrincipal() { - - $authPlugin = $this->server->getPlugin('auth'); - if (is_null($authPlugin)) return null; - /** @var $authPlugin SabreForRainLoop\DAV\Auth\Plugin */ - - $userName = $authPlugin->getCurrentUser(); - if (!$userName) return null; - - return $this->defaultUsernamePath . '/' . $userName; - - } - - - /** - * Returns a list of principals that's associated to the current - * user, either directly or through group membership. - * - * @return array - */ - public function getCurrentUserPrincipals() { - - $currentUser = $this->getCurrentUserPrincipal(); - - if (is_null($currentUser)) return array(); - - return array_merge( - array($currentUser), - $this->getPrincipalMembership($currentUser) - ); - - } - - /** - * This array holds a cache for all the principals that are associated with - * a single principal. - * - * @var array - */ - protected $principalMembershipCache = array(); - - - /** - * Returns all the principal groups the specified principal is a member of. - * - * @param string $principal - * @return array - */ - public function getPrincipalMembership($mainPrincipal) { - - // First check our cache - if (isset($this->principalMembershipCache[$mainPrincipal])) { - return $this->principalMembershipCache[$mainPrincipal]; - } - - $check = array($mainPrincipal); - $principals = array(); - - while(count($check)) { - - $principal = array_shift($check); - - $node = $this->server->tree->getNodeForPath($principal); - if ($node instanceof IPrincipal) { - foreach($node->getGroupMembership() as $groupMember) { - - if (!in_array($groupMember, $principals)) { - - $check[] = $groupMember; - $principals[] = $groupMember; - - } - - } - - } - - } - - // Store the result in the cache - $this->principalMembershipCache[$mainPrincipal] = $principals; - - return $principals; - - } - - /** - * Returns the supported privilege structure for this ACL plugin. - * - * See RFC3744 for more details. Currently we default on a simple, - * standard structure. - * - * You can either get the list of privileges by a uri (path) or by - * specifying a Node. - * - * @param string|DAV\INode $node - * @return array - */ - public function getSupportedPrivilegeSet($node) { - - if (is_string($node)) { - $node = $this->server->tree->getNodeForPath($node); - } - - if ($node instanceof IACL) { - $result = $node->getSupportedPrivilegeSet(); - - if ($result) - return $result; - } - - return self::getDefaultSupportedPrivilegeSet(); - - } - - /** - * Returns a fairly standard set of privileges, which may be useful for - * other systems to use as a basis. - * - * @return array - */ - static function getDefaultSupportedPrivilegeSet() { - - return array( - 'privilege' => '{DAV:}all', - 'abstract' => true, - 'aggregates' => array( - array( - 'privilege' => '{DAV:}read', - 'aggregates' => array( - array( - 'privilege' => '{DAV:}read-acl', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}read-current-user-privilege-set', - 'abstract' => true, - ), - ), - ), // {DAV:}read - array( - 'privilege' => '{DAV:}write', - 'aggregates' => array( - array( - 'privilege' => '{DAV:}write-acl', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}write-properties', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}write-content', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}bind', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}unbind', - 'abstract' => true, - ), - array( - 'privilege' => '{DAV:}unlock', - 'abstract' => true, - ), - ), - ), // {DAV:}write - ), - ); // {DAV:}all - - } - - /** - * Returns the supported privilege set as a flat list - * - * This is much easier to parse. - * - * The returned list will be index by privilege name. - * The value is a struct containing the following properties: - * - aggregates - * - abstract - * - concrete - * - * @param string|DAV\INode $node - * @return array - */ - final public function getFlatPrivilegeSet($node) { - - $privs = $this->getSupportedPrivilegeSet($node); - - $flat = array(); - $this->getFPSTraverse($privs, null, $flat); - - return $flat; - - } - - /** - * Traverses the privilege set tree for reordering - * - * This function is solely used by getFlatPrivilegeSet, and would have been - * a closure if it wasn't for the fact I need to support PHP 5.2. - * - * @param array $priv - * @param $concrete - * @param array $flat - * @return void - */ - final private function getFPSTraverse($priv, $concrete, &$flat) { - - $myPriv = array( - 'privilege' => $priv['privilege'], - 'abstract' => isset($priv['abstract']) && $priv['abstract'], - 'aggregates' => array(), - 'concrete' => isset($priv['abstract']) && $priv['abstract']?$concrete:$priv['privilege'], - ); - - if (isset($priv['aggregates'])) - foreach($priv['aggregates'] as $subPriv) $myPriv['aggregates'][] = $subPriv['privilege']; - - $flat[$priv['privilege']] = $myPriv; - - if (isset($priv['aggregates'])) { - - foreach($priv['aggregates'] as $subPriv) { - - $this->getFPSTraverse($subPriv, $myPriv['concrete'], $flat); - - } - - } - - } - - /** - * Returns the full ACL list. - * - * Either a uri or a DAV\INode may be passed. - * - * null will be returned if the node doesn't support ACLs. - * - * @param string|DAV\INode $node - * @return array - */ - public function getACL($node) { - - if (is_string($node)) { - $node = $this->server->tree->getNodeForPath($node); - } - if (!$node instanceof IACL) { - return null; - } - $acl = $node->getACL(); - foreach($this->adminPrincipals as $adminPrincipal) { - $acl[] = array( - 'principal' => $adminPrincipal, - 'privilege' => '{DAV:}all', - 'protected' => true, - ); - } - return $acl; - - } - - /** - * Returns a list of privileges the current user has - * on a particular node. - * - * Either a uri or a DAV\INode may be passed. - * - * null will be returned if the node doesn't support ACLs. - * - * @param string|DAV\INode $node - * @return array - */ - public function getCurrentUserPrivilegeSet($node) { - - if (is_string($node)) { - $node = $this->server->tree->getNodeForPath($node); - } - - $acl = $this->getACL($node); - - if (is_null($acl)) return null; - - $principals = $this->getCurrentUserPrincipals(); - - $collected = array(); - - foreach($acl as $ace) { - - $principal = $ace['principal']; - - switch($principal) { - - case '{DAV:}owner' : - $owner = $node->getOwner(); - if ($owner && in_array($owner, $principals)) { - $collected[] = $ace; - } - break; - - - // 'all' matches for every user - case '{DAV:}all' : - - // 'authenticated' matched for every user that's logged in. - // Since it's not possible to use ACL while not being logged - // in, this is also always true. - case '{DAV:}authenticated' : - $collected[] = $ace; - break; - - // 'unauthenticated' can never occur either, so we simply - // ignore these. - case '{DAV:}unauthenticated' : - break; - - default : - if (in_array($ace['principal'], $principals)) { - $collected[] = $ace; - } - break; - - } - - - } - - // Now we deduct all aggregated privileges. - $flat = $this->getFlatPrivilegeSet($node); - - $collected2 = array(); - while(count($collected)) { - - $current = array_pop($collected); - $collected2[] = $current['privilege']; - - foreach($flat[$current['privilege']]['aggregates'] as $subPriv) { - $collected2[] = $subPriv; - $collected[] = $flat[$subPriv]; - } - - } - - return array_values(array_unique($collected2)); - - } - - /** - * Principal property search - * - * This method can search for principals matching certain values in - * properties. - * - * This method will return a list of properties for the matched properties. - * - * @param array $searchProperties The properties to search on. This is a - * key-value list. The keys are property - * names, and the values the strings to - * match them on. - * @param array $requestedProperties This is the list of properties to - * return for every match. - * @param string $collectionUri The principal collection to search on. - * If this is ommitted, the standard - * principal collection-set will be used. - * @return array This method returns an array structure similar to - * SabreForRainLoop\DAV\Server::getPropertiesForPath. Returned - * properties are index by a HTTP status code. - * - */ - public function principalSearch(array $searchProperties, array $requestedProperties, $collectionUri = null) { - - if (!is_null($collectionUri)) { - $uris = array($collectionUri); - } else { - $uris = $this->principalCollectionSet; - } - - $lookupResults = array(); - foreach($uris as $uri) { - - $principalCollection = $this->server->tree->getNodeForPath($uri); - if (!$principalCollection instanceof IPrincipalCollection) { - // Not a principal collection, we're simply going to ignore - // this. - continue; - } - - $results = $principalCollection->searchPrincipals($searchProperties); - foreach($results as $result) { - $lookupResults[] = rtrim($uri,'/') . '/' . $result; - } - - } - - $matches = array(); - - foreach($lookupResults as $lookupResult) { - - list($matches[]) = $this->server->getPropertiesForPath($lookupResult, $requestedProperties, 0); - - } - - return $matches; - - } - - /** - * Sets up the plugin - * - * This method is automatically called by the server class. - * - * @param DAV\Server $server - * @return void - */ - public function initialize(DAV\Server $server) { - - $this->server = $server; - $server->subscribeEvent('beforeGetProperties',array($this,'beforeGetProperties')); - - $server->subscribeEvent('beforeMethod', array($this,'beforeMethod'),20); - $server->subscribeEvent('beforeBind', array($this,'beforeBind'),20); - $server->subscribeEvent('beforeUnbind', array($this,'beforeUnbind'),20); - $server->subscribeEvent('updateProperties',array($this,'updateProperties')); - $server->subscribeEvent('beforeUnlock', array($this,'beforeUnlock'),20); - $server->subscribeEvent('report',array($this,'report')); - $server->subscribeEvent('unknownMethod', array($this, 'unknownMethod')); - - array_push($server->protectedProperties, - '{DAV:}alternate-URI-set', - '{DAV:}principal-URL', - '{DAV:}group-membership', - '{DAV:}principal-collection-set', - '{DAV:}current-user-principal', - '{DAV:}supported-privilege-set', - '{DAV:}current-user-privilege-set', - '{DAV:}acl', - '{DAV:}acl-restrictions', - '{DAV:}inherited-acl-set', - '{DAV:}owner', - '{DAV:}group' - ); - - // Automatically mapping nodes implementing IPrincipal to the - // {DAV:}principal resourcetype. - $server->resourceTypeMapping['SabreForRainLoop\\DAVACL\\IPrincipal'] = '{DAV:}principal'; - - // Mapping the group-member-set property to the HrefList property - // class. - $server->propertyMap['{DAV:}group-member-set'] = 'SabreForRainLoop\\DAV\\Property\\HrefList'; - - } - - - /* {{{ Event handlers */ - - /** - * Triggered before any method is handled - * - * @param string $method - * @param string $uri - * @return void - */ - public function beforeMethod($method, $uri) { - - $exists = $this->server->tree->nodeExists($uri); - - // If the node doesn't exists, none of these checks apply - if (!$exists) return; - - switch($method) { - - case 'GET' : - case 'HEAD' : - case 'OPTIONS' : - // For these 3 we only need to know if the node is readable. - $this->checkPrivileges($uri,'{DAV:}read'); - break; - - case 'PUT' : - case 'LOCK' : - case 'UNLOCK' : - // This method requires the write-content priv if the node - // already exists, and bind on the parent if the node is being - // created. - // The bind privilege is handled in the beforeBind event. - $this->checkPrivileges($uri,'{DAV:}write-content'); - break; - - - case 'PROPPATCH' : - $this->checkPrivileges($uri,'{DAV:}write-properties'); - break; - - case 'ACL' : - $this->checkPrivileges($uri,'{DAV:}write-acl'); - break; - - case 'COPY' : - case 'MOVE' : - // Copy requires read privileges on the entire source tree. - // If the target exists write-content normally needs to be - // checked, however, we're deleting the node beforehand and - // creating a new one after, so this is handled by the - // beforeUnbind event. - // - // The creation of the new node is handled by the beforeBind - // event. - // - // If MOVE is used beforeUnbind will also be used to check if - // the sourcenode can be deleted. - $this->checkPrivileges($uri,'{DAV:}read',self::R_RECURSIVE); - - break; - - } - - } - - /** - * Triggered before a new node is created. - * - * This allows us to check permissions for any operation that creates a - * new node, such as PUT, MKCOL, MKCALENDAR, LOCK, COPY and MOVE. - * - * @param string $uri - * @return void - */ - public function beforeBind($uri) { - - list($parentUri,$nodeName) = DAV\URLUtil::splitPath($uri); - $this->checkPrivileges($parentUri,'{DAV:}bind'); - - } - - /** - * Triggered before a node is deleted - * - * This allows us to check permissions for any operation that will delete - * an existing node. - * - * @param string $uri - * @return void - */ - public function beforeUnbind($uri) { - - list($parentUri,$nodeName) = DAV\URLUtil::splitPath($uri); - $this->checkPrivileges($parentUri,'{DAV:}unbind',self::R_RECURSIVEPARENTS); - - } - - /** - * Triggered before a node is unlocked. - * - * @param string $uri - * @param DAV\Locks\LockInfo $lock - * @TODO: not yet implemented - * @return void - */ - public function beforeUnlock($uri, DAV\Locks\LockInfo $lock) { - - - } - - /** - * Triggered before properties are looked up in specific nodes. - * - * @param string $uri - * @param DAV\INode $node - * @param array $requestedProperties - * @param array $returnedProperties - * @TODO really should be broken into multiple methods, or even a class. - * @return bool - */ - public function beforeGetProperties($uri, DAV\INode $node, &$requestedProperties, &$returnedProperties) { - - // Checking the read permission - if (!$this->checkPrivileges($uri,'{DAV:}read',self::R_PARENT,false)) { - - // User is not allowed to read properties - if ($this->hideNodesFromListings) { - return false; - } - - // Marking all requested properties as '403'. - foreach($requestedProperties as $key=>$requestedProperty) { - unset($requestedProperties[$key]); - $returnedProperties[403][$requestedProperty] = null; - } - return; - - } - - /* Adding principal properties */ - if ($node instanceof IPrincipal) { - - if (false !== ($index = array_search('{DAV:}alternate-URI-set', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}alternate-URI-set'] = new DAV\Property\HrefList($node->getAlternateUriSet()); - - } - if (false !== ($index = array_search('{DAV:}principal-URL', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}principal-URL'] = new DAV\Property\Href($node->getPrincipalUrl() . '/'); - - } - if (false !== ($index = array_search('{DAV:}group-member-set', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}group-member-set'] = new DAV\Property\HrefList($node->getGroupMemberSet()); - - } - if (false !== ($index = array_search('{DAV:}group-membership', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}group-membership'] = new DAV\Property\HrefList($node->getGroupMembership()); - - } - - if (false !== ($index = array_search('{DAV:}displayname', $requestedProperties))) { - - $returnedProperties[200]['{DAV:}displayname'] = $node->getDisplayName(); - - } - - } - if (false !== ($index = array_search('{DAV:}principal-collection-set', $requestedProperties))) { - - unset($requestedProperties[$index]); - $val = $this->principalCollectionSet; - // Ensuring all collections end with a slash - foreach($val as $k=>$v) $val[$k] = $v . '/'; - $returnedProperties[200]['{DAV:}principal-collection-set'] = new DAV\Property\HrefList($val); - - } - if (false !== ($index = array_search('{DAV:}current-user-principal', $requestedProperties))) { - - unset($requestedProperties[$index]); - if ($url = $this->getCurrentUserPrincipal()) { - $returnedProperties[200]['{DAV:}current-user-principal'] = new Property\Principal(Property\Principal::HREF, $url . '/'); - } else { - $returnedProperties[200]['{DAV:}current-user-principal'] = new Property\Principal(Property\Principal::UNAUTHENTICATED); - } - - } - if (false !== ($index = array_search('{DAV:}supported-privilege-set', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}supported-privilege-set'] = new Property\SupportedPrivilegeSet($this->getSupportedPrivilegeSet($node)); - - } - if (false !== ($index = array_search('{DAV:}current-user-privilege-set', $requestedProperties))) { - - if (!$this->checkPrivileges($uri, '{DAV:}read-current-user-privilege-set', self::R_PARENT, false)) { - $returnedProperties[403]['{DAV:}current-user-privilege-set'] = null; - unset($requestedProperties[$index]); - } else { - $val = $this->getCurrentUserPrivilegeSet($node); - if (!is_null($val)) { - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}current-user-privilege-set'] = new Property\CurrentUserPrivilegeSet($val); - } - } - - } - - /* The ACL property contains all the permissions */ - if (false !== ($index = array_search('{DAV:}acl', $requestedProperties))) { - - if (!$this->checkPrivileges($uri, '{DAV:}read-acl', self::R_PARENT, false)) { - - unset($requestedProperties[$index]); - $returnedProperties[403]['{DAV:}acl'] = null; - - } else { - - $acl = $this->getACL($node); - if (!is_null($acl)) { - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}acl'] = new Property\Acl($this->getACL($node)); - } - - } - - } - - /* The acl-restrictions property contains information on how privileges - * must behave. - */ - if (false !== ($index = array_search('{DAV:}acl-restrictions', $requestedProperties))) { - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}acl-restrictions'] = new Property\AclRestrictions(); - } - - /* Adding ACL properties */ - if ($node instanceof IACL) { - - if (false !== ($index = array_search('{DAV:}owner', $requestedProperties))) { - - unset($requestedProperties[$index]); - $returnedProperties[200]['{DAV:}owner'] = new DAV\Property\Href($node->getOwner() . '/'); - - } - - } - - } - - /** - * This method intercepts PROPPATCH methods and make sure the - * group-member-set is updated correctly. - * - * @param array $propertyDelta - * @param array $result - * @param DAV\INode $node - * @return bool - */ - public function updateProperties(&$propertyDelta, &$result, DAV\INode $node) { - - if (!array_key_exists('{DAV:}group-member-set', $propertyDelta)) - return; - - if (is_null($propertyDelta['{DAV:}group-member-set'])) { - $memberSet = array(); - } elseif ($propertyDelta['{DAV:}group-member-set'] instanceof DAV\Property\HrefList) { - $memberSet = array_map( - array($this->server,'calculateUri'), - $propertyDelta['{DAV:}group-member-set']->getHrefs() - ); - } else { - throw new DAV\Exception('The group-member-set property MUST be an instance of SabreForRainLoop\DAV\Property\HrefList or null'); - } - - if (!($node instanceof IPrincipal)) { - $result[403]['{DAV:}group-member-set'] = null; - unset($propertyDelta['{DAV:}group-member-set']); - - // Returning false will stop the updateProperties process - return false; - } - - $node->setGroupMemberSet($memberSet); - // We must also clear our cache, just in case - - $this->principalMembershipCache = array(); - - $result[200]['{DAV:}group-member-set'] = null; - unset($propertyDelta['{DAV:}group-member-set']); - - } - - /** - * This method handles HTTP REPORT requests - * - * @param string $reportName - * @param \DOMNode $dom - * @return bool - */ - public function report($reportName, $dom) { - - switch($reportName) { - - case '{DAV:}principal-property-search' : - $this->principalPropertySearchReport($dom); - return false; - case '{DAV:}principal-search-property-set' : - $this->principalSearchPropertySetReport($dom); - return false; - case '{DAV:}expand-property' : - $this->expandPropertyReport($dom); - return false; - - } - - } - - /** - * This event is triggered for any HTTP method that is not known by the - * webserver. - * - * @param string $method - * @param string $uri - * @return bool - */ - public function unknownMethod($method, $uri) { - - if ($method!=='ACL') return; - - $this->httpACL($uri); - return false; - - } - - /** - * This method is responsible for handling the 'ACL' event. - * - * @param string $uri - * @return void - */ - public function httpACL($uri) { - - $body = $this->server->httpRequest->getBody(true); - $dom = DAV\XMLUtil::loadDOMDocument($body); - - $newAcl = - Property\Acl::unserialize($dom->firstChild) - ->getPrivileges(); - - // Normalizing urls - foreach($newAcl as $k=>$newAce) { - $newAcl[$k]['principal'] = $this->server->calculateUri($newAce['principal']); - } - - $node = $this->server->tree->getNodeForPath($uri); - - if (!($node instanceof IACL)) { - throw new DAV\Exception\MethodNotAllowed('This node does not support the ACL method'); - } - - $oldAcl = $this->getACL($node); - - $supportedPrivileges = $this->getFlatPrivilegeSet($node); - - /* Checking if protected principals from the existing principal set are - not overwritten. */ - foreach($oldAcl as $oldAce) { - - if (!isset($oldAce['protected']) || !$oldAce['protected']) continue; - - $found = false; - foreach($newAcl as $newAce) { - if ( - $newAce['privilege'] === $oldAce['privilege'] && - $newAce['principal'] === $oldAce['principal'] && - $newAce['protected'] - ) - $found = true; - } - - if (!$found) - throw new Exception\AceConflict('This resource contained a protected {DAV:}ace, but this privilege did not occur in the ACL request'); - - } - - foreach($newAcl as $newAce) { - - // Do we recognize the privilege - if (!isset($supportedPrivileges[$newAce['privilege']])) { - throw new Exception\NotSupportedPrivilege('The privilege you specified (' . $newAce['privilege'] . ') is not recognized by this server'); - } - - if ($supportedPrivileges[$newAce['privilege']]['abstract']) { - throw new Exception\NoAbstract('The privilege you specified (' . $newAce['privilege'] . ') is an abstract privilege'); - } - - // Looking up the principal - try { - $principal = $this->server->tree->getNodeForPath($newAce['principal']); - } catch (DAV\Exception\NotFound $e) { - throw new Exception\NotRecognizedPrincipal('The specified principal (' . $newAce['principal'] . ') does not exist'); - } - if (!($principal instanceof IPrincipal)) { - throw new Exception\NotRecognizedPrincipal('The specified uri (' . $newAce['principal'] . ') is not a principal'); - } - - } - $node->setACL($newAcl); - - } - - /* }}} */ - - /* Reports {{{ */ - - /** - * The expand-property report is defined in RFC3253 section 3-8. - * - * This report is very similar to a standard PROPFIND. The difference is - * that it has the additional ability to look at properties containing a - * {DAV:}href element, follow that property and grab additional elements - * there. - * - * Other rfc's, such as ACL rely on this report, so it made sense to put - * it in this plugin. - * - * @param \DOMElement $dom - * @return void - */ - protected function expandPropertyReport($dom) { - - $requestedProperties = $this->parseExpandPropertyReportRequest($dom->firstChild->firstChild); - $depth = $this->server->getHTTPDepth(0); - $requestUri = $this->server->getRequestUri(); - - $result = $this->expandProperties($requestUri,$requestedProperties,$depth); - - $dom = new \DOMDocument('1.0','utf-8'); - $dom->formatOutput = true; - $multiStatus = $dom->createElement('d:multistatus'); - $dom->appendChild($multiStatus); - - // Adding in default namespaces - foreach($this->server->xmlNamespaces as $namespace=>$prefix) { - - $multiStatus->setAttribute('xmlns:' . $prefix,$namespace); - - } - - foreach($result as $response) { - $response->serialize($this->server, $multiStatus); - } - - $xml = $dom->saveXML(); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->sendBody($xml); - - } - - /** - * This method is used by expandPropertyReport to parse - * out the entire HTTP request. - * - * @param \DOMElement $node - * @return array - */ - protected function parseExpandPropertyReportRequest($node) { - - $requestedProperties = array(); - do { - - if (DAV\XMLUtil::toClarkNotation($node)!=='{DAV:}property') continue; - - if ($node->firstChild) { - - $children = $this->parseExpandPropertyReportRequest($node->firstChild); - - } else { - - $children = array(); - - } - - $namespace = $node->getAttribute('namespace'); - if (!$namespace) $namespace = 'DAV:'; - - $propName = '{'.$namespace.'}' . $node->getAttribute('name'); - $requestedProperties[$propName] = $children; - - } while ($node = $node->nextSibling); - - return $requestedProperties; - - } - - /** - * This method expands all the properties and returns - * a list with property values - * - * @param array $path - * @param array $requestedProperties the list of required properties - * @param int $depth - * @return array - */ - protected function expandProperties($path, array $requestedProperties, $depth) { - - $foundProperties = $this->server->getPropertiesForPath($path, array_keys($requestedProperties), $depth); - - $result = array(); - - foreach($foundProperties as $node) { - - foreach($requestedProperties as $propertyName=>$childRequestedProperties) { - - // We're only traversing if sub-properties were requested - if(count($childRequestedProperties)===0) continue; - - // We only have to do the expansion if the property was found - // and it contains an href element. - if (!array_key_exists($propertyName,$node[200])) continue; - - if ($node[200][$propertyName] instanceof DAV\Property\IHref) { - $hrefs = array($node[200][$propertyName]->getHref()); - } elseif ($node[200][$propertyName] instanceof DAV\Property\HrefList) { - $hrefs = $node[200][$propertyName]->getHrefs(); - } - - $childProps = array(); - foreach($hrefs as $href) { - $childProps = array_merge($childProps, $this->expandProperties($href, $childRequestedProperties, 0)); - } - $node[200][$propertyName] = new DAV\Property\ResponseList($childProps); - - } - $result[] = new DAV\Property\Response($node['href'], $node); - - } - - return $result; - - } - - /** - * principalSearchPropertySetReport - * - * This method responsible for handing the - * {DAV:}principal-search-property-set report. This report returns a list - * of properties the client may search on, using the - * {DAV:}principal-property-search report. - * - * @param \DOMDocument $dom - * @return void - */ - protected function principalSearchPropertySetReport(\DOMDocument $dom) { - - $httpDepth = $this->server->getHTTPDepth(0); - if ($httpDepth!==0) { - throw new DAV\Exception\BadRequest('This report is only defined when Depth: 0'); - } - - if ($dom->firstChild->hasChildNodes()) - throw new DAV\Exception\BadRequest('The principal-search-property-set report element is not allowed to have child elements'); - - $dom = new \DOMDocument('1.0','utf-8'); - $dom->formatOutput = true; - $root = $dom->createElement('d:principal-search-property-set'); - $dom->appendChild($root); - // Adding in default namespaces - foreach($this->server->xmlNamespaces as $namespace=>$prefix) { - - $root->setAttribute('xmlns:' . $prefix,$namespace); - - } - - $nsList = $this->server->xmlNamespaces; - - foreach($this->principalSearchPropertySet as $propertyName=>$description) { - - $psp = $dom->createElement('d:principal-search-property'); - $root->appendChild($psp); - - $prop = $dom->createElement('d:prop'); - $psp->appendChild($prop); - - $propName = null; - preg_match('/^{([^}]*)}(.*)$/',$propertyName,$propName); - - $currentProperty = $dom->createElement($nsList[$propName[1]] . ':' . $propName[2]); - $prop->appendChild($currentProperty); - - $descriptionElem = $dom->createElement('d:description'); - $descriptionElem->setAttribute('xml:lang','en'); - $descriptionElem->appendChild($dom->createTextNode($description)); - $psp->appendChild($descriptionElem); - - - } - - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->sendStatus(200); - $this->server->httpResponse->sendBody($dom->saveXML()); - - } - - /** - * principalPropertySearchReport - * - * This method is responsible for handing the - * {DAV:}principal-property-search report. This report can be used for - * clients to search for groups of principals, based on the value of one - * or more properties. - * - * @param \DOMDocument $dom - * @return void - */ - protected function principalPropertySearchReport(\DOMDocument $dom) { - - list($searchProperties, $requestedProperties, $applyToPrincipalCollectionSet) = $this->parsePrincipalPropertySearchReportRequest($dom); - - $uri = null; - if (!$applyToPrincipalCollectionSet) { - $uri = $this->server->getRequestUri(); - } - $result = $this->principalSearch($searchProperties, $requestedProperties, $uri); - - $prefer = $this->server->getHTTPPRefer(); - - $this->server->httpResponse->sendStatus(207); - $this->server->httpResponse->setHeader('Content-Type','application/xml; charset=utf-8'); - $this->server->httpResponse->setHeader('Vary','Brief,Prefer'); - $this->server->httpResponse->sendBody($this->server->generateMultiStatus($result, $prefer['return-minimal'])); - - } - - /** - * parsePrincipalPropertySearchReportRequest - * - * This method parses the request body from a - * {DAV:}principal-property-search report. - * - * This method returns an array with two elements: - * 1. an array with properties to search on, and their values - * 2. a list of propertyvalues that should be returned for the request. - * - * @param \DOMDocument $dom - * @return array - */ - protected function parsePrincipalPropertySearchReportRequest($dom) { - - $httpDepth = $this->server->getHTTPDepth(0); - if ($httpDepth!==0) { - throw new DAV\Exception\BadRequest('This report is only defined when Depth: 0'); - } - - $searchProperties = array(); - - $applyToPrincipalCollectionSet = false; - - // Parsing the search request - foreach($dom->firstChild->childNodes as $searchNode) { - - if (DAV\XMLUtil::toClarkNotation($searchNode) == '{DAV:}apply-to-principal-collection-set') { - $applyToPrincipalCollectionSet = true; - } - - if (DAV\XMLUtil::toClarkNotation($searchNode)!=='{DAV:}property-search') - continue; - - $propertyName = null; - $propertyValue = null; - - foreach($searchNode->childNodes as $childNode) { - - switch(DAV\XMLUtil::toClarkNotation($childNode)) { - - case '{DAV:}prop' : - $property = DAV\XMLUtil::parseProperties($searchNode); - reset($property); - $propertyName = key($property); - break; - - case '{DAV:}match' : - $propertyValue = $childNode->textContent; - break; - - } - - - } - - if (is_null($propertyName) || is_null($propertyValue)) - throw new DAV\Exception\BadRequest('Invalid search request. propertyname: ' . $propertyName . '. propertvvalue: ' . $propertyValue); - - $searchProperties[$propertyName] = $propertyValue; - - } - - return array($searchProperties, array_keys(DAV\XMLUtil::parseProperties($dom->firstChild)), $applyToPrincipalCollectionSet); - - } - - - /* }}} */ - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php deleted file mode 100644 index b2d9e9da50..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Principal.php +++ /dev/null @@ -1,281 +0,0 @@ -principalBackend = $principalBackend; - $this->principalProperties = $principalProperties; - - } - - /** - * Returns the full principal url - * - * @return string - */ - public function getPrincipalUrl() { - - return $this->principalProperties['uri']; - - } - - /** - * Returns a list of alternative urls for a principal - * - * This can for example be an email address, or ldap url. - * - * @return array - */ - public function getAlternateUriSet() { - - $uris = array(); - if (isset($this->principalProperties['{DAV:}alternate-URI-set'])) { - - $uris = $this->principalProperties['{DAV:}alternate-URI-set']; - - } - - if (isset($this->principalProperties['{http://sabredav.org/ns}email-address'])) { - $uris[] = 'mailto:' . $this->principalProperties['{http://sabredav.org/ns}email-address']; - } - - return array_unique($uris); - - } - - /** - * Returns the list of group members - * - * If this principal is a group, this function should return - * all member principal uri's for the group. - * - * @return array - */ - public function getGroupMemberSet() { - - return $this->principalBackend->getGroupMemberSet($this->principalProperties['uri']); - - } - - /** - * Returns the list of groups this principal is member of - * - * If this principal is a member of a (list of) groups, this function - * should return a list of principal uri's for it's members. - * - * @return array - */ - public function getGroupMembership() { - - return $this->principalBackend->getGroupMemberShip($this->principalProperties['uri']); - - } - - - /** - * Sets a list of group members - * - * If this principal is a group, this method sets all the group members. - * The list of members is always overwritten, never appended to. - * - * This method should throw an exception if the members could not be set. - * - * @param array $groupMembers - * @return void - */ - public function setGroupMemberSet(array $groupMembers) { - - $this->principalBackend->setGroupMemberSet($this->principalProperties['uri'], $groupMembers); - - } - - - /** - * Returns this principals name. - * - * @return string - */ - public function getName() { - - $uri = $this->principalProperties['uri']; - list(, $name) = DAV\URLUtil::splitPath($uri); - return $name; - - } - - /** - * Returns the name of the user - * - * @return string - */ - public function getDisplayName() { - - if (isset($this->principalProperties['{DAV:}displayname'])) { - return $this->principalProperties['{DAV:}displayname']; - } else { - return $this->getName(); - } - - } - - /** - * Returns a list of properties - * - * @param array $requestedProperties - * @return array - */ - public function getProperties($requestedProperties) { - - $newProperties = array(); - foreach($requestedProperties as $propName) { - - if (isset($this->principalProperties[$propName])) { - $newProperties[$propName] = $this->principalProperties[$propName]; - } - - } - - return $newProperties; - - } - - /** - * Updates this principals properties. - * - * @param array $mutations - * @see SabreForRainLoop\DAV\IProperties::updateProperties - * @return bool|array - */ - public function updateProperties($mutations) { - - return $this->principalBackend->updatePrincipal($this->principalProperties['uri'], $mutations); - - } - - /** - * Returns the owner principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getOwner() { - - return $this->principalProperties['uri']; - - - } - - /** - * Returns a group principal - * - * This must be a url to a principal, or null if there's no owner - * - * @return string|null - */ - public function getGroup() { - - return null; - - } - - /** - * Returns a list of ACE's for this node. - * - * Each ACE has the following properties: - * * 'privilege', a string such as {DAV:}read or {DAV:}write. These are - * currently the only supported privileges - * * 'principal', a url to the principal who owns the node - * * 'protected' (optional), indicating that this ACE is not allowed to - * be updated. - * - * @return array - */ - public function getACL() { - - return array( - array( - 'privilege' => '{DAV:}read', - 'principal' => $this->getPrincipalUrl(), - 'protected' => true, - ), - ); - - } - - /** - * Updates the ACL - * - * This method will receive a list of new ACE's. - * - * @param array $acl - * @return void - */ - public function setACL(array $acl) { - - throw new DAV\Exception\MethodNotAllowed('Updating ACLs is not allowed here'); - - } - - /** - * Returns the list of supported privileges for this node. - * - * The returned data structure is a list of nested privileges. - * See SabreForRainLoop\DAVACL\Plugin::getDefaultSupportedPrivilegeSet for a simple - * standard structure. - * - * If null is returned from this method, the default privilege set is used, - * which is fine for most common usecases. - * - * @return array|null - */ - public function getSupportedPrivilegeSet() { - - return null; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/AbstractBackend.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/AbstractBackend.php deleted file mode 100644 index 3f500e3001..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/AbstractBackend.php +++ /dev/null @@ -1,18 +0,0 @@ - array( - * '{DAV:}prop1' => null, - * ), - * 201 => array( - * '{DAV:}prop2' => null, - * ), - * 403 => array( - * '{DAV:}prop3' => null, - * ), - * 424 => array( - * '{DAV:}prop4' => null, - * ), - * ); - * - * In this previous example prop1 was successfully updated or deleted, and - * prop2 was succesfully created. - * - * prop3 failed to update due to '403 Forbidden' and because of this prop4 - * also could not be updated with '424 Failed dependency'. - * - * This last example was actually incorrect. While 200 and 201 could appear - * in 1 response, if there's any error (403) the other properties should - * always fail with 423 (failed dependency). - * - * But anyway, if you don't want to scratch your head over this, just - * return true or false. - * - * @param string $path - * @param array $mutations - * @return array|bool - */ - function updatePrincipal($path, $mutations); - - /** - * This method is used to search for principals matching a set of - * properties. - * - * This search is specifically used by RFC3744's principal-property-search - * REPORT. You should at least allow searching on - * http://sabredav.org/ns}email-address. - * - * The actual search should be a unicode-non-case-sensitive search. The - * keys in searchProperties are the WebDAV property names, while the values - * are the property values to search on. - * - * If multiple properties are being searched on, the search should be - * AND'ed. - * - * This method should simply return an array with full principal uri's. - * - * If somebody attempted to search on a property the backend does not - * support, you should simply return 0 results. - * - * You can also just return 0 results if you choose to not support - * searching at all, but keep in mind that this may stop certain features - * from working. - * - * @param string $prefixPath - * @param array $searchProperties - * @return array - */ - function searchPrincipals($prefixPath, array $searchProperties); - - /** - * Returns the list of members for a group-principal - * - * @param string $principal - * @return array - */ - function getGroupMemberSet($principal); - - /** - * Returns the list of groups a principal is a member of - * - * @param string $principal - * @return array - */ - function getGroupMembership($principal); - - /** - * Updates the list of group members for a group principal. - * - * The principals should be passed as a list of uri's. - * - * @param string $principal - * @param array $members - * @return void - */ - function setGroupMemberSet($principal, array $members); - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/PDO.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/PDO.php deleted file mode 100644 index 4717c495a8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalBackend/PDO.php +++ /dev/null @@ -1,428 +0,0 @@ - array( - 'dbField' => 'displayname', - ), - - /** - * This property is actually used by the CardDAV plugin, where it gets - * mapped to {http://calendarserver.orgi/ns/}me-card. - * - * The reason we don't straight-up use that property, is because - * me-card is defined as a property on the users' addressbook - * collection. - */ - '{http://sabredav.org/ns}vcard-url' => array( - 'dbField' => 'vcardurl', - ), - /** - * This is the users' primary email-address. - */ - '{http://sabredav.org/ns}email-address' => array( - 'dbField' => 'email', - ), - ); - - /** - * Sets up the backend. - * - * @param PDO $pdo - * @param string $tableName - * @param string $groupMembersTableName - */ - public function __construct(\PDO $pdo, $tableName = 'principals', $groupMembersTableName = 'groupmembers') { - - $this->pdo = $pdo; - $this->tableName = $tableName; - $this->groupMembersTableName = $groupMembersTableName; - - } - - - /** - * Returns a list of principals based on a prefix. - * - * This prefix will often contain something like 'principals'. You are only - * expected to return principals that are in this base path. - * - * You are expected to return at least a 'uri' for every user, you can - * return any additional properties if you wish so. Common properties are: - * {DAV:}displayname - * {http://sabredav.org/ns}email-address - This is a custom SabreDAV - * field that's actualy injected in a number of other properties. If - * you have an email address, use this property. - * - * @param string $prefixPath - * @return array - */ - public function getPrincipalsByPrefix($prefixPath) { - - $fields = array( - 'uri', - ); - - foreach($this->fieldMap as $key=>$value) { - $fields[] = $value['dbField']; - } - $result = $this->pdo->query('SELECT '.implode(',', $fields).' FROM '. $this->tableName); - - $principals = array(); - - while($row = $result->fetch(\PDO::FETCH_ASSOC)) { - - // Checking if the principal is in the prefix - list($rowPrefix) = DAV\URLUtil::splitPath($row['uri']); - if ($rowPrefix !== $prefixPath) continue; - - $principal = array( - 'uri' => $row['uri'], - ); - foreach($this->fieldMap as $key=>$value) { - if ($row[$value['dbField']]) { - $principal[$key] = $row[$value['dbField']]; - } - } - $principals[] = $principal; - - } - - return $principals; - - } - - /** - * Returns a specific principal, specified by it's path. - * The returned structure should be the exact same as from - * getPrincipalsByPrefix. - * - * @param string $path - * @return array - */ - public function getPrincipalByPath($path) { - - $fields = array( - 'id', - 'uri', - ); - - foreach($this->fieldMap as $key=>$value) { - $fields[] = $value['dbField']; - } - $stmt = $this->pdo->prepare('SELECT '.implode(',', $fields).' FROM '. $this->tableName . ' WHERE uri = ?'); - $stmt->execute(array($path)); - - $row = $stmt->fetch(\PDO::FETCH_ASSOC); - if (!$row) return; - - $principal = array( - 'id' => $row['id'], - 'uri' => $row['uri'], - ); - foreach($this->fieldMap as $key=>$value) { - if ($row[$value['dbField']]) { - $principal[$key] = $row[$value['dbField']]; - } - } - return $principal; - - } - - /** - * Updates one ore more webdav properties on a principal. - * - * The list of mutations is supplied as an array. Each key in the array is - * a propertyname, such as {DAV:}displayname. - * - * Each value is the actual value to be updated. If a value is null, it - * must be deleted. - * - * This method should be atomic. It must either completely succeed, or - * completely fail. Success and failure can simply be returned as 'true' or - * 'false'. - * - * It is also possible to return detailed failure information. In that case - * an array such as this should be returned: - * - * array( - * 200 => array( - * '{DAV:}prop1' => null, - * ), - * 201 => array( - * '{DAV:}prop2' => null, - * ), - * 403 => array( - * '{DAV:}prop3' => null, - * ), - * 424 => array( - * '{DAV:}prop4' => null, - * ), - * ); - * - * In this previous example prop1 was successfully updated or deleted, and - * prop2 was succesfully created. - * - * prop3 failed to update due to '403 Forbidden' and because of this prop4 - * also could not be updated with '424 Failed dependency'. - * - * This last example was actually incorrect. While 200 and 201 could appear - * in 1 response, if there's any error (403) the other properties should - * always fail with 423 (failed dependency). - * - * But anyway, if you don't want to scratch your head over this, just - * return true or false. - * - * @param string $path - * @param array $mutations - * @return array|bool - */ - public function updatePrincipal($path, $mutations) { - - $updateAble = array(); - foreach($mutations as $key=>$value) { - - // We are not aware of this field, we must fail. - if (!isset($this->fieldMap[$key])) { - - $response = array( - 403 => array( - $key => null, - ), - 424 => array(), - ); - - // Adding the rest to the response as a 424 - foreach($mutations as $subKey=>$subValue) { - if ($subKey !== $key) { - $response[424][$subKey] = null; - } - } - return $response; - } - - $updateAble[$this->fieldMap[$key]['dbField']] = $value; - - } - - // No fields to update - $query = "UPDATE " . $this->tableName . " SET "; - - $first = true; - foreach($updateAble as $key => $value) { - if (!$first) { - $query.= ', '; - } - $first = false; - $query.= "$key = :$key "; - } - $query.='WHERE uri = :uri'; - $stmt = $this->pdo->prepare($query); - $updateAble['uri'] = $path; - $stmt->execute($updateAble); - - return true; - - } - - /** - * This method is used to search for principals matching a set of - * properties. - * - * This search is specifically used by RFC3744's principal-property-search - * REPORT. You should at least allow searching on - * http://sabredav.org/ns}email-address. - * - * The actual search should be a unicode-non-case-sensitive search. The - * keys in searchProperties are the WebDAV property names, while the values - * are the property values to search on. - * - * If multiple properties are being searched on, the search should be - * AND'ed. - * - * This method should simply return an array with full principal uri's. - * - * If somebody attempted to search on a property the backend does not - * support, you should simply return 0 results. - * - * You can also just return 0 results if you choose to not support - * searching at all, but keep in mind that this may stop certain features - * from working. - * - * @param string $prefixPath - * @param array $searchProperties - * @return array - */ - public function searchPrincipals($prefixPath, array $searchProperties) { - - $query = 'SELECT uri FROM ' . $this->tableName . ' WHERE 1=1 '; - $values = array(); - foreach($searchProperties as $property => $value) { - - switch($property) { - - case '{DAV:}displayname' : - $query.=' AND displayname LIKE ?'; - $values[] = '%' . $value . '%'; - break; - case '{http://sabredav.org/ns}email-address' : - $query.=' AND email LIKE ?'; - $values[] = '%' . $value . '%'; - break; - default : - // Unsupported property - return array(); - - } - - } - $stmt = $this->pdo->prepare($query); - $stmt->execute($values); - - $principals = array(); - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - - // Checking if the principal is in the prefix - list($rowPrefix) = DAV\URLUtil::splitPath($row['uri']); - if ($rowPrefix !== $prefixPath) continue; - - $principals[] = $row['uri']; - - } - - return $principals; - - } - - /** - * Returns the list of members for a group-principal - * - * @param string $principal - * @return array - */ - public function getGroupMemberSet($principal) { - - $principal = $this->getPrincipalByPath($principal); - if (!$principal) throw new DAV\Exception('Principal not found'); - - $stmt = $this->pdo->prepare('SELECT principals.uri as uri FROM '.$this->groupMembersTableName.' AS groupmembers LEFT JOIN '.$this->tableName.' AS principals ON groupmembers.member_id = principals.id WHERE groupmembers.principal_id = ?'); - $stmt->execute(array($principal['id'])); - - $result = array(); - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $result[] = $row['uri']; - } - return $result; - - } - - /** - * Returns the list of groups a principal is a member of - * - * @param string $principal - * @return array - */ - public function getGroupMembership($principal) { - - $principal = $this->getPrincipalByPath($principal); - if (!$principal) throw new DAV\Exception('Principal not found'); - - $stmt = $this->pdo->prepare('SELECT principals.uri as uri FROM '.$this->groupMembersTableName.' AS groupmembers LEFT JOIN '.$this->tableName.' AS principals ON groupmembers.principal_id = principals.id WHERE groupmembers.member_id = ?'); - $stmt->execute(array($principal['id'])); - - $result = array(); - while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - $result[] = $row['uri']; - } - return $result; - - } - - /** - * Updates the list of group members for a group principal. - * - * The principals should be passed as a list of uri's. - * - * @param string $principal - * @param array $members - * @return void - */ - public function setGroupMemberSet($principal, array $members) { - - // Grabbing the list of principal id's. - $stmt = $this->pdo->prepare('SELECT id, uri FROM '.$this->tableName.' WHERE uri IN (? ' . str_repeat(', ? ', count($members)) . ');'); - $stmt->execute(array_merge(array($principal), $members)); - - $memberIds = array(); - $principalId = null; - - while($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { - if ($row['uri'] == $principal) { - $principalId = $row['id']; - } else { - $memberIds[] = $row['id']; - } - } - if (!$principalId) throw new DAV\Exception('Principal not found'); - - // Wiping out old members - $stmt = $this->pdo->prepare('DELETE FROM '.$this->groupMembersTableName.' WHERE principal_id = ?;'); - $stmt->execute(array($principalId)); - - foreach($memberIds as $memberId) { - - $stmt = $this->pdo->prepare('INSERT INTO '.$this->groupMembersTableName.' (principal_id, member_id) VALUES (?, ?);'); - $stmt->execute(array($principalId, $memberId)); - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalCollection.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalCollection.php deleted file mode 100644 index aa8cdd8943..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/PrincipalCollection.php +++ /dev/null @@ -1,33 +0,0 @@ -principalBackend, $principal); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Acl.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Acl.php deleted file mode 100644 index 8284fd3794..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Acl.php +++ /dev/null @@ -1,211 +0,0 @@ -privileges = $privileges; - $this->prefixBaseUrl = $prefixBaseUrl; - - } - - /** - * Returns the list of privileges for this property - * - * @return array - */ - public function getPrivileges() { - - return $this->privileges; - - } - - /** - * Serializes the property into a DOMElement - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - foreach($this->privileges as $ace) { - - $this->serializeAce($doc, $node, $ace, $server); - - } - - } - - /** - * Unserializes the {DAV:}acl xml element. - * - * @param \DOMElement $dom - * @return Acl - */ - static public function unserialize(\DOMElement $dom) { - - $privileges = array(); - $xaces = $dom->getElementsByTagNameNS('urn:DAV','ace'); - for($ii=0; $ii < $xaces->length; $ii++) { - - $xace = $xaces->item($ii); - $principal = $xace->getElementsByTagNameNS('urn:DAV','principal'); - if ($principal->length !== 1) { - throw new DAV\Exception\BadRequest('Each {DAV:}ace element must have one {DAV:}principal element'); - } - $principal = Principal::unserialize($principal->item(0)); - - switch($principal->getType()) { - case Principal::HREF : - $principal = $principal->getHref(); - break; - case Principal::AUTHENTICATED : - $principal = '{DAV:}authenticated'; - break; - case Principal::UNAUTHENTICATED : - $principal = '{DAV:}unauthenticated'; - break; - case Principal::ALL : - $principal = '{DAV:}all'; - break; - - } - - $protected = false; - - if ($xace->getElementsByTagNameNS('urn:DAV','protected')->length > 0) { - $protected = true; - } - - $grants = $xace->getElementsByTagNameNS('urn:DAV','grant'); - if ($grants->length < 1) { - throw new DAV\Exception\NotImplemented('Every {DAV:}ace element must have a {DAV:}grant element. {DAV:}deny is not yet supported'); - } - $grant = $grants->item(0); - - $xprivs = $grant->getElementsByTagNameNS('urn:DAV','privilege'); - for($jj=0; $jj<$xprivs->length; $jj++) { - - $xpriv = $xprivs->item($jj); - - $privilegeName = null; - - for ($kk=0;$kk<$xpriv->childNodes->length;$kk++) { - - $childNode = $xpriv->childNodes->item($kk); - if ($t = DAV\XMLUtil::toClarkNotation($childNode)) { - $privilegeName = $t; - break; - } - } - if (is_null($privilegeName)) { - throw new DAV\Exception\BadRequest('{DAV:}privilege elements must have a privilege element contained within them.'); - } - - $privileges[] = array( - 'principal' => $principal, - 'protected' => $protected, - 'privilege' => $privilegeName, - ); - - } - - } - - return new self($privileges); - - } - - /** - * Serializes a single access control entry. - * - * @param \DOMDocument $doc - * @param \DOMElement $node - * @param array $ace - * @param DAV\Server $server - * @return void - */ - private function serializeAce($doc,$node,$ace, DAV\Server $server) { - - $xace = $doc->createElementNS('DAV:','d:ace'); - $node->appendChild($xace); - - $principal = $doc->createElementNS('DAV:','d:principal'); - $xace->appendChild($principal); - switch($ace['principal']) { - case '{DAV:}authenticated' : - $principal->appendChild($doc->createElementNS('DAV:','d:authenticated')); - break; - case '{DAV:}unauthenticated' : - $principal->appendChild($doc->createElementNS('DAV:','d:unauthenticated')); - break; - case '{DAV:}all' : - $principal->appendChild($doc->createElementNS('DAV:','d:all')); - break; - default: - $principal->appendChild($doc->createElementNS('DAV:','d:href',($this->prefixBaseUrl?$server->getBaseUri():'') . $ace['principal'] . '/')); - } - - $grant = $doc->createElementNS('DAV:','d:grant'); - $xace->appendChild($grant); - - $privParts = null; - - preg_match('/^{([^}]*)}(.*)$/',$ace['privilege'],$privParts); - - $xprivilege = $doc->createElementNS('DAV:','d:privilege'); - $grant->appendChild($xprivilege); - - $xprivilege->appendChild($doc->createElementNS($privParts[1],'d:'.$privParts[2])); - - if (isset($ace['protected']) && $ace['protected']) - $xace->appendChild($doc->createElement('d:protected')); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/AclRestrictions.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/AclRestrictions.php deleted file mode 100644 index f512424b30..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/AclRestrictions.php +++ /dev/null @@ -1,34 +0,0 @@ -ownerDocument; - - $elem->appendChild($doc->createElementNS('DAV:','d:grant-only')); - $elem->appendChild($doc->createElementNS('DAV:','d:no-invert')); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/CurrentUserPrivilegeSet.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/CurrentUserPrivilegeSet.php deleted file mode 100644 index 42307930a9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/CurrentUserPrivilegeSet.php +++ /dev/null @@ -1,124 +0,0 @@ -privileges = $privileges; - - } - - /** - * Serializes the property in the DOM - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - foreach($this->privileges as $privName) { - - $this->serializePriv($doc,$node,$privName); - - } - - } - - /** - * Returns true or false, whether the specified principal appears in the - * list. - * - * @return bool - */ - public function has($privilegeName) { - - return in_array($privilegeName, $this->privileges); - - } - - /** - * Serializes one privilege - * - * @param \DOMDocument $doc - * @param \DOMElement $node - * @param string $privName - * @return void - */ - protected function serializePriv($doc,$node,$privName) { - - $xp = $doc->createElementNS('DAV:','d:privilege'); - $node->appendChild($xp); - - $privParts = null; - preg_match('/^{([^}]*)}(.*)$/',$privName,$privParts); - - $xp->appendChild($doc->createElementNS($privParts[1],'d:'.$privParts[2])); - - } - - /** - * Unserializes the {DAV:}current-user-privilege-set element. - * - * @param DOMElement $node - * @return CurrentUserPrivilegeSet - */ - static public function unserialize(\DOMElement $node) { - - $result = array(); - - $xprivs = $node->getElementsByTagNameNS('urn:DAV','privilege'); - - for($jj=0; $jj<$xprivs->length; $jj++) { - - $xpriv = $xprivs->item($jj); - - $privilegeName = null; - - for ($kk=0;$kk<$xpriv->childNodes->length;$kk++) { - - $childNode = $xpriv->childNodes->item($kk); - if ($t = DAV\XMLUtil::toClarkNotation($childNode)) { - $privilegeName = $t; - break; - } - } - - $result[] = $privilegeName; - - } - - return new self($result); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Principal.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Principal.php deleted file mode 100644 index c6f813f1fb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/Principal.php +++ /dev/null @@ -1,161 +0,0 @@ -type = $type; - - if ($type===self::HREF && is_null($href)) { - throw new DAV\Exception('The href argument must be specified for the HREF principal type.'); - } - $this->href = $href; - - } - - /** - * Returns the principal type - * - * @return int - */ - public function getType() { - - return $this->type; - - } - - /** - * Returns the principal uri. - * - * @return string - */ - public function getHref() { - - return $this->href; - - } - - /** - * Serializes the property into a DOMElement. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server, \DOMElement $node) { - - $prefix = $server->xmlNamespaces['DAV:']; - switch($this->type) { - - case self::UNAUTHENTICATED : - $node->appendChild( - $node->ownerDocument->createElement($prefix . ':unauthenticated') - ); - break; - case self::AUTHENTICATED : - $node->appendChild( - $node->ownerDocument->createElement($prefix . ':authenticated') - ); - break; - case self::HREF : - $href = $node->ownerDocument->createElement($prefix . ':href'); - $href->nodeValue = $server->getBaseUri() . DAV\URLUtil::encodePath($this->href); - $node->appendChild($href); - break; - - } - - } - - /** - * Deserializes a DOM element into a property object. - * - * @param \DOMElement $dom - * @return Principal - */ - static public function unserialize(\DOMElement $dom) { - - $parent = $dom->firstChild; - while(!DAV\XMLUtil::toClarkNotation($parent)) { - $parent = $parent->nextSibling; - } - - switch(DAV\XMLUtil::toClarkNotation($parent)) { - - case '{DAV:}unauthenticated' : - return new self(self::UNAUTHENTICATED); - case '{DAV:}authenticated' : - return new self(self::AUTHENTICATED); - case '{DAV:}href': - return new self(self::HREF, $parent->textContent); - case '{DAV:}all': - return new self(self::ALL); - default : - throw new DAV\Exception\BadRequest('Unexpected element (' . DAV\XMLUtil::toClarkNotation($parent) . '). Could not deserialize'); - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/SupportedPrivilegeSet.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/SupportedPrivilegeSet.php deleted file mode 100644 index 2f3e507fe2..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Property/SupportedPrivilegeSet.php +++ /dev/null @@ -1,94 +0,0 @@ -privileges = $privileges; - - } - - /** - * Serializes the property into a domdocument. - * - * @param DAV\Server $server - * @param \DOMElement $node - * @return void - */ - public function serialize(DAV\Server $server,\DOMElement $node) { - - $doc = $node->ownerDocument; - $this->serializePriv($doc, $node, $this->privileges); - - } - - /** - * Serializes a property - * - * This is a recursive function. - * - * @param \DOMDocument $doc - * @param \DOMElement $node - * @param array $privilege - * @return void - */ - private function serializePriv($doc,$node,$privilege) { - - $xsp = $doc->createElementNS('DAV:','d:supported-privilege'); - $node->appendChild($xsp); - - $xp = $doc->createElementNS('DAV:','d:privilege'); - $xsp->appendChild($xp); - - $privParts = null; - preg_match('/^{([^}]*)}(.*)$/',$privilege['privilege'],$privParts); - - $xp->appendChild($doc->createElementNS($privParts[1],'d:'.$privParts[2])); - - if (isset($privilege['abstract']) && $privilege['abstract']) { - $xsp->appendChild($doc->createElementNS('DAV:','d:abstract')); - } - - if (isset($privilege['description'])) { - $xsp->appendChild($doc->createElementNS('DAV:','d:description',$privilege['description'])); - } - - if (isset($privilege['aggregates'])) { - foreach($privilege['aggregates'] as $subPrivilege) { - $this->serializePriv($doc,$xsp,$subPrivilege); - } - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Version.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Version.php deleted file mode 100644 index 722ab49017..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/DAVACL/Version.php +++ /dev/null @@ -1,24 +0,0 @@ -httpRequest->getHeader('Authorization'); - $authHeader = explode(' ',$authHeader); - - if ($authHeader[0]!='AWS' || !isset($authHeader[1])) { - $this->errorCode = self::ERR_NOAWSHEADER; - return false; - } - - list($this->accessKey,$this->signature) = explode(':',$authHeader[1]); - - return true; - - } - - /** - * Returns the username for the request - * - * @return string - */ - public function getAccessKey() { - - return $this->accessKey; - - } - - /** - * Validates the signature based on the secretKey - * - * @param string $secretKey - * @return bool - */ - public function validate($secretKey) { - - $contentMD5 = $this->httpRequest->getHeader('Content-MD5'); - - if ($contentMD5) { - // We need to validate the integrity of the request - $body = $this->httpRequest->getBody(true); - $this->httpRequest->setBody($body,true); - - if ($contentMD5!=base64_encode(md5($body,true))) { - // content-md5 header did not match md5 signature of body - $this->errorCode = self::ERR_MD5CHECKSUMWRONG; - return false; - } - - } - - if (!$requestDate = $this->httpRequest->getHeader('x-amz-date')) - $requestDate = $this->httpRequest->getHeader('Date'); - - if (!$this->validateRFC2616Date($requestDate)) - return false; - - $amzHeaders = $this->getAmzHeaders(); - - $signature = base64_encode( - $this->hmacsha1($secretKey, - $this->httpRequest->getMethod() . "\n" . - $contentMD5 . "\n" . - $this->httpRequest->getHeader('Content-type') . "\n" . - $requestDate . "\n" . - $amzHeaders . - $this->httpRequest->getURI() - ) - ); - - if ($this->signature != $signature) { - - $this->errorCode = self::ERR_INVALIDSIGNATURE; - return false; - - } - - return true; - - } - - - /** - * Returns an HTTP 401 header, forcing login - * - * This should be called when username and password are incorrect, or not supplied at all - * - * @return void - */ - public function requireLogin() { - - $this->httpResponse->setHeader('WWW-Authenticate','AWS'); - $this->httpResponse->sendStatus(401); - - } - - /** - * Makes sure the supplied value is a valid RFC2616 date. - * - * If we would just use strtotime to get a valid timestamp, we have no way of checking if a - * user just supplied the word 'now' for the date header. - * - * This function also makes sure the Date header is within 15 minutes of the operating - * system date, to prevent replay attacks. - * - * @param string $dateHeader - * @return bool - */ - protected function validateRFC2616Date($dateHeader) { - - $date = Util::parseHTTPDate($dateHeader); - - // Unknown format - if (!$date) { - $this->errorCode = self::ERR_INVALIDDATEFORMAT; - return false; - } - - $min = new \DateTime('-15 minutes'); - $max = new \DateTime('+15 minutes'); - - // We allow 15 minutes around the current date/time - if ($date > $max || $date < $min) { - $this->errorCode = self::ERR_REQUESTTIMESKEWED; - return false; - } - - return $date; - - } - - /** - * Returns a list of AMZ headers - * - * @return string - */ - protected function getAmzHeaders() { - - $amzHeaders = array(); - $headers = $this->httpRequest->getHeaders(); - foreach($headers as $headerName => $headerValue) { - if (strpos(strtolower($headerName),'x-amz-')===0) { - $amzHeaders[strtolower($headerName)] = str_replace(array("\r\n"),array(' '),$headerValue) . "\n"; - } - } - ksort($amzHeaders); - - $headerStr = ''; - foreach($amzHeaders as $h=>$v) { - $headerStr.=$h.':'.$v; - } - - return $headerStr; - - } - - /** - * Generates an HMAC-SHA1 signature - * - * @param string $key - * @param string $message - * @return string - */ - private function hmacsha1($key, $message) { - - $blocksize=64; - if (strlen($key)>$blocksize) - $key=pack('H*', sha1($key)); - $key=str_pad($key,$blocksize,chr(0x00)); - $ipad=str_repeat(chr(0x36),$blocksize); - $opad=str_repeat(chr(0x5c),$blocksize); - $hmac = pack('H*',sha1(($key^$opad).pack('H*',sha1(($key^$ipad).$message)))); - return $hmac; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/AbstractAuth.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/AbstractAuth.php deleted file mode 100644 index 0db2983068..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/AbstractAuth.php +++ /dev/null @@ -1,111 +0,0 @@ -httpResponse = new Response(); - $this->httpRequest = new Request(); - - } - - /** - * Sets an alternative HTTP response object - * - * @param Response $response - * @return void - */ - public function setHTTPResponse(Response $response) { - - $this->httpResponse = $response; - - } - - /** - * Sets an alternative HTTP request object - * - * @param Request $request - * @return void - */ - public function setHTTPRequest(Request $request) { - - $this->httpRequest = $request; - - } - - - /** - * Sets the realm - * - * The realm is often displayed in authentication dialog boxes - * Commonly an application name displayed here - * - * @param string $realm - * @return void - */ - public function setRealm($realm) { - - $this->realm = $realm; - - } - - /** - * Returns the realm - * - * @return string - */ - public function getRealm() { - - return $this->realm; - - } - - /** - * Returns an HTTP 401 header, forcing login - * - * This should be called when username and password are incorrect, or not supplied at all - * - * @return void - */ - abstract public function requireLogin(); - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/BasicAuth.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/BasicAuth.php deleted file mode 100644 index bcb087ed2d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/BasicAuth.php +++ /dev/null @@ -1,67 +0,0 @@ -httpRequest->getRawServerValue('PHP_AUTH_USER')) && ($pass = $this->httpRequest->getRawServerValue('PHP_AUTH_PW'))) { - - return array($user,$pass); - - } - - // Most other webservers - $auth = $this->httpRequest->getHeader('Authorization'); - - // Apache could prefix environment variables with REDIRECT_ when urls - // are passed through mod_rewrite - if (!$auth) { - $auth = $this->httpRequest->getRawServerValue('REDIRECT_HTTP_AUTHORIZATION'); - } - - if (!$auth) return false; - - if (strpos(strtolower($auth),'basic')!==0) return false; - - return explode(':', base64_decode(substr($auth, 6)),2); - - } - - /** - * Returns an HTTP 401 header, forcing login - * - * This should be called when username and password are incorrect, or not supplied at all - * - * @return void - */ - public function requireLogin() { - - $this->httpResponse->setHeader('WWW-Authenticate','Basic realm="' . $this->realm . '"'); - $this->httpResponse->sendStatus(401); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php deleted file mode 100644 index 62310f7ce4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/DigestAuth.php +++ /dev/null @@ -1,240 +0,0 @@ -nonce = uniqid(); - $this->opaque = md5($this->realm); - parent::__construct(); - - } - - /** - * Gathers all information from the headers - * - * This method needs to be called prior to anything else. - * - * @return void - */ - public function init() { - - $digest = $this->getDigest(); - $this->digestParts = $this->parseDigest($digest); - - } - - /** - * Sets the quality of protection value. - * - * Possible values are: - * SabreForRainLoop\HTTP\DigestAuth::QOP_AUTH - * SabreForRainLoop\HTTP\DigestAuth::QOP_AUTHINT - * - * Multiple values can be specified using logical OR. - * - * QOP_AUTHINT ensures integrity of the request body, but this is not - * supported by most HTTP clients. QOP_AUTHINT also requires the entire - * request body to be md5'ed, which can put strains on CPU and memory. - * - * @param int $qop - * @return void - */ - public function setQOP($qop) { - - $this->qop = $qop; - - } - - /** - * Validates the user. - * - * The A1 parameter should be md5($username . ':' . $realm . ':' . $password); - * - * @param string $A1 - * @return bool - */ - public function validateA1($A1) { - - $this->A1 = $A1; - return $this->validate(); - - } - - /** - * Validates authentication through a password. The actual password must be provided here. - * It is strongly recommended not store the password in plain-text and use validateA1 instead. - * - * @param string $password - * @return bool - */ - public function validatePassword($password) { - - $this->A1 = md5($this->digestParts['username'] . ':' . $this->realm . ':' . $password); - return $this->validate(); - - } - - /** - * Returns the username for the request - * - * @return string - */ - public function getUsername() { - - return $this->digestParts['username']; - - } - - /** - * Validates the digest challenge - * - * @return bool - */ - protected function validate() { - - $A2 = $this->httpRequest->getMethod() . ':' . $this->digestParts['uri']; - - if ($this->digestParts['qop']=='auth-int') { - // Making sure we support this qop value - if (!($this->qop & self::QOP_AUTHINT)) return false; - // We need to add an md5 of the entire request body to the A2 part of the hash - $body = $this->httpRequest->getBody(true); - $this->httpRequest->setBody($body,true); - $A2 .= ':' . md5($body); - } else { - - // We need to make sure we support this qop value - if (!($this->qop & self::QOP_AUTH)) return false; - } - - $A2 = md5($A2); - - $validResponse = md5("{$this->A1}:{$this->digestParts['nonce']}:{$this->digestParts['nc']}:{$this->digestParts['cnonce']}:{$this->digestParts['qop']}:{$A2}"); - - return $this->digestParts['response']==$validResponse; - - - } - - /** - * Returns an HTTP 401 header, forcing login - * - * This should be called when username and password are incorrect, or not supplied at all - * - * @return void - */ - public function requireLogin() { - - $qop = ''; - switch($this->qop) { - case self::QOP_AUTH : $qop = 'auth'; break; - case self::QOP_AUTHINT : $qop = 'auth-int'; break; - case self::QOP_AUTH | self::QOP_AUTHINT : $qop = 'auth,auth-int'; break; - } - - $this->httpResponse->setHeader('WWW-Authenticate','Digest realm="' . $this->realm . '",qop="'.$qop.'",nonce="' . $this->nonce . '",opaque="' . $this->opaque . '"'); - $this->httpResponse->sendStatus(401); - - } - - - /** - * This method returns the full digest string. - * - * It should be compatibile with mod_php format and other webservers. - * - * If the header could not be found, null will be returned - * - * @return mixed - */ - public function getDigest() { - - // mod_php - $digest = $this->httpRequest->getRawServerValue('PHP_AUTH_DIGEST'); - if ($digest) return $digest; - - // most other servers - $digest = $this->httpRequest->getHeader('Authorization'); - - // Apache could prefix environment variables with REDIRECT_ when urls - // are passed through mod_rewrite - if (!$digest) { - $digest = $this->httpRequest->getRawServerValue('REDIRECT_HTTP_AUTHORIZATION'); - } - - if ($digest && strpos(strtolower($digest),'digest')===0) { - return substr($digest,7); - } else { - return null; - } - - } - - - /** - * Parses the different pieces of the digest string into an array. - * - * This method returns false if an incomplete digest was supplied - * - * @param string $digest - * @return mixed - */ - protected function parseDigest($digest) { - - // protect against missing data - $needed_parts = array('nonce'=>1, 'nc'=>1, 'cnonce'=>1, 'qop'=>1, 'username'=>1, 'uri'=>1, 'response'=>1); - $data = array(); - - preg_match_all('@(\w+)=(?:(?:")([^"]+)"|([^\s,$]+))@', $digest, $matches, PREG_SET_ORDER); - - foreach ($matches as $m) { - $data[$m[1]] = $m[2] ? $m[2] : $m[3]; - unset($needed_parts[$m[1]]); - } - - return $needed_parts ? false : $data; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Request.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Request.php deleted file mode 100644 index 3942af8c41..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Request.php +++ /dev/null @@ -1,284 +0,0 @@ -_SERVER = $serverData; - else $this->_SERVER =& $_SERVER; - - if ($postData) $this->_POST = $postData; - else $this->_POST =& $_POST; - - } - - /** - * Returns the value for a specific http header. - * - * This method returns null if the header did not exist. - * - * @param string $name - * @return string - */ - public function getHeader($name) { - - $name = strtoupper(str_replace(array('-'),array('_'),$name)); - if (isset($this->_SERVER['HTTP_' . $name])) { - return $this->_SERVER['HTTP_' . $name]; - } - - // There's a few headers that seem to end up in the top-level - // server array. - switch($name) { - case 'CONTENT_TYPE' : - case 'CONTENT_LENGTH' : - if (isset($this->_SERVER[$name])) { - return $this->_SERVER[$name]; - } - break; - - } - return; - - } - - /** - * Returns all (known) HTTP headers. - * - * All headers are converted to lower-case, and additionally all underscores - * are automatically converted to dashes - * - * @return array - */ - public function getHeaders() { - - $hdrs = array(); - foreach($this->_SERVER as $key=>$value) { - - switch($key) { - case 'CONTENT_LENGTH' : - case 'CONTENT_TYPE' : - $hdrs[strtolower(str_replace('_','-',$key))] = $value; - break; - default : - if (strpos($key,'HTTP_')===0) { - $hdrs[substr(strtolower(str_replace('_','-',$key)),5)] = $value; - } - break; - } - - } - - return $hdrs; - - } - - /** - * Returns the HTTP request method - * - * This is for example POST or GET - * - * @return string - */ - public function getMethod() { - - return $this->_SERVER['REQUEST_METHOD']; - - } - - /** - * Returns the requested uri - * - * @return string - */ - public function getUri() { - - return $this->_SERVER['REQUEST_URI']; - - } - - /** - * Will return protocol + the hostname + the uri - * - * @return string - */ - public function getAbsoluteUri() { - - // Checking if the request was made through HTTPS. The last in line is for IIS - $protocol = isset($this->_SERVER['HTTPS']) && ($this->_SERVER['HTTPS']) && ($this->_SERVER['HTTPS']!='off'); - return ($protocol?'https':'http') . '://' . $this->getHeader('Host') . $this->getUri(); - - } - - /** - * Returns everything after the ? from the current url - * - * @return string - */ - public function getQueryString() { - - return isset($this->_SERVER['QUERY_STRING'])?$this->_SERVER['QUERY_STRING']:''; - - } - - /** - * Returns the HTTP request body body - * - * This method returns a readable stream resource. - * If the asString parameter is set to true, a string is sent instead. - * - * @param bool $asString - * @return resource - */ - public function getBody($asString = false) { - - if (is_null($this->body)) { - if (!is_null(self::$defaultInputStream)) { - $this->body = self::$defaultInputStream; - } else { - $this->body = fopen('php://input','r'); - self::$defaultInputStream = $this->body; - } - } - if ($asString) { - $body = stream_get_contents($this->body); - return $body; - } else { - return $this->body; - } - - } - - /** - * Sets the contents of the HTTP request body - * - * This method can either accept a string, or a readable stream resource. - * - * If the setAsDefaultInputStream is set to true, it means for this run of the - * script the supplied body will be used instead of php://input. - * - * @param mixed $body - * @param bool $setAsDefaultInputStream - * @return void - */ - public function setBody($body,$setAsDefaultInputStream = false) { - - if(is_resource($body)) { - $this->body = $body; - } else { - - $stream = fopen('php://temp','r+'); - fputs($stream,$body); - rewind($stream); - // String is assumed - $this->body = $stream; - } - if ($setAsDefaultInputStream) { - self::$defaultInputStream = $this->body; - } - - } - - /** - * Returns PHP's _POST variable. - * - * The reason this is in a method is so it can be subclassed and - * overridden. - * - * @return array - */ - public function getPostVars() { - - return $this->_POST; - - } - - /** - * Returns a specific item from the _SERVER array. - * - * Do not rely on this feature, it is for internal use only. - * - * @param string $field - * @return string - */ - public function getRawServerValue($field) { - - return isset($this->_SERVER[$field])?$this->_SERVER[$field]:null; - - } - - /** - * Returns the HTTP version specified within the request. - * - * @return string - */ - public function getHTTPVersion() { - - $protocol = $this->getRawServerValue('SERVER_PROTOCOL'); - if ($protocol==='HTTP/1.0') { - return '1.0'; - } else { - return '1.1'; - } - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Response.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Response.php deleted file mode 100644 index cb4b9dabd4..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Response.php +++ /dev/null @@ -1,175 +0,0 @@ - 'Continue', - 101 => 'Switching Protocols', - 102 => 'Processing', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authorative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 207 => 'Multi-Status', // RFC 4918 - 208 => 'Already Reported', // RFC 5842 - 226 => 'IM Used', // RFC 3229 - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 302 => 'Found', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => 'Reserved', - 307 => 'Temporary Redirect', - 400 => 'Bad request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 410 => 'Gone', - 411 => 'Length Required', - 412 => 'Precondition failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - 418 => 'I\'m a teapot', // RFC 2324 - 422 => 'Unprocessable Entity', // RFC 4918 - 423 => 'Locked', // RFC 4918 - 424 => 'Failed Dependency', // RFC 4918 - 426 => 'Upgrade required', - 428 => 'Precondition required', // draft-nottingham-http-new-status - 429 => 'Too Many Requests', // draft-nottingham-http-new-status - 431 => 'Request Header Fields Too Large', // draft-nottingham-http-new-status - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version not supported', - 506 => 'Variant Also Negotiates', - 507 => 'Insufficient Storage', // RFC 4918 - 508 => 'Loop Detected', // RFC 5842 - 509 => 'Bandwidth Limit Exceeded', // non-standard - 510 => 'Not extended', - 511 => 'Network Authentication Required', // draft-nottingham-http-new-status - ); - - return 'HTTP/' . $httpVersion . ' ' . $code . ' ' . $msg[$code]; - - } - - // @codeCoverageIgnoreStart - // We cannot reasonably test header() related methods. - - /** - * Sends an HTTP status header to the client. - * - * @param int $code HTTP status code - * @return bool - */ - public function sendStatus($code) { - - if (!headers_sent()) - return header($this->getStatusMessage($code, $this->defaultHttpVersion)); - else return false; - - } - - /** - * Sets an HTTP header for the response - * - * @param string $name - * @param string $value - * @param bool $replace - * @return bool - */ - public function setHeader($name, $value, $replace = true) { - - $value = str_replace(array("\r","\n"),array('\r','\n'),$value); - if (!headers_sent()) - return header($name . ': ' . $value, $replace); - else return false; - - - } - // @codeCoverageIgnoreEnd - - /** - * Sets a bunch of HTTP Headers - * - * headersnames are specified as keys, value in the array value - * - * @param array $headers - * @return void - */ - public function setHeaders(array $headers) { - - foreach($headers as $key=>$value) - $this->setHeader($key, $value); - - } - - /** - * Sends the entire response body - * - * This method can accept either an open filestream, or a string. - * - * @param mixed $body - * @return void - */ - public function sendBody($body) { - - if (is_resource($body)) { - - fpassthru($body); - - } else { - - // We assume a string - echo $body; - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Util.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Util.php deleted file mode 100644 index e308618a12..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Util.php +++ /dev/null @@ -1,82 +0,0 @@ -= 0) - return new \DateTime('@' . $realDate, new \DateTimeZone('UTC')); - - } - - /** - * Transforms a DateTime object to HTTP's most common date format. - * - * We're serializing it as the RFC 1123 date, which, for HTTP must be - * specified as GMT. - * - * @param \DateTime $dateTime - * @return string - */ - static function toHTTPDate(\DateTime $dateTime) { - - // We need to clone it, as we don't want to affect the existing - // DateTime. - $dateTime = clone $dateTime; - $dateTime->setTimeZone(new \DateTimeZone('GMT')); - return $dateTime->format('D, d M Y H:i:s \G\M\T'); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Version.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Version.php deleted file mode 100644 index c14bd03f74..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/HTTP/Version.php +++ /dev/null @@ -1,24 +0,0 @@ -stderr) { - $this->stderr = STDERR; - } - if (!$this->stdout) { - $this->stdout = STDOUT; - } - if (!$this->stdin) { - $this->stdin = STDIN; - } - - // @codeCoverageIgnoreEnd - - - try { - - list($options, $positional) = $this->parseArguments($argv); - - if (isset($options['q'])) { - $this->quiet = true; - } - $this->log($this->colorize('green', "sabre-vobject ") . $this->colorize('yellow', Version::VERSION)); - - foreach($options as $name=>$value) { - - switch($name) { - - case 'q' : - // Already handled earlier. - break; - case 'h' : - case 'help' : - $this->showHelp(); - return 0; - break; - case 'format' : - switch($value) { - - // jcard/jcal documents - case 'jcard' : - case 'jcal' : - - // specific document versions - case 'vcard21' : - case 'vcard30' : - case 'vcard40' : - case 'icalendar20' : - - // specific formats - case 'json' : - case 'mimedir' : - - // icalendar/vcad - case 'icalendar' : - case 'vcard' : - $this->format = $value; - break; - - default : - throw new InvalidArgumentException('Unknown format: ' . $value); - - } - break; - case 'pretty' : - if (version_compare(PHP_VERSION, '5.4.0') >= 0) { - $this->pretty = true; - } - break; - case 'forgiving' : - $this->forgiving = true; - break; - case 'inputformat' : - switch($value) { - // json formats - case 'jcard' : - case 'jcal' : - case 'json' : - $this->inputFormat = 'json'; - break; - - // mimedir formats - case 'mimedir' : - case 'icalendar' : - case 'vcard' : - case 'vcard21' : - case 'vcard30' : - case 'vcard40' : - case 'icalendar20' : - - $this->inputFormat = 'mimedir'; - break; - - default : - throw new InvalidArgumentException('Unknown format: ' . $value); - - } - break; - default : - throw new InvalidArgumentException('Unknown option: ' . $name); - - } - - } - - if (count($positional) === 0) { - $this->showHelp(); - return 1; - } - - if (count($positional) === 1) { - throw new InvalidArgumentException('Inputfile is a required argument'); - } - - if (count($positional) > 3) { - throw new InvalidArgumentException('Too many arguments'); - } - - if (!in_array($positional[0], array('validate','repair','convert','color'))) { - throw new InvalidArgumentException('Uknown command: ' . $positional[0]); - } - - } catch (InvalidArgumentException $e) { - $this->showHelp(); - $this->log('Error: ' . $e->getMessage(),'red'); - return 1; - } - - $command = $positional[0]; - - $this->inputPath = $positional[1]; - $this->outputPath = isset($positional[2])?$positional[2]:'-'; - - if ($this->outputPath !== '-') { - $this->stdout = fopen($this->outputPath,'w'); - } - - if (!$this->inputFormat) { - if (substr($this->inputPath,-5)==='.json') { - $this->inputFormat = 'json'; - } else { - $this->inputFormat = 'mimedir'; - } - } - if (!$this->format) { - if (substr($this->outputPath,-5)==='.json') { - $this->format = 'json'; - } else { - $this->format = 'mimedir'; - } - } - - - $realCode = 0; - - try { - - while($input = $this->readInput()) { - - $returnCode = $this->$command($input); - if ($returnCode!==0) $realCode = $returnCode; - - } - - } catch (EofException $e) { - // end of file - } catch (\Exception $e) { - $this->log('Error: ' . $e->getMessage(),'red'); - return 2; - } - - return $realCode; - - } - - /** - * Shows the help message. - * - * @return void - */ - protected function showHelp() { - - $this->log('Usage:', 'yellow'); - $this->log(" vobject [options] command [arguments]"); - $this->log(''); - $this->log('Options:', 'yellow'); - $this->log($this->colorize('green', ' -q ') . "Don't output anything."); - $this->log($this->colorize('green', ' -help -h ') . "Display this help message."); - $this->log($this->colorize('green', ' --format ') . "Convert to a specific format. Must be one of: vcard, vcard21,"); - $this->log($this->colorize('green', ' --forgiving ') . "Makes the parser less strict."); - $this->log(" vcard30, vcard40, icalendar20, jcal, jcard, json, mimedir."); - $this->log($this->colorize('green', ' --inputformat ') . "If the input format cannot be guessed from the extension, it"); - $this->log(" must be specified here."); - // Only PHP 5.4 and up - if (version_compare(PHP_VERSION, '5.4.0') >= 0) { - $this->log($this->colorize('green', ' --pretty ') . "json pretty-print."); - } - $this->log(''); - $this->log('Commands:', 'yellow'); - $this->log($this->colorize('green', ' validate') . ' source_file Validates a file for correctness.'); - $this->log($this->colorize('green', ' repair') . ' source_file [output_file] Repairs a file.'); - $this->log($this->colorize('green', ' convert') . ' source_file [output_file] Converts a file.'); - $this->log($this->colorize('green', ' color') . ' source_file Colorize a file, useful for debbugging.'); - $this->log(<<log('Examples:', 'yellow'); - $this->log(' vobject convert contact.vcf contact.json'); - $this->log(' vobject convert --format=vcard40 old.vcf new.vcf'); - $this->log(' vobject convert --inputformat=json --format=mimedir - -'); - $this->log(' vobject color calendar.ics'); - $this->log(''); - $this->log('https://github.com/fruux/sabre-vobject','purple'); - - } - - /** - * Validates a VObject file - * - * @param Component $vObj - * @return int - */ - protected function validate($vObj) { - - $returnCode = 0; - - switch($vObj->name) { - case 'VCALENDAR' : - $this->log("iCalendar: " . (string)$vObj->VERSION); - break; - case 'VCARD' : - $this->log("vCard: " . (string)$vObj->VERSION); - break; - } - - $warnings = $vObj->validate(); - if (!count($warnings)) { - $this->log(" No warnings!"); - } else { - - $returnCode = 2; - foreach($warnings as $warn) { - - $this->log(" " . $warn['message']); - - } - - } - - return $returnCode; - - } - - /** - * Repairs a VObject file - * - * @param Component $vObj - * @return int - */ - protected function repair($vObj) { - - $returnCode = 0; - - switch($vObj->name) { - case 'VCALENDAR' : - $this->log("iCalendar: " . (string)$vObj->VERSION); - break; - case 'VCARD' : - $this->log("vCard: " . (string)$vObj->VERSION); - break; - } - - $warnings = $vObj->validate(Node::REPAIR); - if (!count($warnings)) { - $this->log(" No warnings!"); - } else { - foreach($warnings as $warn) { - - $returnCode = 2; - $this->log(" " . $warn['message']); - - } - - } - fwrite($this->stdout, $vObj->serialize()); - - return $returnCode; - - } - - /** - * Converts a vObject file to a new format. - * - * @param Component $vObj - * @return int - */ - protected function convert($vObj) { - - $json = false; - $convertVersion = null; - $forceInput = null; - - switch($this->format) { - case 'json' : - $json = true; - if ($vObj->name === 'VCARD') { - $convertVersion = Document::VCARD40; - } - break; - case 'jcard' : - $json = true; - $forceInput = 'VCARD'; - $convertVersion = Document::VCARD40; - break; - case 'jcal' : - $json = true; - $forceInput = 'VCALENDAR'; - break; - case 'mimedir' : - case 'icalendar' : - case 'icalendar20' : - case 'vcard' : - break; - case 'vcard21' : - $convertVersion = Document::VCARD21; - break; - case 'vcard30' : - $convertVersion = Document::VCARD30; - break; - case 'vcard40' : - $convertVersion = Document::VCARD40; - break; - - } - - if ($forceInput && $vObj->name !== $forceInput) { - throw new \Exception('You cannot convert a ' . strtolower($vObj->name) . ' to ' . $this->format); - } - if ($convertVersion) { - $vObj = $vObj->convert($convertVersion); - } - if ($json) { - $jsonOptions = 0; - if ($this->pretty) { - $jsonOptions = JSON_PRETTY_PRINT; - } - fwrite($this->stdout, json_encode($vObj->jsonSerialize(), $jsonOptions)); - } else { - fwrite($this->stdout, $vObj->serialize()); - } - - return 0; - - } - - /** - * Colorizes a file - * - * @param Component $vObj - * @return int - */ - protected function color($vObj) { - - fwrite($this->stdout, $this->serializeComponent($vObj)); - - } - - /** - * Returns an ansi color string for a color name. - * - * @param string $color - * @return string - */ - protected function colorize($color, $str, $resetTo = 'default') { - - $colors = array( - 'cyan' => '1;36', - 'red' => '1;31', - 'yellow' => '1;33', - 'blue' => '0;34', - 'green' => '0;32', - 'default' => '0', - 'purple' => '0;35', - ); - return "\033[" . $colors[$color] . 'm' . $str . "\033[".$colors[$resetTo]."m"; - - } - - /** - * Writes out a string in specific color. - * - * @param string $color - * @param string $str - * @return void - */ - protected function cWrite($color, $str) { - - fwrite($this->stdout, $this->colorize($color, $str)); - - } - - protected function serializeComponent(Component $vObj) { - - $this->cWrite('cyan', 'BEGIN'); - $this->cWrite('red', ':'); - $this->cWrite('yellow', $vObj->name . "\n"); - - /** - * Gives a component a 'score' for sorting purposes. - * - * This is solely used by the childrenSort method. - * - * A higher score means the item will be lower in the list. - * To avoid score collisions, each "score category" has a reasonable - * space to accomodate elements. The $key is added to the $score to - * preserve the original relative order of elements. - * - * @param int $key - * @param array $array - * @return int - */ - $sortScore = function($key, $array) { - - if ($array[$key] instanceof Component) { - - // We want to encode VTIMEZONE first, this is a personal - // preference. - if ($array[$key]->name === 'VTIMEZONE') { - $score=300000000; - return $score+$key; - } else { - $score=400000000; - return $score+$key; - } - } else { - // Properties get encoded first - // VCARD version 4.0 wants the VERSION property to appear first - if ($array[$key] instanceof Property) { - if ($array[$key]->name === 'VERSION') { - $score=100000000; - return $score+$key; - } else { - // All other properties - $score=200000000; - return $score+$key; - } - } - } - - }; - - $tmp = $vObj->children; - uksort($vObj->children, function($a, $b) use ($sortScore, $tmp) { - - $sA = $sortScore($a, $tmp); - $sB = $sortScore($b, $tmp); - - return $sA - $sB; - - }); - - foreach($vObj->children as $child) { - if ($child instanceof Component) { - $this->serializeComponent($child); - } else { - $this->serializeProperty($child); - } - } - - $this->cWrite('cyan', 'END'); - $this->cWrite('red', ':'); - $this->cWrite('yellow', $vObj->name . "\n"); - - } - - /** - * Colorizes a property. - * - * @param Property $property - * @return void - */ - protected function serializeProperty(Property $property) { - - if ($property->group) { - $this->cWrite('default', $property->group); - $this->cWrite('red', '.'); - } - - $str = ''; - $this->cWrite('yellow', $property->name); - - foreach($property->parameters as $param) { - - $this->cWrite('red',';'); - $this->cWrite('blue', $param->serialize()); - - } - $this->cWrite('red',':'); - - if ($property instanceof Property\Binary) { - - $this->cWrite('default', 'embedded binary stripped. (' . strlen($property->getValue()) . ' bytes)'); - - } else { - - $parts = $property->getParts(); - $first1 = true; - // Looping through property values - foreach($parts as $part) { - if ($first1) { - $first1 = false; - } else { - $this->cWrite('red', $property->delimiter); - } - $first2 = true; - // Looping through property sub-values - foreach((array)$part as $subPart) { - if ($first2) { - $first2 = false; - } else { - // The sub-value delimiter is always comma - $this->cWrite('red', ','); - } - - $subPart = strtr($subPart, array( - '\\' => $this->colorize('purple', '\\\\', 'green'), - ';' => $this->colorize('purple', '\;', 'green'), - ',' => $this->colorize('purple', '\,', 'green'), - "\n" => $this->colorize('purple', "\\n\n\t", 'green'), - "\r" => "", - )); - - $this->cWrite('green', $subPart); - } - } - - } - $this->cWrite("default", "\n"); - - } - - /** - * Parses the list of arguments. - * - * @param array $argv - * @return void - */ - protected function parseArguments(array $argv) { - - $positional = array(); - $options = array(); - - for($ii=0; $ii < count($argv); $ii++) { - - // Skipping the first argument. - if ($ii===0) continue; - - $v = $argv[$ii]; - - if (substr($v,0,2)==='--') { - // This is a long-form option. - $optionName = substr($v,2); - $optionValue = true; - if (strpos($optionName,'=')) { - list($optionName, $optionValue) = explode('=', $optionName); - } - $options[$optionName] = $optionValue; - } elseif (substr($v,0,1) === '-' && strlen($v)>1) { - // This is a short-form option. - foreach(str_split(substr($v,1)) as $option) { - $options[$option] = true; - } - - } else { - - $positional[] = $v; - - } - - } - - return array($options, $positional); - - } - - protected $parser; - - /** - * Reads the input file - * - * @return Component - */ - protected function readInput() { - - if (!$this->parser) { - if ($this->inputPath!=='-') { - $this->stdin = fopen($this->inputPath,'r'); - } - - if ($this->inputFormat === 'mimedir') { - $this->parser = new Parser\MimeDir($this->stdin, ($this->forgiving?Reader::OPTION_FORGIVING:0)); - } else { - $this->parser = new Parser\Json($this->stdin, ($this->forgiving?Reader::OPTION_FORGIVING:0)); - } - } - - return $this->parser->parse(); - - } - - /** - * Sends a message to STDERR. - * - * @param string $msg - * @return void - */ - protected function log($msg, $color = 'default') { - - if (!$this->quiet) { - if ($color!=='default') { - $msg = $this->colorize($color, $msg); - } - fwrite($this->stderr, $msg . "\n"); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component.php deleted file mode 100644 index 70cf550d45..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component.php +++ /dev/null @@ -1,473 +0,0 @@ -value syntax, in which case - * properties will automatically be created, or you can just pass a list of - * Component and Property object. - * - * By default, a set of sensible values will be added to the component. For - * an iCalendar object, this may be something like CALSCALE:GREGORIAN. To - * ensure that this does not happen, set $defaults to false. - * - * @param Document $root - * @param string $name such as VCALENDAR, VEVENT. - * @param array $children - * @param bool $defaults - * @return void - */ - public function __construct(Document $root, $name, array $children = array(), $defaults = true) { - - $this->name = strtoupper($name); - $this->root = $root; - - if ($defaults) { - $children = array_merge($this->getDefaults(), $children); - } - - foreach($children as $k=>$child) { - if ($child instanceof Node) { - - // Component or Property - $this->add($child); - } else { - - // Property key=>value - $this->add($k, $child); - } - } - - } - - /** - * Adds a new property or component, and returns the new item. - * - * This method has 3 possible signatures: - * - * add(Component $comp) // Adds a new component - * add(Property $prop) // Adds a new property - * add($name, $value, array $parameters = array()) // Adds a new property - * add($name, array $children = array()) // Adds a new component - * by name. - * - * @return Node - */ - public function add($a1, $a2 = null, $a3 = null) { - - if ($a1 instanceof Node) { - if (!is_null($a2)) { - throw new \InvalidArgumentException('The second argument must not be specified, when passing a VObject Node'); - } - $a1->parent = $this; - $this->children[] = $a1; - - return $a1; - - } elseif(is_string($a1)) { - - $item = $this->root->create($a1, $a2, $a3); - $item->parent = $this; - $this->children[] = $item; - - return $item; - - } else { - - throw new \InvalidArgumentException('The first argument must either be a \\SabreForRainLoop\\VObject\\Node or a string'); - - } - - } - - /** - * This method removes a component or property from this component. - * - * You can either specify the item by name (like DTSTART), in which case - * all properties/components with that name will be removed, or you can - * pass an instance of a property or component, in which case only that - * exact item will be removed. - * - * The removed item will be returned. In case there were more than 1 items - * removed, only the last one will be returned. - * - * @param mixed $item - * @return void - */ - public function remove($item) { - - if (is_string($item)) { - $children = $this->select($item); - foreach($children as $k=>$child) { - unset($this->children[$k]); - } - return $child; - } else { - foreach($this->children as $k => $child) { - if ($child===$item) { - unset($this->children[$k]); - return $child; - } - } - - throw new \InvalidArgumentException('The item you passed to remove() was not a child of this component'); - - } - - } - - /** - * Returns an iterable list of children - * - * @return array - */ - public function children() { - - return $this->children; - - } - - /** - * This method only returns a list of sub-components. Properties are - * ignored. - * - * @return array - */ - public function getComponents() { - - $result = array(); - foreach($this->children as $child) { - if ($child instanceof Component) { - $result[] = $child; - } - } - - return $result; - - } - - /** - * Returns an array with elements that match the specified name. - * - * This function is also aware of MIME-Directory groups (as they appear in - * vcards). This means that if a property is grouped as "HOME.EMAIL", it - * will also be returned when searching for just "EMAIL". If you want to - * search for a property in a specific group, you can select on the entire - * string ("HOME.EMAIL"). If you want to search on a specific property that - * has not been assigned a group, specify ".EMAIL". - * - * Keys are retained from the 'children' array, which may be confusing in - * certain cases. - * - * @param string $name - * @return array - */ - public function select($name) { - - $group = null; - $name = strtoupper($name); - if (strpos($name,'.')!==false) { - list($group,$name) = explode('.', $name, 2); - } - - $result = array(); - foreach($this->children as $key=>$child) { - - if ( - strtoupper($child->name) === $name && - (is_null($group) || ( $child instanceof Property && strtoupper($child->group) === $group)) - ) { - - $result[$key] = $child; - - } - } - - reset($result); - return $result; - - } - - /** - * Turns the object back into a serialized blob. - * - * @return string - */ - public function serialize() { - - $str = "BEGIN:" . $this->name . "\r\n"; - - /** - * Gives a component a 'score' for sorting purposes. - * - * This is solely used by the childrenSort method. - * - * A higher score means the item will be lower in the list. - * To avoid score collisions, each "score category" has a reasonable - * space to accomodate elements. The $key is added to the $score to - * preserve the original relative order of elements. - * - * @param int $key - * @param array $array - * @return int - */ - $sortScore = function($key, $array) { - - if ($array[$key] instanceof Component) { - - // We want to encode VTIMEZONE first, this is a personal - // preference. - if ($array[$key]->name === 'VTIMEZONE') { - $score=300000000; - return $score+$key; - } else { - $score=400000000; - return $score+$key; - } - } else { - // Properties get encoded first - // VCARD version 4.0 wants the VERSION property to appear first - if ($array[$key] instanceof Property) { - if ($array[$key]->name === 'VERSION') { - $score=100000000; - return $score+$key; - } else { - // All other properties - $score=200000000; - return $score+$key; - } - } - } - - }; - - $tmp = $this->children; - uksort($this->children, function($a, $b) use ($sortScore, $tmp) { - - $sA = $sortScore($a, $tmp); - $sB = $sortScore($b, $tmp); - - return $sA - $sB; - - }); - - foreach($this->children as $child) $str.=$child->serialize(); - $str.= "END:" . $this->name . "\r\n"; - - return $str; - - } - - /** - * This method returns an array, with the representation as it should be - * encoded in json. This is used to create jCard or jCal documents. - * - * @return array - */ - public function jsonSerialize() { - - $components = array(); - $properties = array(); - - foreach($this->children as $child) { - if ($child instanceof Component) { - $components[] = $child->jsonSerialize(); - } else { - $properties[] = $child->jsonSerialize(); - } - } - - return array( - strtolower($this->name), - $properties, - $components - ); - - } - - /** - * This method should return a list of default property values. - * - * @return array - */ - protected function getDefaults() { - - return array(); - - } - - /* Magic property accessors {{{ */ - - /** - * Using 'get' you will either get a property or component. - * - * If there were no child-elements found with the specified name, - * null is returned. - * - * To use this, this may look something like this: - * - * $event = $calendar->VEVENT; - * - * @param string $name - * @return Property - */ - public function __get($name) { - - $matches = $this->select($name); - if (count($matches)===0) { - return null; - } else { - $firstMatch = current($matches); - /** @var $firstMatch Property */ - $firstMatch->setIterator(new ElementList(array_values($matches))); - return $firstMatch; - } - - } - - /** - * This method checks if a sub-element with the specified name exists. - * - * @param string $name - * @return bool - */ - public function __isset($name) { - - $matches = $this->select($name); - return count($matches)>0; - - } - - /** - * Using the setter method you can add properties or subcomponents - * - * You can either pass a Component, Property - * object, or a string to automatically create a Property. - * - * If the item already exists, it will be removed. If you want to add - * a new item with the same name, always use the add() method. - * - * @param string $name - * @param mixed $value - * @return void - */ - public function __set($name, $value) { - - $matches = $this->select($name); - $overWrite = count($matches)?key($matches):null; - - if ($value instanceof Component || $value instanceof Property) { - $value->parent = $this; - if (!is_null($overWrite)) { - $this->children[$overWrite] = $value; - } else { - $this->children[] = $value; - } - } elseif (is_scalar($value) || is_array($value) || is_null($value)) { - $property = $this->root->create($name,$value); - $property->parent = $this; - if (!is_null($overWrite)) { - $this->children[$overWrite] = $property; - } else { - $this->children[] = $property; - } - } else { - throw new \InvalidArgumentException('You must pass a \\SabreForRainLoop\\VObject\\Component, \\SabreForRainLoop\\VObject\\Property or scalar type'); - } - - } - - /** - * Removes all properties and components within this component with the - * specified name. - * - * @param string $name - * @return void - */ - public function __unset($name) { - - $matches = $this->select($name); - foreach($matches as $k=>$child) { - - unset($this->children[$k]); - $child->parent = null; - - } - - } - - /* }}} */ - - /** - * This method is automatically called when the object is cloned. - * Specifically, this will ensure all child elements are also cloned. - * - * @return void - */ - public function __clone() { - - foreach($this->children as $key=>$child) { - $this->children[$key] = clone $child; - $this->children[$key]->parent = $this; - } - - } - - /** - * Validates the node for correctness. - * - * The following options are supported: - * - Node::REPAIR - If something is broken, an automatic repair may - * be attempted. - * - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @param int $options - * @return array - */ - public function validate($options = 0) { - - $result = array(); - foreach($this->children as $child) { - $result = array_merge($result, $child->validate($options)); - } - return $result; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php deleted file mode 100644 index 6951c1996a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VAlarm.php +++ /dev/null @@ -1,108 +0,0 @@ -TRIGGER; - if(!isset($trigger['VALUE']) || strtoupper($trigger['VALUE']) === 'DURATION') { - $triggerDuration = VObject\DateTimeParser::parseDuration($this->TRIGGER); - $related = (isset($trigger['RELATED']) && strtoupper($trigger['RELATED']) == 'END') ? 'END' : 'START'; - - $parentComponent = $this->parent; - if ($related === 'START') { - - if ($parentComponent->name === 'VTODO') { - $propName = 'DUE'; - } else { - $propName = 'DTSTART'; - } - - $effectiveTrigger = clone $parentComponent->$propName->getDateTime(); - $effectiveTrigger->add($triggerDuration); - } else { - if ($parentComponent->name === 'VTODO') { - $endProp = 'DUE'; - } elseif ($parentComponent->name === 'VEVENT') { - $endProp = 'DTEND'; - } else { - throw new \LogicException('time-range filters on VALARM components are only supported when they are a child of VTODO or VEVENT'); - } - - if (isset($parentComponent->$endProp)) { - $effectiveTrigger = clone $parentComponent->$endProp->getDateTime(); - $effectiveTrigger->add($triggerDuration); - } elseif (isset($parentComponent->DURATION)) { - $effectiveTrigger = clone $parentComponent->DTSTART->getDateTime(); - $duration = VObject\DateTimeParser::parseDuration($parentComponent->DURATION); - $effectiveTrigger->add($duration); - $effectiveTrigger->add($triggerDuration); - } else { - $effectiveTrigger = clone $parentComponent->DTSTART->getDateTime(); - $effectiveTrigger->add($triggerDuration); - } - } - } else { - $effectiveTrigger = $trigger->getDateTime(); - } - return $effectiveTrigger; - - } - - /** - * Returns true or false depending on if the event falls in the specified - * time-range. This is used for filtering purposes. - * - * The rules used to determine if an event falls within the specified - * time-range is based on the CalDAV specification. - * - * @param \DateTime $start - * @param \DateTime $end - * @return bool - */ - public function isInTimeRange(\DateTime $start, \DateTime $end) { - - $effectiveTrigger = $this->getEffectiveTriggerTime(); - - if (isset($this->DURATION)) { - $duration = VObject\DateTimeParser::parseDuration($this->DURATION); - $repeat = (string)$this->repeat; - if (!$repeat) { - $repeat = 1; - } - - $period = new \DatePeriod($effectiveTrigger, $duration, (int)$repeat); - - foreach($period as $occurrence) { - - if ($start <= $occurrence && $end > $occurrence) { - return true; - } - } - return false; - } else { - return ($start <= $effectiveTrigger && $end > $effectiveTrigger); - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCalendar.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCalendar.php deleted file mode 100644 index ecc6784d49..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCalendar.php +++ /dev/null @@ -1,369 +0,0 @@ - 'SabreForRainLoop\\VObject\\Component\\VEvent', - 'VFREEBUSY' => 'SabreForRainLoop\\VObject\\Component\\VFreeBusy', - 'VJOURNAL' => 'SabreForRainLoop\\VObject\\Component\\VJournal', - 'VTODO' => 'SabreForRainLoop\\VObject\\Component\\VTodo', - 'VALARM' => 'SabreForRainLoop\\VObject\\Component\\VAlarm', - ); - - /** - * List of value-types, and which classes they map to. - * - * @var array - */ - static public $valueMap = array( - 'BINARY' => 'SabreForRainLoop\\VObject\\Property\\Binary', - 'BOOLEAN' => 'SabreForRainLoop\\VObject\\Property\\Boolean', - 'CAL-ADDRESS' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'DATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Date', - 'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DURATION' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', - 'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Float', - 'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'PERIOD' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Period', - 'RECUR' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', - 'TEXT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'TIME' => 'SabreForRainLoop\\VObject\\Property\\Time', - 'UNKNOWN' => 'SabreForRainLoop\\VObject\\Property\\Unknown', // jCard / jCal-only. - 'URI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UTC-OFFSET' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - ); - - /** - * List of properties, and which classes they map to. - * - * @var array - */ - static public $propertyMap = array( - // Calendar properties - 'CALSCALE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'METHOD' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PRODID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'VERSION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - - // Component properties - 'ATTACH' => 'SabreForRainLoop\\VObject\\Property\\Binary', - 'CATEGORIES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'CLASS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'COMMENT' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'DESCRIPTION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'GEO' => 'SabreForRainLoop\\VObject\\Property\\Float', - 'LOCATION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PERCENT-COMPLETE' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'PRIORITY' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'RESOURCES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'STATUS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'SUMMARY' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - - // Date and Time Component Properties - 'COMPLETED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTEND' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DUE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTSTART' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DURATION' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', - 'FREEBUSY' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Period', - 'TRANSP' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - - // Time Zone Component Properties - 'TZID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZNAME' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZOFFSETFROM' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - 'TZOFFSETTO' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - 'TZURL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - - // Relationship Component Properties - 'ATTENDEE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'CONTACT' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ORGANIZER' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\CalAddress', - 'RECURRENCE-ID' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RELATED-TO' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - - // Recurrence Component Properties - 'EXDATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RDATE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'RRULE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', - 'EXRULE' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Recur', // Deprecated since rfc5545 - - // Alarm Component Properties - 'ACTION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'REPEAT' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'TRIGGER' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\Duration', - - // Change Management Component Properties - 'CREATED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'DTSTAMP' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'LAST-MODIFIED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'SEQUENCE' => 'SabreForRainLoop\\VObject\\Property\\Integer', - - // Request Status - 'REQUEST-STATUS' => 'SabreForRainLoop\\VObject\\Property\\Text', - - // Additions from draft-daboo-valarm-extensions-04 - 'ALARM-AGENT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'ACKNOWLEDGED' => 'SabreForRainLoop\\VObject\\Property\\ICalendar\\DateTime', - 'PROXIMITY' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'DEFAULT-ALARM' => 'SabreForRainLoop\\VObject\\Property\\Boolean', - - ); - - /** - * Returns the current document type. - * - * @return void - */ - public function getDocumentType() { - - return self::ICALENDAR20; - - } - - /** - * Returns a list of all 'base components'. For instance, if an Event has - * a recurrence rule, and one instance is overridden, the overridden event - * will have the same UID, but will be excluded from this list. - * - * VTIMEZONE components will always be excluded. - * - * @param string $componentName filter by component name - * @return array - */ - public function getBaseComponents($componentName = null) { - - $components = array(); - foreach($this->children as $component) { - - if (!$component instanceof VObject\Component) - continue; - - if (isset($component->{'RECURRENCE-ID'})) - continue; - - if ($componentName && $component->name !== strtoupper($componentName)) - continue; - - if ($component->name === 'VTIMEZONE') - continue; - - $components[] = $component; - - } - - return $components; - - } - - /** - * If this calendar object, has events with recurrence rules, this method - * can be used to expand the event into multiple sub-events. - * - * Each event will be stripped from it's recurrence information, and only - * the instances of the event in the specified timerange will be left - * alone. - * - * In addition, this method will cause timezone information to be stripped, - * and normalized to UTC. - * - * This method will alter the VCalendar. This cannot be reversed. - * - * This functionality is specifically used by the CalDAV standard. It is - * possible for clients to request expand events, if they are rather simple - * clients and do not have the possibility to calculate recurrences. - * - * @param DateTime $start - * @param DateTime $end - * @return void - */ - public function expand(\DateTime $start, \DateTime $end) { - - $newEvents = array(); - - foreach($this->select('VEVENT') as $key=>$vevent) { - - if (isset($vevent->{'RECURRENCE-ID'})) { - unset($this->children[$key]); - continue; - } - - - if (!$vevent->rrule) { - unset($this->children[$key]); - if ($vevent->isInTimeRange($start, $end)) { - $newEvents[] = $vevent; - } - continue; - } - - $uid = (string)$vevent->uid; - if (!$uid) { - throw new \LogicException('Event did not have a UID!'); - } - - $it = new VObject\RecurrenceIterator($this, $vevent->uid); - $it->fastForward($start); - - while($it->valid() && $it->getDTStart() < $end) { - - if ($it->getDTEnd() > $start) { - - $newEvents[] = $it->getEventObject(); - - } - $it->next(); - - } - unset($this->children[$key]); - - } - - // Setting all properties to UTC time. - foreach($newEvents as $newEvent) { - - foreach($newEvent->children as $child) { - if ($child instanceof VObject\Property\ICalendar\DateTime && $child->hasTime()) { - $dt = $child->getDateTimes(); - // We only need to update the first timezone, because - // setDateTimes will match all other timezones to the - // first. - $dt[0]->setTimeZone(new \DateTimeZone('UTC')); - $child->setDateTimes($dt); - } - - } - - $this->add($newEvent); - - } - - // Removing all VTIMEZONE components - unset($this->VTIMEZONE); - - } - - /** - * This method should return a list of default property values. - * - * @return array - */ - protected function getDefaults() { - - return array( - 'VERSION' => '2.0', - 'PRODID' => '-//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN', - 'CALSCALE' => 'GREGORIAN', - ); - - } - - /** - * Validates the node for correctness. - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @return array - */ - public function validate($options = 0) { - - $warnings = array(); - - $version = $this->select('VERSION'); - if (count($version)!==1) { - $warnings[] = array( - 'level' => 1, - 'message' => 'The VERSION property must appear in the VCALENDAR component exactly 1 time', - 'node' => $this, - ); - } else { - if ((string)$this->VERSION !== '2.0') { - $warnings[] = array( - 'level' => 1, - 'message' => 'Only iCalendar version 2.0 as defined in rfc5545 is supported.', - 'node' => $this, - ); - } - } - $version = $this->select('PRODID'); - if (count($version)!==1) { - $warnings[] = array( - 'level' => 2, - 'message' => 'The PRODID property must appear in the VCALENDAR component exactly 1 time', - 'node' => $this, - ); - } - if (count($this->CALSCALE) > 1) { - $warnings[] = array( - 'level' => 2, - 'message' => 'The CALSCALE property must not be specified more than once.', - 'node' => $this, - ); - } - if (count($this->METHOD) > 1) { - $warnings[] = array( - 'level' => 2, - 'message' => 'The METHOD property must not be specified more than once.', - 'node' => $this, - ); - } - - $componentsFound = 0; - foreach($this->children as $child) { - if($child instanceof Component) { - $componentsFound++; - } - } - - if ($componentsFound===0) { - $warnings[] = array( - 'level' => 1, - 'message' => 'An iCalendar object must have at least 1 component.', - 'node' => $this, - ); - } - - return array_merge( - $warnings, - parent::validate() - ); - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php deleted file mode 100644 index e44ac3f1f0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VCard.php +++ /dev/null @@ -1,353 +0,0 @@ - 'SabreForRainLoop\\VObject\\Property\\Binary', - 'BOOLEAN' => 'SabreForRainLoop\\VObject\\Property\\Boolean', - 'CONTENT-ID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // vCard 2.1 only - 'DATE' => 'SabreForRainLoop\\VObject\\Property\\VCard\\Date', - 'DATE-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateTime', - 'DATE-AND-OR-TIME' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', // vCard only - 'FLOAT' => 'SabreForRainLoop\\VObject\\Property\\Float', - 'INTEGER' => 'SabreForRainLoop\\VObject\\Property\\Integer', - 'LANGUAGE-TAG' => 'SabreForRainLoop\\VObject\\Property\\VCard\\LanguageTag', - 'TIMESTAMP' => 'SabreForRainLoop\\VObject\\Property\\VCard\\TimeStamp', - 'TEXT' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'TIME' => 'SabreForRainLoop\\VObject\\Property\\Time', - 'UNKNOWN' => 'SabreForRainLoop\\VObject\\Property\\Unknown', // jCard / jCal-only. - 'URI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', // vCard 2.1 only - 'UTC-OFFSET' => 'SabreForRainLoop\\VObject\\Property\\UtcOffset', - ); - - /** - * List of properties, and which classes they map to. - * - * @var array - */ - static public $propertyMap = array( - - // vCard 2.1 properties and up - 'N' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'FN' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PHOTO' => 'SabreForRainLoop\\VObject\\Property\\Binary', // Todo: we should add a class for Binary values. - 'BDAY' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', - 'ADR' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'LABEL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 - 'TEL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'EMAIL' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'MAILER' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 - 'GEO' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TITLE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ROLE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'LOGO' => 'SabreForRainLoop\\VObject\\Property\\Binary', - // 'AGENT' => 'SabreForRainLoop\\VObject\\Property\\', // Todo: is an embedded vCard. Probably rare, so - // not supported at the moment - 'ORG' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'NOTE' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'REV' => 'SabreForRainLoop\\VObject\\Property\\VCard\\TimeStamp', - 'SOUND' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'URL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'UID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'VERSION' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'KEY' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'TZ' => 'SabreForRainLoop\\VObject\\Property\\Text', - - // vCard 3.0 properties - 'CATEGORIES' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'SORT-STRING' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'PRODID' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'NICKNAME' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'CLASS' => 'SabreForRainLoop\\VObject\\Property\\FlatText', // Removed in vCard 4.0 - - // rfc2739 properties - 'FBURL' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'CAPURI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - 'CALURI' => 'SabreForRainLoop\\VObject\\Property\\Uri', - - // rfc4770 properties - 'IMPP' => 'SabreForRainLoop\\VObject\\Property\\Uri', - - // vCard 4.0 properties - 'XML' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - 'ANNIVERSARY' => 'SabreForRainLoop\\VObject\\Property\\VCard\\DateAndOrTime', - 'CLIENTPIDMAP' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'LANG' => 'SabreForRainLoop\\VObject\\Property\\VCard\\LanguageTag', - 'GENDER' => 'SabreForRainLoop\\VObject\\Property\\Text', - 'KIND' => 'SabreForRainLoop\\VObject\\Property\\FlatText', - - ); - - /** - * Returns the current document type. - * - * @return void - */ - public function getDocumentType() { - - if (!$this->version) { - $version = (string)$this->VERSION; - switch($version) { - case '2.1' : - $this->version = self::VCARD21; - break; - case '3.0' : - $this->version = self::VCARD30; - break; - case '4.0' : - $this->version = self::VCARD40; - break; - default : - $this->version = self::UNKNOWN; - break; - - } - } - - return $this->version; - - } - - /** - * Converts the document to a different vcard version. - * - * Use one of the VCARD constants for the target. This method will return - * a copy of the vcard in the new version. - * - * At the moment the only supported conversion is from 3.0 to 4.0. - * - * If input and output version are identical, a clone is returned. - * - * @param int $target - * @return VCard - */ - public function convert($target) { - - $converter = new VObject\VCardConverter(); - return $converter->convert($this, $target); - - } - - /** - * VCards with version 2.1, 3.0 and 4.0 are found. - * - * If the VCARD doesn't know its version, 2.1 is assumed. - */ - const DEFAULT_VERSION = self::VCARD21; - - - - /** - * Validates the node for correctness. - * - * The following options are supported: - * - Node::REPAIR - If something is broken, and automatic repair may - * be attempted. - * - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @param int $options - * @return array - */ - public function validate($options = 0) { - - $warnings = array(); - - $versionMap = array( - self::VCARD21 => '2.1', - self::VCARD30 => '3.0', - self::VCARD40 => '4.0', - ); - - $version = $this->select('VERSION'); - if (count($version)!==1) { - $warnings[] = array( - 'level' => 1, - 'message' => 'The VERSION property must appear in the VCARD component exactly 1 time', - 'node' => $this, - ); - if ($options & self::REPAIR) { - $this->VERSION = $versionMap[self::DEFAULT_VERSION]; - } - } else { - $version = (string)$this->VERSION; - if ($version!=='2.1' && $version!=='3.0' && $version!=='4.0') { - $warnings[] = array( - 'level' => 1, - 'message' => 'Only vcard version 4.0 (RFC6350), version 3.0 (RFC2426) or version 2.1 (icm-vcard-2.1) are supported.', - 'node' => $this, - ); - if ($options & self::REPAIR) { - $this->VERSION = $versionMap[self::DEFAULT_VERSION]; - } - } - - } - $fn = $this->select('FN'); - if (count($fn)!==1) { - $warnings[] = array( - 'level' => 1, - 'message' => 'The FN property must appear in the VCARD component exactly 1 time', - 'node' => $this, - ); - if (($options & self::REPAIR) && count($fn) === 0) { - // We're going to try to see if we can use the contents of the - // N property. - if (isset($this->N)) { - $value = explode(';', (string)$this->N); - if (isset($value[1]) && $value[1]) { - $this->FN = $value[1] . ' ' . $value[0]; - } else { - $this->FN = $value[0]; - } - - // Otherwise, the ORG property may work - } elseif (isset($this->ORG)) { - $this->FN = (string)$this->ORG; - } - - } - } - - return array_merge( - parent::validate($options), - $warnings - ); - - } - - /** - * Returns a preferred field. - * - * VCards can indicate wether a field such as ADR, TEL or EMAIL is - * preferred by specifying TYPE=PREF (vcard 2.1, 3) or PREF=x (vcard 4, x - * being a number between 1 and 100). - * - * If neither of those parameters are specified, the first is returned, if - * a field with that name does not exist, null is returned. - * - * @param string $fieldName - * @return VObject\Property|null - */ - public function preferred($propertyName) { - - $preferred = null; - $lastPref = 101; - foreach($this->select($propertyName) as $field) { - - $pref = 101; - if (isset($field['TYPE']) && $field['TYPE']->has('PREF')) { - $pref = 1; - } elseif (isset($field['PREF'])) { - $pref = $field['PREF']->getValue(); - } - - if ($pref < $lastPref || is_null($preferred)) { - $preferred = $field; - $lastPref = $pref; - } - - } - return $preferred; - - } - - /** - * This method should return a list of default property values. - * - * @return array - */ - protected function getDefaults() { - - return array( - 'VERSION' => '3.0', - 'PRODID' => '-//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN', - ); - - } - - /** - * This method returns an array, with the representation as it should be - * encoded in json. This is used to create jCard or jCal documents. - * - * @return array - */ - public function jsonSerialize() { - - // A vcard does not have sub-components, so we're overriding this - // method to remove that array element. - $properties = array(); - - foreach($this->children as $child) { - $properties[] = $child->jsonSerialize(); - } - - return array( - strtolower($this->name), - $properties, - ); - - } - - /** - * Returns the default class for a property name. - * - * @param string $propertyName - * @return string - */ - public function getClassNameForPropertyName($propertyName) { - - $className = parent::getClassNameForPropertyName($propertyName); - // In vCard 4, BINARY no longer exists, and we need URI instead. - - if ($className == 'SabreForRainLoop\\VObject\\Property\\Binary' && $this->getDocumentType()===self::VCARD40) { - return 'SabreForRainLoop\\VObject\\Property\\Uri'; - } - return $className; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php deleted file mode 100644 index b1dc19331a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VEvent.php +++ /dev/null @@ -1,70 +0,0 @@ -RRULE) { - $it = new VObject\RecurrenceIterator($this); - $it->fastForward($start); - - // We fast-forwarded to a spot where the end-time of the - // recurrence instance exceeded the start of the requested - // time-range. - // - // If the starttime of the recurrence did not exceed the - // end of the time range as well, we have a match. - return ($it->getDTStart() < $end && $it->getDTEnd() > $start); - - } - - $effectiveStart = $this->DTSTART->getDateTime(); - if (isset($this->DTEND)) { - - // The DTEND property is considered non inclusive. So for a 3 day - // event in july, dtstart and dtend would have to be July 1st and - // July 4th respectively. - // - // See: - // http://tools.ietf.org/html/rfc5545#page-54 - $effectiveEnd = $this->DTEND->getDateTime(); - - } elseif (isset($this->DURATION)) { - $effectiveEnd = clone $effectiveStart; - $effectiveEnd->add( VObject\DateTimeParser::parseDuration($this->DURATION) ); - } elseif (!$this->DTSTART->hasTime()) { - $effectiveEnd = clone $effectiveStart; - $effectiveEnd->modify('+1 day'); - } else { - $effectiveEnd = clone $effectiveStart; - } - return ( - ($start <= $effectiveEnd) && ($end > $effectiveStart) - ); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VFreeBusy.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VFreeBusy.php deleted file mode 100644 index 1787c6bb91..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VFreeBusy.php +++ /dev/null @@ -1,68 +0,0 @@ -select('FREEBUSY') as $freebusy) { - - // We are only interested in FBTYPE=BUSY (the default), - // FBTYPE=BUSY-TENTATIVE or FBTYPE=BUSY-UNAVAILABLE. - if (isset($freebusy['FBTYPE']) && strtoupper(substr((string)$freebusy['FBTYPE'],0,4))!=='BUSY') { - continue; - } - - // The freebusy component can hold more than 1 value, separated by - // commas. - $periods = explode(',', (string)$freebusy); - - foreach($periods as $period) { - // Every period is formatted as [start]/[end]. The start is an - // absolute UTC time, the end may be an absolute UTC time, or - // duration (relative) value. - list($busyStart, $busyEnd) = explode('/', $period); - - $busyStart = VObject\DateTimeParser::parse($busyStart); - $busyEnd = VObject\DateTimeParser::parse($busyEnd); - if ($busyEnd instanceof \DateInterval) { - $tmp = clone $busyStart; - $tmp->add($busyEnd); - $busyEnd = $tmp; - } - - if($start < $busyEnd && $end > $busyStart) { - return false; - } - - } - - } - - return true; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VJournal.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VJournal.php deleted file mode 100644 index 8a54a2b0d5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VJournal.php +++ /dev/null @@ -1,46 +0,0 @@ -DTSTART)?$this->DTSTART->getDateTime():null; - if ($dtstart) { - $effectiveEnd = clone $dtstart; - if (!$this->DTSTART->hasTime()) { - $effectiveEnd->modify('+1 day'); - } - - return ($start <= $effectiveEnd && $end > $dtstart); - - } - return false; - - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VTodo.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VTodo.php deleted file mode 100644 index 27bd2e30dc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Component/VTodo.php +++ /dev/null @@ -1,68 +0,0 @@ -DTSTART)?$this->DTSTART->getDateTime():null; - $duration = isset($this->DURATION)?VObject\DateTimeParser::parseDuration($this->DURATION):null; - $due = isset($this->DUE)?$this->DUE->getDateTime():null; - $completed = isset($this->COMPLETED)?$this->COMPLETED->getDateTime():null; - $created = isset($this->CREATED)?$this->CREATED->getDateTime():null; - - if ($dtstart) { - if ($duration) { - $effectiveEnd = clone $dtstart; - $effectiveEnd->add($duration); - return $start <= $effectiveEnd && $end > $dtstart; - } elseif ($due) { - return - ($start < $due || $start <= $dtstart) && - ($end > $dtstart || $end >= $due); - } else { - return $start <= $dtstart && $end > $dtstart; - } - } - if ($due) { - return ($start < $due && $end >= $due); - } - if ($completed && $created) { - return - ($start <= $created || $start <= $completed) && - ($end >= $created || $end >= $completed); - } - if ($completed) { - return ($start <= $completed && $end >= $completed); - } - if ($created) { - return ($end > $created); - } - return true; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/DateTimeParser.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/DateTimeParser.php deleted file mode 100644 index 687a917616..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/DateTimeParser.php +++ /dev/null @@ -1,415 +0,0 @@ -setTimeZone(new \DateTimeZone('UTC')); - return $date; - - } - - /** - * Parses an iCalendar (rfc5545) formatted date and returns a DateTime object - * - * @param string $date - * @return DateTime - */ - static public function parseDate($date) { - - // Format is YYYYMMDD - $result = preg_match('/^([0-9]{4})([0-1][0-9])([0-3][0-9])$/',$date,$matches); - - if (!$result) { - throw new \LogicException('The supplied iCalendar date value is incorrect: ' . $date); - } - - $date = new \DateTime($matches[1] . '-' . $matches[2] . '-' . $matches[3], new \DateTimeZone('UTC')); - return $date; - - } - - /** - * Parses an iCalendar (RFC5545) formatted duration value. - * - * This method will either return a DateTimeInterval object, or a string - * suitable for strtotime or DateTime::modify. - * - * @param string $duration - * @param bool $asString - * @return DateInterval|string - */ - static public function parseDuration($duration, $asString = false) { - - $result = preg_match('/^(?P\+|-)?P((?P\d+)W)?((?P\d+)D)?(T((?P\d+)H)?((?P\d+)M)?((?P\d+)S)?)?$/', $duration, $matches); - if (!$result) { - throw new \LogicException('The supplied iCalendar duration value is incorrect: ' . $duration); - } - - if (!$asString) { - $invert = false; - if ($matches['plusminus']==='-') { - $invert = true; - } - - - $parts = array( - 'week', - 'day', - 'hour', - 'minute', - 'second', - ); - foreach($parts as $part) { - $matches[$part] = isset($matches[$part])&&$matches[$part]?(int)$matches[$part]:0; - } - - - // We need to re-construct the $duration string, because weeks and - // days are not supported by DateInterval in the same string. - $duration = 'P'; - $days = $matches['day']; - if ($matches['week']) { - $days+=$matches['week']*7; - } - if ($days) - $duration.=$days . 'D'; - - if ($matches['minute'] || $matches['second'] || $matches['hour']) { - $duration.='T'; - - if ($matches['hour']) - $duration.=$matches['hour'].'H'; - - if ($matches['minute']) - $duration.=$matches['minute'].'M'; - - if ($matches['second']) - $duration.=$matches['second'].'S'; - - } - - if ($duration==='P') { - $duration = 'PT0S'; - } - $iv = new \DateInterval($duration); - if ($invert) $iv->invert = true; - - return $iv; - - } - - - - $parts = array( - 'week', - 'day', - 'hour', - 'minute', - 'second', - ); - - $newDur = ''; - foreach($parts as $part) { - if (isset($matches[$part]) && $matches[$part]) { - $newDur.=' '.$matches[$part] . ' ' . $part . 's'; - } - } - - $newDur = ($matches['plusminus']==='-'?'-':'+') . trim($newDur); - if ($newDur === '+') { $newDur = '+0 seconds'; }; - return $newDur; - - } - - /** - * Parses either a Date or DateTime, or Duration value. - * - * @param string $date - * @param DateTimeZone|string $referenceTZ - * @return DateTime|DateInterval - */ - static public function parse($date, $referenceTZ = null) { - - if ($date[0]==='P' || ($date[0]==='-' && $date[1]==='P')) { - return self::parseDuration($date); - } elseif (strlen($date)===8) { - return self::parseDate($date); - } else { - return self::parseDateTime($date, $referenceTZ); - } - - } - - /** - * This method parses a vCard date and or time value. - * - * This can be used for the DATE, DATE-TIME, TIMESTAMP and - * DATE-AND-OR-TIME value. - * - * This method returns an array, not a DateTime value. - * - * The elements in the array are in the following order: - * year, month, date, hour, minute, second, timezone - * - * Almost any part of the string may be omitted. It's for example legal to - * just specify seconds, leave out the year, etc. - * - * Timezone is either returned as 'Z' or as '+08:00' - * - * For any non-specified values null is returned. - * - * List of date formats that are supported: - * YYYY - * YYYY-MM - * YYYYMMDD - * --MMDD - * ---DD - * - * YYYY-MM-DD - * --MM-DD - * ---DD - * - * List of supported time formats: - * - * HH - * HHMM - * HHMMSS - * -MMSS - * --SS - * - * HH - * HH:MM - * HH:MM:SS - * -MM:SS - * --SS - * - * A full basic-format date-time string looks like : - * 20130603T133901 - * - * A full extended-format date-time string looks like : - * 2013-06-03T13:39:01 - * - * Times may be postfixed by a timezone offset. This can be either 'Z' for - * UTC, or a string like -0500 or +1100. - * - * @param string $date - * @return array - */ - static public function parseVCardDateTime($date) { - - $regex = '/^ - (?: # date part - (?: - (?: (?P [0-9]{4}) (?: -)?| --) - (?P [0-9]{2})? - |---) - (?P [0-9]{2})? - )? - (?:T # time part - (?P [0-9]{2} | -) - (?P [0-9]{2} | -)? - (?P [0-9]{2})? - - (?P # timezone offset - - Z | (?: \+|-)(?: [0-9]{4}) - - )? - - )? - $/x'; - - - if (!preg_match($regex, $date, $matches)) { - - // Attempting to parse the extended format. - $regex = '/^ - (?: # date part - (?: (?P [0-9]{4}) - | -- ) - (?P [0-9]{2}) - - (?P [0-9]{2}) - )? - (?:T # time part - - (?: (?P [0-9]{2}) : | -) - (?: (?P [0-9]{2}) : | -)? - (?P [0-9]{2})? - - (?P # timezone offset - - Z | (?: \+|-)(?: [0-9]{2}:[0-9]{2}) - - )? - - )? - $/x'; - - if (!preg_match($regex, $date, $matches)) { - throw new \InvalidArgumentException('Invalid vCard date-time string: ' . $date); - } - - } - $parts = array( - 'year', - 'month', - 'date', - 'hour', - 'minute', - 'second', - 'timezone' - ); - - $result = array(); - foreach($parts as $part) { - - if (empty($matches[$part])) { - $result[$part] = null; - } elseif ($matches[$part] === '-' || $matches[$part] === '--') { - $result[$part] = null; - } else { - $result[$part] = $matches[$part]; - } - - } - - return $result; - - } - - /** - * This method parses a vCard TIME value. - * - * This method returns an array, not a DateTime value. - * - * The elements in the array are in the following order: - * hour, minute, second, timezone - * - * Almost any part of the string may be omitted. It's for example legal to - * just specify seconds, leave out the hour etc. - * - * Timezone is either returned as 'Z' or as '+08:00' - * - * For any non-specified values null is returned. - * - * List of supported time formats: - * - * HH - * HHMM - * HHMMSS - * -MMSS - * --SS - * - * HH - * HH:MM - * HH:MM:SS - * -MM:SS - * --SS - * - * A full basic-format time string looks like : - * 133901 - * - * A full extended-format time string looks like : - * 13:39:01 - * - * Times may be postfixed by a timezone offset. This can be either 'Z' for - * UTC, or a string like -0500 or +11:00. - * - * @param string $date - * @return array - */ - static public function parseVCardTime($date) { - - $regex = '/^ - (?P [0-9]{2} | -) - (?P [0-9]{2} | -)? - (?P [0-9]{2})? - - (?P # timezone offset - - Z | (?: \+|-)(?: [0-9]{4}) - - )? - $/x'; - - - if (!preg_match($regex, $date, $matches)) { - - // Attempting to parse the extended format. - $regex = '/^ - (?: (?P [0-9]{2}) : | -) - (?: (?P [0-9]{2}) : | -)? - (?P [0-9]{2})? - - (?P # timezone offset - - Z | (?: \+|-)(?: [0-9]{2}:[0-9]{2}) - - )? - $/x'; - - if (!preg_match($regex, $date, $matches)) { - throw new \InvalidArgumentException('Invalid vCard time string: ' . $date); - } - - } - $parts = array( - 'hour', - 'minute', - 'second', - 'timezone' - ); - - $result = array(); - foreach($parts as $part) { - - if (empty($matches[$part])) { - $result[$part] = null; - } elseif ($matches[$part] === '-') { - $result[$part] = null; - } else { - $result[$part] = $matches[$part]; - } - - } - - return $result; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Document.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Document.php deleted file mode 100644 index fd17b162df..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Document.php +++ /dev/null @@ -1,261 +0,0 @@ -value syntax, in which case - * properties will automatically be created, or you can just pass a list of - * Component and Property object. - * - * By default, a set of sensible values will be added to the component. For - * an iCalendar object, this may be something like CALSCALE:GREGORIAN. To - * ensure that this does not happen, set $defaults to false. - * - * @param string $name - * @param array $children - * @param bool $defaults - * @return Component - */ - public function createComponent($name, array $children = null, $defaults = true) { - - $name = strtoupper($name); - $class = 'SabreForRainLoop\\VObject\\Component'; - - if (isset(static::$componentMap[$name])) { - $class=static::$componentMap[$name]; - } - if (is_null($children)) $children = array(); - return new $class($this, $name, $children, $defaults); - - } - - /** - * Factory method for creating new properties - * - * This method automatically searches for the correct property class, based - * on its name. - * - * You can specify the parameters either in key=>value syntax, in which case - * parameters will automatically be created, or you can just pass a list of - * Parameter objects. - * - * @param string $name - * @param mixed $value - * @param array $parameters - * @param string $valueType Force a specific valuetype, such as URI or TEXT - * @return Property - */ - public function createProperty($name, $value = null, array $parameters = null, $valueType = null) { - - // If there's a . in the name, it means it's prefixed by a groupname. - if (($i=strpos($name,'.'))!==false) { - $group = substr($name, 0, $i); - $name = strtoupper(substr($name, $i+1)); - } else { - $name = strtoupper($name); - $group = null; - } - - $class = null; - - if ($valueType) { - // The valueType argument comes first to figure out the correct - // class. - $class = $this->getClassNameForPropertyValue($valueType); - } - - if (is_null($class) && isset($parameters['VALUE'])) { - // If a VALUE parameter is supplied, we should use that. - $class = $this->getClassNameForPropertyValue($parameters['VALUE']); - } - if (is_null($class)) { - $class = $this->getClassNameForPropertyName($name); - } - if (is_null($parameters)) $parameters = array(); - - return new $class($this, $name, $value, $parameters, $group); - - } - - /** - * This method returns a full class-name for a value parameter. - * - * For instance, DTSTART may have VALUE=DATE. In that case we will look in - * our valueMap table and return the appropriate class name. - * - * This method returns null if we don't have a specialized class. - * - * @param string $valueParam - * @return void - */ - public function getClassNameForPropertyValue($valueParam) { - - $valueParam = strtoupper($valueParam); - if (isset(static::$valueMap[$valueParam])) { - return static::$valueMap[$valueParam]; - } - - } - - /** - * Returns the default class for a property name. - * - * @param string $propertyName - * @return string - */ - public function getClassNameForPropertyName($propertyName) { - - if (isset(static::$propertyMap[$propertyName])) { - return static::$propertyMap[$propertyName]; - } else { - return 'SabreForRainLoop\\VObject\\Property\\Unknown'; - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ElementList.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ElementList.php deleted file mode 100644 index 807a085c63..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ElementList.php +++ /dev/null @@ -1,172 +0,0 @@ -vevent where there's multiple VEVENT objects. - * - * @copyright Copyright (C) 2007-2013 fruux GmbH (https://fruux.com/). - * @author Evert Pot (http://evertpot.com/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License - */ -class ElementList implements \Iterator, \Countable, \ArrayAccess { - - /** - * Inner elements - * - * @var array - */ - protected $elements = array(); - - /** - * Creates the element list. - * - * @param array $elements - */ - public function __construct(array $elements) { - - $this->elements = $elements; - - } - - /* {{{ Iterator interface */ - - /** - * Current position - * - * @var int - */ - private $key = 0; - - /** - * Returns current item in iteration - * - * @return Element - */ - public function current() { - - return $this->elements[$this->key]; - - } - - /** - * To the next item in the iterator - * - * @return void - */ - public function next() { - - $this->key++; - - } - - /** - * Returns the current iterator key - * - * @return int - */ - public function key() { - - return $this->key; - - } - - /** - * Returns true if the current position in the iterator is a valid one - * - * @return bool - */ - public function valid() { - - return isset($this->elements[$this->key]); - - } - - /** - * Rewinds the iterator - * - * @return void - */ - public function rewind() { - - $this->key = 0; - - } - - /* }}} */ - - /* {{{ Countable interface */ - - /** - * Returns the number of elements - * - * @return int - */ - public function count() { - - return count($this->elements); - - } - - /* }}} */ - - /* {{{ ArrayAccess Interface */ - - - /** - * Checks if an item exists through ArrayAccess. - * - * @param int $offset - * @return bool - */ - public function offsetExists($offset) { - - return isset($this->elements[$offset]); - - } - - /** - * Gets an item through ArrayAccess. - * - * @param int $offset - * @return mixed - */ - public function offsetGet($offset) { - - return $this->elements[$offset]; - - } - - /** - * Sets an item through ArrayAccess. - * - * @param int $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset,$value) { - - throw new \LogicException('You can not add new objects to an ElementList'); - - } - - /** - * Sets an item through ArrayAccess. - * - * This method just forwards the request to the inner iterator - * - * @param int $offset - * @return void - */ - public function offsetUnset($offset) { - - throw new \LogicException('You can not remove objects from an ElementList'); - - } - - /* }}} */ - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/EofException.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/EofException.php deleted file mode 100644 index fc93509889..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/EofException.php +++ /dev/null @@ -1,13 +0,0 @@ -setTimeRange($start, $end); - } - - if ($objects) { - $this->setObjects($objects); - } - - } - - /** - * Sets the VCALENDAR object. - * - * If this is set, it will not be generated for you. You are responsible - * for setting things like the METHOD, CALSCALE, VERSION, etc.. - * - * The VFREEBUSY object will be automatically added though. - * - * @param Component $vcalendar - * @return void - */ - public function setBaseObject(Component $vcalendar) { - - $this->baseObject = $vcalendar; - - } - - /** - * Sets the input objects - * - * You must either specify a valendar object as a strong, or as the parse - * Component. - * It's also possible to specify multiple objects as an array. - * - * @param mixed $objects - * @return void - */ - public function setObjects($objects) { - - if (!is_array($objects)) { - $objects = array($objects); - } - - $this->objects = array(); - foreach($objects as $object) { - - if (is_string($object)) { - $this->objects[] = Reader::read($object); - } elseif ($object instanceof Component) { - $this->objects[] = $object; - } else { - throw new \InvalidArgumentException('You can only pass strings or \\SabreForRainLoop\\VObject\\Component arguments to setObjects'); - } - - } - - } - - /** - * Sets the time range - * - * Any freebusy object falling outside of this time range will be ignored. - * - * @param DateTime $start - * @param DateTime $end - * @return void - */ - public function setTimeRange(\DateTime $start = null, \DateTime $end = null) { - - $this->start = $start; - $this->end = $end; - - } - - /** - * Parses the input data and returns a correct VFREEBUSY object, wrapped in - * a VCALENDAR. - * - * @return Component - */ - public function getResult() { - - $busyTimes = array(); - - foreach($this->objects as $object) { - - foreach($object->getBaseComponents() as $component) { - - switch($component->name) { - - case 'VEVENT' : - - $FBTYPE = 'BUSY'; - if (isset($component->TRANSP) && (strtoupper($component->TRANSP) === 'TRANSPARENT')) { - break; - } - if (isset($component->STATUS)) { - $status = strtoupper($component->STATUS); - if ($status==='CANCELLED') { - break; - } - if ($status==='TENTATIVE') { - $FBTYPE = 'BUSY-TENTATIVE'; - } - } - - $times = array(); - - if ($component->RRULE) { - - $iterator = new RecurrenceIterator($object, (string)$component->uid); - if ($this->start) { - $iterator->fastForward($this->start); - } - - $maxRecurrences = 200; - - while($iterator->valid() && --$maxRecurrences) { - - $startTime = $iterator->getDTStart(); - if ($this->end && $startTime > $this->end) { - break; - } - $times[] = array( - $iterator->getDTStart(), - $iterator->getDTEnd(), - ); - - $iterator->next(); - - } - - } else { - - $startTime = $component->DTSTART->getDateTime(); - if ($this->end && $startTime > $this->end) { - break; - } - $endTime = null; - if (isset($component->DTEND)) { - $endTime = $component->DTEND->getDateTime(); - } elseif (isset($component->DURATION)) { - $duration = DateTimeParser::parseDuration((string)$component->DURATION); - $endTime = clone $startTime; - $endTime->add($duration); - } elseif (!$component->DTSTART->hasTime()) { - $endTime = clone $startTime; - $endTime->modify('+1 day'); - } else { - // The event had no duration (0 seconds) - break; - } - - $times[] = array($startTime, $endTime); - - } - - foreach($times as $time) { - - if ($this->end && $time[0] > $this->end) break; - if ($this->start && $time[1] < $this->start) break; - - $busyTimes[] = array( - $time[0], - $time[1], - $FBTYPE, - ); - } - break; - - case 'VFREEBUSY' : - foreach($component->FREEBUSY as $freebusy) { - - $fbType = isset($freebusy['FBTYPE'])?strtoupper($freebusy['FBTYPE']):'BUSY'; - - // Skipping intervals marked as 'free' - if ($fbType==='FREE') - continue; - - $values = explode(',', $freebusy); - foreach($values as $value) { - list($startTime, $endTime) = explode('/', $value); - $startTime = DateTimeParser::parseDateTime($startTime); - - if (substr($endTime,0,1)==='P' || substr($endTime,0,2)==='-P') { - $duration = DateTimeParser::parseDuration($endTime); - $endTime = clone $startTime; - $endTime->add($duration); - } else { - $endTime = DateTimeParser::parseDateTime($endTime); - } - - if($this->start && $this->start > $endTime) continue; - if($this->end && $this->end < $startTime) continue; - $busyTimes[] = array( - $startTime, - $endTime, - $fbType - ); - - } - - - } - break; - - - - } - - - } - - } - - if ($this->baseObject) { - $calendar = $this->baseObject; - } else { - $calendar = new VCalendar(); - } - - $vfreebusy = $calendar->createComponent('VFREEBUSY'); - $calendar->add($vfreebusy); - - if ($this->start) { - $dtstart = $calendar->createProperty('DTSTART'); - $dtstart->setDateTime($this->start); - $vfreebusy->add($dtstart); - } - if ($this->end) { - $dtend = $calendar->createProperty('DTEND'); - $dtend->setDateTime($this->end); - $vfreebusy->add($dtend); - } - $dtstamp = $calendar->createProperty('DTSTAMP'); - $dtstamp->setDateTime(new \DateTime('now', new \DateTimeZone('UTC'))); - $vfreebusy->add($dtstamp); - - foreach($busyTimes as $busyTime) { - - $busyTime[0]->setTimeZone(new \DateTimeZone('UTC')); - $busyTime[1]->setTimeZone(new \DateTimeZone('UTC')); - - $prop = $calendar->createProperty( - 'FREEBUSY', - $busyTime[0]->format('Ymd\\THis\\Z') . '/' . $busyTime[1]->format('Ymd\\THis\\Z') - ); - $prop['FBTYPE'] = $busyTime[2]; - $vfreebusy->add($prop); - - } - - return $calendar; - - } - -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php deleted file mode 100644 index 3330fceffc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Node.php +++ /dev/null @@ -1,201 +0,0 @@ -iterator)) - return $this->iterator; - - return new ElementList(array($this)); - - } - - /** - * Sets the overridden iterator - * - * Note that this is not actually part of the iterator interface - * - * @param ElementList $iterator - * @return void - */ - public function setIterator(ElementList $iterator) { - - $this->iterator = $iterator; - - } - - /** - * Validates the node for correctness. - * - * The following options are supported: - * - Node::REPAIR - If something is broken, and automatic repair may - * be attempted. - * - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @param int $options - * @return array - */ - public function validate($options = 0) { - - return array(); - - } - - /* }}} */ - - /* {{{ Countable interface */ - - /** - * Returns the number of elements - * - * @return int - */ - public function count() { - - $it = $this->getIterator(); - return $it->count(); - - } - - /* }}} */ - - /* {{{ ArrayAccess Interface */ - - - /** - * Checks if an item exists through ArrayAccess. - * - * This method just forwards the request to the inner iterator - * - * @param int $offset - * @return bool - */ - public function offsetExists($offset) { - - $iterator = $this->getIterator(); - return $iterator->offsetExists($offset); - - } - - /** - * Gets an item through ArrayAccess. - * - * This method just forwards the request to the inner iterator - * - * @param int $offset - * @return mixed - */ - public function offsetGet($offset) { - - $iterator = $this->getIterator(); - return $iterator->offsetGet($offset); - - } - - /** - * Sets an item through ArrayAccess. - * - * This method just forwards the request to the inner iterator - * - * @param int $offset - * @param mixed $value - * @return void - */ - public function offsetSet($offset,$value) { - - $iterator = $this->getIterator(); - $iterator->offsetSet($offset,$value); - - // @codeCoverageIgnoreStart - // - // This method always throws an exception, so we ignore the closing - // brace - } - // @codeCoverageIgnoreEnd - - /** - * Sets an item through ArrayAccess. - * - * This method just forwards the request to the inner iterator - * - * @param int $offset - * @return void - */ - public function offsetUnset($offset) { - - $iterator = $this->getIterator(); - $iterator->offsetUnset($offset); - - // @codeCoverageIgnoreStart - // - // This method always throws an exception, so we ignore the closing - // brace - } - // @codeCoverageIgnoreEnd - - /* }}} */ -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parameter.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parameter.php deleted file mode 100644 index 6e1531757e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parameter.php +++ /dev/null @@ -1,343 +0,0 @@ -name = strtoupper($name); - $this->root = $root; - if (is_null($name)) { - $this->noName = true; - $this->name = static::guessParameterNameByValue($value); - } - $this->setValue($value); - } - - /** - * Try to guess property name by value, can be used for vCard 2.1 nameless parameters. - * - * Figuring out what the name should have been. Note that a ton of - * these are rather silly in 2013 and would probably rarely be - * used, but we like to be complete. - * - * @param string $value - * @return string - */ - public static function guessParameterNameByValue($value) { - switch(strtoupper($value)) { - - // Encodings - case '7-BIT' : - case 'QUOTED-PRINTABLE' : - case 'BASE64' : - $name = 'ENCODING'; - break; - - // Common types - case 'WORK' : - case 'HOME' : - case 'PREF' : - - // Delivery Label Type - case 'DOM' : - case 'INTL' : - case 'POSTAL' : - case 'PARCEL' : - - // Telephone types - case 'VOICE' : - case 'FAX' : - case 'MSG' : - case 'CELL' : - case 'PAGER' : - case 'BBS' : - case 'MODEM' : - case 'CAR' : - case 'ISDN' : - case 'VIDEO' : - - // EMAIL types (lol) - case 'AOL' : - case 'APPLELINK' : - case 'ATTMAIL' : - case 'CIS' : - case 'EWORLD' : - case 'INTERNET' : - case 'IBMMAIL' : - case 'MCIMAIL' : - case 'POWERSHARE' : - case 'PRODIGY' : - case 'TLX' : - case 'X400' : - - // Photo / Logo format types - case 'GIF' : - case 'CGM' : - case 'WMF' : - case 'BMP' : - case 'DIB' : - case 'PICT' : - case 'TIFF' : - case 'PDF ': - case 'PS' : - case 'JPEG' : - case 'MPEG' : - case 'MPEG2' : - case 'AVI' : - case 'QTIME' : - - // Sound Digital Audio Type - case 'WAVE' : - case 'PCM' : - case 'AIFF' : - - // Key types - case 'X509' : - case 'PGP' : - $name = 'TYPE'; - break; - - // Value types - case 'INLINE' : - case 'URL' : - case 'CONTENT-ID' : - case 'CID' : - $name = 'VALUE'; - break; - - default: - $name = ''; - } - - return $name; - } - - /** - * Updates the current value. - * - * This may be either a single, or multiple strings in an array. - * - * @param string|array $value - * @return void - */ - public function setValue($value) { - - $this->value = $value; - - } - - /** - * Returns the current value - * - * This method will always return a string, or null. If there were multiple - * values, it will automatically concatinate them (separated by comma). - * - * @return string|null - */ - public function getValue() { - - if (is_array($this->value)) { - return implode(',' , $this->value); - } else { - return $this->value; - } - - } - - /** - * Sets multiple values for this parameter. - * - * @param array $value - * @return void - */ - public function setParts(array $value) { - - $this->value = $value; - - } - - /** - * Returns all values for this parameter. - * - * If there were no values, an empty array will be returned. - * - * @return array - */ - public function getParts() { - - if (is_array($this->value)) { - return $this->value; - } elseif (is_null($this->value)) { - return array(); - } else { - return array($this->value); - } - - } - - /** - * Adds a value to this parameter - * - * If the argument is specified as an array, all items will be added to the - * parameter value list. - * - * @param string|array $part - * @return void - */ - public function addValue($part) { - - if (is_null($this->value)) { - $this->value = $part; - } else { - $this->value = array_merge((array)$this->value, (array)$part); - } - - } - - /** - * Checks if this parameter contains the specified value. - * - * This is a case-insensitive match. It makes sense to call this for for - * instance the TYPE parameter, to see if it contains a keyword such as - * 'WORK' or 'FAX'. - * - * @param string $value - * @return bool - */ - public function has($value) { - - return in_array( - strtolower($value), - array_map('strtolower', (array)$this->value) - ); - - } - - /** - * Turns the object back into a serialized blob. - * - * @return string - */ - public function serialize() { - - $value = $this->getParts(); - - if (count($value)===0) { - return $this->name; - } - - if ($this->root->getDocumentType() === Document::VCARD21 && $this->noName) { - - return implode(';', $value); - - } - - return $this->name . '=' . array_reduce($value, function($out, $item) { - - if (!is_null($out)) $out.=','; - - // If there's no special characters in the string, we'll use the simple - // format - if (!preg_match('#(?: [\n":;\^,] )#x', $item)) { - return $out.$item; - } else { - // Enclosing in double-quotes, and using RFC6868 for encoding any - // special characters - $out.='"' . strtr($item, array( - '^' => '^^', - "\n" => '^n', - '"' => '^\'', - )) . '"'; - return $out; - } - - }); - - } - - /** - * This method returns an array, with the representation as it should be - * encoded in json. This is used to create jCard or jCal documents. - * - * @return array - */ - public function jsonSerialize() { - - return $this->value; - - } - - /** - * Called when this object is being cast to a string - * - * @return string - */ - public function __toString() { - - return $this->getValue(); - - } - - /** - * Returns the iterator for this object - * - * @return ElementList - */ - public function getIterator() { - - if (!is_null($this->iterator)) - return $this->iterator; - - return $this->iterator = new ArrayObject((array)$this->value); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ParseException.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ParseException.php deleted file mode 100644 index 5e3658c5fc..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/ParseException.php +++ /dev/null @@ -1,12 +0,0 @@ -setInput($input); - } - if (is_null($this->input)) { - throw new EofException('End of input stream, or no input supplied'); - } - - if (!is_null($options)) { - $this->options = $options; - } - - switch($this->input[0]) { - case 'vcalendar' : - $this->root = new VCalendar(array(), false); - break; - case 'vcard' : - $this->root = new VCard(array(), false); - break; - default : - throw new ParseException('The root component must either be a vcalendar, or a vcard'); - - } - foreach($this->input[1] as $prop) { - $this->root->add($this->parseProperty($prop)); - } - if (isset($this->input[2])) foreach($this->input[2] as $comp) { - $this->root->add($this->parseComponent($comp)); - } - - // Resetting the input so we can throw an feof exception the next time. - $this->input = null; - - return $this->root; - - } - - /** - * Parses a component - * - * @param array $jComp - * @return \SabreForRainLoop\VObject\Component - */ - public function parseComponent(array $jComp) { - - // We can remove $self from PHP 5.4 onward. - $self = $this; - - $properties = array_map(function($jProp) use ($self) { - return $self->parseProperty($jProp); - }, $jComp[1]); - - if (isset($jComp[2])) { - - $components = array_map(function($jComp) use ($self) { - return $self->parseComponent($jComp); - }, $jComp[2]); - - } else $components = array(); - - return $this->root->createComponent( - $jComp[0], - array_merge( $properties, $components), - $defaults = false - ); - - } - - /** - * Parses properties. - * - * @param array $jProp - * @return \SabreForRainLoop\VObject\Property - */ - public function parseProperty(array $jProp) { - - list( - $propertyName, - $parameters, - $valueType - ) = $jProp; - - $propertyName = strtoupper($propertyName); - - // This is the default class we would be using if we didn't know the - // value type. We're using this value later in this function. - $defaultPropertyClass = $this->root->getClassNameForPropertyName($propertyName); - - $parameters = (array)$parameters; - - $value = array_slice($jProp, 3); - - $valueType = strtoupper($valueType); - - if (isset($parameters['group'])) { - $propertyName = $parameters['group'] . '.' . $propertyName; - unset($parameters['group']); - } - - $prop = $this->root->createProperty($propertyName, null, $parameters, $valueType); - $prop->setJsonValue($value); - - // We have to do something awkward here. FlatText as well as Text - // represents TEXT values. We have to normalize these here. In the - // future we can get rid of FlatText once we're allowed to break BC - // again. - if ($defaultPropertyClass === 'SabreForRainLoop\VObject\Property\FlatText') { - $defaultPropertyClass = 'SabreForRainLoop\VObject\Property\Text'; - } - - // If the value type we received (e.g.: TEXT) was not the default value - // type for the given property (e.g.: BDAY), we need to add a VALUE= - // parameter. - if ($defaultPropertyClass !== get_class($prop)) { - $prop["VALUE"] = $valueType; - } - - return $prop; - - } - - /** - * Sets the input data - * - * @param resource|string|array $input - * @return void - */ - public function setInput($input) { - - if (is_resource($input)) { - $input = stream_get_contents($input); - } - if (is_string($input)) { - $input = json_decode($input); - } - $this->input = $input; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/MimeDir.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/MimeDir.php deleted file mode 100644 index e95741fd19..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/MimeDir.php +++ /dev/null @@ -1,602 +0,0 @@ -root = null; - if (!is_null($input)) { - - $this->setInput($input); - - } - - if (!is_null($options)) $this->options = $options; - - $this->parseDocument(); - - return $this->root; - - } - - /** - * Sets the input buffer. Must be a string or stream. - * - * @param resource|string $input - * @return void - */ - public function setInput($input) { - - // Resetting the parser - $this->lineIndex = 0; - $this->startLine = 0; - - if (is_string($input)) { - // Convering to a stream. - $stream = fopen('php://temp', 'r+'); - fwrite($stream, $input); - rewind($stream); - $this->input = $stream; - } else { - $this->input = $input; - } - - } - - /** - * Parses an entire document. - * - * @return void - */ - protected function parseDocument() { - - $line = $this->readLine(); - switch(strtoupper($line)) { - case 'BEGIN:VCALENDAR' : - $class = isset(VCalendar::$componentMap['VCALENDAR']) - ? VCalendar::$componentMap[$name] - : 'SabreForRainLoop\\VObject\\Component\\VCalendar'; - break; - case 'BEGIN:VCARD' : - $class = isset(VCard::$componentMap['VCARD']) - ? VCard::$componentMap['VCARD'] - : 'SabreForRainLoop\\VObject\\Component\\VCard'; - break; - default : - throw new ParseException('This parser only supports VCARD and VCALENDAR files'); - } - - $this->root = new $class(array(), false); - - while(true) { - - // Reading until we hit END: - $line = $this->readLine(); - if (strtoupper(substr($line,0,4)) === 'END:') { - break; - } - $result = $this->parseLine($line); - if ($result) { - $this->root->add($result); - } - - } - - $name = strtoupper(substr($line, 4)); - if ($name!==$this->root->name) { - throw new ParseException('Invalid MimeDir file. expected: "END:' . $this->root->name . '" got: "END:' . $name . '"'); - } - - } - - /** - * Parses a line, and if it hits a component, it will also attempt to parse - * the entire component - * - * @param string $line Unfolded line - * @return Node - */ - protected function parseLine($line) { - - // Start of a new component - if (strtoupper(substr($line, 0, 6)) === 'BEGIN:') { - - $component = $this->root->createComponent(substr($line,6), array(), false); - - while(true) { - - // Reading until we hit END: - $line = $this->readLine(); - if (strtoupper(substr($line,0,4)) === 'END:') { - break; - } - $result = $this->parseLine($line); - if ($result) { - $component->add($result); - } - - } - - $name = strtoupper(substr($line, 4)); - if ($name!==$component->name) { - throw new ParseException('Invalid MimeDir file. expected: "END:' . $component->name . '" got: "END:' . $name . '"'); - } - - return $component; - - } else { - - // Property reader - $property = $this->readProperty($line); - if (!$property) { - // Ignored line - return false; - } - return $property; - - } - - } - - /** - * We need to look ahead 1 line every time to see if we need to 'unfold' - * the next line. - * - * If that was not the case, we store it here. - * - * @var null|string - */ - protected $lineBuffer; - - /** - * The real current line number. - */ - protected $lineIndex = 0; - - /** - * In the case of unfolded lines, this property holds the line number for - * the start of the line. - * - * @var int - */ - protected $startLine = 0; - - /** - * Contains a 'raw' representation of the current line. - * - * @var string - */ - protected $rawLine; - - /** - * Reads a single line from the buffer. - * - * This method strips any newlines and also takes care of unfolding. - * - * @throws \SabreForRainLoop\VObject\EofException - * @return string - */ - protected function readLine() { - - if (!is_null($this->lineBuffer)) { - $rawLine = $this->lineBuffer; - $this->lineBuffer = null; - } else { - do { - $rawLine = fgets($this->input); - if ($rawLine === false && feof($this->input)) { - throw new EofException('End of document reached prematurely'); - } - $rawLine = rtrim($rawLine, "\r\n"); - } while ($rawLine === ''); // Skipping empty lines - $this->lineIndex++; - } - $line = $rawLine; - - $this->startLine = $this->lineIndex; - - // Looking ahead for folded lines. - while (true) { - - $nextLine = rtrim(fgets($this->input), "\r\n"); - $this->lineIndex++; - if (!$nextLine) { - break; - } - if ($nextLine[0] === "\t" || $nextLine[0] === " ") { - $line .= substr($nextLine, 1); - $rawLine .= "\n " . substr($nextLine, 1); - } else { - $this->lineBuffer = $nextLine; - break; - } - - } - $this->rawLine = $rawLine; - return $line; - - } - - /** - * Reads a property or component from a line. - * - * @return void - */ - protected function readProperty($line) { - - if ($this->options & self::OPTION_FORGIVING) { - $propNameToken = 'A-Z0-9\-\._\\/'; - } else { - $propNameToken = 'A-Z0-9\-\.'; - } - - $paramNameToken = 'A-Z0-9\-'; - $safeChar = '^";:,'; - $qSafeChar = '^"'; - - $regex = "/ - ^(?P [$propNameToken]+ ) (?=[;:]) # property name - | - (?<=:)(?P .*)$ # property value - | - ;(?P [$paramNameToken]+) (?=[=;:]) # parameter name - | - (=|,)(?P # parameter value - (?: [$safeChar]*) | - \"(?: [$qSafeChar]+)\" - ) (?=[;:,]) - /xi"; - - //echo $regex, "\n"; die(); - preg_match_all($regex, $line, $matches, PREG_SET_ORDER ); - - $property = array( - 'name' => null, - 'parameters' => array(), - 'value' => null - ); - - $lastParam = null; - - /** - * Looping through all the tokens. - * - * Note that we are looping through them in reverse order, because if a - * sub-pattern matched, the subsequent named patterns will not show up - * in the result. - */ - foreach($matches as $match) { - - if (isset($match['paramValue'])) { - if ($match['paramValue'] && $match['paramValue'][0] === '"') { - $value = substr($match['paramValue'], 1, -1); - } else { - $value = $match['paramValue']; - } - - $value = $this->unescapeParam($value); - - if (is_null($property['parameters'][$lastParam])) { - $property['parameters'][$lastParam] = $value; - } elseif (is_array($property['parameters'][$lastParam])) { - $property['parameters'][$lastParam][] = $value; - } else { - $property['parameters'][$lastParam] = array( - $property['parameters'][$lastParam], - $value - ); - } - continue; - } - if (isset($match['paramName'])) { - $lastParam = strtoupper($match['paramName']); - if (!isset($property['parameters'][$lastParam])) { - $property['parameters'][$lastParam] = null; - } - continue; - } - if (isset($match['propValue'])) { - $property['value'] = $match['propValue']; - continue; - } - if (isset($match['name']) && $match['name']) { - $property['name'] = strtoupper($match['name']); - continue; - } - - // @codeCoverageIgnoreStart - throw new \LogicException('This code should not be reachable'); - // @codeCoverageIgnoreEnd - - } - - if (is_null($property['value']) || !$property['name']) { - if ($this->options & self::OPTION_IGNORE_INVALID_LINES) { - return false; - } - throw new ParseException('Invalid Mimedir file. Line starting at ' . $this->startLine . ' did not follow iCalendar/vCard conventions'); - } - - // vCard 2.1 states that parameters may appear without a name, and only - // a value. We can deduce the value based on it's name. - // - // Our parser will get those as parameters without a value instead, so - // we're filtering these parameters out first. - $namedParameters = array(); - $namelessParameters = array(); - - foreach($property['parameters'] as $name=>$value) { - if (!is_null($value)) { - $namedParameters[$name] = $value; - } else { - $namelessParameters[] = $name; - } - } - - $propObj = $this->root->createProperty($property['name'], null, $namedParameters); - - foreach($namelessParameters as $namelessParameter) { - $propObj->add(null, $namelessParameter); - } - - if (strtoupper($propObj['ENCODING']) === 'QUOTED-PRINTABLE') { - $propObj->setQuotedPrintableValue($this->extractQuotedPrintableValue()); - } else { - $propObj->setRawMimeDirValue($property['value']); - } - - return $propObj; - - } - - /** - * Unescapes a property value. - * - * vCard 2.1 says: - * * Semi-colons must be escaped in some property values, specifically - * ADR, ORG and N. - * * Semi-colons must be escaped in parameter values, because semi-colons - * are also use to separate values. - * * No mention of escaping backslashes with another backslash. - * * newlines are not escaped either, instead QUOTED-PRINTABLE is used to - * span values over more than 1 line. - * - * vCard 3.0 says: - * * (rfc2425) Backslashes, newlines (\n or \N) and comma's must be - * escaped, all time time. - * * Comma's are used for delimeters in multiple values - * * (rfc2426) Adds to to this that the semi-colon MUST also be escaped, - * as in some properties semi-colon is used for separators. - * * Properties using semi-colons: N, ADR, GEO, ORG - * * Both ADR and N's individual parts may be broken up further with a - * comma. - * * Properties using commas: NICKNAME, CATEGORIES - * - * vCard 4.0 (rfc6350) says: - * * Commas must be escaped. - * * Semi-colons may be escaped, an unescaped semi-colon _may_ be a - * delimiter, depending on the property. - * * Backslashes must be escaped - * * Newlines must be escaped as either \N or \n. - * * Some compound properties may contain multiple parts themselves, so a - * comma within a semi-colon delimited property may also be unescaped - * to denote multiple parts _within_ the compound property. - * * Text-properties using semi-colons: N, ADR, ORG, CLIENTPIDMAP. - * * Text-properties using commas: NICKNAME, RELATED, CATEGORIES, PID. - * - * Even though the spec says that commas must always be escaped, the - * example for GEO in Section 6.5.2 seems to violate this. - * - * iCalendar 2.0 (rfc5545) says: - * * Commas or semi-colons may be used as delimiters, depending on the - * property. - * * Commas, semi-colons, backslashes, newline (\N or \n) are always - * escaped, unless they are delimiters. - * * Colons shall not be escaped. - * * Commas can be considered the 'default delimiter' and is described as - * the delimiter in cases where the order of the multiple values is - * insignificant. - * * Semi-colons are described as the delimiter for 'structured values'. - * They are specifically used in Semi-colons are used as a delimiter in - * REQUEST-STATUS, RRULE, GEO and EXRULE. EXRULE is deprecated however. - * - * Now for the parameters - * - * If delimiter is not set (null) this method will just return a string. - * If it's a comma or a semi-colon the string will be split on those - * characters, and always return an array. - * - * @param string $input - * @param string $delimiter - * @return string|string[] - */ - static public function unescapeValue($input, $delimiter = ';') { - - $regex = '# (?: (\\\\ (?: \\\\ | N | n | ; | , ) )'; - if ($delimiter) { - $regex .= ' | (' . $delimiter . ')'; - } - $regex .= ') #x'; - - $matches = preg_split($regex, $input, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); - - $resultArray = array(); - $result = ''; - - foreach($matches as $match) { - - switch ($match) { - case '\\\\' : - $result .='\\'; - break; - case '\N' : - case '\n' : - $result .="\n"; - break; - case '\;' : - $result .=';'; - break; - case '\,' : - $result .=','; - break; - case $delimiter : - $resultArray[] = $result; - $result = ''; - break; - default : - $result .= $match; - break; - - } - - } - - $resultArray[] = $result; - return $delimiter ? $resultArray : $result; - - } - - /** - * Unescapes a parameter value. - * - * vCard 2.1: - * * Does not mention a mechanism for this. In addition, double quotes - * are never used to wrap values. - * * This means that parameters can simply not contain colons or - * semi-colons. - * - * vCard 3.0 (rfc2425, rfc2426): - * * Parameters _may_ be surrounded by double quotes. - * * If this is not the case, semi-colon, colon and comma may simply not - * occur (the comma used for multiple parameter values though). - * * If it is surrounded by double-quotes, it may simply not contain - * double-quotes. - * * This means that a parameter can in no case encode double-quotes, or - * newlines. - * - * vCard 4.0 (rfc6350) - * * Behavior seems to be identical to vCard 3.0 - * - * iCalendar 2.0 (rfc5545) - * * Behavior seems to be identical to vCard 3.0 - * - * Parameter escaping mechanism (rfc6868) : - * * This rfc describes a new way to escape parameter values. - * * New-line is encoded as ^n - * * ^ is encoded as ^^. - * * " is encoded as ^' - * - * @param string $input - * @return void - */ - private function unescapeParam($input) { - - return - preg_replace_callback('#(\^(\^|n|\'))#',function($matches) { - switch($matches[2]) { - case 'n' : - return "\n"; - case '^' : - return '^'; - case '\'' : - return '"'; - - // @codeCoverageIgnoreStart - } - // @codeCoverageIgnoreEnd - }, $input); - - } - - /** - * Gets the full quoted printable value. - * - * We need a special method for this, because newlines have both a meaning - * in vCards, and in QuotedPrintable. - * - * This method does not do any decoding. - * - * @return string - */ - private function extractQuotedPrintableValue() { - - // We need to parse the raw line again to get the start of the value. - // - // We are basically looking for the first colon (:), but we need to - // skip over the parameters first, as they may contain one. - $regex = '/^ - (?: [^:])+ # Anything but a colon - (?: "[^"]")* # A parameter in double quotes - : # start of the value we really care about - (.*)$ - /xs'; - - preg_match($regex, $this->rawLine, $matches); - - $value = $matches[1]; - // Removing the first whitespace character from every line. Kind of - // like unfolding, but we keep the newline. - $value = str_replace("\n ", "\n", $value); - - // Microsoft products don't always correctly fold lines, they may be - // missing a whitespace. So if 'forgiving' is turned on, we will take - // those as well. - if ($this->options & self::OPTION_FORGIVING) { - while(substr($value,-1) === '=') { - // Reading the line - $this->readLine(); - // Grabbing the raw form - $value.="\n" . $this->rawLine; - } - } - - return $value; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/Parser.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/Parser.php deleted file mode 100644 index 22c90a1fed..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Parser/Parser.php +++ /dev/null @@ -1,77 +0,0 @@ -setInput($input); - } - $this->options = $options; - } - - /** - * This method starts the parsing process. - * - * If the input was not supplied during construction, it's possible to pass - * it here instead. - * - * If either input or options are not supplied, the defaults will be used. - * - * @param mixed $input - * @param int|null $options - * @return array - */ - abstract public function parse($input = null, $options = null); - - /** - * Sets the input data - * - * @param mixed $input - * @return void - */ - abstract public function setInput($input); - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property.php deleted file mode 100644 index 0dde8d0d32..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property.php +++ /dev/null @@ -1,502 +0,0 @@ -value syntax. - * - * @param Component $root The root document - * @param string $name - * @param string|array|null $value - * @param array $parameters List of parameters - * @param string $group The vcard property group - * @return void - */ - public function __construct(Component $root, $name, $value = null, array $parameters = array(), $group = null) { - - $this->name = $name; - $this->group = $group; - - $this->root = $root; - - if (!is_null($value)) { - $this->setValue($value); - } - - foreach($parameters as $k=>$v) { - $this->add($k, $v); - } - - } - - /** - * Updates the current value. - * - * This may be either a single, or multiple strings in an array. - * - * @param string|array $value - * @return void - */ - public function setValue($value) { - - $this->value = $value; - - } - - /** - * Returns the current value. - * - * This method will always return a singular value. If this was a - * multi-value object, some decision will be made first on how to represent - * it as a string. - * - * To get the correct multi-value version, use getParts. - * - * @return string - */ - public function getValue() { - - if (is_array($this->value)) { - if (count($this->value)==0) { - return null; - } elseif (count($this->value)===1) { - return $this->value[0]; - } else { - return $this->getRawMimeDirValue($this->value); - } - } else { - return $this->value; - } - - } - - /** - * Sets a multi-valued property. - * - * @param array $parts - * @return void - */ - public function setParts(array $parts) { - - $this->value = $parts; - - } - - /** - * Returns a multi-valued property. - * - * This method always returns an array, if there was only a single value, - * it will still be wrapped in an array. - * - * @return array - */ - public function getParts() { - - if (is_null($this->value)) { - return array(); - } elseif (is_array($this->value)) { - return $this->value; - } else { - return array($this->value); - } - - } - - /** - * Adds a new parameter, and returns the new item. - * - * If a parameter with same name already existed, the values will be - * combined. - * If nameless parameter is added, we try to guess it's name. - * - * @param string $name - * @param string|null|array $value - * @return Node - */ - public function add($name, $value = null) { - $noName = false; - if ($name === null) { - $name = Parameter::guessParameterNameByValue($value); - $noName = true; - } - - if (isset($this->parameters[strtoupper($name)])) { - $this->parameters[strtoupper($name)]->addValue($value); - } - else { - $param = new Parameter($this->root, $name, $value); - $param->noName = $noName; - $this->parameters[$param->name] = $param; - } - } - - /** - * Returns an iterable list of children - * - * @return array - */ - public function parameters() { - - return $this->parameters; - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - abstract public function getValueType(); - - /** - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. - * - * This has been 'unfolded', so only 1 line will be passed. Unescaping is - * not yet done, but parameters are not included. - * - * @param string $val - * @return void - */ - abstract public function setRawMimeDirValue($val); - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - abstract public function getRawMimeDirValue(); - - /** - * Turns the object back into a serialized blob. - * - * @return string - */ - public function serialize() { - - $str = $this->name; - if ($this->group) $str = $this->group . '.' . $this->name; - - foreach($this->parameters as $param) { - - $str.=';' . $param->serialize(); - - } - - $str.=':' . $this->getRawMimeDirValue(); - - $out = ''; - while(strlen($str)>0) { - if (strlen($str)>75) { - $out.= mb_strcut($str,0,75,'utf-8') . "\r\n"; - $str = ' ' . mb_strcut($str,75,strlen($str),'utf-8'); - } else { - $out.=$str . "\r\n"; - $str=''; - break; - } - } - - return $out; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - return $this->getParts(); - - } - - /** - * Sets the json value, as it would appear in a jCard or jCal object. - * - * The value must always be an array. - * - * @param array $value - * @return void - */ - public function setJsonValue(array $value) { - - if (count($value)===1) { - $this->setValue(reset($value)); - } else { - $this->setValue($value); - } - - } - - /** - * This method returns an array, with the representation as it should be - * encoded in json. This is used to create jCard or jCal documents. - * - * @return array - */ - public function jsonSerialize() { - - $parameters = array(); - - foreach($this->parameters as $parameter) { - if ($parameter->name === 'VALUE') { - continue; - } - $parameters[strtolower($parameter->name)] = $parameter->jsonSerialize(); - } - // In jCard, we need to encode the property-group as a separate 'group' - // parameter. - if ($this->group) { - $parameters['group'] = $this->group; - } - - return array_merge( - array( - strtolower($this->name), - (object)$parameters, - strtolower($this->getValueType()), - ), - $this->getJsonValue() - ); - } - - - /** - * Called when this object is being cast to a string. - * - * If the property only had a single value, you will get just that. In the - * case the property had multiple values, the contents will be escaped and - * combined with ,. - * - * @return string - */ - public function __toString() { - - return (string)$this->getValue(); - - } - - /* ArrayAccess interface {{{ */ - - /** - * Checks if an array element exists - * - * @param mixed $name - * @return bool - */ - public function offsetExists($name) { - - if (is_int($name)) return parent::offsetExists($name); - - $name = strtoupper($name); - - foreach($this->parameters as $parameter) { - if ($parameter->name == $name) return true; - } - return false; - - } - - /** - * Returns a parameter. - * - * If the parameter does not exist, null is returned. - * - * @param string $name - * @return Node - */ - public function offsetGet($name) { - - if (is_int($name)) return parent::offsetGet($name); - $name = strtoupper($name); - - if (!isset($this->parameters[$name])) { - return null; - } - - return $this->parameters[$name]; - - } - - /** - * Creates a new parameter - * - * @param string $name - * @param mixed $value - * @return void - */ - public function offsetSet($name, $value) { - - if (is_int($name)) { - parent::offsetSet($name, $value); - // @codeCoverageIgnoreStart - // This will never be reached, because an exception is always - // thrown. - return; - // @codeCoverageIgnoreEnd - } - - $param = new Parameter($this->root, $name, $value); - $this->parameters[$param->name] = $param; - - } - - /** - * Removes one or more parameters with the specified name - * - * @param string $name - * @return void - */ - public function offsetUnset($name) { - - if (is_int($name)) { - parent::offsetUnset($name); - // @codeCoverageIgnoreStart - // This will never be reached, because an exception is always - // thrown. - return; - // @codeCoverageIgnoreEnd - } - - unset($this->parameters[strtoupper($name)]); - - } - /* }}} */ - - /** - * This method is automatically called when the object is cloned. - * Specifically, this will ensure all child elements are also cloned. - * - * @return void - */ - public function __clone() { - - foreach($this->parameters as $key=>$child) { - $this->parameters[$key] = clone $child; - $this->parameters[$key]->parent = $this; - } - - } - - /** - * Validates the node for correctness. - * - * The following options are supported: - * - Node::REPAIR - If something is broken, and automatic repair may - * be attempted. - * - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @param int $options - * @return array - */ - public function validate($options = 0) { - - $warnings = array(); - - // Checking if our value is UTF-8 - if (!StringUtil::isUTF8($this->getRawMimeDirValue())) { - $warnings[] = array( - 'level' => 1, - 'message' => 'Property is not valid UTF-8!', - 'node' => $this, - ); - if ($options & self::REPAIR) { - $this->setRawMimeDirValue(StringUtil::convertToUTF8($this->getRawMimeDirValue())); - } - } - - // Checking if the propertyname does not contain any invalid bytes. - if (!preg_match('/^([A-Z0-9-]+)$/', $this->name)) { - $warnings[] = array( - 'level' => 1, - 'message' => 'The propertyname: ' . $this->name . ' contains invalid characters. Only A-Z, 0-9 and - are allowed', - 'node' => $this, - ); - if ($options & self::REPAIR) { - // Uppercasing and converting underscores to dashes. - $this->name = strtoupper( - str_replace('_', '-', $this->name) - ); - // Removing every other invalid character - $this->name = preg_replace('/([^A-Z0-9-])/u', '', $this->name); - - } - - } - - // Validating inner parameters - foreach($this->parameters as $param) { - $warnings = array_merge($warnings, $param->validate($options)); - } - - return $warnings; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Binary.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Binary.php deleted file mode 100644 index 2e857c3df9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Binary.php +++ /dev/null @@ -1,127 +0,0 @@ -value = $value[0]; - } else { - throw new \InvalidArgumentException('The argument must either be a string or an array with only one child'); - } - - } else { - - $this->value = $value; - - } - - } - - /** - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. - * - * This has been 'unfolded', so only 1 line will be passed. Unescaping is - * not yet done, but parameters are not included. - * - * @param string $val - * @return void - */ - public function setRawMimeDirValue($val) { - - $this->value = base64_decode($val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return base64_encode($this->value); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return 'BINARY'; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - return array(base64_encode($this->getValue())); - - } - - /** - * Sets the json value, as it would appear in a jCard or jCal object. - * - * The value must always be an array. - * - * @param array $value - * @return void - */ - public function setJsonValue(array $value) { - - $value = array_map('base64_decode', $value); - parent::setJsonValue($value); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Boolean.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Boolean.php deleted file mode 100644 index 75ea0d6914..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Boolean.php +++ /dev/null @@ -1,63 +0,0 @@ -setValue($val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return $this->value?'TRUE':'FALSE'; - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return 'BOOLEAN'; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/FlatText.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/FlatText.php deleted file mode 100644 index 57f30cda60..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/FlatText.php +++ /dev/null @@ -1,49 +0,0 @@ -setValue($val); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Float.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Float.php deleted file mode 100644 index 02476f8dd1..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Float.php +++ /dev/null @@ -1,101 +0,0 @@ -delimiter, $val); - foreach($val as &$item) { - $item = (float)$item; - } - $this->setParts($val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return implode( - $this->delimiter, - $this->getParts() - ); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "FLOAT"; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - $val = array_map(function($item) { - - return (float)$item; - - }, $this->getParts()); - - // Special-casing the GEO property. - // - // See: - // http://tools.ietf.org/html/draft-ietf-jcardcal-jcal-04#section-3.4.1.2 - if ($this->name==='GEO') { - return array($val); - } else { - return $val; - } - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/CalAddress.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/CalAddress.php deleted file mode 100644 index e76a302adb..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/CalAddress.php +++ /dev/null @@ -1,41 +0,0 @@ -setDateTimes($parts); - } else { - parent::setParts($parts); - } - - } - - /** - * Updates the current value. - * - * This may be either a single, or multiple strings in an array. - * - * Instead of strings, you may also use DateTime here. - * - * @param string|array|\DateTime $value - * @return void - */ - public function setValue($value) { - - if (is_array($value) && isset($value[0]) && $value[0] instanceof \DateTime) { - $this->setDateTimes($value); - } elseif ($value instanceof \DateTime) { - $this->setDateTimes(array($value)); - } else { - parent::setValue($value); - } - - } - - /** - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. - * - * This has been 'unfolded', so only 1 line will be passed. Unescaping is - * not yet done, but parameters are not included. - * - * @param string $val - * @return void - */ - public function setRawMimeDirValue($val) { - - $this->setValue(explode($this->delimiter, $val)); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return implode($this->delimiter, $this->getParts()); - - } - - /** - * Returns true if this is a DATE-TIME value, false if it's a DATE. - * - * @return bool - */ - public function hasTime() { - - return strtoupper((string)$this['VALUE']) !== 'DATE'; - - } - - /** - * Returns a date-time value. - * - * Note that if this property contained more than 1 date-time, only the - * first will be returned. To get an array with multiple values, call - * getDateTimes. - * - * @return \DateTime - */ - public function getDateTime() { - - $dt = $this->getDateTimes(); - if (!$dt) return null; - - return $dt[0]; - - } - - /** - * Returns multiple date-time values. - * - * @return \DateTime[] - */ - public function getDateTimes() { - - // Finding the timezone. - $tz = $this['TZID']; - - if ($tz) { - $tz = TimeZoneUtil::getTimeZone((string)$tz, $this->root); - } - - $dts = array(); - foreach($this->getParts() as $part) { - $dts[] = DateTimeParser::parse($part, $tz); - } - return $dts; - - } - - /** - * Sets the property as a DateTime object. - * - * @param \DateTime $dt - * @param bool isFloating If set to true, timezones will be ignored. - * @return void - */ - public function setDateTime(\DateTime $dt, $isFloating = false) { - - $this->setDateTimes(array($dt), $isFloating); - - } - - /** - * Sets the property as multiple date-time objects. - * - * The first value will be used as a reference for the timezones, and all - * the otehr values will be adjusted for that timezone - * - * @param \DateTime[] $dt - * @param bool isFloating If set to true, timezones will be ignored. - * @return void - */ - public function setDateTimes(array $dt, $isFloating = false) { - - $values = array(); - - if($this->hasTime()) { - - $tz = null; - $isUtc = false; - - foreach($dt as $d) { - - if ($isFloating) { - $values[] = $d->format('Ymd\\THis'); - continue; - } - if (is_null($tz)) { - $tz = $d->getTimeZone(); - $isUtc = in_array($tz->getName() , array('UTC', 'GMT', 'Z')); - if (!$isUtc) { - $this->offsetSet('TZID', $tz->getName()); - } - } else { - $d->setTimeZone($tz); - } - - if ($isUtc) { - $values[] = $d->format('Ymd\\THis\\Z'); - } else { - $values[] = $d->format('Ymd\\THis'); - } - - } - if ($isUtc || $isFloating) { - $this->offsetUnset('TZID'); - } - - } else { - - foreach($dt as $d) { - - $values[] = $d->format('Ymd'); - - } - $this->offsetUnset('TZID'); - - } - - $this->value = $values; - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return $this->hasTime()?'DATE-TIME':'DATE'; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - $dts = $this->getDateTimes(); - $hasTime = $this->hasTime(); - - $tz = $dts[0]->getTimeZone(); - $isUtc = in_array($tz->getName() , array('UTC', 'GMT', 'Z')); - - return array_map(function($dt) use ($hasTime, $isUtc) { - - if ($hasTime) { - return $dt->format('Y-m-d\\TH:i:s') . ($isUtc?'Z':''); - } else { - return $dt->format('Y-m-d'); - } - - }, $dts); - - } - - /** - * Sets the json value, as it would appear in a jCard or jCal object. - * - * The value must always be an array. - * - * @param array $value - * @return void - */ - public function setJsonValue(array $value) { - - // dates and times in jCal have one difference to dates and times in - // iCalendar. In jCal date-parts are separated by dashes, and - // time-parts are separated by colons. It makes sense to just remove - // those. - $this->setValue(array_map(function($item) { - - return strtr($item, array(':'=>'', '-'=>'')); - - }, $value)); - - } - /** - * We need to intercept offsetSet, because it may be used to alter the - * VALUE from DATE-TIME to DATE or vice-versa. - * - * @param string $name - * @param mixed $value - * @return void - */ - public function offsetSet($name, $value) { - - parent::offsetSet($name, $value); - if (strtoupper($name)!=='VALUE') { - return; - } - - // This will ensure that dates are correctly encoded. - $this->setDateTimes($this->getDateTimes()); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Duration.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Duration.php deleted file mode 100644 index 0f251102d8..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Duration.php +++ /dev/null @@ -1,86 +0,0 @@ -setValue(explode($this->delimiter, $val)); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return implode($this->delimiter, $this->getParts()); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return 'DURATION'; - - } - - /** - * Returns a DateInterval representation of the Duration property. - * - * If the property has more than one value, only the first is returned. - * - * @return \DateInterval - */ - public function getDateInterval() { - - $parts = $this->getParts(); - $value = $parts[0]; - return DateTimeParser::parseDuration($value); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Period.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Period.php deleted file mode 100644 index 67c818c7a0..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Period.php +++ /dev/null @@ -1,126 +0,0 @@ -setValue(explode($this->delimiter, $val)); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return implode($this->delimiter, $this->getParts()); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "PERIOD"; - - } - - /** - * Sets the json value, as it would appear in a jCard or jCal object. - * - * The value must always be an array. - * - * @param array $value - * @return void - */ - public function setJsonValue(array $value) { - - $value = array_map(function($item) { - - return strtr(implode('/', $item), array(':' => '', '-' => '')); - - }, $value); - parent::setJsonValue($value); - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - $return = array(); - foreach($this->getParts() as $item) { - - list($start, $end) = explode('/', $item, 2); - - $start = DateTimeParser::parseDateTime($start); - - // This is a duration value. - if ($end[0]==='P') { - $return[] = array( - $start->format('Y-m-d\\TH:i:s'), - $end - ); - } else { - $end = DateTimeParser::parseDateTime($end); - $return[] = array( - $start->format('Y-m-d\\TH:i:s'), - $end->format('Y-m-d\\TH:i:s'), - ); - } - - } - - return $return; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Recur.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Recur.php deleted file mode 100644 index 98e3f19d18..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/ICalendar/Recur.php +++ /dev/null @@ -1,189 +0,0 @@ -value array that is accessible using - * getParts, and may be set using setParts. - * - * @copyright Copyright (C) 2007-2013 fruux GmbH. All rights reserved. - * @author Evert Pot (http://evertpot.com/) - * @license http://code.google.com/p/sabredav/wiki/License Modified BSD License - */ -class Recur extends Property { - - /** - * Updates the current value. - * - * This may be either a single, or multiple strings in an array. - * - * @param string|array $value - * @return void - */ - public function setValue($value) { - - // If we're getting the data from json, we'll be receiving an object - if ($value instanceof \StdClass) { - $value = (array)$value; - } - - if (is_array($value)) { - $newVal = array(); - foreach($value as $k=>$v) { - - if (is_string($v)) { - $v = strtoupper($v); - - // The value had multiple sub-values - if (strpos($v,',')!==false) { - $v = explode(',', $v); - } - } else { - $v = array_map('strtoupper', $v); - } - - $newVal[strtoupper($k)] = $v; - } - $this->value = $newVal; - } elseif (is_string($value)) { - $value = strtoupper($value); - $newValue = array(); - foreach(explode(';', $value) as $part) { - - // Skipping empty parts. - if (empty($part)) { - continue; - } - list($partName, $partValue) = explode('=', $part); - - // The value itself had multiple values.. - if (strpos($partValue,',')!==false) { - $partValue=explode(',', $partValue); - } - $newValue[$partName] = $partValue; - - } - $this->value = $newValue; - } else { - throw new \InvalidArgumentException('You must either pass a string, or a key=>value array'); - } - - } - - /** - * Returns the current value. - * - * This method will always return a singular value. If this was a - * multi-value object, some decision will be made first on how to represent - * it as a string. - * - * To get the correct multi-value version, use getParts. - * - * @return string - */ - public function getValue() { - - $out = array(); - foreach($this->value as $key=>$value) { - $out[] = $key . '=' . (is_array($value)?implode(',', $value):$value); - } - return strtoupper(implode(';',$out)); - - } - - /** - * Sets a multi-valued property. - * - * @param array $parts - * @return void - */ - public function setParts(array $parts) { - - $this->setValue($parts); - - } - - /** - * Returns a multi-valued property. - * - * This method always returns an array, if there was only a single value, - * it will still be wrapped in an array. - * - * @return array - */ - public function getParts() { - - return $this->value; - - } - - /** - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. - * - * This has been 'unfolded', so only 1 line will be passed. Unescaping is - * not yet done, but parameters are not included. - * - * @param string $val - * @return void - */ - public function setRawMimeDirValue($val) { - - $this->setValue($val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return $this->getValue(); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "RECUR"; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - $values = array(); - foreach($this->getParts() as $k=>$v) { - $values[strtolower($k)] = $v; - } - return array($values); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Integer.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Integer.php deleted file mode 100644 index a48c87402a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Integer.php +++ /dev/null @@ -1,72 +0,0 @@ -setValue((int)$val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return $this->value; - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "INTEGER"; - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - return array((int)$this->getValue()); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Text.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Text.php deleted file mode 100644 index b1651e3ae5..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Text.php +++ /dev/null @@ -1,330 +0,0 @@ - 5, - 'ADR' => 7, - ); - - /** - * Creates the property. - * - * You can specify the parameters either in key=>value syntax, in which case - * parameters will automatically be created, or you can just pass a list of - * Parameter objects. - * - * @param Component $root The root document - * @param string $name - * @param string|array|null $value - * @param array $parameters List of parameters - * @param string $group The vcard property group - * @return void - */ - public function __construct(Component $root, $name, $value = null, array $parameters = array(), $group = null) { - - // There's two types of multi-valued text properties: - // 1. multivalue properties. - // 2. structured value properties - // - // The former is always separated by a comma, the latter by semi-colon. - if (in_array($name, $this->structuredValues)) { - $this->delimiter = ';'; - } - - parent::__construct($root, $name, $value, $parameters, $group); - - } - - - /** - * Sets a raw value coming from a mimedir (iCalendar/vCard) file. - * - * This has been 'unfolded', so only 1 line will be passed. Unescaping is - * not yet done, but parameters are not included. - * - * @param string $val - * @return void - */ - public function setRawMimeDirValue($val) { - - $this->setValue(MimeDir::unescapeValue($val, $this->delimiter)); - - } - - /** - * Sets the value as a quoted-printable encoded string. - * - * @param string $val - * @return void - */ - public function setQuotedPrintableValue($val) { - - $val = quoted_printable_decode($val); - - // Quoted printable only appears in vCard 2.1, and the only character - // that may be escaped there is ;. So we are simply splitting on just - // that. - // - // We also don't have to unescape \\, so all we need to look for is a ; - // that's not preceeded with a \. - $regex = '# (?setValue($matches); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - $val = $this->getParts(); - - if (isset($this->minimumPropertyValues[$this->name])) { - $val = array_pad($val, $this->minimumPropertyValues[$this->name], ''); - } - - foreach($val as &$item) { - - if (!is_array($item)) { - $item = array($item); - } - - foreach($item as &$subItem) { - $subItem = strtr($subItem, array( - '\\' => '\\\\', - ';' => '\;', - ',' => '\,', - "\n" => '\n', - "\r" => "", - )); - } - $item = implode(',', $item); - - } - - return implode($this->delimiter, $val); - - } - - /** - * Returns the value, in the format it should be encoded for json. - * - * This method must always return an array. - * - * @return array - */ - public function getJsonValue() { - - // Structured text values should always be returned as a single - // array-item. Multi-value text should be returned as multiple items in - // the top-array. - if (in_array($this->name, $this->structuredValues)) { - return array($this->getParts()); - } else { - return $this->getParts(); - } - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "TEXT"; - - } - - /** - * Turns the object back into a serialized blob. - * - * @return string - */ - public function serialize() { - - // We need to kick in a special type of encoding, if it's a 2.1 vcard. - if ($this->root->getDocumentType() !== Document::VCARD21) { - return parent::serialize(); - } - - $val = $this->getParts(); - - if (isset($this->minimumPropertyValues[$this->name])) { - $val = array_pad($val, $this->minimumPropertyValues[$this->name], ''); - } - - // Imploding multiple parts into a single value, and splitting the - // values with ;. - if (count($val)>1) { - foreach($val as $k=>$v) { - $val[$k] = str_replace(';','\;', $v); - } - $val = implode(';', $val); - } else { - $val = $val[0]; - } - - $str = $this->name; - if ($this->group) $str = $this->group . '.' . $this->name; - foreach($this->parameters as $param) { - - if ($param->getValue() === 'QUOTED-PRINTABLE') { - continue; - } - $str.=';' . $param->serialize(); - - } - - - - // If the resulting value contains a \n, we must encode it as - // quoted-printable. - if (strpos($val,"\n") !== false) { - - $str.=';ENCODING=QUOTED-PRINTABLE:'; - $lastLine=$str; - $out = null; - - // The PHP built-in quoted-printable-encode does not correctly - // encode newlines for us. Specifically, the \r\n sequence must in - // vcards be encoded as =0D=OA and we must insert soft-newlines - // every 75 bytes. - for($ii=0;$ii= 32 && $ord <=126) { - $lastLine.=$val[$ii]; - } else { - $lastLine.='=' . strtoupper(bin2hex($val[$ii])); - } - if (strlen($lastLine)>=75) { - // Soft line break - $out.=$lastLine. "=\r\n "; - $lastLine = null; - } - - } - if (!is_null($lastLine)) $out.= $lastLine . "\r\n"; - return $out; - - } else { - $str.=':' . $val; - $out = ''; - while(strlen($str)>0) { - if (strlen($str)>75) { - $out.= mb_strcut($str,0,75,'utf-8') . "\r\n"; - $str = ' ' . mb_strcut($str,75,strlen($str),'utf-8'); - } else { - $out.=$str . "\r\n"; - $str=''; - break; - } - } - - return $out; - - - } - - } - - /** - * Validates the node for correctness. - * - * The following options are supported: - * - Node::REPAIR - If something is broken, and automatic repair may - * be attempted. - * - * An array is returned with warnings. - * - * Every item in the array has the following properties: - * * level - (number between 1 and 3 with severity information) - * * message - (human readable message) - * * node - (reference to the offending node) - * - * @param int $options - * @return array - */ - public function validate($options = 0) { - - $warnings = parent::validate($options); - - if (isset($this->minimumPropertyValues[$this->name])) { - - $minimum = $this->minimumPropertyValues[$this->name]; - $parts = $this->getParts(); - if (count($parts) < $minimum) { - $warnings[] = array( - 'level' => 1, - 'message' => 'This property must have at least ' . $minimum . ' components. It only has ' . count($parts), - 'node' => $this, - ); - if ($options & self::REPAIR) { - $parts = array_pad($parts, $minimum, ''); - $this->setParts($parts); - } - } - - } - return $warnings; - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Time.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Time.php deleted file mode 100644 index 394e37f6e6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Time.php +++ /dev/null @@ -1,94 +0,0 @@ -getValue()); - - $timeStr = ''; - - // Hour - if (!is_null($parts['hour'])) { - $timeStr.=$parts['hour']; - - if (!is_null($parts['minute'])) { - $timeStr.=':'; - } - } else { - // We know either minute or second _must_ be set, so we insert a - // dash for an empty value. - $timeStr.='-'; - } - - // Minute - if (!is_null($parts['minute'])) { - $timeStr.=$parts['minute']; - - if (!is_null($parts['second'])) { - $timeStr.=':'; - } - } else { - if (isset($parts['second'])) { - // Dash for empty minute - $timeStr.='-'; - } - } - - // Second - if (!is_null($parts['second'])) { - $timeStr.=$parts['second']; - } - - // Timezone - if (!is_null($parts['timezone'])) { - $timeStr.=$parts['timezone']; - } - - return array($timeStr); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Unknown.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Unknown.php deleted file mode 100644 index c2a495153a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Unknown.php +++ /dev/null @@ -1,50 +0,0 @@ -getRawMimeDirValue()); - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "UNKNOWN"; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Uri.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Uri.php deleted file mode 100644 index b61078086a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/Uri.php +++ /dev/null @@ -1,70 +0,0 @@ -value = $val; - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - if (is_array($this->value)) { - return $this->value[0]; - } else { - return $this->value; - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/UtcOffset.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/UtcOffset.php deleted file mode 100644 index f2d0d17005..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/UtcOffset.php +++ /dev/null @@ -1,37 +0,0 @@ -getValue()); - - $dateStr = ''; - - // Year - if (!is_null($parts['year'])) { - $dateStr.=$parts['year']; - - if (!is_null($parts['month'])) { - // If a year and a month is set, we need to insert a separator - // dash. - $dateStr.='-'; - } - - } else { - - if (!is_null($parts['month']) || !is_null($parts['date'])) { - // Inserting two dashes - $dateStr.='--'; - } - - } - - // Month - - if (!is_null($parts['month'])) { - $dateStr.=$parts['month']; - - if (isset($parts['date'])) { - // If month and date are set, we need the separator dash. - $dateStr.='-'; - } - } else { - if (isset($parts['date'])) { - // If the month is empty, and a date is set, we need a 'empty - // dash' - $dateStr.='-'; - } - } - - // Date - if (!is_null($parts['date'])) { - $dateStr.=$parts['date']; - } - - - // Early exit if we don't have a time string. - if (is_null($parts['hour']) && is_null($parts['minute']) && is_null($parts['second'])) { - return array($dateStr); - } - - $dateStr.='T'; - - // Hour - if (!is_null($parts['hour'])) { - $dateStr.=$parts['hour']; - - if (!is_null($parts['minute'])) { - $dateStr.=':'; - } - } else { - // We know either minute or second _must_ be set, so we insert a - // dash for an empty value. - $dateStr.='-'; - } - - // Minute - if (!is_null($parts['minute'])) { - $dateStr.=$parts['minute']; - - if (!is_null($parts['second'])) { - $dateStr.=':'; - } - } else { - if (isset($parts['second'])) { - // Dash for empty minute - $dateStr.='-'; - } - } - - // Second - if (!is_null($parts['second'])) { - $dateStr.=$parts['second']; - } - - // Timezone - if (!is_null($parts['timezone'])) { - $dateStr.=$parts['timezone']; - } - - return array($dateStr); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/DateTime.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/DateTime.php deleted file mode 100644 index ae8ffd3f21..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/DateTime.php +++ /dev/null @@ -1,33 +0,0 @@ -setValue($val); - - } - - /** - * Returns a raw mime-dir representation of the value. - * - * @return string - */ - public function getRawMimeDirValue() { - - return $this->value; - - } - - /** - * Returns the type of value. - * - * This corresponds to the VALUE= parameter. Every property also has a - * 'default' valueType. - * - * @return string - */ - public function getValueType() { - - return "LANGUAGE-TAG"; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/TimeStamp.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/TimeStamp.php deleted file mode 100644 index 00522dc3d9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Property/VCard/TimeStamp.php +++ /dev/null @@ -1,69 +0,0 @@ -getValue()); - - $dateStr = - $parts['year'] . '-' . - $parts['month'] . '-' . - $parts['date'] . 'T' . - $parts['hour'] . ':' . - $parts['minute'] . ':' . - $parts['second']; - - // Timezone - if (!is_null($parts['timezone'])) { - $dateStr.=$parts['timezone']; - } - - return array($dateStr); - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Reader.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Reader.php deleted file mode 100644 index 89432f1f79..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Reader.php +++ /dev/null @@ -1,73 +0,0 @@ -parse($data, $options); - - return $result; - - } - - /** - * Parses a jCard or jCal object, and returns the top component. - * - * The options argument is a bitfield. Pass any of the OPTIONS constant to - * alter the parsers' behaviour. - * - * You can either a string, a readable stream, or an array for it's input. - * Specifying the array is useful if json_decode was already called on the - * input. - * - * @param string|resource|array $data - * @param int $options - * @return Node - */ - static function readJson($data, $options = 0) { - - $parser = new Parser\Json(); - $result = $parser->parse($data, $options); - - return $result; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/RecurrenceIterator.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/RecurrenceIterator.php deleted file mode 100644 index 5d6d8e2b70..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/RecurrenceIterator.php +++ /dev/null @@ -1,1153 +0,0 @@ - 0, - 'MO' => 1, - 'TU' => 2, - 'WE' => 3, - 'TH' => 4, - 'FR' => 5, - 'SA' => 6, - ); - - /** - * Mappings between the day number and english day name. - * - * @var array - */ - private $dayNames = array( - 0 => 'Sunday', - 1 => 'Monday', - 2 => 'Tuesday', - 3 => 'Wednesday', - 4 => 'Thursday', - 5 => 'Friday', - 6 => 'Saturday', - ); - - /** - * If the current iteration of the event is an overriden event, this - * property will hold the VObject - * - * @var Component - */ - private $currentOverriddenEvent; - - /** - * This property may contain the date of the next not-overridden event. - * This date is calculated sometimes a bit early, before overridden events - * are evaluated. - * - * @var DateTime - */ - private $nextDate; - - /** - * This counts the number of overridden events we've handled so far - * - * @var int - */ - private $handledOverridden = 0; - - /** - * Creates the iterator - * - * You should pass a VCALENDAR component, as well as the UID of the event - * we're going to traverse. - * - * @param Component $vcal - * @param string|null $uid - */ - public function __construct(Component $vcal, $uid=null) { - - if (is_null($uid)) { - if ($vcal instanceof Component\VCalendar) { - throw new \InvalidArgumentException('If you pass a VCALENDAR object, you must pass a uid argument as well'); - } - $components = array($vcal); - $uid = (string)$vcal->uid; - } else { - $components = $vcal->select('VEVENT'); - } - foreach($components as $component) { - if ((string)$component->uid == $uid) { - if (isset($component->{'RECURRENCE-ID'})) { - $this->overriddenEvents[$component->DTSTART->getDateTime()->getTimeStamp()] = $component; - $this->overriddenDates[] = $component->{'RECURRENCE-ID'}->getDateTime(); - } else { - $this->baseEvent = $component; - } - } - } - - ksort($this->overriddenEvents); - - if (!$this->baseEvent) { - // No base event was found. CalDAV does allow cases where only - // overridden instances are stored. - // - // In this barticular case, we're just going to grab the first - // event and use that instead. This may not always give the - // desired result. - if (!count($this->overriddenEvents)) { - throw new \InvalidArgumentException('Could not find an event with uid: ' . $uid); - } - ksort($this->overriddenEvents, SORT_NUMERIC); - $this->baseEvent = array_shift($this->overriddenEvents); - } - - $this->startDate = clone $this->baseEvent->DTSTART->getDateTime(); - - $this->endDate = null; - if (isset($this->baseEvent->DTEND)) { - $this->endDate = clone $this->baseEvent->DTEND->getDateTime(); - } else { - $this->endDate = clone $this->startDate; - if (isset($this->baseEvent->DURATION)) { - $this->endDate->add(DateTimeParser::parse((string)$this->baseEvent->DURATION)); - } elseif (!$this->baseEvent->DTSTART->hasTime()) { - $this->endDate->modify('+1 day'); - } - } - $this->currentDate = clone $this->startDate; - - $rrule = $this->baseEvent->RRULE; - - // If no rrule was specified, we create a default setting - if (!$rrule) { - $this->frequency = 'daily'; - $this->count = 1; - } else foreach($rrule->getParts() as $key=>$value) { - - switch($key) { - - case 'FREQ' : - if (!in_array( - strtolower($value), - array('secondly','minutely','hourly','daily','weekly','monthly','yearly') - )) { - throw new \InvalidArgumentException('Unknown value for FREQ=' . strtoupper($value)); - - } - $this->frequency = strtolower($value); - break; - - case 'UNTIL' : - $this->until = DateTimeParser::parse($value); - - // In some cases events are generated with an UNTIL= - // parameter before the actual start of the event. - // - // Not sure why this is happening. We assume that the - // intention was that the event only recurs once. - // - // So we are modifying the parameter so our code doesn't - // break. - if($this->until < $this->baseEvent->DTSTART->getDateTime()) { - $this->until = $this->baseEvent->DTSTART->getDateTime(); - } - break; - - case 'COUNT' : - $this->count = (int)$value; - break; - - case 'INTERVAL' : - $this->interval = (int)$value; - if ($this->interval < 1) { - throw new \InvalidArgumentException('INTERVAL in RRULE must be a positive integer!'); - } - break; - - case 'BYSECOND' : - $this->bySecond = (array)$value; - break; - - case 'BYMINUTE' : - $this->byMinute = (array)$value; - break; - - case 'BYHOUR' : - $this->byHour = (array)$value; - break; - - case 'BYDAY' : - $this->byDay = (array)$value; - break; - - case 'BYMONTHDAY' : - $this->byMonthDay = (array)$value; - break; - - case 'BYYEARDAY' : - $this->byYearDay = (array)$value; - break; - - case 'BYWEEKNO' : - $this->byWeekNo = (array)$value; - break; - - case 'BYMONTH' : - $this->byMonth = (array)$value; - break; - - case 'BYSETPOS' : - $this->bySetPos = (array)$value; - break; - - case 'WKST' : - $this->weekStart = strtoupper($value); - break; - - } - - } - - // Parsing exception dates - if (isset($this->baseEvent->EXDATE)) { - foreach($this->baseEvent->EXDATE as $exDate) { - - foreach(explode(',', (string)$exDate) as $exceptionDate) { - - $this->exceptionDates[] = - DateTimeParser::parse($exceptionDate, $this->startDate->getTimeZone()); - - } - - } - - } - - } - - /** - * Returns the current item in the list - * - * @return DateTime - */ - public function current() { - - if (!$this->valid()) return null; - return clone $this->currentDate; - - } - - /** - * This method returns the startdate for the current iteration of the - * event. - * - * @return DateTime - */ - public function getDtStart() { - - if (!$this->valid()) return null; - return clone $this->currentDate; - - } - - /** - * This method returns the enddate for the current iteration of the - * event. - * - * @return DateTime - */ - public function getDtEnd() { - - if (!$this->valid()) return null; - $dtEnd = clone $this->currentDate; - $dtEnd->add( $this->startDate->diff( $this->endDate ) ); - return clone $dtEnd; - - } - - /** - * Returns a VEVENT object with the updated start and end date. - * - * Any recurrence information is removed, and this function may return an - * 'overridden' event instead. - * - * This method always returns a cloned instance. - * - * @return Component\VEvent - */ - public function getEventObject() { - - if ($this->currentOverriddenEvent) { - return clone $this->currentOverriddenEvent; - } - $event = clone $this->baseEvent; - unset($event->RRULE); - unset($event->EXDATE); - unset($event->RDATE); - unset($event->EXRULE); - - $event->DTSTART->setDateTime($this->getDTStart()); - if (isset($event->DTEND)) { - $event->DTEND->setDateTime($this->getDtEnd()); - } - if ($this->counter > 0) { - $event->{'RECURRENCE-ID'} = (string)$event->DTSTART; - } - - return $event; - - } - - /** - * Returns the current item number - * - * @return int - */ - public function key() { - - return $this->counter; - - } - - /** - * Whether or not there is a 'next item' - * - * @return bool - */ - public function valid() { - - if (!is_null($this->count)) { - return $this->counter < $this->count; - } - if (!is_null($this->until) && $this->currentDate > $this->until) { - - // Need to make sure there's no overridden events past the - // until date. - foreach($this->overriddenEvents as $overriddenEvent) { - - if ($overriddenEvent->DTSTART->getDateTime() >= $this->currentDate) { - - return true; - } - } - return false; - } - return true; - - } - - /** - * Resets the iterator - * - * @return void - */ - public function rewind() { - - $this->currentDate = clone $this->startDate; - $this->counter = 0; - - } - - /** - * This method allows you to quickly go to the next occurrence after the - * specified date. - * - * Note that this checks the current 'endDate', not the 'stardDate'. This - * means that if you forward to January 1st, the iterator will stop at the - * first event that ends *after* January 1st. - * - * @param DateTime $dt - * @return void - */ - public function fastForward(\DateTime $dt) { - - while($this->valid() && $this->getDTEnd() <= $dt) { - $this->next(); - } - - } - - /** - * Returns true if this recurring event never ends. - * - * @return bool - */ - public function isInfinite() { - - return !$this->count && !$this->until; - - } - - /** - * Goes on to the next iteration - * - * @return void - */ - public function next() { - - $previousStamp = $this->currentDate->getTimeStamp(); - - // Finding the next overridden event in line, and storing that for - // later use. - $overriddenEvent = null; - $overriddenDate = null; - $this->currentOverriddenEvent = null; - - foreach($this->overriddenEvents as $index=>$event) { - if ($index > $previousStamp) { - $overriddenEvent = $event; - $overriddenDate = clone $event->DTSTART->getDateTime(); - break; - } - } - - // If we have a stored 'next date', we will use that. - if ($this->nextDate) { - if (!$overriddenDate || $this->nextDate < $overriddenDate) { - $this->currentDate = $this->nextDate; - $currentStamp = $this->currentDate->getTimeStamp(); - $this->nextDate = null; - } else { - $this->currentDate = clone $overriddenDate; - $this->currentOverriddenEvent = $overriddenEvent; - } - $this->counter++; - return; - } - - while(true) { - - // Otherwise, we find the next event in the normal RRULE - // sequence. - switch($this->frequency) { - - case 'hourly' : - $this->nextHourly(); - break; - - case 'daily' : - $this->nextDaily(); - break; - - case 'weekly' : - $this->nextWeekly(); - break; - - case 'monthly' : - $this->nextMonthly(); - break; - - case 'yearly' : - $this->nextYearly(); - break; - - } - $currentStamp = $this->currentDate->getTimeStamp(); - - - // Checking exception dates - foreach($this->exceptionDates as $exceptionDate) { - if ($this->currentDate == $exceptionDate) { - $this->counter++; - continue 2; - } - } - foreach($this->overriddenDates as $check) { - if ($this->currentDate == $check) { - continue 2; - } - } - break; - - } - - - - // Is the date we have actually higher than the next overiddenEvent? - if ($overriddenDate && $this->currentDate > $overriddenDate) { - $this->nextDate = clone $this->currentDate; - $this->currentDate = clone $overriddenDate; - $this->currentOverriddenEvent = $overriddenEvent; - $this->handledOverridden++; - } - $this->counter++; - - - /* - * If we have overridden events left in the queue, but our counter is - * running out, we should grab one of those. - */ - if (!is_null($overriddenEvent) && !is_null($this->count) && count($this->overriddenEvents) - $this->handledOverridden >= ($this->count - $this->counter)) { - - $this->currentOverriddenEvent = $overriddenEvent; - $this->currentDate = clone $overriddenDate; - $this->handledOverridden++; - - } - - } - - /** - * Does the processing for advancing the iterator for hourly frequency. - * - * @return void - */ - protected function nextHourly() { - - if (!$this->byHour) { - $this->currentDate->modify('+' . $this->interval . ' hours'); - return; - } - // @codeCoverageIgnoreStart - } - // @codeCoverageIgnoreEnd - - /** - * Does the processing for advancing the iterator for daily frequency. - * - * @return void - */ - protected function nextDaily() { - - if (!$this->byHour && !$this->byDay) { - $this->currentDate->modify('+' . $this->interval . ' days'); - return; - } - - if (isset($this->byHour)) { - $recurrenceHours = $this->getHours(); - } - - if (isset($this->byDay)) { - $recurrenceDays = $this->getDays(); - } - - do { - - if ($this->byHour) { - if ($this->currentDate->format('G') == '23') { - // to obey the interval rule - $this->currentDate->modify('+' . $this->interval-1 . ' days'); - } - - $this->currentDate->modify('+1 hours'); - - } else { - $this->currentDate->modify('+' . $this->interval . ' days'); - - } - - // Current day of the week - $currentDay = $this->currentDate->format('w'); - - // Current hour of the day - $currentHour = $this->currentDate->format('G'); - - } while (($this->byDay && !in_array($currentDay, $recurrenceDays)) || ($this->byHour && !in_array($currentHour, $recurrenceHours))); - - } - - /** - * Does the processing for advancing the iterator for weekly frequency. - * - * @return void - */ - protected function nextWeekly() { - - if (!$this->byHour && !$this->byDay) { - $this->currentDate->modify('+' . $this->interval . ' weeks'); - return; - } - - if ($this->byHour) { - $recurrenceHours = $this->getHours(); - } - - if ($this->byDay) { - $recurrenceDays = $this->getDays(); - } - - // First day of the week: - $firstDay = $this->dayMap[$this->weekStart]; - - do { - - if ($this->byHour) { - $this->currentDate->modify('+1 hours'); - } else { - $this->currentDate->modify('+1 days'); - } - - // Current day of the week - $currentDay = (int) $this->currentDate->format('w'); - - // Current hour of the day - $currentHour = (int) $this->currentDate->format('G'); - - // We need to roll over to the next week - if ($currentDay === $firstDay && (!$this->byHour || $currentHour == '0')) { - $this->currentDate->modify('+' . $this->interval-1 . ' weeks'); - - // We need to go to the first day of this week, but only if we - // are not already on this first day of this week. - if($this->currentDate->format('w') != $firstDay) { - $this->currentDate->modify('last ' . $this->dayNames[$this->dayMap[$this->weekStart]]); - } - } - - // We have a match - } while (($this->byDay && !in_array($currentDay, $recurrenceDays)) || ($this->byHour && !in_array($currentHour, $recurrenceHours))); - } - - /** - * Does the processing for advancing the iterator for monthly frequency. - * - * @return void - */ - protected function nextMonthly() { - - $currentDayOfMonth = $this->currentDate->format('j'); - if (!$this->byMonthDay && !$this->byDay) { - - // If the current day is higher than the 28th, rollover can - // occur to the next month. We Must skip these invalid - // entries. - if ($currentDayOfMonth < 29) { - $this->currentDate->modify('+' . $this->interval . ' months'); - } else { - $increase = 0; - do { - $increase++; - $tempDate = clone $this->currentDate; - $tempDate->modify('+ ' . ($this->interval*$increase) . ' months'); - } while ($tempDate->format('j') != $currentDayOfMonth); - $this->currentDate = $tempDate; - } - return; - } - - while(true) { - - $occurrences = $this->getMonthlyOccurrences(); - - foreach($occurrences as $occurrence) { - - // The first occurrence thats higher than the current - // day of the month wins. - if ($occurrence > $currentDayOfMonth) { - break 2; - } - - } - - // If we made it all the way here, it means there were no - // valid occurrences, and we need to advance to the next - // month. - $this->currentDate->modify('first day of this month'); - $this->currentDate->modify('+ ' . $this->interval . ' months'); - - // This goes to 0 because we need to start counting at hte - // beginning. - $currentDayOfMonth = 0; - - } - - $this->currentDate->setDate($this->currentDate->format('Y'), $this->currentDate->format('n'), $occurrence); - - } - - /** - * Does the processing for advancing the iterator for yearly frequency. - * - * @return void - */ - protected function nextYearly() { - - $currentMonth = $this->currentDate->format('n'); - $currentYear = $this->currentDate->format('Y'); - $currentDayOfMonth = $this->currentDate->format('j'); - - // No sub-rules, so we just advance by year - if (!$this->byMonth) { - - // Unless it was a leap day! - if ($currentMonth==2 && $currentDayOfMonth==29) { - - $counter = 0; - do { - $counter++; - // Here we increase the year count by the interval, until - // we hit a date that's also in a leap year. - // - // We could just find the next interval that's dividable by - // 4, but that would ignore the rule that there's no leap - // year every year that's dividable by a 100, but not by - // 400. (1800, 1900, 2100). So we just rely on the datetime - // functions instead. - $nextDate = clone $this->currentDate; - $nextDate->modify('+ ' . ($this->interval*$counter) . ' years'); - } while ($nextDate->format('n')!=2); - $this->currentDate = $nextDate; - - return; - - } - - // The easiest form - $this->currentDate->modify('+' . $this->interval . ' years'); - return; - - } - - $currentMonth = $this->currentDate->format('n'); - $currentYear = $this->currentDate->format('Y'); - $currentDayOfMonth = $this->currentDate->format('j'); - - $advancedToNewMonth = false; - - // If we got a byDay or getMonthDay filter, we must first expand - // further. - if ($this->byDay || $this->byMonthDay) { - - while(true) { - - $occurrences = $this->getMonthlyOccurrences(); - - foreach($occurrences as $occurrence) { - - // The first occurrence that's higher than the current - // day of the month wins. - // If we advanced to the next month or year, the first - // occurrence is always correct. - if ($occurrence > $currentDayOfMonth || $advancedToNewMonth) { - break 2; - } - - } - - // If we made it here, it means we need to advance to - // the next month or year. - $currentDayOfMonth = 1; - $advancedToNewMonth = true; - do { - - $currentMonth++; - if ($currentMonth>12) { - $currentYear+=$this->interval; - $currentMonth = 1; - } - } while (!in_array($currentMonth, $this->byMonth)); - - $this->currentDate->setDate($currentYear, $currentMonth, $currentDayOfMonth); - - } - - // If we made it here, it means we got a valid occurrence - $this->currentDate->setDate($currentYear, $currentMonth, $occurrence); - return; - - } else { - - // These are the 'byMonth' rules, if there are no byDay or - // byMonthDay sub-rules. - do { - - $currentMonth++; - if ($currentMonth>12) { - $currentYear+=$this->interval; - $currentMonth = 1; - } - } while (!in_array($currentMonth, $this->byMonth)); - $this->currentDate->setDate($currentYear, $currentMonth, $currentDayOfMonth); - - return; - - } - - } - - /** - * Returns all the occurrences for a monthly frequency with a 'byDay' or - * 'byMonthDay' expansion for the current month. - * - * The returned list is an array of integers with the day of month (1-31). - * - * @return array - */ - protected function getMonthlyOccurrences() { - - $startDate = clone $this->currentDate; - - $byDayResults = array(); - - // Our strategy is to simply go through the byDays, advance the date to - // that point and add it to the results. - if ($this->byDay) foreach($this->byDay as $day) { - - $dayName = $this->dayNames[$this->dayMap[substr($day,-2)]]; - - // Dayname will be something like 'wednesday'. Now we need to find - // all wednesdays in this month. - $dayHits = array(); - - $checkDate = clone $startDate; - $checkDate->modify('first day of this month'); - $checkDate->modify($dayName); - - do { - $dayHits[] = $checkDate->format('j'); - $checkDate->modify('next ' . $dayName); - } while ($checkDate->format('n') === $startDate->format('n')); - - // So now we have 'all wednesdays' for month. It is however - // possible that the user only really wanted the 1st, 2nd or last - // wednesday. - if (strlen($day)>2) { - $offset = (int)substr($day,0,-2); - - if ($offset>0) { - // It is possible that the day does not exist, such as a - // 5th or 6th wednesday of the month. - if (isset($dayHits[$offset-1])) { - $byDayResults[] = $dayHits[$offset-1]; - } - } else { - - // if it was negative we count from the end of the array - $byDayResults[] = $dayHits[count($dayHits) + $offset]; - } - } else { - // There was no counter (first, second, last wednesdays), so we - // just need to add the all to the list). - $byDayResults = array_merge($byDayResults, $dayHits); - - } - - } - - $byMonthDayResults = array(); - if ($this->byMonthDay) foreach($this->byMonthDay as $monthDay) { - - // Removing values that are out of range for this month - if ($monthDay > $startDate->format('t') || - $monthDay < 0-$startDate->format('t')) { - continue; - } - if ($monthDay>0) { - $byMonthDayResults[] = $monthDay; - } else { - // Negative values - $byMonthDayResults[] = $startDate->format('t') + 1 + $monthDay; - } - } - - // If there was just byDay or just byMonthDay, they just specify our - // (almost) final list. If both were provided, then byDay limits the - // list. - if ($this->byMonthDay && $this->byDay) { - $result = array_intersect($byMonthDayResults, $byDayResults); - } elseif ($this->byMonthDay) { - $result = $byMonthDayResults; - } else { - $result = $byDayResults; - } - $result = array_unique($result); - sort($result, SORT_NUMERIC); - - // The last thing that needs checking is the BYSETPOS. If it's set, it - // means only certain items in the set survive the filter. - if (!$this->bySetPos) { - return $result; - } - - $filteredResult = array(); - foreach($this->bySetPos as $setPos) { - - if ($setPos<0) { - $setPos = count($result)-($setPos+1); - } - if (isset($result[$setPos-1])) { - $filteredResult[] = $result[$setPos-1]; - } - } - - sort($filteredResult, SORT_NUMERIC); - return $filteredResult; - - } - - protected function getHours() - { - $recurrenceHours = array(); - foreach($this->byHour as $byHour) { - $recurrenceHours[] = $byHour; - } - - return $recurrenceHours; - } - - protected function getDays() - { - $recurrenceDays = array(); - foreach($this->byDay as $byDay) { - - // The day may be preceeded with a positive (+n) or - // negative (-n) integer. However, this does not make - // sense in 'weekly' so we ignore it here. - $recurrenceDays[] = $this->dayMap[substr($byDay,-2)]; - - } - - return $recurrenceDays; - } -} - diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/ICalendar.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/ICalendar.php deleted file mode 100644 index eb5db80b27..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/ICalendar.php +++ /dev/null @@ -1,114 +0,0 @@ -children() as $component) { - if (!$component instanceof VObject\Component) { - continue; - } - - // Get all timezones - if ($component->name === 'VTIMEZONE') { - $this->vtimezones[(string)$component->TZID] = $component; - continue; - } - - // Get component UID for recurring Events search - if($component->UID) { - $uid = (string)$component->UID; - } else { - // Generating a random UID - $uid = sha1(microtime()) . '-vobjectimport'; - } - - // Take care of recurring events - if (!array_key_exists($uid, $this->objects)) { - $this->objects[$uid] = new VCalendar(); - } - - $this->objects[$uid]->add(clone $component); - } - - } - - /** - * Every time getNext() is called, a new object will be parsed, until we - * hit the end of the stream. - * - * When the end is reached, null will be returned. - * - * @return SabreForRainLoop\VObject\Component|null - */ - public function getNext() { - - if($object=array_shift($this->objects)) { - - // create our baseobject - $object->version = '2.0'; - $object->prodid = '-//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN'; - $object->calscale = 'GREGORIAN'; - - // add vtimezone information to obj (if we have it) - foreach ($this->vtimezones as $vtimezone) { - $object->add($vtimezone); - } - - return $object; - - } else { - - return null; - - } - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/SplitterInterface.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/SplitterInterface.php deleted file mode 100644 index 116da8af27..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Splitter/SplitterInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -input = $input; - $this->parser = new MimeDir($input, $options); - - } - - /** - * Every time getNext() is called, a new object will be parsed, until we - * hit the end of the stream. - * - * When the end is reached, null will be returned. - * - * @return SabreForRainLoop\VObject\Component|null - */ - public function getNext() { - - try { - $object = $this->parser->parse(); - } catch (VObject\EofException $e) { - return null; - } - - return $object; - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/StringUtil.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/StringUtil.php deleted file mode 100644 index 390113732a..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/StringUtil.php +++ /dev/null @@ -1,61 +0,0 @@ -'Australia/Darwin', - 'AUS Eastern Standard Time'=>'Australia/Sydney', - 'Afghanistan Standard Time'=>'Asia/Kabul', - 'Alaskan Standard Time'=>'America/Anchorage', - 'Arab Standard Time'=>'Asia/Riyadh', - 'Arabian Standard Time'=>'Asia/Dubai', - 'Arabic Standard Time'=>'Asia/Baghdad', - 'Argentina Standard Time'=>'America/Buenos_Aires', - 'Armenian Standard Time'=>'Asia/Yerevan', - 'Atlantic Standard Time'=>'America/Halifax', - 'Azerbaijan Standard Time'=>'Asia/Baku', - 'Azores Standard Time'=>'Atlantic/Azores', - 'Bangladesh Standard Time'=>'Asia/Dhaka', - 'Canada Central Standard Time'=>'America/Regina', - 'Cape Verde Standard Time'=>'Atlantic/Cape_Verde', - 'Caucasus Standard Time'=>'Asia/Yerevan', - 'Cen. Australia Standard Time'=>'Australia/Adelaide', - 'Central America Standard Time'=>'America/Guatemala', - 'Central Asia Standard Time'=>'Asia/Almaty', - 'Central Brazilian Standard Time'=>'America/Cuiaba', - 'Central Europe Standard Time'=>'Europe/Budapest', - 'Central European Standard Time'=>'Europe/Warsaw', - 'Central Pacific Standard Time'=>'Pacific/Guadalcanal', - 'Central Standard Time'=>'America/Chicago', - 'Central Standard Time (Mexico)'=>'America/Mexico_City', - 'China Standard Time'=>'Asia/Shanghai', - 'Dateline Standard Time'=>'Etc/GMT+12', - 'E. Africa Standard Time'=>'Africa/Nairobi', - 'E. Australia Standard Time'=>'Australia/Brisbane', - 'E. Europe Standard Time'=>'Europe/Minsk', - 'E. South America Standard Time'=>'America/Sao_Paulo', - 'Eastern Standard Time'=>'America/New_York', - 'Egypt Standard Time'=>'Africa/Cairo', - 'Ekaterinburg Standard Time'=>'Asia/Yekaterinburg', - 'FLE Standard Time'=>'Europe/Kiev', - 'Fiji Standard Time'=>'Pacific/Fiji', - 'GMT Standard Time'=>'Europe/London', - 'GTB Standard Time'=>'Europe/Istanbul', - 'Georgian Standard Time'=>'Asia/Tbilisi', - 'Greenland Standard Time'=>'America/Godthab', - 'Greenwich Standard Time'=>'Atlantic/Reykjavik', - 'Hawaiian Standard Time'=>'Pacific/Honolulu', - 'India Standard Time'=>'Asia/Calcutta', - 'Iran Standard Time'=>'Asia/Tehran', - 'Israel Standard Time'=>'Asia/Jerusalem', - 'Jordan Standard Time'=>'Asia/Amman', - 'Kamchatka Standard Time'=>'Asia/Kamchatka', - 'Korea Standard Time'=>'Asia/Seoul', - 'Magadan Standard Time'=>'Asia/Magadan', - 'Mauritius Standard Time'=>'Indian/Mauritius', - 'Mexico Standard Time'=>'America/Mexico_City', - 'Mexico Standard Time 2'=>'America/Chihuahua', - 'Mid-Atlantic Standard Time'=>'Etc/GMT-2', - 'Middle East Standard Time'=>'Asia/Beirut', - 'Montevideo Standard Time'=>'America/Montevideo', - 'Morocco Standard Time'=>'Africa/Casablanca', - 'Mountain Standard Time'=>'America/Denver', - 'Mountain Standard Time (Mexico)'=>'America/Chihuahua', - 'Myanmar Standard Time'=>'Asia/Rangoon', - 'N. Central Asia Standard Time'=>'Asia/Novosibirsk', - 'Namibia Standard Time'=>'Africa/Windhoek', - 'Nepal Standard Time'=>'Asia/Katmandu', - 'New Zealand Standard Time'=>'Pacific/Auckland', - 'Newfoundland Standard Time'=>'America/St_Johns', - 'North Asia East Standard Time'=>'Asia/Irkutsk', - 'North Asia Standard Time'=>'Asia/Krasnoyarsk', - 'Pacific SA Standard Time'=>'America/Santiago', - 'Pacific Standard Time'=>'America/Los_Angeles', - 'Pacific Standard Time (Mexico)'=>'America/Santa_Isabel', - 'Pakistan Standard Time'=>'Asia/Karachi', - 'Paraguay Standard Time'=>'America/Asuncion', - 'Romance Standard Time'=>'Europe/Paris', - 'Russian Standard Time'=>'Europe/Moscow', - 'SA Eastern Standard Time'=>'America/Cayenne', - 'SA Pacific Standard Time'=>'America/Bogota', - 'SA Western Standard Time'=>'America/La_Paz', - 'SE Asia Standard Time'=>'Asia/Bangkok', - 'Samoa Standard Time'=>'Pacific/Apia', - 'Singapore Standard Time'=>'Asia/Singapore', - 'South Africa Standard Time'=>'Africa/Johannesburg', - 'Sri Lanka Standard Time'=>'Asia/Colombo', - 'Syria Standard Time'=>'Asia/Damascus', - 'Taipei Standard Time'=>'Asia/Taipei', - 'Tasmania Standard Time'=>'Australia/Hobart', - 'Tokyo Standard Time'=>'Asia/Tokyo', - 'Tonga Standard Time'=>'Pacific/Tongatapu', - 'US Eastern Standard Time'=>'America/Indianapolis', - 'US Mountain Standard Time'=>'America/Phoenix', - 'UTC+12'=>'Etc/GMT-12', - 'UTC-02'=>'Etc/GMT+2', - 'UTC-11'=>'Etc/GMT+11', - 'Ulaanbaatar Standard Time'=>'Asia/Ulaanbaatar', - 'Venezuela Standard Time'=>'America/Caracas', - 'Vladivostok Standard Time'=>'Asia/Vladivostok', - 'W. Australia Standard Time'=>'Australia/Perth', - 'W. Central Africa Standard Time'=>'Africa/Lagos', - 'W. Europe Standard Time'=>'Europe/Berlin', - 'West Asia Standard Time'=>'Asia/Tashkent', - 'West Pacific Standard Time'=>'Pacific/Port_Moresby', - 'Yakutsk Standard Time'=>'Asia/Yakutsk', - - // Microsoft exchange timezones - // Source: - // http://msdn.microsoft.com/en-us/library/ms988620%28v=exchg.65%29.aspx - // - // Correct timezones deduced with help from: - // http://en.wikipedia.org/wiki/List_of_tz_database_time_zones - 'Universal Coordinated Time' => 'UTC', - 'Casablanca, Monrovia' => 'Africa/Casablanca', - 'Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London' => 'Europe/Lisbon', - 'Greenwich Mean Time; Dublin, Edinburgh, London' => 'Europe/London', - 'Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna' => 'Europe/Berlin', - 'Belgrade, Pozsony, Budapest, Ljubljana, Prague' => 'Europe/Prague', - 'Brussels, Copenhagen, Madrid, Paris' => 'Europe/Paris', - 'Paris, Madrid, Brussels, Copenhagen' => 'Europe/Paris', - 'Prague, Central Europe' => 'Europe/Prague', - 'Sarajevo, Skopje, Sofija, Vilnius, Warsaw, Zagreb' => 'Europe/Sarajevo', - 'West Central Africa' => 'Africa/Luanda', // This was a best guess - 'Athens, Istanbul, Minsk' => 'Europe/Athens', - 'Bucharest' => 'Europe/Bucharest', - 'Cairo' => 'Africa/Cairo', - 'Harare, Pretoria' => 'Africa/Harare', - 'Helsinki, Riga, Tallinn' => 'Europe/Helsinki', - 'Israel, Jerusalem Standard Time' => 'Asia/Jerusalem', - 'Baghdad' => 'Asia/Baghdad', - 'Arab, Kuwait, Riyadh' => 'Asia/Kuwait', - 'Moscow, St. Petersburg, Volgograd' => 'Europe/Moscow', - 'East Africa, Nairobi' => 'Africa/Nairobi', - 'Tehran' => 'Asia/Tehran', - 'Abu Dhabi, Muscat' => 'Asia/Muscat', // Best guess - 'Baku, Tbilisi, Yerevan' => 'Asia/Baku', - 'Kabul' => 'Asia/Kabul', - 'Ekaterinburg' => 'Asia/Yekaterinburg', - 'Islamabad, Karachi, Tashkent' => 'Asia/Karachi', - 'Kolkata, Chennai, Mumbai, New Delhi, India Standard Time' => 'Asia/Calcutta', - 'Kathmandu, Nepal' => 'Asia/Kathmandu', - 'Almaty, Novosibirsk, North Central Asia' => 'Asia/Almaty', - 'Astana, Dhaka' => 'Asia/Dhaka', - 'Sri Jayawardenepura, Sri Lanka' => 'Asia/Colombo', - 'Rangoon' => 'Asia/Rangoon', - 'Bangkok, Hanoi, Jakarta' => 'Asia/Bangkok', - 'Krasnoyarsk' => 'Asia/Krasnoyarsk', - 'Beijing, Chongqing, Hong Kong SAR, Urumqi' => 'Asia/Shanghai', - 'Irkutsk, Ulaan Bataar' => 'Asia/Irkutsk', - 'Kuala Lumpur, Singapore' => 'Asia/Singapore', - 'Perth, Western Australia' => 'Australia/Perth', - 'Taipei' => 'Asia/Taipei', - 'Osaka, Sapporo, Tokyo' => 'Asia/Tokyo', - 'Seoul, Korea Standard time' => 'Asia/Seoul', - 'Yakutsk' => 'Asia/Yakutsk', - 'Adelaide, Central Australia' => 'Australia/Adelaide', - 'Darwin' => 'Australia/Darwin', - 'Brisbane, East Australia' => 'Australia/Brisbane', - 'Canberra, Melbourne, Sydney, Hobart (year 2000 only)' => 'Australia/Sydney', - 'Guam, Port Moresby' => 'Pacific/Guam', - 'Hobart, Tasmania' => 'Australia/Hobart', - 'Vladivostok' => 'Asia/Vladivostok', - 'Magadan, Solomon Is., New Caledonia' => 'Asia/Magadan', - 'Auckland, Wellington' => 'Pacific/Auckland', - 'Fiji Islands, Kamchatka, Marshall Is.' => 'Pacific/Fiji', - 'Nuku\'alofa, Tonga' => 'Pacific/Tongatapu', - 'Azores' => 'Atlantic/Azores', - 'Cape Verde Is.' => 'Atlantic/Cape_Verde', - 'Mid-Atlantic' => 'America/Noronha', - 'Brasilia' => 'America/Sao_Paulo', // Best guess - 'Buenos Aires' => 'America/Argentina/Buenos_Aires', - 'Greenland' => 'America/Godthab', - 'Newfoundland' => 'America/St_Johns', - 'Atlantic Time (Canada)' => 'America/Halifax', - 'Caracas, La Paz' => 'America/Caracas', - 'Santiago' => 'America/Santiago', - 'Bogota, Lima, Quito' => 'America/Bogota', - 'Eastern Time (US & Canada)' => 'America/New_York', - 'Indiana (East)' => 'America/Indiana/Indianapolis', - 'Central America' => 'America/Guatemala', - 'Central Time (US & Canada)' => 'America/Chicago', - 'Mexico City, Tegucigalpa' => 'America/Mexico_City', - 'Saskatchewan' => 'America/Edmonton', - 'Arizona' => 'America/Phoenix', - 'Mountain Time (US & Canada)' => 'America/Denver', // Best guess - 'Pacific Time (US & Canada); Tijuana' => 'America/Los_Angeles', // Best guess - 'Alaska' => 'America/Anchorage', - 'Hawaii' => 'Pacific/Honolulu', - 'Midway Island, Samoa' => 'Pacific/Midway', - 'Eniwetok, Kwajalein, Dateline Time' => 'Pacific/Kwajalein', - - // The following list are timezone names that could be generated by - // Lotus / Domino - 'Dateline' => 'Etc/GMT-12', - 'Samoa' => 'Pacific/Apia', - 'Hawaiian' => 'Pacific/Honolulu', - 'Alaskan' => 'America/Anchorage', - 'Pacific' => 'America/Los_Angeles', - 'Pacific Standard Time' => 'America/Los_Angeles', - 'Mexico Standard Time 2' => 'America/Chihuahua', - 'Mountain' => 'America/Denver', - 'Mountain Standard Time' => 'America/Chihuahua', - 'US Mountain' => 'America/Phoenix', - 'Canada Central' => 'America/Edmonton', - 'Central America' => 'America/Guatemala', - 'Central' => 'America/Chicago', - 'Central Standard Time' => 'America/Mexico_City', - 'Mexico' => 'America/Mexico_City', - 'Eastern' => 'America/New_York', - 'SA Pacific' => 'America/Bogota', - 'US Eastern' => 'America/Indiana/Indianapolis', - 'Venezuela' => 'America/Caracas', - 'Atlantic' => 'America/Halifax', - 'Central Brazilian' => 'America/Manaus', - 'Pacific SA' => 'America/Santiago', - 'SA Western' => 'America/La_Paz', - 'Newfoundland' => 'America/St_Johns', - 'Argentina' => 'America/Argentina/Buenos_Aires', - 'E. South America' => 'America/Belem', - 'Greenland' => 'America/Godthab', - 'Montevideo' => 'America/Montevideo', - 'SA Eastern' => 'America/Belem', - 'Mid-Atlantic' => 'Etc/GMT-2', - 'Azores' => 'Atlantic/Azores', - 'Cape Verde' => 'Atlantic/Cape_Verde', - 'Greenwich' => 'Atlantic/Reykjavik', // No I'm serious.. Greenwich is not GMT. - 'Morocco' => 'Africa/Casablanca', - 'Central Europe' => 'Europe/Prague', - 'Central European' => 'Europe/Sarajevo', - 'Romance' => 'Europe/Paris', - 'W. Central Africa' => 'Africa/Lagos', // Best guess - 'W. Europe' => 'Europe/Amsterdam', - 'E. Europe' => 'Europe/Minsk', - 'Egypt' => 'Africa/Cairo', - 'FLE' => 'Europe/Helsinki', - 'GTB' => 'Europe/Athens', - 'Israel' => 'Asia/Jerusalem', - 'Jordan' => 'Asia/Amman', - 'Middle East' => 'Asia/Beirut', - 'Namibia' => 'Africa/Windhoek', - 'South Africa' => 'Africa/Harare', - 'Arab' => 'Asia/Kuwait', - 'Arabic' => 'Asia/Baghdad', - 'E. Africa' => 'Africa/Nairobi', - 'Georgian' => 'Asia/Tbilisi', - 'Russian' => 'Europe/Moscow', - 'Iran' => 'Asia/Tehran', - 'Arabian' => 'Asia/Muscat', - 'Armenian' => 'Asia/Yerevan', - 'Azerbijan' => 'Asia/Baku', - 'Caucasus' => 'Asia/Yerevan', - 'Mauritius' => 'Indian/Mauritius', - 'Afghanistan' => 'Asia/Kabul', - 'Ekaterinburg' => 'Asia/Yekaterinburg', - 'Pakistan' => 'Asia/Karachi', - 'West Asia' => 'Asia/Tashkent', - 'India' => 'Asia/Calcutta', - 'Sri Lanka' => 'Asia/Colombo', - 'Nepal' => 'Asia/Kathmandu', - 'Central Asia' => 'Asia/Dhaka', - 'N. Central Asia' => 'Asia/Almaty', - 'Myanmar' => 'Asia/Rangoon', - 'North Asia' => 'Asia/Krasnoyarsk', - 'SE Asia' => 'Asia/Bangkok', - 'China' => 'Asia/Shanghai', - 'North Asia East' => 'Asia/Irkutsk', - 'Singapore' => 'Asia/Singapore', - 'Taipei' => 'Asia/Taipei', - 'W. Australia' => 'Australia/Perth', - 'Korea' => 'Asia/Seoul', - 'Tokyo' => 'Asia/Tokyo', - 'Yakutsk' => 'Asia/Yakutsk', - 'AUS Central' => 'Australia/Darwin', - 'Cen. Australia' => 'Australia/Adelaide', - 'AUS Eastern' => 'Australia/Sydney', - 'E. Australia' => 'Australia/Brisbane', - 'Tasmania' => 'Australia/Hobart', - 'Vladivostok' => 'Asia/Vladivostok', - 'West Pacific' => 'Pacific/Guam', - 'Central Pacific' => 'Asia/Magadan', - 'Fiji' => 'Pacific/Fiji', - 'New Zealand' => 'Pacific/Auckland', - 'Tonga' => 'Pacific/Tongatapu', - ); - - /** - * List of microsoft exchange timezone ids. - * - * Source: http://msdn.microsoft.com/en-us/library/aa563018(loband).aspx - */ - public static $microsoftExchangeMap = array( - 0 => 'UTC', - 31 => 'Africa/Casablanca', - - // Insanely, id #2 is used for both Europe/Lisbon, and Europe/Sarajevo. - // I'm not even kidding.. We handle this special case in the - // getTimeZone method. - 2 => 'Europe/Lisbon', - 1 => 'Europe/London', - 4 => 'Europe/Berlin', - 6 => 'Europe/Prague', - 3 => 'Europe/Paris', - 69 => 'Africa/Luanda', // This was a best guess - 7 => 'Europe/Athens', - 5 => 'Europe/Bucharest', - 49 => 'Africa/Cairo', - 50 => 'Africa/Harare', - 59 => 'Europe/Helsinki', - 27 => 'Asia/Jerusalem', - 26 => 'Asia/Baghdad', - 74 => 'Asia/Kuwait', - 51 => 'Europe/Moscow', - 56 => 'Africa/Nairobi', - 25 => 'Asia/Tehran', - 24 => 'Asia/Muscat', // Best guess - 54 => 'Asia/Baku', - 48 => 'Asia/Kabul', - 58 => 'Asia/Yekaterinburg', - 47 => 'Asia/Karachi', - 23 => 'Asia/Calcutta', - 62 => 'Asia/Kathmandu', - 46 => 'Asia/Almaty', - 71 => 'Asia/Dhaka', - 66 => 'Asia/Colombo', - 61 => 'Asia/Rangoon', - 22 => 'Asia/Bangkok', - 64 => 'Asia/Krasnoyarsk', - 45 => 'Asia/Shanghai', - 63 => 'Asia/Irkutsk', - 21 => 'Asia/Singapore', - 73 => 'Australia/Perth', - 75 => 'Asia/Taipei', - 20 => 'Asia/Tokyo', - 72 => 'Asia/Seoul', - 70 => 'Asia/Yakutsk', - 19 => 'Australia/Adelaide', - 44 => 'Australia/Darwin', - 18 => 'Australia/Brisbane', - 76 => 'Australia/Sydney', - 43 => 'Pacific/Guam', - 42 => 'Australia/Hobart', - 68 => 'Asia/Vladivostok', - 41 => 'Asia/Magadan', - 17 => 'Pacific/Auckland', - 40 => 'Pacific/Fiji', - 67 => 'Pacific/Tongatapu', - 29 => 'Atlantic/Azores', - 53 => 'Atlantic/Cape_Verde', - 30 => 'America/Noronha', - 8 => 'America/Sao_Paulo', // Best guess - 32 => 'America/Argentina/Buenos_Aires', - 60 => 'America/Godthab', - 28 => 'America/St_Johns', - 9 => 'America/Halifax', - 33 => 'America/Caracas', - 65 => 'America/Santiago', - 35 => 'America/Bogota', - 10 => 'America/New_York', - 34 => 'America/Indiana/Indianapolis', - 55 => 'America/Guatemala', - 11 => 'America/Chicago', - 37 => 'America/Mexico_City', - 36 => 'America/Edmonton', - 38 => 'America/Phoenix', - 12 => 'America/Denver', // Best guess - 13 => 'America/Los_Angeles', // Best guess - 14 => 'America/Anchorage', - 15 => 'Pacific/Honolulu', - 16 => 'Pacific/Midway', - 39 => 'Pacific/Kwajalein', - ); - - /** - * This method will try to find out the correct timezone for an iCalendar - * date-time value. - * - * You must pass the contents of the TZID parameter, as well as the full - * calendar. - * - * If the lookup fails, this method will return the default PHP timezone - * (as configured using date_default_timezone_set, or the date.timezone ini - * setting). - * - * Alternatively, if $failIfUncertain is set to true, it will throw an - * exception if we cannot accurately determine the timezone. - * - * @param string $tzid - * @param SabreForRainLoop\VObject\Component $vcalendar - * @return DateTimeZone - */ - static public function getTimeZone($tzid, Component $vcalendar = null, $failIfUncertain = false) { - - // First we will just see if the tzid is a support timezone identifier. - try { - return new \DateTimeZone($tzid); - } catch (\Exception $e) { - } - - // Next, we check if the tzid is somewhere in our tzid map. - if (isset(self::$map[$tzid])) { - return new \DateTimeZone(self::$map[$tzid]); - } - - // Maybe the author was hyper-lazy and just included an offset. We - // support it, but we aren't happy about it. - if (preg_match('/^GMT(\+|-)([0-9]{4})$/', $tzid, $matches)) { - return new \DateTimeZone('Etc/GMT' . $matches[1] . ltrim(substr($matches[2],0,2),'0')); - } - - if ($vcalendar) { - - // If that didn't work, we will scan VTIMEZONE objects - foreach($vcalendar->select('VTIMEZONE') as $vtimezone) { - - if ((string)$vtimezone->TZID === $tzid) { - - // Some clients add 'X-LIC-LOCATION' with the olson name. - if (isset($vtimezone->{'X-LIC-LOCATION'})) { - - $lic = (string)$vtimezone->{'X-LIC-LOCATION'}; - - // Libical generators may specify strings like - // "SystemV/EST5EDT". For those we must remove the - // SystemV part. - if (substr($lic,0,8)==='SystemV/') { - $lic = substr($lic,8); - } - - try { - return new \DateTimeZone($lic); - } catch (\Exception $e) { - } - - } - // Microsoft may add a magic number, which we also have an - // answer for. - if (isset($vtimezone->{'X-MICROSOFT-CDO-TZID'})) { - $cdoId = (int)$vtimezone->{'X-MICROSOFT-CDO-TZID'}->getValue(); - - // 2 can mean both Europe/Lisbon and Europe/Sarajevo. - if ($cdoId===2 && strpos((string)$vtimezone->TZID, 'Sarajevo')!==false) { - return new \DateTimeZone('Europe/Sarajevo'); - } - - if (isset(self::$microsoftExchangeMap[$cdoId])) { - return new \DateTimeZone(self::$microsoftExchangeMap[$cdoId]); - } - } - - } - - } - - } - - if ($failIfUncertain) { - throw new \InvalidArgumentException('We were unable to determine the correct PHP timezone for tzid: ' . $tzid); - } - - // If we got all the way here, we default to UTC. - return new \DateTimeZone(date_default_timezone_get()); - - } - -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/VCardConverter.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/VCardConverter.php deleted file mode 100644 index 4b5d6d14e9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/VCardConverter.php +++ /dev/null @@ -1,382 +0,0 @@ -getDocumentType(); - if ($inputVersion===$targetVersion) { - return clone $input; - } - - if (!in_array($inputVersion, array(Document::VCARD21, Document::VCARD30, Document::VCARD40))) { - throw new \InvalidArgumentException('Only vCard 2.1, 3.0 and 4.0 are supported for the input data'); - } - if (!in_array($targetVersion, array(Document::VCARD30, Document::VCARD40))) { - throw new \InvalidArgumentException('You can only use vCard 3.0 or 4.0 for the target version'); - } - - $newVersion = $targetVersion===Document::VCARD40?'4.0':'3.0'; - - $output = new Component\VCard(array( - 'VERSION' => $newVersion, - )); - - foreach($input->children as $property) { - - $this->convertProperty($input, $output, $property, $targetVersion); - - } - - return $output; - - } - - /** - * Handles conversion of a single property. - * - * @param Component\VCard $input - * @param Component\VCard $output - * @param Property $property - * @param int $targetVersion - * @return void - */ - protected function convertProperty(Component\VCard $input, Component\VCard $output, Property $property, $targetVersion) { - - // Skipping these, those are automatically added. - if (in_array($property->name, array('VERSION', 'PRODID'))) { - return; - } - - $parameters = $property->parameters(); - - $valueType = null; - if (isset($parameters['VALUE'])) { - $valueType = $parameters['VALUE']->getValue(); - unset($parameters['VALUE']); - } - if (!$valueType) { - $valueType = $property->getValueType(); - } - - $newProperty = null; - - if ($targetVersion===Document::VCARD30) { - - if ($property instanceof Property\Uri && in_array($property->name, array('PHOTO','LOGO','SOUND'))) { - - $newProperty = $this->convertUriToBinary($output, $property, $parameters); - - } elseif ($property->name === 'KIND') { - - switch(strtolower($property->getValue())) { - case 'org' : - // OS X addressbook property. - $newProperty = $output->createProperty('X-ABSHOWAS','COMPANY'); - break; - case 'individual' : - // Individual is implied, so we can just skip it. - return; - - case 'group' : - // OS X addressbook property - $newProperty = $output->createProperty('X-ADDRESSBOOKSERVER-KIND','GROUP'); - break; - } - - - } - - } elseif ($targetVersion===Document::VCARD40) { - - // These properties were removed in vCard 4.0 - if (in_array($property->name, array('NAME', 'MAILER', 'LABEL', 'CLASS'))) { - return; - } - - if ($property instanceOf Property\Binary) { - - $newProperty = $this->convertBinaryToUri($output, $property, $parameters); - - } else { - switch($property->name) { - case 'X-ABSHOWAS' : - if (strtoupper($property->getValue()) === 'COMPANY') { - $newProperty = $output->createProperty('KIND','org'); - } - break; - case 'X-ADDRESSBOOKSERVER-KIND' : - if (strtoupper($property->getValue()) === 'GROUP') { - $newProperty = $output->createProperty('KIND','group'); - } - break; - } - - } - - } - - - if (is_null($newProperty)) { - - $newProperty = $output->createProperty( - $property->name, - $property->getParts(), - array(), // no parameters yet - $valueType - ); - - } - - // set property group - $newProperty->group = $property->group; - - if ($targetVersion===Document::VCARD40) { - $this->convertParameters40($newProperty, $parameters); - } else { - $this->convertParameters30($newProperty, $parameters); - } - - // Lastly, we need to see if there's a need for a VALUE parameter. - // - // We can do that by instantating a empty property with that name, and - // seeing if the default valueType is identical to the current one. - $tempProperty = $output->createProperty($newProperty->name); - if ($tempProperty->getValueType() !== $newProperty->getValueType()) { - $newProperty['VALUE'] = $newProperty->getValueType(); - } - - $output->add($newProperty); - - - } - - /** - * Converts a BINARY property to a URI property. - * - * vCard 4.0 no longer supports BINARY properties. - * - * @param Component\VCard $output - * @param Property\Uri $property The input property. - * @param $parameters List of parameters that will eventually be added to - * the new property. - * @return Property\Uri - */ - protected function convertBinaryToUri(Component\VCard $output, Property\Binary $property, array &$parameters) { - - $newProperty = $output->createProperty( - $property->name, - null, // no value - array(), // no parameters yet - 'URI' // Forcing the BINARY type - ); - - $mimeType = 'application/octet-stream'; - - // See if we can find a better mimetype. - if (isset($parameters['TYPE'])) { - - $newTypes = array(); - foreach($parameters['TYPE']->getParts() as $typePart) { - if (in_array( - strtoupper($typePart), - array('JPEG','PNG','GIF') - )) { - $mimeType = 'image/' . strtolower($typePart); - } else { - $newTypes[] = $typePart; - } - } - - // If there were any parameters we're not converting to a - // mime-type, we need to keep them. - if ($newTypes) { - $parameters['TYPE']->setParts($newTypes); - } else { - unset($parameters['TYPE']); - } - - } - - $newProperty->setValue('data:' . $mimeType . ';base64,' . base64_encode($property->getValue())); - - return $newProperty; - - } - - /** - * Converts a URI property to a BINARY property. - * - * In vCard 4.0 attachments are encoded as data: uri. Even though these may - * be valid in vCard 3.0 as well, we should convert those to BINARY if - * possible, to improve compatibility. - * - * @param Component\VCard $output - * @param Property\Uri $property The input property. - * @param $parameters List of parameters that will eventually be added to - * the new property. - * @return Property\Binary|null - */ - protected function convertUriToBinary(Component\VCard $output, Property\Uri $property, array &$parameters) { - - $value = $property->getValue(); - - // Only converting data: uris - if (substr($value, 0, 5)!=='data:') { - return; - } - - $newProperty = $output->createProperty( - $property->name, - null, // no value - array(), // no parameters yet - 'BINARY' - ); - - $mimeType = substr($value, 5, strpos($value, ',')-5); - if (strpos($mimeType, ';')) { - $mimeType = substr($mimeType,0,strpos($mimeType, ';')); - $newProperty->setValue(base64_decode(substr($value, strpos($value,',')+1))); - } else { - $newProperty->setValue(substr($value, strpos($value,',')+1)); - } - unset($value); - - $newProperty['ENCODING'] = 'b'; - switch($mimeType) { - - case 'image/jpeg' : - $newProperty['TYPE'] = 'JPEG'; - break; - case 'image/png' : - $newProperty['TYPE'] = 'PNG'; - break; - case 'image/gif' : - $newProperty['TYPE'] = 'GIF'; - break; - - } - - - return $newProperty; - - } - - /** - * Adds parameters to a new property for vCard 4.0 - * - * @param Property $newProperty - * @param array $parameters - * @return void - */ - protected function convertParameters40(Property $newProperty, array $parameters) { - - // Adding all parameters. - foreach($parameters as $param) { - - // vCard 2.1 allowed parameters with no name - if ($param->noName) $param->noName = false; - - switch($param->name) { - - // We need to see if there's any TYPE=PREF, because in vCard 4 - // that's now PREF=1. - case 'TYPE' : - foreach($param->getParts() as $paramPart) { - - if (strtoupper($paramPart)==='PREF') { - $newProperty->add('PREF','1'); - } else { - $newProperty->add($param->name, $paramPart); - } - - } - break; - // These no longer exist in vCard 4 - case 'ENCODING' : - case 'CHARSET' : - break; - - default : - $newProperty->add($param->name, $param->getParts()); - break; - - } - - } - - } - - /** - * Adds parameters to a new property for vCard 3.0 - * - * @param Property $newProperty - * @param array $parameters - * @return void - */ - protected function convertParameters30(Property $newProperty, array $parameters) { - - // Adding all parameters. - foreach($parameters as $param) { - - // vCard 2.1 allowed parameters with no name - if ($param->noName) $param->noName = false; - - switch($param->name) { - - case 'ENCODING' : - // This value only existed in vCard 2.1, and should be - // removed for anything else. - if (strtoupper($param->getValue())!=='QUOTED-PRINTABLE') { - $newProperty->add($param->name, $param->getParts()); - } - break; - - /* - * Converting PREF=1 to TYPE=PREF. - * - * Any other PREF numbers we'll drop. - */ - case 'PREF' : - if ($param->getValue()=='1') { - $newProperty->add('TYPE','PREF'); - } - break; - - default : - $newProperty->add($param->name, $param->getParts()); - break; - - } - - } - - } -} diff --git a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Version.php b/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Version.php deleted file mode 100644 index 7628363994..0000000000 --- a/rainloop/v/0.0.0/app/libraries/SabreForRainLoop/VObject/Version.php +++ /dev/null @@ -1,19 +0,0 @@ - - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - diff --git a/rainloop/v/0.0.0/app/libraries/lessphp/README.md b/rainloop/v/0.0.0/app/libraries/lessphp/README.md deleted file mode 100644 index 0085e19d93..0000000000 --- a/rainloop/v/0.0.0/app/libraries/lessphp/README.md +++ /dev/null @@ -1,96 +0,0 @@ -# lessphp v0.3.9 -### - -[![Build Status](https://secure.travis-ci.org/leafo/lessphp.png)](http://travis-ci.org/leafo/lessphp) - -`lessphp` is a compiler for LESS written in PHP. The documentation is great, -so check it out: . - -Here's a quick tutorial: - -### How to use in your PHP project - -The only file required is `lessc.inc.php`, so copy that to your include directory. - -The typical flow of **lessphp** is to create a new instance of `lessc`, -configure it how you like, then tell it to compile something using one built in -compile methods. - -The `compile` method compiles a string of LESS code to CSS. - -```php -compile(".block { padding: 3 + 4px }"); -``` - -The `compileFile` method reads and compiles a file. It will either return the -result or write it to the path specified by an optional second argument. - -```php -compileFile("input.less"); -``` - -The `compileChecked` method is like `compileFile`, but it only compiles if the output -file doesn't exist or it's older than the input file: - -```php -checkedCompile("input.less", "output.css"); -``` - -If there any problem compiling your code, an exception is thrown with a helpful message: - -```php -compile("invalid LESS } {"); -} catch (exception $e) { - echo "fatal error: " . $e->getMessage(); -} -``` - -The `lessc` object can be configured through an assortment of instance methods. -Some possible configuration options include [changing the output format][1], -[setting variables from PHP][2], and [controlling the preservation of -comments][3], writing [custom functions][4] and much more. It's all described -in [the documentation][0]. - - - [0]: http://leafo.net/lessphp/docs/ - [1]: http://leafo.net/lessphp/docs/#output_formatting - [2]: http://leafo.net/lessphp/docs/#setting_variables_from_php - [3]: http://leafo.net/lessphp/docs/#preserving_comments - [4]: http://leafo.net/lessphp/docs/#custom_functions - - -### How to use from the command line - -An additional script has been included to use the compiler from the command -line. In the simplest invocation, you specify an input file and the compiled -css is written to standard out: - - $ plessc input.less > output.css - -Using the -r flag, you can specify LESS code directly as an argument or, if -the argument is left off, from standard in: - - $ plessc -r "my less code here" - -Finally, by using the -w flag you can watch a specified input file and have it -compile as needed to the output file: - - $ plessc -w input-file output-file - -Errors from watch mode are written to standard out. - -The -f flag sets the [output formatter][1]. For example, to compress the -output run this: - - $ plessc -f=compressed myfile.less - -For more help, run `plessc --help` - diff --git a/rainloop/v/0.0.0/app/libraries/lessphp/ctype.php b/rainloop/v/0.0.0/app/libraries/lessphp/ctype.php deleted file mode 100644 index 74a12d147d..0000000000 --- a/rainloop/v/0.0.0/app/libraries/lessphp/ctype.php +++ /dev/null @@ -1,40 +0,0 @@ - - * Licensed under MIT or GPLv3, see LICENSE - */ - - -/** - * The less compiler and parser. - * - * Converting LESS to CSS is a three stage process. The incoming file is parsed - * by `lessc_parser` into a syntax tree, then it is compiled into another tree - * representing the CSS structure by `lessc`. The CSS tree is fed into a - * formatter, like `lessc_formatter` which then outputs CSS as a string. - * - * During the first compile, all values are *reduced*, which means that their - * types are brought to the lowest form before being dump as strings. This - * handles math equations, variable dereferences, and the like. - * - * The `parse` function of `lessc` is the entry point. - * - * In summary: - * - * The `lessc` class creates an intstance of the parser, feeds it LESS code, - * then transforms the resulting tree to a CSS tree. This class also holds the - * evaluation context, such as all available mixins and variables at any given - * time. - * - * The `lessc_parser` class is only concerned with parsing its input. - * - * The `lessc_formatter` takes a CSS tree, and dumps it to a formatted string, - * handling things like indentation. - */ -class lessc { - static public $VERSION = "v0.3.9"; - static protected $TRUE = array("keyword", "true"); - static protected $FALSE = array("keyword", "false"); - - protected $libFunctions = array(); - protected $registeredVars = array(); - protected $preserveComments = false; - - public $vPrefix = '@'; // prefix of abstract properties - public $mPrefix = '$'; // prefix of abstract blocks - public $parentSelector = '&'; - - public $importDisabled = false; - public $importDir = ''; - - protected $numberPrecision = null; - - // set to the parser that generated the current line when compiling - // so we know how to create error messages - protected $sourceParser = null; - protected $sourceLoc = null; - - static public $defaultValue = array("keyword", ""); - - static protected $nextImportId = 0; // uniquely identify imports - - // attempts to find the path of an import url, returns null for css files - protected function findImport($url) { - foreach ((array)$this->importDir as $dir) { - $full = $dir.(substr($dir, -1) != '/' ? '/' : '').$url; - if ($this->fileExists($file = $full.'.less') || $this->fileExists($file = $full)) { - return $file; - } - } - - return null; - } - - protected function fileExists($name) { - return is_file($name); - } - - static public function compressList($items, $delim) { - if (!isset($items[1]) && isset($items[0])) return $items[0]; - else return array('list', $delim, $items); - } - - static public function preg_quote($what) { - return preg_quote($what, '/'); - } - - protected function tryImport($importPath, $parentBlock, $out) { - if ($importPath[0] == "function" && $importPath[1] == "url") { - $importPath = $this->flattenList($importPath[2]); - } - - $str = $this->coerceString($importPath); - if ($str === null) return false; - - $url = $this->compileValue($this->lib_e($str)); - - // don't import if it ends in css - if (substr_compare($url, '.css', -4, 4) === 0) return false; - - $realPath = $this->findImport($url); - if ($realPath === null) return false; - - if ($this->importDisabled) { - return array(false, "/* import disabled */"); - } - - $this->addParsedFile($realPath); - $parser = $this->makeParser($realPath); - $root = $parser->parse(file_get_contents($realPath)); - - // set the parents of all the block props - foreach ($root->props as $prop) { - if ($prop[0] == "block") { - $prop[1]->parent = $parentBlock; - } - } - - // copy mixins into scope, set their parents - // bring blocks from import into current block - // TODO: need to mark the source parser these came from this file - foreach ($root->children as $childName => $child) { - if (isset($parentBlock->children[$childName])) { - $parentBlock->children[$childName] = array_merge( - $parentBlock->children[$childName], - $child); - } else { - $parentBlock->children[$childName] = $child; - } - } - - $pi = pathinfo($realPath); - $dir = $pi["dirname"]; - - list($top, $bottom) = $this->sortProps($root->props, true); - $this->compileImportedProps($top, $parentBlock, $out, $parser, $dir); - - return array(true, $bottom, $parser, $dir); - } - - protected function compileImportedProps($props, $block, $out, $sourceParser, $importDir) { - $oldSourceParser = $this->sourceParser; - - $oldImport = $this->importDir; - - // TODO: this is because the importDir api is stupid - $this->importDir = (array)$this->importDir; - array_unshift($this->importDir, $importDir); - - foreach ($props as $prop) { - $this->compileProp($prop, $block, $out); - } - - $this->importDir = $oldImport; - $this->sourceParser = $oldSourceParser; - } - - /** - * Recursively compiles a block. - * - * A block is analogous to a CSS block in most cases. A single LESS document - * is encapsulated in a block when parsed, but it does not have parent tags - * so all of it's children appear on the root level when compiled. - * - * Blocks are made up of props and children. - * - * Props are property instructions, array tuples which describe an action - * to be taken, eg. write a property, set a variable, mixin a block. - * - * The children of a block are just all the blocks that are defined within. - * This is used to look up mixins when performing a mixin. - * - * Compiling the block involves pushing a fresh environment on the stack, - * and iterating through the props, compiling each one. - * - * See lessc::compileProp() - * - */ - protected function compileBlock($block) { - switch ($block->type) { - case "root": - $this->compileRoot($block); - break; - case null: - $this->compileCSSBlock($block); - break; - case "media": - $this->compileMedia($block); - break; - case "directive": - $name = "@" . $block->name; - if (!empty($block->value)) { - $name .= " " . $this->compileValue($this->reduce($block->value)); - } - - $this->compileNestedBlock($block, array($name)); - break; - default: - $this->throwError("unknown block type: $block->type\n"); - } - } - - protected function compileCSSBlock($block) { - $env = $this->pushEnv(); - - $selectors = $this->compileSelectors($block->tags); - $env->selectors = $this->multiplySelectors($selectors); - $out = $this->makeOutputBlock(null, $env->selectors); - - $this->scope->children[] = $out; - $this->compileProps($block, $out); - - $block->scope = $env; // mixins carry scope with them! - $this->popEnv(); - } - - protected function compileMedia($media) { - $env = $this->pushEnv($media); - $parentScope = $this->mediaParent($this->scope); - - $query = $this->compileMediaQuery($this->multiplyMedia($env)); - - $this->scope = $this->makeOutputBlock($media->type, array($query)); - $parentScope->children[] = $this->scope; - - $this->compileProps($media, $this->scope); - - if (count($this->scope->lines) > 0) { - $orphanSelelectors = $this->findClosestSelectors(); - if (!is_null($orphanSelelectors)) { - $orphan = $this->makeOutputBlock(null, $orphanSelelectors); - $orphan->lines = $this->scope->lines; - array_unshift($this->scope->children, $orphan); - $this->scope->lines = array(); - } - } - - $this->scope = $this->scope->parent; - $this->popEnv(); - } - - protected function mediaParent($scope) { - while (!empty($scope->parent)) { - if (!empty($scope->type) && $scope->type != "media") { - break; - } - $scope = $scope->parent; - } - - return $scope; - } - - protected function compileNestedBlock($block, $selectors) { - $this->pushEnv($block); - $this->scope = $this->makeOutputBlock($block->type, $selectors); - $this->scope->parent->children[] = $this->scope; - - $this->compileProps($block, $this->scope); - - $this->scope = $this->scope->parent; - $this->popEnv(); - } - - protected function compileRoot($root) { - $this->pushEnv(); - $this->scope = $this->makeOutputBlock($root->type); - $this->compileProps($root, $this->scope); - $this->popEnv(); - } - - protected function compileProps($block, $out) { - foreach ($this->sortProps($block->props) as $prop) { - $this->compileProp($prop, $block, $out); - } - } - - protected function sortProps($props, $split = false) { - $vars = array(); - $imports = array(); - $other = array(); - - foreach ($props as $prop) { - switch ($prop[0]) { - case "assign": - if (isset($prop[1][0]) && $prop[1][0] == $this->vPrefix) { - $vars[] = $prop; - } else { - $other[] = $prop; - } - break; - case "import": - $id = self::$nextImportId++; - $prop[] = $id; - $imports[] = $prop; - $other[] = array("import_mixin", $id); - break; - default: - $other[] = $prop; - } - } - - if ($split) { - return array(array_merge($vars, $imports), $other); - } else { - return array_merge($vars, $imports, $other); - } - } - - protected function compileMediaQuery($queries) { - $compiledQueries = array(); - foreach ($queries as $query) { - $parts = array(); - foreach ($query as $q) { - switch ($q[0]) { - case "mediaType": - $parts[] = implode(" ", array_slice($q, 1)); - break; - case "mediaExp": - if (isset($q[2])) { - $parts[] = "($q[1]: " . - $this->compileValue($this->reduce($q[2])) . ")"; - } else { - $parts[] = "($q[1])"; - } - break; - case "variable": - $parts[] = $this->compileValue($this->reduce($q)); - break; - } - } - - if (count($parts) > 0) { - $compiledQueries[] = implode(" and ", $parts); - } - } - - $out = "@media"; - if (!empty($parts)) { - $out .= " " . - implode($this->formatter->selectorSeparator, $compiledQueries); - } - return $out; - } - - protected function multiplyMedia($env, $childQueries = null) { - if (is_null($env) || - !empty($env->block->type) && $env->block->type != "media") - { - return $childQueries; - } - - // plain old block, skip - if (empty($env->block->type)) { - return $this->multiplyMedia($env->parent, $childQueries); - } - - $out = array(); - $queries = $env->block->queries; - if (is_null($childQueries)) { - $out = $queries; - } else { - foreach ($queries as $parent) { - foreach ($childQueries as $child) { - $out[] = array_merge($parent, $child); - } - } - } - - return $this->multiplyMedia($env->parent, $out); - } - - protected function expandParentSelectors(&$tag, $replace) { - $parts = explode("$&$", $tag); - $count = 0; - foreach ($parts as &$part) { - $part = str_replace($this->parentSelector, $replace, $part, $c); - $count += $c; - } - $tag = implode($this->parentSelector, $parts); - return $count; - } - - protected function findClosestSelectors() { - $env = $this->env; - $selectors = null; - while ($env !== null) { - if (isset($env->selectors)) { - $selectors = $env->selectors; - break; - } - $env = $env->parent; - } - - return $selectors; - } - - - // multiply $selectors against the nearest selectors in env - protected function multiplySelectors($selectors) { - // find parent selectors - - $parentSelectors = $this->findClosestSelectors(); - if (is_null($parentSelectors)) { - // kill parent reference in top level selector - foreach ($selectors as &$s) { - $this->expandParentSelectors($s, ""); - } - - return $selectors; - } - - $out = array(); - foreach ($parentSelectors as $parent) { - foreach ($selectors as $child) { - $count = $this->expandParentSelectors($child, $parent); - - // don't prepend the parent tag if & was used - if ($count > 0) { - $out[] = trim($child); - } else { - $out[] = trim($parent . ' ' . $child); - } - } - } - - return $out; - } - - // reduces selector expressions - protected function compileSelectors($selectors) { - $out = array(); - - foreach ($selectors as $s) { - if (is_array($s)) { - list(, $value) = $s; - $out[] = trim($this->compileValue($this->reduce($value))); - } else { - $out[] = $s; - } - } - - return $out; - } - - protected function eq($left, $right) { - return $left == $right; - } - - protected function patternMatch($block, $callingArgs) { - // match the guards if it has them - // any one of the groups must have all its guards pass for a match - if (!empty($block->guards)) { - $groupPassed = false; - foreach ($block->guards as $guardGroup) { - foreach ($guardGroup as $guard) { - $this->pushEnv(); - $this->zipSetArgs($block->args, $callingArgs); - - $negate = false; - if ($guard[0] == "negate") { - $guard = $guard[1]; - $negate = true; - } - - $passed = $this->reduce($guard) == self::$TRUE; - if ($negate) $passed = !$passed; - - $this->popEnv(); - - if ($passed) { - $groupPassed = true; - } else { - $groupPassed = false; - break; - } - } - - if ($groupPassed) break; - } - - if (!$groupPassed) { - return false; - } - } - - $numCalling = count($callingArgs); - - if (empty($block->args)) { - return $block->isVararg || $numCalling == 0; - } - - $i = -1; // no args - // try to match by arity or by argument literal - foreach ($block->args as $i => $arg) { - switch ($arg[0]) { - case "lit": - if (empty($callingArgs[$i]) || !$this->eq($arg[1], $callingArgs[$i])) { - return false; - } - break; - case "arg": - // no arg and no default value - if (!isset($callingArgs[$i]) && !isset($arg[2])) { - return false; - } - break; - case "rest": - $i--; // rest can be empty - break 2; - } - } - - if ($block->isVararg) { - return true; // not having enough is handled above - } else { - $numMatched = $i + 1; - // greater than becuase default values always match - return $numMatched >= $numCalling; - } - } - - protected function patternMatchAll($blocks, $callingArgs) { - $matches = null; - foreach ($blocks as $block) { - if ($this->patternMatch($block, $callingArgs)) { - $matches[] = $block; - } - } - - return $matches; - } - - // attempt to find blocks matched by path and args - protected function findBlocks($searchIn, $path, $args, $seen=array()) { - if ($searchIn == null) return null; - if (isset($seen[$searchIn->id])) return null; - $seen[$searchIn->id] = true; - - $name = $path[0]; - - if (isset($searchIn->children[$name])) { - $blocks = $searchIn->children[$name]; - if (count($path) == 1) { - $matches = $this->patternMatchAll($blocks, $args); - if (!empty($matches)) { - // This will return all blocks that match in the closest - // scope that has any matching block, like lessjs - return $matches; - } - } else { - $matches = array(); - foreach ($blocks as $subBlock) { - $subMatches = $this->findBlocks($subBlock, - array_slice($path, 1), $args, $seen); - - if (!is_null($subMatches)) { - foreach ($subMatches as $sm) { - $matches[] = $sm; - } - } - } - - return count($matches) > 0 ? $matches : null; - } - } - - if ($searchIn->parent === $searchIn) return null; - return $this->findBlocks($searchIn->parent, $path, $args, $seen); - } - - // sets all argument names in $args to either the default value - // or the one passed in through $values - protected function zipSetArgs($args, $values) { - $i = 0; - $assignedValues = array(); - foreach ($args as $a) { - if ($a[0] == "arg") { - if ($i < count($values) && !is_null($values[$i])) { - $value = $values[$i]; - } elseif (isset($a[2])) { - $value = $a[2]; - } else $value = null; - - $value = $this->reduce($value); - $this->set($a[1], $value); - $assignedValues[] = $value; - } - $i++; - } - - // check for a rest - $last = end($args); - if ($last[0] == "rest") { - $rest = array_slice($values, count($args) - 1); - $this->set($last[1], $this->reduce(array("list", " ", $rest))); - } - - $this->env->arguments = $assignedValues; - } - - // compile a prop and update $lines or $blocks appropriately - protected function compileProp($prop, $block, $out) { - // set error position context - $this->sourceLoc = isset($prop[-1]) ? $prop[-1] : -1; - - switch ($prop[0]) { - case 'assign': - list(, $name, $value) = $prop; - if ($name[0] == $this->vPrefix) { - $this->set($name, $value); - } else { - $out->lines[] = $this->formatter->property($name, - $this->compileValue($this->reduce($value))); - } - break; - case 'block': - list(, $child) = $prop; - $this->compileBlock($child); - break; - case 'mixin': - list(, $path, $args, $suffix) = $prop; - - $args = array_map(array($this, "reduce"), (array)$args); - $mixins = $this->findBlocks($block, $path, $args); - - if ($mixins === null) { - // fwrite(STDERR,"failed to find block: ".implode(" > ", $path)."\n"); - break; // throw error here?? - } - - foreach ($mixins as $mixin) { - $haveScope = false; - if (isset($mixin->parent->scope)) { - $haveScope = true; - $mixinParentEnv = $this->pushEnv(); - $mixinParentEnv->storeParent = $mixin->parent->scope; - } - - $haveArgs = false; - if (isset($mixin->args)) { - $haveArgs = true; - $this->pushEnv(); - $this->zipSetArgs($mixin->args, $args); - } - - $oldParent = $mixin->parent; - if ($mixin != $block) $mixin->parent = $block; - - foreach ($this->sortProps($mixin->props) as $subProp) { - if ($suffix !== null && - $subProp[0] == "assign" && - is_string($subProp[1]) && - $subProp[1]{0} != $this->vPrefix) - { - $subProp[2] = array( - 'list', ' ', - array($subProp[2], array('keyword', $suffix)) - ); - } - - $this->compileProp($subProp, $mixin, $out); - } - - $mixin->parent = $oldParent; - - if ($haveArgs) $this->popEnv(); - if ($haveScope) $this->popEnv(); - } - - break; - case 'raw': - $out->lines[] = $prop[1]; - break; - case "directive": - list(, $name, $value) = $prop; - $out->lines[] = "@$name " . $this->compileValue($this->reduce($value)).';'; - break; - case "comment": - $out->lines[] = $prop[1]; - break; - case "import"; - list(, $importPath, $importId) = $prop; - $importPath = $this->reduce($importPath); - - if (!isset($this->env->imports)) { - $this->env->imports = array(); - } - - $result = $this->tryImport($importPath, $block, $out); - - $this->env->imports[$importId] = $result === false ? - array(false, "@import " . $this->compileValue($importPath).";") : - $result; - - break; - case "import_mixin": - list(,$importId) = $prop; - $import = $this->env->imports[$importId]; - if ($import[0] === false) { - $out->lines[] = $import[1]; - } else { - list(, $bottom, $parser, $importDir) = $import; - $this->compileImportedProps($bottom, $block, $out, $parser, $importDir); - } - - break; - default: - $this->throwError("unknown op: {$prop[0]}\n"); - } - } - - - /** - * Compiles a primitive value into a CSS property value. - * - * Values in lessphp are typed by being wrapped in arrays, their format is - * typically: - * - * array(type, contents [, additional_contents]*) - * - * The input is expected to be reduced. This function will not work on - * things like expressions and variables. - */ - protected function compileValue($value) { - switch ($value[0]) { - case 'list': - // [1] - delimiter - // [2] - array of values - return implode($value[1], array_map(array($this, 'compileValue'), $value[2])); - case 'raw_color': - if (!empty($this->formatter->compressColors)) { - return $this->compileValue($this->coerceColor($value)); - } - return $value[1]; - case 'keyword': - // [1] - the keyword - return $value[1]; - case 'number': - list(, $num, $unit) = $value; - // [1] - the number - // [2] - the unit - if ($this->numberPrecision !== null) { - $num = round($num, $this->numberPrecision); - } - return $num . $unit; - case 'string': - // [1] - contents of string (includes quotes) - list(, $delim, $content) = $value; - foreach ($content as &$part) { - if (is_array($part)) { - $part = $this->compileValue($part); - } - } - return $delim . implode($content) . $delim; - case 'color': - // [1] - red component (either number or a %) - // [2] - green component - // [3] - blue component - // [4] - optional alpha component - list(, $r, $g, $b) = $value; - $r = round($r); - $g = round($g); - $b = round($b); - - if (count($value) == 5 && $value[4] != 1) { // rgba - return 'rgba('.$r.','.$g.','.$b.','.$value[4].')'; - } - - $h = sprintf("#%02x%02x%02x", $r, $g, $b); - - if (!empty($this->formatter->compressColors)) { - // Converting hex color to short notation (e.g. #003399 to #039) - if ($h[1] === $h[2] && $h[3] === $h[4] && $h[5] === $h[6]) { - $h = '#' . $h[1] . $h[3] . $h[5]; - } - } - - return $h; - - case 'function': - list(, $name, $args) = $value; - return $name.'('.$this->compileValue($args).')'; - default: // assumed to be unit - $this->throwError("unknown value type: $value[0]"); - } - } - - protected function lib_isnumber($value) { - return $this->toBool($value[0] == "number"); - } - - protected function lib_isstring($value) { - return $this->toBool($value[0] == "string"); - } - - protected function lib_iscolor($value) { - return $this->toBool($this->coerceColor($value)); - } - - protected function lib_iskeyword($value) { - return $this->toBool($value[0] == "keyword"); - } - - protected function lib_ispixel($value) { - return $this->toBool($value[0] == "number" && $value[2] == "px"); - } - - protected function lib_ispercentage($value) { - return $this->toBool($value[0] == "number" && $value[2] == "%"); - } - - protected function lib_isem($value) { - return $this->toBool($value[0] == "number" && $value[2] == "em"); - } - - protected function lib_isrem($value) { - return $this->toBool($value[0] == "number" && $value[2] == "rem"); - } - - protected function lib_rgbahex($color) { - $color = $this->coerceColor($color); - if (is_null($color)) - $this->throwError("color expected for rgbahex"); - - return sprintf("#%02x%02x%02x%02x", - isset($color[4]) ? $color[4]*255 : 255, - $color[1],$color[2], $color[3]); - } - - protected function lib_argb($color){ - return $this->lib_rgbahex($color); - } - - // utility func to unquote a string - protected function lib_e($arg) { - switch ($arg[0]) { - case "list": - $items = $arg[2]; - if (isset($items[0])) { - return $this->lib_e($items[0]); - } - return self::$defaultValue; - case "string": - $arg[1] = ""; - return $arg; - case "keyword": - return $arg; - default: - return array("keyword", $this->compileValue($arg)); - } - } - - protected function lib__sprintf($args) { - if ($args[0] != "list") return $args; - $values = $args[2]; - $string = array_shift($values); - $template = $this->compileValue($this->lib_e($string)); - - $i = 0; - if (preg_match_all('/%[dsa]/', $template, $m)) { - foreach ($m[0] as $match) { - $val = isset($values[$i]) ? - $this->reduce($values[$i]) : array('keyword', ''); - - // lessjs compat, renders fully expanded color, not raw color - if ($color = $this->coerceColor($val)) { - $val = $color; - } - - $i++; - $rep = $this->compileValue($this->lib_e($val)); - $template = preg_replace('/'.self::preg_quote($match).'/', - $rep, $template, 1); - } - } - - $d = $string[0] == "string" ? $string[1] : '"'; - return array("string", $d, array($template)); - } - - protected function lib_floor($arg) { - $value = $this->assertNumber($arg); - return array("number", floor($value), $arg[2]); - } - - protected function lib_ceil($arg) { - $value = $this->assertNumber($arg); - return array("number", ceil($value), $arg[2]); - } - - protected function lib_round($arg) { - $value = $this->assertNumber($arg); - return array("number", round($value), $arg[2]); - } - - protected function lib_unit($arg) { - if ($arg[0] == "list") { - list($number, $newUnit) = $arg[2]; - return array("number", $this->assertNumber($number), - $this->compileValue($this->lib_e($newUnit))); - } else { - return array("number", $this->assertNumber($arg), ""); - } - } - - /** - * Helper function to get arguments for color manipulation functions. - * takes a list that contains a color like thing and a percentage - */ - protected function colorArgs($args) { - if ($args[0] != 'list' || count($args[2]) < 2) { - return array(array('color', 0, 0, 0), 0); - } - list($color, $delta) = $args[2]; - $color = $this->assertColor($color); - $delta = floatval($delta[1]); - - return array($color, $delta); - } - - protected function lib_darken($args) { - list($color, $delta) = $this->colorArgs($args); - - $hsl = $this->toHSL($color); - $hsl[3] = $this->clamp($hsl[3] - $delta, 100); - return $this->toRGB($hsl); - } - - protected function lib_lighten($args) { - list($color, $delta) = $this->colorArgs($args); - - $hsl = $this->toHSL($color); - $hsl[3] = $this->clamp($hsl[3] + $delta, 100); - return $this->toRGB($hsl); - } - - protected function lib_saturate($args) { - list($color, $delta) = $this->colorArgs($args); - - $hsl = $this->toHSL($color); - $hsl[2] = $this->clamp($hsl[2] + $delta, 100); - return $this->toRGB($hsl); - } - - protected function lib_desaturate($args) { - list($color, $delta) = $this->colorArgs($args); - - $hsl = $this->toHSL($color); - $hsl[2] = $this->clamp($hsl[2] - $delta, 100); - return $this->toRGB($hsl); - } - - protected function lib_spin($args) { - list($color, $delta) = $this->colorArgs($args); - - $hsl = $this->toHSL($color); - - $hsl[1] = $hsl[1] + $delta % 360; - if ($hsl[1] < 0) $hsl[1] += 360; - - return $this->toRGB($hsl); - } - - protected function lib_fadeout($args) { - list($color, $delta) = $this->colorArgs($args); - $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) - $delta/100); - return $color; - } - - protected function lib_fadein($args) { - list($color, $delta) = $this->colorArgs($args); - $color[4] = $this->clamp((isset($color[4]) ? $color[4] : 1) + $delta/100); - return $color; - } - - protected function lib_hue($color) { - $hsl = $this->toHSL($this->assertColor($color)); - return round($hsl[1]); - } - - protected function lib_saturation($color) { - $hsl = $this->toHSL($this->assertColor($color)); - return round($hsl[2]); - } - - protected function lib_lightness($color) { - $hsl = $this->toHSL($this->assertColor($color)); - return round($hsl[3]); - } - - // get the alpha of a color - // defaults to 1 for non-colors or colors without an alpha - protected function lib_alpha($value) { - if (!is_null($color = $this->coerceColor($value))) { - return isset($color[4]) ? $color[4] : 1; - } - } - - // set the alpha of the color - protected function lib_fade($args) { - list($color, $alpha) = $this->colorArgs($args); - $color[4] = $this->clamp($alpha / 100.0); - return $color; - } - - protected function lib_percentage($arg) { - $num = $this->assertNumber($arg); - return array("number", $num*100, "%"); - } - - // mixes two colors by weight - // mix(@color1, @color2, @weight); - // http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html#mix-instance_method - protected function lib_mix($args) { - if ($args[0] != "list" || count($args[2]) < 3) - $this->throwError("mix expects (color1, color2, weight)"); - - list($first, $second, $weight) = $args[2]; - $first = $this->assertColor($first); - $second = $this->assertColor($second); - - $first_a = $this->lib_alpha($first); - $second_a = $this->lib_alpha($second); - $weight = $weight[1] / 100.0; - - $w = $weight * 2 - 1; - $a = $first_a - $second_a; - - $w1 = (($w * $a == -1 ? $w : ($w + $a)/(1 + $w * $a)) + 1) / 2.0; - $w2 = 1.0 - $w1; - - $new = array('color', - $w1 * $first[1] + $w2 * $second[1], - $w1 * $first[2] + $w2 * $second[2], - $w1 * $first[3] + $w2 * $second[3], - ); - - if ($first_a != 1.0 || $second_a != 1.0) { - $new[] = $first_a * $weight + $second_a * ($weight - 1); - } - - return $this->fixColor($new); - } - - protected function lib_contrast($args) { - if ($args[0] != 'list' || count($args[2]) < 3) { - return array(array('color', 0, 0, 0), 0); - } - - list($inputColor, $darkColor, $lightColor) = $args[2]; - - $inputColor = $this->assertColor($inputColor); - $darkColor = $this->assertColor($darkColor); - $lightColor = $this->assertColor($lightColor); - $hsl = $this->toHSL($inputColor); - - if ($hsl[3] > 50) { - return $darkColor; - } - - return $lightColor; - } - - protected function assertColor($value, $error = "expected color value") { - $color = $this->coerceColor($value); - if (is_null($color)) $this->throwError($error); - return $color; - } - - protected function assertNumber($value, $error = "expecting number") { - if ($value[0] == "number") return $value[1]; - $this->throwError($error); - } - - protected function toHSL($color) { - if ($color[0] == 'hsl') return $color; - - $r = $color[1] / 255; - $g = $color[2] / 255; - $b = $color[3] / 255; - - $min = min($r, $g, $b); - $max = max($r, $g, $b); - - $L = ($min + $max) / 2; - if ($min == $max) { - $S = $H = 0; - } else { - if ($L < 0.5) - $S = ($max - $min)/($max + $min); - else - $S = ($max - $min)/(2.0 - $max - $min); - - if ($r == $max) $H = ($g - $b)/($max - $min); - elseif ($g == $max) $H = 2.0 + ($b - $r)/($max - $min); - elseif ($b == $max) $H = 4.0 + ($r - $g)/($max - $min); - - } - - $out = array('hsl', - ($H < 0 ? $H + 6 : $H)*60, - $S*100, - $L*100, - ); - - if (count($color) > 4) $out[] = $color[4]; // copy alpha - return $out; - } - - protected function toRGB_helper($comp, $temp1, $temp2) { - if ($comp < 0) $comp += 1.0; - elseif ($comp > 1) $comp -= 1.0; - - if (6 * $comp < 1) return $temp1 + ($temp2 - $temp1) * 6 * $comp; - if (2 * $comp < 1) return $temp2; - if (3 * $comp < 2) return $temp1 + ($temp2 - $temp1)*((2/3) - $comp) * 6; - - return $temp1; - } - - /** - * Converts a hsl array into a color value in rgb. - * Expects H to be in range of 0 to 360, S and L in 0 to 100 - */ - protected function toRGB($color) { - if ($color[0] == 'color') return $color; - - $H = $color[1] / 360; - $S = $color[2] / 100; - $L = $color[3] / 100; - - if ($S == 0) { - $r = $g = $b = $L; - } else { - $temp2 = $L < 0.5 ? - $L*(1.0 + $S) : - $L + $S - $L * $S; - - $temp1 = 2.0 * $L - $temp2; - - $r = $this->toRGB_helper($H + 1/3, $temp1, $temp2); - $g = $this->toRGB_helper($H, $temp1, $temp2); - $b = $this->toRGB_helper($H - 1/3, $temp1, $temp2); - } - - // $out = array('color', round($r*255), round($g*255), round($b*255)); - $out = array('color', $r*255, $g*255, $b*255); - if (count($color) > 4) $out[] = $color[4]; // copy alpha - return $out; - } - - protected function clamp($v, $max = 1, $min = 0) { - return min($max, max($min, $v)); - } - - /** - * Convert the rgb, rgba, hsl color literals of function type - * as returned by the parser into values of color type. - */ - protected function funcToColor($func) { - $fname = $func[1]; - if ($func[2][0] != 'list') return false; // need a list of arguments - $rawComponents = $func[2][2]; - - if ($fname == 'hsl' || $fname == 'hsla') { - $hsl = array('hsl'); - $i = 0; - foreach ($rawComponents as $c) { - $val = $this->reduce($c); - $val = isset($val[1]) ? floatval($val[1]) : 0; - - if ($i == 0) $clamp = 360; - elseif ($i < 3) $clamp = 100; - else $clamp = 1; - - $hsl[] = $this->clamp($val, $clamp); - $i++; - } - - while (count($hsl) < 4) $hsl[] = 0; - return $this->toRGB($hsl); - - } elseif ($fname == 'rgb' || $fname == 'rgba') { - $components = array(); - $i = 1; - foreach ($rawComponents as $c) { - $c = $this->reduce($c); - if ($i < 4) { - if ($c[0] == "number" && $c[2] == "%") { - $components[] = 255 * ($c[1] / 100); - } else { - $components[] = floatval($c[1]); - } - } elseif ($i == 4) { - if ($c[0] == "number" && $c[2] == "%") { - $components[] = 1.0 * ($c[1] / 100); - } else { - $components[] = floatval($c[1]); - } - } else break; - - $i++; - } - while (count($components) < 3) $components[] = 0; - array_unshift($components, 'color'); - return $this->fixColor($components); - } - - return false; - } - - protected function reduce($value, $forExpression = false) { - switch ($value[0]) { - case "interpolate": - $reduced = $this->reduce($value[1]); - $var = $this->compileValue($reduced); - $res = $this->reduce(array("variable", $this->vPrefix . $var)); - - if (empty($value[2])) $res = $this->lib_e($res); - - return $res; - case "variable": - $key = $value[1]; - if (is_array($key)) { - $key = $this->reduce($key); - $key = $this->vPrefix . $this->compileValue($this->lib_e($key)); - } - - $seen =& $this->env->seenNames; - - if (!empty($seen[$key])) { - $this->throwError("infinite loop detected: $key"); - } - - $seen[$key] = true; - $out = $this->reduce($this->get($key, self::$defaultValue)); - $seen[$key] = false; - return $out; - case "list": - foreach ($value[2] as &$item) { - $item = $this->reduce($item, $forExpression); - } - return $value; - case "expression": - return $this->evaluate($value); - case "string": - foreach ($value[2] as &$part) { - if (is_array($part)) { - $strip = $part[0] == "variable"; - $part = $this->reduce($part); - if ($strip) $part = $this->lib_e($part); - } - } - return $value; - case "escape": - list(,$inner) = $value; - return $this->lib_e($this->reduce($inner)); - case "function": - $color = $this->funcToColor($value); - if ($color) return $color; - - list(, $name, $args) = $value; - if ($name == "%") $name = "_sprintf"; - $f = isset($this->libFunctions[$name]) ? - $this->libFunctions[$name] : array($this, 'lib_'.$name); - - if (is_callable($f)) { - if ($args[0] == 'list') - $args = self::compressList($args[2], $args[1]); - - $ret = call_user_func($f, $this->reduce($args, true), $this); - - if (is_null($ret)) { - return array("string", "", array( - $name, "(", $args, ")" - )); - } - - // convert to a typed value if the result is a php primitive - if (is_numeric($ret)) $ret = array('number', $ret, ""); - elseif (!is_array($ret)) $ret = array('keyword', $ret); - - return $ret; - } - - // plain function, reduce args - $value[2] = $this->reduce($value[2]); - return $value; - case "unary": - list(, $op, $exp) = $value; - $exp = $this->reduce($exp); - - if ($exp[0] == "number") { - switch ($op) { - case "+": - return $exp; - case "-": - $exp[1] *= -1; - return $exp; - } - } - return array("string", "", array($op, $exp)); - } - - if ($forExpression) { - switch ($value[0]) { - case "keyword": - if ($color = $this->coerceColor($value)) { - return $color; - } - break; - case "raw_color": - return $this->coerceColor($value); - } - } - - return $value; - } - - - // coerce a value for use in color operation - protected function coerceColor($value) { - switch($value[0]) { - case 'color': return $value; - case 'raw_color': - $c = array("color", 0, 0, 0); - $colorStr = substr($value[1], 1); - $num = hexdec($colorStr); - $width = strlen($colorStr) == 3 ? 16 : 256; - - for ($i = 3; $i > 0; $i--) { // 3 2 1 - $t = $num % $width; - $num /= $width; - - $c[$i] = $t * (256/$width) + $t * floor(16/$width); - } - - return $c; - case 'keyword': - $name = $value[1]; - if (isset(self::$cssColors[$name])) { - $rgba = explode(',', self::$cssColors[$name]); - - if(isset($rgba[3])) - return array('color', $rgba[0], $rgba[1], $rgba[2], $rgba[3]); - - return array('color', $rgba[0], $rgba[1], $rgba[2]); - } - return null; - } - } - - // make something string like into a string - protected function coerceString($value) { - switch ($value[0]) { - case "string": - return $value; - case "keyword": - return array("string", "", array($value[1])); - } - return null; - } - - // turn list of length 1 into value type - protected function flattenList($value) { - if ($value[0] == "list" && count($value[2]) == 1) { - return $this->flattenList($value[2][0]); - } - return $value; - } - - protected function toBool($a) { - if ($a) return self::$TRUE; - else return self::$FALSE; - } - - // evaluate an expression - protected function evaluate($exp) { - list(, $op, $left, $right, $whiteBefore, $whiteAfter) = $exp; - - $left = $this->reduce($left, true); - $right = $this->reduce($right, true); - - if ($leftColor = $this->coerceColor($left)) { - $left = $leftColor; - } - - if ($rightColor = $this->coerceColor($right)) { - $right = $rightColor; - } - - $ltype = $left[0]; - $rtype = $right[0]; - - // operators that work on all types - if ($op == "and") { - return $this->toBool($left == self::$TRUE && $right == self::$TRUE); - } - - if ($op == "=") { - return $this->toBool($this->eq($left, $right) ); - } - - if ($op == "+" && !is_null($str = $this->stringConcatenate($left, $right))) { - return $str; - } - - // type based operators - $fname = "op_${ltype}_${rtype}"; - if (is_callable(array($this, $fname))) { - $out = $this->$fname($op, $left, $right); - if (!is_null($out)) return $out; - } - - // make the expression look it did before being parsed - $paddedOp = $op; - if ($whiteBefore) $paddedOp = " " . $paddedOp; - if ($whiteAfter) $paddedOp .= " "; - - return array("string", "", array($left, $paddedOp, $right)); - } - - protected function stringConcatenate($left, $right) { - if ($strLeft = $this->coerceString($left)) { - if ($right[0] == "string") { - $right[1] = ""; - } - $strLeft[2][] = $right; - return $strLeft; - } - - if ($strRight = $this->coerceString($right)) { - array_unshift($strRight[2], $left); - return $strRight; - } - } - - - // make sure a color's components don't go out of bounds - protected function fixColor($c) { - foreach (range(1, 3) as $i) { - if ($c[$i] < 0) $c[$i] = 0; - if ($c[$i] > 255) $c[$i] = 255; - } - - return $c; - } - - protected function op_number_color($op, $lft, $rgt) { - if ($op == '+' || $op == '*') { - return $this->op_color_number($op, $rgt, $lft); - } - } - - protected function op_color_number($op, $lft, $rgt) { - if ($rgt[0] == '%') $rgt[1] /= 100; - - return $this->op_color_color($op, $lft, - array_fill(1, count($lft) - 1, $rgt[1])); - } - - protected function op_color_color($op, $left, $right) { - $out = array('color'); - $max = count($left) > count($right) ? count($left) : count($right); - foreach (range(1, $max - 1) as $i) { - $lval = isset($left[$i]) ? $left[$i] : 0; - $rval = isset($right[$i]) ? $right[$i] : 0; - switch ($op) { - case '+': - $out[] = $lval + $rval; - break; - case '-': - $out[] = $lval - $rval; - break; - case '*': - $out[] = $lval * $rval; - break; - case '%': - $out[] = $lval % $rval; - break; - case '/': - if ($rval == 0) $this->throwError("evaluate error: can't divide by zero"); - $out[] = $lval / $rval; - break; - default: - $this->throwError('evaluate error: color op number failed on op '.$op); - } - } - return $this->fixColor($out); - } - - function lib_red($color){ - $color = $this->coerceColor($color); - if (is_null($color)) { - $this->throwError('color expected for red()'); - } - - return $color[1]; - } - - function lib_green($color){ - $color = $this->coerceColor($color); - if (is_null($color)) { - $this->throwError('color expected for green()'); - } - - return $color[2]; - } - - function lib_blue($color){ - $color = $this->coerceColor($color); - if (is_null($color)) { - $this->throwError('color expected for blue()'); - } - - return $color[3]; - } - - - // operator on two numbers - protected function op_number_number($op, $left, $right) { - $unit = empty($left[2]) ? $right[2] : $left[2]; - - $value = 0; - switch ($op) { - case '+': - $value = $left[1] + $right[1]; - break; - case '*': - $value = $left[1] * $right[1]; - break; - case '-': - $value = $left[1] - $right[1]; - break; - case '%': - $value = $left[1] % $right[1]; - break; - case '/': - if ($right[1] == 0) $this->throwError('parse error: divide by zero'); - $value = $left[1] / $right[1]; - break; - case '<': - return $this->toBool($left[1] < $right[1]); - case '>': - return $this->toBool($left[1] > $right[1]); - case '>=': - return $this->toBool($left[1] >= $right[1]); - case '=<': - return $this->toBool($left[1] <= $right[1]); - default: - $this->throwError('parse error: unknown number operator: '.$op); - } - - return array("number", $value, $unit); - } - - - /* environment functions */ - - protected function makeOutputBlock($type, $selectors = null) { - $b = new stdclass; - $b->lines = array(); - $b->children = array(); - $b->selectors = $selectors; - $b->type = $type; - $b->parent = $this->scope; - return $b; - } - - // the state of execution - protected function pushEnv($block = null) { - $e = new stdclass; - $e->parent = $this->env; - $e->store = array(); - $e->block = $block; - - $this->env = $e; - return $e; - } - - // pop something off the stack - protected function popEnv() { - $old = $this->env; - $this->env = $this->env->parent; - return $old; - } - - // set something in the current env - protected function set($name, $value) { - $this->env->store[$name] = $value; - } - - - // get the highest occurrence entry for a name - protected function get($name, $default=null) { - $current = $this->env; - - $isArguments = $name == $this->vPrefix . 'arguments'; - while ($current) { - if ($isArguments && isset($current->arguments)) { - return array('list', ' ', $current->arguments); - } - - if (isset($current->store[$name])) - return $current->store[$name]; - else { - $current = isset($current->storeParent) ? - $current->storeParent : $current->parent; - } - } - - return $default; - } - - // inject array of unparsed strings into environment as variables - protected function injectVariables($args) { - $this->pushEnv(); - $parser = new lessc_parser($this, __METHOD__); - foreach ($args as $name => $strValue) { - if ($name{0} != '@') $name = '@'.$name; - $parser->count = 0; - $parser->buffer = (string)$strValue; - if (!$parser->propertyValue($value)) { - throw new Exception("failed to parse passed in variable $name: $strValue"); - } - - $this->set($name, $value); - } - } - - /** - * Initialize any static state, can initialize parser for a file - * $opts isn't used yet - */ - public function __construct($fname = null) { - if ($fname !== null) { - // used for deprecated parse method - $this->_parseFile = $fname; - } - } - - public function compile($string, $name = null) { - $locale = setlocale(LC_NUMERIC, 0); - setlocale(LC_NUMERIC, "C"); - - $this->parser = $this->makeParser($name); - $root = $this->parser->parse($string); - - $this->env = null; - $this->scope = null; - - $this->formatter = $this->newFormatter(); - - if (!empty($this->registeredVars)) { - $this->injectVariables($this->registeredVars); - } - - $this->sourceParser = $this->parser; // used for error messages - $this->compileBlock($root); - - ob_start(); - $this->formatter->block($this->scope); - $out = ob_get_clean(); - setlocale(LC_NUMERIC, $locale); - return $out; - } - - public function compileFile($fname, $outFname = null) { - if (!is_readable($fname)) { - throw new Exception('load error: failed to find '.$fname); - } - - $pi = pathinfo($fname); - - $oldImport = $this->importDir; - - $this->importDir = (array)$this->importDir; - $this->importDir[] = $pi['dirname'].'/'; - - $this->allParsedFiles = array(); - $this->addParsedFile($fname); - - $out = $this->compile(file_get_contents($fname), $fname); - - $this->importDir = $oldImport; - - if ($outFname !== null) { - return file_put_contents($outFname, $out); - } - - return $out; - } - - // compile only if changed input has changed or output doesn't exist - public function checkedCompile($in, $out) { - if (!is_file($out) || filemtime($in) > filemtime($out)) { - $this->compileFile($in, $out); - return true; - } - return false; - } - - /** - * Execute lessphp on a .less file or a lessphp cache structure - * - * The lessphp cache structure contains information about a specific - * less file having been parsed. It can be used as a hint for future - * calls to determine whether or not a rebuild is required. - * - * The cache structure contains two important keys that may be used - * externally: - * - * compiled: The final compiled CSS - * updated: The time (in seconds) the CSS was last compiled - * - * The cache structure is a plain-ol' PHP associative array and can - * be serialized and unserialized without a hitch. - * - * @param mixed $in Input - * @param bool $force Force rebuild? - * @return array lessphp cache structure - */ - public function cachedCompile($in, $force = false) { - // assume no root - $root = null; - - if (is_string($in)) { - $root = $in; - } elseif (is_array($in) and isset($in['root'])) { - if ($force or ! isset($in['files'])) { - // If we are forcing a recompile or if for some reason the - // structure does not contain any file information we should - // specify the root to trigger a rebuild. - $root = $in['root']; - } elseif (isset($in['files']) and is_array($in['files'])) { - foreach ($in['files'] as $fname => $ftime ) { - if (!file_exists($fname) or filemtime($fname) > $ftime) { - // One of the files we knew about previously has changed - // so we should look at our incoming root again. - $root = $in['root']; - break; - } - } - } - } else { - // TODO: Throw an exception? We got neither a string nor something - // that looks like a compatible lessphp cache structure. - return null; - } - - if ($root !== null) { - // If we have a root value which means we should rebuild. - $out = array(); - $out['root'] = $root; - $out['compiled'] = $this->compileFile($root); - $out['files'] = $this->allParsedFiles(); - $out['updated'] = time(); - return $out; - } else { - // No changes, pass back the structure - // we were given initially. - return $in; - } - - } - - // parse and compile buffer - // This is deprecated - public function parse($str = null, $initialVariables = null) { - if (is_array($str)) { - $initialVariables = $str; - $str = null; - } - - $oldVars = $this->registeredVars; - if ($initialVariables !== null) { - $this->setVariables($initialVariables); - } - - if ($str == null) { - if (empty($this->_parseFile)) { - throw new exception("nothing to parse"); - } - - $out = $this->compileFile($this->_parseFile); - } else { - $out = $this->compile($str); - } - - $this->registeredVars = $oldVars; - return $out; - } - - protected function makeParser($name) { - $parser = new lessc_parser($this, $name); - $parser->writeComments = $this->preserveComments; - - return $parser; - } - - public function setFormatter($name) { - $this->formatterName = $name; - } - - protected function newFormatter() { - $className = "lessc_formatter_lessjs"; - if (!empty($this->formatterName)) { - if (!is_string($this->formatterName)) - return $this->formatterName; - $className = "lessc_formatter_$this->formatterName"; - } - - $className = 'RainLoopVendor\\'.$className; - return new $className; - } - - public function setPreserveComments($preserve) { - $this->preserveComments = $preserve; - } - - public function registerFunction($name, $func) { - $this->libFunctions[$name] = $func; - } - - public function unregisterFunction($name) { - unset($this->libFunctions[$name]); - } - - public function setVariables($variables) { - $this->registeredVars = array_merge($this->registeredVars, $variables); - } - - public function unsetVariable($name) { - unset($this->registeredVars[$name]); - } - - public function setImportDir($dirs) { - $this->importDir = (array)$dirs; - } - - public function addImportDir($dir) { - $this->importDir = (array)$this->importDir; - $this->importDir[] = $dir; - } - - public function allParsedFiles() { - return $this->allParsedFiles; - } - - protected function addParsedFile($file) { - $this->allParsedFiles[realpath($file)] = filemtime($file); - } - - /** - * Uses the current value of $this->count to show line and line number - */ - protected function throwError($msg = null) { - if ($this->sourceLoc >= 0) { - $this->sourceParser->throwError($msg, $this->sourceLoc); - } - throw new exception($msg); - } - - // compile file $in to file $out if $in is newer than $out - // returns true when it compiles, false otherwise - public static function ccompile($in, $out, $less = null) { - if ($less === null) { - $less = new self; - } - return $less->checkedCompile($in, $out); - } - - public static function cexecute($in, $force = false, $less = null) { - if ($less === null) { - $less = new self; - } - return $less->cachedCompile($in, $force); - } - - static protected $cssColors = array( - 'aliceblue' => '240,248,255', - 'antiquewhite' => '250,235,215', - 'aqua' => '0,255,255', - 'aquamarine' => '127,255,212', - 'azure' => '240,255,255', - 'beige' => '245,245,220', - 'bisque' => '255,228,196', - 'black' => '0,0,0', - 'blanchedalmond' => '255,235,205', - 'blue' => '0,0,255', - 'blueviolet' => '138,43,226', - 'brown' => '165,42,42', - 'burlywood' => '222,184,135', - 'cadetblue' => '95,158,160', - 'chartreuse' => '127,255,0', - 'chocolate' => '210,105,30', - 'coral' => '255,127,80', - 'cornflowerblue' => '100,149,237', - 'cornsilk' => '255,248,220', - 'crimson' => '220,20,60', - 'cyan' => '0,255,255', - 'darkblue' => '0,0,139', - 'darkcyan' => '0,139,139', - 'darkgoldenrod' => '184,134,11', - 'darkgray' => '169,169,169', - 'darkgreen' => '0,100,0', - 'darkgrey' => '169,169,169', - 'darkkhaki' => '189,183,107', - 'darkmagenta' => '139,0,139', - 'darkolivegreen' => '85,107,47', - 'darkorange' => '255,140,0', - 'darkorchid' => '153,50,204', - 'darkred' => '139,0,0', - 'darksalmon' => '233,150,122', - 'darkseagreen' => '143,188,143', - 'darkslateblue' => '72,61,139', - 'darkslategray' => '47,79,79', - 'darkslategrey' => '47,79,79', - 'darkturquoise' => '0,206,209', - 'darkviolet' => '148,0,211', - 'deeppink' => '255,20,147', - 'deepskyblue' => '0,191,255', - 'dimgray' => '105,105,105', - 'dimgrey' => '105,105,105', - 'dodgerblue' => '30,144,255', - 'firebrick' => '178,34,34', - 'floralwhite' => '255,250,240', - 'forestgreen' => '34,139,34', - 'fuchsia' => '255,0,255', - 'gainsboro' => '220,220,220', - 'ghostwhite' => '248,248,255', - 'gold' => '255,215,0', - 'goldenrod' => '218,165,32', - 'gray' => '128,128,128', - 'green' => '0,128,0', - 'greenyellow' => '173,255,47', - 'grey' => '128,128,128', - 'honeydew' => '240,255,240', - 'hotpink' => '255,105,180', - 'indianred' => '205,92,92', - 'indigo' => '75,0,130', - 'ivory' => '255,255,240', - 'khaki' => '240,230,140', - 'lavender' => '230,230,250', - 'lavenderblush' => '255,240,245', - 'lawngreen' => '124,252,0', - 'lemonchiffon' => '255,250,205', - 'lightblue' => '173,216,230', - 'lightcoral' => '240,128,128', - 'lightcyan' => '224,255,255', - 'lightgoldenrodyellow' => '250,250,210', - 'lightgray' => '211,211,211', - 'lightgreen' => '144,238,144', - 'lightgrey' => '211,211,211', - 'lightpink' => '255,182,193', - 'lightsalmon' => '255,160,122', - 'lightseagreen' => '32,178,170', - 'lightskyblue' => '135,206,250', - 'lightslategray' => '119,136,153', - 'lightslategrey' => '119,136,153', - 'lightsteelblue' => '176,196,222', - 'lightyellow' => '255,255,224', - 'lime' => '0,255,0', - 'limegreen' => '50,205,50', - 'linen' => '250,240,230', - 'magenta' => '255,0,255', - 'maroon' => '128,0,0', - 'mediumaquamarine' => '102,205,170', - 'mediumblue' => '0,0,205', - 'mediumorchid' => '186,85,211', - 'mediumpurple' => '147,112,219', - 'mediumseagreen' => '60,179,113', - 'mediumslateblue' => '123,104,238', - 'mediumspringgreen' => '0,250,154', - 'mediumturquoise' => '72,209,204', - 'mediumvioletred' => '199,21,133', - 'midnightblue' => '25,25,112', - 'mintcream' => '245,255,250', - 'mistyrose' => '255,228,225', - 'moccasin' => '255,228,181', - 'navajowhite' => '255,222,173', - 'navy' => '0,0,128', - 'oldlace' => '253,245,230', - 'olive' => '128,128,0', - 'olivedrab' => '107,142,35', - 'orange' => '255,165,0', - 'orangered' => '255,69,0', - 'orchid' => '218,112,214', - 'palegoldenrod' => '238,232,170', - 'palegreen' => '152,251,152', - 'paleturquoise' => '175,238,238', - 'palevioletred' => '219,112,147', - 'papayawhip' => '255,239,213', - 'peachpuff' => '255,218,185', - 'peru' => '205,133,63', - 'pink' => '255,192,203', - 'plum' => '221,160,221', - 'powderblue' => '176,224,230', - 'purple' => '128,0,128', - 'red' => '255,0,0', - 'rosybrown' => '188,143,143', - 'royalblue' => '65,105,225', - 'saddlebrown' => '139,69,19', - 'salmon' => '250,128,114', - 'sandybrown' => '244,164,96', - 'seagreen' => '46,139,87', - 'seashell' => '255,245,238', - 'sienna' => '160,82,45', - 'silver' => '192,192,192', - 'skyblue' => '135,206,235', - 'slateblue' => '106,90,205', - 'slategray' => '112,128,144', - 'slategrey' => '112,128,144', - 'snow' => '255,250,250', - 'springgreen' => '0,255,127', - 'steelblue' => '70,130,180', - 'tan' => '210,180,140', - 'teal' => '0,128,128', - 'thistle' => '216,191,216', - 'tomato' => '255,99,71', - 'transparent' => '0,0,0,0', - 'turquoise' => '64,224,208', - 'violet' => '238,130,238', - 'wheat' => '245,222,179', - 'white' => '255,255,255', - 'whitesmoke' => '245,245,245', - 'yellow' => '255,255,0', - 'yellowgreen' => '154,205,50' - ); -} - -// responsible for taking a string of LESS code and converting it into a -// syntax tree -class lessc_parser { - static protected $nextBlockId = 0; // used to uniquely identify blocks - - static protected $precedence = array( - '=<' => 0, - '>=' => 0, - '=' => 0, - '<' => 0, - '>' => 0, - - '+' => 1, - '-' => 1, - '*' => 2, - '/' => 2, - '%' => 2, - ); - - static protected $whitePattern; - static protected $commentMulti; - - static protected $commentSingle = "//"; - static protected $commentMultiLeft = "/*"; - static protected $commentMultiRight = "*/"; - - // regex string to match any of the operators - static protected $operatorString; - - // these properties will supress division unless it's inside parenthases - static protected $supressDivisionProps = - array('/border-radius$/i', '/^font$/i'); - - protected $blockDirectives = array("font-face", "keyframes", "page", "-moz-document"); - protected $lineDirectives = array("charset"); - - /** - * if we are in parens we can be more liberal with whitespace around - * operators because it must evaluate to a single value and thus is less - * ambiguous. - * - * Consider: - * property1: 10 -5; // is two numbers, 10 and -5 - * property2: (10 -5); // should evaluate to 5 - */ - protected $inParens = false; - - // caches preg escaped literals - static protected $literalCache = array(); - - public function __construct($lessc, $sourceName = null) { - $this->eatWhiteDefault = true; - // reference to less needed for vPrefix, mPrefix, and parentSelector - $this->lessc = $lessc; - - $this->sourceName = $sourceName; // name used for error messages - - $this->writeComments = false; - - if (!self::$operatorString) { - self::$operatorString = - '('.implode('|', array_map(array('RainLoopVendor\\lessc', 'preg_quote'), - array_keys(self::$precedence))).')'; - - $commentSingle = lessc::preg_quote(self::$commentSingle); - $commentMultiLeft = lessc::preg_quote(self::$commentMultiLeft); - $commentMultiRight = lessc::preg_quote(self::$commentMultiRight); - - self::$commentMulti = $commentMultiLeft.'.*?'.$commentMultiRight; - self::$whitePattern = '/'.$commentSingle.'[^\n]*\s*|('.self::$commentMulti.')\s*|\s+/Ais'; - } - } - - public function parse($buffer) { - $this->count = 0; - $this->line = 1; - - $this->env = null; // block stack - $this->buffer = $this->writeComments ? $buffer : $this->removeComments($buffer); - $this->pushSpecialBlock("root"); - $this->eatWhiteDefault = true; - $this->seenComments = array(); - - // trim whitespace on head - // if (preg_match('/^\s+/', $this->buffer, $m)) { - // $this->line += substr_count($m[0], "\n"); - // $this->buffer = ltrim($this->buffer); - // } - $this->whitespace(); - - // parse the entire file - $lastCount = $this->count; - while (false !== $this->parseChunk()); - - if ($this->count != strlen($this->buffer)) - $this->throwError(); - - // TODO report where the block was opened - if (!is_null($this->env->parent)) - throw new exception('parse error: unclosed block'); - - return $this->env; - } - - /** - * Parse a single chunk off the head of the buffer and append it to the - * current parse environment. - * Returns false when the buffer is empty, or when there is an error. - * - * This function is called repeatedly until the entire document is - * parsed. - * - * This parser is most similar to a recursive descent parser. Single - * functions represent discrete grammatical rules for the language, and - * they are able to capture the text that represents those rules. - * - * Consider the function lessc::keyword(). (all parse functions are - * structured the same) - * - * The function takes a single reference argument. When calling the - * function it will attempt to match a keyword on the head of the buffer. - * If it is successful, it will place the keyword in the referenced - * argument, advance the position in the buffer, and return true. If it - * fails then it won't advance the buffer and it will return false. - * - * All of these parse functions are powered by lessc::match(), which behaves - * the same way, but takes a literal regular expression. Sometimes it is - * more convenient to use match instead of creating a new function. - * - * Because of the format of the functions, to parse an entire string of - * grammatical rules, you can chain them together using &&. - * - * But, if some of the rules in the chain succeed before one fails, then - * the buffer position will be left at an invalid state. In order to - * avoid this, lessc::seek() is used to remember and set buffer positions. - * - * Before parsing a chain, use $s = $this->seek() to remember the current - * position into $s. Then if a chain fails, use $this->seek($s) to - * go back where we started. - */ - protected function parseChunk() { - if (empty($this->buffer)) return false; - $s = $this->seek(); - - // setting a property - if ($this->keyword($key) && $this->assign() && - $this->propertyValue($value, $key) && $this->end()) - { - $this->append(array('assign', $key, $value), $s); - return true; - } else { - $this->seek($s); - } - - - // look for special css blocks - if ($this->literal('@', false)) { - $this->count--; - - // media - if ($this->literal('@media')) { - if (($this->mediaQueryList($mediaQueries) || true) - && $this->literal('{')) - { - $media = $this->pushSpecialBlock("media"); - $media->queries = is_null($mediaQueries) ? array() : $mediaQueries; - return true; - } else { - $this->seek($s); - return false; - } - } - - if ($this->literal("@", false) && $this->keyword($dirName)) { - if ($this->isDirective($dirName, $this->blockDirectives)) { - if (($this->openString("{", $dirValue, null, array(";")) || true) && - $this->literal("{")) - { - $dir = $this->pushSpecialBlock("directive"); - $dir->name = $dirName; - if (isset($dirValue)) $dir->value = $dirValue; - return true; - } - } elseif ($this->isDirective($dirName, $this->lineDirectives)) { - if ($this->propertyValue($dirValue) && $this->end()) { - $this->append(array("directive", $dirName, $dirValue)); - return true; - } - } - } - - $this->seek($s); - } - - // setting a variable - if ($this->variable($var) && $this->assign() && - $this->propertyValue($value) && $this->end()) - { - $this->append(array('assign', $var, $value), $s); - return true; - } else { - $this->seek($s); - } - - if ($this->import($importValue)) { - $this->append($importValue, $s); - return true; - } - - // opening parametric mixin - if ($this->tag($tag, true) && $this->argumentDef($args, $isVararg) && - ($this->guards($guards) || true) && - $this->literal('{')) - { - $block = $this->pushBlock($this->fixTags(array($tag))); - $block->args = $args; - $block->isVararg = $isVararg; - if (!empty($guards)) $block->guards = $guards; - return true; - } else { - $this->seek($s); - } - - // opening a simple block - if ($this->tags($tags) && $this->literal('{')) { - $tags = $this->fixTags($tags); - $this->pushBlock($tags); - return true; - } else { - $this->seek($s); - } - - // closing a block - if ($this->literal('}', false)) { - try { - $block = $this->pop(); - } catch (exception $e) { - $this->seek($s); - $this->throwError($e->getMessage()); - } - - $hidden = false; - if (is_null($block->type)) { - $hidden = true; - if (!isset($block->args)) { - foreach ($block->tags as $tag) { - if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { - $hidden = false; - break; - } - } - } - - foreach ($block->tags as $tag) { - if (is_string($tag)) { - $this->env->children[$tag][] = $block; - } - } - } - - if (!$hidden) { - $this->append(array('block', $block), $s); - } - - // this is done here so comments aren't bundled into he block that - // was just closed - $this->whitespace(); - return true; - } - - // mixin - if ($this->mixinTags($tags) && - ($this->argumentValues($argv) || true) && - ($this->keyword($suffix) || true) && $this->end()) - { - $tags = $this->fixTags($tags); - $this->append(array('mixin', $tags, $argv, $suffix), $s); - return true; - } else { - $this->seek($s); - } - - // spare ; - if ($this->literal(';')) return true; - - return false; // got nothing, throw error - } - - protected function isDirective($dirname, $directives) { - // TODO: cache pattern in parser - $pattern = implode('|', - array_map(array('RainLoopVendor\\lessc', 'preg_quote'), $directives)); - $pattern = '/^(-[a-z-]+-)?(' . $pattern . ')$/i'; - - return preg_match($pattern, $dirname); - } - - protected function fixTags($tags) { - // move @ tags out of variable namespace - foreach ($tags as &$tag) { - if ($tag{0} == $this->lessc->vPrefix) - $tag[0] = $this->lessc->mPrefix; - } - return $tags; - } - - // a list of expressions - protected function expressionList(&$exps) { - $values = array(); - - while ($this->expression($exp)) { - $values[] = $exp; - } - - if (count($values) == 0) return false; - - $exps = lessc::compressList($values, ' '); - return true; - } - - /** - * Attempt to consume an expression. - * @link http://en.wikipedia.org/wiki/Operator-precedence_parser#Pseudo-code - */ - protected function expression(&$out) { - if ($this->value($lhs)) { - $out = $this->expHelper($lhs, 0); - - // look for / shorthand - if (!empty($this->env->supressedDivision)) { - unset($this->env->supressedDivision); - $s = $this->seek(); - if ($this->literal("/") && $this->value($rhs)) { - $out = array("list", "", - array($out, array("keyword", "/"), $rhs)); - } else { - $this->seek($s); - } - } - - return true; - } - return false; - } - - /** - * recursively parse infix equation with $lhs at precedence $minP - */ - protected function expHelper($lhs, $minP) { - $this->inExp = true; - $ss = $this->seek(); - - while (true) { - $whiteBefore = isset($this->buffer[$this->count - 1]) && - ctype_space($this->buffer[$this->count - 1]); - - // If there is whitespace before the operator, then we require - // whitespace after the operator for it to be an expression - $needWhite = $whiteBefore && !$this->inParens; - - if ($this->match(self::$operatorString.($needWhite ? '\s' : ''), $m) && self::$precedence[$m[1]] >= $minP) { - if (!$this->inParens && isset($this->env->currentProperty) && $m[1] == "/" && empty($this->env->supressedDivision)) { - foreach (self::$supressDivisionProps as $pattern) { - if (preg_match($pattern, $this->env->currentProperty)) { - $this->env->supressedDivision = true; - break 2; - } - } - } - - - $whiteAfter = isset($this->buffer[$this->count - 1]) && - ctype_space($this->buffer[$this->count - 1]); - - if (!$this->value($rhs)) break; - - // peek for next operator to see what to do with rhs - if ($this->peek(self::$operatorString, $next) && self::$precedence[$next[1]] > self::$precedence[$m[1]]) { - $rhs = $this->expHelper($rhs, self::$precedence[$next[1]]); - } - - $lhs = array('expression', $m[1], $lhs, $rhs, $whiteBefore, $whiteAfter); - $ss = $this->seek(); - - continue; - } - - break; - } - - $this->seek($ss); - - return $lhs; - } - - // consume a list of values for a property - public function propertyValue(&$value, $keyName = null) { - $values = array(); - - if ($keyName !== null) $this->env->currentProperty = $keyName; - - $s = null; - while ($this->expressionList($v)) { - $values[] = $v; - $s = $this->seek(); - if (!$this->literal(',')) break; - } - - if ($s) $this->seek($s); - - if ($keyName !== null) unset($this->env->currentProperty); - - if (count($values) == 0) return false; - - $value = lessc::compressList($values, ', '); - return true; - } - - protected function parenValue(&$out) { - $s = $this->seek(); - - // speed shortcut - if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "(") { - return false; - } - - $inParens = $this->inParens; - if ($this->literal("(") && - ($this->inParens = true) && $this->expression($exp) && - $this->literal(")")) - { - $out = $exp; - $this->inParens = $inParens; - return true; - } else { - $this->inParens = $inParens; - $this->seek($s); - } - - return false; - } - - // a single value - protected function value(&$value) { - $s = $this->seek(); - - // speed shortcut - if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "-") { - // negation - if ($this->literal("-", false) && - (($this->variable($inner) && $inner = array("variable", $inner)) || - $this->unit($inner) || - $this->parenValue($inner))) - { - $value = array("unary", "-", $inner); - return true; - } else { - $this->seek($s); - } - } - - if ($this->parenValue($value)) return true; - if ($this->unit($value)) return true; - if ($this->color($value)) return true; - if ($this->func($value)) return true; - if ($this->string($value)) return true; - - if ($this->keyword($word)) { - $value = array('keyword', $word); - return true; - } - - // try a variable - if ($this->variable($var)) { - $value = array('variable', $var); - return true; - } - - // unquote string (should this work on any type? - if ($this->literal("~") && $this->string($str)) { - $value = array("escape", $str); - return true; - } else { - $this->seek($s); - } - - // css hack: \0 - if ($this->literal('\\') && $this->match('([0-9]+)', $m)) { - $value = array('keyword', '\\'.$m[1]); - return true; - } else { - $this->seek($s); - } - - return false; - } - - // an import statement - protected function import(&$out) { - $s = $this->seek(); - if (!$this->literal('@import')) return false; - - // @import "something.css" media; - // @import url("something.css") media; - // @import url(something.css) media; - - if ($this->propertyValue($value)) { - $out = array("import", $value); - return true; - } - } - - protected function mediaQueryList(&$out) { - if ($this->genericList($list, "mediaQuery", ",", false)) { - $out = $list[2]; - return true; - } - return false; - } - - protected function mediaQuery(&$out) { - $s = $this->seek(); - - $expressions = null; - $parts = array(); - - if (($this->literal("only") && ($only = true) || $this->literal("not") && ($not = true) || true) && $this->keyword($mediaType)) { - $prop = array("mediaType"); - if (isset($only)) $prop[] = "only"; - if (isset($not)) $prop[] = "not"; - $prop[] = $mediaType; - $parts[] = $prop; - } else { - $this->seek($s); - } - - - if (!empty($mediaType) && !$this->literal("and")) { - // ~ - } else { - $this->genericList($expressions, "mediaExpression", "and", false); - if (is_array($expressions)) $parts = array_merge($parts, $expressions[2]); - } - - if (count($parts) == 0) { - $this->seek($s); - return false; - } - - $out = $parts; - return true; - } - - protected function mediaExpression(&$out) { - $s = $this->seek(); - $value = null; - if ($this->literal("(") && - $this->keyword($feature) && - ($this->literal(":") && $this->expression($value) || true) && - $this->literal(")")) - { - $out = array("mediaExp", $feature); - if ($value) $out[] = $value; - return true; - } elseif ($this->variable($variable)) { - $out = array('variable', $variable); - return true; - } - - $this->seek($s); - return false; - } - - // an unbounded string stopped by $end - protected function openString($end, &$out, $nestingOpen=null, $rejectStrs = null) { - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - $stop = array("'", '"', "@{", $end); - $stop = array_map(array('RainLoopVendor\\lessc', 'preg_quote'), $stop); - // $stop[] = self::$commentMulti; - - if (!is_null($rejectStrs)) { - $stop = array_merge($stop, $rejectStrs); - } - - $patt = '(.*?)('.implode("|", $stop).')'; - - $nestingLevel = 0; - - $content = array(); - while ($this->match($patt, $m, false)) { - if (!empty($m[1])) { - $content[] = $m[1]; - if ($nestingOpen) { - $nestingLevel += substr_count($m[1], $nestingOpen); - } - } - - $tok = $m[2]; - - $this->count-= strlen($tok); - if ($tok == $end) { - if ($nestingLevel == 0) { - break; - } else { - $nestingLevel--; - } - } - - if (($tok == "'" || $tok == '"') && $this->string($str)) { - $content[] = $str; - continue; - } - - if ($tok == "@{" && $this->interpolation($inter)) { - $content[] = $inter; - continue; - } - - if (!empty($rejectStrs) && in_array($tok, $rejectStrs)) { - $ount = null; - break; - } - - $content[] = $tok; - $this->count+= strlen($tok); - } - - $this->eatWhiteDefault = $oldWhite; - - if (count($content) == 0) return false; - - // trim the end - if (is_string(end($content))) { - $content[count($content) - 1] = rtrim(end($content)); - } - - $out = array("string", "", $content); - return true; - } - - protected function string(&$out) { - $s = $this->seek(); - if ($this->literal('"', false)) { - $delim = '"'; - } elseif ($this->literal("'", false)) { - $delim = "'"; - } else { - return false; - } - - $content = array(); - - // look for either ending delim , escape, or string interpolation - $patt = '([^\n]*?)(@\{|\\\\|' . - lessc::preg_quote($delim).')'; - - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - while ($this->match($patt, $m, false)) { - $content[] = $m[1]; - if ($m[2] == "@{") { - $this->count -= strlen($m[2]); - if ($this->interpolation($inter, false)) { - $content[] = $inter; - } else { - $this->count += strlen($m[2]); - $content[] = "@{"; // ignore it - } - } elseif ($m[2] == '\\') { - $content[] = $m[2]; - if ($this->literal($delim, false)) { - $content[] = $delim; - } - } else { - $this->count -= strlen($delim); - break; // delim - } - } - - $this->eatWhiteDefault = $oldWhite; - - if ($this->literal($delim)) { - $out = array("string", $delim, $content); - return true; - } - - $this->seek($s); - return false; - } - - protected function interpolation(&$out) { - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = true; - - $s = $this->seek(); - if ($this->literal("@{") && - $this->openString("}", $interp, null, array("'", '"', ";")) && - $this->literal("}", false)) - { - $out = array("interpolate", $interp); - $this->eatWhiteDefault = $oldWhite; - if ($this->eatWhiteDefault) $this->whitespace(); - return true; - } - - $this->eatWhiteDefault = $oldWhite; - $this->seek($s); - return false; - } - - protected function unit(&$unit) { - // speed shortcut - if (isset($this->buffer[$this->count])) { - $char = $this->buffer[$this->count]; - if (!ctype_digit($char) && $char != ".") return false; - } - - if ($this->match('([0-9]+(?:\.[0-9]*)?|\.[0-9]+)([%a-zA-Z]+)?', $m)) { - $unit = array("number", $m[1], empty($m[2]) ? "" : $m[2]); - return true; - } - return false; - } - - // a # color - protected function color(&$out) { - if ($this->match('(#(?:[0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3}))', $m)) { - if (strlen($m[1]) > 7) { - $out = array("string", "", array($m[1])); - } else { - $out = array("raw_color", $m[1]); - } - return true; - } - - return false; - } - - // consume a list of property values delimited by ; and wrapped in () - protected function argumentValues(&$args, $delim = ',') { - $s = $this->seek(); - if (!$this->literal('(')) return false; - - $values = array(); - while (true) { - if ($this->expressionList($value)) $values[] = $value; - if (!$this->literal($delim)) break; - else { - if ($value == null) $values[] = null; - $value = null; - } - } - - if (!$this->literal(')')) { - $this->seek($s); - return false; - } - - $args = $values; - return true; - } - - // consume an argument definition list surrounded by () - // each argument is a variable name with optional value - // or at the end a ... or a variable named followed by ... - protected function argumentDef(&$args, &$isVararg, $delim = ',') { - $s = $this->seek(); - if (!$this->literal('(')) return false; - - $values = array(); - - $isVararg = false; - while (true) { - if ($this->literal("...")) { - $isVararg = true; - break; - } - - if ($this->variable($vname)) { - $arg = array("arg", $vname); - $ss = $this->seek(); - if ($this->assign() && $this->expressionList($value)) { - $arg[] = $value; - } else { - $this->seek($ss); - if ($this->literal("...")) { - $arg[0] = "rest"; - $isVararg = true; - } - } - $values[] = $arg; - if ($isVararg) break; - continue; - } - - if ($this->value($literal)) { - $values[] = array("lit", $literal); - } - - if (!$this->literal($delim)) break; - } - - if (!$this->literal(')')) { - $this->seek($s); - return false; - } - - $args = $values; - - return true; - } - - // consume a list of tags - // this accepts a hanging delimiter - protected function tags(&$tags, $simple = false, $delim = ',') { - $tags = array(); - while ($this->tag($tt, $simple)) { - $tags[] = $tt; - if (!$this->literal($delim)) break; - } - if (count($tags) == 0) return false; - - return true; - } - - // list of tags of specifying mixin path - // optionally separated by > (lazy, accepts extra >) - protected function mixinTags(&$tags) { - $s = $this->seek(); - $tags = array(); - while ($this->tag($tt, true)) { - $tags[] = $tt; - $this->literal(">"); - } - - if (count($tags) == 0) return false; - - return true; - } - - // a bracketed value (contained within in a tag definition) - protected function tagBracket(&$value) { - // speed shortcut - if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] != "[") { - return false; - } - - $s = $this->seek(); - if ($this->literal('[') && $this->to(']', $c, true) && $this->literal(']', false)) { - $value = '['.$c.']'; - // whitespace? - if ($this->whitespace()) $value .= " "; - - // escape parent selector, (yuck) - $value = str_replace($this->lessc->parentSelector, "$&$", $value); - return true; - } - - $this->seek($s); - return false; - } - - protected function tagExpression(&$value) { - $s = $this->seek(); - if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { - $value = array('exp', $exp); - return true; - } - - $this->seek($s); - return false; - } - - // a space separated list of selectors - protected function tag(&$tag, $simple = false) { - if ($simple) - $chars = '^@,:;{}\][>\(\) "\''; - else - $chars = '^@,;{}["\''; - - $s = $this->seek(); - - if (!$simple && $this->tagExpression($tag)) { - return true; - } - - $hasExpression = false; - $parts = array(); - while ($this->tagBracket($first)) $parts[] = $first; - - $oldWhite = $this->eatWhiteDefault; - $this->eatWhiteDefault = false; - - while (true) { - if ($this->match('(['.$chars.'0-9]['.$chars.']*)', $m)) { - $parts[] = $m[1]; - if ($simple) break; - - while ($this->tagBracket($brack)) { - $parts[] = $brack; - } - continue; - } - - if (isset($this->buffer[$this->count]) && $this->buffer[$this->count] == "@") { - if ($this->interpolation($interp)) { - $hasExpression = true; - $interp[2] = true; // don't unescape - $parts[] = $interp; - continue; - } - - if ($this->literal("@")) { - $parts[] = "@"; - continue; - } - } - - if ($this->unit($unit)) { // for keyframes - $parts[] = $unit[1]; - $parts[] = $unit[2]; - continue; - } - - break; - } - - $this->eatWhiteDefault = $oldWhite; - if (!$parts) { - $this->seek($s); - return false; - } - - if ($hasExpression) { - $tag = array("exp", array("string", "", $parts)); - } else { - $tag = trim(implode($parts)); - } - - $this->whitespace(); - return true; - } - - // a css function - protected function func(&$func) { - $s = $this->seek(); - - if ($this->match('(%|[\w\-_][\w\-_:\.]+|[\w_])', $m) && $this->literal('(')) { - $fname = $m[1]; - - $sPreArgs = $this->seek(); - - $args = array(); - while (true) { - $ss = $this->seek(); - // this ugly nonsense is for ie filter properties - if ($this->keyword($name) && $this->literal('=') && $this->expressionList($value)) { - $args[] = array("string", "", array($name, "=", $value)); - } else { - $this->seek($ss); - if ($this->expressionList($value)) { - $args[] = $value; - } - } - - if (!$this->literal(',')) break; - } - $args = array('list', ',', $args); - - if ($this->literal(')')) { - $func = array('function', $fname, $args); - return true; - } elseif ($fname == 'url') { - // couldn't parse and in url? treat as string - $this->seek($sPreArgs); - if ($this->openString(")", $string) && $this->literal(")")) { - $func = array('function', $fname, $string); - return true; - } - } - } - - $this->seek($s); - return false; - } - - // consume a less variable - protected function variable(&$name) { - $s = $this->seek(); - if ($this->literal($this->lessc->vPrefix, false) && - ($this->variable($sub) || $this->keyword($name))) - { - if (!empty($sub)) { - $name = array('variable', $sub); - } else { - $name = $this->lessc->vPrefix.$name; - } - return true; - } - - $name = null; - $this->seek($s); - return false; - } - - /** - * Consume an assignment operator - * Can optionally take a name that will be set to the current property name - */ - protected function assign($name = null) { - if ($name) $this->currentProperty = $name; - return $this->literal(':') || $this->literal('='); - } - - // consume a keyword - protected function keyword(&$word) { - if ($this->match('([\w_\-\*!"][\w\-_"]*)', $m)) { - $word = $m[1]; - return true; - } - return false; - } - - // consume an end of statement delimiter - protected function end() { - if ($this->literal(';')) { - return true; - } elseif ($this->count == strlen($this->buffer) || $this->buffer{$this->count} == '}') { - // if there is end of file or a closing block next then we don't need a ; - return true; - } - return false; - } - - protected function guards(&$guards) { - $s = $this->seek(); - - if (!$this->literal("when")) { - $this->seek($s); - return false; - } - - $guards = array(); - - while ($this->guardGroup($g)) { - $guards[] = $g; - if (!$this->literal(",")) break; - } - - if (count($guards) == 0) { - $guards = null; - $this->seek($s); - return false; - } - - return true; - } - - // a bunch of guards that are and'd together - // TODO rename to guardGroup - protected function guardGroup(&$guardGroup) { - $s = $this->seek(); - $guardGroup = array(); - while ($this->guard($guard)) { - $guardGroup[] = $guard; - if (!$this->literal("and")) break; - } - - if (count($guardGroup) == 0) { - $guardGroup = null; - $this->seek($s); - return false; - } - - return true; - } - - protected function guard(&$guard) { - $s = $this->seek(); - $negate = $this->literal("not"); - - if ($this->literal("(") && $this->expression($exp) && $this->literal(")")) { - $guard = $exp; - if ($negate) $guard = array("negate", $guard); - return true; - } - - $this->seek($s); - return false; - } - - /* raw parsing functions */ - - protected function literal($what, $eatWhitespace = null) { - if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; - - // shortcut on single letter - if (!isset($what[1]) && isset($this->buffer[$this->count])) { - if ($this->buffer[$this->count] == $what) { - if (!$eatWhitespace) { - $this->count++; - return true; - } - // goes below... - } else { - return false; - } - } - - if (!isset(self::$literalCache[$what])) { - self::$literalCache[$what] = lessc::preg_quote($what); - } - - return $this->match(self::$literalCache[$what], $m, $eatWhitespace); - } - - protected function genericList(&$out, $parseItem, $delim="", $flatten=true) { - $s = $this->seek(); - $items = array(); - while ($this->$parseItem($value)) { - $items[] = $value; - if ($delim) { - if (!$this->literal($delim)) break; - } - } - - if (count($items) == 0) { - $this->seek($s); - return false; - } - - if ($flatten && count($items) == 1) { - $out = $items[0]; - } else { - $out = array("list", $delim, $items); - } - - return true; - } - - - // advance counter to next occurrence of $what - // $until - don't include $what in advance - // $allowNewline, if string, will be used as valid char set - protected function to($what, &$out, $until = false, $allowNewline = false) { - if (is_string($allowNewline)) { - $validChars = $allowNewline; - } else { - $validChars = $allowNewline ? "." : "[^\n]"; - } - if (!$this->match('('.$validChars.'*?)'.lessc::preg_quote($what), $m, !$until)) return false; - if ($until) $this->count -= strlen($what); // give back $what - $out = $m[1]; - return true; - } - - // try to match something on head of buffer - protected function match($regex, &$out, $eatWhitespace = null) { - if ($eatWhitespace === null) $eatWhitespace = $this->eatWhiteDefault; - - $r = '/'.$regex.($eatWhitespace && !$this->writeComments ? '\s*' : '').'/Ais'; - if (preg_match($r, $this->buffer, $out, null, $this->count)) { - $this->count += strlen($out[0]); - if ($eatWhitespace && $this->writeComments) $this->whitespace(); - return true; - } - return false; - } - - // match some whitespace - protected function whitespace() { - if ($this->writeComments) { - $gotWhite = false; - while (preg_match(self::$whitePattern, $this->buffer, $m, null, $this->count)) { - if (isset($m[1]) && empty($this->commentsSeen[$this->count])) { - $this->append(array("comment", $m[1])); - $this->commentsSeen[$this->count] = true; - } - $this->count += strlen($m[0]); - $gotWhite = true; - } - return $gotWhite; - } else { - $this->match("", $m); - return strlen($m[0]) > 0; - } - } - - // match something without consuming it - protected function peek($regex, &$out = null, $from=null) { - if (is_null($from)) $from = $this->count; - $r = '/'.$regex.'/Ais'; - $result = preg_match($r, $this->buffer, $out, null, $from); - - return $result; - } - - // seek to a spot in the buffer or return where we are on no argument - protected function seek($where = null) { - if ($where === null) return $this->count; - else $this->count = $where; - return true; - } - - /* misc functions */ - - public function throwError($msg = "parse error", $count = null) { - $count = is_null($count) ? $this->count : $count; - - $line = $this->line + - substr_count(substr($this->buffer, 0, $count), "\n"); - - if (!empty($this->sourceName)) { - $loc = "$this->sourceName on line $line"; - } else { - $loc = "line: $line"; - } - - // TODO this depends on $this->count - if ($this->peek("(.*?)(\n|$)", $m, $count)) { - throw new exception("$msg: failed at `$m[1]` $loc"); - } else { - throw new exception("$msg: $loc"); - } - } - - protected function pushBlock($selectors=null, $type=null) { - $b = new stdclass; - $b->parent = $this->env; - - $b->type = $type; - $b->id = self::$nextBlockId++; - - $b->isVararg = false; // TODO: kill me from here - $b->tags = $selectors; - - $b->props = array(); - $b->children = array(); - - $this->env = $b; - return $b; - } - - // push a block that doesn't multiply tags - protected function pushSpecialBlock($type) { - return $this->pushBlock(null, $type); - } - - // append a property to the current block - protected function append($prop, $pos = null) { - if ($pos !== null) $prop[-1] = $pos; - $this->env->props[] = $prop; - } - - // pop something off the stack - protected function pop() { - $old = $this->env; - $this->env = $this->env->parent; - return $old; - } - - // remove comments from $text - // todo: make it work for all functions, not just url - protected function removeComments($text) { - $look = array( - 'url(', '//', '/*', '"', "'" - ); - - $out = ''; - $min = null; - while (true) { - // find the next item - foreach ($look as $token) { - $pos = strpos($text, $token); - if ($pos !== false) { - if (!isset($min) || $pos < $min[1]) $min = array($token, $pos); - } - } - - if (is_null($min)) break; - - $count = $min[1]; - $skip = 0; - $newlines = 0; - switch ($min[0]) { - case 'url(': - if (preg_match('/url\(.*?\)/', $text, $m, 0, $count)) - $count += strlen($m[0]) - strlen($min[0]); - break; - case '"': - case "'": - if (preg_match('/'.$min[0].'.*?'.$min[0].'/', $text, $m, 0, $count)) - $count += strlen($m[0]) - 1; - break; - case '//': - $skip = strpos($text, "\n", $count); - if ($skip === false) $skip = strlen($text) - $count; - else $skip -= $count; - break; - case '/*': - if (preg_match('/\/\*.*?\*\//s', $text, $m, 0, $count)) { - $skip = strlen($m[0]); - $newlines = substr_count($m[0], "\n"); - } - break; - } - - if ($skip == 0) $count += strlen($min[0]); - - $out .= substr($text, 0, $count).str_repeat("\n", $newlines); - $text = substr($text, $count + $skip); - - $min = null; - } - - return $out.$text; - } - -} - -class lessc_formatter_classic { - public $indentChar = " "; - - public $break = "\n"; - public $open = " {"; - public $close = "}"; - public $selectorSeparator = ", "; - public $assignSeparator = ":"; - - public $openSingle = " { "; - public $closeSingle = " }"; - - public $disableSingle = false; - public $breakSelectors = false; - - public $compressColors = false; - - public function __construct() { - $this->indentLevel = 0; - } - - public function indentStr($n = 0) { - return str_repeat($this->indentChar, max($this->indentLevel + $n, 0)); - } - - public function property($name, $value) { - return $name . $this->assignSeparator . $value . ";"; - } - - protected function isEmpty($block) { - if (empty($block->lines)) { - foreach ($block->children as $child) { - if (!$this->isEmpty($child)) return false; - } - - return true; - } - return false; - } - - public function block($block) { - if ($this->isEmpty($block)) return; - - $inner = $pre = $this->indentStr(); - - $isSingle = !$this->disableSingle && - is_null($block->type) && count($block->lines) == 1; - - if (!empty($block->selectors)) { - $this->indentLevel++; - - if ($this->breakSelectors) { - $selectorSeparator = $this->selectorSeparator . $this->break . $pre; - } else { - $selectorSeparator = $this->selectorSeparator; - } - - echo $pre . - implode($selectorSeparator, $block->selectors); - if ($isSingle) { - echo $this->openSingle; - $inner = ""; - } else { - echo $this->open . $this->break; - $inner = $this->indentStr(); - } - - } - - if (!empty($block->lines)) { - $glue = $this->break.$inner; - echo $inner . implode($glue, $block->lines); - if (!$isSingle && !empty($block->children)) { - echo $this->break; - } - } - - foreach ($block->children as $child) { - $this->block($child); - } - - if (!empty($block->selectors)) { - if (!$isSingle && empty($block->children)) echo $this->break; - - if ($isSingle) { - echo $this->closeSingle . $this->break; - } else { - echo $pre . $this->close . $this->break; - } - - $this->indentLevel--; - } - } -} - -class lessc_formatter_compressed extends lessc_formatter_classic { - public $disableSingle = true; - public $open = "{"; - public $selectorSeparator = ","; - public $assignSeparator = ":"; - public $break = ""; - public $compressColors = true; - - public function indentStr($n = 0) { - return ""; - } -} - -class lessc_formatter_lessjs extends lessc_formatter_classic { - public $disableSingle = true; - public $breakSelectors = true; - public $assignSeparator = ": "; - public $selectorSeparator = ","; -} - - diff --git a/rainloop/v/0.0.0/app/libraries/pclzip/_pclzip.lib.php b/rainloop/v/0.0.0/app/libraries/pclzip/_pclzip.lib.php deleted file mode 100644 index a93e2212f7..0000000000 --- a/rainloop/v/0.0.0/app/libraries/pclzip/_pclzip.lib.php +++ /dev/null @@ -1,5693 +0,0 @@ -zipname = $p_zipname; - $this->zip_fd = 0; - $this->magic_quotes_status = -1; - - // ----- Return - return; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // create($p_filelist, $p_add_dir="", $p_remove_dir="") - // create($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two different synopsis. The first one is historical. - // This method creates a Zip Archive. The Zip file is created in the - // filesystem. The files and directories indicated in $p_filelist - // are added in the archive. See the parameters description for the - // supported format of $p_filelist. - // When a directory is in the list, the directory and its content is added - // in the archive. - // In this synopsis, the function takes an optional variable list of - // options. See bellow the supported options. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function create($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove from the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Invalid number / type of arguments"); - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - if ($v_string != '') { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - else { - } - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // add($p_filelist, $p_add_dir="", $p_remove_dir="") - // add($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two synopsis. The first one is historical. - // This methods add the list of files in an existing archive. - // If a file with the same name already exists, it is added at the end of the - // archive, the first one is still present. - // If the archive does not exist, it is created. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_OPT_ADD_COMMENT : - // PCLZIP_OPT_PREPEND_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function add($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_ADD_COMMENT => 'optional', - PCLZIP_OPT_PREPEND_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : listContent() - // Description : - // This public method, gives the list of the files and directories, with their - // properties. - // The properties of each entries in the list are (used also in other functions) : - // filename : Name of the file. For a create or add action it is the filename - // given by the user. For an extract function it is the filename - // of the extracted file. - // stored_filename : Name of the file / directory stored in the archive. - // size : Size of the stored file. - // compressed_size : Size of the file's data compressed in the archive - // (without the headers overhead) - // mtime : Last known modification date of the file (UNIX timestamp) - // comment : Comment associated with the file - // folder : true | false - // index : index of the file in the archive - // status : status of the action (depending of the action) : - // Values are : - // ok : OK ! - // filtered : the file / dir is not extracted (filtered by user) - // already_a_directory : the file can not be extracted because a - // directory with the same name already exists - // write_protected : the file can not be extracted because a file - // with the same name already exists and is - // write protected - // newer_exist : the file was not extracted because a newer file exists - // path_creation_fail : the file is not extracted because the folder - // does not exist and can not be created - // write_error : the file was not extracted because there was a - // error while writing the file - // read_error : the file was not extracted because there was a error - // while reading the file - // invalid_header : the file was not extracted because of an archive - // format error (bad file header) - // Note that each time a method can continue operating when there - // is an action error on a file, the error is only logged in the file status. - // Return Values : - // 0 on an unrecoverable failure, - // The list of the files in the archive. - // -------------------------------------------------------------------------------- - function listContent() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Call the extracting fct - $p_list = array(); - if (($v_result = $this->privList($p_list)) != 1) - { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // extract($p_path="./", $p_remove_path="") - // extract([$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method extract all the files / directories from the archive to the - // folder indicated in $p_path. - // If you want to ignore the 'root' part of path of the memorized files - // you can indicate this in the optional $p_remove_path parameter. - // By default, if a newer file with the same name already exists, the - // file is not extracted. - // - // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions - // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append - // at the end of the path value of PCLZIP_OPT_PATH. - // Parameters : - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 or a negative value on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function extract() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Trace - - // ----- Call the extracting fct - $p_list = array(); - $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, - $v_remove_all_path, $v_options); - if ($v_result < 1) { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - - // -------------------------------------------------------------------------------- - // Function : - // extractByIndex($p_index, $p_path="./", $p_remove_path="") - // extractByIndex($p_index, [$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method is doing a partial extract of the archive. - // The extracted files or folders are identified by their index in the - // archive (from 0 to n). - // Note that if the index identify a folder, only the folder entry is - // extracted, not all the files included in the archive. - // Parameters : - // $p_index : A single index (integer) or a string of indexes of files to - // extract. The form of the string is "0,4-6,8-12" with only numbers - // and '-' for range or ',' to separate ranges. No spaces or ';' - // are allowed. - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and - // not as files. - // The resulting content is in a new field 'content' in the file - // structure. - // This option must be used alone (any other options are ignored). - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - //function extractByIndex($p_index, options...) - function extractByIndex($p_index) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - } - else { - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Trace - - // ----- Trick - // Here I want to reuse extractByRule(), so I need to parse the $p_index - // with privParseOptions() - $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); - $v_options_trick = array(); - $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, - array (PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Call the extracting fct - if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // delete([$p_option, $p_option_value, ...]) - // Description : - // This method removes files from the archive. - // If no parameters are given, then all the archive is emptied. - // Parameters : - // None or optional arguments. - // Options : - // PCLZIP_OPT_BY_INDEX : - // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : - // PCLZIP_OPT_BY_PREG : - // Return Values : - // 0 on failure, - // The list of the files which are still present in the archive. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function delete() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Call the delete fct - $v_list = array(); - if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { - $this->privSwapBackMagicQuotes(); - unset($v_list); - return(0); - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : deleteByIndex() - // Description : - // ***** Deprecated ***** - // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. - // -------------------------------------------------------------------------------- - function deleteByIndex($p_index) - { - - $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : properties() - // Description : - // This method gives the properties of the archive. - // The properties are : - // nb : Number of files in the archive - // comment : Comment associated with the archive file - // status : not_exist, ok - // Parameters : - // None - // Return Values : - // 0 on failure, - // An array with the archive properties. - // -------------------------------------------------------------------------------- - function properties() - { - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - $this->privSwapBackMagicQuotes(); - return(0); - } - - // ----- Default properties - $v_prop = array(); - $v_prop['comment'] = ''; - $v_prop['nb'] = 0; - $v_prop['status'] = 'not_exist'; - - // ----- Look if file exists - if (@is_file($this->zipname)) - { - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return 0; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return 0; - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Set the user attributes - $v_prop['comment'] = $v_central_dir['comment']; - $v_prop['nb'] = $v_central_dir['entries']; - $v_prop['status'] = 'ok'; - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_prop; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : duplicate() - // Description : - // This method creates an archive by copying the content of an other one. If - // the archive already exist, it is replaced by the new one without any warning. - // Parameters : - // $p_archive : The filename of a valid archive, or - // a valid PclZip object. - // Return Values : - // 1 on success. - // 0 or a negative value on error (error code). - // -------------------------------------------------------------------------------- - function duplicate($p_archive) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) - { - - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive->zipname); - } - - // ----- Look if the $p_archive is a string (so a filename) - else if (is_string($p_archive)) - { - - // ----- Check that $p_archive is a valid zip file - // TBC : Should also check the archive format - if (!is_file($p_archive)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); - $v_result = PCLZIP_ERR_MISSING_FILE; - } - else { - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive); - } - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : merge() - // Description : - // This method merge the $p_archive_to_add archive at the end of the current - // one ($this). - // If the archive ($this) does not exist, the merge becomes a duplicate. - // If the $p_archive_to_add archive does not exist, the merge is a success. - // Parameters : - // $p_archive_to_add : It can be directly the filename of a valid zip archive, - // or a PclZip object archive. - // Return Values : - // 1 on success, - // 0 or negative values on error (see below). - // -------------------------------------------------------------------------------- - function merge($p_archive_to_add) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) - { - - // ----- Merge the archive - $v_result = $this->privMerge($p_archive_to_add); - } - - // ----- Look if the $p_archive_to_add is a string (so a filename) - else if (is_string($p_archive_to_add)) - { - - // ----- Create a temporary archive - $v_object_archive = new PclZip($p_archive_to_add); - - // ----- Merge the archive - $v_result = $this->privMerge($v_object_archive); - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : errorCode() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorCode() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorCode()); - } - else { - return($this->error_code); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorName() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorName($p_with_code=false) - { - $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', - PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', - PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', - PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', - PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', - PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', - PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', - PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', - PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', - PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', - PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', - PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', - PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', - PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', - PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', - PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', - PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', - PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', - PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' - ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' - ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' - ); - - if (isset($v_name[$this->error_code])) { - $v_value = $v_name[$this->error_code]; - } - else { - $v_value = 'NoName'; - } - - if ($p_with_code) { - return($v_value.' ('.$this->error_code.')'); - } - else { - return($v_value); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorInfo() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorInfo($p_full=false) - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorString()); - } - else { - if ($p_full) { - return($this->errorName(true)." : ".$this->error_string); - } - else { - return($this->error_string." [code ".$this->error_code."]"); - } - } - } - // -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** -// ***** ***** -// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** -// -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : privCheckFormat() - // Description : - // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) - // Parameters : - // $p_level : Level of check. Default 0. - // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) - // Return Values : - // true on success, - // false on error, the error code is set. - // -------------------------------------------------------------------------------- - function privCheckFormat($p_level=0) - { - $v_result = true; - - // ----- Reset the file system cache - clearstatcache(); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the file exits - if (!is_file($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - return(false); - } - - // ----- Check that the file is readeable - if (!is_readable($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - return(false); - } - - // ----- Check the magic code - // TBC - - // ----- Check the central header - // TBC - - // ----- Check each file header - // TBC - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privParseOptions() - // Description : - // This internal methods reads the variable list of arguments ($p_options_list, - // $p_size) and generate an array with the options and values ($v_result_list). - // $v_requested_options contains the options that can be present and those that - // must be present. - // $v_requested_options is an array, with the option value as key, and 'optional', - // or 'mandatory' as value. - // Parameters : - // See above. - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) - { - $v_result=1; - - // ----- Read the options - $i=0; - while ($i<$p_size) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$p_options_list[$i]])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for next option - switch ($p_options_list[$i]) { - // ----- Look for options that request a path value - case PCLZIP_OPT_PATH : - case PCLZIP_OPT_REMOVE_PATH : - case PCLZIP_OPT_ADD_PATH : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_THRESHOLD : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - // ----- Check the value - $v_value = $p_options_list[$i+1]; - if ((!is_integer($v_value)) || ($v_value<0)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Get the value (and convert it in bytes) - $v_result_list[$p_options_list[$i]] = $v_value*1048576; - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_ON : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_TEMP_FILE_OFF : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); - return PclZip::errorCode(); - } - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if ( is_string($p_options_list[$i+1]) - && ($p_options_list[$i+1] != '')) { - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - } - else { - } - break; - - // ----- Look for options that request an array of string for value - case PCLZIP_OPT_BY_NAME : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an EREG or PREG expression - case PCLZIP_OPT_BY_EREG : - // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG - // to PCLZIP_OPT_BY_PREG - $p_options_list[$i] = PCLZIP_OPT_BY_PREG; - case PCLZIP_OPT_BY_PREG : - //case PCLZIP_OPT_CRYPT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that takes a string - case PCLZIP_OPT_COMMENT : - case PCLZIP_OPT_ADD_COMMENT : - case PCLZIP_OPT_PREPEND_COMMENT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, - "Missing parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, - "Wrong parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an array of index - case PCLZIP_OPT_BY_INDEX : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_work_list = array(); - if (is_string($p_options_list[$i+1])) { - - // ----- Remove spaces - $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); - - // ----- Parse items - $v_work_list = explode(",", $p_options_list[$i+1]); - } - else if (is_integer($p_options_list[$i+1])) { - $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_work_list = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Reduce the index list - // each index item in the list must be a couple with a start and - // an end value : [0,3], [5-5], [8-10], ... - // ----- Check the format of each item - $v_sort_flag=false; - $v_sort_value=0; - for ($j=0; $j= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - $i++; - break; - - // ----- Look for options that request a call-back - case PCLZIP_CB_PRE_EXTRACT : - case PCLZIP_CB_POST_EXTRACT : - case PCLZIP_CB_PRE_ADD : - case PCLZIP_CB_POST_ADD : - /* for futur use - case PCLZIP_CB_PRE_DELETE : - case PCLZIP_CB_POST_DELETE : - case PCLZIP_CB_PRE_LIST : - case PCLZIP_CB_POST_LIST : - */ - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_function_name = $p_options_list[$i+1]; - - // ----- Check that the value is a valid existing function - if (!function_exists($v_function_name)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Set the attribute - $v_result_list[$p_options_list[$i]] = $v_function_name; - $i++; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '" - .$p_options_list[$i]."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Next options - $i++; - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($v_result_list[$key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - - // ----- Return - return PclZip::errorCode(); - } - } - } - } - - // ----- Look for default values - if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOptionDefaultThreshold() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privOptionDefaultThreshold(&$p_options) - { - $v_result=1; - - if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { - return $v_result; - } - - // ----- Get 'memory_limit' configuration value - $v_memory_limit = ini_get('memory_limit'); - $v_memory_limit = trim($v_memory_limit); - $last = strtolower(substr($v_memory_limit, -1)); - - if($last == 'g') - //$v_memory_limit = $v_memory_limit*1024*1024*1024; - $v_memory_limit = $v_memory_limit*1073741824; - if($last == 'm') - //$v_memory_limit = $v_memory_limit*1024*1024; - $v_memory_limit = $v_memory_limit*1048576; - if($last == 'k') - $v_memory_limit = $v_memory_limit*1024; - - $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); - - - // ----- Sanity check : No threshold if value lower than 1M - if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { - unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrParseAtt() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) - { - $v_result=1; - - // ----- For each file in the list check the attributes - foreach ($p_file_list as $v_key => $v_value) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$v_key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for attribute - switch ($v_key) { - case PCLZIP_ATT_FILE_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['filename'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - break; - - case PCLZIP_ATT_FILE_NEW_SHORT_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_short_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - case PCLZIP_ATT_FILE_NEW_FULL_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_full_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - // ----- Look for options that takes a string - case PCLZIP_ATT_FILE_COMMENT : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['comment'] = $v_value; - break; - - case PCLZIP_ATT_FILE_MTIME : - if (!is_integer($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['mtime'] = $v_value; - break; - - case PCLZIP_ATT_FILE_CONTENT : - $p_filedescr['content'] = $v_value; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '".$v_key."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($p_file_list[$key])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - return PclZip::errorCode(); - } - } - } - } - - // end foreach - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrExpand() - // Description : - // This method look for each item of the list to see if its a file, a folder - // or a string to be added as file. For any other type of files (link, other) - // just ignore the item. - // Then prepare the information that will be stored for that file. - // When its a folder, expand the folder with all the files that are in that - // folder (recursively). - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrExpand(&$p_filedescr_list, &$p_options) - { - $v_result=1; - - // ----- Create a result list - $v_result_list = array(); - - // ----- Look each entry - for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); - - // ----- Add the descriptor in result list - $v_result_list[sizeof($v_result_list)] = $v_descr; - - // ----- Look for folder - if ($v_descr['type'] == 'folder') { - // ----- List of items in folder - $v_dirlist_descr = array(); - $v_dirlist_nb = 0; - if ($v_folder_handler = @opendir($v_descr['filename'])) { - while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - - // ----- Skip '.' and '..' - if (($v_item_handler == '.') || ($v_item_handler == '..')) { - continue; - } - - // ----- Compose the full filename - $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - - // ----- Look for different stored filename - // Because the name of the folder was changed, the name of the - // files/sub-folders also change - if (($v_descr['stored_filename'] != $v_descr['filename']) - && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { - if ($v_descr['stored_filename'] != '') { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; - } - else { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; - } - } - - $v_dirlist_nb++; - } - - @closedir($v_folder_handler); - } - else { - // TBC : unable to open folder in read mode - } - - // ----- Expand each element of the list - if ($v_dirlist_nb != 0) { - // ----- Expand - if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - return $v_result; - } - - // ----- Concat the resulting list - $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - } - else { - } - - // ----- Free local array - unset($v_dirlist_descr); - } - } - - // ----- Get the result list - $p_filedescr_list = $v_result_list; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCreate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCreate($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the file in write mode - if (($v_result = $this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Add the list of files - $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); - - // ----- Close - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAdd() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAdd($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Look if the archive exists or is empty - if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) - { - - // ----- Do a create - $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); - - // ----- Return - return $v_result; - } - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Create the Central Dir files header - for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = $v_central_dir['comment']; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { - $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOpenFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privOpenFd($p_mode) - { - $v_result=1; - - // ----- Look if already open - if ($this->zip_fd != 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCloseFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privCloseFd() - { - $v_result=1; - - if ($this->zip_fd != 0) - @fclose($this->zip_fd); - $this->zip_fd = 0; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddList() - // Description : - // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is - // different from the real path of the file. This is usefull if you want to have PclTar - // running in any directory, and memorize relative path from an other directory. - // Parameters : - // $p_list : An array containing the file or directory names to add in the tar - // $p_result_list : list of added files with their properties (specially the status field) - // $p_add_dir : Path to add in the filename path archived - // $p_remove_dir : Path to remove in the filename path archived - // Return Values : - // -------------------------------------------------------------------------------- -// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) - function privAddList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Create the Central Dir files header - for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileList() - // Description : - // Parameters : - // $p_filedescr_list : An array containing the file description - // or directory names to add in the zip - // $p_result_list : list of added files with their properties (specially the status field) - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_header = array(); - - // ----- Recuperate the current number of elt in list - $v_nb = sizeof($p_result_list); - - // ----- Loop on the files - for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, - $p_options); - if ($v_result != 1) { - return $v_result; - } - - // ----- Store the file infos - $p_result_list[$v_nb++] = $v_header; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=1; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - // TBC : Already done in the fileAtt check ... ? - if ($p_filename == "") { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for a stored different filename - /* TBC : Removed - if (isset($p_filedescr['stored_filename'])) { - $v_stored_filename = $p_filedescr['stored_filename']; - } - else { - $v_stored_filename = $p_filedescr['stored_filename']; - } - */ - - // ----- Set the file properties - clearstatcache(); - $p_header['version'] = 20; - $p_header['version_extracted'] = 10; - $p_header['flag'] = 0; - $p_header['compression'] = 0; - $p_header['crc'] = 0; - $p_header['compressed_size'] = 0; - $p_header['filename_len'] = strlen($p_filename); - $p_header['extra_len'] = 0; - $p_header['disk'] = 0; - $p_header['internal'] = 0; - $p_header['offset'] = 0; - $p_header['filename'] = $p_filename; -// TBC : Removed $p_header['stored_filename'] = $v_stored_filename; - $p_header['stored_filename'] = $p_filedescr['stored_filename']; - $p_header['extra'] = ''; - $p_header['status'] = 'ok'; - $p_header['index'] = -1; - - // ----- Look for regular file - if ($p_filedescr['type']=='file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for regular folder - else if ($p_filedescr['type']=='folder') { - $p_header['external'] = 0x00000010; - $p_header['mtime'] = filemtime($p_filename); - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for virtual file - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = strlen($p_filedescr['content']); - } - - - // ----- Look for filetime - if (isset($p_filedescr['mtime'])) { - $p_header['mtime'] = $p_filedescr['mtime']; - } - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['mtime'] = time(); - } - else { - $p_header['mtime'] = filemtime($p_filename); - } - - // ------ Look for file comment - if (isset($p_filedescr['comment'])) { - $p_header['comment_len'] = strlen($p_filedescr['comment']); - $p_header['comment'] = $p_filedescr['comment']; - } - else { - $p_header['comment_len'] = 0; - $p_header['comment'] = ''; - } - - // ----- Look for pre-add callback - if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_header['status'] = "skipped"; - $v_result = 1; - } - - // ----- Update the informations - // Only some fields can be modified - if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { - $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - } - } - - // ----- Look for empty stored filename - if ($p_header['stored_filename'] == "") { - $p_header['status'] = "filtered"; - } - - // ----- Check the path length - if (strlen($p_header['stored_filename']) > 0xFF) { - $p_header['status'] = 'filename_too_long'; - } - - // ----- Look if no error, or file not skipped - if ($p_header['status'] == 'ok') { - - // ----- Look for a file - if ($p_filedescr['type'] == 'file') { - // ----- Look for using temporary file to zip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { - $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Use "in memory" zip algo - else { - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); - - // ----- Close the file - @fclose($v_file); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - - } - - } - - // ----- Look for a virtual file (a file from string) - else if ($p_filedescr['type'] == 'virtual_file') { - - $v_content = $p_filedescr['content']; - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - } - - // ----- Look for a directory - else if ($p_filedescr['type'] == 'folder') { - // ----- Look for directory last '/' - if (@substr($p_header['stored_filename'], -1) != '/') { - $p_header['stored_filename'] .= '/'; - } - - // ----- Set the file properties - $p_header['size'] = 0; - //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked - $p_header['external'] = 0x00000010; // Value for a folder : to be checked - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) - { - return $v_result; - } - } - } - - // ----- Look for post-add callback - if (isset($p_options[PCLZIP_CB_POST_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Ignored - $v_result = 1; - } - - // ----- Update the informations - // Nothing can be modified - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=PCLZIP_ERR_NO_ERROR; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Creates a compressed temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = filesize($p_filename); - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @gzputs($v_file_compressed, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file); - @gzclose($v_file_compressed); - - // ----- Check the minimum file size - if (filesize($v_gzip_temp_name) < 18) { - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); - return PclZip::errorCode(); - } - - // ----- Extract the compressed attributes - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the gzip file header - $v_binary_data = @fread($v_file_compressed, 10); - $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); - - // ----- Check some parameters - $v_data_header['os'] = bin2hex($v_data_header['os']); - - // ----- Read the gzip file footer - @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); - $v_binary_data = @fread($v_file_compressed, 8); - $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); - - // ----- Set the attributes - $p_header['compression'] = ord($v_data_header['cm']); - //$p_header['mtime'] = $v_data_header['mtime']; - $p_header['crc'] = $v_data_footer['crc']; - $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - return $v_result; - } - - // ----- Add the compressed data - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) - { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - fseek($v_file_compressed, 10); - $v_size = $p_header['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file_compressed, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Unlink the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCalculateStoredFilename() - // Description : - // Based on file descriptor properties and global options, this method - // calculate the filename that will be stored in the archive. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCalculateStoredFilename(&$p_filedescr, &$p_options) - { - $v_result=1; - - // ----- Working variables - $p_filename = $p_filedescr['filename']; - if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { - $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; - } - else { - $p_add_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { - $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; - } - else { - $p_remove_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - else { - $p_remove_all_dir = 0; - } - - - // ----- Look for full name change - if (isset($p_filedescr['new_full_name'])) { - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); - } - - // ----- Look for path and/or short name change - else { - - // ----- Look for short name change - // Its when we cahnge just the filename but not the path - if (isset($p_filedescr['new_short_name'])) { - $v_path_info = pathinfo($p_filename); - $v_dir = ''; - if ($v_path_info['dirname'] != '') { - $v_dir = $v_path_info['dirname'].'/'; - } - $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - } - else { - // ----- Calculate the stored filename - $v_stored_filename = $p_filename; - } - - // ----- Look for all path to remove - if ($p_remove_all_dir) { - $v_stored_filename = basename($p_filename); - } - // ----- Look for partial path remove - else if ($p_remove_dir != "") { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= "/"; - - if ( (substr($p_filename, 0, 2) == "./") - || (substr($p_remove_dir, 0, 2) == "./")) { - - if ( (substr($p_filename, 0, 2) == "./") - && (substr($p_remove_dir, 0, 2) != "./")) { - $p_remove_dir = "./".$p_remove_dir; - } - if ( (substr($p_filename, 0, 2) != "./") - && (substr($p_remove_dir, 0, 2) == "./")) { - $p_remove_dir = substr($p_remove_dir, 2); - } - } - - $v_compare = PclZipUtilPathInclusion($p_remove_dir, - $v_stored_filename); - if ($v_compare > 0) { - if ($v_compare == 2) { - $v_stored_filename = ""; - } - else { - $v_stored_filename = substr($v_stored_filename, - strlen($p_remove_dir)); - } - } - } - - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); - - // ----- Look for path to add - if ($p_add_dir != "") { - if (substr($p_add_dir, -1) == "/") - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir."/".$v_stored_filename; - } - } - - // ----- Filename (reduce the path of stored name) - $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); - $p_filedescr['stored_filename'] = $v_stored_filename; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteFileHeader(&$p_header) - { - $v_result=1; - - // ----- Store the offset position of the file - $p_header['offset'] = ftell($this->zip_fd); - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, - $p_header['version_extracted'], $p_header['flag'], - $p_header['compression'], $v_mtime, $v_mdate, - $p_header['crc'], $p_header['compressed_size'], - $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len']); - - // ----- Write the first 148 bytes of the header in the archive - fputs($this->zip_fd, $v_binary_data, 30); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralFileHeader(&$p_header) - { - $v_result=1; - - // TBC - //for(reset($p_header); $key = key($p_header); next($p_header)) { - //} - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - - // ----- Packed data - $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, - $p_header['version'], $p_header['version_extracted'], - $p_header['flag'], $p_header['compression'], - $v_mtime, $v_mdate, $p_header['crc'], - $p_header['compressed_size'], $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len'], $p_header['comment_len'], - $p_header['disk'], $p_header['internal'], - $p_header['external'], $p_header['offset']); - - // ----- Write the 42 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 46); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - if ($p_header['comment_len'] != 0) - { - fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) - { - $v_result=1; - - // ----- Packed data - $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, - $p_nb_entries, $p_size, - $p_offset, strlen($p_comment)); - - // ----- Write the 22 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 22); - - // ----- Write the variable fields - if (strlen($p_comment) != 0) - { - fputs($this->zip_fd, $p_comment, strlen($p_comment)); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privList() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privList(&$p_list) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of Central Dir - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_central_dir['offset'])) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - for ($i=0; $i<$v_central_dir['entries']; $i++) - { - // ----- Read the file header - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - $v_header['index'] = $i; - - // ----- Get the only interesting attributes - $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); - unset($v_header); - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privConvertHeader2FileInfo() - // Description : - // This function takes the file informations from the central directory - // entries and extract the interesting parameters that will be given back. - // The resulting file infos are set in the array $p_info - // $p_info['filename'] : Filename with full path. Given by user (add), - // extracted in the filesystem (extract). - // $p_info['stored_filename'] : Stored filename in the archive. - // $p_info['size'] = Size of the file. - // $p_info['compressed_size'] = Compressed size of the file. - // $p_info['mtime'] = Last modification date of the file. - // $p_info['comment'] = Comment associated with the file. - // $p_info['folder'] = true/false : indicates if the entry is a folder or not. - // $p_info['status'] = status of the action on the file. - // $p_info['crc'] = CRC of the file content. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privConvertHeader2FileInfo($p_header, &$p_info) - { - $v_result=1; - - // ----- Get the interesting attributes - $v_temp_path = PclZipUtilPathReduction($p_header['filename']); - $p_info['filename'] = $v_temp_path; - $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); - $p_info['stored_filename'] = $v_temp_path; - $p_info['size'] = $p_header['size']; - $p_info['compressed_size'] = $p_header['compressed_size']; - $p_info['mtime'] = $p_header['mtime']; - $p_info['comment'] = $p_header['comment']; - $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); - $p_info['index'] = $p_header['index']; - $p_info['status'] = $p_header['status']; - $p_info['crc'] = $p_header['crc']; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractByRule() - // Description : - // Extract a file or directory depending of rules (by index, by name, ...) - // Parameters : - // $p_file_list : An array where will be placed the properties of each - // extracted file - // $p_path : Path to add while writing the extracted files - // $p_remove_path : Path to remove (from the file memorized path) while writing the - // extracted files. If the path does not match the file path, - // the file is extracted with its memorized path. - // $p_remove_path does not apply to 'list' mode. - // $p_path and $p_remove_path are commulative. - // Return Values : - // 1 on success,0 or less on error (see error code list) - // -------------------------------------------------------------------------------- - function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check the path - if ( ($p_path == "") - || ( (substr($p_path, 0, 1) != "/") - && (substr($p_path, 0, 3) != "../") - && (substr($p_path,1,2)!=":/"))) - $p_path = "./".$p_path; - - // ----- Reduce the path last (and duplicated) '/' - if (($p_path != "./") && ($p_path != "/")) - { - // ----- Look for the path end '/' - while (substr($p_path, -1) == "/") - { - $p_path = substr($p_path, 0, strlen($p_path)-1); - } - } - - // ----- Look for path to remove format (should end by /) - if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) - { - $p_remove_path .= '/'; - } - $p_remove_path_size = strlen($p_remove_path); - - // ----- Open the zip file - if (($v_result = $this->privOpenFd('rb')) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - - // ----- Read each entry - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read next Central dir entry - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Store the index - $v_header['index'] = $i; - - // ----- Store the file position - $v_pos_entry = ftell($this->zip_fd); - - // ----- Look for the specific extract rules - $v_extract = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_extract = true; - } - } - // ----- Look for a filename - elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_extract = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_extract = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - - // ----- Look for no rule, which means extract all the archive - else { - $v_extract = true; - } - - // ----- Check compression method - if ( ($v_extract) - && ( ($v_header['compression'] != 8) - && ($v_header['compression'] != 0))) { - $v_header['status'] = 'unsupported_compression'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, - "Filename '".$v_header['stored_filename']."' is " - ."compressed by an unsupported compression " - ."method (".$v_header['compression'].") "); - - return PclZip::errorCode(); - } - } - - // ----- Check encrypted files - if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - $v_header['status'] = 'unsupported_encryption'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, - "Unsupported encryption for " - ." filename '".$v_header['stored_filename'] - ."'"); - - return PclZip::errorCode(); - } - } - - // ----- Look for real extraction - if (($v_extract) && ($v_header['status'] != 'ok')) { - $v_result = $this->privConvertHeader2FileInfo($v_header, - $p_file_list[$v_nb_extracted++]); - if ($v_result != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - $v_extract = false; - } - - // ----- Look for real extraction - if ($v_extract) - { - - // ----- Go to the file position - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_header['offset'])) - { - // ----- Close the zip file - $this->privCloseFd(); - - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for extraction as string - if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { - - $v_string = ''; - - // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Set the file content - $p_file_list[$v_nb_extracted]['content'] = $v_string; - - // ----- Next extracted file - $v_nb_extracted++; - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for extraction in standard output - elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) - && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { - // ----- Extracting the file in standard output - $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for normal extraction - else { - // ----- Extracting the file - $v_result1 = $this->privExtractFile($v_header, - $p_path, $p_remove_path, - $p_remove_all_path, - $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - } - } - - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFile() - // Description : - // Parameters : - // Return Values : - // - // 1 : ... ? - // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback - // -------------------------------------------------------------------------------- - function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for all path to remove - if ($p_remove_all_path == true) { - // ----- Look for folder entry that not need to be extracted - if (($p_entry['external']&0x00000010)==0x00000010) { - - $p_entry['status'] = "filtered"; - - return $v_result; - } - - // ----- Get the basename of the path - $p_entry['filename'] = basename($p_entry['filename']); - } - - // ----- Look for path to remove - else if ($p_remove_path != "") - { - if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) - { - - // ----- Change the file status - $p_entry['status'] = "filtered"; - - // ----- Return - return $v_result; - } - - $p_remove_path_size = strlen($p_remove_path); - if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) - { - - // ----- Remove the path - $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - - } - } - - // ----- Add the path - if ($p_path != '') { - $p_entry['filename'] = $p_path."/".$p_entry['filename']; - } - - // ----- Check a base_dir_restriction - if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - $v_inclusion - = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); - if ($v_inclusion == 0) { - - PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, - "Filename '".$p_entry['filename']."' is " - ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - - return PclZip::errorCode(); - } - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Look for specific actions while the file exist - if (file_exists($p_entry['filename'])) - { - - // ----- Look if file is a directory - if (is_dir($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "already_a_directory"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, - "Filename '".$p_entry['filename']."' is " - ."already used by an existing directory"); - - return PclZip::errorCode(); - } - } - // ----- Look if file is write protected - else if (!is_writeable($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "write_protected"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Filename '".$p_entry['filename']."' exists " - ."and is write protected"); - - return PclZip::errorCode(); - } - } - - // ----- Look if the extracted file is older - else if (filemtime($p_entry['filename']) > $p_entry['mtime']) - { - // ----- Change the file status - if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) - && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - } - else { - $p_entry['status'] = "newer_exist"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Newer version of '".$p_entry['filename']."' exists " - ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - - return PclZip::errorCode(); - } - } - } - else { - } - } - - // ----- Check the directory availability and create it if necessary - else { - if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) - $v_dir_to_check = $p_entry['filename']; - else if (!strstr($p_entry['filename'], "/")) - $v_dir_to_check = ""; - else - $v_dir_to_check = dirname($p_entry['filename']); - - if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - - // ----- Change the file status - $p_entry['status'] = "path_creation_fail"; - - // ----- Return - //return $v_result; - $v_result = 1; - } - } - } - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file - if ($p_entry['compression'] == 0) { - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) - { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - // ----- Return - return $v_result; - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - /* Try to speed up the code - $v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_binary_data, $v_read_size); - */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Closing the destination file - fclose($v_dest_file); - - // ----- Change the file mtime - touch($p_entry['filename'], $p_entry['mtime']); - - - } - else { - // ----- TBC - // Need to be finished - if (($p_entry['flag'] & 1) == 1) { - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); - return PclZip::errorCode(); - } - - - // ----- Look for using temporary file to unzip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { - $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Look for extract in memory - else { - - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = @gzinflate($v_buffer); - unset($v_buffer); - if ($v_file_content === FALSE) { - - // ----- Change the file status - // TBC - $p_entry['status'] = "error"; - - return $v_result; - } - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - return $v_result; - } - - // ----- Write the uncompressed data - @fwrite($v_dest_file, $v_file_content, $p_entry['size']); - unset($v_file_content); - - // ----- Closing the destination file - @fclose($v_dest_file); - - } - - // ----- Change the file mtime - @touch($p_entry['filename'], $p_entry['mtime']); - } - - // ----- Look for chmod option - if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - - // ----- Change the mode of the file - @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); - } - - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileUsingTempFile(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Creates a temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - - // ----- Write gz file format header - $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); - @fwrite($v_dest_file, $v_binary_data, 10); - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Write gz file format footer - $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); - @fwrite($v_dest_file, $v_binary_data, 8); - - // ----- Close the temporary file - @fclose($v_dest_file); - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - $p_entry['status'] = "write_error"; - return $v_result; - } - - // ----- Open the temporary gz file - if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { - @fclose($v_dest_file); - $p_entry['status'] = "read_error"; - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['size']; - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($v_src_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - @fclose($v_dest_file); - @gzclose($v_src_file); - - // ----- Delete the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileInOutput() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileInOutput(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - // ----- Trace - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - if ($p_entry['compressed_size'] == $p_entry['size']) { - - // ----- Read the file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Send the file to the output - echo $v_buffer; - unset($v_buffer); - } - else { - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = gzinflate($v_buffer); - unset($v_buffer); - - // ----- Send the file to the output - echo $v_file_content; - unset($v_file_content); - } - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileAsString() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) - { - $v_result=1; - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - // if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); - } - else { - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC - } - } - - // ----- Trace - } - else { - // TBC : error : can not extract a folder in a string - } - - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Swap the content to header - $v_local_header['content'] = $p_string; - $p_string = ''; - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Swap back the content to header - $p_string = $v_local_header['content']; - unset($v_local_header['content']); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x04034b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 26); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 26) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); - - // ----- Get filename - $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - - // ----- Get extra_fields - if ($v_data['extra_len'] != 0) { - $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); - } - else { - $p_header['extra'] = ''; - } - - // ----- Extract properties - $p_header['version_extracted'] = $v_data['version']; - $p_header['compression'] = $v_data['compression']; - $p_header['size'] = $v_data['size']; - $p_header['compressed_size'] = $v_data['compressed_size']; - $p_header['crc'] = $v_data['crc']; - $p_header['flag'] = $v_data['flag']; - $p_header['filename_len'] = $v_data['filename_len']; - - // ----- Recuperate date in UNIX format - $p_header['mdate'] = $v_data['mdate']; - $p_header['mtime'] = $v_data['mtime']; - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // TBC - //for(reset($v_data); $key = key($v_data); next($v_data)) { - //} - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set the status field - $p_header['status'] = "ok"; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadCentralFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x02014b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 42); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 42) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); - - // ----- Get filename - if ($p_header['filename_len'] != 0) - $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); - else - $p_header['filename'] = ''; - - // ----- Get extra - if ($p_header['extra_len'] != 0) - $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); - else - $p_header['extra'] = ''; - - // ----- Get comment - if ($p_header['comment_len'] != 0) - $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); - else - $p_header['comment'] = ''; - - // ----- Extract properties - - // ----- Recuperate date in UNIX format - //if ($p_header['mdate'] && $p_header['mtime']) - // TBC : bug : this was ignoring time with 0/0/0 - if (1) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set default status to ok - $p_header['status'] = 'ok'; - - // ----- Look if it is a directory - if (substr($p_header['filename'], -1) == '/') { - //$p_header['external'] = 0x41FF0010; - $p_header['external'] = 0x00000010; - } - - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCheckFileHeaders() - // Description : - // Parameters : - // Return Values : - // 1 on success, - // 0 on error; - // -------------------------------------------------------------------------------- - function privCheckFileHeaders(&$p_local_header, &$p_central_header) - { - $v_result=1; - - // ----- Check the static values - // TBC - if ($p_local_header['filename'] != $p_central_header['filename']) { - } - if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - } - if ($p_local_header['flag'] != $p_central_header['flag']) { - } - if ($p_local_header['compression'] != $p_central_header['compression']) { - } - if ($p_local_header['mtime'] != $p_central_header['mtime']) { - } - if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - } - - // ----- Look for flag bit 3 - if (($p_local_header['flag'] & 8) == 8) { - $p_local_header['size'] = $p_central_header['size']; - $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - $p_local_header['crc'] = $p_central_header['crc']; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadEndCentralDir() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadEndCentralDir(&$p_central_dir) - { - $v_result=1; - - // ----- Go to the end of the zip file - $v_size = filesize($this->zipname); - @fseek($this->zip_fd, $v_size); - if (@ftell($this->zip_fd) != $v_size) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- First try : look if this is an archive with no commentaries (most of the time) - // in this case the end of central dir is at 22 bytes of the file end - $v_found = 0; - if ($v_size > 26) { - @fseek($this->zip_fd, $v_size-22); - if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read for bytes - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = @unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] == 0x06054b50) { - $v_found = 1; - } - - $v_pos = ftell($this->zip_fd); - } - - // ----- Go back to the maximum possible size of the Central Dir End Record - if (!$v_found) { - $v_maximum_size = 65557; // 0xFFFF + 22; - if ($v_maximum_size > $v_size) - $v_maximum_size = $v_size; - @fseek($this->zip_fd, $v_size-$v_maximum_size); - if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read byte per byte in order to find the signature - $v_pos = ftell($this->zip_fd); - $v_bytes = 0x00000000; - while ($v_pos < $v_size) - { - // ----- Read a byte - $v_byte = @fread($this->zip_fd, 1); - - // ----- Add the byte - //$v_bytes = ($v_bytes << 8) | Ord($v_byte); - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); - - // ----- Compare the bytes - if ($v_bytes == 0x504b0506) - { - $v_pos++; - break; - } - - $v_pos++; - } - - // ----- Look if not found end of central dir - if ($v_pos == $v_size) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Read the first 18 bytes of the header - $v_binary_data = fread($this->zip_fd, 18); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 18) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); - - // ----- Check the global size - if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - - // ----- Removed in release 2.2 see readme file - // The check of the file size is a little too strict. - // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. - // While decrypted, zip has training 0 bytes - if (0) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, - 'The central dir is not at the end of the archive.' - .' Some trailing bytes exists after the archive.'); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Get comment - if ($v_data['comment_size'] != 0) { - $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); - } - else - $p_central_dir['comment'] = ''; - - $p_central_dir['entries'] = $v_data['entries']; - $p_central_dir['disk_entries'] = $v_data['disk_entries']; - $p_central_dir['offset'] = $v_data['offset']; - $p_central_dir['size'] = $v_data['size']; - $p_central_dir['disk'] = $v_data['disk']; - $p_central_dir['disk_start'] = $v_data['disk_start']; - - // TBC - //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - //} - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDeleteByRule() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDeleteByRule(&$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Scan all the files - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - $v_header_list = array(); - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read the file header - $v_header_list[$v_nb_extracted] = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - - return $v_result; - } - - - // ----- Store the index - $v_header_list[$v_nb_extracted]['index'] = $i; - - // ----- Look for the specific extract rules - $v_found = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ - && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - } - // ----- Look for a filename - elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_found = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_found = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - else { - $v_found = true; - } - - // ----- Look for deletion - if ($v_found) - { - unset($v_header_list[$v_nb_extracted]); - } - else - { - $v_nb_extracted++; - } - } - - // ----- Look if something need to be deleted - if ($v_nb_extracted > 0) { - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Creates a temporary zip archive - $v_temp_zip = new PclZip($v_zip_temp_name); - - // ----- Open the temporary zip file in write mode - if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Look which file need to be kept - for ($i=0; $izip_fd); - if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_local_header = array(); - if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Check that local file header is same as central file header - if ($this->privCheckFileHeaders($v_local_header, - $v_header_list[$i]) != 1) { - // TBC - } - unset($v_local_header); - - // ----- Write the file header - if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Read/write the data block - if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_temp_zip->zip_fd); - - // ----- Re-Create the Central Dir files header - for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Transform the header to a 'usable' info - $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { - // ----- Reset the file list - unset($v_header_list); - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Close - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Destroy the temporary archive - unset($v_temp_zip); - } - - // ----- Remove every files : reset the file - else if ($v_central_dir['entries'] != 0) { - $this->privCloseFd(); - - if (($v_result = $this->privOpenFd('wb')) != 1) { - return $v_result; - } - - if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - return $v_result; - } - - $this->privCloseFd(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDirCheck() - // Description : - // Check if a directory exists, if not it creates it and all the parents directory - // which may be useful. - // Parameters : - // $p_dir : Directory path to check. - // Return Values : - // 1 : OK - // -1 : Unable to create directory - // -------------------------------------------------------------------------------- - function privDirCheck($p_dir, $p_is_dir=false) - { - $v_result = 1; - - - // ----- Remove the final '/' - if (($p_is_dir) && (substr($p_dir, -1)=='/')) - { - $p_dir = substr($p_dir, 0, strlen($p_dir)-1); - } - - // ----- Check the directory availability - if ((is_dir($p_dir)) || ($p_dir == "")) - { - return 1; - } - - // ----- Extract parent directory - $p_parent_dir = dirname($p_dir); - - // ----- Just a check - if ($p_parent_dir != $p_dir) - { - // ----- Look for parent directory - if ($p_parent_dir != "") - { - if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) - { - return $v_result; - } - } - } - - // ----- Create the directory - if (!@mkdir($p_dir, 0777)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privMerge() - // Description : - // If $p_archive_to_add does not exist, the function exit with a success result. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privMerge(&$p_archive_to_add) - { - $v_result=1; - - // ----- Look if the archive_to_add exists - if (!is_file($p_archive_to_add->zipname)) - { - - // ----- Nothing to merge, so merge is a success - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Look if the archive exists - if (!is_file($this->zipname)) - { - - // ----- Do a duplicate - $v_result = $this->privDuplicate($p_archive_to_add->zipname); - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Open the archive_to_add file - if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) - { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir_to_add = array(); - if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - return $v_result; - } - - // ----- Go to beginning of File - @rewind($p_archive_to_add->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the files from the archive_to_add into the temporary file - $v_size = $v_central_dir_to_add['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_zip_temp_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the block of file headers from the archive_to_add - $v_size = $v_central_dir_to_add['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Merge the file comments - $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; - - // ----- Calculate the size of the (new) central header - $v_size = @ftell($v_zip_temp_fd)-$v_offset; - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive fd - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - @fclose($v_zip_temp_fd); - $this->zip_fd = null; - - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDuplicate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDuplicate($p_archive_filename) - { - $v_result=1; - - // ----- Look if the $p_archive_filename exists - if (!is_file($p_archive_filename)) - { - - // ----- Nothing to duplicate, so duplicate is a success. - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) - { - $this->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = filesize($p_archive_filename); - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorLog() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorLog($p_error_code=0, $p_error_string='') - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclError($p_error_code, $p_error_string); - } - else { - $this->error_code = $p_error_code; - $this->error_string = $p_error_string; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorReset() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorReset() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclErrorReset(); - } - else { - $this->error_code = 0; - $this->error_string = ''; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDisableMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDisableMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if already done - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Get and memorize the magic_quote value - $this->magic_quotes_status = @get_magic_quotes_runtime(); - - // ----- Disable magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime(0); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privSwapBackMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privSwapBackMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if something to do - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Swap back magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime($this->magic_quotes_status); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - } - // End of class - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathReduction() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilPathReduction($p_dir) - { - $v_result = ""; - - // ----- Look for not empty path - if ($p_dir != "") { - // ----- Explode path by directory names - $v_list = explode("/", $p_dir); - - // ----- Study directories from last to first - $v_skip = 0; - for ($i=sizeof($v_list)-1; $i>=0; $i--) { - // ----- Look for current path - if ($v_list[$i] == ".") { - // ----- Ignore this directory - // Should be the first $i=0, but no check is done - } - else if ($v_list[$i] == "..") { - $v_skip++; - } - else if ($v_list[$i] == "") { - // ----- First '/' i.e. root slash - if ($i == 0) { - $v_result = "/".$v_result; - if ($v_skip > 0) { - // ----- It is an invalid path, so the path is not modified - // TBC - $v_result = $p_dir; - $v_skip = 0; - } - } - // ----- Last '/' i.e. indicates a directory - else if ($i == (sizeof($v_list)-1)) { - $v_result = $v_list[$i]; - } - // ----- Double '/' inside the path - else { - // ----- Ignore only the double '//' in path, - // but not the first and last '/' - } - } - else { - // ----- Look for item to skip - if ($v_skip > 0) { - $v_skip--; - } - else { - $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); - } - } - } - - // ----- Look for skip - if ($v_skip > 0) { - while ($v_skip > 0) { - $v_result = '../'.$v_result; - $v_skip--; - } - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathInclusion() - // Description : - // This function indicates if the path $p_path is under the $p_dir tree. Or, - // said in an other way, if the file or sub-dir $p_path is inside the dir - // $p_dir. - // The function indicates also if the path is exactly the same as the dir. - // This function supports path with duplicated '/' like '//', but does not - // support '.' or '..' statements. - // Parameters : - // Return Values : - // 0 if $p_path is not inside directory $p_dir - // 1 if $p_path is inside directory $p_dir - // 2 if $p_path is exactly the same as $p_dir - // -------------------------------------------------------------------------------- - function PclZipUtilPathInclusion($p_dir, $p_path) - { - $v_result = 1; - - // ----- Look for path beginning by ./ - if ( ($p_dir == '.') - || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { - $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - } - if ( ($p_path == '.') - || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { - $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - } - - // ----- Explode dir and path by directory separator - $v_list_dir = explode("/", $p_dir); - $v_list_dir_size = sizeof($v_list_dir); - $v_list_path = explode("/", $p_path); - $v_list_path_size = sizeof($v_list_path); - - // ----- Study directories paths - $i = 0; - $j = 0; - while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - - // ----- Look for empty dir (path reduction) - if ($v_list_dir[$i] == '') { - $i++; - continue; - } - if ($v_list_path[$j] == '') { - $j++; - continue; - } - - // ----- Compare the items - if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - $v_result = 0; - } - - // ----- Next items - $i++; - $j++; - } - - // ----- Look if everything seems to be the same - if ($v_result) { - // ----- Skip all the empty items - while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; - while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - - if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { - // ----- There are exactly the same - $v_result = 2; - } - else if ($i < $v_list_dir_size) { - // ----- The path is shorter than the dir - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilCopyBlock() - // Description : - // Parameters : - // $p_mode : read/write compression mode - // 0 : src & dest normal - // 1 : src gzip, dest normal - // 2 : src normal, dest gzip - // 3 : src & dest gzip - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) - { - $v_result = 1; - - if ($p_mode==0) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==1) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==2) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==3) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilRename() - // Description : - // This function tries to do a simple rename() function. If it fails, it - // tries to copy the $p_src file in a new $p_dest file and then unlink the - // first one. - // Parameters : - // $p_src : Old filename - // $p_dest : New filename - // Return Values : - // 1 on success, 0 on failure. - // -------------------------------------------------------------------------------- - function PclZipUtilRename($p_src, $p_dest) - { - $v_result = 1; - - // ----- Try to rename the files - if (!@rename($p_src, $p_dest)) { - - // ----- Try to copy & unlink the src - if (!@copy($p_src, $p_dest)) { - $v_result = 0; - } - else if (!@unlink($p_src)) { - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilOptionText() - // Description : - // Translate option value in text. Mainly for debug purpose. - // Parameters : - // $p_option : the option value. - // Return Values : - // The option text value. - // -------------------------------------------------------------------------------- - function PclZipUtilOptionText($p_option) - { - - $v_list = get_defined_constants(); - for (reset($v_list); $v_key = key($v_list); next($v_list)) { - $v_prefix = substr($v_key, 0, 10); - if (( ($v_prefix == 'PCLZIP_OPT') - || ($v_prefix == 'PCLZIP_CB_') - || ($v_prefix == 'PCLZIP_ATT')) - && ($v_list[$v_key] == $p_option)) { - return $v_key; - } - } - - $v_result = 'Unknown'; - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilTranslateWinPath() - // Description : - // Translate windows path by replacing '\' by '/' and optionally removing - // drive letter. - // Parameters : - // $p_path : path to translate. - // $p_remove_disk_letter : true | false - // Return Values : - // The path translated. - // -------------------------------------------------------------------------------- - function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) - { - if (stristr(php_uname(), 'windows')) { - // ----- Look for potential disk letter - if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { - $p_path = substr($p_path, $v_position+1); - } - // ----- Change potential windows directory separator - if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { - $p_path = strtr($p_path, '\\', '/'); - } - } - return $p_path; - } - // -------------------------------------------------------------------------------- - - diff --git a/rainloop/v/0.0.0/app/libraries/pclzip/gnu-lgpl.txt b/rainloop/v/0.0.0/app/libraries/pclzip/gnu-lgpl.txt deleted file mode 100644 index cbee875ba6..0000000000 --- a/rainloop/v/0.0.0/app/libraries/pclzip/gnu-lgpl.txt +++ /dev/null @@ -1,504 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - diff --git a/rainloop/v/0.0.0/app/libraries/pclzip/pclzip.lib.php b/rainloop/v/0.0.0/app/libraries/pclzip/pclzip.lib.php deleted file mode 100644 index 74365b1c2e..0000000000 --- a/rainloop/v/0.0.0/app/libraries/pclzip/pclzip.lib.php +++ /dev/null @@ -1,5719 +0,0 @@ -bUseGzopen64 = !function_exists('gzopen') && function_exists('gzopen64'); - - // ----- Set the attributes - $this->zipname = $p_zipname; - $this->zip_fd = 0; - $this->magic_quotes_status = -1; - - // ----- Return - return; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // create($p_filelist, $p_add_dir="", $p_remove_dir="") - // create($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two different synopsis. The first one is historical. - // This method creates a Zip Archive. The Zip file is created in the - // filesystem. The files and directories indicated in $p_filelist - // are added in the archive. See the parameters description for the - // supported format of $p_filelist. - // When a directory is in the list, the directory and its content is added - // in the archive. - // In this synopsis, the function takes an optional variable list of - // options. See bellow the supported options. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function create($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove from the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Invalid number / type of arguments"); - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - if ($v_string != '') { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - else { - } - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privCreate($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // add($p_filelist, $p_add_dir="", $p_remove_dir="") - // add($p_filelist, $p_option, $p_option_value, ...) - // Description : - // This method supports two synopsis. The first one is historical. - // This methods add the list of files in an existing archive. - // If a file with the same name already exists, it is added at the end of the - // archive, the first one is still present. - // If the archive does not exist, it is created. - // Parameters : - // $p_filelist : An array containing file or directory names, or - // a string containing one filename or one directory name, or - // a string containing a list of filenames and/or directory - // names separated by spaces. - // $p_add_dir : A path to add before the real path of the archived file, - // in order to have it memorized in the archive. - // $p_remove_dir : A path to remove from the real path of the file to archive, - // in order to have a shorter path memorized in the archive. - // When $p_add_dir and $p_remove_dir are set, $p_remove_dir - // is removed first, before $p_add_dir is added. - // Options : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_COMMENT : - // PCLZIP_OPT_ADD_COMMENT : - // PCLZIP_OPT_PREPEND_COMMENT : - // PCLZIP_CB_PRE_ADD : - // PCLZIP_CB_POST_ADD : - // Return Values : - // 0 on failure, - // The list of the added files, with a status of the add action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function add($p_filelist) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Set default values - $v_options = array(); - $v_options[PCLZIP_OPT_NO_COMPRESSION] = FALSE; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_ADD => 'optional', - PCLZIP_CB_POST_ADD => 'optional', - PCLZIP_OPT_NO_COMPRESSION => 'optional', - PCLZIP_OPT_COMMENT => 'optional', - PCLZIP_OPT_ADD_COMMENT => 'optional', - PCLZIP_OPT_PREPEND_COMMENT => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - //, PCLZIP_OPT_CRYPT => 'optional' - )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_options[PCLZIP_OPT_ADD_PATH] = $v_add_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_options[PCLZIP_OPT_REMOVE_PATH] = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Init - $v_string_list = array(); - $v_att_list = array(); - $v_filedescr_list = array(); - $p_result_list = array(); - - // ----- Look if the $p_filelist is really an array - if (is_array($p_filelist)) { - - // ----- Look if the first element is also an array - // This will mean that this is a file description entry - if (isset($p_filelist[0]) && is_array($p_filelist[0])) { - $v_att_list = $p_filelist; - } - - // ----- The list is a list of string names - else { - $v_string_list = $p_filelist; - } - } - - // ----- Look if the $p_filelist is a string - else if (is_string($p_filelist)) { - // ----- Create a list from the string - $v_string_list = explode(PCLZIP_SEPARATOR, $p_filelist); - } - - // ----- Invalid variable type for $p_filelist - else { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type '".gettype($p_filelist)."' for p_filelist"); - return 0; - } - - // ----- Reformat the string list - if (sizeof($v_string_list) != 0) { - foreach ($v_string_list as $v_string) { - $v_att_list[][PCLZIP_ATT_FILE_NAME] = $v_string; - } - } - - // ----- For each file in the list check the attributes - $v_supported_attributes - = array ( PCLZIP_ATT_FILE_NAME => 'mandatory' - ,PCLZIP_ATT_FILE_NEW_SHORT_NAME => 'optional' - ,PCLZIP_ATT_FILE_NEW_FULL_NAME => 'optional' - ,PCLZIP_ATT_FILE_MTIME => 'optional' - ,PCLZIP_ATT_FILE_CONTENT => 'optional' - ,PCLZIP_ATT_FILE_COMMENT => 'optional' - ); - foreach ($v_att_list as $v_entry) { - $v_result = $this->privFileDescrParseAtt($v_entry, - $v_filedescr_list[], - $v_options, - $v_supported_attributes); - if ($v_result != 1) { - return 0; - } - } - - // ----- Expand the filelist (expand directories) - $v_result = $this->privFileDescrExpand($v_filedescr_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Call the create fct - $v_result = $this->privAdd($v_filedescr_list, $p_result_list, $v_options); - if ($v_result != 1) { - return 0; - } - - // ----- Return - return $p_result_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : listContent() - // Description : - // This public method, gives the list of the files and directories, with their - // properties. - // The properties of each entries in the list are (used also in other functions) : - // filename : Name of the file. For a create or add action it is the filename - // given by the user. For an extract function it is the filename - // of the extracted file. - // stored_filename : Name of the file / directory stored in the archive. - // size : Size of the stored file. - // compressed_size : Size of the file's data compressed in the archive - // (without the headers overhead) - // mtime : Last known modification date of the file (UNIX timestamp) - // comment : Comment associated with the file - // folder : true | false - // index : index of the file in the archive - // status : status of the action (depending of the action) : - // Values are : - // ok : OK ! - // filtered : the file / dir is not extracted (filtered by user) - // already_a_directory : the file can not be extracted because a - // directory with the same name already exists - // write_protected : the file can not be extracted because a file - // with the same name already exists and is - // write protected - // newer_exist : the file was not extracted because a newer file exists - // path_creation_fail : the file is not extracted because the folder - // does not exist and can not be created - // write_error : the file was not extracted because there was a - // error while writing the file - // read_error : the file was not extracted because there was a error - // while reading the file - // invalid_header : the file was not extracted because of an archive - // format error (bad file header) - // Note that each time a method can continue operating when there - // is an action error on a file, the error is only logged in the file status. - // Return Values : - // 0 on an unrecoverable failure, - // The list of the files in the archive. - // -------------------------------------------------------------------------------- - function listContent() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Call the extracting fct - $p_list = array(); - if (($v_result = $this->privList($p_list)) != 1) - { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // extract($p_path="./", $p_remove_path="") - // extract([$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method extract all the files / directories from the archive to the - // folder indicated in $p_path. - // If you want to ignore the 'root' part of path of the memorized files - // you can indicate this in the optional $p_remove_path parameter. - // By default, if a newer file with the same name already exists, the - // file is not extracted. - // - // If both PCLZIP_OPT_PATH and PCLZIP_OPT_ADD_PATH aoptions - // are used, the path indicated in PCLZIP_OPT_ADD_PATH is append - // at the end of the path value of PCLZIP_OPT_PATH. - // Parameters : - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 or a negative value on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function extract() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_EXTRACT_IN_OUTPUT => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Trace - - // ----- Call the extracting fct - $p_list = array(); - $v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, - $v_remove_all_path, $v_options); - if ($v_result < 1) { - unset($p_list); - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - - // -------------------------------------------------------------------------------- - // Function : - // extractByIndex($p_index, $p_path="./", $p_remove_path="") - // extractByIndex($p_index, [$p_option, $p_option_value, ...]) - // Description : - // This method supports two synopsis. The first one is historical. - // This method is doing a partial extract of the archive. - // The extracted files or folders are identified by their index in the - // archive (from 0 to n). - // Note that if the index identify a folder, only the folder entry is - // extracted, not all the files included in the archive. - // Parameters : - // $p_index : A single index (integer) or a string of indexes of files to - // extract. The form of the string is "0,4-6,8-12" with only numbers - // and '-' for range or ',' to separate ranges. No spaces or ';' - // are allowed. - // $p_path : Path where the files and directories are to be extracted - // $p_remove_path : First part ('root' part) of the memorized path - // (if any similar) to remove while extracting. - // Options : - // PCLZIP_OPT_PATH : - // PCLZIP_OPT_ADD_PATH : - // PCLZIP_OPT_REMOVE_PATH : - // PCLZIP_OPT_REMOVE_ALL_PATH : - // PCLZIP_OPT_EXTRACT_AS_STRING : The files are extracted as strings and - // not as files. - // The resulting content is in a new field 'content' in the file - // structure. - // This option must be used alone (any other options are ignored). - // PCLZIP_CB_PRE_EXTRACT : - // PCLZIP_CB_POST_EXTRACT : - // Return Values : - // 0 on failure, - // The list of the extracted files, with a status of the action. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - //function extractByIndex($p_index, options...) - function extractByIndex($p_index) - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); -// $v_path = "./"; - $v_path = ''; - $v_remove_path = ""; - $v_remove_all_path = false; - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Default values for option - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - - // ----- Look for arguments - if ($v_size > 1) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Remove form the options list the first argument - array_shift($v_arg_list); - $v_size--; - - // ----- Look for first arg - if ((is_integer($v_arg_list[0])) && ($v_arg_list[0] > 77000)) { - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_PATH => 'optional', - PCLZIP_OPT_REMOVE_PATH => 'optional', - PCLZIP_OPT_REMOVE_ALL_PATH => 'optional', - PCLZIP_OPT_EXTRACT_AS_STRING => 'optional', - PCLZIP_OPT_ADD_PATH => 'optional', - PCLZIP_CB_PRE_EXTRACT => 'optional', - PCLZIP_CB_POST_EXTRACT => 'optional', - PCLZIP_OPT_SET_CHMOD => 'optional', - PCLZIP_OPT_REPLACE_NEWER => 'optional' - ,PCLZIP_OPT_STOP_ON_ERROR => 'optional' - ,PCLZIP_OPT_EXTRACT_DIR_RESTRICTION => 'optional', - PCLZIP_OPT_TEMP_FILE_THRESHOLD => 'optional', - PCLZIP_OPT_TEMP_FILE_ON => 'optional', - PCLZIP_OPT_TEMP_FILE_OFF => 'optional' - )); - if ($v_result != 1) { - return 0; - } - - // ----- Set the arguments - if (isset($v_options[PCLZIP_OPT_PATH])) { - $v_path = $v_options[PCLZIP_OPT_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_PATH])) { - $v_remove_path = $v_options[PCLZIP_OPT_REMOVE_PATH]; - } - if (isset($v_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $v_remove_all_path = $v_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - if (isset($v_options[PCLZIP_OPT_ADD_PATH])) { - // ----- Check for '/' in last path char - if ((strlen($v_path) > 0) && (substr($v_path, -1) != '/')) { - $v_path .= '/'; - } - $v_path .= $v_options[PCLZIP_OPT_ADD_PATH]; - } - if (!isset($v_options[PCLZIP_OPT_EXTRACT_AS_STRING])) { - $v_options[PCLZIP_OPT_EXTRACT_AS_STRING] = FALSE; - } - else { - } - } - - // ----- Look for 2 args - // Here we need to support the first historic synopsis of the - // method. - else { - - // ----- Get the first argument - $v_path = $v_arg_list[0]; - - // ----- Look for the optional second argument - if ($v_size == 2) { - $v_remove_path = $v_arg_list[1]; - } - else if ($v_size > 2) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid number / type of arguments"); - - // ----- Return - return 0; - } - } - } - - // ----- Trace - - // ----- Trick - // Here I want to reuse extractByRule(), so I need to parse the $p_index - // with privParseOptions() - $v_arg_trick = array (PCLZIP_OPT_BY_INDEX, $p_index); - $v_options_trick = array(); - $v_result = $this->privParseOptions($v_arg_trick, sizeof($v_arg_trick), $v_options_trick, - array (PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - $v_options[PCLZIP_OPT_BY_INDEX] = $v_options_trick[PCLZIP_OPT_BY_INDEX]; - - // ----- Look for default option values - $this->privOptionDefaultThreshold($v_options); - - // ----- Call the extracting fct - if (($v_result = $this->privExtractByRule($p_list, $v_path, $v_remove_path, $v_remove_all_path, $v_options)) < 1) { - return(0); - } - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : - // delete([$p_option, $p_option_value, ...]) - // Description : - // This method removes files from the archive. - // If no parameters are given, then all the archive is emptied. - // Parameters : - // None or optional arguments. - // Options : - // PCLZIP_OPT_BY_INDEX : - // PCLZIP_OPT_BY_NAME : - // PCLZIP_OPT_BY_EREG : - // PCLZIP_OPT_BY_PREG : - // Return Values : - // 0 on failure, - // The list of the files which are still present in the archive. - // (see PclZip::listContent() for list entry format) - // -------------------------------------------------------------------------------- - function delete() - { - $v_result=1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Set default values - $v_options = array(); - - // ----- Look for variable options arguments - $v_size = func_num_args(); - - // ----- Look for arguments - if ($v_size > 0) { - // ----- Get the arguments - $v_arg_list = func_get_args(); - - // ----- Parse the options - $v_result = $this->privParseOptions($v_arg_list, $v_size, $v_options, - array (PCLZIP_OPT_BY_NAME => 'optional', - PCLZIP_OPT_BY_EREG => 'optional', - PCLZIP_OPT_BY_PREG => 'optional', - PCLZIP_OPT_BY_INDEX => 'optional' )); - if ($v_result != 1) { - return 0; - } - } - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Call the delete fct - $v_list = array(); - if (($v_result = $this->privDeleteByRule($v_list, $v_options)) != 1) { - $this->privSwapBackMagicQuotes(); - unset($v_list); - return(0); - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : deleteByIndex() - // Description : - // ***** Deprecated ***** - // delete(PCLZIP_OPT_BY_INDEX, $p_index) should be prefered. - // -------------------------------------------------------------------------------- - function deleteByIndex($p_index) - { - - $p_list = $this->delete(PCLZIP_OPT_BY_INDEX, $p_index); - - // ----- Return - return $p_list; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : properties() - // Description : - // This method gives the properties of the archive. - // The properties are : - // nb : Number of files in the archive - // comment : Comment associated with the archive file - // status : not_exist, ok - // Parameters : - // None - // Return Values : - // 0 on failure, - // An array with the archive properties. - // -------------------------------------------------------------------------------- - function properties() - { - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - $this->privSwapBackMagicQuotes(); - return(0); - } - - // ----- Default properties - $v_prop = array(); - $v_prop['comment'] = ''; - $v_prop['nb'] = 0; - $v_prop['status'] = 'not_exist'; - - // ----- Look if file exists - if (@is_file($this->zipname)) - { - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return 0; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return 0; - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Set the user attributes - $v_prop['comment'] = $v_central_dir['comment']; - $v_prop['nb'] = $v_central_dir['entries']; - $v_prop['status'] = 'ok'; - } - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_prop; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : duplicate() - // Description : - // This method creates an archive by copying the content of an other one. If - // the archive already exist, it is replaced by the new one without any warning. - // Parameters : - // $p_archive : The filename of a valid archive, or - // a valid PclZip object. - // Return Values : - // 1 on success. - // 0 or a negative value on error (error code). - // -------------------------------------------------------------------------------- - function duplicate($p_archive) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the $p_archive is a PclZip object - if ((is_object($p_archive)) && (get_class($p_archive) == 'pclzip')) - { - - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive->zipname); - } - - // ----- Look if the $p_archive is a string (so a filename) - else if (is_string($p_archive)) - { - - // ----- Check that $p_archive is a valid zip file - // TBC : Should also check the archive format - if (!is_file($p_archive)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "No file with filename '".$p_archive."'"); - $v_result = PCLZIP_ERR_MISSING_FILE; - } - else { - // ----- Duplicate the archive - $v_result = $this->privDuplicate($p_archive); - } - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : merge() - // Description : - // This method merge the $p_archive_to_add archive at the end of the current - // one ($this). - // If the archive ($this) does not exist, the merge becomes a duplicate. - // If the $p_archive_to_add archive does not exist, the merge is a success. - // Parameters : - // $p_archive_to_add : It can be directly the filename of a valid zip archive, - // or a PclZip object archive. - // Return Values : - // 1 on success, - // 0 or negative values on error (see below). - // -------------------------------------------------------------------------------- - function merge($p_archive_to_add) - { - $v_result = 1; - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Check archive - if (!$this->privCheckFormat()) { - return(0); - } - - // ----- Look if the $p_archive_to_add is a PclZip object - if ((is_object($p_archive_to_add)) && (get_class($p_archive_to_add) == 'pclzip')) - { - - // ----- Merge the archive - $v_result = $this->privMerge($p_archive_to_add); - } - - // ----- Look if the $p_archive_to_add is a string (so a filename) - else if (is_string($p_archive_to_add)) - { - - // ----- Create a temporary archive - $v_object_archive = new PclZip($p_archive_to_add); - - // ----- Merge the archive - $v_result = $this->privMerge($v_object_archive); - } - - // ----- Invalid variable - else - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid variable type p_archive_to_add"); - $v_result = PCLZIP_ERR_INVALID_PARAMETER; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : errorCode() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorCode() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorCode()); - } - else { - return($this->error_code); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorName() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorName($p_with_code=false) - { - $v_name = array ( PCLZIP_ERR_NO_ERROR => 'PCLZIP_ERR_NO_ERROR', - PCLZIP_ERR_WRITE_OPEN_FAIL => 'PCLZIP_ERR_WRITE_OPEN_FAIL', - PCLZIP_ERR_READ_OPEN_FAIL => 'PCLZIP_ERR_READ_OPEN_FAIL', - PCLZIP_ERR_INVALID_PARAMETER => 'PCLZIP_ERR_INVALID_PARAMETER', - PCLZIP_ERR_MISSING_FILE => 'PCLZIP_ERR_MISSING_FILE', - PCLZIP_ERR_FILENAME_TOO_LONG => 'PCLZIP_ERR_FILENAME_TOO_LONG', - PCLZIP_ERR_INVALID_ZIP => 'PCLZIP_ERR_INVALID_ZIP', - PCLZIP_ERR_BAD_EXTRACTED_FILE => 'PCLZIP_ERR_BAD_EXTRACTED_FILE', - PCLZIP_ERR_DIR_CREATE_FAIL => 'PCLZIP_ERR_DIR_CREATE_FAIL', - PCLZIP_ERR_BAD_EXTENSION => 'PCLZIP_ERR_BAD_EXTENSION', - PCLZIP_ERR_BAD_FORMAT => 'PCLZIP_ERR_BAD_FORMAT', - PCLZIP_ERR_DELETE_FILE_FAIL => 'PCLZIP_ERR_DELETE_FILE_FAIL', - PCLZIP_ERR_RENAME_FILE_FAIL => 'PCLZIP_ERR_RENAME_FILE_FAIL', - PCLZIP_ERR_BAD_CHECKSUM => 'PCLZIP_ERR_BAD_CHECKSUM', - PCLZIP_ERR_INVALID_ARCHIVE_ZIP => 'PCLZIP_ERR_INVALID_ARCHIVE_ZIP', - PCLZIP_ERR_MISSING_OPTION_VALUE => 'PCLZIP_ERR_MISSING_OPTION_VALUE', - PCLZIP_ERR_INVALID_OPTION_VALUE => 'PCLZIP_ERR_INVALID_OPTION_VALUE', - PCLZIP_ERR_UNSUPPORTED_COMPRESSION => 'PCLZIP_ERR_UNSUPPORTED_COMPRESSION', - PCLZIP_ERR_UNSUPPORTED_ENCRYPTION => 'PCLZIP_ERR_UNSUPPORTED_ENCRYPTION' - ,PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE => 'PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE' - ,PCLZIP_ERR_DIRECTORY_RESTRICTION => 'PCLZIP_ERR_DIRECTORY_RESTRICTION' - ); - - if (isset($v_name[$this->error_code])) { - $v_value = $v_name[$this->error_code]; - } - else { - $v_value = 'NoName'; - } - - if ($p_with_code) { - return($v_value.' ('.$this->error_code.')'); - } - else { - return($v_value); - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : errorInfo() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function errorInfo($p_full=false) - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - return(PclErrorString()); - } - else { - if ($p_full) { - return($this->errorName(true)." : ".$this->error_string); - } - else { - return($this->error_string." [code ".$this->error_code."]"); - } - } - } - // -------------------------------------------------------------------------------- - - -// -------------------------------------------------------------------------------- -// ***** UNDER THIS LINE ARE DEFINED PRIVATE INTERNAL FUNCTIONS ***** -// ***** ***** -// ***** THESES FUNCTIONS MUST NOT BE USED DIRECTLY ***** -// -------------------------------------------------------------------------------- - - - - // -------------------------------------------------------------------------------- - // Function : privCheckFormat() - // Description : - // This method check that the archive exists and is a valid zip archive. - // Several level of check exists. (futur) - // Parameters : - // $p_level : Level of check. Default 0. - // 0 : Check the first bytes (magic codes) (default value)) - // 1 : 0 + Check the central directory (futur) - // 2 : 1 + Check each file header (futur) - // Return Values : - // true on success, - // false on error, the error code is set. - // -------------------------------------------------------------------------------- - function privCheckFormat($p_level=0) - { - $v_result = true; - - // ----- Reset the file system cache - clearstatcache(); - - // ----- Reset the error handler - $this->privErrorReset(); - - // ----- Look if the file exits - if (!is_file($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_FILE, "Missing archive file '".$this->zipname."'"); - return(false); - } - - // ----- Check that the file is readeable - if (!is_readable($this->zipname)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to read archive '".$this->zipname."'"); - return(false); - } - - // ----- Check the magic code - // TBC - - // ----- Check the central header - // TBC - - // ----- Check each file header - // TBC - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privParseOptions() - // Description : - // This internal methods reads the variable list of arguments ($p_options_list, - // $p_size) and generate an array with the options and values ($v_result_list). - // $v_requested_options contains the options that can be present and those that - // must be present. - // $v_requested_options is an array, with the option value as key, and 'optional', - // or 'mandatory' as value. - // Parameters : - // See above. - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privParseOptions(&$p_options_list, $p_size, &$v_result_list, $v_requested_options=false) - { - $v_result=1; - - // ----- Read the options - $i=0; - while ($i<$p_size) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$p_options_list[$i]])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid optional parameter '".$p_options_list[$i]."' for this method"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for next option - switch ($p_options_list[$i]) { - // ----- Look for options that request a path value - case PCLZIP_OPT_PATH : - case PCLZIP_OPT_REMOVE_PATH : - case PCLZIP_OPT_ADD_PATH : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_THRESHOLD : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - // ----- Check the value - $v_value = $p_options_list[$i+1]; - if ((!is_integer($v_value)) || ($v_value<0)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Integer expected for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - return PclZip::errorCode(); - } - - // ----- Get the value (and convert it in bytes) - $v_result_list[$p_options_list[$i]] = $v_value*1048576; - $i++; - break; - - case PCLZIP_OPT_TEMP_FILE_ON : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_OFF])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_OFF'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_TEMP_FILE_OFF : - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_ON])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_ON'"); - return PclZip::errorCode(); - } - // ----- Check for incompatible options - if (isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Option '".PclZipUtilOptionText($p_options_list[$i])."' can not be used with option 'PCLZIP_OPT_TEMP_FILE_THRESHOLD'"); - return PclZip::errorCode(); - } - - $v_result_list[$p_options_list[$i]] = true; - break; - - case PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if ( is_string($p_options_list[$i+1]) - && ($p_options_list[$i+1] != '')) { - $v_result_list[$p_options_list[$i]] = PclZipUtilTranslateWinPath($p_options_list[$i+1], FALSE); - $i++; - } - else { - } - break; - - // ----- Look for options that request an array of string for value - case PCLZIP_OPT_BY_NAME : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]][0] = $p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an EREG or PREG expression - case PCLZIP_OPT_BY_EREG : - // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG - // to PCLZIP_OPT_BY_PREG - $p_options_list[$i] = PCLZIP_OPT_BY_PREG; - case PCLZIP_OPT_BY_PREG : - //case PCLZIP_OPT_CRYPT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Wrong parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that takes a string - case PCLZIP_OPT_COMMENT : - case PCLZIP_OPT_ADD_COMMENT : - case PCLZIP_OPT_PREPEND_COMMENT : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, - "Missing parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - if (is_string($p_options_list[$i+1])) { - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, - "Wrong parameter value for option '" - .PclZipUtilOptionText($p_options_list[$i]) - ."'"); - - // ----- Return - return PclZip::errorCode(); - } - $i++; - break; - - // ----- Look for options that request an array of index - case PCLZIP_OPT_BY_INDEX : - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_work_list = array(); - if (is_string($p_options_list[$i+1])) { - - // ----- Remove spaces - $p_options_list[$i+1] = strtr($p_options_list[$i+1], ' ', ''); - - // ----- Parse items - $v_work_list = explode(",", $p_options_list[$i+1]); - } - else if (is_integer($p_options_list[$i+1])) { - $v_work_list[0] = $p_options_list[$i+1].'-'.$p_options_list[$i+1]; - } - else if (is_array($p_options_list[$i+1])) { - $v_work_list = $p_options_list[$i+1]; - } - else { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Value must be integer, string or array for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Reduce the index list - // each index item in the list must be a couple with a start and - // an end value : [0,3], [5-5], [8-10], ... - // ----- Check the format of each item - $v_sort_flag=false; - $v_sort_value=0; - for ($j=0; $j= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_result_list[$p_options_list[$i]] = $p_options_list[$i+1]; - $i++; - break; - - // ----- Look for options that request a call-back - case PCLZIP_CB_PRE_EXTRACT : - case PCLZIP_CB_POST_EXTRACT : - case PCLZIP_CB_PRE_ADD : - case PCLZIP_CB_POST_ADD : - /* for futur use - case PCLZIP_CB_PRE_DELETE : - case PCLZIP_CB_POST_DELETE : - case PCLZIP_CB_PRE_LIST : - case PCLZIP_CB_POST_LIST : - */ - // ----- Check the number of parameters - if (($i+1) >= $p_size) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_MISSING_OPTION_VALUE, "Missing parameter value for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Get the value - $v_function_name = $p_options_list[$i+1]; - - // ----- Check that the value is a valid existing function - if (!function_exists($v_function_name)) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_OPTION_VALUE, "Function '".$v_function_name."()' is not an existing function for option '".PclZipUtilOptionText($p_options_list[$i])."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Set the attribute - $v_result_list[$p_options_list[$i]] = $v_function_name; - $i++; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '" - .$p_options_list[$i]."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Next options - $i++; - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($v_result_list[$key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - - // ----- Return - return PclZip::errorCode(); - } - } - } - } - - // ----- Look for default values - if (!isset($v_result_list[PCLZIP_OPT_TEMP_FILE_THRESHOLD])) { - - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOptionDefaultThreshold() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privOptionDefaultThreshold(&$p_options) - { - $v_result=1; - - if (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - || isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) { - return $v_result; - } - - // ----- Get 'memory_limit' configuration value - $v_memory_limit = ini_get('memory_limit'); - $v_memory_limit = trim($v_memory_limit); - $last = strtolower(substr($v_memory_limit, -1)); - - if($last == 'g') - //$v_memory_limit = $v_memory_limit*1024*1024*1024; - $v_memory_limit = $v_memory_limit*1073741824; - if($last == 'm') - //$v_memory_limit = $v_memory_limit*1024*1024; - $v_memory_limit = $v_memory_limit*1048576; - if($last == 'k') - $v_memory_limit = $v_memory_limit*1024; - - $p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] = floor($v_memory_limit*PCLZIP_TEMPORARY_FILE_RATIO); - - - // ----- Sanity check : No threshold if value lower than 1M - if ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] < 1048576) { - unset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrParseAtt() - // Description : - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrParseAtt(&$p_file_list, &$p_filedescr, $v_options, $v_requested_options=false) - { - $v_result=1; - - // ----- For each file in the list check the attributes - foreach ($p_file_list as $v_key => $v_value) { - - // ----- Check if the option is supported - if (!isset($v_requested_options[$v_key])) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file attribute '".$v_key."' for this file"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for attribute - switch ($v_key) { - case PCLZIP_ATT_FILE_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['filename'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['filename'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - break; - - case PCLZIP_ATT_FILE_NEW_SHORT_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_short_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_short_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty short filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - case PCLZIP_ATT_FILE_NEW_FULL_NAME : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['new_full_name'] = PclZipUtilPathReduction($v_value); - - if ($p_filedescr['new_full_name'] == '') { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid empty full filename for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - break; - - // ----- Look for options that takes a string - case PCLZIP_ATT_FILE_COMMENT : - if (!is_string($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". String expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['comment'] = $v_value; - break; - - case PCLZIP_ATT_FILE_MTIME : - if (!is_integer($v_value)) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE, "Invalid type ".gettype($v_value).". Integer expected for attribute '".PclZipUtilOptionText($v_key)."'"); - return PclZip::errorCode(); - } - - $p_filedescr['mtime'] = $v_value; - break; - - case PCLZIP_ATT_FILE_CONTENT : - $p_filedescr['content'] = $v_value; - break; - - default : - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, - "Unknown parameter '".$v_key."'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for mandatory options - if ($v_requested_options !== false) { - for ($key=reset($v_requested_options); $key=key($v_requested_options); $key=next($v_requested_options)) { - // ----- Look for mandatory option - if ($v_requested_options[$key] == 'mandatory') { - // ----- Look if present - if (!isset($p_file_list[$key])) { - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Missing mandatory parameter ".PclZipUtilOptionText($key)."(".$key.")"); - return PclZip::errorCode(); - } - } - } - } - - // end foreach - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privFileDescrExpand() - // Description : - // This method look for each item of the list to see if its a file, a folder - // or a string to be added as file. For any other type of files (link, other) - // just ignore the item. - // Then prepare the information that will be stored for that file. - // When its a folder, expand the folder with all the files that are in that - // folder (recursively). - // Parameters : - // Return Values : - // 1 on success. - // 0 on failure. - // -------------------------------------------------------------------------------- - function privFileDescrExpand(&$p_filedescr_list, &$p_options) - { - $v_result=1; - - // ----- Create a result list - $v_result_list = array(); - - // ----- Look each entry - for ($i=0; $iprivCalculateStoredFilename($v_descr, $p_options); - - // ----- Add the descriptor in result list - $v_result_list[sizeof($v_result_list)] = $v_descr; - - // ----- Look for folder - if ($v_descr['type'] == 'folder') { - // ----- List of items in folder - $v_dirlist_descr = array(); - $v_dirlist_nb = 0; - if ($v_folder_handler = @opendir($v_descr['filename'])) { - while (($v_item_handler = @readdir($v_folder_handler)) !== false) { - - // ----- Skip '.' and '..' - if (($v_item_handler == '.') || ($v_item_handler == '..')) { - continue; - } - - // ----- Compose the full filename - $v_dirlist_descr[$v_dirlist_nb]['filename'] = $v_descr['filename'].'/'.$v_item_handler; - - // ----- Look for different stored filename - // Because the name of the folder was changed, the name of the - // files/sub-folders also change - if (($v_descr['stored_filename'] != $v_descr['filename']) - && (!isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH]))) { - if ($v_descr['stored_filename'] != '') { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_descr['stored_filename'].'/'.$v_item_handler; - } - else { - $v_dirlist_descr[$v_dirlist_nb]['new_full_name'] = $v_item_handler; - } - } - - $v_dirlist_nb++; - } - - @closedir($v_folder_handler); - } - else { - // TBC : unable to open folder in read mode - } - - // ----- Expand each element of the list - if ($v_dirlist_nb != 0) { - // ----- Expand - if (($v_result = $this->privFileDescrExpand($v_dirlist_descr, $p_options)) != 1) { - return $v_result; - } - - // ----- Concat the resulting list - $v_result_list = array_merge($v_result_list, $v_dirlist_descr); - } - else { - } - - // ----- Free local array - unset($v_dirlist_descr); - } - } - - // ----- Get the result list - $p_filedescr_list = $v_result_list; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCreate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCreate($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the file in write mode - if (($v_result = $this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Add the list of files - $v_result = $this->privAddList($p_filedescr_list, $p_result_list, $p_options); - - // ----- Close - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAdd() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAdd($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Look if the archive exists or is empty - if ((!is_file($this->zipname)) || (filesize($this->zipname) == 0)) - { - - // ----- Do a create - $v_result = $this->privCreate($p_filedescr_list, $p_result_list, $p_options); - - // ----- Return - return $v_result; - } - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Create the Central Dir files header - for ($i=0, $v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - fclose($v_zip_temp_fd); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = $v_central_dir['comment']; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_ADD_COMMENT])) { - $v_comment = $v_comment.$p_options[PCLZIP_OPT_ADD_COMMENT]; - } - if (isset($p_options[PCLZIP_OPT_PREPEND_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_PREPEND_COMMENT].$v_comment; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count+$v_central_dir['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privOpenFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privOpenFd($p_mode) - { - $v_result=1; - - // ----- Look if already open - if ($this->zip_fd != 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Zip file \''.$this->zipname.'\' already open'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, $p_mode)) == 0) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in '.$p_mode.' mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCloseFd() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privCloseFd() - { - $v_result=1; - - if ($this->zip_fd != 0) - @fclose($this->zip_fd); - $this->zip_fd = 0; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddList() - // Description : - // $p_add_dir and $p_remove_dir will give the ability to memorize a path which is - // different from the real path of the file. This is usefull if you want to have PclTar - // running in any directory, and memorize relative path from an other directory. - // Parameters : - // $p_list : An array containing the file or directory names to add in the tar - // $p_result_list : list of added files with their properties (specially the status field) - // $p_add_dir : Path to add in the filename path archived - // $p_remove_dir : Path to remove in the filename path archived - // Return Values : - // -------------------------------------------------------------------------------- -// function privAddList($p_list, &$p_result_list, $p_add_dir, $p_remove_dir, $p_remove_all_dir, &$p_options) - function privAddList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - - // ----- Add the files - $v_header_list = array(); - if (($v_result = $this->privAddFileList($p_filedescr_list, $v_header_list, $p_options)) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($this->zip_fd); - - // ----- Create the Central Dir files header - for ($i=0,$v_count=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - // ----- Return - return $v_result; - } - $v_count++; - } - - // ----- Transform the header to a 'usable' info - $this->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($this->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_count, $v_size, $v_offset, $v_comment)) != 1) - { - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileList() - // Description : - // Parameters : - // $p_filedescr_list : An array containing the file description - // or directory names to add in the zip - // $p_result_list : list of added files with their properties (specially the status field) - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileList($p_filedescr_list, &$p_result_list, &$p_options) - { - $v_result=1; - $v_header = array(); - - // ----- Recuperate the current number of elt in list - $v_nb = sizeof($p_result_list); - - // ----- Loop on the files - for ($j=0; ($jprivAddFile($p_filedescr_list[$j], $v_header, - $p_options); - if ($v_result != 1) { - return $v_result; - } - - // ----- Store the file infos - $p_result_list[$v_nb++] = $v_header; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=1; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - // TBC : Already done in the fileAtt check ... ? - if ($p_filename == "") { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for a stored different filename - /* TBC : Removed - if (isset($p_filedescr['stored_filename'])) { - $v_stored_filename = $p_filedescr['stored_filename']; - } - else { - $v_stored_filename = $p_filedescr['stored_filename']; - } - */ - - // ----- Set the file properties - clearstatcache(); - $p_header['version'] = 20; - $p_header['version_extracted'] = 10; - $p_header['flag'] = 0; - $p_header['compression'] = 0; - $p_header['crc'] = 0; - $p_header['compressed_size'] = 0; - $p_header['filename_len'] = strlen($p_filename); - $p_header['extra_len'] = 0; - $p_header['disk'] = 0; - $p_header['internal'] = 0; - $p_header['offset'] = 0; - $p_header['filename'] = $p_filename; -// TBC : Removed $p_header['stored_filename'] = $v_stored_filename; - $p_header['stored_filename'] = $p_filedescr['stored_filename']; - $p_header['extra'] = ''; - $p_header['status'] = 'ok'; - $p_header['index'] = -1; - - // ----- Look for regular file - if ($p_filedescr['type']=='file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for regular folder - else if ($p_filedescr['type']=='folder') { - $p_header['external'] = 0x00000010; - $p_header['mtime'] = filemtime($p_filename); - $p_header['size'] = filesize($p_filename); - } - - // ----- Look for virtual file - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['external'] = 0x00000000; - $p_header['size'] = strlen($p_filedescr['content']); - } - - - // ----- Look for filetime - if (isset($p_filedescr['mtime'])) { - $p_header['mtime'] = $p_filedescr['mtime']; - } - else if ($p_filedescr['type'] == 'virtual_file') { - $p_header['mtime'] = time(); - } - else { - $p_header['mtime'] = filemtime($p_filename); - } - - // ------ Look for file comment - if (isset($p_filedescr['comment'])) { - $p_header['comment_len'] = strlen($p_filedescr['comment']); - $p_header['comment'] = $p_filedescr['comment']; - } - else { - $p_header['comment_len'] = 0; - $p_header['comment'] = ''; - } - - // ----- Look for pre-add callback - if (isset($p_options[PCLZIP_CB_PRE_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_ADD].'(PCLZIP_CB_PRE_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_ADD](PCLZIP_CB_PRE_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_header['status'] = "skipped"; - $v_result = 1; - } - - // ----- Update the informations - // Only some fields can be modified - if ($p_header['stored_filename'] != $v_local_header['stored_filename']) { - $p_header['stored_filename'] = PclZipUtilPathReduction($v_local_header['stored_filename']); - } - } - - // ----- Look for empty stored filename - if ($p_header['stored_filename'] == "") { - $p_header['status'] = "filtered"; - } - - // ----- Check the path length - if (strlen($p_header['stored_filename']) > 0xFF) { - $p_header['status'] = 'filename_too_long'; - } - - // ----- Look if no error, or file not skipped - if ($p_header['status'] == 'ok') { - - // ----- Look for a file - if ($p_filedescr['type'] == 'file') { - // ----- Look for using temporary file to zip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_header['size'])) ) ) { - $v_result = $this->privAddFileUsingTempFile($p_filedescr, $p_header, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Use "in memory" zip algo - else { - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Read the file content - $v_content = @fread($v_file, $p_header['size']); - - // ----- Close the file - @fclose($v_file); - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - - } - - } - - // ----- Look for a virtual file (a file from string) - else if ($p_filedescr['type'] == 'virtual_file') { - - $v_content = $p_filedescr['content']; - - // ----- Calculate the CRC - $p_header['crc'] = @crc32($v_content); - - // ----- Look for no compression - if ($p_options[PCLZIP_OPT_NO_COMPRESSION]) { - // ----- Set header parameters - $p_header['compressed_size'] = $p_header['size']; - $p_header['compression'] = 0; - } - - // ----- Look for normal compression - else { - // ----- Compress the content - $v_content = @gzdeflate($v_content); - - // ----- Set header parameters - $p_header['compressed_size'] = strlen($v_content); - $p_header['compression'] = 8; - } - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - @fclose($v_file); - return $v_result; - } - - // ----- Write the compressed (or not) content - @fwrite($this->zip_fd, $v_content, $p_header['compressed_size']); - } - - // ----- Look for a directory - else if ($p_filedescr['type'] == 'folder') { - // ----- Look for directory last '/' - if (@substr($p_header['stored_filename'], -1) != '/') { - $p_header['stored_filename'] .= '/'; - } - - // ----- Set the file properties - $p_header['size'] = 0; - //$p_header['external'] = 0x41FF0010; // Value for a folder : to be checked - $p_header['external'] = 0x00000010; // Value for a folder : to be checked - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) - { - return $v_result; - } - } - } - - // ----- Look for post-add callback - if (isset($p_options[PCLZIP_CB_POST_ADD])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_header, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_ADD].'(PCLZIP_CB_POST_ADD, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_ADD](PCLZIP_CB_POST_ADD, $v_local_header); - if ($v_result == 0) { - // ----- Ignored - $v_result = 1; - } - - // ----- Update the informations - // Nothing can be modified - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privAddFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privAddFileUsingTempFile($p_filedescr, &$p_header, &$p_options) - { - $v_result=PCLZIP_ERR_NO_ERROR; - - // ----- Working variable - $p_filename = $p_filedescr['filename']; - - - // ----- Open the source file - if (($v_file = @fopen($p_filename, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, "Unable to open file '$p_filename' in binary read mode"); - return PclZip::errorCode(); - } - - // ----- Creates a compressed temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if ($this->bUseGzopen64) - { - if (($v_file_compressed = @gzopen64($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - } - else - { - if (($v_file_compressed = @gzopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = filesize($p_filename); - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @gzputs($v_file_compressed, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file); - @gzclose($v_file_compressed); - - // ----- Check the minimum file size - if (filesize($v_gzip_temp_name) < 18) { - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'gzip temporary file \''.$v_gzip_temp_name.'\' has invalid filesize - should be minimum 18 bytes'); - return PclZip::errorCode(); - } - - // ----- Extract the compressed attributes - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the gzip file header - $v_binary_data = @fread($v_file_compressed, 10); - $v_data_header = unpack('a1id1/a1id2/a1cm/a1flag/Vmtime/a1xfl/a1os', $v_binary_data); - - // ----- Check some parameters - $v_data_header['os'] = bin2hex($v_data_header['os']); - - // ----- Read the gzip file footer - @fseek($v_file_compressed, filesize($v_gzip_temp_name)-8); - $v_binary_data = @fread($v_file_compressed, 8); - $v_data_footer = unpack('Vcrc/Vcompressed_size', $v_binary_data); - - // ----- Set the attributes - $p_header['compression'] = ord($v_data_header['cm']); - //$p_header['mtime'] = $v_data_header['mtime']; - $p_header['crc'] = $v_data_footer['crc']; - $p_header['compressed_size'] = filesize($v_gzip_temp_name)-18; - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Call the header generation - if (($v_result = $this->privWriteFileHeader($p_header)) != 1) { - return $v_result; - } - - // ----- Add the compressed data - if (($v_file_compressed = @fopen($v_gzip_temp_name, "rb")) == 0) - { - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - fseek($v_file_compressed, 10); - $v_size = $p_header['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($v_file_compressed, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close the file - @fclose($v_file_compressed); - - // ----- Unlink the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCalculateStoredFilename() - // Description : - // Based on file descriptor properties and global options, this method - // calculate the filename that will be stored in the archive. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privCalculateStoredFilename(&$p_filedescr, &$p_options) - { - $v_result=1; - - // ----- Working variables - $p_filename = $p_filedescr['filename']; - if (isset($p_options[PCLZIP_OPT_ADD_PATH])) { - $p_add_dir = $p_options[PCLZIP_OPT_ADD_PATH]; - } - else { - $p_add_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_PATH])) { - $p_remove_dir = $p_options[PCLZIP_OPT_REMOVE_PATH]; - } - else { - $p_remove_dir = ''; - } - if (isset($p_options[PCLZIP_OPT_REMOVE_ALL_PATH])) { - $p_remove_all_dir = $p_options[PCLZIP_OPT_REMOVE_ALL_PATH]; - } - else { - $p_remove_all_dir = 0; - } - - - // ----- Look for full name change - if (isset($p_filedescr['new_full_name'])) { - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($p_filedescr['new_full_name']); - } - - // ----- Look for path and/or short name change - else { - - // ----- Look for short name change - // Its when we cahnge just the filename but not the path - if (isset($p_filedescr['new_short_name'])) { - $v_path_info = pathinfo($p_filename); - $v_dir = ''; - if ($v_path_info['dirname'] != '') { - $v_dir = $v_path_info['dirname'].'/'; - } - $v_stored_filename = $v_dir.$p_filedescr['new_short_name']; - } - else { - // ----- Calculate the stored filename - $v_stored_filename = $p_filename; - } - - // ----- Look for all path to remove - if ($p_remove_all_dir) { - $v_stored_filename = basename($p_filename); - } - // ----- Look for partial path remove - else if ($p_remove_dir != "") { - if (substr($p_remove_dir, -1) != '/') - $p_remove_dir .= "/"; - - if ( (substr($p_filename, 0, 2) == "./") - || (substr($p_remove_dir, 0, 2) == "./")) { - - if ( (substr($p_filename, 0, 2) == "./") - && (substr($p_remove_dir, 0, 2) != "./")) { - $p_remove_dir = "./".$p_remove_dir; - } - if ( (substr($p_filename, 0, 2) != "./") - && (substr($p_remove_dir, 0, 2) == "./")) { - $p_remove_dir = substr($p_remove_dir, 2); - } - } - - $v_compare = PclZipUtilPathInclusion($p_remove_dir, - $v_stored_filename); - if ($v_compare > 0) { - if ($v_compare == 2) { - $v_stored_filename = ""; - } - else { - $v_stored_filename = substr($v_stored_filename, - strlen($p_remove_dir)); - } - } - } - - // ----- Remove drive letter if any - $v_stored_filename = PclZipUtilTranslateWinPath($v_stored_filename); - - // ----- Look for path to add - if ($p_add_dir != "") { - if (substr($p_add_dir, -1) == "/") - $v_stored_filename = $p_add_dir.$v_stored_filename; - else - $v_stored_filename = $p_add_dir."/".$v_stored_filename; - } - } - - // ----- Filename (reduce the path of stored name) - $v_stored_filename = PclZipUtilPathReduction($v_stored_filename); - $p_filedescr['stored_filename'] = $v_stored_filename; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteFileHeader(&$p_header) - { - $v_result=1; - - // ----- Store the offset position of the file - $p_header['offset'] = ftell($this->zip_fd); - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - // ----- Packed data - $v_binary_data = pack("VvvvvvVVVvv", 0x04034b50, - $p_header['version_extracted'], $p_header['flag'], - $p_header['compression'], $v_mtime, $v_mdate, - $p_header['crc'], $p_header['compressed_size'], - $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len']); - - // ----- Write the first 148 bytes of the header in the archive - fputs($this->zip_fd, $v_binary_data, 30); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralFileHeader(&$p_header) - { - $v_result=1; - - // TBC - //for(reset($p_header); $key = key($p_header); next($p_header)) { - //} - - // ----- Transform UNIX mtime to DOS format mdate/mtime - $v_date = getdate($p_header['mtime']); - $v_mtime = ($v_date['hours']<<11) + ($v_date['minutes']<<5) + $v_date['seconds']/2; - $v_mdate = (($v_date['year']-1980)<<9) + ($v_date['mon']<<5) + $v_date['mday']; - - - // ----- Packed data - $v_binary_data = pack("VvvvvvvVVVvvvvvVV", 0x02014b50, - $p_header['version'], $p_header['version_extracted'], - $p_header['flag'], $p_header['compression'], - $v_mtime, $v_mdate, $p_header['crc'], - $p_header['compressed_size'], $p_header['size'], - strlen($p_header['stored_filename']), - $p_header['extra_len'], $p_header['comment_len'], - $p_header['disk'], $p_header['internal'], - $p_header['external'], $p_header['offset']); - - // ----- Write the 42 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 46); - - // ----- Write the variable fields - if (strlen($p_header['stored_filename']) != 0) - { - fputs($this->zip_fd, $p_header['stored_filename'], strlen($p_header['stored_filename'])); - } - if ($p_header['extra_len'] != 0) - { - fputs($this->zip_fd, $p_header['extra'], $p_header['extra_len']); - } - if ($p_header['comment_len'] != 0) - { - fputs($this->zip_fd, $p_header['comment'], $p_header['comment_len']); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privWriteCentralHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privWriteCentralHeader($p_nb_entries, $p_size, $p_offset, $p_comment) - { - $v_result=1; - - // ----- Packed data - $v_binary_data = pack("VvvvvVVv", 0x06054b50, 0, 0, $p_nb_entries, - $p_nb_entries, $p_size, - $p_offset, strlen($p_comment)); - - // ----- Write the 22 bytes of the header in the zip file - fputs($this->zip_fd, $v_binary_data, 22); - - // ----- Write the variable fields - if (strlen($p_comment) != 0) - { - fputs($this->zip_fd, $p_comment, strlen($p_comment)); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privList() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privList(&$p_list) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Open the zip file - if (($this->zip_fd = @fopen($this->zipname, 'rb')) == 0) - { - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive \''.$this->zipname.'\' in binary read mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Go to beginning of Central Dir - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_central_dir['offset'])) - { - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - for ($i=0; $i<$v_central_dir['entries']; $i++) - { - // ----- Read the file header - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - $v_header['index'] = $i; - - // ----- Get the only interesting attributes - $this->privConvertHeader2FileInfo($v_header, $p_list[$i]); - unset($v_header); - } - - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Magic quotes trick - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privConvertHeader2FileInfo() - // Description : - // This function takes the file informations from the central directory - // entries and extract the interesting parameters that will be given back. - // The resulting file infos are set in the array $p_info - // $p_info['filename'] : Filename with full path. Given by user (add), - // extracted in the filesystem (extract). - // $p_info['stored_filename'] : Stored filename in the archive. - // $p_info['size'] = Size of the file. - // $p_info['compressed_size'] = Compressed size of the file. - // $p_info['mtime'] = Last modification date of the file. - // $p_info['comment'] = Comment associated with the file. - // $p_info['folder'] = true/false : indicates if the entry is a folder or not. - // $p_info['status'] = status of the action on the file. - // $p_info['crc'] = CRC of the file content. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privConvertHeader2FileInfo($p_header, &$p_info) - { - $v_result=1; - - // ----- Get the interesting attributes - $v_temp_path = PclZipUtilPathReduction($p_header['filename']); - $p_info['filename'] = $v_temp_path; - $v_temp_path = PclZipUtilPathReduction($p_header['stored_filename']); - $p_info['stored_filename'] = $v_temp_path; - $p_info['size'] = $p_header['size']; - $p_info['compressed_size'] = $p_header['compressed_size']; - $p_info['mtime'] = $p_header['mtime']; - $p_info['comment'] = $p_header['comment']; - $p_info['folder'] = (($p_header['external']&0x00000010)==0x00000010); - $p_info['index'] = $p_header['index']; - $p_info['status'] = $p_header['status']; - $p_info['crc'] = $p_header['crc']; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractByRule() - // Description : - // Extract a file or directory depending of rules (by index, by name, ...) - // Parameters : - // $p_file_list : An array where will be placed the properties of each - // extracted file - // $p_path : Path to add while writing the extracted files - // $p_remove_path : Path to remove (from the file memorized path) while writing the - // extracted files. If the path does not match the file path, - // the file is extracted with its memorized path. - // $p_remove_path does not apply to 'list' mode. - // $p_path and $p_remove_path are commulative. - // Return Values : - // 1 on success,0 or less on error (see error code list) - // -------------------------------------------------------------------------------- - function privExtractByRule(&$p_file_list, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Magic quotes trick - $this->privDisableMagicQuotes(); - - // ----- Check the path - if ( ($p_path == "") - || ( (substr($p_path, 0, 1) != "/") - && (substr($p_path, 0, 3) != "../") - && (substr($p_path,1,2)!=":/"))) - $p_path = "./".$p_path; - - // ----- Reduce the path last (and duplicated) '/' - if (($p_path != "./") && ($p_path != "/")) - { - // ----- Look for the path end '/' - while (substr($p_path, -1) == "/") - { - $p_path = substr($p_path, 0, strlen($p_path)-1); - } - } - - // ----- Look for path to remove format (should end by /) - if (($p_remove_path != "") && (substr($p_remove_path, -1) != '/')) - { - $p_remove_path .= '/'; - } - $p_remove_path_size = strlen($p_remove_path); - - // ----- Open the zip file - if (($v_result = $this->privOpenFd('rb')) != 1) - { - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - - // ----- Read each entry - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read next Central dir entry - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header)) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Store the index - $v_header['index'] = $i; - - // ----- Store the file position - $v_pos_entry = ftell($this->zip_fd); - - // ----- Look for the specific extract rules - $v_extract = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_extract = true; - } - } - // ----- Look for a filename - elseif ($v_header['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_extract = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header['stored_filename'])) { - $v_extract = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_extract = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - - // ----- Look for no rule, which means extract all the archive - else { - $v_extract = true; - } - - // ----- Check compression method - if ( ($v_extract) - && ( ($v_header['compression'] != 8) - && ($v_header['compression'] != 0))) { - $v_header['status'] = 'unsupported_compression'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_COMPRESSION, - "Filename '".$v_header['stored_filename']."' is " - ."compressed by an unsupported compression " - ."method (".$v_header['compression'].") "); - - return PclZip::errorCode(); - } - } - - // ----- Check encrypted files - if (($v_extract) && (($v_header['flag'] & 1) == 1)) { - $v_header['status'] = 'unsupported_encryption'; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - $this->privSwapBackMagicQuotes(); - - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, - "Unsupported encryption for " - ." filename '".$v_header['stored_filename'] - ."'"); - - return PclZip::errorCode(); - } - } - - // ----- Look for real extraction - if (($v_extract) && ($v_header['status'] != 'ok')) { - $v_result = $this->privConvertHeader2FileInfo($v_header, - $p_file_list[$v_nb_extracted++]); - if ($v_result != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - $v_extract = false; - } - - // ----- Look for real extraction - if ($v_extract) - { - - // ----- Go to the file position - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_header['offset'])) - { - // ----- Close the zip file - $this->privCloseFd(); - - $this->privSwapBackMagicQuotes(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Look for extraction as string - if ($p_options[PCLZIP_OPT_EXTRACT_AS_STRING]) { - - $v_string = ''; - - // ----- Extracting the file - $v_result1 = $this->privExtractFileAsString($v_header, $v_string, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Set the file content - $p_file_list[$v_nb_extracted]['content'] = $v_string; - - // ----- Next extracted file - $v_nb_extracted++; - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for extraction in standard output - elseif ( (isset($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) - && ($p_options[PCLZIP_OPT_EXTRACT_IN_OUTPUT])) { - // ----- Extracting the file in standard output - $v_result1 = $this->privExtractFileInOutput($v_header, $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - // ----- Look for normal extraction - else { - // ----- Extracting the file - $v_result1 = $this->privExtractFile($v_header, - $p_path, $p_remove_path, - $p_remove_all_path, - $p_options); - if ($v_result1 < 1) { - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - return $v_result1; - } - - // ----- Get the only interesting attributes - if (($v_result = $this->privConvertHeader2FileInfo($v_header, $p_file_list[$v_nb_extracted++])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - return $v_result; - } - - // ----- Look for user callback abort - if ($v_result1 == 2) { - break; - } - } - } - } - - // ----- Close the zip file - $this->privCloseFd(); - $this->privSwapBackMagicQuotes(); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFile() - // Description : - // Parameters : - // Return Values : - // - // 1 : ... ? - // PCLZIP_ERR_USER_ABORTED(2) : User ask for extraction stop in callback - // -------------------------------------------------------------------------------- - function privExtractFile(&$p_entry, $p_path, $p_remove_path, $p_remove_all_path, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for all path to remove - if ($p_remove_all_path == true) { - // ----- Look for folder entry that not need to be extracted - if (($p_entry['external']&0x00000010)==0x00000010) { - - $p_entry['status'] = "filtered"; - - return $v_result; - } - - // ----- Get the basename of the path - $p_entry['filename'] = basename($p_entry['filename']); - } - - // ----- Look for path to remove - else if ($p_remove_path != "") - { - if (PclZipUtilPathInclusion($p_remove_path, $p_entry['filename']) == 2) - { - - // ----- Change the file status - $p_entry['status'] = "filtered"; - - // ----- Return - return $v_result; - } - - $p_remove_path_size = strlen($p_remove_path); - if (substr($p_entry['filename'], 0, $p_remove_path_size) == $p_remove_path) - { - - // ----- Remove the path - $p_entry['filename'] = substr($p_entry['filename'], $p_remove_path_size); - - } - } - - // ----- Add the path - if ($p_path != '') { - $p_entry['filename'] = $p_path."/".$p_entry['filename']; - } - - // ----- Check a base_dir_restriction - if (isset($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION])) { - $v_inclusion - = PclZipUtilPathInclusion($p_options[PCLZIP_OPT_EXTRACT_DIR_RESTRICTION], - $p_entry['filename']); - if ($v_inclusion == 0) { - - PclZip::privErrorLog(PCLZIP_ERR_DIRECTORY_RESTRICTION, - "Filename '".$p_entry['filename']."' is " - ."outside PCLZIP_OPT_EXTRACT_DIR_RESTRICTION"); - - return PclZip::errorCode(); - } - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Look for specific actions while the file exist - if (file_exists($p_entry['filename'])) - { - - // ----- Look if file is a directory - if (is_dir($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "already_a_directory"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_ALREADY_A_DIRECTORY, - "Filename '".$p_entry['filename']."' is " - ."already used by an existing directory"); - - return PclZip::errorCode(); - } - } - // ----- Look if file is write protected - else if (!is_writeable($p_entry['filename'])) - { - - // ----- Change the file status - $p_entry['status'] = "write_protected"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Filename '".$p_entry['filename']."' exists " - ."and is write protected"); - - return PclZip::errorCode(); - } - } - - // ----- Look if the extracted file is older - else if (filemtime($p_entry['filename']) > $p_entry['mtime']) - { - // ----- Change the file status - if ( (isset($p_options[PCLZIP_OPT_REPLACE_NEWER])) - && ($p_options[PCLZIP_OPT_REPLACE_NEWER]===true)) { - } - else { - $p_entry['status'] = "newer_exist"; - - // ----- Look for PCLZIP_OPT_STOP_ON_ERROR - // For historical reason first PclZip implementation does not stop - // when this kind of error occurs. - if ( (isset($p_options[PCLZIP_OPT_STOP_ON_ERROR])) - && ($p_options[PCLZIP_OPT_STOP_ON_ERROR]===true)) { - - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, - "Newer version of '".$p_entry['filename']."' exists " - ."and option PCLZIP_OPT_REPLACE_NEWER is not selected"); - - return PclZip::errorCode(); - } - } - } - else { - } - } - - // ----- Check the directory availability and create it if necessary - else { - if ((($p_entry['external']&0x00000010)==0x00000010) || (substr($p_entry['filename'], -1) == '/')) - $v_dir_to_check = $p_entry['filename']; - else if (!strstr($p_entry['filename'], "/")) - $v_dir_to_check = ""; - else - $v_dir_to_check = dirname($p_entry['filename']); - - if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) { - - // ----- Change the file status - $p_entry['status'] = "path_creation_fail"; - - // ----- Return - //return $v_result; - $v_result = 1; - } - } - } - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) - { - // ----- Look for not compressed file - if ($p_entry['compression'] == 0) { - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) - { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - // ----- Return - return $v_result; - } - - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - /* Try to speed up the code - $v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_binary_data, $v_read_size); - */ - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Closing the destination file - fclose($v_dest_file); - - // ----- Change the file mtime - touch($p_entry['filename'], $p_entry['mtime']); - - - } - else { - // ----- TBC - // Need to be finished - if (($p_entry['flag'] & 1) == 1) { - PclZip::privErrorLog(PCLZIP_ERR_UNSUPPORTED_ENCRYPTION, 'File \''.$p_entry['filename'].'\' is encrypted. Encrypted files are not supported.'); - return PclZip::errorCode(); - } - - - // ----- Look for using temporary file to unzip - if ( (!isset($p_options[PCLZIP_OPT_TEMP_FILE_OFF])) - && (isset($p_options[PCLZIP_OPT_TEMP_FILE_ON]) - || (isset($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD]) - && ($p_options[PCLZIP_OPT_TEMP_FILE_THRESHOLD] <= $p_entry['size'])) ) ) { - $v_result = $this->privExtractFileUsingTempFile($p_entry, $p_options); - if ($v_result < PCLZIP_ERR_NO_ERROR) { - return $v_result; - } - } - - // ----- Look for extract in memory - else { - - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = @gzinflate($v_buffer); - unset($v_buffer); - if ($v_file_content === FALSE) { - - // ----- Change the file status - // TBC - $p_entry['status'] = "error"; - - return $v_result; - } - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - - // ----- Change the file status - $p_entry['status'] = "write_error"; - - return $v_result; - } - - // ----- Write the uncompressed data - @fwrite($v_dest_file, $v_file_content, $p_entry['size']); - unset($v_file_content); - - // ----- Closing the destination file - @fclose($v_dest_file); - - } - - // ----- Change the file mtime - @touch($p_entry['filename'], $p_entry['mtime']); - } - - // ----- Look for chmod option - if (isset($p_options[PCLZIP_OPT_SET_CHMOD])) { - - // ----- Change the mode of the file - @chmod($p_entry['filename'], $p_options[PCLZIP_OPT_SET_CHMOD]); - } - - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileUsingTempFile() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileUsingTempFile(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Creates a temporary file - $v_gzip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.gz'; - if (($v_dest_file = @fopen($v_gzip_temp_name, "wb")) == 0) { - fclose($v_file); - PclZip::privErrorLog(PCLZIP_ERR_WRITE_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary write mode'); - return PclZip::errorCode(); - } - - - // ----- Write gz file format header - $v_binary_data = pack('va1a1Va1a1', 0x8b1f, Chr($p_entry['compression']), Chr(0x00), time(), Chr(0x00), Chr(3)); - @fwrite($v_dest_file, $v_binary_data, 10); - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['compressed_size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Write gz file format footer - $v_binary_data = pack('VV', $p_entry['crc'], $p_entry['size']); - @fwrite($v_dest_file, $v_binary_data, 8); - - // ----- Close the temporary file - @fclose($v_dest_file); - - // ----- Opening destination file - if (($v_dest_file = @fopen($p_entry['filename'], 'wb')) == 0) { - $p_entry['status'] = "write_error"; - return $v_result; - } - - // ----- Open the temporary gz file - if ($this->bUseGzopen64) - { - if (($v_src_file = @gzopen64($v_gzip_temp_name, 'rb')) == 0) { - @fclose($v_dest_file); - $p_entry['status'] = "read_error"; - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - } - else - { - if (($v_src_file = @gzopen($v_gzip_temp_name, 'rb')) == 0) { - @fclose($v_dest_file); - $p_entry['status'] = "read_error"; - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_gzip_temp_name.'\' in binary read mode'); - return PclZip::errorCode(); - } - } - - // ----- Read the file by PCLZIP_READ_BLOCK_SIZE octets blocks - $v_size = $p_entry['size']; - while ($v_size != 0) { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($v_src_file, $v_read_size); - //$v_binary_data = pack('a'.$v_read_size, $v_buffer); - @fwrite($v_dest_file, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - @fclose($v_dest_file); - @gzclose($v_src_file); - - // ----- Delete the temporary file - @unlink($v_gzip_temp_name); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileInOutput() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileInOutput(&$p_entry, &$p_options) - { - $v_result=1; - - // ----- Read the file header - if (($v_result = $this->privReadFileHeader($v_header)) != 1) { - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - // ----- Trace - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - if ($p_entry['compressed_size'] == $p_entry['size']) { - - // ----- Read the file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Send the file to the output - echo $v_buffer; - unset($v_buffer); - } - else { - - // ----- Read the compressed file in a buffer (one shot) - $v_buffer = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - $v_file_content = gzinflate($v_buffer); - unset($v_buffer); - - // ----- Send the file to the output - echo $v_file_content; - unset($v_file_content); - } - } - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privExtractFileAsString() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privExtractFileAsString(&$p_entry, &$p_string, &$p_options) - { - $v_result=1; - - // ----- Read the file header - $v_header = array(); - if (($v_result = $this->privReadFileHeader($v_header)) != 1) - { - // ----- Return - return $v_result; - } - - - // ----- Check that the file header is coherent with $p_entry info - if ($this->privCheckFileHeaders($v_header, $p_entry) != 1) { - // TBC - } - - // ----- Look for pre-extract callback - if (isset($p_options[PCLZIP_CB_PRE_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_PRE_EXTRACT](PCLZIP_CB_PRE_EXTRACT, $v_local_header); - if ($v_result == 0) { - // ----- Change the file status - $p_entry['status'] = "skipped"; - $v_result = 1; - } - - // ----- Look for abort result - if ($v_result == 2) { - // ----- This status is internal and will be changed in 'skipped' - $p_entry['status'] = "aborted"; - $v_result = PCLZIP_ERR_USER_ABORTED; - } - - // ----- Update the informations - // Only some fields can be modified - $p_entry['filename'] = $v_local_header['filename']; - } - - - // ----- Look if extraction should be done - if ($p_entry['status'] == 'ok') { - - // ----- Do the extraction (if not a folder) - if (!(($p_entry['external']&0x00000010)==0x00000010)) { - // ----- Look for not compressed file - // if ($p_entry['compressed_size'] == $p_entry['size']) - if ($p_entry['compression'] == 0) { - - // ----- Reading the file - $p_string = @fread($this->zip_fd, $p_entry['compressed_size']); - } - else { - - // ----- Reading the file - $v_data = @fread($this->zip_fd, $p_entry['compressed_size']); - - // ----- Decompress the file - if (($p_string = @gzinflate($v_data)) === FALSE) { - // TBC - } - } - - // ----- Trace - } - else { - // TBC : error : can not extract a folder in a string - } - - } - - // ----- Change abort status - if ($p_entry['status'] == "aborted") { - $p_entry['status'] = "skipped"; - } - - // ----- Look for post-extract callback - elseif (isset($p_options[PCLZIP_CB_POST_EXTRACT])) { - - // ----- Generate a local information - $v_local_header = array(); - $this->privConvertHeader2FileInfo($p_entry, $v_local_header); - - // ----- Swap the content to header - $v_local_header['content'] = $p_string; - $p_string = ''; - - // ----- Call the callback - // Here I do not use call_user_func() because I need to send a reference to the - // header. -// eval('$v_result = '.$p_options[PCLZIP_CB_POST_EXTRACT].'(PCLZIP_CB_POST_EXTRACT, $v_local_header);'); - $v_result = $p_options[PCLZIP_CB_POST_EXTRACT](PCLZIP_CB_POST_EXTRACT, $v_local_header); - - // ----- Swap back the content to header - $p_string = $v_local_header['content']; - unset($v_local_header['content']); - - // ----- Look for abort result - if ($v_result == 2) { - $v_result = PCLZIP_ERR_USER_ABORTED; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x04034b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 26); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 26) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vversion/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len', $v_binary_data); - - // ----- Get filename - $p_header['filename'] = fread($this->zip_fd, $v_data['filename_len']); - - // ----- Get extra_fields - if ($v_data['extra_len'] != 0) { - $p_header['extra'] = fread($this->zip_fd, $v_data['extra_len']); - } - else { - $p_header['extra'] = ''; - } - - // ----- Extract properties - $p_header['version_extracted'] = $v_data['version']; - $p_header['compression'] = $v_data['compression']; - $p_header['size'] = $v_data['size']; - $p_header['compressed_size'] = $v_data['compressed_size']; - $p_header['crc'] = $v_data['crc']; - $p_header['flag'] = $v_data['flag']; - $p_header['filename_len'] = $v_data['filename_len']; - - // ----- Recuperate date in UNIX format - $p_header['mdate'] = $v_data['mdate']; - $p_header['mtime'] = $v_data['mtime']; - if ($p_header['mdate'] && $p_header['mtime']) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // TBC - //for(reset($v_data); $key = key($v_data); next($v_data)) { - //} - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set the status field - $p_header['status'] = "ok"; - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadCentralFileHeader() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadCentralFileHeader(&$p_header) - { - $v_result=1; - - // ----- Read the 4 bytes signature - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] != 0x02014b50) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Invalid archive structure'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the first 42 bytes of the header - $v_binary_data = fread($this->zip_fd, 42); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 42) - { - $p_header['filename'] = ""; - $p_header['status'] = "invalid_header"; - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid block size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $p_header = unpack('vversion/vversion_extracted/vflag/vcompression/vmtime/vmdate/Vcrc/Vcompressed_size/Vsize/vfilename_len/vextra_len/vcomment_len/vdisk/vinternal/Vexternal/Voffset', $v_binary_data); - - // ----- Get filename - if ($p_header['filename_len'] != 0) - $p_header['filename'] = fread($this->zip_fd, $p_header['filename_len']); - else - $p_header['filename'] = ''; - - // ----- Get extra - if ($p_header['extra_len'] != 0) - $p_header['extra'] = fread($this->zip_fd, $p_header['extra_len']); - else - $p_header['extra'] = ''; - - // ----- Get comment - if ($p_header['comment_len'] != 0) - $p_header['comment'] = fread($this->zip_fd, $p_header['comment_len']); - else - $p_header['comment'] = ''; - - // ----- Extract properties - - // ----- Recuperate date in UNIX format - //if ($p_header['mdate'] && $p_header['mtime']) - // TBC : bug : this was ignoring time with 0/0/0 - if (1) - { - // ----- Extract time - $v_hour = ($p_header['mtime'] & 0xF800) >> 11; - $v_minute = ($p_header['mtime'] & 0x07E0) >> 5; - $v_seconde = ($p_header['mtime'] & 0x001F)*2; - - // ----- Extract date - $v_year = (($p_header['mdate'] & 0xFE00) >> 9) + 1980; - $v_month = ($p_header['mdate'] & 0x01E0) >> 5; - $v_day = $p_header['mdate'] & 0x001F; - - // ----- Get UNIX date format - $p_header['mtime'] = @mktime($v_hour, $v_minute, $v_seconde, $v_month, $v_day, $v_year); - - } - else - { - $p_header['mtime'] = time(); - } - - // ----- Set the stored filename - $p_header['stored_filename'] = $p_header['filename']; - - // ----- Set default status to ok - $p_header['status'] = 'ok'; - - // ----- Look if it is a directory - if (substr($p_header['filename'], -1) == '/') { - //$p_header['external'] = 0x41FF0010; - $p_header['external'] = 0x00000010; - } - - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privCheckFileHeaders() - // Description : - // Parameters : - // Return Values : - // 1 on success, - // 0 on error; - // -------------------------------------------------------------------------------- - function privCheckFileHeaders(&$p_local_header, &$p_central_header) - { - $v_result=1; - - // ----- Check the static values - // TBC - if ($p_local_header['filename'] != $p_central_header['filename']) { - } - if ($p_local_header['version_extracted'] != $p_central_header['version_extracted']) { - } - if ($p_local_header['flag'] != $p_central_header['flag']) { - } - if ($p_local_header['compression'] != $p_central_header['compression']) { - } - if ($p_local_header['mtime'] != $p_central_header['mtime']) { - } - if ($p_local_header['filename_len'] != $p_central_header['filename_len']) { - } - - // ----- Look for flag bit 3 - if (($p_local_header['flag'] & 8) == 8) { - $p_local_header['size'] = $p_central_header['size']; - $p_local_header['compressed_size'] = $p_central_header['compressed_size']; - $p_local_header['crc'] = $p_central_header['crc']; - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privReadEndCentralDir() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privReadEndCentralDir(&$p_central_dir) - { - $v_result=1; - - // ----- Go to the end of the zip file - $v_size = filesize($this->zipname); - @fseek($this->zip_fd, $v_size); - if (@ftell($this->zip_fd) != $v_size) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to go to the end of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- First try : look if this is an archive with no commentaries (most of the time) - // in this case the end of central dir is at 22 bytes of the file end - $v_found = 0; - if ($v_size > 26) { - @fseek($this->zip_fd, $v_size-22); - if (($v_pos = @ftell($this->zip_fd)) != ($v_size-22)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read for bytes - $v_binary_data = @fread($this->zip_fd, 4); - $v_data = @unpack('Vid', $v_binary_data); - - // ----- Check signature - if ($v_data['id'] == 0x06054b50) { - $v_found = 1; - } - - $v_pos = ftell($this->zip_fd); - } - - // ----- Go back to the maximum possible size of the Central Dir End Record - if (!$v_found) { - $v_maximum_size = 65557; // 0xFFFF + 22; - if ($v_maximum_size > $v_size) - $v_maximum_size = $v_size; - @fseek($this->zip_fd, $v_size-$v_maximum_size); - if (@ftell($this->zip_fd) != ($v_size-$v_maximum_size)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, 'Unable to seek back to the middle of the archive \''.$this->zipname.'\''); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read byte per byte in order to find the signature - $v_pos = ftell($this->zip_fd); - $v_bytes = 0x00000000; - while ($v_pos < $v_size) - { - // ----- Read a byte - $v_byte = @fread($this->zip_fd, 1); - - // ----- Add the byte - //$v_bytes = ($v_bytes << 8) | Ord($v_byte); - // Note we mask the old value down such that once shifted we can never end up with more than a 32bit number - // Otherwise on systems where we have 64bit integers the check below for the magic number will fail. - $v_bytes = ( ($v_bytes & 0xFFFFFF) << 8) | Ord($v_byte); - - // ----- Compare the bytes - if ($v_bytes == 0x504b0506) - { - $v_pos++; - break; - } - - $v_pos++; - } - - // ----- Look if not found end of central dir - if ($v_pos == $v_size) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Unable to find End of Central Dir Record signature"); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Read the first 18 bytes of the header - $v_binary_data = fread($this->zip_fd, 18); - - // ----- Look for invalid block size - if (strlen($v_binary_data) != 18) - { - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, "Invalid End of Central Dir Record size : ".strlen($v_binary_data)); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Extract the values - $v_data = unpack('vdisk/vdisk_start/vdisk_entries/ventries/Vsize/Voffset/vcomment_size', $v_binary_data); - - // ----- Check the global size - if (($v_pos + $v_data['comment_size'] + 18) != $v_size) { - - // ----- Removed in release 2.2 see readme file - // The check of the file size is a little too strict. - // Some bugs where found when a zip is encrypted/decrypted with 'crypt'. - // While decrypted, zip has training 0 bytes - if (0) { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_BAD_FORMAT, - 'The central dir is not at the end of the archive.' - .' Some trailing bytes exists after the archive.'); - - // ----- Return - return PclZip::errorCode(); - } - } - - // ----- Get comment - if ($v_data['comment_size'] != 0) { - $p_central_dir['comment'] = fread($this->zip_fd, $v_data['comment_size']); - } - else - $p_central_dir['comment'] = ''; - - $p_central_dir['entries'] = $v_data['entries']; - $p_central_dir['disk_entries'] = $v_data['disk_entries']; - $p_central_dir['offset'] = $v_data['offset']; - $p_central_dir['size'] = $v_data['size']; - $p_central_dir['disk'] = $v_data['disk']; - $p_central_dir['disk_start'] = $v_data['disk_start']; - - // TBC - //for(reset($p_central_dir); $key = key($p_central_dir); next($p_central_dir)) { - //} - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDeleteByRule() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDeleteByRule(&$p_result_list, &$p_options) - { - $v_result=1; - $v_list_detail = array(); - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Scan all the files - // ----- Start at beginning of Central Dir - $v_pos_entry = $v_central_dir['offset']; - @rewind($this->zip_fd); - if (@fseek($this->zip_fd, $v_pos_entry)) - { - // ----- Close the zip file - $this->privCloseFd(); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read each entry - $v_header_list = array(); - $j_start = 0; - for ($i=0, $v_nb_extracted=0; $i<$v_central_dir['entries']; $i++) - { - - // ----- Read the file header - $v_header_list[$v_nb_extracted] = array(); - if (($v_result = $this->privReadCentralFileHeader($v_header_list[$v_nb_extracted])) != 1) - { - // ----- Close the zip file - $this->privCloseFd(); - - return $v_result; - } - - - // ----- Store the index - $v_header_list[$v_nb_extracted]['index'] = $i; - - // ----- Look for the specific extract rules - $v_found = false; - - // ----- Look for extract by name rule - if ( (isset($p_options[PCLZIP_OPT_BY_NAME])) - && ($p_options[PCLZIP_OPT_BY_NAME] != 0)) { - - // ----- Look if the filename is in the list - for ($j=0; ($j strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) - && (substr($v_header_list[$v_nb_extracted]['stored_filename'], 0, strlen($p_options[PCLZIP_OPT_BY_NAME][$j])) == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - elseif ( (($v_header_list[$v_nb_extracted]['external']&0x00000010)==0x00000010) /* Indicates a folder */ - && ($v_header_list[$v_nb_extracted]['stored_filename'].'/' == $p_options[PCLZIP_OPT_BY_NAME][$j])) { - $v_found = true; - } - } - // ----- Look for a filename - elseif ($v_header_list[$v_nb_extracted]['stored_filename'] == $p_options[PCLZIP_OPT_BY_NAME][$j]) { - $v_found = true; - } - } - } - - // ----- Look for extract by ereg rule - // ereg() is deprecated with PHP 5.3 - /* - else if ( (isset($p_options[PCLZIP_OPT_BY_EREG])) - && ($p_options[PCLZIP_OPT_BY_EREG] != "")) { - - if (ereg($p_options[PCLZIP_OPT_BY_EREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - */ - - // ----- Look for extract by preg rule - else if ( (isset($p_options[PCLZIP_OPT_BY_PREG])) - && ($p_options[PCLZIP_OPT_BY_PREG] != "")) { - - if (preg_match($p_options[PCLZIP_OPT_BY_PREG], $v_header_list[$v_nb_extracted]['stored_filename'])) { - $v_found = true; - } - } - - // ----- Look for extract by index rule - else if ( (isset($p_options[PCLZIP_OPT_BY_INDEX])) - && ($p_options[PCLZIP_OPT_BY_INDEX] != 0)) { - - // ----- Look if the index is in the list - for ($j=$j_start; ($j=$p_options[PCLZIP_OPT_BY_INDEX][$j]['start']) && ($i<=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end'])) { - $v_found = true; - } - if ($i>=$p_options[PCLZIP_OPT_BY_INDEX][$j]['end']) { - $j_start = $j+1; - } - - if ($p_options[PCLZIP_OPT_BY_INDEX][$j]['start']>$i) { - break; - } - } - } - else { - $v_found = true; - } - - // ----- Look for deletion - if ($v_found) - { - unset($v_header_list[$v_nb_extracted]); - } - else - { - $v_nb_extracted++; - } - } - - // ----- Look if something need to be deleted - if ($v_nb_extracted > 0) { - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Creates a temporary zip archive - $v_temp_zip = new PclZip($v_zip_temp_name); - - // ----- Open the temporary zip file in write mode - if (($v_result = $v_temp_zip->privOpenFd('wb')) != 1) { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Look which file need to be kept - for ($i=0; $izip_fd); - if (@fseek($this->zip_fd, $v_header_list[$i]['offset'])) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_INVALID_ARCHIVE_ZIP, 'Invalid archive size'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Read the file header - $v_local_header = array(); - if (($v_result = $this->privReadFileHeader($v_local_header)) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Check that local file header is same as central file header - if ($this->privCheckFileHeaders($v_local_header, - $v_header_list[$i]) != 1) { - // TBC - } - unset($v_local_header); - - // ----- Write the file header - if (($v_result = $v_temp_zip->privWriteFileHeader($v_header_list[$i])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Read/write the data block - if (($v_result = PclZipUtilCopyBlock($this->zip_fd, $v_temp_zip->zip_fd, $v_header_list[$i]['compressed_size'])) != 1) { - // ----- Close the zip file - $this->privCloseFd(); - $v_temp_zip->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_temp_zip->zip_fd); - - // ----- Re-Create the Central Dir files header - for ($i=0; $iprivWriteCentralFileHeader($v_header_list[$i])) != 1) { - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Transform the header to a 'usable' info - $v_temp_zip->privConvertHeader2FileInfo($v_header_list[$i], $p_result_list[$i]); - } - - - // ----- Zip file comment - $v_comment = ''; - if (isset($p_options[PCLZIP_OPT_COMMENT])) { - $v_comment = $p_options[PCLZIP_OPT_COMMENT]; - } - - // ----- Calculate the size of the central header - $v_size = @ftell($v_temp_zip->zip_fd)-$v_offset; - - // ----- Create the central dir footer - if (($v_result = $v_temp_zip->privWriteCentralHeader(sizeof($v_header_list), $v_size, $v_offset, $v_comment)) != 1) { - // ----- Reset the file list - unset($v_header_list); - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - @unlink($v_zip_temp_name); - - // ----- Return - return $v_result; - } - - // ----- Close - $v_temp_zip->privCloseFd(); - $this->privCloseFd(); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Destroy the temporary archive - unset($v_temp_zip); - } - - // ----- Remove every files : reset the file - else if ($v_central_dir['entries'] != 0) { - $this->privCloseFd(); - - if (($v_result = $this->privOpenFd('wb')) != 1) { - return $v_result; - } - - if (($v_result = $this->privWriteCentralHeader(0, 0, 0, '')) != 1) { - return $v_result; - } - - $this->privCloseFd(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDirCheck() - // Description : - // Check if a directory exists, if not it creates it and all the parents directory - // which may be useful. - // Parameters : - // $p_dir : Directory path to check. - // Return Values : - // 1 : OK - // -1 : Unable to create directory - // -------------------------------------------------------------------------------- - function privDirCheck($p_dir, $p_is_dir=false) - { - $v_result = 1; - - - // ----- Remove the final '/' - if (($p_is_dir) && (substr($p_dir, -1)=='/')) - { - $p_dir = substr($p_dir, 0, strlen($p_dir)-1); - } - - // ----- Check the directory availability - if ((is_dir($p_dir)) || ($p_dir == "")) - { - return 1; - } - - // ----- Extract parent directory - $p_parent_dir = dirname($p_dir); - - // ----- Just a check - if ($p_parent_dir != $p_dir) - { - // ----- Look for parent directory - if ($p_parent_dir != "") - { - if (($v_result = $this->privDirCheck($p_parent_dir)) != 1) - { - return $v_result; - } - } - } - - // ----- Create the directory - if (!@mkdir($p_dir, 0777)) - { - // ----- Error log - PclZip::privErrorLog(PCLZIP_ERR_DIR_CREATE_FAIL, "Unable to create directory '$p_dir'"); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privMerge() - // Description : - // If $p_archive_to_add does not exist, the function exit with a success result. - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privMerge(&$p_archive_to_add) - { - $v_result=1; - - // ----- Look if the archive_to_add exists - if (!is_file($p_archive_to_add->zipname)) - { - - // ----- Nothing to merge, so merge is a success - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Look if the archive exists - if (!is_file($this->zipname)) - { - - // ----- Do a duplicate - $v_result = $this->privDuplicate($p_archive_to_add->zipname); - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('rb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir = array(); - if (($v_result = $this->privReadEndCentralDir($v_central_dir)) != 1) - { - $this->privCloseFd(); - return $v_result; - } - - // ----- Go to beginning of File - @rewind($this->zip_fd); - - // ----- Open the archive_to_add file - if (($v_result=$p_archive_to_add->privOpenFd('rb')) != 1) - { - $this->privCloseFd(); - - // ----- Return - return $v_result; - } - - // ----- Read the central directory informations - $v_central_dir_to_add = array(); - if (($v_result = $p_archive_to_add->privReadEndCentralDir($v_central_dir_to_add)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - return $v_result; - } - - // ----- Go to beginning of File - @rewind($p_archive_to_add->zip_fd); - - // ----- Creates a temporay file - $v_zip_temp_name = PCLZIP_TEMPORARY_DIR.uniqid('pclzip-').'.tmp'; - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($v_zip_temp_name, 'wb')) == 0) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open temporary file \''.$v_zip_temp_name.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = $v_central_dir['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the files from the archive_to_add into the temporary file - $v_size = $v_central_dir_to_add['offset']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Store the offset of the central dir - $v_offset = @ftell($v_zip_temp_fd); - - // ----- Copy the block of file headers from the old archive - $v_size = $v_central_dir['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($this->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Copy the block of file headers from the archive_to_add - $v_size = $v_central_dir_to_add['size']; - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_archive_to_add->zip_fd, $v_read_size); - @fwrite($v_zip_temp_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Merge the file comments - $v_comment = $v_central_dir['comment'].' '.$v_central_dir_to_add['comment']; - - // ----- Calculate the size of the (new) central header - $v_size = @ftell($v_zip_temp_fd)-$v_offset; - - // ----- Swap the file descriptor - // Here is a trick : I swap the temporary fd with the zip fd, in order to use - // the following methods on the temporary fil and not the real archive fd - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Create the central dir footer - if (($v_result = $this->privWriteCentralHeader($v_central_dir['entries']+$v_central_dir_to_add['entries'], $v_size, $v_offset, $v_comment)) != 1) - { - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - @fclose($v_zip_temp_fd); - $this->zip_fd = null; - - // ----- Reset the file list - unset($v_header_list); - - // ----- Return - return $v_result; - } - - // ----- Swap back the file descriptor - $v_swap = $this->zip_fd; - $this->zip_fd = $v_zip_temp_fd; - $v_zip_temp_fd = $v_swap; - - // ----- Close - $this->privCloseFd(); - $p_archive_to_add->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Delete the zip file - // TBC : I should test the result ... - @unlink($this->zipname); - - // ----- Rename the temporary file - // TBC : I should test the result ... - //@rename($v_zip_temp_name, $this->zipname); - PclZipUtilRename($v_zip_temp_name, $this->zipname); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDuplicate() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDuplicate($p_archive_filename) - { - $v_result=1; - - // ----- Look if the $p_archive_filename exists - if (!is_file($p_archive_filename)) - { - - // ----- Nothing to duplicate, so duplicate is a success. - $v_result = 1; - - // ----- Return - return $v_result; - } - - // ----- Open the zip file - if (($v_result=$this->privOpenFd('wb')) != 1) - { - // ----- Return - return $v_result; - } - - // ----- Open the temporary file in write mode - if (($v_zip_temp_fd = @fopen($p_archive_filename, 'rb')) == 0) - { - $this->privCloseFd(); - - PclZip::privErrorLog(PCLZIP_ERR_READ_OPEN_FAIL, 'Unable to open archive file \''.$p_archive_filename.'\' in binary write mode'); - - // ----- Return - return PclZip::errorCode(); - } - - // ----- Copy the files from the archive to the temporary file - // TBC : Here I should better append the file and go back to erase the central dir - $v_size = filesize($p_archive_filename); - while ($v_size != 0) - { - $v_read_size = ($v_size < PCLZIP_READ_BLOCK_SIZE ? $v_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = fread($v_zip_temp_fd, $v_read_size); - @fwrite($this->zip_fd, $v_buffer, $v_read_size); - $v_size -= $v_read_size; - } - - // ----- Close - $this->privCloseFd(); - - // ----- Close the temporary file - @fclose($v_zip_temp_fd); - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorLog() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorLog($p_error_code=0, $p_error_string='') - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclError($p_error_code, $p_error_string); - } - else { - $this->error_code = $p_error_code; - $this->error_string = $p_error_string; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privErrorReset() - // Description : - // Parameters : - // -------------------------------------------------------------------------------- - function privErrorReset() - { - if (PCLZIP_ERROR_EXTERNAL == 1) { - PclErrorReset(); - } - else { - $this->error_code = 0; - $this->error_string = ''; - } - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privDisableMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privDisableMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if already done - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Get and memorize the magic_quote value - $this->magic_quotes_status = @get_magic_quotes_runtime(); - - // ----- Disable magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime(0); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : privSwapBackMagicQuotes() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function privSwapBackMagicQuotes() - { - $v_result=1; - - // ----- Look if function exists - if ( (!function_exists("get_magic_quotes_runtime")) - || (!function_exists("set_magic_quotes_runtime"))) { - return $v_result; - } - - // ----- Look if something to do - if ($this->magic_quotes_status != -1) { - return $v_result; - } - - // ----- Swap back magic_quotes - if ($this->magic_quotes_status == 1) { - @set_magic_quotes_runtime($this->magic_quotes_status); - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - } - // End of class - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathReduction() - // Description : - // Parameters : - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilPathReduction($p_dir) - { - $v_result = ""; - - // ----- Look for not empty path - if ($p_dir != "") { - // ----- Explode path by directory names - $v_list = explode("/", $p_dir); - - // ----- Study directories from last to first - $v_skip = 0; - for ($i=sizeof($v_list)-1; $i>=0; $i--) { - // ----- Look for current path - if ($v_list[$i] == ".") { - // ----- Ignore this directory - // Should be the first $i=0, but no check is done - } - else if ($v_list[$i] == "..") { - $v_skip++; - } - else if ($v_list[$i] == "") { - // ----- First '/' i.e. root slash - if ($i == 0) { - $v_result = "/".$v_result; - if ($v_skip > 0) { - // ----- It is an invalid path, so the path is not modified - // TBC - $v_result = $p_dir; - $v_skip = 0; - } - } - // ----- Last '/' i.e. indicates a directory - else if ($i == (sizeof($v_list)-1)) { - $v_result = $v_list[$i]; - } - // ----- Double '/' inside the path - else { - // ----- Ignore only the double '//' in path, - // but not the first and last '/' - } - } - else { - // ----- Look for item to skip - if ($v_skip > 0) { - $v_skip--; - } - else { - $v_result = $v_list[$i].($i!=(sizeof($v_list)-1)?"/".$v_result:""); - } - } - } - - // ----- Look for skip - if ($v_skip > 0) { - while ($v_skip > 0) { - $v_result = '../'.$v_result; - $v_skip--; - } - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilPathInclusion() - // Description : - // This function indicates if the path $p_path is under the $p_dir tree. Or, - // said in an other way, if the file or sub-dir $p_path is inside the dir - // $p_dir. - // The function indicates also if the path is exactly the same as the dir. - // This function supports path with duplicated '/' like '//', but does not - // support '.' or '..' statements. - // Parameters : - // Return Values : - // 0 if $p_path is not inside directory $p_dir - // 1 if $p_path is inside directory $p_dir - // 2 if $p_path is exactly the same as $p_dir - // -------------------------------------------------------------------------------- - function PclZipUtilPathInclusion($p_dir, $p_path) - { - $v_result = 1; - - // ----- Look for path beginning by ./ - if ( ($p_dir == '.') - || ((strlen($p_dir) >=2) && (substr($p_dir, 0, 2) == './'))) { - $p_dir = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_dir, 1); - } - if ( ($p_path == '.') - || ((strlen($p_path) >=2) && (substr($p_path, 0, 2) == './'))) { - $p_path = PclZipUtilTranslateWinPath(getcwd(), FALSE).'/'.substr($p_path, 1); - } - - // ----- Explode dir and path by directory separator - $v_list_dir = explode("/", $p_dir); - $v_list_dir_size = sizeof($v_list_dir); - $v_list_path = explode("/", $p_path); - $v_list_path_size = sizeof($v_list_path); - - // ----- Study directories paths - $i = 0; - $j = 0; - while (($i < $v_list_dir_size) && ($j < $v_list_path_size) && ($v_result)) { - - // ----- Look for empty dir (path reduction) - if ($v_list_dir[$i] == '') { - $i++; - continue; - } - if ($v_list_path[$j] == '') { - $j++; - continue; - } - - // ----- Compare the items - if (($v_list_dir[$i] != $v_list_path[$j]) && ($v_list_dir[$i] != '') && ( $v_list_path[$j] != '')) { - $v_result = 0; - } - - // ----- Next items - $i++; - $j++; - } - - // ----- Look if everything seems to be the same - if ($v_result) { - // ----- Skip all the empty items - while (($j < $v_list_path_size) && ($v_list_path[$j] == '')) $j++; - while (($i < $v_list_dir_size) && ($v_list_dir[$i] == '')) $i++; - - if (($i >= $v_list_dir_size) && ($j >= $v_list_path_size)) { - // ----- There are exactly the same - $v_result = 2; - } - else if ($i < $v_list_dir_size) { - // ----- The path is shorter than the dir - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilCopyBlock() - // Description : - // Parameters : - // $p_mode : read/write compression mode - // 0 : src & dest normal - // 1 : src gzip, dest normal - // 2 : src normal, dest gzip - // 3 : src & dest gzip - // Return Values : - // -------------------------------------------------------------------------------- - function PclZipUtilCopyBlock($p_src, $p_dest, $p_size, $p_mode=0) - { - $v_result = 1; - - if ($p_mode==0) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==1) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @fwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==2) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @fread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - else if ($p_mode==3) - { - while ($p_size != 0) - { - $v_read_size = ($p_size < PCLZIP_READ_BLOCK_SIZE ? $p_size : PCLZIP_READ_BLOCK_SIZE); - $v_buffer = @gzread($p_src, $v_read_size); - @gzwrite($p_dest, $v_buffer, $v_read_size); - $p_size -= $v_read_size; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilRename() - // Description : - // This function tries to do a simple rename() function. If it fails, it - // tries to copy the $p_src file in a new $p_dest file and then unlink the - // first one. - // Parameters : - // $p_src : Old filename - // $p_dest : New filename - // Return Values : - // 1 on success, 0 on failure. - // -------------------------------------------------------------------------------- - function PclZipUtilRename($p_src, $p_dest) - { - $v_result = 1; - - // ----- Try to rename the files - if (!@rename($p_src, $p_dest)) { - - // ----- Try to copy & unlink the src - if (!@copy($p_src, $p_dest)) { - $v_result = 0; - } - else if (!@unlink($p_src)) { - $v_result = 0; - } - } - - // ----- Return - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilOptionText() - // Description : - // Translate option value in text. Mainly for debug purpose. - // Parameters : - // $p_option : the option value. - // Return Values : - // The option text value. - // -------------------------------------------------------------------------------- - function PclZipUtilOptionText($p_option) - { - - $v_list = get_defined_constants(); - for (reset($v_list); $v_key = key($v_list); next($v_list)) { - $v_prefix = substr($v_key, 0, 10); - if (( ($v_prefix == 'PCLZIP_OPT') - || ($v_prefix == 'PCLZIP_CB_') - || ($v_prefix == 'PCLZIP_ATT')) - && ($v_list[$v_key] == $p_option)) { - return $v_key; - } - } - - $v_result = 'Unknown'; - - return $v_result; - } - // -------------------------------------------------------------------------------- - - // -------------------------------------------------------------------------------- - // Function : PclZipUtilTranslateWinPath() - // Description : - // Translate windows path by replacing '\' by '/' and optionally removing - // drive letter. - // Parameters : - // $p_path : path to translate. - // $p_remove_disk_letter : true | false - // Return Values : - // The path translated. - // -------------------------------------------------------------------------------- - function PclZipUtilTranslateWinPath($p_path, $p_remove_disk_letter=true) - { - if (stristr(php_uname(), 'windows')) { - // ----- Look for potential disk letter - if (($p_remove_disk_letter) && (($v_position = strpos($p_path, ':')) != false)) { - $p_path = substr($p_path, $v_position+1); - } - // ----- Change potential windows directory separator - if ((strpos($p_path, '\\') > 0) || (substr($p_path, 0,1) == '\\')) { - $p_path = strtr($p_path, '\\', '/'); - } - } - return $p_path; - } - // -------------------------------------------------------------------------------- - - diff --git a/rainloop/v/0.0.0/app/libraries/pclzip/readme.txt b/rainloop/v/0.0.0/app/libraries/pclzip/readme.txt deleted file mode 100644 index 6ed8839477..0000000000 --- a/rainloop/v/0.0.0/app/libraries/pclzip/readme.txt +++ /dev/null @@ -1,421 +0,0 @@ -// -------------------------------------------------------------------------------- -// PclZip 2.8.2 - readme.txt -// -------------------------------------------------------------------------------- -// License GNU/LGPL - August 2009 -// Vincent Blavet - vincent@phpconcept.net -// http://www.phpconcept.net -// -------------------------------------------------------------------------------- -// $Id: readme.txt,v 1.60 2009/09/30 20:35:21 vblavet Exp $ -// -------------------------------------------------------------------------------- - - - -0 - Sommaire -============ - 1 - Introduction - 2 - What's new - 3 - Corrected bugs - 4 - Known bugs or limitations - 5 - License - 6 - Warning - 7 - Documentation - 8 - Author - 9 - Contribute - -1 - Introduction -================ - - PclZip is a library that allow you to manage a Zip archive. - - Full documentation about PclZip can be found here : http://www.phpconcept.net/pclzip - -2 - What's new -============== - - Version 2.8.2 : - - PCLZIP_CB_PRE_EXTRACT and PCLZIP_CB_POST_EXTRACT are now supported with - extraction as a string (PCLZIP_OPT_EXTRACT_AS_STRING). The string - can also be modified in the post-extract call back. - **Bugs correction : - - PCLZIP_OPT_REMOVE_ALL_PATH was not working correctly - - Remove use of eval() and do direct call to callback functions - - Correct support of 64bits systems (Thanks to WordPress team) - - Version 2.8.1 : - - Move option PCLZIP_OPT_BY_EREG to PCLZIP_OPT_BY_PREG because ereg() is - deprecated in PHP 5.3. When using option PCLZIP_OPT_BY_EREG, PclZip will - automatically replace it by PCLZIP_OPT_BY_PREG. - - Version 2.8 : - - Improve extraction of zip archive for large files by using temporary files - This feature is working like the one defined in r2.7. - Options are renamed : PCLZIP_OPT_TEMP_FILE_ON, PCLZIP_OPT_TEMP_FILE_OFF, - PCLZIP_OPT_TEMP_FILE_THRESHOLD - - Add a ratio constant PCLZIP_TEMPORARY_FILE_RATIO to configure the auto - sense of temporary file use. - - Bug correction : Reduce filepath in returned file list to remove ennoying - './/' preambule in file path. - - Version 2.7 : - - Improve creation of zip archive for large files : - PclZip will now autosense the configured memory and use temporary files - when large file is suspected. - This feature can also ne triggered by manual options in create() and add() - methods. 'PCLZIP_OPT_ADD_TEMP_FILE_ON' force the use of temporary files, - 'PCLZIP_OPT_ADD_TEMP_FILE_OFF' disable the autosense technic, - 'PCLZIP_OPT_ADD_TEMP_FILE_THRESHOLD' allow for configuration of a size - threshold to use temporary files. - Using "temporary files" rather than "memory" might take more time, but - might give the ability to zip very large files : - Tested on my win laptop with a 88Mo file : - Zip "in-memory" : 18sec (max_execution_time=30, memory_limit=180Mo) - Zip "tmporary-files" : 23sec (max_execution_time=30, memory_limit=30Mo) - - Replace use of mktime() by time() to limit the E_STRICT error messages. - - Bug correction : When adding files with full windows path (drive letter) - PclZip is now working. Before, if the drive letter is not the default - path, PclZip was not able to add the file. - - Version 2.6 : - - Code optimisation - - New attributes PCLZIP_ATT_FILE_COMMENT gives the ability to - add a comment for a specific file. (Don't really know if this is usefull) - - New attribute PCLZIP_ATT_FILE_CONTENT gives the ability to add a string - as a file. - - New attribute PCLZIP_ATT_FILE_MTIME modify the timestamp associated with - a file. - - Correct a bug. Files archived with a timestamp with 0h0m0s were extracted - with current time - - Add CRC value in the informations returned back for each file after an - action. - - Add missing closedir() statement. - - When adding a folder, and removing the path of this folder, files were - incorrectly added with a '/' at the beginning. Which means files are - related to root in unix systems. Corrected. - - Add conditional if before constant definition. This will allow users - to redefine constants without changing the file, and then improve - upgrade of pclzip code for new versions. - - Version 2.5 : - - Introduce the ability to add file/folder with individual properties (file descriptor). - This gives for example the ability to change the filename of a zipped file. - . Able to add files individually - . Able to change full name - . Able to change short name - . Compatible with global options - - New attributes : PCLZIP_ATT_FILE_NAME, PCLZIP_ATT_FILE_NEW_SHORT_NAME, PCLZIP_ATT_FILE_NEW_FULL_NAME - - New error code : PCLZIP_ERR_INVALID_ATTRIBUTE_VALUE - - Add a security control feature. PclZip can extract any file in any folder - of a system. People may use this to upload a zip file and try to override - a system file. The PCLZIP_OPT_EXTRACT_DIR_RESTRICTION will give the - ability to forgive any directory transversal behavior. - - New PCLZIP_OPT_EXTRACT_DIR_RESTRICTION : check extraction path - - New error code : PCLZIP_ERR_DIRECTORY_RESTRICTION - - Modification in PclZipUtilPathInclusion() : dir and path beginning with ./ will be prepend - by current path (getcwd()) - - Version 2.4 : - - Code improvment : try to speed up the code by removing unusefull call to pack() - - Correct bug in delete() : delete() should be called with no argument. This was not - the case in 2.3. This is corrected in 2.4. - - Correct a bug in path_inclusion function. When the path has several '../../', the - result was bad. - - Add a check for magic_quotes_runtime configuration. If enabled, PclZip will - disable it while working and det it back to its original value. - This resolve a lots of bad formated archive errors. - - Bug correction : PclZip now correctly unzip file in some specific situation, - when compressed content has same size as uncompressed content. - - Bug correction : When selecting option 'PCLZIP_OPT_REMOVE_ALL_PATH', - directories are not any more created. - - Code improvment : correct unclosed opendir(), better handling of . and .. in - loops. - - - Version 2.3 : - - Correct a bug with PHP5 : affecting the value 0xFE49FFE0 to a variable does not - give the same result in PHP4 and PHP5 .... - - Version 2.2 : - - Try development of PCLZIP_OPT_CRYPT ..... - However this becomes to a stop. To crypt/decrypt I need to multiply 2 long integers, - the result (greater than a long) is not supported by PHP. Even the use of bcmath - functions does not help. I did not find yet a solution ...; - - Add missing '/' at end of directory entries - - Check is a file is encrypted or not. Returns status 'unsupported_encryption' and/or - error code PCLZIP_ERR_UNSUPPORTED_ENCRYPTION. - - Corrected : Bad "version need to extract" field in local file header - - Add private method privCheckFileHeaders() in order to check local and central - file headers. PclZip is now supporting purpose bit flag bit 3. Purpose bit flag bit 3 gives - the ability to have a local file header without size, compressed size and crc filled. - - Add a generic status 'error' for file status - - Add control of compression type. PclZip only support deflate compression method. - Before v2.2, PclZip does not check the compression method used in an archive while - extracting. With v2.2 PclZip returns a new error status for a file using an unsupported - compression method. New status is "unsupported_compression". New error code is - PCLZIP_ERR_UNSUPPORTED_COMPRESSION. - - Add optional attribute PCLZIP_OPT_STOP_ON_ERROR. This will stop the extract of files - when errors like 'a folder with same name exists' or 'a newer file exists' or - 'a write protected file' exists, rather than set a status for the concerning file - and resume the extract of the zip. - - Add optional attribute PCLZIP_OPT_REPLACE_NEWER. This will force, during an extract' the - replacement of the file, even if a newer version of the file exists. - Note that today if a file with the same name already exists but is older it will be - replaced by the extracted one. - - Improve PclZipUtilOption() - - Support of zip archive with trailing bytes. Before 2.2, PclZip checks that the central - directory structure is the last data in the archive. Crypt encryption/decryption of - zip archive put trailing 0 bytes after decryption. PclZip is now supporting this. - - Version 2.1 : - - Add the ability to abort the extraction by using a user callback function. - The user can now return the value '2' in its callback which indicates to stop the - extraction. For a pre call-back extract is stopped before the extration of the current - file. For a post call back, the extraction is stopped after. - - Add the ability to extract a file (or several files) directly in the standard output. - This is done by the new parameter PCLZIP_OPT_EXTRACT_IN_OUTPUT with method extract(). - - Add support for parameters PCLZIP_OPT_COMMENT, PCLZIP_OPT_ADD_COMMENT, - PCLZIP_OPT_PREPEND_COMMENT. This will create, replace, add, or prepend comments - in the zip archive. - - When merging two archives, the comments are not any more lost, but merged, with a - blank space separator. - - Corrected bug : Files are not deleted when all files are asked to be deleted. - - Corrected bug : Folders with name '0' made PclZip to abort the create or add feature. - - - Version 2.0 : - ***** Warning : Some new features may break the backward compatibility for your scripts. - Please carefully read the readme file. - - Add the ability to delete by Index, name and regular expression. This feature is - performed by the method delete(), which uses the optional parameters - PCLZIP_OPT_BY_INDEX, PCLZIP_OPT_BY_NAME, PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG. - - Add the ability to extract by regular expression. To extract by regexp you must use the method - extract(), with the option PCLZIP_OPT_BY_EREG or PCLZIP_OPT_BY_PREG - (depending if you want to use ereg() or preg_match() syntax) followed by the - regular expression pattern. - - Add the ability to extract by index, directly with the extract() method. This is a - code improvment of the extractByIndex() method. - - Add the ability to extract by name. To extract by name you must use the method - extract(), with the option PCLZIP_OPT_BY_NAME followed by the filename to - extract or an array of filenames to extract. To extract all a folder, use the folder - name rather than the filename with a '/' at the end. - - Add the ability to add files without compression. This is done with a new attribute - which is PCLZIP_OPT_NO_COMPRESSION. - - Add the attribute PCLZIP_OPT_EXTRACT_AS_STRING, which allow to extract a file directly - in a string without using any file (or temporary file). - - Add constant PCLZIP_SEPARATOR for static configuration of filename separators in a single string. - The default separator is now a comma (,) and not any more a blank space. - THIS BREAK THE BACKWARD COMPATIBILITY : Please check if this may have an impact with - your script. - - Improve algorythm performance by removing the use of temporary files when adding or - extracting files in an archive. - - Add (correct) detection of empty filename zipping. This can occurs when the removed - path is the same - as a zipped dir. The dir is not zipped (['status'] = filtered), only its content. - - Add better support for windows paths (thanks for help from manus@manusfreedom.com). - - Corrected bug : When the archive file already exists with size=0, the add() method - fails. Corrected in 2.0. - - Remove the use of OS_WINDOWS constant. Use php_uname() function rather. - - Control the order of index ranges in extract by index feature. - - Change the internal management of folders (better handling of internal flag). - - - Version 1.3 : - - Removing the double include check. This is now done by include_once() and require_once() - PHP directives. - - Changing the error handling mecanism : Remove the use of an external error library. - The former PclError...() functions are replaced by internal equivalent methods. - By changing the environment variable PCLZIP_ERROR_EXTERNAL you can still use the former library. - Introducing the use of constants for error codes rather than integer values. This will help - in futur improvment. - Introduction of error handling functions like errorCode(), errorName() and errorInfo(). - - Remove the deprecated use of calling function with arguments passed by reference. - - Add the calling of extract(), extractByIndex(), create() and add() functions - with variable options rather than fixed arguments. - - Add the ability to remove all the file path while extracting or adding, - without any need to specify the path to remove. - This is available for extract(), extractByIndex(), create() and add() functionS by using - the new variable options parameters : - - PCLZIP_OPT_REMOVE_ALL_PATH : by indicating this option while calling the fct. - - Ability to change the mode of a file after the extraction (chmod()). - This is available for extract() and extractByIndex() functionS by using - the new variable options parameters. - - PCLZIP_OPT_SET_CHMOD : by setting the value of this option. - - Ability to definition call-back options. These call-back will be called during the adding, - or the extracting of file (extract(), extractByIndex(), create() and add() functions) : - - PCLZIP_CB_PRE_EXTRACT : will be called before each extraction of a file. The user - can trigerred the change the filename of the extracted file. The user can triggered the - skip of the extraction. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_EXTRACT : will be called after each extraction of a file. - Nothing can be triggered from that point. - - PCLZIP_CB_PRE_ADD : will be called before each add of a file. The user - can trigerred the change the stored filename of the added file. The user can triggered the - skip of the add. This is adding a 'skipped' status in the file list result value. - - PCLZIP_CB_POST_ADD : will be called after each add of a file. - Nothing can be triggered from that point. - - Two status are added in the file list returned as function result : skipped & filename_too_long - 'skipped' is used when a call-back function ask for skipping the file. - 'filename_too_long' is used while adding a file with a too long filename to archive (the file is - not added) - - Adding the function PclZipUtilPathInclusion(), that check the inclusion of a path into - a directory. - - Add a check of the presence of the archive file before some actions (like list, ...) - - Add the initialisation of field "index" in header array. This means that by - default index will be -1 when not explicitly set by the methods. - - Version 1.2 : - - Adding a duplicate function. - - Adding a merge function. The merge function is a "quick merge" function, - it just append the content of an archive at the end of the first one. There - is no check for duplicate files or more recent files. - - Improve the search of the central directory end. - - Version 1.1.2 : - - - Changing the license of PclZip. PclZip is now released under the GNU / LGPL license - (see License section). - - Adding the optional support of a static temporary directory. You will need to configure - the constant PCLZIP_TEMPORARY_DIR if you want to use this feature. - - Improving the rename() function. In some cases rename() does not work (different - Filesystems), so it will be replaced by a copy() + unlink() functions. - - Version 1.1.1 : - - - Maintenance release, no new feature. - - Version 1.1 : - - - New method Add() : adding files in the archive - - New method ExtractByIndex() : partial extract of the archive, files are identified by - their index in the archive - - New method DeleteByIndex() : delete some files/folder entries from the archive, - files are identified by their index in the archive. - - Adding a test of the zlib extension presence. If not present abort the script. - - Version 1.0.1 : - - - No new feature - - -3 - Corrected bugs -================== - - Corrected in Version 2.0 : - - Corrected : During an extraction, if a call-back fucntion is used and try to skip - a file, all the extraction process is stopped. - - Corrected in Version 1.3 : - - Corrected : Support of static synopsis for method extract() is broken. - - Corrected : invalid size of archive content field (0xFF) should be (0xFFFF). - - Corrected : When an extract is done with a remove_path parameter, the entry for - the directory with exactly the same path is not skipped/filtered. - - Corrected : extractByIndex() and deleteByIndex() were not managing index in the - right way. For example indexes '1,3-5,11' will only extract files 1 and 11. This - is due to a sort of the index resulting table that puts 11 before 3-5 (sort on - string and not interger). The sort is temporarilly removed, this means that - you must provide a sorted list of index ranges. - - Corrected in Version 1.2 : - - - Nothing. - - Corrected in Version 1.1.2 : - - - Corrected : Winzip is unable to delete or add new files in a PclZip created archives. - - Corrected in Version 1.1.1 : - - - Corrected : When archived file is not compressed (0% compression), the - extract method fails. - - Corrected in Version 1.1 : - - - Corrected : Adding a complete tree of folder may result in a bad archive - creation. - - Corrected in Version 1.0.1 : - - - Corrected : Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - - -4 - Known bugs or limitations -============================= - - Please publish bugs reports in SourceForge : - http://sourceforge.net/tracker/?group_id=40254&atid=427564 - - In Version 2.x : - - PclZip does only support file uncompressed or compressed with deflate (compression method 8) - - PclZip does not support password protected zip archive - - Some concern were seen when changing mtime of a file while archiving. - Seems to be linked to Daylight Saving Time (PclTest_changing_mtime). - - In Version 1.2 : - - - merge() methods does not check for duplicate files or last date of modifications. - - In Version 1.1 : - - - Limitation : Using 'extract' fields in the file header in the zip archive is not supported. - - WinZip is unable to delete a single file in a PclZip created archive. It is also unable to - add a file in a PclZip created archive. (Corrected in v.1.2) - - In Version 1.0.1 : - - - Adding a complete tree of folder may result in a bad archive - creation. (Corrected in V.1.1). - - Path given to methods must be in the unix format (/) and not the Windows format (\). - Workaround : Use only / directory separators. - - PclZip is using temporary files that are sometime the name of the file with a .tmp or .gz - added suffix. Files with these names may already exist and may be overwritten. - Workaround : none. - - PclZip does not check if the zlib extension is present. If it is absent, the zip - file is not created and the lib abort without warning. - Workaround : enable the zlib extension on the php install - - In Version 1.0 : - - - Error while compressing files greater than PCLZIP_READ_BLOCK_SIZE (default=1024). - (Corrected in v.1.0.1) - - Limitation : Multi-disk zip archive are not supported. - - -5 - License -=========== - - Since version 1.1.2, PclZip Library is released under GNU/LGPL license. - This library is free, so you can use it at no cost. - - HOWEVER, if you release a script, an application, a library or any kind of - code using PclZip library (or a part of it), YOU MUST : - - Indicate in the documentation (or a readme file), that your work - uses PclZip Library, and make a reference to the author and the web site - http://www.phpconcept.net - - Gives the ability to the final user to update the PclZip libary. - - I will also appreciate that you send me a mail (vincent@phpconcept.net), just to - be aware that someone is using PclZip. - - For more information about GNU/LGPL license : http://www.gnu.org - -6 - Warning -================= - - This library and the associated files are non commercial, non professional work. - It should not have unexpected results. However if any damage is caused by this software - the author can not be responsible. - The use of this software is at the risk of the user. - -7 - Documentation -================= - PclZip User Manuel is available in English on PhpConcept : http://www.phpconcept.net/pclzip/man/en/index.php - A Russian translation was done by Feskov Kuzma : http://php.russofile.ru/ru/authors/unsort/zip/ - -8 - Author -========== - - This software was written by Vincent Blavet (vincent@phpconcept.net) on its leasure time. - -9 - Contribute -============== - If you want to contribute to the development of PclZip, please contact vincent@phpconcept.net. - If you can help in financing PhpConcept hosting service, please go to - http://www.phpconcept.net/soutien.php diff --git a/rainloop/v/0.0.0/app/libraries/spyc/COPYING b/rainloop/v/0.0.0/app/libraries/spyc/COPYING deleted file mode 100644 index 8e7ddbcf6b..0000000000 --- a/rainloop/v/0.0.0/app/libraries/spyc/COPYING +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License - -Copyright (c) 2011 Vladimir Andersen - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/spyc/README.md b/rainloop/v/0.0.0/app/libraries/spyc/README.md deleted file mode 100644 index f8fa848739..0000000000 --- a/rainloop/v/0.0.0/app/libraries/spyc/README.md +++ /dev/null @@ -1,30 +0,0 @@ -**Spyc** is a YAML loader/dumper written in pure PHP. Given a YAML document, Spyc will return an array that -you can use however you see fit. Given an array, Spyc will return a string which contains a YAML document -built from your data. - -**YAML** is an amazingly human friendly and strikingly versatile data serialization language which can be used -for log files, config files, custom protocols, the works. For more information, see http://www.yaml.org. - -Spyc supports YAML 1.0 specification. - -## Using Spyc - -Using Spyc is trivial: - -``` - - * @author Chris Wanstrath - * @link https://github.com/mustangostang/spyc/ - * @copyright Copyright 2005-2006 Chris Wanstrath, 2006-2011 Vlad Andersen - * @license http://www.opensource.org/licenses/mit-license.php MIT License - * @package Spyc - */ - -if (!function_exists('spyc_load')) { - /** - * Parses YAML to array. - * @param string $string YAML string. - * @return array - */ - function spyc_load ($string) { - return Spyc::YAMLLoadString($string); - } -} - -if (!function_exists('spyc_load_file')) { - /** - * Parses YAML to array. - * @param string $file Path to YAML file. - * @return array - */ - function spyc_load_file ($file) { - return Spyc::YAMLLoad($file); - } -} - -if (!function_exists('spyc_dump')) { - /** - * Dumps array to YAML. - * @param array $data Array. - * @return string - */ - function spyc_dump ($data) { - return Spyc::YAMLDump($data, false, false, true); - } -} - -/** - * The Simple PHP YAML Class. - * - * This class can be used to read a YAML file and convert its contents - * into a PHP array. It currently supports a very limited subsection of - * the YAML spec. - * - * Usage: - * - * $Spyc = new Spyc; - * $array = $Spyc->load($file); - * - * or: - * - * $array = Spyc::YAMLLoad($file); - * - * or: - * - * $array = spyc_load_file($file); - * - * @package Spyc - */ -class Spyc { - - // SETTINGS - - const REMPTY = "\0\0\0\0\0"; - - /** - * Setting this to true will force YAMLDump to enclose any string value in - * quotes. False by default. - * - * @var bool - */ - public $setting_dump_force_quotes = false; - - /** - * Setting this to true will forse YAMLLoad to use syck_load function when - * possible. False by default. - * @var bool - */ - public $setting_use_syck_is_possible = false; - - - - /**#@+ - * @access private - * @var mixed - */ - private $_dumpIndent; - private $_dumpWordWrap; - private $_containsGroupAnchor = false; - private $_containsGroupAlias = false; - private $path; - private $result; - private $LiteralPlaceHolder = '___YAML_Literal_Block___'; - private $SavedGroups = array(); - private $indent; - /** - * Path modifier that should be applied after adding current element. - * @var array - */ - private $delayedPath = array(); - - /**#@+ - * @access public - * @var mixed - */ - public $_nodeId; - -/** - * Load a valid YAML string to Spyc. - * @param string $input - * @return array - */ - public function load ($input) { - return $this->__loadString($input); - } - - /** - * Load a valid YAML file to Spyc. - * @param string $file - * @return array - */ - public function loadFile ($file) { - return $this->__load($file); - } - - /** - * Load YAML into a PHP array statically - * - * The load method, when supplied with a YAML stream (string or file), - * will do its best to convert YAML in a file into a PHP array. Pretty - * simple. - * Usage: - * - * $array = Spyc::YAMLLoad('lucky.yaml'); - * print_r($array); - * - * @access public - * @return array - * @param string $input Path of YAML file or string containing YAML - */ - public static function YAMLLoad($input) { - $Spyc = new Spyc; - return $Spyc->__load($input); - } - - /** - * Load a string of YAML into a PHP array statically - * - * The load method, when supplied with a YAML string, will do its best - * to convert YAML in a string into a PHP array. Pretty simple. - * - * Note: use this function if you don't want files from the file system - * loaded and processed as YAML. This is of interest to people concerned - * about security whose input is from a string. - * - * Usage: - * - * $array = Spyc::YAMLLoadString("---\n0: hello world\n"); - * print_r($array); - * - * @access public - * @return array - * @param string $input String containing YAML - */ - public static function YAMLLoadString($input) { - $Spyc = new Spyc; - return $Spyc->__loadString($input); - } - - /** - * Dump YAML from PHP array statically - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. Pretty simple. Feel free to - * save the returned string as nothing.yaml and pass it around. - * - * Oh, and you can decide how big the indent is and what the wordwrap - * for folding is. Pretty cool -- just pass in 'false' for either if - * you want to use the default. - * - * Indent's default is 2 spaces, wordwrap's default is 40 characters. And - * you can turn off wordwrap by passing in 0. - * - * @access public - * @return string - * @param array $array PHP array - * @param int $indent Pass in false to use the default, which is 2 - * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40) - * @param int $no_opening_dashes Do not start YAML file with "---\n" - */ - public static function YAMLDump($array, $indent = false, $wordwrap = false, $no_opening_dashes = false) { - $spyc = new Spyc; - return $spyc->dump($array, $indent, $wordwrap, $no_opening_dashes); - } - - - /** - * Dump PHP array to YAML - * - * The dump method, when supplied with an array, will do its best - * to convert the array into friendly YAML. Pretty simple. Feel free to - * save the returned string as tasteful.yaml and pass it around. - * - * Oh, and you can decide how big the indent is and what the wordwrap - * for folding is. Pretty cool -- just pass in 'false' for either if - * you want to use the default. - * - * Indent's default is 2 spaces, wordwrap's default is 40 characters. And - * you can turn off wordwrap by passing in 0. - * - * @access public - * @return string - * @param array $array PHP array - * @param int $indent Pass in false to use the default, which is 2 - * @param int $wordwrap Pass in 0 for no wordwrap, false for default (40) - */ - public function dump($array,$indent = false,$wordwrap = false, $no_opening_dashes = false) { - // Dumps to some very clean YAML. We'll have to add some more features - // and options soon. And better support for folding. - - // New features and options. - if ($indent === false or !is_numeric($indent)) { - $this->_dumpIndent = 2; - } else { - $this->_dumpIndent = $indent; - } - - if ($wordwrap === false or !is_numeric($wordwrap)) { - $this->_dumpWordWrap = 40; - } else { - $this->_dumpWordWrap = $wordwrap; - } - - // New YAML document - $string = ""; - if (!$no_opening_dashes) $string = "---\n"; - - // Start at the base of the array and move through it. - if ($array) { - $array = (array)$array; - $previous_key = -1; - foreach ($array as $key => $value) { - if (!isset($first_key)) $first_key = $key; - $string .= $this->_yamlize($key,$value,0,$previous_key, $first_key, $array); - $previous_key = $key; - } - } - return $string; - } - - /** - * Attempts to convert a key / value array item to YAML - * @access private - * @return string - * @param $key The name of the key - * @param $value The value of the item - * @param $indent The indent of the current node - */ - private function _yamlize($key,$value,$indent, $previous_key = -1, $first_key = 0, $source_array = null) { - if (is_array($value)) { - if (empty ($value)) - return $this->_dumpNode($key, array(), $indent, $previous_key, $first_key, $source_array); - // It has children. What to do? - // Make it the right kind of item - $string = $this->_dumpNode($key, self::REMPTY, $indent, $previous_key, $first_key, $source_array); - // Add the indent - $indent += $this->_dumpIndent; - // Yamlize the array - $string .= $this->_yamlizeArray($value,$indent); - } elseif (!is_array($value)) { - // It doesn't have children. Yip. - $string = $this->_dumpNode($key, $value, $indent, $previous_key, $first_key, $source_array); - } - return $string; - } - - /** - * Attempts to convert an array to YAML - * @access private - * @return string - * @param $array The array you want to convert - * @param $indent The indent of the current level - */ - private function _yamlizeArray($array,$indent) { - if (is_array($array)) { - $string = ''; - $previous_key = -1; - foreach ($array as $key => $value) { - if (!isset($first_key)) $first_key = $key; - $string .= $this->_yamlize($key, $value, $indent, $previous_key, $first_key, $array); - $previous_key = $key; - } - return $string; - } else { - return false; - } - } - - /** - * Returns YAML from a key and a value - * @access private - * @return string - * @param $key The name of the key - * @param $value The value of the item - * @param $indent The indent of the current node - */ - private function _dumpNode($key, $value, $indent, $previous_key = -1, $first_key = 0, $source_array = null) { - // do some folding here, for blocks - if (is_string ($value) && ((strpos($value,"\n") !== false || strpos($value,": ") !== false || strpos($value,"- ") !== false || - strpos($value,"*") !== false || strpos($value,"#") !== false || strpos($value,"<") !== false || strpos($value,">") !== false || strpos ($value, '%') !== false || strpos ($value, ' ') !== false || - strpos($value,"[") !== false || strpos($value,"]") !== false || strpos($value,"{") !== false || strpos($value,"}") !== false) || strpos($value,"&") !== false || strpos($value, "'") !== false || strpos($value, "!") === 0 || - substr ($value, -1, 1) == ':') - ) { - $value = $this->_doLiteralBlock($value,$indent); - } else { - $value = $this->_doFolding($value,$indent); - } - - if ($value === array()) $value = '[ ]'; - if ($value === "") $value = '""'; - if (self::isTranslationWord($value)) { - $value = $this->_doLiteralBlock($value, $indent); - } - if (trim ($value) != $value) - $value = $this->_doLiteralBlock($value,$indent); - - if (is_bool($value)) { - $value = $value ? "true" : "false"; - } - - if ($value === null) $value = 'null'; - if ($value === "'" . self::REMPTY . "'") $value = null; - - $spaces = str_repeat(' ',$indent); - - //if (is_int($key) && $key - 1 == $previous_key && $first_key===0) { - if (is_array ($source_array) && array_keys($source_array) === range(0, count($source_array) - 1)) { - // It's a sequence - $string = $spaces.'- '.$value."\n"; - } else { - // if ($first_key===0) throw new Exception('Keys are all screwy. The first one was zero, now it\'s "'. $key .'"'); - // It's mapped - if (strpos($key, ":") !== false || strpos($key, "#") !== false) { $key = '"' . $key . '"'; } - $string = rtrim ($spaces.$key.': '.$value)."\n"; - } - return $string; - } - - /** - * Creates a literal block for dumping - * @access private - * @return string - * @param $value - * @param $indent int The value of the indent - */ - private function _doLiteralBlock($value,$indent) { - if ($value === "\n") return '\n'; - if (strpos($value, "\n") === false && strpos($value, "'") === false) { - return sprintf ("'%s'", $value); - } - if (strpos($value, "\n") === false && strpos($value, '"') === false) { - return sprintf ('"%s"', $value); - } - $exploded = explode("\n",$value); - $newValue = '|'; - if (isset($exploded[0]) && ($exploded[0] == "|" || $exploded[0] == "|-" || $exploded[0] == ">")) { - $newValue = $exploded[0]; - unset($exploded[0]); - } - $indent += $this->_dumpIndent; - $spaces = str_repeat(' ',$indent); - foreach ($exploded as $line) { - $line = trim($line); - if (strpos($line, '"') === 0 && strrpos($line, '"') == (strlen($line)-1) || strpos($line, "'") === 0 && strrpos($line, "'") == (strlen($line)-1)) { - $line = substr($line, 1, -1); - } - $newValue .= "\n" . $spaces . ($line); - } - return $newValue; - } - - /** - * Folds a string of text, if necessary - * @access private - * @return string - * @param $value The string you wish to fold - */ - private function _doFolding($value,$indent) { - // Don't do anything if wordwrap is set to 0 - - if ($this->_dumpWordWrap !== 0 && is_string ($value) && strlen($value) > $this->_dumpWordWrap) { - $indent += $this->_dumpIndent; - $indent = str_repeat(' ',$indent); - $wrapped = wordwrap($value,$this->_dumpWordWrap,"\n$indent"); - $value = ">\n".$indent.$wrapped; - } else { - if ($this->setting_dump_force_quotes && is_string ($value) && $value !== self::REMPTY) - $value = '"' . $value . '"'; - if (is_numeric($value) && is_string($value)) - $value = '"' . $value . '"'; - } - - - return $value; - } - - private function isTrueWord($value) { - $words = self::getTranslations(array('true', 'on', 'yes', 'y')); - return in_array($value, $words, true); - } - - private function isFalseWord($value) { - $words = self::getTranslations(array('false', 'off', 'no', 'n')); - return in_array($value, $words, true); - } - - private function isNullWord($value) { - $words = self::getTranslations(array('null', '~')); - return in_array($value, $words, true); - } - - private function isTranslationWord($value) { - return ( - self::isTrueWord($value) || - self::isFalseWord($value) || - self::isNullWord($value) - ); - } - - /** - * Coerce a string into a native type - * Reference: http://yaml.org/type/bool.html - * TODO: Use only words from the YAML spec. - * @access private - * @param $value The value to coerce - */ - private function coerceValue(&$value) { - if (self::isTrueWord($value)) { - $value = true; - } else if (self::isFalseWord($value)) { - $value = false; - } else if (self::isNullWord($value)) { - $value = null; - } - } - - /** - * Given a set of words, perform the appropriate translations on them to - * match the YAML 1.1 specification for type coercing. - * @param $words The words to translate - * @access private - */ - private static function getTranslations(array $words) { - $result = array(); - foreach ($words as $i) { - $result = array_merge($result, array(ucfirst($i), strtoupper($i), strtolower($i))); - } - return $result; - } - -// LOADING FUNCTIONS - - private function __load($input) { - $Source = $this->loadFromSource($input); - return $this->loadWithSource($Source); - } - - private function __loadString($input) { - $Source = $this->loadFromString($input); - return $this->loadWithSource($Source); - } - - private function loadWithSource($Source) { - if (empty ($Source)) return array(); - if ($this->setting_use_syck_is_possible && function_exists ('syck_load')) { - $array = syck_load (implode ("\n", $Source)); - return is_array($array) ? $array : array(); - } - - $this->path = array(); - $this->result = array(); - - $cnt = count($Source); - for ($i = 0; $i < $cnt; $i++) { - $line = $Source[$i]; - - $this->indent = strlen($line) - strlen(ltrim($line)); - $tempPath = $this->getParentPathByIndent($this->indent); - $line = self::stripIndent($line, $this->indent); - if (self::isComment($line)) continue; - if (self::isEmpty($line)) continue; - $this->path = $tempPath; - - $literalBlockStyle = self::startsLiteralBlock($line); - if ($literalBlockStyle) { - $line = rtrim ($line, $literalBlockStyle . " \n"); - $literalBlock = ''; - $line .= ' '.$this->LiteralPlaceHolder; - $literal_block_indent = strlen($Source[$i+1]) - strlen(ltrim($Source[$i+1])); - while (++$i < $cnt && $this->literalBlockContinues($Source[$i], $this->indent)) { - $literalBlock = $this->addLiteralLine($literalBlock, $Source[$i], $literalBlockStyle, $literal_block_indent); - } - $i--; - } - - // Strip out comments - if (strpos ($line, '#')) { - $line = preg_replace('/\s*#([^"\']+)$/','',$line); - } - - while (++$i < $cnt && self::greedilyNeedNextLine($line)) { - $line = rtrim ($line, " \n\t\r") . ' ' . ltrim ($Source[$i], " \t"); - } - $i--; - - $lineArray = $this->_parseLine($line); - - if ($literalBlockStyle) - $lineArray = $this->revertLiteralPlaceHolder ($lineArray, $literalBlock); - - $this->addArray($lineArray, $this->indent); - - foreach ($this->delayedPath as $indent => $delayedPath) - $this->path[$indent] = $delayedPath; - - $this->delayedPath = array(); - - } - return $this->result; - } - - private function loadFromSource ($input) { - if (!empty($input) && strpos($input, "\n") === false && file_exists($input)) - $input = file_get_contents($input); - - return $this->loadFromString($input); - } - - private function loadFromString ($input) { - $lines = explode("\n",$input); - foreach ($lines as $k => $_) { - $lines[$k] = rtrim ($_, "\r"); - } - return $lines; - } - - /** - * Parses YAML code and returns an array for a node - * @access private - * @return array - * @param string $line A line from the YAML file - */ - private function _parseLine($line) { - if (!$line) return array(); - $line = trim($line); - if (!$line) return array(); - - $array = array(); - - $group = $this->nodeContainsGroup($line); - if ($group) { - $this->addGroup($line, $group); - $line = $this->stripGroup ($line, $group); - } - - if ($this->startsMappedSequence($line)) - return $this->returnMappedSequence($line); - - if ($this->startsMappedValue($line)) - return $this->returnMappedValue($line); - - if ($this->isArrayElement($line)) - return $this->returnArrayElement($line); - - if ($this->isPlainArray($line)) - return $this->returnPlainArray($line); - - - return $this->returnKeyValuePair($line); - - } - - /** - * Finds the type of the passed value, returns the value as the new type. - * @access private - * @param string $value - * @return mixed - */ - private function _toType($value) { - if ($value === '') return ""; - $first_character = $value[0]; - $last_character = substr($value, -1, 1); - - $is_quoted = false; - do { - if (!$value) break; - if ($first_character != '"' && $first_character != "'") break; - if ($last_character != '"' && $last_character != "'") break; - $is_quoted = true; - } while (0); - - if ($is_quoted) { - $value = str_replace('\n', "\n", $value); - return strtr(substr ($value, 1, -1), array ('\\"' => '"', '\'\'' => '\'', '\\\'' => '\'')); - } - - if (strpos($value, ' #') !== false && !$is_quoted) - $value = preg_replace('/\s+#(.+)$/','',$value); - - if ($first_character == '[' && $last_character == ']') { - // Take out strings sequences and mappings - $innerValue = trim(substr ($value, 1, -1)); - if ($innerValue === '') return array(); - $explode = $this->_inlineEscape($innerValue); - // Propagate value array - $value = array(); - foreach ($explode as $v) { - $value[] = $this->_toType($v); - } - return $value; - } - - if (strpos($value,': ')!==false && $first_character != '{') { - $array = explode(': ',$value); - $key = trim($array[0]); - array_shift($array); - $value = trim(implode(': ',$array)); - $value = $this->_toType($value); - return array($key => $value); - } - - if ($first_character == '{' && $last_character == '}') { - $innerValue = trim(substr ($value, 1, -1)); - if ($innerValue === '') return array(); - // Inline Mapping - // Take out strings sequences and mappings - $explode = $this->_inlineEscape($innerValue); - // Propagate value array - $array = array(); - foreach ($explode as $v) { - $SubArr = $this->_toType($v); - if (empty($SubArr)) continue; - if (is_array ($SubArr)) { - $array[key($SubArr)] = $SubArr[key($SubArr)]; continue; - } - $array[] = $SubArr; - } - return $array; - } - - if ($value == 'null' || $value == 'NULL' || $value == 'Null' || $value == '' || $value == '~') { - return null; - } - - if ( is_numeric($value) && preg_match ('/^(-|)[1-9]+[0-9]*$/', $value) ){ - $intvalue = (int)$value; - if ($intvalue != PHP_INT_MAX) - $value = $intvalue; - return $value; - } - - if (is_numeric($value) && preg_match('/^0[xX][0-9a-fA-F]+$/', $value)) { - // Hexadecimal value. - return hexdec($value); - } - - $this->coerceValue($value); - - if (is_numeric($value)) { - if ($value === '0') return 0; - if (rtrim ($value, 0) === $value) - $value = (float)$value; - return $value; - } - - return $value; - } - - /** - * Used in inlines to check for more inlines or quoted strings - * @access private - * @return array - */ - private function _inlineEscape($inline) { - // There's gotta be a cleaner way to do this... - // While pure sequences seem to be nesting just fine, - // pure mappings and mappings with sequences inside can't go very - // deep. This needs to be fixed. - - $seqs = array(); - $maps = array(); - $saved_strings = array(); - $saved_empties = array(); - - // Check for empty strings - $regex = '/("")|(\'\')/'; - if (preg_match_all($regex,$inline,$strings)) { - $saved_empties = $strings[0]; - $inline = preg_replace($regex,'YAMLEmpty',$inline); - } - unset($regex); - - // Check for strings - $regex = '/(?:(")|(?:\'))((?(1)[^"]+|[^\']+))(?(1)"|\')/'; - if (preg_match_all($regex,$inline,$strings)) { - $saved_strings = $strings[0]; - $inline = preg_replace($regex,'YAMLString',$inline); - } - unset($regex); - - // echo $inline; - - $i = 0; - do { - - // Check for sequences - while (preg_match('/\[([^{}\[\]]+)\]/U',$inline,$matchseqs)) { - $seqs[] = $matchseqs[0]; - $inline = preg_replace('/\[([^{}\[\]]+)\]/U', ('YAMLSeq' . (count($seqs) - 1) . 's'), $inline, 1); - } - - // Check for mappings - while (preg_match('/{([^\[\]{}]+)}/U',$inline,$matchmaps)) { - $maps[] = $matchmaps[0]; - $inline = preg_replace('/{([^\[\]{}]+)}/U', ('YAMLMap' . (count($maps) - 1) . 's'), $inline, 1); - } - - if ($i++ >= 10) break; - - } while (strpos ($inline, '[') !== false || strpos ($inline, '{') !== false); - - $explode = explode(',',$inline); - $explode = array_map('trim', $explode); - $stringi = 0; $i = 0; - - while (1) { - - // Re-add the sequences - if (!empty($seqs)) { - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLSeq') !== false) { - foreach ($seqs as $seqk => $seq) { - $explode[$key] = str_replace(('YAMLSeq'.$seqk.'s'),$seq,$value); - $value = $explode[$key]; - } - } - } - } - - // Re-add the mappings - if (!empty($maps)) { - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLMap') !== false) { - foreach ($maps as $mapk => $map) { - $explode[$key] = str_replace(('YAMLMap'.$mapk.'s'), $map, $value); - $value = $explode[$key]; - } - } - } - } - - - // Re-add the strings - if (!empty($saved_strings)) { - foreach ($explode as $key => $value) { - while (strpos($value,'YAMLString') !== false) { - $explode[$key] = preg_replace('/YAMLString/',$saved_strings[$stringi],$value, 1); - unset($saved_strings[$stringi]); - ++$stringi; - $value = $explode[$key]; - } - } - } - - - // Re-add the empties - if (!empty($saved_empties)) { - foreach ($explode as $key => $value) { - while (strpos($value,'YAMLEmpty') !== false) { - $explode[$key] = preg_replace('/YAMLEmpty/', '', $value, 1); - $value = $explode[$key]; - } - } - } - - $finished = true; - foreach ($explode as $key => $value) { - if (strpos($value,'YAMLSeq') !== false) { - $finished = false; break; - } - if (strpos($value,'YAMLMap') !== false) { - $finished = false; break; - } - if (strpos($value,'YAMLString') !== false) { - $finished = false; break; - } - if (strpos($value,'YAMLEmpty') !== false) { - $finished = false; break; - } - } - if ($finished) break; - - $i++; - if ($i > 10) - break; // Prevent infinite loops. - } - - - return $explode; - } - - private function literalBlockContinues ($line, $lineIndent) { - if (!trim($line)) return true; - if (strlen($line) - strlen(ltrim($line)) > $lineIndent) return true; - return false; - } - - private function referenceContentsByAlias ($alias) { - do { - if (!isset($this->SavedGroups[$alias])) { echo "Bad group name: $alias."; break; } - $groupPath = $this->SavedGroups[$alias]; - $value = $this->result; - foreach ($groupPath as $k) { - $value = $value[$k]; - } - } while (false); - return $value; - } - - private function addArrayInline ($array, $indent) { - $CommonGroupPath = $this->path; - if (empty ($array)) return false; - - foreach ($array as $k => $_) { - $this->addArray(array($k => $_), $indent); - $this->path = $CommonGroupPath; - } - return true; - } - - private function addArray ($incoming_data, $incoming_indent) { - - // print_r ($incoming_data); - - if (count ($incoming_data) > 1) - return $this->addArrayInline ($incoming_data, $incoming_indent); - - $key = key ($incoming_data); - $value = isset($incoming_data[$key]) ? $incoming_data[$key] : null; - if ($key === '__!YAMLZero') $key = '0'; - - if ($incoming_indent == 0 && !$this->_containsGroupAlias && !$this->_containsGroupAnchor) { // Shortcut for root-level values. - if ($key || $key === '' || $key === '0') { - $this->result[$key] = $value; - } else { - $this->result[] = $value; end ($this->result); $key = key ($this->result); - } - $this->path[$incoming_indent] = $key; - return; - } - - - - $history = array(); - // Unfolding inner array tree. - $history[] = $_arr = $this->result; - foreach ($this->path as $k) { - $history[] = $_arr = $_arr[$k]; - } - - if ($this->_containsGroupAlias) { - $value = $this->referenceContentsByAlias($this->_containsGroupAlias); - $this->_containsGroupAlias = false; - } - - - // Adding string or numeric key to the innermost level or $this->arr. - if (is_string($key) && $key == '<<') { - if (!is_array ($_arr)) { $_arr = array (); } - - $_arr = array_merge ($_arr, $value); - } else if ($key || $key === '' || $key === '0') { - if (!is_array ($_arr)) - $_arr = array ($key=>$value); - else - $_arr[$key] = $value; - } else { - if (!is_array ($_arr)) { $_arr = array ($value); $key = 0; } - else { $_arr[] = $value; end ($_arr); $key = key ($_arr); } - } - - $reverse_path = array_reverse($this->path); - $reverse_history = array_reverse ($history); - $reverse_history[0] = $_arr; - $cnt = count($reverse_history) - 1; - for ($i = 0; $i < $cnt; $i++) { - $reverse_history[$i+1][$reverse_path[$i]] = $reverse_history[$i]; - } - $this->result = $reverse_history[$cnt]; - - $this->path[$incoming_indent] = $key; - - if ($this->_containsGroupAnchor) { - $this->SavedGroups[$this->_containsGroupAnchor] = $this->path; - if (is_array ($value)) { - $k = key ($value); - if (!is_int ($k)) { - $this->SavedGroups[$this->_containsGroupAnchor][$incoming_indent + 2] = $k; - } - } - $this->_containsGroupAnchor = false; - } - - } - - private static function startsLiteralBlock ($line) { - $lastChar = substr (trim($line), -1); - if ($lastChar != '>' && $lastChar != '|') return false; - if ($lastChar == '|') return $lastChar; - // HTML tags should not be counted as literal blocks. - if (preg_match ('#<.*?>$#', $line)) return false; - return $lastChar; - } - - private static function greedilyNeedNextLine($line) { - $line = trim ($line); - if (!strlen($line)) return false; - if (substr ($line, -1, 1) == ']') return false; - if ($line[0] == '[') return true; - if (preg_match ('#^[^:]+?:\s*\[#', $line)) return true; - return false; - } - - private function addLiteralLine ($literalBlock, $line, $literalBlockStyle, $indent = -1) { - $line = self::stripIndent($line, $indent); - if ($literalBlockStyle !== '|') { - $line = self::stripIndent($line); - } - $line = rtrim ($line, "\r\n\t ") . "\n"; - if ($literalBlockStyle == '|') { - return $literalBlock . $line; - } - if (strlen($line) == 0) - return rtrim($literalBlock, ' ') . "\n"; - if ($line == "\n" && $literalBlockStyle == '>') { - return rtrim ($literalBlock, " \t") . "\n"; - } - if ($line != "\n") - $line = trim ($line, "\r\n ") . " "; - return $literalBlock . $line; - } - - function revertLiteralPlaceHolder ($lineArray, $literalBlock) { - foreach ($lineArray as $k => $_) { - if (is_array($_)) - $lineArray[$k] = $this->revertLiteralPlaceHolder ($_, $literalBlock); - else if (substr($_, -1 * strlen ($this->LiteralPlaceHolder)) == $this->LiteralPlaceHolder) - $lineArray[$k] = rtrim ($literalBlock, " \r\n"); - } - return $lineArray; - } - - private static function stripIndent ($line, $indent = -1) { - if ($indent == -1) $indent = strlen($line) - strlen(ltrim($line)); - return substr ($line, $indent); - } - - private function getParentPathByIndent ($indent) { - if ($indent == 0) return array(); - $linePath = $this->path; - do { - end($linePath); $lastIndentInParentPath = key($linePath); - if ($indent <= $lastIndentInParentPath) array_pop ($linePath); - } while ($indent <= $lastIndentInParentPath); - return $linePath; - } - - - private function clearBiggerPathValues ($indent) { - - - if ($indent == 0) $this->path = array(); - if (empty ($this->path)) return true; - - foreach ($this->path as $k => $_) { - if ($k > $indent) unset ($this->path[$k]); - } - - return true; - } - - - private static function isComment ($line) { - if (!$line) return false; - if ($line[0] == '#') return true; - if (trim($line, " \r\n\t") == '---') return true; - return false; - } - - private static function isEmpty ($line) { - return (trim ($line) === ''); - } - - - private function isArrayElement ($line) { - if (!$line || !is_scalar($line)) return false; - if (substr($line, 0, 2) != '- ') return false; - if (strlen ($line) > 3) - if (substr($line,0,3) == '---') return false; - - return true; - } - - private function isHashElement ($line) { - return strpos($line, ':'); - } - - private function isLiteral ($line) { - if ($this->isArrayElement($line)) return false; - if ($this->isHashElement($line)) return false; - return true; - } - - - private static function unquote ($value) { - if (!$value) return $value; - if (!is_string($value)) return $value; - if ($value[0] == '\'') return trim ($value, '\''); - if ($value[0] == '"') return trim ($value, '"'); - return $value; - } - - private function startsMappedSequence ($line) { - return (substr($line, 0, 2) == '- ' && substr ($line, -1, 1) == ':'); - } - - private function returnMappedSequence ($line) { - $array = array(); - $key = self::unquote(trim(substr($line,1,-1))); - $array[$key] = array(); - $this->delayedPath = array(strpos ($line, $key) + $this->indent => $key); - return array($array); - } - - private function checkKeysInValue($value) { - if (strchr('[{"\'', $value[0]) === false) { - if (strchr($value, ': ') !== false) { - throw new Exception('Too many keys: '.$value); - } - } - } - - private function returnMappedValue ($line) { - $this->checkKeysInValue($line); - $array = array(); - $key = self::unquote (trim(substr($line,0,-1))); - $array[$key] = ''; - return $array; - } - - private function startsMappedValue ($line) { - return (substr ($line, -1, 1) == ':'); - } - - private function isPlainArray ($line) { - return ($line[0] == '[' && substr ($line, -1, 1) == ']'); - } - - private function returnPlainArray ($line) { - return $this->_toType($line); - } - - private function returnKeyValuePair ($line) { - $array = array(); - $key = ''; - if (strpos ($line, ': ')) { - // It's a key/value pair most likely - // If the key is in double quotes pull it out - if (($line[0] == '"' || $line[0] == "'") && preg_match('/^(["\'](.*)["\'](\s)*:)/',$line,$matches)) { - $value = trim(str_replace($matches[1],'',$line)); - $key = $matches[2]; - } else { - // Do some guesswork as to the key and the value - $explode = explode(': ', $line); - $key = trim(array_shift($explode)); - $value = trim(implode(': ', $explode)); - $this->checkKeysInValue($value); - } - // Set the type of the value. Int, string, etc - $value = $this->_toType($value); - if ($key === '0') $key = '__!YAMLZero'; - $array[$key] = $value; - } else { - $array = array ($line); - } - return $array; - - } - - - private function returnArrayElement ($line) { - if (strlen($line) <= 1) return array(array()); // Weird %) - $array = array(); - $value = trim(substr($line,1)); - $value = $this->_toType($value); - if ($this->isArrayElement($value)) { - $value = $this->returnArrayElement($value); - } - $array[] = $value; - return $array; - } - - - private function nodeContainsGroup ($line) { - $symbolsForReference = 'A-z0-9_\-'; - if (strpos($line, '&') === false && strpos($line, '*') === false) return false; // Please die fast ;-) - if ($line[0] == '&' && preg_match('/^(&['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1]; - if ($line[0] == '*' && preg_match('/^(\*['.$symbolsForReference.']+)/', $line, $matches)) return $matches[1]; - if (preg_match('/(&['.$symbolsForReference.']+)$/', $line, $matches)) return $matches[1]; - if (preg_match('/(\*['.$symbolsForReference.']+$)/', $line, $matches)) return $matches[1]; - if (preg_match ('#^\s*<<\s*:\s*(\*[^\s]+).*$#', $line, $matches)) return $matches[1]; - return false; - - } - - private function addGroup ($line, $group) { - if ($group[0] == '&') $this->_containsGroupAnchor = substr ($group, 1); - if ($group[0] == '*') $this->_containsGroupAlias = substr ($group, 1); - //print_r ($this->path); - } - - private function stripGroup ($line, $group) { - $line = trim(str_replace($group, '', $line)); - return $line; - } -} - -// Enable use of Spyc from command line -// The syntax is the following: php Spyc.php spyc.yaml - -do { - if (PHP_SAPI != 'cli') break; - if (empty ($_SERVER['argc']) || $_SERVER['argc'] < 2) break; - if (empty ($_SERVER['PHP_SELF']) || FALSE === strpos ($_SERVER['PHP_SELF'], 'Spyc.php') ) break; - $file = $argv[1]; - echo json_encode (spyc_load_file ($file)); -} while (0); diff --git a/rainloop/v/0.0.0/app/libraries/spyc/composer.json b/rainloop/v/0.0.0/app/libraries/spyc/composer.json deleted file mode 100644 index e5ab776848..0000000000 --- a/rainloop/v/0.0.0/app/libraries/spyc/composer.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "mustangostang/spyc", - "description": "A simple YAML loader/dumper class for PHP", - "type": "library", - "keywords": [ - "spyc", - "yaml", - "yml" - ], - "homepage": "https://github.com/mustangostang/spyc/", - "authors" : [{ - "name": "mustangostang", - "email": "vlad.andersen@gmail.com" - }], - "license": "MIT", - "require": { - "php": ">=5.3.1" - }, - "autoload": { - "files": [ "Spyc.php" ] - }, - "require-dev": { - "phpunit/phpunit": "4.3.*@dev" - }, - "extra": { - "branch-alias": { - "dev-master": "0.5.x-dev" - } - } -} diff --git a/rainloop/v/0.0.0/app/libraries/tmhOAuth/LICENSE b/rainloop/v/0.0.0/app/libraries/tmhOAuth/LICENSE deleted file mode 100644 index d645695673..0000000000 --- a/rainloop/v/0.0.0/app/libraries/tmhOAuth/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/rainloop/v/0.0.0/app/libraries/tmhOAuth/README.md b/rainloop/v/0.0.0/app/libraries/tmhOAuth/README.md deleted file mode 100644 index 7d45323cfa..0000000000 --- a/rainloop/v/0.0.0/app/libraries/tmhOAuth/README.md +++ /dev/null @@ -1,211 +0,0 @@ -# tmhOAuth - -An OAuth 1.0A library written in PHP by @themattharris, specifically for use -with the Twitter API. - -**Disclaimer**: This project is a work in progress. Please use the issue tracker -to report any enhancements or issues you encounter. - -## Goals - -- Support OAuth 1.0A -- Use Authorisation headers instead of query string or POST parameters -- Allow uploading of images -- Provide enough information to assist with debugging - -## Dependencies - -The library has been tested with PHP 5.3+ and relies on CURL and hash_hmac. The -vast majority of hosting providers include these libraries and run with PHP 5.1+. - -The code makes use of hash_hmac, which was introduced in PHP 5.1.2. If your version -of PHP is lower than this you should ask your hosting provider for an update. - -## A note about security and SSL - -Version 0.60 hardened the security of the library and defaulted `curl_ssl_verifypeer` to `true`. -As some hosting providers do not provide the most current certificate root file -it is now included in this repository. If the version is out of date OR you prefer -to download the certificate roots yourself, you can get them -from: http://curl.haxx.se/ca/cacert.pem - -Before upgrading the version of tmhOAuth that you use, be sure to verify the SSL -handling works on your server by running the `examples/verify_ssl.php` script. - -## Usage - -This will be built out later but for the moment review the examples repository - for ways the library can be -used. Each example contains instructions on how to use it. - -## Notes for users of previous versions - -If you previously used version 0.4 be aware the utility functions -have now been broken into their own file. Before you use version 0.5+ in your app -test locally to ensure your code doesn't need tmhUtilities included. - -If you used custom HTTP request headers when they were defined as `'key: value'` strings -you should now define them as `'key' => 'value'` pairs. - -Versions prior to 0.7.3 collapsed headers with the same value into one -$tmhOAuth->response['headers'] key. Since 0.7.3 headers with the same key will use an array -to store their values. - -## Change History -### 0.7.5 - 20 Februrary 2013 -- tidying up of composer.json. (Issue #112) Props: ceeram - -### 0.7.4 - 19 Februrary 2013 -- corrections to composer.json to support packagists requirements. (Issue #110) - -### 0.7.3 - 18 Februrary 2013 -- add support for making requests with the host header being different to the request host. -- ensure headers with the same key do not overwrite each other in $tmhOAuth->response['headers']. -- removed examples submodule in favor of examples including tmhOAuth, rather than tmhOAuth including examples -- made it so that if param values are sent to $tmhOAuth->request as an array (key -> array()) then $tmhOAuth->prepare_params will now implode them using ',' -- fixed composer. (Issue #99). Props: rasa -- fixed PHPDoc. (Issue #47). Props: trante -- instead of void, $tmhOAuth->curlit now returns 0 if 'prevent_request' is set - -### 0.7.2 - 01 November 2012 -- use DIRECTORY_SEPARATOR for multi-environment support. (Issue #80) Props: whallz -- tidied up the curlHeader function to use explode instead of substr and store the keys in the format they are returned from the API -- removed content-length hack as it isn't needed if CURLOPT_POSTFIELDS is initialized on all POSTs -- removed the expects header hack as Twitter no longer requires it to be there -- introduce composer.json. (Issues #39, #77, #85) Props: akandels, conradkleinespel, dguyon, kud, philsturgeon, willdurand -- added support for specifying custom headers when using $tmhOAuth->request. (Issue #98) - -### 0.7.1 - 27 October 2012 -- set content-length to 0 explictly to avoid a bug between libcurl and Twitter. (Issue #94) -- allow initialization without a configuration array (default config to array()) -- prevent ->url allowing double slashes in paths - -### 0.7.0 - 04 September 2012 -- changed version numbers to x.y.z format -- stronger method scoping (public and private) -- Typo fix in depenencies. (Issue #42) Props: tantek -- Only lowercase the host and scheme, and not path, in prepare_url. (Issue #56) Props: uzyn -- Fixed a number of PHP warnings by changing some tmhUtilty methods to static. (Issue #52) Props: DrayChou -- Raw headers and response body are now available as `$tmhOAuth->response['raw']` -- Moved the examples to their own repository -- Removed the `noexamples` branch as master does not contain examples anymore -- Introduced `$tmhOAuth->config['timezone']` and set `date_default_timezone_set`. (Issue #70) Props: iamctodd - -### 0.621 - 12 March 2012 -- Ensure `$_SERVER['HTTPS']` isset before checking it's value. Props: kud - -### 0.62 - 01 March 2012 -- Fix array merging bug. Props: julien-c -- use is_callable instead of function_exists: Props: samwierema -- Allow options to be specified for the entify function. Props: davidcroda -- protocol was not inferred correctly for https when ['HTTPS'] == 'on'. Props: ospector -- Switched to https for twitter.com display URLs -- Improved the search results example - -### 0.61 - 16 January 2012 -- Removed trailing ?> from tmhOAuth.php and tmhUtilities.php to meet the Zend Framework's coding practices. Props: reedy -- Fixed bug where CURLOPT_SSL_VERIFYHOST was defaulted to true when it should have been defaulted to 2. Props: kevinsmcarthur - -### 0.60 - 29 December 2011 -- Changed any use of implode to the preferred format of implode($glue, $pieces). Props: reedy -- Moved oauth_verifier to the authorization header as shown in example of RFC 5849. Props: spacenick -- added curl error and error number values to the $tmhOAuth->response object -- added an example script for testing the SSL connection to twitter.com with the new SSL configuration of tmhOAuth -- added a function to generate the useragent depending on whether SSL is on or not -- defaulted CURLOPT_SSL_VERIFYPEER to true -- added CURLOPT_SSL_VERIFYHOST and defaulted it to true -- added the most current cacert.pem file from http://curl.haxx.se/ca/cacert.pem and configured curl to use it - -### 0.58 - 29 December 2011 -- Rearranged some configuration variables around to make commenting easier -- Standarised on lowercase booleans - -### 0.57 - 11 December 2011 -- Fixed prevent_request so OAuth Echo requests work again. -- Added a TwitPic OAuth Echo example - -### 0.56 - 29 September 2011 -- Fixed version reference in the UserAgent -- Updated tmhUtilities::entify with support for media -- Updated tmhUtilities::entify with support for multibyte characters. Props: andersonshatch - -### 0.55 - 29 September 2011 -- Added support for content encoding. Defaults to whatever localhost supports. Props: yusuke - -### 0.54 - 29 September 2011 -- User-Agent is now configurable and includes the current version number of the script -- Updated the Streaming examples to use SSL - -### 0.53 - 15 July 2011 -- Fixed issue where headers were being duplicated if the library was called more than once. -- Updated examples to fit the new location of access tokens and secrets on dev.twitter.com -- Added Photo Tweet example - -### 0.52 - 06 July 2011 -- Fixed issue where the preference for include_time in create_nonce was being ignored - -### 0.51 - 06 July 2011 -- Use isset instead of suppress errors. Props: funkatron -- Added example of using the Search API -- Added example of using friends/ids and users/lookup to get details of a users friends -- Added example of the authorize OAuth webflow - -### 0.5 - 29 March 2011 -- Moved utility functions out of the main class and into the tmhUtilities class. -- Added the ability to send OAuth parameters as part of the querystring or POST body. -- Section 3.4.1.2 says the url must be lowercase so prepare URL now does this. -- Added a convenience method for accessing the safe_encode/decode transforms. -- Updated the examples to use the new utilities library. -- Added examples for sitestreams and userstreams. -- Added a more advanced streaming API example. - -### 0.4 - 03 March 2011 -- Fixed handling of parameters when using DELETE. Thanks to yusuke for reporting -- Fixed php_self to handle port numbers other than 80/443. Props: yusuke -- Updated function pr to use pre only when not running in CLI mode -- Add support for proxy servers. Props juanchorossi -- Function request now returns the HTTP status code. Props: kronenthaler -- Documentation fixes for xAuth. Props: 140dev -- Some minor code formatting changes - -### 0.3 - 28 September 2010 -- Moved entities rendering into the library - -### 0.2 - 17 September 2010 -- Added support for the Streaming API - -### 0.14 - 17 September 2010 -- Fixed authorisation header for use with OAuth Echo - -### 0.13 - 17 September 2010 -- Added use_ssl configuration parameter -- Fixed config array typo -- Removed v from the config -- Remove protocol from the host (configured by use_ssl) -- Added include for easier debugging - -### 0.12 - 17 September 2010 - -- Moved curl options to config -- Added the ability for curl to follow redirects, default false - -### 0.11 - 17 September 2010 - -- Fixed a bug in the GET requests - -### 0.1 - 26 August 2010 - -- Initial beta version - -## Community - -License: Apache 2 (see [included LICENSE file](https://github.com/themattharris/tmhOAuth/blob/master/LICENSE)) - -Follow [@tmhOAuth](https://twitter.com/intent/follow?screen_name=tmhOAuth) to receive updates on releases, or ask for support -Follow me on Twitter: [@themattharris](https://twitter.com/intent/follow?screen_name=themattharris) -Check out the Twitter Developer Resources: - -## To Do - -- Add good behavior logic to the Streaming API handler - i.e. on disconnect back off -- Async Curl support \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/tmhOAuth/cacert.pem b/rainloop/v/0.0.0/app/libraries/tmhOAuth/cacert.pem deleted file mode 100644 index 334fb26ade..0000000000 --- a/rainloop/v/0.0.0/app/libraries/tmhOAuth/cacert.pem +++ /dev/null @@ -1,3376 +0,0 @@ -## -## ca-bundle.crt -- Bundle of CA Root Certificates -## -## Certificate data from Mozilla as of: Thu Nov 3 19:04:19 2011 -## -## This is a bundle of X.509 certificates of public Certificate Authorities -## (CA). These were automatically extracted from Mozilla's root certificates -## file (certdata.txt). This file can be found in the mozilla source tree: -## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 -## -## It contains the certificates in PEM format and therefore -## can be directly used with curl / libcurl / php_curl, or with -## an Apache+mod_ssl webserver for SSL client authentication. -## Just configure this file as the SSLCACertificateFile. -## - -# ***** BEGIN LICENSE BLOCK ***** -# Version: MPL 1.1/GPL 2.0/LGPL 2.1 -# -# The contents of this file are subject to the Mozilla Public License Version -# 1.1 (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# http://www.mozilla.org/MPL/ -# -# Software distributed under the License is distributed on an "AS IS" basis, -# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License -# for the specific language governing rights and limitations under the -# License. -# -# The Original Code is the Netscape security libraries. -# -# The Initial Developer of the Original Code is -# Netscape Communications Corporation. -# Portions created by the Initial Developer are Copyright (C) 1994-2000 -# the Initial Developer. All Rights Reserved. -# -# Contributor(s): -# -# Alternatively, the contents of this file may be used under the terms of -# either the GNU General Public License Version 2 or later (the "GPL"), or -# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), -# in which case the provisions of the GPL or the LGPL are applicable instead -# of those above. If you wish to allow use of your version of this file only -# under the terms of either the GPL or the LGPL, and not to allow others to -# use your version of this file under the terms of the MPL, indicate your -# decision by deleting the provisions above and replace them with the notice -# and other provisions required by the GPL or the LGPL. If you do not delete -# the provisions above, a recipient may use your version of this file under -# the terms of any one of the MPL, the GPL or the LGPL. -# -# ***** END LICENSE BLOCK ***** -# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.80 $ $Date: 2011/11/03 15:11:58 $ - -GTE CyberTrust Global Root -========================== ------BEGIN CERTIFICATE----- -MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg -Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG -A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz -MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL -Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 -IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u -sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql -HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID -AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW -M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF -NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ ------END CERTIFICATE----- - -Thawte Server CA -================ ------BEGIN CERTIFICATE----- -MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE -AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j -b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV -BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u -c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG -A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 -ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl -/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 -1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR -MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J -GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ -GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= ------END CERTIFICATE----- - -Thawte Premium Server CA -======================== ------BEGIN CERTIFICATE----- -MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT -DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs -dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE -AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl -ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT -AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU -VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 -aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ -cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 -aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh -Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ -qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm -SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf -8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t -UCemDaYj+bvLpgcUQg== ------END CERTIFICATE----- - -Equifax Secure CA -================= ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE -ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 -MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT -B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB -nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR -fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW -8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG -A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE -CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG -A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS -spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB -Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 -zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB -BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 -70+sB3c4 ------END CERTIFICATE----- - -Digital Signature Trust Co. Global CA 1 -======================================= ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE -ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy -MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs -IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE -NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i -o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo -BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 -dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw -IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY -MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM -BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB -ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq -kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 -RbyhkwS7hp86W0N6w4pl ------END CERTIFICATE----- - -Digital Signature Trust Co. Global CA 3 -======================================= ------BEGIN CERTIFICATE----- -MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE -ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy -MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs -IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA -A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD -VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS -xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo -BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 -dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw -IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY -MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM -BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB -AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi -up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1 -mPnHfxsb1gYgAlihw6ID ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA -TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah -WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf -Tqj/ZA1k ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO -FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 -lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT -1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD -Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G2 -============================================================ ------BEGIN CERTIFICATE----- -MIIDAjCCAmsCEDKIjprS9esTR/h/xCA3JfgwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT -MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgNCBQdWJsaWMgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln -biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz -dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC68OTP+cSuhVS5B1f5j8V/aBH4 -xBewRNzjMHPVKmIquNDMHO0oW369atyzkSTKQWI8/AIBvxwWMZQFl3Zuoq29YRdsTjCG8FE3KlDH -qGKB3FtKqsGgtG7rL+VXxbErQHDbWk2hjh+9Ax/YA9SPTJlxvOKCzFjomDqG04Y48wApHwIDAQAB -MA0GCSqGSIb3DQEBBQUAA4GBAIWMEsGnuVAVess+rLhDityq3RS6iYF+ATwjcSGIL4LcY/oCRaxF -WdcqWERbt5+BO5JoPeI3JPV7bI92NZYJqFmduc4jq3TWg/0ycyfYaT5DdPauxYma51N86Xv2S/PB -ZYPejYqcPIiNOVn8qj8ijaHBZlCBckztImRPT8qAkbYp ------END CERTIFICATE----- - -GlobalSign Root CA -================== ------BEGIN CERTIFICATE----- -MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx -GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds -b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV -BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD -VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa -DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc -THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb -Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP -c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX -gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV -HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF -AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj -Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG -j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH -hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC -X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== ------END CERTIFICATE----- - -GlobalSign Root CA - R2 -======================= ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 -ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp -s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN -S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL -TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C -ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E -FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i -YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN -BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp -9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu -01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 -9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 -TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== ------END CERTIFICATE----- - -ValiCert Class 1 VA -=================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy -MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi -GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm -DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG -lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX -icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP -Orf1LXLI ------END CERTIFICATE----- - -ValiCert Class 2 VA -=================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw -MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC -CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf -ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ -SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV -UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 -W9ViH0Pd ------END CERTIFICATE----- - -RSA Root Certificate 1 -====================== ------BEGIN CERTIFICATE----- -MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp -b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs -YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh -bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw -MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 -d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg -UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 -LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td -3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H -BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs -3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF -V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r -on+jjBXu ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 -EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc -cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw -EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj -055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f -j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC -/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 -xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa -t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== ------END CERTIFICATE----- - -Verisign Class 4 Public Primary Certification Authority - G3 -============================================================ ------BEGIN CERTIFICATE----- -MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw -CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy -dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS -tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM -8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW -Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX -Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA -j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt -mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm -fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd -RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG -UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== ------END CERTIFICATE----- - -Entrust.net Secure Server CA -============================ ------BEGIN CERTIFICATE----- -MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV -BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg -cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl -ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG -A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi -eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p -dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ -aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 -gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw -ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw -CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l -dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF -bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl -cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu -dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw -NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow -HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA -BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN -Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 -n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= ------END CERTIFICATE----- - -Entrust.net Premium 2048 Secure Server CA -========================================= ------BEGIN CERTIFICATE----- -MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u -ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp -bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV -BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx -NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 -d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl -MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u -ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL -Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr -hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW -nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi -VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC -AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER -gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B -AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo -oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS -o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z -2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX -OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ== ------END CERTIFICATE----- - -Baltimore CyberTrust Root -========================= ------BEGIN CERTIFICATE----- -MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE -ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li -ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC -SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs -dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME -uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB -UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C -G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 -XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr -l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI -VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB -BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh -cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 -hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa -Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H -RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp ------END CERTIFICATE----- - -Equifax Secure Global eBusiness CA -================================== ------BEGIN CERTIFICATE----- -MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp -bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx -HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds -b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV -PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN -qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn -hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j -BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs -MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN -I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY -NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV ------END CERTIFICATE----- - -Equifax Secure eBusiness CA 1 -============================= ------BEGIN CERTIFICATE----- -MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB -LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE -ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz -IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ -1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a -IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk -MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW -Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF -AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 -lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ -KpYrtWKmpj29f5JZzVoqgrI3eQ== ------END CERTIFICATE----- - -Equifax Secure eBusiness CA 2 -============================= ------BEGIN CERTIFICATE----- -MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE -ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y -MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT -DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB -nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn -2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5 -BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG -A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx -JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG -A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e -uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB -Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 -jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia -78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm -V+GRMOrN ------END CERTIFICATE----- - -AddTrust Low-Value Services Root -================================ ------BEGIN CERTIFICATE----- -MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU -cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw -CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO -ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 -54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr -oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 -Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui -GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w -HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD -AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT -RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw -HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt -ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph -iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY -eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr -mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj -ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= ------END CERTIFICATE----- - -AddTrust External Root -====================== ------BEGIN CERTIFICATE----- -MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD -VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw -NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU -cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg -Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 -+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw -Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo -aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy -2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 -7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P -BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL -VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk -VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB -IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl -j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 -6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 -e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u -G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= ------END CERTIFICATE----- - -AddTrust Public Services Root -============================= ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU -cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ -BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l -dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu -nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i -d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG -Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw -HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G -A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux -FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G -A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 -JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL -+YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao -GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 -Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H -EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= ------END CERTIFICATE----- - -AddTrust Qualified Certificates Root -==================================== ------BEGIN CERTIFICATE----- -MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML -QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU -cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx -CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ -IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG -9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx -64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 -KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o -L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR -wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU -MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE -BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y -azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD -ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG -GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X -dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze -RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB -iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= ------END CERTIFICATE----- - -Entrust Root Certification Authority -==================================== ------BEGIN CERTIFICATE----- -MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV -BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw -b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG -A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 -MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu -MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu -Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v -dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB -ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz -A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww -Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 -j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN -rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 -MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH -hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA -A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM -Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa -v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS -W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 -tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 ------END CERTIFICATE----- - -RSA Security 2048 v3 -==================== ------BEGIN CERTIFICATE----- -MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK -ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy -MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb -BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC -AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 -Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb -WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH -KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP -+Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ -MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E -FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY -v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj -0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj -VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 -nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA -pKnXwiJPZ9d37CAFYd4= ------END CERTIFICATE----- - -GeoTrust Global CA -================== ------BEGIN CERTIFICATE----- -MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK -Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw -MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j -LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo -BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet -8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc -T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU -vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD -AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk -DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q -zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 -d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 -mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p -XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm -Mw== ------END CERTIFICATE----- - -GeoTrust Global CA 2 -==================== ------BEGIN CERTIFICATE----- -MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw -MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j -LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ -NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k -LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA -Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b -HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF -MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH -K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 -srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh -ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL -OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC -x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF -H4z1Ir+rzoPz4iIprn2DQKi6bA== ------END CERTIFICATE----- - -GeoTrust Universal CA -===================== ------BEGIN CERTIFICATE----- -MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 -MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu -Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP -ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t -JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e -RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs -7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d -8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V -qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga -Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB -Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu -KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 -ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 -XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB -hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc -aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 -qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL -oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK -xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF -KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 -DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK -xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU -p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI -P/rmMuGNG2+k5o7Y+SlIis5z/iw= ------END CERTIFICATE----- - -GeoTrust Universal CA 2 -======================= ------BEGIN CERTIFICATE----- -MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN -R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 -MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg -SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA -A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 -DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 -j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q -JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a -QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 -WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP -20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn -ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC -SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG -8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 -+/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E -BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z -dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ -4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ -mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq -A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg -Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP -pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d -FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp -gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm -X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS ------END CERTIFICATE----- - -America Online Root Certification Authority 1 -============================================= ------BEGIN CERTIFICATE----- -MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG -A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg -T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG -v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z -DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh -sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP -8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T -AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z -o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf -GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF -VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft -3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g -Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds -sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 ------END CERTIFICATE----- - -America Online Root Certification Authority 2 -============================================= ------BEGIN CERTIFICATE----- -MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT -QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp -Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG -A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg -T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en -fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 -f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO -qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN -RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 -gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn -6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid -FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 -Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj -B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op -aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE -AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY -T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p -+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg -JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy -zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO -ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh -1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf -GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff -Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP -cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= ------END CERTIFICATE----- - -Visa eCommerce Root -=================== ------BEGIN CERTIFICATE----- -MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG -EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug -QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 -WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm -VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv -bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL -F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b -RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 -TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI -/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs -GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG -MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc -CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW -YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz -zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu -YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt -398znM/jra6O1I7mT1GvFpLgXPYHDw== ------END CERTIFICATE----- - -TC TrustCenter, Germany, Class 2 CA -=================================== ------BEGIN CERTIFICATE----- -MIIDXDCCAsWgAwIBAgICA+owDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI -EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD -bGFzcyAyIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05 -ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt -YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy -aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg -MiBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBANo46O0yAClxgwENv4wB3NrGrTmkqYov1YtcaF9QxmL1Zr3KkSLs -qh1R1z2zUbKDTl3LSbDwTFXlay3HhQswHJJOgtTKAu33b77c4OMUuAVT8pr0VotanoWT0bSCVq5N -u6hLVxa8/vhYnvgpjbB7zXjJT6yLZwzxnPv8V5tXXE8NAgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB -Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy -LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBAIRS+yjf -/x91AbwBvgRWl2p0QiQxg/lGsQaKic+WLDO/jLVfenKhhQbOhvgFjuj5Jcrag4wGrOs2bYWRNAQ2 -9ELw+HkuCkhcq8xRT3h2oNmsGb0q0WkEKJHKNhAngFdb0lz1wlurZIFjdFH0l7/NEij3TWZ/p/Ac -ASZ4smZHcFFk ------END CERTIFICATE----- - -TC TrustCenter, Germany, Class 3 CA -=================================== ------BEGIN CERTIFICATE----- -MIIDXDCCAsWgAwIBAgICA+swDQYJKoZIhvcNAQEEBQAwgbwxCzAJBgNVBAYTAkRFMRAwDgYDVQQI -EwdIYW1idXJnMRAwDgYDVQQHEwdIYW1idXJnMTowOAYDVQQKEzFUQyBUcnVzdENlbnRlciBmb3Ig -U2VjdXJpdHkgaW4gRGF0YSBOZXR3b3JrcyBHbWJIMSIwIAYDVQQLExlUQyBUcnVzdENlbnRlciBD -bGFzcyAzIENBMSkwJwYJKoZIhvcNAQkBFhpjZXJ0aWZpY2F0ZUB0cnVzdGNlbnRlci5kZTAeFw05 -ODAzMDkxMTU5NTlaFw0xMTAxMDExMTU5NTlaMIG8MQswCQYDVQQGEwJERTEQMA4GA1UECBMHSGFt -YnVyZzEQMA4GA1UEBxMHSGFtYnVyZzE6MDgGA1UEChMxVEMgVHJ1c3RDZW50ZXIgZm9yIFNlY3Vy -aXR5IGluIERhdGEgTmV0d29ya3MgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3Mg -MyBDQTEpMCcGCSqGSIb3DQEJARYaY2VydGlmaWNhdGVAdHJ1c3RjZW50ZXIuZGUwgZ8wDQYJKoZI -hvcNAQEBBQADgY0AMIGJAoGBALa0wTUFLg2N7KBAahwOJ6ZQkmtQGwfeLud2zODa/ISoXoxjaitN -2U4CdhHBC/KNecoAtvGwDtf7pBc9r6tpepYnv68zoZoqWarEtTcI8hKlMbZD9TKWcSgoq40oht+7 -7uMMfTDWw1Krj10nnGvAo+cFa1dJRLNu6mTP0o56UHd3AgMBAAGjazBpMA8GA1UdEwEB/wQFMAMB -Af8wDgYDVR0PAQH/BAQDAgGGMDMGCWCGSAGG+EIBCAQmFiRodHRwOi8vd3d3LnRydXN0Y2VudGVy -LmRlL2d1aWRlbGluZXMwEQYJYIZIAYb4QgEBBAQDAgAHMA0GCSqGSIb3DQEBBAUAA4GBABY9xs3B -u4VxhUafPiCPUSiZ7C1FIWMjWwS7TJC4iJIETb19AaM/9uzO8d7+feXhPrvGq14L3T2WxMup1Pkm -5gZOngylerpuw3yCGdHHsbHD2w2Om0B8NwvxXej9H5CIpQ5ON2QhqE6NtJ/x3kit1VYYUimLRzQS -CdS7kjXvD9s0 ------END CERTIFICATE----- - -Certum Root CA -============== ------BEGIN CERTIFICATE----- -MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK -ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla -Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u -by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x -wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL -kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ -89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K -Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P -NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq -hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ -GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg -GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ -0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS -qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== ------END CERTIFICATE----- - -Comodo AAA Services root -======================== ------BEGIN CERTIFICATE----- -MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw -MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl -c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV -BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG -C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs -i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW -Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH -Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK -Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f -BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl -cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz -LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm -7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz -Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z -8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C -12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== ------END CERTIFICATE----- - -Comodo Secure Services root -=========================== ------BEGIN CERTIFICATE----- -MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw -MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu -Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi -BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP -9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc -rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC -oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V -p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E -FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w -gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj -YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm -aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm -4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj -Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL -DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw -pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H -RR3B7Hzs/Sk= ------END CERTIFICATE----- - -Comodo Trusted Services root -============================ ------BEGIN CERTIFICATE----- -MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS -R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg -TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw -MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h -bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw -IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 -3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y -/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 -juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS -ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud -DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB -/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp -ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl -cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw -uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 -pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA -BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l -R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O -9y5Xt5hwXsjEeLBi ------END CERTIFICATE----- - -QuoVadis Root CA -================ ------BEGIN CERTIFICATE----- -MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE -ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 -eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz -MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp -cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD -EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk -J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL -F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL -YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen -AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w -PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y -ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 -MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj -YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs -ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh -Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW -Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu -BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw -FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 -tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo -fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul -LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x -gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi -5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi -5nrQNiOKSnQ2+Q== ------END CERTIFICATE----- - -QuoVadis Root CA 2 -================== ------BEGIN CERTIFICATE----- -MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx -ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 -XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk -lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB -lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy -lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt -66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn -wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh -D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy -BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie -J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud -DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU -a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT -ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv -Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 -UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm -VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK -+JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW -IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 -WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X -f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II -4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 -VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u ------END CERTIFICATE----- - -QuoVadis Root CA 3 -================== ------BEGIN CERTIFICATE----- -MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT -EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx -OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM -aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC -DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg -DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij -KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K -DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv -BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp -p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 -nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX -MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM -Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz -uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT -BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj -YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 -aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB -BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD -VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 -ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE -AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV -qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s -hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z -POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 -Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp -8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC -bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu -g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p -vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr -qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= ------END CERTIFICATE----- - -Security Communication Root CA -============================== ------BEGIN CERTIFICATE----- -MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP -U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw -8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM -DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX -5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd -DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 -JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw -DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g -0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a -mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ -s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ -6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi -FL39vmwLAw== ------END CERTIFICATE----- - -Sonera Class 2 Root CA -====================== ------BEGIN CERTIFICATE----- -MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG -U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw -NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh -IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 -/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT -dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG -f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P -tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH -nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT -XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt -0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI -cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph -Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx -EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH -llpwrN9M ------END CERTIFICATE----- - -Staat der Nederlanden Root CA -============================= ------BEGIN CERTIFICATE----- -MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE -ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w -HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh -bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt -vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P -jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca -C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth -vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 -22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV -HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v -dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN -BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR -EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw -MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y -nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR -iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== ------END CERTIFICATE----- - -TDC Internet Root CA -==================== ------BEGIN CERTIFICATE----- -MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE -ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx -NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu -ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j -xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL -znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc -5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 -otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI -AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM -VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM -MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC -AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe -UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G -CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m -gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ -2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb -O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU -Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l ------END CERTIFICATE----- - -TDC OCES Root CA -================ ------BEGIN CERTIFICATE----- -MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE -ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5 -MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH -nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0 -zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV -iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde -dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO -3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB -5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k -ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm -cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp -Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x -LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM -MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm -aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy -MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647 -+RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6 -NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4 -A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc -A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9 -AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1 -AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw== ------END CERTIFICATE----- - -UTN DATACorp SGC Root CA -======================== ------BEGIN CERTIFICATE----- -MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ -BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa -MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w -HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy -dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys -raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo -wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA -9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv -33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud -DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 -BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD -LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 -DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft -Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 -I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx -EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP -DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI ------END CERTIFICATE----- - -UTN USERFirst Hardware Root CA -============================== ------BEGIN CERTIFICATE----- -MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE -BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl -IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd -BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx -OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 -eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz -ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI -wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd -tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 -i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf -Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw -gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF -lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF -UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF -BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM -//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW -XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 -lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn -iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 -nfhmqA== ------END CERTIFICATE----- - -Camerfirma Chambers of Commerce Root -==================================== ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe -QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i -ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx -NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp -cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn -MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC -AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU -xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH -NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW -DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV -d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud -EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v -cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P -AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh -bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD -VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz -aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi -fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD -L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN -UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n -ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 -erfutGWaIZDgqtCYvDi1czyL+Nw= ------END CERTIFICATE----- - -Camerfirma Global Chambersign Root -================================== ------BEGIN CERTIFICATE----- -MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe -QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i -ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx -NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt -YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg -MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw -ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J -1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O -by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl -6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c -8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ -BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j -aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B -Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj -aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y -ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh -bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA -PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y -gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ -PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 -IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes -t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== ------END CERTIFICATE----- - -NetLock Notary (Class A) Root -============================= ------BEGIN CERTIFICATE----- -MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI -EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 -dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j -ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX -DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH -EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD -VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz -cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM -D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ -z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC -/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 -tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 -4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG -A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC -Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv -bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu -IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn -LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 -ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz -IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh -IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu -b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh -bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg -Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp -bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 -ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP -ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB -CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr -KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM -8CgHrTwXZoi1/baI ------END CERTIFICATE----- - -NetLock Business (Class B) Root -=============================== ------BEGIN CERTIFICATE----- -MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg -VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD -VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv -bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg -VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB -iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S -o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr -1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV -HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ -RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh -dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 -ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv -c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg -YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh -c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz -Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA -bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl -IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 -YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj -cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM -43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR -stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI ------END CERTIFICATE----- - -NetLock Express (Class C) Root -============================== ------BEGIN CERTIFICATE----- -MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT -CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV -BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD -KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ -BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 -dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j -ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB -jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z -W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 -euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw -DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN -RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn -YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB -IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i -aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 -ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs -ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo -dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y -emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k -IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ -UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg -YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 -xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW -gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== ------END CERTIFICATE----- - -XRamp Global CA Root -==================== ------BEGIN CERTIFICATE----- -MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE -BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj -dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx -HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg -U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp -dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu -IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx -foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE -zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs -AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry -xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap -oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC -AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc -/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt -qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n -nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz -8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= ------END CERTIFICATE----- - -Go Daddy Class 2 CA -=================== ------BEGIN CERTIFICATE----- -MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY -VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG -A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g -RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD -ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv -2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 -qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j -YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY -vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O -BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o -atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu -MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG -A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim -PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt -I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ -HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI -Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b -vZ8= ------END CERTIFICATE----- - -Starfield Class 2 CA -==================== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc -U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg -Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo -MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG -A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG -SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY -bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ -JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm -epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN -F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF -MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f -hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo -bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g -QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs -afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM -PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl -xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD -KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 -QBFGmh95DmK/D5fs4C8fF5Q= ------END CERTIFICATE----- - -StartCom Certification Authority -================================ ------BEGIN CERTIFICATE----- -MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN -U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu -ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 -NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk -LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg -U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw -ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y -o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ -Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d -eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt -2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z -6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ -osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ -untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc -UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT -37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE -FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 -Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj -YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH -AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw -Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg -U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 -LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl -cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh -cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT -dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC -AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh -3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm -vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk -fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 -fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ -EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq -yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl -1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ -lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro -g14= ------END CERTIFICATE----- - -Taiwan GRCA -=========== ------BEGIN CERTIFICATE----- -MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG -EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X -DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv -dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN -w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 -BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O -1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO -htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov -J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 -Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t -B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB -O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 -lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV -HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 -09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ -TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj -Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 -Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU -D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz -DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk -Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk -7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ -CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy -+fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS ------END CERTIFICATE----- - -Firmaprofesional Root CA -======================== ------BEGIN CERTIFICATE----- -MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT -GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp -Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA -ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL -MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT -OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2 -ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V -j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH -lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf -3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8 -NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww -KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG -AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud -DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD -ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq -u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf -wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm -7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG -VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA= ------END CERTIFICATE----- - -Wells Fargo Root CA -=================== ------BEGIN CERTIFICATE----- -MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV -BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv -cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl -bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv -MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG -SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX -x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3 -E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5 -OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j -sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj -YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF -BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD -ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv -m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R -OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx -x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023 -tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= ------END CERTIFICATE----- - -Swisscom Root CA 1 -================== ------BEGIN CERTIFICATE----- -MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG -EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy -dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 -MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln -aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC -IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM -MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF -NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe -AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC -b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn -7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN -cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp -WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 -haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY -MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw -HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j -BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 -MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn -jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ -MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H -VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl -vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl -OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 -1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq -nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy -x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW -NY6E0F/6MBr1mmz0DlP5OlvRHA== ------END CERTIFICATE----- - -DigiCert Assured ID Root CA -=========================== ------BEGIN CERTIFICATE----- -MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw -IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx -MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL -ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO -9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy -UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW -/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy -oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf -GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF -66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq -hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc -EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn -SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i -8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe -+o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== ------END CERTIFICATE----- - -DigiCert Global Root CA -======================= ------BEGIN CERTIFICATE----- -MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw -HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw -MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 -dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn -TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 -BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H -4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y -7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB -o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm -8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF -BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr -EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt -tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 -UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk -CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= ------END CERTIFICATE----- - -DigiCert High Assurance EV Root CA -================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG -EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw -KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw -MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ -MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu -Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t -Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS -OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 -MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ -NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe -h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB -Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY -JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ -V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp -myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK -mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe -vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K ------END CERTIFICATE----- - -Certplus Class 2 Primary CA -=========================== ------BEGIN CERTIFICATE----- -MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE -BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN -OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy -dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP -ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR -5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ -Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO -YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e -e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME -CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ -YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t -L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD -P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R -TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ -7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW -//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 -l7+ijrRU ------END CERTIFICATE----- - -DST Root CA X3 -============== ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK -ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X -DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 -cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT -rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 -UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy -xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d -utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T -AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ -MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug -dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE -GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw -RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS -fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ ------END CERTIFICATE----- - -DST ACES CA X6 -============== ------BEGIN CERTIFICATE----- -MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT -MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha -MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE -CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI -DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa -pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow -GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy -MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud -EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu -Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy -dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU -CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 -5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t -Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq -nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs -vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 -oKfN5XozNmr6mis= ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 1 -============================================== ------BEGIN CERTIFICATE----- -MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP -MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 -acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx -MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg -U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB -TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC -aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX -yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i -Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ -8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 -W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME -BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 -sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE -q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy -B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY -nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H ------END CERTIFICATE----- - -TURKTRUST Certificate Services Provider Root 2 -============================================== ------BEGIN CERTIFICATE----- -MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP -MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg -QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN -MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr -dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G -A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls -acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe -LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI -x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g -QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr -5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB -AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G -A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt -Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 -Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ -hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P -9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 -UrbnBEI= ------END CERTIFICATE----- - -SwissSign Gold CA - G2 -====================== ------BEGIN CERTIFICATE----- -MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw -EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN -MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp -c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq -t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C -jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg -vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF -ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR -AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend -jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO -peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR -7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi -GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 -OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov -L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm -5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr -44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf -Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m -Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp -mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk -vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf -KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br -NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj -viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ ------END CERTIFICATE----- - -SwissSign Silver CA - G2 -======================== ------BEGIN CERTIFICATE----- -MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT -BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X -DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 -aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG -9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 -N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm -+/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH -6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu -MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h -qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 -FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs -ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc -celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X -CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB -tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 -cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P -4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F -kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L -3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx -/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa -DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP -e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu -WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ -DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub -DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority -======================================== ------BEGIN CERTIFICATE----- -MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG -EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx -CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ -cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN -b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 -nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge -RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt -tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD -AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI -hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K -Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN -NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa -Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG -1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= ------END CERTIFICATE----- - -thawte Primary Root CA -====================== ------BEGIN CERTIFICATE----- -MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 -MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg -SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv -KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT -FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs -oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ -1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc -q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K -aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p -afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD -VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF -AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE -uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX -xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 -jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH -z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G5 -============================================================ ------BEGIN CERTIFICATE----- -MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp -ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB -yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln -biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh -dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt -YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz -j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD -Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ -Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r -fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ -BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv -Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy -aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG -SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ -X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE -KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC -Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE -ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq ------END CERTIFICATE----- - -SecureTrust CA -============== ------BEGIN CERTIFICATE----- -MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy -dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe -BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC -ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX -OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t -DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH -GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b -01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH -ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ -BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj -aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu -SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf -mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ -nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR -3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= ------END CERTIFICATE----- - -Secure Global CA -================ ------BEGIN CERTIFICATE----- -MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG -EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH -bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg -MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg -Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx -YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ -bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g -8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV -HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi -0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud -EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn -oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA -MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ -OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn -CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 -3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc -f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW ------END CERTIFICATE----- - -COMODO Certification Authority -============================== ------BEGIN CERTIFICATE----- -MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE -BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG -A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 -dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb -MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD -T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH -+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww -xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV -4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA -1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI -rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k -b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC -AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP -OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ -RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc -IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN -+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== ------END CERTIFICATE----- - -Network Solutions Certificate Authority -======================================= ------BEGIN CERTIFICATE----- -MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG -EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr -IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx -MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu -MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx -jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT -aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT -crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc -/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB -AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv -bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA -A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q -4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ -GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv -wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD -ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey ------END CERTIFICATE----- - -WellsSecure Public Root Certificate Authority -============================================= ------BEGIN CERTIFICATE----- -MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM -F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw -NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN -MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl -bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD -VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 -iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 -i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 -bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB -K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB -AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu -cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm -lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB -i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww -GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI -K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 -bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj -qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es -E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ -tylv2G0xffX8oRAHh84vWdw+WNs= ------END CERTIFICATE----- - -COMODO ECC Certification Authority -================================== ------BEGIN CERTIFICATE----- -MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC -R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE -ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB -dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix -GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR -Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo -b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X -4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni -wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E -BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG -FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA -U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= ------END CERTIFICATE----- - -IGC/A -===== ------BEGIN CERTIFICATE----- -MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD -VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE -Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy -MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI -EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT -STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB -IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 -TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW -So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy -HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd -frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ -tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB -egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC -iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK -q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q -MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg -Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI -lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF -0mBWWg== ------END CERTIFICATE----- - -Security Communication EV RootCA1 -================================= ------BEGIN CERTIFICATE----- -MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc -U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh -dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE -BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl -Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO -/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX -WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z -ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 -bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK -9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm -iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG -Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW -mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW -T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 ------END CERTIFICATE----- - -OISTE WISeKey Global Root GA CA -=============================== ------BEGIN CERTIFICATE----- -MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE -BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG -A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH -bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD -VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw -IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 -IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 -Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg -Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD -d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ -/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R -LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw -AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ -KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm -MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 -+vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa -hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY -okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= ------END CERTIFICATE----- - -Microsec e-Szigno Root CA -========================= ------BEGIN CERTIFICATE----- -MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE -BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL -EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 -MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz -dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT -GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB -AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG -d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N -oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc -QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ -PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb -MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG -IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD -VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 -LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A -dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn -AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA -4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg -AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA -egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 -Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO -PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv -c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h -cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw -IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT -WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV -MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER -MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp -Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal -HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT -nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE -aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a -86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK -yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB -S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= ------END CERTIFICATE----- - -Certigna -======== ------BEGIN CERTIFICATE----- -MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw -EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 -MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI -Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q -XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH -GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p -ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg -DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf -Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ -tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ -BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J -SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA -hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ -ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu -PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY -1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw -WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== ------END CERTIFICATE----- - -AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. -====================================== ------BEGIN CERTIFICATE----- -MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT -AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg -LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w -HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ -U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh -IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN -yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU -2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 -4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP -2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm -8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf -HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa -Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK -5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b -czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE -AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g -ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF -BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug -cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf -AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX -EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v -/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 -MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 -3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk -eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f -/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h -RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU -Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== ------END CERTIFICATE----- - -TC TrustCenter Class 2 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy -IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw -MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 -c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE -AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw -IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 -xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ -Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u -SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB -7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 -Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU -cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i -SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G -dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ -KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj -TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP -JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk -vQ== ------END CERTIFICATE----- - -TC TrustCenter Class 3 CA II -============================ ------BEGIN CERTIFICATE----- -MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy -IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw -MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 -c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE -AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W -yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo -6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ -uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk -2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB -7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 -Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU -cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i -SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u -TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE -O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 -yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 -IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal -092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc -5A== ------END CERTIFICATE----- - -TC TrustCenter Universal CA I -============================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy -IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN -MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg -VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw -JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD -ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC -qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv -xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw -ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O -gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j -BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG -1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy -vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 -ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT -ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a -7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY ------END CERTIFICATE----- - -Deutsche Telekom Root CA 2 -========================== ------BEGIN CERTIFICATE----- -MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT -RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG -A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 -MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G -A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS -b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 -bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI -KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY -AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK -Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV -jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV -HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr -E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy -zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 -rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G -dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU -Cm26OWMohpLzGITY+9HPBVZkVw== ------END CERTIFICATE----- - -ComSign Secured CA -================== ------BEGIN CERTIFICATE----- -MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE -AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w -NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD -QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw -ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs -49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH -7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB -kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 -9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw -AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t -U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA -j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC -AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a -BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp -FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP -51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz -OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== ------END CERTIFICATE----- - -Cybertrust Global Root -====================== ------BEGIN CERTIFICATE----- -MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li -ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 -MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD -ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA -+Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW -0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL -AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin -89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT -8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP -BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 -MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G -A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO -lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi -5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 -hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T -X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW -WL1WMRJOEcgh4LMRkWXbtKaIOM5V ------END CERTIFICATE----- - -ePKI Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG -EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg -Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx -MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq -MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B -AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs -IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi -lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv -qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX -12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O -WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ -ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao -lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ -vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi -Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi -MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH -ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 -1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq -KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV -xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP -NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r -GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE -xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx -gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy -sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD -BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= ------END CERTIFICATE----- - -T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 -============================================================================================================================= ------BEGIN CERTIFICATE----- -MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH -DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q -aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry -b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV -BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg -S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 -MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl -IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF -n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl -IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft -dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl -cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B -AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO -Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 -xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR -6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL -hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd -BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF -MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 -N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT -y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh -LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M -dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= ------END CERTIFICATE----- - -Buypass Class 2 CA 1 -==================== ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 -MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh -c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M -cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 -0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 -0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R -uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P -AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV -1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt -7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 -fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w -wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho ------END CERTIFICATE----- - -Buypass Class 3 CA 1 -==================== ------BEGIN CERTIFICATE----- -MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU -QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 -MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh -c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx -ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 -n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia -AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c -1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P -AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 -pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA -EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 -htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj -el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 ------END CERTIFICATE----- - -EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 -========================================================================== ------BEGIN CERTIFICATE----- -MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF -bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg -QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe -Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p -ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt -IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG -SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by -X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b -gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr -eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ -TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy -Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn -uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI -qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm -ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 -Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB -/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW -Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t -FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm -zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k -XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT -bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU -RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK -1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt -2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ -Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 -AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT ------END CERTIFICATE----- - -certSIGN ROOT CA -================ ------BEGIN CERTIFICATE----- -MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD -VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa -Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE -CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I -JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH -rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 -ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD -0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 -AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B -Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB -AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 -SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 -x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt -vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz -TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD ------END CERTIFICATE----- - -CNNIC ROOT -========== ------BEGIN CERTIFICATE----- -MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE -ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw -OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD -o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz -VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT -VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or -czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK -y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC -wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S -lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 -Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM -O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 -BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 -G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m -mxE= ------END CERTIFICATE----- - -ApplicationCA - Japanese Government -=================================== ------BEGIN CERTIFICATE----- -MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT -SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw -MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl -cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB -CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 -fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN -wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE -jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu -nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU -WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV -BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD -vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs -o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g -/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD -io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW -dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL -rosot4LKGAfmt1t06SAZf7IbiVQ= ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G3 -============================================= ------BEGIN CERTIFICATE----- -MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE -BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 -IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy -eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz -NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo -YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT -LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j -K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE -c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C -IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu -dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr -2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 -cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE -Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD -AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s -t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt ------END CERTIFICATE----- - -thawte Primary Root CA - G2 -=========================== ------BEGIN CERTIFICATE----- -MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC -VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu -IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg -Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV -MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG -b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt -IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS -LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 -8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU -mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN -G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K -rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== ------END CERTIFICATE----- - -thawte Primary Root CA - G3 -=========================== ------BEGIN CERTIFICATE----- -MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE -BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 -aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv -cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w -ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh -d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD -VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG -A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A -MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At -P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC -+BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY -7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW -vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E -BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ -KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK -A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu -t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC -8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm -er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= ------END CERTIFICATE----- - -GeoTrust Primary Certification Authority - G2 -============================================= ------BEGIN CERTIFICATE----- -MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC -VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu -Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD -ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 -OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg -MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl -b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG -BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc -KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD -VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ -EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m -ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 -npaqBA+K ------END CERTIFICATE----- - -VeriSign Universal Root Certification Authority -=============================================== ------BEGIN CERTIFICATE----- -MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE -BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO -ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk -IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u -IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV -UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv -cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl -IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 -aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj -1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP -MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 -9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I -AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR -tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G -CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O -a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud -DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 -Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx -Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx -P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P -wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 -mJO37M2CYfE45k+XmCpajQ== ------END CERTIFICATE----- - -VeriSign Class 3 Public Primary Certification Authority - G4 -============================================================ ------BEGIN CERTIFICATE----- -MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC -VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 -b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz -ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj -YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL -MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU -cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo -b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 -Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz -rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB -/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw -HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u -Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD -A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx -AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== ------END CERTIFICATE----- - -NetLock Arany (Class Gold) FÅ‘tanúsítvány -============================================ ------BEGIN CERTIFICATE----- -MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G -A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 -dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB -cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx -MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO -ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv -biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 -c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu -0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw -/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk -H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw -fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 -neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB -BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW -qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta -YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC -bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna -NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu -dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= ------END CERTIFICATE----- - -Staat der Nederlanden Root CA - G2 -================================== ------BEGIN CERTIFICATE----- -MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE -CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g -Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC -TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l -ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ -5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn -vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj -CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil -e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR -OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI -CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 -48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi -trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 -qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB -AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC -ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV -HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA -A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz -+51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj -f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN -kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk -CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF -URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb -CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h -oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV -IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm -66+KAQ== ------END CERTIFICATE----- - -CA Disig -======== ------BEGIN CERTIFICATE----- -MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK -QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw -MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz -bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 -DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm -GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD -Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo -hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt -ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w -gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P -AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz -aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff -ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa -BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t -WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 -mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ -CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K -ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA -4Z7CRneC9VkGjCFMhwnN5ag= ------END CERTIFICATE----- - -Juur-SK -======= ------BEGIN CERTIFICATE----- -MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA -c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw -DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG -SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy -aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC -ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf -TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC -+Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw -UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa -Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF -MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD -HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh -AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA -cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr -AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw -cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE -FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G -A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo -ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL -abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 -IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh -Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 -yyqcjg== ------END CERTIFICATE----- - -Hongkong Post Root CA 1 -======================= ------BEGIN CERTIFICATE----- -MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT -DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx -NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n -IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 -ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr -auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh -qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY -V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV -HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i -h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio -l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei -IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps -T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT -c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== ------END CERTIFICATE----- - -SecureSign RootCA11 -=================== ------BEGIN CERTIFICATE----- -MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi -SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS -b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw -KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 -cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL -TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO -wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq -g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP -O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA -bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX -t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh -OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r -bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ -Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 -y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 -lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= ------END CERTIFICATE----- - -ACEDICOM Root -============= ------BEGIN CERTIFICATE----- -MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD -T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 -MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG -A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF -AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk -WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD -YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew -MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb -m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk -HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT -xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 -3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 -2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq -TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz -4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU -9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv -bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg -aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP -eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk -zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 -ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI -KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq -nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE -I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp -MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o -tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== ------END CERTIFICATE----- - -Verisign Class 3 Public Primary Certification Authority -======================================================= ------BEGIN CERTIFICATE----- -MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx -FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 -IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow -XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz -IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA -A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 -f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol -hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky -CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX -bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ -D/xwzoiQ ------END CERTIFICATE----- - -Microsec e-Szigno Root CA 2009 -============================== ------BEGIN CERTIFICATE----- -MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER -MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv -c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o -dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE -BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt -U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw -DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA -fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG -0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA -pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm -1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC -AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf -QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE -FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o -lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX -I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 -tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 -yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi -LXpUq3DDfSJlgnCW ------END CERTIFICATE----- - -E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi -=================================================== ------BEGIN CERTIFICATE----- -MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG -EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz -ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 -MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 -cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u -aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY -8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y -jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI -JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk -9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD -AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG -SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d -F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq -D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 -Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq -fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX ------END CERTIFICATE----- - -GlobalSign Root CA - R3 -======================= ------BEGIN CERTIFICATE----- -MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv -YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh -bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT -aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln -bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt -iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ -0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 -rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl -OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 -xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE -FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 -lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 -EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E -bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 -YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r -kpeDMdmztcpHWD9f ------END CERTIFICATE----- - -TC TrustCenter Universal CA III -=============================== ------BEGIN CERTIFICATE----- -MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC -REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy -IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe -Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU -QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex -KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB -AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt -QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO -juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut -CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 -M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G -A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ -BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA -g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ -KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK -BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV -CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq -woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== ------END CERTIFICATE----- - -Autoridad de Certificacion Firmaprofesional CIF A62634068 -========================================================= ------BEGIN CERTIFICATE----- -MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA -BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 -MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw -QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB -NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD -Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P -B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY -7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH -ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI -plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX -MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX -LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK -bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU -vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud -EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH -DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp -cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA -bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx -ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx -51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk -R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP -T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f -Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl -osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR -crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR -saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD -KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi -6Et8Vcad+qMUu2WFbm5PEn4KPJ2V ------END CERTIFICATE----- - -Izenpe.com -========== ------BEGIN CERTIFICATE----- -MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG -EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz -MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu -QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ -03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK -ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU -+zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC -PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT -OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK -F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK -0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ -0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB -leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID -AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ -SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG -NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx -MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O -BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l -Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga -kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q -hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs -g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 -aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 -nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC -ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo -Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z -WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== ------END CERTIFICATE----- - -Chambers of Commerce Root - 2008 -================================ ------BEGIN CERTIFICATE----- -MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy -Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl -ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF -EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl -cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC -AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA -XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj -h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ -ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk -NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g -D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 -lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ -0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj -ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 -EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI -G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ -BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh -bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh -bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC -CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH -AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 -wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH -3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU -RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 -M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 -YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF -9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK -zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG -nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg -OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ ------END CERTIFICATE----- - -Global Chambersign Root - 2008 -============================== ------BEGIN CERTIFICATE----- -MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD -MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv -bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu -QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx -NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg -Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ -QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD -aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf -VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf -XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 -ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB -/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA -TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M -H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe -Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF -HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh -wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB -AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT -BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE -BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm -aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm -aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp -1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 -dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG -/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 -ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s -dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg -9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH -foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du -qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr -P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq -c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z -09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B ------END CERTIFICATE----- - -Go Daddy Root Certificate Authority - G2 -======================================== ------BEGIN CERTIFICATE----- -MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu -MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 -MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 -b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G -A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI -hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq -9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD -+qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd -fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl -NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC -MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 -BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac -vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r -5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV -N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO -LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 ------END CERTIFICATE----- - -Starfield Root Certificate Authority - G2 -========================================= ------BEGIN CERTIFICATE----- -MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 -eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw -DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg -VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB -dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv -W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs -bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk -N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf -ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU -JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol -TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx -4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw -F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K -pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ -c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 ------END CERTIFICATE----- - -Starfield Services Root Certificate Authority - G2 -================================================== ------BEGIN CERTIFICATE----- -MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT -B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s -b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl -IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV -BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT -dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg -Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC -AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 -h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa -hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP -LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB -rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw -AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG -SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP -E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy -xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd -iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza -YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 ------END CERTIFICATE----- - -AffirmTrust Commercial -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw -MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb -DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV -C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 -BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww -MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV -HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG -hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi -qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv -0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh -sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= ------END CERTIFICATE----- - -AffirmTrust Networking -====================== ------BEGIN CERTIFICATE----- -MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw -MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly -bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF -AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE -Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI -dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 -/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb -h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV -HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC -AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu -UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 -12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 -WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 -/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= ------END CERTIFICATE----- - -AffirmTrust Premium -=================== ------BEGIN CERTIFICATE----- -MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS -BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy -OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy -dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A -MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn -BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV -5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs -+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd -GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R -p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI -S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 -6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 -/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo -+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB -/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv -MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg -Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC -6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S -L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK -+4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV -BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg -IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 -g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb -zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== ------END CERTIFICATE----- - -AffirmTrust Premium ECC -======================= ------BEGIN CERTIFICATE----- -MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV -BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx -MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U -cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA -IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ -N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW -BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK -BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X -57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM -eQ== ------END CERTIFICATE----- - -Certum Trusted Network CA -========================= ------BEGIN CERTIFICATE----- -MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK -ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv -biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy -MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU -ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 -MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC -AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC -l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J -J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 -fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 -cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB -Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw -DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj -jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 -mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj -Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI -03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= ------END CERTIFICATE----- - -Certinomis - Autorité Racine -============================= ------BEGIN CERTIFICATE----- -MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK -Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg -LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG -A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw -JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD -ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa -wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly -Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw -2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N -jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q -c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC -lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb -xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g -530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna -4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G -A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ -KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x -WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva -R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 -nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B -CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv -JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE -qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b -WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE -wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ -vgt2Fl43N+bYdJeimUV5 ------END CERTIFICATE----- - -Root CA Generalitat Valenciana -============================== ------BEGIN CERTIFICATE----- -MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE -ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 -IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 -WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE -CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G -CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 -F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B -ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ -D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte -JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB -AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n -dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB -ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl -AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA -YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy -AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA -aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt -AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA -YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu -AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA -OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 -dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV -BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G -A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S -b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh -TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz -Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 -NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH -iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt -+GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= ------END CERTIFICATE----- - -A-Trust-nQual-03 -================ ------BEGIN CERTIFICATE----- -MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE -Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy -a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R -dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw -RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 -ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 -c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA -zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n -yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE -SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 -iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V -cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV -eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 -ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr -sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd -JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS -mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 -ahq97BvIxYSazQ== ------END CERTIFICATE----- - -TWCA Root Certification Authority -================================= ------BEGIN CERTIFICATE----- -MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ -VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh -dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG -EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB -IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK -AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx -QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC -oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP -4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r -y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB -BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG -9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC -mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW -QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY -T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny -Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== ------END CERTIFICATE----- \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhOAuth.php b/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhOAuth.php deleted file mode 100644 index c4ad4e78a9..0000000000 --- a/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhOAuth.php +++ /dev/null @@ -1,724 +0,0 @@ -params = array(); - $this->headers = array(); - $this->auto_fixed_time = false; - $this->buffer = null; - - // default configuration options - $this->config = array_merge( - array( - // leave 'user_agent' blank for default, otherwise set this to - // something that clearly identifies your app - 'user_agent' => '', - // default timezone for requests - 'timezone' => 'UTC', - - 'use_ssl' => true, - 'host' => 'api.twitter.com', - - 'consumer_key' => '', - 'consumer_secret' => '', - 'user_token' => '', - 'user_secret' => '', - 'force_nonce' => false, - 'nonce' => false, // used for checking signatures. leave as false for auto - 'force_timestamp' => false, - 'timestamp' => false, // used for checking signatures. leave as false for auto - - // oauth signing variables that are not dynamic - 'oauth_version' => '1.0', - 'oauth_signature_method' => 'HMAC-SHA1', - - // you probably don't want to change any of these curl values - 'curl_connecttimeout' => 30, - 'curl_timeout' => 10, - - // for security this should always be set to 2. - 'curl_ssl_verifyhost' => 2, - // for security this should always be set to true. - 'curl_ssl_verifypeer' => true, - - // you can get the latest cacert.pem from here http://curl.haxx.se/ca/cacert.pem - 'curl_cainfo' => dirname(__FILE__) . DIRECTORY_SEPARATOR . 'cacert.pem', - 'curl_capath' => dirname(__FILE__), - - 'curl_followlocation' => false, // whether to follow redirects or not - - // support for proxy servers - 'curl_proxy' => false, // really you don't want to use this if you are using streaming - 'curl_proxyuserpwd' => false, // format username:password for proxy, if required - 'curl_encoding' => '', // leave blank for all supported formats, else use gzip, deflate, identity - - // streaming API - 'is_streaming' => false, - 'streaming_eol' => "\r\n", - 'streaming_metrics_interval' => 60, - - // header or querystring. You should always use header! - // this is just to help me debug other developers implementations - 'as_header' => true, - 'debug' => false, - ), - $config - ); - $this->set_user_agent(); - date_default_timezone_set($this->config['timezone']); - } - - /** - * Sets the useragent for PHP to use - * If '$this->config['user_agent']' already has a value it is used instead of one - * being generated. - * - * @return void value is stored to the config array class variable - */ - private function set_user_agent() { - if (!empty($this->config['user_agent'])) - return; - - if ($this->config['curl_ssl_verifyhost'] && $this->config['curl_ssl_verifypeer']) { - $ssl = '+SSL'; - } else { - $ssl = '-SSL'; - } - - $ua = 'tmhOAuth ' . self::VERSION . $ssl . ' - //github.com/themattharris/tmhOAuth'; - $this->config['user_agent'] = $ua; - } - - /** - * Generates a random OAuth nonce. - * If 'force_nonce' is true a nonce is not generated and the value in the configuration will be retained. - * - * @param string $length how many characters the nonce should be before MD5 hashing. default 12 - * @param string $include_time whether to include time at the beginning of the nonce. default true - * @return void value is stored to the config array class variable - */ - private function create_nonce($length=12, $include_time=true) { - if ($this->config['force_nonce'] == false) { - $sequence = array_merge(range(0,9), range('A','Z'), range('a','z')); - $length = $length > count($sequence) ? count($sequence) : $length; - shuffle($sequence); - - $prefix = $include_time ? microtime() : ''; - $this->config['nonce'] = md5(substr($prefix . implode('', $sequence), 0, $length)); - } - } - - /** - * Generates a timestamp. - * If 'force_timestamp' is true a nonce is not generated and the value in the configuration will be retained. - * - * @return void value is stored to the config array class variable - */ - private function create_timestamp() { - $this->config['timestamp'] = ($this->config['force_timestamp'] == false ? time() : $this->config['timestamp']); - } - - /** - * Encodes the string or array passed in a way compatible with OAuth. - * If an array is passed each array value will will be encoded. - * - * @param mixed $data the scalar or array to encode - * @return $data encoded in a way compatible with OAuth - */ - private function safe_encode($data) { - if (is_array($data)) { - return array_map(array($this, 'safe_encode'), $data); - } else if (is_scalar($data)) { - return str_ireplace( - array('+', '%7E'), - array(' ', '~'), - rawurlencode($data) - ); - } else { - return ''; - } - } - - /** - * Decodes the string or array from it's URL encoded form - * If an array is passed each array value will will be decoded. - * - * @param mixed $data the scalar or array to decode - * @return string $data decoded from the URL encoded form - */ - private function safe_decode($data) { - if (is_array($data)) { - return array_map(array($this, 'safe_decode'), $data); - } else if (is_scalar($data)) { - return rawurldecode($data); - } else { - return ''; - } - } - - /** - * Returns an array of the standard OAuth parameters. - * - * @return array all required OAuth parameters, safely encoded - */ - private function get_defaults() { - $defaults = array( - 'oauth_version' => $this->config['oauth_version'], - 'oauth_nonce' => $this->config['nonce'], - 'oauth_timestamp' => $this->config['timestamp'], - 'oauth_consumer_key' => $this->config['consumer_key'], - 'oauth_signature_method' => $this->config['oauth_signature_method'], - ); - - // include the user token if it exists - if ( $this->config['user_token'] ) - $defaults['oauth_token'] = $this->config['user_token']; - - // safely encode - foreach ($defaults as $k => $v) { - $_defaults[$this->safe_encode($k)] = $this->safe_encode($v); - } - - return $_defaults; - } - - /** - * Extracts and decodes OAuth parameters from the passed string - * - * @param string $body the response body from an OAuth flow method - * @return array the response body safely decoded to an array of key => values - */ - public function extract_params($body) { - $kvs = explode('&', $body); - $decoded = array(); - foreach ($kvs as $kv) { - $kv = explode('=', $kv, 2); - $kv[0] = $this->safe_decode($kv[0]); - $kv[1] = $this->safe_decode($kv[1]); - $decoded[$kv[0]] = $kv[1]; - } - return $decoded; - } - - /** - * Prepares the HTTP method for use in the base string by converting it to - * uppercase. - * - * @param string $method an HTTP method such as GET or POST - * @return void value is stored to the class variable 'method' - */ - private function prepare_method($method) { - $this->method = strtoupper($method); - } - - /** - * Prepares the URL for use in the base string by ripping it apart and - * reconstructing it. - * - * Ref: 3.4.1.2 - * - * @param string $url the request URL - * @return void value is stored to the class variable 'url' - */ - private function prepare_url($url) { - $parts = parse_url($url); - - $port = isset($parts['port']) ? $parts['port'] : false; - $scheme = $parts['scheme']; - $host = $parts['host']; - $path = isset($parts['path']) ? $parts['path'] : false; - - $port or $port = ($scheme == 'https') ? '443' : '80'; - - if (($scheme == 'https' && $port != '443') - || ($scheme == 'http' && $port != '80')) { - $host = "$host:$port"; - } - - // the scheme and host MUST be lowercase - $this->url = strtolower("$scheme://$host"); - // but not the path - $this->url .= $path; - } - - /** - * Prepares all parameters for the base string and request. - * Multipart parameters are ignored as they are not defined in the specification, - * all other types of parameter are encoded for compatibility with OAuth. - * - * @param array $params the parameters for the request - * @return void prepared values are stored in the class variable 'signing_params' - */ - private function prepare_params($params) { - // do not encode multipart parameters, leave them alone - if ($this->config['multipart']) { - $this->request_params = $params; - $params = array(); - } - - // signing parameters are request parameters + OAuth default parameters - $this->signing_params = array_merge($this->get_defaults(), (array)$params); - - // Remove oauth_signature if present - // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.") - if (isset($this->signing_params['oauth_signature'])) { - unset($this->signing_params['oauth_signature']); - } - - // Parameters are sorted by name, using lexicographical byte value ordering. - // Ref: Spec: 9.1.1 (1) - uksort($this->signing_params, 'strcmp'); - - // encode. Also sort the signed parameters from the POST parameters - foreach ($this->signing_params as $k => $v) { - $k = $this->safe_encode($k); - - if (is_array($v)) - $v = implode(',', $v); - - $v = $this->safe_encode($v); - $_signing_params[$k] = $v; - $kv[] = "{$k}={$v}"; - } - - // auth params = the default oauth params which are present in our collection of signing params - $this->auth_params = array_intersect_key($this->get_defaults(), $_signing_params); - if (isset($_signing_params['oauth_callback'])) { - $this->auth_params['oauth_callback'] = $_signing_params['oauth_callback']; - unset($_signing_params['oauth_callback']); - } - - if (isset($_signing_params['oauth_verifier'])) { - $this->auth_params['oauth_verifier'] = $_signing_params['oauth_verifier']; - unset($_signing_params['oauth_verifier']); - } - - // request_params is already set if we're doing multipart, if not we need to set them now - if ( ! $this->config['multipart']) - $this->request_params = array_diff_key($_signing_params, $this->get_defaults()); - - // create the parameter part of the base string - $this->signing_params = implode('&', $kv); - } - - /** - * Prepares the OAuth signing key - * - * @return void prepared signing key is stored in the class variable 'signing_key' - */ - private function prepare_signing_key() { - $this->signing_key = $this->safe_encode($this->config['consumer_secret']) . '&' . $this->safe_encode($this->config['user_secret']); - } - - /** - * Prepare the base string. - * Ref: Spec: 9.1.3 ("Concatenate Request Elements") - * - * @return void prepared base string is stored in the class variable 'base_string' - */ - private function prepare_base_string() { - $url = $this->url; - - # if the host header is set we need to rewrite the basestring to use - # that, instead of the request host. otherwise the signature won't match - # on the server side - if (!empty($this->custom_headers['Host'])) { - $url = str_ireplace( - $this->config['host'], - $this->custom_headers['Host'], - $url - ); - } - - $base = array( - $this->method, - $url, - $this->signing_params - ); - $this->base_string = implode('&', $this->safe_encode($base)); - } - - /** - * Prepares the Authorization header - * - * @return void prepared authorization header is stored in the class variable headers['Authorization'] - */ - private function prepare_auth_header() { - unset($this->headers['Authorization']); - - uksort($this->auth_params, 'strcmp'); - if (!$this->config['as_header']) : - $this->request_params = array_merge($this->request_params, $this->auth_params); - return; - endif; - - foreach ($this->auth_params as $k => $v) { - $kv[] = "{$k}=\"{$v}\""; - } - $this->auth_header = 'OAuth ' . implode(', ', $kv); - $this->headers['Authorization'] = $this->auth_header; - } - - /** - * Signs the request and adds the OAuth signature. This runs all the request - * parameter preparation methods. - * - * @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc - * @param string $url the request URL without query string parameters - * @param array $params the request parameters as an array of key=value pairs - * @param string $useauth whether to use authentication when making the request. - * @return void - */ - private function sign($method, $url, $params, $useauth) { - $this->prepare_method($method); - $this->prepare_url($url); - $this->prepare_params($params); - - // we don't sign anything is we're not using auth - if ($useauth) { - $this->prepare_base_string(); - $this->prepare_signing_key(); - - $this->auth_params['oauth_signature'] = $this->safe_encode( - base64_encode( - hash_hmac( - 'sha1', $this->base_string, $this->signing_key, true - ))); - - $this->prepare_auth_header(); - } - } - - /** - * Make an HTTP request using this library. This method doesn't return anything. - * Instead the response should be inspected directly. - * - * @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc - * @param string $url the request URL without query string parameters - * @param array $params the request parameters as an array of key=value pairs. Default empty array - * @param string $useauth whether to use authentication when making the request. Default true - * @param string $multipart whether this request contains multipart data. Default false - * @param array $headers any custom headers to send with the request. Default empty array - * @return int the http response code for the request. 0 is returned if a connection could not be made - */ - public function request($method, $url, $params=array(), $useauth=true, $multipart=false, $headers=array()) { - // reset the request headers (we don't want to reuse them) - $this->headers = array(); - $this->custom_headers = $headers; - - $this->config['multipart'] = $multipart; - - $this->create_nonce(); - $this->create_timestamp(); - - $this->sign($method, $url, $params, $useauth); - - if (!empty($this->custom_headers)) - $this->headers = array_merge((array)$this->headers, (array)$this->custom_headers); - - return $this->curlit(); - } - - /** - * Make a long poll HTTP request using this library. This method is - * different to the other request methods as it isn't supposed to disconnect - * - * Using this method expects a callback which will receive the streaming - * responses. - * - * @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc - * @param string $url the request URL without query string parameters - * @param array $params the request parameters as an array of key=value pairs - * @param string $callback the callback function to stream the buffer to. - * @return void - */ - public function streaming_request($method, $url, $params=array(), $callback='') { - if ( ! empty($callback) ) { - if ( ! is_callable($callback) ) { - return false; - } - $this->config['streaming_callback'] = $callback; - } - $this->metrics['start'] = time(); - $this->metrics['interval_start'] = $this->metrics['start']; - $this->metrics['tweets'] = 0; - $this->metrics['last_tweets'] = 0; - $this->metrics['bytes'] = 0; - $this->metrics['last_bytes'] = 0; - $this->config['is_streaming'] = true; - $this->request($method, $url, $params); - } - - /** - * Handles the updating of the current Streaming API metrics. - * - * @return array the metrics for the streaming api connection - */ - private function update_metrics() { - $now = time(); - if (($this->metrics['interval_start'] + $this->config['streaming_metrics_interval']) > $now) - return false; - - $this->metrics['tps'] = round( ($this->metrics['tweets'] - $this->metrics['last_tweets']) / $this->config['streaming_metrics_interval'], 2); - $this->metrics['bps'] = round( ($this->metrics['bytes'] - $this->metrics['last_bytes']) / $this->config['streaming_metrics_interval'], 2); - - $this->metrics['last_bytes'] = $this->metrics['bytes']; - $this->metrics['last_tweets'] = $this->metrics['tweets']; - $this->metrics['interval_start'] = $now; - return $this->metrics; - } - - /** - * Utility function to create the request URL in the requested format - * - * @param string $request the API method without extension - * @param string $format the format of the response. Default json. Set to an empty string to exclude the format - * @return string the concatenation of the host, API version, API method and format - */ - public function url($request, $format='json') { - $format = strlen($format) > 0 ? ".$format" : ''; - $proto = $this->config['use_ssl'] ? 'https:/' : 'http:/'; - - // backwards compatibility with v0.1 - if (isset($this->config['v'])) - $this->config['host'] = $this->config['host'] . '/' . $this->config['v']; - - $request = ltrim($request, '/'); - - $pos = strlen($request) - strlen($format); - if (substr($request, $pos) === $format) - $request = substr_replace($request, '', $pos); - - return implode('/', array( - $proto, - $this->config['host'], - $request . $format - )); - } - - /** - * Public access to the private safe decode/encode methods - * - * @param string $text the text to transform - * @param string $mode the transformation mode. either encode or decode - * @return string $text transformed by the given $mode - */ - public function transformText($text, $mode='encode') { - return $this->{"safe_$mode"}($text); - } - - /** - * Utility function to parse the returned curl headers and store them in the - * class array variable. - * - * @param object $ch curl handle - * @param string $header the response headers - * @return string the length of the header - */ - private function curlHeader($ch, $header) { - $this->response['raw'] .= $header; - - list($key, $value) = array_pad(explode(':', $header, 2), 2, null); - - $key = trim($key); - $value = trim($value); - - if ( ! isset($this->response['headers'][$key])) { - $this->response['headers'][$key] = $value; - } else { - if (!is_array($this->response['headers'][$key])) { - $this->response['headers'][$key] = array($this->response['headers'][$key]); - } - $this->response['headers'][$key][] = $value; - } - - return strlen($header); - } - - /** - * Utility function to parse the returned curl buffer and store them until - * an EOL is found. The buffer for curl is an undefined size so we need - * to collect the content until an EOL is found. - * - * This function calls the previously defined streaming callback method. - * - * @param object $ch curl handle - * @param string $data the current curl buffer - * @return int the length of the data string processed in this function - */ - private function curlWrite($ch, $data) { - $l = strlen($data); - if (strpos($data, $this->config['streaming_eol']) === false) { - $this->buffer .= $data; - return $l; - } - - $buffered = explode($this->config['streaming_eol'], $data); - $content = $this->buffer . $buffered[0]; - - $this->metrics['tweets']++; - $this->metrics['bytes'] += strlen($content); - - if ( ! is_callable($this->config['streaming_callback'])) - return 0; - - $metrics = $this->update_metrics(); - $stop = call_user_func( - $this->config['streaming_callback'], - $content, - strlen($content), - $metrics - ); - $this->buffer = $buffered[1]; - if ($stop) - return 0; - - return $l; - } - - /** - * Makes a curl request. Takes no parameters as all should have been prepared - * by the request method - * - * the response data is stored in the class variable 'response' - * - * @return int the http response code for the request. 0 is returned if a connection could not be made - */ - private function curlit() { - $this->response['raw'] = ''; - - // method handling - switch ($this->method) { - case 'POST': - break; - default: - // GET, DELETE request so convert the parameters to a querystring - if ( ! empty($this->request_params)) { - foreach ($this->request_params as $k => $v) { - // Multipart params haven't been encoded yet. - // Not sure why you would do a multipart GET but anyway, here's the support for it - if ($this->config['multipart']) { - $params[] = $this->safe_encode($k) . '=' . $this->safe_encode($v); - } else { - $params[] = $k . '=' . $v; - } - } - $qs = implode('&', $params); - $this->url = strlen($qs) > 0 ? $this->url . '?' . $qs : $this->url; - $this->request_params = array(); - } - break; - } - - // configure curl - $c = curl_init(); - curl_setopt_array($c, array( - CURLOPT_USERAGENT => $this->config['user_agent'], - CURLOPT_CONNECTTIMEOUT => $this->config['curl_connecttimeout'], - CURLOPT_TIMEOUT => $this->config['curl_timeout'], - CURLOPT_RETURNTRANSFER => true, - CURLOPT_SSL_VERIFYPEER => $this->config['curl_ssl_verifypeer'], - CURLOPT_SSL_VERIFYHOST => $this->config['curl_ssl_verifyhost'], - - CURLOPT_FOLLOWLOCATION => $this->config['curl_followlocation'], - CURLOPT_PROXY => $this->config['curl_proxy'], - CURLOPT_ENCODING => $this->config['curl_encoding'], - CURLOPT_URL => $this->url, - // process the headers - CURLOPT_HEADERFUNCTION => array($this, 'curlHeader'), - CURLOPT_HEADER => false, - CURLINFO_HEADER_OUT => true, - )); - - if ($this->config['curl_cainfo'] !== false) - curl_setopt($c, CURLOPT_CAINFO, $this->config['curl_cainfo']); - - if ($this->config['curl_capath'] !== false) - curl_setopt($c, CURLOPT_CAPATH, $this->config['curl_capath']); - - if ($this->config['curl_proxyuserpwd'] !== false) - curl_setopt($c, CURLOPT_PROXYUSERPWD, $this->config['curl_proxyuserpwd']); - - if ($this->config['is_streaming']) { - // process the body - $this->response['content-length'] = 0; - curl_setopt($c, CURLOPT_TIMEOUT, 0); - curl_setopt($c, CURLOPT_WRITEFUNCTION, array($this, 'curlWrite')); - } - - switch ($this->method) { - case 'GET': - break; - case 'POST': - curl_setopt($c, CURLOPT_POST, true); - curl_setopt($c, CURLOPT_POSTFIELDS, $this->request_params); - break; - default: - curl_setopt($c, CURLOPT_CUSTOMREQUEST, $this->method); - } - - if ( ! empty($this->request_params) ) { - // if not doing multipart we need to implode the parameters - if ( ! $this->config['multipart'] ) { - foreach ($this->request_params as $k => $v) { - $ps[] = "{$k}={$v}"; - } - $this->request_params = implode('&', $ps); - } - curl_setopt($c, CURLOPT_POSTFIELDS, $this->request_params); - } - - if ( ! empty($this->headers)) { - foreach ($this->headers as $k => $v) { - $headers[] = trim($k . ': ' . $v); - } - curl_setopt($c, CURLOPT_HTTPHEADER, $headers); - } - - if (isset($this->config['prevent_request']) && (true == $this->config['prevent_request'])) - return 0; - - // do it! - $response = curl_exec($c); - $code = curl_getinfo($c, CURLINFO_HTTP_CODE); - $info = curl_getinfo($c); - $error = curl_error($c); - $errno = curl_errno($c); - curl_close($c); - - // store the response - $this->response['code'] = $code; - $this->response['response'] = $response; - $this->response['info'] = $info; - $this->response['error'] = $error; - $this->response['errno'] = $errno; - - if (!isset($this->response['raw'])) { - $this->response['raw'] = ''; - } - $this->response['raw'] .= $response; - - return $code; - } -} \ No newline at end of file diff --git a/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhUtilities.php b/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhUtilities.php deleted file mode 100644 index 22277df35f..0000000000 --- a/rainloop/v/0.0.0/app/libraries/tmhOAuth/tmhUtilities.php +++ /dev/null @@ -1,280 +0,0 @@ - 'UTF-8', - 'target' => '', - ); - - $opts = array_merge($default_opts, $options); - - $encoding = mb_internal_encoding(); - mb_internal_encoding($opts['encoding']); - - $keys = array(); - $is_retweet = false; - - if (isset($tweet['retweeted_status'])) { - $tweet = $tweet['retweeted_status']; - $is_retweet = true; - } - - if (!isset($tweet['entities'])) { - return $tweet['text']; - } - - $target = (!empty($opts['target'])) ? ' target="'.$opts['target'].'"' : ''; - - // prepare the entities - foreach ($tweet['entities'] as $type => $things) { - foreach ($things as $entity => $value) { - $tweet_link = "{$tweet['created_at']}"; - - switch ($type) { - case 'hashtags': - $href = "#{$value['text']}"; - break; - case 'user_mentions': - $href = "@{$value['screen_name']}"; - break; - case 'urls': - case 'media': - $url = empty($value['expanded_url']) ? $value['url'] : $value['expanded_url']; - $display = isset($value['display_url']) ? $value['display_url'] : str_replace('http://', '', $url); - // Not all pages are served in UTF-8 so you may need to do this ... - $display = urldecode(str_replace('%E2%80%A6', '…', urlencode($display))); - $href = "{$display}"; - break; - } - $keys[$value['indices']['0']] = mb_substr( - $tweet['text'], - $value['indices']['0'], - $value['indices']['1'] - $value['indices']['0'] - ); - $replacements[$value['indices']['0']] = $href; - } - } - - ksort($replacements); - $replacements = array_reverse($replacements, true); - $entified_tweet = $tweet['text']; - foreach ($replacements as $k => $v) { - $entified_tweet = mb_substr($entified_tweet, 0, $k).$v.mb_substr($entified_tweet, $k + strlen($keys[$k])); - } - $replacements = array( - 'replacements' => $replacements, - 'keys' => $keys - ); - - mb_internal_encoding($encoding); - return $entified_tweet; - } - - /** - * Returns the current URL. This is instead of PHP_SELF which is unsafe - * - * @param bool $dropqs whether to drop the querystring or not. Default true - * @return string the current URL - */ - public static function php_self($dropqs=true) { - $protocol = 'http'; - if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') { - $protocol = 'https'; - } elseif (isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] == '443')) { - $protocol = 'https'; - } - - $url = sprintf('%s://%s%s', - $protocol, - $_SERVER['SERVER_NAME'], - $_SERVER['REQUEST_URI'] - ); - - $parts = parse_url($url); - - $port = $_SERVER['SERVER_PORT']; - $scheme = $parts['scheme']; - $host = $parts['host']; - $path = @$parts['path']; - $qs = @$parts['query']; - - $port or $port = ($scheme == 'https') ? '443' : '80'; - - if (($scheme == 'https' && $port != '443') - || ($scheme == 'http' && $port != '80')) { - $host = "$host:$port"; - } - $url = "$scheme://$host$path"; - if ( ! $dropqs) - return "{$url}?{$qs}"; - else - return $url; - } - - public static function is_cli() { - return (PHP_SAPI == 'cli' && empty($_SERVER['REMOTE_ADDR'])); - } - - /** - * Debug function for printing the content of an object - * - * @param mixes $obj - */ - public static function pr($obj) { - - if (!self::is_cli()) - echo '
';
-    if ( is_object($obj) )
-      print_r($obj);
-    elseif ( is_array($obj) )
-      print_r($obj);
-    else
-      echo $obj;
-    if (!self::is_cli())
-      echo '
'; - } - - /** - * Make an HTTP request using this library. This method is different to 'request' - * because on a 401 error it will retry the request. - * - * When a 401 error is returned it is possible the timestamp of the client is - * too different to that of the API server. In this situation it is recommended - * the request is retried with the OAuth timestamp set to the same as the API - * server. This method will automatically try that technique. - * - * This method doesn't return anything. Instead the response should be - * inspected directly. - * - * @param string $method the HTTP method being used. e.g. POST, GET, HEAD etc - * @param string $url the request URL without query string parameters - * @param array $params the request parameters as an array of key=value pairs - * @param string $useauth whether to use authentication when making the request. Default true. - * @param string $multipart whether this request contains multipart data. Default false - */ - public static function auto_fix_time_request($tmhOAuth, $method, $url, $params=array(), $useauth=true, $multipart=false) { - $tmhOAuth->request($method, $url, $params, $useauth, $multipart); - - // if we're not doing auth the timestamp isn't important - if ( ! $useauth) - return; - - // some error that isn't a 401 - if ($tmhOAuth->response['code'] != 401) - return; - - // some error that is a 401 but isn't because the OAuth token and signature are incorrect - // TODO: this check is horrid but helps avoid requesting twice when the username and password are wrong - if (stripos($tmhOAuth->response['response'], 'password') !== false) - return; - - // force the timestamp to be the same as the Twitter servers, and re-request - $tmhOAuth->auto_fixed_time = true; - $tmhOAuth->config['force_timestamp'] = true; - $tmhOAuth->config['timestamp'] = strtotime($tmhOAuth->response['headers']['date']); - return $tmhOAuth->request($method, $url, $params, $useauth, $multipart); - } - - /** - * Asks the user for input and returns the line they enter - * - * @param string $prompt the text to display to the user - * @return the text entered by the user - */ - public static function read_input($prompt) { - echo $prompt; - $handle = fopen("php://stdin","r"); - $data = fgets($handle); - return trim($data); - } - - /** - * Get a password from the shell. - * - * This function works on *nix systems only and requires shell_exec and stty. - * - * @param boolean $stars Wether or not to output stars for given characters - * @return string - * @url http://www.dasprids.de/blog/2008/08/22/getting-a-password-hidden-from-stdin-with-php-cli - */ - public static function read_password($prompt, $stars=false) { - echo $prompt; - $style = shell_exec('stty -g'); - - if ($stars === false) { - shell_exec('stty -echo'); - $password = rtrim(fgets(STDIN), "\n"); - } else { - shell_exec('stty -icanon -echo min 1 time 0'); - $password = ''; - while (true) : - $char = fgetc(STDIN); - if ($char === "\n") : - break; - elseif (ord($char) === 127) : - if (strlen($password) > 0) { - fwrite(STDOUT, "\x08 \x08"); - $password = substr($password, 0, -1); - } - else - fwrite(STDOUT, "*"); - $password .= $char; - endif; - endwhile; - } - - // Reset - shell_exec('stty ' . $style); - echo PHP_EOL; - return $password; - } - - /** - * Check if one string ends with another - * - * @param string $haystack the string to check inside of - * @param string $needle the string to check $haystack ends with - * @return true if $haystack ends with $needle, false otherwise - */ - public static function endswith($haystack, $needle) { - $haylen = strlen($haystack); - $needlelen = strlen($needle); - if ($needlelen > $haylen) - return false; - - return substr_compare($haystack, $needle, -$needlelen) === 0; - } -} \ No newline at end of file