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

Oss Sdk Php Laravel Package

aliyuncs/oss-sdk-php

Alibaba Cloud OSS SDK for PHP lets you upload, download, and manage any files on Alibaba Cloud Object Storage from PHP 5.3+ applications via Composer, requiring the cURL extension.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. aliyuncs/oss-sdk-php is a vendor SDK, not a framework integration — there is no first-party Laravel service provider, config publishing, or facade. The integration seam is the OSS\OssClient class, which is instantiated with credentials + endpoint and exposes a broad, imperative surface (bucket CRUD, object PUT/GET/append/copy, multipart upload, ACL, tagging, versioning, WORM, encryption, CNAME, transfer acceleration, presigned URLs, RTMP, image processing). That breadth is the main architectural value: it lets us push media resizing/watermarking and large-object assembly to OSS instead of doing it in PHP workers. It also fits Laravel's filesystem abstraction reasonably well via community Flysystem adapters (iidestiny/flysystem-oss and similar, which depend on this SDK for Flysystem v3 / Laravel 9+). Recommended posture: use the Flysystem adapter behind Storage::disk('oss') for ordinary file operations, and wrap OssClient in a thin internal gateway (interface + adapter) for presigned URLs, multipart, and bucket policy — never let OSS\* types leak into domain or controller code.

Integration feasibility. High. Composer install (~2.0), cURL extension, PHP 5.3+ per README with release notes confirming PHP 8.5 compatibility as of 2.7.3, so Laravel 10/11/12 on PHP 8.2–8.4 is well within range. Auth is static AK/SK or, since 2.6.0/2.7.0, a credentials provider with environment-variable and STS support; SigV4 and forcePathStyle arrived in 2.7.x, which matters for CNAME/VPC endpoints and private-link style access. Risk is concentrated in three places: (1) the repo explicitly steers new work toward alibabacloud-oss-php-sdk-v2 (beta) while this v1 line remains the production-proven path — we must decide which line we are standardizing on before writing code; (2) the package's "Dependents: 0" signal is almost certainly a metric artifact (Packagist dependents are not reflected), so we cannot use it as ecosystem validation and should confirm real-world usage ourselves; (3) the client is stateful-ish (holds config, options, retry settings), which interacts badly with Octane/long-lived workers if instantiated as a singleton with short-lived STS credentials.

Technical risk. Medium overall, mitigated by the fact that failures are well-bounded and observable.

  • Abstraction risk (high impact, low effort to avoid): direct OssClient usage in business code will make a future V2 migration a rewrite. Enforce a gateway interface from day one.
  • Credential risk (high): static AK/SK in .env for server-side is acceptable short-term; any browser-direct or mobile upload requires STS token vending from our backend, with expiry and refresh designed up front.
  • Error-model risk (medium): only OSS\Core\OssException surfaces, with service codes inside; we need a mapping layer to Laravel exceptions plus a retry policy that distinguishes retryable (5xx, throttling, timeouts) from terminal (403 signature, 404, 409) errors.
  • Client-version risk (medium): v1 is in a "fix + add" cadence, not feature-frozen, but the official narrative points at v2; expect eventual guidance to migrate and budget a follow-on workstream.
  • Data-governance risk (medium, non-technical): objects and metadata leave our cloud boundary for Alibaba Cloud; this needs security/legal/procurement sign-off before the first bucket holds real user data.

Key questions. Which region(s) and data-residency constraints apply, and do we already have an Alibaba Cloud account and support tier? Do we standardize on the current SDK (v1 line) and time-box a v2 migration, or spike v2 now? Do we have existing S3/Flysystem usage that should share an abstraction? What is the object profile — average/max size, request rate, public vs private, CDN in front? Are presigned direct-to-OSS uploads in scope (this changes the STS and CORS work substantially)? Do we need image processing, WORM/retention, or cross-region replication for compliance? Who owns the runbook when OSS returns 503 or a region degrades?

Integration Approach

Stack fit. Add aliyuncs/oss-sdk-php (pinned to a specific minor, e.g. ~2.7.3) plus a Flysystem OSS adapter. Configure a disks.oss entry in config/filesystems.php and a small service provider that binds a StorageGateway interface to an OssStorageGateway implementation, constructs OssClient per config, and sets timeouts, proxy, and retry behavior from env. Keep config/oss.php for endpoint, bucket, region, credential mode, and URL-signing TTL. Default the disk to private, with presigned GETs for delivery, so bucket ACLs stay locked down by default.

