PHPackages                             mwstake/mediawiki-component-wire - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. mwstake/mediawiki-component-wire

ActiveLibrary

mwstake/mediawiki-component-wire
================================

Real time messaging

1.0.9(4mo ago)0921—6.7%GPL-3.0-onlyPHPCI passing

Since Aug 19Pushed 4mo agoCompare

[ Source](https://github.com/hallowelt/mwstake-mediawiki-component-wire)[ Packagist](https://packagist.org/packages/mwstake/mediawiki-component-wire)[ RSS](/packages/mwstake-mediawiki-component-wire/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (2)Dependencies (7)Versions (11)Used By (0)

Setup
=====

[](#setup)

This component uses `mwstake/mediawiki-component-token-authenticator` for client authentication. Configure salt to be used to sign tokens issued to the wire service. Same value must be configured on `webservice-wire` side (`TOKEN_SALT` env var)

```
$GLOBALS['mwsgTokenAuthenticatorSalt'] = '';

```

Url of `webservice-wire` service

```
$GLOBALS['mwsgWireServiceUrl'] = '';
$GLOBALS['mwsgWireServiceAllowInsecureSSL'] = false;

```

API-key used for HTTP communication with `webservice-wire` service. Same key must be configured on `webservice-wire` side (`API_KEY` env var)

```
$GLOBALS['mwsgWireServiceApiKey'] = '';

```

Note: If using Insecure SSL you need to visit `mwsgWireServiceUrl` in browser and manually "trust" it, so that websocket can establish connection

Usage
=====

[](#usage)

Sending message
---------------

[](#sending-message)

### In application

[](#in-application)

```
    $channel = ( new \MWStake\MediaWiki\Component\Wire\WireChannelFactory() )->getChannelForPage( $title );
    $channel = ( new \MWStake\MediaWiki\Component\Wire\WireChannelFactory() )->getChannelForUser( $user );
    $channel = ( new \MWStake\MediaWiki\Component\Wire\WireChannelFactory() )->getGlobalChannel();

    $message = new \MWStake\MediaWiki\Component\Wire\WireMessage(
        $channel,
        [ 'arbitrary' => 'payload' ]
    );
    // or, for creating Wire messages from MW Message object, you can use:
    $message = \MWStake\MediaWiki\Component\Wire\WireMessage::newFromLocalizationMessage(
        \MediaWiki\Message\Message::newFromKey( 'my-text', [ 'a', 'b' ] ),
        $channel
    )

    /** @var \MWStake\MediaWiki\Component\Wire\WireMessenger $messenger */
    $messenger = \MediaWiki\MediaWikiServices::getInstance()->getService( 'MWStake.Wire.Messenger' );
    $messenger->send( $message );
```

### Client-side

[](#client-side)

```
const channel = mws.wire.getCurrentPageChannel();
const message = new mws.wire.Message( channel, { arbitrary: 'payload' } );
mws.wire.send( message );
```

Listening for messages
----------------------

[](#listening-for-messages)

### In application

[](#in-application-1)

```
// Global var
$GLOBALS['mwsgWireListeners'][] = [
    'class' => MyListener::class,
    'services' => [ ... ]
];

// Or hook
$GLOBALS['wgHooks']['MWStakeWireListeners'][] = static function( \MWStake\MediaWiki\Component\Wire\WireListenerRegistry $registry ) {
    $registry->register( new MyListener() );
};

// Class...
class MyListener implements \MWStake\MediaWiki\Component\Wire\WireListener {
    public function onWireMessage( \MWStake\MediaWiki\Component\Wire\WireMessage $message ) {
        // Handle message
    }
}

class MyListener implements \MWStake\MediaWiki\Component\Wire\Listener\WireListenerOnPage {
    public function getPageToListenOn() {
        return $title; // Title to listen for messages on, or null for all pages
    }
    public function onWireMessage( \MWStake\MediaWiki\Component\Wire\WireMessage $message ) {
        // Handle message for a page
    }
}
```

### Client-side

[](#client-side-1)

```
mws.wire.listen( mws.wire.getCurrentPageChannel(), function( payload ) {
	mw.notify( mw.msg( payload.mymsgkey ) );
} );
```

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance78

Regular maintenance activity

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 63.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~17 days

Recently: every ~32 days

Total

10

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/161c38b5448b71865cf0652b6974ed489dd3683b5d6e1814973cea6cb66c8f1d?d=identicon)[dsavuljesku](/maintainers/dsavuljesku)

---

Top Contributors

[![it-spiderman](https://avatars.githubusercontent.com/u/13665198?v=4)](https://github.com/it-spiderman "it-spiderman (14 commits)")[![HamishSlater](https://avatars.githubusercontent.com/u/26261210?v=4)](https://github.com/HamishSlater "HamishSlater (7 commits)")[![osnard](https://avatars.githubusercontent.com/u/1201528?v=4)](https://github.com/osnard "osnard (1 commits)")

### Embed Badge

![Health badge](/badges/mwstake-mediawiki-component-wire/health.svg)

```
[![Health](https://phpackages.com/badges/mwstake-mediawiki-component-wire/health.svg)](https://phpackages.com/packages/mwstake-mediawiki-component-wire)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
