Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Common Laravel Package

tencentcloud/common

tencentcloud/common provides shared foundation code for Tencent Cloud PHP SDK packages, including request signing, HTTP transport, credential handling, and common exceptions. Add it when integrating Tencent Cloud APIs or building service-specific clients in PHP.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

What this package actually is. tencentcloud/common is not an application-facing package — it is the shared runtime core for the Tencent Cloud PHP SDK family. It ships the base AbstractClient, the Credential object (SecretId/SecretKey/token), ClientProfile/HttpProfile transport configuration, the TC3-HMAC-SHA256 (and legacy HmacSHA1/MD5) request signers, and TencentCloudSDKException. Every product SDK (tencentcloud/cvm, tencentcloud/ocr, tencentcloud/sms, etc.) depends on it. A Laravel team never "uses" it directly; they use it indirectly through a product SDK, and the TPM decision is really about whether to standardize on the Tencent SDK family at all and how much wrapper to build.

Architecture fit. Poor fit as a framework citizen, acceptable as a transport library. There is no ServiceProvider, no facade, no publishable config, no config-repository awareness. Configuration is imperative: you construct Credential and HttpProfile objects per client instance. In a Laravel app this means every consumer either hand-rolls client construction or you build a container-bound factory and a config/tencentcloud.php. That wrapper is unavoidable and is the bulk of the integration work. Credentials are plain strings with no built-in chain (no env-var, instance-profile, or metadata-service provider), and no automatic STS token refresh — rotation logic is yours.

Integration feasibility. Straightforward and low-magic. composer require tencentcloud/common plus the specific product package, wire a singleton factory, done. Watch the dependency footprint: recent 3.x releases pull in Guzzle (older 2.x used raw cURL), so you inherit Guzzle's PSR-7/PSR-18 surface and its version constraints — pin and verify against your locked Laravel/Symfony versions. Apache-2.0 is commercially clean and includes a patent grant.

Technical risk.

  • Signal quality is misleading in both directions. 1 star and "0 dependents" understate reality: the dependents are the product SDKs, which Composer resolves transitively, so the registry metric doesn't capture them. Conversely, low stars mean you are effectively the only QA on your integration path — no community recipes for Laravel.
  • Major-version churn. The 2.x → 3.x jump changed the HTTP layer. Treat common as a pinned transitive dependency and test upgrades deliberately; a product SDK bump can drag common across a major.
  • Testability. There is no clean seam for injecting a mock HTTP handler through HttpProfile, so unit-testing against the SDK is painful. Mock at your own service boundary, not at the SDK.
  • Credential handling is the real security risk, not the code: signed requests, secrets in .env, manual rotation, no refresh.

Key questions for the vendor/team. Which product SDKs and regions are in scope? Do we need STS temporary credentials (and therefore a refresh loop)? What per-API QPS quotas apply to our account tier? Is common pinned independently of product SDKs in our lockfile? Do we have a Chinese-reading engineer for the docs?

Integration Approach

Stack fit. Treat it as infrastructure, not as a package to "adopt." The clean Laravel shape is: config/tencentcloud.php (secret id/key/region/endpoint, sourced from env or a secrets manager), a TencentCloudServiceProvider binding a ClientFactory singleton, and one thin domain service per product (SmsSender, OcrClient) that owns its SDK client. Controllers and jobs depend on your interface, never on TencentCloud\Common\*. This keeps the SDK swappable and testable.

Migration path. No migration — greenfield dependency. The only "migration" is from ad-hoc new Credential(...) calls scattered across the codebase into the factory; enforce that from day one so you never have to consolidate later.

Compatibility. Verify PHP 8.2/8.3 support in the exact locked version (older lines target PHP 5.6/7.x), confirm Guzzle 7 alignment with Laravel's HTTP client usage, and check for global-state hazards — ClientProfile/HttpProfile instances are mutable and should be treated as per-client, not shared singletons, to avoid timeout bleed between services. Ensure ext-curl and ext-json are in your base image.

Sequencing.

  1. Spike: one read-only API (e.g. region list or an OCR call) end-to-end in a throwaway branch. Half a day.
  2. Config + secrets: env-backed config, .env.example entries, secrets manager wiring, and a documented rotation runbook.
  3. Factory + provider + one domain service, with the SDK call isolated behind an interface.
  4. Observability: request/response logging with redaction, latency and error-code metrics, and a TencentCloudSDKException → domain-exception mapper registered in the exception handler.
  5. Resilience: wrap calls in a retry-with-jitter policy keyed on Tencent error codes (RequestLimitExceeded, InternalError), never on validation errors; add idempotency tokens where the API supports them.
  6. Async: move non-interactive calls (SMS, OCR batch, media processing) to queued jobs with their own timeout and retry budgets so web workers aren't blocked.
  7. Expand to remaining product SDKs only after the wrapper proves out.

Operational Impact

Maintenance. Low steady-state cost — the SDK is thin and Tencent maintains it — but the upgrade path is opaque: sparse changelogs, Chinese-first documentation, and majors that move the HTTP layer. Budget a deliberate quarterly review of pinned versions rather than relying on Dependabot auto-merges.

Support. Single-vendor governance (Tencent). Community support is thin in English; expect to lean on official docs and ticketing. Internally, the wrapper layer is yours to own, so assign a named owner — otherwise the credential and retry logic rots silently.

Scaling. Scaling is bounded by PHP worker concurrency and Tencent's per-API QPS quotas, not by the library. Synchronous calls inside request handlers will saturate FPM under load; push throughput-sensitive workloads to queues with bounded worker pools. Add client-side throttling or a token-bucket per API so a traffic spike degrades gracefully instead of burning the quota and failing everything. Multi-region endpoints are per-client configuration, so a region failover strategy means constructing clients per region, not reusing one.

Failure modes to design for. Clock skew breaking TC3 signatures (keep NTP tight, surface AuthFailure.SignatureExpire distinctly); expired STS tokens if you adopt temporary credentials; region/endpoint mismatch; throttling under burst; cURL timeouts hanging workers when HttpProfile defaults are too generous; and unhandled TencentCloudSDKException leaking vendor error strings into user-facing responses. Each needs an explicit handling decision, not a catch-all.

Ramp-up. Roughly one to two engineer-days for a competent PHP developer to ship the wrapper plus first integration, assuming the spike lands. The friction is not the code — it's the documentation language gap, the absence of Laravel-native examples, and the need to invent credential rotation and test doubles from scratch. The low star count is an accurate proxy for "no community scaffolding," not for code quality.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings