PHPackages                             eliasis-framework/license-handler - 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. [Framework](/categories/framework)
4. /
5. eliasis-framework/license-handler

AbandonedArchivedEliasis-plugin[Framework](/categories/framework)

eliasis-framework/license-handler
=================================

Licensing and applications manager.

1.0.0(8y ago)6161MITPHPPHP ^5.6 || ^7.0

Since Mar 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/eliasis-framework/license-handler)[ Packagist](https://packagist.org/packages/eliasis-framework/license-handler)[ RSS](/packages/eliasis-framework-license-handler/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (11)Versions (1)Used By (0)

License Handler · Eliasis PHP Framework plugin
==============================================

[](#license-handler--eliasis-php-framework-plugin)

[![Packagist](https://camo.githubusercontent.com/01e640766cf599dc1d6f16f747c71349ee98f18ce4fb5e01e0791d2bd670c9d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f656c69617369732d6672616d65776f726b2f6c6963656e73652d68616e646c65722e737667)](https://packagist.org/packages/eliasis-framework/license-handler)[![License](https://camo.githubusercontent.com/ddae47feb4cef58a4e0b16175e0edf11d2ff79310c4c838d80a5ba7911676b17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f656c69617369732d6672616d65776f726b2f6c6963656e73652d68616e646c65722e737667)](https://github.com/eliasis-framework/license-handler/blob/master/LICENSE)

[Versión en español](README-ES.md)

Licensing and applications manager.

---

- [Requirements](#requirements)
- [Installation](#installation)
- [Available Methods](#available-methods)
- [Quick Start](#quick-start)
- [Usage](#usage)
- [Database](#database)
- [Tests](#tests)
- [Sponsor](#Sponsor)
- [License](#license)

---

Requirements
------------

[](#requirements)

This plugin is supported by **PHP versions 5.6** or higher and is compatible with **HHVM versions 3.0** or higher.

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

[](#installation)

The preferred way to install this extension is through [Composer](http://getcomposer.org/download/).

To install **License Handler**, simply:

```
composer require eliasis-framework/license-handler

```

The previous command will only install the necessary files, if you prefer to **download the entire source code** you can use:

```
composer require eliasis-framework/license-handler --prefer-source

```

You can also **clone the complete repository** with Git:

```
git clone https://github.com/eliasis-framework/license-handler.git

```

Available Methods
-----------------

[](#available-methods)

Available methods in this plugin:

### Applications

[](#applications)

#### - Add application

[](#--add-application)

```
$application->add($name, $type, $category, $active);
```

AtttributeDescriptionTypeRequired$nameApplication name.stringYes$typeApplication type.stringYes$categoryApplication category.stringYes$activeApplication state.booleanYes**@return** (int) → Application inserted ID.

#### - Update application

[](#--update-application)

```
$application->update($id, $name, $type, $category, $active);
```

AtttributeDescriptionTypeRequired$idApplication ID.stringYes$nameApplication name.stringYes$typeApplication type.stringYes$categoryApplication category.stringYes$activeApplication state.booleanYes**@return** (int) → Rows affected.

### Sites

[](#sites)

#### - Add site

[](#--add-site)

```
$site->add($domain, $host, $ip, $authorized);
```

AtttributeDescriptionTypeRequired$domainSite domain.stringYes$hostSite host.stringYes$ipSite ip.stringYes$authorizedAuthorized?.booleanYes**@return** (int) → Site inserted ID.

#### - Update site

[](#--update-site)

```
$site->update($id, $domain, $host, $ip, $authorized);
```

AtttributeDescriptionTypeRequired$idSite ID.stringYes$domainSite domain.stringYes$hostSite host.stringYes$ipSite ip.stringYes$authorizedAuthorized?.booleanYes**@return** (int) → Rows affected.

### License

[](#license)

#### - Generate license key

[](#--generate-license-key)

```
$license->generateKey($characters, $segments);
```

AtttributeDescriptionTypeRequiredDefault$charactersCharacters number by segments.intNo5$segmentsSegments number.intNo5**@return** (string) → License key.

#### - Add license

[](#--add-license)

```
$license->add($appID, $siteID, $key, $state, $expire);
```

AtttributeDescriptionTypeRequired$appIDApplication table id.intYes$siteIDSite table id.intYes$keyLicense key.stringYes$stateLicense state.boolYes$expireLicense expiration date.stringYes**@return** (int) → License inserted ID.

#### - Update license

[](#--update-license)

```
$license->update($id, $appID, $siteID, $key, $state, $expire);
```

AtttributeDescriptionTypeRequired$idLicense ID.stringYes$appIDApplication table id.intYes$siteIDSite table id.intYes$keyLicense key.stringYes$stateLicense state.boolYes$expireLicense expiration date.stringYes**@return** (int) → Rows affected.

#### - Check if license exists

[](#--check-if-license-exists)

```
$license->keyExists($license);
```

AtttributeDescriptionTypeRequired$licenseLicense key.stringYes**@return** (boolean)

### Options

[](#options)

#### - Add option

[](#--add-option)

```
$option->add($licenseID, $name, $value);
```

AtttributeDescriptionTypeRequired$licenseIDLicense table id.stringYes$nameOption name.stringYes$valueOption value.stringYes**@return** (int) → Option inserted ID.

#### - Update option

[](#--update-option)

```
$option->update($id, $licenseID, $name, $value);
```

AtttributeDescriptionTypeRequired$idOption ID.stringYes$licenseIDLicense table id.stringYes$nameOption name.stringYes$valueOption value.stringYes**@return** (int) → Rows affected.

Quick Start
-----------

[](#quick-start)

To use this plugin, your [Eliasis application](https://github.com/eliasis-framework/eliasis) must use the [PHP-Database](https://eliasis-framework.github.io/eliasis/v1.1.3/lang/en/#libraries-Database) library and add the following to the application configuration files:

```
/**
 * eliasis-app/config/complements.php
 */
return [

    'plugin' => [

        'license-handler' => [

            'db-id' => 'app',
            'db-prefix' => 'test_',
            'db-charset' => 'utf8',
            'db-engine' => 'innodb'
        ],
    ],
];
```

And get the instances from each table:

```
use Eliasis\Complement\Type\Plugin;

$site = Plugin::WP_Plugin_Info()->getControllerInstance('Site');
$option = Plugin::WP_Plugin_Info()->getControllerInstance('Option');
$license = Plugin::WP_Plugin_Info()->getControllerInstance('License);
$application = Plugin::WP_Plugin_Info()->getControllerInstance('Application');
```

Usage
-----

[](#usage)

### Applications

[](#applications-1)

#### - Add application

[](#--add-application-1)

```
$appID = $application->add('app-name', 'plugin', 'WordPress', 1);
```

#### - Update application

[](#--update-application-1)

```
$application->update($appID, 'new-app-name', 'module', 'Prestashop', 1);
```

### Sites

[](#sites-1)

#### - Add site

[](#--add-site-1)

```
$siteID = $site->add(
 'domain.com',
 'host.domain.com',
 '87.142.85.70', 1
);
```

#### - Update site

[](#--update-site-1)

```
$site->update(
 $siteID,
 'new-domain.com',
 'host.new-domain.com',
 '87.142.85.70', 1
);
```

### License

[](#license-1)

#### - Generate license key

[](#--generate-license-key-1)

```
$license = $license->generateKey(); // 3FGSV-BZ49N-U79EA-S96ZY-MFQ63

$license = $license->generateKey(5, 5); // 3FGSV-BZ49N-U79EA-S96ZY-MFQ63

$license = $license->generateKey(4, 4); // 3FGS-BZ4N-U7EA-S9ZY

$license = $license->generateKey(6, 5); // SF4W2H-FEJKZ5-PU7KAD-N77486-BKMJSW

$license = $license->generateKey(4, 2); // FT3Q-EBT5
```

#### - Add license

[](#--add-license-1)

```
$licenseID = $license->add(1, 1, $key, $license, '+1day');

$licenseID = $license->add(1, 1, $key, $license, '+10days');

$licenseID = $license->add(1, 1, $key, $license, '+1week');

$licenseID = $license->add(1, 1, $key, $license, '+1month');

$licenseID = $license->add(1, 1, $key, $license, '+2months');

$licenseID = $license->add(1, 1, $key, $license, '+1year');

$licenseID = $license->add(1, 1, $key, $license, '+2years');
```

#### - Update license

[](#--update-license-1)

```
$license->update(1, 1, $key, $license, '+3weeks');
```

#### - Check if license exists

[](#--check-if-license-exists-1)

```
$license->keyExists('SF4W2H-FEJKZ5-PU7KAD-N77486-BKMJSW');
```

### Options

[](#options-1)

#### - Add option

[](#--add-option-1)

```
$option->add($licenseID, 'lang', 'es-ES');
```

#### - Update option

[](#--update-option-1)

```
$option->update($id, $licenseID, 'lang', 'en-EN');
```

Database
--------

[](#database)

This plugin will create the following tables.

### - test\_applications

[](#--test_applications)

The table structure created is as follows:

ColumnsData typeapp\_idINT(9)app\_nameVARCHAR(80)app\_typeVARCHAR(80)app\_categoryVARCHAR(80)app\_stateINT(1)updatedTIMESTAMPcreatedTIMESTAMP### - test\_sites

[](#--test_sites)

The table structure created is as follows:

ColumnsData typesite\_idINT(9)site\_domainVARCHAR(255)site\_hostVARCHAR(255)site\_ipVARCHAR(1)site\_authorizedINT(1)updatedTIMESTAMPcreatedTIMESTAMP### - test\_licenses

[](#--test_licenses)

The table structure created is as follows:

ColumnsData typelic\_idINT(9)app\_idINT(9)site\_idINT(9)lic\_keyVARCHAR(29)lic\_stateINT(1)lic\_expireDATETIMEsite\_authorizedINT(1)updatedTIMESTAMPcreatedTIMESTAMP### - test\_options

[](#--test_options)

The table structure created is as follows:

ColumnsData typeoption\_idINT(9)lic\_idINT(9)option\_nameVARCHAR(180)option\_valueLONGTEXTTests
-----

[](#tests)

To run [tests](tests) you just need [composer](http://getcomposer.org/download/) and to execute the following:

```
git clone https://github.com/eliasis-framework/license-handler.git

cd license-handler

composer install

```

Run unit tests with [PHPUnit](https://phpunit.de/):

```
composer phpunit

```

Run [PSR2](http://www.php-fig.org/psr/psr-2/) code standard tests with [PHPCS](https://github.com/squizlabs/PHP_CodeSniffer):

```
composer phpcs

```

Run [PHP Mess Detector](https://phpmd.org/) tests to detect inconsistencies in code style:

```
composer phpmd

```

Run all previous tests:

```
composer tests

```

Sponsor
-------

[](#sponsor)

If this project helps you to reduce your development time, [you can sponsor me](https://github.com/josantonius#sponsor) to support my open source work 😊

License
-------

[](#license-2)

This repository is licensed under the [MIT License](LICENSE).

Copyright © 2017-2022, [Josantonius](https://github.com/josantonius#contact)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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

2997d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/4b221283501ec8a9cbaefaf27821a91ae8ddd33bddf1fccc6c6815b7ad216ff1?d=identicon)[Josantonius](/maintainers/Josantonius)

---

Top Contributors

[![josantonius](https://avatars.githubusercontent.com/u/18104336?v=4)](https://github.com/josantonius "josantonius (7 commits)")

---

Tags

phpphpframeworkEliasishmvcEliasis pluginLicense Handler

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/eliasis-framework-license-handler/health.svg)

```
[![Health](https://phpackages.com/badges/eliasis-framework-license-handler/health.svg)](https://phpackages.com/packages/eliasis-framework-license-handler)
```

###  Alternatives

[fuel/fuel

FuelPHP is a simple, flexible, community driven PHP 5.4+ framework, based on the best ideas of other frameworks, with a fresh start!

1.5k42.3k](/packages/fuel-fuel)[dframe/dframe

PHP Framework - Dframe

136.4k4](/packages/dframe-dframe)

PHPackages © 2026

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