hello
Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : chryzalihi ( 621211) PHP Version : 8.3.31 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/chryzalihi/www/wp-content/languages/themes/the/ |
UploadPart.php 0000604 00000003204 15244702061 0007324 0 ustar 00 <?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
namespace Aws\S3\Model\MultipartUpload;
use Aws\Common\Model\MultipartUpload\AbstractUploadPart;
/**
* An object that encapsulates the data for a Glacier upload operation
*/
class UploadPart extends AbstractUploadPart
{
/**
* {@inheritdoc}
*/
protected static $keyMap = array(
'PartNumber' => 'partNumber',
'ETag' => 'eTag',
'LastModified' => 'lastModified',
'Size' => 'size'
);
/**
* @var string The ETag for this part
*/
protected $eTag;
/**
* @var string The last modified date
*/
protected $lastModified;
/**
* @var int The size (or content-length) in bytes of the upload body
*/
protected $size;
/**
* @return string
*/
public function getETag()
{
return $this->eTag;
}
/**
* @return string
*/
public function getLastModified()
{
return $this->lastModified;
}
/**
* @return int
*/
public function getSize()
{
return $this->size;
}
}
TransferState.php 0000604 00000002371 15244702061 0010042 0 ustar 00 <?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
namespace Aws\S3\Model\MultipartUpload;
use Aws\Common\Client\AwsClientInterface;
use Aws\Common\Model\MultipartUpload\AbstractTransferState;
use Aws\Common\Model\MultipartUpload\UploadIdInterface;
/**
* State of a multipart upload
*/
class TransferState extends AbstractTransferState
{
/**
* {@inheritdoc}
*/
public static function fromUploadId(AwsClientInterface $client, UploadIdInterface $uploadId)
{
$transferState = new self($uploadId);
foreach ($client->getIterator('ListParts', $uploadId->toParams()) as $part) {
$transferState->addPart(UploadPart::fromArray($part));
}
return $transferState;
}
}
ParallelTransfer.php 0000604 00000011027 15244702061 0010514 0 ustar 00 <?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
namespace Aws\S3\Model\MultipartUpload;
use Aws\Common\Exception\RuntimeException;
use Aws\Common\Enum\DateFormat;
use Aws\Common\Enum\UaString as Ua;
use Guzzle\Http\EntityBody;
use Guzzle\Http\ReadLimitEntityBody;
/**
* Transfers multipart upload parts in parallel
*/
class ParallelTransfer extends AbstractTransfer
{
/**
* {@inheritdoc}
*/
protected function init()
{
parent::init();
if (!$this->source->isLocal() || $this->source->getWrapper() != 'plainfile') {
throw new RuntimeException('The source data must be a local file stream when uploading in parallel.');
}
if (empty($this->options['concurrency'])) {
throw new RuntimeException('The `concurrency` option must be specified when instantiating.');
}
}
/**
* {@inheritdoc}
*/
protected function transfer()
{
$totalParts = (int) ceil($this->source->getContentLength() / $this->partSize);
$concurrency = min($totalParts, $this->options['concurrency']);
$partsToSend = $this->prepareParts($concurrency);
$eventData = $this->getEventData();
while (!$this->stopped && count($this->state) < $totalParts) {
$currentTotal = count($this->state);
$commands = array();
for ($i = 0; $i < $concurrency && $i + $currentTotal < $totalParts; $i++) {
// Move the offset to the correct position
$partsToSend[$i]->setOffset(($currentTotal + $i) * $this->partSize);
// @codeCoverageIgnoreStart
if ($partsToSend[$i]->getContentLength() == 0) {
break;
}
// @codeCoverageIgnoreEnd
$params = $this->state->getUploadId()->toParams();
$eventData['command'] = $this->client->getCommand('UploadPart', array_replace($params, array(
'PartNumber' => count($this->state) + 1 + $i,
'Body' => $partsToSend[$i],
'ContentMD5' => (bool) $this->options['part_md5'],
Ua::OPTION => Ua::MULTIPART_UPLOAD
)));
$commands[] = $eventData['command'];
// Notify any listeners of the part upload
$this->dispatch(self::BEFORE_PART_UPLOAD, $eventData);
}
// Allow listeners to stop the transfer if needed
if ($this->stopped) {
break;
}
// Execute each command, iterate over the results, and add to the transfer state
/** @var \Guzzle\Service\Command\OperationCommand $command */
foreach ($this->client->execute($commands) as $command) {
$this->state->addPart(UploadPart::fromArray(array(
'PartNumber' => $command['PartNumber'],
'ETag' => $command->getResponse()->getEtag(),
'Size' => (int) $command->getRequest()->getBody()->getContentLength(),
'LastModified' => gmdate(DateFormat::RFC2822)
)));
$eventData['command'] = $command;
// Notify any listeners the the part was uploaded
$this->dispatch(self::AFTER_PART_UPLOAD, $eventData);
}
}
}
/**
* Prepare the entity body handles to use while transferring
*
* @param int $concurrency Number of parts to prepare
*
* @return array Parts to send
*/
protected function prepareParts($concurrency)
{
$url = $this->source->getUri();
// Use the source EntityBody as the first part
$parts = array(new ReadLimitEntityBody($this->source, $this->partSize));
// Open EntityBody handles for each part to upload in parallel
for ($i = 1; $i < $concurrency; $i++) {
$parts[] = new ReadLimitEntityBody(new EntityBody(fopen($url, 'r')), $this->partSize);
}
return $parts;
}
}
SerialTransfer.php 0000604 00000006164 15244702061 0010205 0 ustar 00 <?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
namespace Aws\S3\Model\MultipartUpload;
use Aws\Common\Enum\DateFormat;
use Aws\Common\Enum\Size;
use Aws\Common\Enum\UaString as Ua;
use Guzzle\Http\EntityBody;
use Guzzle\Http\ReadLimitEntityBody;
/**
* Transfers multipart upload parts serially
*/
class SerialTransfer extends AbstractTransfer
{
/**
* {@inheritdoc}
*/
protected function transfer()
{
while (!$this->stopped && !$this->source->isConsumed()) {
if ($this->source->getContentLength() && $this->source->isSeekable()) {
// If the stream is seekable and the Content-Length known, then stream from the data source
$body = new ReadLimitEntityBody($this->source, $this->partSize, $this->source->ftell());
} else {
// We need to read the data source into a temporary buffer before streaming
$body = EntityBody::factory();
while ($body->getContentLength() < $this->partSize
&& $body->write(
$this->source->read(max(1, min(10 * Size::KB, $this->partSize - $body->getContentLength())))
));
}
// @codeCoverageIgnoreStart
if ($body->getContentLength() == 0) {
break;
}
// @codeCoverageIgnoreEnd
$params = $this->state->getUploadId()->toParams();
$command = $this->client->getCommand('UploadPart', array_replace($params, array(
'PartNumber' => count($this->state) + 1,
'Body' => $body,
'ContentMD5' => (bool) $this->options['part_md5'],
Ua::OPTION => Ua::MULTIPART_UPLOAD
)));
// Notify observers that the part is about to be uploaded
$eventData = $this->getEventData();
$eventData['command'] = $command;
$this->dispatch(self::BEFORE_PART_UPLOAD, $eventData);
// Allow listeners to stop the transfer if needed
if ($this->stopped) {
break;
}
$response = $command->getResponse();
$this->state->addPart(UploadPart::fromArray(array(
'PartNumber' => $command['PartNumber'],
'ETag' => $response->getEtag(),
'Size' => $body->getContentLength(),
'LastModified' => gmdate(DateFormat::RFC2822)
)));
// Notify observers that the part was uploaded
$this->dispatch(self::AFTER_PART_UPLOAD, $eventData);
}
}
}
AbstractTransfer.php 0000604 00000015475 15244702061 0010536 0 ustar 00 <?php
/**
* Copyright 2010-2013 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.
*/
namespace Aws\Common\Model\MultipartUpload;
use Aws\Common\Client\AwsClientInterface;
use Aws\Common\Exception\MultipartUploadException;
use Aws\Common\Exception\RuntimeException;
use Guzzle\Common\AbstractHasDispatcher;
use Guzzle\Http\EntityBody;
use Guzzle\Http\EntityBodyInterface;
use Guzzle\Service\Command\OperationCommand;
use Guzzle\Service\Resource\Model;
/**
* Abstract class for transfer commonalities
*/
abstract class AbstractTransfer extends AbstractHasDispatcher implements TransferInterface
{
const BEFORE_UPLOAD = 'multipart_upload.before_upload';
const AFTER_UPLOAD = 'multipart_upload.after_upload';
const BEFORE_PART_UPLOAD = 'multipart_upload.before_part_upload';
const AFTER_PART_UPLOAD = 'multipart_upload.after_part_upload';
const AFTER_ABORT = 'multipart_upload.after_abort';
const AFTER_COMPLETE = 'multipart_upload.after_complete';
/**
* @var AwsClientInterface Client used for the transfers
*/
protected $client;
/**
* @var TransferStateInterface State of the transfer
*/
protected $state;
/**
* @var EntityBody Data source of the transfer
*/
protected $source;
/**
* @var array Associative array of options
*/
protected $options;
/**
* @var int Size of each part to upload
*/
protected $partSize;
/**
* @var bool Whether or not the transfer has been stopped
*/
protected $stopped = false;
/**
* Construct a new transfer object
*
* @param AwsClientInterface $client Client used for the transfers
* @param TransferStateInterface $state State used to track transfer
* @param EntityBody $source Data source of the transfer
* @param array $options Array of options to apply
*/
public function __construct(
AwsClientInterface $client,
TransferStateInterface $state,
EntityBody $source,
array $options = array()
) {
$this->client = $client;
$this->state = $state;
$this->source = $source;
$this->options = $options;
$this->init();
$this->partSize = $this->calculatePartSize();
}
public function __invoke()
{
return $this->upload();
}
/**
* {@inheritdoc}
*/
public static function getAllEvents()
{
return array(
self::BEFORE_PART_UPLOAD,
self::AFTER_UPLOAD,
self::BEFORE_PART_UPLOAD,
self::AFTER_PART_UPLOAD,
self::AFTER_ABORT,
self::AFTER_COMPLETE
);
}
/**
* {@inheritdoc}
*/
public function abort()
{
$command = $this->getAbortCommand();
$result = $command->getResult();
$this->state->setAborted(true);
$this->stop();
$this->dispatch(self::AFTER_ABORT, $this->getEventData($command));
return $result;
}
/**
* {@inheritdoc}
*/
public function stop()
{
$this->stopped = true;
return $this->state;
}
/**
* {@inheritdoc}
*/
public function getState()
{
return $this->state;
}
/**
* Get the array of options associated with the transfer
*
* @return array
*/
public function getOptions()
{
return $this->options;
}
/**
* Set an option on the transfer
*
* @param string $option Name of the option
* @param mixed $value Value to set
*
* @return self
*/
public function setOption($option, $value)
{
$this->options[$option] = $value;
return $this;
}
/**
* Get the source body of the upload
*
* @return EntityBodyInterface
*/
public function getSource()
{
return $this->source;
}
/**
* {@inheritdoc}
* @throws MultipartUploadException when an error is encountered. Use getLastException() to get more information.
* @throws RuntimeException when attempting to upload an aborted transfer
*/
public function upload()
{
if ($this->state->isAborted()) {
throw new RuntimeException('The transfer has been aborted and cannot be uploaded');
}
$this->stopped = false;
$eventData = $this->getEventData();
$this->dispatch(self::BEFORE_UPLOAD, $eventData);
try {
$this->transfer();
$this->dispatch(self::AFTER_UPLOAD, $eventData);
if ($this->stopped) {
return null;
} else {
$result = $this->complete();
$this->dispatch(self::AFTER_COMPLETE, $eventData);
}
} catch (\Exception $e) {
throw new MultipartUploadException($this->state, $e);
}
return $result;
}
/**
* Get an array used for event notifications
*
* @param OperationCommand $command Command to include in event data
*
* @return array
*/
protected function getEventData(OperationCommand $command = null)
{
$data = array(
'transfer' => $this,
'source' => $this->source,
'options' => $this->options,
'client' => $this->client,
'part_size' => $this->partSize,
'state' => $this->state
);
if ($command) {
$data['command'] = $command;
}
return $data;
}
/**
* Hook to initialize the transfer
*/
protected function init() {}
/**
* Determine the upload part size based on the size of the source data and
* taking into account the acceptable minimum and maximum part sizes.
*
* @return int The part size
*/
abstract protected function calculatePartSize();
/**
* Complete the multipart upload
*
* @return Model Returns the result of the complete multipart upload command
*/
abstract protected function complete();
/**
* Hook to implement in subclasses to perform the actual transfer
*/
abstract protected function transfer();
/**
* Fetches the abort command fom the concrete implementation
*
* @return OperationCommand
*/
abstract protected function getAbortCommand();
}
.htaccess 0000444 00000000424 15244702061 0006341 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>