PHPackages                             keevitaja/language-detector-socket - 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. keevitaja/language-detector-socket

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

keevitaja/language-detector-socket
==================================

A high-performance PHP language detection service using Unix sockets and Efficient Language Detector.

v0.0.5(6mo ago)111MITPHP

Since Oct 18Pushed 6mo agoCompare

[ Source](https://github.com/keevitaja/language-detector-socket)[ Packagist](https://packagist.org/packages/keevitaja/language-detector-socket)[ RSS](/packages/keevitaja-language-detector-socket/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (6)Used By (0)

Language Detector Socket
========================

[](#language-detector-socket)

A high-performance language detection service written in PHP using Unix sockets and [Efficient Language Detector](https://github.com/nitotm/efficient-language-detector).

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

[](#installation)

```
composer require keevitaja/language-detector-socket
```

Important

**Enable OPcache for CLI** to avoid excessive CPU usage. The LanguageDetector library loads and compiles large language model data files on every request. Without OPcache, PHP will recompile these files repeatedly, causing significant CPU overhead.

```
opcache.enable_cli=1
```

Usage
-----

[](#usage)

### Start the Server

[](#start-the-server)

```
use Keevitaja\LanguageDetectorSocket\Server;

$server = new Server([
    'socket' => '/tmp/language-detector.sock',
]);

$server->run();
```

### Use the Client

[](#use-the-client)

```
use Keevitaja\LanguageDetectorSocket\Client;

$client = new Client([
    'socket' => '/tmp/language-detector.sock',
])->make();

$scores = $client->detect('Hello world');
// ['en' => 0.95, 'nl' => 0.03, ...]

$client->close();
```

Configuration defaults
----------------------

[](#configuration-defaults)

```
[
    // Unix socket path
    'socket' => '/tmp/language.detector.sock',

    // Number of worker processes
    'processes' => 1,

    // Connection timeout in seconds
    'timeout' => 10,

    // Limit detection to specific languages (null = all or ['en', 'nl'])
    'locales' => null,

    // Language model size (SMALL, MEDIUM, LARGE)
    'eldDataFile' => EldDataFile::SMALL,

    // Language code format (ISO639_1, ISO639_3)
    'eldFormat' => EldFormat::ISO639_1,

    // Path to store the worker process ID file
    'workerPidFile' => '/tmp/language.detector.worker.pid',

    // Path to store the worker log file
    'workerLogFile' => '/tmp/language.detector.worker.log',

    // Path to store the worker an stdout log file
    'workerStdoutFile' => '/tmp/language.detector.worker.stdout.log',

    // Whether to run the worker as a daemon process
    'workerDemonize' => false,
]
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance66

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity29

Early-stage or recently created project

 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 ~2 days

Total

5

Last Release

204d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/095d59168b7cb0cf90ecb948c3e7de7a58e1528e7a19759a628ea15db65f3b72?d=identicon)[keevitaja](/maintainers/keevitaja)

---

Top Contributors

[![keevitaja](https://avatars.githubusercontent.com/u/158787?v=4)](https://github.com/keevitaja "keevitaja (5 commits)")

---

Tags

languagedetectordetectionlanguage detectorlanguage identificationlanguage detectionlanguage recognitionlanguage classification

### Embed Badge

![Health badge](/badges/keevitaja-language-detector-socket/health.svg)

```
[![Health](https://phpackages.com/badges/keevitaja-language-detector-socket/health.svg)](https://phpackages.com/packages/keevitaja-language-detector-socket)
```

###  Alternatives

[nitotm/efficient-language-detector

Fast and accurate natural language detection. Detector written in PHP. Nito-ELD, ELD.

59252.9k6](/packages/nitotm-efficient-language-detector)[phpoption/phpoption

Option Type for PHP

2.7k541.2M159](/packages/phpoption-phpoption)[patrickschur/language-detection

A language detection library for PHP. Detects the language from a given text string.

8513.2M18](/packages/patrickschur-language-detection)[shipmonk/composer-dependency-analyser

Fast detection of composer dependency issues (dead dependencies, shadow dependencies, misplaced dependencies)

6076.7M435](/packages/shipmonk-composer-dependency-analyser)[landrok/language-detector

A fast and reliable PHP library for detecting languages

132647.0k3](/packages/landrok-language-detector)[tivie/php-os-detector

A small utility library that detects the OS the server is running on

201.6M11](/packages/tivie-php-os-detector)

PHPackages © 2026

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