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

Flysystem Oss Laravel Package

iidestiny/flysystem-oss

Flysystem adapter for Alibaba Cloud OSS (Aliyun Object Storage Service). Integrate OSS storage with Laravel and PHP apps using Flysystem, enabling file uploads, reads, deletes, and URL generation through a familiar filesystem API.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit. This is a thin port/adapter implementation: it connects league/flysystem (the filesystem abstraction Laravel's Storage facade is built on) to Alibaba Cloud OSS. Architecturally it lives at the infrastructure edge — application code continues to depend on Illuminate\Contracts\Filesystem\Filesystem, and only configuration changes. That is the right shape for a TPM to approve, because the blast radius of replacing it later is a config swap rather than a refactor.

It fits well when:

  • The app already uses Storage::disk() and you need OSS for China-region latency, data residency, or cost.
  • You want one filesystem contract across local, S3, and OSS so environments stay symmetric.

It does not fit when the product genuinely needs OSS-specific capabilities below the Flysystem line: x-oss-process image transforms, storage-class transitions to IA/Archive, versioning, inventory, Select, or KMS/CMK encryption. Those require the official aliyuncs/oss-sdk-php and a bespoke abstraction, not this package.

Integration feasibility. High for the happy path. Composer-installable; the v3 line targets Flysystem 3 (Laravel 9+). For Laravel wiring, the same author publishes a sibling service-provider package that registers the oss driver; alternatively you register a custom disk via Storage::extend() in a service provider — roughly 30 lines, and often the lower-risk choice because it removes an unmaintained dependency from the tree. Configuration surface is small: key, secret, bucket, endpoint, isCName, SSL, prefix. Budget hours to a day for a working disk, and several days for production hardening (IAM/STS credentials, presigned URLs, contract tests, parity checks).

Technical risk.

  • Supply chain / bus factor. ~95 stars and a single-maintainer pattern. Community-only support, no SLA, no security disclosure process visible. Treat as a pinned dependency with a fork-and-patch contingency planned up front.
  • Credential handling. The typical configuration is a static AccessKey/Secret in config/filesystems.php. Production should use a RAM role or STS temporary credentials. Verify whether a security-token parameter is supported; if not, you must implement credential refresh yourself and pass short-lived credentials into the disk config.
  • Contract fidelity. Adapters commonly under-implement the Flysystem 3 interface: visibility/ACL mapping (private vs public-read), temporaryUrl, mimeType, lastModified, directoryExists, server-side move/copy, and throwing the correct UnableTo* exceptions. Each gap surfaces as a broken framework feature — asset URL generation, backup jobs, queued deletes, cache invalidation.
  • Streaming and memory. Confirm writeStream/readStream are genuinely streamed and that multipart thresholds are configurable. A buffering adapter will OOM on large uploads and only reveal itself under production load.
  • Path semantics. prefix/root handling and key normalization (leading slashes, URL encoding, unicode) are a recurring source of orphaned and overwritten objects.
  • Version drift. Flysystem's next major will require an adapter update that may never ship. The abstraction protects your application code but not your dependency graph.

Key questions for the maintainer/vendor.

  1. Which Flysystem majors and PHP versions does the pinned tag support, and what is the tested Laravel compatibility matrix (10/11/12)?
  2. Is temporaryUrl implemented, and does it respect custom domains / CNAME endpoints?
  3. Does it support STS SecurityToken and RAM-role credentials, or only static AccessKey/Secret?
  4. Are streams and multipart uploads documented and covered by tests? What is the large-file memory profile?
  5. Is there CI, a test suite, contribution guidelines, and a named security contact? Who else has commit rights?
  6. What are the failure semantics — which exceptions propagate, and are transient network errors distinguishable from auth failures so retries can be scoped correctly?
  7. What is the license, and which version of the Alibaba OSS SDK is pinned transitively?

Integration Approach

Stack fit. Composer-based, PHP with cURL. Fit is conditional on Flysystem major version alignment: this adapter's v3 line is required for Laravel 9+, and an older pinned tag will strand you on an unsupported framework. Keep all application code on Storage/Illuminate\Contracts\Filesystem\Filesystem; any direct OSS SDK call inside domain logic destroys the swap-out option that justifies adopting the adapter at all.

Migration path.

  1. Add the OSS disk alongside the existing local/S3 disk; do not change the default disk.
  2. Backfill with a queue job that reads from the source disk and writes to OSS preserving keys.
  3. Verify with size + ETag/MD5 comparison plus sampled content diffs — checksums, not file counts.
  4. Canary one low-risk upload path in production.
  5. Cut over behind a feature flag, keeping the previous disk readable for a defined rollback window.

Compatibility checks before committing.

  • Flysystem major ↔ Laravel major ↔ PHP version, mapped explicitly in the ticket.
  • Endpoint selection: internal vs public endpoint, region co-location, and CNAME behavior if a custom domain fronts the bucket.
  • Bucket ACL model versus the application's visibility assumptions — verify that a "private" write is actually private.
  • Whether the sibling Laravel driver package is needed or whether Storage::extend() is sufficient (prefer the latter unless the former is actively maintained).

Sequencing.

  1. Spike (1–2 days). Sandbox bucket; exercise write, read, stream, delete, list, exists, visibility, temporary URL. Log every interface method that behaves unexpectedly.
  2. Harden. Credentials from a secret store or RAM role; explicit timeouts; retry policy; structured logging on OSS error codes.
  3. Contract tests. One suite run against local, S3, and OSS disks to catch abstraction leaks before they reach production.
  4. Backfill + parity + canary + cutover, with a rehearsed rollback.
  5. Pin and govern. Exact version pin, dependency-update automation with a mandatory human review gate, and a written fork-and-patch procedure.

Operational Impact

Maintenance. The code surface is small — a handful of classes — so maintenance cost is dominated by dependency hygiene rather than by the adapter itself. Pin exact versions, watch upstream releases, and review the transitive OSS SDK. Assume you may need to vendor a fork; that is realistic for a mid-level PHP engineer precisely because the package is thin. Keep an internal StoragePort interface above Laravel's contract so an eventual rip-and-replace is configuration, not surgery.

Support. Community-only via GitHub issues, likely Chinese-language-first. There is no vendor SLA and no guaranteed response. For any Tier-1 revenue path, assign a named internal owner for the integration and its tests, and make the escalation boundary explicit for on-call: adapter defects are yours, OSS service defects are Alibaba Cloud's.

Scaling. OSS scales horizontally; the adapter is not the throughput bottleneck. The bottlenecks are on the PHP side: request concurrency, connection reuse, timeout tuning, and memory behavior on large files. For user-generated or multi-GB content, route uploads as presigned direct-to-OSS transfers rather than proxying bytes through PHP. Co-locate compute and bucket region and use the internal endpoint, because cross-region egress is the dominant cost line at volume.

Failure modes and mitigations.

  • Credential/STS expiry → 403 storms. Use a refresh-aware credential provider; alert on 403 rate, not just on error totals.
  • Visibility misconfiguration → an accidentally public bucket. Default to private, and audit ACLs in CI against a policy check.
  • Path/prefix defects → orphaned or silently overwritten objects. Unit-test key generation and enforce a uniqueness invariant at write time.
  • Exception drift → retry and queue logic stops matching. Assert exception types in contract tests, not just success paths.
  • Move/copy semantics → server-side copy not supported means copy-then-delete, which is not atomic. Confirm behavior and design idempotent operations around it.
  • Endpoint/CNAME changes at deploy → DNS/TTL and cached-URL breakage. Treat endpoint configuration as immutable per environment.

Ramp-up. Low for Laravel developers: anyone comfortable with Storage::disk is productive within an hour on the happy path. Moderate for OSS depth — ACLs, storage class, lifecycle rules, versioning, presigned URLs — and for whoever debugs the second-order failures when a framework feature (backups, asset URLs, queued deletes) quietly stops working. Ship a one-page runbook covering key rotation, how to smoke-test a disk, where the disk is configured, and the fork procedure. Overall: a reasonable, low-ceremony component for a China-region Laravel workload, contingent on pinning, contract testing, and accepting single-maintainer dependency risk.

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.
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
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route