PHPackages                             klako/mocknet - 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. klako/mocknet

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

klako/mocknet
=============

En replika av Scoutnet.

v0.3(4y ago)23[9 issues](https://github.com/Klako/mocknet/issues)[3 PRs](https://github.com/Klako/mocknet/pulls)MITPHPPHP &gt;=7.3

Since Sep 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/Klako/mocknet)[ Packagist](https://packagist.org/packages/klako/mocknet)[ RSS](/packages/klako-mocknet/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (9)Versions (8)Used By (0)

Mocknet
=======

[](#mocknet)

Mocknet is a light weight replica of the scoutnet api using fake data for testing environment.

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

[](#installation)

Install the package using composer with `composer require klako/mocknet`

The package requires some database that is compatible with Doctrine, such as sqlite or mysql. Parameters for creating a database connection can be found in the [doctrine docs](https://www.doctrine-project.org/projects/doctrine-dbal/en/2.13/reference/configuration.html#configuration)

Running the app
---------------

[](#running-the-app)

There are three ways to run the app.

### Using [`Scouterna\Mocknet\PhpServer`](src/PhpServer.php)

[](#using-scouternamocknetphpserver)

The following code will start an internal php web server on the host's specified address and port.

```
$server = new Scouterna\Mocknet\PhpServer(
    "localhost",
    "8080",
    $databaseParams, // parameters for the database connection as specified above
    444, // The group id to be required in the api calls
    "abcdefghikjlmn" // The api key to be required in the api calls
);
$server->start();
```

### Using [`Scouterna\Mocknet\ServerApp`](src/ServerApp.php)

[](#using-scouternamocknetserverapp)

The following code will run the app if you want to run it programmatically within your existing one.

```
Scouterna\Mocknet\ServerApp::run(
    $connection, // A Doctrine\DBAL\Connection or parameters for the database connection
    444, // The group id to be required in the api calls
    "abcdefghikjlmn" // The api key to be required in the api calls
);
```

### Using [server.php](src/server.php)

[](#using-serverphp)

The server.php file can be used as an entry point for a web server.

The following environment variables must be specified.

- `MOCKNET_VENDOR_FOLDER` Path to the composer vendor folder
- `MOCKNET_DBPARAMS` A base64 encoded json object with the database parameters
- `MOCKNET_GROUP_ID` The group id to be required in the api calls
- `MOCKNET_API_KEY` The api key to be required in the api calls

Generating and reading the database
-----------------------------------

[](#generating-and-reading-the-database)

In order to simply generate a group, run the [generator.php](src/generator.php) file with the following environment variables.

- `MOCKNET_VENDOR_FOLDER` Path to the composer vendor folder
- `MOCKNET_DBPARAMS` A base64 encoded json object with the database parameters
- `MOCKNET_GROUP_ID` The group id of the generated group

In order to create a manager for reading as well as writing to the database, use the `Scouterna\Mocknet\Database\ManagerFactory` class. The namespace `Scouterna\Mocknet\Database\Model` contains all entities that are used by the manager and the api.

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity40

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

Every ~63 days

Total

4

Last Release

1511d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/28c447b86c67b713d5e9e7e25f563b58c5c2bd4045f4c66f32421c20e95d2653?d=identicon)[Klako](/maintainers/Klako)

---

Top Contributors

[![Klako](https://avatars.githubusercontent.com/u/4390016?v=4)](https://github.com/Klako "Klako (54 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/klako-mocknet/health.svg)

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

###  Alternatives

[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[shlinkio/shlink

A self-hosted and PHP-based URL shortener application with CLI and REST interfaces

4.8k4.3k](/packages/shlinkio-shlink)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

7310.3k29](/packages/open-dxp-opendxp)[hostnet/entity-tracker-component

Provides an event when a Tracked entity changes

16158.1k4](/packages/hostnet-entity-tracker-component)

PHPackages © 2026

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