PHPackages                             bankiru/seo-engine - 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. bankiru/seo-engine

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

bankiru/seo-engine
==================

Banki.ru SEO engine library

0.2(9y ago)325.4k1MITPHPPHP ~5.5 || ~7.0

Since Jan 30Pushed 3y ago2 watchersCompare

[ Source](https://github.com/bankiru/seo-engine)[ Packagist](https://packagist.org/packages/bankiru/seo-engine)[ RSS](/packages/bankiru-seo-engine/feed)WikiDiscussions master Synced today

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

[![Latest Stable Version](https://camo.githubusercontent.com/7899500b384cd8018918e0e8ce095e00730ecf6327577c021991c743bcd79c72/68747470733a2f2f706f7365722e707567782e6f72672f62616e6b6972752f73656f2d656e67696e652f76657273696f6e)](https://packagist.org/packages/bankiru/seo-engine)[![Total Downloads](https://camo.githubusercontent.com/aeb3990d1c0a2d8d38028ef668489a06fe76824362bb011cddc2e8509f77b9e0/68747470733a2f2f706f7365722e707567782e6f72672f62616e6b6972752f73656f2d656e67696e652f646f776e6c6f616473)](https://packagist.org/packages/bankiru/seo-engine)[![Latest Unstable Version](https://camo.githubusercontent.com/419f0f93250f6aaa92906c3d85c7e3392a721e617c834e71562a16b63b3bb5d6/68747470733a2f2f706f7365722e707567782e6f72672f62616e6b6972752f73656f2d656e67696e652f762f756e737461626c65)](//packagist.org/packages/bankiru/seo-engine)[![License](https://camo.githubusercontent.com/b9b018314eb28eb18f7dc9d145a21c31bda7eaedda370aeaf962565a548a48b5/68747470733a2f2f706f7365722e707567782e6f72672f62616e6b6972752f73656f2d656e67696e652f6c6963656e7365)](https://packagist.org/packages/bankiru/seo-engine)

[![Build Status](https://camo.githubusercontent.com/6721fd1ca751e46f9d42a4e5d336bf48dfbd46302925cf15342dcae509833dd8/68747470733a2f2f7472617669732d63692e6f72672f62616e6b6972752f73656f2d656e67696e652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bankiru/seo-engine)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/b83ecce20b8390324580738931a98f0d1253ffc6bbd2ac04f59de76cdd7f7ccd/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616e6b6972752f73656f2d656e67696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bankiru/seo-engine/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/0bad70a49b8c2abae10379d04b4bfdb1c6fc087d20fb6de09e69174cfaa27495/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f62616e6b6972752f73656f2d656e67696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/bankiru/seo-engine/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/0daca9c592d315e05d635ed75f7081ff6ff55345590b3f76889561ab17d60e02/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f37376663306562392d643261642d343866312d383432642d3364363236663331353032342f6d696e692e706e67)](https://insight.sensiolabs.com/projects/77fc0eb9-d2ad-48f1-842d-3d626f315024)

Banki.ru SEO Engine
===================

[](#bankiru-seo-engine)

General purpose SEO library for standalone usage (Symfony DI included)

Purpose
-------

[](#purpose)

- Processing general SEO data
- SEO links generation
- Sitemap generation

Installation
------------

[](#installation)

```
composer require bankiru/seo-engine:~1.0
```

Terminology
-----------

[](#terminology)

### Matching

[](#matching)

- **Destination** — is a route identifier and set of concrete entities indexed by placeholder codes
- Complete **TargetSpace** — is a set of all possible destinations for the given route identifier
- **Condition** — a binary predicate, can return **Destination** weight on successful match
- **TargetSpaceDefinition** — is a (sub)set of complete **TargetSpace**, defined by a set of **Conditions**

### Generation

[](#generation)

- **Source** — is any countable and iterable source of entities, which could be filtered with **Condition**
- **Filler** — (in general) function that infers missing values into **Destination**

Usage
-----

[](#usage)

### Standalone

[](#standalone)

For general standalone usage you have to implement (or use out-of-the-box static collection implementations) three services:

- **Destination** - An item to match by SEO engine
- **TargetDefinitionRepositoryInterface** - A source of **TargetSpaces** indexed by routes
- **PageRepositoryInterface** - Matcher of **SeoPageInterface** by matched **TargetSpace** and initial **Destination**

#### Generic flow

[](#generic-flow)

```
// Instantiate TargetRepository
$targetRepository = new StaticTargetRepository();
// Fill it with $targetRepository->add($target);

// Instantiate PageRepository
$pageRepository = new StaticPageRepository();
// Fill page pairs with $pageRepository->add($target, $page);

// Instantiate target sorter
$sorter = new MatchScoreTargetSorter($targetRepository);
// Instantiate matcher

$matcher = new DestinationMatcher($sorter, $pageRepository);
// Create the destination to match
// The general approach is to hook into request processing and create it
// from incoming HTTP request

$destination = new Destination(
    '/blog/articles/123',
    [
        'page_id' => 123,
        'language' => 'en',
        'category' => 'programming'
    ]
);

// Obtain matching SEO page for destination. Or handle a matching exception

try {
  $page = $matcher->match($destination);
} catch (MatchingException $e) {
  // you probably also wan't to set proper headers here
  echo "Not found";
  exit();
}

// Do whatether you want to render $page as HTML response properly.
```

### Symfony integration

[](#symfony-integration)

This library has built-in integration into symfony request processing flow and DI, so the kernel takes the most of the work above for you

```
public function someAction(Request $request) {
    $destination = RequestDestinationFactory::createFromRequest($requset)
    $matcher = $container->get('bankiru.seo.matcher');

    try {
      $page = $matcher->match($destination);
    } catch (MatchingException $e) {
      throw $this->createNotFoundException();
    }

    return ['page'=>$page];
}
```

If you define `options: {seo: true}` for your route, then you can obtain SEO page immediately with following signature

```
public function someAction(SeoPageInterface $_seo_page)
{
   return ['page'=>$page];
}
```

This will throw an exception for you automatically.

Configuration
-------------

[](#configuration)

### Routing

[](#routing)

Configure route options like following

```
my_route:
    resources: routes.yml
    options:
        seo: true
```

To enable listeners for this route

Integrations
------------

[](#integrations)

### Local static matching

[](#local-static-matching)

To bootstrap data configuration there is a local implementation of necessary interface, which allows to start using the library immediately pre-filling the repositories from init\\config code.

### Doctrine ORM matching

[](#doctrine-orm-matching)

You can implement the necessary interfaces ontop of your entity repositories. Make sure the entities implement required interfaces (target, condition, etc)

### Link generation

[](#link-generation)

In order to use link generation ability, you have to define two

- Fill source registry with `SourceInterface` entities indexed by alias
- Create Link compiler which can forge a url using the route identifier from link and the destination items as `Sluggable`s

As a part of Symfony integration where is the `SymfonyRouterCompiler`which uses the `UrlGenerator` to compile the link reference

Extensions
----------

[](#extensions)

You can override, decorate and replace the following extension points to tune your SEO processing experience

### Matching

[](#matching-1)

- `TargetRepositoryInterface` - finds the all matching targets for given route
- `TargetSorter` - chooses single target from all fetched above by matching with destination
- `PageRepositoryInterface` - finds the SEO page for target and destination

### Generation

[](#generation-1)

- `DestinationNormalizer` - converts your entity into string for slug generation. `SluggableNormalizer` normalizer is the primary option for objects, `ScalarNormalizer` is used for all the scalars
- `DestinationCompiler` - forges your destination into the link (href, title and attributes). `SymfonyRouterCompiler` is the primary default option if symfony available
- `SourceInterface` - source of the data to create destinations. No default option, `CollectionSource` is the built-in one
- `SourceFiller` - extend missing entries in destination from source-generated values. Not required, thus no defaults

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.3% 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 ~2 days

Total

2

Last Release

3379d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ed906771163ff68cfb365bdd3b8278a3ce1b464f94051ff7ab50c03a30110efe?d=identicon)[scaytrase](/maintainers/scaytrase)

---

Top Contributors

[![scaytrase](https://avatars.githubusercontent.com/u/6578413?v=4)](https://github.com/scaytrase "scaytrase (14 commits)")[![hanovruslan](https://avatars.githubusercontent.com/u/1153520?v=4)](https://github.com/hanovruslan "hanovruslan (1 commits)")

---

Tags

seosymfony

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bankiru-seo-engine/health.svg)

```
[![Health](https://phpackages.com/badges/bankiru-seo-engine/health.svg)](https://phpackages.com/packages/bankiru-seo-engine)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.5k5.8M712](/packages/sylius-sylius)[api-platform/doctrine-common

Common files used by api-platform/doctrine-orm and api-platform/doctrine-odm

243.9M41](/packages/api-platform-doctrine-common)[akeneo/pim-community-dev

Akeneo PIM, the future of catalog management is open!

1.0k620.8k86](/packages/akeneo-pim-community-dev)[oat-sa/tao-core

TAO core extension

66140.1k108](/packages/oat-sa-tao-core)[roave/psr-container-doctrine

Doctrine Factories for PSR-11 Containers

99803.8k21](/packages/roave-psr-container-doctrine)[sylius/promotion

Flexible promotion management for PHP applications.

28495.4k13](/packages/sylius-promotion)

PHPackages © 2026

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