OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
reader
/
aws-ses
/
vendor
/
aws
/
aws-sdk-php
/
src
/
DynamoDb
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
08/14/2024 10:55:35 AM
rwxr-xr-x
📄
BinaryValue.php
780 bytes
08/14/2024 10:52:00 AM
rw-r--r--
📄
DynamoDbClient.php
13.78 KB
08/14/2024 10:52:00 AM
rw-r--r--
📁
Exception
-
08/14/2024 10:55:09 AM
rwxr-xr-x
📄
LockingSessionConnection.php
1.94 KB
08/14/2024 10:52:00 AM
rw-r--r--
📄
Marshaler.php
9.83 KB
08/14/2024 10:52:00 AM
rw-r--r--
📄
NumberValue.php
582 bytes
08/14/2024 10:52:00 AM
rw-r--r--
📄
SessionConnectionConfigTrait.php
6.11 KB
08/14/2024 10:52:00 AM
rw-r--r--
📄
SessionConnectionInterface.php
1.04 KB
08/14/2024 10:52:00 AM
rw-r--r--
📄
SessionHandler.php
8.08 KB
08/14/2024 10:52:00 AM
rw-r--r--
📄
SetValue.php
1010 bytes
08/14/2024 10:52:00 AM
rw-r--r--
📄
StandardSessionConnection.php
4.61 KB
08/14/2024 10:52:01 AM
rw-r--r--
📄
WriteRequestBatch.php
9.6 KB
08/14/2024 10:52:01 AM
rw-r--r--
Editing: LockingSessionConnection.php
Close
<?php namespace Aws\DynamoDb; use Aws\DynamoDb\Exception\DynamoDbException; /** * The locking connection adds locking logic to the read operation. */ class LockingSessionConnection extends StandardSessionConnection { public function __construct(DynamoDbClient $client, array $config = []) { parent::__construct($client, $config); } /** * {@inheritdoc} * Retries the request until the lock can be acquired */ public function read($id) { // Create the params for the UpdateItem operation so that a lock can be // set and item returned (via ReturnValues) in a one, atomic operation. $params = [ 'TableName' => $this->getTableName(), 'Key' => $this->formatKey($id), 'Expected' => ['lock' => ['Exists' => false]], 'AttributeUpdates' => ['lock' => ['Value' => ['N' => '1']]], 'ReturnValues' => 'ALL_NEW', ]; // Acquire the lock and fetch the item data. $timeout = time() + $this->getMaxLockWaitTime(); while (true) { try { $item = []; $result = $this->client->updateItem($params); if (isset($result['Attributes'])) { foreach ($result['Attributes'] as $key => $value) { $item[$key] = current($value); } } return $item; } catch (DynamoDbException $e) { if ($e->getAwsErrorCode() === 'ConditionalCheckFailedException' && time() < $timeout ) { usleep(rand( $this->getMinLockRetryMicrotime(), $this->getMaxLockRetryMicrotime() )); } else { break; } } } } }