Download the PHP package klako/mocknet without Composer
On this page you can find all versions of the php package klako/mocknet. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download klako/mocknet
More information about klako/mocknet
Files in klako/mocknet
Informations about the package mocknet
Mocknet
Mocknet is a light weight replica of the scoutnet api using fake data for testing environment.
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
Running the app
There are three ways to run the app.
Using Scouterna\Mocknet\PhpServer
The following code will start an internal php web server on the host's specified address and port.
Using Scouterna\Mocknet\ServerApp
The following code will run the app if you want to run it programmatically within your existing one.
Using server.php
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 folderMOCKNET_DBPARAMS
A base64 encoded json object with the database parametersMOCKNET_GROUP_ID
The group id to be required in the api callsMOCKNET_API_KEY
The api key to be required in the api calls
Generating and reading the database
In order to simply generate a group, run the generator.php file with the following environment variables.
MOCKNET_VENDOR_FOLDER
Path to the composer vendor folderMOCKNET_DBPARAMS
A base64 encoded json object with the database parametersMOCKNET_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.
All versions of mocknet with dependencies
ext-mbstring Version *
php Version >=7.3
symfony/process Version ^5.0
slim/slim Version ^4.4
slim/psr7 Version ^1.0
tuupola/slim-basic-auth Version ^3.2
fzaninotto/faker Version ^1.9
doctrine/orm Version ^2.9.2
symfony/cache Version ^5.3
doctrine/annotations Version ^1.13