PHPackages                             delirehberi/webfinger - 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. [API Development](/categories/api)
4. /
5. delirehberi/webfinger

AbandonedArchivedLibrary[API Development](/categories/api)

delirehberi/webfinger
=====================

Webfinger Implementation

0.0.5.x-dev(6y ago)681MITPHP

Since Jul 21Pushed 6y ago1 watchersCompare

[ Source](https://github.com/delirehberi/webfinger)[ Packagist](https://packagist.org/packages/delirehberi/webfinger)[ RSS](/packages/delirehberi-webfinger/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (1)Versions (2)Used By (1)

PHP WebFinger implementation [![Build Status](https://camo.githubusercontent.com/05ee35f8c70b3345cd94f9931a0a87692d1f8c8a60790da2deaec04ce8cbdd13/68747470733a2f2f7472617669732d63692e636f6d2f64656c69726568626572692f77656266696e6765722e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/delirehberi/webfinger)
===========================================================================================================================================================================================================================================================================================================================

[](#php-webfinger-implementation-)

WebFinger [RFC7033](https://tools.ietf.org/html/rfc7033) implementation for PHP. You can use your projects after with basic installation steps.

### Installation

[](#installation)

- add to your dependencies `composer require delirehberi/webfinger`
- create your WebFingerController and route it to `/.well-known/webfinger`
- configure your resources.
    - add user resource for `acct:` requests. eg: `acct:rik@florina.gov`
    - add url resource for `https://` request. eg: `https://florina.gov/news/missing-spatio-analyst`
    - add user resource for `mailto:` request. eg: `mailto:rik@florina.gov`

#### Example

[](#example)

- `$router` is router object
- `$dbh` pdo instance

At first, you need implement your entities from `\DelirehberiWebFinger\ResourceDescriptorInterface`

---

After that you need to write your transform method.

```
public function transform(): \DelirehberiWebFinger\JsonRD
            {
                $data = new \DelirehberiWebFinger\JsonRD();
                $data
                    ->setSubject("acct:" . $this->getEmail());
                $data->addAlias('https://www.example.com/~' . $this->getUsername() . "/");

                $link = new \DelirehberiWebFinger\JsonRDLink();
                $link->setRel('http://webfinger.example/rel/profile-page')
                    ->setHref('https://www.example.com/~' . $this->getUsername() . "/");
                $data->addLink($link);

                $link = new \DelirehberiWebFinger\JsonRDLink();
                $link->setRel('http://webfinger.example/rel/businesscard')
                    ->setHref('https://www.example.com/~' . $this->getUsername() . "/" . $this->getVcardUrl());
                $data->addLink($link);

                $data->addProperty('http://example.com/ns/role', 'employee');
                return $data;
            }
```

---

Last step is return your object in your controller.

```
 $dbh = new PDO('mysql:host=localhost;dbname=test', $user, $pass);
 $router->add('/.well-known/webfinger',function(Request $req)use($dbh){

    $userAdapter = new \DelirehberiWebFinger\Adapter\ArrayAdapter();
    $userAdapter->add($user);
    $userAdapter->setScheme(\DelirehberiWebFinger\Constants::Account);
    $userAdapter->setFilter(function(User $user,string $query){
        if($user->getEmail()==$query){
            return true;
        }
        return false;
    });

    $contentAdapter = new \DelirehberiWebFinger\Adapter\SqlQueryAdapter();
    $contentAdapter->setPdoInstance($dbg);
    $contentAdapter->setQuery("select * from contents where slug=:data");
    $contentAdapter->addModifier(function($url)use($router){
        $url = parse_url($url);
        $parse = $router->match($url['path');
        return $parse['slug']??false;
    });
    $contentAdapter->setScheme(\DelirehberiWebFinger\Constants::Content);

    $webfinger = new \DelirehberiWebFinger\WebFinger();
    $webfinger->addResource($userAdapter);
    $webfinger->addResource($contentAdapter);

    $data = $webfinger->response($req->getQuery());
    if($data===null){
        //header 404
        return "";
    }
    // don't forget add content-type to your response header
    // eg:  Content-Type: application/jrd+json
    return $data->transform()->toJSON();
 });
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

2487d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/41a38f57dd7761f20b08fede145a46265cbd296d0f4b155aec8ffb299ae14d69?d=identicon)[delirehberi](/maintainers/delirehberi)

---

Top Contributors

[![delirehberi](https://avatars.githubusercontent.com/u/803964?v=4)](https://github.com/delirehberi "delirehberi (11 commits)")

---

Tags

w3cwebfinger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/delirehberi-webfinger/health.svg)

```
[![Health](https://phpackages.com/badges/delirehberi-webfinger/health.svg)](https://phpackages.com/packages/delirehberi-webfinger)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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