百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

marko

> 编程语言
开源

模块化的 PHP 框架。

393 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

模块化的 PHP 框架。

██      ██   ██████   ██████    ██   ██   ██████
████  ████  ██    ██  ██   ██   ██  ██   ██    ██
██ ████ ██  ████████  ██████    █████    ██    ██
██  ██  ██  ██    ██  ██   ██   ██  ██   ██    ██
██      ██  ██    ██  ██    ██  ██   ██   ██████

Enterprise-grade extensibility meets modern PHP.

Override anything. Intercept any method. Extend any module — all without touching vendor code.

Documentation, guides, and tutorials at marko.build/docs.

Why Marko?

Rapid-development frameworks are great — until you need to customize a third-party module. Enterprise frameworks let you override anything, but demand months of learning.

Marko bridges the gap.

Magento's deep extensibility + Laravel's developer experience + loud, helpful errors.

Marko is a modular PHP 8.5+ framework where everything is a module: your app code, third-party packages, …even the framework. All integration areas follow the same structure and rules. Later modules always win, so your app layer cleanly overrides vendor without patches, forks, or hacks.

What makes Marko different

  • True modularity — Interface and implementation are always separate. Swap any driver (database, cache, mail, queue) without touching a line of application code.
  • Preferences — Remap any interface to your own implementation, framework-wide. One line of config replaces an entire class.
  • Plugins — Intercept any public method with before and after hooks. Modify inputs, transform outputs, or add behavior — all without inheritance.
  • PHP-native configuration — No XML. No YAML. Every route, binding, and plugin is defined in PHP, including full IDE autocompletion and ::class constants.
  • Attribute-driven — Routes, plugins, observers, layouts, commands, and more are declared with PHP attributes. Discovery is automatic.
  • Loud errors — No silent failures. When something goes wrong, Marko tells you exactly what happened, where, and how to fix it.

Watch the Introduction

Learn what Marko is, why it exists, and how it works in this short video overview. Introducing Marko: The Truly Modular PHP Framework

Quick Start

bash
composer create-project marko/skeleton my-app
cd my-app

Register your first module in app/hello/composer.json:

json
{
    "name": "app/hello",
    "autoload": {
        "psr-4": {
            "App\\Hello\\": "src/"
        }
    },
    "extra": {
        "marko": {
            "module": true
        }
    }
}

Create a controller at app/hello/src/Controller/HelloController.php:

php
 [
        PaymentProcessorInterface::class => MyCustomPaymentProcessor::class,
    ],
];

Plugins — Intercept any public method:

php
#[Plugin(target: OrderService::class)]
class OrderPlugin
{
    #[Before]
    public function place(Order $order): null
    {
        // Runs before OrderService::place() — method name matches target
        return null;
    }
}

#[Plugin(target: OrderService::class)]
class OrderAuditPlugin
{
    #[After(method: 'place')]
    public function auditPlace(OrderResult $result, Order $order): OrderResult
    {
        // Custom method name — `method` param maps it to OrderService::place()
        return $result;
    }
}

Observers — React to system events:

php
#[Observer(event: OrderPlaced::class)]
class SendOrderNotification
{
    public function handle(OrderPlaced $event): void
    {
        // Decoupled, event-driven logic
    }
}

Packages

Marko ships as composable packages — require only what you need. Every package follows an interface/implementation split, so you can swap drivers without changing application code.

Core

Package Description
core DI container, module discovery, bootstrap, plugin & preference systems
config PHP-native configuration with dot-notation access
env Environment variable loading
routing Attribute-based HTTP routing with conflict detection
roadrunner RoadRunner application server driver
cli Console command system with attribute-driven discovery
framework Full-stack metapackage for rapid setup

Database

Package Description
database Database abstraction, migrations, entity management
database-pgsql PostgreSQL driver
database-mysql MySQL driver
database-readwrite Read/write connection splitting

Caching

Package Description
cache Cache contracts and manager
cache-array In-memory cache (testing)
cache-file Filesystem cache driver
cache-redis Redis cache driver

Full-Page Caching

Package Description
page-cache Full-page HTTP cache contracts and middleware
page-cache-file File-based page cache driver
page-cache-entity Auto-purge page cache tags on entity save/delete

Session

Package Description
session Session contracts and manager
session-file File-based sessions
session-database Database-backed sessions

Mail

Package Description
mail Mail contracts and manager
mail-log Log driver (development)
mail-smtp SMTP driver

Queue

Package Description
queue Queue contracts and manager
queue-sync Synchronous driver (development)
queue-database Database-backed queue
queue-rabbitmq RabbitMQ driver

Logging

Package Description
log PSR-3 logging contracts
log-file File-based log driver

Views, Templates & Layout

Package Description
view View contracts and template resolution
view-latte Latte template engine integration
view-twig Twig template engine integration
layout Attribute-driven layout system with slot-based component composition

Error Handling

Package Description
errors Error handling contracts
errors-simple Minimal error handler
errors-advanced Rich error pages with stack traces

HTTP

Package Description
http HTTP client contracts
http-guzzle Guzzle HTTP driver

Filesystem

Package Description
filesystem Filesystem contracts
filesystem-local Local filesystem driver
filesystem-s3 Amazon S3 driver

Encryption

Package Description
encryption Encryption contracts
encryption-openssl OpenSSL driver

Media

Package Description
media Image processing contracts
media-gd GD driver
media-imagick ImageMagick driver

Pub/Sub & Real-Time

Package Description
pubsub Pub/Sub contracts
pubsub-pgsql PostgreSQL LISTEN/NOTIFY driver
pubsub-redis Redis Pub/Sub driver
sse Server-Sent Events
amphp Async foundation with AMPHP

Security & Access Control

Package Description
authentication Guard-based authentication
authentication-token Token/API authentication
authorization Policy-based authorization
hashing Password hashing
security Security utilities and middleware
cors Cross-Origin Resource Sharing
ratelimiter Request rate limiting

Admin

Package Description
admin Admin panel foundation
admin-auth Admin authentication
admin-api Admin REST API
admin-panel Admin UI panel
admin-panel-latte Latte templates for admin panel
admin-panel-twig Twig templates for admin panel

Utilities

Package Description
api REST API foundation
validation Input validation
pagination Query result pagination
notification Notification contracts
notification-database Database notification driver
translation Translation contracts
translation-file File-based translations
search Search abstraction
scheduler Task scheduling
health Health check endpoints
webhook Webhook handling
devserver Local development server
debugbar Development debugbar and request profiler

Frontend & Build

Package Description
vite Vite integration — asset manifest resolution and dev-server detection
inertia Inertia.js protocol — middleware, response factory, shared data, SSR
inertia-react React frontend marker binding for Inertia
inertia-svelte Svelte frontend marker binding for Inertia
inertia-vue Vue 3 frontend marker binding for Inertia

Documentation

Package Description
docs Documentation search contracts
docs-markdown Canonical Marko documentation content
docs-fts FTS5 lexical search driver for documentation

AI-Assisted Development

Package Description
[devai](packages/dev

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

PHPphpphp-frameworkphp8

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言