Skip to content

aigmlab/tinyphp-framework-1.0

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyPHP Framework 1.0

中文

简介

一款经过生产环境检验(日 PV 十亿级)的轻量级 PHP 框架,v1.0.1 版本,高性能毫秒级响应。

# 支持 Web 和 Console 两种模式,单文件入口,自动识别 Web / CLI 环境
php index.php

支持 Console 环境下的 Daemon 守护进程模式(主要适用于 Linux CentOS 7):

# 实现经典的 Master-Worker 模式
php index.php --id=tinyphp-daemon --daemon=start

# 可扩展为 TCP 服务端程序、定时器、IO 异步事件驱动等,365x24 稳定运行

支持一键打包成单文件可执行程序:

# 编译
php index.php --build

# 运行生成的 phar 单文件程序
php tinyphp-demo.phar

框架安装

git clone https://github.com/aigmlab/tinyphp.git
cd tinyphp

# 兼容 Composer 安装
composer install aigm/tinyphp-framework-1.0 @dev

# 直接 Git 下载
mkdir lib/ && cd lib
git clone https://github.com/aigmlab/tinyphp.git

# 运行
php index.php

# 编译
php index.php --build

# 开启守护进程
php index.php -d

# 编辑配置文件
vi application/config/profile.php

一键搭建 LNMP 运行环境

lnmp-utils

Linux (CentOS 7 X64) + OpenResty (Nginx) + MySQL + PHP + Redis 一键安装包。

项目地址: https://github.com/aigmlab/lnmp-utils

CentOS 7 X86_64 (生产环境)

git clone https://github.com/aigmlab/lnmp-utils.git
cd ./lnmp-utils
./install.sh -m lnmp
curl http://127.0.0.1

框架开发规范

一、PHP 编码规范

二、SQL 使用规范

三、框架使用手册


English

Overview

A production-tested (1+ billion daily PV), lightweight PHP framework — v1.0.1, high-performance with millisecond response times.

# Supports both Web and Console modes via a single entry point
php index.php

Daemon mode for Console environments (primarily Linux CentOS 7):

# Classic Master-Worker pattern
php index.php --id=tinyphp-daemon --daemon=start

# Extensible to TCP servers, timers, async IO event-driven modes — 365x24 stable

Single-file executable packaging:

# Build
php index.php --build

# Run the generated phar executable
php tinyphp-demo.phar

Installation

git clone https://github.com/aigmlab/tinyphp.git
cd tinyphp

# Composer install
composer install aigm/tinyphp-framework-1.0 @dev

# Or direct Git clone
mkdir lib/ && cd lib
git clone https://github.com/aigmlab/tinyphp.git

# Run
php index.php

# Build
php index.php --build

# Start daemon
php index.php -d

# Edit config
vi application/config/profile.php

LNMP Environment Setup

lnmp-utils

Linux (CentOS 7 X64) + OpenResty (Nginx) + MySQL + PHP + Redis one-click installer.

Repository: https://github.com/aigmlab/lnmp-utils

CentOS 7 X86_64 (Production)

git clone https://github.com/aigmlab/lnmp-utils.git
cd ./lnmp-utils
./install.sh -m lnmp
curl http://127.0.0.1

Coding Standards

The framework includes comprehensive documentation covering:

  • PHP coding standards (file structure, formatting, naming, expressions, constants, function design)
  • SQL usage guidelines (query standards, table/database conventions, design and optimization principles)
  • Framework manual and getting-started guide

See the 中文 section above for the complete document index.

About

一款经过生产环境检验(日PV10亿级)的轻量级PHP框架,此为1.0高性能版本,毫秒级响应。

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors