fjffk简单的咖啡店科开发2方法2 环滁皆山也。其西南诸峰,林壑尤美,望之蔚然而深秀者,琅琊也。山行六七里,渐闻水声潺潺,而泻出于两峰之间者,酿泉也 ??????????????????????????????? ??????????????/????????????????? ............/................... .........................../... ??????????????????????????????? >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>> ÿØÿà JFIF    ÿÛ „  ( %!1!%)+//.383,7(-.+  -%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ     ÿÄ J    ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ   ÿÄ *  !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú "SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5 ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍѶ¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e ríV ?> ......................................... ............................................................................. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>/>>>>>>>>>>>>>>>>>> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< >>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dsdfVisibilityConverter.php000064400000000432152665616500011307 0ustar00defaultForDirectories; } } LICENSE000064400000002047152665616500005570 0ustar00Copyright (c) 2013-2024 Frank de Jonge 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. AwsS3V3Adapter.php000064400000041734152665616500007754 0ustar00prefixer = new PathPrefixer($prefix); $this->visibility = $visibility ?? new PortableVisibilityConverter(); $this->mimeTypeDetector = $mimeTypeDetector ?? new FinfoMimeTypeDetector(); } public function fileExists(string $path): bool { try { return $this->client->doesObjectExistV2($this->bucket, $this->prefixer->prefixPath($path), false, $this->options); } catch (Throwable $exception) { throw UnableToCheckFileExistence::forLocation($path, $exception); } } public function directoryExists(string $path): bool { try { $prefix = $this->prefixer->prefixDirectoryPath($path); $options = ['Bucket' => $this->bucket, 'Prefix' => $prefix, 'MaxKeys' => 1, 'Delimiter' => '/']; $command = $this->client->getCommand('ListObjectsV2', $options); $result = $this->client->execute($command); return $result->hasKey('Contents') || $result->hasKey('CommonPrefixes'); } catch (Throwable $exception) { throw UnableToCheckDirectoryExistence::forLocation($path, $exception); } } public function write(string $path, string $contents, Config $config): void { $this->upload($path, $contents, $config); } /** * @param string $path * @param string|resource $body * @param Config $config */ private function upload(string $path, $body, Config $config): void { $key = $this->prefixer->prefixPath($path); $options = $this->createOptionsFromConfig($config); $acl = $options['params']['ACL'] ?? $this->determineAcl($config); $shouldDetermineMimetype = ! array_key_exists('ContentType', $options['params']); if ($shouldDetermineMimetype && $mimeType = $this->mimeTypeDetector->detectMimeType($key, $body)) { $options['params']['ContentType'] = $mimeType; } try { $this->client->upload($this->bucket, $key, $body, $acl, $options); } catch (Throwable $exception) { throw UnableToWriteFile::atLocation($path, $exception->getMessage(), $exception); } } private function determineAcl(Config $config): string { $visibility = (string) $config->get(Config::OPTION_VISIBILITY, Visibility::PRIVATE); return $this->visibility->visibilityToAcl($visibility); } private function createOptionsFromConfig(Config $config): array { $config = $config->withDefaults($this->options); $options = ['params' => []]; if ($mimetype = $config->get('mimetype')) { $options['params']['ContentType'] = $mimetype; } foreach ($this->forwardedOptions as $option) { $value = $config->get($option, '__NOT_SET__'); if ($value !== '__NOT_SET__') { $options['params'][$option] = $value; } } foreach ($this->multipartUploadOptions as $option) { $value = $config->get($option, '__NOT_SET__'); if ($value !== '__NOT_SET__') { $options[$option] = $value; } } return $options; } public function writeStream(string $path, $contents, Config $config): void { $this->upload($path, $contents, $config); } public function read(string $path): string { $body = $this->readObject($path, false); return (string) $body->getContents(); } public function readStream(string $path) { /** @var resource $resource */ $resource = $this->readObject($path, true)->detach(); return $resource; } public function delete(string $path): void { $arguments = ['Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path)]; $command = $this->client->getCommand('DeleteObject', $arguments); try { $this->client->execute($command); } catch (Throwable $exception) { throw UnableToDeleteFile::atLocation($path, '', $exception); } } public function deleteDirectory(string $path): void { $prefix = $this->prefixer->prefixPath($path); $prefix = ltrim(rtrim($prefix, '/') . '/', '/'); try { $this->client->deleteMatchingObjects($this->bucket, $prefix); } catch (Throwable $exception) { throw UnableToDeleteDirectory::atLocation($path, '', $exception); } } public function createDirectory(string $path, Config $config): void { $defaultVisibility = $config->get(Config::OPTION_DIRECTORY_VISIBILITY, $this->visibility->defaultForDirectories()); $config = $config->withDefaults([Config::OPTION_VISIBILITY => $defaultVisibility]); $this->upload(rtrim($path, '/') . '/', '', $config); } public function setVisibility(string $path, string $visibility): void { $arguments = [ 'Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path), 'ACL' => $this->visibility->visibilityToAcl($visibility), ]; $command = $this->client->getCommand('PutObjectAcl', $arguments); try { $this->client->execute($command); } catch (Throwable $exception) { throw UnableToSetVisibility::atLocation($path, '', $exception); } } public function visibility(string $path): FileAttributes { $arguments = ['Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path)]; $command = $this->client->getCommand('GetObjectAcl', $arguments); try { $result = $this->client->execute($command); } catch (Throwable $exception) { throw UnableToRetrieveMetadata::visibility($path, '', $exception); } $visibility = $this->visibility->aclToVisibility((array) $result->get('Grants')); return new FileAttributes($path, null, $visibility); } private function fetchFileMetadata(string $path, string $type): FileAttributes { $arguments = ['Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path)]; $command = $this->client->getCommand('HeadObject', $arguments); try { $result = $this->client->execute($command); } catch (Throwable $exception) { throw UnableToRetrieveMetadata::create($path, $type, '', $exception); } $attributes = $this->mapS3ObjectMetadata($result->toArray(), $path); if ( ! $attributes instanceof FileAttributes) { throw UnableToRetrieveMetadata::create($path, $type, ''); } return $attributes; } private function mapS3ObjectMetadata(array $metadata, string $path): StorageAttributes { if (substr($path, -1) === '/') { return new DirectoryAttributes(rtrim($path, '/')); } $mimetype = $metadata['ContentType'] ?? null; $fileSize = $metadata['ContentLength'] ?? $metadata['Size'] ?? null; $fileSize = $fileSize === null ? null : (int) $fileSize; $dateTime = $metadata['LastModified'] ?? null; $lastModified = $dateTime instanceof DateTimeResult ? $dateTime->getTimeStamp() : null; return new FileAttributes( $path, $fileSize, null, $lastModified, $mimetype, $this->extractExtraMetadata($metadata) ); } private function extractExtraMetadata(array $metadata): array { $extracted = []; foreach ($this->metadataFields as $field) { if (isset($metadata[$field]) && $metadata[$field] !== '') { $extracted[$field] = $metadata[$field]; } } return $extracted; } public function mimeType(string $path): FileAttributes { $attributes = $this->fetchFileMetadata($path, FileAttributes::ATTRIBUTE_MIME_TYPE); if ($attributes->mimeType() === null) { throw UnableToRetrieveMetadata::mimeType($path); } return $attributes; } public function lastModified(string $path): FileAttributes { $attributes = $this->fetchFileMetadata($path, FileAttributes::ATTRIBUTE_LAST_MODIFIED); if ($attributes->lastModified() === null) { throw UnableToRetrieveMetadata::lastModified($path); } return $attributes; } public function fileSize(string $path): FileAttributes { $attributes = $this->fetchFileMetadata($path, FileAttributes::ATTRIBUTE_FILE_SIZE); if ($attributes->fileSize() === null) { throw UnableToRetrieveMetadata::fileSize($path); } return $attributes; } public function listContents(string $path, bool $deep): iterable { $prefix = trim($this->prefixer->prefixPath($path), '/'); $prefix = empty($prefix) ? '' : $prefix . '/'; $options = ['Bucket' => $this->bucket, 'Prefix' => $prefix]; if ($deep === false) { $options['Delimiter'] = '/'; } $listing = $this->retrievePaginatedListing($options); foreach ($listing as $item) { $key = $item['Key'] ?? $item['Prefix']; if ($key === $prefix) { continue; } yield $this->mapS3ObjectMetadata($item, $this->prefixer->stripPrefix($key)); } } private function retrievePaginatedListing(array $options): Generator { $resultPaginator = $this->client->getPaginator('ListObjectsV2', $options + $this->options); foreach ($resultPaginator as $result) { yield from ($result->get('CommonPrefixes') ?? []); yield from ($result->get('Contents') ?? []); } } public function move(string $source, string $destination, Config $config): void { if ($source === $destination) { return; } try { $this->copy($source, $destination, $config); $this->delete($source); } catch (FilesystemOperationFailed $exception) { throw UnableToMoveFile::fromLocationTo($source, $destination, $exception); } } public function copy(string $source, string $destination, Config $config): void { if ($source === $destination) { return; } try { $visibility = $config->get(Config::OPTION_VISIBILITY); if ($visibility === null && $config->get(Config::OPTION_RETAIN_VISIBILITY, true)) { $visibility = $this->visibility($source)->visibility(); } } catch (Throwable $exception) { throw UnableToCopyFile::fromLocationTo( $source, $destination, $exception ); } $options = $this->createOptionsFromConfig($config); $options['MetadataDirective'] = $config->get('MetadataDirective', 'COPY'); try { $this->client->copy( $this->bucket, $this->prefixer->prefixPath($source), $this->bucket, $this->prefixer->prefixPath($destination), $this->visibility->visibilityToAcl($visibility ?: 'private'), $options, ); } catch (Throwable $exception) { throw UnableToCopyFile::fromLocationTo($source, $destination, $exception); } } private function readObject(string $path, bool $wantsStream): StreamInterface { $options = ['Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path)]; if ($wantsStream && $this->streamReads && ! isset($this->options['@http']['stream'])) { $options['@http']['stream'] = true; } $command = $this->client->getCommand('GetObject', $options + $this->options); try { return $this->client->execute($command)->get('Body'); } catch (Throwable $exception) { throw UnableToReadFile::fromLocation($path, '', $exception); } } public function publicUrl(string $path, Config $config): string { $location = $this->prefixer->prefixPath($path); try { return $this->client->getObjectUrl($this->bucket, $location); } catch (Throwable $exception) { throw UnableToGeneratePublicUrl::dueToError($path, $exception); } } public function checksum(string $path, Config $config): string { $algo = $config->get('checksum_algo', 'etag'); if ($algo !== 'etag') { throw new ChecksumAlgoIsNotSupported(); } try { $metadata = $this->fetchFileMetadata($path, 'checksum')->extraMetadata(); } catch (UnableToRetrieveMetadata $exception) { throw new UnableToProvideChecksum($exception->reason(), $path, $exception); } if ( ! isset($metadata['ETag'])) { throw new UnableToProvideChecksum('ETag header not available.', $path); } return trim($metadata['ETag'], '"'); } public function temporaryUrl(string $path, DateTimeInterface $expiresAt, Config $config): string { try { $options = $config->get('get_object_options', []); $command = $this->client->getCommand('GetObject', [ 'Bucket' => $this->bucket, 'Key' => $this->prefixer->prefixPath($path), ] + $options); $presignedRequestOptions = $config->get('presigned_request_options', []); $request = $this->client->createPresignedRequest($command, $expiresAt, $presignedRequestOptions); return (string) $request->getUri(); } catch (Throwable $exception) { throw UnableToGenerateTemporaryUrl::dueToError($path, $exception); } } } composer.json000064400000001346152665616500007306 0ustar00{ "name": "league/flysystem-aws-s3-v3", "description": "AWS S3 filesystem adapter for Flysystem.", "keywords": ["aws", "s3", "flysystem", "filesystem", "storage", "file", "files"], "type": "library", "autoload": { "psr-4": { "League\\Flysystem\\AwsS3V3\\": "" } }, "require": { "php": "^8.0.2", "league/flysystem": "^3.10.0", "league/mime-type-detection": "^1.0.0", "aws/aws-sdk-php": "^3.295.10" }, "conflict": { "guzzlehttp/ringphp": "<1.1.1", "guzzlehttp/guzzle": "<7.0" }, "license": "MIT", "authors": [ { "name": "Frank de Jonge", "email": "info@frankdejonge.nl" } ] }