PHPackages                             witals/app - 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. witals/app

ActiveProject

witals/app
==========

103PHP

Since Jan 28Pushed 5mo agoCompare

[ Source](https://github.com/puleeno/witals-app)[ Packagist](https://packagist.org/packages/witals/app)[ RSS](/packages/witals-app/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

Witals Framework
================

[](#witals-framework)

Framework PHP hiện đại có thể chạy song song trên cả **RoadRunner** và **Traditional Web Server** (Apache, Nginx, PHP Built-in Server).

✨ Tính năng
-----------

[](#-tính-năng)

- 🚀 **Dual Runtime Support**: Chạy trên cả RoadRunner và traditional web servers
- ⚡ **High Performance**: Tận dụng RoadRunner worker pool để tăng hiệu suất
- 🔄 **Hot Reload**: Tự động reload khi code thay đổi (RoadRunner mode)
- 📊 **Metrics**: Built-in metrics endpoint
- 🎯 **PSR-7 Compatible**: Hỗ trợ PSR-7 HTTP messages
- 🛠️ **Environment Detection**: Tự động detect và tối ưu cho từng môi trường

📋 Yêu cầu
---------

[](#-yêu-cầu)

- PHP &gt;= 8.1
- Composer
- (Optional) RoadRunner binary

🚀 Cài đặt
---------

[](#-cài-đặt)

### 1. Clone và cài đặt dependencies

[](#1-clone-và-cài-đặt-dependencies)

```
composer install
```

### 2. Cấu hình environment

[](#2-cấu-hình-environment)

```
cp .env.example .env
```

### 3. Download RoadRunner binary (nếu muốn dùng RoadRunner)

[](#3-download-roadrunner-binary-nếu-muốn-dùng-roadrunner)

```
composer rr:download
```

🎯 Sử dụng
---------

[](#-sử-dụng)

### Chạy với RoadRunner (Khuyến nghị cho production)

[](#chạy-với-roadrunner-khuyến-nghị-cho-production)

```
# Development mode với hot reload
composer rr:serve:dev

# Production mode
composer rr:serve
```

Truy cập:

### Chạy với PHP Built-in Server

[](#chạy-với-php-built-in-server)

```
composer serve
```

Truy cập:

### Chạy với Apache/Nginx

[](#chạy-với-apachenginx)

1. Point document root đến thư mục `public/`
2. Đảm bảo `.htaccess` được enable (Apache) hoặc cấu hình nginx rewrite rules
3. Truy cập qua domain/virtual host của bạn

📁 Cấu trúc thư mục
------------------

[](#-cấu-trúc-thư-mục)

```
witals-app/
├── app/                    # Application code
│   ├── Application.php     # Core application class
│   ├── Contracts/          # Interfaces
│   └── Http/               # HTTP layer
│       ├── Kernel.php      # HTTP kernel
│       ├── Request.php     # Request wrapper
│       └── Response.php    # Response wrapper
├── bootstrap/              # Bootstrap files
│   └── app.php            # Application bootstrap
├── public/                 # Public directory
│   ├── index.php          # Traditional web server entry
│   └── .htaccess          # Apache configuration
├── worker.php             # RoadRunner worker entry
├── .rr.yaml               # RoadRunner configuration
├── .env.example           # Environment variables example
└── composer.json          # Dependencies

```

🔧 Cấu hình
----------

[](#-cấu-hình)

### RoadRunner Configuration (`.rr.yaml`)

[](#roadrunner-configuration-rryaml)

File `.rr.yaml` chứa cấu hình cho RoadRunner:

- HTTP server settings
- Worker pool configuration
- Hot reload settings
- Metrics endpoint

### Environment Variables (`.env`)

[](#environment-variables-env)

Cấu hình ứng dụng thông qua file `.env`:

- App settings
- RoadRunner settings
- Database configuration
- Cache &amp; session settings

🌐 API Endpoints
---------------

[](#-api-endpoints)

- `GET /` - Home page với thông tin hệ thống
- `GET /health` - Health check endpoint
- `GET /info` - Detailed system information

🔍 Environment Detection
-----------------------

[](#-environment-detection)

Framework tự động detect môi trường đang chạy:

```
if ($app->isRoadRunner()) {
    // RoadRunner specific code
} else {
    // Traditional web server code
}
```

⚡ Performance Tips
------------------

[](#-performance-tips)

### RoadRunner Mode

[](#roadrunner-mode)

- Worker pool tái sử dụng PHP processes
- Không cần khởi tạo lại framework mỗi request
- Tốc độ nhanh hơn 5-10 lần so với PHP-FPM

### Traditional Mode

[](#traditional-mode)

- Phù hợp cho shared hosting
- Dễ dàng debug
- Không cần cài đặt thêm

📊 Metrics
---------

[](#-metrics)

Khi chạy RoadRunner, metrics có sẵn tại:

```
http://localhost:2112/metrics

```

🛠️ Development
--------------

[](#️-development)

### Hot Reload

[](#hot-reload)

RoadRunner tự động reload khi file `.php` thay đổi trong thư mục `app/` và `public/`:

```
reload:
  interval: 1s
  patterns: [".php"]
  services:
    http:
      dirs: ["app", "public"]
```

### Debug Mode

[](#debug-mode)

Set `APP_DEBUG=true` trong `.env` để enable debug mode.

📝 License
---------

[](#-license)

MIT License

👨‍💻 Author
----------

[](#‍-author)

Puleeno Nguyen

###  Health Score

19

—

LowBetter than 9% of packages

Maintenance49

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/6a609a3b3a36dee9f36ef6f8d3b2b2dc91eebefc7644031e829e65bca4329799?d=identicon)[puleeno](/maintainers/puleeno)

---

Top Contributors

[![puleeno](https://avatars.githubusercontent.com/u/22538657?v=4)](https://github.com/puleeno "puleeno (27 commits)")

### Embed Badge

![Health badge](/badges/witals-app/health.svg)

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

PHPackages © 2026

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