Migration path. Three phases. (1) Foundation (1–2 sprints): provider, config, gateway interface, error mapping, two or three real object operations, integration tests against a sandbox bucket. (2) Adoption: move new upload paths (user avatars, exports, invoice PDFs, media) to the OSS disk; add direct-to-OSS presigned uploads for anything larger than ~10 MB to keep bytes out of PHP-FPM; wire multipart for large assets and enqueue completion in jobs. (3) Consolidation: migrate legacy local/public-disk assets with a batched copy job, keep a dual-read window, then remove local copies. Do not use Storage::move across disks for large files — stream or server-side copy via copyObject.

Compatibility. Confirm PHP and Laravel versions against the pinned SDK; add the cURL extension to the base image explicitly. If we run Octane, bind the client as a scoped (not singleton) instance and re-resolve on credential refresh. If we use a CNAME or internal endpoint, verify against forcePathStyle and the SigV4 path, since signature bugs surface only on non-standard endpoints. Set bucket CORS deliberately if browsers upload directly. Note that OSS has an S3-compatible surface, but treat that only as a hedge — do not design for S3 portability on day one unless there is a credible multi-cloud mandate.

Sequencing and gates. Decision gate 1: SDK line (v1 vs v2 beta) and abstraction commitment. Gate 2: security sign-off on credentials, STS design, and data residency. Gate 3: Flysystem adapter selection and a spike proving put/get/presign/multipart against a sandbox bucket. Then build. Each gate should be a same-week artifact, not a document.

Operational Impact

Maintenance. MIT-licensed, vendor-maintained with a steady patch cadence and clear per-release changelogs; we own the Laravel glue (provider, config, gateway) and must treat it as first-class code with tests. Budget roughly one day per quarter for dependency review, plus a defined event for the eventual v2 migration. Track which SDK line we are on in the dependency register so drift is visible.

Support. Alibaba Cloud offers official docs (English and Chinese), a developer forum, and ticketing — ticketing is the escalation path, and its quality should be validated during the pilot by filing one real issue. Upstream GitHub issues are the fix path for SDK bugs; there is no commercial SLA on the library itself. Internal runbook ownership must be assigned before production traffic.

Scaling. OSS itself scales; our constraints are application-side. Keep uploads streaming (file handles are supported) rather than loading objects into memory; size PHP-FPM and queue workers for network-bound I/O, not CPU; reuse client instances per request; and put a CDN in front of any read-heavy public asset path. Presigned direct uploads are the single highest-leverage scaling decision — they remove the web tier from the data path entirely. Watch request-count costs (HEAD/LIST are cheap but not free) and egress charges, which are the usual surprise line item.

Failure modes. Expect and pre-plan for: STS token expiry mid-flight (surface as a retryable auth error, refresh and retry once); clock skew producing signature failures (NTP on hosts, alert on 403 signature errors); throttling/5xx from OSS (bounded exponential backoff, then dead-letter); orphaned multipart parts from aborted uploads (mandatory lifecycle rule to abort incomplete multipart uploads after N days); region-level outage (documented degradation — read-only or queued writes — with a status-page check in the runbook); and silent cost creep from egress and repeated LIST calls. Emit metrics per operation (latency, error code, bytes) so these are diagnosable without reproducing locally.

Ramp-up. The SDK is simple to start with (new OssClient(...), putObject) but the operational knowledge — STS, CORS, multipart lifecycle, presigning, endpoint variants — is where teams lose time, and documentation leans Chinese-first in places. Plan a half-day onboarding session, two reference implementations (small private file, large presigned multipart upload) checked into the repo as living examples, and a short internal README covering credentials, bucket policy, and the escalation path. Net: a mid-level Laravel engineer should be productive within a week; the gateway abstraction is what keeps that knowledge from evaporating when the SDK line changes.

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.
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle
glavweb/extra-bundle
glavweb/api-bundle
glavweb/admin-bundle
adachsoft/api-version-bundle
elsayed85/laravel-api-exceptions
ouhssini/laravel-demo-mode
daworks/ncloud-outbound-mailer-driver
gp247/cms
ignibyte/aic-gates
nexa-merchant/blog
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
cgv/localized-resource