ledc/mark

a PHP API micro framework based on workerman

Maintainers

👁 ledccn

Package info

github.com/ledccn/micro-mark

pkg:composer/ledc/mark

Statistics

Installs: 4

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2023-10-09 02:06 UTC

Requires

Requires (Dev)

None

Suggests

  • ext-event: For better performance.

Provides

None

Conflicts

None

Replaces

None

MIT bcb01c407e71263f58106722165757bf3cf7b74e

This package is not auto-updated.

Last update: 2026-06-18 16:01:50 UTC


README

Mark is a high performance API micro framework based on FastRoute and workerman helps you quickly write APIs with php. It is so simple that the core codes is only about 200 lines.

Install

It's recommended that you use Composer to install Mark.

composer require ledc/mark

Usage

start.php

<?php
use Ledc\Mark\App;

require 'vendor/autoload.php';

$api = new App('http://0.0.0.0:3000');

$api->count = 4; // process count

$api->any('/', function ($requst) {
 return 'Hello world';
});

$api->get('/hello/{name}', function ($requst, $name) {
 return "Hello $name";
});

$api->post('/user/create', function ($requst) {
 return json_encode(['code'=>0 ,'message' => 'ok']);
});

$api->start();

Run command php start.php start -d

Going to http://127.0.0.1:3000/hello/world will now display "Hello world".

Benchmark

https://github.com/the-benchmarker/web-frameworks#results

Available commands

php start.php restart -d
php start.php stop
php start.php status
php start.php connections

License

The Mark Framework is licensed under the MIT license. See License File for more information.