Split DB Updates into seperate files, with the cutoff being 2.0.0

This commit is contained in:
johnnyq
2026-07-22 18:43:11 -04:00
parent 17e4c61067
commit 2b756f6ea4
252 changed files with 4161 additions and 4875 deletions

View File

@@ -134,6 +134,7 @@ class ApiRequestor
$headers = $headers ?: [];
list($rbody, $rcode, $rheaders, $myApiKey)
= $this->_requestRaw($method, $url, $params, $headers, $apiMode, $usage, $maxNetworkRetries);
$this->_maybeEmitStripeNotice($rheaders);
$json = $this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode);
$resp = new ApiResponse($rbody, $rcode, $rheaders, $json);
@@ -158,6 +159,7 @@ class ApiRequestor
$headers = $headers ?: [];
list($rbody, $rcode, $rheaders, $myApiKey)
= $this->_requestRawStreaming($method, $url, $params, $headers, $apiMode, $usage, $readBodyChunkCallable, $maxNetworkRetries);
$this->_maybeEmitStripeNotice($rheaders);
if ($rcode >= 300) {
$this->_interpretResponse($rbody, $rcode, $rheaders, $apiMode);
}
@@ -270,6 +272,16 @@ class ApiRequestor
return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code);
// switchCases: The beginning of the section generated from our OpenAPI spec
case 'rate_limit':
return Exception\RateLimitException::factory(
$msg,
$rcode,
$rbody,
$resp,
$rheaders,
$code
);
case 'temporary_session_expired':
return Exception\TemporarySessionExpiredException::factory(
$msg,
@@ -385,6 +397,7 @@ class ApiRequestor
['CODEX_CI', 'codex_cli'],
['CURSOR_AGENT', 'cursor'],
['GEMINI_CLI', 'gemini_cli'],
['OPENCLAW_SHELL', 'openclaw'],
['OPENCODE', 'open_code'],
// aiAgents: The end of the section generated from our OpenAPI spec
];
@@ -419,18 +432,26 @@ class ApiRequestor
$uaString = "Stripe/{$apiMode} PhpBindings/" . Stripe::VERSION;
$langVersion = \PHP_VERSION;
$uname_disabled = self::_isDisabled(\ini_get('disable_functions'), 'php_uname');
$uname = $uname_disabled ? '(disabled)' : \php_uname();
// Fallback to global configuration to maintain backwards compatibility.
$appInfo = $appInfo ?: Stripe::getAppInfo();
$ua = [
'bindings_version' => Stripe::VERSION,
'lang' => 'php',
'lang_version' => $langVersion,
'publisher' => 'stripe',
'uname' => $uname,
];
if (Stripe::getEnableTelemetry()) {
$telemetryId = TelemetryId::get();
if (null !== $telemetryId) {
$ua['telemetry_id'] = $telemetryId;
}
$uname_disabled = self::_isDisabled(\ini_get('disable_functions'), 'php_uname');
$ua['platform'] = $uname_disabled
? '(disabled)'
// only get general platform information, e.g. `Darwin 25.3.0 arm64`
: \php_uname('s') . ' ' . \php_uname('r') . ' ' . \php_uname('m');
}
if ($clientInfo) {
$ua = \array_merge($clientInfo, $ua);
}
@@ -543,6 +564,13 @@ class ApiRequestor
return [$absUrl, $rawHeaders, $params, $hasFile, $myApiKey];
}
private function _maybeEmitStripeNotice($rheaders)
{
if (isset($rheaders['stripe-notice']) && \is_string($rheaders['stripe-notice'])) {
\trigger_error($rheaders['stripe-notice'], \E_USER_WARNING);
}
}
/**
* @param 'delete'|'get'|'post' $method
* @param string $url