oss 直传

分片上传
This commit is contained in:
2026-05-08 10:49:16 +08:00
parent 4dc9ec1878
commit 7d7a4aa4d2
26 changed files with 1644 additions and 72 deletions
+23 -4
View File
@@ -32,6 +32,11 @@ class InstalledVersions
*/
private static $installed;
/**
* @var bool
*/
private static $installedIsLocalDir;
/**
* @var bool|null
*/
@@ -309,6 +314,12 @@ class InstalledVersions
{
self::$installed = $data;
self::$installedByVendor = array();
// when using reload, we disable the duplicate protection to ensure that self::$installed data is
// always returned, but we cannot know whether it comes from the installed.php in __DIR__ or not,
// so we have to assume it does not, and that may result in duplicate data being returned when listing
// all installed packages for example
self::$installedIsLocalDir = false;
}
/**
@@ -322,19 +333,27 @@ class InstalledVersions
}
$installed = array();
$copiedLocalDir = false;
if (self::$canGetVendors) {
$selfDir = strtr(__DIR__, '\\', '/');
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
$vendorDir = strtr($vendorDir, '\\', '/');
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
$required = require $vendorDir.'/composer/installed.php';
$installed[] = self::$installedByVendor[$vendorDir] = $required;
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
self::$installed = $installed[count($installed) - 1];
self::$installedByVendor[$vendorDir] = $required;
$installed[] = $required;
if (self::$installed === null && $vendorDir.'/composer' === $selfDir) {
self::$installed = $required;
self::$installedIsLocalDir = true;
}
}
if (self::$installedIsLocalDir && $vendorDir.'/composer' === $selfDir) {
$copiedLocalDir = true;
}
}
}
@@ -350,7 +369,7 @@ class InstalledVersions
}
}
if (self::$installed !== array()) {
if (self::$installed !== array() && !$copiedLocalDir) {
$installed[] = self::$installed;
}
+3 -2
View File
@@ -9,14 +9,14 @@ return array(
'think\\view\\driver\\' => array($vendorDir . '/topthink/think-view/src'),
'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'),
'think\\app\\' => array($vendorDir . '/topthink/think-multi-app/src'),
'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src'),
'think\\' => array($vendorDir . '/topthink/think-template/src', $vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-helper/src'),
'clagiordano\\weblibs\\configmanager\\' => array($vendorDir . '/clagiordano/weblibs-configmanager/src'),
'app\\' => array($baseDir . '/app'),
'ZipStream\\' => array($vendorDir . '/maennchen/zipstream-php/src'),
'WpOrg\\Requests\\' => array($vendorDir . '/rmccue/requests/src'),
'Webmozart\\Assert\\' => array($vendorDir . '/webmozart/assert/src'),
'TheNorthMemory\\Xml\\' => array($vendorDir . '/thenorthmemory/xml/src'),
'TencentCloud\\' => array($vendorDir . '/tencentcloud/common/src/TencentCloud', $vendorDir . '/tencentcloud/sms/src/TencentCloud', $vendorDir . '/tencentcloud/trtc/src/TencentCloud'),
'TencentCloud\\' => array($vendorDir . '/tencentcloud/trtc/src/TencentCloud', $vendorDir . '/tencentcloud/sms/src/TencentCloud', $vendorDir . '/tencentcloud/common/src/TencentCloud'),
'Symfony\\Polyfill\\Php81\\' => array($vendorDir . '/symfony/polyfill-php81'),
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
@@ -37,6 +37,7 @@ return array(
'Symfony\\Bridge\\PsrHttpMessage\\' => array($vendorDir . '/symfony/psr-http-message-bridge'),
'Qiniu\\' => array($vendorDir . '/qiniu/php-sdk/src/Qiniu'),
'Qcloud\\Cos\\' => array($vendorDir . '/qcloud/cos-sdk-v5/src'),
'QCloud\\COSSTS\\' => array($vendorDir . '/qcloud_sts/qcloud-sts-sdk/src'),
'Psr\\SimpleCache\\' => array($vendorDir . '/psr/simple-cache/src'),
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-factory/src', $vendorDir . '/psr/http-message/src'),
+10 -5
View File
@@ -87,6 +87,7 @@ class ComposerStaticInitd2a74ba94e266cc4f45a64c54a292d7e
array (
'Qiniu\\' => 6,
'Qcloud\\Cos\\' => 11,
'QCloud\\COSSTS\\' => 14,
),
'P' =>
array (
@@ -162,10 +163,10 @@ class ComposerStaticInitd2a74ba94e266cc4f45a64c54a292d7e
),
'think\\' =>
array (
0 => __DIR__ . '/..' . '/topthink/framework/src/think',
1 => __DIR__ . '/..' . '/topthink/think-helper/src',
0 => __DIR__ . '/..' . '/topthink/think-template/src',
1 => __DIR__ . '/..' . '/topthink/framework/src/think',
2 => __DIR__ . '/..' . '/topthink/think-orm/src',
3 => __DIR__ . '/..' . '/topthink/think-template/src',
3 => __DIR__ . '/..' . '/topthink/think-helper/src',
),
'clagiordano\\weblibs\\configmanager\\' =>
array (
@@ -193,9 +194,9 @@ class ComposerStaticInitd2a74ba94e266cc4f45a64c54a292d7e
),
'TencentCloud\\' =>
array (
0 => __DIR__ . '/..' . '/tencentcloud/common/src/TencentCloud',
0 => __DIR__ . '/..' . '/tencentcloud/trtc/src/TencentCloud',
1 => __DIR__ . '/..' . '/tencentcloud/sms/src/TencentCloud',
2 => __DIR__ . '/..' . '/tencentcloud/trtc/src/TencentCloud',
2 => __DIR__ . '/..' . '/tencentcloud/common/src/TencentCloud',
),
'Symfony\\Polyfill\\Php81\\' =>
array (
@@ -277,6 +278,10 @@ class ComposerStaticInitd2a74ba94e266cc4f45a64c54a292d7e
array (
0 => __DIR__ . '/..' . '/qcloud/cos-sdk-v5/src',
),
'QCloud\\COSSTS\\' =>
array (
0 => __DIR__ . '/..' . '/qcloud_sts/qcloud-sts-sdk/src',
),
'Psr\\SimpleCache\\' =>
array (
0 => __DIR__ . '/..' . '/psr/simple-cache/src',
+55
View File
@@ -2637,6 +2637,61 @@
},
"install-path": "../qcloud/cos-sdk-v5"
},
{
"name": "qcloud_sts/qcloud-sts-sdk",
"version": "3.0.12",
"version_normalized": "3.0.12.0",
"source": {
"type": "git",
"url": "https://github.com/tencentyun/qcloud-cos-sts-php-sdk.git",
"reference": "16ebb03f1079ef71c272180fc015cc809ce8320b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/tencentyun/qcloud-cos-sts-php-sdk/zipball/16ebb03f1079ef71c272180fc015cc809ce8320b",
"reference": "16ebb03f1079ef71c272180fc015cc809ce8320b",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=5.3.0"
},
"time": "2023-12-20T06:42:36+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-4": {
"QCloud\\COSSTS\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "qcloudterminal",
"email": "qcloudterminal@gmail.com"
},
{
"name": "tuunalai",
"email": "550566181@qq.com"
}
],
"description": "PHP SDK for QCloud STS",
"homepage": "https://github.com/tencentyun/qcloud-cos-sts-sdk",
"keywords": [
"cos",
"php",
"qcloud",
"sts"
],
"support": {
"issues": "https://github.com/tencentyun/qcloud-cos-sts-php-sdk/issues",
"source": "https://github.com/tencentyun/qcloud-cos-sts-php-sdk/tree/3.0.12"
},
"install-path": "../qcloud_sts/qcloud-sts-sdk"
},
{
"name": "qiniu/php-sdk",
"version": "v7.4.0",
+15 -6
View File
@@ -1,9 +1,9 @@
<?php return array(
'root' => array(
'name' => 'topthink/think',
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => NULL,
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '4dc9ec1878f6cdd83cfdc9044b93828d46eda715',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -376,6 +376,15 @@
'aliases' => array(),
'dev_requirement' => false,
),
'qcloud_sts/qcloud-sts-sdk' => array(
'pretty_version' => '3.0.12',
'version' => '3.0.12.0',
'reference' => '16ebb03f1079ef71c272180fc015cc809ce8320b',
'type' => 'library',
'install_path' => __DIR__ . '/../qcloud_sts/qcloud-sts-sdk',
'aliases' => array(),
'dev_requirement' => false,
),
'qiniu/php-sdk' => array(
'pretty_version' => 'v7.4.0',
'version' => '7.4.0.0',
@@ -632,9 +641,9 @@
'dev_requirement' => false,
),
'topthink/think' => array(
'pretty_version' => '1.0.0+no-version-set',
'version' => '1.0.0.0',
'reference' => NULL,
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '4dc9ec1878f6cdd83cfdc9044b93828d46eda715',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
+3 -4
View File
@@ -4,10 +4,9 @@
$issues = array();
// Temporarily disabled for testing
// if (!(PHP_VERSION_ID >= 80100)) {
// $issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
// }
if (!(PHP_VERSION_ID >= 80100)) {
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
}
if ($issues) {
if (!headers_sent()) {