PHPackages                             linkorb/extractor - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. linkorb/extractor

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

linkorb/extractor
=================

Extractor: extracts contexts through query packs

v1.1.1(7y ago)0301MITPHPCI failing

Since Oct 30Pushed 7y ago2 watchersCompare

[ Source](https://github.com/linkorb/extractor)[ Packagist](https://packagist.org/packages/linkorb/extractor)[ Docs](https://github.com/linkorb/extractor)[ RSS](/packages/linkorb-extractor/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (1)

Extractor
=========

[](#extractor)

**Extractor** is a library that allows you to extract data from *connections* (databases, files, API's, etc) into a simple JSON array for further processing.

No programming is required, all you need to do is write extractor definitions.

Use-cases
---------

[](#use-cases)

- Extract data from applications you can't modify
- Reporting
- Collecting Context data (all records related to entity "X").

Extractor + Context = &lt;3
---------------------------

[](#extractor--context--3)

Extractor works particularly well in tandem with github.com/linkorb/context

You can use the output of Extractor to load the data into a Context for further processing. This gives you the ability to specify advanced multi-directional relationships for flexible in-memory navigation.

Example: wordpress-post-extractor.yaml
--------------------------------------

[](#example-wordpress-post-extractoryaml)

Check the [examples/wordpress-post-extractor.yaml](examples/wordpress-post-extractor.yaml) definition file for a simple example.

This example requires one **Input** called `postName`.

Based on the input, it runs a set of commands.

Each command has a `method`. Different connections support different methods. The `PdoConnection` supports the `query` method, while an `XyzApiConnection` would support methods like `request`.

You can specify an SQL query that contains a set of placeholders.

The placeholders are passed as arguments into the command before it's executed. This allows you to pass arguments from the "inputs" table, or from a table that has been queried before.

In the wordpress example you'll see that the first command passes the `postName` from the initial inputs.

The second command passes in the `postId` that was retrieved during the first command.

This allows you to stack queries on top of each-other.

Output format
-------------

[](#output-format)

Extractor collects a set of tables, with rows per table. You can think of it as snapshot of a database.

The output is a simple array (which you can json\_encode) that looks like this:

```
{
  "inputs": [
    {
      "postName": "hello-world"
    }
  ],
  "posts": [
    {
      "ID": "3021",
      "post_title": "Hello world",
      "post_name": "hello-world",
      "post_date": "2018-06-17 09:00:00",
      "post_status": "publish"
    }
  ],
  "comments": [
    {
      "comment_ID": "431",
      "comment_author": "Joe Johnson",
      "comment_author_email": "joe@example.com",
      "comment_date": "2018-06-17 11:06:00",
      "comment_content": "Hello to you too!"
    },
    {
      "comment_ID": "452",
      "comment_author": "Alice Alisson",
      "comment_author_email": "alice@example.com",
      "comment_date": "2018-06-17 13:21:00",
      "comment_content": "Nice post! and a 'Hello' back :-)"
    }
  }
}

```

You'll see the "inputs" have is provided as a table containing a single row. The "posts" table contains one row, the one selected based on the input argument. And the comments table contains all rows matched by the postId.

Note that rows don't have a key, it's up to the code that uses these extracts to assign row ids or build indexes if needed.

A simple way would add useful IDs to the comment table based on the `comment_ID` of each row would be:

```
$comments = [];
foreach ($data['comments'] as $i=>$row) {
  $comments[$row['comment_ID']] = $row;
}
$data['comments'] = $comments;
```

License
-------

[](#license)

MIT (see [LICENSE.md](LICENSE.md))

Brought to you by the LinkORB Engineering team
----------------------------------------------

[](#brought-to-you-by-the-linkorb-engineering-team)

[![](https://camo.githubusercontent.com/62fb66b034de7ea7fca9fd9776424b5348daa76ef8622caf92c2f7622003e5ef/687474703a2f2f7777772e6c696e6b6f72622e636f6d2f642f6d6574612f74696572312f696d616765732f6c696e6b6f7262656e67696e656572696e672d6c6f676f2e706e67)](https://camo.githubusercontent.com/62fb66b034de7ea7fca9fd9776424b5348daa76ef8622caf92c2f7622003e5ef/687474703a2f2f7777772e6c696e6b6f72622e636f6d2f642f6d6574612f74696572312f696d616765732f6c696e6b6f7262656e67696e656572696e672d6c6f676f2e706e67)
Check out our other projects at [linkorb.com/engineering](http://www.linkorb.com/engineering).

Btw, we're hiring!

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity64

Established project with proven stability

 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

Every ~0 days

Total

3

Last Release

2800d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1db66b320db18b8036ea68211b7d8a39e7c6da97e6fd29f59a50380ebb69d0bb?d=identicon)[joostfaassen](/maintainers/joostfaassen)

---

Top Contributors

[![joostfaassen](https://avatars.githubusercontent.com/u/411113?v=4)](https://github.com/joostfaassen "joostfaassen (6 commits)")

---

Tags

Contextextractorlinkorb

### Embed Badge

![Health badge](/badges/linkorb-extractor/health.svg)

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

###  Alternatives

[verbb/formie

The most user-friendly forms plugin for Craft.

102393.6k59](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54681.3k17](/packages/solspace-craft-freeform)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[typo3/cms-form

TYPO3 CMS Form - Flexible TYPO3 frontend form framework that comes with a backend editor interface.

147.6M248](/packages/typo3-cms-form)[eliashaeussler/typo3-form-consent

Extension for TYPO3 CMS that adds double opt-in functionality to EXT:form

1595.5k](/packages/eliashaeussler-typo3-form-consent)[netgen/layouts-core

Netgen Layouts enables you to build and manage complex web pages in a simpler way and with less coding. This is the core of Netgen Layouts, its heart and soul.

3692.1k16](/packages/netgen-layouts-core)

PHPackages © 2026

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