starcitizenwiki/mediawikiapi
A PHP package for working with the MediaWiki API, built for the Star Citizen Wiki. It offers convenient methods for querying wiki pages, search, and related data in Laravel or standalone PHP applications.
Architecture fit. This is a thin Laravel wrapper around the MediaWiki Action API over HTTP, authenticated via OAuth. Architecturally it slots into the standard Laravel service-provider/config/facade pattern, so for a Laravel application that needs to read from or write to a MediaWiki instance (content sync, automated page creation, template/data ingestion, bulk edits), it saves hand-rolling a Guzzle client and OAuth signing. It is a request/response client only — no webhooks, no change streams — so any near-real-time requirement would still need polling or a separate mechanism.
Integration feasibility. MIT license, Composer-installable, small footprint. Zero dependents means no transitive baggage but also no ecosystem validation. The real gate is authentication: MediaWiki historically used OAuth 1.0a owner-only consumers, and Wikimedia has been moving toward OAuth 2.0; a 2021 package likely implements OAuth 1.0a only. Confirm the target wiki's OAuth extension and consumer type before committing. Also verify PHP/Laravel version constraints — a March 2021 release probably caps around Laravel 8 / PHP 8.0.
Technical risk. High maintenance risk: unmaintained for ~4 years, 6 stars, no dependents, no visible security disclosure process, unknown test coverage. MediaWiki's Action API is relatively stable, which limits churn risk, but the Laravel and Guzzle major-version treadmill is the bigger threat. OAuth 1.0a signing is a classic source of subtle, environment-specific bugs, so mock-based confidence is misleading. Error handling, retry, CSRF token refresh, and edit-conflict behavior are likely thin or undocumented.
Key questions.
baserevid conflict handling?Stack fit. A fit only if we are on Laravel in the 6–8 range. On Laravel 10/11 the constraints will need widening or a fork; on Symfony or plain PHP the Laravel coupling is pure overhead and a generic MediaWiki client is a better choice. If the need is read-only content ingestion, even a small in-house Guzzle client may be cheaper than owning this.
Migration path. Adopt behind an internal WikiClient contract/facade so the package is a swappable implementation, not a hard dependency. Start read-only. Vendor or pin the package unmodified; only fork if we need patches, and if we fork, publish internally with our own version tags.
Compatibility. Pin an exact version, validate composer constraints against our PHP/Laravel matrix, register an owner-only OAuth consumer against a staging wiki, and prove the OAuth signature flow end-to-end against a real MediaWiki instance — not mocks. Check content-model and namespace handling if we touch non-wikitext pages.
Sequencing. (1) One-week spike: install, authenticate to staging, exercise one read and one write. (2) Fork-vs-wrap decision. (3) Wrap behind internal contract, add integration tests against staging. (4) Ship the read path. (5) Ship the write path with queueing, retry/backoff, and audit logging. (6) Define the exit path: contribute upstream or commit to a maintained internal fork.
Maintenance. Assume we own it. Budget for a fork-and-maintain or vendor-and-patch arrangement. The surface is small, so cost is modest but non-zero: dependency bumps, MediaWiki API/OAuth changes, and security patching Guzzle transitively.
Support. Upstream is a community wiki project with no SLA and likely low responsiveness. No security policy. An internal maintainer must be named before adoption.
Scaling. MediaWiki enforces edit rate limits and maxlag; writes should be serialized through a queue to avoid edit conflicts and throttling. Reads should be cached and batched. OAuth consumers should be one per environment, with secrets in a proper secrets manager, not .env sprawl.
Failure modes. OAuth signature failures and secret rotation; CSRF token expiry mid-operation; edit conflicts (baserevid/starttimestamp); maxlag rejections; wiki 5xx and Guzzle timeouts; silent empty results on permission errors; and breakage on Laravel/Guzzle major upgrades. Instrument non-2xx responses and MediaWiki error envelopes with alerting.
Ramp-up. Low for a mid-level Laravel developer — the API surface is small and Laravel conventions are familiar, so days not weeks. Documentation is likely sparse, so source-reading is required. The real learning curve is MediaWiki semantics (tokens, namespaces, content models, conflict handling), not the package itself.
How can I help you explore Laravel packages today?